"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 VxeOptgroupComponent = comp.defineVxeComponent({
  name: "VxeOptgroup",
  props: {
    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 optionConfig = util.createOption($xeSelect, props);
    const $xeOptgroup = { optionConfig };
    optionConfig.options = [];
    vue.provide("$xeOptgroup", $xeOptgroup);
    util.watchOption(props, optionConfig);
    vue.onMounted(() => {
      const el = elem.value;
      util.assembleOption($xeSelect, el, optionConfig);
    });
    vue.onUnmounted(() => {
      util.destroyOption($xeSelect, optionConfig);
    });
    return () => {
      const defaultSlot = slots.default;
      return vue.h("div", {
        ref: elem
      }, defaultSlot ? defaultSlot({}) : []);
    };
  }
});
exports.default = VxeOptgroupComponent;
