/**
 * ldesign v0.4.6
 * (c) 2023 ldesign
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var VueCompositionAPI = require('@vue/composition-api');
var hooks_tnode = require('../hooks/tnode.js');
var configProvider_useConfig = require('../config-provider/useConfig.js');
var hooks_useCommonClassName = require('../hooks/useCommonClassName.js');
var select_optionGroupProps = require('./option-group-props.js');
require('lodash/isEmpty');
require('lodash/isFunction');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../hooks/render-tnode.js');
require('lodash/isString');
require('lodash/isObject');
require('../config-provider/context.js');
require('lodash/merge');
require('lodash/mergeWith');
require('../_common/js/global-config/default-config.js');
require('../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('../_chunks/dep-7c884501.js');
require('dayjs');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var _OptionGroup = VueCompositionAPI.defineComponent({
  name: "TOptionGroup",
  props: _objectSpread({}, select_optionGroupProps["default"]),
  setup: function setup(props2) {
    var _toRefs = VueCompositionAPI.toRefs(props2),
      divider = _toRefs.divider;
    var tSelect = VueCompositionAPI.inject("tSelect");
    var _useCommonClassName = hooks_useCommonClassName["default"](),
      sizeClassNames = _useCommonClassName.sizeClassNames;
    var COMPONENT_NAME = configProvider_useConfig.usePrefixClass("select");
    var _useConfig = configProvider_useConfig.useConfig("classPrefix"),
      classPrefix = _useConfig.classPrefix;
    var classes = VueCompositionAPI.computed(function () {
      var _ref;
      return ["".concat(COMPONENT_NAME.value, "-option-group"), (_ref = {}, _defineProperty__default["default"](_ref, sizeClassNames[tSelect.size], tSelect && tSelect.size), _defineProperty__default["default"](_ref, "".concat(COMPONENT_NAME.value, "-option-group__divider"), divider), _ref)];
    });
    return {
      classes: classes,
      classPrefix: classPrefix,
      componentName: COMPONENT_NAME
    };
  },
  render: function render() {
    var h = arguments[0];
    var renderTNode = hooks_tnode.useTNodeJSX();
    var children = renderTNode("default");
    return h("li", {
      "class": this.classes
    }, [h("div", {
      "class": "".concat(this.componentName, "-option-group__header")
    }, [this.label]), children]);
  }
});

exports["default"] = _OptionGroup;
//# sourceMappingURL=optionGroup.js.map
