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.
- package/CHANGELOG.md +38 -0
- package/dist/_hooks/use-form-item.d.ts +5 -0
- package/dist/_hooks/use-picker-focus.d.ts +17 -0
- package/dist/components/_components/feedback-icon/index.vue.d.ts +4 -4
- package/dist/components/_components/picker/input-range.vue.d.ts +10 -6
- package/dist/components/_components/picker/input.vue.d.ts +9 -5
- package/dist/components/alert/Alert.vue.d.ts +5 -5
- package/dist/components/alert/index.d.ts +10 -10
- package/dist/components/date-picker/DatePanel.vue.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +36 -16
- package/dist/components/date-picker/index.d.ts +77 -33
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/index.d.ts +3 -3
- package/dist/components/drawer/index.d.ts +3 -3
- package/dist/components/drawer/src/Drawer.vue.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.vue.d.ts +30 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +31 -5
- package/dist/components/dropdown/DropdownOption.vue.d.ts +2 -0
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +162 -5
- package/dist/components/dropdown/context.d.ts +14 -1
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +7 -1
- package/dist/components/dropdown/index.d.ts +610 -28
- package/dist/components/dropdown/use-keyboard.d.ts +10 -0
- package/dist/components/form/FormItem.vue.d.ts +12 -4
- package/dist/components/form/context.d.ts +6 -0
- package/dist/components/form/form-item-label.vue.d.ts +4 -4
- package/dist/components/form/form-item-message.vue.d.ts +2 -0
- package/dist/components/form/index.d.ts +30 -8
- package/dist/components/form/interface.d.ts +2 -2
- package/dist/components/form-input/InputPassword.vue.d.ts +20 -2
- package/dist/components/form-input/index.d.ts +22 -4
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/hooks/use-select.d.ts +2 -1
- package/dist/components/form-select/index.d.ts +6 -6
- package/dist/components/form-slider/Slider.vue.d.ts +10 -3
- package/dist/components/form-slider/index.d.ts +26 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +4 -3
- package/dist/components/form-switch/Switch.vue.d.ts +2 -1
- package/dist/components/form-switch/index.d.ts +5 -2
- package/dist/components/form-textarea/Textarea.vue.d.ts +2 -2
- package/dist/components/form-textarea/index.d.ts +5 -5
- package/dist/components/image/Image.vue.d.ts +10 -9
- package/dist/components/image/ImagePreview.vue.d.ts +8 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +8 -7
- package/dist/components/image/index.d.ts +59 -52
- package/dist/components/image/preview-arrow.vue.d.ts +2 -2
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/layout/LayoutSidebar.vue.d.ts +2 -2
- package/dist/components/layout/index.d.ts +4 -4
- package/dist/components/link/Link.vue.d.ts +2 -2
- package/dist/components/link/index.d.ts +4 -4
- package/dist/components/menu/Menu.d.ts +2 -2
- package/dist/components/menu/base-menu.vue.d.ts +2 -2
- package/dist/components/menu/index.d.ts +4 -4
- package/dist/components/menu/sub-menu-pop.vue.d.ts +5 -5
- package/dist/components/message/index.d.ts +17 -17
- package/dist/components/message/message.vue.d.ts +8 -8
- package/dist/components/notification/Notification.d.ts +1 -1
- package/dist/components/notification/index.d.ts +3 -3
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +1 -1
- package/dist/components/pagination/page-item-step.vue.d.ts +2 -2
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popconfirm/src/popup.vue.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/progress/Progress.vue.d.ts +4 -4
- package/dist/components/progress/circle.vue.d.ts +2 -2
- package/dist/components/progress/index.d.ts +8 -8
- package/dist/components/progress/line.vue.d.ts +1 -1
- package/dist/components/progress/steps.vue.d.ts +1 -1
- package/dist/components/steps/Step.vue.d.ts +2 -2
- package/dist/components/steps/index.d.ts +4 -4
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/tabs/tabs-tab.vue.d.ts +1 -1
- package/dist/components/tag/Tag.vue.d.ts +2 -2
- package/dist/components/tag/index.d.ts +4 -4
- package/dist/components/time-picker/TimeColumn.vue.d.ts +3 -0
- package/dist/components/time-picker/TimePanel.vue.d.ts +3 -0
- package/dist/components/time-picker/TimePicker.vue.d.ts +33 -17
- package/dist/components/time-picker/index.d.ts +73 -36
- package/dist/components/time-range-selector/TimeRangeSelector.vue.d.ts +8 -0
- package/dist/components/time-range-selector/index.d.ts +22 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/es/_hooks/use-form-item.js +36 -10
- package/dist/es/_hooks/use-overflow.js +45 -40
- package/dist/es/_hooks/use-picker-focus.js +57 -0
- package/dist/es/_utils/constant.js +17 -5
- package/dist/es/components/_components/picker/input-range.vue.js +45 -55
- package/dist/es/components/_components/picker/input-range.vue2.js +105 -70
- package/dist/es/components/_components/picker/input.vue.js +22 -25
- package/dist/es/components/_components/picker/input.vue2.js +58 -43
- package/dist/es/components/_components/select-view/select-view.js +61 -66
- package/dist/es/components/date-picker/DatePanel.vue.js +102 -94
- package/dist/es/components/date-picker/DatePanel.vue2.js +97 -44
- package/dist/es/components/date-picker/DatePicker.vue.js +71 -58
- package/dist/es/components/date-picker/DatePicker.vue2.js +285 -231
- package/dist/es/components/dialog/Dialog.js +159 -128
- package/dist/es/components/dropdown/Dropdown.vue.js +18 -15
- package/dist/es/components/dropdown/Dropdown.vue2.js +52 -31
- package/dist/es/components/dropdown/DropdownOption.vue.js +22 -21
- package/dist/es/components/dropdown/DropdownOption.vue2.js +23 -19
- package/dist/es/components/dropdown/DropdownSubmenu.vue.js +49 -36
- package/dist/es/components/dropdown/DropdownSubmenu.vue2.js +45 -24
- package/dist/es/components/dropdown/context.js +3 -2
- package/dist/es/components/dropdown/dropdown-panel.vue.js +24 -21
- package/dist/es/components/dropdown/dropdown-panel.vue2.js +83 -31
- package/dist/es/components/dropdown/use-keyboard.js +45 -0
- package/dist/es/components/form/Form.vue2.js +113 -101
- package/dist/es/components/form/FormItem.vue.js +26 -22
- package/dist/es/components/form/FormItem.vue2.js +162 -125
- package/dist/es/components/form/form-item-message.vue.js +31 -24
- package/dist/es/components/form/form-item-message.vue2.js +4 -2
- package/dist/es/components/form-checkbox/Checkbox.js +80 -76
- package/dist/es/components/form-checkbox/CheckboxGroup.js +43 -38
- package/dist/es/components/form-input/Input.js +83 -79
- package/dist/es/components/form-input/InputPassword.vue.js +19 -16
- package/dist/es/components/form-input/InputPassword.vue2.js +39 -29
- package/dist/es/components/form-input/InputSearch.js +47 -37
- package/dist/es/components/form-input-number/InputNumber.js +134 -133
- package/dist/es/components/form-input-tag/InputTag.js +173 -162
- package/dist/es/components/form-radio/Radio.js +74 -71
- package/dist/es/components/form-radio/RadioGroup.js +55 -49
- package/dist/es/components/form-select/Select.js +116 -114
- package/dist/es/components/form-select/hooks/use-select.js +128 -128
- package/dist/es/components/form-slider/Slider.vue.js +28 -28
- package/dist/es/components/form-slider/Slider.vue2.js +139 -132
- package/dist/es/components/form-slider/slider-button.vue.js +6 -6
- package/dist/es/components/form-slider/slider-button.vue2.js +39 -34
- package/dist/es/components/form-switch/Switch.vue.js +9 -9
- package/dist/es/components/form-switch/Switch.vue2.js +81 -74
- package/dist/es/components/form-textarea/Textarea.vue2.js +123 -108
- package/dist/es/components/image/Image.vue2.js +77 -76
- package/dist/es/components/image/ImagePreview.vue.js +13 -12
- package/dist/es/components/image/ImagePreview.vue2.js +141 -136
- package/dist/es/components/image/ImagePreviewGroup.vue.js +1 -1
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +82 -83
- package/dist/es/components/rate/Rate.js +106 -103
- package/dist/es/components/time-picker/TimeColumn.vue.js +34 -23
- package/dist/es/components/time-picker/TimeColumn.vue2.js +37 -28
- package/dist/es/components/time-picker/TimePicker.vue.js +83 -64
- package/dist/es/components/time-picker/TimePicker.vue2.js +192 -156
- package/dist/es/components/time-range-selector/TimeRangeSelector.vue.js +327 -193
- package/dist/es/locale/en-US.js +6 -0
- package/dist/es/locale/zh-CN.js +6 -0
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/down.d.ts +1 -1
- package/dist/icons/_self/dropdown/more.d.ts +1 -1
- package/dist/icons/_self/empty-better.d.ts +1 -1
- package/dist/icons/_self/empty.d.ts +1 -1
- package/dist/icons/_self/eye-invisible.d.ts +1 -1
- package/dist/icons/_self/eye.d.ts +1 -1
- package/dist/icons/_self/full-screen.d.ts +1 -1
- package/dist/icons/_self/left.d.ts +1 -1
- package/dist/icons/_self/menu/down.d.ts +1 -1
- package/dist/icons/_self/minus.d.ts +1 -1
- package/dist/icons/_self/more-dot.d.ts +1 -1
- package/dist/icons/_self/next.d.ts +1 -1
- package/dist/icons/_self/original-size.d.ts +1 -1
- package/dist/icons/_self/plus.d.ts +1 -1
- package/dist/icons/_self/prev.d.ts +1 -1
- package/dist/icons/_self/question-message.d.ts +1 -1
- package/dist/icons/_self/right.d.ts +1 -1
- package/dist/icons/_self/rotate-left.d.ts +1 -1
- package/dist/icons/_self/rotate-right.d.ts +1 -1
- package/dist/icons/_self/search.d.ts +1 -1
- package/dist/icons/_self/up.d.ts +1 -1
- package/dist/icons/_self/zoom-in.d.ts +1 -1
- package/dist/icons/_self/zoom-out.d.ts +1 -1
- package/dist/icons/_ui/alone-left.d.ts +1 -1
- package/dist/icons/_ui/alone-margin-left.d.ts +1 -1
- package/dist/icons/_ui/alone-margin-right.d.ts +1 -1
- package/dist/icons/_ui/alone-right.d.ts +1 -1
- package/dist/icons/_ui/calendar.d.ts +1 -1
- package/dist/icons/_ui/time.d.ts +1 -1
- package/dist/icons/animation/animation-loading.d.ts +1 -1
- package/dist/icons/default/check-circle-fill.d.ts +1 -1
- package/dist/icons/default/check.d.ts +1 -1
- package/dist/icons/default/close-circle-fill.d.ts +1 -1
- package/dist/icons/default/close.d.ts +1 -1
- package/dist/icons/default/exclamation-circle-fill.d.ts +1 -1
- package/dist/icons/default/exclamation.d.ts +1 -1
- package/dist/icons/default/filter.d.ts +1 -1
- package/dist/icons/default/info-circle-fill.d.ts +1 -1
- package/dist/icons/default/link.d.ts +1 -1
- package/dist/icons/default/logo-simple.d.ts +1 -1
- package/dist/icons/default/minus-circle-fill.d.ts +1 -1
- package/dist/icons/icon.d.ts +2 -2
- package/dist/icons/index.d.ts +3 -3
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +6 -0
- package/dist/style/base.css +1 -1
- package/dist/style/date-picker.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/time-range-selector.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { dayjs as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { Trigger as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getClassNameMixin as
|
|
9
|
-
import { omit as
|
|
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
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
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:
|
|
20
|
-
DateInput:
|
|
21
|
-
DateRangeInput:
|
|
22
|
-
DatePanel:
|
|
23
|
-
TimePanel:
|
|
24
|
-
IconCalendar:
|
|
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,
|
|
157
|
-
select: (t,
|
|
158
|
-
"calendar-change": (t,
|
|
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,
|
|
161
|
+
ok: (t, c, S) => !0,
|
|
161
162
|
"popup-visible-change": (t) => !0,
|
|
162
|
-
"picker-value-change": (t,
|
|
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:
|
|
168
|
-
const S =
|
|
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
|
-
),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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 ?
|
|
183
|
-
return
|
|
184
|
-
}),
|
|
185
|
-
|
|
186
|
-
),
|
|
187
|
-
() =>
|
|
188
|
-
),
|
|
189
|
-
|
|
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 ?
|
|
192
|
-
}),
|
|
193
|
-
if (!
|
|
194
|
-
const e =
|
|
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
|
-
}),
|
|
205
|
+
}), be = n(
|
|
197
206
|
() => i(m.value) ? void 0 : m.value
|
|
198
|
-
),
|
|
207
|
+
), ke = n(
|
|
199
208
|
() => i(m.value) ? m.value : []
|
|
200
|
-
),
|
|
201
|
-
() => typeof
|
|
202
|
-
),
|
|
203
|
-
() => i(
|
|
204
|
-
),
|
|
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
|
-
}),
|
|
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 =
|
|
218
|
-
return ((l = t.disabledDate) == null ? void 0 : l.call(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
}),
|
|
229
|
-
const a =
|
|
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
|
-
},
|
|
232
|
-
const u = i(
|
|
233
|
-
return
|
|
234
|
-
},
|
|
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
|
-
},
|
|
238
|
-
t.modelValue === void 0 && (
|
|
239
|
-
},
|
|
240
|
-
t.pickerValue === void 0 && (
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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(
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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(
|
|
253
|
-
|
|
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 (!
|
|
256
|
-
const a =
|
|
257
|
-
return 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,
|
|
260
|
-
const l = i(e) ?
|
|
261
|
-
|
|
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), (
|
|
269
|
-
},
|
|
270
|
-
const a =
|
|
271
|
-
if (
|
|
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] ||
|
|
274
|
-
l[0] = a, l[1] = void 0,
|
|
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 =
|
|
279
|
-
y.value = void 0,
|
|
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
|
-
|
|
284
|
-
},
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
287
|
-
|
|
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 ||
|
|
291
|
-
|
|
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
|
-
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
-
|
|
312
|
-
const a =
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
|
|
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
|
-
|
|
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),
|
|
326
|
-
},
|
|
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 (
|
|
330
|
-
const
|
|
331
|
-
|
|
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
|
-
|
|
334
|
-
(u = (l =
|
|
335
|
-
},
|
|
336
|
-
if (
|
|
337
|
-
const e = i(
|
|
338
|
-
l && (a[
|
|
339
|
-
} else if (typeof
|
|
340
|
-
const e =
|
|
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 =
|
|
343
|
-
|
|
386
|
+
const a = R(e, g.value);
|
|
387
|
+
r.value = a, _(a);
|
|
344
388
|
}
|
|
345
389
|
}
|
|
346
|
-
|
|
347
|
-
},
|
|
390
|
+
v.value = void 0, y.value = void 0;
|
|
391
|
+
}, ea = (e) => {
|
|
348
392
|
var a, l;
|
|
349
|
-
|
|
350
|
-
},
|
|
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
|
-
|
|
353
|
-
},
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
|
|
357
|
-
},
|
|
358
|
-
|
|
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 =
|
|
404
|
+
(a = (e = B.value) == null ? void 0 : e.focus) == null || a.call(e, d.value ? s.value : void 0);
|
|
361
405
|
});
|
|
362
|
-
},
|
|
406
|
+
}, la = () => {
|
|
363
407
|
var e, a;
|
|
364
|
-
(a = (e =
|
|
408
|
+
(a = (e = B.value) == null ? void 0 : e.blur) == null || a.call(e);
|
|
365
409
|
};
|
|
366
|
-
return
|
|
367
|
-
() =>
|
|
410
|
+
return O(
|
|
411
|
+
() => I.value,
|
|
368
412
|
(e) => {
|
|
369
|
-
e && (ae(),
|
|
413
|
+
e && (ae(), v.value = void 0, y.value = void 0, F.value = "date");
|
|
370
414
|
}
|
|
371
|
-
),
|
|
415
|
+
), O(
|
|
372
416
|
() => [t.modelValue, t.type, t.format, t.valueFormat],
|
|
373
417
|
() => {
|
|
374
|
-
|
|
418
|
+
r.value = i(m.value) ? [...m.value] : m.value, v.value = void 0, y.value = void 0, F.value = "date";
|
|
375
419
|
}
|
|
376
|
-
),
|
|
377
|
-
() => [
|
|
420
|
+
), O(
|
|
421
|
+
() => [
|
|
422
|
+
t.pickerValue,
|
|
423
|
+
t.defaultPickerValue,
|
|
424
|
+
t.type,
|
|
425
|
+
t.format,
|
|
426
|
+
t.valueFormat
|
|
427
|
+
],
|
|
378
428
|
() => {
|
|
379
|
-
|
|
429
|
+
b.value = N(H.value) || N(r.value);
|
|
380
430
|
}
|
|
381
|
-
),
|
|
431
|
+
), O(
|
|
382
432
|
() => m.value,
|
|
383
433
|
() => {
|
|
384
|
-
|
|
434
|
+
I.value || ae();
|
|
385
435
|
}
|
|
386
436
|
), {
|
|
387
437
|
t: h,
|
|
388
438
|
attrs: S,
|
|
389
|
-
className:
|
|
390
|
-
inputRef:
|
|
391
|
-
inputAttrs:
|
|
392
|
-
isRange:
|
|
439
|
+
className: se,
|
|
440
|
+
inputRef: B,
|
|
441
|
+
inputAttrs: Ce,
|
|
442
|
+
isRange: d,
|
|
393
443
|
mode: g,
|
|
394
|
-
isDateTime:
|
|
395
|
-
needConfirm:
|
|
396
|
-
timeFormat:
|
|
397
|
-
timePickerProps:
|
|
398
|
-
focused:
|
|
399
|
-
focusedIndex:
|
|
400
|
-
mergedSize:
|
|
401
|
-
mergedError:
|
|
402
|
-
allDisabled:
|
|
403
|
-
rangeDisabled:
|
|
404
|
-
mergedInputReadonly:
|
|
405
|
-
mergedPopupVisible:
|
|
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:
|
|
408
|
-
rangeInputValue:
|
|
409
|
-
singleInputText:
|
|
410
|
-
rangeInputText:
|
|
411
|
-
singlePlaceholder:
|
|
412
|
-
rangePlaceholder:
|
|
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:
|
|
416
|
-
rangeViewDates:
|
|
465
|
+
previewRangeValue: Pe,
|
|
466
|
+
rangeViewDates: pe,
|
|
417
467
|
rangePanelMode: F,
|
|
418
|
-
viewDate:
|
|
419
|
-
mergedDisabledDate:
|
|
420
|
-
getDisabledTimeProps:
|
|
421
|
-
formatTimeDate:
|
|
422
|
-
formatTimeValue:
|
|
423
|
-
handlePanelSelect:
|
|
424
|
-
handleTimeSelect:
|
|
425
|
-
openRangeTimePanel:
|
|
426
|
-
openRangeDatePanel:
|
|
427
|
-
handlePanelCellMouseEnter:
|
|
428
|
-
handlePanelCellMouseLeave:
|
|
429
|
-
handleShortcut:
|
|
430
|
-
handleToday:
|
|
431
|
-
handleConfirm:
|
|
432
|
-
handleViewDateChange:
|
|
433
|
-
handleRangeViewDateChange:
|
|
434
|
-
handlePopupVisibleChange:
|
|
435
|
-
handleClear:
|
|
436
|
-
handleInputChange:
|
|
437
|
-
handleInputSubmit:
|
|
438
|
-
handleFocus:
|
|
439
|
-
handleBlur:
|
|
440
|
-
handleEsc:
|
|
441
|
-
handleFocusedIndexChange:
|
|
442
|
-
openPanel:
|
|
443
|
-
|
|
444
|
-
|
|
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
|
-
|
|
503
|
+
Ya as default
|
|
450
504
|
};
|