import { defineComponent, useAttrs, ref, computed, resolveComponent, createBlock, openBlock, mergeProps, unref, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
import '../../../utils/index.mjs';
import { selectProps } from './select.mjs';
import { createNamespace } from '../../../utils/create-namespace.mjs';

"use strict";
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{ name: "LlSelect" },
  __name: "select",
  props: selectProps,
  setup(__props, { expose: __expose }) {
    const bem = createNamespace("select");
    const props = __props;
    const attrs = useAttrs();
    const selectRef = ref();
    const getMaxTagCount = computed(() => {
      return typeof props.maxTagCount === "number" ? props.maxTagCount <= 0 ? null : props.maxTagCount : null;
    });
    const getMaxTagTextLength = computed(() => {
      return typeof props.maxTagTextLength === "number" ? props.maxTagTextLength <= 0 ? null : props.maxTagTextLength : null;
    });
    const focus = () => {
      selectRef.value.focus();
    };
    const blur = () => {
      selectRef.value.blur();
    };
    __expose({
      focus,
      blur
    });
    return (_ctx, _cache) => {
      const _component_a_select = resolveComponent("a-select");
      return openBlock(), createBlock(_component_a_select, mergeProps(unref(attrs), {
        ref_key: "selectRef",
        ref: selectRef,
        "max-tag-count": getMaxTagCount.value,
        "max-tag-text-length": getMaxTagTextLength.value,
        class: [unref(bem).b(), unref(bem).is(_ctx.isGray ? "gray-select" : "")]
      }), createSlots({
        _: 2
        /* DYNAMIC */
      }, [
        renderList(Object.keys(_ctx.$slots), (item) => {
          return {
            name: item,
            fn: withCtx((data) => [
              renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
            ])
          };
        })
      ]), 1040, ["max-tag-count", "max-tag-text-length", "class"]);
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=select.vue2.mjs.map
