@wfrog/vc-ui 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +3 -3
  2. package/dist/es/chunk/{OEa4tYPF.mjs → -ga82G_B.mjs} +1 -1
  3. package/dist/es/chunk/B1BnPYNG.mjs +163 -0
  4. package/dist/es/chunk/{DFOLES4O.mjs → BA2yoAwy.mjs} +403 -502
  5. package/dist/es/chunk/{BpqBBo4z.mjs → BDyXj_90.mjs} +2 -2
  6. package/dist/es/chunk/{BI0vrXwX.mjs → BI-fNJhk.mjs} +6 -3
  7. package/dist/es/chunk/{BsGCX4td.mjs → BK4T_2ha.mjs} +1 -1
  8. package/dist/es/chunk/{73YgKz3H.mjs → BLLKi_0v.mjs} +1 -1
  9. package/dist/es/chunk/{DTLPXrjb.mjs → BTsEMnf_.mjs} +1 -1
  10. package/dist/es/chunk/{B5UQmWXg.mjs → BUf50Y7Y.mjs} +41 -21
  11. package/dist/es/chunk/{BzedaLtg.mjs → BYVaz5Or.mjs} +2 -2
  12. package/dist/es/chunk/BaJ7k5Lg.mjs +209 -0
  13. package/dist/es/chunk/{Bp9jXKX0.mjs → BambM7zX.mjs} +2 -2
  14. package/dist/es/chunk/{CizMbf5K.mjs → Bl0WQiki.mjs} +1 -1
  15. package/dist/es/chunk/{CLbj8G-F.mjs → Bnot0Gwc.mjs} +12 -4
  16. package/dist/es/chunk/{4eyJqDa9.mjs → BoGGHTrJ.mjs} +4 -2
  17. package/dist/es/chunk/C7Dgjpd1.mjs +242 -0
  18. package/dist/es/chunk/{D0LB3gF-.mjs → CKbkzlkO.mjs} +104 -72
  19. package/dist/es/chunk/{DrgvuOYH.mjs → CL5WTCB3.mjs} +4 -2
  20. package/dist/es/chunk/{XwSiBVsA.mjs → CM_I1FoA.mjs} +2 -2
  21. package/dist/es/chunk/{DouIsSPi.mjs → CNILa-hz.mjs} +1 -1
  22. package/dist/es/chunk/{DRoyW749.mjs → CcKUdl3e.mjs} +12 -6
  23. package/dist/es/chunk/CidLkmft.mjs +188 -0
  24. package/dist/es/chunk/{HAog8AWU.mjs → CitH0taR.mjs} +816 -539
  25. package/dist/es/chunk/{Cu6erWl4.mjs → CzqeSQn4.mjs} +73 -38
  26. package/dist/es/chunk/{CLCfXfvv.mjs → D7JQbDFE.mjs} +154 -118
  27. package/dist/es/chunk/{DaCDeO95.mjs → D9iEroQw.mjs} +1 -207
  28. package/dist/es/chunk/{cPBw23yt.mjs → DEPZhJ0Z.mjs} +21 -16
  29. package/dist/es/chunk/{CPERtDRX.mjs → DHpbQMGk.mjs} +32 -22
  30. package/dist/es/chunk/{BHsNc7jl.mjs → DKpRXDRE.mjs} +82 -55
  31. package/dist/es/chunk/{CLMc8GzD.mjs → DMYHOxhk.mjs} +462 -311
  32. package/dist/es/chunk/{CBSopeeE.mjs → DQHGjqG5.mjs} +9 -4
  33. package/dist/es/chunk/DTEM_vYZ.mjs +23 -0
  34. package/dist/es/chunk/{NQBKROII.mjs → DWcIzeMM.mjs} +1 -1
  35. package/dist/es/chunk/{FHvLvzEB.mjs → DX38FfmL.mjs} +1088 -697
  36. package/dist/es/chunk/{DZD-YnCt.mjs → Dcm-lOj8.mjs} +4 -4
  37. package/dist/es/chunk/{09Ec85_u.mjs → DdmNdV7I.mjs} +398 -278
  38. package/dist/es/chunk/{f0-vIQGp.mjs → DfHTA5LW.mjs} +3 -3
  39. package/dist/es/chunk/DgFT6snA.mjs +835 -0
  40. package/dist/es/chunk/{DwKWIlzw.mjs → DgSzI6Fw.mjs} +106 -71
  41. package/dist/es/chunk/{BcTuAX8r.mjs → Dsye5ZEp.mjs} +5 -3
  42. package/dist/es/chunk/{BsLJxiSC.mjs → Dw-yyl2m.mjs} +1 -1
  43. package/dist/es/chunk/{DXPWe_a5.mjs → U13Qpiki.mjs} +19 -13
  44. package/dist/es/chunk/{axpwSky6.mjs → _8u_XVHh.mjs} +168 -120
  45. package/dist/es/chunk/egk9EEzo.mjs +66 -0
  46. package/dist/es/chunk/{BUEEWLrd.mjs → ezK_XQQd.mjs} +15 -6
  47. package/dist/es/chunk/{Bl2KlMdP.mjs → oW98L-44.mjs} +8 -3
  48. package/dist/es/chunk/{Dk6Bx0KT.mjs → plK2vnjp.mjs} +8 -5
  49. package/dist/es/components/awesome-icon/awesome-icon.mjs +2 -1
  50. package/dist/es/components/backbottom/backbottom.mjs +2 -2
  51. package/dist/es/components/button/button.mjs +105 -76
  52. package/dist/es/components/choice/choice.mjs +2 -2
  53. package/dist/es/components/config-provider/config-provider.d.ts +1 -0
  54. package/dist/es/components/config-provider/config-provider.mjs +13 -5
  55. package/dist/es/components/cropper/cropper.mjs +44 -33
  56. package/dist/es/components/currency/currency.mjs +5 -5
  57. package/dist/es/components/daterange-picker/daterange-picker.mjs +2267 -1522
  58. package/dist/es/components/dialog/dialog.mjs +213 -172
  59. package/dist/es/components/dialog/index.css +1 -1
  60. package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +11 -11
  61. package/dist/es/components/dialog-map-point/dialog-map-point.mjs +5 -4
  62. package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +495 -314
  63. package/dist/es/components/dialog-upload-images/index.css +1 -1
  64. package/dist/es/components/drag-verify/drag-verify.mjs +3 -3
  65. package/dist/es/components/drawer/drawer.mjs +136 -94
  66. package/dist/es/components/drawer/index.css +1 -1
  67. package/dist/es/components/easy-pagination/easy-pagination.mjs +2 -2
  68. package/dist/es/components/el-icon/el-icon.mjs +1 -1
  69. package/dist/es/components/el-icon/index.css +3 -2
  70. package/dist/es/components/flag/flag.mjs +2 -1
  71. package/dist/es/components/icon/icon.mjs +10 -31
  72. package/dist/es/components/icon/icon.vue.d.ts +1 -1
  73. package/dist/es/components/icon/icon2.mjs +1 -1
  74. package/dist/es/components/icon/index.mjs +2 -2
  75. package/dist/es/components/icon-picker/components/collections.vue.d.ts +625 -0
  76. package/dist/es/components/icon-picker/components/panel.vue.d.ts +9 -0
  77. package/dist/es/components/icon-picker/icon-picker.d.ts +40 -0
  78. package/dist/es/components/icon-picker/icon-picker.mjs +1375 -0
  79. package/dist/es/components/icon-picker/icon-picker.vue.d.ts +9 -0
  80. package/dist/es/components/icon-picker/index.css +121 -0
  81. package/dist/es/components/icon-picker/index.d.ts +4 -0
  82. package/dist/es/components/icon-picker/index.mjs +6 -0
  83. package/dist/es/components/iconify-icon/iconify-icon.d.ts +5 -0
  84. package/dist/es/components/iconify-icon/iconify-icon.mjs +1860 -0
  85. package/dist/es/components/iconify-icon/iconify-icon.vue.d.ts +6 -0
  86. package/dist/es/components/iconify-icon/index.css +11 -0
  87. package/dist/es/components/iconify-icon/index.d.ts +4 -0
  88. package/dist/es/components/iconify-icon/index.mjs +6 -0
  89. package/dist/es/components/image/image.mjs +5 -5
  90. package/dist/es/components/input/input.mjs +4 -4
  91. package/dist/es/components/input/input.vue.d.ts +63 -54
  92. package/dist/es/components/input-number/input-number.mjs +5 -5
  93. package/dist/es/components/pca-picker/components/c.vue.d.ts +4 -4
  94. package/dist/es/components/pca-picker/index.css +1 -1
  95. package/dist/es/components/pca-picker/pca-picker.mjs +154 -160
  96. package/dist/es/components/pca-picker/pca-picker.vue.d.ts +12 -11
  97. package/dist/es/components/qr-code/qr-code.mjs +2 -1
  98. package/dist/es/components/screenfull/screenfull.mjs +6 -5
  99. package/dist/es/components/scrollbar/index.css +18 -0
  100. package/dist/es/components/scrollbar/index.d.ts +4 -0
  101. package/dist/es/components/scrollbar/index.mjs +6 -0
  102. package/dist/es/components/scrollbar/scrollbar.d.ts +4 -0
  103. package/dist/es/components/scrollbar/scrollbar.mjs +65 -0
  104. package/dist/es/components/scrollbar/scrollbar.vue.d.ts +588 -0
  105. package/dist/es/components/select/select.mjs +7 -7
  106. package/dist/es/components/single-player/index.css +1 -1
  107. package/dist/es/components/single-player/single-player.mjs +265 -166
  108. package/dist/es/components/svg-icon/index.css +3 -2
  109. package/dist/es/components/svg-icon/svg-icon.mjs +3 -3
  110. package/dist/es/components/switch/switch.mjs +2 -2
  111. package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +2 -2
  112. package/dist/es/components/tags/tags.mjs +9 -9
  113. package/dist/es/components/text-ellipsis/text-ellipsis.mjs +4 -4
  114. package/dist/es/components/thousand-input/thousand-input.mjs +5 -4
  115. package/dist/es/components/thousand-input/thousand-input.vue.d.ts +126 -108
  116. package/dist/es/components/tinymce/index.css +1 -1
  117. package/dist/es/components/tinymce/tinymce.mjs +9 -8
  118. package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +179 -141
  119. package/dist/es/components/tree-picker/popover-cascader.css +1 -1
  120. package/dist/es/components/tree-picker/tree-picker.mjs +10 -10
  121. package/dist/es/components/tree-picker/tree-picker.vue.d.ts +12 -11
  122. package/dist/es/components/upload-file/upload-file.mjs +3 -3
  123. package/dist/es/index.d.ts +3 -0
  124. package/dist/es/index.mjs +41 -31
  125. package/dist/global.d.ts +3 -0
  126. package/dist/index.css +166 -22
  127. package/package.json +8 -2
  128. package/dist/es/chunk/BtTIs3tG.mjs +0 -138
  129. package/dist/es/chunk/C7wQNvSS.mjs +0 -728
  130. package/dist/es/chunk/Cbhe4I9Z.mjs +0 -16
  131. package/dist/es/chunk/DihosKp1.mjs +0 -140
  132. package/dist/es/components/icon/index.css +0 -9
@@ -1,27 +1,28 @@
1
- import { i as isArray, a as isEmpty, b as isDate, c as buildProps, d as definePropType, u as useNamespace, e as debugWarn, N as NOOP, f as isNumber, g as isUndefined, h as isString, j as isFunction } from '../../chunk/DRoyW749.mjs';
2
- import { E as ElInput } from '../../chunk/C7wQNvSS.mjs';
3
- import { E as ElScrollbar } from '../../chunk/axpwSky6.mjs';
4
- import { E as ElButton } from '../../chunk/D0LB3gF-.mjs';
5
- import { E as Ee, u as useTooltipContentProps, a as ElTooltip, c as castArray, e as extractFirst } from '../../chunk/CLMc8GzD.mjs';
1
+ import { i as isArray, a as isEmpty, b as isDate, c as buildProps, d as definePropType, u as useNamespace, e as debugWarn, N as NOOP, f as isNumber, g as isUndefined, h as isString, j as isFunction } from '../../chunk/CcKUdl3e.mjs';
2
+ import { E as ElInput } from '../../chunk/DgFT6snA.mjs';
3
+ import { E as ElScrollbar } from '../../chunk/_8u_XVHh.mjs';
4
+ import { E as ElButton } from '../../chunk/CKbkzlkO.mjs';
5
+ import { E as Ee, u as useTooltipContentProps, a as ElTooltip, c as castArray, e as extractFirst } from '../../chunk/DMYHOxhk.mjs';
6
6
  import { ref, computed, defineComponent, reactive, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot, createElementVNode, mergeProps, useAttrs as useAttrs$1, inject, watch, nextTick, onBeforeUnmount, provide, createBlock, withCtx, withModifiers, createCommentVNode, resolveDynamicComponent, toDisplayString, onMounted, Fragment, renderList, createTextVNode, withDirectives, createVNode, Transition, withKeys, useSlots, toRef, vShow, getCurrentInstance, toRefs, isVNode, isRef } from 'vue';
7
7
  import { onClickOutside, unrefElement, useVModel } from '@vueuse/core';
8
- import { E as ElIcon } from '../../chunk/cPBw23yt.mjs';
8
+ import { E as ElIcon } from '../../chunk/DEPZhJ0Z.mjs';
9
9
  import { CircleClose, Clock, Calendar, ArrowUp, ArrowDown, DArrowLeft, ArrowLeft, ArrowRight, DArrowRight } from '@element-plus/icons-vue';
10
- import { u as useLocale } from '../../chunk/Dk6Bx0KT.mjs';
11
- import { u as useAriaProps, f as flatten } from '../../chunk/BpqBBo4z.mjs';
12
- import { _ as _export_sfc, w as withInstall } from '../../chunk/DTLPXrjb.mjs';
13
- import { g as getStyle, h as hasClass } from '../../chunk/CizMbf5K.mjs';
14
- import { v as vRepeatClick } from '../../chunk/4eyJqDa9.mjs';
10
+ import { u as useLocale } from '../../chunk/plK2vnjp.mjs';
11
+ import { u as useAriaProps, f as flatten } from '../../chunk/BDyXj_90.mjs';
12
+ import { _ as _export_sfc, w as withInstall } from '../../chunk/BTsEMnf_.mjs';
13
+ import { g as getStyle, h as hasClass } from '../../chunk/Bl0WQiki.mjs';
14
+ import { v as vRepeatClick } from '../../chunk/BoGGHTrJ.mjs';
15
15
  import { U as UPDATE_MODEL_EVENT, C as CHANGE_EVENT } from '../../chunk/Ct6q2FXg.mjs';
16
- import { d as debounce } from '../../chunk/Bp9jXKX0.mjs';
16
+ import { d as debounce } from '../../chunk/BambM7zX.mjs';
17
17
  import { g as getEventCode, E as EVENT_CODE } from '../../chunk/BTpNRPQW.mjs';
18
- import { C as ClickOutside } from '../../chunk/DrgvuOYH.mjs';
19
- import { u as useFormItem, a as useFormItemInputId, b as useFormDisabled, c as useFormSize } from '../../chunk/DXPWe_a5.mjs';
20
- import { i as isEqual } from '../../chunk/BsLJxiSC.mjs';
21
- import { u as useSizeProp } from '../../chunk/BsGCX4td.mjs';
22
- import { u as useEmptyValuesProps, a as useEmptyValues } from '../../chunk/BcTuAX8r.mjs';
23
- import { u as useAttrs } from '../../chunk/BUEEWLrd.mjs';
24
- import { u as useFocusController } from '../../chunk/XwSiBVsA.mjs';
18
+ import { C as ClickOutside } from '../../chunk/CL5WTCB3.mjs';
19
+ import { u as useFormItem, a as useFormItemInputId, b as useFormDisabled, c as useFormSize } from '../../chunk/U13Qpiki.mjs';
20
+ import { i as isEqual } from '../../chunk/Dw-yyl2m.mjs';
21
+ import { o as omit } from '../../chunk/C7Dgjpd1.mjs';
22
+ import { u as useSizeProp } from '../../chunk/BK4T_2ha.mjs';
23
+ import { u as useEmptyValuesProps, a as useEmptyValues } from '../../chunk/Dsye5ZEp.mjs';
24
+ import { u as useAttrs } from '../../chunk/ezK_XQQd.mjs';
25
+ import { u as useFocusController } from '../../chunk/CM_I1FoA.mjs';
25
26
 
