You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 lines
68 KiB

{"ast":null,"code":"import { defineComponent, useAttrs, useSlots, inject, toRef, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, Fragment, renderList, toDisplayString, createCommentVNode, createVNode, withDirectives, withCtx, vShow, withKeys, createBlock, createTextVNode, nextTick } from 'vue';\nimport dayjs from 'dayjs';\nimport { ElButton } from '../../../button/index.mjs';\nimport { ElInput } from '../../../input/index.mjs';\nimport '../../../time-picker/index.mjs';\nimport { ElIcon } from '../../../icon/index.mjs';\nimport { DArrowLeft, ArrowLeft, ArrowRight, DArrowRight } from '@element-plus/icons-vue';\nimport { panelDatePickProps } from '../props/panel-date-pick.mjs';\nimport { getValidDateOfMonth, getValidDateOfYear } from '../utils.mjs';\nimport DateTable from './basic-date-table.mjs';\nimport MonthTable from './basic-month-table.mjs';\nimport YearTable from './basic-year-table.mjs';\nimport _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';\nimport { TOOLTIP_INJECTION_KEY } from '../../../tooltip/src/constants.mjs';\nimport { extractTimeFormat, extractDateFormat } from '../../../time-picker/src/utils.mjs';\nimport TimePickPanel from '../../../time-picker/src/time-picker-com/panel-time-pick.mjs';\nimport ClickOutside from '../../../../directives/click-outside/index.mjs';\nimport { useNamespace } from '../../../../hooks/use-namespace/index.mjs';\nimport { useLocale } from '../../../../hooks/use-locale/index.mjs';\nimport { isArray, isFunction } from '@vue/shared';\nimport { EVENT_CODE } from '../../../../constants/aria.mjs';\nconst _sfc_main = /* @__PURE__ */defineComponent({\n __name: \"panel-date-pick\",\n props: panelDatePickProps,\n emits: [\"pick\", \"set-picker-option\", \"panel-change\"],\n setup(__props, {\n emit: contextEmit\n }) {\n const props = __props;\n const timeWithinRange = (_, __, ___) => true;\n const ppNs = useNamespace(\"picker-panel\");\n const dpNs = useNamespace(\"date-picker\");\n const attrs = useAttrs();\n const slots = useSlots();\n const {\n t,\n lang\n } = useLocale();\n const pickerBase = inject(\"EP_PICKER_BASE\");\n const popper = inject(TOOLTIP_INJECTION_KEY);\n const {\n shortcuts,\n disabledDate,\n cellClassName,\n defaultTime\n } = pickerBase.props;\n const defaultValue = toRef(pickerBase.props, \"defaultValue\");\n const currentViewRef = ref();\n const innerDate = ref(dayjs().locale(lang.value));\n const isChangeToNow = ref(false);\n let isShortcut = false;\n const defaultTimeD = computed(() => {\n return dayjs(defaultTime).locale(lang.value);\n });\n const month = computed(() => {\n return innerDate.value.month();\n });\n const year = computed(() => {\n return innerDate.value.year();\n });\n const selectableRange = ref([]);\n const userInputDate = ref(null);\n const userInputTime = ref(null);\n const checkDateWithinRange = date => {\n return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props.format || \"HH:mm:ss\") : true;\n };\n const formatEmit = emitDayjs => {\n if (defaultTime && !visibleTime.value && !isChangeToNow.value && !isShortcut) {\n return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());\n }\n if (showTime.value) return emitDayjs.millisecond(0);\n return emitDayjs.startOf(\"day\");\n };\n const emit = (value, ...args) => {\n if (!value) {\n contextEmit(\"pick\", value, ...args);\n } else if (isArray(value)) {\n const dates = value.map(formatEmit);\n contextEmit(\"pick\", dates, ...args);\n } else {\n contextEmit(\"pick\", formatEmit(value), ...args);\n }\n userInputDate.value = null;\n userInputTime.value = null;\n isChangeToNow.value = false;\n isShortcut = false;\n };\n const handleDatePick = async (value, keepOpen) => {\n if (selectionMode.value === \"date\") {\n value = value;\n let newDate = props.parsedValue ? props.parsedValue.year(value.year()).month(value.month()).date(value.date()) : value;\n if (!checkDateWithinRange(newDate)) {\n newDate = selectableRange.value[0][0].year(value.year()).month(value.month()).date(value.date());\n }\n innerDate.value = newDate;\n emit(newDate, showTime.value || keepOpen);\n if (props.type === \"datetime\") {\n await nextTick();\n handleFocusPicker();\n }\n } else if (selectionMode.value === \"week\") {\n emit(value.date);\n } else if (selectionMode.value === \"dates\") {\n emit(value, true);\n }\n };\n const moveByMonth = forward => {\n const action = forward ? \"add\" : \"subtract\";\n innerDate.value = innerDate.value[action](1, \"month\");\n handlePanelChange(\"month\");\n };\n const moveByYear = forward => {\n const currentDate = innerDate.value;\n const action = forward ? \"add\" : \"subtract\";\n innerDate.value = currentView.value === \"year\" ? currentDate[action](10, \"year\") : currentDate[action](1, \"year\");\n handlePanelChange(\"year\");\n };\n const currentView = ref(\"date\");\n const yearLabel = computed(() => {\n const yearTranslation = t(\"el.datepicker.year\");\n if (currentView.value === \"year\") {\n const startYear = Math.floor(year.value / 10) * 10;\n if (yearTranslation) {\n return `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}`;\n }\n return `${startYear} - ${startYear + 9}`;\n }\n return `${year.value} ${yearTranslation}`;\n });\n const handleShortcutClick = shortcut => {\n const shortcutValue = isFunction(shortcut.value) ? shortcut.value() : shortcut.value;\n if (shortcutValue) {\n isShortcut = true;\n emit(dayjs(shortcutValue).locale(lang.value));\n return;\n }\n if (shortcut.onClick) {\n shortcut.onClick({\n attrs,\n slots,\n emit: contextEmit\n });\n }\n };\n const selectionMode = computed(() => {\n const {\n type\n } = props;\n if ([\"week\", \"month\", \"months\", \"year\", \"years\", \"dates\"].includes(type)) return type;\n return \"date\";\n });\n const isMultipleType = computed(() => {\n return selectionMode.value === \"dates\" || selectionMode.value === \"months\" || selectionMode.value === \"years\";\n });\n const keyboardMode = computed(() => {\n return selectionMode.value === \"date\" ? currentView.value : selectionMode.value;\n });\n const hasShortcuts = computed(() => !!shortcuts.length);\n const handleMonthPick = async (month2, keepOpen) => {\n if (selectionMode.value === \"month\") {\n innerDate.value = getValidDateOfMonth(innerDate.value.year(), month2, lang.value, disabledDate);\n emit(innerDate.value, false);\n } else if (selectionMode.value === \"months\") {\n emit(month2, keepOpen != null ? keepOpen : true);\n } else {\n innerDate.value = getValidDateOfMonth(innerDate.value.year(), month2, lang.value, disabledDate);\n currentView.value = \"date\";\n if ([\"month\", \"year\", \"date\", \"week\"].includes(selectionMode.value)) {\n emit(innerDate.value, true);\n await nextTick();\n handleFocusPicker();\n }\n }\n handlePanelChange(\"month\");\n };\n const handleYearPick = async (year2, keepOpen) => {\n if (selectionMode.value === \"year\") {\n const data = innerDate.value.startOf(\"year\").year(year2);\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate);\n emit(innerDate.value, false);\n } else if (selectionMode.value === \"years\") {\n emit(year2, keepOpen != null ? keepOpen : true);\n } else {\n const data = innerDate.value.year(year2);\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate);\n currentView.value = \"month\";\n if ([\"month\", \"year\", \"date\", \"week\"].includes(selectionMode.value)) {\n emit(innerDate.value, true);\n await nextTick();\n handleFocusPicker();\n }\n }\n handlePanelChange(\"year\");\n };\n const showPicker = async view => {\n currentView.value = view;\n await nextTick();\n handleFocusPicker();\n };\n const showTime = computed(() => props.type === \"datetime\" || props.type === \"datetimerange\");\n const footerVisible = computed(() => {\n const showDateFooter = showTime.value || selectionMode.value === \"dates\";\n const showYearFooter = selectionMode.value === \"years\";\n const showMonthFooter = selectionMode.value === \"months\";\n const isDateView = currentView.value === \"date\";\n const isYearView = currentView.value === \"year\";\n const isMonthView = currentView.value === \"month\";\n return showDateFooter && isDateView || showYearFooter && isYearView || showMonthFooter && isMonthView;\n });\n const disabledConfirm = computed(() => {\n if (!disabledDate) return false;\n if (!props.parsedValue) return true;\n if (isArray(props.parsedValue)) {\n return disabledDate(props.parsedValue[0].toDate());\n }\n return disabledDate(props.parsedValue.toDate());\n });\n const onConfirm = () => {\n if (isMultipleType.value) {\n emit(props.parsedValue);\n } else {\n let result = props.parsedValue;\n if (!result) {\n const defaultTimeD2 = dayjs(defaultTime).locale(lang.value);\n const defaultValueD = getDefaultValue();\n result = defaultTimeD2.year(defaultValueD.year()).month(defaultValueD.month()).date(defaultValueD.date());\n }\n innerDate.value = result;\n emit(result);\n }\n };\n const disabledNow = computed(() => {\n if (!disabledDate) return false;\n return disabledDate(dayjs().locale(lang.value).toDate());\n });\n const changeToNow = () => {\n const now = dayjs().locale(lang.value);\n const nowDate = now.toDate();\n isChangeToNow.value = true;\n if ((!disabledDate || !disabledDate(nowDate)) && checkDateWithinRange(nowDate)) {\n innerDate.value = dayjs().locale(lang.value);\n emit(innerDate.value);\n }\n };\n const timeFormat = computed(() => {\n return props.timeFormat || extractTimeFormat(props.format);\n });\n const dateFormat = computed(() => {\n return props.dateFormat || extractDateFormat(props.format);\n });\n const visibleTime = computed(() => {\n if (userInputTime.value) return userInputTime.value;\n if (!props.parsedValue && !defaultValue.value) return;\n return (props.parsedValue || innerDate.value).format(timeFormat.value);\n });\n const visibleDate = computed(() => {\n if (userInputDate.value) return userInputDate.value;\n if (!props.parsedValue && !defaultValue.value) return;\n return (props.parsedValue || innerDate.value).format(dateFormat.value);\n });\n const timePickerVisible = ref(false);\n const onTimePickerInputFocus = () => {\n timePickerVisible.value = true;\n };\n const handleTimePickClose = () => {\n timePickerVisible.value = false;\n };\n const getUnits = date => {\n return {\n hour: date.hour(),\n minute: date.minute(),\n second: date.second(),\n year: date.year(),\n month: date.month(),\n date: date.date()\n };\n };\n const handleTimePick = (value, visible, first) => {\n const {\n hour,\n minute,\n second\n } = getUnits(value);\n const newDate = props.parsedValue ? props.parsedValue.hour(hour).minute(minute).second(second) : value;\n innerDate.value = newDate;\n emit(innerDate.value, true);\n if (!first) {\n timePickerVisible.value = visible;\n }\n };\n const handleVisibleTimeChange = value => {\n const newDate = dayjs(value, timeFormat.value).locale(lang.value);\n if (newDate.isValid() && checkDateWithinRange(newDate)) {\n const {\n year: year2,\n month: month2,\n date\n } = getUnits(innerDate.value);\n innerDate.value = newDate.year(year2).month(month2).date(date);\n userInputTime.value = null;\n timePickerVisible.value = false;\n emit(innerDate.value, true);\n }\n };\n const handleVisibleDateChange = value => {\n const newDate = dayjs(value, dateFormat.value).locale(lang.value);\n if (newDate.isValid()) {\n if (disabledDate && disabledDate(newDate.toDate())) {\n return;\n }\n const {\n hour,\n minute,\n second\n } = getUnits(innerDate.value);\n innerDate.value = newDate.hour(hour).minute(minute).second(second);\n userInputDate.value = null;\n emit(innerDate.value, true);\n }\n };\n const isValidValue = date => {\n return dayjs.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true);\n };\n const formatToString = value => {\n return isArray(value) ? value.map(_ => _.format(props.format)) : value.format(props.format);\n };\n const parseUserInput = value => {\n return dayjs(value, props.format).locale(lang.value);\n };\n const getDefaultValue = () => {\n const parseDate = dayjs(defaultValue.value).locale(lang.value);\n if (!defaultValue.value) {\n const defaultTimeDValue = defaultTimeD.value;\n return dayjs().hour(defaultTimeDValue.hour()).minute(defaultTimeDValue.minute()).second(defaultTimeDValue.second()).locale(lang.value);\n }\n return parseDate;\n };\n const handleFocusPicker = () => {\n var _a;\n if ([\"week\", \"month\", \"year\", \"date\"].includes(selectionMode.value)) {\n (_a = currentViewRef.value) == null ? void 0 : _a.focus();\n }\n };\n const _handleFocusPicker = () => {\n handleFocusPicker();\n if (selectionMode.value === \"week\") {\n handleKeyControl(EVENT_CODE.down);\n }\n };\n const handleKeydownTable = event => {\n const {\n code\n } = event;\n const validCode = [EVENT_CODE.up, EVENT_CODE.down, EVENT_CODE.left, EVENT_CODE.right, EVENT_CODE.home, EVENT_CODE.end, EVENT_CODE.pageUp, EVENT_CODE.pageDown];\n if (validCode.includes(code)) {\n handleKeyControl(code);\n event.stopPropagation();\n event.preventDefault();\n }\n if ([EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(code) && userInputDate.value === null && userInputTime.value === null) {\n event.preventDefault();\n emit(innerDate.value, false);\n }\n };\n const handleKeyControl = code => {\n var _a;\n const {\n up,\n down,\n left,\n right,\n home,\n end,\n pageUp,\n pageDown\n } = EVENT_CODE;\n const mapping = {\n year: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date, step) => date.setFullYear(date.getFullYear() + step)\n },\n month: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date, step) => date.setMonth(date.getMonth() + step)\n },\n week: {\n [up]: -1,\n [down]: 1,\n [left]: -1,\n [right]: 1,\n offset: (date, step) => date.setDate(date.getDate() + step * 7)\n },\n date: {\n [up]: -7,\n [down]: 7,\n [left]: -1,\n [right]: 1,\n [home]: date => -date.getDay(),\n [end]: date => -date.getDay() + 6,\n [pageUp]: date => -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),\n [pageDown]: date => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),\n offset: (date, step) => date.setDate(date.getDate() + step)\n }\n };\n const newDate = innerDate.value.toDate();\n while (Math.abs(innerDate.value.diff(newDate, \"year\", true)) < 1) {\n const map = mapping[keyboardMode.value];\n if (!map) return;\n map.offset(newDate, isFunction(map[code]) ? map[code](newDate) : (_a = map[code]) != null ? _a : 0);\n if (disabledDate && disabledDate(newDate)) {\n break;\n }\n const result = dayjs(newDate).locale(lang.value);\n innerDate.value = result;\n contextEmit(\"pick\", result, true);\n break;\n }\n };\n const handlePanelChange = mode => {\n contextEmit(\"panel-change\", innerDate.value.toDate(), mode, currentView.value);\n };\n watch(() => selectionMode.value, val => {\n if ([\"month\", \"year\"].includes(val)) {\n currentView.value = val;\n return;\n } else if (val === \"years\") {\n currentView.value = \"year\";\n return;\n } else if (val === \"months\") {\n currentView.value = \"month\";\n return;\n }\n currentView.value = \"date\";\n }, {\n immediate: true\n });\n watch(() => currentView.value, () => {\n popper == null ? void 0 : popper.updatePopper();\n });\n watch(() => defaultValue.value, val => {\n if (val) {\n innerDate.value = getDefaultValue();\n }\n }, {\n immediate: true\n });\n watch(() => props.parsedValue, val => {\n if (val) {\n if (isMultipleType.value) return;\n if (isArray(val)) return;\n innerDate.value = val;\n } else {\n innerDate.value = getDefaultValue();\n }\n }, {\n immediate: true\n });\n contextEmit(\"set-picker-option\", [\"isValidValue\", isValidValue]);\n contextEmit(\"set-picker-option\", [\"formatToString\", formatToString]);\n contextEmit(\"set-picker-option\", [\"parseUserInput\", parseUserInput]);\n contextEmit(\"set-picker-option\", [\"handleFocusPicker\", _handleFocusPicker]);\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass([unref(ppNs).b(), unref(dpNs).b(), {\n \"has-sidebar\": _ctx.$slots.sidebar || unref(hasShortcuts),\n \"has-time\": unref(showTime)\n }])\n }, [createElementVNode(\"div\", {\n class: normalizeClass(unref(ppNs).e(\"body-wrapper\"))\n }, [renderSlot(_ctx.$slots, \"sidebar\", {\n class: normalizeClass(unref(ppNs).e(\"sidebar\"))\n }), unref(hasShortcuts) ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n class: normalizeClass(unref(ppNs).e(\"sidebar\"))\n }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {\n return openBlock(), createElementBlock(\"button\", {\n key,\n type: \"button\",\n class: normalizeClass(unref(ppNs).e(\"shortcut\")),\n onClick: $event => handleShortcutClick(shortcut)\n }, toDisplayString(shortcut.text), 11, [\"onClick\"]);\n }), 128))], 2)) : createCommentVNode(\"v-if\", true), createElementVNode(\"div\", {\n class: normalizeClass(unref(ppNs).e(\"body\"))\n }, [unref(showTime) ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n class: normalizeClass(unref(dpNs).e(\"time-header\"))\n }, [createElementVNode(\"span\", {\n class: normalizeClass(unref(dpNs).e(\"editor-wrap\"))\n }, [createVNode(unref(ElInput), {\n placeholder: unref(t)(\"el.datepicker.selectDate\"),\n \"model-value\": unref(visibleDate),\n size: \"small\",\n \"validate-event\": false,\n onInput: val => userInputDate.value = val,\n onChange: handleVisibleDateChange\n }, null, 8, [\"placeholder\", \"model-value\", \"onInput\"])], 2), withDirectives((openBlock(), createElementBlock(\"span\", {\n class: normalizeClass(unref(dpNs).e(\"editor-wrap\"))\n }, [createVNode(unref(ElInput), {\n placeholder: unref(t)(\"el.datepicker.selectTime\"),\n \"model-value\": unref(visibleTime),\n size: \"small\",\n \"validate-event\": false,\n onFocus: onTimePickerInputFocus,\n onInput: val => userInputTime.value = val,\n onChange: handleVisibleTimeChange\n }, null, 8, [\"placeholder\", \"model-value\", \"onInput\"]), createVNode(unref(TimePickPanel), {\n visible: timePickerVisible.value,\n format: unref(timeFormat),\n \"parsed-value\": innerDate.value,\n onPick: handleTimePick\n }, null, 8, [\"visible\", \"format\", \"parsed-value\"])], 2)), [[unref(ClickOutside), handleTimePickClose]])], 2)) : createCommentVNode(\"v-if\", true), withDirectives(createElementVNode(\"div\", {\n class: normalizeClass([unref(dpNs).e(\"header\"), (currentView.value === \"year\" || currentView.value === \"month\") && unref(dpNs).e(\"header--bordered\")])\n }, [createElementVNode(\"span\", {\n class: normalizeClass(unref(dpNs).e(\"prev-btn\"))\n }, [createElementVNode(\"button\", {\n type: \"button\",\n \"aria-label\": unref(t)(`el.datepicker.prevYear`),\n class: normalizeClass([\"d-arrow-left\", unref(ppNs).e(\"icon-btn\")]),\n onClick: $event => moveByYear(false)\n }, [renderSlot(_ctx.$slots, \"prev-year\", {}, () => [createVNode(unref(ElIcon), null, {\n default: withCtx(() => [createVNode(unref(DArrowLeft))]),\n _: 1\n })])], 10, [\"aria-label\", \"onClick\"]), withDirectives(createElementVNode(\"button\", {\n type: \"button\",\n \"aria-label\": unref(t)(`el.datepicker.prevMonth`),\n class: normalizeClass([unref(ppNs).e(\"icon-btn\"), \"arrow-left\"]),\n onClick: $event => moveByMonth(false)\n }, [renderSlot(_ctx.$slots, \"prev-month\", {}, () => [createVNode(unref(ElIcon), null, {\n default: withCtx(() => [createVNode(unref(ArrowLeft))]),\n _: 1\n })])], 10, [\"aria-label\", \"onClick\"]), [[vShow, currentView.value === \"date\"]])], 2), createElementVNode(\"span\", {\n role: \"button\",\n class: normalizeClass(unref(dpNs).e(\"header-label\")),\n \"aria-live\": \"polite\",\n tabindex: \"0\",\n onKeydown: withKeys($event => showPicker(\"year\"), [\"enter\"]),\n onClick: $event => showPicker(\"year\")\n }, toDisplayString(unref(yearLabel)), 43, [\"onKeydown\", \"onClick\"]), withDirectives(createElementVNode(\"span\", {\n role: \"button\",\n \"aria-live\": \"polite\",\n tabindex: \"0\",\n class: normalizeClass([unref(dpNs).e(\"header-label\"), {\n active: currentView.value === \"month\"\n }]),\n onKeydown: withKeys($event => showPicker(\"month\"), [\"enter\"]),\n onClick: $event => showPicker(\"month\")\n }, toDisplayString(unref(t)(`el.datepicker.month${unref(month) + 1}`)), 43, [\"onKeydown\", \"onClick\"]), [[vShow, currentView.value === \"date\"]]), createElementVNode(\"span\", {\n class: normalizeClass(unref(dpNs).e(\"next-btn\"))\n }, [withDirectives(createElementVNode(\"button\", {\n type: \"button\",\n \"aria-label\": unref(t)(`el.datepicker.nextMonth`),\n class: normalizeClass([unref(ppNs).e(\"icon-btn\"), \"arrow-right\"]),\n onClick: $event => moveByMonth(true)\n }, [renderSlot(_ctx.$slots, \"next-month\", {}, () => [createVNode(unref(ElIcon), null, {\n default: withCtx(() => [createVNode(unref(ArrowRight))]),\n _: 1\n })])], 10, [\"aria-label\", \"onClick\"]), [[vShow, currentView.value === \"date\"]]), createElementVNode(\"button\", {\n type: \"button\",\n \"aria-label\": unref(t)(`el.datepicker.nextYear`),\n class: normalizeClass([unref(ppNs).e(\"icon-btn\"), \"d-arrow-right\"]),\n onClick: $event => moveByYear(true)\n }, [renderSlot(_ctx.$slots, \"next-year\", {}, () => [createVNode(unref(ElIcon), null, {\n default: withCtx(() => [createVNode(unref(DArrowRight))]),\n _: 1\n })])], 10, [\"aria-label\", \"onClick\"])], 2)], 2), [[vShow, currentView.value !== \"time\"]]), createElementVNode(\"div\", {\n class: normalizeClass(unref(ppNs).e(\"content\")),\n onKeydown: handleKeydownTable\n }, [currentView.value === \"date\" ? (openBlock(), createBlock(DateTable, {\n key: 0,\n ref_key: \"currentViewRef\",\n ref: currentViewRef,\n \"selection-mode\": unref(selectionMode),\n date: innerDate.value,\n \"parsed-value\": _ctx.parsedValue,\n \"disabled-date\": unref(disabledDate),\n \"cell-class-name\": unref(cellClassName),\n onPick: handleDatePick\n }, null, 8, [\"selection-mode\", \"date\", \"parsed-value\", \"disabled-date\", \"cell-class-name\"])) : createCommentVNode(\"v-if\", true), currentView.value === \"year\" ? (openBlock(), createBlock(YearTable, {\n key: 1,\n ref_key: \"currentViewRef\",\n ref: currentViewRef,\n \"selection-mode\": unref(selectionMode),\n date: innerDate.value,\n \"disabled-date\": unref(disabledDate),\n \"parsed-value\": _ctx.parsedValue,\n onPick: handleYearPick\n }, null, 8, [\"selection-mode\", \"date\", \"disabled-date\", \"parsed-value\"])) : createCommentVNode(\"v-if\", true), currentView.value === \"month\" ? (openBlock(), createBlock(MonthTable, {\n key: 2,\n ref_key: \"currentViewRef\",\n ref: currentViewRef,\n \"selection-mode\": unref(selectionMode),\n date: innerDate.value,\n \"parsed-value\": _ctx.parsedValue,\n \"disabled-date\": unref(disabledDate),\n onPick: handleMonthPick\n }, null, 8, [\"selection-mode\", \"date\", \"parsed-value\", \"disabled-date\"])) : createCommentVNode(\"v-if\", true)], 34)], 2)], 2), withDirectives(createElementVNode(\"div\", {\n class: normalizeClass(unref(ppNs).e(\"footer\"))\n }, [withDirectives(createVNode(unref(ElButton), {\n text: \"\",\n size: \"small\",\n class: normalizeClass(unref(ppNs).e(\"link-btn\")),\n disabled: unref(disabledNow),\n onClick: changeToNow\n }, {\n default: withCtx(() => [createTextVNode(toDisplayString(unref(t)(\"el.datepicker.now\")), 1)]),\n _: 1\n }, 8, [\"class\", \"disabled\"]), [[vShow, !unref(isMultipleType) && _ctx.showNow]]), createVNode(unref(ElButton), {\n plain: \"\",\n size: \"small\",\n class: normalizeClass(unref(ppNs).e(\"link-btn\")),\n disabled: unref(disabledConfirm),\n onClick: onConfirm\n }, {\n default: withCtx(() => [createTextVNode(toDisplayString(unref(t)(\"el.datepicker.confirm\")), 1)]),\n _: 1\n }, 8, [\"class\", \"disabled\"])], 2), [[vShow, unref(footerVisible)]])], 2);\n };\n }\n});\nvar DatePickPanel = /* @__PURE__ */_export_sfc(_sfc_main, [[\"__file\", \"panel-date-pick.vue\"]]);\nexport { DatePickPanel as default };","map":{"version":3,"names":["timeWithinRange","_","__","___","ppNs","useNamespace","dpNs","attrs","useAttrs","slots","useSlots","t","lang","useLocale","pickerBase","inject","popper","TOOLTIP_INJECTION_KEY","shortcuts","disabledDate","cellClassName","defaultTime","props","defaultValue","toRef","currentViewRef","ref","innerDate","dayjs","locale","value","isChangeToNow","isShortcut","defaultTimeD","computed","month","year","selectableRange","userInputDate","userInputTime","checkDateWithinRange","date","length","format","formatEmit","emitDayjs","visibleTime","showTime","millisecond","startOf","emit","args","contextEmit","isArray","dates","map","handleDatePick","keepOpen","selectionMode","newDate","parsedValue","type","nextTick","handleFocusPicker","moveByMonth","forward","action","handlePanelChange","moveByYear","currentDate","currentView","yearLabel","yearTranslation","startYear","Math","floor","handleShortcutClick","shortcut","shortcutValue","isFunction","onClick","includes","isMultipleType","keyboardMode","hasShortcuts","handleMonthPick","month2","getValidDateOfMonth","handleYearPick","year2","data","getValidDateOfYear","showPicker","view","footerVisible","showDateFooter","showYearFooter","showMonthFooter","isDateView","isYearView","isMonthView","disabledConfirm","toDate","onConfirm","result","defaultTimeD2","defaultValueD","getDefaultValue","disabledNow","changeToNow","now","nowDate","timeFormat","extractTimeFormat","dateFormat","extractDateFormat","visibleDate","timePickerVisible","onTimePickerInputFocus","handleTimePickClose","getUnits","hour","minute","second","handleTimePick","visible","first","handleVisibleTimeChange","isValid","handleVisibleDateChange","isValidValue","isDayjs","formatToString","parseUserInput","parseDate","defaultTimeDValue","_a","focus","_handleFocusPicker","handleKeyControl","EVENT_CODE","down","handleKeydownTable","event","code","validCode","up","left","right","home","end","pageUp","pageDown","stopPropagation","preventDefault","enter","space","numpadEnter","mapping","offset","step","setFullYear","getFullYear","setMonth","getMonth","week","setDate","getDate","getDay","Date","abs","diff","mode","watch","val","immediate","updatePopper","_ctx","_cache","openBlock","createElementBlock","class","normalizeClass","unref","b","$slots","sidebar","createElementVNode","e","renderSlot","key","Fragment","renderList"],"sources":["../../../../../../../packages/components/date-picker/src/date-picker-com/panel-date-pick.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ppNs.b(),\n dpNs.b(),\n {\n 'has-sidebar': $slots.sidebar || hasShortcuts,\n 'has-time': showTime,\n },\n ]\"\n >\n <div :class=\"ppNs.e('body-wrapper')\">\n <slot name=\"sidebar\" :class=\"ppNs.e('sidebar')\" />\n <div v-if=\"hasShortcuts\" :class=\"ppNs.e('sidebar')\">\n <button\n v-for=\"(shortcut, key) in shortcuts\"\n :key=\"key\"\n type=\"button\"\n :class=\"ppNs.e('shortcut')\"\n @click=\"handleShortcutClick(shortcut)\"\n >\n {{ shortcut.text }}\n </button>\n </div>\n <div :class=\"ppNs.e('body')\">\n <div v-if=\"showTime\" :class=\"dpNs.e('time-header')\">\n <span :class=\"dpNs.e('editor-wrap')\">\n <el-input\n :placeholder=\"t('el.datepicker.selectDate')\"\n :model-value=\"visibleDate\"\n size=\"small\"\n :validate-event=\"false\"\n @input=\"(val) => (userInputDate = val)\"\n @change=\"handleVisibleDateChange\"\n />\n </span>\n <span\n v-click-outside=\"handleTimePickClose\"\n :class=\"dpNs.e('editor-wrap')\"\n >\n <el-input\n :placeholder=\"t('el.datepicker.selectTime')\"\n :model-value=\"visibleTime\"\n size=\"small\"\n :validate-event=\"false\"\n @focus=\"onTimePickerInputFocus\"\n @input=\"(val) => (userInputTime = val)\"\n @change=\"handleVisibleTimeChange\"\n />\n <time-pick-panel\n :visible=\"timePickerVisible\"\n :format=\"timeFormat\"\n :parsed-value=\"innerDate\"\n @pick=\"handleTimePick\"\n />\n </span>\n </div>\n <div\n v-show=\"currentView !== 'time'\"\n :class=\"[\n dpNs.e('header'),\n (currentView === 'year' || currentView === 'month') &&\n dpNs.e('header--bordered'),\n ]\"\n >\n <span :class=\"dpNs.e('prev-btn')\">\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevYear`)\"\n class=\"d-arrow-left\"\n :class=\"ppNs.e('icon-btn')\"\n @click=\"moveByYear(false)\"\n >\n <slot name=\"prev-year\">\n <el-icon><d-arrow-left /></el-icon>\n </slot>\n </button>\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-left\"\n @click=\"moveByMonth(false)\"\n >\n <slot name=\"prev-month\">\n <el-icon><arrow-left /></el-icon>\n </slot>\n </button>\n </span>\n <span\n role=\"button\"\n :class=\"dpNs.e('header-label')\"\n aria-live=\"polite\"\n tabindex=\"0\"\n @keydown.enter=\"showPicker('year')\"\n @click=\"showPicker('year')\"\n >{{ yearLabel }}</span\n >\n <span\n v-show=\"currentView === 'date'\"\n role=\"button\"\n aria-live=\"polite\"\n tabindex=\"0\"\n :class=\"[\n dpNs.e('header-label'),\n { active: currentView === 'month' },\n ]\"\n @keydown.enter=\"showPicker('month')\"\n @click=\"showPicker('month')\"\n >{{ t(`el.datepicker.month${month + 1}`) }}</span\n >\n <span :class=\"dpNs.e('next-btn')\">\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-right\"\n @click=\"moveByMonth(true)\"\n >\n <slot name=\"next-month\">\n <el-icon><arrow-right /></el-icon>\n </slot>\n </button>\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextYear`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"d-arrow-right\"\n @click=\"moveByYear(true)\"\n >\n <slot name=\"next-year\">\n <el-icon><d-arrow-right /></el-icon>\n </slot>\n </button>\n </span>\n </div>\n <div :class=\"ppNs.e('content')\" @keydown=\"handleKeydownTable\">\n <date-table\n v-if=\"currentView === 'date'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleDatePick\"\n />\n <year-table\n v-if=\"currentView === 'year'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :disabled-date=\"disabledDate\"\n :parsed-value=\"parsedValue\"\n @pick=\"handleYearPick\"\n />\n <month-table\n v-if=\"currentView === 'month'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n @pick=\"handleMonthPick\"\n />\n </div>\n </div>\n </div>\n <div v-show=\"footerVisible\" :class=\"ppNs.e('footer')\">\n <el-button\n v-show=\"!isMultipleType && showNow\"\n text\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledNow\"\n @click=\"changeToNow\"\n >\n {{ t('el.datepicker.now') }}\n </el-button>\n <el-button\n plain\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledConfirm\"\n @click=\"onConfirm\"\n >\n {{ t('el.datepicker.confirm') }}\n </el-button>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n ref,\n toRef,\n useAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport dayjs from 'dayjs'\nimport ElButton from '@element-plus/components/button'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport {\n TimePickPanel,\n extractDateFormat,\n extractTimeFormat,\n} from '@element-plus/components/time-picker'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { isArray, isFunction } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport {\n ArrowLeft,\n ArrowRight,\n DArrowLeft,\n DArrowRight,\n} from '@element-plus/icons-vue'\nimport { TOOLTIP_INJECTION_KEY } from '@element-plus/components/tooltip'\nimport { panelDatePickProps } from '../props/panel-date-pick'\nimport { getValidDateOfMonth, getValidDateOfYear } from '../utils'\nimport DateTable from './basic-date-table.vue'\nimport MonthTable from './basic-month-table.vue'\nimport YearTable from './basic-year-table.vue'\n\nimport type { SetupContext } from 'vue'\nimport type { ConfigType, Dayjs } from 'dayjs'\nimport type { PanelDatePickProps } from '../props/panel-date-pick'\nimport type {\n DateTableEmits,\n DatesPickerEmits,\n MonthsPickerEmits,\n WeekPickerEmits,\n YearsPickerEmits,\n} from '../props/basic-date-table'\n\ntype DatePickType = PanelDatePickProps['type']\n// todo\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst timeWithinRange = (_: ConfigType, __: any, ___: string) => true\nconst props = defineProps(panelDatePickProps)\nconst contextEmit = defineEmits(['pick', 'set-picker-option', 'panel-change'])\nconst ppNs = useNamespace('picker-panel')\nconst dpNs = useNamespace('date-picker')\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst { t, lang } = useLocale()\nconst pickerBase = inject('EP_PICKER_BASE') as any\nconst popper = inject(TOOLTIP_INJECTION_KEY)\nconst { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props\nconst defaultValue = toRef(pickerBase.props, 'defaultValue')\n\nconst currentViewRef = ref<{ focus: () => void }>()\n\nconst innerDate = ref(dayjs().locale(lang.value))\n\nconst isChangeToNow = ref(false)\n\nlet isShortcut = false\n\nconst defaultTimeD = computed(() => {\n return dayjs(defaultTime).locale(lang.value)\n})\n\nconst month = computed(() => {\n return innerDate.value.month()\n})\n\nconst year = computed(() => {\n return innerDate.value.year()\n})\n\nconst selectableRange = ref([])\nconst userInputDate = ref<string | null>(null)\nconst userInputTime = ref<string | null>(null)\n// todo update to disableHour\nconst checkDateWithinRange = (date: ConfigType) => {\n return selectableRange.value.length > 0\n ? timeWithinRange(date, selectableRange.value, props.format || 'HH:mm:ss')\n : true\n}\nconst formatEmit = (emitDayjs: Dayjs) => {\n if (\n defaultTime &&\n !visibleTime.value &&\n !isChangeToNow.value &&\n !isShortcut\n ) {\n return defaultTimeD.value\n .year(emitDayjs.year())\n .month(emitDayjs.month())\n .date(emitDayjs.date())\n }\n if (showTime.value) return emitDayjs.millisecond(0)\n return emitDayjs.startOf('day')\n}\nconst emit = (value: Dayjs | Dayjs[], ...args: any[]) => {\n if (!value) {\n contextEmit('pick', value, ...args)\n } else if (isArray(value)) {\n const dates = value.map(formatEmit)\n contextEmit('pick', dates, ...args)\n } else {\n contextEmit('pick', formatEmit(value), ...args)\n }\n userInputDate.value = null\n userInputTime.value = null\n isChangeToNow.value = false\n isShortcut = false\n}\nconst handleDatePick = async (value: DateTableEmits, keepOpen?: boolean) => {\n if (selectionMode.value === 'date') {\n value = value as Dayjs\n let newDate = props.parsedValue\n ? (props.parsedValue as Dayjs)\n .year(value.year())\n .month(value.month())\n .date(value.date())\n : value\n // change default time while out of selectableRange\n if (!checkDateWithinRange(newDate)) {\n newDate = (selectableRange.value[0][0] as Dayjs)\n .year(value.year())\n .month(value.month())\n .date(value.date())\n }\n innerDate.value = newDate\n emit(newDate, showTime.value || keepOpen)\n // fix: https://github.com/element-plus/element-plus/issues/14728\n if (props.type === 'datetime') {\n await nextTick()\n handleFocusPicker()\n }\n } else if (selectionMode.value === 'week') {\n emit((value as WeekPickerEmits).date)\n } else if (selectionMode.value === 'dates') {\n emit(value as DatesPickerEmits, true) // set true to keep panel open\n }\n}\n\nconst moveByMonth = (forward: boolean) => {\n const action = forward ? 'add' : 'subtract'\n innerDate.value = innerDate.value[action](1, 'month')\n handlePanelChange('month')\n}\n\nconst moveByYear = (forward: boolean) => {\n const currentDate = innerDate.value\n const action = forward ? 'add' : 'subtract'\n\n innerDate.value =\n currentView.value === 'year'\n ? currentDate[action](10, 'year')\n : currentDate[action](1, 'year')\n\n handlePanelChange('year')\n}\n\nconst currentView = ref('date')\n\nconst yearLabel = computed(() => {\n const yearTranslation = t('el.datepicker.year')\n if (currentView.value === 'year') {\n const startYear = Math.floor(year.value / 10) * 10\n if (yearTranslation) {\n return `${startYear} ${yearTranslation} - ${\n startYear + 9\n } ${yearTranslation}`\n }\n return `${startYear} - ${startYear + 9}`\n }\n return `${year.value} ${yearTranslation}`\n})\n\ntype Shortcut = {\n value: (() => Dayjs) | Dayjs\n onClick?: (ctx: Omit<SetupContext, 'expose'>) => void\n}\n\nconst handleShortcutClick = (shortcut: Shortcut) => {\n const shortcutValue = isFunction(shortcut.value)\n ? shortcut.value()\n : shortcut.value\n if (shortcutValue) {\n isShortcut = true\n emit(dayjs(shortcutValue).locale(lang.value))\n return\n }\n if (shortcut.onClick) {\n shortcut.onClick({\n attrs,\n slots,\n emit: contextEmit as SetupContext['emit'],\n })\n }\n}\n\nconst selectionMode = computed<DatePickType>(() => {\n const { type } = props\n if (['week', 'month', 'months', 'year', 'years', 'dates'].includes(type))\n return type\n return 'date' as DatePickType\n})\n\nconst isMultipleType = computed(() => {\n return (\n selectionMode.value === 'dates' ||\n selectionMode.value === 'months' ||\n selectionMode.value === 'years'\n )\n})\n\nconst keyboardMode = computed<string>(() => {\n return selectionMode.value === 'date'\n ? currentView.value\n : selectionMode.value\n})\n\nconst hasShortcuts = computed(() => !!shortcuts.length)\n\nconst handleMonthPick = async (\n month: number | MonthsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'month') {\n innerDate.value = getValidDateOfMonth(\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'months') {\n emit(month as MonthsPickerEmits, keepOpen ?? true)\n } else {\n innerDate.value = getValidDateOfMonth(\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n currentView.value = 'date'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('month')\n}\n\nconst handleYearPick = async (\n year: number | YearsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'year') {\n const data = innerDate.value.startOf('year').year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'years') {\n emit(year as YearsPickerEmits, keepOpen ?? true)\n } else {\n const data = innerDate.value.year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n currentView.value = 'month'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('year')\n}\n\nconst showPicker = async (view: 'month' | 'year') => {\n currentView.value = view\n await nextTick()\n handleFocusPicker()\n}\n\nconst showTime = computed(\n () => props.type === 'datetime' || props.type === 'datetimerange'\n)\n\nconst footerVisible = computed(() => {\n const showDateFooter = showTime.value || selectionMode.value === 'dates'\n const showYearFooter = selectionMode.value === 'years'\n const showMonthFooter = selectionMode.value === 'months'\n const isDateView = currentView.value === 'date'\n const isYearView = currentView.value === 'year'\n const isMonthView = currentView.value === 'month'\n return (\n (showDateFooter && isDateView) ||\n (showYearFooter && isYearView) ||\n (showMonthFooter && isMonthView)\n )\n})\n\nconst disabledConfirm = computed(() => {\n if (!disabledDate) return false\n if (!props.parsedValue) return true\n if (isArray(props.parsedValue)) {\n return disabledDate(props.parsedValue[0].toDate())\n }\n return disabledDate(props.parsedValue.toDate())\n})\nconst onConfirm = () => {\n if (isMultipleType.value) {\n emit(props.parsedValue as Dayjs[])\n } else {\n // deal with the scenario where: user opens the date time picker, then confirm without doing anything\n let result = props.parsedValue as Dayjs\n if (!result) {\n const defaultTimeD = dayjs(defaultTime).locale(lang.value)\n const defaultValueD = getDefaultValue()\n result = defaultTimeD\n .year(defaultValueD.year())\n .month(defaultValueD.month())\n .date(defaultValueD.date())\n }\n innerDate.value = result\n emit(result)\n }\n}\n\nconst disabledNow = computed(() => {\n if (!disabledDate) return false\n return disabledDate(dayjs().locale(lang.value).toDate())\n})\nconst changeToNow = () => {\n // NOTE: not a permanent solution\n // consider disable \"now\" button in the future\n const now = dayjs().locale(lang.value)\n const nowDate = now.toDate()\n isChangeToNow.value = true\n if (\n (!disabledDate || !disabledDate(nowDate)) &&\n checkDateWithinRange(nowDate)\n ) {\n innerDate.value = dayjs().locale(lang.value)\n emit(innerDate.value)\n }\n}\n\nconst timeFormat = computed(() => {\n return props.timeFormat || extractTimeFormat(props.format)\n})\n\nconst dateFormat = computed(() => {\n return props.dateFormat || extractDateFormat(props.format)\n})\n\nconst visibleTime = computed(() => {\n if (userInputTime.value) return userInputTime.value\n if (!props.parsedValue && !defaultValue.value) return\n return ((props.parsedValue || innerDate.value) as Dayjs).format(\n timeFormat.value\n )\n})\n\nconst visibleDate = computed(() => {\n if (userInputDate.value) return userInputDate.value\n if (!props.parsedValue && !defaultValue.value) return\n return ((props.parsedValue || innerDate.value) as Dayjs).format(\n dateFormat.value\n )\n})\n\nconst timePickerVisible = ref(false)\nconst onTimePickerInputFocus = () => {\n timePickerVisible.value = true\n}\nconst handleTimePickClose = () => {\n timePickerVisible.value = false\n}\n\nconst getUnits = (date: Dayjs) => {\n return {\n hour: date.hour(),\n minute: date.minute(),\n second: date.second(),\n year: date.year(),\n month: date.month(),\n date: date.date(),\n }\n}\n\nconst handleTimePick = (value: Dayjs, visible: boolean, first: boolean) => {\n const { hour, minute, second } = getUnits(value)\n const newDate = props.parsedValue\n ? (props.parsedValue as Dayjs).hour(hour).minute(minute).second(second)\n : value\n innerDate.value = newDate\n emit(innerDate.value, true)\n if (!first) {\n timePickerVisible.value = visible\n }\n}\n\nconst handleVisibleTimeChange = (value: string) => {\n const newDate = dayjs(value, timeFormat.value).locale(lang.value)\n if (newDate.isValid() && checkDateWithinRange(newDate)) {\n const { year, month, date } = getUnits(innerDate.value)\n innerDate.value = newDate.year(year).month(month).date(date)\n userInputTime.value = null\n timePickerVisible.value = false\n emit(innerDate.value, true)\n }\n}\n\nconst handleVisibleDateChange = (value: string) => {\n const newDate = dayjs(value, dateFormat.value).locale(lang.value)\n if (newDate.isValid()) {\n if (disabledDate && disabledDate(newDate.toDate())) {\n return\n }\n const { hour, minute, second } = getUnits(innerDate.value)\n innerDate.value = newDate.hour(hour).minute(minute).second(second)\n userInputDate.value = null\n emit(innerDate.value, true)\n }\n}\n\nconst isValidValue = (date: unknown) => {\n return (\n dayjs.isDayjs(date) &&\n date.isValid() &&\n (disabledDate ? !disabledDate(date.toDate()) : true)\n )\n}\n\nconst formatToString = (value: Dayjs | Dayjs[]) => {\n return isArray(value)\n ? (value as Dayjs[]).map((_) => _.format(props.format))\n : (value as Dayjs).format(props.format)\n}\n\nconst parseUserInput = (value: Dayjs) => {\n return dayjs(value, props.format).locale(lang.value)\n}\n\nconst getDefaultValue = () => {\n const parseDate = dayjs(defaultValue.value).locale(lang.value)\n if (!defaultValue.value) {\n const defaultTimeDValue = defaultTimeD.value\n return dayjs()\n .hour(defaultTimeDValue.hour())\n .minute(defaultTimeDValue.minute())\n .second(defaultTimeDValue.second())\n .locale(lang.value)\n }\n return parseDate\n}\n\nconst handleFocusPicker = () => {\n if (['week', 'month', 'year', 'date'].includes(selectionMode.value)) {\n currentViewRef.value?.focus()\n }\n}\n\nconst _handleFocusPicker = () => {\n handleFocusPicker()\n // TODO: After focus the date input, the first time you use the ArrowDown keys, you cannot focus on the date cell\n if (selectionMode.value === 'week') {\n handleKeyControl(EVENT_CODE.down)\n }\n}\n\nconst handleKeydownTable = (event: KeyboardEvent) => {\n const { code } = event\n const validCode = [\n EVENT_CODE.up,\n EVENT_CODE.down,\n EVENT_CODE.left,\n EVENT_CODE.right,\n EVENT_CODE.home,\n EVENT_CODE.end,\n EVENT_CODE.pageUp,\n EVENT_CODE.pageDown,\n ]\n if (validCode.includes(code)) {\n handleKeyControl(code)\n event.stopPropagation()\n event.preventDefault()\n }\n if (\n [EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(\n code\n ) &&\n userInputDate.value === null &&\n userInputTime.value === null\n ) {\n event.preventDefault()\n emit(innerDate.value, false)\n }\n}\n\nconst handleKeyControl = (code: string) => {\n type KeyControlMappingCallableOffset = (date: Date, step?: number) => number\n type KeyControl = {\n [key: string]:\n | number\n | KeyControlMappingCallableOffset\n | ((date: Date, step: number) => any)\n offset: (date: Date, step: number) => any\n }\n interface KeyControlMapping {\n [key: string]: KeyControl\n }\n\n const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE\n const mapping: KeyControlMapping = {\n year: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setFullYear(date.getFullYear() + step),\n },\n month: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setMonth(date.getMonth() + step),\n },\n week: {\n [up]: -1,\n [down]: 1,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setDate(date.getDate() + step * 7),\n },\n date: {\n [up]: -7,\n [down]: 7,\n [left]: -1,\n [right]: 1,\n [home]: (date: Date) => -date.getDay(),\n [end]: (date: Date) => -date.getDay() + 6,\n [pageUp]: (date: Date) =>\n -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),\n [pageDown]: (date: Date) =>\n new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),\n offset: (date: Date, step: number) => date.setDate(date.getDate() + step),\n },\n }\n\n const newDate = innerDate.value.toDate()\n while (Math.abs(innerDate.value.diff(newDate, 'year', true)) < 1) {\n const map = mapping[keyboardMode.value]\n if (!map) return\n map.offset(\n newDate,\n isFunction(map[code])\n ? (map[code] as unknown as KeyControlMappingCallableOffset)(newDate)\n : (map[code] as number) ?? 0\n )\n if (disabledDate && disabledDate(newDate)) {\n break\n }\n const result = dayjs(newDate).locale(lang.value)\n innerDate.value = result\n contextEmit('pick', result, true)\n break\n }\n}\n\nconst handlePanelChange = (mode: 'month' | 'year') => {\n contextEmit('panel-change', innerDate.value.toDate(), mode, currentView.value)\n}\n\nwatch(\n () => selectionMode.value,\n (val) => {\n if (['month', 'year'].includes(val)) {\n currentView.value = val\n return\n } else if (val === 'years') {\n currentView.value = 'year'\n return\n } else if (val === 'months') {\n currentView.value = 'month'\n return\n }\n currentView.value = 'date'\n },\n { immediate: true }\n)\n\nwatch(\n () => currentView.value,\n () => {\n popper?.updatePopper()\n }\n)\n\nwatch(\n () => defaultValue.value,\n (val) => {\n if (val) {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.parsedValue,\n (val) => {\n if (val) {\n if (isMultipleType.value) return\n if (isArray(val)) return\n innerDate.value = val\n } else {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\ncontextEmit('set-picker-option', ['isValidValue', isValidValue])\ncontextEmit('set-picker-option', ['formatToString', formatToString])\ncontextEmit('set-picker-option', ['parseUserInput', parseUserInput])\ncontextEmit('set-picker-option', ['handleFocusPicker', _handleFocusPicker])\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqPA,MAAMA,eAAkB,GAAAA,CAACC,CAAe,EAAAC,EAAA,EAASC,GAAgB;IAG3D,MAAAC,IAAA,GAAOC,YAAA,CAAa,cAAc;IAClC,MAAAC,IAAA,GAAOD,YAAA,CAAa,aAAa;IACvC,MAAME,KAAA,GAAQC,QAAS;IACvB,MAAMC,KAAA,GAAQC,QAAS;IAEvB,MAAM;MAAEC,CAAA;MAAGC;IAAK,IAAIC,SAAU;IACxB,MAAAC,UAAA,GAAaC,MAAA,CAAO,gBAAgB;IACpC,MAAAC,MAAA,GAASD,MAAA,CAAOE,qBAAqB;IAC3C,MAAM;MAAEC,SAAW;MAAAC,YAAA;MAAcC,aAAe;MAAAC;IAAA,IAAgBP,UAAW,CAAAQ,KAAA;IAC3E,MAAMC,YAAe,GAAAC,KAAA,CAAMV,UAAW,CAAAQ,KAAA,EAAO,cAAc;IAE3D,MAAMG,cAAA,GAAiBC,GAA2B;IAElD,MAAMC,SAAA,GAAYD,GAAI,CAAAE,KAAA,GAAQC,MAAO,CAAAjB,IAAA,CAAKkB,KAAK,CAAC;IAE1C,MAAAC,aAA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