x-next 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -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 +3 -3
- package/dist/components/dropdown/DropdownButton.vue.d.ts +4 -4
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
- package/dist/components/dropdown/index.d.ts +22 -22
- 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/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-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 +67 -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 +154 -132
- 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 +75 -71
- 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 +99 -98
- 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.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,18 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDayjs as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useFormItem as
|
|
6
|
-
import { useLocale as
|
|
7
|
-
import { useSize as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
import { defineComponent as j, toRefs as x, computed as a, ref as A } from "vue";
|
|
2
|
+
import { isDayjs as E, isFunction as k } from "../../../_utils/is.js";
|
|
3
|
+
import O from "../../../icons/default/close-circle-fill.js";
|
|
4
|
+
import _ from "../icon-hover/index.vue.js";
|
|
5
|
+
import { useFormItem as D, useFormItemControl as T } from "../../../_hooks/use-form-item.js";
|
|
6
|
+
import { useLocale as w } from "../../../locale/index.js";
|
|
7
|
+
import { useSize as P } from "../../../_hooks/use-size.js";
|
|
8
|
+
import { INPUT_EVENTS as m } from "../../../_utils/constant.js";
|
|
9
|
+
import W from "../../../_utils/pick.js";
|
|
10
|
+
import { omit as q } from "../../../_utils/omit.js";
|
|
11
|
+
import H from "../feedback-icon/index.vue.js";
|
|
12
|
+
import { getClassNameMixin as K } from "../../../_utils/config.js";
|
|
13
|
+
const re = j({
|
|
11
14
|
name: "DateInput",
|
|
15
|
+
inheritAttrs: !1,
|
|
12
16
|
components: {
|
|
13
|
-
IconHover:
|
|
14
|
-
IconClose:
|
|
15
|
-
FeedbackIcon:
|
|
17
|
+
IconHover: _,
|
|
18
|
+
IconClose: O,
|
|
19
|
+
FeedbackIcon: H
|
|
16
20
|
},
|
|
17
21
|
props: {
|
|
18
22
|
size: {
|
|
@@ -55,48 +59,59 @@ const $ = C({
|
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
61
|
emits: ["clear", "press-enter", "change", "focus", "blur"],
|
|
58
|
-
setup(
|
|
59
|
-
const { t:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
setup(f, { emit: s, slots: c, attrs: i }) {
|
|
63
|
+
const { t: u } = w(), { error: p, focused: d, disabled: g, size: v, value: o, format: n, inputValue: t } = x(f), {
|
|
64
|
+
formItemCtx: b,
|
|
65
|
+
mergedSize: h,
|
|
66
|
+
mergedDisabled: l,
|
|
67
|
+
mergedError: I,
|
|
63
68
|
feedback: y
|
|
64
|
-
} =
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
} = D({ size: v, disabled: g, error: p }), { mergedSize: C } = P(h), S = a(() => q(i, [
|
|
70
|
+
...m,
|
|
71
|
+
...Object.keys(i).filter((e) => e.startsWith("aria-") || e === "role")
|
|
72
|
+
])), z = T(b, () => ({
|
|
73
|
+
...W(i, m),
|
|
74
|
+
...Object.fromEntries(
|
|
75
|
+
Object.entries(i).filter(([e]) => e.startsWith("aria-") || e === "role")
|
|
76
|
+
)
|
|
77
|
+
})), r = K("picker"), F = a(() => [
|
|
78
|
+
r.block,
|
|
79
|
+
r.modifier(`size-${C.value}`),
|
|
67
80
|
{
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
81
|
+
[r.modifier("focused")]: d.value,
|
|
82
|
+
[r.modifier("disabled")]: l.value,
|
|
83
|
+
[r.modifier("error")]: I.value,
|
|
84
|
+
[r.modifier("has-prefix")]: c.prefix
|
|
72
85
|
}
|
|
73
|
-
]),
|
|
86
|
+
]), N = a(() => {
|
|
74
87
|
if (t != null && t.value) return t == null ? void 0 : t.value;
|
|
75
|
-
if (o != null && o.value &&
|
|
88
|
+
if (o != null && o.value && E(o.value))
|
|
76
89
|
return k(n.value) ? n.value(o.value) : o.value.format(n.value);
|
|
77
|
-
}),
|
|
90
|
+
}), B = A();
|
|
78
91
|
return {
|
|
79
|
-
|
|
92
|
+
wrapperAttrs: S,
|
|
93
|
+
formControlAttrs: z,
|
|
94
|
+
t: u,
|
|
80
95
|
feedback: y,
|
|
81
|
-
className:
|
|
82
|
-
classNames:
|
|
83
|
-
displayValue:
|
|
84
|
-
mergedDisabled:
|
|
85
|
-
refInput:
|
|
96
|
+
className: r,
|
|
97
|
+
classNames: F,
|
|
98
|
+
displayValue: N,
|
|
99
|
+
mergedDisabled: l,
|
|
100
|
+
refInput: B,
|
|
86
101
|
onPressEnter() {
|
|
87
102
|
s("press-enter");
|
|
88
103
|
},
|
|
89
|
-
onChange(
|
|
90
|
-
s("change",
|
|
104
|
+
onChange(e) {
|
|
105
|
+
s("change", e);
|
|
91
106
|
},
|
|
92
|
-
onFocus(
|
|
93
|
-
s("focus",
|
|
107
|
+
onFocus(e) {
|
|
108
|
+
s("focus", e);
|
|
94
109
|
},
|
|
95
|
-
onClear(
|
|
96
|
-
s("clear",
|
|
110
|
+
onClear(e) {
|
|
111
|
+
s("clear", e);
|
|
97
112
|
},
|
|
98
|
-
onBlur(
|
|
99
|
-
s("blur",
|
|
113
|
+
onBlur(e) {
|
|
114
|
+
s("blur", e);
|
|
100
115
|
}
|
|
101
116
|
};
|
|
102
117
|
},
|
|
@@ -110,5 +125,5 @@ const $ = C({
|
|
|
110
125
|
}
|
|
111
126
|
});
|
|
112
127
|
export {
|
|
113
|
-
|
|
128
|
+
re as default
|
|
114
129
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isArray as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { InputTag as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useFormItem as
|
|
12
|
-
import { useLocale as
|
|
13
|
-
import { useSize as
|
|
14
|
-
import { getClassNameMixin as
|
|
15
|
-
const
|
|
1
|
+
import { defineComponent as L, toRefs as B, ref as H, computed as i, watch as M, createVNode as o, Fragment as P } from "vue";
|
|
2
|
+
import { isArray as q } from "../../../_utils/is.js";
|
|
3
|
+
import O from "../feedback-icon/index.vue.js";
|
|
4
|
+
import _ from "../input-label/input-label.js";
|
|
5
|
+
import { InputTag as $ } from "../../form-input-tag/index.js";
|
|
6
|
+
import G from "../icon-hover/index.vue.js";
|
|
7
|
+
import J from "../../../icons/_self/down.js";
|
|
8
|
+
import Q from "../../../icons/animation/animation-loading.js";
|
|
9
|
+
import U from "../../../icons/default/close.js";
|
|
10
|
+
import W from "../../../icons/_self/search.js";
|
|
11
|
+
import { useFormItem as X, useFormItemControl as Y } from "../../../_hooks/use-form-item.js";
|
|
12
|
+
import { useLocale as Z } from "../../../locale/index.js";
|
|
13
|
+
import { useSize as ee } from "../../../_hooks/use-size.js";
|
|
14
|
+
import { getClassNameMixin as le } from "../../../_utils/config.js";
|
|
15
|
+
const he = /* @__PURE__ */ L({
|
|
16
16
|
name: "SelectView",
|
|
17
17
|
props: {
|
|
18
18
|
modelValue: {
|
|
@@ -58,7 +58,7 @@ const pe = /* @__PURE__ */ E({
|
|
|
58
58
|
},
|
|
59
59
|
allowSearch: {
|
|
60
60
|
type: Boolean,
|
|
61
|
-
default: (e) =>
|
|
61
|
+
default: (e) => q(e.modelValue)
|
|
62
62
|
},
|
|
63
63
|
maxTagCount: {
|
|
64
64
|
type: Number,
|
|
@@ -87,67 +87,68 @@ const pe = /* @__PURE__ */ E({
|
|
|
87
87
|
slots: n
|
|
88
88
|
}) {
|
|
89
89
|
const {
|
|
90
|
-
size:
|
|
91
|
-
disabled:
|
|
92
|
-
error:
|
|
93
|
-
} =
|
|
90
|
+
size: S,
|
|
91
|
+
disabled: x,
|
|
92
|
+
error: F
|
|
93
|
+
} = B(e), u = le("select--view"), {
|
|
94
|
+
formItemCtx: R,
|
|
94
95
|
feedback: p,
|
|
95
96
|
eventHandlers: c,
|
|
96
97
|
mergedDisabled: g,
|
|
97
|
-
mergedSize:
|
|
98
|
+
mergedSize: z,
|
|
98
99
|
mergedError: b
|
|
99
|
-
} =
|
|
100
|
-
size:
|
|
101
|
-
disabled:
|
|
102
|
-
error:
|
|
103
|
-
}), {
|
|
104
|
-
t:
|
|
105
|
-
} =
|
|
106
|
-
mergedSize:
|
|
107
|
-
} =
|
|
108
|
-
opened:
|
|
109
|
-
} =
|
|
100
|
+
} = X({
|
|
101
|
+
size: S,
|
|
102
|
+
disabled: x,
|
|
103
|
+
error: F
|
|
104
|
+
}), h = Y(R, () => e.inputAttrs ?? {}), {
|
|
105
|
+
t: A
|
|
106
|
+
} = Z(), {
|
|
107
|
+
mergedSize: v
|
|
108
|
+
} = ee(z), {
|
|
109
|
+
opened: N
|
|
110
|
+
} = B(e), m = H(), d = i(
|
|
110
111
|
// @ts-ignore
|
|
111
112
|
() => {
|
|
112
113
|
var l;
|
|
113
|
-
return (l =
|
|
114
|
+
return (l = m.value) == null ? void 0 : l.inputRef;
|
|
114
115
|
}
|
|
115
|
-
),
|
|
116
|
+
), k = i(() => e.modelValue.length === 0), T = i(() => e.allowSearch || e.allowCreate), j = i(() => e.allowClear && !e.disabled && !k.value && e.modelValue.some((l) => l.closable !== !1)), f = (l) => {
|
|
116
117
|
var a, t;
|
|
117
118
|
r("focus", l), (t = (a = c.value) == null ? void 0 : a.onFocus) == null || t.call(a, l);
|
|
118
119
|
}, s = (l) => {
|
|
119
120
|
var a, t;
|
|
120
121
|
r("blur", l), (t = (a = c.value) == null ? void 0 : a.onBlur) == null || t.call(a, l);
|
|
121
|
-
},
|
|
122
|
+
}, D = (l) => {
|
|
122
123
|
r("remove", String(l));
|
|
123
|
-
},
|
|
124
|
+
}, E = (l) => {
|
|
124
125
|
l.stopPropagation(), r("clear", l);
|
|
125
|
-
},
|
|
126
|
-
var t,
|
|
127
|
-
r("inputValueChange", l, a), (
|
|
128
|
-
},
|
|
126
|
+
}, w = (l, a) => {
|
|
127
|
+
var t, I;
|
|
128
|
+
r("inputValueChange", l, a), (I = (t = c.value) == null ? void 0 : t.onInput) == null || I.call(t, a);
|
|
129
|
+
}, C = (l) => {
|
|
129
130
|
r("keydown", l);
|
|
130
|
-
},
|
|
131
|
+
}, K = () => {
|
|
131
132
|
var l, a;
|
|
132
|
-
return e.loading ? ((l = n["loading-icon"]) == null ? void 0 : l.call(n)) ?? o(
|
|
133
|
+
return e.loading ? ((l = n["loading-icon"]) == null ? void 0 : l.call(n)) ?? o(Q, null, null) : e.allowSearch && e.opened ? ((a = n["search-icon"]) == null ? void 0 : a.call(n)) ?? o(W, null, null) : n["arrow-icon"] ? n["arrow-icon"]() : o(J, {
|
|
133
134
|
class: u.element("arrow-icon")
|
|
134
135
|
}, null);
|
|
135
|
-
}, V = () => o(
|
|
136
|
+
}, V = () => o(P, null, [j.value && o(G, {
|
|
136
137
|
as: "button",
|
|
137
|
-
"aria-label":
|
|
138
|
+
"aria-label": A("common.clearTarget", {
|
|
138
139
|
target: "选择"
|
|
139
140
|
}),
|
|
140
141
|
class: u.element("clear-btn"),
|
|
141
|
-
onClick:
|
|
142
|
+
onClick: E,
|
|
142
143
|
onMousedown: (l) => l.stopPropagation()
|
|
143
144
|
}, {
|
|
144
|
-
default: () => [o(
|
|
145
|
+
default: () => [o(U, null, null)]
|
|
145
146
|
}), o("span", {
|
|
146
147
|
class: u.element("icon")
|
|
147
|
-
}, [
|
|
148
|
+
}, [K()]), !!p.value && o(O, {
|
|
148
149
|
type: p.value
|
|
149
150
|
}, null)]);
|
|
150
|
-
|
|
151
|
+
M(N, (l) => {
|
|
151
152
|
!l && d.value && d.value.isSameNode(document.activeElement) && d.value.blur();
|
|
152
153
|
});
|
|
153
154
|
const y = i(() => [u.modifier(`${e.multiple ? "multiple" : "single"}`), {
|
|
@@ -156,10 +157,10 @@ const pe = /* @__PURE__ */ E({
|
|
|
156
157
|
}]);
|
|
157
158
|
return {
|
|
158
159
|
inputRef: d,
|
|
159
|
-
handleFocus:
|
|
160
|
+
handleFocus: f,
|
|
160
161
|
handleBlur: s,
|
|
161
|
-
render: () => e.multiple ? o(
|
|
162
|
-
ref:
|
|
162
|
+
render: () => e.multiple ? o($, {
|
|
163
|
+
ref: m,
|
|
163
164
|
baseCls: u.block,
|
|
164
165
|
class: y.value,
|
|
165
166
|
modelValue: e.modelValue,
|
|
@@ -167,25 +168,25 @@ const pe = /* @__PURE__ */ E({
|
|
|
167
168
|
focused: e.opened,
|
|
168
169
|
placeholder: e.placeholder,
|
|
169
170
|
disabled: g.value,
|
|
170
|
-
size:
|
|
171
|
+
size: v.value,
|
|
171
172
|
error: b.value,
|
|
172
173
|
maxTagCount: e.maxTagCount,
|
|
173
174
|
disabledInput: !e.allowSearch && !e.allowCreate,
|
|
174
175
|
tagNowrap: e.tagNowrap,
|
|
175
176
|
retainInputValue: !0,
|
|
176
|
-
inputAttrs:
|
|
177
|
+
inputAttrs: h.value,
|
|
177
178
|
uninjectFormItemContext: !0,
|
|
178
|
-
onRemove:
|
|
179
|
-
onInputValueChange:
|
|
180
|
-
onKeydown:
|
|
181
|
-
onFocus:
|
|
179
|
+
onRemove: D,
|
|
180
|
+
onInputValueChange: w,
|
|
181
|
+
onKeydown: C,
|
|
182
|
+
onFocus: f,
|
|
182
183
|
onBlur: s
|
|
183
184
|
}, {
|
|
184
185
|
prefix: n.prefix,
|
|
185
186
|
suffix: V,
|
|
186
187
|
tag: n.label
|
|
187
|
-
}) : o(
|
|
188
|
-
ref:
|
|
188
|
+
}) : o(_, {
|
|
189
|
+
ref: m,
|
|
189
190
|
baseCls: u.block,
|
|
190
191
|
class: y.value,
|
|
191
192
|
modelValue: e.modelValue[0],
|
|
@@ -193,14 +194,14 @@ const pe = /* @__PURE__ */ E({
|
|
|
193
194
|
focused: e.opened,
|
|
194
195
|
placeholder: e.placeholder,
|
|
195
196
|
disabled: g.value,
|
|
196
|
-
size:
|
|
197
|
+
size: v.value,
|
|
197
198
|
error: b.value,
|
|
198
|
-
enabledInput:
|
|
199
|
-
inputAttrs:
|
|
199
|
+
enabledInput: T.value,
|
|
200
|
+
inputAttrs: h.value,
|
|
200
201
|
uninjectFormItemContext: !0,
|
|
201
|
-
onInputValueChange:
|
|
202
|
-
onKeydown:
|
|
203
|
-
onFocus:
|
|
202
|
+
onInputValueChange: w,
|
|
203
|
+
onKeydown: C,
|
|
204
|
+
onFocus: f,
|
|
204
205
|
onBlur: s
|
|
205
206
|
}, {
|
|
206
207
|
default: n.label,
|
|
@@ -222,5 +223,5 @@ const pe = /* @__PURE__ */ E({
|
|
|
222
223
|
}
|
|
223
224
|
});
|
|
224
225
|
export {
|
|
225
|
-
|
|
226
|
+
he as default
|
|
226
227
|
};
|
|
@@ -1,139 +1,147 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as s, createElementBlock as n, withKeys as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
function
|
|
1
|
+
import p from "./DatePanel.vue2.js";
|
|
2
|
+
import { openBlock as s, createElementBlock as n, withKeys as w, normalizeClass as l, createElementVNode as m, createCommentVNode as r, toDisplayString as i, Fragment as u, renderList as b, renderSlot as N, createTextVNode as v } from "vue";
|
|
3
|
+
import $ from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const g = ["aria-label"], C = ["aria-label"], f = ["aria-label"], P = ["aria-label"], h = { key: 0 }, L = ["title", "aria-label", "role", "tabindex", "disabled", "aria-selected", "onMouseenter", "onFocus", "onKeydown", "onClick"], S = ["onClick"];
|
|
5
|
+
function E(e, t, M, T, R, K) {
|
|
6
6
|
return s(), n("div", {
|
|
7
|
+
ref: "panelRef",
|
|
7
8
|
class: l([
|
|
8
9
|
e.className.element("panel"),
|
|
9
10
|
e.className.modifier(`mode-${e.mode}`),
|
|
10
11
|
{ [e.className.is("show-lunar")]: e.showLunar && e.mode === "date" }
|
|
11
12
|
]),
|
|
12
|
-
onKeydown: t[8] || (t[8] =
|
|
13
|
+
onKeydown: t[8] || (t[8] = w((o) => e.$emit("cancel"), ["esc"]))
|
|
13
14
|
}, [
|
|
14
|
-
|
|
15
|
-
class: l([
|
|
16
|
-
e.className.element("header"),
|
|
17
|
-
e.className.element(`header-${e.panelPosition}`)
|
|
18
|
-
])
|
|
15
|
+
m("div", {
|
|
16
|
+
class: l([e.className.element("header"), e.className.element(`header-${e.panelPosition}`)])
|
|
19
17
|
}, [
|
|
20
18
|
e.panelPosition !== "right" ? (s(), n("button", {
|
|
21
19
|
key: 0,
|
|
22
20
|
type: "button",
|
|
23
21
|
class: l(e.className.element("header-btn")),
|
|
24
22
|
"aria-label": e.t("datePicker.prevPage"),
|
|
25
|
-
onClick: t[0] || (t[0] = (
|
|
26
|
-
}, " « ", 10,
|
|
23
|
+
onClick: t[0] || (t[0] = (o) => e.movePanel(-1, !0))
|
|
24
|
+
}, " « ", 10, g)) : r("", !0),
|
|
27
25
|
e.panelPosition !== "right" ? (s(), n("button", {
|
|
28
26
|
key: 1,
|
|
29
27
|
type: "button",
|
|
30
28
|
class: l(e.className.element("header-btn")),
|
|
31
29
|
"aria-label": e.t("datePicker.prevItem"),
|
|
32
|
-
onClick: t[1] || (t[1] = (
|
|
33
|
-
}, " ‹ ", 10,
|
|
34
|
-
|
|
30
|
+
onClick: t[1] || (t[1] = (o) => e.movePanel(-1))
|
|
31
|
+
}, " ‹ ", 10, C)) : r("", !0),
|
|
32
|
+
m("button", {
|
|
35
33
|
type: "button",
|
|
36
34
|
class: l(e.className.element("header-label")),
|
|
37
|
-
onClick: t[2] || (t[2] = (...
|
|
38
|
-
},
|
|
35
|
+
onClick: t[2] || (t[2] = (...o) => e.zoomHeader && e.zoomHeader(...o))
|
|
36
|
+
}, i(e.headerLabel), 3),
|
|
39
37
|
e.panelPosition !== "left" ? (s(), n("button", {
|
|
40
38
|
key: 2,
|
|
41
39
|
type: "button",
|
|
42
40
|
class: l(e.className.element("header-btn")),
|
|
43
41
|
"aria-label": e.t("datePicker.nextItem"),
|
|
44
|
-
onClick: t[3] || (t[3] = (
|
|
45
|
-
}, " › ", 10,
|
|
42
|
+
onClick: t[3] || (t[3] = (o) => e.movePanel(1))
|
|
43
|
+
}, " › ", 10, f)) : r("", !0),
|
|
46
44
|
e.panelPosition !== "left" ? (s(), n("button", {
|
|
47
45
|
key: 3,
|
|
48
46
|
type: "button",
|
|
49
47
|
class: l(e.className.element("header-btn")),
|
|
50
48
|
"aria-label": e.t("datePicker.nextPage"),
|
|
51
|
-
onClick: t[4] || (t[4] = (
|
|
52
|
-
}, " » ", 10,
|
|
49
|
+
onClick: t[4] || (t[4] = (o) => e.movePanel(1, !0))
|
|
50
|
+
}, " » ", 10, P)) : r("", !0)
|
|
53
51
|
], 2),
|
|
54
52
|
e.mode === "date" || e.mode === "week" ? (s(), n("div", {
|
|
55
53
|
key: 0,
|
|
56
|
-
class: l([
|
|
57
|
-
e.className.element("weekdays"),
|
|
58
|
-
{ [e.className.is("week-mode")]: e.mode === "week" }
|
|
59
|
-
])
|
|
54
|
+
class: l([e.className.element("weekdays"), { [e.className.is("week-mode")]: e.mode === "week" }])
|
|
60
55
|
}, [
|
|
61
|
-
e.mode === "week" ? (s(), n("span",
|
|
62
|
-
(s(!0), n(
|
|
63
|
-
], 2)) :
|
|
64
|
-
|
|
65
|
-
class: l([
|
|
66
|
-
e.className.element("body"),
|
|
67
|
-
e.className.element(`body-${e.mode}`)
|
|
68
|
-
]),
|
|
56
|
+
e.mode === "week" ? (s(), n("span", h, i(e.t("datePicker.weekColumn")), 1)) : r("", !0),
|
|
57
|
+
(s(!0), n(u, null, b(e.weekdayLabels, (o) => (s(), n("span", { key: o }, i(o), 1))), 128))
|
|
58
|
+
], 2)) : r("", !0),
|
|
59
|
+
m("div", {
|
|
60
|
+
class: l([e.className.element("body"), e.className.element(`body-${e.mode}`)]),
|
|
69
61
|
role: "grid"
|
|
70
62
|
}, [
|
|
71
|
-
(s(!0), n(
|
|
72
|
-
key:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
disabled: a.isWeekLabel || a.disabled || !a.inView,
|
|
76
|
-
"aria-selected": !a.isWeekLabel && (a.selected || a.rangeStart || a.rangeEnd),
|
|
77
|
-
onMouseenter: (m) => e.handleCellMouseEnter(a),
|
|
78
|
-
onMouseleave: t[5] || (t[5] = (...m) => e.handleCellMouseLeave && e.handleCellMouseLeave(...m)),
|
|
79
|
-
class: l([
|
|
80
|
-
e.className.element("cell"),
|
|
81
|
-
{
|
|
82
|
-
[e.className.is("out-view")]: a.outView,
|
|
83
|
-
[e.className.is("today")]: a.today,
|
|
84
|
-
[e.className.is("selected")]: a.selected,
|
|
85
|
-
[e.className.is("range-start")]: a.rangeStart,
|
|
86
|
-
[e.className.is("range-end")]: a.rangeEnd,
|
|
87
|
-
[e.className.is("in-range")]: a.inRange,
|
|
88
|
-
[e.className.is("preview-range-start")]: a.previewRangeStart,
|
|
89
|
-
[e.className.is("preview-range-end")]: a.previewRangeEnd,
|
|
90
|
-
[e.className.is("in-preview-range")]: a.inPreviewRange,
|
|
91
|
-
[e.className.is("disabled")]: a.disabled,
|
|
92
|
-
[e.className.is("week-label")]: a.isWeekLabel,
|
|
93
|
-
[e.className.is("week-start")]: a.weekStart,
|
|
94
|
-
[e.className.is("week-end")]: a.weekEnd,
|
|
95
|
-
[e.className.is("week-selected")]: a.weekSelected
|
|
96
|
-
}
|
|
97
|
-
]),
|
|
98
|
-
onClick: (m) => e.handleSelect(a)
|
|
63
|
+
(s(!0), n(u, null, b(e.cellRows, (o, k) => (s(), n("div", {
|
|
64
|
+
key: k,
|
|
65
|
+
role: "row",
|
|
66
|
+
class: l(e.className.element("row"))
|
|
99
67
|
}, [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
68
|
+
(s(!0), n(u, null, b(o, (a) => {
|
|
69
|
+
var y;
|
|
70
|
+
return s(), n("button", {
|
|
71
|
+
key: a.title,
|
|
72
|
+
type: "button",
|
|
73
|
+
title: a.title,
|
|
74
|
+
"aria-label": a.title,
|
|
75
|
+
role: a.isWeekLabel ? "rowheader" : "gridcell",
|
|
76
|
+
tabindex: a.title === ((y = e.activeCell) == null ? void 0 : y.title) ? 0 : -1,
|
|
77
|
+
disabled: a.isWeekLabel || a.disabled || !a.inView,
|
|
78
|
+
"aria-selected": !a.isWeekLabel && (a.selected || a.rangeStart || a.rangeEnd),
|
|
79
|
+
onMouseenter: (d) => e.handleCellMouseEnter(a),
|
|
80
|
+
onMouseleave: t[5] || (t[5] = (...d) => e.handleCellMouseLeave && e.handleCellMouseLeave(...d)),
|
|
81
|
+
onFocus: (d) => {
|
|
82
|
+
e.activeTitle = a.title, e.handleCellMouseEnter(a);
|
|
83
|
+
},
|
|
84
|
+
onKeydown: (d) => e.handleCellKeydown(d, a),
|
|
85
|
+
class: l([
|
|
86
|
+
e.className.element("cell"),
|
|
87
|
+
{
|
|
88
|
+
[e.className.is("out-view")]: a.outView,
|
|
89
|
+
[e.className.is("today")]: a.today,
|
|
90
|
+
[e.className.is("selected")]: a.selected,
|
|
91
|
+
[e.className.is("range-start")]: a.rangeStart,
|
|
92
|
+
[e.className.is("range-end")]: a.rangeEnd,
|
|
93
|
+
[e.className.is("in-range")]: a.inRange,
|
|
94
|
+
[e.className.is("preview-range-start")]: a.previewRangeStart,
|
|
95
|
+
[e.className.is("preview-range-end")]: a.previewRangeEnd,
|
|
96
|
+
[e.className.is("in-preview-range")]: a.inPreviewRange,
|
|
97
|
+
[e.className.is("disabled")]: a.disabled,
|
|
98
|
+
[e.className.is("week-label")]: a.isWeekLabel,
|
|
99
|
+
[e.className.is("week-start")]: a.weekStart,
|
|
100
|
+
[e.className.is("week-end")]: a.weekEnd,
|
|
101
|
+
[e.className.is("week-selected")]: a.weekSelected
|
|
102
|
+
}
|
|
103
|
+
]),
|
|
104
|
+
onClick: (d) => e.handleSelect(a)
|
|
105
105
|
}, [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
m("span", {
|
|
107
|
+
class: l(e.className.element("cell-date"))
|
|
108
|
+
}, [
|
|
109
|
+
m("span", {
|
|
110
|
+
class: l(e.className.element("cell-inner"))
|
|
111
|
+
}, [
|
|
112
|
+
N(e.$slots, "cell", {
|
|
113
|
+
date: a.value.toDate(),
|
|
114
|
+
label: a.label
|
|
115
|
+
}, () => [
|
|
116
|
+
v(i(a.label), 1)
|
|
117
|
+
])
|
|
118
|
+
], 2)
|
|
119
|
+
], 2),
|
|
120
|
+
a.lunar && !e.$slots.cell ? (s(), n("span", {
|
|
121
|
+
key: 0,
|
|
122
|
+
class: l(e.className.element("cell-lunar"))
|
|
123
|
+
}, i(a.lunar.displayText), 3)) : r("", !0)
|
|
124
|
+
], 42, L);
|
|
125
|
+
}), 128))
|
|
126
|
+
], 2))), 128))
|
|
119
127
|
], 2),
|
|
120
128
|
e.shortcuts.length || e.$slots.extra ? (s(), n("div", {
|
|
121
129
|
key: 1,
|
|
122
130
|
class: l(e.className.element("shortcuts"))
|
|
123
131
|
}, [
|
|
124
|
-
(s(!0), n(
|
|
125
|
-
key: String(
|
|
132
|
+
(s(!0), n(u, null, b(e.shortcuts, (o) => (s(), n("button", {
|
|
133
|
+
key: String(o.label),
|
|
126
134
|
type: "button",
|
|
127
135
|
class: l(e.className.element("shortcut")),
|
|
128
|
-
onClick: (
|
|
129
|
-
},
|
|
136
|
+
onClick: (k) => e.$emit("shortcut", o)
|
|
137
|
+
}, i(o.label), 11, S))), 128)),
|
|
130
138
|
e.$slots.extra ? (s(), n("div", {
|
|
131
139
|
key: 0,
|
|
132
140
|
class: l(e.className.element("extra"))
|
|
133
141
|
}, [
|
|
134
|
-
|
|
135
|
-
], 2)) :
|
|
136
|
-
], 2)) :
|
|
142
|
+
N(e.$slots, "extra")
|
|
143
|
+
], 2)) : r("", !0)
|
|
144
|
+
], 2)) : r("", !0),
|
|
137
145
|
e.showToday || e.showConfirmBtn ? (s(), n("div", {
|
|
138
146
|
key: 2,
|
|
139
147
|
class: l(e.className.element("footer"))
|
|
@@ -142,18 +150,18 @@ function h(e, t, L, S, E, M) {
|
|
|
142
150
|
key: 0,
|
|
143
151
|
type: "button",
|
|
144
152
|
class: l([e.className.element("footer-btn"), e.className.element("today")]),
|
|
145
|
-
onClick: t[6] || (t[6] = (...
|
|
146
|
-
},
|
|
153
|
+
onClick: t[6] || (t[6] = (...o) => e.selectToday && e.selectToday(...o))
|
|
154
|
+
}, i(e.todayLabel), 3)) : r("", !0),
|
|
147
155
|
e.showConfirmBtn ? (s(), n("button", {
|
|
148
156
|
key: 1,
|
|
149
157
|
type: "button",
|
|
150
158
|
class: l([e.className.element("footer-btn"), e.className.element("confirm")]),
|
|
151
|
-
onClick: t[7] || (t[7] = (
|
|
152
|
-
},
|
|
153
|
-
], 2)) :
|
|
159
|
+
onClick: t[7] || (t[7] = (o) => e.$emit("confirm"))
|
|
160
|
+
}, i(e.t("datePicker.ok")), 3)) : r("", !0)
|
|
161
|
+
], 2)) : r("", !0)
|
|
154
162
|
], 34);
|
|
155
163
|
}
|
|
156
|
-
const
|
|
164
|
+
const z = /* @__PURE__ */ $(p, [["render", E]]);
|
|
157
165
|
export {
|
|
158
|
-
|
|
166
|
+
z as default
|
|
159
167
|
};
|