@manik02/vue3-timepicker 0.4.2 → 0.4.4

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