26
27
  function getDefaultExportFromCjs (x) {
27
28
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -193,7 +194,9 @@ const useCommonPicker = (props, emit) => {
193
194
  if (!valueEquals(props.modelValue, input)) {
194
195
  let formatted;
195
196
  if (isArray(input)) {
196
- formatted = input.map((item) => formatter(item, props.valueFormat, lang.value));
197
+ formatted = input.map(
198
+ (item) => formatter(item, props.valueFormat, lang.value)
199
+ );
197
200
  } else if (input) {
198
201
  formatted = formatter(input, props.valueFormat, lang.value);
199
202
  }
@@ -210,13 +213,21 @@ const useCommonPicker = (props, emit) => {
210
213
  }
211
214
  } else {
212
215
  if (isArray(props.modelValue)) {
213
- dayOrDays = props.modelValue.map((d) => parseDate(d, props.valueFormat, lang.value));
216
+ dayOrDays = props.modelValue.map(
217
+ (d) => parseDate(d, props.valueFormat, lang.value)
218
+ );
214
219
  } else {
215
- dayOrDays = parseDate((_a = props.modelValue) != null ? _a : "", props.valueFormat, lang.value);
220
+ dayOrDays = parseDate(
221
+ (_a = props.modelValue) != null ? _a : "",
222
+ props.valueFormat,
223
+ lang.value
224
+ );
216
225
  }
217
226
  }
218
227
  if (pickerOptions.value.getRangeAvailableTime) {
219
- const availableResult = pickerOptions.value.getRangeAvailableTime(dayOrDays);
228
+ const availableResult = pickerOptions.value.getRangeAvailableTime(
229
+ dayOrDays
230
+ );
220
231
  if (!isEqual(availableResult, dayOrDays)) {
221
232
  dayOrDays = availableResult;
222
233
  if (!valueIsEmpty.value) {
@@ -328,7 +339,10 @@ const timePickerDefaultProps = buildProps({
328
339
  },
329
340
  size: useSizeProp,
330
341
  readonly: Boolean,
331
- disabled: Boolean,
342
+ disabled: {
343
+ type: Boolean,
344
+ default: void 0
345
+ },
332
346
  placeholder: {
333
347
  type: String,
334
348
  default: ""
@@ -415,12 +429,14 @@ const timePickerRangeTriggerProps = buildProps({
415
429
  disabled: Boolean
416
430
  });
417
431
 
418
- const __default__$3 = defineComponent({
419
- name: "PickerRangeTrigger",
420
- inheritAttrs: false
421
- });
422
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
423
- ...__default__$3,
432
+ const _hoisted_1$8 = ["id", "name", "placeholder", "value", "disabled"];
433
+ const _hoisted_2$8 = ["id", "name", "placeholder", "value", "disabled"];
434
+ const _sfc_main$b = defineComponent({
435
+ ...{
436
+ name: "PickerRangeTrigger",
437
+ inheritAttrs: false
438
+ },
439
+ __name: "picker-range-trigger",
424
440
  props: timePickerRangeTriggerProps,
425
441
  emits: [
426
442
  "mouseenter",
@@ -434,15 +450,19 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
434
450
  "startChange",
435
451
  "endChange"
436
452
  ],
437
- setup(__props, { expose, emit }) {
453
+ setup(__props, { expose: __expose, emit: __emit }) {
438
454
  const props = __props;
455
+ const emit = __emit;
439
456
  const { formItem } = useFormItem();
440
- const { inputId } = useFormItemInputId(reactive({ id: computed(() => {
441
- var _a;
442
- return (_a = props.id) == null ? void 0 : _a[0];
443
- }) }), {
444
- formItemContext: formItem
445
- });
457
+ const { inputId } = useFormItemInputId(
458
+ reactive({ id: computed(() => {
459
+ var _a;
460
+ return (_a = props.id) == null ? void 0 : _a[0];
461
+ }) }),
462
+ {
463
+ formItemContext: formItem
464
+ }
465
+ );
446
466
  const attrs = useAttrs();
447
467
  const nsDate = useNamespace("date");
448
468
  const nsRange = useNamespace("range");
@@ -484,59 +504,66 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
484
504
  (_a = inputRef.value) == null ? void 0 : _a.blur();
485
505
  (_b = endInputRef.value) == null ? void 0 : _b.blur();
486
506
  };
487
- expose({
507
+ __expose({
488
508
  focus,
489
509
  blur
490
510
  });
491
511
  return (_ctx, _cache) => {
492
- return openBlock(), createElementBlock("div", {
493
- ref_key: "wrapperRef",
494
- ref: wrapperRef,
495
- class: normalizeClass([unref(nsDate).is("active", unref(isFocused)), _ctx.$attrs.class]),
496
- style: normalizeStyle(_ctx.$attrs.style),
497
- onClick: handleClick,
498
- onMouseenter: handleMouseEnter,
499
- onMouseleave: handleMouseLeave,
500
- onTouchstartPassive: handleTouchStart
501
- }, [
502
- renderSlot(_ctx.$slots, "prefix"),
503
- createElementVNode("input", mergeProps(unref(attrs), {
504
- id: unref(inputId),
505
- ref_key: "inputRef",
506
- ref: inputRef,
507
- name: _ctx.name && _ctx.name[0],
508
- placeholder: _ctx.startPlaceholder,
509
- value: _ctx.modelValue && _ctx.modelValue[0],
510
- class: unref(nsRange).b("input"),
511
- disabled: _ctx.disabled,
512
- onInput: handleStartInput,
513
- onChange: handleStartChange
514
- }), null, 16, ["id", "name", "placeholder", "value", "disabled"]),
515
- renderSlot(_ctx.$slots, "range-separator"),
516
- createElementVNode("input", mergeProps(unref(attrs), {
517
- id: _ctx.id && _ctx.id[1],
518
- ref_key: "endInputRef",
519
- ref: endInputRef,
520
- name: _ctx.name && _ctx.name[1],
521
- placeholder: _ctx.endPlaceholder,
522
- value: _ctx.modelValue && _ctx.modelValue[1],
523
- class: unref(nsRange).b("input"),
524
- disabled: _ctx.disabled,
525
- onInput: handleEndInput,
526
- onChange: handleEndChange
527
- }), null, 16, ["id", "name", "placeholder", "value", "disabled"]),
528
- renderSlot(_ctx.$slots, "suffix")
529
- ], 38);
512
+ return openBlock(), createElementBlock(
513
+ "div",
514
+ {
515
+ ref_key: "wrapperRef",
516
+ ref: wrapperRef,
517
+ class: normalizeClass([unref(nsDate).is("active", unref(isFocused)), _ctx.$attrs.class]),
518
+ style: normalizeStyle(
519
+ _ctx.$attrs.style
520
+ ),
521
+ onClick: handleClick,
522
+ onMouseenter: handleMouseEnter,
523
+ onMouseleave: handleMouseLeave,
524
+ onTouchstartPassive: handleTouchStart
525
+ },
526
+ [
527
+ renderSlot(_ctx.$slots, "prefix"),
528
+ createElementVNode("input", mergeProps(unref(attrs), {
529
+ id: unref(inputId),
530
+ ref_key: "inputRef",
531
+ ref: inputRef,
532
+ name: _ctx.name && _ctx.name[0],
533
+ placeholder: _ctx.startPlaceholder,
534
+ value: _ctx.modelValue && _ctx.modelValue[0],
535
+ class: unref(nsRange).b("input"),
536
+ disabled: _ctx.disabled,
537
+ onInput: handleStartInput,
538
+ onChange: handleStartChange
539
+ }), null, 16, _hoisted_1$8),
540
+ renderSlot(_ctx.$slots, "range-separator"),
541
+ createElementVNode("input", mergeProps(unref(attrs), {
542
+ id: _ctx.id && _ctx.id[1],
543
+ ref_key: "endInputRef",
544
+ ref: endInputRef,
545
+ name: _ctx.name && _ctx.name[1],
546
+ placeholder: _ctx.endPlaceholder,
547
+ value: _ctx.modelValue && _ctx.modelValue[1],
548
+ class: unref(nsRange).b("input"),
549
+ disabled: _ctx.disabled,
550
+ onInput: handleEndInput,
551
+ onChange: handleEndChange
552
+ }), null, 16, _hoisted_2$8),
553
+ renderSlot(_ctx.$slots, "suffix")
554
+ ],
555
+ 38
556
+ );
530
557
  };
531
558
  }
532
559
  });
533
- var PickerRangeTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "picker-range-trigger.vue"]]);
560
+ var PickerRangeTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/time-picker/src/common/picker-range-trigger.vue"]]);
534
561
 
535
- const __default__$2 = defineComponent({
536
- name: "Picker"
537
- });
538
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
539
- ...__default__$2,
562
+ const _sfc_main$a = defineComponent({
563
+ ...{
564
+ name: "Picker"
565
+ },
566
+ __name: "picker",
540
567
  props: timePickerDefaultProps,
541
568
  emits: [
542
569
  UPDATE_MODEL_EVENT,
@@ -549,14 +576,18 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
549
576
  "visible-change",
550
577
  "keydown"
551
578
  ],
552
- setup(__props, { expose, emit }) {
579
+ setup(__props, { expose: __expose, emit: __emit }) {
553
580
  const props = __props;
581
+ const emit = __emit;
554
582
  const attrs = useAttrs$1();
555
583
  const nsDate = useNamespace("date");
556
584
  const nsInput = useNamespace("input");
557
585
  const nsRange = useNamespace("range");
558
586
  const { formItem } = useFormItem();
559
- const elPopperOptions = inject(PICKER_POPPER_OPTIONS_INJECTION_KEY, {});
587
+ const elPopperOptions = inject(
588
+ PICKER_POPPER_OPTIONS_INJECTION_KEY,
589
+ {}
590
+ );
560
591
  const emptyValues = useEmptyValues(props, null);
561
592
  const refPopper = ref();
562
593
  const inputRef = ref();
@@ -640,7 +671,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
640
671
  };
641
672
  const refInput = computed(() => {
642
673
  if (inputRef.value) {
643
- return Array.from(inputRef.value.$el.querySelectorAll("input"));
674
+ return Array.from(
675
+ inputRef.value.$el.querySelectorAll("input")
676
+ );
644
677
  }
645
678
  return [];
646
679
  });
@@ -697,13 +730,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
697
730
  const isDatesPicker = computed(() => props.type === "dates");
698
731
  const isMonthsPicker = computed(() => props.type === "months");
699
732
  const isYearsPicker = computed(() => props.type === "years");
700
- const triggerIcon = computed(() => props.prefixIcon || (isTimeLikePicker.value ? Clock : Calendar));
701
- const showClearBtn = computed(() => props.clearable && !pickerDisabled.value && !props.readonly && !valueIsEmpty.value && (hovering.value || isFocused.value));
702
- const onClearIconClick = (event) => {
733
+ const triggerIcon = computed(
734
+ () => props.prefixIcon || (isTimeLikePicker.value ? Clock : Calendar)
735
+ );
736
+ const showClearBtn = computed(
737
+ () => props.clearable && !pickerDisabled.value && !props.readonly && !valueIsEmpty.value && (hovering.value || isFocused.value)
738
+ );
739
+ const onClear = (event) => {
703
740
  if (props.readonly || pickerDisabled.value)
704
741
  return;
705
742
  if (showClearBtn.value) {
706
- event.stopPropagation();
743
+ event == null ? void 0 : event.stopPropagation();
707
744
  if (pickerOptions.value.handleClear) {
708
745
  pickerOptions.value.handleClear();
709
746
  } else {
@@ -748,13 +785,16 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
748
785
  var _a, _b;
749
786
  return (_b = (_a = unref(refPopper)) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
750
787
  });
751
- const stophandle = onClickOutside(inputRef, (e) => {
752
- const unrefedPopperEl = unref(popperEl);
753
- const inputEl = unrefElement(inputRef);
754
- if (unrefedPopperEl && (e.target === unrefedPopperEl || e.composedPath().includes(unrefedPopperEl)) || e.target === inputEl || inputEl && e.composedPath().includes(inputEl))
755
- return;
756
- pickerVisible.value = false;
757
- });
788
+ const stophandle = onClickOutside(
789
+ inputRef,
790
+ (e) => {
791
+ const unrefedPopperEl = unref(popperEl);
792
+ const inputEl = unrefElement(inputRef);
793
+ if (unrefedPopperEl && (e.target === unrefedPopperEl || e.composedPath().includes(unrefedPopperEl)) || e.target === inputEl || inputEl && e.composedPath().includes(inputEl))
794
+ return;
795
+ pickerVisible.value = false;
796
+ }
797
+ );
758
798
  onBeforeUnmount(() => {
759
799
  stophandle == null ? void 0 : stophandle();
760
800
  });
@@ -907,7 +947,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
907
947
  emptyValues
908
948
  });
909
949
  provide(ROOT_COMMON_PICKER_INJECTION_KEY, commonPicker);
910
- expose({
950
+ __expose({
911
951
  focus,
912
952
  blur,
913
953
  handleOpen,
@@ -940,13 +980,13 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
940
980
  onHide
941
981
  }), {
942
982
  default: withCtx(() => [
943
- !unref(isRangeInput) ? (openBlock(), createBlock(unref(ElInput), {
983
+ !isRangeInput.value ? (openBlock(), createBlock(unref(ElInput), {
944
984
  key: 0,
945
985
  id: _ctx.id,
946
986
  ref_key: "inputRef",
947
987
  ref: inputRef,
948
988
  "container-role": "combobox",
949
- "model-value": unref(displayValue),
989
+ "model-value": displayValue.value,
950
990
  name: _ctx.name,
951
991
  size: unref(pickerSize),
952
992
  disabled: unref(pickerDisabled),
@@ -958,7 +998,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
958
998
  _ctx.$attrs.class
959
999
  ]),
960
1000
  style: normalizeStyle(_ctx.$attrs.style),
961
- readonly: !_ctx.editable || _ctx.readonly || unref(isDatesPicker) || unref(isMonthsPicker) || unref(isYearsPicker) || _ctx.type === "week",
1001
+ readonly: !_ctx.editable || _ctx.readonly || isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value || _ctx.type === "week",
962
1002
  "aria-label": _ctx.ariaLabel,
963
1003
  tabindex: _ctx.tabindex,
964
1004
  "validate-event": false,
@@ -971,28 +1011,28 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
971
1011
  onMouseenter: onMouseEnter,
972
1012
  onMouseleave: onMouseLeave,
973
1013
  onTouchstartPassive: onTouchStartInput,
974
- onClick: withModifiers(() => {
975
- }, ["stop"])
1014
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
1015
+ }, ["stop"]))
976
1016
  }, {
977
1017
  prefix: withCtx(() => [
978
- unref(triggerIcon) ? (openBlock(), createBlock(unref(ElIcon), {
1018
+ triggerIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
979
1019
  key: 0,
980
1020
  class: normalizeClass(unref(nsInput).e("icon")),
981
1021
  onMousedown: withModifiers(onMouseDownInput, ["prevent"]),
982
1022
  onTouchstartPassive: onTouchStartInput
983
1023
  }, {
984
1024
  default: withCtx(() => [
985
- (openBlock(), createBlock(resolveDynamicComponent(unref(triggerIcon))))
1025
+ (openBlock(), createBlock(resolveDynamicComponent(triggerIcon.value)))
986
1026
  ]),
987
1027
  _: 1
988
- }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)
1028
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
989
1029
  ]),
990
1030
  suffix: withCtx(() => [
991
- unref(showClearBtn) && _ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
1031
+ showClearBtn.value && _ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
992
1032
  key: 0,
993
1033
  class: normalizeClass(`${unref(nsInput).e("icon")} clear-icon`),
994
1034
  onMousedown: withModifiers(unref(NOOP), ["prevent"]),
995
- onClick: onClearIconClick
1035
+ onClick: onClear
996
1036
  }, {
997
1037
  default: withCtx(() => [
998
1038
  (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
@@ -1001,18 +1041,18 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1001
1041
  }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)
1002
1042
  ]),
1003
1043
  _: 1
1004
- }, 8, ["id", "model-value", "name", "size", "disabled", "placeholder", "class", "style", "readonly", "aria-label", "tabindex", "onFocus", "onBlur", "onClick"])) : (openBlock(), createBlock(PickerRangeTrigger, {
1044
+ }, 8, ["id", "model-value", "name", "size", "disabled", "placeholder", "class", "style", "readonly", "aria-label", "tabindex", "onFocus", "onBlur"])) : (openBlock(), createBlock(PickerRangeTrigger, {
1005
1045
  key: 1,
1006
1046
  id: _ctx.id,
1007
1047
  ref_key: "inputRef",
1008
1048
  ref: inputRef,
1009
- "model-value": unref(displayValue),
1049
+ "model-value": displayValue.value,
1010
1050
  name: _ctx.name,
1011
1051
  disabled: unref(pickerDisabled),
1012
1052
  readonly: !_ctx.editable || _ctx.readonly,
1013
1053
  "start-placeholder": _ctx.startPlaceholder,
1014
1054
  "end-placeholder": _ctx.endPlaceholder,
1015
- class: normalizeClass(unref(rangeInputKls)),
1055
+ class: normalizeClass(rangeInputKls.value),
1016
1056
  style: normalizeStyle(_ctx.$attrs.style),
1017
1057
  "aria-label": _ctx.ariaLabel,
1018
1058
  tabindex: _ctx.tabindex,
@@ -1032,29 +1072,34 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1032
1072
  onKeydown: handleKeydownInput
1033
1073
  }, {
1034
1074
  prefix: withCtx(() => [
1035
- unref(triggerIcon) ? (openBlock(), createBlock(unref(ElIcon), {
1075
+ triggerIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
1036
1076
  key: 0,
1037
1077
  class: normalizeClass([unref(nsInput).e("icon"), unref(nsRange).e("icon")])
1038
1078
  }, {
1039
1079
  default: withCtx(() => [
1040
- (openBlock(), createBlock(resolveDynamicComponent(unref(triggerIcon))))
1080
+ (openBlock(), createBlock(resolveDynamicComponent(triggerIcon.value)))
1041
1081
  ]),
1042
1082
  _: 1
1043
1083
  }, 8, ["class"])) : createCommentVNode("v-if", true)
1044
1084
  ]),
1045
1085
  "range-separator": withCtx(() => [
1046
1086
  renderSlot(_ctx.$slots, "range-separator", {}, () => [
1047
- createElementVNode("span", {
1048
- class: normalizeClass(unref(nsRange).b("separator"))
1049
- }, toDisplayString(_ctx.rangeSeparator), 3)
1087
+ createElementVNode(
1088
+ "span",
1089
+ {
1090
+ class: normalizeClass(unref(nsRange).b("separator"))
1091
+ },
1092
+ toDisplayString(_ctx.rangeSeparator),
1093
+ 3
1094
+ )
1050
1095
  ])
1051
1096
  ]),
1052
1097
  suffix: withCtx(() => [
1053
1098
  _ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
1054
1099
  key: 0,
1055
- class: normalizeClass(unref(clearIconKls)),
1100
+ class: normalizeClass(clearIconKls.value),
1056
1101
  onMousedown: withModifiers(unref(NOOP), ["prevent"]),
1057
- onClick: onClearIconClick
1102
+ onClick: onClear
1058
1103
  }, {
1059
1104
  default: withCtx(() => [
1060
1105
  (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
@@ -1080,13 +1125,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1080
1125
  showConfirm: _ctx.showConfirm,
1081
1126
  showFooter: _ctx.showFooter,
1082
1127
  showWeekNumber: _ctx.showWeekNumber,
1083
- onPick: unref(onPick),
1128
+ onPick: _cache[1] || (_cache[1] = (...args) => unref(onPick) && unref(onPick)(...args)),
1084
1129
  onSelectRange: setSelectionRange,
1085
- onSetPickerOption: unref(onSetPickerOption),
1086
- onCalendarChange: unref(onCalendarChange),
1087
- onPanelChange: unref(onPanelChange),
1088
- onMousedown: withModifiers(() => {
1089
- }, ["stop"])
1130
+ onSetPickerOption: _cache[2] || (_cache[2] = (...args) => unref(onSetPickerOption) && unref(onSetPickerOption)(...args)),
1131
+ onCalendarChange: _cache[3] || (_cache[3] = (...args) => unref(onCalendarChange) && unref(onCalendarChange)(...args)),
1132
+ onClear,
1133
+ onPanelChange: _cache[4] || (_cache[4] = (...args) => unref(onPanelChange) && unref(onPanelChange)(...args)),
1134
+ onMousedown: _cache[5] || (_cache[5] = withModifiers(() => {
1135
+ }, ["stop"]))
1090
1136
  })
1091
1137
  ]),
1092
1138
  _: 3
@@ -1094,7 +1140,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1094
1140
  };
1095
1141
  }
1096
1142
  });
1097
- var CommonPicker = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "picker.vue"]]);
1143
+ var CommonPicker = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/time-picker/src/common/picker.vue"]]);
1098
1144
 
1099
1145
  const panelTimePickerProps = buildProps({
1100
1146
  ...timePanelSharedProps,
@@ -1122,15 +1168,27 @@ const useTimePanel = ({
1122
1168
  const method = availableTimeGetters[type];
1123
1169
  switch (type) {
1124
1170
  case "minute": {
1125
- availableTimeSlots = method(result.hour(), role, compareDate);
1171
+ availableTimeSlots = method(
1172
+ result.hour(),
1173
+ role,
1174
+ compareDate
1175
+ );
1126
1176
  break;
1127
1177
  }
1128
1178
  case "second": {
1129
- availableTimeSlots = method(result.hour(), result.minute(), role, compareDate);
1179
+ availableTimeSlots = method(
1180
+ result.hour(),
1181
+ result.minute(),
1182
+ role,
1183
+ compareDate
1184
+ );
1130
1185
  break;
1131
1186
  }
1132
1187
  default: {
1133
- availableTimeSlots = method(role, compareDate);
1188
+ availableTimeSlots = method(
1189
+ role,
1190
+ compareDate
1191
+ );
1134
1192
  break;
1135
1193
  }
1136
1194
  }
@@ -1163,10 +1221,16 @@ const getTimeLists = (disabledHours, disabledMinutes, disabledSeconds) => {
1163
1221
  return makeList(24, disabledHours && (() => disabledHours == null ? void 0 : disabledHours(role, compare)));
1164
1222
  };
1165
1223
  const getMinutesList = (hour, role, compare) => {
1166
- return makeList(60, disabledMinutes && (() => disabledMinutes == null ? void 0 : disabledMinutes(hour, role, compare)));
1224
+ return makeList(
1225
+ 60,
1226
+ disabledMinutes && (() => disabledMinutes == null ? void 0 : disabledMinutes(hour, role, compare))
1227
+ );
1167
1228
  };
1168
1229
  const getSecondsList = (hour, minute, role, compare) => {
1169
- return makeList(60, disabledSeconds && (() => disabledSeconds == null ? void 0 : disabledSeconds(hour, minute, role, compare)));
1230
+ return makeList(
1231
+ 60,
1232
+ disabledSeconds && (() => disabledSeconds == null ? void 0 : disabledSeconds(hour, minute, role, compare))
1233
+ );
1170
1234
  };
1171
1235
  return {
1172
1236
  getHoursList,
@@ -1175,7 +1239,11 @@ const getTimeLists = (disabledHours, disabledMinutes, disabledSeconds) => {
1175
1239
  };
1176
1240
  };
1177
1241
  const buildAvailableTimeSlotGetter = (disabledHours, disabledMinutes, disabledSeconds) => {
1178
- const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(disabledHours, disabledMinutes, disabledSeconds);
1242
+ const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(
1243
+ disabledHours,
1244
+ disabledMinutes,
1245
+ disabledSeconds
1246
+ );
1179
1247
  const getAvailableHours = (role, compare) => {
1180
1248
  return makeAvailableArr(getHoursList(role, compare));
1181
1249
  };
@@ -1193,11 +1261,14 @@ const buildAvailableTimeSlotGetter = (disabledHours, disabledMinutes, disabledSe
1193
1261
  };
1194
1262
  const useOldValue = (props) => {
1195
1263
  const oldValue = ref(props.parsedValue);
1196
- watch(() => props.visible, (val) => {
1197
- if (!val) {
1198
- oldValue.value = props.parsedValue;
1264
+ watch(
1265
+ () => props.visible,
1266
+ (val) => {
1267
+ if (!val) {
1268
+ oldValue.value = props.parsedValue;
1269
+ }
1199
1270
  }
1200
- });
1271
+ );
1201
1272
  return oldValue;
1202
1273
  };
1203
1274
 
@@ -1222,16 +1293,23 @@ const basicTimeSpinnerProps = buildProps({
1222
1293
  ...disabledTimeListsProps
1223
1294
  });
1224
1295
 
1225
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1296
+ const _hoisted_1$7 = ["onClick"];
1297
+ const _hoisted_2$7 = ["onMouseenter"];
1298
+ const _sfc_main$9 = defineComponent({
1226
1299
  __name: "basic-time-spinner",
1227
1300
  props: basicTimeSpinnerProps,
1228
1301
  emits: [CHANGE_EVENT, "select-range", "set-option"],
1229
- setup(__props, { emit }) {
1302
+ setup(__props, { emit: __emit }) {
1230
1303
  const props = __props;
1231
1304
  const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
1232
1305
  const { isRange, format } = pickerBase.props;
1306
+ const emit = __emit;
1233
1307
  const ns = useNamespace("time");
1234
- const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(props.disabledHours, props.disabledMinutes, props.disabledSeconds);
1308
+ const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(
1309
+ props.disabledHours,
1310
+ props.disabledMinutes,
1311
+ props.disabledSeconds
1312
+ );
1235
1313
  let isScrolling = false;
1236
1314
  const currentScrollbar = ref();
1237
1315
  const listHoursRef = ref();
@@ -1325,7 +1403,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1325
1403
  return;
1326
1404
  const scrollbar = unref(listRefsMap[type]);
1327
1405
  if (scrollbar && scrollbar.$el) {
1328
- getScrollbarElement(scrollbar.$el).scrollTop = Math.max(0, value * typeItemHeight(type));
1406
+ getScrollbarElement(scrollbar.$el).scrollTop = Math.max(
1407
+ 0,
1408
+ value * typeItemHeight(type)
1409
+ );
1329
1410
  }
1330
1411
  };
1331
1412
  const typeItemHeight = (type) => {
@@ -1395,7 +1476,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1395
1476
  return;
1396
1477
  isScrolling = true;
1397
1478
  debouncedResetScroll(type);
1398
- const value = Math.min(Math.round((getScrollbarElement(scrollbar.$el).scrollTop - (scrollBarHeight(type) * 0.5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)), type === "hours" ? 23 : 59);
1479
+ const value = Math.min(
1480
+ Math.round(
1481
+ (getScrollbarElement(scrollbar.$el).scrollTop - (scrollBarHeight(type) * 0.5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)
1482
+ ),
1483
+ type === "hours" ? 23 : 59
1484
+ );
1399
1485
  modifyDateField(type, value);
1400
1486
  };
1401
1487
  const scrollBarHeight = (type) => {
@@ -1427,112 +1513,188 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1427
1513
  };
1428
1514
  emit("set-option", [`${props.role}_scrollDown`, scrollDown]);
1429
1515
  emit("set-option", [`${props.role}_emitSelectRange`, emitSelectRange]);
1430
- watch(() => props.spinnerDate, () => {
1431
- if (isScrolling)
1432
- return;
1433
- adjustSpinners();
1434
- });
1516
+ watch(
1517
+ () => props.spinnerDate,
1518
+ () => {
1519
+ if (isScrolling)
1520
+ return;
1521
+ adjustSpinners();
1522
+ }
1523
+ );
1435
1524
  return (_ctx, _cache) => {
1436
- return openBlock(), createElementBlock("div", {
1437
- class: normalizeClass([unref(ns).b("spinner"), { "has-seconds": _ctx.showSeconds }])
1438
- }, [
1439
- !_ctx.arrowControl ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(spinnerItems), (item) => {
1440
- return openBlock(), createBlock(unref(ElScrollbar), {
1441
- key: item,
1442
- ref_for: true,
1443
- ref: (scrollbar) => setRef(scrollbar, item),
1444
- class: normalizeClass(unref(ns).be("spinner", "wrapper")),
1445
- "wrap-style": "max-height: inherit;",
1446
- "view-class": unref(ns).be("spinner", "list"),
1447
- noresize: "",
1448
- tag: "ul",
1449
- onMouseenter: ($event) => emitSelectRange(item),
1450
- onMousemove: ($event) => adjustCurrentSpinner(item)
1451
- }, {
1452
- default: withCtx(() => [
1453
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(timeList)[item], (disabled, key) => {
1454
- return openBlock(), createElementBlock("li", {
1455
- key,
1456
- class: normalizeClass([
1457
- unref(ns).be("spinner", "item"),
1458
- unref(ns).is("active", key === unref(timePartials)[item]),
1459
- unref(ns).is("disabled", disabled)
1525
+ return openBlock(), createElementBlock(
1526
+ "div",
1527
+ {
1528
+ class: normalizeClass([unref(ns).b("spinner"), { "has-seconds": _ctx.showSeconds }])
1529
+ },
1530
+ [
1531
+ !_ctx.arrowControl ? (openBlock(true), createElementBlock(
1532
+ Fragment,
1533
+ { key: 0 },
1534
+ renderList(spinnerItems.value, (item) => {
1535
+ return openBlock(), createBlock(unref(ElScrollbar), {
1536
+ key: item,
1537
+ ref_for: true,
1538
+ ref: (scrollbar) => setRef(scrollbar, item),
1539
+ class: normalizeClass(unref(ns).be("spinner", "wrapper")),
1540
+ "wrap-style": "max-height: inherit;",
1541
+ "view-class": unref(ns).be("spinner", "list"),
1542
+ noresize: "",
1543
+ tag: "ul",
1544
+ onMouseenter: ($event) => emitSelectRange(item),
1545
+ onMousemove: ($event) => adjustCurrentSpinner(item)
1546
+ }, {
1547
+ default: withCtx(() => [
1548
+ (openBlock(true), createElementBlock(
1549
+ Fragment,
1550
+ null,
1551
+ renderList(timeList.value[item], (disabled, key) => {
1552
+ return openBlock(), createElementBlock("li", {
1553
+ key,
1554
+ class: normalizeClass([
1555
+ unref(ns).be("spinner", "item"),
1556
+ unref(ns).is("active", key === timePartials.value[item]),
1557
+ unref(ns).is("disabled", disabled)
1558
+ ]),
1559
+ onClick: ($event) => handleClick(item, { value: key, disabled })
1560
+ }, [
1561
+ item === "hours" ? (openBlock(), createElementBlock(
1562
+ Fragment,
1563
+ { key: 0 },
1564
+ [
1565
+ createTextVNode(
1566
+ toDisplayString(("0" + (_ctx.amPmMode ? key % 12 || 12 : key)).slice(-2)) + toDisplayString(getAmPmFlag(key)),
1567
+ 1
1568
+ )
1569
+ ],
1570
+ 64
1571
+ )) : (openBlock(), createElementBlock(
1572
+ Fragment,
1573
+ { key: 1 },
1574
+ [
1575
+ createTextVNode(
1576
+ toDisplayString(("0" + key).slice(-2)),
1577
+ 1
1578
+ )
1579
+ ],
1580
+ 64
1581
+ ))
1582
+ ], 10, _hoisted_1$7);
1583
+ }),
1584
+ 128
1585
+ ))
1586
+ ]),
1587
+ _: 2
1588
+ }, 1032, ["class", "view-class", "onMouseenter", "onMousemove"]);
1589
+ }),
1590
+ 128
1591
+ )) : createCommentVNode("v-if", true),
1592
+ _ctx.arrowControl ? (openBlock(true), createElementBlock(
1593
+ Fragment,
1594
+ { key: 1 },
1595
+ renderList(spinnerItems.value, (item) => {
1596
+ return openBlock(), createElementBlock("div", {
1597
+ key: item,
1598
+ class: normalizeClass([unref(ns).be("spinner", "wrapper"), unref(ns).is("arrow")]),
1599
+ onMouseenter: ($event) => emitSelectRange(item)
1600
+ }, [
1601
+ withDirectives((openBlock(), createBlock(unref(ElIcon), {
1602
+ class: normalizeClass(["arrow-up", unref(ns).be("spinner", "arrow")])
1603
+ }, {
1604
+ default: withCtx(() => [
1605
+ createVNode(unref(ArrowUp))
1460
1606
  ]),
1461
- onClick: ($event) => handleClick(item, { value: key, disabled })
1462
- }, [
1463
- item === "hours" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1464
- createTextVNode(toDisplayString(("0" + (_ctx.amPmMode ? key % 12 || 12 : key)).slice(-2)) + toDisplayString(getAmPmFlag(key)), 1)
1465
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1466
- createTextVNode(toDisplayString(("0" + key).slice(-2)), 1)
1467
- ], 64))
1468
- ], 10, ["onClick"]);
1469
- }), 128))
1470
- ]),
1471
- _: 2
1472
- }, 1032, ["class", "view-class", "onMouseenter", "onMousemove"]);
1473
- }), 128)) : createCommentVNode("v-if", true),
1474
- _ctx.arrowControl ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(spinnerItems), (item) => {
1475
- return openBlock(), createElementBlock("div", {
1476
- key: item,
1477
- class: normalizeClass([unref(ns).be("spinner", "wrapper"), unref(ns).is("arrow")]),
1478
- onMouseenter: ($event) => emitSelectRange(item)
1479
- }, [
1480
- withDirectives((openBlock(), createBlock(unref(ElIcon), {
1481
- class: normalizeClass(["arrow-up", unref(ns).be("spinner", "arrow")])
1482
- }, {
1483
- default: withCtx(() => [
1484
- createVNode(unref(ArrowUp))
1485
- ]),
1486
- _: 1
1487
- }, 8, ["class"])), [
1488
- [unref(vRepeatClick), onDecrement]
1489
- ]),
1490
- withDirectives((openBlock(), createBlock(unref(ElIcon), {
1491
- class: normalizeClass(["arrow-down", unref(ns).be("spinner", "arrow")])
1492
- }, {
1493
- default: withCtx(() => [
1494
- createVNode(unref(ArrowDown))
1495
- ]),
1496
- _: 1
1497
- }, 8, ["class"])), [
1498
- [unref(vRepeatClick), onIncrement]
1499
- ]),
1500
- createElementVNode("ul", {
1501
- class: normalizeClass(unref(ns).be("spinner", "list"))
1502
- }, [
1503
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(arrowControlTimeList)[item], (time, key) => {
1504
- return openBlock(), createElementBlock("li", {
1505
- key,
1506
- class: normalizeClass([
1507
- unref(ns).be("spinner", "item"),
1508
- unref(ns).is("active", time === unref(timePartials)[item]),
1509
- unref(ns).is("disabled", unref(timeList)[item][time])
1510
- ])
1511
- }, [
1512
- unref(isNumber)(time) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1513
- item === "hours" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1514
- createTextVNode(toDisplayString(("0" + (_ctx.amPmMode ? time % 12 || 12 : time)).slice(-2)) + toDisplayString(getAmPmFlag(time)), 1)
1515
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1516
- createTextVNode(toDisplayString(("0" + time).slice(-2)), 1)
1517
- ], 64))
1518
- ], 64)) : createCommentVNode("v-if", true)
1519
- ], 2);
1520
- }), 128))
1521
- ], 2)
1522
- ], 42, ["onMouseenter"]);
1523
- }), 128)) : createCommentVNode("v-if", true)
1524
- ], 2);
1607
+ _: 1
1608
+ }, 8, ["class"])), [
1609
+ [unref(vRepeatClick), onDecrement]
1610
+ ]),
1611
+ withDirectives((openBlock(), createBlock(unref(ElIcon), {
1612
+ class: normalizeClass(["arrow-down", unref(ns).be("spinner", "arrow")])
1613
+ }, {
1614
+ default: withCtx(() => [
1615
+ createVNode(unref(ArrowDown))
1616
+ ]),
1617
+ _: 1
1618
+ }, 8, ["class"])), [
1619
+ [unref(vRepeatClick), onIncrement]
1620
+ ]),
1621
+ createElementVNode(
1622
+ "ul",
1623
+ {
1624
+ class: normalizeClass(unref(ns).be("spinner", "list"))
1625
+ },
1626
+ [
1627
+ (openBlock(true), createElementBlock(
1628
+ Fragment,
1629
+ null,
1630
+ renderList(arrowControlTimeList.value[item], (time, key) => {
1631
+ return openBlock(), createElementBlock(
1632
+ "li",
1633
+ {
1634
+ key,
1635
+ class: normalizeClass([
1636
+ unref(ns).be("spinner", "item"),
1637
+ unref(ns).is("active", time === timePartials.value[item]),
1638
+ unref(ns).is("disabled", timeList.value[item][time])
1639
+ ])
1640
+ },
1641
+ [
1642
+ unref(isNumber)(time) ? (openBlock(), createElementBlock(
1643
+ Fragment,
1644
+ { key: 0 },
1645
+ [
1646
+ item === "hours" ? (openBlock(), createElementBlock(
1647
+ Fragment,
1648
+ { key: 0 },
1649
+ [
1650
+ createTextVNode(
1651
+ toDisplayString(("0" + (_ctx.amPmMode ? time % 12 || 12 : time)).slice(-2)) + toDisplayString(getAmPmFlag(time)),
1652
+ 1
1653
+ )
1654
+ ],
1655
+ 64
1656
+ )) : (openBlock(), createElementBlock(
1657
+ Fragment,
1658
+ { key: 1 },
1659
+ [
1660
+ createTextVNode(
1661
+ toDisplayString(("0" + time).slice(-2)),
1662
+ 1
1663
+ )
1664
+ ],
1665
+ 64
1666
+ ))
1667
+ ],
1668
+ 64
1669
+ )) : createCommentVNode("v-if", true)
1670
+ ],
1671
+ 2
1672
+ );
1673
+ }),
1674
+ 128
1675
+ ))
1676
+ ],
1677
+ 2
1678
+ )
1679
+ ], 42, _hoisted_2$7);
1680
+ }),
1681
+ 128
1682
+ )) : createCommentVNode("v-if", true)
1683
+ ],
1684
+ 2
1685
+ );
1525
1686
  };
1526
1687
  }
1527
1688
  });
1528
- var TimeSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "basic-time-spinner.vue"]]);
1689
+ var TimeSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/time-picker/src/time-picker-com/basic-time-spinner.vue"]]);
1529
1690
 
