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