@manik02/vue3-timepicker 0.4.6 → 1.1.0

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