v-datepicker-lite 0.1.6 → 0.1.8

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 +240 -236
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,44 +1,48 @@
1
- import { defineComponent as B, computed as $, createElementBlock as k, openBlock as p, createElementVNode as v, Fragment as P, renderList as F, unref as g, toDisplayString as A, normalizeClass as H, ref as C, watch as O, nextTick as R, onMounted as se, createCommentVNode as q, createBlock as W, createVNode as G, renderSlot as K, normalizeProps as Q, guardReactiveProps as X, withCtx as U } from "vue";
2
- import ne from "v-tooltip-lite";
3
- const J = (l, n = "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"), s = String(l.getMilliseconds()).padStart(3, "0");
5
- return n.replace("YYYY", e.toString()).replace("MM", u).replace("DD", t).replace("HH", c).replace("mm", r).replace("ss", i).replace("sss", s);
6
- }, Z = (l) => {
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";
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
7
  if (!l) return null;
8
- const n = new Date(l);
9
- return isNaN(n.getTime()) ? null : n;
10
- }, L = (l, n) => l.getFullYear() === n.getFullYear() && l.getMonth() === n.getMonth() && l.getDate() === n.getDate(), oe = (l, n) => l.getFullYear() === n.getFullYear() && l.getMonth() === n.getMonth(), re = (l) => {
11
- const n = new Date(l.getFullYear(), 0, 1), e = (l.getTime() - n.getTime()) / 864e5;
12
- return Math.ceil((e + n.getDay() + 1) / 7);
13
- }, ee = (l, n) => {
14
- const e = new Date(l, n, 1), t = new Date(l, n + 1, 0).getDate(), c = e.getDay(), r = [], i = /* @__PURE__ */ new Date(), s = n === 0 ? 11 : n - 1, h = n === 0 ? l - 1 : l, b = new Date(h, s + 1, 0).getDate();
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);
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();
15
19
  for (let d = c - 1; d >= 0; d--) {
16
- const a = new Date(h, s, b - d);
20
+ const a = new Date(h, n, b - d);
17
21
  r.push({
18
22
  date: a,
19
23
  day: b - d,
20
- month: s,
24
+ month: n,
21
25
  year: h,
22
26
  isCurrentMonth: !1,
23
- isToday: L(a, i),
27
+ isToday: q(a, i),
24
28
  isSelected: !1,
25
29
  isDisabled: !1
26
30
  });
27
31
  }
28
32
  for (let d = 1; d <= t; d++) {
29
- const a = new Date(l, n, d);
33
+ const a = new Date(l, s, d);
30
34
  r.push({
31
35
  date: a,
32
36
  day: d,
33
- month: n,
37
+ month: s,
34
38
  year: l,
35
39
  isCurrentMonth: !0,
36
- isToday: L(a, i),
40
+ isToday: q(a, i),
37
41
  isSelected: !1,
38
42
  isDisabled: !1
39
43
  });
40
44
  }
