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