vft 0.0.511 → 0.0.514
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/dist/index.css +1 -1
- package/es/components/cascader/cascader.vue2.js +202 -203
- package/es/components/cascader-panel/menu.vue2.js +49 -50
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
- package/es/components/color-picker/color-picker.vue2.js +133 -134
- package/es/components/config-provider/config-provider.vue.d.ts +0 -2
- package/es/components/config-provider/config-provider.vue2.js +4 -5
- package/es/components/config-provider/constants.d.ts +0 -1
- package/es/components/config-provider/constants.js +2 -3
- package/es/components/config-provider/hooks/use-global-config.js +30 -33
- package/es/components/config-provider/index.d.ts +0 -9
- package/es/components/config-provider/index.js +5 -6
- package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
- package/es/components/date-picker/composables/use-month-range-header.js +14 -15
- package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
- package/es/components/date-time-select/date-time-select.vue2.js +36 -39
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue2.js +67 -68
- package/es/components/dropdown/index.d.ts +33 -33
- package/es/components/empty/empty.vue2.js +38 -39
- package/es/components/full-screen/full-screen.vue2.js +17 -18
- package/es/components/image/image.vue2.js +59 -60
- package/es/components/image-viewer/image-viewer.vue2.js +44 -45
- package/es/components/index.js +97 -98
- package/es/components/md-container/md-container.vue2.js +74 -75
- package/es/components/md-container/toc.js +36 -37
- package/es/components/message-box/message-box.vue2.js +3 -3
- package/es/components/message-box/method.js +47 -48
- package/es/components/modal/modal-footer-action.vue2.js +24 -25
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
- package/es/components/popconfirm/popconfirm.vue2.js +39 -40
- package/es/components/search/search.vue2.js +50 -51
- package/es/components/select/useSelect.js +231 -232
- package/es/components/super-form/super-form-item.vue2.js +66 -66
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
- package/es/components/transfer/transfer-panel.vue2.js +56 -57
- package/es/components/transfer/transfer.vue2.js +69 -70
- package/es/components/tree/tree.vue2.js +59 -60
- package/es/components/upload/upload-content.vue2.js +49 -50
- package/es/components/upload/upload-list.vue2.js +45 -46
- package/es/components/upload/upload.vue2.js +99 -100
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -5
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +0 -1
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +0 -9
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.d.ts +33 -33
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/message-box/message-box.vue2.cjs +1 -1
- package/lib/components/message-box/method.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +3 -3
- package/theme-style/index.css +1 -1
- package/theme-style/src/image-viewer.scss +12 -0
- package/theme-style/src/message-box.scss +2 -2
- package/theme-style/src/table.scss +6 -0
- package/theme-style/vft-image-viewer.css +1 -1
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
- package/es/locale/index.d.js +0 -1
- package/es/locale/index.d.ts +0 -26
- package/es/locale/index.js +0 -10
- package/es/locale/lang/en.d.ts +0 -183
- package/es/locale/lang/en.js +0 -241
- package/es/locale/lang/zh-cn.d.ts +0 -183
- package/es/locale/lang/zh-cn.js +0 -241
- package/es/locale/lang/zh-tw.d.ts +0 -183
- package/es/locale/lang/zh-tw.js +0 -241
- package/es/locale/use-locale.d.ts +0 -17
- package/es/locale/use-locale.js +0 -56
- package/lib/locale/index.cjs +0 -1
- package/lib/locale/index.d.cjs +0 -1
- package/lib/locale/index.d.ts +0 -26
- package/lib/locale/lang/en.cjs +0 -1
- package/lib/locale/lang/en.d.ts +0 -183
- package/lib/locale/lang/zh-cn.cjs +0 -1
- package/lib/locale/lang/zh-cn.d.ts +0 -183
- package/lib/locale/lang/zh-tw.cjs +0 -1
- package/lib/locale/lang/zh-tw.d.ts +0 -183
- package/lib/locale/use-locale.cjs +0 -1
- package/lib/locale/use-locale.d.ts +0 -17
|
@@ -1,191 +1,190 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as nt, useAttrs as rt, useSlots as st, ref as g, inject as ee, toRef as ut, computed as m, watch as x, openBlock as C, createElementBlock as I, normalizeClass as i, unref as o, createElementVNode as h, renderSlot as it, Fragment as ct, renderList as dt, toDisplayString as te, createCommentVNode as S, createVNode as T, withDirectives as P, vShow as N, withKeys as he, createBlock as ae, withCtx as ye, createTextVNode as ke, nextTick as z } from "vue";
|
|
2
2
|
import w from "dayjs";
|
|
3
|
-
import { VftButton as
|
|
4
|
-
import { ClickOutside as
|
|
3
|
+
import { VftButton as we } from "../../button/index.js";
|
|
4
|
+
import { ClickOutside as vt } from "@vft/directives";
|
|
5
5
|
import "@vueuse/core";
|
|
6
|
-
import { isArray as
|
|
6
|
+
import { isArray as A, isFunction as be } from "@vft/utils";
|
|
7
7
|
import "../../config-provider/hooks/use-global-config.js";
|
|
8
8
|
import { EVENT_CODE as k } from "../../../constants/aria.js";
|
|
9
9
|
import "lodash-es";
|
|
10
10
|
import "../../form/index.js";
|
|
11
|
-
import { useNamespace as
|
|
11
|
+
import { useNamespace as Ve } from "../../../hooks/use-namespace/index.js";
|
|
12
12
|
import "../../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../../hooks/use-z-index/index.js";
|
|
15
|
-
import { VftInput as
|
|
15
|
+
import { VftInput as De } from "../../input/index.js";
|
|
16
16
|
import "../../time-picker/index.js";
|
|
17
|
-
import { VftIcon as
|
|
17
|
+
import { VftIcon as L } from "../../icon/index.js";
|
|
18
18
|
import "../../tooltip/index.js";
|
|
19
|
-
import { panelDatePickProps as
|
|
20
|
-
import { getValidDateOfMonth as
|
|
21
|
-
import { ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
|
|
30
|
-
const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
19
|
+
import { panelDatePickProps as mt } from "../props/panel-date-pick.js";
|
|
20
|
+
import { getValidDateOfMonth as ge, getValidDateOfYear as Ce, correctlyParseUserInput as Te } from "../utils.js";
|
|
21
|
+
import { ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY as ft } from "../constants.js";
|
|
22
|
+
import pt from "./basic-date-table.vue2.js";
|
|
23
|
+
import ht from "./basic-month-table.vue2.js";
|
|
24
|
+
import yt from "./basic-year-table.vue2.js";
|
|
25
|
+
import { PICKER_BASE_INJECTION_KEY as kt } from "../../time-picker/constants.js";
|
|
26
|
+
import { TOOLTIP_INJECTION_KEY as wt } from "../../tooltip/constants.js";
|
|
27
|
+
import { extractTimeFormat as bt, extractDateFormat as Vt } from "../../time-picker/utils.js";
|
|
28
|
+
import Dt from "../../time-picker/time-picker-com/panel-time-pick.vue2.js";
|
|
29
|
+
const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
|
|
31
30
|
__name: "panel-date-pick",
|
|
32
|
-
props:
|
|
31
|
+
props: mt,
|
|
33
32
|
emits: ["pick", "set-picker-option", "panel-change"],
|
|
34
|
-
setup(
|
|
35
|
-
const n =
|
|
36
|
-
|
|
37
|
-
),
|
|
38
|
-
let
|
|
39
|
-
const
|
|
33
|
+
setup(Pe, { emit: Fe }) {
|
|
34
|
+
const n = Pe, b = Fe, $e = (e, t, l) => !0, f = Ve("picker-panel"), V = Ve("date-picker"), Ie = rt(), Ne = st(), d = g("zh-cn"), le = ee(kt), oe = ee(
|
|
35
|
+
ft
|
|
36
|
+
), Ee = ee(wt), { shortcuts: ne, disabledDate: c, cellClassName: Me, defaultTime: J } = le.props, E = ut(le.props, "defaultValue"), _ = g(), a = g(w().locale(d.value)), W = g(!1);
|
|
37
|
+
let H = !1;
|
|
38
|
+
const re = m(() => w(J).locale(d.value)), Oe = m(() => a.value.month()), se = m(() => a.value.year()), ue = g([]), F = g(null), $ = g(null), q = (e) => ue.value.length > 0 ? $e(e, ue.value, n.format || "HH:mm:ss") : !0, ie = (e) => J && !fe.value && !W.value && !H ? re.value.year(e.year()).month(e.month()).date(e.date()) : M.value ? e.millisecond(0) : e.startOf("day"), v = (e, ...t) => {
|
|
40
39
|
if (!e)
|
|
41
40
|
b("pick", e, ...t);
|
|
42
|
-
else if (
|
|
43
|
-
const l = e.map(
|
|
41
|
+
else if (A(e)) {
|
|
42
|
+
const l = e.map(ie);
|
|
44
43
|
b("pick", l, ...t);
|
|
45
44
|
} else
|
|
46
|
-
b("pick",
|
|
47
|
-
F.value = null, $.value = null,
|
|
48
|
-
},
|
|
45
|
+
b("pick", ie(e), ...t);
|
|
46
|
+
F.value = null, $.value = null, W.value = !1, H = !1;
|
|
47
|
+
}, Ye = async (e, t) => {
|
|
49
48
|
if (u.value === "date") {
|
|
50
49
|
e = e;
|
|
51
50
|
let l = n.parsedValue ? n.parsedValue.year(e.year()).month(e.month()).date(e.date()) : e;
|
|
52
|
-
|
|
51
|
+
q(l), a.value = l, v(l, M.value || t), n.type === "datetime" && (await z(), Y());
|
|
53
52
|
} else u.value === "week" ? v(e.date) : u.value === "dates" && v(e, !0);
|
|
54
|
-
},
|
|
53
|
+
}, ce = (e) => {
|
|
55
54
|
const t = e ? "add" : "subtract";
|
|
56
|
-
a.value = a.value[t](1, "month"),
|
|
57
|
-
},
|
|
55
|
+
a.value = a.value[t](1, "month"), U("month");
|
|
56
|
+
}, de = (e) => {
|
|
58
57
|
const t = a.value, l = e ? "add" : "subtract";
|
|
59
|
-
a.value = s.value === "year" ? t[l](10, "year") : t[l](1, "year"),
|
|
58
|
+
a.value = s.value === "year" ? t[l](10, "year") : t[l](1, "year"), U("year");
|
|
60
59
|
}, s = g("date"), Re = m(() => {
|
|
61
|
-
const e =
|
|
60
|
+
const e = "年";
|
|
62
61
|
if (s.value === "year") {
|
|
63
|
-
const t = Math.floor(
|
|
64
|
-
return
|
|
62
|
+
const t = Math.floor(se.value / 10) * 10;
|
|
63
|
+
return `${t} ${e} - ${t + 9} ${e}`;
|
|
65
64
|
}
|
|
66
|
-
return `${
|
|
65
|
+
return `${se.value} ${e}`;
|
|
67
66
|
}), Ke = (e) => {
|
|
68
|
-
const t =
|
|
67
|
+
const t = be(e.value) ? e.value() : e.value;
|
|
69
68
|
if (t) {
|
|
70
|
-
|
|
69
|
+
H = !0, v(w(t).locale(d.value));
|
|
71
70
|
return;
|
|
72
71
|
}
|
|
73
72
|
e.onClick && e.onClick({
|
|
74
|
-
attrs:
|
|
75
|
-
slots:
|
|
73
|
+
attrs: Ie,
|
|
74
|
+
slots: Ne,
|
|
76
75
|
emit: b
|
|
77
76
|
});
|
|
78
77
|
}, u = m(() => {
|
|
79
78
|
const { type: e } = n;
|
|
80
79
|
return ["week", "month", "months", "year", "years", "dates"].includes(e) ? e : "date";
|
|
81
|
-
}),
|
|
82
|
-
u.value === "month" ? (a.value =
|
|
80
|
+
}), G = m(() => u.value === "dates" || u.value === "months" || u.value === "years"), Se = m(() => u.value === "date" ? s.value : u.value), ve = m(() => !!ne.length), _e = async (e, t) => {
|
|
81
|
+
u.value === "month" ? (a.value = ge(
|
|
83
82
|
a.value,
|
|
84
83
|
a.value.year(),
|
|
85
84
|
e,
|
|
86
85
|
d.value,
|
|
87
86
|
c
|
|
88
|
-
), v(a.value, !1)) : u.value === "months" ? v(e, t ?? !0) : (a.value =
|
|
87
|
+
), v(a.value, !1)) : u.value === "months" ? v(e, t ?? !0) : (a.value = ge(
|
|
89
88
|
a.value,
|
|
90
89
|
a.value.year(),
|
|
91
90
|
e,
|
|
92
91
|
d.value,
|
|
93
92
|
c
|
|
94
|
-
), s.value = "date", ["month", "year", "date", "week"].includes(u.value) && (v(a.value, !0), await
|
|
95
|
-
},
|
|
93
|
+
), s.value = "date", ["month", "year", "date", "week"].includes(u.value) && (v(a.value, !0), await z(), Y())), U("month");
|
|
94
|
+
}, Be = async (e, t) => {
|
|
96
95
|
if (u.value === "year") {
|
|
97
96
|
const l = a.value.startOf("year").year(e);
|
|
98
|
-
a.value =
|
|
97
|
+
a.value = Ce(l, d.value, c), v(a.value, !1);
|
|
99
98
|
} else if (u.value === "years")
|
|
100
99
|
v(e, t ?? !0);
|
|
101
100
|
else {
|
|
102
101
|
const l = a.value.year(e);
|
|
103
|
-
a.value =
|
|
102
|
+
a.value = Ce(l, d.value, c), s.value = "month", ["month", "year", "date", "week"].includes(u.value) && (v(a.value, !0), await z(), Y());
|
|
104
103
|
}
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
s.value = e, await
|
|
108
|
-
},
|
|
104
|
+
U("year");
|
|
105
|
+
}, B = async (e) => {
|
|
106
|
+
s.value = e, await z(), Y();
|
|
107
|
+
}, M = m(
|
|
109
108
|
() => n.type === "datetime" || n.type === "datetimerange"
|
|
110
|
-
),
|
|
111
|
-
const e =
|
|
109
|
+
), Ue = m(() => {
|
|
110
|
+
const e = M.value || u.value === "dates", t = u.value === "years", l = u.value === "months", p = s.value === "date", y = s.value === "year", R = s.value === "month";
|
|
112
111
|
return e && p || t && y || l && R;
|
|
113
|
-
}),
|
|
114
|
-
if (
|
|
112
|
+
}), xe = m(() => c ? n.parsedValue ? A(n.parsedValue) ? c(n.parsedValue[0].toDate()) : c(n.parsedValue.toDate()) : !0 : !1), ze = () => {
|
|
113
|
+
if (G.value)
|
|
115
114
|
v(n.parsedValue);
|
|
116
115
|
else {
|
|
117
116
|
let e = n.parsedValue;
|
|
118
117
|
if (!e) {
|
|
119
|
-
const t = w(
|
|
118
|
+
const t = w(J).locale(d.value), l = Z();
|
|
120
119
|
e = t.year(l.year()).month(l.month()).date(l.date());
|
|
121
120
|
}
|
|
122
121
|
a.value = e, v(e);
|
|
123
122
|
}
|
|
124
|
-
},
|
|
123
|
+
}, Ae = m(() => c ? c(w().locale(d.value).toDate()) : !1), Le = () => {
|
|
125
124
|
const t = w().locale(d.value).toDate();
|
|
126
|
-
|
|
127
|
-
},
|
|
125
|
+
W.value = !0, (!c || !c(t)) && q(t) && (a.value = w().locale(d.value), v(a.value));
|
|
126
|
+
}, Q = m(() => n.timeFormat || bt(n.format)), me = m(() => n.dateFormat || Vt(n.format)), fe = m(() => {
|
|
128
127
|
if ($.value) return $.value;
|
|
129
|
-
if (!(!n.parsedValue && !
|
|
128
|
+
if (!(!n.parsedValue && !E.value))
|
|
130
129
|
return (n.parsedValue || a.value).format(
|
|
131
|
-
|
|
130
|
+
Q.value
|
|
132
131
|
);
|
|
133
|
-
}),
|
|
132
|
+
}), Je = m(() => {
|
|
134
133
|
if (F.value) return F.value;
|
|
135
|
-
if (!(!n.parsedValue && !
|
|
134
|
+
if (!(!n.parsedValue && !E.value))
|
|
136
135
|
return (n.parsedValue || a.value).format(
|
|
137
|
-
|
|
136
|
+
me.value
|
|
138
137
|
);
|
|
139
|
-
}),
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
},
|
|
138
|
+
}), O = g(!1), We = () => {
|
|
139
|
+
O.value = !0;
|
|
140
|
+
}, He = () => {
|
|
141
|
+
O.value = !1;
|
|
142
|
+
}, X = (e) => ({
|
|
144
143
|
hour: e.hour(),
|
|
145
144
|
minute: e.minute(),
|
|
146
145
|
second: e.second(),
|
|
147
146
|
year: e.year(),
|
|
148
147
|
month: e.month(),
|
|
149
148
|
date: e.date()
|
|
150
|
-
}),
|
|
151
|
-
const { hour: p, minute: y, second: R } =
|
|
152
|
-
a.value =
|
|
153
|
-
},
|
|
154
|
-
const t = w(e,
|
|
155
|
-
if (t.isValid() &&
|
|
156
|
-
const { year: l, month: p, date: y } =
|
|
157
|
-
a.value = t.year(l).month(p).date(y), $.value = null,
|
|
149
|
+
}), qe = (e, t, l) => {
|
|
150
|
+
const { hour: p, minute: y, second: R } = X(e), j = n.parsedValue ? n.parsedValue.hour(p).minute(y).second(R) : e;
|
|
151
|
+
a.value = j, v(a.value, !0), l || (O.value = t);
|
|
152
|
+
}, Ge = (e) => {
|
|
153
|
+
const t = w(e, Q.value).locale(d.value);
|
|
154
|
+
if (t.isValid() && q(t)) {
|
|
155
|
+
const { year: l, month: p, date: y } = X(a.value);
|
|
156
|
+
a.value = t.year(l).month(p).date(y), $.value = null, O.value = !1, v(a.value, !0);
|
|
158
157
|
}
|
|
159
|
-
},
|
|
160
|
-
const t =
|
|
158
|
+
}, Qe = (e) => {
|
|
159
|
+
const t = Te(
|
|
161
160
|
e,
|
|
162
|
-
|
|
161
|
+
me.value,
|
|
163
162
|
d.value,
|
|
164
|
-
|
|
163
|
+
oe
|
|
165
164
|
);
|
|
166
165
|
if (t.isValid()) {
|
|
167
166
|
if (c && c(t.toDate()))
|
|
168
167
|
return;
|
|
169
|
-
const { hour: l, minute: p, second: y } =
|
|
168
|
+
const { hour: l, minute: p, second: y } = X(a.value);
|
|
170
169
|
a.value = t.hour(l).minute(p).second(y), F.value = null, v(a.value, !0);
|
|
171
170
|
}
|
|
172
|
-
},
|
|
171
|
+
}, Xe = (e) => w.isDayjs(e) && e.isValid() && (c ? !c(e.toDate()) : !0), Ze = (e) => A(e) ? e.map((t) => t.format(n.format)) : e.format(n.format), je = (e) => Te(
|
|
173
172
|
e,
|
|
174
173
|
n.format,
|
|
175
174
|
d.value,
|
|
176
|
-
|
|
177
|
-
),
|
|
178
|
-
const e = w(
|
|
179
|
-
if (!
|
|
180
|
-
const t =
|
|
175
|
+
oe
|
|
176
|
+
), Z = () => {
|
|
177
|
+
const e = w(E.value).locale(d.value);
|
|
178
|
+
if (!E.value) {
|
|
179
|
+
const t = re.value;
|
|
181
180
|
return w().hour(t.hour()).minute(t.minute()).second(t.second()).locale(d.value);
|
|
182
181
|
}
|
|
183
182
|
return e;
|
|
184
|
-
},
|
|
185
|
-
["week", "month", "year", "date"].includes(u.value) &&
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
},
|
|
183
|
+
}, Y = () => {
|
|
184
|
+
["week", "month", "year", "date"].includes(u.value) && _.value?.focus();
|
|
185
|
+
}, et = () => {
|
|
186
|
+
Y(), u.value === "week" && pe(k.down);
|
|
187
|
+
}, tt = (e) => {
|
|
189
188
|
const { code: t } = e;
|
|
190
189
|
[
|
|
191
190
|
k.up,
|
|
@@ -196,11 +195,11 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
196
195
|
k.end,
|
|
197
196
|
k.pageUp,
|
|
198
197
|
k.pageDown
|
|
199
|
-
].includes(t) && (
|
|
198
|
+
].includes(t) && (pe(t), e.stopPropagation(), e.preventDefault()), [k.enter, k.space, k.numpadEnter].includes(
|
|
200
199
|
t
|
|
201
200
|
) && F.value === null && $.value === null && (e.preventDefault(), v(a.value, !1));
|
|
202
|
-
},
|
|
203
|
-
const { up: t, down: l, left: p, right: y, home: R, end:
|
|
201
|
+
}, pe = (e) => {
|
|
202
|
+
const { up: t, down: l, left: p, right: y, home: R, end: j, pageUp: at, pageDown: lt } = k, ot = {
|
|
204
203
|
year: {
|
|
205
204
|
[t]: -4,
|
|
206
205
|
[l]: 4,
|
|
@@ -228,25 +227,25 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
228
227
|
[p]: -1,
|
|
229
228
|
[y]: 1,
|
|
230
229
|
[R]: (r) => -r.getDay(),
|
|
231
|
-
[
|
|
232
|
-
[
|
|
233
|
-
[
|
|
230
|
+
[j]: (r) => -r.getDay() + 6,
|
|
231
|
+
[at]: (r) => -new Date(r.getFullYear(), r.getMonth(), 0).getDate(),
|
|
232
|
+
[lt]: (r) => new Date(r.getFullYear(), r.getMonth() + 1, 0).getDate(),
|
|
234
233
|
offset: (r, D) => r.setDate(r.getDate() + D)
|
|
235
234
|
}
|
|
236
235
|
}, K = a.value.toDate();
|
|
237
236
|
for (; Math.abs(a.value.diff(K, "year", !0)) < 1; ) {
|
|
238
|
-
const r =
|
|
237
|
+
const r = ot[Se.value];
|
|
239
238
|
if (!r) return;
|
|
240
239
|
if (r.offset(
|
|
241
240
|
K,
|
|
242
|
-
|
|
241
|
+
be(r[e]) ? r[e](K) : r[e] ?? 0
|
|
243
242
|
), c && c(K))
|
|
244
243
|
break;
|
|
245
244
|
const D = w(K).locale(d.value);
|
|
246
245
|
a.value = D, b("pick", D, !0);
|
|
247
246
|
break;
|
|
248
247
|
}
|
|
249
|
-
},
|
|
248
|
+
}, U = (e) => {
|
|
250
249
|
b(
|
|
251
250
|
"panel-change",
|
|
252
251
|
a.value.toDate(),
|
|
@@ -254,7 +253,7 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
254
253
|
s.value
|
|
255
254
|
);
|
|
256
255
|
};
|
|
257
|
-
return
|
|
256
|
+
return x(
|
|
258
257
|
() => u.value,
|
|
259
258
|
(e) => {
|
|
260
259
|
if (["month", "year"].includes(e)) {
|
|
@@ -270,95 +269,95 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
270
269
|
s.value = "date";
|
|
271
270
|
},
|
|
272
271
|
{ immediate: !0 }
|
|
273
|
-
),
|
|
272
|
+
), x(
|
|
274
273
|
() => s.value,
|
|
275
274
|
() => {
|
|
276
|
-
|
|
275
|
+
Ee?.updatePopper();
|
|
277
276
|
}
|
|
278
|
-
),
|
|
279
|
-
() =>
|
|
277
|
+
), x(
|
|
278
|
+
() => E.value,
|
|
280
279
|
(e) => {
|
|
281
|
-
e && (a.value =
|
|
280
|
+
e && (a.value = Z());
|
|
282
281
|
},
|
|
283
282
|
{ immediate: !0 }
|
|
284
|
-
),
|
|
283
|
+
), x(
|
|
285
284
|
() => n.parsedValue,
|
|
286
285
|
(e) => {
|
|
287
286
|
if (e) {
|
|
288
|
-
if (
|
|
287
|
+
if (G.value || A(e)) return;
|
|
289
288
|
a.value = e;
|
|
290
289
|
} else
|
|
291
|
-
a.value =
|
|
290
|
+
a.value = Z();
|
|
292
291
|
},
|
|
293
292
|
{ immediate: !0 }
|
|
294
|
-
), b("set-picker-option", ["isValidValue",
|
|
293
|
+
), b("set-picker-option", ["isValidValue", Xe]), b("set-picker-option", ["formatToString", Ze]), b("set-picker-option", ["parseUserInput", je]), b("set-picker-option", ["handleFocusPicker", et]), (e, t) => (C(), I("div", {
|
|
295
294
|
class: i([
|
|
296
295
|
o(f).b(),
|
|
297
296
|
o(V).b(),
|
|
298
297
|
{
|
|
299
|
-
"has-sidebar": e.$slots.sidebar ||
|
|
300
|
-
"has-time":
|
|
298
|
+
"has-sidebar": e.$slots.sidebar || ve.value,
|
|
299
|
+
"has-time": M.value
|
|
301
300
|
}
|
|
302
301
|
])
|
|
303
302
|
}, [
|
|
304
303
|
h("div", {
|
|
305
304
|
class: i(o(f).e("body-wrapper"))
|
|
306
305
|
}, [
|
|
307
|
-
|
|
306
|
+
it(e.$slots, "sidebar", {
|
|
308
307
|
class: i(o(f).e("sidebar"))
|
|
309
308
|
}),
|
|
310
|
-
|
|
309
|
+
ve.value ? (C(), I("div", {
|
|
311
310
|
key: 0,
|
|
312
311
|
class: i(o(f).e("sidebar"))
|
|
313
312
|
}, [
|
|
314
|
-
(C(!0), I(
|
|
313
|
+
(C(!0), I(ct, null, dt(o(ne), (l, p) => (C(), I("button", {
|
|
315
314
|
key: p,
|
|
316
315
|
type: "button",
|
|
317
316
|
class: i(o(f).e("shortcut")),
|
|
318
317
|
onClick: (y) => Ke(l)
|
|
319
|
-
},
|
|
320
|
-
], 2)) :
|
|
318
|
+
}, te(l.text), 11, gt))), 128))
|
|
319
|
+
], 2)) : S("", !0),
|
|
321
320
|
h("div", {
|
|
322
321
|
class: i(o(f).e("body"))
|
|
323
322
|
}, [
|
|
324
|
-
|
|
323
|
+
M.value ? (C(), I("div", {
|
|
325
324
|
key: 0,
|
|
326
325
|
class: i(o(V).e("time-header"))
|
|
327
326
|
}, [
|
|
328
327
|
h("span", {
|
|
329
328
|
class: i(o(V).e("editor-wrap"))
|
|
330
329
|
}, [
|
|
331
|
-
T(o(
|
|
332
|
-
placeholder:
|
|
333
|
-
"model-value":
|
|
330
|
+
T(o(De), {
|
|
331
|
+
placeholder: "选择日期",
|
|
332
|
+
"model-value": Je.value,
|
|
334
333
|
size: "small",
|
|
335
334
|
"validate-event": !1,
|
|
336
335
|
onInput: t[0] || (t[0] = (l) => F.value = l),
|
|
337
|
-
onChange:
|
|
338
|
-
}, null, 8, ["
|
|
336
|
+
onChange: Qe
|
|
337
|
+
}, null, 8, ["model-value"])
|
|
339
338
|
], 2),
|
|
340
339
|
P((C(), I("span", {
|
|
341
340
|
class: i(o(V).e("editor-wrap"))
|
|
342
341
|
}, [
|
|
343
|
-
T(o(
|
|
344
|
-
placeholder:
|
|
345
|
-
"model-value":
|
|
342
|
+
T(o(De), {
|
|
343
|
+
placeholder: "选择时间",
|
|
344
|
+
"model-value": fe.value,
|
|
346
345
|
size: "small",
|
|
347
346
|
"validate-event": !1,
|
|
348
|
-
onFocus:
|
|
347
|
+
onFocus: We,
|
|
349
348
|
onInput: t[1] || (t[1] = (l) => $.value = l),
|
|
350
|
-
onChange:
|
|
351
|
-
}, null, 8, ["
|
|
352
|
-
T(o(
|
|
353
|
-
visible:
|
|
354
|
-
format:
|
|
349
|
+
onChange: Ge
|
|
350
|
+
}, null, 8, ["model-value"]),
|
|
351
|
+
T(o(Dt), {
|
|
352
|
+
visible: O.value,
|
|
353
|
+
format: Q.value,
|
|
355
354
|
"parsed-value": a.value,
|
|
356
|
-
onPick:
|
|
355
|
+
onPick: qe
|
|
357
356
|
}, null, 8, ["visible", "format", "parsed-value"])
|
|
358
357
|
], 2)), [
|
|
359
|
-
[o(
|
|
358
|
+
[o(vt), He]
|
|
360
359
|
])
|
|
361
|
-
], 2)) :
|
|
360
|
+
], 2)) : S("", !0),
|
|
362
361
|
P(h("div", {
|
|
363
362
|
class: i([
|
|
364
363
|
o(V).e("header"),
|
|
@@ -371,16 +370,16 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
371
370
|
h("button", {
|
|
372
371
|
type: "button",
|
|
373
372
|
class: i(["d-arrow-left", o(f).e("icon-btn")]),
|
|
374
|
-
onClick: t[2] || (t[2] = (l) =>
|
|
373
|
+
onClick: t[2] || (t[2] = (l) => de(!1))
|
|
375
374
|
}, [
|
|
376
|
-
T(o(
|
|
375
|
+
T(o(L), { icon: "icon-d-arrow-left" })
|
|
377
376
|
], 2),
|
|
378
377
|
P(h("button", {
|
|
379
378
|
type: "button",
|
|
380
379
|
class: i([o(f).e("icon-btn"), "arrow-left"]),
|
|
381
|
-
onClick: t[3] || (t[3] = (l) =>
|
|
380
|
+
onClick: t[3] || (t[3] = (l) => ce(!1))
|
|
382
381
|
}, [
|
|
383
|
-
T(o(
|
|
382
|
+
T(o(L), { icon: "icon-arrow-left" })
|
|
384
383
|
], 2), [
|
|
385
384
|
[N, s.value === "date"]
|
|
386
385
|
])
|
|
@@ -390,9 +389,9 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
390
389
|
class: i(o(V).e("header-label")),
|
|
391
390
|
"aria-live": "polite",
|
|
392
391
|
tabindex: "0",
|
|
393
|
-
onKeydown: t[4] || (t[4] =
|
|
394
|
-
onClick: t[5] || (t[5] = (l) =>
|
|
395
|
-
},
|
|
392
|
+
onKeydown: t[4] || (t[4] = he((l) => B("year"), ["enter"])),
|
|
393
|
+
onClick: t[5] || (t[5] = (l) => B("year"))
|
|
394
|
+
}, te(Re.value), 35),
|
|
396
395
|
P(h("span", {
|
|
397
396
|
role: "button",
|
|
398
397
|
"aria-live": "polite",
|
|
@@ -401,9 +400,9 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
401
400
|
o(V).e("header-label"),
|
|
402
401
|
{ active: s.value === "month" }
|
|
403
402
|
]),
|
|
404
|
-
onKeydown: t[6] || (t[6] =
|
|
405
|
-
onClick: t[7] || (t[7] = (l) =>
|
|
406
|
-
},
|
|
403
|
+
onKeydown: t[6] || (t[6] = he((l) => B("month"), ["enter"])),
|
|
404
|
+
onClick: t[7] || (t[7] = (l) => B("month"))
|
|
405
|
+
}, te(Oe.value + 1), 35), [
|
|
407
406
|
[N, s.value === "date"]
|
|
408
407
|
]),
|
|
409
408
|
h("span", {
|
|
@@ -412,18 +411,18 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
412
411
|
P(h("button", {
|
|
413
412
|
type: "button",
|
|
414
413
|
class: i([o(f).e("icon-btn"), "arrow-right"]),
|
|
415
|
-
onClick: t[8] || (t[8] = (l) =>
|
|
414
|
+
onClick: t[8] || (t[8] = (l) => ce(!0))
|
|
416
415
|
}, [
|
|
417
|
-
T(o(
|
|
416
|
+
T(o(L), { icon: "icon-arrow-right" })
|
|
418
417
|
], 2), [
|
|
419
418
|
[N, s.value === "date"]
|
|
420
419
|
]),
|
|
421
420
|
h("button", {
|
|
422
421
|
type: "button",
|
|
423
422
|
class: i([o(f).e("icon-btn"), "d-arrow-right"]),
|
|
424
|
-
onClick: t[9] || (t[9] = (l) =>
|
|
423
|
+
onClick: t[9] || (t[9] = (l) => de(!0))
|
|
425
424
|
}, [
|
|
426
|
-
T(o(
|
|
425
|
+
T(o(L), { icon: "icon-d-arrow-right" })
|
|
427
426
|
], 2)
|
|
428
427
|
], 2)
|
|
429
428
|
], 2), [
|
|
@@ -431,78 +430,78 @@ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
|
|
|
431
430
|
]),
|
|
432
431
|
h("div", {
|
|
433
432
|
class: i(o(f).e("content")),
|
|
434
|
-
onKeydown:
|
|
433
|
+
onKeydown: tt
|
|
435
434
|
}, [
|
|
436
|
-
s.value === "date" ? (C(),
|
|
435
|
+
s.value === "date" ? (C(), ae(pt, {
|
|
437
436
|
key: 0,
|
|
438
437
|
ref_key: "currentViewRef",
|
|
439
|
-
ref:
|
|
438
|
+
ref: _,
|
|
440
439
|
"selection-mode": u.value,
|
|
441
440
|
date: a.value,
|
|
442
441
|
"parsed-value": e.parsedValue,
|
|
443
442
|
"disabled-date": o(c),
|
|
444
|
-
"cell-class-name": o(
|
|
443
|
+
"cell-class-name": o(Me),
|
|
445
444
|
"show-week-number": e.showWeekNumber,
|
|
446
|
-
onPick:
|
|
447
|
-
}, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "cell-class-name", "show-week-number"])) :
|
|
448
|
-
s.value === "year" ? (C(),
|
|
445
|
+
onPick: Ye
|
|
446
|
+
}, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "cell-class-name", "show-week-number"])) : S("", !0),
|
|
447
|
+
s.value === "year" ? (C(), ae(yt, {
|
|
449
448
|
key: 1,
|
|
450
449
|
ref_key: "currentViewRef",
|
|
451
|
-
ref:
|
|
450
|
+
ref: _,
|
|
452
451
|
"selection-mode": u.value,
|
|
453
452
|
date: a.value,
|
|
454
453
|
"disabled-date": o(c),
|
|
455
454
|
"parsed-value": e.parsedValue,
|
|
456
|
-
onPick:
|
|
457
|
-
}, null, 8, ["selection-mode", "date", "disabled-date", "parsed-value"])) :
|
|
458
|
-
s.value === "month" ? (C(),
|
|
455
|
+
onPick: Be
|
|
456
|
+
}, null, 8, ["selection-mode", "date", "disabled-date", "parsed-value"])) : S("", !0),
|
|
457
|
+
s.value === "month" ? (C(), ae(ht, {
|
|
459
458
|
key: 2,
|
|
460
459
|
ref_key: "currentViewRef",
|
|
461
|
-
ref:
|
|
460
|
+
ref: _,
|
|
462
461
|
"selection-mode": u.value,
|
|
463
462
|
date: a.value,
|
|
464
463
|
"parsed-value": e.parsedValue,
|
|
465
464
|
"disabled-date": o(c),
|
|
466
|
-
onPick:
|
|
467
|
-
}, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date"])) :
|
|
465
|
+
onPick: _e
|
|
466
|
+
}, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date"])) : S("", !0)
|
|
468
467
|
], 34)
|
|
469
468
|
], 2)
|
|
470
469
|
], 2),
|
|
471
470
|
P(h("div", {
|
|
472
471
|
class: i(o(f).e("footer"))
|
|
473
472
|
}, [
|
|
474
|
-
P(T(o(
|
|
473
|
+
P(T(o(we), {
|
|
475
474
|
text: "",
|
|
476
475
|
size: "small",
|
|
477
476
|
class: i(o(f).e("link-btn")),
|
|
478
|
-
disabled:
|
|
479
|
-
onClick:
|
|
477
|
+
disabled: Ae.value,
|
|
478
|
+
onClick: Le
|
|
480
479
|
}, {
|
|
481
|
-
default:
|
|
482
|
-
|
|
483
|
-
]),
|
|
480
|
+
default: ye(() => [...t[10] || (t[10] = [
|
|
481
|
+
ke(" 此刻 ", -1)
|
|
482
|
+
])]),
|
|
484
483
|
_: 1
|
|
485
484
|
}, 8, ["class", "disabled"]), [
|
|
486
|
-
[N, !
|
|
485
|
+
[N, !G.value && e.showNow]
|
|
487
486
|
]),
|
|
488
|
-
T(o(
|
|
487
|
+
T(o(we), {
|
|
489
488
|
plain: "",
|
|
490
489
|
size: "small",
|
|
491
490
|
class: i(o(f).e("link-btn")),
|
|
492
|
-
disabled:
|
|
493
|
-
onClick:
|
|
491
|
+
disabled: xe.value,
|
|
492
|
+
onClick: ze
|
|
494
493
|
}, {
|
|
495
|
-
default:
|
|
496
|
-
|
|
497
|
-
]),
|
|
494
|
+
default: ye(() => [...t[11] || (t[11] = [
|
|
495
|
+
ke(" 确认 ", -1)
|
|
496
|
+
])]),
|
|
498
497
|
_: 1
|
|
499
498
|
}, 8, ["class", "disabled"])
|
|
500
499
|
], 2), [
|
|
501
|
-
[N,
|
|
500
|
+
[N, Ue.value]
|
|
502
501
|
])
|
|
503
502
|
], 2));
|
|
504
503
|
}
|
|
505
504
|
});
|
|
506
505
|
export {
|
|
507
|
-
|
|
506
|
+
Zt as default
|
|
508
507
|
};
|