@ianicdev/datatables2 0.9.0 → 0.9.1

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 (39) hide show
  1. package/dist/{Columns-BcKul1XU.cjs → Columns-5FUNk8-6.cjs} +1 -1
  2. package/dist/{Columns-WV_XTcfk.js → Columns-lW5ifpVY.js} +1 -1
  3. package/dist/{Comparison-B-0lzZby.cjs → Comparison-B_jdQPdW.cjs} +1 -1
  4. package/dist/{Comparison-CS3dbw7-.js → Comparison-OWm3KG63.js} +1 -1
  5. package/dist/Datepicker-BDXMvB6Q.cjs +1 -0
  6. package/dist/Datepicker-D0Yzqhky.js +1272 -0
  7. package/dist/{Download-DObh-0qf.cjs → Download-DZv0Co50.cjs} +1 -1
  8. package/dist/{Download-HnSkTpjH.js → Download-Dv6nv_kh.js} +2 -2
  9. package/dist/{Options-B6aA6OT0.js → Options-CvAQ7vuJ.js} +2 -2
  10. package/dist/{Options-CrhimulB.cjs → Options-Dmq3tFGa.cjs} +1 -1
  11. package/dist/{RefreshTable-s7gqKe6b.cjs → RefreshTable-DQt3K_wT.cjs} +1 -1
  12. package/dist/{RefreshTable-Doiv_YZB.js → RefreshTable-vbz6jP_l.js} +2 -2
  13. package/dist/{Search-CTLGwT0r.js → Search-KNaJ43Yv.js} +2 -2
  14. package/dist/{Search-Dz0QZMXz.cjs → Search-w6O09lLl.cjs} +1 -1
  15. package/dist/{Table-ClcPfYL5.cjs → Table-Bfa_XCKK.cjs} +1 -1
  16. package/dist/{Table-DUoBK9K2.js → Table-P3KDor2k.js} +2 -2
  17. package/dist/{TableServer-DlguQn9Z.js → TableServer-C7VVLhRY.js} +3 -3
  18. package/dist/{TableServer-CP_gJg6t.cjs → TableServer-CraUFndq.cjs} +1 -1
  19. package/dist/{cellRender-DPw3VrGL.cjs → cellRender-AyOlbHkM.cjs} +1 -1
  20. package/dist/{cellRender-O1eaCIAB.js → cellRender-BSERCH_s.js} +2 -2
  21. package/dist/{dataTables-CPyO3-V6.js → dataTables-DqHE-hm9.js} +13 -20
  22. package/dist/{dataTables-DqovKov-.cjs → dataTables-oPwexOUF.cjs} +2 -2
  23. package/dist/datatables.cjs +1 -1
  24. package/dist/datatables.js +1 -1
  25. package/dist/datatables2.css +1 -1
  26. package/dist/escapeKeyString-CngwDxKW.js +17 -0
  27. package/dist/escapeKeyString-nS7kXLwu.cjs +1 -0
  28. package/dist/{index-CAZtJOlN.js → index-BjboPrMg.js} +1 -1
  29. package/dist/index-BwtJBnu1.cjs +1 -0
  30. package/dist/{index-BUe_gyg1.js → index-FhbzpwmS.js} +559 -552
  31. package/dist/{index-CBmwmlHg.cjs → index-Wzi3PVax.cjs} +1 -1
  32. package/lib/locale/de.js +14 -0
  33. package/lib/locale/index.js +1 -0
  34. package/package.json +7 -7
  35. package/dist/Datepicker-CBF5JWDm.js +0 -1246
  36. package/dist/Datepicker-DayGtvzT.cjs +0 -1
  37. package/dist/escapeKeyString-B_mzfoez.js +0 -17
  38. package/dist/escapeKeyString-CQVlwp30.cjs +0 -1
  39. package/dist/index-Bj2papn9.cjs +0 -1
