x-next 1.18.0 → 1.18.2

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 (170) hide show
  1. package/AI_USAGE/catalog.md +1 -1
  2. package/AI_USAGE/components/alert-api.md +1 -1
  3. package/AI_USAGE/components/alert.md +1 -1
  4. package/AI_USAGE/components/bar-chart-api.md +1 -1
  5. package/AI_USAGE/components/bar-chart.md +1 -1
  6. package/AI_USAGE/components/boxicons.md +1 -1
  7. package/AI_USAGE/components/button-api.md +1 -1
  8. package/AI_USAGE/components/button.md +4 -4
  9. package/AI_USAGE/components/charts.md +1 -1
  10. package/AI_USAGE/components/checkbox-api.md +1 -1
  11. package/AI_USAGE/components/checkbox.md +1 -1
  12. package/AI_USAGE/components/color-picker-api.md +1 -1
  13. package/AI_USAGE/components/color-picker.md +1 -1
  14. package/AI_USAGE/components/config-provider-api.md +1 -1
  15. package/AI_USAGE/components/config-provider.md +1 -1
  16. package/AI_USAGE/components/date-picker-api.md +44 -26
  17. package/AI_USAGE/components/date-picker.md +78 -3
  18. package/AI_USAGE/components/dialog-api.md +2 -2
  19. package/AI_USAGE/components/dialog.md +5 -1
  20. package/AI_USAGE/components/draggable-api.md +1 -1
  21. package/AI_USAGE/components/draggable.md +1 -1
  22. package/AI_USAGE/components/drawer-api.md +1 -1
  23. package/AI_USAGE/components/drawer.md +1 -1
  24. package/AI_USAGE/components/dropdown-api.md +6 -1
  25. package/AI_USAGE/components/dropdown.md +2 -2
  26. package/AI_USAGE/components/empty-api.md +1 -1
  27. package/AI_USAGE/components/empty.md +1 -1
  28. package/AI_USAGE/components/finicon.md +1 -1
  29. package/AI_USAGE/components/form-api.md +1 -1
  30. package/AI_USAGE/components/form.md +1 -1
  31. package/AI_USAGE/components/grid-api.md +1 -1
  32. package/AI_USAGE/components/grid.md +1 -1
  33. package/AI_USAGE/components/heatmap-api.md +1 -1
  34. package/AI_USAGE/components/heatmap.md +1 -1
  35. package/AI_USAGE/components/icon-api.md +1 -1
  36. package/AI_USAGE/components/icon.md +1 -1
  37. package/AI_USAGE/components/image-api.md +1 -1
  38. package/AI_USAGE/components/image.md +1 -1
  39. package/AI_USAGE/components/input-api.md +1 -1
  40. package/AI_USAGE/components/input-number-api.md +1 -1
  41. package/AI_USAGE/components/input-number.md +1 -1
  42. package/AI_USAGE/components/input-tag-api.md +1 -1
  43. package/AI_USAGE/components/input-tag.md +1 -1
  44. package/AI_USAGE/components/input.md +1 -1
  45. package/AI_USAGE/components/layout-api.md +1 -1
  46. package/AI_USAGE/components/layout.md +1 -1
  47. package/AI_USAGE/components/line-chart-api.md +1 -1
  48. package/AI_USAGE/components/line-chart.md +1 -1
  49. package/AI_USAGE/components/link-api.md +1 -1
  50. package/AI_USAGE/components/link.md +1 -1
  51. package/AI_USAGE/components/menu-api.md +1 -1
  52. package/AI_USAGE/components/menu.md +1 -1
  53. package/AI_USAGE/components/message-api.md +1 -1
  54. package/AI_USAGE/components/message-box-api.md +1 -1
  55. package/AI_USAGE/components/message-box.md +1 -1
  56. package/AI_USAGE/components/message.md +1 -1
  57. package/AI_USAGE/components/network-api.md +1 -1
  58. package/AI_USAGE/components/network.md +1 -1
  59. package/AI_USAGE/components/notification-api.md +1 -1
  60. package/AI_USAGE/components/notification.md +1 -1
  61. package/AI_USAGE/components/pagination-api.md +1 -1
  62. package/AI_USAGE/components/pagination.md +1 -1
  63. package/AI_USAGE/components/pie-chart-api.md +1 -1
  64. package/AI_USAGE/components/pie-chart.md +1 -1
  65. package/AI_USAGE/components/popconfirm-api.md +1 -1
  66. package/AI_USAGE/components/popconfirm.md +1 -1
  67. package/AI_USAGE/components/popover-api.md +1 -1
  68. package/AI_USAGE/components/popover.md +3 -1
  69. package/AI_USAGE/components/popup-api.md +1 -1
  70. package/AI_USAGE/components/popup.md +1 -1
  71. package/AI_USAGE/components/progress-api.md +1 -1
  72. package/AI_USAGE/components/progress.md +1 -1
  73. package/AI_USAGE/components/radio-api.md +1 -1
  74. package/AI_USAGE/components/radio.md +1 -1
  75. package/AI_USAGE/components/rate-api.md +1 -1
  76. package/AI_USAGE/components/rate.md +1 -1
  77. package/AI_USAGE/components/resize-box-api.md +1 -1
  78. package/AI_USAGE/components/resize-box.md +1 -1
  79. package/AI_USAGE/components/scrollbar-api.md +1 -1
  80. package/AI_USAGE/components/scrollbar.md +1 -1
  81. package/AI_USAGE/components/select-api.md +1 -1
  82. package/AI_USAGE/components/select.md +1 -1
  83. package/AI_USAGE/components/skeleton-api.md +1 -1
  84. package/AI_USAGE/components/skeleton.md +1 -1
  85. package/AI_USAGE/components/slider-api.md +1 -1
  86. package/AI_USAGE/components/slider.md +1 -1
  87. package/AI_USAGE/components/space-api.md +1 -1
  88. package/AI_USAGE/components/space.md +1 -1
  89. package/AI_USAGE/components/spin-api.md +1 -1
  90. package/AI_USAGE/components/spin.md +1 -1
  91. package/AI_USAGE/components/steps-api.md +1 -1
  92. package/AI_USAGE/components/steps.md +1 -1
  93. package/AI_USAGE/components/switch-api.md +1 -1
  94. package/AI_USAGE/components/switch.md +1 -1
  95. package/AI_USAGE/components/table-api.md +1 -1
  96. package/AI_USAGE/components/table.md +1 -1
  97. package/AI_USAGE/components/tabs-api.md +1 -1
  98. package/AI_USAGE/components/tabs.md +1 -1
  99. package/AI_USAGE/components/tag-api.md +1 -1
  100. package/AI_USAGE/components/tag.md +1 -1
  101. package/AI_USAGE/components/textarea-api.md +1 -1
  102. package/AI_USAGE/components/textarea.md +1 -1
  103. package/AI_USAGE/components/time-picker-api.md +1 -1
  104. package/AI_USAGE/components/time-picker.md +1 -1
  105. package/AI_USAGE/components/time-range-selector-api.md +1 -1
  106. package/AI_USAGE/components/time-range-selector.md +1 -1
  107. package/AI_USAGE/components/timeline-api.md +1 -1
  108. package/AI_USAGE/components/timeline.md +1 -1
  109. package/AI_USAGE/components/tooltip-api.md +1 -1
  110. package/AI_USAGE/components/tooltip.md +1 -1
  111. package/AI_USAGE/components/transfer-api.md +1 -1
  112. package/AI_USAGE/components/transfer.md +1 -1
  113. package/AI_USAGE/components/tree-select-api.md +1 -1
  114. package/AI_USAGE/components/tree-select.md +1 -1
  115. package/AI_USAGE/components/trend-chart-api.md +1 -1
  116. package/AI_USAGE/components/trend-chart.md +1 -1
  117. package/AI_USAGE/components/trigger-api.md +1 -1
  118. package/AI_USAGE/components/trigger.md +1 -1
  119. package/AI_USAGE/components/upload-api.md +1 -1
  120. package/AI_USAGE/components/upload.md +1 -1
  121. package/AI_USAGE/components/watermark-api.md +1 -1
  122. package/AI_USAGE/components/watermark.md +1 -1
  123. package/AI_USAGE/core.md +1 -1
  124. package/AI_USAGE/index.md +1 -1
  125. package/AI_USAGE/recipes/form-on-demand.md +1 -1
  126. package/AI_USAGE.md +138 -34
  127. package/CHANGELOG.md +28 -0
  128. package/README.md +108 -212
  129. package/dist/_container/render-function.d.ts +2 -2
  130. package/dist/components/_components/picker/input-range.vue.d.ts +1 -1
  131. package/dist/components/date-picker/DatePanel.vue.d.ts +10 -1
  132. package/dist/components/date-picker/DatePicker.vue.d.ts +22 -10
  133. package/dist/components/date-picker/index.d.ts +156 -54
  134. package/dist/components/date-picker/utils.d.ts +4 -4
  135. package/dist/components/dropdown/Dropdown.vue.d.ts +1 -0
  136. package/dist/components/dropdown/DropdownButton.vue.d.ts +1 -0
  137. package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +1 -0
  138. package/dist/components/dropdown/context.d.ts +1 -0
  139. package/dist/components/dropdown/index.d.ts +8 -0
  140. package/dist/components/dropdown/use-keyboard.d.ts +1 -0
  141. package/dist/components/menu/MenuItem.d.ts +2 -2
  142. package/dist/components/menu/context.d.ts +3 -3
  143. package/dist/components/menu/index.d.ts +6 -6
  144. package/dist/components/menu/sub-menu-pop.vue.d.ts +2 -2
  145. package/dist/components/time-picker/TimePicker.vue.d.ts +1 -1
  146. package/dist/components/time-picker/index.d.ts +2 -2
  147. package/dist/es/components/_components/picker/input-range.vue.js +12 -12
  148. package/dist/es/components/_components/picker/input-range.vue2.js +45 -45
  149. package/dist/es/components/_components/picker/input.vue2.js +24 -24
  150. package/dist/es/components/date-picker/DatePanel.vue.js +47 -47
  151. package/dist/es/components/date-picker/DatePanel.vue2.js +68 -59
  152. package/dist/es/components/date-picker/DatePicker.vue.js +65 -59
  153. package/dist/es/components/date-picker/DatePicker.vue2.js +387 -284
  154. package/dist/es/components/date-picker/index.js +57 -36
  155. package/dist/es/components/date-picker/utils.js +132 -122
  156. package/dist/es/components/dialog/Dialog.js +43 -40
  157. package/dist/es/components/dialog/props.js +1 -1
  158. package/dist/es/components/dropdown/Dropdown.vue2.js +66 -50
  159. package/dist/es/components/dropdown/dropdown-panel.vue2.js +48 -43
  160. package/dist/es/components/dropdown/use-keyboard.js +36 -28
  161. package/dist/es/components/popover/Popover.js +72 -32
  162. package/dist/es/style.css +1 -1
  163. package/dist/index.cjs +3 -3
  164. package/dist/index.umd.js +3 -3
  165. package/dist/style/button.css +1 -1
  166. package/dist/style/date-picker.css +1 -1
  167. package/dist/style/dialog.css +1 -1
  168. package/dist/style/message-box.css +1 -1
  169. package/dist/style.css +1 -1
  170. package/package.json +2 -1