1530
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1691
+ const _sfc_main$8 = defineComponent({
1531
1692
  __name: "panel-time-pick",
1532
1693
  props: panelTimePickerProps,
1533
1694
  emits: ["pick", "select-range", "set-picker-option"],
1534
- setup(__props, { emit }) {
1695
+ setup(__props, { emit: __emit }) {
1535
1696
  const props = __props;
1697
+ const emit = __emit;
1536
1698
  const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
1537
1699
  const {
1538
1700
  arrowControl,
@@ -1648,52 +1810,77 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1648
1810
  emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
1649
1811
  emit("set-picker-option", ["getDefaultValue", getDefaultValue]);
1650
1812
  return (_ctx, _cache) => {
1651
- return openBlock(), createBlock(Transition, { name: unref(transitionName) }, {
1813
+ return openBlock(), createBlock(Transition, { name: transitionName.value }, {
1652
1814
  default: withCtx(() => [
1653
- _ctx.actualVisible || _ctx.visible ? (openBlock(), createElementBlock("div", {
1654
- key: 0,
1655
- class: normalizeClass(unref(ns).b("panel"))
1656
- }, [
1657
- createElementVNode("div", {
1658
- class: normalizeClass([unref(ns).be("panel", "content"), { "has-seconds": unref(showSeconds) }])
1659
- }, [
1660
- createVNode(TimeSpinner, {
1661
- ref: "spinner",
1662
- role: _ctx.datetimeRole || "start",
1663
- "arrow-control": unref(arrowControl),
1664
- "show-seconds": unref(showSeconds),
1665
- "am-pm-mode": unref(amPmMode),
1666
- "spinner-date": _ctx.parsedValue,
1667
- "disabled-hours": unref(disabledHours),
1668
- "disabled-minutes": unref(disabledMinutes),
1669
- "disabled-seconds": unref(disabledSeconds),
1670
- onChange: handleChange,
1671
- onSetOption: unref(onSetOption),
1672
- onSelectRange: setSelectionRange
1673
- }, null, 8, ["role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption"])
1674
- ], 2),
1675
- createElementVNode("div", {
1676
- class: normalizeClass(unref(ns).be("panel", "footer"))
1677
- }, [
1678
- createElementVNode("button", {
1679
- type: "button",
1680
- class: normalizeClass([unref(ns).be("panel", "btn"), "cancel"]),
1681
- onClick: handleCancel
1682
- }, toDisplayString(unref(t)("el.datepicker.cancel")), 3),
1683
- createElementVNode("button", {
1684
- type: "button",
1685
- class: normalizeClass([unref(ns).be("panel", "btn"), "confirm"]),
1686
- onClick: ($event) => handleConfirm()
1687
- }, toDisplayString(unref(t)("el.datepicker.confirm")), 11, ["onClick"])
1688
- ], 2)
1689
- ], 2)) : createCommentVNode("v-if", true)
1815
+ _ctx.actualVisible || _ctx.visible ? (openBlock(), createElementBlock(
1816
+ "div",
1817
+ {
1818
+ key: 0,
1819
+ class: normalizeClass(unref(ns).b("panel"))
1820
+ },
1821
+ [
1822
+ createElementVNode(
1823
+ "div",
1824
+ {
1825
+ class: normalizeClass([unref(ns).be("panel", "content"), { "has-seconds": showSeconds.value }])
1826
+ },
1827
+ [
1828
+ createVNode(TimeSpinner, {
1829
+ ref: "spinner",
1830
+ role: _ctx.datetimeRole || "start",
1831
+ "arrow-control": unref(arrowControl),
1832
+ "show-seconds": showSeconds.value,
1833
+ "am-pm-mode": amPmMode.value,
1834
+ "spinner-date": _ctx.parsedValue,
1835
+ "disabled-hours": unref(disabledHours),
1836
+ "disabled-minutes": unref(disabledMinutes),
1837
+ "disabled-seconds": unref(disabledSeconds),
1838
+ onChange: handleChange,
1839
+ onSetOption: unref(onSetOption),
1840
+ onSelectRange: setSelectionRange
1841
+ }, null, 8, ["role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption"])
1842
+ ],
1843
+ 2
1844
+ ),
1845
+ createElementVNode(
1846
+ "div",
1847
+ {
1848
+ class: normalizeClass(unref(ns).be("panel", "footer"))
1849
+ },
1850
+ [
1851
+ createElementVNode(
1852
+ "button",
1853
+ {
1854
+ type: "button",
1855
+ class: normalizeClass([unref(ns).be("panel", "btn"), "cancel"]),
1856
+ onClick: handleCancel
1857
+ },
1858
+ toDisplayString(unref(t)("el.datepicker.cancel")),
1859
+ 3
1860
+ ),
1861
+ createElementVNode(
1862
+ "button",
1863
+ {
1864
+ type: "button",
1865
+ class: normalizeClass([unref(ns).be("panel", "btn"), "confirm"]),
1866
+ onClick: _cache[0] || (_cache[0] = ($event) => handleConfirm())
1867
+ },
1868
+ toDisplayString(unref(t)("el.datepicker.confirm")),
1869
+ 3
1870
+ )
1871
+ ],
1872
+ 2
1873
+ )
1874
+ ],
1875
+ 2
1876
+ )) : createCommentVNode("v-if", true)
1690
1877
  ]),
1691
1878
  _: 1
1692
1879
  }, 8, ["name"]);
1693
1880
  };
1694
1881
  }
1695
1882
  });
1696
- var TimePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "panel-time-pick.vue"]]);
1883
+ var TimePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/time-picker/src/time-picker-com/panel-time-pick.vue"]]);
1697
1884
 
1698
1885
  var advancedFormat$2 = {exports: {}};
1699
1886
 
@@ -1853,6 +2040,10 @@ const datePickerPanelProps = buildProps({
1853
2040
  border: {
1854
2041
  type: Boolean,
1855
2042
  default: true
2043
+ },
2044
+ editable: {
2045
+ type: Boolean,
2046
+ default: true
1856
2047
  }
1857
2048
  });
1858
2049
 
@@ -1917,7 +2108,11 @@ const panelSharedProps = buildProps({
1917
2108
  },
1918
2109
  showWeekNumber: Boolean,
1919
2110
  border: Boolean,
1920
- disabled: Boolean
2111
+ disabled: Boolean,
2112
+ editable: {
2113
+ type: Boolean,
2114
+ default: true
2115
+ }
1921
2116
  });
1922
2117
  const panelRangeSharedProps = buildProps({
1923
2118
  unlinkPanels: Boolean,
@@ -2062,7 +2257,9 @@ const getValidDateOfYear = (value, lang, disabledDate) => {
2062
2257
  };
2063
2258
  const correctlyParseUserInput = (value, format, lang, defaultFormat) => {
2064
2259
  if (isArray(value)) {
2065
- return value.map((v) => correctlyParseUserInput(v, format, lang, defaultFormat));
2260
+ return value.map(
2261
+ (v) => correctlyParseUserInput(v, format, lang, defaultFormat)
2262
+ );
2066
2263
  }
2067
2264
  if (isString(value)) {
2068
2265
  const dayjsValue = (defaultFormat == null ? void 0 : defaultFormat.value) ? dayjs(value) : dayjs(value, format);
@@ -2101,7 +2298,10 @@ const useBasicDateTable = (props, emit) => {
2101
2298
  return startDayOfMonth.subtract(startDayOfMonth.day() || 7, "day");
2102
2299
  });
2103
2300
  const WEEKS = computed(() => {
2104
- return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(firstDayOfWeek, firstDayOfWeek + 7);
2301
+ return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(
2302
+ firstDayOfWeek,
2303
+ firstDayOfWeek + 7
2304
+ );
2105
2305
  });
2106
2306
  const hasCurrent = computed(() => {
2107
2307
  return flatten(unref(rows)).some((row) => {
@@ -2199,13 +2399,16 @@ const useBasicDateTable = (props, emit) => {
2199
2399
  }
2200
2400
  return rows_;
2201
2401
  });
2202
- watch(() => props.date, async () => {
2203
- var _a;
2204
- if ((_a = unref(tbodyRef)) == null ? void 0 : _a.contains(document.activeElement)) {
2205
- await nextTick();
2206
- await focus();
2402
+ watch(
2403
+ () => props.date,
2404
+ async () => {
2405
+ var _a;
2406
+ if ((_a = unref(tbodyRef)) == null ? void 0 : _a.contains(document.activeElement)) {
2407
+ await nextTick();
2408
+ await focus();
2409
+ }
2207
2410
  }
2208
- });
2411
+ );
2209
2412
  const focus = async () => {
2210
2413
  var _a;
2211
2414
  return (_a = unref(currentCellRef)) == null ? void 0 : _a.focus();
@@ -2292,7 +2495,9 @@ const useBasicDateTable = (props, emit) => {
2292
2495
  });
2293
2496
  };
2294
2497
  const handleDatesPick = (newDate, selected) => {
2295
- const newValue = selected ? castArray(props.parsedValue).filter((d) => (d == null ? void 0 : d.valueOf()) !== newDate.valueOf()) : castArray(props.parsedValue).concat([newDate]);
2498
+ const newValue = selected ? castArray(props.parsedValue).filter(
2499
+ (d) => (d == null ? void 0 : d.valueOf()) !== newDate.valueOf()
2500
+ ) : castArray(props.parsedValue).concat([newDate]);
2296
2501
  emit("pick", newValue);
2297
2502
  };
2298
2503
  const handlePickDate = (event, isKeyboardMovement = false) => {
@@ -2450,12 +2655,16 @@ var ElDatePickerCell = defineComponent({
2450
2655
  }
2451
2656
  });
2452
2657
 
2453
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2658
+ const _hoisted_1$6 = ["aria-label"];
2659
+ const _hoisted_2$6 = ["aria-label"];
2660
+ const _hoisted_3$4 = ["aria-current", "aria-selected", "tabindex", "aria-disabled"];
2661
+ const _sfc_main$7 = defineComponent({
2454
2662
  __name: "basic-date-table",
2455
2663
  props: basicDateTableProps,
2456
2664
  emits: basicDateTableEmits,
2457
- setup(__props, { expose, emit }) {
2665
+ setup(__props, { expose: __expose, emit: __emit }) {
2458
2666
  const props = __props;
2667
+ const emit = __emit;
2459
2668
  const {
2460
2669
  WEEKS,
2461
2670
  rows,
@@ -2479,7 +2688,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2479
2688
  onBeforeUnmount(() => {
2480
2689
  isUnmounting = true;
2481
2690
  });
2482
- expose({
2691
+ __expose({
2483
2692
  focus
2484
2693
  });
2485
2694
  return (_ctx, _cache) => {
@@ -2489,74 +2698,109 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2489
2698
  cellspacing: "0",
2490
2699
  cellpadding: "0",
2491
2700
  role: "grid",
2492
- onClick: unref(handlePickDate),
2493
- onMousemove: unref(handleMouseMove),
2494
- onMousedown: unref(handleMouseDown),
2495
- onMouseup: unref(handleMouseUp)
2701
+ onClick: _cache[1] || (_cache[1] = (...args) => unref(handlePickDate) && unref(handlePickDate)(...args)),
2702
+ onMousemove: _cache[2] || (_cache[2] = (...args) => unref(handleMouseMove) && unref(handleMouseMove)(...args)),
2703
+ onMousedown: _cache[3] || (_cache[3] = (...args) => unref(handleMouseDown) && unref(handleMouseDown)(...args)),
2704
+ onMouseup: _cache[4] || (_cache[4] = (...args) => unref(handleMouseUp) && unref(handleMouseUp)(...args))
2496
2705
  }, [
2497
- createElementVNode("tbody", {
2498
- ref_key: "tbodyRef",
2499
- ref: tbodyRef
2500
- }, [
2501
- createElementVNode("tr", null, [
2502
- _ctx.showWeekNumber ? (openBlock(), createElementBlock("th", {
2503
- key: 0,
2504
- scope: "col",
2505
- class: normalizeClass(unref(weekHeaderClass))
2506
- }, null, 2)) : createCommentVNode("v-if", true),
2507
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(WEEKS), (week, key) => {
2508
- return openBlock(), createElementBlock("th", {
2509
- key,
2510
- "aria-label": unref(t)("el.datepicker.weeksFull." + week),
2511
- scope: "col"
2512
- }, toDisplayString(unref(t)("el.datepicker.weeks." + week)), 9, ["aria-label"]);
2513
- }), 128))
2514
- ]),
2515
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, rowKey) => {
2516
- return openBlock(), createElementBlock("tr", {
2517
- key: rowKey,
2518
- class: normalizeClass(unref(getRowKls)(_ctx.showWeekNumber ? row[2] : row[1]))
2519
- }, [
2520
- (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, columnKey) => {
2521
- return openBlock(), createElementBlock("td", {
2522
- key: `${rowKey}.${columnKey}`,
2523
- ref_for: true,
2524
- ref: (el) => !unref(isUnmounting) && unref(isSelectedCell)(cell) && (currentCellRef.value = el),
2525
- class: normalizeClass(unref(getCellClasses)(cell)),
2526
- "aria-current": cell.isCurrent ? "date" : void 0,
2527
- "aria-selected": cell.isCurrent,
2528
- tabindex: _ctx.disabled ? void 0 : unref(isSelectedCell)(cell) ? 0 : -1,
2529
- "aria-disabled": _ctx.disabled,
2530
- onFocus: unref(handleFocus)
2531
- }, [
2532
- createVNode(unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
2533
- ], 42, ["aria-current", "aria-selected", "tabindex", "aria-disabled", "onFocus"]);
2534
- }), 128))
2535
- ], 2);
2536
- }), 128))
2537
- ], 512)
2538
- ], 42, ["aria-label", "onClick", "onMousemove", "onMousedown", "onMouseup"]);
2706
+ createElementVNode(
2707
+ "tbody",
2708
+ {
2709
+ ref_key: "tbodyRef",
2710
+ ref: tbodyRef
2711
+ },
2712
+ [
2713
+ createElementVNode("tr", null, [
2714
+ _ctx.showWeekNumber ? (openBlock(), createElementBlock(
2715
+ "th",
2716
+ {
2717
+ key: 0,
2718
+ scope: "col",
2719
+ class: normalizeClass(unref(weekHeaderClass))
2720
+ },
2721
+ null,
2722
+ 2
2723
+ )) : createCommentVNode("v-if", true),
2724
+ (openBlock(true), createElementBlock(
2725
+ Fragment,
2726
+ null,
2727
+ renderList(unref(WEEKS), (week, key) => {
2728
+ return openBlock(), createElementBlock("th", {
2729
+ key,
2730
+ "aria-label": unref(t)("el.datepicker.weeksFull." + week),
2731
+ scope: "col"
2732
+ }, toDisplayString(unref(t)("el.datepicker.weeks." + week)), 9, _hoisted_2$6);
2733
+ }),
2734
+ 128
2735
+ ))
2736
+ ]),
2737
+ (openBlock(true), createElementBlock(
2738
+ Fragment,
2739
+ null,
2740
+ renderList(unref(rows), (row, rowKey) => {
2741
+ return openBlock(), createElementBlock(
2742
+ "tr",
2743
+ {
2744
+ key: rowKey,
2745
+ class: normalizeClass(unref(getRowKls)(_ctx.showWeekNumber ? row[2] : row[1]))
2746
+ },
2747
+ [
2748
+ (openBlock(true), createElementBlock(
2749
+ Fragment,
2750
+ null,
2751
+ renderList(row, (cell, columnKey) => {
2752
+ return openBlock(), createElementBlock("td", {
2753
+ key: `${rowKey}.${columnKey}`,
2754
+ ref_for: true,
2755
+ ref: (el) => !unref(isUnmounting) && unref(isSelectedCell)(cell) && (currentCellRef.value = el),
2756
+ class: normalizeClass(unref(getCellClasses)(cell)),
2757
+ "aria-current": cell.isCurrent ? "date" : void 0,
2758
+ "aria-selected": cell.isCurrent,
2759
+ tabindex: _ctx.disabled ? void 0 : unref(isSelectedCell)(cell) ? 0 : -1,
2760
+ "aria-disabled": _ctx.disabled,
2761
+ onFocus: _cache[0] || (_cache[0] = (...args) => unref(handleFocus) && unref(handleFocus)(...args))
2762
+ }, [
2763
+ createVNode(unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
2764
+ ], 42, _hoisted_3$4);
2765
+ }),
2766
+ 128
2767
+ ))
2768
+ ],
2769
+ 2
2770
+ );
2771
+ }),
2772
+ 128
2773
+ ))
2774
+ ],
2775
+ 512
2776
+ )
2777
+ ], 42, _hoisted_1$6);
2539
2778
  };
2540
2779
  }
2541
2780
  });
2542
- var DateTable = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "basic-date-table.vue"]]);
2781
+ var DateTable = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/date-picker-panel/src/date-picker-com/basic-date-table.vue"]]);
2543
2782
 
2544
2783
  const basicMonthTableProps = buildProps({
2545
2784
  ...datePickerSharedProps,
2546
2785
  selectionMode: selectionModeWithDefault("month")
2547
2786
  });
2548
2787
 
2549
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2788
+ const _hoisted_1$5 = ["aria-label"];
2789
+ const _hoisted_2$5 = ["aria-selected", "aria-label", "tabindex", "onKeydown"];
2790
+ const _sfc_main$6 = defineComponent({
2550
2791
  __name: "basic-month-table",
2551
2792
  props: basicMonthTableProps,
2552
2793
  emits: ["changerange", "pick", "select"],
2553
- setup(__props, { expose, emit }) {
2794
+ setup(__props, { expose: __expose, emit: __emit }) {
2554
2795
  const props = __props;
2796
+ const emit = __emit;
2555
2797
  const ns = useNamespace("month-table");
2556
2798
  const { t, lang } = useLocale();
2557
2799
  const tbodyRef = ref();
2558
2800
  const currentCellRef = ref();
2559
- const months = ref(props.date.locale("en").localeData().monthsShort().map((_) => _.toLowerCase()));
2801
+ const months = ref(
2802
+ props.date.locale("en").localeData().monthsShort().map((_) => _.toLowerCase())
2803
+ );
2560
2804
  const tableRows = ref([[], [], []]);
2561
2805
  const lastRow = ref();
2562
2806
  const lastColumn = ref();
@@ -2622,8 +2866,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2622
2866
  const year = props.date.year();
2623
2867
  const today = /* @__PURE__ */ new Date();
2624
2868
  const month = cell.text;
2625
- style.disabled = props.disabled || (props.disabledDate ? datesInMonth(props.date, year, month, lang.value).every(props.disabledDate) : false);
2626
- style.current = castArray(props.parsedValue).some((date) => dayjs.isDayjs(date) && date.year() === year && date.month() === month);
2869
+ style.disabled = props.disabled || (props.disabledDate ? datesInMonth(props.date, year, month, lang.value).every(
2870
+ props.disabledDate
2871
+ ) : false);
2872
+ style.current = castArray(props.parsedValue).some(
2873
+ (date) => dayjs.isDayjs(date) && date.year() === year && date.month() === month
2874
+ );
2627
2875
  style.today = today.getFullYear() === year && today.getMonth() === month;
2628
2876
  if (cell.customClass) {
2629
2877
  style[cell.customClass] = true;
@@ -2642,7 +2890,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2642
2890
  const isSelectedCell = (cell) => {
2643
2891
  const year = props.date.year();
2644
2892
  const month = cell.text;
2645
- return castArray(props.date).some((date) => date.year() === year && date.month() === month);
2893
+ return castArray(props.date).some(
2894
+ (date) => date.year() === year && date.month() === month
2895
+ );
2646
2896
  };
2647
2897
  const handleMouseMove = (event) => {
2648
2898
  var _a;
@@ -2674,7 +2924,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2674
2924
  var _a;
2675
2925
  if (props.disabled)
2676
2926
  return;
2677
- const target = (_a = event.target) == null ? void 0 : _a.closest("td");
2927
+ const target = (_a = event.target) == null ? void 0 : _a.closest(
2928
+ "td"
2929
+ );
2678
2930
  if ((target == null ? void 0 : target.tagName) !== "TD")
2679
2931
  return;
2680
2932
  if (hasClass(target, "disabled"))
@@ -2688,8 +2940,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2688
2940
  emit("pick", castArray(props.parsedValue), false);
2689
2941
  return;
2690
2942
  }
2691
- const newMonth = getValidDateOfMonth(props.date, props.date.year(), month, lang.value, props.disabledDate);
2692
- const newValue = hasClass(target, "current") ? castArray(props.parsedValue).filter((d) => (d == null ? void 0 : d.year()) !== newMonth.year() || (d == null ? void 0 : d.month()) !== newMonth.month()) : castArray(props.parsedValue).concat([dayjs(newMonth)]);
2943
+ const newMonth = getValidDateOfMonth(
2944
+ props.date,
2945
+ props.date.year(),
2946
+ month,
2947
+ lang.value,
2948
+ props.disabledDate
2949
+ );
2950
+ const newValue = hasClass(target, "current") ? castArray(props.parsedValue).filter(
2951
+ (d) => (d == null ? void 0 : d.year()) !== newMonth.year() || (d == null ? void 0 : d.month()) !== newMonth.month()
2952
+ ) : castArray(props.parsedValue).concat([dayjs(newMonth)]);
2693
2953
  emit("pick", newValue);
2694
2954
  } else if (props.selectionMode === "range") {
2695
2955
  if (!props.rangeState.selecting) {
@@ -2707,14 +2967,17 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2707
2967
  emit("pick", month);
2708
2968
  }
2709
2969
  };
2710
- watch(() => props.date, async () => {
2711
- var _a, _b;
2712
- if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
2713
- await nextTick();
2714
- (_b = currentCellRef.value) == null ? void 0 : _b.focus();
2970
+ watch(
2971
+ () => props.date,
2972
+ async () => {
2973
+ var _a, _b;
2974
+ if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
2975
+ await nextTick();
2976
+ (_b = currentCellRef.value) == null ? void 0 : _b.focus();
2977
+ }
2715
2978
  }
2716
- });
2717
- expose({
2979
+ );
2980
+ __expose({
2718
2981
  focus
2719
2982
  });
2720
2983
  return (_ctx, _cache) => {
@@ -2725,60 +2988,78 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2725
2988
  onClick: handleMonthTableClick,
2726
2989
  onMousemove: handleMouseMove
2727
2990
  }, [
2728
- createElementVNode("tbody", {
2729
- ref_key: "tbodyRef",
2730
- ref: tbodyRef
2731
- }, [
2732
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, key) => {
2733
- return openBlock(), createElementBlock("tr", { key }, [
2734
- (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key_) => {
2735
- return openBlock(), createElementBlock("td", {
2736
- key: key_,
2737
- ref_for: true,
2738
- ref: (el) => cell.isSelected && (currentCellRef.value = el),
2739
- class: normalizeClass(getCellStyle(cell)),
2740
- "aria-selected": !!cell.isSelected,
2741
- "aria-label": unref(t)(`el.datepicker.month${+cell.text + 1}`),
2742
- tabindex: cell.isSelected ? 0 : -1,
2743
- onKeydown: [
2744
- withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["space"]),
2745
- withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["enter"])
2746
- ]
2747
- }, [
2748
- createVNode(unref(ElDatePickerCell), {
2749
- cell: {
2750
- ...cell,
2751
- renderText: unref(t)("el.datepicker.months." + months.value[cell.text])
2752
- }
2753
- }, null, 8, ["cell"])
2754
- ], 42, ["aria-selected", "aria-label", "tabindex", "onKeydown"]);
2755
- }), 128))
2756
- ]);
2757
- }), 128))
2758
- ], 512)
2759
- ], 42, ["aria-label"]);
2991
+ createElementVNode(
2992
+ "tbody",
2993
+ {
2994
+ ref_key: "tbodyRef",
2995
+ ref: tbodyRef
2996
+ },
2997
+ [
2998
+ (openBlock(true), createElementBlock(
2999
+ Fragment,
3000
+ null,
3001
+ renderList(rows.value, (row, key) => {
3002
+ return openBlock(), createElementBlock("tr", { key }, [
3003
+ (openBlock(true), createElementBlock(
3004
+ Fragment,
3005
+ null,
3006
+ renderList(row, (cell, key_) => {
3007
+ return openBlock(), createElementBlock("td", {
3008
+ key: key_,
3009
+ ref_for: true,
3010
+ ref: (el) => cell.isSelected && (currentCellRef.value = el),
3011
+ class: normalizeClass(getCellStyle(cell)),
3012
+ "aria-selected": !!cell.isSelected,
3013
+ "aria-label": unref(t)(`el.datepicker.month${+cell.text + 1}`),
3014
+ tabindex: cell.isSelected ? 0 : -1,
3015
+ onKeydown: [
3016
+ withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["space"]),
3017
+ withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["enter"])
3018
+ ]
3019
+ }, [
3020
+ createVNode(unref(ElDatePickerCell), {
3021
+ cell: {
3022
+ ...cell,
3023
+ renderText: unref(t)("el.datepicker.months." + months.value[cell.text])
3024
+ }
3025
+ }, null, 8, ["cell"])
3026
+ ], 42, _hoisted_2$5);
3027
+ }),
3028
+ 128
3029
+ ))
3030
+ ]);
3031
+ }),
3032
+ 128
3033
+ ))
3034
+ ],
3035
+ 512
3036
+ )
3037
+ ], 42, _hoisted_1$5);
2760
3038
  };
2761
3039
  }
2762
3040
  });
2763
- var MonthTable = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "basic-month-table.vue"]]);
3041
+ var MonthTable = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/date-picker-panel/src/date-picker-com/basic-month-table.vue"]]);
2764
3042
 
2765
3043
  const basicYearTableProps = buildProps({
2766
3044
  ...datePickerSharedProps,
2767
3045
  selectionMode: selectionModeWithDefault("year")
2768
3046
  });
2769
3047
 
