@manik02/vue3-timepicker 0.4.1 → 0.4.3

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