@@ -1,9 +1,9 @@
1
- import C from "./DatePanel.vue2.js";
2
- import { resolveComponent as u, openBlock as s, createElementBlock as n, withKeys as h, normalizeClass as o, createElementVNode as d, createVNode as b, createCommentVNode as r, toDisplayString as i, Fragment as k, renderList as p, renderSlot as v, createTextVNode as P } from "vue";
1
+ import $ from "./DatePanel.vue2.js";
2
+ import { resolveComponent as u, openBlock as s, createElementBlock as n, withKeys as C, normalizeClass as o, createElementVNode as m, createVNode as b, createCommentVNode as i, toDisplayString as r, Fragment as k, renderList as N, renderSlot as v, createTextVNode as P } from "vue";
3
3
  import L from "../../_virtual/_plugin-vue_export-helper.js";
4
- const I = ["aria-label"], R = ["aria-label"], S = ["aria-label"], E = ["aria-label"], D = { key: 0 }, M = ["title", "aria-label", "role", "tabindex", "disabled", "aria-selected", "onMouseenter", "onFocus", "onKeydown", "onClick"], T = ["onClick"];
5
- function V(e, t, K, B, W, z) {
6
- const w = u("IconDoubleLeft"), g = u("IconLeft"), $ = u("IconRight"), f = u("IconDoubleRight");
4
+ const I = ["aria-label"], R = ["aria-label"], D = ["aria-label"], S = ["aria-label"], E = { key: 0 }, M = ["title", "aria-label", "role", "tabindex", "disabled", "aria-selected", "onMouseenter", "onFocus", "onKeydown", "onClick"], T = ["onClick"], V = ["disabled"], K = ["disabled"];
5
+ function B(e, t, W, F, z, j) {
6
+ const w = u("IconDoubleLeft"), g = u("IconLeft"), h = u("IconRight"), f = u("IconDoubleRight");
7
7
  return s(), n("div", {
8
8
  ref: "panelRef",
9
9
  class: o([
@@ -11,9 +11,9 @@ function V(e, t, K, B, W, z) {
11
11
  e.className.modifier(`mode-${e.mode}`),
12
12
  { [e.className.is("show-lunar")]: e.showLunar && e.mode === "date" }
13
13
  ]),
14
- onKeydown: t[8] || (t[8] = h((l) => e.$emit("cancel"), ["esc"]))
14
+ onKeydown: t[7] || (t[7] = C((l) => e.$emit("cancel"), ["esc"]))
15
15
  }, [
16
- d("div", {
16
+ m("div", {
17
17
  class: o([e.className.element("header"), e.className.element(`header-${e.panelPosition}`)])
18
18
  }, [
19
19
  e.panelPosition !== "right" ? (s(), n("button", {
@@ -24,7 +24,7 @@ function V(e, t, K, B, W, z) {
24
24
  onClick: t[0] || (t[0] = (l) => e.movePanel(-1, !0))
25
25
  }, [
26
26
  b(w)
27
- ], 10, I)) : r("", !0),
27
+ ], 10, I)) : i("", !0),
28
28
  e.panelPosition !== "right" ? (s(), n("button", {
29
29
  key: 1,
30
30
  type: "button",
@@ -33,48 +33,46 @@ function V(e, t, K, B, W, z) {
33
33
  onClick: t[1] || (t[1] = (l) => e.movePanel(-1))
34
34
  }, [
35
35
  b(g)
36
- ], 10, R)) : r("", !0),
37
- d("button", {
38
- type: "button",
39
- class: o(e.className.element("header-label")),
40
- onClick: t[2] || (t[2] = (...l) => e.zoomHeader && e.zoomHeader(...l))
41
- }, i(e.headerLabel), 3),
36
+ ], 10, R)) : i("", !0),
37
+ m("div", {
38
+ class: o(e.className.element("header-label"))
39
+ }, r(e.headerLabel), 3),
42
40
  e.panelPosition !== "left" ? (s(), n("button", {
43
41
  key: 2,
44
42
  type: "button",
45
43
  class: o(e.className.element("header-btn")),
46
44
  "aria-label": e.t("datePicker.nextItem"),
47
- onClick: t[3] || (t[3] = (l) => e.movePanel(1))
45
+ onClick: t[2] || (t[2] = (l) => e.movePanel(1))
48
46
  }, [
49
- b($)
50
- ], 10, S)) : r("", !0),
47
+ b(h)
48
+ ], 10, D)) : i("", !0),
51
49
  e.panelPosition !== "left" ? (s(), n("button", {
52
50
  key: 3,
53
51
  type: "button",
54
52
  class: o(e.className.element("header-btn")),
55
53
  "aria-label": e.t("datePicker.nextPage"),
56
- onClick: t[4] || (t[4] = (l) => e.movePanel(1, !0))
54
+ onClick: t[3] || (t[3] = (l) => e.movePanel(1, !0))
57
55
  }, [
58
56
  b(f)
59
- ], 10, E)) : r("", !0)
57
+ ], 10, S)) : i("", !0)
60
58
  ], 2),
