x-next 1.1.0 → 1.3.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 (206) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/_hooks/use-form-item.d.ts +5 -0
  3. package/dist/_hooks/use-picker-focus.d.ts +17 -0
  4. package/dist/components/_components/feedback-icon/index.vue.d.ts +4 -4
  5. package/dist/components/_components/picker/input-range.vue.d.ts +10 -6
  6. package/dist/components/_components/picker/input.vue.d.ts +9 -5
  7. package/dist/components/alert/Alert.vue.d.ts +5 -5
  8. package/dist/components/alert/index.d.ts +10 -10
  9. package/dist/components/date-picker/DatePanel.vue.d.ts +5 -0
  10. package/dist/components/date-picker/DatePicker.vue.d.ts +36 -16
  11. package/dist/components/date-picker/index.d.ts +77 -33
  12. package/dist/components/dialog/Dialog.d.ts +1 -1
  13. package/dist/components/dialog/index.d.ts +3 -3
  14. package/dist/components/drawer/index.d.ts +3 -3
  15. package/dist/components/drawer/src/Drawer.vue.d.ts +1 -1
  16. package/dist/components/dropdown/Dropdown.vue.d.ts +30 -4
  17. package/dist/components/dropdown/DropdownButton.vue.d.ts +31 -5
  18. package/dist/components/dropdown/DropdownOption.vue.d.ts +2 -0
  19. package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +162 -5
  20. package/dist/components/dropdown/context.d.ts +14 -1
  21. package/dist/components/dropdown/dropdown-panel.vue.d.ts +7 -1
  22. package/dist/components/dropdown/index.d.ts +610 -28
  23. package/dist/components/dropdown/use-keyboard.d.ts +10 -0
  24. package/dist/components/form/FormItem.vue.d.ts +12 -4
  25. package/dist/components/form/context.d.ts +6 -0
  26. package/dist/components/form/form-item-label.vue.d.ts +4 -4
  27. package/dist/components/form/form-item-message.vue.d.ts +2 -0
  28. package/dist/components/form/index.d.ts +30 -8
  29. package/dist/components/form/interface.d.ts +2 -2
  30. package/dist/components/form-input/InputPassword.vue.d.ts +20 -2
  31. package/dist/components/form-input/index.d.ts +22 -4
  32. package/dist/components/form-select/Select.d.ts +3 -3
  33. package/dist/components/form-select/hooks/use-select.d.ts +2 -1
  34. package/dist/components/form-select/index.d.ts +6 -6
  35. package/dist/components/form-slider/Slider.vue.d.ts +10 -3
  36. package/dist/components/form-slider/index.d.ts +26 -6
  37. package/dist/components/form-slider/slider-button.vue.d.ts +4 -3
  38. package/dist/components/form-switch/Switch.vue.d.ts +2 -1
  39. package/dist/components/form-switch/index.d.ts +5 -2
  40. package/dist/components/form-textarea/Textarea.vue.d.ts +2 -2
  41. package/dist/components/form-textarea/index.d.ts +5 -5
  42. package/dist/components/image/Image.vue.d.ts +10 -9
  43. package/dist/components/image/ImagePreview.vue.d.ts +8 -7
  44. package/dist/components/image/ImagePreviewAction.d.ts +3 -3
  45. package/dist/components/image/ImagePreviewGroup.vue.d.ts +8 -7
  46. package/dist/components/image/index.d.ts +59 -52
  47. package/dist/components/image/preview-arrow.vue.d.ts +2 -2
  48. package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
  49. package/dist/components/layout/LayoutSidebar.vue.d.ts +2 -2
  50. package/dist/components/layout/index.d.ts +4 -4
  51. package/dist/components/link/Link.vue.d.ts +2 -2
  52. package/dist/components/link/index.d.ts +4 -4
  53. package/dist/components/menu/Menu.d.ts +2 -2
  54. package/dist/components/menu/base-menu.vue.d.ts +2 -2
  55. package/dist/components/menu/index.d.ts +4 -4
  56. package/dist/components/menu/sub-menu-pop.vue.d.ts +5 -5
  57. package/dist/components/message/index.d.ts +17 -17
  58. package/dist/components/message/message.vue.d.ts +8 -8
  59. package/dist/components/notification/Notification.d.ts +1 -1
  60. package/dist/components/notification/index.d.ts +3 -3
  61. package/dist/components/pagination/page-item-ellipsis.vue.d.ts +1 -1
  62. package/dist/components/pagination/page-item-step.vue.d.ts +2 -2
  63. package/dist/components/pagination/page-options.vue.d.ts +6 -6
  64. package/dist/components/popconfirm/src/popup.vue.d.ts +1 -1
  65. package/dist/components/popover/Popover.d.ts +1 -1
  66. package/dist/components/popover/index.d.ts +3 -3
  67. package/dist/components/popup/Popup.d.ts +1 -1
  68. package/dist/components/popup/index.d.ts +3 -3
  69. package/dist/components/progress/Progress.vue.d.ts +4 -4
  70. package/dist/components/progress/circle.vue.d.ts +2 -2
  71. package/dist/components/progress/index.d.ts +8 -8
  72. package/dist/components/progress/line.vue.d.ts +1 -1
  73. package/dist/components/progress/steps.vue.d.ts +1 -1
  74. package/dist/components/steps/Step.vue.d.ts +2 -2
  75. package/dist/components/steps/index.d.ts +4 -4
  76. package/dist/components/tabs/Tabs.d.ts +1 -1
  77. package/dist/components/tabs/index.d.ts +3 -3
  78. package/dist/components/tabs/tabs-tab.vue.d.ts +1 -1
  79. package/dist/components/tag/Tag.vue.d.ts +2 -2
  80. package/dist/components/tag/index.d.ts +4 -4
  81. package/dist/components/time-picker/TimeColumn.vue.d.ts +3 -0
  82. package/dist/components/time-picker/TimePanel.vue.d.ts +3 -0
  83. package/dist/components/time-picker/TimePicker.vue.d.ts +33 -17
  84. package/dist/components/time-picker/index.d.ts +73 -36
  85. package/dist/components/time-range-selector/TimeRangeSelector.vue.d.ts +8 -0
  86. package/dist/components/time-range-selector/index.d.ts +22 -0
  87. package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
  88. package/dist/components/tooltip/index.d.ts +3 -3
  89. package/dist/components/trigger/Trigger.d.ts +1 -1
  90. package/dist/components/trigger/index.d.ts +3 -3
  91. package/dist/es/_hooks/use-form-item.js +36 -10
  92. package/dist/es/_hooks/use-overflow.js +45 -40
  93. package/dist/es/_hooks/use-picker-focus.js +57 -0
  94. package/dist/es/_utils/constant.js +17 -5
  95. package/dist/es/components/_components/picker/input-range.vue.js +45 -55
  96. package/dist/es/components/_components/picker/input-range.vue2.js +105 -70
  97. package/dist/es/components/_components/picker/input.vue.js +22 -25
  98. package/dist/es/components/_components/picker/input.vue2.js +58 -43
  99. package/dist/es/components/_components/select-view/select-view.js +61 -66
  100. package/dist/es/components/date-picker/DatePanel.vue.js +102 -94
  101. package/dist/es/components/date-picker/DatePanel.vue2.js +97 -44
  102. package/dist/es/components/date-picker/DatePicker.vue.js +71 -58
  103. package/dist/es/components/date-picker/DatePicker.vue2.js +285 -231
  104. package/dist/es/components/dialog/Dialog.js +159 -128
  105. package/dist/es/components/dropdown/Dropdown.vue.js +18 -15
  106. package/dist/es/components/dropdown/Dropdown.vue2.js +52 -31
  107. package/dist/es/components/dropdown/DropdownOption.vue.js +22 -21
  108. package/dist/es/components/dropdown/DropdownOption.vue2.js +23 -19
  109. package/dist/es/components/dropdown/DropdownSubmenu.vue.js +49 -36
  110. package/dist/es/components/dropdown/DropdownSubmenu.vue2.js +45 -24
  111. package/dist/es/components/dropdown/context.js +3 -2
  112. package/dist/es/components/dropdown/dropdown-panel.vue.js +24 -21
  113. package/dist/es/components/dropdown/dropdown-panel.vue2.js +83 -31
  114. package/dist/es/components/dropdown/use-keyboard.js +45 -0
  115. package/dist/es/components/form/Form.vue2.js +113 -101
  116. package/dist/es/components/form/FormItem.vue.js +26 -22
  117. package/dist/es/components/form/FormItem.vue2.js +162 -125
  118. package/dist/es/components/form/form-item-message.vue.js +31 -24
  119. package/dist/es/components/form/form-item-message.vue2.js +4 -2
  120. package/dist/es/components/form-checkbox/Checkbox.js +80 -76
  121. package/dist/es/components/form-checkbox/CheckboxGroup.js +43 -38
  122. package/dist/es/components/form-input/Input.js +83 -79
  123. package/dist/es/components/form-input/InputPassword.vue.js +19 -16
  124. package/dist/es/components/form-input/InputPassword.vue2.js +39 -29
  125. package/dist/es/components/form-input/InputSearch.js +47 -37
  126. package/dist/es/components/form-input-number/InputNumber.js +134 -133
  127. package/dist/es/components/form-input-tag/InputTag.js +173 -162
  128. package/dist/es/components/form-radio/Radio.js +74 -71
  129. package/dist/es/components/form-radio/RadioGroup.js +55 -49
  130. package/dist/es/components/form-select/Select.js +116 -114
  131. package/dist/es/components/form-select/hooks/use-select.js +128 -128
  132. package/dist/es/components/form-slider/Slider.vue.js +28 -28
  133. package/dist/es/components/form-slider/Slider.vue2.js +139 -132
  134. package/dist/es/components/form-slider/slider-button.vue.js +6 -6
  135. package/dist/es/components/form-slider/slider-button.vue2.js +39 -34
  136. package/dist/es/components/form-switch/Switch.vue.js +9 -9
  137. package/dist/es/components/form-switch/Switch.vue2.js +81 -74
  138. package/dist/es/components/form-textarea/Textarea.vue2.js +123 -108
  139. package/dist/es/components/image/Image.vue2.js +77 -76
  140. package/dist/es/components/image/ImagePreview.vue.js +13 -12
  141. package/dist/es/components/image/ImagePreview.vue2.js +141 -136
  142. package/dist/es/components/image/ImagePreviewGroup.vue.js +1 -1
  143. package/dist/es/components/image/ImagePreviewGroup.vue2.js +82 -83
  144. package/dist/es/components/rate/Rate.js +106 -103
  145. package/dist/es/components/time-picker/TimeColumn.vue.js +34 -23
  146. package/dist/es/components/time-picker/TimeColumn.vue2.js +37 -28
  147. package/dist/es/components/time-picker/TimePicker.vue.js +83 -64
  148. package/dist/es/components/time-picker/TimePicker.vue2.js +192 -156
  149. package/dist/es/components/time-range-selector/TimeRangeSelector.vue.js +327 -193
  150. package/dist/es/locale/en-US.js +6 -0
  151. package/dist/es/locale/zh-CN.js +6 -0
  152. package/dist/es/style.css +1 -1
  153. package/dist/icons/_self/down.d.ts +1 -1
  154. package/dist/icons/_self/dropdown/more.d.ts +1 -1
  155. package/dist/icons/_self/empty-better.d.ts +1 -1
  156. package/dist/icons/_self/empty.d.ts +1 -1
  157. package/dist/icons/_self/eye-invisible.d.ts +1 -1
  158. package/dist/icons/_self/eye.d.ts +1 -1
  159. package/dist/icons/_self/full-screen.d.ts +1 -1
  160. package/dist/icons/_self/left.d.ts +1 -1
  161. package/dist/icons/_self/menu/down.d.ts +1 -1
  162. package/dist/icons/_self/minus.d.ts +1 -1
  163. package/dist/icons/_self/more-dot.d.ts +1 -1
  164. package/dist/icons/_self/next.d.ts +1 -1
  165. package/dist/icons/_self/original-size.d.ts +1 -1
  166. package/dist/icons/_self/plus.d.ts +1 -1
  167. package/dist/icons/_self/prev.d.ts +1 -1
  168. package/dist/icons/_self/question-message.d.ts +1 -1
  169. package/dist/icons/_self/right.d.ts +1 -1
  170. package/dist/icons/_self/rotate-left.d.ts +1 -1
  171. package/dist/icons/_self/rotate-right.d.ts +1 -1
  172. package/dist/icons/_self/search.d.ts +1 -1
  173. package/dist/icons/_self/up.d.ts +1 -1
  174. package/dist/icons/_self/zoom-in.d.ts +1 -1
  175. package/dist/icons/_self/zoom-out.d.ts +1 -1
  176. package/dist/icons/_ui/alone-left.d.ts +1 -1
  177. package/dist/icons/_ui/alone-margin-left.d.ts +1 -1
  178. package/dist/icons/_ui/alone-margin-right.d.ts +1 -1
  179. package/dist/icons/_ui/alone-right.d.ts +1 -1
  180. package/dist/icons/_ui/calendar.d.ts +1 -1
  181. package/dist/icons/_ui/time.d.ts +1 -1
  182. package/dist/icons/animation/animation-loading.d.ts +1 -1
  183. package/dist/icons/default/check-circle-fill.d.ts +1 -1
  184. package/dist/icons/default/check.d.ts +1 -1
  185. package/dist/icons/default/close-circle-fill.d.ts +1 -1
  186. package/dist/icons/default/close.d.ts +1 -1
  187. package/dist/icons/default/exclamation-circle-fill.d.ts +1 -1
  188. package/dist/icons/default/exclamation.d.ts +1 -1
  189. package/dist/icons/default/filter.d.ts +1 -1
  190. package/dist/icons/default/info-circle-fill.d.ts +1 -1
  191. package/dist/icons/default/link.d.ts +1 -1
  192. package/dist/icons/default/logo-simple.d.ts +1 -1
  193. package/dist/icons/default/minus-circle-fill.d.ts +1 -1
  194. package/dist/icons/icon.d.ts +2 -2
  195. package/dist/icons/index.d.ts +3 -3
  196. package/dist/index.cjs +4 -4
  197. package/dist/index.d.ts +1 -1
  198. package/dist/index.umd.js +4 -4
  199. package/dist/locale/interface.d.ts +6 -0
  200. package/dist/style/base.css +1 -1
  201. package/dist/style/date-picker.css +1 -1
  202. package/dist/style/form.css +1 -1
  203. package/dist/style/image.css +1 -1
  204. package/dist/style/time-range-selector.css +1 -1
  205. package/dist/style.css +1 -1
  206. package/package.json +2 -2
