v-datepicker-lite 0.1.8 → 0.1.9

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 (2) hide show
  1. package/index.js +454 -450
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,74 +1,74 @@
1
- import { defineComponent as x, computed as $, createElementBlock as k, openBlock as p, createElementVNode as v, Fragment as F, renderList as I, unref as g, toDisplayString as A, normalizeClass as C, ref as P, watch as L, nextTick as R, onMounted as ne, createCommentVNode as B, createBlock as W, createVNode as G, renderSlot as K, normalizeProps as Q, guardReactiveProps as X, withCtx as J } from "vue";
1
+ import { defineComponent as x, computed as $, createElementBlock as k, openBlock as h, createElementVNode as p, Fragment as F, renderList as I, unref as g, toDisplayString as A, normalizeClass as C, ref as P, watch as q, nextTick as R, onMounted as ne, createCommentVNode as B, createBlock as W, createVNode as G, renderSlot as K, normalizeProps as Q, guardReactiveProps as X, withCtx as J } from "vue";
2
2
  import se from "v-tooltip-lite";
3
- const Z = (l, s = "YYYY-MM-DD") => {
4
- const e = l.getFullYear(), u = String(l.getMonth() + 1).padStart(2, "0"), t = String(l.getDate()).padStart(2, "0"), c = String(l.getHours()).padStart(2, "0"), r = String(l.getMinutes()).padStart(2, "0"), i = String(l.getSeconds()).padStart(2, "0"), n = String(l.getMilliseconds()).padStart(3, "0");
5
- return s.replace("YYYY", e.toString()).replace("MM", u).replace("DD", t).replace("HH", c).replace("mm", r).replace("ss", i).replace("sss", n);
6
- }, U = (l) => {
7
- if (!l) return null;
8
- if (/^\d{4}-\d{2}-\d{2}$/.test(l)) {
9
- const [e, u, t] = l.split("-").map(Number);
10
- return new Date(e, u - 1, t);
3
+ const Z = (e, o = "YYYY-MM-DD") => {
4
+ const l = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), t = String(e.getDate()).padStart(2, "0"), u = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0"), c = String(e.getSeconds()).padStart(2, "0"), s = String(e.getMilliseconds()).padStart(3, "0");
5
+ return o.replace("YYYY", l.toString()).replace("MM", a).replace("DD", t).replace("HH", u).replace("mm", i).replace("ss", c).replace("sss", s);
6
+ }, U = (e) => {
7
+ if (!e) return null;
8
+ if (/^\d{4}-\d{2}-\d{2}$/.test(e)) {
9
+ const [l, a, t] = e.split("-").map(Number);
10
+ return new Date(l, a - 1, t);
11
11
  }
12
- const s = new Date(l);
13
- return isNaN(s.getTime()) ? null : s;
14
- }, q = (l, s) => l.getFullYear() === s.getFullYear() && l.getMonth() === s.getMonth() && l.getDate() === s.getDate(), oe = (l, s) => l.getFullYear() === s.getFullYear() && l.getMonth() === s.getMonth(), re = (l) => {
15
- const s = new Date(l.getFullYear(), 0, 1), e = (l.getTime() - s.getTime()) / 864e5;
16
- return Math.ceil((e + s.getDay() + 1) / 7);
17
- }, ee = (l, s) => {
18
- const e = new Date(l, s, 1), t = new Date(l, s + 1, 0).getDate(), c = e.getDay(), r = [], i = /* @__PURE__ */ new Date(), n = s === 0 ? 11 : s - 1, h = s === 0 ? l - 1 : l, b = new Date(h, n + 1, 0).getDate();
19
- for (let d = c - 1; d >= 0; d--) {
20
- const a = new Date(h, n, b - d);
21
- r.push({
22
- date: a,
23
- day: b - d,
24
- month: n,
25
- year: h,
12
+ const o = new Date(e);
13
+ return isNaN(o.getTime()) ? null : o;
14
+ }, L = (e, o) => e.getFullYear() === o.getFullYear() && e.getMonth() === o.getMonth() && e.getDate() === o.getDate(), oe = (e, o) => e.getFullYear() === o.getFullYear() && e.getMonth() === o.getMonth(), re = (e) => {
15
+ const o = new Date(e.getFullYear(), 0, 1), l = (e.getTime() - o.getTime()) / 864e5;
16
+ return Math.ceil((l + o.getDay() + 1) / 7);
17
+ }, ee = (e, o) => {
18
+ const l = new Date(e, o, 1), t = new Date(e, o + 1, 0).getDate(), u = l.getDay(), i = [], c = /* @__PURE__ */ new Date(), s = o === 0 ? 11 : o - 1, f = o === 0 ? e - 1 : e, M = new Date(f, s + 1, 0).getDate();
19
+ for (let d = u - 1; d >= 0; d--) {
20
+ const n = new Date(f, s, M - d);
21
+ i.push({
22
+ date: n,
23
+ day: M - d,
24
+ month: s,
25
+ year: f,
26
26
  isCurrentMonth: !1,
27
- isToday: q(a, i),
27
+ isToday: L(n, c),
28
28
  isSelected: !1,
29
29
  isDisabled: !1
30
30
  });
31
31
  }
32
32
  for (let d = 1; d <= t; d++) {
33
- const a = new Date(l, s, d);
34
- r.push({
35
- date: a,
33
+ const n = new Date(e, o, d);
34
+ i.push({
35
+ date: n,
36
36
  day: d,
37
- month: s,
38
- year: l,
37
+ month: o,
38
+ year: e,
39
39
  isCurrentMonth: !0,
40
- isToday: q(a, i),
40
+ isToday: L(n, c),
41
41
  isSelected: !1,
42
42
  isDisabled: !1
43
43
  });
44
44
  }
45
- const m = 42 - r.length, S = s === 11 ? 0 : s + 1, y = s === 11 ? l + 1 : l;
45
+ const m = 42 - i.length, S = o === 11 ? 0 : o + 1, y = o === 11 ? e + 1 : e;
46
46
  for (let d = 1; d <= m; d++) {
47
- const a = new Date(y, S, d);
48
- r.push({
49
- date: a,
47
+ const n = new Date(y, S, d);
48
+ i.push({
49
+ date: n,
50
50
  day: d,
51
51
  month: S,
52
52
  year: y,
53
53
  isCurrentMonth: !1,
54
- isToday: q(a, i),
54
+ isToday: L(n, c),
55
55
  isSelected: !1,
56
56
  isDisabled: !1
57
57
  });
58
58
  }
59
- return r;
60
- }, ie = (l, s) => {
61
- const e = ee(l, s), u = [];
62
- for (let t = 0; t < e.length; t += 7) {
63
- const c = e.slice(t, t + 7), r = re(c[0].date);
64
- u.push({
65
- weekNumber: r,
66
- days: c,
59
+ return i;
60
+ }, ie = (e, o) => {
61
+ const l = ee(e, o), a = [];
62
+ for (let t = 0; t < l.length; t += 7) {
63
+ const u = l.slice(t, t + 7), i = re(u[0].date);
64
+ a.push({
65
+ weekNumber: i,
66
+ days: u,
67
67
  isSelected: !1
68
68
  });
69
69
  }
70
- return u;
71
- }, te = (l) => [
70
+ return a;
71
+ }, te = (e) => [
72
72
  "January",
73
73
  "February",
74
74
  "March",
@@ -81,15 +81,15 @@ const Z = (l, s = "YYYY-MM-DD") => {
81
81
  "October",
82
82
  "November",
83
83
  "December"
84
- ].map((e, u) => ({
85
- month: u,
86
- year: l,
87
- name: e,
84
+ ].map((l, a) => ({
85
+ month: a,
86
+ year: e,
87
+ name: l,
88
88
  isSelected: !1,
89
89
  isDisabled: !1
90
- })), le = (l, s, e, u) => {
91
- const t = Z(l, "YYYY-MM-DD");
92
- return s && t < s || e && t > e ? !0 : u ? u.some((c) => c.end ? t >= c.start && t <= c.end : t === c.start) : !1;
90
+ })), le = (e, o, l, a) => {
91
+ const t = Z(e, "YYYY-MM-DD");
92
+ return o && t < o || l && t > l ? !0 : a ? a.some((u) => u.end ? t >= u.start && t <= u.end : t === u.start) : !1;
93
93
  }, E = [
94
94
  "January",
95
95
  "February",
@@ -113,36 +113,36 @@ const Z = (l, s = "YYYY-MM-DD") => {
113
113
  disabledDates: {}
114
114
  },
115
115
  emits: ["select"],
116
- setup(l, { emit: s }) {
117
- const e = l, u = s, t = $(() => ee(e.currentDate.getFullYear(), e.currentDate.getMonth()).map((n) => ({
118
- ...n,
119
- isSelected: e.selectedDate ? q(n.date, e.selectedDate) : !1,
120
- isDisabled: le(n.date, e.minDate, e.maxDate, e.disabledDates)
121
- }))), c = $(() => {
122
- const i = [];
123
- for (let n = 0; n < t.value.length; n += 7)
124
- i.push(t.value.slice(n, n + 7));
125
- return i.filter((n) => n.some((h) => h.isCurrentMonth));
126
- }), r = (i) => {
127
- i.isDisabled || u("select", i.date);
116
+ setup(e, { emit: o }) {
117
+ const l = e, a = o, t = $(() => ee(l.currentDate.getFullYear(), l.currentDate.getMonth()).map((s) => ({
118
+ ...s,
119
+ isSelected: l.selectedDate ? L(s.date, l.selectedDate) : !1,
120
+ isDisabled: le(s.date, l.minDate, l.maxDate, l.disabledDates)
121
+ }))), u = $(() => {
122
+ const c = [];
123
+ for (let s = 0; s < t.value.length; s += 7)
124
+ c.push(t.value.slice(s, s + 7));
125
+ return c.filter((s) => s.some((f) => f.isCurrentMonth));
126
+ }), i = (c) => {
127
+ c.isDisabled || a("select", c.date);
128
128
  };
129
- return (i, n) => (p(), k("div", ce, [
130
- v("table", ue, [
131
- v("thead", null, [
132
- v("tr", de, [
133
- (p(!0), k(F, null, I(g(ae), (h) => (p(), k("th", { key: h }, A(h), 1))), 128))
129
+ return (c, s) => (h(), k("div", ce, [
130
+ p("table", ue, [
131
+ p("thead", null, [
132
+ p("tr", de, [
133
+ (h(!0), k(F, null, I(g(ae), (f) => (h(), k("th", { key: f }, A(f), 1))), 128))
134
134
  ])
135
135
  ]),
136
- v("tbody", me, [
137
- (p(!0), k(F, null, I(c.value, (h, b) => (p(), k("tr", {
138
- key: b,
136
+ p("tbody", me, [
137
+ (h(!0), k(F, null, I(u.value, (f, M) => (h(), k("tr", {
138
+ key: M,
139
139
  class: "date-picker-week-row"
140
140
  }, [
141
- (p(!0), k(F, null, I(h, (m) => (p(), k("td", {
141
+ (h(!0), k(F, null, I(f, (m) => (h(), k("td", {
142
142
  key: `${m.year}-${m.month}-${m.day}`,
143
143
  class: "date-picker-day-cell"
144
144
  }, [
145
- v("button", {
145
+ p("button", {
146
146
  class: C([
147
147
  "date-picker-day",
148
148
  {
@@ -152,7 +152,7 @@ const Z = (l, s = "YYYY-MM-DD") => {
152
152
  disabled: m.isDisabled
153
153
  }
154
154
  ]),
155
- onClick: (S) => r(m),
155
+ onClick: (S) => i(m),
156
156
  disabled: m.isDisabled
157
157
  }, A(m.day), 11, ve)
158
158
  ]))), 128))
@@ -165,60 +165,60 @@ const Z = (l, s = "YYYY-MM-DD") => {
165
165
  class: "date-picker-table date-picker-week-table",
166
166
  cellpadding: "0",
167
167
  cellspacing: "0"
168
- }, ge = { class: "date-picker-weekdays-row" }, ke = { class: "date-picker-weeks-body" }, De = ["onClick"], ye = { class: "date-picker-week-number-cell" }, be = { class: "date-picker-week-number" }, Me = /* @__PURE__ */ x({
168
+ }, ge = { class: "date-picker-weekdays-row" }, ke = { class: "date-picker-weeks-body" }, De = ["onClick"], ye = { class: "date-picker-week-number-cell" }, Me = { class: "date-picker-week-number" }, be = /* @__PURE__ */ x({
169
169
  __name: "WeekView",
170
170
  props: {
171
171
  currentDate: {},
172
172
  selectedDate: {}
173
173
  },
174
174
  emits: ["select"],
175
- setup(l, { emit: s }) {
176
- const e = l, u = s, t = $(() => ie(e.currentDate.getFullYear(), e.currentDate.getMonth()).map((i) => {
177
- const n = e.selectedDate ? i.days.some((h) => q(h.date, e.selectedDate)) : !1;
175
+ setup(e, { emit: o }) {
176
+ const l = e, a = o, t = $(() => ie(l.currentDate.getFullYear(), l.currentDate.getMonth()).map((c) => {
177
+ const s = l.selectedDate ? c.days.some((f) => L(f.date, l.selectedDate)) : !1;
178
178
  return {
179
- ...i,
180
- isSelected: n
179
+ ...c,
180
+ isSelected: s
181
181
  };
182
- })), c = (r) => {
183
- var n;
184
- const i = ((n = r.days.find((h) => h.isCurrentMonth)) == null ? void 0 : n.date) || r.days[0].date;
185
- u("select", i);
182
+ })), u = (i) => {
183
+ var s;
184
+ const c = ((s = i.days.find((f) => f.isCurrentMonth)) == null ? void 0 : s.date) || i.days[0].date;
185
+ a("select", c);
186
186
  };
187
- return (r, i) => (p(), k("div", he, [
188
- v("table", fe, [
189
- v("thead", null, [
190
- v("tr", ge, [
191
- i[0] || (i[0] = v("th", { class: "date-picker-weekday date-picker-week-header" }, "Wk", -1)),
192
- (p(!0), k(F, null, I(g(ae), (n) => (p(), k("th", { key: n }, A(n), 1))), 128))
187
+ return (i, c) => (h(), k("div", he, [
188
+ p("table", fe, [
189
+ p("thead", null, [
190
+ p("tr", ge, [
191
+ c[0] || (c[0] = p("th", { class: "date-picker-weekday date-picker-week-header" }, "Wk", -1)),
192
+ (h(!0), k(F, null, I(g(ae), (s) => (h(), k("th", { key: s }, A(s), 1))), 128))
193
193
  ])
194
194
  ]),
195
- v("tbody", ke, [
196
- (p(!0), k(F, null, I(t.value, (n) => (p(), k("tr", {
197
- key: n.weekNumber,
195
+ p("tbody", ke, [
196
+ (h(!0), k(F, null, I(t.value, (s) => (h(), k("tr", {
197
+ key: s.weekNumber,
198
198
  class: C([
199
199
  "date-picker-week-row",
200
200
  {
201
- selected: n.isSelected
201
+ selected: s.isSelected
202
202
  }
203
203
  ]),
204
- onClick: (h) => c(n)
204
+ onClick: (f) => u(s)
205
205
  }, [
206
- v("td", ye, [
207
- v("div", be, A(n.weekNumber), 1)
206
+ p("td", ye, [
207
+ p("div", Me, A(s.weekNumber), 1)
208
208
  ]),
209
- (p(!0), k(F, null, I(n.days, (h) => (p(), k("td", {
210
- key: `${h.year}-${h.month}-${h.day}`,
209
+ (h(!0), k(F, null, I(s.days, (f) => (h(), k("td", {
210
+ key: `${f.year}-${f.month}-${f.day}`,
211
211
  class: "date-picker-day-cell"
212
212
  }, [
213
- v("button", {
213
+ p("button", {
214
214
  class: C([
215
215
  "date-picker-day",
216
216
  {
217
- "other-month": !h.isCurrentMonth,
218
- today: h.isToday
217
+ "other-month": !f.isCurrentMonth,
218
+ today: f.isToday
219
219
  }
220
220
  ])
221
- }, A(h.day), 3)
221
+ }, A(f.day), 3)
222
222
  ]))), 128))
223
223
  ], 10, De))), 128))
224
224
  ])
@@ -226,25 +226,25 @@ const Z = (l, s = "YYYY-MM-DD") => {
226
226
  ]));
227
227
  }
228
228
  });
229
- function Se(l, s = "24h", e = 1, u) {
230
- const t = P(0), c = P(0), r = P([]), i = P(!1), n = $(() => s === "12h"), h = () => {
231
- if (l)
232
- t.value = l.getHours(), c.value = l.getMinutes(), i.value = !0;
229
+ function Se(e, o = "24h", l = 1, a) {
230
+ const t = P(0), u = P(0), i = P([]), c = P(!1), s = $(() => o === "12h"), f = () => {
231
+ if (e)
232
+ t.value = e.getHours(), u.value = e.getMinutes(), c.value = !0;
233
233
  else {
234
- const o = /* @__PURE__ */ new Date();
235
- t.value = o.getHours(), c.value = o.getMinutes(), i.value = !1;
234
+ const r = /* @__PURE__ */ new Date();
235
+ t.value = r.getHours(), u.value = r.getMinutes(), c.value = !1;
236
236
  }
237
237
  m();
238
- }, b = (o) => {
239
- o ? (t.value = o.getHours(), c.value = o.getMinutes(), i.value = !0) : i.value = !1;
238
+ }, M = (r) => {
239
+ r ? (t.value = r.getHours(), u.value = r.getMinutes(), c.value = !0) : c.value = !1;
240
240
  }, m = () => {
241
- const o = [], D = n.value ? 1 : 0;
242
- for (let M = 0; M < (n.value ? 2 : 1); M++) {
243
- const V = n.value ? M === 0 ? " AM" : " PM" : "";
244
- for (let Y = D; Y <= (n.value ? 12 : 23); Y++)
245
- for (let T = 0; T < 60; T += e) {
246
- const f = (n.value, Y), w = n.value ? Y === 12 ? M === 0 ? 0 : 12 : Y + M * 12 : Y, z = `${String(f).padStart(2, "0")}:${String(T).padStart(2, "0")}` + V;
247
- o.push({
241
+ const r = [], D = s.value ? 1 : 0;
242
+ for (let b = 0; b < (s.value ? 2 : 1); b++) {
243
+ const V = s.value ? b === 0 ? " AM" : " PM" : "";
244
+ for (let Y = D; Y <= (s.value ? 12 : 23); Y++)
245
+ for (let T = 0; T < 60; T += l) {
246
+ const v = (s.value, Y), w = s.value ? Y === 12 ? b === 0 ? 0 : 12 : Y + b * 12 : Y, z = `${String(v).padStart(2, "0")}:${String(T).padStart(2, "0")}` + V;
247
+ r.push({
248
248
  display: z,
249
249
  value: `${String(w).padStart(2, "0")}:${String(T).padStart(2, "0")}`,
250
250
  hour: w,
@@ -252,54 +252,54 @@ function Se(l, s = "24h", e = 1, u) {
252
252
  });
253
253
  }
254
254
  }
255
- n.value ? r.value = o.map((M) => M.display) : r.value = o.map((M) => M.value);
255
+ s.value ? i.value = r.map((b) => b.display) : i.value = r.map((b) => b.value);
256
256
  }, S = () => {
257
- if (!i.value) return "";
258
- if (n.value) {
259
- const o = t.value === 0 ? 12 : t.value > 12 ? t.value - 12 : t.value, D = t.value < 12 ? " AM" : " PM";
260
- return `${String(o).padStart(2, "0")}:${String(c.value).padStart(
257
+ if (!c.value) return "";
258
+ if (s.value) {
259
+ const r = t.value === 0 ? 12 : t.value > 12 ? t.value - 12 : t.value, D = t.value < 12 ? " AM" : " PM";
260
+ return `${String(r).padStart(2, "0")}:${String(u.value).padStart(
261
261
  2,
262
262
  "0"
263
263
  )}${D}`;
264
264
  }
265
- return `${String(t.value).padStart(2, "0")}:${String(c.value).padStart(2, "0")}`;
265
+ return `${String(t.value).padStart(2, "0")}:${String(u.value).padStart(2, "0")}`;
266
266
  };
267
267
  return {
268
268
  hours: t,
269
- minutes: c,
270
- timeOptions: r,
271
- is12HourFormat: n,
272
- initializeTime: h,
273
- updateTime: b,
269
+ minutes: u,
270
+ timeOptions: i,
271
+ is12HourFormat: s,
272
+ initializeTime: f,
273
+ updateTime: M,
274
274
  generateTimeOptions: m,
275
275
  getCurrentTimeString: S,
276
- selectTime: (o) => {
277
- let D, M;
278
- if (n.value) {
279
- const [Y, T] = o.split(" "), [f, w] = Y.split(":");
280
- D = parseInt(f), M = parseInt(w), T === "AM" ? D === 12 && (D = 0) : D !== 12 && (D += 12);
276
+ selectTime: (r) => {
277
+ let D, b;
278
+ if (s.value) {
279
+ const [Y, T] = r.split(" "), [v, w] = Y.split(":");
280
+ D = parseInt(v), b = parseInt(w), T === "AM" ? D === 12 && (D = 0) : D !== 12 && (D += 12);
281
281
  } else {
282
- const [Y, T] = o.split(":");
283
- D = parseInt(Y), M = parseInt(T);
282
+ const [Y, T] = r.split(":");
283
+ D = parseInt(Y), b = parseInt(T);
284
284
  }
285
- if (i.value && t.value === D && c.value === M) {
286
- i.value = !1, u("update", null);
285
+ if (c.value && t.value === D && u.value === b) {
286
+ c.value = !1, a("update", null);
287
287
  return;
288
288
  }
289
- t.value = D, c.value = M, i.value = !0;
290
- const V = l ? new Date(l.getTime()) : /* @__PURE__ */ new Date();
291
- V.setHours(D, M, 0, 0), u("update", V);
289
+ t.value = D, u.value = b, c.value = !0;
290
+ const V = e ? new Date(e.getTime()) : /* @__PURE__ */ new Date();
291
+ V.setHours(D, b, 0, 0), a("update", V);
292
292
  },
293
- scrollToSelected: (o) => {
294
- if (!o || !i.value) return;
295
- const D = r.value.findIndex((M) => M === S());
293
+ scrollToSelected: (r) => {
294
+ if (!r || !c.value) return;
295
+ const D = i.value.findIndex((b) => b === S());
296
296
  if (D >= 0) {
297
- const V = o.clientHeight, Y = D * 30 - V / 2 + 30 / 2;
298
- o.scrollTop = Math.max(0, Y);
297
+ const V = r.clientHeight, Y = D * 30 - V / 2 + 30 / 2;
298
+ r.scrollTop = Math.max(0, Y);
299
299
  }
300
300
  },
301
- onTimeUpdate: (o) => {
302
- t.value = o.getHours(), c.value = o.getMinutes(), i.value = !0, u("update", o);
301
+ onTimeUpdate: (r) => {
302
+ t.value = r.getHours(), u.value = r.getMinutes(), c.value = !0, a("update", r);
303
303
  }
304
304
  };
305
305
  }
@@ -311,52 +311,52 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
311
311
  minuteInterval: { default: 1 }
312
312
  },
313
313
  emits: ["update"],
314
- setup(l, { emit: s }) {
315
- const e = l, u = s, t = P(null), { timeOptions: c, initializeTime: r, updateTime: i, getCurrentTimeString: n, selectTime: h, scrollToSelected: b } = Se(e.selectedTime, e.timeFormat, e.minuteInterval, u);
316
- return L(
317
- () => e.selectedTime,
314
+ setup(e, { emit: o }) {
315
+ const l = e, a = o, t = P(null), { timeOptions: u, initializeTime: i, updateTime: c, getCurrentTimeString: s, selectTime: f, scrollToSelected: M } = Se(l.selectedTime, l.timeFormat, l.minuteInterval, a);
316
+ return q(
317
+ () => l.selectedTime,
318
318
  (m) => {
319
- i(m), R(() => {
320
- b(t.value);
319
+ c(m), R(() => {
320
+ M(t.value);
321
321
  });
322
322
  },
323
323
  { immediate: !0 }
324
- ), L(
325
- () => e.timeFormat,
324
+ ), q(
325
+ () => l.timeFormat,
326
326
  () => {
327
- r(), R(() => {
328
- b(t.value);
327
+ i(), R(() => {
328
+ M(t.value);
329
329
  });
330
330
  }
331
- ), L(
332
- () => e.minuteInterval,
331
+ ), q(
332
+ () => l.minuteInterval,
333
333
  () => {
334
- r(), R(() => {
335
- b(t.value);
334
+ i(), R(() => {
335
+ M(t.value);
336
336
  });
337
337
  }
338
338
  ), ne(() => {
339
- r(), R(() => {
339
+ i(), R(() => {
340
340
  setTimeout(() => {
341
- b(t.value);
341
+ M(t.value);
342
342
  }, 3);
343
343
  });
344
- }), (m, S) => (p(), k("div", _e, [
345
- v("div", {
344
+ }), (m, S) => (h(), k("div", _e, [
345
+ p("div", {
346
346
  ref_key: "timeListRef",
347
347
  ref: t,
348
348
  class: "time-wheel",
349
349
  role: "listbox",
350
350
  "aria-label": "Time Selection"
351
351
  }, [
352
- (p(!0), k(F, null, I(g(c), (y) => (p(), k("div", {
352
+ (h(!0), k(F, null, I(g(u), (y) => (h(), k("div", {
353
353
  key: y,
354
354
  class: C(["time-option", {
355
- selected: y === g(n)()
355
+ selected: y === g(s)()
356
356
  }]),
357
357
  role: "option",
358
- "aria-selected": y === g(n)(),
359
- onClick: (d) => g(h)(y)
358
+ "aria-selected": y === g(s)(),
359
+ onClick: (d) => g(f)(y)
360
360
  }, A(y), 11, we))), 128))
361
361
  ], 512)
362
362
  ]));
@@ -368,64 +368,64 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
368
368
  selectedDate: {}
369
369
  },
370
370
  emits: ["select", "month-select"],
371
- setup(l, { emit: s }) {
372
- const e = l, u = s, t = $(() => e.currentDate.getFullYear()), c = $(() => {
371
+ setup(e, { emit: o }) {
372
+ const l = e, a = o, t = $(() => l.currentDate.getFullYear()), u = $(() => {
373
373
  var m;
374
- return (m = e.selectedDate) == null ? void 0 : m.getFullYear();
375
- }), r = $(() => {
374
+ return (m = l.selectedDate) == null ? void 0 : m.getFullYear();
375
+ }), i = $(() => {
376
376
  const m = Math.floor(t.value / 10) * 10;
377
377
  return Array.from({ length: 12 }, (S, y) => m + y - 1);
378
- }), i = $(() => te(t.value).map((m) => ({
378
+ }), c = $(() => te(t.value).map((m) => ({
379
379
  ...m,
380
- isSelected: e.selectedDate ? m.month === e.selectedDate.getMonth() && m.year === e.selectedDate.getFullYear() : !1
381
- }))), n = $(() => {
380
+ isSelected: l.selectedDate ? m.month === l.selectedDate.getMonth() && m.year === l.selectedDate.getFullYear() : !1
381
+ }))), s = $(() => {
382
382
  const m = [];
383
- for (let S = 0; S < i.value.length; S += 3)
384
- m.push(i.value.slice(S, S + 3));
383
+ for (let S = 0; S < c.value.length; S += 3)
384
+ m.push(c.value.slice(S, S + 3));
385
385
  return m;
386
- }), h = (m) => {
387
- u("select", m);
388
- }, b = (m) => {
389
- u("month-select", m.month);
386
+ }), f = (m) => {
387
+ a("select", m);
388
+ }, M = (m) => {
389
+ a("month-select", m.month);
390
390
  };
391
- return (m, S) => (p(), k("div", $e, [
392
- v("div", Ye, [
393
- v("div", Te, [
394
- (p(!0), k(F, null, I(r.value, (y) => (p(), k("button", {
391
+ return (m, S) => (h(), k("div", $e, [
392
+ p("div", Ye, [
393
+ p("div", Te, [
394
+ (h(!0), k(F, null, I(i.value, (y) => (h(), k("button", {
395
395
  key: y,
396
396
  class: C([
397
397
  "year-item",
398
398
  {
399
- selected: y === c.value,
399
+ selected: y === u.value,
400
400
  current: y === t.value
401
401
  }
402
402
  ]),
403
- onClick: (d) => h(y)
403
+ onClick: (d) => f(y)
404
404
  }, A(y), 11, He))), 128))
405
405
  ])
406
406
  ]),
407
- v("div", Ce, [
408
- v("table", Pe, [
409
- v("tbody", Fe, [
410
- (p(!0), k(F, null, I(n.value, (y, d) => (p(), k("tr", {
407
+ p("div", Ce, [
408
+ p("table", Pe, [
409
+ p("tbody", Fe, [
410
+ (h(!0), k(F, null, I(s.value, (y, d) => (h(), k("tr", {
411
411
  key: d,
412
412
  class: "date-picker-months-row"
413
413
  }, [
414
- (p(!0), k(F, null, I(y, (a) => (p(), k("td", {
415
- key: a.month,
414
+ (h(!0), k(F, null, I(y, (n) => (h(), k("td", {
415
+ key: n.month,
416
416
  class: "date-picker-month-cell"
417
417
  }, [
418
- v("button", {
418
+ p("button", {
419
419
  class: C([
420
420
  "date-picker-month",
421
421
  {
422
- selected: a.isSelected,
423
- disabled: a.isDisabled
422
+ selected: n.isSelected,
423
+ disabled: n.isDisabled
424
424
  }
425
425
  ]),
426
- onClick: (o) => b(a),
427
- disabled: a.isDisabled
428
- }, A(a.name.substring(0, 3)), 11, Ie)
426
+ onClick: (r) => M(n),
427
+ disabled: n.isDisabled
428
+ }, A(n.name.substring(0, 3)), 11, Ie)
429
429
  ]))), 128))
430
430
  ]))), 128))
431
431
  ])
@@ -440,30 +440,30 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
440
440
  selectedDate: {}
441
441
  },
442
442
  emits: ["select"],
443
- setup(l, { emit: s }) {
444
- const e = l, u = s, t = $(() => te(e.currentDate.getFullYear()).map((n) => ({
445
- ...n,
446
- isSelected: e.selectedDate ? n.month === e.selectedDate.getMonth() && n.year === e.selectedDate.getFullYear() : !1
447
- }))), c = $(() => {
448
- const i = [];
449
- for (let n = 0; n < t.value.length; n += 3)
450
- i.push(t.value.slice(n, n + 3));
451
- return i;
452
- }), r = (i) => {
453
- u("select", i.month);
443
+ setup(e, { emit: o }) {
444
+ const l = e, a = o, t = $(() => te(l.currentDate.getFullYear()).map((s) => ({
445
+ ...s,
446
+ isSelected: l.selectedDate ? s.month === l.selectedDate.getMonth() && s.year === l.selectedDate.getFullYear() : !1
447
+ }))), u = $(() => {
448
+ const c = [];
449
+ for (let s = 0; s < t.value.length; s += 3)
450
+ c.push(t.value.slice(s, s + 3));
451
+ return c;
452
+ }), i = (c) => {
453
+ a("select", c.month);
454
454
  };
455
- return (i, n) => (p(), k("div", Ve, [
456
- v("table", Ne, [
457
- v("tbody", xe, [
458
- (p(!0), k(F, null, I(c.value, (h, b) => (p(), k("tr", {
459
- key: b,
455
+ return (c, s) => (h(), k("div", Ve, [
456
+ p("table", Ne, [
457
+ p("tbody", xe, [
458
+ (h(!0), k(F, null, I(u.value, (f, M) => (h(), k("tr", {
459
+ key: M,
460
460
  class: "date-picker-months-row"
461
461
  }, [
462
- (p(!0), k(F, null, I(h, (m) => (p(), k("td", {
462
+ (h(!0), k(F, null, I(f, (m) => (h(), k("td", {
463
463
  key: m.month,
464
464
  class: "date-picker-month-cell"
465
465
  }, [
466
- v("button", {
466
+ p("button", {
467
467
  class: C([
468
468
  "date-picker-month",
469
469
  {
@@ -471,7 +471,7 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
471
471
  disabled: m.isDisabled
472
472
  }
473
473
  ]),
474
- onClick: (S) => r(m),
474
+ onClick: (S) => i(m),
475
475
  disabled: m.isDisabled
476
476
  }, A(m.name), 11, Be)
477
477
  ]))), 128))
@@ -487,129 +487,133 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
487
487
  viewMode: {}
488
488
  },
489
489
  emits: ["header-click"],
490
- setup(l, { emit: s }) {
491
- const e = l, u = s, t = $(() => {
492
- const r = e.currentDate.getFullYear(), i = e.currentDate.getMonth();
493
- switch (e.viewMode) {
490
+ setup(e, { emit: o }) {
491
+ const l = e, a = o, t = $(() => {
492
+ const i = l.currentDate.getFullYear(), c = l.currentDate.getMonth();
493
+ switch (l.viewMode) {
494
494
  case "date":
495
- return `${E[i]} ${r}`;
495
+ return `${E[c]} ${i}`;
496
496
  case "year":
497
- const n = Math.floor(r / 10) * 10, h = n + 9;
498
- return `${n}–${h}`;
497
+ const s = Math.floor(i / 10) * 10, f = s + 9;
498
+ return `${s}–${f}`;
499
499
  default:
500
- return `${E[i]} ${r}`;
500
+ return `${E[c]} ${i}`;
501
501
  }
502
- }), c = () => {
503
- u("header-click");
502
+ }), u = () => {
503
+ a("header-click");
504
504
  };
505
- return (r, i) => (p(), k("button", {
505
+ return (i, c) => (h(), k("button", {
506
506
  class: "date-picker-title",
507
- onClick: c,
507
+ onClick: u,
508
508
  type: "button"
509
509
  }, A(t.value), 1));
510
510
  }
511
511
  });
512
- function ze(l, s) {
513
- const e = P(/* @__PURE__ */ new Date()), u = P("date"), t = $(() => l.value ? l.value instanceof Date ? l.value : U(l.value) : null), c = (f) => {
512
+ function ze(e, o) {
513
+ const l = $(() => e.value ? e.value instanceof Date ? e.value : U(e.value) : null), a = P(l.value ? new Date(l.value) : /* @__PURE__ */ new Date()), t = P("date");
514
+ q(l, (v) => {
515
+ v && (a.value.getFullYear() !== v.getFullYear() || a.value.getMonth() !== v.getMonth()) && (a.value = new Date(v));
516
+ });
517
+ const u = (v) => {
514
518
  const w = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/, H = /^\d{4}-\d{2}-\d{2}$/;
515
- return w.test(f) ? f.includes(".") ? "YYYY-MM-DDTHH:mm:ss.sssZ" : "YYYY-MM-DDTHH:mm:ssZ" : H.test(f) ? "YYYY-MM-DD" : l.format || "YYYY-MM-DD";
516
- }, r = $(() => {
517
- if (!l.value) return !1;
518
- if (l.value instanceof Date) return !0;
519
- const f = c(l.value);
520
- return f.includes("H") || f.includes("h") || f.includes("m") || f.includes("T");
521
- }), i = $(() => {
522
- if (!l.minDate) return !0;
523
- const f = U(l.minDate);
524
- if (!f) return !0;
525
- const w = e.value.getFullYear(), H = e.value.getMonth();
526
- return new Date(w, H, 1) > f;
527
- }), n = $(() => {
528
- if (!l.maxDate) return !0;
529
- const f = U(l.maxDate);
530
- if (!f) return !0;
531
- const w = e.value.getFullYear(), H = e.value.getMonth();
532
- return new Date(w, H + 1, 0) < f;
533
- }), h = () => {
534
- i.value && (e.value = new Date(e.value.getFullYear(), e.value.getMonth() - 1, 1));
535
- }, b = () => {
536
- n.value && (e.value = new Date(e.value.getFullYear(), e.value.getMonth() + 1, 1));
519
+ return w.test(v) ? v.includes(".") ? "YYYY-MM-DDTHH:mm:ss.sssZ" : "YYYY-MM-DDTHH:mm:ssZ" : H.test(v) ? "YYYY-MM-DD" : e.format || "YYYY-MM-DD";
520
+ }, i = $(() => {
521
+ if (!e.value) return !1;
522
+ if (e.value instanceof Date) return !0;
523
+ const v = u(e.value);
524
+ return v.includes("H") || v.includes("h") || v.includes("m") || v.includes("T");
525
+ }), c = $(() => {
526
+ if (!e.minDate) return !0;
527
+ const v = U(e.minDate);
528
+ if (!v) return !0;
529
+ const w = a.value.getFullYear(), H = a.value.getMonth();
530
+ return new Date(w, H, 1) > v;
531
+ }), s = $(() => {
532
+ if (!e.maxDate) return !0;
533
+ const v = U(e.maxDate);
534
+ if (!v) return !0;
535
+ const w = a.value.getFullYear(), H = a.value.getMonth();
536
+ return new Date(w, H + 1, 0) < v;
537
+ }), f = () => {
538
+ c.value && (a.value = new Date(a.value.getFullYear(), a.value.getMonth() - 1, 1));
539
+ }, M = () => {
540
+ s.value && (a.value = new Date(a.value.getFullYear(), a.value.getMonth() + 1, 1));
537
541
  }, m = () => {
538
- e.value = new Date(e.value.getFullYear() - 1, e.value.getMonth(), 1);
542
+ a.value = new Date(a.value.getFullYear() - 1, a.value.getMonth(), 1);
539
543
  }, S = () => {
540
- e.value = new Date(e.value.getFullYear() + 1, e.value.getMonth(), 1);
544
+ a.value = new Date(a.value.getFullYear() + 1, a.value.getMonth(), 1);
541
545
  }, y = () => {
542
- e.value = new Date(e.value.getFullYear() - 10, e.value.getMonth(), 1);
546
+ a.value = new Date(a.value.getFullYear() - 10, a.value.getMonth(), 1);
543
547
  }, d = () => {
544
- e.value = new Date(e.value.getFullYear() + 10, e.value.getMonth(), 1);
545
- }, a = () => {
546
- e.value = /* @__PURE__ */ new Date(), u.value = "date";
547
- }, o = () => {
548
- switch (u.value) {
548
+ a.value = new Date(a.value.getFullYear() + 10, a.value.getMonth(), 1);
549
+ }, n = () => {
550
+ a.value = /* @__PURE__ */ new Date(), t.value = "date";
551
+ }, r = () => {
552
+ switch (t.value) {
549
553
  case "date":
550
- u.value = "year";
554
+ t.value = "year";
551
555
  break;
552
556
  case "year":
553
- u.value = "date";
557
+ t.value = "date";
554
558
  break;
555
559
  }
556
- }, D = (f) => {
557
- if (!le(f, l.minDate, l.maxDate, l.disabledDates)) {
558
- if (t.value && q(t.value, f)) {
559
- s("update:value", null), s("change", null), s("select", null);
560
+ }, D = (v) => {
561
+ if (!le(v, e.minDate, e.maxDate, e.disabledDates)) {
562
+ if (l.value && L(l.value, v)) {
563
+ o("update:value", null), o("change", null), o("select", null);
560
564
  return;
561
565
  }
562
- l.mode === "dateTime" && t.value && f.setHours(t.value.getHours(), t.value.getMinutes()), T(f);
566
+ e.mode === "dateTime" && l.value && v.setHours(l.value.getHours(), l.value.getMinutes()), T(v);
563
567
  }
564
- }, M = (f) => {
565
- if (t.value && q(t.value, f)) {
566
- s("update:value", null), s("change", null), s("select", null);
568
+ }, b = (v) => {
569
+ if (l.value && L(l.value, v)) {
570
+ o("update:value", null), o("change", null), o("select", null);
567
571
  return;
568
572
  }
569
- T(f);
570
- }, V = (f) => {
571
- const w = new Date(e.value.getFullYear(), f, 1);
572
- if (e.value = w, u.value = "date", l.mode === "month") {
573
- if (t.value && oe(t.value, w)) {
574
- s("update:value", null), s("change", null), s("select", null);
573
+ T(v);
574
+ }, V = (v) => {
575
+ const w = new Date(a.value.getFullYear(), v, 1);
576
+ if (a.value = w, t.value = "date", e.mode === "month") {
577
+ if (l.value && oe(l.value, w)) {
578
+ o("update:value", null), o("change", null), o("select", null);
575
579
  return;
576
580
  }
577
581
  T(w);
578
582
  }
579
- }, Y = (f) => {
580
- e.value = new Date(f, e.value.getMonth(), 1), u.value = "date";
581
- }, T = (f, w = !1) => {
583
+ }, Y = (v) => {
584
+ a.value = new Date(v, a.value.getMonth(), 1), t.value = "date";
585
+ }, T = (v, w = !1) => {
582
586
  let H;
583
- if (typeof l.value == "string" || l.value === null || l.value === void 0)
584
- if (l.format && l.format !== "YYYY-MM-DD" && !w && l.mode !== "dateTime" && l.mode !== "time")
585
- H = Z(f, l.format);
586
- else if (l.mode === "dateTime" || l.mode === "time" || w)
587
- H = f.toISOString();
587
+ if (typeof e.value == "string" || e.value === null || e.value === void 0)
588
+ if (e.format && e.format !== "YYYY-MM-DD" && !w && e.mode !== "dateTime" && e.mode !== "time")
589
+ H = Z(v, e.format);
590
+ else if (e.mode === "dateTime" || e.mode === "time" || w)
591
+ H = v.toISOString();
588
592
  else {
589
- const z = f.getFullYear(), _ = String(f.getMonth() + 1).padStart(2, "0"), N = String(f.getDate()).padStart(2, "0");
593
+ const z = v.getFullYear(), _ = String(v.getMonth() + 1).padStart(2, "0"), N = String(v.getDate()).padStart(2, "0");
590
594
  H = `${z}-${_}-${N}`;
591
595
  }
592
596
  else
593
- H = f;
594
- s("update:value", H), s("change", H), s("select", H);
597
+ H = v;
598
+ o("update:value", H), o("change", H), o("select", H);
595
599
  };
596
600
  return {
597
- currentDate: e,
598
- viewMode: u,
599
- selectedDate: t,
600
- canGoPrev: i,
601
- canGoNext: n,
602
- hasTime: r,
603
- goToPrevMonth: h,
604
- goToNextMonth: b,
601
+ currentDate: a,
602
+ viewMode: t,
603
+ selectedDate: l,
604
+ canGoPrev: c,
605
+ canGoNext: s,
606
+ hasTime: i,
607
+ goToPrevMonth: f,
608
+ goToNextMonth: M,
605
609
  goToPrevYear: m,
606
610
  goToNextYear: S,
607
611
  goToPrevDecade: y,
608
612
  goToNextDecade: d,
609
- goToCurrentDate: a,
610
- onHeaderClick: o,
613
+ goToCurrentDate: n,
614
+ onHeaderClick: r,
611
615
  onDateSelect: D,
612
- onWeekSelect: M,
616
+ onWeekSelect: b,
613
617
  onMonthSelect: V,
614
618
  onYearSelect: Y,
615
619
  emitValue: T
@@ -636,142 +640,142 @@ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
636
640
  minuteInterval: { default: 1 }
637
641
  },
638
642
  emits: ["update:value", "change", "select"],
639
- setup(l, { emit: s }) {
640
- const e = l, u = s, {
643
+ setup(e, { emit: o }) {
644
+ const l = e, a = o, {
641
645
  currentDate: t,
642
- viewMode: c,
643
- selectedDate: r,
644
- canGoPrev: i,
645
- canGoNext: n,
646
- hasTime: h,
647
- goToPrevMonth: b,
646
+ viewMode: u,
647
+ selectedDate: i,
648
+ canGoPrev: c,
649
+ canGoNext: s,
650
+ hasTime: f,
651
+ goToPrevMonth: M,
648
652
  goToNextMonth: m,
649
653
  goToPrevYear: S,
650
654
  goToNextYear: y,
651
655
  goToPrevDecade: d,
652
- goToNextDecade: a,
653
- goToCurrentDate: o,
656
+ goToNextDecade: n,
657
+ goToCurrentDate: r,
654
658
  onHeaderClick: D,
655
- onDateSelect: M,
659
+ onDateSelect: b,
656
660
  onWeekSelect: V,
657
661
  onMonthSelect: Y,
658
662
  onYearSelect: T,
659
- emitValue: f
660
- } = ze(e, u), w = (_) => {
663
+ emitValue: v
664
+ } = ze(l, a), w = (_) => {
661
665
  if (_ === null) {
662
- if (r.value) {
663
- const N = new Date(r.value);
666
+ if (i.value) {
667
+ const N = new Date(i.value);
664
668
  N.setHours(0, 0, 0, 0);
665
669
  const O = Z(N, "YYYY-MM-DD");
666
- u("update:value", O), u("change", O), u("select", O);
670
+ a("update:value", O), a("change", O), a("select", O);
667
671
  }
668
672
  return;
669
673
  }
670
- if (e.mode === "dateTime" && r.value) {
671
- const N = new Date(r.value.getTime());
672
- N.setHours(_.getHours(), _.getMinutes(), 0, 0), f(N, !0);
674
+ if (l.mode === "dateTime" && i.value) {
675
+ const N = new Date(i.value.getTime());
676
+ N.setHours(_.getHours(), _.getMinutes(), 0, 0), v(N, !0);
673
677
  } else
674
- f(_, !0);
678
+ v(_, !0);
675
679
  }, H = () => {
676
- c.value === "year" ? d() : c.value === "month" ? S() : b();
680
+ u.value === "year" ? d() : u.value === "month" ? S() : M();
677
681
  }, z = () => {
678
- c.value === "year" ? a() : c.value === "month" ? y() : m();
682
+ u.value === "year" ? n() : u.value === "month" ? y() : m();
679
683
  };
680
- return (_, N) => (p(), k("div", {
684
+ return (_, N) => (h(), k("div", {
681
685
  class: C(["date-picker", _.mode == "dateTime" && "date-picker-container-wide"])
682
686
  }, [
683
- _.mode !== "time" ? (p(), k("div", Re, [
687
+ _.mode !== "time" ? (h(), k("div", Re, [
684
688
  G(Le, {
685
689
  "current-date": g(t),
686
- "view-mode": g(c),
690
+ "view-mode": g(u),
687
691
  onHeaderClick: g(D)
688
692
  }, null, 8, ["current-date", "view-mode", "onHeaderClick"]),
689
- v("div", Je, [
690
- v("button", {
693
+ p("div", Je, [
694
+ p("button", {
691
695
  class: "date-picker-nav-button",
692
- disabled: !g(i),
696
+ disabled: !g(c),
693
697
  onClick: H,
694
698
  type: "button",
695
699
  "aria-label": "Previous"
696
700
  }, [
697
- v("span", {
701
+ p("span", {
698
702
  class: "date-picker-nav-icon",
699
703
  innerHTML: g(Oe)
700
704
  }, null, 8, Ze)
701
705
  ], 8, Ue),
702
- v("button", {
706
+ p("button", {
703
707
  class: "date-picker-nav-button",
704
708
  onClick: N[0] || (N[0] = //@ts-ignore
705
- (...O) => g(o) && g(o)(...O)),
709
+ (...O) => g(r) && g(r)(...O)),
706
710
  type: "button",
707
711
  "aria-label": "Current Date"
708
712
  }, [
709
- v("span", {
713
+ p("span", {
710
714
  class: "date-picker-nav-icon",
711
715
  innerHTML: g(Ge)
712
716
  }, null, 8, Ee)
713
717
  ]),
714
- v("button", {
718
+ p("button", {
715
719
  class: "date-picker-nav-button",
716
- disabled: !g(n),
720
+ disabled: !g(s),
717
721
  onClick: z,
718
722
  type: "button",
719
723
  "aria-label": "Next"
720
724
  }, [
721
- v("span", {
725
+ p("span", {
722
726
  class: "date-picker-nav-icon",
723
727
  innerHTML: g(We)
724
728
  }, null, 8, Ke)
725
729
  ], 8, je)
726
730
  ])
727
731
  ])) : B("", !0),
728
- v("div", {
732
+ p("div", {
729
733
  class: C({
730
- "date-picker-datetime-layout": _.mode === "dateTime" && g(c) === "date"
734
+ "date-picker-datetime-layout": _.mode === "dateTime" && g(u) === "date"
731
735
  })
732
736
  }, [
733
- v("div", Qe, [
734
- g(c) === "date" && (_.mode === "date" || _.mode === "dateTime") ? (p(), W(pe, {
737
+ p("div", Qe, [
738
+ g(u) === "date" && (_.mode === "date" || _.mode === "dateTime") ? (h(), W(pe, {
735
739
  key: 0,
736
740
  "current-date": g(t),
737
- "selected-date": g(r),
741
+ "selected-date": g(i),
738
742
  "min-date": _.minDate,
739
743
  "max-date": _.maxDate,
740
744
  "disabled-dates": _.disabledDates,
741
- onSelect: g(M)
745
+ onSelect: g(b)
742
746
  }, null, 8, ["current-date", "selected-date", "min-date", "max-date", "disabled-dates", "onSelect"])) : B("", !0),
743
- _.mode === "week" && g(c) === "date" ? (p(), W(Me, {
747
+ _.mode === "week" && g(u) === "date" ? (h(), W(be, {
744
748
  key: 1,
745
749
  "current-date": g(t),
746
- "selected-date": g(r),
750
+ "selected-date": g(i),
747
751
  onSelect: g(V)
748
752
  }, null, 8, ["current-date", "selected-date", "onSelect"])) : B("", !0),
749
- g(c) !== "year" && (g(c) === "month" || _.mode === "month") ? (p(), W(qe, {
753
+ g(u) !== "year" && (g(u) === "month" || _.mode === "month") ? (h(), W(qe, {
750
754
  key: 2,
751
755
  "current-date": g(t),
752
- "selected-date": g(r),
756
+ "selected-date": g(i),
753
757
  onSelect: g(Y)
754
758
  }, null, 8, ["current-date", "selected-date", "onSelect"])) : B("", !0),
755
- g(c) === "year" ? (p(), W(Ae, {
759
+ g(u) === "year" ? (h(), W(Ae, {
756
760
  key: 3,
757
761
  "current-date": g(t),
758
- "selected-date": g(r),
762
+ "selected-date": g(i),
759
763
  onSelect: g(T),
760
764
  onMonthSelect: g(Y)
761
765
  }, null, 8, ["current-date", "selected-date", "onSelect", "onMonthSelect"])) : B("", !0)
762
766
  ]),
763
- _.mode === "dateTime" && g(c) === "date" ? (p(), k("div", Xe, [
767
+ _.mode === "dateTime" && g(u) === "date" ? (h(), k("div", Xe, [
764
768
  G(j, {
765
- "selected-time": g(h) ? g(r) : null,
769
+ "selected-time": g(f) ? g(i) : null,
766
770
  "time-format": _.timeFormat,
767
771
  "minute-interval": _.minuteInterval,
768
772
  onUpdate: w
769
773
  }, null, 8, ["selected-time", "time-format", "minute-interval"])
770
774
  ])) : B("", !0)
771
775
  ], 2),
772
- _.mode === "time" ? (p(), W(j, {
776
+ _.mode === "time" ? (h(), W(j, {
773
777
  key: 1,
774
- "selected-time": g(r),
778
+ "selected-time": g(i),
775
779
  "time-format": _.timeFormat,
776
780
  "minute-interval": _.minuteInterval,
777
781
  onUpdate: w
@@ -794,22 +798,22 @@ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
794
798
  minuteInterval: { default: 1 }
795
799
  },
796
800
  emits: ["select-hour", "select-minute", "select-period", "close"],
797
- setup(l, { expose: s, emit: e }) {
798
- const u = l, t = e, c = P(null), r = P(null), i = P(null), n = $(() => u.is12Hour ? Array.from({ length: 12 }, (d, a) => a + 1) : Array.from({ length: 24 }, (d, a) => a)), h = $(() => {
799
- const d = u.minuteInterval, a = Math.floor(60 / d);
800
- return Array.from({ length: a }, (o, D) => D * d);
801
- }), b = () => {
802
- if (c.value) {
803
- const d = c.value.querySelectorAll(".time-picker-option-button"), a = Array.from(d).findIndex((o) => o.classList.contains("selected"));
804
- a !== -1 && d[a].scrollIntoView({ block: "center", behavior: "auto" });
801
+ setup(e, { expose: o, emit: l }) {
802
+ const a = e, t = l, u = P(null), i = P(null), c = P(null), s = $(() => a.is12Hour ? Array.from({ length: 12 }, (d, n) => n + 1) : Array.from({ length: 24 }, (d, n) => n)), f = $(() => {
803
+ const d = a.minuteInterval, n = Math.floor(60 / d);
804
+ return Array.from({ length: n }, (r, D) => D * d);
805
+ }), M = () => {
806
+ if (u.value) {
807
+ const d = u.value.querySelectorAll(".time-picker-option-button"), n = Array.from(d).findIndex((r) => r.classList.contains("selected"));
808
+ n !== -1 && d[n].scrollIntoView({ block: "center", behavior: "auto" });
805
809
  }
806
- if (r.value) {
807
- const d = r.value.querySelectorAll(".time-picker-option-button"), a = Array.from(d).findIndex((o) => o.classList.contains("selected"));
808
- a !== -1 && d[a].scrollIntoView({ block: "center", behavior: "auto" });
810
+ if (i.value) {
811
+ const d = i.value.querySelectorAll(".time-picker-option-button"), n = Array.from(d).findIndex((r) => r.classList.contains("selected"));
812
+ n !== -1 && d[n].scrollIntoView({ block: "center", behavior: "auto" });
809
813
  }
810
- if (u.is12Hour && i.value) {
811
- const d = i.value.querySelectorAll(".time-picker-option-button"), a = Array.from(d).findIndex((o) => o.classList.contains("selected"));
812
- a !== -1 && d[a].scrollIntoView({ block: "center", behavior: "auto" });
814
+ if (a.is12Hour && c.value) {
815
+ const d = c.value.querySelectorAll(".time-picker-option-button"), n = Array.from(d).findIndex((r) => r.classList.contains("selected"));
816
+ n !== -1 && d[n].scrollIntoView({ block: "center", behavior: "auto" });
813
817
  }
814
818
  }, m = (d) => {
815
819
  t("select-hour", d);
@@ -818,51 +822,51 @@ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
818
822
  }, y = (d) => {
819
823
  t("select-period", d);
820
824
  };
821
- return s({ scrollToSelected: b }), (d, a) => (p(), k("div", et, [
822
- v("div", tt, [
823
- v("div", lt, [
824
- v("div", {
825
+ return o({ scrollToSelected: M }), (d, n) => (h(), k("div", et, [
826
+ p("div", tt, [
827
+ p("div", lt, [
828
+ p("div", {
825
829
  ref_key: "hourScroll",
826
- ref: c,
830
+ ref: u,
827
831
  class: "time-picker-options-scroll"
828
832
  }, [
829
- (p(!0), k(F, null, I(n.value, (o) => (p(), k("button", {
830
- key: o,
833
+ (h(!0), k(F, null, I(s.value, (r) => (h(), k("button", {
834
+ key: r,
831
835
  type: "button",
832
- class: C(["time-picker-option-button", { selected: o === d.selectedHour }]),
833
- onClick: (D) => m(o)
834
- }, A(String(o).padStart(2, "0")), 11, at))), 128))
836
+ class: C(["time-picker-option-button", { selected: r === d.selectedHour }]),
837
+ onClick: (D) => m(r)
838
+ }, A(String(r).padStart(2, "0")), 11, at))), 128))
835
839
  ], 512)
836
840
  ]),
837
- v("div", nt, [
838
- v("div", {
841
+ p("div", nt, [
842
+ p("div", {
839
843
  ref_key: "minuteScroll",
840
- ref: r,
844
+ ref: i,
841
845
  class: "time-picker-options-scroll"
842
846
  }, [
843
- (p(!0), k(F, null, I(h.value, (o) => (p(), k("button", {
844
- key: o,
847
+ (h(!0), k(F, null, I(f.value, (r) => (h(), k("button", {
848
+ key: r,
845
849
  type: "button",
846
- class: C(["time-picker-option-button", { selected: o === d.selectedMinute }]),
847
- onClick: (D) => S(o)
848
- }, A(String(o).padStart(2, "0")), 11, st))), 128))
850
+ class: C(["time-picker-option-button", { selected: r === d.selectedMinute }]),
851
+ onClick: (D) => S(r)
852
+ }, A(String(r).padStart(2, "0")), 11, st))), 128))
849
853
  ], 512)
850
854
  ]),
851
- d.is12Hour ? (p(), k("div", ot, [
852
- v("div", {
855
+ d.is12Hour ? (h(), k("div", ot, [
856
+ p("div", {
853
857
  ref_key: "periodScroll",
854
- ref: i,
858
+ ref: c,
855
859
  class: "time-picker-options-scroll"
856
860
  }, [
857
- v("button", {
861
+ p("button", {
858
862
  type: "button",
859
863
  class: C(["time-picker-option-button", { selected: d.selectedPeriod === "AM" }]),
860
- onClick: a[0] || (a[0] = (o) => y("AM"))
864
+ onClick: n[0] || (n[0] = (r) => y("AM"))
861
865
  }, " AM ", 2),
862
- v("button", {
866
+ p("button", {
863
867
  type: "button",
864
868
  class: C(["time-picker-option-button", { selected: d.selectedPeriod === "PM" }]),
865
- onClick: a[1] || (a[1] = (o) => y("PM"))
869
+ onClick: n[1] || (n[1] = (r) => y("PM"))
866
870
  }, " PM ", 2)
867
871
  ], 512)
868
872
  ])) : B("", !0)
@@ -880,23 +884,23 @@ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
880
884
  disabled: { type: Boolean },
881
885
  readonly: { type: Boolean }
882
886
  },
883
- setup(l) {
884
- const s = l, e = $(() => {
885
- const u = String(s.minute).padStart(2, "0");
886
- if (s.is12Hour) {
887
- let t = s.hour % 12;
888
- return t === 0 && (t = 12), `${String(t).padStart(2, "0")}:${u} ${s.period}`;
887
+ setup(e) {
888
+ const o = e, l = $(() => {
889
+ const a = String(o.minute).padStart(2, "0");
890
+ if (o.is12Hour) {
891
+ let t = o.hour % 12;
892
+ return t === 0 && (t = 12), `${String(t).padStart(2, "0")}:${a} ${o.period}`;
889
893
  } else
890
- return `${String(s.hour).padStart(2, "0")}:${u}`;
894
+ return `${String(o.hour).padStart(2, "0")}:${a}`;
891
895
  });
892
- return (u, t) => K(u.$slots, "default", Q(X({ displayTime: e.value })), () => [
893
- v("button", {
896
+ return (a, t) => K(a.$slots, "default", Q(X({ displayTime: l.value })), () => [
897
+ p("button", {
894
898
  type: "button",
895
- class: C(["time-picker-input", [u.triggerClass, { "is-disabled": u.disabled, "is-readonly": u.readonly }]]),
896
- disabled: u.disabled || u.readonly
899
+ class: C(["time-picker-input", [a.triggerClass, { "is-disabled": a.disabled, "is-readonly": a.readonly }]]),
900
+ disabled: a.disabled || a.readonly
897
901
  }, [
898
- v("span", ct, A(e.value), 1),
899
- t[0] || (t[0] = v("svg", {
902
+ p("span", ct, A(l.value), 1),
903
+ t[0] || (t[0] = p("svg", {
900
904
  class: "time-picker-clock-icon",
901
905
  xmlns: "http://www.w3.org/2000/svg",
902
906
  width: "18",
@@ -908,12 +912,12 @@ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
908
912
  "stroke-linecap": "round",
909
913
  "stroke-linejoin": "round"
910
914
  }, [
911
- v("circle", {
915
+ p("circle", {
912
916
  cx: "12",
913
917
  cy: "12",
914
918
  r: "10"
915
919
  }),
916
- v("polyline", { points: "12,6 12,12 16,14" })
920
+ p("polyline", { points: "12,6 12,12 16,14" })
917
921
  ], -1))
918
922
  ], 10, it)
919
923
  ]);
@@ -934,50 +938,50 @@ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
934
938
  readonly: { type: Boolean, default: !1 }
935
939
  },
936
940
  emits: ["update:modelValue"],
937
- setup(l, { emit: s }) {
938
- const e = l, u = s, t = P(12), c = P(0), r = P("AM"), i = P(null), n = $(() => e.timeFormat === "12h"), h = () => {
939
- if (e.modelValue) {
940
- let a = 0, o = 0;
941
- if (e.modelValue instanceof Date)
942
- a = e.modelValue.getHours(), o = e.modelValue.getMinutes();
943
- else if (typeof e.modelValue == "string") {
944
- const [D, M] = e.modelValue.split(":");
945
- a = parseInt(D), o = parseInt(M);
941
+ setup(e, { emit: o }) {
942
+ const l = e, a = o, t = P(12), u = P(0), i = P("AM"), c = P(null), s = $(() => l.timeFormat === "12h"), f = () => {
943
+ if (l.modelValue) {
944
+ let n = 0, r = 0;
945
+ if (l.modelValue instanceof Date)
946
+ n = l.modelValue.getHours(), r = l.modelValue.getMinutes();
947
+ else if (typeof l.modelValue == "string") {
948
+ const [D, b] = l.modelValue.split(":");
949
+ n = parseInt(D), r = parseInt(b);
946
950
  } else {
947
951
  const D = /* @__PURE__ */ new Date();
948
- a = D.getHours(), o = D.getMinutes();
952
+ n = D.getHours(), r = D.getMinutes();
949
953
  }
950
- c.value = o, n.value ? a === 0 ? (t.value = 12, r.value = "AM") : a === 12 ? (t.value = 12, r.value = "PM") : a > 12 ? (t.value = a - 12, r.value = "PM") : (t.value = a, r.value = "AM") : t.value = a;
954
+ u.value = r, s.value ? n === 0 ? (t.value = 12, i.value = "AM") : n === 12 ? (t.value = 12, i.value = "PM") : n > 12 ? (t.value = n - 12, i.value = "PM") : (t.value = n, i.value = "AM") : t.value = n;
951
955
  } else {
952
- const a = /* @__PURE__ */ new Date(), o = a.getHours(), D = a.getMinutes();
953
- c.value = D, n.value ? o === 0 ? (t.value = 12, r.value = "AM") : o === 12 ? (t.value = 12, r.value = "PM") : o > 12 ? (t.value = o - 12, r.value = "PM") : (t.value = o, r.value = "AM") : t.value = o;
956
+ const n = /* @__PURE__ */ new Date(), r = n.getHours(), D = n.getMinutes();
957
+ u.value = D, s.value ? r === 0 ? (t.value = 12, i.value = "AM") : r === 12 ? (t.value = 12, i.value = "PM") : r > 12 ? (t.value = r - 12, i.value = "PM") : (t.value = r, i.value = "AM") : t.value = r;
954
958
  }
955
- }, b = () => {
956
- let a = t.value;
957
- n.value && (r.value === "AM" && a === 12 ? a = 0 : r.value === "PM" && a !== 12 && (a += 12));
958
- const o = `${String(a).padStart(2, "0")}:${String(c.value).padStart(2, "0")}`;
959
- u("update:modelValue", o);
960
- }, m = (a) => {
961
- t.value = a, b();
962
- }, S = (a) => {
963
- c.value = a, b();
964
- }, y = (a) => {
965
- r.value = a, b();
959
+ }, M = () => {
960
+ let n = t.value;
961
+ s.value && (i.value === "AM" && n === 12 ? n = 0 : i.value === "PM" && n !== 12 && (n += 12));
962
+ const r = `${String(n).padStart(2, "0")}:${String(u.value).padStart(2, "0")}`;
963
+ a("update:modelValue", r);
964
+ }, m = (n) => {
965
+ t.value = n, M();
966
+ }, S = (n) => {
967
+ u.value = n, M();
968
+ }, y = (n) => {
969
+ i.value = n, M();
966
970
  }, d = () => {
967
- var a;
968
- (a = i == null ? void 0 : i.value) == null || a.scrollToSelected();
971
+ var n;
972
+ (n = c == null ? void 0 : c.value) == null || n.scrollToSelected();
969
973
  };
970
- return L(() => e.modelValue, h, { immediate: !0 }), L(() => e.timeFormat, h), L(() => e.minuteInterval, h), (a, o) => (p(), k("div", dt, [
974
+ return q(() => l.modelValue, f, { immediate: !0 }), q(() => l.timeFormat, f), q(() => l.minuteInterval, f), (n, r) => (h(), k("div", dt, [
971
975
  G(g(se), {
972
976
  trigger: "click",
973
977
  placement: "bottom-start",
974
978
  onOnShow: d,
975
979
  teleport: "",
976
980
  arrow: !1,
977
- offset: a.offset,
981
+ offset: n.offset,
978
982
  triggerClass: "w-full",
979
- "class-name": `v-time-picker ${a.className}`,
980
- styles: a.style,
983
+ "class-name": `v-time-picker ${n.className}`,
984
+ styles: n.style,
981
985
  style: {
982
986
  width: "100%"
983
987
  }
@@ -985,15 +989,15 @@ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
985
989
  trigger: J(() => [
986
990
  G(ut, {
987
991
  hour: t.value,
988
- minute: c.value,
989
- period: r.value,
990
- "is12-hour": n.value,
991
- "trigger-class": a.triggerClass,
992
- disabled: a.disabled,
993
- readonly: a.readonly
992
+ minute: u.value,
993
+ period: i.value,
994
+ "is12-hour": s.value,
995
+ "trigger-class": n.triggerClass,
996
+ disabled: n.disabled,
997
+ readonly: n.readonly
994
998
  }, {
995
999
  default: J(({ displayTime: D }) => [
996
- K(a.$slots, "default", Q(X({ displayTime: D })))
1000
+ K(n.$slots, "default", Q(X({ displayTime: D })))
997
1001
  ]),
998
1002
  _: 3
999
1003
  }, 8, ["hour", "minute", "period", "is12-hour", "trigger-class", "disabled", "readonly"])
@@ -1001,12 +1005,12 @@ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
1001
1005
  default: J(() => [
1002
1006
  G(rt, {
1003
1007
  ref_key: "dropdownRef",
1004
- ref: i,
1008
+ ref: c,
1005
1009
  "selected-hour": t.value,
1006
- "selected-minute": c.value,
1007
- "selected-period": r.value,
1008
- "is12-hour": n.value,
1009
- "minute-interval": a.minuteInterval,
1010
+ "selected-minute": u.value,
1011
+ "selected-period": i.value,
1012
+ "is12-hour": s.value,
1013
+ "minute-interval": n.minuteInterval,
1010
1014
  onSelectHour: m,
1011
1015
  onSelectMinute: S,
1012
1016
  onSelectPeriod: y