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