@quidgest/ui 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/json/api.json +1 -1
  2. package/dist/ui.css +9 -11
  3. package/dist/ui.esm.js +3717 -3582
  4. package/dist/ui.js +28 -28
  5. package/dist/ui.min.css +1 -1
  6. package/dist/ui.min.js +272 -225
  7. package/dist/ui.scss +16 -17
  8. package/esm/components/QCombobox/QCombobox.d.ts.map +1 -1
  9. package/esm/components/QCombobox/index.d.ts.map +1 -1
  10. package/esm/components/QDateTimePicker/QDateTimePicker.d.ts +439 -0
  11. package/esm/components/QDateTimePicker/QDateTimePicker.d.ts.map +1 -1
  12. package/esm/components/QDateTimePicker/QDateTimePicker.vue.js +754 -627
  13. package/esm/components/QDateTimePicker/index.d.ts +219 -0
  14. package/esm/components/QDateTimePicker/index.d.ts.map +1 -1
  15. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts.map +1 -1
  16. package/esm/components/QIcon/InlineSvg.d.ts.map +1 -1
  17. package/esm/components/QIcon/InlineSvg.js +2 -2
  18. package/esm/components/QList/QList.d.ts.map +1 -1
  19. package/esm/components/QList/index.d.ts.map +1 -1
  20. package/esm/components/QPasswordField/QPasswordField.d.ts.map +1 -1
  21. package/esm/components/QPasswordField/index.d.ts.map +1 -1
  22. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  23. package/esm/components/QSelect/index.d.ts.map +1 -1
  24. package/esm/components/QSidebar/QSidebarAnchor.d.ts.map +1 -1
  25. package/esm/components/QTextField/QTextField.d.ts.map +1 -1
  26. package/esm/components/QTextField/index.d.ts.map +1 -1
  27. package/esm/composables/useInputMask/index.js +9 -9
  28. package/esm/utils/date.d.ts +6 -0
  29. package/esm/utils/date.d.ts.map +1 -1
  30. package/esm/utils/date.js +139 -131
  31. package/esm/utils/index.js +19 -18
  32. package/package.json +7 -12
@@ -1,23 +1,23 @@
1
- import { defineComponent as xn, mergeModels as Tn, useModel as Sn, computed as s, ref as q, useTemplateRef as Be, watch as se, onBeforeUnmount as In, createElementBlock as S, openBlock as f, Fragment as V, createVNode as i, createBlock as U, createCommentVNode as M, unref as o, normalizeClass as yt, createSlots as Cn, withCtx as b, mergeProps as ne, renderSlot as Hn, createElementVNode as k, normalizeProps as W, guardReactiveProps as Q, renderList as ge, toDisplayString as Le, nextTick as F } from "vue";
2
- import { WEEKDAY_NAMES as Oe, MONTH_NAMES as $e, DEFAULT_TEXTS as qn, DEFAULT_ICONS as En } from "./constants.js";
1
+ import { defineComponent as Gn, mergeModels as Xn, useModel as Zn, computed as s, ref as C, useTemplateRef as ce, watch as fe, onBeforeUnmount as Jn, createElementBlock as S, openBlock as m, Fragment as Y, createVNode as i, createBlock as W, createCommentVNode as x, unref as o, mergeProps as Q, createSlots as ea, withCtx as b, renderSlot as ta, createElementVNode as k, normalizeProps as G, guardReactiveProps as X, renderList as _e, toDisplayString as Xe, normalizeClass as na, nextTick as q } from "vue";
2
+ import { WEEKDAY_NAMES as Ze, MONTH_NAMES as Je, DEFAULT_TEXTS as aa, DEFAULT_ICONS as ra } from "./constants.js";
3
3
  import { QButton as p } from "../QButton/index.js";
