import { defineComponent, useModel, resolveComponent, createBlock, openBlock, withCtx, createVNode, mergeProps, toHandlers, unref, mergeModels } from 'vue';
import '../../../../../../utils/index.mjs';
import '../../../../base/select/index.mjs';
import { useWatchModelChange } from '../../composables/useWatchModelChange.mjs';
import { searchFormSelectEmits, searchFormSelectProps, SearchFormSelectName } from './searchFormSelect.mjs';
import { getGmEvent } from '../../../../../../utils/src/elementPlus/event.mjs';
import { selectEmits } from '../../../../base/select/select.mjs';

var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: SearchFormSelectName
  },
  __name: "SearchFormSelect",
  props: /* @__PURE__ */ mergeModels(searchFormSelectProps, {
    "modelValue": {},
    "modelModifiers": {}
  }),
  emits: /* @__PURE__ */ mergeModels(searchFormSelectEmits, ["update:modelValue"]),
  setup(__props, { emit: __emit }) {
    const props = __props;
    const modelValue = useModel(__props, "modelValue");
    const emit = __emit;
    const selectEvents = getGmEvent(selectEmits, emit);
    useWatchModelChange(modelValue, { prop: props.prop, noDefaultSync: props.noDefaultSync });
    return (_ctx, _cache) => {
      const _component_gm_select_options = resolveComponent("gm-select-options");
      const _component_gm_form_item = resolveComponent("gm-form-item");
      return openBlock(), createBlock(_component_gm_form_item, {
        prop: _ctx.prop,
        class: ""
      }, {
        default: withCtx(() => [
          createVNode(_component_gm_select_options, mergeProps({
            modelValue: modelValue.value,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
            filterable: "",
            "collapse-tags": "",
            "collapse-tags-tooltip": "",
            clearable: _ctx.clearable,
            placeholder: _ctx.label,
            multiple: _ctx.multiple,
            disabled: _ctx.disabled,
            options: _ctx.options,
            labelKey: _ctx.labelKey,
            loading: _ctx.loading,
            optionLabel: _ctx.optionLabel,
            optionValue: _ctx.optionValue,
            class: "gm-w-full"
          }, toHandlers(unref(selectEvents))), null, 16, ["modelValue", "clearable", "placeholder", "multiple", "disabled", "options", "labelKey", "loading", "optionLabel", "optionValue"])
        ]),
        _: 1
        /* STABLE */
      }, 8, ["prop"]);
    };
  }
});

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