/**
 * ldesign v0.2.3
 * (c) 2022年9月24日 swimly
 * @license MIT
 */

import { defineComponent, toRefs, ref, inject, computed } from '@vue/composition-api';
import { SelectOptionGroupProps } from './props.js';
import { useLNodeJSX } from '../../hooks/lnode.js';
import { usePrefixClass, useConfig } from '../config-provider/useConfig.js';
import useCommonClassName from '../../hooks/use-common-classname.js';
import 'lodash/isEmpty';
import 'lodash/isFunction';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../hooks/render-lnode.js';
import 'lodash/isString';
import 'lodash/isObject';
import '../config-provider/context.js';
import 'lodash';
import '../../chunks/zh_CN.js';
import '../config-provider/type.js';

var _OptionGroup = defineComponent({
  name: "LOptionGroup",
  props: { ...SelectOptionGroupProps
  },

  setup(props2) {
    const {
      divider
    } = toRefs(props2);
    const ulRef = ref(null);
    const tSelect = inject("tSelect");
    const {
      sizeClassNames
    } = useCommonClassName();
    const COMPONENT_NAME = usePrefixClass("select");
    const {
      classPrefix
    } = useConfig("classPrefix");
    const classes = computed(() => [`${COMPONENT_NAME.value}-option-group`, {
      [sizeClassNames[tSelect.size]]: tSelect && tSelect.size,
      [`${COMPONENT_NAME.value}-option-group__divider`]: divider
    }]);
    return {
      classes,
      ulRef,
      classPrefix,
      componentName: COMPONENT_NAME
    };
  },

  render() {
    const h = arguments[0];
    const renderTNode = useLNodeJSX();
    const children = renderTNode("default");
    return h("li", {
      "class": this.classes
    }, [h("div", {
      "class": `${this.componentName}-option-group__header`
    }, [this.label]), h("ul", {
      "class": `${this.classPrefix}-select__list`,
      "ref": "ulRef"
    }, [children])]);
  }

});

export { _OptionGroup as default };
//# sourceMappingURL=option-group.js.map
