"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const comp = require("../../ui/src/comp.js");
const util = require("./util.js");
const VxeOptionComponent = comp.defineVxeComponent({
  name: "VxeOption",
  props: {
    value: [String, Number, Boolean],
    label: {
      type: [String, Number, Boolean],
      default: ""
    },
    visible: {
      type: Boolean,
      default: null
    },
    className: [String, Function],
    disabled: Boolean
  },
  emits: [],
  setup(props, { slots }) {
    const elem = vue.ref();
    const $xeSelect = vue.inject("$xeSelect", {});
    const $xeOptgroup = vue.inject("$xeOptgroup", null);
    const optionConfig = util.createOption($xeSelect, props);
    optionConfig.slots = slots;
    util.watchOption(props, optionConfig);
    vue.onMounted(() => {
      const el = elem.value;
      util.assembleOption($xeSelect, el, optionConfig, $xeOptgroup);
    });
    vue.onUnmounted(() => {
      util.destroyOption($xeSelect, optionConfig);
    });
    return () => {
      return vue.h("div", {
        ref: elem
      });
    };
  }
});
exports.default = VxeOptionComponent;