@@ -0,0 +1,1272 @@
1
+ import { createVNode as w, mergeProps as O, createElementVNode as x, normalizeStyle as pe, normalizeClass as K, inject as He, reactive as Le, watch as oe, ref as re, watchEffect as fe, computed as V, Fragment as ie, shallowRef as Z, toRef as ee, createTextVNode as Je, withDirectives as ze, mergeModels as Ke, useModel as Ze, createBlock as qe, openBlock as Ge, unref as he, isRef as Qe } from "vue";
2
+ import ne from "moment";
3
+ import { c as Ye, g as N, p as $, P as _e, u as R, e as ve, T as q, K as F, aY as ke, J as Xe, a9 as T, ax as me, I as le, W as Oe, H as et, N as X, S as j, aU as Ie, ay as ge, aZ as tt, a0 as at, am as nt, ag as lt, aj as rt, a1 as it, aD as ot, a2 as ut, ao as dt } from "./dataTables-DqHE-hm9.js";
4
+ import { j as De, m as st, g as be, l as ct, n as ft } from "./index-FhbzpwmS.js";
5
+ const vt = Ye("v-picker-title"), Fe = $({
6
+ bgColor: String,
7
+ divided: Boolean,
8
+ landscape: Boolean,
9
+ title: String,
10
+ hideHeader: Boolean,
11
+ hideTitle: Boolean,
12
+ ...st()
13
+ }, "VPicker"), Ve = N()({
14
+ name: "VPicker",
15
+ props: Fe(),
16
+ setup(e, a) {
17
+ let {
18
+ slots: r
19
+ } = a;
20
+ const {
21
+ backgroundColorClasses: n,
22
+ backgroundColorStyles: t
23
+ } = _e(() => e.color);
24
+ return R(() => {
25
+ const i = De.filterProps(e), u = !e.hideTitle && !!(e.title || r.title);
26
+ return w(De, O(i, {
27
+ color: e.bgColor,
28
+ class: ["v-picker", {
29
+ "v-picker--divided": e.divided,
30
+ "v-picker--landscape": e.landscape,
31
+ "v-picker--with-actions": !!r.actions
32
+ }, e.class],
33
+ style: e.style
34
+ }), {
35
+ default: () => [!e.hideHeader && x("div", {
36
+ key: "header",
37
+ class: K([n.value]),
38
+ style: pe([t.value])
39
+ }, [u && w(vt, {
40
+ key: "picker-title"
41
+ }, {
42
+ default: () => [r.title?.() ?? e.title]
43
+ }), r.header && x("div", {
44
+ class: "v-picker__header"
45
+ }, [r.header()])]), x("div", {
46
+ class: "v-picker__body"
47
+ }, [r.default?.()]), r.actions && w(ve, {
48
+ defaults: {
49
+ VBtn: {
50
+ slim: !0,
51
+ variant: "text"
52
+ }
53
+ }
54
+ }, {
55
+ default: () => [x("div", {
56
+ class: "v-picker__actions"
57
+ }, [r.actions()])]
58
+ })]
59
+ });
60
+ }), {};
61
+ }
62
+ }), mt = Symbol.for("vuetify:date-options");
63
+ function Be(e, a, r) {
64
+ const n = $e(e, a, r), t = [a];
65
+ for (let i = 1; i < n; i++) {
66
+ const u = e.addDays(a, i);
67
+ t.push(u);
68
+ }
69
+ return r && t.push(e.endOfDay(r)), t;
70
+ }
71
+ function $e(e, a, r) {
72
+ const n = [`${e.toISO(r ?? a).split("T")[0]}T00:00:00Z`, `${e.toISO(a).split("T")[0]}T00:00:00Z`];
73
+ return typeof e.date() == "string" ? e.getDiff(n[0], n[1], "days") : e.getDiff(e.date(n[0]), e.date(n[1]), "days");
74
+ }
75
+ function yt(e, a) {
76
+ const r = Le(typeof e.adapter == "function" ? new e.adapter({
77
+ locale: e.locale[a.current.value] ?? a.current.value,
78
+ formats: e.formats
79
+ }) : e.adapter);
80
+ return oe(a.current, (n) => {
81
+ r.locale = e.locale[n] ?? n ?? r.locale;
82
+ }), r;
83
+ }
84
+ function H() {
85
+ const e = He(mt);
86
+ if (!e) throw new Error("[Vuetify] Could not find injected date options");
87
+ const a = q();
88
+ return yt(e, a);
89
+ }
90
+ const Te = $({
91
+ modelValue: null,
92
+ color: String,
93
+ cancelText: {
94
+ type: String,
95
+ default: "$vuetify.confirmEdit.cancel"
96
+ },
97
+ okText: {
98
+ type: String,
99
+ default: "$vuetify.confirmEdit.ok"
100
+ },
101
+ disabled: {
102
+ type: [Boolean, Array],
103
+ default: void 0
104
+ },
105
+ hideActions: Boolean
106
+ }, "VConfirmEdit"), we = N()({
107
+ name: "VConfirmEdit",
108
+ props: Te(),
109
+ emits: {
110
+ cancel: () => !0,
111
+ save: (e) => !0,
112
+ "update:modelValue": (e) => !0
113
+ },
114
+ setup(e, a) {
115
+ let {
116
+ emit: r,
117
+ slots: n
118
+ } = a;
119
+ const t = F(e, "modelValue"), i = re();
120
+ fe(() => {
121
+ i.value = structuredClone(ke(t.value));
122
+ });
123
+ const {
124
+ t: u
125
+ } = q(), s = V(() => Xe(t.value, i.value));
126
+ function d(l) {
127
+ return typeof e.disabled == "boolean" ? e.disabled : Array.isArray(e.disabled) ? e.disabled.includes(l) : s.value;
128
+ }
129
+ const k = V(() => d("save")), f = V(() => d("cancel"));
130
+ function h() {
131
+ t.value = i.value, r("save", i.value);
132
+ }
133
+ function D() {
134
+ i.value = structuredClone(ke(t.value)), r("cancel");
135
+ }
136
+ function S(l) {
137
+ return x(ie, null, [w(T, O({
138
+ disabled: f.value,
139
+ variant: "text",
140
+ color: e.color,
141
+ onClick: D,
142
+ text: u(e.cancelText)
143
+ }, l), null), w(T, O({
144
+ disabled: k.value,
145
+ variant: "text",
146
+ color: e.color,
147
+ onClick: h,
148
+ text: u(e.okText)
149
+ }, l), null)]);
150
+ }
151
+ let p = !1;
152
+ return R(() => x(ie, null, [n.default?.({
153
+ model: i,
154
+ save: h,
155
+ cancel: D,
156
+ isPristine: s.value,
157
+ get actions() {
158
+ return p = !0, S;
159
+ }
160
+ }), !e.hideActions && !p && S()])), {
161
+ save: h,
162
+ cancel: D,
163
+ isPristine: s
164
+ };
165
+ }
166
+ }), ht = Ye("v-spacer", "div", "VSpacer"), We = $({
167
+ active: {
168
+ type: [String, Array],
169
+ default: void 0
170
+ },
171
+ controlHeight: [Number, String],
172
+ disabled: {
173
+ type: [Boolean, String, Array],
174
+ default: null
175
+ },
176
+ nextIcon: {
177
+ type: le,
178
+ default: "$next"
179
+ },
180
+ prevIcon: {
181
+ type: le,
182
+ default: "$prev"
183
+ },
184
+ modeIcon: {
185
+ type: le,
186
+ default: "$subgroup"
187
+ },
188
+ text: String,
189
+ viewMode: {
190
+ type: String,
191
+ default: "month"
192
+ }
193
+ }, "VDatePickerControls"), Pe = N()({
194
+ name: "VDatePickerControls",
195
+ props: We(),
196
+ emits: {
197
+ "click:year": () => !0,
198
+ "click:month": () => !0,
199
+ "click:prev": () => !0,
200
+ "click:next": () => !0,
201
+ "click:text": () => !0
202
+ },
203
+ setup(e, a) {
204
+ let {
205
+ emit: r
206
+ } = a;
207
+ const {
208
+ t: n
209
+ } = q(), t = V(() => Array.isArray(e.disabled) ? e.disabled.includes("text") : !!e.disabled), i = V(() => Array.isArray(e.disabled) ? e.disabled.includes("mode") : !!e.disabled), u = V(() => Array.isArray(e.disabled) ? e.disabled.includes("prev") : !!e.disabled), s = V(() => Array.isArray(e.disabled) ? e.disabled.includes("next") : !!e.disabled);
210
+ function d() {
211
+ r("click:prev");
212
+ }
213
+ function k() {
214
+ r("click:next");
215
+ }
216
+ function f() {
217
+ r("click:year");
218
+ }
219
+ function h() {
220
+ r("click:month");
221
+ }
222
+ return R(() => x("div", {
223
+ class: K(["v-date-picker-controls"]),
224
+ style: {
225
+ "--v-date-picker-controls-height": me(e.controlHeight)
226
+ }
227
+ }, [w(T, {
228
+ class: "v-date-picker-controls__month-btn",
229
+ "data-testid": "month-btn",
230
+ disabled: t.value,
231
+ text: e.text,
232
+ variant: "text",
233
+ rounded: !0,
234
+ onClick: h
235
+ }, null), w(T, {
236
+ class: "v-date-picker-controls__mode-btn",
237
+ "data-testid": "year-btn",
238
+ disabled: i.value,
239
+ density: "comfortable",
240
+ icon: e.modeIcon,
241
+ variant: "text",
242
+ "aria-label": n("$vuetify.datePicker.ariaLabel.selectYear"),
243
+ onClick: f
244
+ }, null), w(ht, null, null), x("div", {
245
+ class: "v-date-picker-controls__month"
246
+ }, [w(T, {
247
+ "data-testid": "prev-month",
248
+ disabled: u.value,
249
+ density: "comfortable",
250
+ icon: e.prevIcon,
251
+ variant: "text",
252
+ "aria-label": n("$vuetify.datePicker.ariaLabel.previousMonth"),
253
+ onClick: d
254
+ }, null), w(T, {
255
+ "data-testid": "next-month",
256
+ disabled: s.value,
257
+ icon: e.nextIcon,
258
+ density: "comfortable",
259
+ variant: "text",
260
+ "aria-label": n("$vuetify.datePicker.ariaLabel.nextMonth"),
261
+ onClick: k
262
+ }, null)])])), {};
263
+ }
264
+ }), kt = $({
265
+ appendIcon: le,
266
+ color: String,
267
+ header: String,
268
+ transition: String,
269
+ onClick: et()
270
+ }, "VDatePickerHeader"), xe = N()({
271
+ name: "VDatePickerHeader",
272
+ props: kt(),
273
+ emits: {
274
+ click: () => !0,
275
+ "click:append": () => !0
276
+ },
277
+ setup(e, a) {
278
+ let {
279
+ emit: r,
280
+ slots: n
281
+ } = a;
282
+ const {
283
+ backgroundColorClasses: t,
284
+ backgroundColorStyles: i
285
+ } = _e(() => e.color);
286
+ function u() {
287
+ r("click");
288
+ }
289
+ function s() {
290
+ r("click:append");
291
+ }
292
+ return R(() => {
293
+ const d = !!(n.default || e.header), k = !!(n.append || e.appendIcon);
294
+ return x("div", {
295
+ class: K(["v-date-picker-header", {
296
+ "v-date-picker-header--clickable": !!e.onClick
297
+ }, t.value]),
298
+ style: pe(i.value),
299
+ onClick: u
300
+ }, [n.prepend && x("div", {
301
+ key: "prepend",
302
+ class: "v-date-picker-header__prepend"
303
+ }, [n.prepend()]), d && w(Oe, {
304
+ key: "content",
305
+ name: e.transition
306
+ }, {
307
+ default: () => [x("div", {
308
+ key: e.header,
309
+ class: "v-date-picker-header__content"
310
+ }, [n.default?.() ?? e.header])]
311
+ }), k && x("div", {
312
+ class: "v-date-picker-header__append"
313
+ }, [n.append ? w(ve, {
314
+ key: "append-defaults",
315
+ disabled: !e.appendIcon,
316
+ defaults: {
317
+ VBtn: {
318
+ icon: e.appendIcon,
319
+ variant: "text"
320
+ }
321
+ }
322
+ }, {
323
+ default: () => [n.append?.()]
324
+ }) : w(T, {
325
+ key: "append-btn",
326
+ icon: e.appendIcon,
327
+ variant: "text",
328
+ onClick: s
329
+ }, null)])]);
330
+ }), {};
331
+ }
332
+ }), gt = $({
333
+ allowedDates: [Array, Function],
334
+ disabled: {
335
+ type: Boolean,
336
+ default: null
337
+ },
338
+ displayValue: null,
339
+ modelValue: Array,
340
+ month: [Number, String],
341
+ max: null,
342
+ min: null,
343
+ showAdjacentMonths: Boolean,
344
+ year: [Number, String],
345
+ weekdays: {
346
+ type: Array,
347
+ default: () => [0, 1, 2, 3, 4, 5, 6]
348
+ },
349
+ weeksInMonth: {
350
+ type: String,
351
+ default: "dynamic"
352
+ },
353
+ firstDayOfWeek: {
354
+ type: [Number, String],
355
+ default: void 0
356
+ },
357
+ firstDayOfYear: {
358
+ type: [Number, String],
359
+ default: void 0
360
+ },
361
+ weekdayFormat: String
362
+ }, "calendar");
363
+ function Dt(e) {
364
+ const a = H(), r = F(e, "modelValue", [], (l) => X(l).map((y) => a.date(y))), n = V(() => e.displayValue ? a.date(e.displayValue) : r.value.length > 0 ? a.date(r.value[0]) : e.min ? a.date(e.min) : Array.isArray(e.allowedDates) ? a.date(e.allowedDates[0]) : a.date()), t = F(e, "year", void 0, (l) => {
365
+ const y = l != null ? Number(l) : a.getYear(n.value);
366
+ return a.startOfYear(a.setYear(a.date(), y));
367
+ }, (l) => a.getYear(l)), i = F(e, "month", void 0, (l) => {
368
+ const y = l != null ? Number(l) : a.getMonth(n.value), c = a.setYear(a.startOfMonth(a.date()), a.getYear(t.value));
369
+ return a.setMonth(c, y);
370
+ }, (l) => a.getMonth(l)), u = V(() => {
371
+ const l = a.toJsDate(a.startOfWeek(a.date(), e.firstDayOfWeek)).getDay();
372
+ return a.getWeekdays(e.firstDayOfWeek, e.weekdayFormat).filter((y, c) => e.weekdays.includes((c + l) % 7));
373
+ }), s = V(() => {
374
+ const l = a.getWeekArray(i.value, e.firstDayOfWeek), y = l.flat(), c = 42;
375
+ if (e.weeksInMonth === "static" && y.length < c) {
376
+ const b = y[y.length - 1];
377
+ let C = [];
378
+ for (let o = 1; o <= c - y.length; o++)
379
+ C.push(a.addDays(b, o)), o % 7 === 0 && (l.push(C), C = []);
380
+ }
381
+ return l;
382
+ });
383
+ function d(l, y) {
384
+ return l.filter((c) => e.weekdays.includes(a.toJsDate(c).getDay())).map((c, b) => {
385
+ const C = a.toISO(c), o = !a.isSameMonth(c, i.value), P = a.isSameDay(c, a.startOfMonth(i.value)), Y = a.isSameDay(c, a.endOfMonth(i.value)), G = a.isSameDay(c, i.value), W = e.weekdays.length;
386
+ return {
387
+ date: c,
388
+ formatted: a.format(c, "keyboardDate"),
389
+ isAdjacent: o,
390
+ isDisabled: p(c),
391
+ isEnd: Y,
392
+ isHidden: o && !e.showAdjacentMonths,
393
+ isSame: G,
394
+ isSelected: r.value.some((z) => a.isSameDay(c, z)),
395
+ isStart: P,
396
+ isToday: a.isSameDay(c, y),
397
+ isWeekEnd: b % W === W - 1,
398
+ isWeekStart: b % W === 0,
399
+ isoDate: C,
400
+ localized: a.format(c, "dayOfMonth"),
401
+ month: a.getMonth(c),
402
+ year: a.getYear(c)
403
+ };
404
+ });
405
+ }
406
+ const k = V(() => {
407
+ const l = a.startOfWeek(n.value, e.firstDayOfWeek), y = [];
408
+ for (let b = 0; b <= 6; b++)
409
+ y.push(a.addDays(l, b));
410
+ const c = a.date();
411
+ return d(y, c);
412
+ }), f = V(() => {
413
+ const l = s.value.flat(), y = a.date();
414
+ return d(l, y);
415
+ }), h = V(() => s.value.map((l) => l.length ? a.getWeek(l[0], e.firstDayOfWeek, e.firstDayOfYear) : null)), {
416
+ minDate: D,
417
+ maxDate: S
418
+ } = ye(e);
419
+ function p(l) {
420
+ if (e.disabled) return !0;
421
+ const y = a.date(l);
422
+ return D.value && a.isBefore(a.endOfDay(y), D.value) || S.value && a.isAfter(y, S.value) ? !0 : Array.isArray(e.allowedDates) && e.allowedDates.length > 0 ? !e.allowedDates.some((c) => a.isSameDay(a.date(c), y)) : typeof e.allowedDates == "function" ? !e.allowedDates(y) : !1;
423
+ }
424
+ return {
425
+ displayValue: n,
426
+ daysInMonth: f,
427
+ daysInWeek: k,
428
+ genDays: d,
429
+ model: r,
430
+ weeksInMonth: s,
431
+ weekdayLabels: u,
432
+ weekNumbers: h
433
+ };
434
+ }
435
+ function ye(e) {
436
+ const a = H(), r = V(() => {
437
+ if (!e.min) return null;
438
+ const u = a.date(e.min);
439
+ return a.isValid(u) ? u : null;
440
+ }), n = V(() => {
441
+ if (!e.max) return null;
442
+ const u = a.date(e.max);
443
+ return a.isValid(u) ? u : null;
444
+ });
445
+ function t(u) {
446
+ return r.value && a.isBefore(u, r.value) ? r.value : n.value && a.isAfter(u, n.value) ? n.value : u;
447
+ }
448
+ function i(u) {
449
+ return (!r.value || a.isAfter(u, r.value)) && (!n.value || a.isBefore(u, n.value));
450
+ }
451
+ return {
452
+ minDate: r,
453
+ maxDate: n,
454
+ clampDate: t,
455
+ isInAllowedRange: i
456
+ };
457
+ }
458
+ const Ne = $({
459
+ color: String,
460
+ hideWeekdays: Boolean,
461
+ multiple: [Boolean, Number, String],
462
+ showWeek: Boolean,
463
+ transition: {
464
+ type: String,
465
+ default: "picker-transition"
466
+ },
467
+ reverseTransition: {
468
+ type: String,
469
+ default: "picker-reverse-transition"
470
+ },
471
+ ...j(gt(), ["displayValue"])
472
+ }, "VDatePickerMonth"), Me = N()({
473
+ name: "VDatePickerMonth",
474
+ props: Ne(),
475
+ emits: {
476
+ "update:modelValue": (e) => !0,
477
+ "update:month": (e) => !0,
478
+ "update:year": (e) => !0
479
+ },
480
+ setup(e, a) {
481
+ let {
482
+ emit: r,
483
+ slots: n
484
+ } = a;
485
+ const t = re(), {
486
+ t: i
487
+ } = q(), {
488
+ daysInMonth: u,
489
+ model: s,
490
+ weekNumbers: d,
491
+ weekdayLabels: k
492
+ } = Dt(e), f = H(), h = Z(), D = Z(), S = Z(!1), p = ee(() => S.value ? e.reverseTransition : e.transition);
493
+ e.multiple === "range" && s.value.length > 0 && (h.value = s.value[0], s.value.length > 1 && (D.value = s.value[s.value.length - 1]));
494
+ const l = V(() => {
495
+ const o = ["number", "string"].includes(typeof e.multiple) ? Number(e.multiple) : 1 / 0;
496
+ return s.value.length >= o;
497
+ });
498
+ oe(u, (o, P) => {
499
+ P && (S.value = f.isBefore(o[0].date, P[0].date));
500
+ });
501
+ function y(o) {
502
+ const P = f.startOfDay(o);
503
+ if (s.value.length === 0 ? h.value = void 0 : s.value.length === 1 && (h.value = s.value[0], D.value = void 0), !h.value)
504
+ h.value = P, s.value = [h.value];
505
+ else if (D.value)
506
+ h.value = o, D.value = void 0, s.value = [h.value];
507
+ else {
508
+ if (f.isSameDay(P, h.value)) {
509
+ h.value = void 0, s.value = [];
510
+ return;
511
+ } else f.isBefore(P, h.value) ? (D.value = f.endOfDay(h.value), h.value = P) : D.value = f.endOfDay(P);
512
+ s.value = Be(f, h.value, D.value);
513
+ }
514
+ }
515
+ function c(o) {
516
+ const P = f.format(o.date, "fullDateWithWeekday"), Y = o.isToday ? "currentDate" : "selectDate";
517
+ return i(`$vuetify.datePicker.ariaLabel.${Y}`, P);
518
+ }
519
+ function b(o) {
520
+ const P = s.value.findIndex((Y) => f.isSameDay(Y, o));
521
+ if (P === -1)
522
+ s.value = [...s.value, o];
523
+ else {
524
+ const Y = [...s.value];
525
+ Y.splice(P, 1), s.value = Y;
526
+ }
527
+ }
528
+ function C(o) {
529
+ e.multiple === "range" ? y(o) : e.multiple ? b(o) : s.value = [o];
530
+ }
531
+ R(() => x("div", {
532
+ class: "v-date-picker-month",
533
+ style: {
534
+ "--v-date-picker-days-in-week": e.weekdays.length
535
+ }
536
+ }, [e.showWeek && x("div", {
537
+ key: "weeks",
538
+ class: "v-date-picker-month__weeks"
539
+ }, [!e.hideWeekdays && x("div", {
540
+ key: "hide-week-days",
541
+ class: "v-date-picker-month__day"
542
+ }, [Je(" ")]), d.value.map((o) => x("div", {
543
+ class: K(["v-date-picker-month__day", "v-date-picker-month__day--adjacent"])
544
+ }, [o]))]), w(Oe, {
545
+ name: p.value
546
+ }, {
547
+ default: () => [x("div", {
548
+ ref: t,
549
+ key: u.value[0].date?.toString(),
550
+ class: "v-date-picker-month__days"
551
+ }, [!e.hideWeekdays && k.value.map((o) => x("div", {
552
+ class: K(["v-date-picker-month__day", "v-date-picker-month__weekday"])
553
+ }, [o])), u.value.map((o, P) => {
554
+ const Y = {
555
+ props: {
556
+ class: "v-date-picker-month__day-btn",
557
+ color: o.isSelected || o.isToday ? e.color : void 0,
558
+ disabled: o.isDisabled,
559
+ icon: !0,
560
+ ripple: !1,
561
+ text: o.localized,
562
+ variant: o.isSelected ? "flat" : o.isToday ? "outlined" : "text",
563
+ "aria-label": c(o),
564
+ "aria-current": o.isToday ? "date" : void 0,
565
+ onClick: () => C(o.date)
566
+ },
567
+ item: o,
568
+ i: P
569
+ };
570
+ return l.value && !o.isSelected && (o.isDisabled = !0), x("div", {
571
+ class: K(["v-date-picker-month__day", {
572
+ "v-date-picker-month__day--adjacent": o.isAdjacent,
573
+ "v-date-picker-month__day--hide-adjacent": o.isHidden,
574
+ "v-date-picker-month__day--selected": o.isSelected,
575
+ "v-date-picker-month__day--week-end": o.isWeekEnd,
576
+ "v-date-picker-month__day--week-start": o.isWeekStart
577
+ }]),
578
+ "data-v-date": o.isDisabled ? void 0 : o.isoDate
579
+ }, [(e.showAdjacentMonths || !o.isAdjacent) && (n.day?.(Y) ?? w(T, Y.props, null))]);
580
+ })])]
581
+ })]));
582
+ }
583
+ }), Re = $({
584
+ color: String,
585
+ height: [String, Number],
586
+ min: null,
587
+ max: null,
588
+ modelValue: Number,
589
+ year: Number,
590
+ allowedMonths: [Array, Function]
591
+ }, "VDatePickerMonths"), Se = N()({
592
+ name: "VDatePickerMonths",
593
+ props: Re(),
594
+ emits: {
595
+ "update:modelValue": (e) => !0
596
+ },
597
+ setup(e, a) {
598
+ let {
599
+ emit: r,
600
+ slots: n
601
+ } = a;
602
+ const t = H(), i = F(e, "modelValue"), u = V(() => {
603
+ let d = t.startOfYear(t.date());
604
+ return e.year && (d = t.setYear(d, e.year)), Ie(12).map((k) => {
605
+ const f = t.format(d, "monthShort"), h = t.format(d, "month"), D = !!(!s(k) || e.min && t.isAfter(t.startOfMonth(t.date(e.min)), d) || e.max && t.isAfter(d, t.startOfMonth(t.date(e.max))));
606
+ return d = t.getNextMonth(d), {
607
+ isDisabled: D,
608
+ text: f,
609
+ label: h,
610
+ value: k
611
+ };
612
+ });
613
+ });
614
+ fe(() => {
615
+ i.value = i.value ?? t.getMonth(t.date());
616
+ });
617
+ function s(d) {
618
+ return Array.isArray(e.allowedMonths) && e.allowedMonths.length ? e.allowedMonths.includes(d) : typeof e.allowedMonths == "function" ? e.allowedMonths(d) : !0;
619
+ }
620
+ return R(() => x("div", {
621
+ class: "v-date-picker-months",
622
+ style: {
623
+ height: me(e.height)
624
+ }
625
+ }, [x("div", {
626
+ class: "v-date-picker-months__content"
627
+ }, [u.value.map((d, k) => {
628
+ const f = {
629
+ active: i.value === k,
630
+ ariaLabel: d.label,
631
+ color: i.value === k ? e.color : void 0,
632
+ disabled: d.isDisabled,
633
+ rounded: !0,
634
+ text: d.text,
635
+ variant: i.value === d.value ? "flat" : "text",
636
+ onClick: () => h(k)
637
+ };
638
+ function h(D) {
639
+ if (i.value === D) {
640
+ r("update:modelValue", i.value);
641
+ return;
642
+ }
643
+ i.value = D;
644
+ }
645
+ return n.month?.({
646
+ month: d,
647
+ i: k,
648
+ props: f
649
+ }) ?? w(T, O({
650
+ key: "month"
651
+ }, f), null);
652
+ })])])), {};
653
+ }
654
+ }), Ue = $({
655
+ color: String,
656
+ height: [String, Number],
657
+ min: null,
658
+ max: null,
659
+ modelValue: Number,
660
+ allowedYears: [Array, Function]
661
+ }, "VDatePickerYears"), Ce = N()({
662
+ name: "VDatePickerYears",
663
+ props: Ue(),
664
+ directives: {
665
+ vIntersect: ge
666
+ },
667
+ emits: {
668
+ "update:modelValue": (e) => !0
669
+ },
670
+ setup(e, a) {
671
+ let {
672
+ emit: r,
673
+ slots: n
674
+ } = a;
675
+ const t = H(), i = F(e, "modelValue"), u = V(() => {
676
+ const f = t.getYear(t.date());
677
+ let h = f - 100, D = f + 52;
678
+ e.min && (h = t.getYear(t.date(e.min))), e.max && (D = t.getYear(t.date(e.max)));
679
+ let S = t.startOfYear(t.date());
680
+ return S = t.setYear(S, h), Ie(D - h + 1, h).map((p) => {
681
+ const l = t.format(S, "year");
682
+ return S = t.setYear(S, t.getYear(S) + 1), {
683
+ text: l,
684
+ value: p,
685
+ isDisabled: !k(p)
686
+ };
687
+ });
688
+ });
689
+ fe(() => {
690
+ i.value = i.value ?? t.getYear(t.date());
691
+ });
692
+ const s = tt();
693
+ function d() {
694
+ s.el?.focus(), s.el?.scrollIntoView({
695
+ block: "center"
696
+ });
697
+ }
698
+ function k(f) {
699
+ return Array.isArray(e.allowedYears) && e.allowedYears.length ? e.allowedYears.includes(f) : typeof e.allowedYears == "function" ? e.allowedYears(f) : !0;
700
+ }
701
+ return R(() => ze(x("div", {
702
+ class: "v-date-picker-years",
703
+ style: {
704
+ height: me(e.height)
705
+ }
706
+ }, [x("div", {
707
+ class: "v-date-picker-years__content"
708
+ }, [u.value.map((f, h) => {
709
+ const D = {
710
+ ref: i.value === f.value ? s : void 0,
711
+ active: i.value === f.value,
712
+ color: i.value === f.value ? e.color : void 0,
713
+ rounded: !0,
714
+ text: f.text,
715
+ disabled: f.isDisabled,
716
+ variant: i.value === f.value ? "flat" : "text",
717
+ onClick: () => {
718
+ if (i.value === f.value) {
719
+ r("update:modelValue", i.value);
720
+ return;
721
+ }
722
+ i.value = f.value;
723
+ }
724
+ };
725
+ return n.year?.({
726
+ year: f,
727
+ i: h,
728
+ props: D
729
+ }) ?? w(T, O({
730
+ key: "month"
731
+ }, D), null);
732
+ })])]), [[ge, {
733
+ handler: d
734
+ }, null, {
735
+ once: !0
736
+ }]])), {};
737
+ }
738
+ }), Ee = $({
739
+ // TODO: implement in v3.5
740
+ // calendarIcon: {
741
+ // type: String,
742
+ // default: '$calendar',
743
+ // },
744
+ // keyboardIcon: {
745
+ // type: String,
746
+ // default: '$edit',
747
+ // },
748
+ // inputMode: {
749
+ // type: String as PropType<'calendar' | 'keyboard'>,
750
+ // default: 'calendar',
751
+ // },
752
+ // inputText: {
753
+ // type: String,
754
+ // default: '$vuetify.datePicker.input.placeholder',
755
+ // },
756
+ // inputPlaceholder: {
757
+ // type: String,
758
+ // default: 'dd/mm/yyyy',
759
+ // },
760
+ header: {
761
+ type: String,
762
+ default: "$vuetify.datePicker.header"
763
+ },
764
+ headerColor: String,
765
+ ...We(),
766
+ ...Ne({
767
+ weeksInMonth: "static"
768
+ }),
769
+ ...j(Re(), ["modelValue"]),
770
+ ...j(Ue(), ["modelValue"]),
771
+ ...Fe({
772
+ title: "$vuetify.datePicker.title"
773
+ }),
774
+ modelValue: null
775
+ }, "VDatePicker"), Ae = N()({
776
+ name: "VDatePicker",
777
+ props: Ee(),
778
+ emits: {
779
+ "update:modelValue": (e) => !0,
780
+ "update:month": (e) => !0,
781
+ "update:year": (e) => !0,
782
+ // 'update:inputMode': (date: any) => true,
783
+ "update:viewMode": (e) => !0
784
+ },
785
+ setup(e, a) {
786
+ let {
787
+ emit: r,
788
+ slots: n
789
+ } = a;
790
+ const t = H(), {
791
+ t: i
792
+ } = q(), {
793
+ rtlClasses: u
794
+ } = at(), s = F(e, "modelValue", void 0, (v) => X(v).map((g) => t.date(g)), (v) => e.multiple ? v : v[0]), d = F(e, "viewMode"), {
795
+ minDate: k,
796
+ maxDate: f,
797
+ clampDate: h
798
+ } = ye(e), D = V(() => {
799
+ const v = t.date(), g = s.value?.[0] ? t.date(s.value[0]) : h(v);
800
+ return g && t.isValid(g) ? g : v;
801
+ }), S = ee(() => e.headerColor ?? e.color), p = F(e, "month"), l = V({
802
+ get: () => Number(p.value ?? t.getMonth(t.startOfMonth(D.value))),
803
+ set: (v) => p.value = v
804
+ }), y = F(e, "year"), c = V({
805
+ get: () => Number(y.value ?? t.getYear(t.startOfYear(t.setMonth(D.value, l.value)))),
806
+ set: (v) => y.value = v
807
+ }), b = Z(!1), C = V(() => e.multiple && s.value.length > 1 ? i("$vuetify.datePicker.itemsSelected", s.value.length) : s.value[0] && t.isValid(s.value[0]) ? t.format(t.date(s.value[0]), "normalDateWithWeekday") : i(e.header)), o = V(() => {
808
+ let v = t.date();
809
+ return v = t.setDate(v, 1), v = t.setMonth(v, l.value), v = t.setYear(v, c.value), t.format(v, "monthAndYear");
810
+ }), P = ee(() => `date-picker-header${b.value ? "-reverse" : ""}-transition`), Y = V(() => {
811
+ if (e.disabled) return !0;
812
+ const v = [];
813
+ if (d.value !== "month")
814
+ v.push("prev", "next");
815
+ else {
816
+ let g = t.date();
817
+ if (g = t.startOfMonth(g), g = t.setMonth(g, l.value), g = t.setYear(g, c.value), k.value) {
818
+ const M = t.addDays(t.startOfMonth(g), -1);
819
+ t.isAfter(k.value, M) && v.push("prev");
820
+ }
821
+ if (f.value) {
822
+ const M = t.addDays(t.endOfMonth(g), 1);
823
+ t.isAfter(M, f.value) && v.push("next");
824
+ }
825
+ }
826
+ return v;
827
+ }), G = V(() => e.allowedYears || ue), W = V(() => e.allowedMonths || te);
828
+ function z(v, g) {
829
+ const M = e.allowedDates;
830
+ if (typeof M != "function") return !0;
831
+ const B = 1 + $e(t, v, g);
832
+ for (let I = 0; I < B; I++)
833
+ if (M(t.addDays(v, I))) return !0;
834
+ return !1;
835
+ }
836
+ function ue(v) {
837
+ if (typeof e.allowedDates == "function") {
838
+ const g = t.parseISO(`${v}-01-01`);
839
+ return z(g, t.endOfYear(g));
840
+ }
841
+ if (Array.isArray(e.allowedDates) && e.allowedDates.length) {
842
+ for (const g of e.allowedDates)
843
+ if (t.getYear(t.date(g)) === v) return !0;
844
+ return !1;
845
+ }
846
+ return !0;
847
+ }
848
+ function te(v) {
849
+ if (typeof e.allowedDates == "function") {
850
+ const g = String(v + 1).padStart(2, "0"), M = t.parseISO(`${c.value}-${g}-01`);
851
+ return z(M, t.endOfMonth(M));
852
+ }
853
+ if (Array.isArray(e.allowedDates) && e.allowedDates.length) {
854
+ for (const g of e.allowedDates)
855
+ if (t.getYear(t.date(g)) === c.value && t.getMonth(t.date(g)) === v) return !0;
856
+ return !1;
857
+ }
858
+ return !0;
859
+ }
860
+ function de() {
861
+ l.value < 11 ? l.value++ : (c.value++, l.value = 0, A()), m();
862
+ }
863
+ function se() {
864
+ l.value > 0 ? l.value-- : (c.value--, l.value = 11, A()), m();
865
+ }
866
+ function ce() {
867
+ d.value = "month";
868
+ }
869
+ function ae() {
870
+ d.value = d.value === "months" ? "month" : "months";
871
+ }
872
+ function Q() {
873
+ d.value = d.value === "year" ? "month" : "year";
874
+ }
875
+ function m() {
876
+ d.value === "months" && ae();
877
+ }
878
+ function A() {
879
+ d.value === "year" && Q();
880
+ }
881
+ return oe(s, (v, g) => {
882
+ const M = X(g), B = X(v);
883
+ if (!B.length) return;
884
+ const I = t.date(M[M.length - 1]), L = t.date(B[B.length - 1]), U = t.getMonth(L), _ = t.getYear(L);
885
+ U !== l.value && (l.value = U, m()), _ !== c.value && (c.value = _, A()), b.value = t.isBefore(I, L);
886
+ }), R(() => {
887
+ const v = Ve.filterProps(e), g = Pe.filterProps(e), M = xe.filterProps(e), B = Me.filterProps(e), I = j(Se.filterProps(e), ["modelValue"]), L = j(Ce.filterProps(e), ["modelValue"]), U = {
888
+ color: S.value,
889
+ header: C.value,
890
+ transition: P.value
891
+ };
892
+ return w(Ve, O(v, {
893
+ color: S.value,
894
+ class: ["v-date-picker", `v-date-picker--${d.value}`, {
895
+ "v-date-picker--show-week": e.showWeek
896
+ }, u.value, e.class],
897
+ style: e.style
898
+ }), {
899
+ title: () => n.title?.() ?? x("div", {
900
+ class: "v-date-picker__title"
901
+ }, [i(e.title)]),
902
+ header: () => n.header ? w(ve, {
903
+ defaults: {
904
+ VDatePickerHeader: {
905
+ ...U
906
+ }
907
+ }
908
+ }, {
909
+ default: () => [n.header?.(U)]
910
+ }) : w(xe, O({
911
+ key: "header"
912
+ }, M, U, {
913
+ onClick: d.value !== "month" ? ce : void 0
914
+ }), {
915
+ prepend: n.prepend,
916
+ append: n.append
917
+ }),
918
+ default: () => x(ie, null, [w(Pe, O(g, {
919
+ disabled: Y.value,
920
+ text: o.value,
921
+ "onClick:next": de,
922
+ "onClick:prev": se,
923
+ "onClick:month": ae,
924
+ "onClick:year": Q
925
+ }), null), w(nt, {
926
+ hideOnLeave: !0
927
+ }, {
928
+ default: () => [d.value === "months" ? w(Se, O({
929
+ key: "date-picker-months"
930
+ }, I, {
931
+ modelValue: l.value,
932
+ "onUpdate:modelValue": [(_) => l.value = _, m],
933
+ min: k.value,
934
+ max: f.value,
935
+ year: c.value,
936
+ allowedMonths: W.value
937
+ }), {
938
+ month: n.month
939
+ }) : d.value === "year" ? w(Ce, O({
940
+ key: "date-picker-years"
941
+ }, L, {
942
+ modelValue: c.value,
943
+ "onUpdate:modelValue": [(_) => c.value = _, A],
944
+ min: k.value,
945
+ max: f.value,
946
+ allowedYears: G.value
947
+ }), {
948
+ year: n.year
949
+ }) : w(Me, O({
950
+ key: "date-picker-month"
951
+ }, B, {
952
+ modelValue: s.value,
953
+ "onUpdate:modelValue": (_) => s.value = _,
954
+ month: l.value,
955
+ "onUpdate:month": [(_) => l.value = _, m],
956
+ year: c.value,
957
+ "onUpdate:year": [(_) => c.value = _, A],
958
+ min: k.value,
959
+ max: f.value
960
+ }), {
961
+ day: n.day
962
+ })]
963
+ })]),
964
+ actions: n.actions
965
+ });
966
+ }), {};
967
+ }
968
+ });
969
+ class E {
970
+ constructor(a, r) {
971
+ this.order = a, this.separator = r;
972
+ }
973
+ get format() {
974
+ return this.order.split("").map((a) => `${a}${a}`).join(this.separator).replace("yy", "yyyy");
975
+ }
976
+ static canBeParsed(a) {
977
+ if (typeof a != "string") return !1;
978
+ const r = a.toLowerCase();
979
+ return ["y", "m", "d"].every((n) => r.includes(n)) && ["/", "-", "."].some((n) => a.includes(n));
980
+ }
981
+ static parse(a) {
982
+ if (!E.canBeParsed(a))
983
+ throw new Error(`[${a}] cannot be parsed into date format specification`);
984
+ const r = a.toLowerCase().split("").filter((t, i, u) => "dmy".includes(t) && u.indexOf(t) === i).join(""), n = ["/", "-", "."].find((t) => a.includes(t));
985
+ return new E(r, n);
986
+ }
987
+ }
988
+ const bt = $({
989
+ inputFormat: {
990
+ type: String,
991
+ validator: (e) => !e || E.canBeParsed(e)
992
+ }
993
+ }, "date-format");
994
+ function Vt(e, a) {
995
+ const r = H();
996
+ function n() {
997
+ const d = a.value ?? "en-US", k = Intl.DateTimeFormat(d, {
998
+ year: "numeric",
999
+ month: "2-digit",
1000
+ day: "2-digit"
1001
+ }).format(r.toJsDate(r.parseISO("1999-12-07"))).replace(/(07)|(٠٧)|(٢٩)|(۱۶)|(০৭)/, "dd").replace(/(12)|(١٢)|(٠٨)|(۰۹)|(১২)/, "mm").replace(/(1999)|(2542)|(١٩٩٩)|(١٤٢٠)|(۱۳۷۸)|(১৯৯৯)/, "yyyy").replace(/[^ymd\-/.]/g, "").replace(/\.$/, "");
1002
+ return E.canBeParsed(k) ? k : (lt(`Date format inferred from locale [${d}] is invalid: [${k}]`), "mm/dd/yyyy");
1003
+ }
1004
+ const t = ee(() => E.canBeParsed(e.inputFormat) ? E.parse(e.inputFormat) : E.parse(n()));
1005
+ function i(d) {
1006
+ function k(b) {
1007
+ const C = b.trim().split(t.value.separator);
1008
+ return {
1009
+ y: Number(C[t.value.order.indexOf("y")]),
1010
+ m: Number(C[t.value.order.indexOf("m")]),
1011
+ d: Number(C[t.value.order.indexOf("d")])
1012
+ };
1013
+ }
1014
+ function f(b) {
1015
+ const {
1016
+ y: C,
1017
+ m: o,
1018
+ d: P
1019
+ } = b;
1020
+ return !C || !o || !P || o < 1 || o > 12 || P < 1 || P > 31 ? null : {
1021
+ year: h(C),
1022
+ month: o,
1023
+ day: P
1024
+ };
1025
+ }
1026
+ function h(b) {
1027
+ const C = r.getYear(r.date());
1028
+ if (b > 100 || C % 100 >= 50)
1029
+ return b;
1030
+ const o = ~~(C / 100) * 100;
1031
+ return b < 50 ? o + b : o - 100 + b;
1032
+ }
1033
+ const D = k(d), S = f(D);
1034
+ if (!S) return null;
1035
+ const {
1036
+ year: p,
1037
+ month: l,
1038
+ day: y
1039
+ } = S, c = (b) => String(b).padStart(2, "0");
1040
+ return r.parseISO(`${p}-${c(l)}-${c(y)}`);
1041
+ }
1042
+ function u(d) {
1043
+ return !!i(d);
1044
+ }
1045
+ function s(d) {
1046
+ const k = r.toISO(d).split("T")[0].split("-");
1047
+ return t.value.order.split("").map((f) => k["ymd".indexOf(f)]).join(t.value.separator);
1048
+ }
1049
+ return {
1050
+ isValid: u,
1051
+ parseDate: i,
1052
+ formatDate: s,
1053
+ parserFormat: ee(() => t.value.format)
1054
+ };
1055
+ }
1056
+ const wt = $({
1057
+ displayFormat: {
1058
+ type: [Function, String],
1059
+ default: void 0
1060
+ },
1061
+ location: {
1062
+ type: String,
1063
+ default: "bottom start"
1064
+ },
1065
+ menu: Boolean,
1066
+ updateOn: {
1067
+ type: Array,
1068
+ default: () => ["blur", "enter"]
1069
+ },
1070
+ ...bt(),
1071
+ ...dt({
1072
+ mobile: null
1073
+ }),
1074
+ ...ft(),
1075
+ ...Te({
1076
+ hideActions: !0
1077
+ }),
1078
+ ...ct({
1079
+ prependIcon: "$calendar"
1080
+ }),
1081
+ ...j(Ee({
1082
+ hideHeader: !0,
1083
+ showAdjacentMonths: !0
1084
+ }), ["active", "location", "rounded", "height", "minHeight", "maxHeight"])
1085
+ }, "VDateInput"), Pt = N()({
1086
+ name: "VDateInput",
1087
+ props: wt(),
1088
+ emits: {
1089
+ save: (e) => !0,
1090
+ cancel: () => !0,
1091
+ "update:focused": (e) => !0,
1092
+ "update:modelValue": (e) => !0,
1093
+ "update:menu": (e) => !0
1094
+ },
1095
+ setup(e, a) {
1096
+ let {
1097
+ emit: r,
1098
+ slots: n
1099
+ } = a;
1100
+ const {
1101
+ t,
1102
+ current: i
1103
+ } = q(), u = H(), {
1104
+ isValid: s,
1105
+ parseDate: d,
1106
+ formatDate: k,
1107
+ parserFormat: f
1108
+ } = Vt(e, i), {
1109
+ mobile: h
1110
+ } = rt(e), {
1111
+ clampDate: D,
1112
+ isInAllowedRange: S
1113
+ } = ye(e), p = () => e.multiple ? [] : null, l = F(e, "modelValue", p(), (m) => Array.isArray(m) ? m.map((A) => u.toJsDate(A)) : m && u.toJsDate(m), (m) => Array.isArray(m) ? m.map((A) => u.date(A)) : m && u.date(m)), y = F(e, "menu"), c = Z(!1), b = Z(e.focused), C = re(), o = re(["save"]);
1114
+ function P(m) {
1115
+ return typeof e.displayFormat == "function" ? e.displayFormat(m) : e.displayFormat ? u.format(m, e.displayFormat ?? "keyboardDate") : k(m);
1116
+ }
1117
+ const Y = V(() => {
1118
+ const m = X(l.value);
1119
+ if (!m.length) return null;
1120
+ if (e.multiple === !0)
1121
+ return t("$vuetify.datePicker.itemsSelected", m.length);
1122
+ if (e.multiple === "range") {
1123
+ const A = m[0], v = m[m.length - 1];
1124
+ return !u.isValid(A) || !u.isValid(v) ? "" : `${P(u.date(A))} - ${P(u.date(v))}`;
1125
+ }
1126
+ return u.isValid(l.value) ? P(u.date(l.value)) : "";
1127
+ }), G = V(() => {
1128
+ if (h.value)
1129
+ return c.value ? "text" : "none";
1130
+ }), W = V(() => !e.disabled && !e.readonly), z = V(() => e.updateOn.length ? !(h.value && c.value) && e.readonly : !0);
1131
+ oe(y, (m) => {
1132
+ m || (c.value = !1, o.value = ["save"]);
1133
+ });
1134
+ function ue(m) {
1135
+ m.key === "Enter" && ((!y.value || !b.value) && (y.value = !0), e.updateOn.includes("enter") && !e.readonly && Q(m.target));
1136
+ }
1137
+ function te(m) {
1138
+ m.preventDefault(), m.stopPropagation(), y.value && h.value ? c.value = !0 : y.value = !0;
1139
+ }
1140
+ function de() {
1141
+ r("cancel"), y.value = !1, c.value = !1;
1142
+ }
1143
+ function se(m) {
1144
+ r("save", m), y.value = !1;
1145
+ }
1146
+ function ce(m) {
1147
+ m == null && (l.value = p());
1148
+ }
1149
+ function ae(m) {
1150
+ e.updateOn.includes("blur") && !e.readonly && Q(m.target), h.value && c.value && !b.value && (y.value = !1, c.value = !1);
1151
+ }
1152
+ function Q(m) {
1153
+ let {
1154
+ value: A
1155
+ } = m;
1156
+ if (!A.trim())
1157
+ l.value = p();
1158
+ else if (!e.multiple)
1159
+ s(A) && (l.value = D(d(A)));
1160
+ else {
1161
+ const v = A.trim().split(/\D+-\D+|[^\d\-/.]+/);
1162
+ if (v.every(s))
1163
+ if (e.multiple === "range") {
1164
+ const [g, M] = v.map(d).map(D).toSorted((B, I) => u.isAfter(B, I) ? 1 : -1);
1165
+ l.value = Be(u, g, M);
1166
+ } else
1167
+ l.value = v.map(d).filter(S);
1168
+ }
1169
+ }
1170
+ return R(() => {
1171
+ const m = we.filterProps(e), A = Ae.filterProps(j(e, ["active", "bgColor", "color", "location", "rounded", "maxWidth", "minWidth", "width"])), v = it(n, ["title", "header", "day", "month", "year"]), g = be.filterProps(j(e, ["placeholder"]));
1172
+ return w(be, O({
1173
+ ref: C
1174
+ }, g, {
1175
+ class: e.class,
1176
+ style: e.style,
1177
+ modelValue: Y.value,
1178
+ inputmode: G.value,
1179
+ placeholder: e.placeholder ?? f.value,
1180
+ readonly: z.value,
1181
+ onKeydown: W.value ? ue : void 0,
1182
+ focused: y.value || b.value,
1183
+ onBlur: ae,
1184
+ validationValue: l.value,
1185
+ "onClick:control": W.value ? te : void 0,
1186
+ "onClick:prepend": W.value ? te : void 0,
1187
+ "onUpdate:modelValue": ce,
1188
+ "onUpdate:focused": (M) => b.value = M
1189
+ }), {
1190
+ ...n,
1191
+ default: () => x(ie, null, [w(ot, {
1192
+ modelValue: y.value,
1193
+ "onUpdate:modelValue": (M) => y.value = M,
1194
+ activator: "parent",
1195
+ minWidth: "0",
1196
+ eager: b.value,
1197
+ location: e.location,
1198
+ closeOnContentClick: !1,
1199
+ openOnClick: !1
1200
+ }, {
1201
+ default: () => [w(we, O(m, {
1202
+ modelValue: l.value,
1203
+ "onUpdate:modelValue": (M) => l.value = M,
1204
+ disabled: o.value,
1205
+ onSave: se,
1206
+ onCancel: de
1207
+ }), {
1208
+ default: (M) => {
1209
+ let {
1210
+ actions: B,
1211
+ model: I,
1212
+ save: L,
1213
+ cancel: U,
1214
+ isPristine: _
1215
+ } = M;
1216
+ function je(J) {
1217
+ e.hideActions ? (l.value = J, e.multiple || (y.value = !1)) : I.value = J, r("save", J), o.value = [];
1218
+ }
1219
+ return w(Ae, O(A, {
1220
+ modelValue: e.hideActions ? l.value : I.value,
1221
+ "onUpdate:modelValue": (J) => je(J),
1222
+ onMousedown: (J) => J.preventDefault()
1223
+ }), {
1224
+ ...v,
1225
+ actions: e.hideActions ? void 0 : () => n.actions?.({
1226
+ save: L,
1227
+ cancel: U,
1228
+ isPristine: _
1229
+ }) ?? B()
1230
+ });
1231
+ }
1232
+ })]
1233
+ }), n.default?.()])
1234
+ });
1235
+ }), ut({}, C);
1236
+ }
1237
+ }), At = {
1238
+ __name: "Datepicker",
1239
+ props: /* @__PURE__ */ Ke({
1240
+ returnFormat: {
1241
+ type: String,
1242
+ default: "DD-MM-YYYY"
1243
+ }
1244
+ }, {
1245
+ modelValue: {},
1246
+ modelModifiers: {}
1247
+ }),
1248
+ emits: ["update:modelValue"],
1249
+ setup(e) {
1250
+ const a = Ze(e, "modelValue"), r = e, n = V({
1251
+ get: () => {
1252
+ const t = r.returnFormat, i = Array.isArray(a.value);
1253
+ let u;
1254
+ if (a.value)
1255
+ return i && a.value.length ? u = a.value.map(
1256
+ (s) => new Date(ne(s, t).format())
1257
+ ) : u = new Date(ne(a.value, t).format()), u;
1258
+ },
1259
+ set: (t) => {
1260
+ const i = r.returnFormat;
1261
+ Array.isArray(t) && t.length ? a.value = t.map((s) => ne(s).format(i)) : a.value = ne(t).format(i);
1262
+ }
1263
+ });
1264
+ return (t, i) => (Ge(), qe(he(Pt), {
1265
+ modelValue: he(n),
1266
+ "onUpdate:modelValue": i[0] || (i[0] = (u) => Qe(n) ? n.value = u : null)
1267
+ }, null, 8, ["modelValue"]));
1268
+ }
1269
+ };
1270
+ export {
1271
+ At as default
1272
+ };