2770
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3048
+ const _hoisted_1$4 = ["aria-label"];
3049
+ const _hoisted_2$4 = ["aria-selected", "aria-label", "tabindex", "onKeydown"];
3050
+ const _sfc_main$5 = defineComponent({
2771
3051
  __name: "basic-year-table",
2772
3052
  props: basicYearTableProps,
2773
3053
  emits: ["changerange", "pick", "select"],
2774
- setup(__props, { expose, emit }) {
2775
- const props = __props;
3054
+ setup(__props, { expose: __expose, emit: __emit }) {
2776
3055
  const datesInYear = (year, lang2) => {
2777
3056
  const firstDay = dayjs(String(year)).locale(lang2).startOf("year");
2778
3057
  const lastDay = firstDay.endOf("year");
2779
3058
  const numOfDays = lastDay.dayOfYear();
2780
3059
  return rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
2781
3060
  };
3061
+ const props = __props;
3062
+ const emit = __emit;
2782
3063
  const ns = useNamespace("year-table");
2783
3064
  const { t, lang } = useLocale();
2784
3065
  const tbodyRef = ref();
@@ -2882,7 +3163,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2882
3163
  var _a;
2883
3164
  if (props.disabled)
2884
3165
  return;
2885
- const target = (_a = event.target) == null ? void 0 : _a.closest("td");
3166
+ const target = (_a = event.target) == null ? void 0 : _a.closest(
3167
+ "td"
3168
+ );
2886
3169
  if (!target || !target.textContent || hasClass(target, "disabled"))
2887
3170
  return;
2888
3171
  const column = target.cellIndex;
@@ -2906,7 +3189,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2906
3189
  emit("pick", castArray(props.parsedValue), false);
2907
3190
  return;
2908
3191
  }
2909
- const vaildYear = getValidDateOfYear(newDate.startOf("year"), lang.value, props.disabledDate);
3192
+ const vaildYear = getValidDateOfYear(
3193
+ newDate.startOf("year"),
3194
+ lang.value,
3195
+ props.disabledDate
3196
+ );
2910
3197
  const newValue = hasClass(target, "current") ? castArray(props.parsedValue).filter((d) => (d == null ? void 0 : d.year()) !== selectedYear) : castArray(props.parsedValue).concat([vaildYear]);
2911
3198
  emit("pick", newValue);
2912
3199
  } else {
@@ -2917,7 +3204,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2917
3204
  var _a;
2918
3205
  if (!props.rangeState.selecting)
2919
3206
  return;
2920
- const target = (_a = event.target) == null ? void 0 : _a.closest("td");
3207
+ const target = (_a = event.target) == null ? void 0 : _a.closest(
3208
+ "td"
3209
+ );
2921
3210
  if (!target)
2922
3211
  return;
2923
3212
  const row = target.parentNode.rowIndex;
@@ -2933,14 +3222,17 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2933
3222
  });
2934
3223
  }
2935
3224
  };
2936
- watch(() => props.date, async () => {
2937
- var _a, _b;
2938
- if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
2939
- await nextTick();
2940
- (_b = currentCellRef.value) == null ? void 0 : _b.focus();
3225
+ watch(
3226
+ () => props.date,
3227
+ async () => {
3228
+ var _a, _b;
3229
+ if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
3230
+ await nextTick();
3231
+ (_b = currentCellRef.value) == null ? void 0 : _b.focus();
3232
+ }
2941
3233
  }
2942
- });
2943
- expose({
3234
+ );
3235
+ __expose({
2944
3236
  focus
2945
3237
  });
2946
3238
  return (_ctx, _cache) => {
@@ -2951,52 +3243,78 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2951
3243
  onClick: handleYearTableClick,
2952
3244
  onMousemove: handleMouseMove
2953
3245
  }, [
2954
- createElementVNode("tbody", {
2955
- ref_key: "tbodyRef",
2956
- ref: tbodyRef
2957
- }, [
2958
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, rowKey) => {
2959
- return openBlock(), createElementBlock("tr", { key: rowKey }, [
2960
- (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, cellKey) => {
2961
- return openBlock(), createElementBlock("td", {
2962
- key: `${rowKey}_${cellKey}`,
2963
- ref_for: true,
2964
- ref: (el) => cell.isSelected && (currentCellRef.value = el),
2965
- class: normalizeClass(["available", getCellKls(cell)]),
2966
- "aria-selected": cell.isSelected,
2967
- "aria-label": String(cell.text),
2968
- tabindex: cell.isSelected ? 0 : -1,
2969
- onKeydown: [
2970
- withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["space"]),
2971
- withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["enter"])
2972
- ]
2973
- }, [
2974
- createVNode(unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
2975
- ], 42, ["aria-selected", "aria-label", "tabindex", "onKeydown"]);
2976
- }), 128))
2977
- ]);
2978
- }), 128))
2979
- ], 512)
2980
- ], 42, ["aria-label"]);
3246
+ createElementVNode(
3247
+ "tbody",
3248
+ {
3249
+ ref_key: "tbodyRef",
3250
+ ref: tbodyRef
3251
+ },
3252
+ [
3253
+ (openBlock(true), createElementBlock(
3254
+ Fragment,
3255
+ null,
3256
+ renderList(rows.value, (row, rowKey) => {
3257
+ return openBlock(), createElementBlock("tr", { key: rowKey }, [
3258
+ (openBlock(true), createElementBlock(
3259
+ Fragment,
3260
+ null,
3261
+ renderList(row, (cell, cellKey) => {
3262
+ return openBlock(), createElementBlock("td", {
3263
+ key: `${rowKey}_${cellKey}`,
3264
+ ref_for: true,
3265
+ ref: (el) => cell.isSelected && (currentCellRef.value = el),
3266
+ class: normalizeClass(["available", getCellKls(cell)]),
3267
+ "aria-selected": cell.isSelected,
3268
+ "aria-label": String(cell.text),
3269
+ tabindex: cell.isSelected ? 0 : -1,
3270
+ onKeydown: [
3271
+ withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["space"]),
3272
+ withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["enter"])
3273
+ ]
3274
+ }, [
3275
+ createVNode(unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
3276
+ ], 42, _hoisted_2$4);
3277
+ }),
3278
+ 128
3279
+ ))
3280
+ ]);
3281
+ }),
3282
+ 128
3283
+ ))
3284
+ ],
3285
+ 512
3286
+ )
3287
+ ], 42, _hoisted_1$4);
2981
3288
  };
2982
3289
  }
2983
3290
  });
2984
- var YearTable = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "basic-year-table.vue"]]);
3291
+ var YearTable = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/date-picker-panel/src/date-picker-com/basic-year-table.vue"]]);
2985
3292
 
2986
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3293
+ const _hoisted_1$3 = ["disabled", "onClick"];
3294
+ const _hoisted_2$3 = ["aria-label", "disabled"];
3295
+ const _hoisted_3$3 = ["aria-label", "disabled"];
3296
+ const _hoisted_4$3 = ["tabindex", "aria-disabled"];
3297
+ const _hoisted_5$3 = ["tabindex", "aria-disabled"];
3298
+ const _hoisted_6$1 = ["aria-label", "disabled"];
3299
+ const _hoisted_7$1 = ["aria-label", "disabled"];
3300
+ const _sfc_main$4 = defineComponent({
2987
3301
  __name: "panel-date-pick",
2988
3302
  props: panelDatePickProps,
2989
3303
  emits: ["pick", "set-picker-option", "panel-change"],
2990
- setup(__props, { emit: contextEmit }) {
2991
- const props = __props;
3304
+ setup(__props, { emit: __emit }) {
2992
3305
  const timeWithinRange = (_, __, ___) => true;
3306
+ const props = __props;
3307
+ const contextEmit = __emit;
2993
3308
  const ppNs = useNamespace("picker-panel");
2994
3309
  const dpNs = useNamespace("date-picker");
2995
3310
  const attrs = useAttrs$1();
2996
3311
  const slots = useSlots();
2997
3312
  const { t, lang } = useLocale();
2998
3313
  const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
2999
- const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
3314
+ const isDefaultFormat = inject(
3315
+ ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,
3316
+ void 0
3317
+ );
3000
3318
  const { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props;
3001
3319
  const defaultValue = toRef(pickerBase.props, "defaultValue");
3002
3320
  const currentViewRef = ref();
@@ -3106,12 +3424,24 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3106
3424
  const hasShortcuts = computed(() => !!shortcuts.length);
3107
3425
  const handleMonthPick = async (month2, keepOpen) => {
3108
3426
  if (selectionMode.value === "month") {
3109
- innerDate.value = getValidDateOfMonth(innerDate.value, innerDate.value.year(), month2, lang.value, disabledDate);
3427
+ innerDate.value = getValidDateOfMonth(
3428
+ innerDate.value,
3429
+ innerDate.value.year(),
3430
+ month2,
3431
+ lang.value,
3432
+ disabledDate
3433
+ );
3110
3434
  emit(innerDate.value, false);
3111
3435
  } else if (selectionMode.value === "months") {
3112
3436
  emit(month2, keepOpen != null ? keepOpen : true);
3113
3437
  } else {
3114
- innerDate.value = getValidDateOfMonth(innerDate.value, innerDate.value.year(), month2, lang.value, disabledDate);
3438
+ innerDate.value = getValidDateOfMonth(
3439
+ innerDate.value,
3440
+ innerDate.value.year(),
3441
+ month2,
3442
+ lang.value,
3443
+ disabledDate
3444
+ );
3115
3445
  currentView.value = "date";
3116
3446
  if (["month", "year", "date", "week"].includes(selectionMode.value)) {
3117
3447
  emit(innerDate.value, true);
@@ -3148,7 +3478,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3148
3478
  await nextTick();
3149
3479
  handleFocusPicker();
3150
3480
  };
3151
- const showTime = computed(() => props.type === "datetime" || props.type === "datetimerange");
3481
+ const showTime = computed(
3482
+ () => props.type === "datetime" || props.type === "datetimerange"
3483
+ );
3152
3484
  const footerVisible = computed(() => {
3153
3485
  const showDateFooter = showTime.value || selectionMode.value === "dates";
3154
3486
  const showYearFooter = selectionMode.value === "years";
@@ -3158,7 +3490,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3158
3490
  const isMonthView = currentView.value === "month";
3159
3491
  return showDateFooter && isDateView || showYearFooter && isYearView || showMonthFooter && isMonthView;
3160
3492
  });
3161
- const footerFilled = computed(() => !isMultipleType.value && props.showNow || props.showConfirm);
3493
+ const footerFilled = computed(
3494
+ () => !isMultipleType.value && props.showNow || props.showConfirm
3495
+ );
3162
3496
  const disabledConfirm = computed(() => {
3163
3497
  if (!disabledDate)
3164
3498
  return false;
@@ -3257,7 +3591,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3257
3591
  }
3258
3592
  };
3259
3593
  const handleVisibleDateChange = (value) => {
3260
- const newDate = correctlyParseUserInput(value, dateFormat.value, lang.value, isDefaultFormat);
3594
+ const newDate = correctlyParseUserInput(
3595
+ value,
3596
+ dateFormat.value,
3597
+ lang.value,
3598
+ isDefaultFormat
3599
+ );
3261
3600
  if (newDate.isValid()) {
3262
3601
  if (disabledDate && disabledDate(newDate.toDate())) {
3263
3602
  return;
@@ -3272,7 +3611,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3272
3611
  return dayjs.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true);
3273
3612
  };
3274
3613
  const parseUserInput = (value) => {
3275
- return correctlyParseUserInput(value, props.format, lang.value, isDefaultFormat);
3614
+ return correctlyParseUserInput(
3615
+ value,
3616
+ props.format,
3617
+ lang.value,
3618
+ isDefaultFormat
3619
+ );
3276
3620
  };
3277
3621
  const getDefaultValue = () => {
3278
3622
  const parseDate = dayjs(defaultValue.value).locale(lang.value);
@@ -3311,7 +3655,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3311
3655
  event.stopPropagation();
3312
3656
  event.preventDefault();
3313
3657
  }
3314
- if ([EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(code) && userInputDate.value === null && userInputTime.value === null) {
3658
+ if ([EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(
3659
+ code
3660
+ ) && userInputDate.value === null && userInputTime.value === null) {
3315
3661
  event.preventDefault();
3316
3662
  emit(innerDate.value, false);
3317
3663
  }
@@ -3358,7 +3704,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3358
3704
  const map = mapping[keyboardMode.value];
3359
3705
  if (!map)
3360
3706
  return;
3361
- map.offset(newDate, isFunction(map[code]) ? map[code](newDate) : (_a = map[code]) != null ? _a : 0);
3707
+ map.offset(
3708
+ newDate,
3709
+ isFunction(map[code]) ? map[code](newDate) : (_a = map[code]) != null ? _a : 0
3710
+ );
3362
3711
  if (disabledDate && disabledDate(newDate)) {
3363
3712
  break;
3364
3713
  }
@@ -3371,303 +3720,388 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3371
3720
  const handlePanelChange = (mode) => {
3372
3721
  contextEmit("panel-change", innerDate.value.toDate(), mode, currentView.value);
3373
3722
  };
3374
- watch(() => selectionMode.value, (val) => {
3375
- if (["month", "year"].includes(val)) {
3376
- currentView.value = val;
3377
- return;
3378
- } else if (val === "years") {
3379
- currentView.value = "year";
3380
- return;
3381
- } else if (val === "months") {
3382
- currentView.value = "month";
3383
- return;
3384
- }
3385
- currentView.value = "date";
3386
- }, { immediate: true });
3387
- watch(() => defaultValue.value, (val) => {
3388
- if (val) {
3389
- innerDate.value = getDefaultValue();
3390
- }
3391
- }, { immediate: true });
3392
- watch(() => props.parsedValue, (val) => {
3393
- if (val) {
3394
- if (isMultipleType.value)
3723
+ watch(
3724
+ () => selectionMode.value,
3725
+ (val) => {
3726
+ if (["month", "year"].includes(val)) {
3727
+ currentView.value = val;
3395
3728
  return;
3396
- if (isArray(val))
3729
+ } else if (val === "years") {
3730
+ currentView.value = "year";
3397
3731
  return;
3398
- innerDate.value = val;
3399
- } else {
3400
- innerDate.value = getDefaultValue();
3401
- }
3402
- }, { immediate: true });
3732
+ } else if (val === "months") {
3733
+ currentView.value = "month";
3734
+ return;
3735
+ }
3736
+ currentView.value = "date";
3737
+ },
3738
+ { immediate: true }
3739
+ );
3740
+ watch(
3741
+ () => defaultValue.value,
3742
+ (val) => {
3743
+ if (val) {
3744
+ innerDate.value = getDefaultValue();
3745
+ }
3746
+ },
3747
+ { immediate: true }
3748
+ );
3749
+ watch(
3750
+ () => props.parsedValue,
3751
+ (val) => {
3752
+ if (val) {
3753
+ if (isMultipleType.value)
3754
+ return;
3755
+ if (isArray(val))
3756
+ return;
3757
+ innerDate.value = val;
3758
+ } else {
3759
+ innerDate.value = getDefaultValue();
3760
+ }
3761
+ },
3762
+ { immediate: true }
3763
+ );
3403
3764
  contextEmit("set-picker-option", ["isValidValue", isValidValue]);
3404
3765
  contextEmit("set-picker-option", ["parseUserInput", parseUserInput]);
3405
3766
  contextEmit("set-picker-option", ["handleFocusPicker", _handleFocusPicker]);
3406
3767
  return (_ctx, _cache) => {
3407
- return openBlock(), createElementBlock("div", {
3408
- class: normalizeClass([
3409
- unref(ppNs).b(),
3410
- unref(dpNs).b(),
3411
- unref(ppNs).is("border", _ctx.border),
3412
- unref(ppNs).is("disabled", unref(dateDisabled)),
3413
- {
3414
- "has-sidebar": _ctx.$slots.sidebar || unref(hasShortcuts),
3415
- "has-time": unref(showTime)
3416
- }
3417
- ])
3418
- }, [
3419
- createElementVNode("div", {
3420
- class: normalizeClass(unref(ppNs).e("body-wrapper"))
3421
- }, [
3422
- renderSlot(_ctx.$slots, "sidebar", {
3423
- class: normalizeClass(unref(ppNs).e("sidebar"))
3424
- }),
3425
- unref(hasShortcuts) ? (openBlock(), createElementBlock("div", {
3426
- key: 0,
3427
- class: normalizeClass(unref(ppNs).e("sidebar"))
3428
- }, [
3429
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
3430
- return openBlock(), createElementBlock("button", {
3431
- key,
3432
- type: "button",
3433
- disabled: unref(dateDisabled),
3434
- class: normalizeClass(unref(ppNs).e("shortcut")),
3435
- onClick: ($event) => handleShortcutClick(shortcut)
3436
- }, toDisplayString(shortcut.text), 11, ["disabled", "onClick"]);
3437
- }), 128))
3438
- ], 2)) : createCommentVNode("v-if", true),
3439
- createElementVNode("div", {
3440
- class: normalizeClass(unref(ppNs).e("body"))
3441
- }, [
3442
- unref(showTime) ? (openBlock(), createElementBlock("div", {
3443
- key: 0,
3444
- class: normalizeClass(unref(dpNs).e("time-header"))
3445
- }, [
3446
- createElementVNode("span", {
3447
- class: normalizeClass(unref(dpNs).e("editor-wrap"))
3448
- }, [
3449
- createVNode(unref(ElInput), {
3450
- placeholder: unref(t)("el.datepicker.selectDate"),
3451
- "model-value": unref(visibleDate),
3452
- size: "small",
3453
- "validate-event": false,
3454
- disabled: unref(dateDisabled),
3455
- onInput: (val) => userInputDate.value = val,
3456
- onChange: handleVisibleDateChange
3457
- }, null, 8, ["placeholder", "model-value", "disabled", "onInput"])
3458
- ], 2),
3459
- withDirectives((openBlock(), createElementBlock("span", {
3460
- class: normalizeClass(unref(dpNs).e("editor-wrap"))
3461
- }, [
3462
- createVNode(unref(ElInput), {
3463
- placeholder: unref(t)("el.datepicker.selectTime"),
3464
- "model-value": unref(visibleTime),
3465
- size: "small",
3466
- "validate-event": false,
3467
- disabled: unref(dateDisabled),
3468
- onFocus: onTimePickerInputFocus,
3469
- onInput: (val) => userInputTime.value = val,
3470
- onChange: handleVisibleTimeChange
3471
- }, null, 8, ["placeholder", "model-value", "disabled", "onInput"]),
3472
- createVNode(unref(TimePickPanel), {
3473
- visible: timePickerVisible.value,
3474
- format: unref(timeFormat),
3475
- "parsed-value": innerDate.value,
3476
- onPick: handleTimePick
3477
- }, null, 8, ["visible", "format", "parsed-value"])
3478
- ], 2)), [
3479
- [unref(ClickOutside), handleTimePickClose]
3480
- ])
3481
- ], 2)) : createCommentVNode("v-if", true),
3482
- withDirectives(createElementVNode("div", {
3483
- class: normalizeClass([
3484
- unref(dpNs).e("header"),
3485
- (currentView.value === "year" || currentView.value === "month") && unref(dpNs).em("header", "bordered")
3486
- ])
3487
- }, [
3488
- createElementVNode("span", {
3489
- class: normalizeClass(unref(dpNs).e("prev-btn"))
3490
- }, [
3491
- createElementVNode("button", {
3492
- type: "button",
3493
- "aria-label": unref(t)(`el.datepicker.prevYear`),
3494
- class: normalizeClass(["d-arrow-left", unref(ppNs).e("icon-btn")]),
3495
- disabled: unref(dateDisabled),
3496
- onClick: ($event) => moveByYear(false)
3497
- }, [
3498
- renderSlot(_ctx.$slots, "prev-year", {}, () => [
3499
- createVNode(unref(ElIcon), null, {
3500
- default: withCtx(() => [
3501
- createVNode(unref(DArrowLeft))
3502
- ]),
3503
- _: 1
3504
- })
3505
- ])
3506
- ], 10, ["aria-label", "disabled", "onClick"]),
3507
- withDirectives(createElementVNode("button", {
3508
- type: "button",
3509
- "aria-label": unref(t)(`el.datepicker.prevMonth`),
3510
- class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
3511
- disabled: unref(dateDisabled),
3512
- onClick: ($event) => moveByMonth(false)
3513
- }, [
3514
- renderSlot(_ctx.$slots, "prev-month", {}, () => [
3515
- createVNode(unref(ElIcon), null, {
3516
- default: withCtx(() => [
3517
- createVNode(unref(ArrowLeft))
3768
+ return openBlock(), createElementBlock(
3769
+ "div",
3770
+ {
3771
+ class: normalizeClass([
3772
+ unref(ppNs).b(),
3773
+ unref(dpNs).b(),
3774
+ unref(ppNs).is("border", _ctx.border),
3775
+ unref(ppNs).is("disabled", unref(dateDisabled)),
3776
+ {
3777
+ "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
3778
+ "has-time": showTime.value
3779
+ }
3780
+ ])
3781
+ },
3782
+ [
3783
+ createElementVNode(
3784
+ "div",
3785
+ {
3786
+ class: normalizeClass(unref(ppNs).e("body-wrapper"))
3787
+ },
3788
+ [
3789
+ renderSlot(_ctx.$slots, "sidebar", {
3790
+ class: normalizeClass(unref(ppNs).e("sidebar"))
3791
+ }),
3792
+ hasShortcuts.value ? (openBlock(), createElementBlock(
3793
+ "div",
3794
+ {
3795
+ key: 0,
3796
+ class: normalizeClass(unref(ppNs).e("sidebar"))
3797
+ },
3798
+ [
3799
+ (openBlock(true), createElementBlock(
3800
+ Fragment,
3801
+ null,
3802
+ renderList(unref(shortcuts), (shortcut, key) => {
3803
+ return openBlock(), createElementBlock("button", {
3804
+ key,
3805
+ type: "button",
3806
+ disabled: unref(dateDisabled),
3807
+ class: normalizeClass(unref(ppNs).e("shortcut")),
3808
+ onClick: ($event) => handleShortcutClick(shortcut)
3809
+ }, toDisplayString(shortcut.text), 11, _hoisted_1$3);
3810
+ }),
3811
+ 128
3812
+ ))
3813
+ ],
3814
+ 2
3815
+ )) : createCommentVNode("v-if", true),
3816
+ createElementVNode(
3817
+ "div",
3818
+ {
3819
+ class: normalizeClass(unref(ppNs).e("body"))
3820
+ },
3821
+ [
3822
+ showTime.value ? (openBlock(), createElementBlock(
3823
+ "div",
3824
+ {
3825
+ key: 0,
3826
+ class: normalizeClass(unref(dpNs).e("time-header"))
3827
+ },
3828
+ [
3829
+ createElementVNode(
3830
+ "span",
3831
+ {
3832
+ class: normalizeClass(unref(dpNs).e("editor-wrap"))
3833
+ },
3834
+ [
3835
+ createVNode(unref(ElInput), {
3836
+ placeholder: unref(t)("el.datepicker.selectDate"),
3837
+ "model-value": visibleDate.value,
3838
+ size: "small",
3839
+ "validate-event": false,
3840
+ disabled: unref(dateDisabled),
3841
+ readonly: !_ctx.editable,
3842
+ onInput: _cache[0] || (_cache[0] = (val) => userInputDate.value = val),
3843
+ onChange: handleVisibleDateChange
3844
+ }, null, 8, ["placeholder", "model-value", "disabled", "readonly"])
3845
+ ],
3846
+ 2
3847
+ ),
3848
+ withDirectives((openBlock(), createElementBlock(
3849
+ "span",
3850
+ {
3851
+ class: normalizeClass(unref(dpNs).e("editor-wrap"))
3852
+ },
3853
+ [
3854
+ createVNode(unref(ElInput), {
3855
+ placeholder: unref(t)("el.datepicker.selectTime"),
3856
+ "model-value": visibleTime.value,
3857
+ size: "small",
3858
+ "validate-event": false,
3859
+ disabled: unref(dateDisabled),
3860
+ readonly: !_ctx.editable,
3861
+ onFocus: onTimePickerInputFocus,
3862
+ onInput: _cache[1] || (_cache[1] = (val) => userInputTime.value = val),
3863
+ onChange: handleVisibleTimeChange
3864
+ }, null, 8, ["placeholder", "model-value", "disabled", "readonly"]),
3865
+ createVNode(unref(TimePickPanel), {
3866
+ visible: timePickerVisible.value,
3867
+ format: timeFormat.value,
3868
+ "parsed-value": innerDate.value,
3869
+ onPick: handleTimePick
3870
+ }, null, 8, ["visible", "format", "parsed-value"])
3871
+ ],
3872
+ 2
3873
+ )), [
3874
+ [unref(ClickOutside), handleTimePickClose]
3875
+ ])
3876
+ ],
3877
+ 2
3878
+ )) : createCommentVNode("v-if", true),
3879
+ withDirectives(createElementVNode(
3880
+ "div",
3881
+ {
3882
+ class: normalizeClass([
3883
+ unref(dpNs).e("header"),
3884
+ (currentView.value === "year" || currentView.value === "month") && unref(dpNs).em("header", "bordered")
3885
+ ])
3886
+ },
3887
+ [
3888
+ createElementVNode(
3889
+ "span",
3890
+ {
3891
+ class: normalizeClass(unref(dpNs).e("prev-btn"))
3892
+ },
3893
+ [
3894
+ createElementVNode("button", {
3895
+ type: "button",
3896
+ "aria-label": unref(t)(`el.datepicker.prevYear`),
3897
+ class: normalizeClass(["d-arrow-left", unref(ppNs).e("icon-btn")]),
3898
+ disabled: unref(dateDisabled),
3899
+ onClick: _cache[2] || (_cache[2] = ($event) => moveByYear(false))
3900
+ }, [
3901
+ renderSlot(_ctx.$slots, "prev-year", {}, () => [
3902
+ createVNode(unref(ElIcon), null, {
3903
+ default: withCtx(() => [
3904
+ createVNode(unref(DArrowLeft))
3905
+ ]),
3906
+ _: 1
3907
+ })
3908
+ ])
3909
+ ], 10, _hoisted_2$3),
3910
+ withDirectives(createElementVNode("button", {
3911
+ type: "button",
3912
+ "aria-label": unref(t)(`el.datepicker.prevMonth`),
3913
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
3914
+ disabled: unref(dateDisabled),
3915
+ onClick: _cache[3] || (_cache[3] = ($event) => moveByMonth(false))
3916
+ }, [
3917
+ renderSlot(_ctx.$slots, "prev-month", {}, () => [
3918
+ createVNode(unref(ElIcon), null, {
3919
+ default: withCtx(() => [
3920
+ createVNode(unref(ArrowLeft))
3921
+ ]),
3922
+ _: 1
3923
+ })
3924
+ ])
3925
+ ], 10, _hoisted_3$3), [
3926
+ [vShow, currentView.value === "date"]
3927
+ ])
3928
+ ],
3929
+ 2
3930
+ ),
3931
+ createElementVNode("span", {
3932
+ role: "button",
3933
+ class: normalizeClass(unref(dpNs).e("header-label")),
3934
+ "aria-live": "polite",
3935
+ tabindex: _ctx.disabled ? void 0 : 0,
3936
+ "aria-disabled": _ctx.disabled,
3937
+ onKeydown: _cache[4] || (_cache[4] = withKeys(($event) => showPicker("year"), ["enter"])),
3938
+ onClick: _cache[5] || (_cache[5] = ($event) => showPicker("year"))
3939
+ }, toDisplayString(yearLabel.value), 43, _hoisted_4$3),
3940
+ withDirectives(createElementVNode("span", {
3941
+ role: "button",
3942
+ "aria-live": "polite",
3943
+ tabindex: _ctx.disabled ? void 0 : 0,
3944
+ "aria-disabled": _ctx.disabled,
3945
+ class: normalizeClass([
3946
+ unref(dpNs).e("header-label"),
3947
+ { active: currentView.value === "month" }
3948
+ ]),
3949
+ onKeydown: _cache[6] || (_cache[6] = withKeys(($event) => showPicker("month"), ["enter"])),
3950
+ onClick: _cache[7] || (_cache[7] = ($event) => showPicker("month"))
3951
+ }, toDisplayString(unref(t)(`el.datepicker.month${month.value + 1}`)), 43, _hoisted_5$3), [
3952
+ [vShow, currentView.value === "date"]
3518
3953
  ]),
3519
- _: 1
3520
- })
3521
- ])
3522
- ], 10, ["aria-label", "disabled", "onClick"]), [
3523
- [vShow, currentView.value === "date"]
3524
- ])
3525
- ], 2),
3526
- createElementVNode("span", {
3527
- role: "button",
3528
- class: normalizeClass(unref(dpNs).e("header-label")),
3529
- "aria-live": "polite",
3530
- tabindex: _ctx.disabled ? void 0 : 0,
3531
- "aria-disabled": _ctx.disabled,
3532
- onKeydown: withKeys(($event) => showPicker("year"), ["enter"]),
3533
- onClick: ($event) => showPicker("year")
3534
- }, toDisplayString(unref(yearLabel)), 43, ["tabindex", "aria-disabled", "onKeydown", "onClick"]),
3535
- withDirectives(createElementVNode("span", {
3536
- role: "button",
3537
- "aria-live": "polite",
3538
- tabindex: _ctx.disabled ? void 0 : 0,
3539
- "aria-disabled": _ctx.disabled,
3540
- class: normalizeClass([
3541
- unref(dpNs).e("header-label"),
3542
- { active: currentView.value === "month" }
3954
+ createElementVNode(
3955
+ "span",
3956
+ {
3957
+ class: normalizeClass(unref(dpNs).e("next-btn"))
3958
+ },
3959
+ [
3960
+ withDirectives(createElementVNode("button", {
3961
+ type: "button",
3962
+ "aria-label": unref(t)(`el.datepicker.nextMonth`),
3963
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
3964
+ disabled: unref(dateDisabled),
3965
+ onClick: _cache[8] || (_cache[8] = ($event) => moveByMonth(true))
3966
+ }, [
3967
+ renderSlot(_ctx.$slots, "next-month", {}, () => [
3968
+ createVNode(unref(ElIcon), null, {
3969
+ default: withCtx(() => [
3970
+ createVNode(unref(ArrowRight))
3971
+ ]),
3972
+ _: 1
3973
+ })
3974
+ ])
3975
+ ], 10, _hoisted_6$1), [
3976
+ [vShow, currentView.value === "date"]
3977
+ ]),
3978
+ createElementVNode("button", {
3979
+ type: "button",
3980
+ "aria-label": unref(t)(`el.datepicker.nextYear`),
3981
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
3982
+ disabled: unref(dateDisabled),
3983
+ onClick: _cache[9] || (_cache[9] = ($event) => moveByYear(true))
3984
+ }, [
3985
+ renderSlot(_ctx.$slots, "next-year", {}, () => [
3986
+ createVNode(unref(ElIcon), null, {
3987
+ default: withCtx(() => [
3988
+ createVNode(unref(DArrowRight))
3989
+ ]),
3990
+ _: 1
3991
+ })
3992
+ ])
3993
+ ], 10, _hoisted_7$1)
3994
+ ],
3995
+ 2
3996
+ )
3997
+ ],
3998
+ 2
3999
+ ), [
4000
+ [vShow, currentView.value !== "time"]
4001
+ ]),
4002
+ createElementVNode(
4003
+ "div",
4004
+ {
4005
+ class: normalizeClass(unref(ppNs).e("content")),
4006
+ onKeydown: handleKeydownTable
4007
+ },
4008
+ [
4009
+ currentView.value === "date" ? (openBlock(), createBlock(DateTable, {
4010
+ key: 0,
4011
+ ref_key: "currentViewRef",
4012
+ ref: currentViewRef,
4013
+ "selection-mode": selectionMode.value,
4014
+ date: innerDate.value,
4015
+ "parsed-value": _ctx.parsedValue,
4016
+ "disabled-date": unref(disabledDate),
4017
+ disabled: unref(dateDisabled),
4018
+ "cell-class-name": unref(cellClassName),
4019
+ "show-week-number": _ctx.showWeekNumber,
4020
+ onPick: handleDatePick
4021
+ }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "disabled", "cell-class-name", "show-week-number"])) : createCommentVNode("v-if", true),
4022
+ currentView.value === "year" ? (openBlock(), createBlock(YearTable, {
4023
+ key: 1,
4024
+ ref_key: "currentViewRef",
4025
+ ref: currentViewRef,
4026
+ "selection-mode": selectionMode.value,
4027
+ date: innerDate.value,
4028
+ "disabled-date": unref(disabledDate),
4029
+ disabled: unref(dateDisabled),
4030
+ "parsed-value": _ctx.parsedValue,
4031
+ "cell-class-name": unref(cellClassName),
4032
+ onPick: handleYearPick
4033
+ }, null, 8, ["selection-mode", "date", "disabled-date", "disabled", "parsed-value", "cell-class-name"])) : createCommentVNode("v-if", true),
4034
+ currentView.value === "month" ? (openBlock(), createBlock(MonthTable, {
4035
+ key: 2,
4036
+ ref_key: "currentViewRef",
4037
+ ref: currentViewRef,
4038
+ "selection-mode": selectionMode.value,
4039
+ date: innerDate.value,
4040
+ "parsed-value": _ctx.parsedValue,
4041
+ "disabled-date": unref(disabledDate),
4042
+ disabled: unref(dateDisabled),
4043
+ "cell-class-name": unref(cellClassName),
4044
+ onPick: handleMonthPick
4045
+ }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "disabled", "cell-class-name"])) : createCommentVNode("v-if", true)
4046
+ ],
4047
+ 34
4048
+ )
4049
+ ],
4050
+ 2
4051
+ )
4052
+ ],
4053
+ 2
4054
+ ),
4055
+ _ctx.showFooter && footerVisible.value && footerFilled.value ? (openBlock(), createElementBlock(
4056
+ "div",
4057
+ {
4058
+ key: 0,
4059
+ class: normalizeClass(unref(ppNs).e("footer"))
4060
+ },
4061
+ [
4062
+ withDirectives(createVNode(unref(ElButton), {
4063
+ text: "",
4064
+ size: "small",
4065
+ class: normalizeClass(unref(ppNs).e("link-btn")),
4066
+ disabled: disabledNow.value,
4067
+ onClick: changeToNow
4068
+ }, {
4069
+ default: withCtx(() => [
4070
+ createTextVNode(
4071
+ toDisplayString(unref(t)("el.datepicker.now")),
4072
+ 1
4073
+ )
3543
4074
  ]),
3544
- onKeydown: withKeys(($event) => showPicker("month"), ["enter"]),
3545
- onClick: ($event) => showPicker("month")
3546
- }, toDisplayString(unref(t)(`el.datepicker.month${unref(month) + 1}`)), 43, ["tabindex", "aria-disabled", "onKeydown", "onClick"]), [
3547
- [vShow, currentView.value === "date"]
4075
+ _: 1
4076
+ }, 8, ["class", "disabled"]), [
4077
+ [vShow, !isMultipleType.value && _ctx.showNow]
3548
4078
  ]),
3549
- createElementVNode("span", {
3550
- class: normalizeClass(unref(dpNs).e("next-btn"))
3551
- }, [
3552
- withDirectives(createElementVNode("button", {
3553
- type: "button",
3554
- "aria-label": unref(t)(`el.datepicker.nextMonth`),
3555
- class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
3556
- disabled: unref(dateDisabled),
3557
- onClick: ($event) => moveByMonth(true)
3558
- }, [
3559
- renderSlot(_ctx.$slots, "next-month", {}, () => [
3560
- createVNode(unref(ElIcon), null, {
3561
- default: withCtx(() => [
3562
- createVNode(unref(ArrowRight))
3563
- ]),
3564
- _: 1
3565
- })
3566
- ])
3567
- ], 10, ["aria-label", "disabled", "onClick"]), [
3568
- [vShow, currentView.value === "date"]
3569
- ]),
3570
- createElementVNode("button", {
3571
- type: "button",
3572
- "aria-label": unref(t)(`el.datepicker.nextYear`),
3573
- class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
3574
- disabled: unref(dateDisabled),
3575
- onClick: ($event) => moveByYear(true)
3576
- }, [
3577
- renderSlot(_ctx.$slots, "next-year", {}, () => [
3578
- createVNode(unref(ElIcon), null, {
3579
- default: withCtx(() => [
3580
- createVNode(unref(DArrowRight))
3581
- ]),
3582
- _: 1
3583
- })
3584
- ])
3585
- ], 10, ["aria-label", "disabled", "onClick"])
3586
- ], 2)
3587
- ], 2), [
3588
- [vShow, currentView.value !== "time"]
3589
- ]),
3590
- createElementVNode("div", {
3591
- class: normalizeClass(unref(ppNs).e("content")),
3592
- onKeydown: handleKeydownTable
3593
- }, [
3594
- currentView.value === "date" ? (openBlock(), createBlock(DateTable, {
4079
+ _ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
3595
4080
  key: 0,
3596
- ref_key: "currentViewRef",
3597
- ref: currentViewRef,
3598
- "selection-mode": unref(selectionMode),
3599
- date: innerDate.value,
3600
- "parsed-value": _ctx.parsedValue,
3601
- "disabled-date": unref(disabledDate),
3602
- disabled: unref(dateDisabled),
3603
- "cell-class-name": unref(cellClassName),
3604
- "show-week-number": _ctx.showWeekNumber,
3605
- onPick: handleDatePick
3606
- }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "disabled", "cell-class-name", "show-week-number"])) : createCommentVNode("v-if", true),
3607
- currentView.value === "year" ? (openBlock(), createBlock(YearTable, {
3608
- key: 1,
3609
- ref_key: "currentViewRef",
3610
- ref: currentViewRef,
3611
- "selection-mode": unref(selectionMode),
3612
- date: innerDate.value,
3613
- "disabled-date": unref(disabledDate),
3614
- disabled: unref(dateDisabled),
3615
- "parsed-value": _ctx.parsedValue,
3616
- "cell-class-name": unref(cellClassName),
3617
- onPick: handleYearPick
3618
- }, null, 8, ["selection-mode", "date", "disabled-date", "disabled", "parsed-value", "cell-class-name"])) : createCommentVNode("v-if", true),
3619
- currentView.value === "month" ? (openBlock(), createBlock(MonthTable, {
3620
- key: 2,
3621
- ref_key: "currentViewRef",
3622
- ref: currentViewRef,
3623
- "selection-mode": unref(selectionMode),
3624
- date: innerDate.value,
3625
- "parsed-value": _ctx.parsedValue,
3626
- "disabled-date": unref(disabledDate),
3627
- disabled: unref(dateDisabled),
3628
- "cell-class-name": unref(cellClassName),
3629
- onPick: handleMonthPick
3630
- }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "disabled", "cell-class-name"])) : createCommentVNode("v-if", true)
3631
- ], 34)
3632
- ], 2)
3633
- ], 2),
3634
- _ctx.showFooter && unref(footerVisible) && unref(footerFilled) ? (openBlock(), createElementBlock("div", {
3635
- key: 0,
3636
- class: normalizeClass(unref(ppNs).e("footer"))
3637
- }, [
3638
- withDirectives(createVNode(unref(ElButton), {
3639
- text: "",
3640
- size: "small",
3641
- class: normalizeClass(unref(ppNs).e("link-btn")),
3642
- disabled: unref(disabledNow),
3643
- onClick: changeToNow
3644
- }, {
3645
- default: withCtx(() => [
3646
- createTextVNode(toDisplayString(unref(t)("el.datepicker.now")), 1)
3647
- ]),
3648
- _: 1
3649
- }, 8, ["class", "disabled"]), [
3650
- [vShow, !unref(isMultipleType) && _ctx.showNow]
3651
- ]),
3652
- _ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
3653
- key: 0,
3654
- plain: "",
3655
- size: "small",
3656
- class: normalizeClass(unref(ppNs).e("link-btn")),
3657
- disabled: unref(disabledConfirm),
3658
- onClick: onConfirm
3659
- }, {
3660
- default: withCtx(() => [
3661
- createTextVNode(toDisplayString(unref(t)("el.datepicker.confirm")), 1)
3662
- ]),
3663
- _: 1
3664
- }, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)
3665
- ], 2)) : createCommentVNode("v-if", true)
3666
- ], 2);
4081
+ plain: "",
4082
+ size: "small",
4083
+ class: normalizeClass(unref(ppNs).e("link-btn")),
4084
+ disabled: disabledConfirm.value,
4085
+ onClick: onConfirm
4086
+ }, {
4087
+ default: withCtx(() => [
4088
+ createTextVNode(
4089
+ toDisplayString(unref(t)("el.datepicker.confirm")),
4090
+ 1
4091
+ )
4092
+ ]),
4093
+ _: 1
4094
+ }, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)
4095
+ ],
4096
+ 2
4097
+ )) : createCommentVNode("v-if", true)
4098
+ ],
4099
+ 2
4100
+ );
3667
4101
  };
3668
4102
  }
3669
4103
  });
3670
- var DatePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "panel-date-pick.vue"]]);
4104
+ var DatePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue"]]);
3671
4105
 