@@ -1,27 +1,28 @@
1
- import { dayjs as J } from "../../_utils/date.js";
2
- import { defineComponent as Ze, useAttrs as $e, toRefs as ea, computed as n, ref as V, watch as M, nextTick as aa } from "vue";
3
- import { Trigger as ta } from "../trigger/index.js";
4
- import la from "../_components/picker/input.vue.js";
5
- import ua from "../_components/picker/input-range.vue.js";
6
- import na from "../time-picker/TimePanel.vue.js";
7
- import oa from "../../icons/_ui/calendar.js";
8
- import { getClassNameMixin as ra } from "../../_utils/config.js";
9
- import { omit as ia } from "../../_utils/omit.js";
1
+ import { dayjs as $ } from "../../_utils/date.js";
2
+ import { defineComponent as na, useAttrs as oa, toRefs as ra, computed as n, ref as V, watch as O, nextTick as ie } from "vue";
3
+ import { Trigger as ia } from "../trigger/index.js";
4
+ import ca from "../_components/picker/input.vue.js";
5
+ import da from "../_components/picker/input-range.vue.js";
6
+ import sa from "../time-picker/TimePanel.vue.js";
7
+ import va from "../../icons/_ui/calendar.js";
8
+ import { getClassNameMixin as fa } from "../../_utils/config.js";
9
+ import { omit as ma } from "../../_utils/omit.js";
10
10
  import { isArray as i } from "../../_utils/is.js";
