'use strict';

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

var vue = require('vue');
require('../../../../../../utils/index.js');
require('../../../../base/select/index.js');
var useWatchModelChange = require('../../composables/useWatchModelChange.js');
var searchFormSelect = require('./searchFormSelect.js');
var event = require('../../../../../../utils/src/elementPlus/event.js');
var select = require('../../../../base/select/select.js');

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

exports.default = _sfc_main;
//# sourceMappingURL=SearchFormSelect.vue2.js.map
