import { defineComponent, useSlots, ref, computed, resolveComponent, createBlock, openBlock, mergeProps, toHandlers, unref, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
import '../../../../utils/index.mjs';
import { elDatePickerEmits, datePickerEmits, datePickerProps } from './datePicker.mjs';
import { getGmEvent } from '../../../../utils/src/elementPlus/event.mjs';
import { getGmExports } from '../../../../utils/src/elementPlus/exports.mjs';
import { getDateShortcuts } from '../../../../utils/src/date/dateShortcuts.mjs';

var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{
    name: "GmDatePicker"
  },
  __name: "DatePicker",
  props: datePickerProps,
  emits: datePickerEmits,
  setup(__props, { expose: __expose, emit: __emit }) {
    const slots = useSlots();
    const props = __props;
    const emit = __emit;
    const elEvents = getGmEvent(elDatePickerEmits, emit);
    const elRef = ref();
    const exposeEvents = ["focus", "handleOpen", "handleClose"];
    const { exposeFns } = getGmExports(elRef, exposeEvents);
    const shortcutList = computed(() => Array.isArray(props.shortcuts) ? props.shortcuts : getDateShortcuts(props.type));
    __expose({
      elRef,
      ...exposeFns
    });
    return (_ctx, _cache) => {
      const _component_el_date_picker = resolveComponent("el-date-picker");
      return openBlock(), createBlock(_component_el_date_picker, mergeProps({
        ref_key: "elRef",
        ref: elRef
      }, props, { shortcuts: shortcutList.value }, toHandlers(unref(elEvents))), createSlots({
        _: 2
        /* DYNAMIC */
      }, [
        unref(slots).default ? {
          name: "default",
          fn: withCtx((slotValue) => [
            renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotValue)))
          ]),
          key: "0"
        } : void 0,
        unref(slots)["range-separator"] ? {
          name: "range-separator",
          fn: withCtx((slotValue) => [
            renderSlot(_ctx.$slots, "range-separator", normalizeProps(guardReactiveProps(slotValue)))
          ]),
          key: "1"
        } : void 0
      ]), 1040, ["shortcuts"]);
    };
  }
});

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