11
- import { useFormItem as da } from "../../_hooks/use-form-item.js";
12
- import { useSize as ca } from "../../_hooks/use-size.js";
13
- import { useLocale as sa } from "../../locale/index.js";
14
- import va from "./DatePanel.vue.js";
15
- import { isRangeType as fa, getDatePickerMode as ma, getDefaultFormat as ga, parseDateModelValue as T, getSortedRange as N, getRangeViewDate as ne, formatPanelValue as D, normalizePanelValue as I, getShortcutValue as Va, parseInputValue as oe, getDateValueFromPanel as K, isSameDateValue as ha } from "./utils.js";
16
- const xa = Ze({
11
+ import { useFormItem as ga } from "../../_hooks/use-form-item.js";
12
+ import { usePickerFocus as Va } from "../../_hooks/use-picker-focus.js";
13
+ import { useSize as ha } from "../../_hooks/use-size.js";
14
+ import { useLocale as ya } from "../../locale/index.js";
15
+ import Pa from "./DatePanel.vue.js";
16
+ import { isRangeType as pa, getDatePickerMode as ba, getDefaultFormat as ka, parseDateModelValue as x, getSortedRange as j, getRangeViewDate as ce, formatPanelValue as D, normalizePanelValue as R, getShortcutValue as Da, parseInputValue as de, getDateValueFromPanel as G, isSameDateValue as Sa } from "./utils.js";
17
+ const Ya = na({
17
18
  name: "DatePicker",
18
19
  components: {
19
- Trigger: ta,
20
- DateInput: la,
21
- DateRangeInput: ua,
22
- DatePanel: va,
23
- TimePanel: na,
24
- IconCalendar: oa
20
+ Trigger: ia,
21
+ DateInput: ca,
22
+ DateRangeInput: da,
23
+ DatePanel: Pa,
24
+ TimePanel: sa,
25
+ IconCalendar: va
25
26
  },
26
27
  inheritAttrs: !1,
27
28
  props: {
@@ -153,298 +154,351 @@ const xa = Ze({
153
154
  "update:modelValue": (t) => !0,
154
155
  "update:popupVisible": (t) => !0,
155
156
  "update:pickerValue": (t) => !0,
156
- change: (t, d, S) => !0,
157
- select: (t, d, S) => !0,
158
- "calendar-change": (t, d, S, O) => !0,
157
+ change: (t, c, S) => !0,
158
+ select: (t, c, S) => !0,
159
+ "calendar-change": (t, c, S, E) => !0,
159
160
  clear: (t) => !0,
160
- ok: (t, d, S) => !0,
161
+ ok: (t, c, S) => !0,
161
162
  "popup-visible-change": (t) => !0,
162
- "picker-value-change": (t, d, S) => !0,
163
+ "picker-value-change": (t, c, S) => !0,
163
164
  "select-shortcut": (t) => !0,
164
165
  focus: (t) => !0,
165
166
  blur: (t) => !0
166
167
  },
167
- setup(t, { emit: d }) {
168
- const S = $e(), O = ea(t), re = ra("date-picker"), { t: h } = sa(), c = n(() => fa(t.type)), g = n(() => ma(t.type)), b = n(() => g.value === "date" && t.showTime), j = n(() => t.timePickerProps || {}), Y = n(() => j.value.format || "HH:mm:ss"), E = n(() => t.showConfirmBtn || b.value), f = n(() => t.format || ga(g.value, b.value)), R = n(
168
+ setup(t, { emit: c }) {
169
+ const S = oa(), E = ra(t), se = fa("date-picker"), { t: h } = ya(), d = n(() => pa(t.type)), g = n(() => ba(t.type)), p = n(() => g.value === "date" && t.showTime), Y = n(() => t.timePickerProps || {}), L = n(() => Y.value.format || "HH:mm:ss"), q = n(() => t.showConfirmBtn || p.value), f = n(
170
+ () => t.format || ka(g.value, p.value)
171
+ ), A = n(
169
172
  () => t.valueFormat && t.valueFormat !== "timestamp" && t.valueFormat !== "Date" ? t.valueFormat : f.value
170
- ), ie = n(() => i(t.disabled) ? t.disabled.every(Boolean) : t.disabled), {
171
- mergedSize: de,
172
- mergedDisabled: ce,
173
- mergedError: se,
174
- eventHandlers: B
175
- } = da({
176
- size: O.size,
177
- disabled: ie,
178
- error: O.error
179
- }), { mergedSize: ve } = ca(de), X = V(
180
- T(t.defaultValue, R.value, c.value)
173
+ ), ve = n(
174
+ () => i(t.disabled) ? t.disabled.every(Boolean) : t.disabled
175
+ ), {
176
+ mergedSize: fe,
177
+ mergedDisabled: me,
178
+ mergedError: ge,
179
+ eventHandlers: C
180
+ } = ga({
181
+ size: E.size,
182
+ disabled: ve,
183
+ error: E.error
184
+ }), { mergedSize: Ve } = ha(fe), J = V(
185
+ x(t.defaultValue, A.value, d.value)
181
186
  ), m = n(() => {
182
- const e = t.modelValue !== void 0 ? T(t.modelValue, R.value, c.value) : X.value;
183
- return c.value && !i(e) ? [void 0, void 0] : e;
184
- }), Z = V(
185
- T(t.defaultPickerValue, R.value, c.value)
186
- ), L = n(() => t.pickerValue !== void 0 ? T(t.pickerValue, R.value, c.value) : Z.value), q = V(), H = V(!1), v = V(0), $ = V(t.defaultPopupVisible), o = V(m.value), y = V(), s = V(), p = V(), F = V("date"), U = n(() => t.popupVisible ?? $.value), x = n(() => !!ce.value), fe = n(() => t.readonly || t.disabledInput || t.inputReadOnly), me = n(() => x.value ? [!0, !0] : i(t.disabled) ? t.disabled : [!!t.disabled, !!t.disabled]), W = n(() => i(o.value) ? void 0 : o.value), k = n(
187
- () => i(o.value) ? o.value : [void 0, void 0]
188
- ), ge = n(() => {
189
- if (!c.value || !y.value) return [];
187
+ const e = t.modelValue !== void 0 ? x(t.modelValue, A.value, d.value) : J.value;
188
+ return d.value && !i(e) ? [void 0, void 0] : e;
189
+ }), X = V(
190
+ x(t.defaultPickerValue, A.value, d.value)
191
+ ), H = n(() => t.pickerValue !== void 0 ? x(t.pickerValue, A.value, d.value) : X.value), B = V(), U = V(!1), s = V(0), Z = V(t.defaultPopupVisible), r = V(m.value), y = V(), v = V(), b = V(), F = V("date"), I = n(() => t.popupVisible ?? Z.value), z = n(() => !!me.value), he = n(
192
+ () => t.readonly || t.disabledInput || t.inputReadOnly
193
+ ), ye = n(() => z.value ? [!0, !0] : i(t.disabled) ? t.disabled : [!!t.disabled, !!t.disabled]), W = n(
194
+ () => i(r.value) ? void 0 : r.value
195
+ ), k = n(
196
+ () => i(r.value) ? r.value : [void 0, void 0]
197
+ ), Pe = n(() => {
198
+ if (!d.value || !y.value) return [];
190
199
  const [e, a] = k.value;
191
- return e && !a ? N([e, y.value]) : [];
192
- }), Ve = n(() => {
193
- if (!c.value) return [p.value, void 0];
194
- const e = p.value || k.value[0] || k.value[1], a = ne(e, g.value);
200
+ return e && !a ? j([e, y.value]) : [];
201
+ }), pe = n(() => {
202
+ if (!d.value) return [b.value, void 0];
203
+ const e = b.value || k.value[0] || k.value[1], a = ce(e, g.value);
195
204
  return [e, a];
196
- }), he = n(
205
+ }), be = n(
197
206
  () => i(m.value) ? void 0 : m.value
198
- ), ye = n(
207
+ ), ke = n(
199
208
  () => i(m.value) ? m.value : []
200
- ), Pe = n(
201
- () => typeof s.value == "string" ? s.value : void 0
202
- ), be = n(
203
- () => i(s.value) ? s.value : void 0
204
- ), pe = (e) => h(e === "month" ? "datePicker.placeholderMonth" : e === "year" ? "datePicker.placeholderYear" : e === "quarter" ? "datePicker.placeholderQuarter" : e === "week" ? "datePicker.placeholderWeek" : "datePicker.placeholderDate"), ke = n(() => i(t.placeholder) ? t.placeholder[0] : t.placeholder ?? pe(g.value)), De = n(() => {
209
+ ), De = n(
210
+ () => typeof v.value == "string" ? v.value : void 0
211
+ ), Se = n(
212
+ () => i(v.value) ? v.value : void 0
213
+ ), Fe = (e) => h(e === "month" ? "datePicker.placeholderMonth" : e === "year" ? "datePicker.placeholderYear" : e === "quarter" ? "datePicker.placeholderQuarter" : e === "week" ? "datePicker.placeholderWeek" : "datePicker.placeholderDate"), _e = n(() => i(t.placeholder) ? t.placeholder[0] : t.placeholder ?? Fe(g.value)), Be = n(() => {
205
214
  if (i(t.placeholder)) return t.placeholder;
206
215
  const e = t.placeholder ?? h("datePicker.dateLabel");
207
216
  return [
208
217
  h("datePicker.rangeStart", { type: e }),
209
218
  h("datePicker.rangeEnd", { type: e })
210
219
  ];
211
- }), Se = n(
212
- () => ia(S, ["class", "style"])
213
- ), Fe = n(() => {
220
+ }), Ce = n(() => ma(S, ["class", "style"])), Ie = n(() => {
214
221
  if (t.disabledDate)
215
222
  return (e) => {
216
223
  var l;
217
- const a = c.value ? v.value === 0 ? "start" : "end" : void 0;
218
- return ((l = t.disabledDate) == null ? void 0 : l.call(
219
- t,
220
- e,
221
- a,
222
- {
223
- value: D(o.value, f.value, t.valueFormat),
224
- selecting: a
225
- }
226
- )) ?? !1;
224
+ const a = d.value ? s.value === 0 ? "start" : "end" : void 0;
225
+ return ((l = t.disabledDate) == null ? void 0 : l.call(t, e, a, {
226
+ value: D(
227
+ r.value,
228
+ f.value,
229
+ t.valueFormat
230
+ ),
231
+ selecting: a
232
+ })) ?? !1;
227
233
  };
228
- }), _e = (e = 0) => {
229
- const a = j.value.defaultValue, l = i(a) ? a[e] : a, u = T(l, Y.value, !1);
234
+ }), we = (e = 0) => {
235
+ const a = Y.value.defaultValue, l = i(a) ? a[e] : a, u = x(l, L.value, !1);
230
236
  return i(u) ? void 0 : u;
231
- }, A = (e, a, l = 0) => {
232
- const u = i(o.value) ? o.value[l] : o.value, r = a || u || _e(l);
233
- return r ? e.hour(r.hour()).minute(r.minute()).second(r.second()).millisecond(0) : e.millisecond(0);
234
- }, Be = (e, a) => {
237
+ }, M = (e, a, l = 0) => {
238
+ const u = i(r.value) ? r.value[l] : r.value, o = a || u || we(l);
239
+ return o ? e.hour(o.hour()).minute(o.minute()).second(o.second()).millisecond(0) : e.millisecond(0);
240
+ }, Te = (e, a) => {
235
241
  var l;
236
242
  return ((l = t.disabledTime) == null ? void 0 : l.call(t, e == null ? void 0 : e.toDate(), a)) ?? {};
237
- }, Ce = (e) => (e == null ? void 0 : e.format("YYYY-MM-DD")) ?? h("datePicker.placeholderDate"), we = (e) => (e == null ? void 0 : e.format(Y.value)) ?? "--:--:--", ee = (e) => {
238
- t.modelValue === void 0 && (X.value = i(e) ? [...e] : e);
239
- }, Q = (e) => {
240
- t.pickerValue === void 0 && (Z.value = i(e) ? [...e] : e);
241
- }, C = (e) => {
242
- (x.value || t.readonly) && (e = !1), $.value = e, d("update:popupVisible", e), d("popup-visible-change", e);
243
- }, z = (e) => i(e) ? e[0] || e[1] : e, ae = () => {
244
- o.value = i(m.value) ? [...m.value] : m.value, p.value = z(L.value) || z(o.value);
243
+ }, xe = (e) => (e == null ? void 0 : e.format("YYYY-MM-DD")) ?? h("datePicker.placeholderDate"), Re = (e) => (e == null ? void 0 : e.format(L.value)) ?? "--:--:--", ee = (e) => {
244
+ t.modelValue === void 0 && (J.value = i(e) ? [...e] : e);
245
+ }, K = (e) => {
246
+ t.pickerValue === void 0 && (X.value = i(e) ? [...e] : e);
247
+ }, w = (e) => {
248
+ var l;
249
+ (z.value || t.readonly) && (e = !1);
250
+ const a = !e && ((l = ue.value) == null ? void 0 : l.contains(document.activeElement));
251
+ Z.value = e, a && ie(() => {
252
+ var u, o;
253
+ I.value || (o = (u = B.value) == null ? void 0 : u.focus) == null || o.call(u, d.value ? s.value : void 0);
254
+ }), c("update:popupVisible", e), c("popup-visible-change", e);
255
+ }, N = (e) => i(e) ? e[0] || e[1] : e, ae = () => {
256
+ r.value = i(m.value) ? [...m.value] : m.value, b.value = N(H.value) || N(r.value);
245
257
  }, P = (e, a) => {
246
- const l = D(a, f.value, t.valueFormat), u = K(a), r = D(a, f.value);
247
- d(e === "change" ? "change" : e === "select" ? "select" : e === "ok" ? "ok" : "picker-value-change", l, u, r);
248
- }, G = (e, a) => {
249
- const l = D(e, f.value, t.valueFormat), u = K(e), r = D(e, f.value);
250
- d("calendar-change", l, u, r, { range: a });
258
+ const l = D(
259
+ a,
260
+ f.value,
261
+ t.valueFormat
262
+ ), u = G(a), o = D(a, f.value);
263
+ c(e === "change" ? "change" : e === "select" ? "select" : e === "ok" ? "ok" : "picker-value-change", l, u, o);
264
+ }, Q = (e, a) => {
265
+ const l = D(
266
+ e,
267
+ f.value,
268
+ t.valueFormat
269
+ ), u = G(e), o = D(e, f.value);
270
+ c("calendar-change", l, u, o, { range: a });
251
271
  }, te = (e) => {
252
- const a = D(e, f.value, t.valueFormat), l = K(e), u = D(e, f.value);
253
- d("update:pickerValue", a), d("picker-value-change", a, l, u);
272
+ const a = D(
273
+ e,
274
+ f.value,
275
+ t.valueFormat
276
+ ), l = G(e), u = D(e, f.value);
277
+ c("update:pickerValue", a), c("picker-value-change", a, l, u);
254
278
  }, le = (e) => {
255
- if (!c.value) return e;
256
- const a = L.value, l = i(a) ? [...a] : [void 0, void 0];
257
- return l[v.value] = e, l;
279
+ if (!d.value) return e;
280
+ const a = H.value, l = i(a) ? [...a] : [void 0, void 0];
281
+ return l[s.value] = e, l;
258
282
  }, _ = (e, a = !0) => {
259
- var u, r;
260
- const l = i(e) ? N(e) : e;
261
- ha(l, m.value, g.value, b.value) || (ee(l), d(
283
+ var u, o;
284
+ const l = i(e) ? j(e) : e;
285
+ Sa(l, m.value, g.value, p.value) || (ee(l), c(
262
286
  "update:modelValue",
263
287
  D(
264
288
  l,
265
289
  f.value,
266
290
  t.valueFormat
267
291
  )
268
- ), P("change", l), (r = (u = B.value) == null ? void 0 : u.onChange) == null || r.call(u)), a && C(!1);
269
- }, Te = (e) => {
270
- const a = b.value ? A(I(e, g.value), void 0, v.value) : I(e, g.value);
271
- if (c.value) {
292
+ ), P("change", l), (o = (u = C.value) == null ? void 0 : u.onChange) == null || o.call(u)), a && w(!1);
293
+ }, Ae = (e) => {
294
+ const a = p.value ? M(R(e, g.value), void 0, s.value) : R(e, g.value);
295
+ if (d.value) {
272
296
  const l = [...k.value];
273
- if (!l[0] || l[1] || v.value === 0) {
274
- l[0] = a, l[1] = void 0, v.value = 1, y.value = void 0, o.value = l, F.value = "date", P("select", l), G(l, "start");
297
+ if (!l[0] || l[1] || s.value === 0) {
298
+ l[0] = a, l[1] = void 0, s.value = 1, y.value = void 0, r.value = l, F.value = "date", P("select", l), Q(l, "start");
275
299
  return;
276
300
  } else {
277
301
  l[1] = a;
278
- const u = N(l);
279
- y.value = void 0, o.value = u, F.value = "date", P("select", u), G(u, "end"), E.value || _(u);
302
+ const u = j(l);
303
+ y.value = void 0, r.value = u, F.value = "date", P("select", u), Q(u, "end"), q.value || _(u);
280
304
  return;
281
305
  }
282
306
  }
283
- o.value = a, P("select", a), E.value || _(a);
284
- }, Ie = (e, a) => {
285
- if (c.value) {
286
- const r = a ?? v.value, w = [...k.value], Xe = w[r] || J();
287
- w[r] = A(Xe, e, r), o.value = w, v.value = r, P("select", w), G(w, r === 0 ? "start" : "end");
307
+ r.value = a, P("select", a), q.value || _(a);
308
+ }, ze = (e, a) => {
309
+ if (d.value) {
310
+ const o = a ?? s.value, T = [...k.value], ua = T[o] || $();
311
+ T[o] = M(ua, e, o), r.value = T, s.value = o, P("select", T), Q(T, o === 0 ? "start" : "end");
288
312
  return;
289
313
  }
290
- const l = W.value || J(), u = A(l, e);
291
- o.value = u, P("select", u);
292
- }, Re = () => {
293
- const e = I(J(), g.value), a = b.value ? A(e, W.value) : e;
294
- o.value = a, p.value = e, Q(e), P("select", a), b.value || _(a);
295
- }, xe = (e) => {
296
- v.value = e, F.value = "time";
297
- }, Ae = (e) => {
298
- v.value = e, F.value = "date";
299
- }, ze = (e) => {
300
- if (!c.value) return;
301
- const [a, l] = k.value;
302
- a && !l && (y.value = e);
314
+ const l = W.value || $(), u = M(l, e);
315
+ r.value = u, P("select", u);
303
316
  }, Me = () => {
304
- y.value = void 0;
317
+ const e = R($(), g.value), a = p.value ? M(e, W.value) : e;
318
+ r.value = a, b.value = e, K(e), P("select", a), p.value || _(a);
305
319
  }, Ne = (e) => {
306
- const a = Va(e, f.value, c.value);
307
- o.value = a, d("select-shortcut", e), P("select", a), !b.value && _(a);
308
- }, Oe = () => {
309
- _(o.value), P("ok", o.value);
320
+ s.value = e, F.value = "time";
321
+ }, Oe = (e) => {
322
+ s.value = e, F.value = "date";
310
323
  }, je = (e) => {
311
- p.value = e;
312
- const a = le(e);
313
- Q(a), te(a);
314
- }, Ye = (e, a) => {
315
- const l = a === 0 ? e : ne(e, g.value, -1);
316
- p.value = l;
317
- const u = le(l);
318
- Q(u), te(u);
319
- }, Ee = (e) => {
320
- C(e);
324
+ if (!d.value) return;
325
+ const [a, l] = k.value;
326
+ a && !l && (y.value = e);
327
+ }, Ee = () => {
328
+ y.value = void 0;
329
+ }, Ye = (e) => {
330
+ const a = Da(e, f.value, d.value);
331
+ r.value = a, c("select-shortcut", e), P("select", a), !p.value && _(a);
321
332
  }, Le = () => {
322
- !x.value && !t.readonly && C(!0);
333
+ _(r.value), P("ok", r.value);
323
334
  }, qe = (e) => {
335
+ b.value = e;
336
+ const a = le(e);
337
+ K(a), te(a);
338
+ }, He = (e, a) => {
339
+ const l = a === 0 ? e : ce(e, g.value, -1);
340
+ b.value = l;
341
+ const u = le(l);
342
+ K(u), te(u);
343
+ }, Ue = (e) => {
344
+ w(e);
345
+ }, {
346
+ popupRef: ue,
347
+ panelId: We,
348
+ openPanel: Ke,
349
+ handlePanelKeydown: Qe,
350
+ isInternalFocus: $e,
351
+ handlePanelFocusout: Ge
352
+ } = Va({
353
+ visible: I,
354
+ canOpen: () => !z.value && !t.readonly,
355
+ setVisible: w,
356
+ focusInput: () => {
357
+ var e, a;
358
+ return (a = (e = B.value) == null ? void 0 : e.focus) == null ? void 0 : a.call(e, d.value ? s.value : void 0);
359
+ },
360
+ inputContains: (e) => {
361
+ var a, l;
362
+ return !!(e && ((l = (a = B.value) == null ? void 0 : a.$el) != null && l.contains(e)));
363
+ },
364
+ selector: '[role="gridcell"][tabindex="0"], [role="listbox"][tabindex="0"]'
365
+ }), Je = (e) => {
366
+ Ge(e, oe);
367
+ }, Xe = (e) => {
324
368
  var a, l, u;
325
- (a = e == null ? void 0 : e.stopPropagation) == null || a.call(e), s.value = void 0, o.value = c.value ? [void 0, void 0] : void 0, ee(o.value), y.value = void 0, d("update:modelValue", void 0), d("change", void 0, void 0, void 0), d("clear", e), (u = (l = B.value) == null ? void 0 : l.onChange) == null || u.call(l), C(!1);
326
- }, He = (e) => {
369
+ (a = e == null ? void 0 : e.stopPropagation) == null || a.call(e), v.value = void 0, r.value = d.value ? [void 0, void 0] : void 0, ee(r.value), y.value = void 0, c("update:modelValue", void 0), c("change", void 0, void 0, void 0), c("clear", e), (u = (l = C.value) == null ? void 0 : l.onChange) == null || u.call(l), w(!1);
370
+ }, Ze = (e) => {
327
371
  var l, u;
328
372
  const a = e.target;
329
- if (c.value) {
330
- const r = i(s.value) ? [...s.value] : ["", ""];
331
- r[v.value] = a.value, s.value = r;
373
+ if (d.value) {
374
+ const o = i(v.value) ? [...v.value] : ["", ""];
375
+ o[s.value] = a.value, v.value = o;
332
376
  } else
333
- s.value = a.value;
334
- (u = (l = B.value) == null ? void 0 : l.onInput) == null || u.call(l);
335
- }, ue = () => {
336
- if (c.value) {
337
- const e = i(s.value) ? s.value : [], a = [...k.value], l = oe(e[v.value], f.value);
338
- l && (a[v.value] = I(l, g.value), o.value = a, a[0] && a[1] && _(N(a)));
339
- } else if (typeof s.value == "string") {
340
- const e = oe(s.value, f.value);
377
+ v.value = a.value;
378
+ (u = (l = C.value) == null ? void 0 : l.onInput) == null || u.call(l);
379
+ }, ne = () => {
380
+ if (d.value) {
381
+ const e = i(v.value) ? v.value : [], a = [...k.value], l = de(e[s.value], f.value);
382
+ l && (a[s.value] = R(l, g.value), r.value = a, a[0] && a[1] && _(j(a)));
383
+ } else if (typeof v.value == "string") {
384
+ const e = de(v.value, f.value);
341
385
  if (e) {
342
- const a = I(e, g.value);
343
- o.value = a, _(a);
386
+ const a = R(e, g.value);
387
+ r.value = a, _(a);
344
388
  }
345
389
  }
346
- s.value = void 0, y.value = void 0;
347
- }, Ue = (e) => {
390
+ v.value = void 0, y.value = void 0;
391
+ }, ea = (e) => {
348
392
  var a, l;
349
- H.value = !0, d("focus", e), (l = (a = B.value) == null ? void 0 : a.onFocus) == null || l.call(a, e);
350
- }, We = (e) => {
393
+ U.value = !0, c("focus", e), (l = (a = C.value) == null ? void 0 : a.onFocus) == null || l.call(a, e);
394
+ }, oe = (e) => {
351
395
  var a, l;
352
- H.value = !1, ue(), d("blur", e), (l = (a = B.value) == null ? void 0 : a.onBlur) == null || l.call(a, e);
353
- }, Qe = () => {
354
- s.value = void 0, C(!1);
355
- }, Ge = (e) => {
356
- v.value = e;
357
- }, Je = () => {
358
- aa(() => {
396
+ $e(e.relatedTarget) || (U.value = !1, ne(), c("blur", e), (l = (a = C.value) == null ? void 0 : a.onBlur) == null || l.call(a, e));
397
+ }, aa = () => {
398
+ v.value = void 0, w(!1), re();
399
+ }, ta = (e) => {
400
+ s.value = e;
401
+ }, re = () => {
402
+ ie(() => {
359
403
  var e, a;
360
- (a = (e = q.value) == null ? void 0 : e.focus) == null || a.call(e, c.value ? v.value : void 0);
404
+ (a = (e = B.value) == null ? void 0 : e.focus) == null || a.call(e, d.value ? s.value : void 0);
361
405
  });
362
- }, Ke = () => {
406
+ }, la = () => {
363
407
  var e, a;
364
- (a = (e = q.value) == null ? void 0 : e.blur) == null || a.call(e);
408
+ (a = (e = B.value) == null ? void 0 : e.blur) == null || a.call(e);
365
409
  };
366
- return M(
367
- () => U.value,
410
+ return O(
411
+ () => I.value,
368
412
  (e) => {
369
- e && (ae(), s.value = void 0, y.value = void 0, F.value = "date");
413
+ e && (ae(), v.value = void 0, y.value = void 0, F.value = "date");
370
414
  }
371
- ), M(
415
+ ), O(
372
416
  () => [t.modelValue, t.type, t.format, t.valueFormat],
373
417
  () => {
374
- o.value = i(m.value) ? [...m.value] : m.value, s.value = void 0, y.value = void 0, F.value = "date";
418
+ r.value = i(m.value) ? [...m.value] : m.value, v.value = void 0, y.value = void 0, F.value = "date";
375
419
  }
376
- ), M(
377
- () => [t.pickerValue, t.defaultPickerValue, t.type, t.format, t.valueFormat],
420
+ ), O(
421
+ () => [
422
+ t.pickerValue,
423
+ t.defaultPickerValue,
424
+ t.type,
425
+ t.format,
426
+ t.valueFormat
427
+ ],
378
428
  () => {
379
- p.value = z(L.value) || z(o.value);
429
+ b.value = N(H.value) || N(r.value);
380
430
  }
381
- ), M(
431
+ ), O(
382
432
  () => m.value,
383
433
  () => {
384
- U.value || ae();
434
+ I.value || ae();
385
435
  }
386
436
  ), {
387
437
  t: h,
388
438
  attrs: S,
389
- className: re,
390
- inputRef: q,
391
- inputAttrs: Se,
392
- isRange: c,
439
+ className: se,
440
+ inputRef: B,
441
+ inputAttrs: Ce,
442
+ isRange: d,
393
443
  mode: g,
394
- isDateTime: b,
395
- needConfirm: E,
396
- timeFormat: Y,
397
- timePickerProps: j,
398
- focused: H,
399
- focusedIndex: v,
400
- mergedSize: ve,
401
- mergedError: se,
402
- allDisabled: x,
403
- rangeDisabled: me,
404
- mergedInputReadonly: fe,
405
- mergedPopupVisible: U,
444
+ isDateTime: p,
445
+ needConfirm: q,
446
+ timeFormat: L,
447
+ timePickerProps: Y,
448
+ focused: U,
449
+ focusedIndex: s,
450
+ mergedSize: Ve,
451
+ mergedError: ge,
452
+ allDisabled: z,
453
+ rangeDisabled: ye,
454
+ mergedInputReadonly: he,
455
+ mergedPopupVisible: I,
406
456
  computedFormat: f,
407
- singleInputValue: he,
408
- rangeInputValue: ye,
409
- singleInputText: Pe,
410
- rangeInputText: be,
411
- singlePlaceholder: ke,
412
- rangePlaceholder: De,
457
+ singleInputValue: be,
458
+ rangeInputValue: ke,
459
+ singleInputText: De,
460
+ rangeInputText: Se,
461
+ singlePlaceholder: _e,
462
+ rangePlaceholder: Be,
413
463
  singlePanelValue: W,
414
464
  rangePanelValue: k,
415
- previewRangeValue: ge,
416
- rangeViewDates: Ve,
465
+ previewRangeValue: Pe,
466
+ rangeViewDates: pe,
417
467
  rangePanelMode: F,
418
- viewDate: p,
419
- mergedDisabledDate: Fe,
420
- getDisabledTimeProps: Be,
421
- formatTimeDate: Ce,
422
- formatTimeValue: we,
423
- handlePanelSelect: Te,
424
- handleTimeSelect: Ie,
425
- openRangeTimePanel: xe,
426
- openRangeDatePanel: Ae,
427
- handlePanelCellMouseEnter: ze,
428
- handlePanelCellMouseLeave: Me,
429
- handleShortcut: Ne,
430
- handleToday: Re,
431
- handleConfirm: Oe,
432
- handleViewDateChange: je,
433
- handleRangeViewDateChange: Ye,
434
- handlePopupVisibleChange: Ee,
435
- handleClear: qe,
436
- handleInputChange: He,
437
- handleInputSubmit: ue,
438
- handleFocus: Ue,
439
- handleBlur: We,
440
- handleEsc: Qe,
441
- handleFocusedIndexChange: Ge,
442
- openPanel: Le,
443
- focus: Je,
444
- blur: Ke
468
+ viewDate: b,
469
+ mergedDisabledDate: Ie,
470
+ getDisabledTimeProps: Te,
471
+ formatTimeDate: xe,
472
+ formatTimeValue: Re,
473
+ handlePanelSelect: Ae,
474
+ handleTimeSelect: ze,
475
+ openRangeTimePanel: Ne,
476
+ openRangeDatePanel: Oe,
477
+ handlePanelCellMouseEnter: je,
478
+ handlePanelCellMouseLeave: Ee,
479
+ handleShortcut: Ye,
480
+ handleToday: Me,
481
+ handleConfirm: Le,
482
+ handleViewDateChange: qe,
483
+ handleRangeViewDateChange: He,
484
+ handlePopupVisibleChange: Ue,
485
+ handleClear: Xe,
486
+ handleInputChange: Ze,
487
+ handleInputSubmit: ne,
488
+ handleFocus: ea,
489
+ handleBlur: oe,
490
+ handleEsc: aa,
491
+ handleFocusedIndexChange: ta,
492
+ openPanel: Ke,
493
+ popupRef: ue,
494
+ panelId: We,
495
+ handlePanelKeydown: Qe,
496
+ handlePopupFocusout: Je,
497
+ focus: re,
498
+ blur: la
445
499
  };
446
500
  }
447
501
  });
448
502
  export {
449
- xa as default
503
+ Ya as default
450
504
  };