61
59
  e.mode === "date" || e.mode === "week" ? (s(), n("div", {
62
60
  key: 0,
63
61
  class: o([e.className.element("weekdays"), { [e.className.is("week-mode")]: e.mode === "week" }])
64
62
  }, [
65
- e.mode === "week" ? (s(), n("span", D, i(e.t("datePicker.weekColumn")), 1)) : r("", !0),
66
- (s(!0), n(k, null, p(e.weekdayLabels, (l) => (s(), n("span", { key: l }, i(l), 1))), 128))
67
- ], 2)) : r("", !0),
68
- d("div", {
63
+ e.mode === "week" ? (s(), n("span", E, r(e.t("datePicker.weekColumn")), 1)) : i("", !0),
64
+ (s(!0), n(k, null, N(e.weekdayLabels, (l) => (s(), n("span", { key: l }, r(l), 1))), 128))
65
+ ], 2)) : i("", !0),
66
+ m("div", {
69
67
  class: o([e.className.element("body"), e.className.element(`body-${e.mode}`)]),
70
68
  role: "grid"
71
69
  }, [
72
- (s(!0), n(k, null, p(e.cellRows, (l, N) => (s(), n("div", {
73
- key: N,
70
+ (s(!0), n(k, null, N(e.cellRows, (l, p) => (s(), n("div", {
71
+ key: p,
74
72
  role: "row",
75
73
  class: o(e.className.element("row"))
76
74
  }, [
77
- (s(!0), n(k, null, p(l, (a) => {
75
+ (s(!0), n(k, null, N(l, (a) => {
78
76
  var y;
79
77
  return s(), n("button", {
80
78
  key: a.title,
@@ -85,12 +83,12 @@ function V(e, t, K, B, W, z) {
85
83
  tabindex: a.title === ((y = e.activeCell) == null ? void 0 : y.title) ? 0 : -1,
86
84
  disabled: a.isWeekLabel || a.disabled || !a.inView,
87
85
  "aria-selected": !a.isWeekLabel && (a.selected || a.rangeStart || a.rangeEnd),
88
- onMouseenter: (m) => e.handleCellMouseEnter(a),
89
- onMouseleave: t[5] || (t[5] = (...m) => e.handleCellMouseLeave && e.handleCellMouseLeave(...m)),
90
- onFocus: (m) => {
86
+ onMouseenter: (d) => e.handleCellMouseEnter(a),
87
+ onMouseleave: t[4] || (t[4] = (...d) => e.handleCellMouseLeave && e.handleCellMouseLeave(...d)),
88
+ onFocus: (d) => {
91
89
  e.activeTitle = a.title, e.handleCellMouseEnter(a);
92
90
  },
93
- onKeydown: (m) => e.handleCellKeydown(m, a),
91
+ onKeydown: (d) => e.handleCellKeydown(d, a),
94
92
  class: o([
95
93
  e.className.element("cell"),
96
94
  {
@@ -110,26 +108,26 @@ function V(e, t, K, B, W, z) {
110
108
  [e.className.is("week-selected")]: a.weekSelected
111
109
  }
112
110
  ]),
113
- onClick: (m) => e.handleSelect(a)
111
+ onClick: (d) => e.handleSelect(a)
114
112
  }, [
115
- d("span", {
113
+ m("span", {
116
114
  class: o(e.className.element("cell-date"))
117
115
  }, [
118
- d("span", {
116
+ m("span", {
119
117
  class: o(e.className.element("cell-inner"))
120
118
  }, [
121
119
  v(e.$slots, "cell", {
122
120
  date: a.value.toDate(),
123
121
  label: a.label
124
122
  }, () => [
125
- P(i(a.label), 1)
123
+ P(r(a.label), 1)
126
124
  ])
127
125
  ], 2)
128
126
  ], 2),
129
127
  a.lunar && !e.$slots.cell ? (s(), n("span", {
130
128
  key: 0,
131
129
  class: o(e.className.element("cell-lunar"))
132
- }, i(a.lunar.displayText), 3)) : r("", !0)
130
+ }, r(a.lunar.displayText), 3)) : i("", !0)
133
131
  ], 42, M);
134
132
  }), 128))
135
133
  ], 2))), 128))
@@ -138,19 +136,19 @@ function V(e, t, K, B, W, z) {
138
136
  key: 1,
139
137
  class: o(e.className.element("shortcuts"))
140
138
  }, [
141
- (s(!0), n(k, null, p(e.shortcuts, (l) => (s(), n("button", {
139
+ (s(!0), n(k, null, N(e.shortcuts, (l) => (s(), n("button", {
142
140
  key: String(l.label),
143
141
  type: "button",
144
142
  class: o(e.className.element("shortcut")),
145
- onClick: (N) => e.$emit("shortcut", l)
146
- }, i(l.label), 11, T))), 128)),
143
+ onClick: (p) => e.$emit("shortcut", l)
144
+ }, r(l.label), 11, T))), 128)),
147
145
  e.$slots.extra ? (s(), n("div", {
148
146
  key: 0,
149
147
  class: o(e.className.element("extra"))
150
148
  }, [
151
149
  v(e.$slots, "extra")
152
- ], 2)) : r("", !0)
153
- ], 2)) : r("", !0),
150
+ ], 2)) : i("", !0)
151
+ ], 2)) : i("", !0),
154
152
  e.showToday || e.showConfirmBtn ? (s(), n("div", {
155
153
  key: 2,
156
154
  class: o(e.className.element("footer"))
@@ -159,18 +157,20 @@ function V(e, t, K, B, W, z) {
159
157
  key: 0,
160
158
  type: "button",
161
159
  class: o([e.className.element("footer-btn"), e.className.element("today")]),
162
- onClick: t[6] || (t[6] = (...l) => e.selectToday && e.selectToday(...l))
163
- }, i(e.todayLabel), 3)) : r("", !0),
160
+ disabled: e.todayDisabled,
161
+ onClick: t[5] || (t[5] = (...l) => e.selectToday && e.selectToday(...l))
162
+ }, r(e.todayLabel), 11, V)) : i("", !0),
164
163
  e.showConfirmBtn ? (s(), n("button", {
165
164
  key: 1,
166
165
  type: "button",
167
166
  class: o([e.className.element("footer-btn"), e.className.element("confirm")]),
168
- onClick: t[7] || (t[7] = (l) => e.$emit("confirm"))
169
- }, i(e.t("datePicker.ok")), 3)) : r("", !0)
170
- ], 2)) : r("", !0)
167
+ disabled: e.confirmDisabled,
168
+ onClick: t[6] || (t[6] = (l) => e.$emit("confirm"))
169
+ }, r(e.t("datePicker.ok")), 11, K)) : i("", !0)
170
+ ], 2)) : i("", !0)
171
171
  ], 34);