3672
4106
  const panelDateRangeProps = buildProps({
3673
4107
  ...panelSharedProps,
@@ -3776,23 +4210,35 @@ const useRangePicker = (props, {
3776
4210
  leftDate.value = start;
3777
4211
  rightDate.value = end;
3778
4212
  };
3779
- watch(defaultValue, (val) => {
3780
- if (val) {
3781
- restoreDefault();
3782
- }
3783
- }, { immediate: true });
3784
- watch(() => props.parsedValue, (parsedValue) => {
3785
- if (!(parsedValue == null ? void 0 : parsedValue.length) || !isEqual(parsedValue, [minDate.value, maxDate.value])) {
3786
- parseValue(parsedValue);
3787
- }
3788
- }, {
3789
- immediate: true
3790
- });
3791
- watch(() => props.visible, () => {
3792
- if (props.visible) {
3793
- parseValue(props.parsedValue);
4213
+ watch(
4214
+ defaultValue,
4215
+ (val) => {
4216
+ if (val) {
4217
+ restoreDefault();
4218
+ }
4219
+ },
4220
+ { immediate: true }
4221
+ );
4222
+ watch(
4223
+ () => props.parsedValue,
4224
+ (parsedValue) => {
4225
+ if (!(parsedValue == null ? void 0 : parsedValue.length) || !isEqual(parsedValue, [minDate.value, maxDate.value])) {
4226
+ parseValue(parsedValue);
4227
+ }
4228
+ },
4229
+ {
4230
+ immediate: true
3794
4231
  }
3795
- }, { immediate: true });
4232
+ );
4233
+ watch(
4234
+ () => props.visible,
4235
+ () => {
4236
+ if (props.visible) {
4237
+ parseValue(props.parsedValue);
4238
+ }
4239
+ },
4240
+ { immediate: true }
4241
+ );
3796
4242
  return {
3797
4243
  minDate,
3798
4244
  maxDate,
@@ -3862,7 +4308,13 @@ const usePanelDateRange = (props, emit, leftDate, rightDate) => {
3862
4308
  startDate.value = getValidDateOfYear(data, lang.value, disabledDate);
3863
4309
  }
3864
4310
  if (mode === "month") {
3865
- startDate.value = getValidDateOfMonth(startDate.value, startDate.value.year(), value, lang.value, disabledDate);
4311
+ startDate.value = getValidDateOfMonth(
4312
+ startDate.value,
4313
+ startDate.value.year(),
4314
+ value,
4315
+ lang.value,
4316
+ disabledDate
4317
+ );
3866
4318
  }
3867
4319
  if (!props.unlinkPanels) {
3868
4320
  endDate.value = pickerType === "left" ? startDate.value.add(1, "month") : startDate.value.subtract(1, "month");
@@ -3873,7 +4325,11 @@ const usePanelDateRange = (props, emit, leftDate, rightDate) => {
3873
4325
  handlePanelChange(mode);
3874
4326
  }
3875
4327
  function handlePanelChange(mode) {
3876
- emit("panel-change", [leftDate.value.toDate(), rightDate.value.toDate()], mode);
4328
+ emit(
4329
+ "panel-change",
4330
+ [leftDate.value.toDate(), rightDate.value.toDate()],
4331
+ mode
4332
+ );
3877
4333
  }
3878
4334
  function adjustDateByView(currentView, date, forward) {
3879
4335
  const action = forward ? "add" : "subtract";
@@ -3889,7 +4345,9 @@ const usePanelDateRange = (props, emit, leftDate, rightDate) => {
3889
4345
  leftMonth,
3890
4346
  rightMonth,
3891
4347
  leftYearLabel: computed(() => computedYearLabel(leftCurrentView, leftYear)),
3892
- rightYearLabel: computed(() => computedYearLabel(rightCurrentView, rightYear)),
4348
+ rightYearLabel: computed(
4349
+ () => computedYearLabel(rightCurrentView, rightYear)
4350
+ ),
3893
4351
  showLeftPicker: (view) => showPicker("left", view),
3894
4352
  showRightPicker: (view) => showPicker("right", view),
3895
4353
  handleLeftYearPick: (year) => handlePick("year", "left", year),
@@ -3901,20 +4359,38 @@ const usePanelDateRange = (props, emit, leftDate, rightDate) => {
3901
4359
  };
3902
4360
  };
3903
4361
 
4362
+ const _hoisted_1$2 = ["disabled", "onClick"];
4363
+ const _hoisted_2$2 = ["aria-label", "disabled"];
4364
+ const _hoisted_3$2 = ["aria-label", "disabled"];
4365
+ const _hoisted_4$2 = ["disabled", "aria-label"];
4366
+ const _hoisted_5$2 = ["disabled", "aria-label"];
4367
+ const _hoisted_6 = ["tabindex", "aria-disabled"];
4368
+ const _hoisted_7 = ["tabindex", "aria-disabled"];
4369
+ const _hoisted_8 = ["disabled", "aria-label"];
4370
+ const _hoisted_9 = ["disabled", "aria-label"];
4371
+ const _hoisted_10 = ["aria-label", "disabled"];
4372
+ const _hoisted_11 = ["disabled", "aria-label"];
4373
+ const _hoisted_12 = ["tabindex", "aria-disabled"];
4374
+ const _hoisted_13 = ["tabindex", "aria-disabled"];
3904
4375
  const unit$2 = "month";
3905
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4376
+ const _sfc_main$3 = defineComponent({
3906
4377
  __name: "panel-date-range",
3907
4378
  props: panelDateRangeProps,
3908
4379
  emits: [
3909
4380
  "pick",
3910
4381
  "set-picker-option",
3911
4382
  "calendar-change",
3912
- "panel-change"
4383
+ "panel-change",
4384
+ "clear"
3913
4385
  ],
3914
- setup(__props, { emit }) {
4386
+ setup(__props, { emit: __emit }) {
3915
4387
  const props = __props;
4388
+ const emit = __emit;
3916
4389
  const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
3917
- const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
4390
+ const isDefaultFormat = inject(
4391
+ ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,
4392
+ void 0
4393
+ );
3918
4394
  const { disabledDate, cellClassName, defaultTime, clearable } = pickerBase.props;
3919
4395
  const format = toRef(pickerBase.props, "format");
3920
4396
  const shortcuts = toRef(pickerBase.props, "shortcuts");
@@ -3942,12 +4418,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3942
4418
  unit: unit$2,
3943
4419
  sortDates
3944
4420
  });
3945
- watch(() => props.visible, (visible) => {
3946
- if (!visible && rangeState.value.selecting) {
3947
- parseValue(props.parsedValue);
3948
- onSelect(false);
4421
+ watch(
4422
+ () => props.visible,
4423
+ (visible) => {
4424
+ if (!visible && rangeState.value.selecting) {
4425
+ parseValue(props.parsedValue);
4426
+ onSelect(false);
4427
+ }
3949
4428
  }
3950
- });
4429
+ );
3951
4430
  const dateUserInput = ref({
3952
4431
  min: null,
3953
4432
  max: null
@@ -4015,7 +4494,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4015
4494
  return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
4016
4495
  };
4017
4496
  const leftPrevYear = () => {
4018
- leftDate.value = adjustDateByView(leftCurrentView.value, leftDate.value, false);
4497
+ leftDate.value = adjustDateByView(
4498
+ leftCurrentView.value,
4499
+ leftDate.value,
4500
+ false
4501
+ );
4019
4502
  if (!props.unlinkPanels) {
4020
4503
  rightDate.value = leftDate.value.add(1, "month");
4021
4504
  }
@@ -4030,10 +4513,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4030
4513
  };
4031
4514
  const rightNextYear = () => {
4032
4515
  if (!props.unlinkPanels) {
4033
- leftDate.value = adjustDateByView(rightCurrentView.value, leftDate.value, true);
4516
+ leftDate.value = adjustDateByView(
4517
+ rightCurrentView.value,
4518
+ leftDate.value,
4519
+ true
4520
+ );
4034
4521
  rightDate.value = leftDate.value.add(1, "month");
4035
4522
  } else {
4036
- rightDate.value = adjustDateByView(rightCurrentView.value, rightDate.value, true);
4523
+ rightDate.value = adjustDateByView(
4524
+ rightCurrentView.value,
4525
+ rightDate.value,
4526
+ true
4527
+ );
4037
4528
  }
4038
4529
  handlePanelChange("year");
4039
4530
  };
@@ -4055,7 +4546,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4055
4546
  handlePanelChange("month");
4056
4547
  };
4057
4548
  const rightPrevYear = () => {
4058
- rightDate.value = adjustDateByView(rightCurrentView.value, rightDate.value, false);
4549
+ rightDate.value = adjustDateByView(
4550
+ rightCurrentView.value,
4551
+ rightDate.value,
4552
+ false
4553
+ );
4059
4554
  handlePanelChange("year");
4060
4555
  };
4061
4556
  const rightPrevMonth = () => {
@@ -4074,12 +4569,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4074
4569
  const btnDisabled = computed(() => {
4075
4570
  return !(minDate.value && maxDate.value && !rangeState.value.selecting && isValidRange([minDate.value, maxDate.value]) && !dateRangeDisabled.value);
4076
4571
  });
4077
- const showTime = computed(() => props.type === "datetime" || props.type === "datetimerange");
4572
+ const showTime = computed(
4573
+ () => props.type === "datetime" || props.type === "datetimerange"
4574
+ );
4078
4575
  const formatEmit = (emitDayjs, index) => {
4079
4576
  if (!emitDayjs)
4080
4577
  return;
4081
4578
  if (defaultTime) {
4082
- const defaultTimeD = dayjs(defaultTime[index] || defaultTime).locale(lang.value);
4579
+ const defaultTimeD = dayjs(
4580
+ defaultTime[index] || defaultTime
4581
+ ).locale(lang.value);
4083
4582
  return defaultTimeD.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
4084
4583
  }
4085
4584
  return emitDayjs;
@@ -4173,7 +4672,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4173
4672
  if (timeUserInput.value.min)
4174
4673
  return;
4175
4674
  if (value) {
4176
- leftDate.value = value;
4177
4675
  minDate.value = (minDate.value || leftDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
4178
4676
  }
4179
4677
  if (!first) {
@@ -4192,7 +4690,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4192
4690
  if (timeUserInput.value.max)
4193
4691
  return;
4194
4692
  if (value) {
4195
- rightDate.value = value;
4196
4693
  maxDate.value = (maxDate.value || rightDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
4197
4694
  }
4198
4695
  if (!first) {
@@ -4203,6 +4700,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4203
4700
  }
4204
4701
  handleRangeConfirm(true);
4205
4702
  };
4703
+ const onClear = () => {
4704
+ handleClear();
4705
+ emit("clear");
4706
+ };
4206
4707
  const handleClear = () => {
4207
4708
  let valueOnClear = null;
4208
4709
  if (pickerBase == null ? void 0 : pickerBase.emptyValues) {
@@ -4220,7 +4721,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4220
4721
  emit("pick", valueOnClear);
4221
4722
  };
4222
4723
  const parseUserInput = (value) => {
4223
- return correctlyParseUserInput(value, format.value || "", lang.value, isDefaultFormat);
4724
+ return correctlyParseUserInput(
4725
+ value,
4726
+ format.value || "",
4727
+ lang.value,
4728
+ isDefaultFormat
4729
+ );
4224
4730
  };
4225
4731
  function sortDates(minDate2, maxDate2) {
4226
4732
  if (props.unlinkPanels && maxDate2) {
@@ -4240,466 +4746,556 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
4240
4746
  emit("set-picker-option", ["parseUserInput", parseUserInput]);
4241
4747
  emit("set-picker-option", ["handleClear", handleClear]);
4242
4748
  return (_ctx, _cache) => {
4243
- return openBlock(), createElementBlock("div", {
4244
- class: normalizeClass([
4245
- unref(ppNs).b(),
4246
- unref(drpNs).b(),
4247
- unref(ppNs).is("border", _ctx.border),
4248
- unref(ppNs).is("disabled", unref(dateRangeDisabled)),
4249
- {
4250
- "has-sidebar": _ctx.$slots.sidebar || unref(hasShortcuts),
4251
- "has-time": unref(showTime)
4252
- }
4253
- ])
4254
- }, [
4255
- createElementVNode("div", {
4256
- class: normalizeClass(unref(ppNs).e("body-wrapper"))
4257
- }, [
4258
- renderSlot(_ctx.$slots, "sidebar", {
4259
- class: normalizeClass(unref(ppNs).e("sidebar"))
4260
- }),
4261
- unref(hasShortcuts) ? (openBlock(), createElementBlock("div", {
4262
- key: 0,
4263
- class: normalizeClass(unref(ppNs).e("sidebar"))
4264
- }, [
4265
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
4266
- return openBlock(), createElementBlock("button", {
4267
- key,
4268
- type: "button",
4269
- disabled: unref(dateRangeDisabled),
4270
- class: normalizeClass(unref(ppNs).e("shortcut")),
4271
- onClick: ($event) => unref(handleShortcutClick)(shortcut)
4272
- }, toDisplayString(shortcut.text), 11, ["disabled", "onClick"]);
4273
- }), 128))
4274
- ], 2)) : createCommentVNode("v-if", true),
4275
- createElementVNode("div", {
4276
- class: normalizeClass(unref(ppNs).e("body"))
4277
- }, [
4278
- unref(showTime) ? (openBlock(), createElementBlock("div", {
4279
- key: 0,
4280
- class: normalizeClass(unref(drpNs).e("time-header"))
4281
- }, [
4282
- createElementVNode("span", {
4283
- class: normalizeClass(unref(drpNs).e("editors-wrap"))
4284
- }, [
4285
- createElementVNode("span", {
4286
- class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
4287
- }, [
4288
- createVNode(unref(ElInput), {
4289
- size: "small",
4290
- disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
4291
- placeholder: unref(t)("el.datepicker.startDate"),
4292
- class: normalizeClass(unref(drpNs).e("editor")),
4293
- "model-value": unref(minVisibleDate),
4294
- "validate-event": false,
4295
- onInput: (val) => handleDateInput(val, "min"),
4296
- onChange: (val) => handleDateChange(val, "min")
4297
- }, null, 8, ["disabled", "placeholder", "class", "model-value", "onInput", "onChange"])
4298
- ], 2),
4299
- withDirectives((openBlock(), createElementBlock("span", {
4300
- class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
4301
- }, [
4302
- createVNode(unref(ElInput), {
4303
- size: "small",
4304
- class: normalizeClass(unref(drpNs).e("editor")),
4305
- disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
4306
- placeholder: unref(t)("el.datepicker.startTime"),
4307
- "model-value": unref(minVisibleTime),
4308
- "validate-event": false,
4309
- onFocus: ($event) => minTimePickerVisible.value = true,
4310
- onInput: (val) => handleTimeInput(val, "min"),
4311
- onChange: (val) => handleTimeChange(val, "min")
4312
- }, null, 8, ["class", "disabled", "placeholder", "model-value", "onFocus", "onInput", "onChange"]),
4313
- createVNode(unref(TimePickPanel), {
4314
- visible: minTimePickerVisible.value,
4315
- format: unref(timeFormat),
4316
- "datetime-role": "start",
4317
- "parsed-value": leftDate.value,
4318
- onPick: handleMinTimePick
4319
- }, null, 8, ["visible", "format", "parsed-value"])
4320
- ], 2)), [
4321
- [unref(ClickOutside), handleMinTimeClose]
4322
- ])
4323
- ], 2),
4324
- createElementVNode("span", null, [
4325
- createVNode(unref(ElIcon), null, {
4326
- default: withCtx(() => [
4327
- createVNode(unref(ArrowRight))
4328
- ]),
4329
- _: 1
4330
- })
4331
- ]),
4332
- createElementVNode("span", {
4333
- class: normalizeClass([unref(drpNs).e("editors-wrap"), "is-right"])
4334
- }, [
4335
- createElementVNode("span", {
4336
- class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
4337
- }, [
4338
- createVNode(unref(ElInput), {
4339
- size: "small",
4340
- class: normalizeClass(unref(drpNs).e("editor")),
4341
- disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
4342
- placeholder: unref(t)("el.datepicker.endDate"),
4343
- "model-value": unref(maxVisibleDate),
4344
- readonly: !unref(minDate),
4345
- "validate-event": false,
4346
- onInput: (val) => handleDateInput(val, "max"),
4347
- onChange: (val) => handleDateChange(val, "max")
4348
- }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly", "onInput", "onChange"])
4349
- ], 2),
4350
- withDirectives((openBlock(), createElementBlock("span", {
4351
- class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
4352
- }, [
4353
- createVNode(unref(ElInput), {
4354
- size: "small",
4355
- class: normalizeClass(unref(drpNs).e("editor")),
4356
- disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
4357
- placeholder: unref(t)("el.datepicker.endTime"),
4358
- "model-value": unref(maxVisibleTime),
4359
- readonly: !unref(minDate),
4360
- "validate-event": false,
4361
- onFocus: ($event) => unref(minDate) && (maxTimePickerVisible.value = true),
4362
- onInput: (val) => handleTimeInput(val, "max"),
4363
- onChange: (val) => handleTimeChange(val, "max")
4364
- }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly", "onFocus", "onInput", "onChange"]),
4365
- createVNode(unref(TimePickPanel), {
4366
- "datetime-role": "end",
4367
- visible: maxTimePickerVisible.value,
4368
- format: unref(timeFormat),
4369
- "parsed-value": rightDate.value,
4370
- onPick: handleMaxTimePick
4371
- }, null, 8, ["visible", "format", "parsed-value"])
4372
- ], 2)), [
4373
- [unref(ClickOutside), handleMaxTimeClose]
4374
- ])
4375
- ], 2)
4376
- ], 2)) : createCommentVNode("v-if", true),
4377
- createElementVNode("div", {
4378
- class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"])
4379
- }, [
4380
- createElementVNode("div", {
4381
- class: normalizeClass(unref(drpNs).e("header"))
4382
- }, [
4383
- createElementVNode("button", {
4384
- type: "button",
4385
- class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
4386
- "aria-label": unref(t)(`el.datepicker.prevYear`),
4387
- disabled: unref(dateRangeDisabled),
4388
- onClick: leftPrevYear
4389
- }, [
4390
- renderSlot(_ctx.$slots, "prev-year", {}, () => [
4391
- createVNode(unref(ElIcon), null, {
4392
- default: withCtx(() => [
4393
- createVNode(unref(DArrowLeft))
4394
- ]),
4395
- _: 1
4396
- })
4397
- ])
4398
- ], 10, ["aria-label", "disabled"]),
4399
- withDirectives(createElementVNode("button", {
4400
- type: "button",
4401
- class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
4402
- "aria-label": unref(t)(`el.datepicker.prevMonth`),
4403
- disabled: unref(dateRangeDisabled),
4404
- onClick: leftPrevMonth
4405
- }, [
4406
- renderSlot(_ctx.$slots, "prev-month", {}, () => [
4407
- createVNode(unref(ElIcon), null, {
4408
- default: withCtx(() => [
4409
- createVNode(unref(ArrowLeft))
4410
- ]),
4411
- _: 1
4412
- })
4413
- ])
4414
- ], 10, ["aria-label", "disabled"]), [
4415
- [vShow, unref(leftCurrentView) === "date"]
4416
- ]),
4417
- _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
4749
+ return openBlock(), createElementBlock(
4750
+ "div",
4751
+ {
4752
+ class: normalizeClass([
4753
+ unref(ppNs).b(),
4754
+ unref(drpNs).b(),
4755
+ unref(ppNs).is("border", _ctx.border),
4756
+ unref(ppNs).is("disabled", unref(dateRangeDisabled)),
4757
+ {
4758
+ "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
4759
+ "has-time": showTime.value
4760
+ }
4761
+ ])
4762
+ },
4763
+ [
4764
+ createElementVNode(
4765
+ "div",
4766
+ {
4767
+ class: normalizeClass(unref(ppNs).e("body-wrapper"))
4768
+ },
4769
+ [
4770
+ renderSlot(_ctx.$slots, "sidebar", {
4771
+ class: normalizeClass(unref(ppNs).e("sidebar"))
4772
+ }),
4773
+ hasShortcuts.value ? (openBlock(), createElementBlock(
4774
+ "div",
4775
+ {
4418
4776
  key: 0,
4419
- type: "button",
4420
- disabled: !unref(enableYearArrow) || unref(dateRangeDisabled),
4421
- class: normalizeClass([[
4422
- unref(ppNs).e("icon-btn"),
4423
- unref(ppNs).is("disabled", !unref(enableYearArrow) || unref(dateRangeDisabled))
4424
- ], "d-arrow-right"]),
4425
- "aria-label": unref(t)(`el.datepicker.nextYear`),
4426
- onClick: leftNextYear
4427
- }, [
4428
- renderSlot(_ctx.$slots, "next-year", {}, () => [
4429
- createVNode(unref(ElIcon), null, {
4430
- default: withCtx(() => [
4431
- createVNode(unref(DArrowRight))
4777
+ class: normalizeClass(unref(ppNs).e("sidebar"))
4778
+ },
4779
+ [
4780
+ (openBlock(true), createElementBlock(
4781
+ Fragment,
4782
+ null,
4783
+ renderList(shortcuts.value, (shortcut, key) => {
4784
+ return openBlock(), createElementBlock("button", {
4785
+ key,
4786
+ type: "button",
4787
+ disabled: unref(dateRangeDisabled),
4788
+ class: normalizeClass(unref(ppNs).e("shortcut")),
4789
+ onClick: ($event) => unref(handleShortcutClick)(shortcut)
4790
+ }, toDisplayString(shortcut.text), 11, _hoisted_1$2);
4791
+ }),
4792
+ 128
4793
+ ))
4794
+ ],
4795
+ 2
4796
+ )) : createCommentVNode("v-if", true),
4797
+ createElementVNode(
4798
+ "div",
4799
+ {
4800
+ class: normalizeClass(unref(ppNs).e("body"))
4801
+ },
4802
+ [
4803
+ showTime.value ? (openBlock(), createElementBlock(
4804
+ "div",
4805
+ {
4806
+ key: 0,
4807
+ class: normalizeClass(unref(drpNs).e("time-header"))
4808
+ },
4809
+ [
4810
+ createElementVNode(
4811
+ "span",
4812
+ {
4813
+ class: normalizeClass(unref(drpNs).e("editors-wrap"))
4814
+ },
4815
+ [
4816
+ createElementVNode(
4817
+ "span",
4818
+ {
4819
+ class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
4820
+ },
4821
+ [
4822
+ createVNode(unref(ElInput), {
4823
+ size: "small",
4824
+ disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
4825
+ placeholder: unref(t)("el.datepicker.startDate"),
4826
+ class: normalizeClass(unref(drpNs).e("editor")),
4827
+ "model-value": minVisibleDate.value,
4828
+ "validate-event": false,
4829
+ readonly: !_ctx.editable,
4830
+ onInput: _cache[0] || (_cache[0] = (val) => handleDateInput(val, "min")),
4831
+ onChange: _cache[1] || (_cache[1] = (val) => handleDateChange(val, "min"))
4832
+ }, null, 8, ["disabled", "placeholder", "class", "model-value", "readonly"])
4833
+ ],
4834
+ 2
4835
+ ),
4836
+ withDirectives((openBlock(), createElementBlock(
4837
+ "span",
4838
+ {
4839
+ class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
4840
+ },
4841
+ [
4842
+ createVNode(unref(ElInput), {
4843
+ size: "small",
4844
+ class: normalizeClass(unref(drpNs).e("editor")),
4845
+ disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
4846
+ placeholder: unref(t)("el.datepicker.startTime"),
4847
+ "model-value": minVisibleTime.value,
4848
+ "validate-event": false,
4849
+ readonly: !_ctx.editable,
4850
+ onFocus: _cache[2] || (_cache[2] = ($event) => minTimePickerVisible.value = true),
4851
+ onInput: _cache[3] || (_cache[3] = (val) => handleTimeInput(val, "min")),
4852
+ onChange: _cache[4] || (_cache[4] = (val) => handleTimeChange(val, "min"))
4853
+ }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly"]),
4854
+ createVNode(unref(TimePickPanel), {
4855
+ visible: minTimePickerVisible.value,
4856
+ format: timeFormat.value,
4857
+ "datetime-role": "start",
4858
+ "parsed-value": unref(minDate) || leftDate.value,
4859
+ onPick: handleMinTimePick
4860
+ }, null, 8, ["visible", "format", "parsed-value"])
4861
+ ],
4862
+ 2
4863
+ )), [
4864
+ [unref(ClickOutside), handleMinTimeClose]
4865
+ ])
4866
+ ],
4867
+ 2
4868
+ ),
4869
+ createElementVNode("span", null, [
4870
+ createVNode(unref(ElIcon), null, {
4871
+ default: withCtx(() => [
4872
+ createVNode(unref(ArrowRight))
4873
+ ]),
4874
+ _: 1
4875
+ })
4432
4876
  ]),
4433
- _: 1
4434
- })
4435
- ])
4436
- ], 10, ["disabled", "aria-label"])) : createCommentVNode("v-if", true),
4437
- _ctx.unlinkPanels && unref(leftCurrentView) === "date" ? (openBlock(), createElementBlock("button", {
4438
- key: 1,
4439
- type: "button",
4440
- disabled: !unref(enableMonthArrow) || unref(dateRangeDisabled),
4441
- class: normalizeClass([[
4442
- unref(ppNs).e("icon-btn"),
4443
- unref(ppNs).is("disabled", !unref(enableMonthArrow) || unref(dateRangeDisabled))
4444
- ], "arrow-right"]),
4445
- "aria-label": unref(t)(`el.datepicker.nextMonth`),
4446
- onClick: leftNextMonth
4447
- }, [
4448
- renderSlot(_ctx.$slots, "next-month", {}, () => [
4449
- createVNode(unref(ElIcon), null, {
4450
- default: withCtx(() => [
4451
- createVNode(unref(ArrowRight))
4452
- ]),
4453
- _: 1
4454
- })
4455
- ])
4456
- ], 10, ["disabled", "aria-label"])) : createCommentVNode("v-if", true),
4457
- createElementVNode("div", null, [
4458
- createElementVNode("span", {
4459
- role: "button",
4460
- class: normalizeClass(unref(drpNs).e("header-label")),
4461
- "aria-live": "polite",
4462
- tabindex: _ctx.disabled ? void 0 : 0,
4463
- "aria-disabled": _ctx.disabled,
4464
- onKeydown: withKeys(($event) => unref(showLeftPicker)("year"), ["enter"]),
4465
- onClick: ($event) => unref(showLeftPicker)("year")
4466
- }, toDisplayString(unref(leftYearLabel)), 43, ["tabindex", "aria-disabled", "onKeydown", "onClick"]),
4467
- withDirectives(createElementVNode("span", {
4468
- role: "button",
4469
- "aria-live": "polite",
4470
- tabindex: _ctx.disabled ? void 0 : 0,
4471
- "aria-disabled": _ctx.disabled,
4472
- class: normalizeClass([
4473
- unref(drpNs).e("header-label"),
4474
- { active: unref(leftCurrentView) === "month" }
4475
- ]),
4476
- onKeydown: withKeys(($event) => unref(showLeftPicker)("month"), ["enter"]),
4477
- onClick: ($event) => unref(showLeftPicker)("month")
4478
- }, toDisplayString(unref(t)(`el.datepicker.month${leftDate.value.month() + 1}`)), 43, ["tabindex", "aria-disabled", "onKeydown", "onClick"]), [
4479
- [vShow, unref(leftCurrentView) === "date"]
4480
- ])
4481
- ])
4482
- ], 2),
4483
- unref(leftCurrentView) === "date" ? (openBlock(), createBlock(DateTable, {
4877
+ createElementVNode(
4878
+ "span",
4879
+ {
4880
+ class: normalizeClass([unref(drpNs).e("editors-wrap"), "is-right"])
4881
+ },
4882
+ [
4883
+ createElementVNode(
4884
+ "span",
4885
+ {
4886
+ class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
4887
+ },
4888
+ [
4889
+ createVNode(unref(ElInput), {
4890
+ size: "small",
4891
+ class: normalizeClass(unref(drpNs).e("editor")),
4892
+ disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
4893
+ placeholder: unref(t)("el.datepicker.endDate"),
4894
+ "model-value": maxVisibleDate.value,
4895
+ readonly: !unref(minDate) || !_ctx.editable,
4896
+ "validate-event": false,
4897
+ onInput: _cache[5] || (_cache[5] = (val) => handleDateInput(val, "max")),
4898
+ onChange: _cache[6] || (_cache[6] = (val) => handleDateChange(val, "max"))
4899
+ }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly"])
4900
+ ],
4901
+ 2
4902
+ ),
4903
+ withDirectives((openBlock(), createElementBlock(
4904
+ "span",
4905
+ {
4906
+ class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
4907
+ },
4908
+ [
4909
+ createVNode(unref(ElInput), {
4910
+ size: "small",
4911
+ class: normalizeClass(unref(drpNs).e("editor")),
4912
+ disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
4913
+ placeholder: unref(t)("el.datepicker.endTime"),
4914
+ "model-value": maxVisibleTime.value,
4915
+ readonly: !unref(minDate) || !_ctx.editable,
4916
+ "validate-event": false,
4917
+ onFocus: _cache[7] || (_cache[7] = ($event) => unref(minDate) && (maxTimePickerVisible.value = true)),
4918
+ onInput: _cache[8] || (_cache[8] = (val) => handleTimeInput(val, "max")),
4919
+ onChange: _cache[9] || (_cache[9] = (val) => handleTimeChange(val, "max"))
4920
+ }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly"]),
4921
+ createVNode(unref(TimePickPanel), {
4922
+ "datetime-role": "end",
4923
+ visible: maxTimePickerVisible.value,
4924
+ format: timeFormat.value,
4925
+ "parsed-value": unref(maxDate) || rightDate.value,
4926
+ onPick: handleMaxTimePick
4927
+ }, null, 8, ["visible", "format", "parsed-value"])
4928
+ ],
4929
+ 2
4930
+ )), [
4931
+ [unref(ClickOutside), handleMaxTimeClose]
4932
+ ])
4933
+ ],
4934
+ 2
4935
+ )
4936
+ ],
4937
+ 2
4938
+ )) : createCommentVNode("v-if", true),
4939
+ createElementVNode(
4940
+ "div",
4941
+ {
4942
+ class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"])
4943
+ },
4944
+ [
4945
+ createElementVNode(
4946
+ "div",
4947
+ {
4948
+ class: normalizeClass(unref(drpNs).e("header"))
4949
+ },
4950
+ [
4951
+ createElementVNode("button", {
4952
+ type: "button",
4953
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
4954
+ "aria-label": unref(t)(`el.datepicker.prevYear`),
4955
+ disabled: unref(dateRangeDisabled),
4956
+ onClick: leftPrevYear
4957
+ }, [
4958
+ renderSlot(_ctx.$slots, "prev-year", {}, () => [
4959
+ createVNode(unref(ElIcon), null, {
4960
+ default: withCtx(() => [
4961
+ createVNode(unref(DArrowLeft))
4962
+ ]),
4963
+ _: 1
4964
+ })
4965
+ ])
4966
+ ], 10, _hoisted_2$2),
4967
+ withDirectives(createElementVNode("button", {
4968
+ type: "button",
4969
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
4970
+ "aria-label": unref(t)(`el.datepicker.prevMonth`),
4971
+ disabled: unref(dateRangeDisabled),
4972
+ onClick: leftPrevMonth
4973
+ }, [
4974
+ renderSlot(_ctx.$slots, "prev-month", {}, () => [
4975
+ createVNode(unref(ElIcon), null, {
4976
+ default: withCtx(() => [
4977
+ createVNode(unref(ArrowLeft))
4978
+ ]),
4979
+ _: 1
4980
+ })
4981
+ ])
4982
+ ], 10, _hoisted_3$2), [
4983
+ [vShow, unref(leftCurrentView) === "date"]
4984
+ ]),
4985
+ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
4986
+ key: 0,
4987
+ type: "button",
4988
+ disabled: !enableYearArrow.value || unref(dateRangeDisabled),
4989
+ class: normalizeClass([[
4990
+ unref(ppNs).e("icon-btn"),
4991
+ unref(ppNs).is("disabled", !enableYearArrow.value || unref(dateRangeDisabled))
4992
+ ], "d-arrow-right"]),
4993
+ "aria-label": unref(t)(`el.datepicker.nextYear`),
4994
+ onClick: leftNextYear
4995
+ }, [
4996
+ renderSlot(_ctx.$slots, "next-year", {}, () => [
4997
+ createVNode(unref(ElIcon), null, {
4998
+ default: withCtx(() => [
4999
+ createVNode(unref(DArrowRight))
5000
+ ]),
5001
+ _: 1
5002
+ })
5003
+ ])
5004
+ ], 10, _hoisted_4$2)) : createCommentVNode("v-if", true),
5005
+ _ctx.unlinkPanels && unref(leftCurrentView) === "date" ? (openBlock(), createElementBlock("button", {
5006
+ key: 1,
5007
+ type: "button",
5008
+ disabled: !enableMonthArrow.value || unref(dateRangeDisabled),
5009
+ class: normalizeClass([[
5010
+ unref(ppNs).e("icon-btn"),
5011
+ unref(ppNs).is("disabled", !enableMonthArrow.value || unref(dateRangeDisabled))
5012
+ ], "arrow-right"]),
5013
+ "aria-label": unref(t)(`el.datepicker.nextMonth`),
5014
+ onClick: leftNextMonth
5015
+ }, [
5016
+ renderSlot(_ctx.$slots, "next-month", {}, () => [
5017
+ createVNode(unref(ElIcon), null, {
5018
+ default: withCtx(() => [
5019
+ createVNode(unref(ArrowRight))
5020
+ ]),
5021
+ _: 1
5022
+ })
5023
+ ])
5024
+ ], 10, _hoisted_5$2)) : createCommentVNode("v-if", true),
5025
+ createElementVNode("div", null, [
5026
+ createElementVNode("span", {
5027
+ role: "button",
5028
+ class: normalizeClass(unref(drpNs).e("header-label")),
5029
+ "aria-live": "polite",
5030
+ tabindex: _ctx.disabled ? void 0 : 0,
5031
+ "aria-disabled": _ctx.disabled,
5032
+ onKeydown: _cache[10] || (_cache[10] = withKeys(($event) => unref(showLeftPicker)("year"), ["enter"])),
5033
+ onClick: _cache[11] || (_cache[11] = ($event) => unref(showLeftPicker)("year"))
5034
+ }, toDisplayString(unref(leftYearLabel)), 43, _hoisted_6),
5035
+ withDirectives(createElementVNode("span", {
5036
+ role: "button",
5037
+ "aria-live": "polite",
5038
+ tabindex: _ctx.disabled ? void 0 : 0,
5039
+ "aria-disabled": _ctx.disabled,
5040
+ class: normalizeClass([
5041
+ unref(drpNs).e("header-label"),
5042
+ { active: unref(leftCurrentView) === "month" }
5043
+ ]),
5044
+ onKeydown: _cache[12] || (_cache[12] = withKeys(($event) => unref(showLeftPicker)("month"), ["enter"])),
5045
+ onClick: _cache[13] || (_cache[13] = ($event) => unref(showLeftPicker)("month"))
5046
+ }, toDisplayString(unref(t)(`el.datepicker.month${leftDate.value.month() + 1}`)), 43, _hoisted_7), [
5047
+ [vShow, unref(leftCurrentView) === "date"]
5048
+ ])
5049
+ ])
5050
+ ],
5051
+ 2
5052
+ ),
5053
+ unref(leftCurrentView) === "date" ? (openBlock(), createBlock(DateTable, {
5054
+ key: 0,
5055
+ ref_key: "leftCurrentViewRef",
5056
+ ref: leftCurrentViewRef,
5057
+ "selection-mode": "range",
5058
+ date: leftDate.value,
5059
+ "min-date": unref(minDate),
5060
+ "max-date": unref(maxDate),
5061
+ "range-state": unref(rangeState),
5062
+ "disabled-date": unref(disabledDate),
5063
+ "cell-class-name": unref(cellClassName),
5064
+ "show-week-number": _ctx.showWeekNumber,
5065
+ disabled: unref(dateRangeDisabled),
5066
+ onChangerange: unref(handleChangeRange),
5067
+ onPick: handleRangePick,
5068
+ onSelect: unref(onSelect)
5069
+ }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "show-week-number", "disabled", "onChangerange", "onSelect"])) : createCommentVNode("v-if", true),
5070
+ unref(leftCurrentView) === "year" ? (openBlock(), createBlock(YearTable, {
5071
+ key: 1,
5072
+ ref_key: "leftCurrentViewRef",
5073
+ ref: leftCurrentViewRef,
5074
+ "selection-mode": "year",
5075
+ date: leftDate.value,
5076
+ "disabled-date": unref(disabledDate),
5077
+ "parsed-value": _ctx.parsedValue,
5078
+ disabled: unref(dateRangeDisabled),
5079
+ onPick: unref(handleLeftYearPick)
5080
+ }, null, 8, ["date", "disabled-date", "parsed-value", "disabled", "onPick"])) : createCommentVNode("v-if", true),
5081
+ unref(leftCurrentView) === "month" ? (openBlock(), createBlock(MonthTable, {
5082
+ key: 2,
5083
+ ref_key: "leftCurrentViewRef",
5084
+ ref: leftCurrentViewRef,
5085
+ "selection-mode": "month",
5086
+ date: leftDate.value,
5087
+ "parsed-value": _ctx.parsedValue,
5088
+ "disabled-date": unref(disabledDate),
5089
+ disabled: unref(dateRangeDisabled),
5090
+ onPick: unref(handleLeftMonthPick)
5091
+ }, null, 8, ["date", "parsed-value", "disabled-date", "disabled", "onPick"])) : createCommentVNode("v-if", true)
5092
+ ],
5093
+ 2
5094
+ ),
5095
+ createElementVNode(
5096
+ "div",
5097
+ {
5098
+ class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"])
5099
+ },
5100
+ [
5101
+ createElementVNode(
5102
+ "div",
5103
+ {
5104
+ class: normalizeClass(unref(drpNs).e("header"))
5105
+ },
5106
+ [
5107
+ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
5108
+ key: 0,
5109
+ type: "button",
5110
+ disabled: !enableYearArrow.value || unref(dateRangeDisabled),
5111
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
5112
+ "aria-label": unref(t)(`el.datepicker.prevYear`),
5113
+ onClick: rightPrevYear
5114
+ }, [
5115
+ renderSlot(_ctx.$slots, "prev-year", {}, () => [
5116
+ createVNode(unref(ElIcon), null, {
5117
+ default: withCtx(() => [
5118
+ createVNode(unref(DArrowLeft))
5119
+ ]),
5120
+ _: 1
5121
+ })
5122
+ ])
5123
+ ], 10, _hoisted_8)) : createCommentVNode("v-if", true),
5124
+ _ctx.unlinkPanels && unref(rightCurrentView) === "date" ? (openBlock(), createElementBlock("button", {
5125
+ key: 1,
5126
+ type: "button",
5127
+ disabled: !enableMonthArrow.value || unref(dateRangeDisabled),
5128
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
5129
+ "aria-label": unref(t)(`el.datepicker.prevMonth`),
5130
+ onClick: rightPrevMonth
5131
+ }, [
5132
+ renderSlot(_ctx.$slots, "prev-month", {}, () => [
5133
+ createVNode(unref(ElIcon), null, {
5134
+ default: withCtx(() => [
5135
+ createVNode(unref(ArrowLeft))
5136
+ ]),
5137
+ _: 1
5138
+ })
5139
+ ])
5140
+ ], 10, _hoisted_9)) : createCommentVNode("v-if", true),
5141
+ createElementVNode("button", {
5142
+ type: "button",
5143
+ "aria-label": unref(t)(`el.datepicker.nextYear`),
5144
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
5145
+ disabled: unref(dateRangeDisabled),
5146
+ onClick: rightNextYear
5147
+ }, [
5148
+ renderSlot(_ctx.$slots, "next-year", {}, () => [
5149
+ createVNode(unref(ElIcon), null, {
5150
+ default: withCtx(() => [
5151
+ createVNode(unref(DArrowRight))
5152
+ ]),
5153
+ _: 1
5154
+ })
5155
+ ])
5156
+ ], 10, _hoisted_10),
5157
+ withDirectives(createElementVNode("button", {
5158
+ type: "button",
5159
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
5160
+ disabled: unref(dateRangeDisabled),
5161
+ "aria-label": unref(t)(`el.datepicker.nextMonth`),
5162
+ onClick: rightNextMonth
5163
+ }, [
5164
+ renderSlot(_ctx.$slots, "next-month", {}, () => [
5165
+ createVNode(unref(ElIcon), null, {
5166
+ default: withCtx(() => [
5167
+ createVNode(unref(ArrowRight))
5168
+ ]),
5169
+ _: 1
5170
+ })
5171
+ ])
5172
+ ], 10, _hoisted_11), [
5173
+ [vShow, unref(rightCurrentView) === "date"]
5174
+ ]),
5175
+ createElementVNode("div", null, [
5176
+ createElementVNode("span", {
5177
+ role: "button",
5178
+ class: normalizeClass(unref(drpNs).e("header-label")),
5179
+ "aria-live": "polite",
5180
+ tabindex: _ctx.disabled ? void 0 : 0,
5181
+ "aria-disabled": _ctx.disabled,
5182
+ onKeydown: _cache[14] || (_cache[14] = withKeys(($event) => unref(showRightPicker)("year"), ["enter"])),
5183
+ onClick: _cache[15] || (_cache[15] = ($event) => unref(showRightPicker)("year"))
5184
+ }, toDisplayString(unref(rightYearLabel)), 43, _hoisted_12),
5185
+ withDirectives(createElementVNode("span", {
5186
+ role: "button",
5187
+ "aria-live": "polite",
5188
+ tabindex: _ctx.disabled ? void 0 : 0,
5189
+ "aria-disabled": _ctx.disabled,
5190
+ class: normalizeClass([
5191
+ unref(drpNs).e("header-label"),
5192
+ { active: unref(rightCurrentView) === "month" }
5193
+ ]),
5194
+ onKeydown: _cache[16] || (_cache[16] = withKeys(($event) => unref(showRightPicker)("month"), ["enter"])),
5195
+ onClick: _cache[17] || (_cache[17] = ($event) => unref(showRightPicker)("month"))
5196
+ }, toDisplayString(unref(t)(`el.datepicker.month${rightDate.value.month() + 1}`)), 43, _hoisted_13), [
5197
+ [vShow, unref(rightCurrentView) === "date"]
5198
+ ])
5199
+ ])
5200
+ ],
5201
+ 2
5202
+ ),
5203
+ unref(rightCurrentView) === "date" ? (openBlock(), createBlock(DateTable, {
5204
+ key: 0,
5205
+ ref_key: "rightCurrentViewRef",
5206
+ ref: rightCurrentViewRef,
5207
+ "selection-mode": "range",
5208
+ date: rightDate.value,
5209
+ "min-date": unref(minDate),
5210
+ "max-date": unref(maxDate),
5211
+ "range-state": unref(rangeState),
5212
+ "disabled-date": unref(disabledDate),
5213
+ "cell-class-name": unref(cellClassName),
5214
+ "show-week-number": _ctx.showWeekNumber,
5215
+ disabled: unref(dateRangeDisabled),
5216
+ onChangerange: unref(handleChangeRange),
5217
+ onPick: handleRangePick,
5218
+ onSelect: unref(onSelect)
5219
+ }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "show-week-number", "disabled", "onChangerange", "onSelect"])) : createCommentVNode("v-if", true),
5220
+ unref(rightCurrentView) === "year" ? (openBlock(), createBlock(YearTable, {
5221
+ key: 1,
5222
+ ref_key: "rightCurrentViewRef",
5223
+ ref: rightCurrentViewRef,
5224
+ "selection-mode": "year",
5225
+ date: rightDate.value,
5226
+ "disabled-date": unref(disabledDate),
5227
+ "parsed-value": _ctx.parsedValue,
5228
+ disabled: unref(dateRangeDisabled),
5229
+ onPick: unref(handleRightYearPick)
5230
+ }, null, 8, ["date", "disabled-date", "parsed-value", "disabled", "onPick"])) : createCommentVNode("v-if", true),
5231
+ unref(rightCurrentView) === "month" ? (openBlock(), createBlock(MonthTable, {
5232
+ key: 2,
5233
+ ref_key: "rightCurrentViewRef",
5234
+ ref: rightCurrentViewRef,
5235
+ "selection-mode": "month",
5236
+ date: rightDate.value,
5237
+ "parsed-value": _ctx.parsedValue,
5238
+ "disabled-date": unref(disabledDate),
5239
+ disabled: unref(dateRangeDisabled),
5240
+ onPick: unref(handleRightMonthPick)
5241
+ }, null, 8, ["date", "parsed-value", "disabled-date", "disabled", "onPick"])) : createCommentVNode("v-if", true)
5242
+ ],
5243
+ 2
5244
+ )
5245
+ ],
5246
+ 2
5247
+ )
5248
+ ],
5249
+ 2
5250
+ ),
5251
+ _ctx.showFooter && showTime.value && (_ctx.showConfirm || unref(clearable)) ? (openBlock(), createElementBlock(
5252
+ "div",
5253
+ {
5254
+ key: 0,
5255
+ class: normalizeClass(unref(ppNs).e("footer"))
5256
+ },
5257
+ [
5258
+ unref(clearable) ? (openBlock(), createBlock(unref(ElButton), {
4484
5259
  key: 0,
4485
- ref_key: "leftCurrentViewRef",
4486
- ref: leftCurrentViewRef,
4487
- "selection-mode": "range",
4488
- date: leftDate.value,
4489
- "min-date": unref(minDate),
4490
- "max-date": unref(maxDate),
4491
- "range-state": unref(rangeState),
4492
- "disabled-date": unref(disabledDate),
4493
- "cell-class-name": unref(cellClassName),
4494
- "show-week-number": _ctx.showWeekNumber,
4495
- disabled: unref(dateRangeDisabled),
4496
- onChangerange: unref(handleChangeRange),
4497
- onPick: handleRangePick,
4498
- onSelect: unref(onSelect)
4499
- }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "show-week-number", "disabled", "onChangerange", "onSelect"])) : createCommentVNode("v-if", true),
4500
- unref(leftCurrentView) === "year" ? (openBlock(), createBlock(YearTable, {
4501
- key: 1,
4502
- ref_key: "leftCurrentViewRef",
4503
- ref: leftCurrentViewRef,
4504
- "selection-mode": "year",
4505
- date: leftDate.value,
4506
- "disabled-date": unref(disabledDate),
4507
- "parsed-value": _ctx.parsedValue,
4508
- disabled: unref(dateRangeDisabled),
4509
- onPick: unref(handleLeftYearPick)
4510
- }, null, 8, ["date", "disabled-date", "parsed-value", "disabled", "onPick"])) : createCommentVNode("v-if", true),
4511
- unref(leftCurrentView) === "month" ? (openBlock(), createBlock(MonthTable, {
4512
- key: 2,
4513
- ref_key: "leftCurrentViewRef",
4514
- ref: leftCurrentViewRef,
4515
- "selection-mode": "month",
4516
- date: leftDate.value,
4517
- "parsed-value": _ctx.parsedValue,
4518
- "disabled-date": unref(disabledDate),
4519
- disabled: unref(dateRangeDisabled),
4520
- onPick: unref(handleLeftMonthPick)
4521
- }, null, 8, ["date", "parsed-value", "disabled-date", "disabled", "onPick"])) : createCommentVNode("v-if", true)
4522
- ], 2),
4523
- createElementVNode("div", {
4524
- class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"])
4525
- }, [
4526
- createElementVNode("div", {
4527
- class: normalizeClass([
4528
- unref(drpNs).e("header"),
4529
- unref(ppNs).is("disabled", !unref(enableYearArrow) || unref(dateRangeDisabled))
4530
- ])
4531
- }, [
4532
- _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
4533
- key: 0,
4534
- type: "button",
4535
- disabled: !unref(enableYearArrow) || unref(dateRangeDisabled),
4536
- class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
4537
- "aria-label": unref(t)(`el.datepicker.prevYear`),
4538
- onClick: rightPrevYear
4539
- }, [
4540
- renderSlot(_ctx.$slots, "prev-year", {}, () => [
4541
- createVNode(unref(ElIcon), null, {
4542
- default: withCtx(() => [
4543
- createVNode(unref(DArrowLeft))
4544
- ]),
4545
- _: 1
4546
- })
4547
- ])
4548
- ], 10, ["disabled", "aria-label"])) : createCommentVNode("v-if", true),
4549
- _ctx.unlinkPanels && unref(rightCurrentView) === "date" ? (openBlock(), createElementBlock("button", {
4550
- key: 1,
4551
- type: "button",
4552
- disabled: !unref(enableMonthArrow) || unref(dateRangeDisabled),
4553
- class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
4554
- "aria-label": unref(t)(`el.datepicker.prevMonth`),
4555
- onClick: rightPrevMonth
4556
- }, [
4557
- renderSlot(_ctx.$slots, "prev-month", {}, () => [
4558
- createVNode(unref(ElIcon), null, {
4559
- default: withCtx(() => [
4560
- createVNode(unref(ArrowLeft))
4561
- ]),
4562
- _: 1
4563
- })
4564
- ])
4565
- ], 10, ["disabled", "aria-label"])) : createCommentVNode("v-if", true),
4566
- createElementVNode("button", {
4567
- type: "button",
4568
- "aria-label": unref(t)(`el.datepicker.nextYear`),
4569
- class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
4570
- disabled: unref(dateRangeDisabled),
4571
- onClick: rightNextYear
4572
- }, [
4573
- renderSlot(_ctx.$slots, "next-year", {}, () => [
4574
- createVNode(unref(ElIcon), null, {
4575
- default: withCtx(() => [
4576
- createVNode(unref(DArrowRight))
4577
- ]),
4578
- _: 1
4579
- })
4580
- ])
4581
- ], 10, ["aria-label", "disabled"]),
4582
- withDirectives(createElementVNode("button", {
4583
- type: "button",
4584
- class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
4585
- disabled: unref(dateRangeDisabled),
4586
- "aria-label": unref(t)(`el.datepicker.nextMonth`),
4587
- onClick: rightNextMonth
4588
- }, [
4589
- renderSlot(_ctx.$slots, "next-month", {}, () => [
4590
- createVNode(unref(ElIcon), null, {
4591
- default: withCtx(() => [
4592
- createVNode(unref(ArrowRight))
4593
- ]),
4594
- _: 1
4595
- })
4596
- ])
4597
- ], 10, ["disabled", "aria-label"]), [
4598
- [vShow, unref(rightCurrentView) === "date"]
5260
+ text: "",
5261
+ size: "small",
5262
+ class: normalizeClass(unref(ppNs).e("link-btn")),
5263
+ onClick: onClear
5264
+ }, {
5265
+ default: withCtx(() => [
5266
+ createTextVNode(
5267
+ toDisplayString(unref(t)("el.datepicker.clear")),
5268
+ 1
5269
+ )
4599
5270
  ]),
4600
- createElementVNode("div", null, [
4601
- createElementVNode("span", {
4602
- role: "button",
4603
- class: normalizeClass(unref(drpNs).e("header-label")),
4604
- "aria-live": "polite",
4605
- tabindex: _ctx.disabled ? void 0 : 0,
4606
- "aria-disabled": _ctx.disabled,
4607
- onKeydown: withKeys(($event) => unref(showRightPicker)("year"), ["enter"]),
4608
- onClick: ($event) => unref(showRightPicker)("year")
4609
- }, toDisplayString(unref(rightYearLabel)), 43, ["tabindex", "aria-disabled", "onKeydown", "onClick"]),
4610
- withDirectives(createElementVNode("span", {
4611
- role: "button",
4612
- "aria-live": "polite",
4613
- tabindex: _ctx.disabled ? void 0 : 0,
4614
- "aria-disabled": _ctx.disabled,
4615
- class: normalizeClass([
4616
- unref(drpNs).e("header-label"),
4617
- { active: unref(rightCurrentView) === "month" }
4618
- ]),
4619
- onKeydown: withKeys(($event) => unref(showRightPicker)("month"), ["enter"]),
4620
- onClick: ($event) => unref(showRightPicker)("month")
4621
- }, toDisplayString(unref(t)(`el.datepicker.month${rightDate.value.month() + 1}`)), 43, ["tabindex", "aria-disabled", "onKeydown", "onClick"]), [
4622
- [vShow, unref(rightCurrentView) === "date"]
4623
- ])
4624
- ])
4625
- ], 2),
4626
- unref(rightCurrentView) === "date" ? (openBlock(), createBlock(DateTable, {
4627
- key: 0,
4628
- ref_key: "rightCurrentViewRef",
4629
- ref: rightCurrentViewRef,
4630
- "selection-mode": "range",
4631
- date: rightDate.value,
4632
- "min-date": unref(minDate),
4633
- "max-date": unref(maxDate),
4634
- "range-state": unref(rangeState),
4635
- "disabled-date": unref(disabledDate),
4636
- "cell-class-name": unref(cellClassName),
4637
- "show-week-number": _ctx.showWeekNumber,
4638
- disabled: unref(dateRangeDisabled),
4639
- onChangerange: unref(handleChangeRange),
4640
- onPick: handleRangePick,
4641
- onSelect: unref(onSelect)
4642
- }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "show-week-number", "disabled", "onChangerange", "onSelect"])) : createCommentVNode("v-if", true),
4643
- unref(rightCurrentView) === "year" ? (openBlock(), createBlock(YearTable, {
5271
+ _: 1
5272
+ }, 8, ["class"])) : createCommentVNode("v-if", true),
5273
+ _ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
4644
5274
  key: 1,
4645
- ref_key: "rightCurrentViewRef",
4646
- ref: rightCurrentViewRef,
4647
- "selection-mode": "year",
4648
- date: rightDate.value,
4649
- "disabled-date": unref(disabledDate),
4650
- "parsed-value": _ctx.parsedValue,
4651
- disabled: unref(dateRangeDisabled),
4652
- onPick: unref(handleRightYearPick)
4653
- }, null, 8, ["date", "disabled-date", "parsed-value", "disabled", "onPick"])) : createCommentVNode("v-if", true),
4654
- unref(rightCurrentView) === "month" ? (openBlock(), createBlock(MonthTable, {
4655
- key: 2,
4656
- ref_key: "rightCurrentViewRef",
4657
- ref: rightCurrentViewRef,
4658
- "selection-mode": "month",
4659
- date: rightDate.value,
4660
- "parsed-value": _ctx.parsedValue,
4661
- "disabled-date": unref(disabledDate),
4662
- disabled: unref(dateRangeDisabled),
4663
- onPick: unref(handleRightMonthPick)
4664
- }, null, 8, ["date", "parsed-value", "disabled-date", "disabled", "onPick"])) : createCommentVNode("v-if", true)
4665
- ], 2)
4666
- ], 2)
4667
- ], 2),
4668
- _ctx.showFooter && unref(showTime) && (_ctx.showConfirm || unref(clearable)) ? (openBlock(), createElementBlock("div", {
4669
- key: 0,
4670
- class: normalizeClass(unref(ppNs).e("footer"))
4671
- }, [
4672
- unref(clearable) ? (openBlock(), createBlock(unref(ElButton), {
4673
- key: 0,
4674
- text: "",
4675
- size: "small",
4676
- class: normalizeClass(unref(ppNs).e("link-btn")),
4677
- onClick: handleClear
4678
- }, {
4679
- default: withCtx(() => [
4680
- createTextVNode(toDisplayString(unref(t)("el.datepicker.clear")), 1)
4681
- ]),
4682
- _: 1
4683
- }, 8, ["class"])) : createCommentVNode("v-if", true),
4684
- _ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
4685
- key: 1,
4686
- plain: "",
4687
- size: "small",
4688
- class: normalizeClass(unref(ppNs).e("link-btn")),
4689
- disabled: unref(btnDisabled),
4690
- onClick: ($event) => unref(handleRangeConfirm)(false)
4691
- }, {
4692
- default: withCtx(() => [
4693
- createTextVNode(toDisplayString(unref(t)("el.datepicker.confirm")), 1)
4694
- ]),
4695
- _: 1
4696
- }, 8, ["class", "disabled", "onClick"])) : createCommentVNode("v-if", true)
4697
- ], 2)) : createCommentVNode("v-if", true)
4698
- ], 2);
5275
+ plain: "",
5276
+ size: "small",
5277
+ class: normalizeClass(unref(ppNs).e("link-btn")),
5278
+ disabled: btnDisabled.value,
5279
+ onClick: _cache[18] || (_cache[18] = ($event) => unref(handleRangeConfirm)(false))
5280
+ }, {
5281
+ default: withCtx(() => [
5282
+ createTextVNode(
5283
+ toDisplayString(unref(t)("el.datepicker.confirm")),
5284
+ 1
5285
+ )
5286
+ ]),
5287
+ _: 1
5288
+ }, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)
5289
+ ],
5290
+ 2
5291
+ )) : createCommentVNode("v-if", true)
5292
+ ],
5293
+ 2
5294
+ );
4699
5295
  };
4700
5296
  }
