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