41
- const m = 42 - r.length, S = n === 11 ? 0 : n + 1, y = n === 11 ? l + 1 : l;
45
+ const m = 42 - r.length, S = s === 11 ? 0 : s + 1, y = s === 11 ? l + 1 : l;
42
46
  for (let d = 1; d <= m; d++) {
43
47
  const a = new Date(y, S, d);
44
48
  r.push({
@@ -47,14 +51,14 @@ const J = (l, n = "YYYY-MM-DD") => {
47
51
  month: S,
48
52
  year: y,
49
53
  isCurrentMonth: !1,
50
- isToday: L(a, i),
54
+ isToday: q(a, i),
51
55
  isSelected: !1,
52
56
  isDisabled: !1
53
57
  });
54
58
  }
55
59
  return r;
56
- }, ie = (l, n) => {
57
- const e = ee(l, n), u = [];
60
+ }, ie = (l, s) => {
61
+ const e = ee(l, s), u = [];
58
62
  for (let t = 0; t < e.length; t += 7) {
59
63
  const c = e.slice(t, t + 7), r = re(c[0].date);
60
64
  u.push({
@@ -83,9 +87,9 @@ const J = (l, n = "YYYY-MM-DD") => {
83
87
  name: e,
84
88
  isSelected: !1,
85
89
  isDisabled: !1
86
- })), le = (l, n, e, u) => {
87
- const t = J(l, "YYYY-MM-DD");
88
- return n && t < n || e && t > e ? !0 : u ? u.some((c) => c.end ? t >= c.start && t <= c.end : t === c.start) : !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;
89
93
  }, E = [
90
94
  "January",
91
95
  "February",
@@ -99,7 +103,7 @@ const J = (l, n = "YYYY-MM-DD") => {
99
103
  "October",
100
104
  "November",
101
105
  "December"
102
- ], ae = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], ce = { class: "date-picker-content dates" }, ue = { class: "date-picker-table" }, de = { class: "date-picker-weekdays-row" }, me = { class: "date-picker-days-body" }, ve = ["onClick", "disabled"], pe = /* @__PURE__ */ B({
106
+ ], ae = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], ce = { class: "date-picker-content dates" }, ue = { class: "date-picker-table" }, de = { class: "date-picker-weekdays-row" }, me = { class: "date-picker-days-body" }, ve = ["onClick", "disabled"], pe = /* @__PURE__ */ x({
103
107
  __name: "DateView",
104
108
  props: {
105
109
  currentDate: {},
@@ -109,37 +113,37 @@ const J = (l, n = "YYYY-MM-DD") => {
109
113
  disabledDates: {}
110
114
  },
111
115
  emits: ["select"],
112
- setup(l, { emit: n }) {
113
- const e = l, u = n, t = $(() => ee(e.currentDate.getFullYear(), e.currentDate.getMonth()).map((s) => ({
114
- ...s,
115
- isSelected: e.selectedDate ? L(s.date, e.selectedDate) : !1,
116
- isDisabled: le(s.date, e.minDate, e.maxDate, e.disabledDates)
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)
117
121
  }))), c = $(() => {
118
122
  const i = [];
119
- for (let s = 0; s < t.value.length; s += 7)
120
- i.push(t.value.slice(s, s + 7));
121
- return i.filter((s) => s.some((h) => h.isCurrentMonth));
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));
122
126
  }), r = (i) => {
123
127
  i.isDisabled || u("select", i.date);
124
128
  };
125
- return (i, s) => (p(), k("div", ce, [
129
+ return (i, n) => (p(), k("div", ce, [
126
130
  v("table", ue, [
127
131
  v("thead", null, [
128
132
  v("tr", de, [
129
- (p(!0), k(P, null, F(g(ae), (h) => (p(), k("th", { key: h }, A(h), 1))), 128))
133
+ (p(!0), k(F, null, I(g(ae), (h) => (p(), k("th", { key: h }, A(h), 1))), 128))
130
134
  ])
131
135
  ]),
132
136
  v("tbody", me, [
133
- (p(!0), k(P, null, F(c.value, (h, b) => (p(), k("tr", {
137
+ (p(!0), k(F, null, I(c.value, (h, b) => (p(), k("tr", {
134
138
  key: b,
135
139
  class: "date-picker-week-row"
136
140
  }, [
137
- (p(!0), k(P, null, F(h, (m) => (p(), k("td", {
141
+ (p(!0), k(F, null, I(h, (m) => (p(), k("td", {
138
142
  key: `${m.year}-${m.month}-${m.day}`,
139
143
  class: "date-picker-day-cell"
140
144
  }, [
141
145
  v("button", {
142
- class: H([
146
+ class: C([
143
147
  "date-picker-day",
144
148
  {
145
149
  "other-month": !m.isCurrentMonth,
@@ -161,23 +165,23 @@ const J = (l, n = "YYYY-MM-DD") => {
161
165
  class: "date-picker-table date-picker-week-table",
162
166
  cellpadding: "0",
163
167
  cellspacing: "0"
164
- }, 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__ */ B({
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({
165
169
  __name: "WeekView",
166
170
  props: {
167
171
  currentDate: {},
168
172
  selectedDate: {}
169
173
  },
170
174
  emits: ["select"],
171
- setup(l, { emit: n }) {
172
- const e = l, u = n, t = $(() => ie(e.currentDate.getFullYear(), e.currentDate.getMonth()).map((i) => {
173
- const s = e.selectedDate ? i.days.some((h) => L(h.date, e.selectedDate)) : !1;
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;
174
178
  return {
175
179
  ...i,
176
- isSelected: s
180
+ isSelected: n
177
181
  };
178
182
  })), c = (r) => {
179
- var s;
180
- const i = ((s = r.days.find((h) => h.isCurrentMonth)) == null ? void 0 : s.date) || r.days[0].date;
183
+ var n;
184
+ const i = ((n = r.days.find((h) => h.isCurrentMonth)) == null ? void 0 : n.date) || r.days[0].date;
181
185
  u("select", i);
182
186
  };
183
187
  return (r, i) => (p(), k("div", he, [
@@ -185,29 +189,29 @@ const J = (l, n = "YYYY-MM-DD") => {
185
189
  v("thead", null, [
186
190
  v("tr", ge, [
187
191
  i[0] || (i[0] = v("th", { class: "date-picker-weekday date-picker-week-header" }, "Wk", -1)),
188
- (p(!0), k(P, null, F(g(ae), (s) => (p(), k("th", { key: s }, A(s), 1))), 128))
192
+ (p(!0), k(F, null, I(g(ae), (n) => (p(), k("th", { key: n }, A(n), 1))), 128))
189
193
  ])
190
194
  ]),
191
195
  v("tbody", ke, [
192
- (p(!0), k(P, null, F(t.value, (s) => (p(), k("tr", {
193
- key: s.weekNumber,
194
- class: H([
196
+ (p(!0), k(F, null, I(t.value, (n) => (p(), k("tr", {
197
+ key: n.weekNumber,
198
+ class: C([
195
199
  "date-picker-week-row",
196
200
  {
197
- selected: s.isSelected
201
+ selected: n.isSelected
198
202
  }
199
203
  ]),
200
- onClick: (h) => c(s)
204
+ onClick: (h) => c(n)
201
205
  }, [
202
206
  v("td", ye, [
203
- v("div", be, A(s.weekNumber), 1)
207
+ v("div", be, A(n.weekNumber), 1)
204
208
  ]),
205
- (p(!0), k(P, null, F(s.days, (h) => (p(), k("td", {
209
+ (p(!0), k(F, null, I(n.days, (h) => (p(), k("td", {
206
210
  key: `${h.year}-${h.month}-${h.day}`,
207
211
  class: "date-picker-day-cell"
208
212
  }, [
209
213
  v("button", {
210
- class: H([
214
+ class: C([
211
215
  "date-picker-day",
212
216
  {
213
217
  "other-month": !h.isCurrentMonth,
@@ -222,8 +226,8 @@ const J = (l, n = "YYYY-MM-DD") => {
222
226
  ]));
223
227
  }
224
228
  });
225
- function Se(l, n = "24h", e = 1, u) {
226
- const t = C(0), c = C(0), r = C([]), i = C(!1), s = $(() => n === "12h"), h = () => {
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 = () => {
227
231
  if (l)
228
232
  t.value = l.getHours(), c.value = l.getMinutes(), i.value = !0;
229
233
  else {
@@ -234,24 +238,24 @@ function Se(l, n = "24h", e = 1, u) {
234
238
  }, b = (o) => {
235
239
  o ? (t.value = o.getHours(), c.value = o.getMinutes(), i.value = !0) : i.value = !1;
236
240
  }, m = () => {
237
- const o = [], D = s.value ? 1 : 0;
238
- for (let M = 0; M < (s.value ? 2 : 1); M++) {
239
- const N = s.value ? M === 0 ? " AM" : " PM" : "";
240
- for (let T = D; T <= (s.value ? 12 : 23); T++)
241
- for (let I = 0; I < 60; I += e) {
242
- const V = (s.value, T), f = s.value ? T === 12 ? M === 0 ? 0 : 12 : T + M * 12 : T, w = `${String(V).padStart(2, "0")}:${String(I).padStart(2, "0")}` + N;
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;
243
247
  o.push({
244
- display: w,
245
- value: `${String(f).padStart(2, "0")}:${String(I).padStart(2, "0")}`,
246
- hour: f,
247
- minute: I
248
+ display: z,
249
+ value: `${String(w).padStart(2, "0")}:${String(T).padStart(2, "0")}`,
250
+ hour: w,
251
+ minute: T
248
252
  });
249
253
  }
250
254
  }
251
- s.value ? r.value = o.map((M) => M.display) : r.value = o.map((M) => M.value);
255
+ n.value ? r.value = o.map((M) => M.display) : r.value = o.map((M) => M.value);
252
256
  }, S = () => {
253
257
  if (!i.value) return "";
254
- if (s.value) {
258
+ if (n.value) {
255
259
  const o = t.value === 0 ? 12 : t.value > 12 ? t.value - 12 : t.value, D = t.value < 12 ? " AM" : " PM";
256
260
  return `${String(o).padStart(2, "0")}:${String(c.value).padStart(
257
261
  2,
@@ -264,34 +268,34 @@ function Se(l, n = "24h", e = 1, u) {
264
268
  hours: t,
265
269
  minutes: c,
266
270
  timeOptions: r,
267
- is12HourFormat: s,
271
+ is12HourFormat: n,
268
272
  initializeTime: h,
269
273
  updateTime: b,
270
274
  generateTimeOptions: m,
271
275
  getCurrentTimeString: S,
272
276
  selectTime: (o) => {
273
277
  let D, M;
274
- if (s.value) {
275
- const [T, I] = o.split(" "), [V, f] = T.split(":");
276
- D = parseInt(V), M = parseInt(f), I === "AM" ? D === 12 && (D = 0) : D !== 12 && (D += 12);
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);
277
281
  } else {
278
- const [T, I] = o.split(":");
279
- D = parseInt(T), M = parseInt(I);
282
+ const [Y, T] = o.split(":");
283
+ D = parseInt(Y), M = parseInt(T);
280
284
  }
281
285
  if (i.value && t.value === D && c.value === M) {
282
286
  i.value = !1, u("update", null);
283
287
  return;
284
288
  }
285
289
  t.value = D, c.value = M, i.value = !0;
286
- const N = l ? new Date(l.getTime()) : /* @__PURE__ */ new Date();
287
- N.setHours(D, M, 0, 0), u("update", N);
290
+ const V = l ? new Date(l.getTime()) : /* @__PURE__ */ new Date();
291
+ V.setHours(D, M, 0, 0), u("update", V);
288
292
  },
289
293
  scrollToSelected: (o) => {
290
294
  if (!o || !i.value) return;
291
295
  const D = r.value.findIndex((M) => M === S());
292
296
  if (D >= 0) {
293
- const N = o.clientHeight, T = D * 30 - N / 2 + 30 / 2;
294
- o.scrollTop = Math.max(0, T);
297
+ const V = o.clientHeight, Y = D * 30 - V / 2 + 30 / 2;
298
+ o.scrollTop = Math.max(0, Y);
295
299
  }
296
300
  },
297
301
  onTimeUpdate: (o) => {
@@ -299,7 +303,7 @@ function Se(l, n = "24h", e = 1, u) {
299
303
  }
300
304
  };
301
305
  }
302
- const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"], j = /* @__PURE__ */ B({
306
+ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"], j = /* @__PURE__ */ x({
303
307
  __name: "TimeView",
304
308
  props: {
305
309
  selectedTime: {},
@@ -307,9 +311,9 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
307
311
  minuteInterval: { default: 1 }
308
312
  },
309
313
  emits: ["update"],
310
- setup(l, { emit: n }) {
311
- const e = l, u = n, t = C(null), { timeOptions: c, initializeTime: r, updateTime: i, getCurrentTimeString: s, selectTime: h, scrollToSelected: b } = Se(e.selectedTime, e.timeFormat, e.minuteInterval, u);
312
- return O(
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(
313
317
  () => e.selectedTime,
314
318
  (m) => {
315
319
  i(m), R(() => {
@@ -317,21 +321,21 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
317
321
  });
318
322
  },
319
323
  { immediate: !0 }
320
- ), O(
324
+ ), L(
321
325
  () => e.timeFormat,
322
326
  () => {
323
327
  r(), R(() => {
324
328
  b(t.value);
325
329
  });
326
330
  }
327
- ), O(
331
+ ), L(
328
332
  () => e.minuteInterval,
329
333
  () => {
330
334
  r(), R(() => {
331
335
  b(t.value);
332
336
  });
333
337
  }
334
- ), se(() => {
338
+ ), ne(() => {
335
339
  r(), R(() => {
336
340
  setTimeout(() => {
337
341
  b(t.value);
@@ -345,27 +349,27 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
345
349
  role: "listbox",
346
350
  "aria-label": "Time Selection"
347
351
  }, [
348
- (p(!0), k(P, null, F(g(c), (y) => (p(), k("div", {
352
+ (p(!0), k(F, null, I(g(c), (y) => (p(), k("div", {
349
353
  key: y,
350
- class: H(["time-option", {
351
- selected: y === g(s)()
354
+ class: C(["time-option", {
355
+ selected: y === g(n)()
352
356
  }]),
353
357
  role: "option",
354
- "aria-selected": y === g(s)(),
358
+ "aria-selected": y === g(n)(),
355
359
  onClick: (d) => g(h)(y)
356
360
  }, A(y), 11, we))), 128))
357
361
  ], 512)
358
362
  ]));
359
363
  }
360
- }), $e = { class: "year-view-layout" }, Te = { class: "years-section" }, Ye = { class: "years-list" }, He = ["onClick"], Ce = { class: "months-section" }, Pe = { class: "date-picker-table date-picker-months-table" }, Fe = { class: "date-picker-months-body" }, Ie = ["onClick", "disabled"], Ae = /* @__PURE__ */ B({
364
+ }), $e = { class: "year-view-layout" }, Ye = { class: "years-section" }, Te = { class: "years-list" }, He = ["onClick"], Ce = { class: "months-section" }, Pe = { class: "date-picker-table date-picker-months-table" }, Fe = { class: "date-picker-months-body" }, Ie = ["onClick", "disabled"], Ae = /* @__PURE__ */ x({
361
365
  __name: "YearView",
362
366
  props: {
363
367
  currentDate: {},
364
368
  selectedDate: {}
365
369
  },
366
370
  emits: ["select", "month-select"],
367
- setup(l, { emit: n }) {
368
- const e = l, u = n, t = $(() => e.currentDate.getFullYear()), c = $(() => {
371
+ setup(l, { emit: s }) {
372
+ const e = l, u = s, t = $(() => e.currentDate.getFullYear()), c = $(() => {
369
373
  var m;
370
374
  return (m = e.selectedDate) == null ? void 0 : m.getFullYear();
371
375
  }), r = $(() => {
@@ -374,7 +378,7 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
374
378
  }), i = $(() => te(t.value).map((m) => ({
375
379
  ...m,
376
380
  isSelected: e.selectedDate ? m.month === e.selectedDate.getMonth() && m.year === e.selectedDate.getFullYear() : !1
377
- }))), s = $(() => {
381
+ }))), n = $(() => {
378
382
  const m = [];
379
383
  for (let S = 0; S < i.value.length; S += 3)
380
384
  m.push(i.value.slice(S, S + 3));
@@ -385,11 +389,11 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
385
389
  u("month-select", m.month);
386
390
  };
387
391
  return (m, S) => (p(), k("div", $e, [
388
- v("div", Te, [
389
- v("div", Ye, [
390
- (p(!0), k(P, null, F(r.value, (y) => (p(), k("button", {
392
+ v("div", Ye, [
393
+ v("div", Te, [
394
+ (p(!0), k(F, null, I(r.value, (y) => (p(), k("button", {
391
395
  key: y,
392
- class: H([
396
+ class: C([
393
397
  "year-item",
394
398
  {
395
399
  selected: y === c.value,
@@ -403,16 +407,16 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
403
407
  v("div", Ce, [
404
408
  v("table", Pe, [
405
409
  v("tbody", Fe, [
406
- (p(!0), k(P, null, F(s.value, (y, d) => (p(), k("tr", {
410
+ (p(!0), k(F, null, I(n.value, (y, d) => (p(), k("tr", {
407
411
  key: d,
408
412
  class: "date-picker-months-row"
409
413
  }, [
410
- (p(!0), k(P, null, F(y, (a) => (p(), k("td", {
414
+ (p(!0), k(F, null, I(y, (a) => (p(), k("td", {
411
415
  key: a.month,
412
416
  class: "date-picker-month-cell"
413
417
  }, [
414
418
  v("button", {
415
- class: H([
419
+ class: C([
416
420
  "date-picker-month",
417
421
  {
418
422
  selected: a.isSelected,
@@ -429,38 +433,38 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
429
433
  ])
430
434
  ]));
431
435
  }
432
- }), Ve = { class: "date-picker-content months" }, Ne = { class: "date-picker-table date-picker-months-table" }, xe = { class: "date-picker-months-body" }, Be = ["onClick", "disabled"], qe = /* @__PURE__ */ B({
436
+ }), Ve = { class: "date-picker-content months" }, Ne = { class: "date-picker-table date-picker-months-table" }, xe = { class: "date-picker-months-body" }, Be = ["onClick", "disabled"], qe = /* @__PURE__ */ x({
433
437
  __name: "MonthView",
434
438
  props: {
435
439
  currentDate: {},
436
440
  selectedDate: {}
437
441
  },
438
442
  emits: ["select"],
439
- setup(l, { emit: n }) {
440
- const e = l, u = n, t = $(() => te(e.currentDate.getFullYear()).map((s) => ({
441
- ...s,
442
- isSelected: e.selectedDate ? s.month === e.selectedDate.getMonth() && s.year === e.selectedDate.getFullYear() : !1
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
443
447
  }))), c = $(() => {
444
448
  const i = [];
445
- for (let s = 0; s < t.value.length; s += 3)
446
- i.push(t.value.slice(s, s + 3));
449
+ for (let n = 0; n < t.value.length; n += 3)
450
+ i.push(t.value.slice(n, n + 3));
447
451
  return i;
448
452
  }), r = (i) => {
449
453
  u("select", i.month);
450
454
  };
451
- return (i, s) => (p(), k("div", Ve, [
455
+ return (i, n) => (p(), k("div", Ve, [
452
456
  v("table", Ne, [
453
457
  v("tbody", xe, [
454
- (p(!0), k(P, null, F(c.value, (h, b) => (p(), k("tr", {
458
+ (p(!0), k(F, null, I(c.value, (h, b) => (p(), k("tr", {
455
459
  key: b,
456
460
  class: "date-picker-months-row"
457
461
  }, [
458
- (p(!0), k(P, null, F(h, (m) => (p(), k("td", {
462
+ (p(!0), k(F, null, I(h, (m) => (p(), k("td", {
459
463
  key: m.month,
460
464
  class: "date-picker-month-cell"
461
465
  }, [
462
466
  v("button", {
463
- class: H([
467
+ class: C([
464
468
  "date-picker-month",
465
469
  {
466
470
  selected: m.isSelected,
@@ -476,22 +480,22 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
476
480
  ])
477
481
  ]));
478
482
  }
479
- }), Le = /* @__PURE__ */ B({
483
+ }), Le = /* @__PURE__ */ x({
480
484
  __name: "DatePickerHeader",
481
485
  props: {
482
486
  currentDate: {},
483
487
  viewMode: {}
484
488
  },
485
489
  emits: ["header-click"],
486
- setup(l, { emit: n }) {
487
- const e = l, u = n, t = $(() => {
490
+ setup(l, { emit: s }) {
491
+ const e = l, u = s, t = $(() => {
488
492
  const r = e.currentDate.getFullYear(), i = e.currentDate.getMonth();
489
493
  switch (e.viewMode) {
490
494
  case "date":
491
495
  return `${E[i]} ${r}`;
492
496
  case "year":
493
- const s = Math.floor(r / 10) * 10, h = s + 9;
494
- return `${s}–${h}`;
497
+ const n = Math.floor(r / 10) * 10, h = n + 9;
498
+ return `${n}–${h}`;
495
499
  default:
496
500
  return `${E[i]} ${r}`;
497
501
  }
@@ -505,10 +509,10 @@ const _e = { class: "time-picker-container" }, we = ["aria-selected", "onClick"]
505
509
  }, A(t.value), 1));
506
510
  }
507
511
  });
508
- function Oe(l, n) {
509
- const e = C(/* @__PURE__ */ new Date()), u = C("date"), t = $(() => l.value ? l.value instanceof Date ? l.value : Z(l.value) : null), c = (f) => {
510
- const Y = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/, w = /^\d{4}-\d{2}-\d{2}$/;
511
- return Y.test(f) ? f.includes(".") ? "YYYY-MM-DDTHH:mm:ss.sssZ" : "YYYY-MM-DDTHH:mm:ssZ" : w.test(f) ? "YYYY-MM-DD" : l.format || "YYYY-MM-DD";
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) => {
514
+ 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";
512
516
  }, r = $(() => {
513
517
  if (!l.value) return !1;
514
518
  if (l.value instanceof Date) return !0;
@@ -516,20 +520,20 @@ function Oe(l, n) {
516
520
  return f.includes("H") || f.includes("h") || f.includes("m") || f.includes("T");
517
521
  }), i = $(() => {
518
522
  if (!l.minDate) return !0;
519
- const f = Z(l.minDate);
523
+ const f = U(l.minDate);
520
524
  if (!f) return !0;
521
- const Y = e.value.getFullYear(), w = e.value.getMonth();
522
- return new Date(Y, w, 1) > f;
523
- }), s = $(() => {
525
+ const w = e.value.getFullYear(), H = e.value.getMonth();
526
+ return new Date(w, H, 1) > f;
527
+ }), n = $(() => {
524
528
  if (!l.maxDate) return !0;
525
- const f = Z(l.maxDate);
529
+ const f = U(l.maxDate);
526
530
  if (!f) return !0;
527
- const Y = e.value.getFullYear(), w = e.value.getMonth();
528
- return new Date(Y, w + 1, 0) < f;
531
+ const w = e.value.getFullYear(), H = e.value.getMonth();
532
+ return new Date(w, H + 1, 0) < f;
529
533
  }), h = () => {
530
534
  i.value && (e.value = new Date(e.value.getFullYear(), e.value.getMonth() - 1, 1));
531
535
  }, b = () => {
532
- s.value && (e.value = new Date(e.value.getFullYear(), e.value.getMonth() + 1, 1));
536
+ n.value && (e.value = new Date(e.value.getFullYear(), e.value.getMonth() + 1, 1));
533
537
  }, m = () => {
534
538
  e.value = new Date(e.value.getFullYear() - 1, e.value.getMonth(), 1);
535
539
  }, S = () => {
@@ -551,50 +555,50 @@ function Oe(l, n) {
551
555
  }
552
556
  }, D = (f) => {
553
557
  if (!le(f, l.minDate, l.maxDate, l.disabledDates)) {
554
- if (t.value && L(t.value, f)) {
555
- n("update:value", null), n("change", null), n("select", null);
558
+ if (t.value && q(t.value, f)) {
559
+ s("update:value", null), s("change", null), s("select", null);
556
560
  return;
557
561
  }
558
- l.mode === "dateTime" && t.value && f.setHours(t.value.getHours(), t.value.getMinutes()), V(f);
562
+ l.mode === "dateTime" && t.value && f.setHours(t.value.getHours(), t.value.getMinutes()), T(f);
559
563
  }
560
564
  }, M = (f) => {
561
- if (t.value && L(t.value, f)) {
562
- n("update:value", null), n("change", null), n("select", null);
565
+ if (t.value && q(t.value, f)) {
566
+ s("update:value", null), s("change", null), s("select", null);
563
567
  return;
564
568
  }
565
- V(f);
566
- }, N = (f) => {
567
- const Y = new Date(e.value.getFullYear(), f, 1);
568
- if (e.value = Y, u.value = "date", l.mode === "month") {
569
- if (t.value && oe(t.value, Y)) {
570
- n("update:value", null), n("change", null), n("select", null);
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);
571
575
  return;
572
576
  }
573
- V(Y);
577
+ T(w);
574
578
  }
575
- }, T = (f) => {
579
+ }, Y = (f) => {
576
580
  e.value = new Date(f, e.value.getMonth(), 1), u.value = "date";
577
- }, I = (f, Y) => {
578
- const w = c(Y);
579
- return w.includes("T") ? w.includes(".sss") ? f.toISOString() : f.toISOString().replace(/\.\d{3}Z$/, "Z") : J(f, w);
580
- }, V = (f, Y = !1) => {
581
- let w;
582
- if (typeof l.value == "string")
583
- if (Y) {
584
- const x = l.format && (l.format.includes("H") || l.format.includes("h") || l.format.includes("m")) ? l.format : "YYYY-MM-DDTHH:mm:ss";
585
- w = J(f, x);
586
- } else
587
- w = I(f, l.value);
581
+ }, T = (f, w = !1) => {
582
+ 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();
588
+ else {
589
+ const z = f.getFullYear(), _ = String(f.getMonth() + 1).padStart(2, "0"), N = String(f.getDate()).padStart(2, "0");
590
+ H = `${z}-${_}-${N}`;
591
+ }
588
592
  else
589
- w = f;
590
- n("update:value", w), n("change", w), n("select", w);
593
+ H = f;
594
+ s("update:value", H), s("change", H), s("select", H);
591
595
  };
592
596
  return {
593
597
  currentDate: e,
594
598
  viewMode: u,
595
599
  selectedDate: t,
596
600
  canGoPrev: i,
597
- canGoNext: s,
601
+ canGoNext: n,
598
602
  hasTime: r,
599
603
  goToPrevMonth: h,
600
604
  goToNextMonth: b,
@@ -606,18 +610,18 @@ function Oe(l, n) {
606
610
  onHeaderClick: o,
607
611
  onDateSelect: D,
608
612
  onWeekSelect: M,
609
- onMonthSelect: N,
610
- onYearSelect: T,
611
- emitValue: V
613
+ onMonthSelect: V,
614
+ onYearSelect: Y,
615
+ emitValue: T
612
616
  };
613
617
  }
614
- const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M8.293 12.707a1 1 0 0 1 0-1.414l5.657-5.657a1 1 0 1 1 1.414 1.414L10.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414z"/></g></svg>', We = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M15.707 11.293a1 1 0 0 1 0 1.414l-5.657 5.657a1 1 0 1 1-1.414-1.414l4.95-4.95l-4.95-4.95a1 1 0 0 1 1.414-1.414z"/></g></svg>', Ge = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 18a6 6 0 1 1 0-12a6 6 0 0 1 0 12m0-1.5a4.5 4.5 0 1 0 0-9a4.5 4.5 0 0 0 0 9"/></svg>', Re = {
618
+ const Oe = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M8.293 12.707a1 1 0 0 1 0-1.414l5.657-5.657a1 1 0 1 1 1.414 1.414L10.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414z"/></g></svg>', We = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M15.707 11.293a1 1 0 0 1 0 1.414l-5.657 5.657a1 1 0 1 1-1.414-1.414l4.95-4.95l-4.95-4.95a1 1 0 0 1 1.414-1.414z"/></g></svg>', Ge = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 18a6 6 0 1 1 0-12a6 6 0 0 1 0 12m0-1.5a4.5 4.5 0 1 0 0-9a4.5 4.5 0 0 0 0 9"/></svg>', Re = {
615
619
  key: 0,
616
620
  class: "date-picker-header"
617
621
  }, Je = { class: "date-picker-nav ml-auto" }, Ue = ["disabled"], Ze = ["innerHTML"], Ee = ["innerHTML"], je = ["disabled"], Ke = ["innerHTML"], Qe = { class: "date-picker-date-section" }, Xe = {
618
622
  key: 0,
619
623
  class: "date-picker-time-section"
620
- }, pt = /* @__PURE__ */ B({
624
+ }, pt = /* @__PURE__ */ x({
621
625
  __name: "DatePicker",
622
626
  props: {
623
627
  value: {},
@@ -632,13 +636,13 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
632
636
  minuteInterval: { default: 1 }
633
637
  },
634
638
  emits: ["update:value", "change", "select"],
635
- setup(l, { emit: n }) {
636
- const e = l, u = n, {
639
+ setup(l, { emit: s }) {
640
+ const e = l, u = s, {
637
641
  currentDate: t,
638
642
  viewMode: c,
639
643
  selectedDate: r,
640
644
  canGoPrev: i,
641
- canGoNext: s,
645
+ canGoNext: n,
642
646
  hasTime: h,
643
647
  goToPrevMonth: b,
644
648
  goToNextMonth: m,
@@ -649,32 +653,32 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
649
653
  goToCurrentDate: o,
650
654
  onHeaderClick: D,
651
655
  onDateSelect: M,
652
- onWeekSelect: N,
653
- onMonthSelect: T,
654
- onYearSelect: I,
655
- emitValue: V
656
- } = Oe(e, u), f = (_) => {
656
+ onWeekSelect: V,
657
+ onMonthSelect: Y,
658
+ onYearSelect: T,
659
+ emitValue: f
660
+ } = ze(e, u), w = (_) => {
657
661
  if (_ === null) {
658
662
  if (r.value) {
659
- const x = new Date(r.value);
660
- x.setHours(0, 0, 0, 0);
661
- const z = J(x, "YYYY-MM-DD");
662
- u("update:value", z), u("change", z), u("select", z);
663
+ const N = new Date(r.value);
664
+ N.setHours(0, 0, 0, 0);
665
+ const O = Z(N, "YYYY-MM-DD");
666
+ u("update:value", O), u("change", O), u("select", O);
663
667
  }
664
668
  return;
665
669
  }
666
670
  if (e.mode === "dateTime" && r.value) {
667
- const x = new Date(r.value.getTime());
668
- x.setHours(_.getHours(), _.getMinutes(), 0, 0), V(x, !0);
671
+ const N = new Date(r.value.getTime());
672
+ N.setHours(_.getHours(), _.getMinutes(), 0, 0), f(N, !0);
669
673
  } else
670
- V(_, !0);
671
- }, Y = () => {
674
+ f(_, !0);
675
+ }, H = () => {
672
676
  c.value === "year" ? d() : c.value === "month" ? S() : b();
673
- }, w = () => {
677
+ }, z = () => {
674
678
  c.value === "year" ? a() : c.value === "month" ? y() : m();
675
679
  };
676
- return (_, x) => (p(), k("div", {
677
- class: H(["date-picker", _.mode == "dateTime" && "date-picker-container-wide"])
680
+ return (_, N) => (p(), k("div", {
681
+ class: C(["date-picker", _.mode == "dateTime" && "date-picker-container-wide"])
678
682
  }, [
679
683
  _.mode !== "time" ? (p(), k("div", Re, [
680
684
  G(Le, {
@@ -686,19 +690,19 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
686
690
  v("button", {
687
691
  class: "date-picker-nav-button",
688
692
  disabled: !g(i),
689
- onClick: Y,
693
+ onClick: H,
690
694
  type: "button",
691
695
  "aria-label": "Previous"
692
696
  }, [
693
697
  v("span", {
694
698
  class: "date-picker-nav-icon",
695
- innerHTML: g(ze)
699
+ innerHTML: g(Oe)
696
700
  }, null, 8, Ze)
697
701
  ], 8, Ue),
698
702
  v("button", {
699
703
  class: "date-picker-nav-button",
700
- onClick: x[0] || (x[0] = //@ts-ignore
701
- (...z) => g(o) && g(o)(...z)),
704
+ onClick: N[0] || (N[0] = //@ts-ignore
705
+ (...O) => g(o) && g(o)(...O)),
702
706
  type: "button",
703
707
  "aria-label": "Current Date"
704
708
  }, [
@@ -709,8 +713,8 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
709
713
  ]),
710
714
  v("button", {
711
715
  class: "date-picker-nav-button",
712
- disabled: !g(s),
713
- onClick: w,
716
+ disabled: !g(n),
717
+ onClick: z,
714
718
  type: "button",
715
719
  "aria-label": "Next"
716
720
  }, [
@@ -720,9 +724,9 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
720
724
  }, null, 8, Ke)
721
725
  ], 8, je)
722
726
  ])
723
- ])) : q("", !0),
727
+ ])) : B("", !0),
724
728
  v("div", {
725
- class: H({
729
+ class: C({
726
730
  "date-picker-datetime-layout": _.mode === "dateTime" && g(c) === "date"
727
731
  })
728
732
  }, [
@@ -735,52 +739,52 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
735
739
  "max-date": _.maxDate,
736
740
  "disabled-dates": _.disabledDates,
737
741
  onSelect: g(M)
738
- }, null, 8, ["current-date", "selected-date", "min-date", "max-date", "disabled-dates", "onSelect"])) : q("", !0),
742
+ }, null, 8, ["current-date", "selected-date", "min-date", "max-date", "disabled-dates", "onSelect"])) : B("", !0),
739
743
  _.mode === "week" && g(c) === "date" ? (p(), W(Me, {
740
744
  key: 1,
741
745
  "current-date": g(t),
742
746
  "selected-date": g(r),
743
- onSelect: g(N)
744
- }, null, 8, ["current-date", "selected-date", "onSelect"])) : q("", !0),
747
+ onSelect: g(V)
748
+ }, null, 8, ["current-date", "selected-date", "onSelect"])) : B("", !0),
745
749
  g(c) !== "year" && (g(c) === "month" || _.mode === "month") ? (p(), W(qe, {
746
750
  key: 2,
747
751
  "current-date": g(t),
748
752
  "selected-date": g(r),
749
- onSelect: g(T)
750
- }, null, 8, ["current-date", "selected-date", "onSelect"])) : q("", !0),
753
+ onSelect: g(Y)
754
+ }, null, 8, ["current-date", "selected-date", "onSelect"])) : B("", !0),
751
755
  g(c) === "year" ? (p(), W(Ae, {
752
756
  key: 3,
753
757
  "current-date": g(t),
754
758
  "selected-date": g(r),
755
- onSelect: g(I),
756
- onMonthSelect: g(T)
757
- }, null, 8, ["current-date", "selected-date", "onSelect", "onMonthSelect"])) : q("", !0)
759
+ onSelect: g(T),
760
+ onMonthSelect: g(Y)
761
+ }, null, 8, ["current-date", "selected-date", "onSelect", "onMonthSelect"])) : B("", !0)
758
762
  ]),
759
763
  _.mode === "dateTime" && g(c) === "date" ? (p(), k("div", Xe, [
760
764
  G(j, {
761
765
  "selected-time": g(h) ? g(r) : null,
762
766
  "time-format": _.timeFormat,
763
767
  "minute-interval": _.minuteInterval,
764
- onUpdate: f
768
+ onUpdate: w
765
769
  }, null, 8, ["selected-time", "time-format", "minute-interval"])
766
- ])) : q("", !0)
770
+ ])) : B("", !0)
767
771
  ], 2),
768
772
  _.mode === "time" ? (p(), W(j, {
769
773
  key: 1,
770
774
  "selected-time": g(r),
771
775
  "time-format": _.timeFormat,
772
776
  "minute-interval": _.minuteInterval,
773
- onUpdate: f
774
- }, null, 8, ["selected-time", "time-format", "minute-interval"])) : q("", !0)
777
+ onUpdate: w
778
+ }, null, 8, ["selected-time", "time-format", "minute-interval"])) : B("", !0)
775
779
  ], 2));
776
780
  }
777
781
  }), et = {
778
782
  ref: "dropdownRef",
779
783
  class: "time-picker-dropdown"
780
- }, tt = { class: "time-picker-sections" }, lt = { class: "time-picker-time-section" }, at = ["onClick"], st = { class: "time-picker-time-section" }, nt = ["onClick"], ot = {
784
+ }, tt = { class: "time-picker-sections" }, lt = { class: "time-picker-time-section" }, at = ["onClick"], nt = { class: "time-picker-time-section" }, st = ["onClick"], ot = {
781
785
  key: 0,
782
786
  class: "time-picker-time-section time-picker-period-section"
783
- }, rt = /* @__PURE__ */ B({
787
+ }, rt = /* @__PURE__ */ x({
784
788
  __name: "TimePickerDropdown",
785
789
  props: {
786
790
  selectedHour: {},
@@ -790,8 +794,8 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
790
794
  minuteInterval: { default: 1 }
791
795
  },
792
796
  emits: ["select-hour", "select-minute", "select-period", "close"],
793
- setup(l, { expose: n, emit: e }) {
794
- const u = l, t = e, c = C(null), r = C(null), i = C(null), s = $(() => u.is12Hour ? Array.from({ length: 12 }, (d, a) => a + 1) : Array.from({ length: 24 }, (d, a) => a)), h = $(() => {
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 = $(() => {
795
799
  const d = u.minuteInterval, a = Math.floor(60 / d);
796
800
  return Array.from({ length: a }, (o, D) => D * d);
797
801
  }), b = () => {
@@ -814,7 +818,7 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
814
818
  }, y = (d) => {
815
819
  t("select-period", d);
816
820
  };
817
- return n({ scrollToSelected: b }), (d, a) => (p(), k("div", et, [
821
+ return s({ scrollToSelected: b }), (d, a) => (p(), k("div", et, [
818
822
  v("div", tt, [
819
823
  v("div", lt, [
820
824
  v("div", {
@@ -822,26 +826,26 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
822
826
  ref: c,
823
827
  class: "time-picker-options-scroll"
824
828
  }, [
825
- (p(!0), k(P, null, F(s.value, (o) => (p(), k("button", {
829
+ (p(!0), k(F, null, I(n.value, (o) => (p(), k("button", {
826
830
  key: o,
827
831
  type: "button",
828
- class: H(["time-picker-option-button", { selected: o === d.selectedHour }]),
832
+ class: C(["time-picker-option-button", { selected: o === d.selectedHour }]),
829
833
  onClick: (D) => m(o)
830
834
  }, A(String(o).padStart(2, "0")), 11, at))), 128))
831
835
  ], 512)
832
836
  ]),
833
- v("div", st, [
837
+ v("div", nt, [
834
838
  v("div", {
835
839
  ref_key: "minuteScroll",
836
840
  ref: r,
837
841
  class: "time-picker-options-scroll"
838
842
  }, [
839
- (p(!0), k(P, null, F(h.value, (o) => (p(), k("button", {
843
+ (p(!0), k(F, null, I(h.value, (o) => (p(), k("button", {
840
844
  key: o,
841
845
  type: "button",
842
- class: H(["time-picker-option-button", { selected: o === d.selectedMinute }]),
846
+ class: C(["time-picker-option-button", { selected: o === d.selectedMinute }]),
843
847
  onClick: (D) => S(o)
844
- }, A(String(o).padStart(2, "0")), 11, nt))), 128))
848
+ }, A(String(o).padStart(2, "0")), 11, st))), 128))
845
849
  ], 512)
846
850
  ]),
847
851
  d.is12Hour ? (p(), k("div", ot, [
@@ -852,20 +856,20 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
852
856
  }, [
853
857
  v("button", {
854
858
  type: "button",
855
- class: H(["time-picker-option-button", { selected: d.selectedPeriod === "AM" }]),
859
+ class: C(["time-picker-option-button", { selected: d.selectedPeriod === "AM" }]),
856
860
  onClick: a[0] || (a[0] = (o) => y("AM"))
857
861
  }, " AM ", 2),
858
862
  v("button", {
859
863
  type: "button",
860
- class: H(["time-picker-option-button", { selected: d.selectedPeriod === "PM" }]),
864
+ class: C(["time-picker-option-button", { selected: d.selectedPeriod === "PM" }]),
861
865
  onClick: a[1] || (a[1] = (o) => y("PM"))
862
866
  }, " PM ", 2)
863
867
  ], 512)
864
- ])) : q("", !0)
868
+ ])) : B("", !0)
865
869
  ])
866
870
  ], 512));
867
871
  }
868
- }), it = ["disabled"], ct = { class: "time-display" }, ut = /* @__PURE__ */ B({
872
+ }), it = ["disabled"], ct = { class: "time-display" }, ut = /* @__PURE__ */ x({
869
873
  __name: "TimePickerInput",
870
874
  props: {
871
875
  hour: {},
@@ -877,18 +881,18 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
877
881
  readonly: { type: Boolean }
878
882
  },
879
883
  setup(l) {
880
- const n = l, e = $(() => {
881
- const u = String(n.minute).padStart(2, "0");
882
- if (n.is12Hour) {
883
- let t = n.hour % 12;
884
- return t === 0 && (t = 12), `${String(t).padStart(2, "0")}:${u} ${n.period}`;
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}`;
885
889
  } else
886
- return `${String(n.hour).padStart(2, "0")}:${u}`;
890
+ return `${String(s.hour).padStart(2, "0")}:${u}`;
887
891
  });
888
892
  return (u, t) => K(u.$slots, "default", Q(X({ displayTime: e.value })), () => [
889
893
  v("button", {
890
894
  type: "button",
891
- class: H(["time-picker-input", [u.triggerClass, { "is-disabled": u.disabled, "is-readonly": u.readonly }]]),
895
+ class: C(["time-picker-input", [u.triggerClass, { "is-disabled": u.disabled, "is-readonly": u.readonly }]]),
892
896
  disabled: u.disabled || u.readonly
893
897
  }, [
894
898
  v("span", ct, A(e.value), 1),
@@ -916,7 +920,7 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
916
920
  }
917
921
  }), dt = { style: {
918
922
  width: "100%"
919
- } }, ht = /* @__PURE__ */ B({
923
+ } }, ht = /* @__PURE__ */ x({
920
924
  __name: "TimePicker",
921
925
  props: {
922
926
  modelValue: { default: null },
@@ -930,8 +934,8 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
930
934
  readonly: { type: Boolean, default: !1 }
931
935
  },
932
936
  emits: ["update:modelValue"],
933
- setup(l, { emit: n }) {
934
- const e = l, u = n, t = C(12), c = C(0), r = C("AM"), i = C(null), s = $(() => e.timeFormat === "12h"), h = () => {
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 = () => {
935
939
  if (e.modelValue) {
936
940
  let a = 0, o = 0;
937
941
  if (e.modelValue instanceof Date)
@@ -943,14 +947,14 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
943
947
  const D = /* @__PURE__ */ new Date();
944
948
  a = D.getHours(), o = D.getMinutes();
945
949
  }
946
- c.value = o, s.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;
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;
947
951
  } else {
948
952
  const a = /* @__PURE__ */ new Date(), o = a.getHours(), D = a.getMinutes();
949
- c.value = D, s.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;
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;
950
954
  }
951
955
  }, b = () => {
952
956
  let a = t.value;
953
- s.value && (r.value === "AM" && a === 12 ? a = 0 : r.value === "PM" && a !== 12 && (a += 12));
957
+ n.value && (r.value === "AM" && a === 12 ? a = 0 : r.value === "PM" && a !== 12 && (a += 12));
954
958
  const o = `${String(a).padStart(2, "0")}:${String(c.value).padStart(2, "0")}`;
955
959
  u("update:modelValue", o);
956
960
  }, m = (a) => {
@@ -963,8 +967,8 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
963
967
  var a;
964
968
  (a = i == null ? void 0 : i.value) == null || a.scrollToSelected();
965
969
  };
966
- return O(() => e.modelValue, h, { immediate: !0 }), O(() => e.timeFormat, h), O(() => e.minuteInterval, h), (a, o) => (p(), k("div", dt, [
967
- G(g(ne), {
970
+ return L(() => e.modelValue, h, { immediate: !0 }), L(() => e.timeFormat, h), L(() => e.minuteInterval, h), (a, o) => (p(), k("div", dt, [
971
+ G(g(se), {
968
972
  trigger: "click",
969
973
  placement: "bottom-start",
970
974
  onOnShow: d,
@@ -978,30 +982,30 @@ const ze = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewB
978
982
  width: "100%"
979
983
  }
980
984
  }, {
981
- trigger: U(() => [
985
+ trigger: J(() => [
982
986
  G(ut, {
983
987
  hour: t.value,
984
988
  minute: c.value,
985
989
  period: r.value,
986
- "is12-hour": s.value,
990
+ "is12-hour": n.value,
987
991
  "trigger-class": a.triggerClass,
988
992
  disabled: a.disabled,
989
993
  readonly: a.readonly
990
994
  }, {
991
- default: U(({ displayTime: D }) => [
995
+ default: J(({ displayTime: D }) => [
992
996
  K(a.$slots, "default", Q(X({ displayTime: D })))
993
997
  ]),
994
998
  _: 3
995
999
  }, 8, ["hour", "minute", "period", "is12-hour", "trigger-class", "disabled", "readonly"])
996
1000
  ]),
997
- default: U(() => [
1001
+ default: J(() => [
998
1002
  G(rt, {
999
1003
  ref_key: "dropdownRef",
1000
1004
  ref: i,
1001
1005
  "selected-hour": t.value,
1002
1006
  "selected-minute": c.value,
1003
1007
  "selected-period": r.value,
1004
- "is12-hour": s.value,
1008
+ "is12-hour": n.value,
1005
1009
  "minute-interval": a.minuteInterval,
1006
1010
  onSelectHour: m,
1007
1011
  onSelectMinute: S,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-datepicker-lite",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "A lightweight Vue 3 date picker with date, time, date-time, week, and month modes",
5
5
  "type": "module",
6
6
  "author": "safdar-azeem",