4701
5297
  });
4702
- var DateRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "panel-date-range.vue"]]);
5298
+ var DateRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/date-picker-panel/src/date-picker-com/panel-date-range.vue"]]);
4703
5299
 
4704
5300
  const panelMonthRangeProps = buildProps({
4705
5301
  ...panelRangeSharedProps
@@ -4758,19 +5354,28 @@ const useMonthRangeHeader = ({
4758
5354
  };
4759
5355
  };
4760
5356
 
5357
+ const _hoisted_1$1 = ["disabled", "onClick"];
5358
+ const _hoisted_2$1 = ["disabled"];
5359
+ const _hoisted_3$1 = ["disabled"];
5360
+ const _hoisted_4$1 = ["disabled"];
5361
+ const _hoisted_5$1 = ["disabled"];
4761
5362
  const unit$1 = "year";
4762
- const __default__$1 = defineComponent({
4763
- name: "DatePickerMonthRange"
4764
- });
4765
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
4766
- ...__default__$1,
5363
+ const _sfc_main$2 = defineComponent({
5364
+ ...{
5365
+ name: "DatePickerMonthRange"
5366
+ },
5367
+ __name: "panel-month-range",
4767
5368
  props: panelMonthRangeProps,
4768
5369
  emits: panelMonthRangeEmits,
4769
- setup(__props, { emit }) {
5370
+ setup(__props, { emit: __emit }) {
4770
5371
  const props = __props;
5372
+ const emit = __emit;
4771
5373
  const { lang } = useLocale();
4772
5374
  const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
4773
- const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
5375
+ const isDefaultFormat = inject(
5376
+ ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,
5377
+ void 0
5378
+ );
4774
5379
  const { shortcuts, disabledDate, cellClassName } = pickerBase.props;
4775
5380
  const format = toRef(pickerBase.props, "format");
4776
5381
  const defaultValue = toRef(pickerBase.props, "defaultValue");
@@ -4839,7 +5444,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
4839
5444
  emit("pick", valueOnClear);
4840
5445
  };
4841
5446
  const parseUserInput = (value) => {
4842
- return correctlyParseUserInput(value, format.value, lang.value, isDefaultFormat);
5447
+ return correctlyParseUserInput(
5448
+ value,
5449
+ format.value,
5450
+ lang.value,
5451
+ isDefaultFormat
5452
+ );
4843
5453
  };
4844
5454
  function sortDates(minDate2, maxDate2) {
4845
5455
  if (props.unlinkPanels && maxDate2) {
@@ -4851,169 +5461,227 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
4851
5461
  }
4852
5462
  }
4853
5463
  const monthRangeDisabled = useFormDisabled();
4854
- watch(() => props.visible, (visible) => {
4855
- if (!visible && rangeState.value.selecting) {
4856
- parseValue(props.parsedValue);
4857
- onSelect(false);
5464
+ watch(
5465
+ () => props.visible,
5466
+ (visible) => {
5467
+ if (!visible && rangeState.value.selecting) {
5468
+ parseValue(props.parsedValue);
5469
+ onSelect(false);
5470
+ }
4858
5471
  }
4859
- });
5472
+ );
4860
5473
  emit("set-picker-option", ["isValidValue", isValidRange]);
4861
5474
  emit("set-picker-option", ["parseUserInput", parseUserInput]);
4862
5475
  emit("set-picker-option", ["handleClear", handleClear]);
4863
5476
  return (_ctx, _cache) => {
4864
- return openBlock(), createElementBlock("div", {
4865
- class: normalizeClass([
4866
- unref(ppNs).b(),
4867
- unref(drpNs).b(),
4868
- unref(ppNs).is("border", _ctx.border),
4869
- unref(ppNs).is("disabled", unref(monthRangeDisabled)),
4870
- {
4871
- "has-sidebar": Boolean(_ctx.$slots.sidebar) || unref(hasShortcuts)
4872
- }
4873
- ])
4874
- }, [
4875
- createElementVNode("div", {
4876
- class: normalizeClass(unref(ppNs).e("body-wrapper"))
4877
- }, [
4878
- renderSlot(_ctx.$slots, "sidebar", {
4879
- class: normalizeClass(unref(ppNs).e("sidebar"))
4880
- }),
4881
- unref(hasShortcuts) ? (openBlock(), createElementBlock("div", {
4882
- key: 0,
4883
- class: normalizeClass(unref(ppNs).e("sidebar"))
4884
- }, [
4885
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
4886
- return openBlock(), createElementBlock("button", {
4887
- key,
4888
- type: "button",
4889
- class: normalizeClass(unref(ppNs).e("shortcut")),
4890
- disabled: unref(monthRangeDisabled),
4891
- onClick: ($event) => unref(handleShortcutClick)(shortcut)
4892
- }, toDisplayString(shortcut.text), 11, ["disabled", "onClick"]);
4893
- }), 128))
4894
- ], 2)) : createCommentVNode("v-if", true),
4895
- createElementVNode("div", {
4896
- class: normalizeClass(unref(ppNs).e("body"))
4897
- }, [
4898
- createElementVNode("div", {
4899
- class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"])
4900
- }, [
4901
- createElementVNode("div", {
4902
- class: normalizeClass(unref(drpNs).e("header"))
4903
- }, [
4904
- createElementVNode("button", {
4905
- type: "button",
4906
- class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
4907
- disabled: unref(monthRangeDisabled),
4908
- onClick: unref(leftPrevYear)
4909
- }, [
4910
- renderSlot(_ctx.$slots, "prev-year", {}, () => [
4911
- createVNode(unref(ElIcon), null, {
4912
- default: withCtx(() => [
4913
- createVNode(unref(DArrowLeft))
4914
- ]),
4915
- _: 1
4916
- })
4917
- ])
4918
- ], 10, ["disabled", "onClick"]),
4919
- _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
4920
- key: 0,
4921
- type: "button",
4922
- disabled: !unref(enableYearArrow) || unref(monthRangeDisabled),
4923
- class: normalizeClass([[
4924
- unref(ppNs).e("icon-btn"),
4925
- unref(ppNs).is("disabled", !unref(enableYearArrow) || unref(monthRangeDisabled))
4926
- ], "d-arrow-right"]),
4927
- onClick: unref(leftNextYear)
4928
- }, [
4929
- renderSlot(_ctx.$slots, "next-year", {}, () => [
4930
- createVNode(unref(ElIcon), null, {
4931
- default: withCtx(() => [
4932
- createVNode(unref(DArrowRight))
4933
- ]),
4934
- _: 1
4935
- })
4936
- ])
4937
- ], 10, ["disabled", "onClick"])) : createCommentVNode("v-if", true),
4938
- createElementVNode("div", null, toDisplayString(unref(leftLabel)), 1)
4939
- ], 2),
4940
- createVNode(MonthTable, {
4941
- "selection-mode": "range",
4942
- date: leftDate.value,
4943
- "min-date": unref(minDate),
4944
- "max-date": unref(maxDate),
4945
- "range-state": unref(rangeState),
4946
- "disabled-date": unref(disabledDate),
4947
- disabled: unref(monthRangeDisabled),
4948
- "cell-class-name": unref(cellClassName),
4949
- onChangerange: unref(handleChangeRange),
4950
- onPick: handleRangePick,
4951
- onSelect: unref(onSelect)
4952
- }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
4953
- ], 2),
4954
- createElementVNode("div", {
4955
- class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"])
4956
- }, [
4957
- createElementVNode("div", {
4958
- class: normalizeClass(unref(drpNs).e("header"))
4959
- }, [
4960
- _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
5477
+ return openBlock(), createElementBlock(
5478
+ "div",
5479
+ {
5480
+ class: normalizeClass([
5481
+ unref(ppNs).b(),
5482
+ unref(drpNs).b(),
5483
+ unref(ppNs).is("border", _ctx.border),
5484
+ unref(ppNs).is("disabled", unref(monthRangeDisabled)),
5485
+ {
5486
+ "has-sidebar": Boolean(_ctx.$slots.sidebar) || hasShortcuts.value
5487
+ }
5488
+ ])
5489
+ },
5490
+ [
5491
+ createElementVNode(
5492
+ "div",
5493
+ {
5494
+ class: normalizeClass(unref(ppNs).e("body-wrapper"))
5495
+ },
5496
+ [
5497
+ renderSlot(_ctx.$slots, "sidebar", {
5498
+ class: normalizeClass(unref(ppNs).e("sidebar"))
5499
+ }),
5500
+ hasShortcuts.value ? (openBlock(), createElementBlock(
5501
+ "div",
5502
+ {
4961
5503
  key: 0,
4962
- type: "button",
4963
- disabled: !unref(enableYearArrow) || unref(monthRangeDisabled),
4964
- class: normalizeClass([[
4965
- unref(ppNs).e("icon-btn"),
4966
- unref(ppNs).is("disabled", !unref(enableYearArrow) || unref(monthRangeDisabled))
4967
- ], "d-arrow-left"]),
4968
- onClick: unref(rightPrevYear)
4969
- }, [
4970
- renderSlot(_ctx.$slots, "prev-year", {}, () => [
4971
- createVNode(unref(ElIcon), null, {
4972
- default: withCtx(() => [
4973
- createVNode(unref(DArrowLeft))
4974
- ]),
4975
- _: 1
4976
- })
4977
- ])
4978
- ], 10, ["disabled", "onClick"])) : createCommentVNode("v-if", true),
4979
- createElementVNode("button", {
4980
- type: "button",
4981
- class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
4982
- disabled: unref(monthRangeDisabled),
4983
- onClick: unref(rightNextYear)
4984
- }, [
4985
- renderSlot(_ctx.$slots, "next-year", {}, () => [
4986
- createVNode(unref(ElIcon), null, {
4987
- default: withCtx(() => [
4988
- createVNode(unref(DArrowRight))
4989
- ]),
4990
- _: 1
4991
- })
4992
- ])
4993
- ], 10, ["disabled", "onClick"]),
4994
- createElementVNode("div", null, toDisplayString(unref(rightLabel)), 1)
4995
- ], 2),
4996
- createVNode(MonthTable, {
4997
- "selection-mode": "range",
4998
- date: rightDate.value,
4999
- "min-date": unref(minDate),
5000
- "max-date": unref(maxDate),
5001
- "range-state": unref(rangeState),
5002
- "disabled-date": unref(disabledDate),
5003
- disabled: unref(monthRangeDisabled),
5004
- "cell-class-name": unref(cellClassName),
5005
- onChangerange: unref(handleChangeRange),
5006
- onPick: handleRangePick,
5007
- onSelect: unref(onSelect)
5008
- }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
5009
- ], 2)
5010
- ], 2)
5011
- ], 2)
5012
- ], 2);
5504
+ class: normalizeClass(unref(ppNs).e("sidebar"))
5505
+ },
5506
+ [
5507
+ (openBlock(true), createElementBlock(
5508
+ Fragment,
5509
+ null,
5510
+ renderList(unref(shortcuts), (shortcut, key) => {
5511
+ return openBlock(), createElementBlock("button", {
5512
+ key,
5513
+ type: "button",
5514
+ class: normalizeClass(unref(ppNs).e("shortcut")),
5515
+ disabled: unref(monthRangeDisabled),
5516
+ onClick: ($event) => unref(handleShortcutClick)(shortcut)
5517
+ }, toDisplayString(shortcut.text), 11, _hoisted_1$1);
5518
+ }),
5519
+ 128
5520
+ ))
5521
+ ],
5522
+ 2
5523
+ )) : createCommentVNode("v-if", true),
5524
+ createElementVNode(
5525
+ "div",
5526
+ {
5527
+ class: normalizeClass(unref(ppNs).e("body"))
5528
+ },
5529
+ [
5530
+ createElementVNode(
5531
+ "div",
5532
+ {
5533
+ class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"])
5534
+ },
5535
+ [
5536
+ createElementVNode(
5537
+ "div",
5538
+ {
5539
+ class: normalizeClass(unref(drpNs).e("header"))
5540
+ },
5541
+ [
5542
+ createElementVNode("button", {
5543
+ type: "button",
5544
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
5545
+ disabled: unref(monthRangeDisabled),
5546
+ onClick: _cache[0] || (_cache[0] = (...args) => unref(leftPrevYear) && unref(leftPrevYear)(...args))
5547
+ }, [
5548
+ renderSlot(_ctx.$slots, "prev-year", {}, () => [
5549
+ createVNode(unref(ElIcon), null, {
5550
+ default: withCtx(() => [
5551
+ createVNode(unref(DArrowLeft))
5552
+ ]),
5553
+ _: 1
5554
+ })
5555
+ ])
5556
+ ], 10, _hoisted_2$1),
5557
+ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
5558
+ key: 0,
5559
+ type: "button",
5560
+ disabled: !enableYearArrow.value || unref(monthRangeDisabled),
5561
+ class: normalizeClass([[
5562
+ unref(ppNs).e("icon-btn"),
5563
+ unref(ppNs).is("disabled", !enableYearArrow.value || unref(monthRangeDisabled))
5564
+ ], "d-arrow-right"]),
5565
+ onClick: _cache[1] || (_cache[1] = (...args) => unref(leftNextYear) && unref(leftNextYear)(...args))
5566
+ }, [
5567
+ renderSlot(_ctx.$slots, "next-year", {}, () => [
5568
+ createVNode(unref(ElIcon), null, {
5569
+ default: withCtx(() => [
5570
+ createVNode(unref(DArrowRight))
5571
+ ]),
5572
+ _: 1
5573
+ })
5574
+ ])
5575
+ ], 10, _hoisted_3$1)) : createCommentVNode("v-if", true),
5576
+ createElementVNode(
5577
+ "div",
5578
+ null,
5579
+ toDisplayString(unref(leftLabel)),
5580
+ 1
5581
+ )
5582
+ ],
5583
+ 2
5584
+ ),
5585
+ createVNode(MonthTable, {
5586
+ "selection-mode": "range",
5587
+ date: leftDate.value,
5588
+ "min-date": unref(minDate),
5589
+ "max-date": unref(maxDate),
5590
+ "range-state": unref(rangeState),
5591
+ "disabled-date": unref(disabledDate),
5592
+ disabled: unref(monthRangeDisabled),
5593
+ "cell-class-name": unref(cellClassName),
5594
+ onChangerange: unref(handleChangeRange),
5595
+ onPick: handleRangePick,
5596
+ onSelect: unref(onSelect)
5597
+ }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
5598
+ ],
5599
+ 2
5600
+ ),
5601
+ createElementVNode(
5602
+ "div",
5603
+ {
5604
+ class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"])
5605
+ },
5606
+ [
5607
+ createElementVNode(
5608
+ "div",
5609
+ {
5610
+ class: normalizeClass(unref(drpNs).e("header"))
5611
+ },
5612
+ [
5613
+ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
5614
+ key: 0,
5615
+ type: "button",
5616
+ disabled: !enableYearArrow.value || unref(monthRangeDisabled),
5617
+ class: normalizeClass([[
5618
+ unref(ppNs).e("icon-btn"),
5619
+ unref(ppNs).is("disabled", !enableYearArrow.value || unref(monthRangeDisabled))
5620
+ ], "d-arrow-left"]),
5621
+ onClick: _cache[2] || (_cache[2] = (...args) => unref(rightPrevYear) && unref(rightPrevYear)(...args))
5622
+ }, [
5623
+ renderSlot(_ctx.$slots, "prev-year", {}, () => [
5624
+ createVNode(unref(ElIcon), null, {
5625
+ default: withCtx(() => [
5626
+ createVNode(unref(DArrowLeft))
5627
+ ]),
5628
+ _: 1
5629
+ })
5630
+ ])
5631
+ ], 10, _hoisted_4$1)) : createCommentVNode("v-if", true),
5632
+ createElementVNode("button", {
5633
+ type: "button",
5634
+ class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
5635
+ disabled: unref(monthRangeDisabled),
5636
+ onClick: _cache[3] || (_cache[3] = (...args) => unref(rightNextYear) && unref(rightNextYear)(...args))
5637
+ }, [
5638
+ renderSlot(_ctx.$slots, "next-year", {}, () => [
5639
+ createVNode(unref(ElIcon), null, {
5640
+ default: withCtx(() => [
5641
+ createVNode(unref(DArrowRight))
5642
+ ]),
5643
+ _: 1
5644
+ })
5645
+ ])
5646
+ ], 10, _hoisted_5$1),
5647
+ createElementVNode(
5648
+ "div",
5649
+ null,
5650
+ toDisplayString(unref(rightLabel)),
5651
+ 1
5652
+ )
5653
+ ],
5654
+ 2
5655
+ ),
5656
+ createVNode(MonthTable, {
5657
+ "selection-mode": "range",
5658
+ date: rightDate.value,
5659
+ "min-date": unref(minDate),
5660
+ "max-date": unref(maxDate),
5661
+ "range-state": unref(rangeState),
5662
+ "disabled-date": unref(disabledDate),
5663
+ disabled: unref(monthRangeDisabled),
5664
+ "cell-class-name": unref(cellClassName),
5665
+ onChangerange: unref(handleChangeRange),
5666
+ onPick: handleRangePick,
5667
+ onSelect: unref(onSelect)
5668
+ }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
5669
+ ],
5670
+ 2
5671
+ )
5672
+ ],
5673
+ 2
5674
+ )
5675
+ ],
5676
+ 2
5677
+ )
5678
+ ],
5679
+ 2
5680
+ );
5013
5681
  };