4
- import { QIcon as w } from "../QIcon/index.js";
5
- import { QOverlay as Fn } from "../QOverlay/index.js";
6
- import { QSwitch as Nn } from "../QSwitch/index.js";
7
- import { QTextField as Me } from "../QTextField/index.js";
8
- import { useInputMask as Rn, applyMask as we, clampNumericSegments as ht, resolveCursorPosition as Pn } from "../../composables/useInputMask/index.js";
9
- import { formatUsesTime as Vn, formatUsesSeconds as Yn, uses12HourFormat as An, isTimeOnlyFormat as Bn, parseDate as L, formatDate as j, getFirstDayOfMonth as Ln, getDaysInMonth as bt, isBetween as On, isSameDay as xe, convertDatePatternToMask as $n, padNumber as Ke, parseDateWithCompletion as ze, inputIncludesTimePortion as kt } from "../../utils/date.js";
10
- const Kn = {
4
+ import { QIcon as I } from "../QIcon/index.js";
5
+ import { QOverlay as la } from "../QOverlay/index.js";
6
+ import { QSwitch as ua } from "../QSwitch/index.js";
7
+ import { QTextField as Fe } from "../QTextField/index.js";
8
+ import { useInputMask as oa, applyMask as Re, clampNumericSegments as St, resolveCursorPosition as ia } from "../../composables/useInputMask/index.js";
9
+ import { formatUsesTime as sa, formatUsesSeconds as ca, uses12HourFormat as fa, isTimeOnlyFormat as da, formatDate as V, getFirstDayOfMonth as va, getDaysInMonth as Ct, isBetween as ma, isSameDay as Ne, convertDatePatternToMask as pa, parseDate as de, parseIsoDate as et, padNumber as tt, parseDateWithCompletion as nt, inputIncludesTimePortion as qt } from "../../utils/date.js";
10
+ const ga = {
11
11
  key: 0,
12
12
  ref: "calendar",
13
13
  class: "q-date-time-picker__calendar"
14
- }, zn = { class: "q-date-time-picker__header" }, Un = { class: "q-date-time-picker__weekdays" }, Wn = { class: "q-date-time-picker__time" }, Qn = {
14
+ }, ya = { class: "q-date-time-picker__header" }, ha = { class: "q-date-time-picker__weekdays" }, ba = { class: "q-date-time-picker__time" }, ka = {
15
15
  key: 0,
16
16
  class: "q-date-time-picker__time-period"
17
- }, jn = { class: "q-date-time-picker__time-inputs" }, Gn = { class: "q-date-time-picker__time-input-group" }, Xn = { class: "q-date-time-picker__time-input-group" }, Zn = { class: "q-date-time-picker__time-input-group" }, Jn = { class: "q-date-time-picker__month-grid" }, ea = { class: "q-date-time-picker__year" }, ta = { class: "q-date-time-picker__year-change" }, na = { class: "q-date-time-picker__year-interval" }, aa = { class: "q-date-time-picker__year-grid" }, la = { class: "q-date-time-picker__bottom-bar" }, G = 1001, X = 9999, ce = 26, _t = 'a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable]', ma = /* @__PURE__ */ xn({
17
+ }, _a = { class: "q-date-time-picker__time-inputs" }, Da = { class: "q-date-time-picker__time-input-group" }, wa = { class: "q-date-time-picker__time-input-group" }, Ma = { class: "q-date-time-picker__time-input-group" }, Ta = { class: "q-date-time-picker__month-grid" }, xa = { class: "q-date-time-picker__year" }, Ia = { class: "q-date-time-picker__year-change" }, Ha = { class: "q-date-time-picker__year-interval" }, Sa = { class: "q-date-time-picker__year-grid" }, Ca = { class: "q-date-time-picker__bottom-bar" }, Z = 1001, J = 9999, ve = 26, Ft = 'a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable]', La = /* @__PURE__ */ Gn({
18
18
  inheritAttrs: !1,
19
19
  __name: "QDateTimePicker",
20
- props: /* @__PURE__ */ Tn({
20
+ props: /* @__PURE__ */ Xn({
21
21
  id: {},
22
22
  class: {},
23
23
  label: {},
@@ -33,748 +33,864 @@ const Kn = {
33
33
  clearable: { type: Boolean },
34
34
  format: { default: "dd/MM/yyyy HH:mm" },
35
35
  range: { type: Boolean },
36
- icons: { default: () => En },
37
- texts: { default: () => qn }
36
+ icons: { default: () => ra },
37
+ texts: { default: () => aa }
38
38
  }, {
39
39
  modelValue: {},
40
40
  modelModifiers: {}
41
41
  }),
42
42
  emits: ["update:modelValue"],
43
- setup(Ue) {
44
- const l = Ue, We = Sn(Ue, "modelValue"), v = s({
45
- get: () => We.value,
46
- set: (e) => We.value = e || void 0
47
- }), Dt = s(
48
- () => l.readonly || l.disabled ? void 0 : l.placeholder
49
- ), ae = s(() => Vn(l.format)), ye = s(() => Yn(l.format)), Z = s(() => An(l.format)), J = s(() => Bn(l.format)), Mt = s(
50
- () => g.value === (/* @__PURE__ */ new Date()).getMonth() && h.value === (/* @__PURE__ */ new Date()).getFullYear()
51
- ), x = q(!1), Te = q(!1), _ = q(""), I = q(null), Y = q(!1);
52
- let de = 0;
53
- const D = q("date"), g = q((/* @__PURE__ */ new Date()).getMonth()), h = q((/* @__PURE__ */ new Date()).getFullYear()), le = q((/* @__PURE__ */ new Date()).getFullYear());
54
- let re = null, O = !1, fe = !1, Se = !1;
55
- function Qe() {
43
+ setup(at) {
44
+ const r = at, rt = Zn(at, "modelValue"), c = s({
45
+ get: () => rt.value,
46
+ set: (e) => rt.value = e || void 0
47
+ }), Rt = s(
48
+ () => r.readonly || r.disabled ? void 0 : r.placeholder
49
+ ), re = s(() => sa(r.format)), De = s(() => ca(r.format)), ee = s(() => fa(r.format)), E = s(() => da(r.format)), Nt = s(
50
+ () => y.value === (/* @__PURE__ */ new Date()).getMonth() && h.value === (/* @__PURE__ */ new Date()).getFullYear()
51
+ ), H = C(!1), Ve = C(!1), g = C(""), D = C(null), F = C(!1);
52
+ let me = 0;
53
+ const w = C("date"), y = C((/* @__PURE__ */ new Date()).getMonth()), h = C((/* @__PURE__ */ new Date()).getFullYear()), le = C((/* @__PURE__ */ new Date()).getFullYear());
54
+ let ue = null, A = !1, pe = !1, te = !1, oe = null;
55
+ function lt() {
56
56
  queueMicrotask(() => {
57
57
  requestAnimationFrame(() => {
58
- var a, n;
59
- const e = ie((a = C.value) == null ? void 0 : a.inputRef), t = document.activeElement;
60
- if (e && (t === e || t instanceof Node && ((n = N.value) != null && n.contains(t)))) {
61
- O = !0;
62
- return;
63
- }
64
- O = !1;
58
+ var a;
59
+ const e = ae(), t = document.activeElement;
60
+ e && (t === e || t instanceof Node && ((a = R.value) != null && a.contains(t))) && (A = !0);
65
61
  });
66
62
  });
67
63
  }
68
- const C = Be("field"), N = Be("menu"), Ie = Be("calendar"), E = s(() => ({
64
+ const L = ce("field"), R = ce("menu"), Ee = ce("calendar"), Vt = ce("monthHeader"), Et = ce("yearHeader"), Pt = ce("toggleTime"), Pe = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Map();
65
+ function we(e) {
66
+ if (!e) return null;
67
+ if (e instanceof HTMLElement) return e;
68
+ if (typeof e == "object" && "$el" in e) {
69
+ const t = e.$el;
70
+ return t instanceof HTMLElement ? t : null;
71
+ }
72
+ return null;
73
+ }
74
+ function Yt(e, t) {
75
+ const a = we(e);
76
+ a ? Pe.set(t, a) : Pe.delete(t);
77
+ }
78
+ function At(e, t) {
79
+ const a = we(e);
80
+ a ? Ye.set(t, a) : Ye.delete(t);
81
+ }
82
+ function Lt(e) {
83
+ var t;
84
+ (t = we(e)) == null || t.focus();
85
+ }
86
+ const O = s(() => ({
69
87
  getMonthIndex: (e, t) => {
70
88
  const a = e.toLowerCase();
71
- return $e.findIndex((n) => {
72
- const r = l.texts[n] ?? n;
73
- return (t ? r.substring(0, 3) : r).toLowerCase() === a;
89
+ return Je.findIndex((n) => {
90
+ const l = r.texts[n] ?? n;
91
+ return (t ? l.substring(0, 3) : l).toLowerCase() === a;
74
92
  });
75
93
  },
76
94
  getWeekdayIndex: (e, t) => {
77
95
  const a = e.toLowerCase();
78
96
  for (let n = 0; n < 7; n++) {
79
- const r = (n + 6) % 7, u = Oe[r], c = l.texts[u] ?? u;
80
- if ((t ? c.substring(0, 3) : c).toLowerCase() === a) return n;
97
+ const l = (n + 6) % 7, u = Ze[l], f = r.texts[u] ?? u;
98
+ if ((t ? f.substring(0, 3) : f).toLowerCase() === a) return n;
81
99
  }
82
100
  return null;
83
101
  }
84
- })), T = s(() => {
85
- const e = v.value;
86
- return e ? e instanceof Date ? e : Array.isArray(e) && e.length > 0 ? e[0] : typeof e == "string" ? L(e, l.format, E.value) : null : null;
87
- }), Ce = s(() => {
88
- const e = v.value;
102
+ })), M = s(() => {
103
+ const e = c.value;
104
+ return e ? e instanceof Date ? e : Array.isArray(e) && e.length > 0 ? e[0] : typeof e == "string" ? ne(e) : null : null;
105
+ }), Me = s(() => {
106
+ const e = c.value;
89
107
  return Array.isArray(e) && e.length > 1 ? e[1] : null;
90
- }), m = q(null), ee = q(null), R = q(null), A = q(!1), wt = s(() => !A.value || !m.value ? T.value : R.value && R.value < m.value ? R.value : m.value), xt = s(() => {
91
- if (!l.range) return T.value;
92
- if (!A.value || !m.value)
93
- return Ce.value;
94
- const e = R.value ?? ee.value;
95
- return e ? e < m.value ? m.value : e : null;
96
- }), $ = s(() => ({
108
+ }), v = C(null), ie = C(null), B = C(null), $ = C(!1), Ot = s(() => !$.value || !v.value ? M.value : B.value && B.value < v.value ? B.value : v.value), Bt = s(() => {
109
+ if (!r.range) return M.value;
110
+ if (!$.value || !v.value)
111
+ return Me.value;
112
+ const e = B.value ?? ie.value;
113
+ return e ? e < v.value ? v.value : e : null;
114
+ }), N = s(() => ({
97
115
  getMonthName: (e, t) => {
98
- const a = be(e);
116
+ const a = xe(e);
99
117
  return t ? a.substring(0, 3) : a;
100
118
  },
101
119
  getWeekdayName: (e, t) => {
102
- const a = (e + 6) % 7, n = Oe[a], r = l.texts[n] ?? n;
103
- return t ? r.substring(0, 3) : r;
120
+ const a = (e + 6) % 7, n = Ze[a], l = r.texts[n] ?? n;
121
+ return t ? l.substring(0, 3) : l;
104
122
  }
105
- })), Tt = s(() => {
106
- const e = v.value;
107
- return e ? Array.isArray(e) ? e.map(
108
- (t) => t instanceof Date ? j(t, l.format, $.value) : t
109
- ).join(" - ") : e instanceof Date ? j(e, l.format, $.value) : String(e) : "";
110
- }), je = s(() => I.value ?? Tt.value);
111
- function he() {
112
- _.value = je.value;
113
- }
114
- se(
115
- je,
123
+ })), $t = s(() => {
124
+ const e = c.value;
125
+ if (!e) return "";
126
+ if (Array.isArray(e))
127
+ return e.map(
128
+ (t) => t instanceof Date ? V(t, r.format, N.value) : t
129
+ ).join(" - ");
130
+ if (e instanceof Date)
131
+ return V(e, r.format, N.value);
132
+ if (typeof e == "string") {
133
+ const t = ne(e);
134
+ return t ? V(t, r.format, N.value) : String(e);
135
+ }
136
+ return String(e);
137
+ }), ut = s(() => D.value ?? $t.value);
138
+ function Te() {
139
+ g.value = ut.value;
140
+ }
141
+ fe(
142
+ ut,
116
143
  () => {
117
- Te.value || he();
144
+ Ve.value || Te();
118
145
  },
119
146
  { immediate: !0 }
120
147
  );
121
- const Ge = s(() => {
122
- const e = Ln(new Date(h.value, g.value, 1)), t = bt(g.value, h.value), a = (e.getDay() + 6) % 7, n = [], r = g.value === 0 ? 11 : g.value - 1, u = g.value === 0 ? h.value - 1 : h.value, c = bt(r, u);
148
+ const ot = s(() => {
149
+ const e = va(new Date(h.value, y.value, 1)), t = Ct(y.value, h.value), a = (e.getDay() + 6) % 7, n = [], l = y.value === 0 ? 11 : y.value - 1, u = y.value === 0 ? h.value - 1 : h.value, f = Ct(l, u);
123
150
  for (let d = a - 1; d >= 0; d--) {
124
- const H = new Date(u, r, c - d);
125
- He(n, H, !1);
151
+ const T = new Date(u, l, f - d);
152
+ Ae(n, T, !1);
126
153
  }
127
154
  for (let d = 1; d <= t; d++) {
128
- const H = new Date(h.value, g.value, d);
129
- He(n, H, !0);
155
+ const T = new Date(h.value, y.value, d);
156
+ Ae(n, T, !0);
130
157
  }
131
- const y = 7 - n.length % 7, B = y === 7 ? 0 : y;
132
- for (let d = 1; d <= B; d++) {
133
- const H = new Date(h.value, g.value + 1, d);
134
- He(n, H, !1);
158
+ const _ = 7 - n.length % 7, j = _ === 7 ? 0 : _;
159
+ for (let d = 1; d <= j; d++) {
160
+ const T = new Date(h.value, y.value + 1, d);
161
+ Ae(n, T, !1);
135
162
  }
136
163
  return n;
137
164
  });
138
- function He(e, t, a) {
139
- const n = wt.value, r = xt.value, u = t.getFullYear(), c = u < G || u > X;
165
+ function Ae(e, t, a) {
166
+ const n = Ot.value, l = Bt.value, u = t.getFullYear(), f = u < Z || u > J;
140
167
  e.push({
141
168
  date: t,
142
169
  isCurrentMonth: a,
143
- isToday: xe(t, /* @__PURE__ */ new Date()),
144
- isSelected: n ? xe(t, n) : !1,
145
- isRangeStart: !!n && xe(t, n),
146
- isRangeEnd: !!r && xe(t, r),
147
- isInRange: n && r ? On(t, n, r) : !1,
148
- isDisabled: c
170
+ isToday: Ne(t, /* @__PURE__ */ new Date()),
171
+ isSelected: n ? Ne(t, n) : !1,
172
+ isRangeStart: !!n && Ne(t, n),
173
+ isRangeEnd: !!l && Ne(t, l),
174
+ isInRange: n && l ? ma(t, n, l) : !1,
175
+ isDisabled: f
149
176
  });
150
177
  }
151
- const St = s(() => Oe.map((e) => {
178
+ const zt = s(() => Ze.map((e) => {
152
179
  var a;
153
180
  const t = e;
154
- return ((a = l.texts[t]) == null ? void 0 : a.substring(0, 2)) ?? e;
155
- })), Xe = s(
156
- () => Array.from({ length: 12 }, (e, t) => be(t, 3))
181
+ return ((a = r.texts[t]) == null ? void 0 : a.substring(0, 2)) ?? e;
182
+ })), Kt = s(
183
+ () => Array.from({ length: 12 }, (e, t) => xe(t, 3))
157
184
  );
158
- function be(e, t = 0) {
159
- const a = $e[e], n = l.texts[a] ?? $e[e];
185
+ function xe(e, t = 0) {
186
+ const a = Je[e], n = r.texts[a] ?? Je[e];
160
187
  return t <= 0 ? n : n.substring(0, t);
161
188
  }
162
- function Ze(e) {
163
- const t = Math.floor(ce / 2);
164
- let a = e - t, n = a + ce;
165
- return a < G && (a = G, n = Math.min(a + ce, X)), n > X && (n = X, a = Math.max(G, n - ce)), { startYear: a, endYear: n };
189
+ function it(e) {
190
+ const t = Math.floor(ve / 2);
191
+ let a = e - t, n = a + ve;
192
+ return a < Z && (a = Z, n = Math.min(a + ve, J)), n > J && (n = J, a = Math.max(Z, n - ve)), { startYear: a, endYear: n };
166
193
  }
167
- function It(e) {
168
- const { startYear: t, endYear: a } = Ze(e);
169
- return Array.from({ length: a - t + 1 }, (n, r) => t + r);
194
+ function Ut(e) {
195
+ const { startYear: t, endYear: a } = it(e);
196
+ return Array.from({ length: a - t + 1 }, (n, l) => t + l);
170
197
  }
171
- function Ct() {
172
- Je.value && (le.value -= ce);
198
+ function jt() {
199
+ st.value && (le.value -= ve);
173
200
  }
174
- function Ht() {
175
- et.value && (le.value += ce);
201
+ function Wt() {
202
+ ct.value && (le.value += ve);
176
203
  }
177
- const ke = s(() => Ze(le.value)), Je = s(
178
- () => ke.value.startYear > G
179
- ), et = s(() => ke.value.endYear < X), qt = s(() => g.value === 0 ? h.value - 1 : h.value), Et = s(() => g.value === 11 ? h.value + 1 : h.value), tt = s(() => qt.value >= G), nt = s(() => Et.value <= X), Ft = s(() => It(le.value)), Nt = s(() => J.value ? l.icons.clock : l.icons.calendar), ve = s(() => $n(l.format)), qe = s(
180
- () => `${ve.value} - ${ve.value}`
204
+ const Ie = s(() => it(le.value)), st = s(
205
+ () => Ie.value.startYear > Z
206
+ ), ct = s(() => Ie.value.endYear < J), Qt = s(() => y.value === 0 ? h.value - 1 : h.value), Gt = s(() => y.value === 11 ? h.value + 1 : h.value), ft = s(() => Qt.value >= Z), dt = s(() => Gt.value <= J), Xt = s(() => Ut(le.value)), Zt = s(() => E.value ? r.icons.clock : r.icons.calendar), ge = s(() => pa(r.format)), Le = s(
207
+ () => `${ge.value} - ${ge.value}`
181
208
  );
182
- Rn(
209
+ oa(
183
210
  () => {
184
211
  var e;
185
- return (e = C == null ? void 0 : C.value) == null ? void 0 : e.inputRef;
212
+ return (e = L == null ? void 0 : L.value) == null ? void 0 : e.inputRef;
186
213
  },
187
- () => l.range ? qe.value : ve.value
188
- ), se(
214
+ () => r.range ? Le.value : ge.value
215
+ ), fe(
189
216
  () => {
190
217
  var e;
191
- return (e = C == null ? void 0 : C.value) == null ? void 0 : e.inputRef;
218
+ return (e = L == null ? void 0 : L.value) == null ? void 0 : e.inputRef;
192
219
  },
193
220
  (e, t, a) => {
194
- const n = ie(e);
195
- n && (n.addEventListener("click", vt), n.addEventListener("paste", dt, !0), a(() => {
196
- n.removeEventListener("click", vt), n.removeEventListener("paste", dt, !0);
221
+ const n = Tt(e);
222
+ oe = n, n && (n.addEventListener("click", wt), n.addEventListener("paste", _t, !0), a(() => {
223
+ oe = null, n.removeEventListener("click", wt), n.removeEventListener("paste", _t, !0);
197
224
  }));
198
225
  },
199
226
  { flush: "post" }
200
- ), se(v, () => {
201
- I.value = null, he();
227
+ ), fe(c, () => {
228
+ D.value = null, Te();
202
229
  });
203
- const Ee = s(
204
- () => l.clearable && !l.readonly && !l.disabled && !!v.value
230
+ function Jt(e) {
231
+ return e === void 0 ? !1 : typeof e == "string" ? e.trim().length > 0 : e instanceof Date ? !0 : Array.isArray(e) ? e.length > 0 : !1;
232
+ }
233
+ const Oe = s(
234
+ () => r.clearable && !r.readonly && !r.disabled && Jt(c.value)
205
235
  );
206
- function Rt() {
207
- Ee.value && (m.value = null, ee.value = null, R.value = null, A.value = !1, v.value = void 0, _.value = "", De());
236
+ function en() {
237
+ Oe.value && ($e(), c.value = void 0, g.value = "", We());
208
238
  }
209
- function Fe(e) {
210
- !l.range || !A.value || !m.value || e.getFullYear() < G || e.getFullYear() > X || (R.value = new Date(e));
239
+ function Be(e) {
240
+ !r.range || !$.value || !v.value || e.getFullYear() < Z || e.getFullYear() > J || (B.value = new Date(e));
211
241
  }
212
- function at() {
213
- R.value = null;
242
+ function vt() {
243
+ B.value = null;
214
244
  }
215
- function Pt(e) {
245
+ function tn(e) {
216
246
  const t = e.currentTarget, a = e.relatedTarget;
217
- !t || a && t.contains(a) || at();
247
+ !t || a && t.contains(a) || vt();
218
248
  }
219
- function lt(e) {
220
- if (!l.range || !A.value || !m.value) return;
249
+ function mt(e) {
250
+ if (!r.range || !$.value || !v.value) return;
221
251
  const t = e.touches.item(0);
222
252
  if (!t) return;
223
253
  const a = document.elementFromPoint(t.clientX, t.clientY), n = a == null ? void 0 : a.closest("[data-day-index]");
224
254
  if (!n) return;
225
- const r = Number(n.dataset.dayIndex);
226
- if (Number.isNaN(r)) return;
227
- const u = Ge.value[r];
228
- u && Fe(u.date);
229
- }
230
- function Vt(e) {
231
- if (!(l.readonly || l.disabled) && !(e.getFullYear() < G || e.getFullYear() > X))
232
- if (l.range)
233
- if (A.value) {
234
- const t = m.value ?? new Date(e), a = new Date(e), [n, r] = a < t ? [a, t] : [t, a];
235
- ae.value && r.setHours(23, 59, ye.value ? 59 : 0, 0), v.value = [n, r], m.value = null, ee.value = null, R.value = null, A.value = !1;
255
+ const l = Number(n.dataset.dayIndex);
256
+ if (Number.isNaN(l)) return;
257
+ const u = ot.value[l];
258
+ u && Be(u.date);
259
+ }
260
+ function nn(e) {
261
+ if (!(r.readonly || r.disabled) && !(e.getFullYear() < Z || e.getFullYear() > J))
262
+ if (r.range)
263
+ if ($.value) {
264
+ const t = v.value ?? new Date(e), a = new Date(e), [n, l] = a < t ? [a, t] : [t, a];
265
+ re.value && l.setHours(23, 59, De.value ? 59 : 0, 0), c.value = [n, l], v.value = null, ie.value = null, B.value = null, $.value = !1;
236
266
  } else {
237
267
  const t = new Date(e);
238
- ae.value && m.value && t.setHours(
239
- m.value.getHours(),
240
- m.value.getMinutes(),
241
- m.value.getSeconds(),
242
- m.value.getMilliseconds()
243
- ), m.value = t, ee.value = null, R.value = null, A.value = !0;
268
+ re.value && v.value && t.setHours(
269
+ v.value.getHours(),
270
+ v.value.getMinutes(),
271
+ v.value.getSeconds(),
272
+ v.value.getMilliseconds()
273
+ ), v.value = t, ie.value = null, B.value = null, $.value = !0;
244
274
  }
245
275
  else {
246
276
  const t = new Date(e);
247
- T.value && !un(T.value) ? t.setHours(
248
- T.value.getHours(),
249
- T.value.getMinutes(),
250
- T.value.getSeconds()
251
- ) : ae.value && ct(t), v.value = t;
277
+ M.value && !Hn(M.value) ? t.setHours(
278
+ M.value.getHours(),
279
+ M.value.getMinutes(),
280
+ M.value.getSeconds()
281
+ ) : re.value && kt(t), c.value = t;
252
282
  }
253
283
  }
254
- function ue(e, t) {
255
- h.value = e, t && te();
284
+ function se(e, t) {
285
+ h.value = e, t && qe("year");
256
286
  }
257
- function K(e, t) {
258
- g.value = e, t && te();
287
+ function z(e, t) {
288
+ y.value = e, t && qe("month");
259
289
  }
260
- function Yt() {
261
- tt.value && (g.value === 0 ? (K(11), ue(h.value - 1)) : K(g.value - 1));
290
+ function an() {
291
+ ft.value && (y.value === 0 ? (z(11), se(h.value - 1)) : z(y.value - 1));
262
292
  }
263
- function At() {
264
- nt.value && (g.value === 11 ? (K(0), ue(h.value + 1)) : K(g.value + 1));
293
+ function rn() {
294
+ dt.value && (y.value === 11 ? (z(0), se(h.value + 1)) : z(y.value + 1));
265
295
  }
266
- function Bt() {
267
- K((/* @__PURE__ */ new Date()).getMonth()), ue((/* @__PURE__ */ new Date()).getFullYear()), te();
296
+ function ln() {
297
+ z((/* @__PURE__ */ new Date()).getMonth()), se((/* @__PURE__ */ new Date()).getFullYear()), Ce();
268
298
  }
269
- function Lt() {
270
- let e = T.value;
271
- const t = v.value;
272
- if (l.range && Array.isArray(t) && t.length > 0) {
299
+ function un() {
300
+ let e = M.value;
301
+ const t = c.value;
302
+ if (r.range && Array.isArray(t) && t.length > 0) {
273
303
  const a = t[0];
274
- a instanceof Date ? e = a : typeof a == "string" && (e = L(a, l.format, E.value));
304
+ a instanceof Date ? e = a : typeof a == "string" && (e = de(a, r.format, O.value));
275
305
  }
276
- e = e ?? /* @__PURE__ */ new Date(), K(e.getMonth()), ue(e.getFullYear()), te();
306
+ e = e ?? /* @__PURE__ */ new Date(), z(e.getMonth()), se(e.getFullYear()), Ce();
307
+ }
308
+ function ye(e) {
309
+ return r.range ? e === 1 ? Me.value ?? ie.value : M.value ?? v.value : M.value;
310
+ }
311
+ function $e() {
312
+ v.value = null, ie.value = null, B.value = null, $.value = !1;
277
313
  }
278
- function me(e) {
279
- return l.range ? e === 1 ? Ce.value ?? ee.value : T.value ?? m.value : T.value;
314
+ function on(e, t) {
315
+ return t < e ? [new Date(t), new Date(e)] : [new Date(e), new Date(t)];
280
316
  }
281
- function Ot(e, t) {
282
- if (!l.range) {
283
- v.value = t;
317
+ function sn() {
318
+ if (!r.range || !E.value) return;
319
+ const e = c.value;
320
+ if (!Array.isArray(e) || e.length < 2) return;
321
+ const t = e[0], a = e[1];
322
+ !(t instanceof Date) || !(a instanceof Date) || a >= t || (c.value = on(t, a));
323
+ }
324
+ function cn(e, t) {
325
+ if (!r.range) {
326
+ c.value = t;
284
327
  return;
285
328
  }
286
- const a = T.value, n = Ce.value;
287
- if (!a || !n) {
288
- e === 1 ? ee.value = t : m.value = t;
329
+ if (E.value) {
330
+ e === 0 ? v.value = t : ie.value = t;
331
+ const l = e === 0 ? t : M.value ?? v.value, u = e === 1 ? t : Me.value;
332
+ if (!l || !u) return;
333
+ c.value = [new Date(l), new Date(u)], $e();
289
334
  return;
290
335
  }
291
- v.value = e === 1 ? [a, t] : [t, n];
336
+ if ($.value) {
337
+ e === 0 && (v.value = t);
338
+ return;
339
+ }
340
+ const a = M.value, n = Me.value;
341
+ !a || !n || (c.value = e === 1 ? [a, t] : [t, n]);
292
342
  }
293
343
  function P(e, t) {
294
- const a = me(e) ?? (() => {
295
- const r = /* @__PURE__ */ new Date();
296
- return r.setHours(0, 0, 0, 0), r;
344
+ const a = ye(e) ?? (() => {
345
+ const l = /* @__PURE__ */ new Date();
346
+ return l.setHours(0, 0, 0, 0), l;
297
347
  })(), n = new Date(a);
298
- t(n), Ot(e, n);
348
+ t(n), cn(e, n);
299
349
  }
300
- function $t(e) {
301
- const t = me(e);
302
- if (!t) return Z.value ? 12 : 0;
350
+ function fn(e) {
351
+ const t = ye(e);
352
+ if (!t) return ee.value ? 12 : 0;
303
353
  const a = t.getHours();
304
- return Z.value ? a % 12 || 12 : a;
354
+ return ee.value ? a % 12 || 12 : a;
305
355
  }
306
- function Kt(e) {
356
+ function dn(e) {
307
357
  var t;
308
- return ((t = me(e)) == null ? void 0 : t.getMinutes()) ?? 0;
358
+ return ((t = ye(e)) == null ? void 0 : t.getMinutes()) ?? 0;
309
359
  }
310
- function zt(e) {
360
+ function vn(e) {
311
361
  var t;
312
- return ((t = me(e)) == null ? void 0 : t.getSeconds()) ?? 0;
362
+ return ((t = ye(e)) == null ? void 0 : t.getSeconds()) ?? 0;
313
363
  }
314
- function Ut(e) {
315
- const t = me(e);
364
+ function mn(e) {
365
+ const t = ye(e);
316
366
  return t ? t.getHours() >= 12 : !1;
317
367
  }
318
- function _e(e, t) {
368
+ function He(e, t) {
319
369
  return t ? e === 12 ? 12 : e + 12 : e === 12 ? 0 : e;
320
370
  }
321
- function Wt(e) {
371
+ function pn(e) {
322
372
  P(e, (t) => {
323
- if (Z.value) {
324
- const a = t.getHours() % 12 || 12, n = a >= 12 ? 1 : a + 1, r = t.getHours() >= 12;
325
- t.setHours(_e(n, r));
373
+ if (ee.value) {
374
+ const a = t.getHours() % 12 || 12, n = a >= 12 ? 1 : a + 1, l = t.getHours() >= 12;
375
+ t.setHours(He(n, l));
326
376
  } else
327
377
  t.setHours(t.getHours() >= 23 ? 0 : t.getHours() + 1);
328
378
  });
329
379
  }
330
- function Qt(e) {
380
+ function gn(e) {
331
381
  P(e, (t) => {
332
- if (Z.value) {
333
- const a = t.getHours() % 12 || 12, n = a <= 1 ? 12 : a - 1, r = t.getHours() >= 12;
334
- t.setHours(_e(n, r));
382
+ if (ee.value) {
383
+ const a = t.getHours() % 12 || 12, n = a <= 1 ? 12 : a - 1, l = t.getHours() >= 12;
384
+ t.setHours(He(n, l));
335
385
  } else
336
386
  t.setHours(t.getHours() <= 0 ? 23 : t.getHours() - 1);
337
387
  });
338
388
  }
339
- function jt(e) {
389
+ function yn(e) {
340
390
  P(e, (t) => {
341
391
  t.setMinutes(t.getMinutes() >= 59 ? 0 : t.getMinutes() + 1);
342
392
  });
343
393
  }
344
- function Gt(e) {
394
+ function hn(e) {
345
395
  P(e, (t) => {
346
396
  t.setMinutes(t.getMinutes() <= 0 ? 59 : t.getMinutes() - 1);
347
397
  });
348
398
  }
349
- function Xt(e) {
399
+ function bn(e) {
350
400
  P(e, (t) => {
351
401
  t.setSeconds(t.getSeconds() >= 59 ? 0 : t.getSeconds() + 1);
352
402
  });
353
403
  }
354
- function Zt(e) {
404
+ function kn(e) {
355
405
  P(e, (t) => {
356
406
  t.setSeconds(t.getSeconds() <= 0 ? 59 : t.getSeconds() - 1);
357
407
  });
358
408
  }
359
- function Ne(e) {
409
+ function ze(e) {
360
410
  return (e ?? "").replace(/\D/g, "");
361
411
  }
362
- function Jt(e) {
412
+ function _n(e) {
363
413
  return Math.min(23, Math.max(0, e));
364
414
  }
365
- function en(e) {
415
+ function Dn(e) {
366
416
  return Math.min(12, Math.max(1, e));
367
417
  }
368
- function rt(e) {
418
+ function pt(e) {
369
419
  return Math.min(59, Math.max(0, e));
370
420
  }
371
- function ut(e, t) {
372
- const a = Ne(e).slice(0, 2);
421
+ function gt(e, t) {
422
+ const a = ze(e).slice(0, 2);
373
423
  if (a === "") return;
374
424
  const n = Number.parseInt(a, 10);
375
425
  if (Number.isNaN(n)) return;
376
- const r = Z.value ? en(n) : Jt(n);
426
+ const l = ee.value ? Dn(n) : _n(n);
377
427
  P(t, (u) => {
378
- Z.value ? u.setHours(_e(r, u.getHours() >= 12)) : u.setHours(r);
428
+ ee.value ? u.setHours(He(l, u.getHours() >= 12)) : u.setHours(l);
379
429
  });
380
430
  }
381
- function ot(e, t) {
382
- const a = Ne(e).slice(0, 2);
431
+ function yt(e, t) {
432
+ const a = ze(e).slice(0, 2);
383
433
  if (a === "") return;
384
434
  const n = Number.parseInt(a, 10);
385
435
  if (Number.isNaN(n)) return;
386
- const r = rt(n);
436
+ const l = pt(n);
387
437
  P(t, (u) => {
388
- u.setMinutes(r);
438
+ u.setMinutes(l);
389
439
  });
390
440
  }
391
- function it(e, t) {
392
- const a = Ne(e).slice(0, 2);
441
+ function ht(e, t) {
442
+ const a = ze(e).slice(0, 2);
393
443
  if (a === "") return;
394
444
  const n = Number.parseInt(a, 10);
395
445
  if (Number.isNaN(n)) return;
396
- const r = rt(n);
446
+ const l = pt(n);
397
447
  P(t, (u) => {
398
- u.setSeconds(r);
448
+ u.setSeconds(l);
399
449
  });
400
450
  }
401
- async function Re(e, t, a) {
451
+ async function Ke(e, t, a) {
402
452
  if (e.ctrlKey || e.altKey || e.metaKey || !/^\d$/.test(e.key)) return;
403
453
  const n = e.target;
404
454
  if (!n) return;
405
- const r = n.selectionStart, u = n.selectionEnd;
406
- if (r === null || u === null || r !== u || n.maxLength <= 0 || n.value.length < n.maxLength || r >= n.value.length)
455
+ const l = n.selectionStart, u = n.selectionEnd;
456
+ if (l === null || u === null || l !== u || n.maxLength <= 0 || n.value.length < n.maxLength || l >= n.value.length)
407
457
  return;
408
458
  e.preventDefault();
409
- const c = `${n.value.slice(0, r)}${e.key}${n.value.slice(r + 1)}`;
410
- t === "hours" ? ut(c, a) : t === "minutes" ? ot(c, a) : it(c, a);
411
- const y = Math.min(r + 1, n.maxLength);
412
- await F(), n.setSelectionRange(y, y);
459
+ const f = `${n.value.slice(0, l)}${e.key}${n.value.slice(l + 1)}`;
460
+ t === "hours" ? gt(f, a) : t === "minutes" ? yt(f, a) : ht(f, a);
461
+ const _ = Math.min(l + 1, n.maxLength);
462
+ await q(), n.setSelectionRange(_, _);
413
463
  }
414
- function tn(e, t) {
464
+ function wn(e, t) {
415
465
  P(t, (a) => {
416
466
  const n = a.getHours() % 12 || 12;
417
- a.setHours(_e(n, e));
467
+ a.setHours(He(n, e));
418
468
  });
419
469
  }
420
- async function Pe(e, t, a, n) {
470
+ async function Ue(e, t, a, n) {
421
471
  if (!e) return;
422
- const r = Pn(t, a, n), u = () => e.setSelectionRange(r, r);
423
- u(), await F(), u(), await new Promise((c) => {
472
+ const l = ia(t, a, n), u = () => e.setSelectionRange(l, l);
473
+ u(), await q(), u(), await new Promise((f) => {
424
474
  requestAnimationFrame(() => {
425
- u(), c();
475
+ u(), f();
426
476
  });
427
477
  });
428
478
  }
429
- async function st(e, t, a, n) {
479
+ async function bt(e, t, a, n) {
430
480
  if (a === t) {
431
- _.value !== a && (_.value = a);
481
+ g.value !== a && (g.value = a);
432
482
  return;
433
483
  }
434
- _.value = a, await Pe(e, t, a, n);
435
- }
436
- async function nn(e) {
437
- var B;
438
- if (de > 0) return;
439
- if (l.readonly || l.disabled) {
440
- he();
484
+ g.value = a, await Ue(e, t, a, n);
485
+ }
486
+ function ne(e, t) {
487
+ const a = e.trim();
488
+ if (!a) return null;
489
+ const n = de(a, r.format, O.value);
490
+ if (n) return n;
491
+ const l = et(a);
492
+ if (l) return l;
493
+ const u = Mt(a);
494
+ return u || (t != null && t.complete ? nt(a, r.format, O.value) : null);
495
+ }
496
+ async function Mn(e) {
497
+ if (me > 0) return;
498
+ if (r.readonly || r.disabled) {
499
+ Te();
441
500
  return;
442
501
  }
443
- const t = ie((B = C.value) == null ? void 0 : B.inputRef), a = (t == null ? void 0 : t.selectionStart) ?? 0, n = e ?? "";
502
+ const t = ae(), a = (t == null ? void 0 : t.selectionStart) ?? 0, n = e ?? "";
444
503
  if (!n) {
445
- v.value = void 0, I.value = null, _.value = "", Y.value = !1;
504
+ c.value = void 0, D.value = null, g.value = "", F.value = !1;
446
505
  return;
447
506
  }
448
- if (l.range) {
449
- const d = we(n, qe.value);
450
- await st(t, n, d, a), I.value = d;
451
- const H = Ve(d);
452
- if (H) {
453
- v.value = H, I.value = null;
454
- const Ae = H.map((wn) => j(wn, l.format, $.value)).join(" - ");
455
- Ae !== d && (_.value = Ae, await Pe(t, d, Ae, a)), Y.value = !1;
507
+ if (r.range) {
508
+ const d = Se(n);
509
+ if (d) {
510
+ c.value = d, D.value = null, g.value = d.map((ke) => V(ke, r.format, N.value)).join(" - "), F.value = !1;
511
+ return;
512
+ }
513
+ const T = Re(n, Le.value);
514
+ await bt(t, n, T, a), D.value = T;
515
+ const Ge = Se(T);
516
+ if (Ge) {
517
+ c.value = Ge, D.value = null;
518
+ const ke = Ge.map((Qn) => V(Qn, r.format, N.value)).join(" - ");
519
+ ke !== T && (g.value = ke, await Ue(t, T, ke, a)), F.value = !1;
456
520
  }
457
521
  return;
458
522
  }
459
- const r = we(n, ve.value), u = ht(r, l.format);
460
- let c = u, y = L(u, l.format, E.value);
461
- if (!y) {
462
- const d = L(n, l.format, E.value);
463
- d && (c = n, y = d);
523
+ const l = ne(n);
524
+ if (l) {
525
+ const d = K(l, n);
526
+ c.value = d, D.value = null, g.value = V(d, r.format, N.value), F.value = !1;
527
+ return;
528
+ }
529
+ const u = Re(n, ge.value), f = St(u, r.format);
530
+ let _ = f, j = de(f, r.format, O.value);
531
+ if (!j) {
532
+ const d = de(n, r.format, O.value);
533
+ d && (_ = n, j = d);
464
534
  }
465
- if (await st(t, n, c, a), I.value = c, y) {
466
- const d = oe(y, n);
467
- v.value = d, I.value = null;
468
- const H = j(d, l.format, $.value);
469
- H !== c && (_.value = H, await Pe(t, c, H, a)), Y.value = !1;
535
+ if (await bt(t, n, _, a), D.value = _, j) {
536
+ const d = K(j, n);
537
+ c.value = d, D.value = null;
538
+ const T = V(d, r.format, N.value);
539
+ T !== _ && (g.value = T, await Ue(t, _, T, a)), F.value = !1;
470
540
  }
471
541
  }
472
- function Ve(e, t) {
542
+ function Se(e, t) {
473
543
  const a = e.split(" - ");
474
544
  if (a.length !== 2) return null;
475
- const n = (c) => {
476
- const y = c.trim(), B = L(y, l.format, E.value);
477
- return B || (t != null && t.complete ? ze(y, l.format, E.value) : null);
478
- }, r = n(a[0] ?? ""), u = n(a[1] ?? "");
479
- return !r || !u ? null : u < r ? [u, r] : [r, u];
545
+ const n = (f) => ne(f, t), l = n(a[0] ?? ""), u = n(a[1] ?? "");
546
+ return !l || !u ? null : u < l ? [u, l] : [l, u];
480
547
  }
481
- function an() {
482
- if (l.readonly || l.disabled) return !1;
483
- const e = I.value ?? _.value;
548
+ function Tn() {
549
+ if (r.readonly || r.disabled) return !1;
550
+ const e = D.value ?? g.value;
484
551
  if (!e) return !1;
485
- if (l.range) {
486
- const c = we(e, qe.value), y = Ve(c, { complete: !0 });
487
- return y ? (v.value = y, I.value = null, Y.value = !1, _.value = y.map((B) => j(B, l.format, $.value)).join(" - "), !0) : (I.value = null, v.value = void 0, Y.value = !0, _.value = "", !1);
552
+ if (r.range) {
553
+ const f = Re(e, Le.value), _ = Se(f, { complete: !0 });
554
+ return _ ? (c.value = _, D.value = null, F.value = !1, g.value = _.map((j) => V(j, r.format, N.value)).join(" - "), !0) : (D.value = null, c.value = void 0, F.value = !0, g.value = "", !1);
488
555
  }
489
- const t = we(e, ve.value), a = ht(t, l.format), n = ze(
490
- a,
491
- l.format,
492
- E.value
493
- );
556
+ const t = Re(e, ge.value), a = St(t, r.format), n = ne(e, { complete: !0 }) ?? nt(a, r.format, O.value);
494
557
  if (!n)
495
- return I.value = null, v.value = void 0, Y.value = !0, _.value = "", !1;
496
- const u = !!L(a, l.format, E.value) || kt(a, l.format) ? n : oe(n, a);
497
- return v.value = u, I.value = null, Y.value = !1, _.value = j(u, l.format, $.value), !0;
558
+ return D.value = null, c.value = void 0, F.value = !0, g.value = "", !1;
559
+ const u = !!ne(e) || qt(a, r.format) ? n : K(n, a);
560
+ return c.value = u, D.value = null, F.value = !1, g.value = V(u, r.format, N.value), !0;
498
561
  }
499
- function ln(e) {
562
+ function xn(e) {
500
563
  const t = e.replace(/[\sT]+(?:'[^']*'|HH|H|hh|h|mm|m|ss|s|SSS|S|a).*$/i, "").trim();
501
564
  return t && t !== e ? t : null;
502
565
  }
503
- function rn(e) {
504
- return !ae.value || L(e, l.format, E.value) || kt(e, l.format) ? !0 : /\dT\d|\d{1,2}:\d{2}/.test(e);
566
+ function In(e) {
567
+ return !re.value || ne(e) || qt(e, r.format) ? !0 : /\dT\d|\d{1,2}:\d{2}/.test(e);
505
568
  }
506
- function un(e) {
569
+ function Hn(e) {
507
570
  return e.getHours() === 0 && e.getMinutes() === 0 && e.getSeconds() === 0 && e.getMilliseconds() === 0;
508
571
  }
509
- function ct(e) {
572
+ function kt(e) {
510
573
  const t = /* @__PURE__ */ new Date();
511
574
  e.setHours(
512
575
  t.getHours(),
513
576
  t.getMinutes(),
514
- ye.value ? t.getSeconds() : 0,
515
- ye.value ? t.getMilliseconds() : 0
577
+ De.value ? t.getSeconds() : 0,
578
+ De.value ? t.getMilliseconds() : 0
516
579
  );
517
580
  }
518
- function oe(e, t) {
519
- if (l.range || !ae.value || t !== void 0 && rn(t)) return e;
581
+ function K(e, t) {
582
+ if (r.range || !re.value || t !== void 0 && In(t)) return e;
520
583
  const a = new Date(e);
521
- return ct(a), a;
522
- }
523
- function on(e) {
524
- if (l.range)
525
- return Ve(e);
526
- const t = L(e, l.format, E.value);
527
- if (t) return oe(t, e);
528
- const a = bn(e);
529
- if (a) return oe(a, e);
530
- const n = ze(e, l.format, E.value);
531
- if (n) return oe(n, e);
532
- const r = ln(l.format);
533
- if (r) {
534
- const u = L(e, r, E.value);
535
- if (u) return oe(u, e);
584
+ return kt(a), a;
585
+ }
586
+ function Sn(e) {
587
+ if (r.range)
588
+ return Se(e);
589
+ const t = de(e, r.format, O.value);
590
+ if (t) return K(t, e);
591
+ const a = et(e);
592
+ if (a) return K(a, e);
593
+ const n = Mt(e);
594
+ if (n) return K(n, e);
595
+ const l = nt(e, r.format, O.value);
596
+ if (l) return K(l, e);
597
+ const u = xn(r.format);
598
+ if (u) {
599
+ const f = de(e, u, O.value);
600
+ if (f) return K(f, e);
536
601
  }
537
602
  return null;
538
603
  }
539
- function sn(e) {
540
- if (Y.value = !1, I.value = null, Array.isArray(e)) {
541
- const a = e.map((n) => j(n, l.format, $.value)).join(" - ");
542
- de += 1, v.value = e, _.value = a, F(() => {
543
- de -= 1;
544
- });
604
+ async function Cn(e) {
605
+ if (F.value = !1, D.value = null, Array.isArray(e)) {
606
+ const a = e.map((n) => V(n, r.format, N.value)).join(" - ");
607
+ me += 1, c.value = e, g.value = a, await q(), me -= 1;
545
608
  return;
546
609
  }
547
- const t = j(e, l.format, $.value);
548
- de += 1, v.value = e, _.value = t, F(() => {
549
- de -= 1;
550
- });
610
+ const t = V(e, r.format, N.value);
611
+ me += 1, c.value = e, g.value = t, await q(), me -= 1;
551
612
  }
552
- function dt(e) {
553
- var n, r, u, c;
554
- if (l.readonly || l.disabled) {
613
+ function _t(e) {
614
+ var n, l, u, f;
615
+ if (r.readonly || r.disabled) {
555
616
  e.preventDefault();
556
617
  return;
557
618
  }
558
- const t = ((r = (n = e.clipboardData) == null ? void 0 : n.getData("text/plain")) == null ? void 0 : r.trim()) || ((c = (u = e.clipboardData) == null ? void 0 : u.getData("text")) == null ? void 0 : c.trim()) || "";
619
+ const t = ((l = (n = e.clipboardData) == null ? void 0 : n.getData("text/plain")) == null ? void 0 : l.trim()) || ((f = (u = e.clipboardData) == null ? void 0 : u.getData("text")) == null ? void 0 : f.trim()) || "";
559
620
  if (!t) {
560
621
  e.preventDefault();
561
622
  return;
562
623
  }
563
- const a = on(t);
624
+ const a = Sn(t);
564
625
  if (!a) {
565
626
  e.preventDefault();
566
627
  return;
567
628
  }
568
- e.preventDefault(), sn(a);
629
+ e.preventDefault(), Cn(a);
569
630
  }
570
- function cn(e) {
631
+ function qn(e) {
571
632
  const t = e.target;
572
- if (!(t instanceof Element) || !N.value) return null;
633
+ if (!(t instanceof Element) || !R.value) return null;
573
634
  const a = t.closest(
574
635
  "button, input, select, textarea, a[href], [tabindex], [contenteditable]"
575
636
  );
576
- return a && N.value.contains(a) ? a : null;
637
+ return a && R.value.contains(a) ? a : null;
577
638
  }
578
- function dn(e) {
639
+ function Fn(e) {
579
640
  return !(e.matches(":disabled") || e.getAttribute("aria-disabled") === "true" || e.getAttribute("tabindex") === "-1");
580
641
  }
581
- function fn(e) {
642
+ function Rn(e) {
582
643
  var a;
583
- if (!(e.target instanceof Node) || !((a = N.value) != null && a.contains(e.target))) return;
584
- fe = !0;
585
- const t = cn(e);
586
- t && !dn(t) && e.preventDefault();
644
+ if (!(e.target instanceof Node) || !((a = R.value) != null && a.contains(e.target))) return;
645
+ pe = !0;
646
+ const t = qn(e);
647
+ t && !Fn(t) && e.preventDefault();
587
648
  }
588
- function ft() {
589
- return N.value ? Array.from(N.value.querySelectorAll(_t)).filter(
649
+ function Dt() {
650
+ return R.value ? Array.from(R.value.querySelectorAll(Ft)).filter(
590
651
  (e) => e.offsetWidth > 0 || e.offsetHeight > 0 || e.getClientRects().length > 0
591
652
  ) : [];
592
653
  }
593
- function vn() {
594
- var n, r;
595
- const e = ie((n = C.value) == null ? void 0 : n.inputRef);
654
+ function Nn() {
655
+ var n;
656
+ const e = ae();
596
657
  if (!e) return;
597
658
  const t = Array.from(
598
- document.querySelectorAll(_t)
659
+ document.querySelectorAll(Ft)
599
660
  ).filter(
600
- (u) => u.offsetWidth > 0 || u.offsetHeight > 0 || u.getClientRects().length > 0
661
+ (l) => l.offsetWidth > 0 || l.offsetHeight > 0 || l.getClientRects().length > 0
601
662
  ), a = t.indexOf(e);
602
- a >= 0 && a < t.length - 1 && ((r = t[a + 1]) == null || r.focus());
663
+ a >= 0 && a < t.length - 1 && ((n = t[a + 1]) == null || n.focus());
603
664
  }
604
- function mn(e) {
605
- if (e.key !== "Tab" || !x.value || l.readonly || l.disabled) return;
665
+ function Vn(e) {
666
+ if (e.key !== "Tab" || !H.value || r.readonly || r.disabled) return;
606
667
  if (e.shiftKey) {
607
- O = !1, x.value = !1;
668
+ A = !1, H.value = !1;
608
669
  return;
609
670
  }
610
- const [t] = ft();
611
- t && (e.preventDefault(), fe = !0, t.focus());
671
+ const [t] = Dt();
672
+ t && (e.preventDefault(), pe = !0, t.focus());
612
673
  }
613
- async function pn(e) {
674
+ async function En(e) {
614
675
  if (e.key !== "Tab") return;
615
- const t = ft();
676
+ const t = Dt();
616
677
  if (!t.length) return;
617
- const a = t[0], n = t[t.length - 1], r = document.activeElement;
678
+ const a = t[0], n = t[t.length - 1], l = document.activeElement;
618
679
  if (e.shiftKey) {
619
- if (r !== a) return;
620
- e.preventDefault(), fe = !0, De();
680
+ if (l !== a) return;
681
+ e.preventDefault(), pe = !0, We();
621
682
  return;
622
683
  }
623
- r === n && (e.preventDefault(), Se = !0, x.value = !1, await F(), vn());
684
+ l === n && (e.preventDefault(), te = !0, H.value = !1, await q(), Nn());
624
685
  }
625
- async function gn(e) {
626
- var r, u, c;
627
- if (an(), fe) {
628
- fe = !1;
686
+ async function Pn(e) {
687
+ var l, u;
688
+ if (Tn(), pe) {
689
+ pe = !1;
629
690
  return;
630
691
  }
631
692
  const t = e == null ? void 0 : e.relatedTarget;
632
- if (t instanceof Node && ((r = N.value) != null && r.contains(t)))
693
+ if (t instanceof Node && ((l = R.value) != null && l.contains(t)))
633
694
  return;
634
- await F();
635
- const a = ie((u = C.value) == null ? void 0 : u.inputRef), n = document.activeElement;
636
- a !== n && (n instanceof Node && ((c = N.value) != null && c.contains(n)) || (O = !1, x.value = !1, Te.value = !1, he()));
637
- }
638
- function yn() {
639
- if (!(l.readonly || l.disabled)) {
640
- if (Te.value = !0, O) {
641
- O = !1;
695
+ await q();
696
+ const a = ae(), n = document.activeElement;
697
+ a !== n && (n instanceof Node && ((u = R.value) != null && u.contains(n)) || (A = !1, H.value = !1, Ve.value = !1, Te()));
698
+ }
699
+ function Yn() {
700
+ if (!(r.readonly || r.disabled)) {
701
+ if (Ve.value = !0, A) {
702
+ A = !1;
642
703
  return;
643
704
  }
644
- x.value || (x.value = !0);
705
+ H.value || (H.value = !0);
645
706
  }
646
707
  }
647
- function vt() {
648
- l.readonly || l.disabled || (O = !1, x.value = !0);
708
+ function wt() {
709
+ r.readonly || r.disabled || (A = !1, H.value = !0);
649
710
  }
650
- function hn(e) {
651
- e || Qe(), x.value = e;
711
+ function An(e) {
712
+ e || lt(), H.value = e;
652
713
  }
653
- function bn(e) {
654
- const t = /[A-Za-z]/.test(e), a = /^\d{4}[-/]\d{1,2}[-/]\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?$/.test(
714
+ function Mt(e) {
715
+ const t = et(e);
716
+ if (t) return t;
717
+ const a = /[A-Za-z]/.test(e), n = /^\d{4}[-/]\d{1,2}[-/]\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?$/.test(
655
718
  e
656
719
  );
657
- if (!t && !a) return null;
658
- const n = new Date(e);
659
- return Number.isNaN(n.getTime()) ? null : n;
720
+ if (!a && !n) return null;
721
+ const l = new Date(e);
722
+ return Number.isNaN(l.getTime()) ? null : l;
660
723
  }
661
- function ie(e) {
724
+ function Tt(e) {
662
725
  return e instanceof HTMLInputElement ? e : typeof e == "object" && e !== null && "value" in e && e.value instanceof HTMLInputElement ? e.value : null;
663
726
  }
664
- function kn(e) {
727
+ function ae() {
728
+ var n, l;
729
+ if (oe) return oe;
730
+ const e = Tt((n = L.value) == null ? void 0 : n.inputRef);
731
+ if (e)
732
+ return oe = e, e;
733
+ const t = we(
734
+ (l = L.value) == null ? void 0 : l.fieldRef
735
+ ), a = (t == null ? void 0 : t.querySelector(".q-text-field__input")) ?? null;
736
+ return a ? (oe = a, a) : null;
737
+ }
738
+ function Ln(e) {
665
739
  return e.isSelected || e.isRangeStart || e.isRangeEnd ? "bold" : e.isInRange ? "tonal" : "ghost";
666
740
  }
667
- function pe(e) {
741
+ function he(e) {
668
742
  var t;
669
- (t = N.value) == null || t.style.setProperty("--q-date-view-height", `${Math.max(0, e)}px`);
743
+ (t = R.value) == null || t.style.setProperty("--q-date-view-height", `${Math.max(0, e)}px`);
670
744
  }
671
- async function mt() {
745
+ async function xt() {
672
746
  var e;
673
- if (!x.value || J.value) {
674
- pe(0);
747
+ if (!H.value || E.value) {
748
+ he(0);
675
749
  return;
676
750
  }
677
- D.value === "date" && (await F(), pe(((e = Ie.value) == null ? void 0 : e.getBoundingClientRect().height) ?? 0));
751
+ w.value === "date" && (await q(), he(((e = Ee.value) == null ? void 0 : e.getBoundingClientRect().height) ?? 0));
678
752
  }
679
- function z() {
680
- re == null || re.disconnect(), re = null;
753
+ function U() {
754
+ ue == null || ue.disconnect(), ue = null;
681
755
  }
682
- async function pt() {
683
- !x.value || J.value || D.value !== "date" || (await F(), Ie.value && (z(), re = new MutationObserver(() => {
684
- mt();
685
- }), re.observe(Ie.value, {
756
+ async function It() {
757
+ !H.value || E.value || w.value !== "date" || (await q(), Ee.value && (U(), ue = new MutationObserver(() => {
758
+ xt();
759
+ }), ue.observe(Ee.value, {
686
760
  childList: !0,
687
761
  subtree: !0,
688
762
  attributes: !0,
689
763
  characterData: !0
690
- }), mt()));
764
+ }), xt()));
691
765
  }
692
- function gt() {
693
- D.value = "time", z();
766
+ function je() {
767
+ w.value = "time", U();
694
768
  }
695
- function te() {
696
- D.value = "date", pt();
769
+ function Ce() {
770
+ w.value = "date", It();
697
771
  }
698
- async function _n() {
772
+ async function qe(e) {
699
773
  var a;
700
- z(), D.value = "month", await F();
701
- const e = Xe.value.findIndex((n, r) => r !== g.value), t = e >= 0 ? e : 0;
702
- (a = document.getElementById(`q-date-time-month-option-${t}`)) == null || a.focus();
774
+ (a = R.value) == null || a.focus(), Ce(), await q();
775
+ const t = e === "year" ? Et.value : e === "month" ? Vt.value : e === "time" ? Pt.value : null;
776
+ Lt(t);
703
777
  }
704
- async function Dn() {
705
- z(), le.value = h.value, D.value = "year", await F();
706
- const e = document.getElementById(`q-date-time-year-${le.value}`);
707
- e == null || e.scrollIntoView({ block: "center" });
778
+ function On() {
779
+ const e = w.value;
780
+ e !== "date" && qe(e);
708
781
  }
709
- async function Ye(e) {
710
- var a;
782
+ async function Bn() {
783
+ U(), w.value = "month", await q();
784
+ const e = Pe.get(y.value);
785
+ e == null || e.scrollIntoView({ block: "center" }), e == null || e.focus();
786
+ }
787
+ async function $n() {
788
+ var e;
789
+ U(), le.value = h.value, w.value = "year", await q(), (e = Ye.get(le.value)) == null || e.scrollIntoView({ block: "center" });
790
+ }
791
+ async function be(e) {
711
792
  if (e.key !== "Escape") return;
712
- if (O = !0, D.value === "date") {
713
- e.preventDefault(), x.value = !1;
793
+ if (A = !0, w.value === "date" || E.value) {
794
+ e.preventDefault(), H.value = !1, await q(), Qe();
714
795
  return;
715
796
  }
716
- const t = D.value === "year" ? "q-date-time-year" : D.value === "month" ? "q-date-time-month" : D.value === "time" ? "q-date-time-toggle-time" : "";
717
- e.preventDefault(), te(), await F(), t && ((a = document.getElementById(t)) == null || a.focus());
797
+ e.preventDefault();
798
+ const t = w.value;
799
+ await qe(t);
800
+ }
801
+ function We() {
802
+ var e;
803
+ (e = ae()) == null || e.focus();
804
+ }
805
+ function zn(e) {
806
+ return !e || e === document.body || e === document.documentElement;
807
+ }
808
+ function Kn(e, t) {
809
+ if (e.closest(".q-date-time-picker__menu")) return !1;
810
+ const a = t.closest(".q-date-time-picker");
811
+ return a != null && a.contains(e) || !(e instanceof HTMLElement) ? !1 : e.tabIndex >= 0 || e.matches(
812
+ 'input, select, textarea, button, a[href], [tabindex]:not([tabindex="-1"])'
813
+ );
814
+ }
815
+ function Un(e) {
816
+ var a;
817
+ const t = ae();
818
+ return t ? e === t || !e || !e.isConnected || zn(e) || (a = R.value) != null && a.contains(e) ? !0 : !Kn(e, t) : !1;
819
+ }
820
+ function jn() {
821
+ if (te) return;
822
+ const e = ae();
823
+ !e || !Un(document.activeElement) || (A = !0, e.focus());
718
824
  }
719
- function De() {
720
- var e, t;
721
- (t = (e = C.value) == null ? void 0 : e.inputRef) == null || t.focus();
825
+ function Qe() {
826
+ q().then(() => {
827
+ requestAnimationFrame(() => {
828
+ requestAnimationFrame(() => {
829
+ jn();
830
+ });
831
+ });
832
+ });
722
833
  }
723
- function Mn() {
724
- var a, n;
725
- if (Se) {
726
- Se = !1;
834
+ function Wn() {
835
+ if (te) {
836
+ te = !1;
727
837
  return;
728
838
  }
729
- const e = ie((a = C.value) == null ? void 0 : a.inputRef), t = document.activeElement;
730
- e && t !== e && !(t instanceof Node && ((n = N.value) != null && n.contains(t))) || De();
731
- }
732
- return se(v, () => {
733
- T.value && (K(T.value.getMonth()), ue(T.value.getFullYear()));
734
- }), se(x, (e, t) => {
735
- if (J.value) {
736
- z(), pe(0);
839
+ Qe();
840
+ }
841
+ function Ht() {
842
+ lt();
843
+ const e = te;
844
+ te && (te = !1), e || (A = !0, Qe());
845
+ }
846
+ return fe(c, () => {
847
+ M.value && (z(M.value.getMonth()), se(M.value.getFullYear()));
848
+ }), fe(H, (e, t) => {
849
+ if (E.value) {
850
+ U(), he(0), e ? (document.addEventListener("keydown", be, { capture: !0 }), je()) : (t && (sn(), Ht()), document.removeEventListener("keydown", be, { capture: !0 }));
737
851
  return;
738
852
  }
739
- m.value = null, ee.value = null, R.value = null, A.value = !1, e ? (document.addEventListener("keydown", Ye), Lt(), pt()) : (t && Qe(), document.removeEventListener("keydown", Ye), z(), pe(0));
740
- }), se(
741
- J,
853
+ $e(), e ? (document.addEventListener("keydown", be, { capture: !0 }), un(), It()) : (t && Ht(), document.removeEventListener("keydown", be, { capture: !0 }), U(), he(0));
854
+ }), fe(
855
+ E,
742
856
  (e) => {
743
- e && z(), x.value = !1, e && pe(0), e ? gt() : te();
857
+ e && U(), H.value = !1, e && he(0), e ? je() : Ce();
744
858
  },
745
859
  { immediate: !0 }
746
- ), In(() => {
747
- z(), document.removeEventListener("keydown", Ye);
860
+ ), Jn(() => {
861
+ U(), document.removeEventListener("keydown", be, { capture: !0 });
748
862
  }), (e, t) => {
749
863
  var a;
750
- return f(), S(
751
- V,
864
+ return m(), S(
865
+ Y,
752
866
  null,
753
867
  [
754
- i(o(Me), {
755
- id: l.id,
868
+ i(o(Fe), Q({
869
+ id: r.id,
756
870
  ref: "field",
757
- "model-value": _.value,
758
- class: yt(["q-date-time-picker", l.class]),
759
- clearable: Ee.value,
760
- label: l.label,
761
- "label-position": l.labelPosition,
762
- readonly: l.readonly,
763
- disabled: l.disabled,
764
- placeholder: Dt.value,
765
- required: l.required,
766
- size: l.size,
767
- invalid: l.invalid || Y.value,
768
- "onClick:clear": De,
769
- onFocusin: yn,
770
- onKeydown: mn,
771
- onBlur: gn,
772
- "onUpdate:modelValue": nn
773
- }, Cn({
871
+ "model-value": g.value,
872
+ class: ["q-date-time-picker", r.class],
873
+ clearable: Oe.value,
874
+ "aria-label": r.label,
875
+ label: r.label,
876
+ "label-position": r.labelPosition,
877
+ readonly: r.readonly,
878
+ disabled: r.disabled,
879
+ placeholder: Rt.value,
880
+ required: r.required,
881
+ size: r.size,
882
+ invalid: r.invalid || F.value
883
+ }, e.$attrs, {
884
+ onBlur: Pn,
885
+ "onClick:clear": We,
886
+ onFocusin: Yn,
887
+ onKeydown: Vn,
888
+ "onUpdate:modelValue": Mn
889
+ }), ea({
774
890
  prepend: b(() => [
775
891
  i(
776
- o(w),
777
- ne({ class: "q-date-time-picker__input-icon" }, Nt.value),
892
+ o(I),
893
+ Q({ class: "q-date-time-picker__input-icon" }, Zt.value),
778
894
  null,
779
895
  16
780
896
  /* FULL_PROPS */
@@ -786,24 +902,24 @@ const Kn = {
786
902
  e.$slots.extras ? {
787
903
  name: "extras",
788
904
  fn: b(() => [
789
- Hn(e.$slots, "extras")
905
+ ta(e.$slots, "extras")
790
906
  ]),
791
907
  key: "0"
792
908
  } : void 0
793
- ]), 1032, ["id", "model-value", "class", "clearable", "label", "label-position", "readonly", "disabled", "placeholder", "required", "size", "invalid"]),
794
- !l.readonly && !l.disabled ? (f(), U(o(Fn), {
909
+ ]), 1040, ["id", "model-value", "class", "clearable", "aria-label", "label", "label-position", "readonly", "disabled", "placeholder", "required", "size", "invalid"]),
910
+ !r.readonly && !r.disabled ? (m(), W(o(la), {
795
911
  key: 0,
796
- "model-value": x.value,
797
- anchor: (a = C.value) == null ? void 0 : a.fieldRef,
798
- inline: l.inline,
912
+ "model-value": H.value,
913
+ anchor: (a = L.value) == null ? void 0 : a.fieldRef,
914
+ inline: r.inline,
799
915
  offset: 8,
800
916
  placement: "bottom",
801
917
  trigger: "manual",
802
918
  arrow: "",
803
919
  "non-modal": "",
804
920
  spy: "",
805
- onLeave: Mn,
806
- "onUpdate:modelValue": hn
921
+ onLeave: Wn,
922
+ "onUpdate:modelValue": An
807
923
  }, {
808
924
  default: b(() => [
809
925
  k(
@@ -811,27 +927,28 @@ const Kn = {
811
927
  {
812
928
  ref: "menu",
813
929
  class: "q-date-time-picker__menu",
814
- onPointerdownCapture: fn,
815
- onKeydown: pn
930
+ tabindex: "-1",
931
+ onPointerdownCapture: Rn,
932
+ onKeydown: En
816
933
  },
817
934
  [
818
- M(" Calendar View "),
819
- D.value === "date" ? (f(), S(
935
+ x(" Calendar View "),
936
+ w.value === "date" ? (m(), S(
820
937
  "div",
821
- Kn,
938
+ ga,
822
939
  [
823
- M(" Header "),
824
- k("div", zn, [
940
+ x(" Header "),
941
+ k("div", ya, [
825
942
  i(o(p), {
826
943
  variant: "ghost",
827
- disabled: !tt.value,
828
- title: l.texts.previousMonth,
829
- onClick: Yt
944
+ disabled: !ft.value,
945
+ title: r.texts.previousMonth,
946
+ onClick: an
830
947
  }, {
831
948
  default: b(() => [
832
949
  i(
833
- o(w),
834
- W(Q(l.icons.back)),
950
+ o(I),
951
+ G(X(r.icons.back)),
835
952
  null,
836
953
  16
837
954
  /* FULL_PROPS */
@@ -841,29 +958,31 @@ const Kn = {
841
958
  /* STABLE */
842
959
  }, 8, ["disabled", "title"]),
843
960
  i(o(p), {
844
- id: "q-date-time-month",
961
+ ref: "monthHeader",
962
+ "data-testid": "q-date-time-picker-month-header",
845
963
  variant: "ghost",
846
- label: be(g.value, 3),
847
- title: l.texts.pickMonth,
848
- onClick: _n
964
+ label: xe(y.value, 3),
965
+ title: r.texts.pickMonth,
966
+ onClick: Bn
849
967
  }, null, 8, ["label", "title"]),
850
968
  i(o(p), {
851
- id: "q-date-time-year",
969
+ ref: "yearHeader",
970
+ "data-testid": "q-date-time-picker-year-header",
852
971
  variant: "ghost",
853
972
  label: h.value.toString(),
854
- title: l.texts.pickYear,
855
- onClick: Dn
973
+ title: r.texts.pickYear,
974
+ onClick: $n
856
975
  }, null, 8, ["label", "title"]),
857
976
  i(o(p), {
858
977
  variant: "ghost",
859
- disabled: !nt.value,
860
- title: l.texts.nextMonth,
861
- onClick: At
978
+ disabled: !dt.value,
979
+ title: r.texts.nextMonth,
980
+ onClick: rn
862
981
  }, {
863
982
  default: b(() => [
864
983
  i(
865
- o(w),
866
- W(Q(l.icons.forward)),
984
+ o(I),
985
+ G(X(r.icons.forward)),
867
986
  null,
868
987
  16
869
988
  /* FULL_PROPS */
@@ -873,18 +992,18 @@ const Kn = {
873
992
  /* STABLE */
874
993
  }, 8, ["disabled", "title"])
875
994
  ]),
876
- M(" Weekday Headers "),
877
- k("div", Un, [
878
- (f(!0), S(
879
- V,
995
+ x(" Weekday Headers "),
996
+ k("div", ha, [
997
+ (m(!0), S(
998
+ Y,
880
999
  null,
881
- ge(St.value, (n) => (f(), S(
1000
+ _e(zt.value, (n) => (m(), S(
882
1001
  "div",
883
1002
  {
884
1003
  key: n,
885
1004
  class: "q-date-time-picker__weekday"
886
1005
  },
887
- Le(n),
1006
+ Xe(n),
888
1007
  1
889
1008
  /* TEXT */
890
1009
  ))),
@@ -892,24 +1011,24 @@ const Kn = {
892
1011
  /* KEYED_FRAGMENT */
893
1012
  ))
894
1013
  ]),
895
- M(" Days Grid "),
1014
+ x(" Days Grid "),
896
1015
  k(
897
1016
  "div",
898
1017
  {
899
1018
  class: "q-date-time-picker__days",
900
- onMouseleave: at,
901
- onFocusout: Pt,
902
- onTouchstartPassive: lt,
903
- onTouchmovePassive: lt
1019
+ onMouseleave: vt,
1020
+ onFocusout: tn,
1021
+ onTouchstartPassive: mt,
1022
+ onTouchmovePassive: mt
904
1023
  },
905
1024
  [
906
- (f(!0), S(
907
- V,
1025
+ (m(!0), S(
1026
+ Y,
908
1027
  null,
909
- ge(Ge.value, (n, r) => (f(), U(o(p), {
910
- key: r,
911
- "data-day-index": r,
912
- class: yt([
1028
+ _e(ot.value, (n, l) => (m(), W(o(p), {
1029
+ key: l,
1030
+ "data-day-index": l,
1031
+ class: na([
913
1032
  "q-date-time-picker__day",
914
1033
  {
915
1034
  "q-date-time-picker__day--other-month": !n.isCurrentMonth,
@@ -921,11 +1040,11 @@ const Kn = {
921
1040
  }
922
1041
  ]),
923
1042
  label: n.date.getDate().toString(),
924
- variant: kn(n),
1043
+ variant: Ln(n),
925
1044
  disabled: n.isDisabled,
926
- onMouseenter: () => Fe(n.date),
927
- onFocus: () => Fe(n.date),
928
- onClick: () => Vt(n.date)
1045
+ onMouseenter: () => Be(n.date),
1046
+ onFocus: () => Be(n.date),
1047
+ onClick: () => nn(n.date)
929
1048
  }, null, 8, ["data-day-index", "class", "label", "variant", "disabled", "onMouseenter", "onFocus", "onClick"]))),
930
1049
  128
931
1050
  /* KEYED_FRAGMENT */
@@ -937,41 +1056,41 @@ const Kn = {
937
1056
  ],
938
1057
  512
939
1058
  /* NEED_PATCH */
940
- )) : D.value === "time" ? (f(), S(
941
- V,
1059
+ )) : w.value === "time" ? (m(), S(
1060
+ Y,
942
1061
  { key: 1 },
943
1062
  [
944
- M(" Time View "),
945
- k("div", Wn, [
946
- (f(!0), S(
947
- V,
1063
+ x(" Time View "),
1064
+ k("div", ba, [
1065
+ (m(!0), S(
1066
+ Y,
948
1067
  null,
949
- ge(l.range ? 2 : 1, (n) => (f(), S("div", {
1068
+ _e(r.range ? 2 : 1, (n) => (m(), S("div", {
950
1069
  key: n,
951
1070
  class: "q-date-time-picker__time-group"
952
1071
  }, [
953
- Z.value ? (f(), S("div", Qn, [
954
- i(o(Nn), {
955
- "model-value": Ut(n - 1),
1072
+ ee.value ? (m(), S("div", ka, [
1073
+ i(o(ua), {
1074
+ "model-value": mn(n - 1),
956
1075
  "show-state-labels": "",
957
1076
  size: "small",
958
- "false-label": l.texts.am,
959
- "true-label": l.texts.pm,
960
- "onUpdate:modelValue": (r) => tn(r ?? !1, n - 1)
1077
+ "false-label": r.texts.am,
1078
+ "true-label": r.texts.pm,
1079
+ "onUpdate:modelValue": (l) => wn(l ?? !1, n - 1)
961
1080
  }, null, 8, ["model-value", "false-label", "true-label", "onUpdate:modelValue"])
962
- ])) : M("v-if", !0),
963
- M(" Time Inputs "),
964
- k("div", jn, [
965
- k("div", Gn, [
1081
+ ])) : x("v-if", !0),
1082
+ x(" Time Inputs "),
1083
+ k("div", _a, [
1084
+ k("div", Da, [
966
1085
  i(o(p), {
967
1086
  variant: "ghost",
968
- title: l.texts.increaseHour,
969
- onClick: (r) => Wt(n - 1)
1087
+ title: r.texts.increaseHour,
1088
+ onClick: (l) => pn(n - 1)
970
1089
  }, {
971
1090
  default: b(() => [
972
1091
  i(
973
- o(w),
974
- ne({ ref_for: !0 }, l.icons.up),
1092
+ o(I),
1093
+ Q({ ref_for: !0 }, r.icons.up),
975
1094
  null,
976
1095
  16
977
1096
  /* FULL_PROPS */
@@ -980,24 +1099,24 @@ const Kn = {
980
1099
  _: 1
981
1100
  /* STABLE */
982
1101
  }, 8, ["title", "onClick"]),
983
- i(o(Me), {
1102
+ i(o(Fe), {
984
1103
  class: "q-date-time-picker__time-number",
985
1104
  size: "small",
986
1105
  inputmode: "numeric",
987
1106
  "max-length": 2,
988
- "model-value": o(Ke)($t(n - 1)),
989
- onKeydown: (r) => Re(r, "hours", n - 1),
990
- "onUpdate:modelValue": (r) => ut(r, n - 1)
1107
+ "model-value": o(tt)(fn(n - 1)),
1108
+ onKeydown: (l) => Ke(l, "hours", n - 1),
1109
+ "onUpdate:modelValue": (l) => gt(l, n - 1)
991
1110
  }, null, 8, ["model-value", "onKeydown", "onUpdate:modelValue"]),
992
1111
  i(o(p), {
993
1112
  variant: "ghost",
994
- title: l.texts.decreaseHour,
995
- onClick: (r) => Qt(n - 1)
1113
+ title: r.texts.decreaseHour,
1114
+ onClick: (l) => gn(n - 1)
996
1115
  }, {
997
1116
  default: b(() => [
998
1117
  i(
999
- o(w),
1000
- ne({ ref_for: !0 }, l.icons.down),
1118
+ o(I),
1119
+ Q({ ref_for: !0 }, r.icons.down),
1001
1120
  null,
1002
1121
  16
1003
1122
  /* FULL_PROPS */
@@ -1014,16 +1133,16 @@ const Kn = {
1014
1133
  -1
1015
1134
  /* CACHED */
1016
1135
  )),
1017
- k("div", Xn, [
1136
+ k("div", wa, [
1018
1137
  i(o(p), {
1019
1138
  variant: "ghost",
1020
- title: l.texts.increaseMinute,
1021
- onClick: (r) => jt(n - 1)
1139
+ title: r.texts.increaseMinute,
1140
+ onClick: (l) => yn(n - 1)
1022
1141
  }, {
1023
1142
  default: b(() => [
1024
1143
  i(
1025
- o(w),
1026
- ne({ ref_for: !0 }, l.icons.up),
1144
+ o(I),
1145
+ Q({ ref_for: !0 }, r.icons.up),
1027
1146
  null,
1028
1147
  16
1029
1148
  /* FULL_PROPS */
@@ -1032,24 +1151,24 @@ const Kn = {
1032
1151
  _: 1
1033
1152
  /* STABLE */
1034
1153
  }, 8, ["title", "onClick"]),
1035
- i(o(Me), {
1154
+ i(o(Fe), {
1036
1155
  class: "q-date-time-picker__time-number",
1037
1156
  size: "small",
1038
1157
  inputmode: "numeric",
1039
1158
  "max-length": 2,
1040
- "model-value": o(Ke)(Kt(n - 1)),
1041
- onKeydown: (r) => Re(r, "minutes", n - 1),
1042
- "onUpdate:modelValue": (r) => ot(r, n - 1)
1159
+ "model-value": o(tt)(dn(n - 1)),
1160
+ onKeydown: (l) => Ke(l, "minutes", n - 1),
1161
+ "onUpdate:modelValue": (l) => yt(l, n - 1)
1043
1162
  }, null, 8, ["model-value", "onKeydown", "onUpdate:modelValue"]),
1044
1163
  i(o(p), {
1045
1164
  variant: "ghost",
1046
- title: l.texts.decreaseMinute,
1047
- onClick: (r) => Gt(n - 1)
1165
+ title: r.texts.decreaseMinute,
1166
+ onClick: (l) => hn(n - 1)
1048
1167
  }, {
1049
1168
  default: b(() => [
1050
1169
  i(
1051
- o(w),
1052
- ne({ ref_for: !0 }, l.icons.down),
1170
+ o(I),
1171
+ Q({ ref_for: !0 }, r.icons.down),
1053
1172
  null,
1054
1173
  16
1055
1174
  /* FULL_PROPS */
@@ -1059,8 +1178,8 @@ const Kn = {
1059
1178
  /* STABLE */
1060
1179
  }, 8, ["title", "onClick"])
1061
1180
  ]),
1062
- ye.value ? (f(), S(
1063
- V,
1181
+ De.value ? (m(), S(
1182
+ Y,
1064
1183
  { key: 0 },
1065
1184
  [
1066
1185
  t[0] || (t[0] = k(
@@ -1070,16 +1189,16 @@ const Kn = {
1070
1189
  -1
1071
1190
  /* CACHED */
1072
1191
  )),
1073
- k("div", Zn, [
1192
+ k("div", Ma, [
1074
1193
  i(o(p), {
1075
1194
  variant: "ghost",
1076
- title: l.texts.increaseSecond,
1077
- onClick: (r) => Xt(n - 1)
1195
+ title: r.texts.increaseSecond,
1196
+ onClick: (l) => bn(n - 1)
1078
1197
  }, {
1079
1198
  default: b(() => [
1080
1199
  i(
1081
- o(w),
1082
- ne({ ref_for: !0 }, l.icons.up),
1200
+ o(I),
1201
+ Q({ ref_for: !0 }, r.icons.up),
1083
1202
  null,
1084
1203
  16
1085
1204
  /* FULL_PROPS */
@@ -1088,24 +1207,24 @@ const Kn = {
1088
1207
  _: 1
1089
1208
  /* STABLE */
1090
1209
  }, 8, ["title", "onClick"]),
1091
- i(o(Me), {
1210
+ i(o(Fe), {
1092
1211
  class: "q-date-time-picker__time-number",
1093
1212
  size: "small",
1094
1213
  inputmode: "numeric",
1095
1214
  "max-length": 2,
1096
- "model-value": o(Ke)(zt(n - 1)),
1097
- onKeydown: (r) => Re(r, "seconds", n - 1),
1098
- "onUpdate:modelValue": (r) => it(r, n - 1)
1215
+ "model-value": o(tt)(vn(n - 1)),
1216
+ onKeydown: (l) => Ke(l, "seconds", n - 1),
1217
+ "onUpdate:modelValue": (l) => ht(l, n - 1)
1099
1218
  }, null, 8, ["model-value", "onKeydown", "onUpdate:modelValue"]),
1100
1219
  i(o(p), {
1101
1220
  variant: "ghost",
1102
- title: l.texts.decreaseSecond,
1103
- onClick: (r) => Zt(n - 1)
1221
+ title: r.texts.decreaseSecond,
1222
+ onClick: (l) => kn(n - 1)
1104
1223
  }, {
1105
1224
  default: b(() => [
1106
1225
  i(
1107
- o(w),
1108
- ne({ ref_for: !0 }, l.icons.down),
1226
+ o(I),
1227
+ Q({ ref_for: !0 }, r.icons.down),
1109
1228
  null,
1110
1229
  16
1111
1230
  /* FULL_PROPS */
@@ -1118,7 +1237,7 @@ const Kn = {
1118
1237
  ],
1119
1238
  64
1120
1239
  /* STABLE_FRAGMENT */
1121
- )) : M("v-if", !0)
1240
+ )) : x("v-if", !0)
1122
1241
  ])
1123
1242
  ]))),
1124
1243
  128
@@ -1128,24 +1247,27 @@ const Kn = {
1128
1247
  ],
1129
1248
  2112
1130
1249
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
1131
- )) : D.value === "month" ? (f(), S(
1132
- V,
1250
+ )) : w.value === "month" ? (m(), S(
1251
+ Y,
1133
1252
  { key: 2 },
1134
1253
  [
1135
- M(" Month View "),
1136
- k("div", Jn, [
1137
- (f(!0), S(
1138
- V,
1254
+ x(" Month View "),
1255
+ k("div", Ta, [
1256
+ (m(!0), S(
1257
+ Y,
1139
1258
  null,
1140
- ge(Xe.value, (n, r) => (f(), U(o(p), {
1141
- id: `q-date-time-month-option-${r}`,
1142
- key: r,
1143
- disabled: g.value === r,
1259
+ _e(Kt.value, (n, l) => (m(), W(o(p), {
1260
+ key: l,
1261
+ ref_for: !0,
1262
+ ref: (u) => Yt(u, l),
1263
+ "data-testid": "q-date-time-picker-month-option",
1264
+ "data-month-index": l,
1265
+ disabled: y.value === l,
1144
1266
  label: n,
1145
- title: be(r),
1267
+ title: xe(l),
1146
1268
  variant: "ghost",
1147
- onClick: () => K(r, !0)
1148
- }, null, 8, ["id", "disabled", "label", "title", "onClick"]))),
1269
+ onClick: () => z(l, !0)
1270
+ }, null, 8, ["data-month-index", "disabled", "label", "title", "onClick"]))),
1149
1271
  128
1150
1272
  /* KEYED_FRAGMENT */
1151
1273
  ))
@@ -1153,23 +1275,23 @@ const Kn = {
1153
1275
  ],
1154
1276
  2112
1155
1277
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
1156
- )) : D.value === "year" ? (f(), S(
1157
- V,
1278
+ )) : w.value === "year" ? (m(), S(
1279
+ Y,
1158
1280
  { key: 3 },
1159
1281
  [
1160
- M(" Year View "),
1161
- k("div", ea, [
1162
- k("div", ta, [
1282
+ x(" Year View "),
1283
+ k("div", xa, [
1284
+ k("div", Ia, [
1163
1285
  i(o(p), {
1164
1286
  variant: "ghost",
1165
- disabled: !Je.value,
1166
- title: l.texts.previousYears,
1167
- onClick: Ct
1287
+ disabled: !st.value,
1288
+ title: r.texts.previousYears,
1289
+ onClick: jt
1168
1290
  }, {
1169
1291
  default: b(() => [
1170
1292
  i(
1171
- o(w),
1172
- W(Q(l.icons.back)),
1293
+ o(I),
1294
+ G(X(r.icons.back)),
1173
1295
  null,
1174
1296
  16
1175
1297
  /* FULL_PROPS */
@@ -1180,21 +1302,21 @@ const Kn = {
1180
1302
  }, 8, ["disabled", "title"]),
1181
1303
  k(
1182
1304
  "div",
1183
- na,
1184
- Le(ke.value.startYear) + " - " + Le(ke.value.endYear),
1305
+ Ha,
1306
+ Xe(Ie.value.startYear) + " - " + Xe(Ie.value.endYear),
1185
1307
  1
1186
1308
  /* TEXT */
1187
1309
  ),
1188
1310
  i(o(p), {
1189
1311
  variant: "ghost",
1190
- disabled: !et.value,
1191
- title: l.texts.nextYears,
1192
- onClick: Ht
1312
+ disabled: !ct.value,
1313
+ title: r.texts.nextYears,
1314
+ onClick: Wt
1193
1315
  }, {
1194
1316
  default: b(() => [
1195
1317
  i(
1196
- o(w),
1197
- W(Q(l.icons.forward)),
1318
+ o(I),
1319
+ G(X(r.icons.forward)),
1198
1320
  null,
1199
1321
  16
1200
1322
  /* FULL_PROPS */
@@ -1204,19 +1326,22 @@ const Kn = {
1204
1326
  /* STABLE */
1205
1327
  }, 8, ["disabled", "title"])
1206
1328
  ]),
1207
- k("div", aa, [
1208
- (f(!0), S(
1209
- V,
1329
+ k("div", Sa, [
1330
+ (m(!0), S(
1331
+ Y,
1210
1332
  null,
1211
- ge(Ft.value, (n, r) => (f(), U(o(p), {
1212
- id: `q-date-time-year-${n}`,
1213
- key: r,
1333
+ _e(Xt.value, (n, l) => (m(), W(o(p), {
1334
+ key: l,
1335
+ ref_for: !0,
1336
+ ref: (u) => At(u, n),
1337
+ "data-testid": "q-date-time-picker-year-option",
1338
+ "data-year": n,
1214
1339
  disabled: h.value === n,
1215
1340
  label: n.toString(),
1216
1341
  title: n,
1217
1342
  variant: "ghost",
1218
- onClick: () => ue(n, !0)
1219
- }, null, 8, ["id", "disabled", "label", "title", "onClick"]))),
1343
+ onClick: () => se(n, !0)
1344
+ }, null, 8, ["data-year", "disabled", "label", "title", "onClick"]))),
1220
1345
  128
1221
1346
  /* KEYED_FRAGMENT */
1222
1347
  ))
@@ -1225,19 +1350,19 @@ const Kn = {
1225
1350
  ],
1226
1351
  2112
1227
1352
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
1228
- )) : M("v-if", !0),
1229
- k("div", la, [
1230
- J.value ? M("v-if", !0) : (f(), U(o(p), {
1353
+ )) : x("v-if", !0),
1354
+ k("div", Ca, [
1355
+ E.value ? x("v-if", !0) : (m(), W(o(p), {
1231
1356
  key: 0,
1232
1357
  variant: "ghost",
1233
- disabled: Mt.value,
1234
- title: l.texts.today,
1235
- onClick: Bt
1358
+ disabled: Nt.value,
1359
+ title: r.texts.today,
1360
+ onClick: ln
1236
1361
  }, {
1237
1362
  default: b(() => [
1238
1363
  i(
1239
- o(w),
1240
- W(Q(l.icons.today)),
1364
+ o(I),
1365
+ G(X(r.icons.today)),
1241
1366
  null,
1242
1367
  16
1243
1368
  /* FULL_PROPS */
@@ -1246,17 +1371,18 @@ const Kn = {
1246
1371
  _: 1
1247
1372
  /* STABLE */
1248
1373
  }, 8, ["disabled", "title"])),
1249
- ae.value && D.value === "date" ? (f(), U(o(p), {
1374
+ re.value && w.value === "date" ? (m(), W(o(p), {
1250
1375
  key: 1,
1251
- id: "q-date-time-toggle-time",
1376
+ ref: "toggleTime",
1377
+ "data-testid": "q-date-time-picker-toggle-time",
1252
1378
  variant: "ghost",
1253
- title: l.texts.toggleMode,
1254
- onClick: gt
1379
+ title: r.texts.toggleMode,
1380
+ onClick: je
1255
1381
  }, {
1256
1382
  default: b(() => [
1257
1383
  i(
1258
- o(w),
1259
- W(Q(l.icons.clock)),
1384
+ o(I),
1385
+ G(X(r.icons.clock)),
1260
1386
  null,
1261
1387
  16
1262
1388
  /* FULL_PROPS */
@@ -1264,17 +1390,17 @@ const Kn = {
1264
1390
  ]),
1265
1391
  _: 1
1266
1392
  /* STABLE */
1267
- }, 8, ["title"])) : D.value !== "date" && !J.value ? (f(), U(o(p), {
1393
+ }, 8, ["title"])) : w.value !== "date" && !E.value ? (m(), W(o(p), {
1268
1394
  key: 2,
1269
- id: "q-date-time-toggle-date",
1395
+ "data-testid": "q-date-time-picker-toggle-date",
1270
1396
  variant: "ghost",
1271
- title: l.texts.toggleMode,
1272
- onClick: te
1397
+ title: r.texts.toggleMode,
1398
+ onClick: On
1273
1399
  }, {
1274
1400
  default: b(() => [
1275
1401
  i(
1276
- o(w),
1277
- W(Q(l.icons.calendar)),
1402
+ o(I),
1403
+ G(X(r.icons.calendar)),
1278
1404
  null,
1279
1405
  16
1280
1406
  /* FULL_PROPS */
@@ -1282,18 +1408,19 @@ const Kn = {
1282
1408
  ]),
1283
1409
  _: 1
1284
1410
  /* STABLE */
1285
- }, 8, ["title"])) : M("v-if", !0),
1286
- l.clearable ? (f(), U(o(p), {
1411
+ }, 8, ["title"])) : x("v-if", !0),
1412
+ r.clearable ? (m(), W(o(p), {
1287
1413
  key: 3,
1414
+ "data-testid": "q-date-time-picker-clear",
1288
1415
  variant: "ghost",
1289
- disabled: !Ee.value,
1290
- title: l.texts.clearValue,
1291
- onClick: Rt
1416
+ disabled: !Oe.value,
1417
+ title: r.texts.clearValue,
1418
+ onClick: en
1292
1419
  }, {
1293
1420
  default: b(() => [
1294
1421
  i(
1295
- o(w),
1296
- W(Q(l.icons.delete)),
1422
+ o(I),
1423
+ G(X(r.icons.delete)),
1297
1424
  null,
1298
1425
  16
1299
1426
  /* FULL_PROPS */
@@ -1301,7 +1428,7 @@ const Kn = {
1301
1428
  ]),
1302
1429
  _: 1
1303
1430
  /* STABLE */
1304
- }, 8, ["disabled", "title"])) : M("v-if", !0)
1431
+ }, 8, ["disabled", "title"])) : x("v-if", !0)
1305
1432
  ])
1306
1433
  ],
1307
1434
  544
@@ -1310,7 +1437,7 @@ const Kn = {
1310
1437
  ]),
1311
1438
  _: 1
1312
1439
  /* STABLE */
1313
- }, 8, ["model-value", "anchor", "inline"])) : M("v-if", !0)
1440
+ }, 8, ["model-value", "anchor", "inline"])) : x("v-if", !0)
1314
1441
  ],
1315
1442
  64
1316
1443
  /* STABLE_FRAGMENT */
@@ -1319,5 +1446,5 @@ const Kn = {
1319
1446
  }
1320
1447
  });
1321
1448
  export {
1322
- ma as default
1449
+ La as default
1323
1450
  };