172
172
  }
173
- const q = /* @__PURE__ */ L(C, [["render", V]]);
173
+ const H = /* @__PURE__ */ L($, [["render", B]]);
174
174
  export {
175
- q as default
175
+ H as default
176
176
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as K, ref as L, watch as R, computed as i, nextTick as F } from "vue";
1
+ import { defineComponent as K, ref as L, watch as I, computed as i, nextTick as F } from "vue";
2
2
  import { getClassNameMixin as Q } from "../../_utils/config.js";
3
3
  import { useLocale as Y } from "../../locale/index.js";
4
- import { getWeekdayLabels as G, getHeaderLabel as J, createDateCells as X, moveViewDate as B, normalizePanelValue as g } from "./utils.js";
5
- import { dayjs as I } from "../../_utils/date.js";
4
+ import { getWeekdayLabels as G, getHeaderLabel as J, normalizePanelValue as v, createDateCells as X, moveViewDate as M } from "./utils.js";
5
+ import { dayjs as P } from "../../_utils/date.js";
6
6
  import Z from "../../icons/default/left.js";
7
7
  import $ from "../../icons/default/right.js";
8
8
  import p from "../../icons/default/double-left.js";
9
9
  import ee from "../../icons/default/double-right.js";
10
- const se = K({
10
+ const me = K({
11
11
  name: "DatePanel",
12
12
  components: {
13
13
  IconLeft: Z,
@@ -68,6 +68,10 @@ const se = K({
68
68
  showConfirmBtn: {
69
69
  type: Boolean,
70
70
  default: !0
71
+ },
72
+ confirmDisabled: {
73
+ type: Boolean,
74
+ default: !1
71
75
  }
72
76
  },
73
77
  emits: {
@@ -79,27 +83,33 @@ const se = K({
79
83
  confirm: () => !0,
80
84
  cancel: () => !0
81
85
  },
82
- setup(e, { emit: s }) {
83
- const M = Q("date-picker"), { t: d, locale: P } = Y(), u = L(e.viewDate || e.value || e.rangeValue[0] || I()), W = L(), v = L("");
84
- R(
86
+ setup(e, { emit: m }) {
87
+ const x = Q("date-picker"), { t: u, locale: W } = Y(), d = L(e.viewDate || e.value || e.rangeValue[0] || P()), S = L(), y = L("");
88
+ I(
85
89
  () => e.viewDate,
86
90
  (t) => {
87
- t && (u.value = t);
91
+ t && (d.value = t);
88
92
  }
89
- ), R(
93
+ ), I(
90
94
  () => [e.value, e.rangeValue[0], e.rangeValue[1], e.mode],
91
95
  () => {
92
96
  if (e.viewDate) return;
93
97
  const t = e.value || e.rangeValue[0] || e.rangeValue[1];
94
- t && (u.value = t);
98
+ t && (d.value = t);
95
99
  }
96
100
  );
97
- const x = i(
98
- () => G(e.dayStartOfWeek, P.value.datePicker)
99
- ), H = i(() => J(u.value, e.mode)), _ = i(() => e.mode === "month" ? d("datePicker.thisMonth") : e.mode === "year" ? d("datePicker.thisYear") : e.mode === "quarter" ? d("datePicker.thisQuarter") : e.mode === "week" ? d("datePicker.thisWeek") : d("datePicker.today")), r = i(
101
+ const _ = i(
102
+ () => G(e.dayStartOfWeek, W.value.datePicker)
103
+ ), H = i(() => J(d.value, e.mode)), N = i(() => e.mode === "month" ? u("datePicker.thisMonth") : e.mode === "year" ? u("datePicker.thisYear") : e.mode === "quarter" ? u("datePicker.thisQuarter") : e.mode === "week" ? u("datePicker.thisWeek") : u("datePicker.today")), A = i(() => {
104
+ var t;
105
+ return !!((t = e.disabledDate) != null && t.call(
106
+ e,
107
+ v(P(), e.mode, e.dayStartOfWeek).toDate()
108
+ ));
109
+ }), r = i(
100
110
  () => X({
101
111
  mode: e.mode,
102
- viewDate: u.value,
112
+ viewDate: d.value,
103
113
  selectedValue: e.value,
104
114
  rangeValue: e.rangeValue,
105
115
  previewRangeValue: e.previewRangeValue,
@@ -107,31 +117,31 @@ const se = K({
107
117
  hideNotInViewDates: e.hideNotInViewDates,
108
118
  disabledDate: e.disabledDate,
109
119
  showLunar: e.showLunar,
110
- locale: P.value.datePicker
120
+ locale: W.value.datePicker
111
121
  })
112
122
  ), c = i(
113
123
  () => e.mode === "date" || e.mode === "week" ? 7 : e.mode === "quarter" ? 2 : 3
114
- ), N = i(() => {
124
+ ), T = i(() => {
115
125
  const t = e.mode === "week" ? 8 : c.value;
116
126
  return Array.from(
117
127
  { length: Math.ceil(r.value.length / t) },
118
128
  (a, l) => r.value.slice(l * t, (l + 1) * t)
119
129
  );
120
- }), k = (t) => !t.isWeekLabel && !t.disabled && t.inView, T = i(() => {
121
- const t = r.value.filter(k);
122
- return t.find((a) => a.title === v.value) ?? t.find((a) => a.selected || a.rangeStart || a.rangeEnd) ?? t.find((a) => a.today && !a.outView) ?? t.find((a) => !a.outView) ?? t[0];
123
- }), U = () => {
130
+ }), g = (t) => !t.isWeekLabel && !t.disabled && t.inView, U = i(() => {
131
+ const t = r.value.filter(g);
132
+ return t.find((a) => a.title === y.value) ?? t.find((a) => a.selected || a.rangeStart || a.rangeEnd) ?? t.find((a) => a.today && !a.outView) ?? t.find((a) => !a.outView) ?? t[0];
133
+ }), j = () => {
124
134
  F(() => {
125
135
  var t, a;
126
- (a = (t = W.value) == null ? void 0 : t.querySelector('[role="gridcell"][tabindex="0"]')) == null || a.focus();
136
+ (a = (t = S.value) == null ? void 0 : t.querySelector('[role="gridcell"][tabindex="0"]')) == null || a.focus();
127
137
  });
128
- }, y = (t) => {
129
- u.value = t, s("view-date-change", t);
130
- }, j = (t, a = !1) => {
131
- y(B(u.value, e.mode, t, a)), v.value = "";
132
- }, q = (t, a) => {
133
- var C;
134
- if (!k(a)) return;
138
+ }, k = (t) => {
139
+ d.value = t, m("view-date-change", t);
140
+ }, q = (t, a = !1) => {
141
+ k(M(d.value, e.mode, t, a)), y.value = "";
142
+ }, E = (t, a) => {
143
+ var B;
144
+ if (!g(a)) return;
135
145
  const l = t.key;
136
146
  if (![
137
147
  "ArrowLeft",
@@ -145,55 +155,54 @@ const se = K({
145
155
  ].includes(l))
146
156
  return;
147
157
  t.preventDefault();
148
- const m = e.mode === "date" || e.mode === "week" ? "day" : e.mode === "year" ? "year" : "month", S = e.mode === "quarter" ? 3 : 1;
158
+ const s = e.mode === "date" || e.mode === "week" ? "day" : e.mode === "year" ? "year" : "month", C = e.mode === "quarter" ? 3 : 1;
149
159
  let f = l === "ArrowLeft" ? -1 : l === "ArrowRight" ? 1 : l === "ArrowUp" ? -c.value : c.value, n = a.value, w;
150
160
  if (l === "Home" || l === "End") {
151
- const o = r.value.filter((D) => !D.isWeekLabel), b = o.findIndex((D) => D.title === a.title), V = Math.floor(b / c.value) * c.value, O = Math.min(V + c.value - 1, o.length - 1);
152
- n = o[l === "Home" ? V : O].value, w = o[l === "Home" ? O : V].value, f = l === "Home" ? 1 : -1;
153
- } else l === "PageUp" || l === "PageDown" ? (f = l === "PageUp" ? -1 : 1, n = B(a.value, e.mode, f, t.shiftKey)) : n = n.add(f * S, m);
161
+ const o = r.value.filter((V) => !V.isWeekLabel), b = o.findIndex((V) => V.title === a.title), D = Math.floor(b / c.value) * c.value, R = Math.min(D + c.value - 1, o.length - 1);
162
+ n = o[l === "Home" ? D : R].value, w = o[l === "Home" ? R : D].value, f = l === "Home" ? 1 : -1;
163
+ } else l === "PageUp" || l === "PageDown" ? (f = l === "PageUp" ? -1 : 1, n = M(a.value, e.mode, f, t.shiftKey)) : n = n.add(f * C, s);
154
164
  for (let o = 0; o < 366; o++) {
155
- const b = g(n, e.mode);
156
- if (!((C = e.disabledDate) != null && C.call(e, b.toDate()))) break;
157
- if (n = n.add(f * S, m), w && (f > 0 ? n.isAfter(w, m) : n.isBefore(w, m)) || o === 365) return;
165
+ const b = v(n, e.mode, e.dayStartOfWeek);
166
+ if (!((B = e.disabledDate) != null && B.call(e, b.toDate()))) break;
167
+ if (n = n.add(f * C, s), w && (f > 0 ? n.isAfter(w, s) : n.isBefore(w, s)) || o === 365) return;
158
168
  }
159
- y(n);
169
+ k(n);
160
170
  const h = r.value.find(
161
- (o) => !o.isWeekLabel && o.value.isSame(n, m)
171
+ (o) => !o.isWeekLabel && o.value.isSame(n, s)
162
172
  );
163
- h && k(h) && (v.value = h.title, A(h), U());
164
- }, E = () => {
165
- e.mode === "date" && y(u.value.startOf("year"));
173
+ h && g(h) && (y.value = h.title, O(h), j());
166
174
  }, z = (t) => {
167
- t.isWeekLabel || t.disabled || !t.inView || s("select", g(t.value, e.mode, e.dayStartOfWeek));
168
- }, A = (t) => {
169
- t.isWeekLabel || t.disabled || !t.inView || s("cell-mouse-enter", g(t.value, e.mode, e.dayStartOfWeek));
175
+ t.isWeekLabel || t.disabled || !t.inView || m("select", v(t.value, e.mode, e.dayStartOfWeek));
176
+ }, O = (t) => {
177
+ t.isWeekLabel || t.disabled || !t.inView || m("cell-mouse-enter", v(t.value, e.mode, e.dayStartOfWeek));
170
178
  };
171
179
  return {
172
- t: d,
173
- className: M,
180
+ t: u,
181
+ className: x,
174
182
  cells: r,
175
- cellRows: N,
176
- panelRef: W,
177
- activeTitle: v,
178
- activeCell: T,
179
- handleCellKeydown: q,
183
+ cellRows: T,
184
+ panelRef: S,
185
+ activeTitle: y,
186
+ activeCell: U,
187
+ handleCellKeydown: E,
180
188
  headerLabel: H,
181
- todayLabel: _,
182
- weekdayLabels: x,
183
- movePanel: j,
184
- zoomHeader: E,
189
+ todayLabel: N,
190
+ todayDisabled: A,
191
+ weekdayLabels: _,
192
+ movePanel: q,
185
193
  handleSelect: z,
186
- handleCellMouseEnter: A,
194
+ handleCellMouseEnter: O,
187
195
  handleCellMouseLeave: () => {
188
- s("cell-mouse-leave");
196
+ m("cell-mouse-leave");
189
197
  },
190
198
  selectToday: () => {
191
- const t = I();
192
- s("select", g(t, e.mode, e.dayStartOfWeek)), y(t);
199
+ if (A.value) return;
200
+ const t = P();
201
+ m("select", v(t, e.mode, e.dayStartOfWeek)), k(t);
193
202
  }
194
203
  };
195
204
  }
196
205
  });
197
206
  export {
198
- se as default
207
+ me as default
199
208
  };