5014
5682
  }
5015
5683
  });
5016
- var MonthRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "panel-month-range.vue"]]);
5684
+ var MonthRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/date-picker-panel/src/date-picker-com/panel-month-range.vue"]]);
5017
5685
 
5018
5686
  const panelYearRangeProps = buildProps({
5019
5687
  ...panelRangeSharedProps
@@ -5075,21 +5743,30 @@ const useYearRangeHeader = ({
5075
5743
  };
5076
5744
  };
5077
5745
 
5746
+ const _hoisted_1 = ["disabled", "onClick"];
5747
+ const _hoisted_2 = ["disabled"];
5748
+ const _hoisted_3 = ["disabled"];
5749
+ const _hoisted_4 = ["disabled"];
5750
+ const _hoisted_5 = ["disabled"];
5078
5751
  const step = 10;
5079
5752
  const unit = "year";
5080
- const __default__ = defineComponent({
5081
- name: "DatePickerYearRange"
5082
- });
5083
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5084
- ...__default__,
5753
+ const _sfc_main$1 = defineComponent({
5754
+ ...{
5755
+ name: "DatePickerYearRange"
5756
+ },
5757
+ __name: "panel-year-range",
5085
5758
  props: panelYearRangeProps,
5086
5759
  emits: panelYearRangeEmits,
5087
- setup(__props, { emit }) {
5760
+ setup(__props, { emit: __emit }) {
5088
5761
  const props = __props;
5762
+ const emit = __emit;
5089
5763
  const { lang } = useLocale();
5090
5764
  const leftDate = ref(dayjs().locale(lang.value));
5091
5765
  const rightDate = ref(dayjs().locale(lang.value).add(step, unit));
5092
- const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
5766
+ const isDefaultFormat = inject(
5767
+ ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,
5768
+ void 0
5769
+ );
5093
5770
  const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
5094
5771
  const { shortcuts, disabledDate, cellClassName } = pickerBase.props;
5095
5772
  const format = toRef(pickerBase.props, "format");
@@ -5177,7 +5854,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5177
5854
  handleRangeConfirm();
5178
5855
  };
5179
5856
  const parseUserInput = (value) => {
5180
- return correctlyParseUserInput(value, format.value, lang.value, isDefaultFormat);
5857
+ return correctlyParseUserInput(
5858
+ value,
5859
+ format.value,
5860
+ lang.value,
5861
+ isDefaultFormat
5862
+ );
5181
5863
  };
5182
5864
  const isValidValue = (date) => {
5183
5865
  return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
@@ -5206,155 +5888,213 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5206
5888
  rightDate.value = leftDate.value.add(step, unit);
5207
5889
  }
5208
5890
  }
5209
- watch(() => props.visible, (visible) => {
5210
- if (!visible && rangeState.value.selecting) {
5211
- parseValue(props.parsedValue);
5212
- onSelect(false);
5891
+ watch(
5892
+ () => props.visible,
5893
+ (visible) => {
5894
+ if (!visible && rangeState.value.selecting) {
5895
+ parseValue(props.parsedValue);
5896
+ onSelect(false);
5897
+ }
5213
5898
  }
5214
- });
5899
+ );
5215
5900
  emit("set-picker-option", ["isValidValue", isValidValue]);
5216
5901
  emit("set-picker-option", ["parseUserInput", parseUserInput]);
5217
5902
  emit("set-picker-option", ["handleClear", handleClear]);
5218
5903
  return (_ctx, _cache) => {
5219
- return openBlock(), createElementBlock("div", {
5220
- class: normalizeClass(unref(panelKls))
5221
- }, [
5222
- createElementVNode("div", {
5223
- class: normalizeClass(unref(ppNs).e("body-wrapper"))
5224
- }, [
5225
- renderSlot(_ctx.$slots, "sidebar", {
5226
- class: normalizeClass(unref(ppNs).e("sidebar"))
5227
- }),
5228
- unref(hasShortcuts) ? (openBlock(), createElementBlock("div", {
5229
- key: 0,
5230
- class: normalizeClass(unref(ppNs).e("sidebar"))
5231
- }, [
5232
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
5233
- return openBlock(), createElementBlock("button", {
5234
- key,
5235
- type: "button",
5236
- class: normalizeClass(unref(ppNs).e("shortcut")),
5237
- disabled: unref(yearRangeDisabled),
5238
- onClick: ($event) => unref(handleShortcutClick)(shortcut)
5239
- }, toDisplayString(shortcut.text), 11, ["disabled", "onClick"]);
5240
- }), 128))
5241
- ], 2)) : createCommentVNode("v-if", true),
5242
- createElementVNode("div", {
5243
- class: normalizeClass(unref(ppNs).e("body"))
5244
- }, [
5245
- createElementVNode("div", {
5246
- class: normalizeClass(unref(leftPanelKls).content)
5247
- }, [
5248
- createElementVNode("div", {
5249
- class: normalizeClass(unref(drpNs).e("header"))
5250
- }, [
5251
- createElementVNode("button", {
5252
- type: "button",
5253
- class: normalizeClass(unref(leftPanelKls).arrowLeftBtn),
5254
- disabled: unref(yearRangeDisabled),
5255
- onClick: unref(leftPrevYear)
5256
- }, [
5257
- renderSlot(_ctx.$slots, "prev-year", {}, () => [
5258
- createVNode(unref(ElIcon), null, {
5259
- default: withCtx(() => [
5260
- createVNode(unref(DArrowLeft))
5261
- ]),
5262
- _: 1
5263
- })
5264
- ])
5265
- ], 10, ["disabled", "onClick"]),
5266
- _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
5267
- key: 0,
5268
- type: "button",
5269
- disabled: !unref(enableYearArrow) || unref(yearRangeDisabled),
5270
- class: normalizeClass(unref(leftPanelKls).arrowRightBtn),
5271
- onClick: unref(leftNextYear)
5272
- }, [
5273
- renderSlot(_ctx.$slots, "next-year", {}, () => [
5274
- createVNode(unref(ElIcon), null, {
5275
- default: withCtx(() => [
5276
- createVNode(unref(DArrowRight))
5277
- ]),
5278
- _: 1
5279
- })
5280
- ])
5281
- ], 10, ["disabled", "onClick"])) : createCommentVNode("v-if", true),
5282
- createElementVNode("div", null, toDisplayString(unref(leftLabel)), 1)
5283
- ], 2),
5284
- createVNode(YearTable, {
5285
- "selection-mode": "range",
5286
- date: leftDate.value,
5287
- "min-date": unref(minDate),
5288
- "max-date": unref(maxDate),
5289
- "range-state": unref(rangeState),
5290
- "disabled-date": unref(disabledDate),
5291
- disabled: unref(yearRangeDisabled),
5292
- "cell-class-name": unref(cellClassName),
5293
- onChangerange: unref(handleChangeRange),
5294
- onPick: handleRangePick,
5295
- onSelect: unref(onSelect)
5296
- }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
5297
- ], 2),
5298
- createElementVNode("div", {
5299
- class: normalizeClass(unref(rightPanelKls).content)
5300
- }, [
5301
- createElementVNode("div", {
5302
- class: normalizeClass(unref(drpNs).e("header"))
5303
- }, [
5304
- _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
5904
+ return openBlock(), createElementBlock(
5905
+ "div",
5906
+ {
5907
+ class: normalizeClass(panelKls.value)
5908
+ },
5909
+ [
5910
+ createElementVNode(
5911
+ "div",
5912
+ {
5913
+ class: normalizeClass(unref(ppNs).e("body-wrapper"))
5914
+ },
5915
+ [
5916
+ renderSlot(_ctx.$slots, "sidebar", {
5917
+ class: normalizeClass(unref(ppNs).e("sidebar"))
5918
+ }),
5919
+ hasShortcuts.value ? (openBlock(), createElementBlock(
5920
+ "div",
5921
+ {
5305
5922
  key: 0,
5306
- type: "button",
5307
- disabled: !unref(enableYearArrow) || unref(yearRangeDisabled),
5308
- class: normalizeClass(unref(rightPanelKls).arrowLeftBtn),
5309
- onClick: unref(rightPrevYear)
5310
- }, [
5311
- renderSlot(_ctx.$slots, "prev-year", {}, () => [
5312
- createVNode(unref(ElIcon), null, {
5313
- default: withCtx(() => [
5314
- createVNode(unref(DArrowLeft))
5315
- ]),
5316
- _: 1
5317
- })
5318
- ])
5319
- ], 10, ["disabled", "onClick"])) : createCommentVNode("v-if", true),
5320
- createElementVNode("button", {
5321
- type: "button",
5322
- class: normalizeClass(unref(rightPanelKls).arrowRightBtn),
5323
- disabled: unref(yearRangeDisabled),
5324
- onClick: unref(rightNextYear)
5325
- }, [
5326
- renderSlot(_ctx.$slots, "next-year", {}, () => [
5327
- createVNode(unref(ElIcon), null, {
5328
- default: withCtx(() => [
5329
- createVNode(unref(DArrowRight))
5330
- ]),
5331
- _: 1
5332
- })
5333
- ])
5334
- ], 10, ["disabled", "onClick"]),
5335
- createElementVNode("div", null, toDisplayString(unref(rightLabel)), 1)
5336
- ], 2),
5337
- createVNode(YearTable, {
5338
- "selection-mode": "range",
5339
- date: rightDate.value,
5340
- "min-date": unref(minDate),
5341
- "max-date": unref(maxDate),
5342
- "range-state": unref(rangeState),
5343
- "disabled-date": unref(disabledDate),
5344
- disabled: unref(yearRangeDisabled),
5345
- "cell-class-name": unref(cellClassName),
5346
- onChangerange: unref(handleChangeRange),
5347
- onPick: handleRangePick,
5348
- onSelect: unref(onSelect)
5349
- }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
5350
- ], 2)
5351
- ], 2)
5352
- ], 2)
5353
- ], 2);
5923
+ class: normalizeClass(unref(ppNs).e("sidebar"))
5924
+ },
5925
+ [
5926
+ (openBlock(true), createElementBlock(
5927
+ Fragment,
5928
+ null,
5929
+ renderList(unref(shortcuts), (shortcut, key) => {
5930
+ return openBlock(), createElementBlock("button", {
5931
+ key,
5932
+ type: "button",
5933
+ class: normalizeClass(unref(ppNs).e("shortcut")),
5934
+ disabled: unref(yearRangeDisabled),
5935
+ onClick: ($event) => unref(handleShortcutClick)(shortcut)
5936
+ }, toDisplayString(shortcut.text), 11, _hoisted_1);
5937
+ }),
5938
+ 128
5939
+ ))
5940
+ ],
5941
+ 2
5942
+ )) : createCommentVNode("v-if", true),
5943
+ createElementVNode(
5944
+ "div",
5945
+ {
5946
+ class: normalizeClass(unref(ppNs).e("body"))
5947
+ },
5948
+ [
5949
+ createElementVNode(
5950
+ "div",
5951
+ {
5952
+ class: normalizeClass(leftPanelKls.value.content)
5953
+ },
5954
+ [
5955
+ createElementVNode(
5956
+ "div",
5957
+ {
5958
+ class: normalizeClass(unref(drpNs).e("header"))
5959
+ },
5960
+ [
5961
+ createElementVNode("button", {
5962
+ type: "button",
5963
+ class: normalizeClass(leftPanelKls.value.arrowLeftBtn),
5964
+ disabled: unref(yearRangeDisabled),
5965
+ onClick: _cache[0] || (_cache[0] = (...args) => unref(leftPrevYear) && unref(leftPrevYear)(...args))
5966
+ }, [
5967
+ renderSlot(_ctx.$slots, "prev-year", {}, () => [
5968
+ createVNode(unref(ElIcon), null, {
5969
+ default: withCtx(() => [
5970
+ createVNode(unref(DArrowLeft))
5971
+ ]),
5972
+ _: 1
5973
+ })
5974
+ ])
5975
+ ], 10, _hoisted_2),
5976
+ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
5977
+ key: 0,
5978
+ type: "button",
5979
+ disabled: !enableYearArrow.value || unref(yearRangeDisabled),
5980
+ class: normalizeClass(leftPanelKls.value.arrowRightBtn),
5981
+ onClick: _cache[1] || (_cache[1] = (...args) => unref(leftNextYear) && unref(leftNextYear)(...args))
5982
+ }, [
5983
+ renderSlot(_ctx.$slots, "next-year", {}, () => [
5984
+ createVNode(unref(ElIcon), null, {
5985
+ default: withCtx(() => [
5986
+ createVNode(unref(DArrowRight))
5987
+ ]),
5988
+ _: 1
5989
+ })
5990
+ ])
5991
+ ], 10, _hoisted_3)) : createCommentVNode("v-if", true),
5992
+ createElementVNode(
5993
+ "div",
5994
+ null,
5995
+ toDisplayString(unref(leftLabel)),
5996
+ 1
5997
+ )
5998
+ ],
5999
+ 2
6000
+ ),
6001
+ createVNode(YearTable, {
6002
+ "selection-mode": "range",
6003
+ date: leftDate.value,
6004
+ "min-date": unref(minDate),
6005
+ "max-date": unref(maxDate),
6006
+ "range-state": unref(rangeState),
6007
+ "disabled-date": unref(disabledDate),
6008
+ disabled: unref(yearRangeDisabled),
6009
+ "cell-class-name": unref(cellClassName),
6010
+ onChangerange: unref(handleChangeRange),
6011
+ onPick: handleRangePick,
6012
+ onSelect: unref(onSelect)
6013
+ }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
6014
+ ],
6015
+ 2
6016
+ ),
6017
+ createElementVNode(
6018
+ "div",
6019
+ {
6020
+ class: normalizeClass(rightPanelKls.value.content)
6021
+ },
6022
+ [
6023
+ createElementVNode(
6024
+ "div",
6025
+ {
6026
+ class: normalizeClass(unref(drpNs).e("header"))
6027
+ },
6028
+ [
6029
+ _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
6030
+ key: 0,
6031
+ type: "button",
6032
+ disabled: !enableYearArrow.value || unref(yearRangeDisabled),
6033
+ class: normalizeClass(rightPanelKls.value.arrowLeftBtn),
6034
+ onClick: _cache[2] || (_cache[2] = (...args) => unref(rightPrevYear) && unref(rightPrevYear)(...args))
6035
+ }, [
6036
+ renderSlot(_ctx.$slots, "prev-year", {}, () => [
6037
+ createVNode(unref(ElIcon), null, {
6038
+ default: withCtx(() => [
6039
+ createVNode(unref(DArrowLeft))
6040
+ ]),
6041
+ _: 1
6042
+ })
6043
+ ])
6044
+ ], 10, _hoisted_4)) : createCommentVNode("v-if", true),
6045
+ createElementVNode("button", {
6046
+ type: "button",
6047
+ class: normalizeClass(rightPanelKls.value.arrowRightBtn),
6048
+ disabled: unref(yearRangeDisabled),
6049
+ onClick: _cache[3] || (_cache[3] = (...args) => unref(rightNextYear) && unref(rightNextYear)(...args))
6050
+ }, [
6051
+ renderSlot(_ctx.$slots, "next-year", {}, () => [
6052
+ createVNode(unref(ElIcon), null, {
6053
+ default: withCtx(() => [
6054
+ createVNode(unref(DArrowRight))
6055
+ ]),
6056
+ _: 1
6057
+ })
6058
+ ])
6059
+ ], 10, _hoisted_5),
6060
+ createElementVNode(
6061
+ "div",
6062
+ null,
6063
+ toDisplayString(unref(rightLabel)),
6064
+ 1
6065
+ )
6066
+ ],
6067
+ 2
6068
+ ),
6069
+ createVNode(YearTable, {
6070
+ "selection-mode": "range",
6071
+ date: rightDate.value,
6072
+ "min-date": unref(minDate),
6073
+ "max-date": unref(maxDate),
6074
+ "range-state": unref(rangeState),
6075
+ "disabled-date": unref(disabledDate),
6076
+ disabled: unref(yearRangeDisabled),
6077
+ "cell-class-name": unref(cellClassName),
6078
+ onChangerange: unref(handleChangeRange),
6079
+ onPick: handleRangePick,
6080
+ onSelect: unref(onSelect)
6081
+ }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "disabled", "cell-class-name", "onChangerange", "onSelect"])
6082
+ ],
6083
+ 2
6084
+ )
6085
+ ],
6086
+ 2
6087
+ )
6088
+ ],
6089
+ 2
6090
+ )
6091
+ ],
6092
+ 2
6093
+ );
5354
6094
  };
