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