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