5355
6095
  }
5356
6096
  });
5357
- var YearRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "panel-year-range.vue"]]);
6097
+ var YearRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/date-picker-panel/src/date-picker-com/panel-year-range.vue"]]);
5358
6098
 
5359
6099
  const getPanel = function(type) {
5360
6100
  switch (type) {
@@ -5388,11 +6128,13 @@ dayjs.extend(isSameOrBefore);
5388
6128
  var DatePickerPanel = defineComponent({
5389
6129
  name: "ElDatePickerPanel",
5390
6130
  install: null,
6131
+ inheritAttrs: false,
5391
6132
  props: datePickerPanelProps,
5392
- emits: [UPDATE_MODEL_EVENT, "calendar-change", "panel-change", "visible-change", "pick"],
6133
+ emits: [UPDATE_MODEL_EVENT, "calendar-change", "panel-change", "visible-change", "clear"],
5393
6134
  setup(props, {
5394
6135
  slots,
5395
- emit
6136
+ emit,
6137
+ attrs
5396
6138
  }) {
5397
6139
  const ns = useNamespace("picker-panel");
5398
6140
  const pickerInjection = inject(PICKER_BASE_INJECTION_KEY, void 0);
@@ -5417,11 +6159,12 @@ var DatePickerPanel = defineComponent({
5417
6159
  } = inject(ROOT_COMMON_PICKER_INJECTION_KEY, () => useCommonPicker(props, emit), true);
5418
6160
  return () => {
5419
6161
  const Component = getPanel(props.type);
5420
- return createVNode(Component, mergeProps(props, {
6162
+ return createVNode(Component, mergeProps(omit(attrs, "onPick"), props, {
5421
6163
  "parsedValue": parsedValue.value,
5422
6164
  "onSet-picker-option": onSetPickerOption,
5423
6165
  "onCalendar-change": onCalendarChange,
5424
6166
  "onPanel-change": onPanelChange,
6167
+ "onClear": () => emit("clear"),
5425
6168
  "onPick": onPick
5426
6169
  }), _isSlot$1(slots) ? slots : {
5427
6170
  default: () => [slots]
@@ -5491,6 +6234,8 @@ var DatePicker = defineComponent({
5491
6234
  "onUpdate:modelValue": onModelValueUpdated
5492
6235
  }), {
5493
6236
  default: (scopedProps) => createVNode(ElDatePickerPanel, mergeProps({
6237
+ "disabled": props.disabled,
6238
+ "editable": props.editable,
5494
6239
  "border": false
5495
6240
  }, scopedProps), _isSlot(slots) ? slots : {
5496
6241
  default: () => [slots]