@manik02/vue3-timepicker 0.2.2 → 0.4.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/README.md +45 -15
- package/dist/TimePicker/TimePicker.vue.d.ts +54 -1
- package/dist/TimePicker/types.d.ts +24 -0
- package/dist/TimePicker/useTimeMask.d.ts +1 -0
- package/dist/stories/TimePicker.stories.d.ts +220 -4
- package/dist/vue-timepicker.css +1 -1
- package/dist/vue-timepicker.js +704 -600
- package/dist/vue-timepicker.umd.cjs +1 -1
- package/package.json +4 -2
package/dist/vue-timepicker.js
CHANGED
|
@@ -1,119 +1,159 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as he, ref as N, onMounted as de, onBeforeUnmount as ce, createElementBlock as Y, openBlock as W, normalizeClass as me, createElementVNode as J, Fragment as xe, renderList as we, toDisplayString as Pe, nextTick as ge, computed as p, watch as L, createCommentVNode as Z, createVNode as fe, createBlock as ve, normalizeStyle as ue, unref as R } from "vue";
|
|
2
|
+
const De = ["tabindex", "onClick", "onMousemove"], ne = /* @__PURE__ */ he({
|
|
3
3
|
__name: "TimeColumn",
|
|
4
4
|
props: {
|
|
5
5
|
items: {},
|
|
6
6
|
activeIndex: {}
|
|
7
7
|
},
|
|
8
8
|
emits: ["update:activeIndex", "select"],
|
|
9
|
-
setup(
|
|
10
|
-
const l =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
setup(n, { emit: o }) {
|
|
10
|
+
const l = n, i = o, f = N(null), g = N(!1);
|
|
11
|
+
let u = null;
|
|
12
|
+
function P(m) {
|
|
13
|
+
const S = Array.from(m.querySelectorAll(".timepicker-option"));
|
|
14
|
+
if (!S.length) return 0;
|
|
15
|
+
const T = m.scrollTop + m.clientHeight / 2;
|
|
16
|
+
let V = 0, w = Number.POSITIVE_INFINITY;
|
|
17
|
+
for (let A = 0; A < S.length; A++) {
|
|
18
|
+
const C = S[A], r = C.offsetTop + C.offsetHeight / 2, d = Math.abs(r - T);
|
|
19
|
+
d < w && (w = d, V = A);
|
|
20
|
+
}
|
|
21
|
+
return V;
|
|
22
|
+
}
|
|
23
|
+
function D(m) {
|
|
24
|
+
if (!l.items.length) return 0;
|
|
25
|
+
if (!l.items[m]?.disabled) return m;
|
|
26
|
+
for (let S = 1; S < l.items.length; S++) {
|
|
27
|
+
const T = m - S, V = m + S;
|
|
28
|
+
if (T >= 0 && !l.items[T]?.disabled) return T;
|
|
29
|
+
if (V < l.items.length && !l.items[V]?.disabled) return V;
|
|
30
|
+
}
|
|
31
|
+
return m;
|
|
32
|
+
}
|
|
33
|
+
function I() {
|
|
34
|
+
ge(() => {
|
|
35
|
+
const m = f.value;
|
|
36
|
+
if (!m) return;
|
|
37
|
+
const S = m.querySelector(
|
|
16
38
|
".timepicker-option--active"
|
|
17
39
|
);
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
40
|
+
if (S) {
|
|
41
|
+
const T = m.clientHeight, V = S.offsetTop, w = S.offsetHeight, A = V - T / 2 + w / 2;
|
|
42
|
+
g.value = !0, m.scrollTo({ top: A, behavior: "auto" }), u && clearTimeout(u), u = setTimeout(() => {
|
|
43
|
+
g.value = !1;
|
|
44
|
+
}, 70);
|
|
21
45
|
}
|
|
22
46
|
});
|
|
23
47
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
48
|
+
function F() {
|
|
49
|
+
const m = f.value;
|
|
50
|
+
if (!m || g.value) return;
|
|
51
|
+
const S = P(m), T = D(S);
|
|
52
|
+
l.items[T]?.disabled || (E.value = T);
|
|
27
53
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
54
|
+
de(I), ce(() => {
|
|
55
|
+
u && clearTimeout(u);
|
|
56
|
+
});
|
|
57
|
+
function y(m) {
|
|
58
|
+
i("update:activeIndex", m), i("select", l.items[m]?.value);
|
|
59
|
+
}
|
|
60
|
+
function M(m) {
|
|
61
|
+
y(m);
|
|
62
|
+
}
|
|
63
|
+
const E = N(l.activeIndex ?? 0);
|
|
64
|
+
return (m, S) => (W(), Y("div", {
|
|
65
|
+
class: me(["timepicker-dropdown", {
|
|
66
|
+
"timepicker-dropdown--short": m.items.length <= 3
|
|
67
|
+
}])
|
|
68
|
+
}, [
|
|
69
|
+
J("div", {
|
|
31
70
|
ref_key: "menu",
|
|
32
|
-
ref:
|
|
71
|
+
ref: f,
|
|
33
72
|
class: "timepicker-dropdown__panel",
|
|
34
73
|
role: "listbox",
|
|
35
|
-
tabindex: "-1"
|
|
74
|
+
tabindex: "-1",
|
|
75
|
+
onScroll: F
|
|
36
76
|
}, [
|
|
37
|
-
(
|
|
38
|
-
key:
|
|
39
|
-
class:
|
|
40
|
-
"timepicker-option--active":
|
|
41
|
-
"timepicker-option--disabled":
|
|
42
|
-
"timepicker-option--focused":
|
|
77
|
+
(W(!0), Y(xe, null, we(m.items, (T, V) => (W(), Y("div", {
|
|
78
|
+
key: T.key,
|
|
79
|
+
class: me(["timepicker-option", {
|
|
80
|
+
"timepicker-option--active": V === m.activeIndex,
|
|
81
|
+
"timepicker-option--disabled": T.disabled,
|
|
82
|
+
"timepicker-option--focused": V === E.value
|
|
43
83
|
}]),
|
|
44
84
|
role: "option",
|
|
45
|
-
tabindex:
|
|
46
|
-
onClick: (
|
|
47
|
-
onMousemove: (
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
]));
|
|
85
|
+
tabindex: T.disabled ? -1 : 0,
|
|
86
|
+
onClick: (w) => !T.disabled && M(V),
|
|
87
|
+
onMousemove: (w) => !T.disabled && (E.value = V)
|
|
88
|
+
}, Pe(T.text), 43, De))), 128))
|
|
89
|
+
], 544)
|
|
90
|
+
], 2));
|
|
51
91
|
}
|
|
52
92
|
});
|
|
53
|
-
function
|
|
54
|
-
return
|
|
93
|
+
function ye(n) {
|
|
94
|
+
return n.h * 3600 + n.m * 60 + n.s;
|
|
55
95
|
}
|
|
56
|
-
function
|
|
57
|
-
return /(a|A|p|P)/.test(
|
|
96
|
+
function Ae(n) {
|
|
97
|
+
return /(a|A|p|P)/.test(n);
|
|
58
98
|
}
|
|
59
|
-
function
|
|
60
|
-
return /(p|P)/.test(
|
|
99
|
+
function Ee(n) {
|
|
100
|
+
return /(p|P)/.test(n);
|
|
61
101
|
}
|
|
62
|
-
function
|
|
63
|
-
return /k{1,2}/.test(
|
|
102
|
+
function pe(n) {
|
|
103
|
+
return /k{1,2}/.test(n);
|
|
64
104
|
}
|
|
65
|
-
function z(
|
|
66
|
-
if (!
|
|
67
|
-
const l =
|
|
68
|
-
let
|
|
69
|
-
const
|
|
70
|
-
return { h:
|
|
105
|
+
function z(n, o) {
|
|
106
|
+
if (!n || typeof n != "string") return { h: 0, m: 0, s: 0 };
|
|
107
|
+
const l = n.match(/\d+/g) || [];
|
|
108
|
+
let i = l[0] !== void 0 ? +l[0] : 0;
|
|
109
|
+
const f = +l[1] || 0, g = +l[2] || 0;
|
|
110
|
+
return { h: i, m: f, s: g };
|
|
71
111
|
}
|
|
72
|
-
function
|
|
73
|
-
const o =
|
|
112
|
+
function He(n) {
|
|
113
|
+
const o = n % 12;
|
|
74
114
|
return o === 0 ? 12 : o;
|
|
75
115
|
}
|
|
76
|
-
function
|
|
77
|
-
return o ?
|
|
116
|
+
function Te(n, o) {
|
|
117
|
+
return o ? n % 12 + 12 : n % 12;
|
|
78
118
|
}
|
|
79
|
-
function
|
|
80
|
-
return /(s|ss)/.test(
|
|
119
|
+
function Ne(n) {
|
|
120
|
+
return /(s|ss)/.test(n);
|
|
81
121
|
}
|
|
82
|
-
function
|
|
83
|
-
let { h: l, m:
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const
|
|
122
|
+
function ie(n, o) {
|
|
123
|
+
let { h: l, m: i, s: f } = o;
|
|
124
|
+
const g = Ae(n), u = l >= 12 ? "PM" : "AM";
|
|
125
|
+
g && (l = He(l));
|
|
126
|
+
const P = l === 0 ? 24 : l, D = {
|
|
87
127
|
HH: String(l).padStart(2, "0"),
|
|
88
128
|
H: String(l),
|
|
89
129
|
hh: String(l).padStart(2, "0"),
|
|
90
130
|
h: String(l),
|
|
91
|
-
kk: String(
|
|
92
|
-
k: String(
|
|
93
|
-
mm: String(
|
|
94
|
-
m: String(
|
|
95
|
-
ss: String(
|
|
96
|
-
s: String(
|
|
97
|
-
A:
|
|
98
|
-
a:
|
|
99
|
-
P:
|
|
100
|
-
p:
|
|
131
|
+
kk: String(P).padStart(2, "0"),
|
|
132
|
+
k: String(P),
|
|
133
|
+
mm: String(i).padStart(2, "0"),
|
|
134
|
+
m: String(i),
|
|
135
|
+
ss: String(f).padStart(2, "0"),
|
|
136
|
+
s: String(f),
|
|
137
|
+
A: u,
|
|
138
|
+
a: u.toLowerCase(),
|
|
139
|
+
P: u,
|
|
140
|
+
p: u.toLowerCase()
|
|
101
141
|
};
|
|
102
|
-
return
|
|
142
|
+
return n.replace(/HH|hh|kk|mm|ss|H|h|k|m|s|A|a|P|p/g, (I) => D[I] ?? I);
|
|
103
143
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
144
|
+
function U(n, o) {
|
|
145
|
+
return ye(n) - ye(o);
|
|
106
146
|
}
|
|
107
|
-
function
|
|
108
|
-
return o &&
|
|
147
|
+
function $e(n, o, l) {
|
|
148
|
+
return o && U(n, o) < 0 ? { ...o } : l && U(n, l) > 0 ? { ...l } : { ...n };
|
|
109
149
|
}
|
|
110
|
-
function
|
|
111
|
-
return !(o &&
|
|
150
|
+
function Me(n, o, l) {
|
|
151
|
+
return !(o && U(n, o) < 0 || l && U(n, l) > 0);
|
|
112
152
|
}
|
|
113
|
-
function
|
|
114
|
-
return o.some(([l,
|
|
153
|
+
function Ie(n, o) {
|
|
154
|
+
return o.some(([l, i]) => U(n, l) >= 0 && U(n, i) <= 0);
|
|
115
155
|
}
|
|
116
|
-
const
|
|
156
|
+
const ke = /* @__PURE__ */ he({
|
|
117
157
|
__name: "TimeSelection",
|
|
118
158
|
props: {
|
|
119
159
|
open: { type: Boolean },
|
|
@@ -128,217 +168,234 @@ const be = /* @__PURE__ */ ce({
|
|
|
128
168
|
secondStep: {}
|
|
129
169
|
},
|
|
130
170
|
emits: ["update:initTime", "open", "close", "update:open"],
|
|
131
|
-
setup(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
171
|
+
setup(n, { emit: o }) {
|
|
172
|
+
function l(a) {
|
|
173
|
+
return Math.max(1, a ?? 1);
|
|
174
|
+
}
|
|
175
|
+
const i = p(() => Ae(u.format)), f = p(() => Ne(u.format)), g = p(() => pe(u.format)), u = n, P = o, D = p({
|
|
176
|
+
get: () => u.open ?? !1,
|
|
177
|
+
set: (a) => {
|
|
178
|
+
const e = u.open ?? !1;
|
|
179
|
+
a !== e && (P("update:open", a), P(a ? "open" : "close"));
|
|
137
180
|
}
|
|
138
|
-
}),
|
|
139
|
-
function
|
|
140
|
-
if (!
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
() => document.removeEventListener("mousedown",
|
|
181
|
+
}), I = N(null);
|
|
182
|
+
function F(a) {
|
|
183
|
+
if (!D.value) return;
|
|
184
|
+
const e = a.target;
|
|
185
|
+
I.value && !I.value.contains(e) && (D.value = !1);
|
|
186
|
+
}
|
|
187
|
+
de(() => document.addEventListener("mousedown", F)), ce(
|
|
188
|
+
() => document.removeEventListener("mousedown", F)
|
|
146
189
|
);
|
|
147
|
-
function
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const M =
|
|
152
|
-
|
|
153
|
-
() =>
|
|
154
|
-
(
|
|
155
|
-
const
|
|
156
|
-
let
|
|
157
|
-
|
|
190
|
+
function y(a) {
|
|
191
|
+
a.key === "Escape" && D.value && (D.value = !1);
|
|
192
|
+
}
|
|
193
|
+
de(() => document.addEventListener("keydown", y)), ce(() => document.removeEventListener("keydown", y));
|
|
194
|
+
const M = N(Math.floor(u.initTime.h / u.hourStep) || 0), E = N(Math.floor(u.initTime.m / u.minuteStep) || 0), m = N(Math.floor(u.initTime.s / u.secondStep) || 0);
|
|
195
|
+
L(
|
|
196
|
+
() => u.initTime,
|
|
197
|
+
(a) => {
|
|
198
|
+
const e = l(u.hourStep), t = l(u.minuteStep), s = l(u.secondStep);
|
|
199
|
+
let h = a.h;
|
|
200
|
+
i.value ? (w.value = a.h >= 12 ? 1 : 0, h = a.h % 12) : g.value && a.h === 0 && (h = 24), M.value = Math.floor(h / e), E.value = Math.floor(a.m / t), m.value = Math.floor(a.s / s);
|
|
158
201
|
}
|
|
159
202
|
);
|
|
160
|
-
function
|
|
161
|
-
const
|
|
162
|
-
for (let
|
|
163
|
-
|
|
164
|
-
return
|
|
165
|
-
}
|
|
166
|
-
function
|
|
167
|
-
const
|
|
168
|
-
for (let
|
|
169
|
-
const
|
|
170
|
-
|
|
203
|
+
function S(a, e) {
|
|
204
|
+
const t = [];
|
|
205
|
+
for (let s = 0; s < a; s += l(e))
|
|
206
|
+
t.push({ key: s, value: s, text: String(s).padStart(2, "0") });
|
|
207
|
+
return t;
|
|
208
|
+
}
|
|
209
|
+
function T(a, e) {
|
|
210
|
+
const t = l(e), s = [];
|
|
211
|
+
for (let h = 0; h < 12; h += t) {
|
|
212
|
+
const x = h === 0 ? 12 : h, be = a ? h === 0 ? 12 : h + 12 : h;
|
|
213
|
+
s.push({ key: be, value: be, text: String(x).padStart(2, "0") });
|
|
171
214
|
}
|
|
172
|
-
return
|
|
215
|
+
return s;
|
|
173
216
|
}
|
|
174
|
-
function
|
|
175
|
-
const
|
|
176
|
-
for (let
|
|
177
|
-
const
|
|
178
|
-
|
|
217
|
+
function V(a) {
|
|
218
|
+
const e = l(a), t = [];
|
|
219
|
+
for (let s = 0; s < 24; s += e) {
|
|
220
|
+
const h = s === 0 ? 24 : s;
|
|
221
|
+
t.push({ key: s, value: s, text: String(h).padStart(2, "0") });
|
|
179
222
|
}
|
|
180
|
-
return
|
|
181
|
-
}
|
|
182
|
-
const
|
|
183
|
-
if (!
|
|
184
|
-
return g.value ?
|
|
185
|
-
const
|
|
186
|
-
return
|
|
187
|
-
}),
|
|
188
|
-
const
|
|
223
|
+
return t;
|
|
224
|
+
}
|
|
225
|
+
const w = N(Ee(u.format) ? 1 : 0), A = p(() => {
|
|
226
|
+
if (!i.value)
|
|
227
|
+
return g.value ? V(u.hourStep) : S(24, u.hourStep);
|
|
228
|
+
const a = w.value === 1;
|
|
229
|
+
return T(a, u.hourStep);
|
|
230
|
+
}), C = p(() => S(60, u.minuteStep)), r = p(() => S(60, u.secondStep)), d = p(() => /\s[ap]$/.test(u.format)), c = p(() => {
|
|
231
|
+
const a = d.value ? "am" : "AM", e = d.value ? "pm" : "PM";
|
|
189
232
|
return [
|
|
190
|
-
{ key: "AM", value: "AM", text:
|
|
191
|
-
{ key: "PM", value: "PM", text:
|
|
233
|
+
{ key: "AM", value: "AM", text: a },
|
|
234
|
+
{ key: "PM", value: "PM", text: e }
|
|
192
235
|
];
|
|
193
|
-
}),
|
|
194
|
-
() =>
|
|
195
|
-
),
|
|
196
|
-
function
|
|
197
|
-
return Number(
|
|
198
|
-
}
|
|
199
|
-
function
|
|
200
|
-
const
|
|
201
|
-
return
|
|
202
|
-
}
|
|
203
|
-
function
|
|
204
|
-
return !(!
|
|
205
|
-
}
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
(
|
|
209
|
-
(
|
|
236
|
+
}), b = p(
|
|
237
|
+
() => C.value.map((a) => Number(a.value ?? 0))
|
|
238
|
+
), v = p(() => f.value ? r.value.map((a) => Number(a.value ?? 0)) : [0]);
|
|
239
|
+
function k(a) {
|
|
240
|
+
return Number(a.value ?? 0);
|
|
241
|
+
}
|
|
242
|
+
function K(a) {
|
|
243
|
+
const e = a.findIndex((t) => !t.disabled);
|
|
244
|
+
return e >= 0 ? e : 0;
|
|
245
|
+
}
|
|
246
|
+
function G(a) {
|
|
247
|
+
return !(!Me(a, u.minTime, u.maxTime) || Ie(a, u.disabledRanges ?? []) || u.isTimeDisabled?.(a));
|
|
248
|
+
}
|
|
249
|
+
const B = p(() => A.value.map((a) => {
|
|
250
|
+
const e = k(a), t = b.value.some(
|
|
251
|
+
(s) => v.value.some(
|
|
252
|
+
(h) => G({ h: e, m: s, s: h })
|
|
210
253
|
)
|
|
211
254
|
);
|
|
212
255
|
return {
|
|
213
|
-
...
|
|
214
|
-
disabled: !
|
|
256
|
+
...a,
|
|
257
|
+
disabled: !t
|
|
215
258
|
};
|
|
216
|
-
})),
|
|
217
|
-
const
|
|
218
|
-
return
|
|
219
|
-
const
|
|
220
|
-
(
|
|
259
|
+
})), q = p(() => {
|
|
260
|
+
const a = Number(A.value[M.value]?.value ?? 0);
|
|
261
|
+
return C.value.map((e) => {
|
|
262
|
+
const t = Number(e.value ?? 0), s = v.value.some(
|
|
263
|
+
(h) => G({ h: a, m: t, s: h })
|
|
221
264
|
);
|
|
222
265
|
return {
|
|
223
|
-
...
|
|
224
|
-
disabled: !
|
|
266
|
+
...e,
|
|
267
|
+
disabled: !s
|
|
225
268
|
};
|
|
226
269
|
});
|
|
227
|
-
}),
|
|
228
|
-
const
|
|
229
|
-
|
|
270
|
+
}), O = p(() => {
|
|
271
|
+
const a = Number(A.value[M.value]?.value ?? 0), e = Number(
|
|
272
|
+
C.value[E.value]?.value ?? 0
|
|
230
273
|
);
|
|
231
|
-
return
|
|
232
|
-
const
|
|
274
|
+
return r.value.map((t) => {
|
|
275
|
+
const s = Number(t.value ?? 0);
|
|
233
276
|
return {
|
|
234
|
-
...
|
|
235
|
-
disabled: !
|
|
236
|
-
h:
|
|
237
|
-
m:
|
|
238
|
-
s
|
|
277
|
+
...t,
|
|
278
|
+
disabled: !G({
|
|
279
|
+
h: a,
|
|
280
|
+
m: e,
|
|
281
|
+
s
|
|
239
282
|
})
|
|
240
283
|
};
|
|
241
284
|
});
|
|
242
|
-
}),
|
|
243
|
-
if (!
|
|
244
|
-
const
|
|
245
|
-
return
|
|
246
|
-
const
|
|
247
|
-
(
|
|
248
|
-
h: Number(
|
|
249
|
-
m:
|
|
250
|
-
s:
|
|
285
|
+
}), ee = p(() => {
|
|
286
|
+
if (!i.value) return c.value;
|
|
287
|
+
const a = Number(C.value[E.value]?.value ?? 0), e = f.value ? Number(r.value[m.value]?.value ?? 0) : 0;
|
|
288
|
+
return c.value.map((t) => {
|
|
289
|
+
const s = t.value === "PM", h = T(s, u.hourStep).some(
|
|
290
|
+
(x) => G({
|
|
291
|
+
h: Number(x.value ?? 0),
|
|
292
|
+
m: a,
|
|
293
|
+
s: e
|
|
251
294
|
})
|
|
252
295
|
);
|
|
253
296
|
return {
|
|
254
|
-
...
|
|
255
|
-
disabled: !
|
|
297
|
+
...t,
|
|
298
|
+
disabled: !h
|
|
256
299
|
};
|
|
257
300
|
});
|
|
258
|
-
}),
|
|
259
|
-
const
|
|
260
|
-
return
|
|
261
|
-
}),
|
|
262
|
-
() => Number(
|
|
263
|
-
),
|
|
264
|
-
() => Number(
|
|
301
|
+
}), oe = p(() => w.value === 1 ? "PM" : "AM"), te = p(() => {
|
|
302
|
+
const a = Number(A.value[M.value]?.value ?? 0);
|
|
303
|
+
return i.value ? oe.value === "PM" ? Te(a, !0) : Te(a, !1) : g.value && a === 24 ? 0 : a;
|
|
304
|
+
}), $ = p(
|
|
305
|
+
() => Number(C.value[E.value]?.value ?? 0)
|
|
306
|
+
), re = p(
|
|
307
|
+
() => Number(r.value[m.value]?.value ?? 0)
|
|
265
308
|
);
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
309
|
+
function H(a, e, t) {
|
|
310
|
+
a.length && (!a[e] || a[e].disabled) && t(K(a));
|
|
311
|
+
}
|
|
312
|
+
L(B, (a) => {
|
|
313
|
+
H(a, M.value, (e) => {
|
|
314
|
+
M.value = e;
|
|
315
|
+
});
|
|
316
|
+
}), L(q, (a) => {
|
|
317
|
+
H(a, E.value, (e) => {
|
|
318
|
+
E.value = e;
|
|
319
|
+
});
|
|
320
|
+
}), L(O, (a) => {
|
|
321
|
+
!f.value || !a.length || H(a, m.value, (e) => {
|
|
322
|
+
m.value = e;
|
|
323
|
+
});
|
|
324
|
+
}), L(ee, (a) => {
|
|
325
|
+
!i.value || !a.length || H(a, w.value, (e) => {
|
|
326
|
+
w.value = e;
|
|
327
|
+
});
|
|
274
328
|
});
|
|
275
|
-
function
|
|
276
|
-
!
|
|
329
|
+
function se(a) {
|
|
330
|
+
!f.value && !i.value && X();
|
|
277
331
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
332
|
+
function Q(a) {
|
|
333
|
+
i.value || X();
|
|
280
334
|
}
|
|
281
|
-
function
|
|
282
|
-
|
|
335
|
+
function le(a) {
|
|
336
|
+
X();
|
|
283
337
|
}
|
|
284
|
-
function
|
|
285
|
-
|
|
338
|
+
function X() {
|
|
339
|
+
D.value = !1;
|
|
286
340
|
}
|
|
287
|
-
return
|
|
288
|
-
[
|
|
289
|
-
([
|
|
290
|
-
|
|
341
|
+
return L(
|
|
342
|
+
[te, $, re],
|
|
343
|
+
([a, e, t]) => {
|
|
344
|
+
P("update:initTime", { h: a, m: e, s: t });
|
|
291
345
|
},
|
|
292
346
|
{ immediate: !0 }
|
|
293
|
-
), (
|
|
347
|
+
), (a, e) => D.value ? (W(), Y("div", {
|
|
294
348
|
key: 0,
|
|
295
349
|
class: "vtp-cols",
|
|
296
350
|
ref_key: "root",
|
|
297
|
-
ref:
|
|
351
|
+
ref: I
|
|
298
352
|
}, [
|
|
299
|
-
|
|
353
|
+
fe(ne, {
|
|
300
354
|
activeIndex: M.value,
|
|
301
|
-
"onUpdate:activeIndex":
|
|
302
|
-
items:
|
|
355
|
+
"onUpdate:activeIndex": e[0] || (e[0] = (t) => M.value = t),
|
|
356
|
+
items: B.value,
|
|
303
357
|
label: "Hours"
|
|
304
358
|
}, null, 8, ["activeIndex", "items"]),
|
|
305
|
-
|
|
306
|
-
activeIndex:
|
|
307
|
-
"onUpdate:activeIndex":
|
|
308
|
-
items:
|
|
359
|
+
fe(ne, {
|
|
360
|
+
activeIndex: E.value,
|
|
361
|
+
"onUpdate:activeIndex": e[1] || (e[1] = (t) => E.value = t),
|
|
362
|
+
items: q.value,
|
|
309
363
|
label: "Minutes",
|
|
310
|
-
onSelect:
|
|
364
|
+
onSelect: se
|
|
311
365
|
}, null, 8, ["activeIndex", "items"]),
|
|
312
|
-
|
|
366
|
+
f.value ? (W(), ve(ne, {
|
|
313
367
|
key: 0,
|
|
314
|
-
activeIndex:
|
|
315
|
-
"onUpdate:activeIndex":
|
|
316
|
-
items:
|
|
368
|
+
activeIndex: m.value,
|
|
369
|
+
"onUpdate:activeIndex": e[2] || (e[2] = (t) => m.value = t),
|
|
370
|
+
items: O.value,
|
|
317
371
|
label: "Seconds",
|
|
318
|
-
onSelect:
|
|
319
|
-
}, null, 8, ["activeIndex", "items"])) :
|
|
320
|
-
|
|
372
|
+
onSelect: Q
|
|
373
|
+
}, null, 8, ["activeIndex", "items"])) : Z("", !0),
|
|
374
|
+
i.value ? (W(), ve(ne, {
|
|
321
375
|
key: 1,
|
|
322
|
-
activeIndex:
|
|
323
|
-
"onUpdate:activeIndex":
|
|
324
|
-
items:
|
|
376
|
+
activeIndex: w.value,
|
|
377
|
+
"onUpdate:activeIndex": e[3] || (e[3] = (t) => w.value = t),
|
|
378
|
+
items: ee.value,
|
|
325
379
|
label: "AM/PM",
|
|
326
|
-
onSelect:
|
|
327
|
-
}, null, 8, ["activeIndex", "items"])) :
|
|
328
|
-
], 512)) :
|
|
380
|
+
onSelect: le
|
|
381
|
+
}, null, 8, ["activeIndex", "items"])) : Z("", !0)
|
|
382
|
+
], 512)) : Z("", !0);
|
|
329
383
|
}
|
|
330
384
|
});
|
|
331
|
-
function
|
|
332
|
-
return typeof
|
|
385
|
+
function Le(n) {
|
|
386
|
+
return typeof n == "string" ? j.test(n) : Array.isArray(n) ? n.length === 2 && j.test(n[0] ?? "") && j.test(n[1] ?? "") : !1;
|
|
387
|
+
}
|
|
388
|
+
function ae(n) {
|
|
389
|
+
return n == null || typeof n == "string" || typeof n == "number";
|
|
333
390
|
}
|
|
334
|
-
const
|
|
391
|
+
const Ve = /^(HH|H|hh|h|kk|k):(mm|m)(?::(ss|s))?(?:\s*(A|a|P|p))?$/, j = /^([01]\d|2[0-3]):([0-5]\d)(:([0-5]\d))?$/, _ = typeof __DEV__ < "u" ? __DEV__ : typeof process < "u" && process.env && process.env.NODE_ENV !== "production", Fe = {
|
|
335
392
|
modelValue: {
|
|
336
393
|
type: [String, Array],
|
|
337
394
|
default: void 0,
|
|
338
|
-
validator: (
|
|
395
|
+
validator: (n) => {
|
|
339
396
|
let o;
|
|
340
|
-
return Array.isArray(
|
|
341
|
-
`[VueTimepicker] \`modelValue\` is wrong. Received: ${
|
|
397
|
+
return Array.isArray(n) ? o = n.length === 2 && n.every((l) => j.test(l)) : o = n == null || j.test(n), !o && _ && console.error(
|
|
398
|
+
`[VueTimepicker] \`modelValue\` is wrong. Received: ${n}`
|
|
342
399
|
), o;
|
|
343
400
|
}
|
|
344
401
|
},
|
|
@@ -356,26 +413,26 @@ const Me = /^(HH|H|hh|h|kk|k):(mm|m)(?::(ss|s))?(?:\s*(A|a|P|p))?$/, j = /^([01]
|
|
|
356
413
|
minTime: {
|
|
357
414
|
type: String,
|
|
358
415
|
default: void 0,
|
|
359
|
-
validator: (
|
|
360
|
-
const o =
|
|
361
|
-
return !o &&
|
|
416
|
+
validator: (n) => {
|
|
417
|
+
const o = n == null || j.test(n);
|
|
418
|
+
return !o && _ && console.error(`[VueTimepicker] \`minTime\` is wrong. Received: ${n}`), o;
|
|
362
419
|
}
|
|
363
420
|
},
|
|
364
421
|
maxTime: {
|
|
365
422
|
type: String,
|
|
366
423
|
default: void 0,
|
|
367
|
-
validator: (
|
|
368
|
-
const o =
|
|
369
|
-
return !o &&
|
|
424
|
+
validator: (n) => {
|
|
425
|
+
const o = n == null || j.test(n);
|
|
426
|
+
return !o && _ && console.error(`[VueTimepicker] \`maxTime\` is wrong. Received: ${n}`), o;
|
|
370
427
|
}
|
|
371
428
|
},
|
|
372
429
|
disabledTimes: {
|
|
373
430
|
type: Array,
|
|
374
431
|
default: void 0,
|
|
375
|
-
validator: (
|
|
376
|
-
const o =
|
|
377
|
-
return !o &&
|
|
378
|
-
`[VueTimepicker] \`disabledTimes\` is wrong. Received: ${JSON.stringify(
|
|
432
|
+
validator: (n) => {
|
|
433
|
+
const o = n == null || n.every(Le);
|
|
434
|
+
return !o && _ && console.error(
|
|
435
|
+
`[VueTimepicker] \`disabledTimes\` is wrong. Received: ${JSON.stringify(n)}`
|
|
379
436
|
), o;
|
|
380
437
|
}
|
|
381
438
|
},
|
|
@@ -386,480 +443,527 @@ const Me = /^(HH|H|hh|h|kk|k):(mm|m)(?::(ss|s))?(?:\s*(A|a|P|p))?$/, j = /^([01]
|
|
|
386
443
|
format: {
|
|
387
444
|
type: String,
|
|
388
445
|
default: "HH:mm",
|
|
389
|
-
validator: (
|
|
390
|
-
const o =
|
|
391
|
-
return !o &&
|
|
392
|
-
`[VueTimepicker] \`format\` format is wrong. Received: ${
|
|
446
|
+
validator: (n) => {
|
|
447
|
+
const o = Ve.test(n);
|
|
448
|
+
return !o && _ && console.error(
|
|
449
|
+
`[VueTimepicker] \`format\` format is wrong. Received: ${n}`
|
|
450
|
+
), o;
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
placeholder: {
|
|
454
|
+
type: String,
|
|
455
|
+
default: "Select time"
|
|
456
|
+
},
|
|
457
|
+
inputWidth: {
|
|
458
|
+
type: [String, Number],
|
|
459
|
+
default: void 0,
|
|
460
|
+
validator: (n) => {
|
|
461
|
+
const o = ae(n);
|
|
462
|
+
return !o && _ && console.error(
|
|
463
|
+
`[VueTimepicker] \`inputWidth\` must be a string or number. Received: ${n}`
|
|
464
|
+
), o;
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
componentWidth: {
|
|
468
|
+
type: [String, Number],
|
|
469
|
+
default: void 0,
|
|
470
|
+
validator: (n) => {
|
|
471
|
+
const o = ae(n);
|
|
472
|
+
return !o && _ && console.error(
|
|
473
|
+
`[VueTimepicker] \`componentWidth\` must be a string or number. Received: ${n}`
|
|
474
|
+
), o;
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
minInputWidth: {
|
|
478
|
+
type: [String, Number],
|
|
479
|
+
default: void 0,
|
|
480
|
+
validator: (n) => {
|
|
481
|
+
const o = ae(n);
|
|
482
|
+
return !o && _ && console.error(
|
|
483
|
+
`[VueTimepicker] \`minInputWidth\` must be a string or number. Received: ${n}`
|
|
484
|
+
), o;
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
maxInputWidth: {
|
|
488
|
+
type: [String, Number],
|
|
489
|
+
default: void 0,
|
|
490
|
+
validator: (n) => {
|
|
491
|
+
const o = ae(n);
|
|
492
|
+
return !o && _ && console.error(
|
|
493
|
+
`[VueTimepicker] \`maxInputWidth\` must be a string or number. Received: ${n}`
|
|
393
494
|
), o;
|
|
394
495
|
}
|
|
395
496
|
},
|
|
396
497
|
size: {
|
|
397
498
|
type: String,
|
|
398
499
|
default: "md",
|
|
399
|
-
validator: (
|
|
400
|
-
const o =
|
|
401
|
-
return !o &&
|
|
500
|
+
validator: (n) => {
|
|
501
|
+
const o = n === "xs" || n === "sm" || n === "md" || n === "lg" || n === "xl";
|
|
502
|
+
return !o && _ && console.error(`[VueTimepicker] \`size\` is wrong. Received: ${n}`), o;
|
|
402
503
|
}
|
|
403
504
|
}
|
|
404
505
|
};
|
|
405
|
-
function
|
|
406
|
-
const o =
|
|
407
|
-
if (!o) throw new Error(`[useTimeMask] Invalid format: ${
|
|
408
|
-
const [, l,
|
|
409
|
-
let
|
|
410
|
-
return
|
|
411
|
-
digitGroups:
|
|
412
|
-
hasAmPm: !!
|
|
413
|
-
ampmLowercase:
|
|
506
|
+
function Ce(n) {
|
|
507
|
+
const o = Ve.exec(n);
|
|
508
|
+
if (!o) throw new Error(`[useTimeMask] Invalid format: ${n}`);
|
|
509
|
+
const [, l, i, f, g] = o, u = [], P = !!g, D = /^k{1,2}$/.test(l);
|
|
510
|
+
let I = 0, F = 23;
|
|
511
|
+
return P ? (I = 1, F = 12) : D && (I = 1, F = 24), u.push({ token: l, min: I, max: F }), u.push({ token: i, min: 0, max: 59 }), f && u.push({ token: f, min: 0, max: 59 }), {
|
|
512
|
+
digitGroups: u,
|
|
513
|
+
hasAmPm: !!g,
|
|
514
|
+
ampmLowercase: g === "a" || g === "p"
|
|
414
515
|
};
|
|
415
516
|
}
|
|
416
|
-
function
|
|
417
|
-
const o =
|
|
418
|
-
function
|
|
419
|
-
const { digitGroups:
|
|
420
|
-
let
|
|
421
|
-
for (let
|
|
422
|
-
for (let
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
if (
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
return
|
|
517
|
+
function Se(n) {
|
|
518
|
+
const o = p(() => Ce(n.value)), l = p(() => o.value.digitGroups.length * 2), i = N([]), f = N("AM"), g = N("");
|
|
519
|
+
function u() {
|
|
520
|
+
const { digitGroups: r, hasAmPm: d } = o.value;
|
|
521
|
+
let c = "", b = 0;
|
|
522
|
+
for (let v = 0; v < r.length; v++) {
|
|
523
|
+
for (let k = 0; k < 2; k++)
|
|
524
|
+
b < i.value.length && (c += String(i.value[b]), b++);
|
|
525
|
+
b === (v + 1) * 2 && v < r.length - 1 && (c += ":");
|
|
526
|
+
}
|
|
527
|
+
if (d && b >= l.value) {
|
|
528
|
+
const v = o.value.ampmLowercase ? f.value.toLowerCase() : f.value;
|
|
529
|
+
c += " " + v;
|
|
530
|
+
}
|
|
531
|
+
return c;
|
|
431
532
|
}
|
|
432
|
-
function
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
const
|
|
436
|
-
|
|
533
|
+
function P(r) {
|
|
534
|
+
const d = r * 2;
|
|
535
|
+
if (i.value.length < d + 2) return;
|
|
536
|
+
const c = i.value[d] * 10 + i.value[d + 1], { min: b, max: v } = o.value.digitGroups[r], k = Math.max(b, Math.min(v, c));
|
|
537
|
+
k !== c && (i.value[d] = Math.floor(k / 10), i.value[d + 1] = k % 10);
|
|
437
538
|
}
|
|
438
|
-
function
|
|
439
|
-
for (let
|
|
440
|
-
|
|
539
|
+
function D() {
|
|
540
|
+
for (let r = 0; r < o.value.digitGroups.length; r++)
|
|
541
|
+
P(r);
|
|
441
542
|
}
|
|
442
|
-
function
|
|
443
|
-
const
|
|
444
|
-
let
|
|
445
|
-
for (let
|
|
446
|
-
/\d/.test(
|
|
447
|
-
return
|
|
543
|
+
function I(r) {
|
|
544
|
+
const d = u();
|
|
545
|
+
let c = 0;
|
|
546
|
+
for (let b = 0; b < Math.min(r, d.length); b++)
|
|
547
|
+
/\d/.test(d[b]) && c++;
|
|
548
|
+
return c;
|
|
448
549
|
}
|
|
449
|
-
function
|
|
450
|
-
return
|
|
550
|
+
function F(r) {
|
|
551
|
+
return r + Math.floor(r / 2);
|
|
451
552
|
}
|
|
452
|
-
function
|
|
453
|
-
if (
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
const
|
|
457
|
-
return
|
|
553
|
+
function y(r, d) {
|
|
554
|
+
if (r >= l.value) return l.value;
|
|
555
|
+
const c = [...i.value];
|
|
556
|
+
c[r] = d, i.value = c;
|
|
557
|
+
const b = Math.floor(r / 2);
|
|
558
|
+
return P(b), Math.min(r + 1, l.value);
|
|
458
559
|
}
|
|
459
|
-
function
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
document.activeElement ===
|
|
560
|
+
function M(r, d) {
|
|
561
|
+
const c = u();
|
|
562
|
+
g.value = c, r.value = c;
|
|
563
|
+
const b = d !== void 0 ? Math.min(F(d), c.length) : c.length;
|
|
564
|
+
r.selectionStart = r.selectionEnd = b, ge(() => {
|
|
565
|
+
document.activeElement === r && (r.selectionStart = r.selectionEnd = b);
|
|
465
566
|
});
|
|
466
567
|
}
|
|
467
|
-
function
|
|
468
|
-
const
|
|
568
|
+
function E(r) {
|
|
569
|
+
const d = r.key, c = r.target;
|
|
469
570
|
if (["Tab", "Escape", "ArrowLeft", "ArrowRight", "Home", "End"].includes(
|
|
470
|
-
|
|
471
|
-
) ||
|
|
571
|
+
d
|
|
572
|
+
) || r.metaKey || r.ctrlKey)
|
|
472
573
|
return;
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
|
|
574
|
+
r.preventDefault();
|
|
575
|
+
const b = c.selectionStart ?? 0, v = I(b);
|
|
576
|
+
if (d === "Backspace") {
|
|
577
|
+
v > 0 && M(c, v - 1);
|
|
477
578
|
return;
|
|
478
579
|
}
|
|
479
|
-
if (
|
|
580
|
+
if (d !== "Delete") {
|
|
480
581
|
if (o.value.hasAmPm) {
|
|
481
|
-
const
|
|
482
|
-
if (
|
|
483
|
-
|
|
582
|
+
const k = d.toLowerCase();
|
|
583
|
+
if (k === "a") {
|
|
584
|
+
f.value = "AM", M(c, v);
|
|
484
585
|
return;
|
|
485
586
|
}
|
|
486
|
-
if (
|
|
487
|
-
|
|
587
|
+
if (k === "p") {
|
|
588
|
+
f.value = "PM", M(c, v);
|
|
488
589
|
return;
|
|
489
590
|
}
|
|
490
591
|
}
|
|
491
|
-
if (/^\d$/.test(
|
|
492
|
-
const
|
|
493
|
-
|
|
592
|
+
if (/^\d$/.test(d)) {
|
|
593
|
+
const k = y(v, +d);
|
|
594
|
+
M(c, k);
|
|
494
595
|
return;
|
|
495
596
|
}
|
|
496
597
|
}
|
|
497
598
|
}
|
|
498
|
-
function
|
|
499
|
-
const
|
|
500
|
-
|
|
599
|
+
function m(r) {
|
|
600
|
+
const d = r.target, c = d.value.replace(/\D/g, "").split("").map(Number).slice(0, l.value);
|
|
601
|
+
i.value = c, D(), o.value.hasAmPm && (/p/i.test(d.value) ? f.value = "PM" : /a/i.test(d.value) && (f.value = "AM")), M(d);
|
|
602
|
+
}
|
|
603
|
+
function S(r) {
|
|
604
|
+
r.preventDefault();
|
|
605
|
+
const d = r.clipboardData?.getData("text") ?? "", c = r.target, b = c.selectionStart ?? 0, v = d.replace(/\D/g, "").split("").map(Number);
|
|
606
|
+
let k = I(b);
|
|
607
|
+
for (const K of v) {
|
|
608
|
+
if (k >= l.value) break;
|
|
609
|
+
k = y(k, K);
|
|
610
|
+
}
|
|
611
|
+
o.value.hasAmPm && (/p\.?m\.?/i.test(d) ? f.value = "PM" : /a\.?m\.?/i.test(d) && (f.value = "AM")), M(c, k);
|
|
501
612
|
}
|
|
502
|
-
function
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
for (const C of f) {
|
|
507
|
-
if (b >= l.value) break;
|
|
508
|
-
b = M(b, C);
|
|
509
|
-
}
|
|
510
|
-
o.value.hasAmPm && (/p\.?m\.?/i.test(u) ? g.value = "PM" : /a\.?m\.?/i.test(u) && (g.value = "AM")), A(d, b);
|
|
613
|
+
function T(r) {
|
|
614
|
+
const { digitGroups: d, hasAmPm: c } = o.value, b = [];
|
|
615
|
+
let v = r.h;
|
|
616
|
+
c ? (f.value = r.h >= 12 ? "PM" : "AM", v = r.h % 12, v === 0 && (v = 12)) : pe(n.value) && (v = r.h === 0 ? 24 : r.h), b.push(Math.floor(v / 10), v % 10), b.push(Math.floor(r.m / 10), r.m % 10), d.length > 2 && b.push(Math.floor(r.s / 10), r.s % 10), i.value = b, g.value = u();
|
|
511
617
|
}
|
|
512
|
-
function
|
|
513
|
-
|
|
514
|
-
let f = s.h;
|
|
515
|
-
d ? (g.value = s.h >= 12 ? "PM" : "AM", f = s.h % 12, f === 0 && (f = 12)) : me(t.value) && (f = s.h === 0 ? 24 : s.h), v.push(Math.floor(f / 10), f % 10), v.push(Math.floor(s.m / 10), s.m % 10), u.length > 2 && v.push(Math.floor(s.s / 10), s.s % 10), e.value = v, r.value = y();
|
|
618
|
+
function V() {
|
|
619
|
+
i.value = [], g.value = "", f.value = "AM";
|
|
516
620
|
}
|
|
517
|
-
function
|
|
518
|
-
if (
|
|
519
|
-
const
|
|
520
|
-
for (let
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
let
|
|
525
|
-
const
|
|
526
|
-
return o.value.hasAmPm && (
|
|
621
|
+
function w() {
|
|
622
|
+
if (i.value.length < l.value) return null;
|
|
623
|
+
const r = [];
|
|
624
|
+
for (let v = 0; v < o.value.digitGroups.length; v++) {
|
|
625
|
+
const k = v * 2;
|
|
626
|
+
r.push(i.value[k] * 10 + i.value[k + 1]);
|
|
627
|
+
}
|
|
628
|
+
let d = r[0];
|
|
629
|
+
const c = r[1], b = r[2] ?? 0;
|
|
630
|
+
return o.value.hasAmPm && (d = f.value === "PM" ? d === 12 ? 12 : d + 12 : d === 12 ? 0 : d), pe(n.value) && d === 24 && (d = 0), { h: d, m: c, s: b };
|
|
527
631
|
}
|
|
528
|
-
const
|
|
529
|
-
() =>
|
|
530
|
-
),
|
|
632
|
+
const A = p(
|
|
633
|
+
() => i.value.length >= l.value
|
|
634
|
+
), C = p(() => o.value.ampmLowercase);
|
|
531
635
|
return {
|
|
532
|
-
inputValue:
|
|
533
|
-
handleKeydown:
|
|
534
|
-
handleInput:
|
|
535
|
-
handlePaste:
|
|
536
|
-
setFromTime:
|
|
537
|
-
|
|
538
|
-
|
|
636
|
+
inputValue: g,
|
|
637
|
+
handleKeydown: E,
|
|
638
|
+
handleInput: m,
|
|
639
|
+
handlePaste: S,
|
|
640
|
+
setFromTime: T,
|
|
641
|
+
clear: V,
|
|
642
|
+
getParsedTime: w,
|
|
643
|
+
isComplete: A,
|
|
539
644
|
totalDigits: l,
|
|
540
|
-
displayPosToDigitIndex:
|
|
541
|
-
ampm:
|
|
542
|
-
ampmLowercase:
|
|
645
|
+
displayPosToDigitIndex: I,
|
|
646
|
+
ampm: f,
|
|
647
|
+
ampmLowercase: C
|
|
543
648
|
};
|
|
544
649
|
}
|
|
545
|
-
const Be = ["data-size", "data-validation", "data-disabled"],
|
|
650
|
+
const Be = ["data-size", "data-validation", "data-disabled"], Re = ["value", "placeholder", "disabled"], _e = ["value", "placeholder", "disabled"], Ke = /* @__PURE__ */ he({
|
|
546
651
|
__name: "TimePicker",
|
|
547
|
-
props:
|
|
652
|
+
props: Fe,
|
|
548
653
|
emits: ["update:modelValue", "update:validationState", "validate", "open", "close", "error"],
|
|
549
|
-
setup(
|
|
550
|
-
const l =
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}), D(y, (a) => {
|
|
558
|
-
if (e.disabled && a) {
|
|
559
|
-
y.value = !1;
|
|
654
|
+
setup(n, { emit: o }) {
|
|
655
|
+
const l = N(null), i = n, f = o, g = N(!1), u = N(!1), P = N("valid"), D = N("valid");
|
|
656
|
+
function I() {
|
|
657
|
+
g.value = !1, u.value = !1;
|
|
658
|
+
}
|
|
659
|
+
function F(e, t) {
|
|
660
|
+
if (i.disabled && t) {
|
|
661
|
+
I();
|
|
560
662
|
return;
|
|
561
663
|
}
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
(
|
|
566
|
-
|
|
664
|
+
t && (e === "first" ? u.value = !1 : g.value = !1);
|
|
665
|
+
}
|
|
666
|
+
L(g, (e) => {
|
|
667
|
+
F("first", e);
|
|
668
|
+
}), L(u, (e) => {
|
|
669
|
+
F("second", e);
|
|
670
|
+
}), L(
|
|
671
|
+
() => i.disabled,
|
|
672
|
+
(e) => {
|
|
673
|
+
e && I();
|
|
567
674
|
}
|
|
568
675
|
);
|
|
569
|
-
const
|
|
676
|
+
const y = p({
|
|
570
677
|
get() {
|
|
571
|
-
if (Array.isArray(
|
|
572
|
-
const [
|
|
573
|
-
return [z(
|
|
678
|
+
if (Array.isArray(i.modelValue)) {
|
|
679
|
+
const [e, t] = i.modelValue;
|
|
680
|
+
return [z(e, i.format), z(t, i.format)];
|
|
574
681
|
} else
|
|
575
|
-
return z(
|
|
682
|
+
return z(i.modelValue, i.format);
|
|
576
683
|
},
|
|
577
|
-
set(
|
|
578
|
-
Array.isArray(
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
]) :
|
|
684
|
+
set(e) {
|
|
685
|
+
Array.isArray(e) ? f("update:modelValue", [
|
|
686
|
+
ie("HH:mm:ss", e[0]),
|
|
687
|
+
ie("HH:mm:ss", e[1])
|
|
688
|
+
]) : f("update:modelValue", ie("HH:mm:ss", e));
|
|
582
689
|
}
|
|
583
|
-
}),
|
|
584
|
-
() =>
|
|
585
|
-
),
|
|
586
|
-
() =>
|
|
587
|
-
),
|
|
588
|
-
const
|
|
589
|
-
return
|
|
690
|
+
}), M = p(
|
|
691
|
+
() => i.minTime ? z(i.minTime) : null
|
|
692
|
+
), E = p(
|
|
693
|
+
() => i.maxTime ? z(i.maxTime) : null
|
|
694
|
+
), m = p(() => !M.value || !E.value ? !0 : U(M.value, E.value) <= 0), S = p(() => P.value === "out-of-range" || i.range && D.value === "out-of-range" ? "out-of-range" : P.value === "invalid" || i.range && D.value === "invalid" ? "invalid" : "valid"), T = p(() => (i.disabledTimes ?? []).map((t) => {
|
|
695
|
+
const s = Array.isArray(t) ? t : [t, t], h = z(s[0]), x = z(s[1]);
|
|
696
|
+
return U(h, x) <= 0 ? [h, x] : [x, h];
|
|
590
697
|
}));
|
|
591
|
-
function
|
|
592
|
-
return !!(
|
|
698
|
+
function V(e) {
|
|
699
|
+
return !!(Ie(e, T.value) || i.isTimeDisabled?.(e));
|
|
593
700
|
}
|
|
594
|
-
function
|
|
595
|
-
return
|
|
701
|
+
function w(e) {
|
|
702
|
+
return e === "first" ? Array.isArray(y.value) ? y.value[0] : y.value : Array.isArray(y.value) ? y.value[1] : y.value;
|
|
596
703
|
}
|
|
597
|
-
function
|
|
598
|
-
|
|
599
|
-
|
|
704
|
+
function A(e) {
|
|
705
|
+
const t = i.modelValue;
|
|
706
|
+
return Array.isArray(t) ? e === "first" ? !!t[0] : !!t[1] : e === "second" ? !1 : typeof t == "string" && t.length > 0;
|
|
707
|
+
}
|
|
708
|
+
function C(e, t) {
|
|
709
|
+
if (e === "first") {
|
|
710
|
+
Array.isArray(y.value) ? y.value = [t, y.value[1]] : y.value = t;
|
|
600
711
|
return;
|
|
601
712
|
}
|
|
602
|
-
Array.isArray(
|
|
603
|
-
}
|
|
604
|
-
function
|
|
605
|
-
if (
|
|
606
|
-
target:
|
|
607
|
-
state:
|
|
608
|
-
reason:
|
|
609
|
-
value:
|
|
610
|
-
}),
|
|
713
|
+
Array.isArray(y.value) && (y.value = [y.value[0], t]);
|
|
714
|
+
}
|
|
715
|
+
function r(e, t, s, h) {
|
|
716
|
+
if (e === "first" ? P.value = t : D.value = t, f("validate", {
|
|
717
|
+
target: e,
|
|
718
|
+
state: t,
|
|
719
|
+
reason: s,
|
|
720
|
+
value: h ? ie("HH:mm:ss", h) : null
|
|
721
|
+
}), t === "valid") {
|
|
611
722
|
l.value = null;
|
|
612
723
|
return;
|
|
613
724
|
}
|
|
614
|
-
if (
|
|
615
|
-
l.value = "OUT_OF_RANGE",
|
|
725
|
+
if (t === "out-of-range") {
|
|
726
|
+
l.value = "OUT_OF_RANGE", f("error", {
|
|
616
727
|
code: "OUT_OF_RANGE",
|
|
617
728
|
message: "Time is outside min/max bounds and was clamped."
|
|
618
729
|
});
|
|
619
730
|
return;
|
|
620
731
|
}
|
|
621
|
-
l.value =
|
|
622
|
-
code:
|
|
623
|
-
message:
|
|
732
|
+
l.value = s ?? "BAD_TIME", f("error", {
|
|
733
|
+
code: s ?? "BAD_TIME",
|
|
734
|
+
message: s === "DISABLED" ? "Time is disabled by disabledTimes or isTimeDisabled." : "Time is invalid."
|
|
624
735
|
});
|
|
625
736
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
(
|
|
629
|
-
|
|
737
|
+
L(
|
|
738
|
+
S,
|
|
739
|
+
(e) => {
|
|
740
|
+
f("update:validationState", e);
|
|
630
741
|
},
|
|
631
742
|
{ immediate: !0 }
|
|
632
743
|
);
|
|
633
|
-
const
|
|
634
|
-
() =>
|
|
635
|
-
),
|
|
636
|
-
() =>
|
|
744
|
+
const d = p(
|
|
745
|
+
() => m.value ? M.value : null
|
|
746
|
+
), c = p(
|
|
747
|
+
() => m.value ? E.value : null
|
|
637
748
|
);
|
|
638
|
-
function
|
|
639
|
-
return
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
749
|
+
function b(e) {
|
|
750
|
+
return $e(
|
|
751
|
+
e,
|
|
752
|
+
d.value,
|
|
753
|
+
c.value
|
|
643
754
|
);
|
|
644
755
|
}
|
|
645
|
-
function
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
),
|
|
651
|
-
return
|
|
756
|
+
function v(e, t, s) {
|
|
757
|
+
const h = !Me(
|
|
758
|
+
t,
|
|
759
|
+
d.value,
|
|
760
|
+
c.value
|
|
761
|
+
), x = b(t);
|
|
762
|
+
return V(x) ? (s.emitValidation && r(e, "invalid", "DISABLED", x), !1) : (C(e, x), s.emitValidation && (h ? r(e, "out-of-range", "OUT_OF_RANGE", x) : r(e, "valid", void 0, x)), !0);
|
|
652
763
|
}
|
|
653
|
-
const
|
|
764
|
+
const k = p({
|
|
654
765
|
get() {
|
|
655
|
-
return Array.isArray(
|
|
766
|
+
return Array.isArray(y.value) ? y.value[0] : y.value;
|
|
656
767
|
},
|
|
657
|
-
set(
|
|
658
|
-
|
|
768
|
+
set(e) {
|
|
769
|
+
!A("first") && !g.value || v("first", e, { emitValidation: !0 });
|
|
659
770
|
}
|
|
660
|
-
}),
|
|
771
|
+
}), K = p({
|
|
661
772
|
get() {
|
|
662
|
-
return Array.isArray(
|
|
773
|
+
return Array.isArray(y.value) ? y.value[1] : y.value;
|
|
663
774
|
},
|
|
664
|
-
set(
|
|
665
|
-
Array.isArray(
|
|
775
|
+
set(e) {
|
|
776
|
+
!A("second") && !u.value || Array.isArray(y.value) && v("second", e, { emitValidation: !0 });
|
|
666
777
|
}
|
|
667
778
|
});
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
() => e.range,
|
|
674
|
-
(a) => {
|
|
675
|
-
if (a) {
|
|
676
|
-
if (!Array.isArray(e.modelValue))
|
|
779
|
+
L(
|
|
780
|
+
() => i.range,
|
|
781
|
+
(e) => {
|
|
782
|
+
if (e) {
|
|
783
|
+
if (i.modelValue != null && !Array.isArray(i.modelValue))
|
|
677
784
|
throw new RangeError(
|
|
678
|
-
`Model value must be an array for range selection: ${
|
|
785
|
+
`Model value must be an array for range selection: ${i.modelValue}`
|
|
679
786
|
);
|
|
680
|
-
} else if (Array.isArray(
|
|
787
|
+
} else if (Array.isArray(i.modelValue))
|
|
681
788
|
throw new RangeError(
|
|
682
|
-
`Model value must be a single string for single time selection: ${
|
|
789
|
+
`Model value must be a single string for single time selection: ${i.modelValue}`
|
|
683
790
|
);
|
|
684
791
|
},
|
|
685
792
|
{ immediate: !0 }
|
|
686
|
-
)
|
|
687
|
-
|
|
688
|
-
()
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
793
|
+
);
|
|
794
|
+
function G() {
|
|
795
|
+
A("first") && v("first", w("first"), {
|
|
796
|
+
emitValidation: !0
|
|
797
|
+
}), i.range && A("second") && v("second", w("second"), {
|
|
798
|
+
emitValidation: !0
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
L(
|
|
802
|
+
() => [d.value, c.value, i.range],
|
|
803
|
+
G,
|
|
695
804
|
{ immediate: !0 }
|
|
696
|
-
),
|
|
697
|
-
() => [
|
|
698
|
-
|
|
699
|
-
d("first", U("first"), {
|
|
700
|
-
emitValidation: !0
|
|
701
|
-
}), e.range && d("second", U("second"), {
|
|
702
|
-
emitValidation: !0
|
|
703
|
-
});
|
|
704
|
-
},
|
|
805
|
+
), L(
|
|
806
|
+
() => [T.value, i.isTimeDisabled, i.range],
|
|
807
|
+
G,
|
|
705
808
|
{ immediate: !0 }
|
|
706
809
|
);
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
810
|
+
const B = p(() => i.format ?? "HH:mm:ss"), q = p(() => i.placeholder ?? "Select time");
|
|
811
|
+
function O(e) {
|
|
812
|
+
if (e == null) return;
|
|
813
|
+
if (typeof e == "number") return `${e}px`;
|
|
814
|
+
const t = e.trim();
|
|
815
|
+
return t.length > 0 ? t : void 0;
|
|
816
|
+
}
|
|
817
|
+
const ee = p(() => {
|
|
818
|
+
let e = Math.max(
|
|
819
|
+
B.value.length,
|
|
820
|
+
q.value.length
|
|
821
|
+
);
|
|
822
|
+
return /[AaPp]$/.test(B.value) && (e = Math.max(e, B.value.length + 1)), `${Math.min(20, Math.max(6, e))}ch`;
|
|
823
|
+
}), oe = p(() => {
|
|
824
|
+
const e = {}, t = O(i.componentWidth), s = O(i.inputWidth), h = O(i.minInputWidth), x = O(i.maxInputWidth);
|
|
825
|
+
return t && (e["--vtp-component-width"] = t), s && (e["--vtp-input-width"] = s), h && (e["--vtp-input-min-width"] = h), x && (e["--vtp-input-max-width"] = x), e;
|
|
826
|
+
}), te = p(() => ({
|
|
827
|
+
width: `var(--vtp-input-width, ${ee.value})`,
|
|
828
|
+
minWidth: "var(--vtp-input-min-width, 0)",
|
|
829
|
+
maxWidth: "var(--vtp-input-max-width, none)"
|
|
830
|
+
})), $ = Se(B), re = $.inputValue, H = Se(B), se = H.inputValue;
|
|
831
|
+
L(
|
|
832
|
+
() => [k.value, B.value],
|
|
833
|
+
([e]) => {
|
|
834
|
+
if (!A("first")) {
|
|
835
|
+
$.clear();
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
$.setFromTime(e);
|
|
715
839
|
},
|
|
716
840
|
{ immediate: !0 }
|
|
717
|
-
),
|
|
718
|
-
() => [
|
|
719
|
-
([
|
|
720
|
-
if (!
|
|
721
|
-
|
|
841
|
+
), L(
|
|
842
|
+
() => [K.value, B.value, i.range],
|
|
843
|
+
([e, , t]) => {
|
|
844
|
+
if (!t || !A("second")) {
|
|
845
|
+
H.clear();
|
|
722
846
|
return;
|
|
723
847
|
}
|
|
724
|
-
|
|
848
|
+
H.setFromTime(e);
|
|
725
849
|
},
|
|
726
850
|
{ immediate: !0 }
|
|
727
851
|
);
|
|
728
|
-
const
|
|
729
|
-
function
|
|
730
|
-
if (
|
|
731
|
-
if (
|
|
732
|
-
|
|
852
|
+
const Q = N(null);
|
|
853
|
+
function le(e) {
|
|
854
|
+
if (i.disabled) return;
|
|
855
|
+
if (e.key === "Enter") {
|
|
856
|
+
e.preventDefault(), a("first");
|
|
733
857
|
return;
|
|
734
858
|
}
|
|
735
|
-
/^\d$/.test(
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
const
|
|
739
|
-
|
|
859
|
+
/^\d$/.test(e.key) && (g.value = !1, u.value = !1);
|
|
860
|
+
const t = e.target, s = $.displayPosToDigitIndex(t.selectionStart ?? 0), h = /^\d$/.test(e.key) && s >= $.totalDigits.value - 1;
|
|
861
|
+
if ($.handleKeydown(e), /^\d$/.test(e.key)) {
|
|
862
|
+
const x = $.getParsedTime();
|
|
863
|
+
x && v("first", x, { emitValidation: !1 });
|
|
740
864
|
}
|
|
741
|
-
|
|
742
|
-
const
|
|
743
|
-
|
|
865
|
+
i.range && h && Q.value && (a("first"), ge(() => {
|
|
866
|
+
const x = Q.value;
|
|
867
|
+
x && (x.focus(), x.selectionStart = x.selectionEnd = 0);
|
|
744
868
|
}));
|
|
745
869
|
}
|
|
746
|
-
function
|
|
747
|
-
if (!
|
|
748
|
-
if (
|
|
749
|
-
|
|
870
|
+
function X(e) {
|
|
871
|
+
if (!i.disabled) {
|
|
872
|
+
if (e.key === "Enter") {
|
|
873
|
+
e.preventDefault(), a("second");
|
|
750
874
|
return;
|
|
751
875
|
}
|
|
752
|
-
if (/^\d$/.test(
|
|
753
|
-
const
|
|
754
|
-
|
|
876
|
+
if (/^\d$/.test(e.key) && (g.value = !1, u.value = !1), H.handleKeydown(e), /^\d$/.test(e.key)) {
|
|
877
|
+
const t = H.getParsedTime();
|
|
878
|
+
t && v("second", t, { emitValidation: !1 });
|
|
755
879
|
}
|
|
756
880
|
}
|
|
757
881
|
}
|
|
758
|
-
function
|
|
759
|
-
const
|
|
760
|
-
|
|
882
|
+
function a(e) {
|
|
883
|
+
const t = e === "first" ? $ : H, s = t.getParsedTime();
|
|
884
|
+
s ? v(e, s, { emitValidation: !0 }) : t.inputValue.value.trim() ? r(e, "invalid", "BAD_TIME") : !i.range && e === "first" && (f("update:modelValue", null), r("first", "valid")), e === "first" ? A("first") ? $.setFromTime(k.value) : $.clear() : i.range && (A("second") ? H.setFromTime(K.value) : H.clear());
|
|
761
885
|
}
|
|
762
|
-
return (
|
|
886
|
+
return (e, t) => (W(), Y("div", {
|
|
763
887
|
class: "timepicker-shell",
|
|
764
|
-
"data-size":
|
|
765
|
-
"data-validation":
|
|
766
|
-
"data-disabled":
|
|
888
|
+
"data-size": i.size,
|
|
889
|
+
"data-validation": S.value,
|
|
890
|
+
"data-disabled": i.disabled ? "true" : "false",
|
|
891
|
+
style: ue(oe.value)
|
|
767
892
|
}, [
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
class: re(["timepicker-shell__input", {
|
|
771
|
-
"timepicker-shell__input--error": l.value,
|
|
772
|
-
"timepicker-shell__input--disabled": e.disabled
|
|
773
|
-
}])
|
|
774
|
-
}, [
|
|
775
|
-
X("input", {
|
|
776
|
-
type: "text",
|
|
777
|
-
class: "timepicker-field",
|
|
778
|
-
value: H(Y),
|
|
779
|
-
placeholder: b.value,
|
|
780
|
-
style: oe({ width: C.value }),
|
|
781
|
-
disabled: e.disabled,
|
|
782
|
-
onFocus: i[4] || (i[4] = (m) => !e.disabled && (r.value = !0)),
|
|
783
|
-
onKeydown: te,
|
|
784
|
-
onInput: i[5] || (i[5] = //@ts-ignore
|
|
785
|
-
(...m) => H(P).handleInput && H(P).handleInput(...m)),
|
|
786
|
-
onPaste: i[6] || (i[6] = //@ts-ignore
|
|
787
|
-
(...m) => H(P).handlePaste && H(P).handlePaste(...m)),
|
|
788
|
-
onBlur: i[7] || (i[7] = (m) => !e.disabled && G("first"))
|
|
789
|
-
}, null, 44, _e),
|
|
790
|
-
i[16] || (i[16] = X("span", { class: "timepicker-separator" }, "–", -1)),
|
|
791
|
-
X("input", {
|
|
792
|
-
ref_key: "secondInputRef",
|
|
793
|
-
ref: J,
|
|
794
|
-
type: "text",
|
|
795
|
-
class: "timepicker-field",
|
|
796
|
-
value: H(ee),
|
|
797
|
-
placeholder: b.value,
|
|
798
|
-
style: oe({ width: C.value }),
|
|
799
|
-
disabled: e.disabled,
|
|
800
|
-
onFocus: i[8] || (i[8] = (m) => !e.disabled && (y.value = !0)),
|
|
801
|
-
onKeydown: ie,
|
|
802
|
-
onInput: i[9] || (i[9] = //@ts-ignore
|
|
803
|
-
(...m) => H($).handleInput && H($).handleInput(...m)),
|
|
804
|
-
onPaste: i[10] || (i[10] = //@ts-ignore
|
|
805
|
-
(...m) => H($).handlePaste && H($).handlePaste(...m)),
|
|
806
|
-
onBlur: i[11] || (i[11] = (m) => !e.disabled && G("second"))
|
|
807
|
-
}, null, 44, Re)
|
|
808
|
-
], 2)) : (K(), W("div", {
|
|
809
|
-
key: 0,
|
|
810
|
-
class: re(["timepicker-shell__input", {
|
|
893
|
+
J("div", {
|
|
894
|
+
class: me(["timepicker-shell__input", {
|
|
811
895
|
"timepicker-shell__input--error": l.value,
|
|
812
|
-
"timepicker-shell__input--disabled":
|
|
896
|
+
"timepicker-shell__input--disabled": i.disabled
|
|
813
897
|
}])
|
|
814
898
|
}, [
|
|
815
|
-
|
|
899
|
+
J("input", {
|
|
816
900
|
type: "text",
|
|
817
901
|
class: "timepicker-field",
|
|
818
|
-
value:
|
|
819
|
-
placeholder:
|
|
820
|
-
style:
|
|
821
|
-
disabled:
|
|
822
|
-
onFocus:
|
|
823
|
-
onKeydown:
|
|
824
|
-
onInput:
|
|
825
|
-
(...
|
|
826
|
-
onPaste:
|
|
827
|
-
(...
|
|
828
|
-
onBlur:
|
|
829
|
-
}, null, 44,
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
902
|
+
value: R(re),
|
|
903
|
+
placeholder: q.value,
|
|
904
|
+
style: ue(te.value),
|
|
905
|
+
disabled: i.disabled,
|
|
906
|
+
onFocus: t[0] || (t[0] = (s) => !i.disabled && (g.value = !0)),
|
|
907
|
+
onKeydown: le,
|
|
908
|
+
onInput: t[1] || (t[1] = //@ts-ignore
|
|
909
|
+
(...s) => R($).handleInput && R($).handleInput(...s)),
|
|
910
|
+
onPaste: t[2] || (t[2] = //@ts-ignore
|
|
911
|
+
(...s) => R($).handlePaste && R($).handlePaste(...s)),
|
|
912
|
+
onBlur: t[3] || (t[3] = (s) => !i.disabled && a("first"))
|
|
913
|
+
}, null, 44, Re),
|
|
914
|
+
i.range ? (W(), Y(xe, { key: 0 }, [
|
|
915
|
+
t[12] || (t[12] = J("span", { class: "timepicker-separator" }, "–", -1)),
|
|
916
|
+
J("input", {
|
|
917
|
+
ref_key: "secondInputRef",
|
|
918
|
+
ref: Q,
|
|
919
|
+
type: "text",
|
|
920
|
+
class: "timepicker-field",
|
|
921
|
+
value: R(se),
|
|
922
|
+
placeholder: q.value,
|
|
923
|
+
style: ue(te.value),
|
|
924
|
+
disabled: i.disabled,
|
|
925
|
+
onFocus: t[4] || (t[4] = (s) => !i.disabled && (u.value = !0)),
|
|
926
|
+
onKeydown: X,
|
|
927
|
+
onInput: t[5] || (t[5] = //@ts-ignore
|
|
928
|
+
(...s) => R(H).handleInput && R(H).handleInput(...s)),
|
|
929
|
+
onPaste: t[6] || (t[6] = //@ts-ignore
|
|
930
|
+
(...s) => R(H).handlePaste && R(H).handlePaste(...s)),
|
|
931
|
+
onBlur: t[7] || (t[7] = (s) => !i.disabled && a("second"))
|
|
932
|
+
}, null, 44, _e)
|
|
933
|
+
], 64)) : Z("", !0)
|
|
934
|
+
], 2),
|
|
935
|
+
J("div", null, [
|
|
936
|
+
fe(ke, {
|
|
937
|
+
open: g.value,
|
|
938
|
+
"onUpdate:open": t[8] || (t[8] = (s) => g.value = s),
|
|
939
|
+
initTime: k.value,
|
|
940
|
+
"onUpdate:initTime": t[9] || (t[9] = (s) => k.value = s),
|
|
941
|
+
format: i.format,
|
|
942
|
+
"hour-step": i.hourStep,
|
|
943
|
+
"minute-step": i.minuteStep,
|
|
944
|
+
"second-step": i.secondStep,
|
|
945
|
+
"min-time": d.value,
|
|
946
|
+
"max-time": c.value,
|
|
947
|
+
"disabled-ranges": T.value,
|
|
948
|
+
"is-time-disabled": i.isTimeDisabled
|
|
845
949
|
}, null, 8, ["open", "initTime", "format", "hour-step", "minute-step", "second-step", "min-time", "max-time", "disabled-ranges", "is-time-disabled"]),
|
|
846
|
-
|
|
950
|
+
i.range ? (W(), ve(ke, {
|
|
847
951
|
key: 0,
|
|
848
|
-
open:
|
|
849
|
-
"onUpdate:open":
|
|
850
|
-
initTime:
|
|
851
|
-
"onUpdate:initTime":
|
|
852
|
-
format:
|
|
853
|
-
"hour-step":
|
|
854
|
-
"minute-step":
|
|
855
|
-
"second-step":
|
|
856
|
-
"min-time":
|
|
857
|
-
"max-time":
|
|
858
|
-
"disabled-ranges":
|
|
859
|
-
"is-time-disabled":
|
|
860
|
-
}, null, 8, ["open", "initTime", "format", "hour-step", "minute-step", "second-step", "min-time", "max-time", "disabled-ranges", "is-time-disabled"])) :
|
|
952
|
+
open: u.value,
|
|
953
|
+
"onUpdate:open": t[10] || (t[10] = (s) => u.value = s),
|
|
954
|
+
initTime: K.value,
|
|
955
|
+
"onUpdate:initTime": t[11] || (t[11] = (s) => K.value = s),
|
|
956
|
+
format: i.format,
|
|
957
|
+
"hour-step": i.hourStep,
|
|
958
|
+
"minute-step": i.minuteStep,
|
|
959
|
+
"second-step": i.secondStep,
|
|
960
|
+
"min-time": d.value,
|
|
961
|
+
"max-time": c.value,
|
|
962
|
+
"disabled-ranges": T.value,
|
|
963
|
+
"is-time-disabled": i.isTimeDisabled
|
|
964
|
+
}, null, 8, ["open", "initTime", "format", "hour-step", "minute-step", "second-step", "min-time", "max-time", "disabled-ranges", "is-time-disabled"])) : Z("", !0)
|
|
861
965
|
])
|
|
862
|
-
],
|
|
966
|
+
], 12, Be));
|
|
863
967
|
}
|
|
864
968
|
});
|
|
865
969
|
export {
|