@ianicdev/datatables2 0.10.8 → 0.11.0
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/{Comparison-ClrNRg-V.js → Comparison-C2hZMBq4.js} +3 -3
- package/dist/{Comparison-DCWQz5X9.cjs → Comparison-tLPSEm-Q.cjs} +1 -1
- package/dist/Datepicker-BA4mQx6C.cjs +2 -0
- package/dist/{Datepicker-Du8AggGn.js → Datepicker-BO2Ixl4r.js} +463 -459
- package/dist/Options-C7EAVB8f.cjs +1 -0
- package/dist/Options-DrhE_fto.js +108 -0
- package/dist/RefreshTable-BNy_MWZg.js +21 -0
- package/dist/RefreshTable-C-AgoC97.cjs +1 -0
- package/dist/{Search-BHVyo0uz.js → Search-CdHQz2KW.js} +8 -8
- package/dist/{Search-CVhqyw6f.cjs → Search-D_zU2pXl.cjs} +1 -1
- package/dist/{Table-C2P9cYl_.cjs → Table-B2iOe4P0.cjs} +1 -1
- package/dist/{Table-DoG07zNZ.js → Table-DHHVRPoA.js} +3 -3
- package/dist/{TableServer-BDcY2nQz.js → TableServer-D4Q_9dET.js} +3 -3
- package/dist/{TableServer-CeJMxSCa.cjs → TableServer-k8aRa4f5.cjs} +1 -1
- package/dist/{cellRender-DZ5qL5RV.cjs → cellRender-DuBdvYbh.cjs} +1 -1
- package/dist/{cellRender-BRFdMQzg.js → cellRender-LGC_k50e.js} +57 -57
- package/dist/dataTables-DV00l1p8.cjs +4 -0
- package/dist/{dataTables-DRiNyKEv.js → dataTables-j8j4naMl.js} +380 -374
- package/dist/datatables.cjs +1 -1
- package/dist/datatables.js +1 -1
- package/dist/datatables2.css +1 -1
- package/dist/{index-DqBI0sCe.js → index-BU9rb0Q-.js} +2 -2
- package/dist/index-BjbhnehN.js +4477 -0
- package/dist/index-CEe--P_C.cjs +1 -0
- package/dist/{index-DD_T-n8-.cjs → index-CU-Eak9-.cjs} +1 -1
- package/dist/index-CXUreMkK.cjs +1 -0
- package/dist/index-DzyBRRkM.js +30 -0
- package/dist/index-_cYryjRU.cjs +1 -0
- package/dist/index-zhSEiNN0.js +61 -0
- package/dist/{index.es-BtDW7HTQ.cjs → index.es-BCJd8pS0.cjs} +1 -1
- package/dist/{index.es-Bv6Mb9BC.js → index.es-CtLP1GTc.js} +1 -1
- package/dist/{jspdf-D9i2dan7.js → jspdf-3qJBK9tP.js} +6 -6
- package/dist/{jspdf-BsORS480.cjs → jspdf-DyYqWhF9.cjs} +4 -4
- package/dist/useColumns-CCJ04VF-.cjs +1 -0
- package/dist/useColumns-Dfrb9p8A.js +1473 -0
- package/dist/useDownload-CL90ZIqP.cjs +1 -0
- package/dist/{Download-CIp1YVEq.js → useDownload-DgATsbOV.js} +105 -132
- package/dist/useRefreshTable-BhEgI00Z.cjs +1 -0
- package/dist/useRefreshTable-Cf0gpIuT.js +18 -0
- package/package.json +16 -16
- package/dist/Columns-Dd9SfqmJ.cjs +0 -1
- package/dist/Columns-QO7YU0eZ.js +0 -28
- package/dist/Datepicker-BHbZnWHu.cjs +0 -2
- package/dist/Download-B2JKkFCz.cjs +0 -1
- package/dist/Options-BPCUGErN.js +0 -82
- package/dist/Options-DiRnomZy.cjs +0 -1
- package/dist/RefreshTable-B13C6sLc.js +0 -26
- package/dist/RefreshTable-CwHf3COZ.cjs +0 -1
- package/dist/dataTables-CmM1RF0K.cjs +0 -4
- package/dist/escapeKeyString-CngwDxKW.js +0 -17
- package/dist/escapeKeyString-nS7kXLwu.cjs +0 -1
- package/dist/index-Bz4Guf4c.cjs +0 -1
- package/dist/index-D9tMlHlC.js +0 -5891
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { inject as Ke, reactive as Ze, watch as ce, createVNode as
|
|
1
|
+
import { inject as Ke, reactive as Ze, watch as ce, createVNode as b, mergeProps as B, createElementVNode as P, normalizeStyle as Te, normalizeClass as ie, ref as se, watchEffect as ge, computed as w, Fragment as Q, shallowRef as le, toRef as z, createTextVNode as qe, withDirectives as Xe, mergeModels as Ge, useModel as Qe, createBlock as et, openBlock as tt, unref as De, isRef as at } from "vue";
|
|
2
2
|
import G from "moment";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
3
|
+
import { y as oe, aJ as Fe, g as K, p as j, Y as $e, h as Z, L as fe, E as L, aZ as Ve, x as nt, aL as F, aj as ve, o as de, a9 as Be, X as lt, a4 as te, a7 as H, aV as We, an as xe, a_ as rt, u as it, V as ot, a as ut, b as dt, af as st, at as ct, ao as ft, l as vt } from "./dataTables-j8j4naMl.js";
|
|
4
|
+
import { n as Pe, x as mt, y as yt, z as ht, i as we, A as kt, B as gt } from "./index-BjbhnehN.js";
|
|
5
|
+
const bt = /* @__PURE__ */ Symbol.for("vuetify:date-options");
|
|
6
6
|
function Ne(e, a, l) {
|
|
7
7
|
const n = Ee(e, a, l), t = [a];
|
|
8
8
|
for (let i = 1; i < n; i++) {
|
|
9
|
-
const
|
|
10
|
-
t.push(
|
|
9
|
+
const o = e.addDays(a, i);
|
|
10
|
+
t.push(o);
|
|
11
11
|
}
|
|
12
12
|
return l && t.push(e.endOfDay(l)), t;
|
|
13
13
|
}
|
|
@@ -15,7 +15,7 @@ function Ee(e, a, l) {
|
|
|
15
15
|
const n = [`${e.toISO(l ?? a).split("T")[0]}T00:00:00Z`, `${e.toISO(a).split("T")[0]}T00:00:00Z`];
|
|
16
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
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Dt(e, a) {
|
|
19
19
|
const l = Ze(typeof e.adapter == "function" ? new e.adapter({
|
|
20
20
|
locale: e.locale[a.current.value] ?? a.current.value,
|
|
21
21
|
formats: e.formats
|
|
@@ -24,13 +24,13 @@ function bt(e, a) {
|
|
|
24
24
|
l.locale = e.locale[n] ?? n ?? l.locale;
|
|
25
25
|
}), l;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const e = Ke(
|
|
27
|
+
function ae() {
|
|
28
|
+
const e = Ke(bt);
|
|
29
29
|
if (!e) throw new Error("[Vuetify] Could not find injected date options");
|
|
30
30
|
const a = oe();
|
|
31
|
-
return
|
|
31
|
+
return Dt(e, a);
|
|
32
32
|
}
|
|
33
|
-
const Vt =
|
|
33
|
+
const Vt = Fe("v-picker-title"), Le = j({
|
|
34
34
|
bgColor: String,
|
|
35
35
|
divided: Boolean,
|
|
36
36
|
landscape: Boolean,
|
|
@@ -40,7 +40,7 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
40
40
|
...mt()
|
|
41
41
|
}, "VPicker"), Me = K()({
|
|
42
42
|
name: "VPicker",
|
|
43
|
-
props:
|
|
43
|
+
props: Le(),
|
|
44
44
|
setup(e, a) {
|
|
45
45
|
let {
|
|
46
46
|
slots: l
|
|
@@ -48,10 +48,10 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
48
48
|
const {
|
|
49
49
|
backgroundColorClasses: n,
|
|
50
50
|
backgroundColorStyles: t
|
|
51
|
-
} =
|
|
51
|
+
} = $e(() => e.color);
|
|
52
52
|
return Z(() => {
|
|
53
|
-
const i = Pe.filterProps(e),
|
|
54
|
-
return
|
|
53
|
+
const i = Pe.filterProps(e), o = !e.hideTitle && !!(e.title || l.title);
|
|
54
|
+
return b(Pe, B(i, {
|
|
55
55
|
color: e.bgColor,
|
|
56
56
|
class: ["v-picker", {
|
|
57
57
|
"v-picker--divided": e.divided,
|
|
@@ -62,9 +62,9 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
62
62
|
}), {
|
|
63
63
|
default: () => [!e.hideHeader && P("div", {
|
|
64
64
|
key: "header",
|
|
65
|
-
class:
|
|
65
|
+
class: ie(["v-picker__header-wrapper", n.value]),
|
|
66
66
|
style: Te([t.value])
|
|
67
|
-
}, [
|
|
67
|
+
}, [o && b(Vt, {
|
|
68
68
|
key: "picker-title"
|
|
69
69
|
}, {
|
|
70
70
|
default: () => [l.title?.() ?? e.title]
|
|
@@ -72,7 +72,7 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
72
72
|
class: "v-picker__header"
|
|
73
73
|
}, [l.header()])]), P("div", {
|
|
74
74
|
class: "v-picker__body"
|
|
75
|
-
}, [l.default?.()]), l.actions &&
|
|
75
|
+
}, [l.default?.()]), l.actions && b(fe, {
|
|
76
76
|
defaults: {
|
|
77
77
|
VBtn: {
|
|
78
78
|
slim: !0,
|
|
@@ -87,7 +87,7 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
87
87
|
});
|
|
88
88
|
}), {};
|
|
89
89
|
}
|
|
90
|
-
}),
|
|
90
|
+
}), Re = j({
|
|
91
91
|
modelValue: null,
|
|
92
92
|
color: String,
|
|
93
93
|
cancelText: {
|
|
@@ -105,7 +105,7 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
105
105
|
hideActions: Boolean
|
|
106
106
|
}, "VConfirmEdit"), Se = K()({
|
|
107
107
|
name: "VConfirmEdit",
|
|
108
|
-
props:
|
|
108
|
+
props: Re(),
|
|
109
109
|
emits: {
|
|
110
110
|
cancel: () => !0,
|
|
111
111
|
save: (e) => !0,
|
|
@@ -116,54 +116,54 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
116
116
|
emit: l,
|
|
117
117
|
slots: n
|
|
118
118
|
} = a;
|
|
119
|
-
const t =
|
|
119
|
+
const t = L(e, "modelValue"), i = se();
|
|
120
120
|
ge(() => {
|
|
121
121
|
i.value = structuredClone(Ve(t.value));
|
|
122
122
|
});
|
|
123
123
|
const {
|
|
124
|
-
t:
|
|
125
|
-
} = oe(),
|
|
126
|
-
function
|
|
127
|
-
return typeof e.disabled == "boolean" ? e.disabled : Array.isArray(e.disabled) ? e.disabled.includes(r) :
|
|
124
|
+
t: o
|
|
125
|
+
} = oe(), c = w(() => nt(t.value, i.value));
|
|
126
|
+
function d(r) {
|
|
127
|
+
return typeof e.disabled == "boolean" ? e.disabled : Array.isArray(e.disabled) ? e.disabled.includes(r) : c.value;
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
function
|
|
129
|
+
const h = w(() => d("save")), g = w(() => d("cancel"));
|
|
130
|
+
function f() {
|
|
131
131
|
t.value = i.value, l("save", i.value);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function D() {
|
|
134
134
|
i.value = structuredClone(Ve(t.value)), l("cancel");
|
|
135
135
|
}
|
|
136
136
|
function C(r) {
|
|
137
|
-
return P(Q, null, [
|
|
138
|
-
disabled:
|
|
137
|
+
return P(Q, null, [b(F, B({
|
|
138
|
+
disabled: g.value,
|
|
139
139
|
variant: "text",
|
|
140
140
|
color: e.color,
|
|
141
|
-
onClick:
|
|
142
|
-
text:
|
|
143
|
-
}, r), null),
|
|
144
|
-
disabled:
|
|
141
|
+
onClick: D,
|
|
142
|
+
text: o(e.cancelText)
|
|
143
|
+
}, r), null), b(F, B({
|
|
144
|
+
disabled: h.value,
|
|
145
145
|
variant: "text",
|
|
146
146
|
color: e.color,
|
|
147
|
-
onClick:
|
|
148
|
-
text:
|
|
147
|
+
onClick: f,
|
|
148
|
+
text: o(e.okText)
|
|
149
149
|
}, r), null)]);
|
|
150
150
|
}
|
|
151
151
|
let Y = !1;
|
|
152
152
|
return Z(() => P(Q, null, [n.default?.({
|
|
153
153
|
model: i,
|
|
154
|
-
save:
|
|
155
|
-
cancel:
|
|
156
|
-
isPristine:
|
|
154
|
+
save: f,
|
|
155
|
+
cancel: D,
|
|
156
|
+
isPristine: c.value,
|
|
157
157
|
get actions() {
|
|
158
158
|
return Y = !0, C;
|
|
159
159
|
}
|
|
160
160
|
}), !e.hideActions && !Y && C()])), {
|
|
161
|
-
save:
|
|
162
|
-
cancel:
|
|
163
|
-
isPristine:
|
|
161
|
+
save: f,
|
|
162
|
+
cancel: D,
|
|
163
|
+
isPristine: c
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
}), Ce =
|
|
166
|
+
}), Ce = Fe("v-spacer", "div", "VSpacer"), je = j({
|
|
167
167
|
active: {
|
|
168
168
|
type: [String, Array],
|
|
169
169
|
default: void 0
|
|
@@ -215,11 +215,11 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
215
215
|
} = a;
|
|
216
216
|
const {
|
|
217
217
|
t
|
|
218
|
-
} = oe(), i = w(() => Array.isArray(e.disabled) ? e.disabled.includes("text") : !!e.disabled),
|
|
219
|
-
function
|
|
218
|
+
} = oe(), i = w(() => Array.isArray(e.disabled) ? e.disabled.includes("text") : !!e.disabled), o = w(() => Array.isArray(e.disabled) ? e.disabled.includes("mode") : !!e.disabled), c = w(() => Array.isArray(e.disabled) ? e.disabled.includes("prev-month") : !!e.disabled), d = w(() => Array.isArray(e.disabled) ? e.disabled.includes("next-month") : !!e.disabled), h = w(() => Array.isArray(e.disabled) ? e.disabled.includes("prev-year") : !!e.disabled), g = w(() => Array.isArray(e.disabled) ? e.disabled.includes("next-year") : !!e.disabled);
|
|
219
|
+
function f() {
|
|
220
220
|
l("click:prev");
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function D() {
|
|
223
223
|
l("click:next");
|
|
224
224
|
}
|
|
225
225
|
function C() {
|
|
@@ -235,36 +235,36 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
235
235
|
l("click:month");
|
|
236
236
|
}
|
|
237
237
|
return Z(() => {
|
|
238
|
-
const
|
|
238
|
+
const u = {
|
|
239
239
|
VBtn: {
|
|
240
240
|
density: "comfortable",
|
|
241
241
|
variant: "text"
|
|
242
242
|
}
|
|
243
|
-
},
|
|
243
|
+
}, V = b(F, {
|
|
244
244
|
"data-testid": "prev-month",
|
|
245
|
-
disabled:
|
|
245
|
+
disabled: c.value,
|
|
246
246
|
icon: e.prevIcon,
|
|
247
247
|
"aria-label": t("$vuetify.datePicker.ariaLabel.previousMonth"),
|
|
248
|
-
onClick:
|
|
249
|
-
}, null), S =
|
|
248
|
+
onClick: f
|
|
249
|
+
}, null), S = b(F, {
|
|
250
250
|
"data-testid": "next-month",
|
|
251
|
-
disabled:
|
|
251
|
+
disabled: d.value,
|
|
252
252
|
icon: e.nextIcon,
|
|
253
253
|
"aria-label": t("$vuetify.datePicker.ariaLabel.nextMonth"),
|
|
254
|
-
onClick:
|
|
255
|
-
}, null), A =
|
|
254
|
+
onClick: D
|
|
255
|
+
}, null), A = b(F, {
|
|
256
256
|
"data-testid": "prev-year",
|
|
257
|
-
disabled:
|
|
257
|
+
disabled: h.value,
|
|
258
258
|
icon: e.prevIcon,
|
|
259
259
|
"aria-label": t("$vuetify.datePicker.ariaLabel.previousYear"),
|
|
260
260
|
onClick: C
|
|
261
|
-
}, null), I =
|
|
261
|
+
}, null), I = b(F, {
|
|
262
262
|
"data-testid": "next-year",
|
|
263
|
-
disabled:
|
|
263
|
+
disabled: g.value,
|
|
264
264
|
icon: e.nextIcon,
|
|
265
265
|
"aria-label": t("$vuetify.datePicker.ariaLabel.nextYear"),
|
|
266
266
|
onClick: Y
|
|
267
|
-
}, null), s =
|
|
267
|
+
}, null), s = b(F, {
|
|
268
268
|
class: "v-date-picker-controls__only-month-btn",
|
|
269
269
|
"data-testid": "month-btn",
|
|
270
270
|
density: "default",
|
|
@@ -274,27 +274,27 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
274
274
|
rounded: !0,
|
|
275
275
|
"aria-label": t("$vuetify.datePicker.ariaLabel.selectMonth"),
|
|
276
276
|
onClick: m
|
|
277
|
-
}, null), x =
|
|
277
|
+
}, null), x = b(F, {
|
|
278
278
|
class: "v-date-picker-controls__only-year-btn",
|
|
279
279
|
"data-testid": "year-btn",
|
|
280
280
|
density: "default",
|
|
281
|
-
disabled:
|
|
281
|
+
disabled: o.value,
|
|
282
282
|
text: e.yearText,
|
|
283
283
|
appendIcon: e.modeIcon,
|
|
284
284
|
rounded: !0,
|
|
285
285
|
"aria-label": t("$vuetify.datePicker.ariaLabel.selectYear"),
|
|
286
286
|
onClick: r
|
|
287
|
-
}, null), M =
|
|
287
|
+
}, null), M = b(F, {
|
|
288
288
|
class: "v-date-picker-controls__year-btn",
|
|
289
289
|
"data-testid": "year-btn",
|
|
290
290
|
density: "default",
|
|
291
|
-
disabled:
|
|
291
|
+
disabled: o.value,
|
|
292
292
|
text: e.text,
|
|
293
293
|
appendIcon: e.modeIcon,
|
|
294
294
|
rounded: !0,
|
|
295
295
|
"aria-label": t("$vuetify.datePicker.ariaLabel.selectYear"),
|
|
296
296
|
onClick: r
|
|
297
|
-
}, null),
|
|
297
|
+
}, null), _ = P(Q, null, [b(F, {
|
|
298
298
|
class: "v-date-picker-controls__month-btn",
|
|
299
299
|
"data-testid": "month-btn",
|
|
300
300
|
height: "36",
|
|
@@ -303,10 +303,10 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
303
303
|
rounded: !0,
|
|
304
304
|
"aria-label": t("$vuetify.datePicker.ariaLabel.selectMonth"),
|
|
305
305
|
onClick: m
|
|
306
|
-
}, null),
|
|
306
|
+
}, null), b(F, {
|
|
307
307
|
class: "v-date-picker-controls__mode-btn",
|
|
308
308
|
"data-testid": "year-btn",
|
|
309
|
-
disabled:
|
|
309
|
+
disabled: o.value,
|
|
310
310
|
icon: e.modeIcon,
|
|
311
311
|
"aria-label": t("$vuetify.datePicker.ariaLabel.selectYear"),
|
|
312
312
|
onClick: r
|
|
@@ -318,30 +318,30 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
318
318
|
yearText: e.yearText ?? "",
|
|
319
319
|
openMonths: m,
|
|
320
320
|
openYears: r,
|
|
321
|
-
prevMonth:
|
|
322
|
-
nextMonth:
|
|
321
|
+
prevMonth: f,
|
|
322
|
+
nextMonth: D,
|
|
323
323
|
prevYear: C,
|
|
324
324
|
nextYear: Y
|
|
325
|
-
}, q = P(Q, null, [e.noMonthPicker ? M :
|
|
325
|
+
}, q = P(Q, null, [e.noMonthPicker ? M : _, b(Ce, null, null), P("div", {
|
|
326
326
|
class: "v-date-picker-controls__month"
|
|
327
|
-
}, [
|
|
327
|
+
}, [V, S])]), ne = P(Q, null, [P("div", {
|
|
328
328
|
class: "v-date-picker-controls__month"
|
|
329
|
-
}, [
|
|
329
|
+
}, [V, s, S]), b(Ce, null, null), P("div", {
|
|
330
330
|
class: "v-date-picker-controls__year"
|
|
331
331
|
}, [A, x, I])]);
|
|
332
|
-
return
|
|
333
|
-
defaults:
|
|
332
|
+
return b(fe, {
|
|
333
|
+
defaults: u
|
|
334
334
|
}, {
|
|
335
335
|
default: () => [P("div", {
|
|
336
|
-
class:
|
|
336
|
+
class: ie(["v-date-picker-controls", `v-date-picker-controls--variant-${e.controlVariant}`]),
|
|
337
337
|
style: {
|
|
338
338
|
"--v-date-picker-controls-height": ve(e.controlHeight)
|
|
339
339
|
}
|
|
340
|
-
}, [n.default?.(W) ?? P(Q, null, [e.controlVariant === "modal" && q, e.controlVariant === "docked" &&
|
|
340
|
+
}, [n.default?.(W) ?? P(Q, null, [e.controlVariant === "modal" && q, e.controlVariant === "docked" && ne])])]
|
|
341
341
|
});
|
|
342
342
|
}), {};
|
|
343
343
|
}
|
|
344
|
-
}), xt =
|
|
344
|
+
}), xt = j({
|
|
345
345
|
appendIcon: de,
|
|
346
346
|
color: String,
|
|
347
347
|
header: String,
|
|
@@ -362,25 +362,25 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
362
362
|
const {
|
|
363
363
|
backgroundColorClasses: t,
|
|
364
364
|
backgroundColorStyles: i
|
|
365
|
-
} =
|
|
366
|
-
function
|
|
365
|
+
} = $e(() => e.color);
|
|
366
|
+
function o() {
|
|
367
367
|
l("click");
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function c() {
|
|
370
370
|
l("click:append");
|
|
371
371
|
}
|
|
372
372
|
return Z(() => {
|
|
373
|
-
const
|
|
373
|
+
const d = !!(n.default || e.header), h = !!(n.append || e.appendIcon);
|
|
374
374
|
return P("div", {
|
|
375
|
-
class:
|
|
375
|
+
class: ie(["v-date-picker-header", {
|
|
376
376
|
"v-date-picker-header--clickable": !!e.onClick
|
|
377
377
|
}, t.value]),
|
|
378
378
|
style: Te(i.value),
|
|
379
|
-
onClick:
|
|
379
|
+
onClick: o
|
|
380
380
|
}, [n.prepend && P("div", {
|
|
381
381
|
key: "prepend",
|
|
382
382
|
class: "v-date-picker-header__prepend"
|
|
383
|
-
}, [n.prepend()]),
|
|
383
|
+
}, [n.prepend()]), d && b(Be, {
|
|
384
384
|
key: "content",
|
|
385
385
|
name: e.transition
|
|
386
386
|
}, {
|
|
@@ -388,9 +388,9 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
388
388
|
key: e.header,
|
|
389
389
|
class: "v-date-picker-header__content"
|
|
390
390
|
}, [n.default?.() ?? e.header])]
|
|
391
|
-
}),
|
|
391
|
+
}), h && P("div", {
|
|
392
392
|
class: "v-date-picker-header__append"
|
|
393
|
-
}, [n.append ?
|
|
393
|
+
}, [n.append ? b(fe, {
|
|
394
394
|
key: "append-defaults",
|
|
395
395
|
disabled: !e.appendIcon,
|
|
396
396
|
defaults: {
|
|
@@ -401,15 +401,15 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
401
401
|
}
|
|
402
402
|
}, {
|
|
403
403
|
default: () => [n.append?.()]
|
|
404
|
-
}) :
|
|
404
|
+
}) : b(F, {
|
|
405
405
|
key: "append-btn",
|
|
406
406
|
icon: e.appendIcon,
|
|
407
407
|
variant: "text",
|
|
408
|
-
onClick:
|
|
408
|
+
onClick: c
|
|
409
409
|
}, null)])]);
|
|
410
410
|
}), {};
|
|
411
411
|
}
|
|
412
|
-
}), Pt =
|
|
412
|
+
}), Pt = j({
|
|
413
413
|
allowedDates: [Array, Function],
|
|
414
414
|
disabled: {
|
|
415
415
|
type: Boolean,
|
|
@@ -441,92 +441,92 @@ const Vt = $e("v-picker-title"), Re = U({
|
|
|
441
441
|
weekdayFormat: String
|
|
442
442
|
}, "calendar");
|
|
443
443
|
function wt(e) {
|
|
444
|
-
const a =
|
|
444
|
+
const a = ae(), l = L(e, "modelValue", [], (r) => te(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 = L(e, "year", void 0, (r) => {
|
|
445
445
|
const m = r != null ? Number(r) : a.getYear(n.value);
|
|
446
446
|
return a.startOfYear(a.setYear(a.date(), m));
|
|
447
|
-
}, (r) => a.getYear(r)), i =
|
|
448
|
-
const m = r != null ? Number(r) : a.getMonth(n.value),
|
|
449
|
-
return a.setMonth(
|
|
450
|
-
}, (r) => a.getMonth(r)),
|
|
447
|
+
}, (r) => a.getYear(r)), i = L(e, "month", void 0, (r) => {
|
|
448
|
+
const m = r != null ? Number(r) : a.getMonth(n.value), u = a.setYear(a.startOfMonth(a.date()), a.getYear(t.value));
|
|
449
|
+
return a.setMonth(u, m);
|
|
450
|
+
}, (r) => a.getMonth(r)), o = w(() => {
|
|
451
451
|
const r = a.toJsDate(a.startOfWeek(a.date(), e.firstDayOfWeek)).getDay();
|
|
452
|
-
return a.getWeekdays(e.firstDayOfWeek, e.weekdayFormat).filter((m,
|
|
453
|
-
}),
|
|
454
|
-
const r = a.getWeekArray(i.value, e.firstDayOfWeek), m = r.flat(),
|
|
455
|
-
if (e.weeksInMonth === "static" && m.length <
|
|
456
|
-
const
|
|
452
|
+
return a.getWeekdays(e.firstDayOfWeek, e.weekdayFormat).filter((m, u) => e.weekdays.includes((u + r) % 7));
|
|
453
|
+
}), c = w(() => {
|
|
454
|
+
const r = a.getWeekArray(i.value, e.firstDayOfWeek), m = r.flat(), u = 42;
|
|
455
|
+
if (e.weeksInMonth === "static" && m.length < u) {
|
|
456
|
+
const V = m[m.length - 1];
|
|
457
457
|
let S = [];
|
|
458
|
-
for (let A = 1; A <=
|
|
459
|
-
S.push(a.addDays(
|
|
458
|
+
for (let A = 1; A <= u - m.length; A++)
|
|
459
|
+
S.push(a.addDays(V, A)), A % 7 === 0 && (r.push(S), S = []);
|
|
460
460
|
}
|
|
461
461
|
return r;
|
|
462
462
|
});
|
|
463
|
-
function
|
|
464
|
-
return r.filter((
|
|
465
|
-
const S = a.toISO(
|
|
463
|
+
function d(r, m) {
|
|
464
|
+
return r.filter((u) => e.weekdays.includes(a.toJsDate(u).getDay())).map((u, V) => {
|
|
465
|
+
const S = a.toISO(u), A = !a.isSameMonth(u, i.value), I = a.isSameDay(u, a.startOfMonth(i.value)), s = a.isSameDay(u, a.endOfMonth(i.value)), x = a.isSameDay(u, i.value), M = e.weekdays.length;
|
|
466
466
|
return {
|
|
467
|
-
date:
|
|
468
|
-
formatted: a.format(
|
|
467
|
+
date: u,
|
|
468
|
+
formatted: a.format(u, "keyboardDate"),
|
|
469
469
|
isAdjacent: A,
|
|
470
|
-
isDisabled: Y(
|
|
470
|
+
isDisabled: Y(u),
|
|
471
471
|
isEnd: s,
|
|
472
472
|
isHidden: A && !e.showAdjacentMonths,
|
|
473
473
|
isSame: x,
|
|
474
|
-
isSelected: l.value.some((
|
|
474
|
+
isSelected: l.value.some((_) => a.isSameDay(u, _)),
|
|
475
475
|
isStart: I,
|
|
476
|
-
isToday: a.isSameDay(
|
|
477
|
-
isWeekEnd:
|
|
478
|
-
isWeekStart:
|
|
476
|
+
isToday: a.isSameDay(u, m),
|
|
477
|
+
isWeekEnd: V % M === M - 1,
|
|
478
|
+
isWeekStart: V % M === 0,
|
|
479
479
|
isoDate: S,
|
|
480
|
-
localized: a.format(
|
|
481
|
-
month: a.getMonth(
|
|
482
|
-
year: a.getYear(
|
|
480
|
+
localized: a.format(u, "dayOfMonth"),
|
|
481
|
+
month: a.getMonth(u),
|
|
482
|
+
year: a.getYear(u)
|
|
483
483
|
};
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
const
|
|
486
|
+
const h = w(() => {
|
|
487
487
|
const r = a.startOfWeek(n.value, e.firstDayOfWeek), m = [];
|
|
488
|
-
for (let
|
|
489
|
-
m.push(a.addDays(r,
|
|
490
|
-
const
|
|
491
|
-
return
|
|
492
|
-
}),
|
|
493
|
-
const r =
|
|
494
|
-
return
|
|
495
|
-
}),
|
|
496
|
-
minDate:
|
|
488
|
+
for (let V = 0; V <= 6; V++)
|
|
489
|
+
m.push(a.addDays(r, V));
|
|
490
|
+
const u = a.date();
|
|
491
|
+
return d(m, u);
|
|
492
|
+
}), g = w(() => {
|
|
493
|
+
const r = c.value.flat(), m = a.date();
|
|
494
|
+
return d(r, m);
|
|
495
|
+
}), f = w(() => c.value.map((r) => r.length ? a.getWeek(r[0], e.firstDayOfWeek, e.firstDayOfYear) : null)), {
|
|
496
|
+
minDate: D,
|
|
497
497
|
maxDate: C
|
|
498
|
-
} =
|
|
498
|
+
} = be(e);
|
|
499
499
|
function Y(r) {
|
|
500
500
|
if (e.disabled) return !0;
|
|
501
501
|
const m = a.date(r);
|
|
502
|
-
return
|
|
502
|
+
return D.value && a.isBefore(a.endOfDay(m), D.value) || C.value && a.isAfter(m, C.value) ? !0 : Array.isArray(e.allowedDates) && e.allowedDates.length > 0 ? !e.allowedDates.some((u) => a.isSameDay(a.date(u), m)) : typeof e.allowedDates == "function" ? !e.allowedDates(m) : !1;
|
|
503
503
|
}
|
|
504
504
|
return {
|
|
505
505
|
displayValue: n,
|
|
506
|
-
daysInMonth:
|
|
507
|
-
daysInWeek:
|
|
508
|
-
genDays:
|
|
506
|
+
daysInMonth: g,
|
|
507
|
+
daysInWeek: h,
|
|
508
|
+
genDays: d,
|
|
509
509
|
model: l,
|
|
510
|
-
weeksInMonth:
|
|
511
|
-
weekdayLabels:
|
|
512
|
-
weekNumbers:
|
|
510
|
+
weeksInMonth: c,
|
|
511
|
+
weekdayLabels: o,
|
|
512
|
+
weekNumbers: f
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
const a =
|
|
515
|
+
function be(e) {
|
|
516
|
+
const a = ae(), l = w(() => {
|
|
517
517
|
if (!e.min) return null;
|
|
518
|
-
const
|
|
519
|
-
return a.isValid(
|
|
518
|
+
const o = a.date(e.min);
|
|
519
|
+
return a.isValid(o) ? o : null;
|
|
520
520
|
}), n = w(() => {
|
|
521
521
|
if (!e.max) return null;
|
|
522
|
-
const
|
|
523
|
-
return a.isValid(
|
|
522
|
+
const o = a.date(e.max);
|
|
523
|
+
return a.isValid(o) ? o : null;
|
|
524
524
|
});
|
|
525
|
-
function t(
|
|
526
|
-
return l.value && a.isBefore(
|
|
525
|
+
function t(o) {
|
|
526
|
+
return l.value && a.isBefore(o, l.value) ? l.value : n.value && a.isAfter(o, n.value) ? n.value : o;
|
|
527
527
|
}
|
|
528
|
-
function i(
|
|
529
|
-
return (!l.value || a.isAfter(
|
|
528
|
+
function i(o) {
|
|
529
|
+
return (!l.value || a.isAfter(o, l.value)) && (!n.value || a.isBefore(o, n.value));
|
|
530
530
|
}
|
|
531
531
|
return {
|
|
532
532
|
minDate: l,
|
|
@@ -535,7 +535,7 @@ function De(e) {
|
|
|
535
535
|
isInAllowedRange: i
|
|
536
536
|
};
|
|
537
537
|
}
|
|
538
|
-
const Ue =
|
|
538
|
+
const Ue = j({
|
|
539
539
|
color: String,
|
|
540
540
|
hideWeekdays: Boolean,
|
|
541
541
|
multiple: [Boolean, Number, String],
|
|
@@ -556,7 +556,7 @@ const Ue = U({
|
|
|
556
556
|
type: [Array, Function, Object, String],
|
|
557
557
|
default: () => null
|
|
558
558
|
},
|
|
559
|
-
...
|
|
559
|
+
...H(Pt(), ["displayValue"])
|
|
560
560
|
}, "VDatePickerMonth"), pe = K()({
|
|
561
561
|
name: "VDatePickerMonth",
|
|
562
562
|
props: Ue(),
|
|
@@ -573,57 +573,57 @@ const Ue = U({
|
|
|
573
573
|
const t = se(), {
|
|
574
574
|
t: i
|
|
575
575
|
} = oe(), {
|
|
576
|
-
daysInMonth:
|
|
577
|
-
model:
|
|
578
|
-
weekNumbers:
|
|
579
|
-
weekdayLabels:
|
|
580
|
-
} = wt(e),
|
|
581
|
-
e.multiple === "range" &&
|
|
576
|
+
daysInMonth: o,
|
|
577
|
+
model: c,
|
|
578
|
+
weekNumbers: d,
|
|
579
|
+
weekdayLabels: h
|
|
580
|
+
} = wt(e), g = ae(), f = le(), D = le(), C = le(!1), Y = z(() => C.value ? e.reverseTransition : e.transition);
|
|
581
|
+
e.multiple === "range" && c.value.length > 0 && (f.value = c.value[0], c.value.length > 1 && (D.value = c.value[c.value.length - 1]));
|
|
582
582
|
const r = w(() => {
|
|
583
583
|
const s = ["number", "string"].includes(typeof e.multiple) ? Number(e.multiple) : 1 / 0;
|
|
584
|
-
return
|
|
584
|
+
return c.value.length >= s;
|
|
585
585
|
});
|
|
586
|
-
ce(
|
|
587
|
-
x && (C.value =
|
|
586
|
+
ce(o, (s, x) => {
|
|
587
|
+
x && (C.value = g.isBefore(s[0].date, x[0].date));
|
|
588
588
|
});
|
|
589
589
|
function m(s) {
|
|
590
|
-
const x =
|
|
591
|
-
if (
|
|
592
|
-
|
|
593
|
-
else if (
|
|
594
|
-
|
|
590
|
+
const x = g.startOfDay(s);
|
|
591
|
+
if (c.value.length === 0 ? f.value = void 0 : c.value.length === 1 && (f.value = c.value[0], D.value = void 0), !f.value)
|
|
592
|
+
f.value = x, c.value = [f.value];
|
|
593
|
+
else if (D.value)
|
|
594
|
+
f.value = s, D.value = void 0, c.value = [f.value];
|
|
595
595
|
else {
|
|
596
|
-
if (
|
|
597
|
-
|
|
596
|
+
if (g.isSameDay(x, f.value)) {
|
|
597
|
+
f.value = void 0, c.value = [];
|
|
598
598
|
return;
|
|
599
|
-
} else
|
|
600
|
-
|
|
599
|
+
} else g.isBefore(x, f.value) ? (D.value = g.endOfDay(f.value), f.value = x) : D.value = g.endOfDay(x);
|
|
600
|
+
c.value = Ne(g, f.value, D.value);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
const x =
|
|
603
|
+
function u(s) {
|
|
604
|
+
const x = g.format(s.date, "fullDateWithWeekday"), M = s.isToday ? "currentDate" : "selectDate";
|
|
605
605
|
return i(`$vuetify.datePicker.ariaLabel.${M}`, x);
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
const x =
|
|
607
|
+
function V(s) {
|
|
608
|
+
const x = c.value.findIndex((M) => g.isSameDay(M, s));
|
|
609
609
|
if (x === -1)
|
|
610
|
-
|
|
610
|
+
c.value = [...c.value, s];
|
|
611
611
|
else {
|
|
612
|
-
const M = [...
|
|
613
|
-
M.splice(x, 1),
|
|
612
|
+
const M = [...c.value];
|
|
613
|
+
M.splice(x, 1), c.value = M;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
function S(s) {
|
|
617
|
-
e.multiple === "range" ? m(s) : e.multiple ?
|
|
617
|
+
e.multiple === "range" ? m(s) : e.multiple ? V(s) : c.value = [s];
|
|
618
618
|
}
|
|
619
619
|
function A(s) {
|
|
620
620
|
const {
|
|
621
621
|
events: x,
|
|
622
622
|
eventColor: M
|
|
623
623
|
} = e;
|
|
624
|
-
let
|
|
625
|
-
if (Array.isArray(x) ?
|
|
626
|
-
|
|
624
|
+
let _, W = [];
|
|
625
|
+
if (Array.isArray(x) ? _ = x.includes(s) : x instanceof Function ? _ = x(s) || !1 : x ? _ = x[s] || !1 : _ = !1, _)
|
|
626
|
+
_ !== !0 ? W = te(_) : typeof M == "string" ? W = [M] : typeof M == "function" ? W = te(M(s)) : Array.isArray(M) ? W = M : typeof M == "object" && M !== null && (W = te(M[s]));
|
|
627
627
|
else return [];
|
|
628
628
|
return W.length ? W.filter(Boolean).map((q) => typeof q == "string" ? q : "surface-variant") : ["surface-variant"];
|
|
629
629
|
}
|
|
@@ -631,7 +631,7 @@ const Ue = U({
|
|
|
631
631
|
const x = A(s);
|
|
632
632
|
return x.length ? P("div", {
|
|
633
633
|
class: "v-date-picker-month__events"
|
|
634
|
-
}, [x.map((M) =>
|
|
634
|
+
}, [x.map((M) => b(yt, {
|
|
635
635
|
dot: !0,
|
|
636
636
|
color: M
|
|
637
637
|
}, null))]) : null;
|
|
@@ -647,18 +647,18 @@ const Ue = U({
|
|
|
647
647
|
}, [!e.hideWeekdays && P("div", {
|
|
648
648
|
key: "hide-week-days",
|
|
649
649
|
class: "v-date-picker-month__day"
|
|
650
|
-
}, [qe(" ")]),
|
|
651
|
-
class:
|
|
652
|
-
}, [s]))]),
|
|
650
|
+
}, [qe(" ")]), d.value.map((s) => P("div", {
|
|
651
|
+
class: ie(["v-date-picker-month__day", "v-date-picker-month__day--adjacent"])
|
|
652
|
+
}, [s]))]), b(Be, {
|
|
653
653
|
name: Y.value
|
|
654
654
|
}, {
|
|
655
655
|
default: () => [P("div", {
|
|
656
656
|
ref: t,
|
|
657
|
-
key:
|
|
657
|
+
key: o.value[0].date?.toString(),
|
|
658
658
|
class: "v-date-picker-month__days"
|
|
659
|
-
}, [!e.hideWeekdays &&
|
|
660
|
-
class:
|
|
661
|
-
}, [s])),
|
|
659
|
+
}, [!e.hideWeekdays && h.value.map((s) => P("div", {
|
|
660
|
+
class: ie(["v-date-picker-month__day", "v-date-picker-month__weekday"])
|
|
661
|
+
}, [s])), o.value.map((s, x) => {
|
|
662
662
|
const M = {
|
|
663
663
|
props: {
|
|
664
664
|
class: "v-date-picker-month__day-btn",
|
|
@@ -667,7 +667,7 @@ const Ue = U({
|
|
|
667
667
|
icon: !0,
|
|
668
668
|
ripple: !1,
|
|
669
669
|
variant: s.isSelected ? "flat" : s.isToday ? "outlined" : "text",
|
|
670
|
-
"aria-label":
|
|
670
|
+
"aria-label": u(s),
|
|
671
671
|
"aria-current": s.isToday ? "date" : void 0,
|
|
672
672
|
onClick: () => S(s.date)
|
|
673
673
|
},
|
|
@@ -675,7 +675,7 @@ const Ue = U({
|
|
|
675
675
|
i: x
|
|
676
676
|
};
|
|
677
677
|
return r.value && !s.isSelected && (s.isDisabled = !0), P("div", {
|
|
678
|
-
class:
|
|
678
|
+
class: ie(["v-date-picker-month__day", {
|
|
679
679
|
"v-date-picker-month__day--adjacent": s.isAdjacent,
|
|
680
680
|
"v-date-picker-month__day--hide-adjacent": s.isHidden,
|
|
681
681
|
"v-date-picker-month__day--selected": s.isSelected,
|
|
@@ -683,13 +683,13 @@ const Ue = U({
|
|
|
683
683
|
"v-date-picker-month__day--week-start": s.isWeekStart
|
|
684
684
|
}]),
|
|
685
685
|
"data-v-date": s.isDisabled ? void 0 : s.isoDate
|
|
686
|
-
}, [(e.showAdjacentMonths || !s.isAdjacent) && (n.day?.(M) ??
|
|
686
|
+
}, [(e.showAdjacentMonths || !s.isAdjacent) && (n.day?.(M) ?? b(F, M.props, {
|
|
687
687
|
default: () => [s.localized, I(s.isoDate)]
|
|
688
688
|
}))]);
|
|
689
689
|
})])]
|
|
690
690
|
})]));
|
|
691
691
|
}
|
|
692
|
-
}), He =
|
|
692
|
+
}), He = j({
|
|
693
693
|
color: String,
|
|
694
694
|
height: [String, Number],
|
|
695
695
|
min: null,
|
|
@@ -708,23 +708,23 @@ const Ue = U({
|
|
|
708
708
|
emit: l,
|
|
709
709
|
slots: n
|
|
710
710
|
} = a;
|
|
711
|
-
const t =
|
|
712
|
-
let
|
|
713
|
-
return e.year && (
|
|
714
|
-
const
|
|
715
|
-
return
|
|
716
|
-
isDisabled:
|
|
717
|
-
text:
|
|
718
|
-
label:
|
|
719
|
-
value:
|
|
711
|
+
const t = ae(), i = L(e, "modelValue"), o = w(() => {
|
|
712
|
+
let d = t.startOfYear(t.date());
|
|
713
|
+
return e.year && (d = t.setYear(d, e.year)), We(12).map((h) => {
|
|
714
|
+
const g = t.format(d, "monthShort"), f = t.format(d, "month"), D = !!(!c(h) || e.min && t.isAfter(t.startOfMonth(t.date(e.min)), d) || e.max && t.isAfter(d, t.startOfMonth(t.date(e.max))));
|
|
715
|
+
return d = t.getNextMonth(d), {
|
|
716
|
+
isDisabled: D,
|
|
717
|
+
text: g,
|
|
718
|
+
label: f,
|
|
719
|
+
value: h
|
|
720
720
|
};
|
|
721
721
|
});
|
|
722
722
|
});
|
|
723
723
|
ge(() => {
|
|
724
724
|
i.value = i.value ?? t.getMonth(t.date());
|
|
725
725
|
});
|
|
726
|
-
function d
|
|
727
|
-
return Array.isArray(e.allowedMonths) && e.allowedMonths.length ? e.allowedMonths.includes(
|
|
726
|
+
function c(d) {
|
|
727
|
+
return Array.isArray(e.allowedMonths) && e.allowedMonths.length ? e.allowedMonths.includes(d) : typeof e.allowedMonths == "function" ? e.allowedMonths(d) : !0;
|
|
728
728
|
}
|
|
729
729
|
return Z(() => P("div", {
|
|
730
730
|
class: "v-date-picker-months",
|
|
@@ -733,34 +733,34 @@ const Ue = U({
|
|
|
733
733
|
}
|
|
734
734
|
}, [P("div", {
|
|
735
735
|
class: "v-date-picker-months__content"
|
|
736
|
-
}, [
|
|
737
|
-
const
|
|
738
|
-
active: i.value ===
|
|
739
|
-
ariaLabel:
|
|
740
|
-
color: i.value ===
|
|
741
|
-
disabled:
|
|
736
|
+
}, [o.value.map((d, h) => {
|
|
737
|
+
const g = {
|
|
738
|
+
active: i.value === h,
|
|
739
|
+
ariaLabel: d.label,
|
|
740
|
+
color: i.value === h ? e.color : void 0,
|
|
741
|
+
disabled: d.isDisabled,
|
|
742
742
|
rounded: !0,
|
|
743
|
-
text:
|
|
744
|
-
variant: i.value ===
|
|
745
|
-
onClick: () =>
|
|
743
|
+
text: d.text,
|
|
744
|
+
variant: i.value === d.value ? "flat" : "text",
|
|
745
|
+
onClick: () => f(h)
|
|
746
746
|
};
|
|
747
|
-
function
|
|
748
|
-
if (i.value ===
|
|
747
|
+
function f(D) {
|
|
748
|
+
if (i.value === D) {
|
|
749
749
|
l("update:modelValue", i.value);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
i.value =
|
|
752
|
+
i.value = D;
|
|
753
753
|
}
|
|
754
754
|
return n.month?.({
|
|
755
|
-
month:
|
|
756
|
-
i:
|
|
757
|
-
props:
|
|
758
|
-
}) ??
|
|
755
|
+
month: d,
|
|
756
|
+
i: h,
|
|
757
|
+
props: g
|
|
758
|
+
}) ?? b(F, B({
|
|
759
759
|
key: "month"
|
|
760
|
-
},
|
|
760
|
+
}, g), null);
|
|
761
761
|
})])])), {};
|
|
762
762
|
}
|
|
763
|
-
}), Je =
|
|
763
|
+
}), Je = j({
|
|
764
764
|
color: String,
|
|
765
765
|
height: [String, Number],
|
|
766
766
|
min: null,
|
|
@@ -781,17 +781,17 @@ const Ue = U({
|
|
|
781
781
|
emit: l,
|
|
782
782
|
slots: n
|
|
783
783
|
} = a;
|
|
784
|
-
const t =
|
|
784
|
+
const t = ae(), i = L(e, "modelValue"), o = le(!1), c = w(() => {
|
|
785
785
|
const f = t.getYear(t.date());
|
|
786
|
-
let
|
|
787
|
-
e.min && (
|
|
788
|
-
let
|
|
789
|
-
return
|
|
790
|
-
const
|
|
791
|
-
return
|
|
792
|
-
text:
|
|
793
|
-
value:
|
|
794
|
-
isDisabled: !
|
|
786
|
+
let D = f - 100, C = f + 52;
|
|
787
|
+
e.min && (D = t.getYear(t.date(e.min))), e.max && (C = t.getYear(t.date(e.max)));
|
|
788
|
+
let Y = t.startOfYear(t.date());
|
|
789
|
+
return Y = t.setYear(Y, D), We(C - D + 1, D).map((r) => {
|
|
790
|
+
const m = t.format(Y, "year");
|
|
791
|
+
return Y = t.setYear(Y, t.getYear(Y) + 1), {
|
|
792
|
+
text: m,
|
|
793
|
+
value: r,
|
|
794
|
+
isDisabled: !g(r)
|
|
795
795
|
};
|
|
796
796
|
});
|
|
797
797
|
});
|
|
@@ -799,23 +799,27 @@ const Ue = U({
|
|
|
799
799
|
i.value = i.value ?? t.getYear(t.date());
|
|
800
800
|
});
|
|
801
801
|
const d = rt();
|
|
802
|
-
function
|
|
803
|
-
d.el?.
|
|
802
|
+
function h() {
|
|
803
|
+
d.el?.scrollIntoView({
|
|
804
804
|
block: "center"
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function g(f) {
|
|
808
808
|
return Array.isArray(e.allowedYears) && e.allowedYears.length ? e.allowedYears.includes(f) : typeof e.allowedYears == "function" ? e.allowedYears(f) : !0;
|
|
809
809
|
}
|
|
810
|
-
return Z(() =>
|
|
810
|
+
return Z(() => Xe(P("div", {
|
|
811
811
|
class: "v-date-picker-years",
|
|
812
812
|
style: {
|
|
813
813
|
height: ve(e.height)
|
|
814
814
|
}
|
|
815
815
|
}, [P("div", {
|
|
816
|
-
class: "v-date-picker-years__content"
|
|
817
|
-
|
|
818
|
-
|
|
816
|
+
class: "v-date-picker-years__content",
|
|
817
|
+
onFocus: () => d.el?.focus(),
|
|
818
|
+
onFocusin: () => o.value = !0,
|
|
819
|
+
onFocusout: () => o.value = !1,
|
|
820
|
+
tabindex: o.value ? -1 : 0
|
|
821
|
+
}, [c.value.map((f, D) => {
|
|
822
|
+
const C = {
|
|
819
823
|
ref: i.value === f.value ? d : void 0,
|
|
820
824
|
active: i.value === f.value,
|
|
821
825
|
color: i.value === f.value ? e.color : void 0,
|
|
@@ -833,18 +837,18 @@ const Ue = U({
|
|
|
833
837
|
};
|
|
834
838
|
return n.year?.({
|
|
835
839
|
year: f,
|
|
836
|
-
i:
|
|
837
|
-
props:
|
|
838
|
-
}) ??
|
|
840
|
+
i: D,
|
|
841
|
+
props: C
|
|
842
|
+
}) ?? b(F, B({
|
|
839
843
|
key: "month"
|
|
840
|
-
},
|
|
844
|
+
}, C), null);
|
|
841
845
|
})])]), [[xe, {
|
|
842
|
-
handler:
|
|
846
|
+
handler: h
|
|
843
847
|
}, null, {
|
|
844
848
|
once: !0
|
|
845
849
|
}]])), {};
|
|
846
850
|
}
|
|
847
|
-
}), ze =
|
|
851
|
+
}), ze = j({
|
|
848
852
|
// TODO: implement in v3.5
|
|
849
853
|
// calendarIcon: {
|
|
850
854
|
// type: String,
|
|
@@ -876,13 +880,13 @@ const Ue = U({
|
|
|
876
880
|
default: "normalDateWithWeekday"
|
|
877
881
|
},
|
|
878
882
|
landscapeHeaderWidth: [Number, String],
|
|
879
|
-
...
|
|
883
|
+
...H(je(), ["active", "monthText", "yearText"]),
|
|
880
884
|
...Ue({
|
|
881
885
|
weeksInMonth: "static"
|
|
882
886
|
}),
|
|
883
|
-
...
|
|
884
|
-
...
|
|
885
|
-
...
|
|
887
|
+
...H(He(), ["modelValue"]),
|
|
888
|
+
...H(Je(), ["modelValue"]),
|
|
889
|
+
...Le({
|
|
886
890
|
title: "$vuetify.datePicker.title"
|
|
887
891
|
}),
|
|
888
892
|
modelValue: null
|
|
@@ -901,135 +905,135 @@ const Ue = U({
|
|
|
901
905
|
emit: l,
|
|
902
906
|
slots: n
|
|
903
907
|
} = a;
|
|
904
|
-
const t =
|
|
908
|
+
const t = ae(), {
|
|
905
909
|
t: i
|
|
906
910
|
} = oe(), {
|
|
907
|
-
rtlClasses:
|
|
908
|
-
} = it(),
|
|
909
|
-
minDate:
|
|
910
|
-
maxDate:
|
|
911
|
-
clampDate:
|
|
912
|
-
} =
|
|
913
|
-
const v = t.date(),
|
|
914
|
-
return
|
|
915
|
-
}), C = z(() => e.headerColor ?? e.color), Y =
|
|
916
|
-
get: () => Number(Y.value ?? t.getMonth(t.startOfMonth(
|
|
911
|
+
rtlClasses: o
|
|
912
|
+
} = it(), c = L(e, "modelValue", void 0, (v) => te(v).map((k) => t.date(k)), (v) => e.multiple ? v : v[0]), d = L(e, "viewMode"), {
|
|
913
|
+
minDate: h,
|
|
914
|
+
maxDate: g,
|
|
915
|
+
clampDate: f
|
|
916
|
+
} = be(e), D = w(() => {
|
|
917
|
+
const v = t.date(), k = c.value?.[0] ? t.date(c.value[0]) : f(v);
|
|
918
|
+
return k && t.isValid(k) ? k : v;
|
|
919
|
+
}), C = z(() => e.headerColor ?? e.color), Y = L(e, "month"), r = w({
|
|
920
|
+
get: () => Number(Y.value ?? t.getMonth(t.startOfMonth(D.value))),
|
|
917
921
|
set: (v) => Y.value = v
|
|
918
|
-
}), m =
|
|
919
|
-
get: () => Number(m.value ?? t.getYear(t.startOfYear(t.setMonth(
|
|
922
|
+
}), m = L(e, "year"), u = w({
|
|
923
|
+
get: () => Number(m.value ?? t.getYear(t.startOfYear(t.setMonth(D.value, r.value)))),
|
|
920
924
|
set: (v) => m.value = v
|
|
921
|
-
}),
|
|
922
|
-
if (e.multiple &&
|
|
923
|
-
return i("$vuetify.datePicker.itemsSelected",
|
|
924
|
-
const v =
|
|
925
|
+
}), V = le(!1), S = w(() => {
|
|
926
|
+
if (e.multiple && c.value.length > 1)
|
|
927
|
+
return i("$vuetify.datePicker.itemsSelected", c.value.length);
|
|
928
|
+
const v = c.value[0] && t.isValid(c.value[0]) ? t.format(t.date(c.value[0]), e.headerDateFormat) : i(e.header);
|
|
925
929
|
return e.landscape && v.split(" ").length === 3 ? v.replace(" ", `
|
|
926
930
|
`) : v;
|
|
927
931
|
}), A = z(() => {
|
|
928
932
|
let v = t.date();
|
|
929
|
-
return v = t.setDate(v, 1), v = t.setMonth(v, r.value), v = t.setYear(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${
|
|
933
|
+
return v = t.setDate(v, 1), v = t.setMonth(v, r.value), v = t.setYear(v, u.value), v;
|
|
934
|
+
}), 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${V.value ? "-reverse" : ""}-transition`), _ = w(() => {
|
|
931
935
|
if (e.disabled) return !0;
|
|
932
936
|
const v = [];
|
|
933
|
-
if (
|
|
937
|
+
if (d.value !== "month")
|
|
934
938
|
v.push("prev-month", "next-month", "prev-year", "next-year");
|
|
935
939
|
else {
|
|
936
|
-
let
|
|
937
|
-
if (
|
|
938
|
-
const O = t.addDays(t.startOfMonth(
|
|
939
|
-
t.isAfter(
|
|
940
|
+
let k = t.date();
|
|
941
|
+
if (k = t.startOfMonth(k), k = t.setMonth(k, r.value), k = t.setYear(k, u.value), h.value) {
|
|
942
|
+
const O = t.addDays(t.startOfMonth(k), -1), N = t.addDays(t.startOfYear(k), -1);
|
|
943
|
+
t.isAfter(h.value, O) && v.push("prev-month"), t.isAfter(h.value, N) && v.push("prev-year");
|
|
940
944
|
}
|
|
941
|
-
if (
|
|
942
|
-
const O = t.addDays(t.endOfMonth(
|
|
943
|
-
t.isAfter(O,
|
|
945
|
+
if (g.value) {
|
|
946
|
+
const O = t.addDays(t.endOfMonth(k), 1), N = t.addDays(t.endOfYear(k), 1);
|
|
947
|
+
t.isAfter(O, g.value) && v.push("next-month"), t.isAfter(N, g.value) && v.push("next-year");
|
|
944
948
|
}
|
|
945
949
|
}
|
|
946
950
|
return v;
|
|
947
951
|
}), W = w(() => e.allowedYears || me), q = w(() => e.allowedMonths || ye);
|
|
948
|
-
function
|
|
952
|
+
function ne(v, k) {
|
|
949
953
|
const O = e.allowedDates;
|
|
950
954
|
if (typeof O != "function") return !0;
|
|
951
|
-
const N = 1 + Ee(t, v,
|
|
952
|
-
for (let
|
|
953
|
-
if (O(t.addDays(v,
|
|
955
|
+
const N = 1 + Ee(t, v, k);
|
|
956
|
+
for (let U = 0; U < N; U++)
|
|
957
|
+
if (O(t.addDays(v, U))) return !0;
|
|
954
958
|
return !1;
|
|
955
959
|
}
|
|
956
960
|
function me(v) {
|
|
957
961
|
if (typeof e.allowedDates == "function") {
|
|
958
|
-
const
|
|
959
|
-
return
|
|
962
|
+
const k = t.parseISO(`${v}-01-01`);
|
|
963
|
+
return ne(k, t.endOfYear(k));
|
|
960
964
|
}
|
|
961
965
|
if (Array.isArray(e.allowedDates) && e.allowedDates.length) {
|
|
962
|
-
for (const
|
|
963
|
-
if (t.getYear(t.date(
|
|
966
|
+
for (const k of e.allowedDates)
|
|
967
|
+
if (t.getYear(t.date(k)) === v) return !0;
|
|
964
968
|
return !1;
|
|
965
969
|
}
|
|
966
970
|
return !0;
|
|
967
971
|
}
|
|
968
972
|
function ye(v) {
|
|
969
973
|
if (typeof e.allowedDates == "function") {
|
|
970
|
-
const
|
|
971
|
-
return
|
|
974
|
+
const k = String(v + 1).padStart(2, "0"), O = t.parseISO(`${u.value}-${k}-01`);
|
|
975
|
+
return ne(O, t.endOfMonth(O));
|
|
972
976
|
}
|
|
973
977
|
if (Array.isArray(e.allowedDates) && e.allowedDates.length) {
|
|
974
|
-
for (const
|
|
975
|
-
if (t.getYear(t.date(
|
|
978
|
+
for (const k of e.allowedDates)
|
|
979
|
+
if (t.getYear(t.date(k)) === u.value && t.getMonth(t.date(k)) === v) return !0;
|
|
976
980
|
return !1;
|
|
977
981
|
}
|
|
978
982
|
return !0;
|
|
979
983
|
}
|
|
980
984
|
function he() {
|
|
981
|
-
r.value < 11 ? r.value++ : (
|
|
985
|
+
r.value < 11 ? r.value++ : (u.value++, r.value = 0, p()), J();
|
|
982
986
|
}
|
|
983
987
|
function ke() {
|
|
984
|
-
r.value > 0 ? r.value-- : (
|
|
988
|
+
r.value > 0 ? r.value-- : (u.value--, r.value = 11, p()), J();
|
|
985
989
|
}
|
|
986
990
|
function ue() {
|
|
987
|
-
if (
|
|
988
|
-
const v = String(r.value + 1).padStart(2, "0"),
|
|
989
|
-
t.isAfter(
|
|
991
|
+
if (u.value++, g.value) {
|
|
992
|
+
const v = String(r.value + 1).padStart(2, "0"), k = t.parseISO(`${u.value}-${v}-01`);
|
|
993
|
+
t.isAfter(k, g.value) && (r.value = t.getMonth(g.value));
|
|
990
994
|
}
|
|
991
|
-
|
|
995
|
+
p();
|
|
992
996
|
}
|
|
993
|
-
function
|
|
994
|
-
if (
|
|
995
|
-
const v = String(r.value + 1).padStart(2, "0"),
|
|
996
|
-
t.isAfter(
|
|
997
|
+
function y() {
|
|
998
|
+
if (u.value--, h.value) {
|
|
999
|
+
const v = String(r.value + 1).padStart(2, "0"), k = t.endOfMonth(t.parseISO(`${u.value}-${v}-01`));
|
|
1000
|
+
t.isAfter(h.value, k) && (r.value = t.getMonth(h.value));
|
|
997
1001
|
}
|
|
998
|
-
|
|
1002
|
+
p();
|
|
999
1003
|
}
|
|
1000
1004
|
function T() {
|
|
1001
|
-
|
|
1005
|
+
d.value = "month";
|
|
1002
1006
|
}
|
|
1003
|
-
function
|
|
1004
|
-
|
|
1007
|
+
function R() {
|
|
1008
|
+
d.value = d.value === "months" ? "month" : "months";
|
|
1005
1009
|
}
|
|
1006
|
-
function
|
|
1007
|
-
|
|
1010
|
+
function re() {
|
|
1011
|
+
d.value = d.value === "year" ? "month" : "year";
|
|
1008
1012
|
}
|
|
1009
|
-
function
|
|
1010
|
-
|
|
1013
|
+
function J() {
|
|
1014
|
+
d.value === "months" && R();
|
|
1011
1015
|
}
|
|
1012
|
-
function
|
|
1013
|
-
|
|
1016
|
+
function p() {
|
|
1017
|
+
d.value === "year" && re();
|
|
1014
1018
|
}
|
|
1015
|
-
return ce(
|
|
1016
|
-
const O =
|
|
1019
|
+
return ce(c, (v, k) => {
|
|
1020
|
+
const O = te(k), N = te(v);
|
|
1017
1021
|
if (!N.length) return;
|
|
1018
|
-
const
|
|
1019
|
-
if (t.isSameDay(
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
+
const U = t.date(O[O.length - 1]), X = t.date(N[N.length - 1]);
|
|
1023
|
+
if (t.isSameDay(U, X)) return;
|
|
1024
|
+
const $ = t.getMonth(X), E = t.getYear(X);
|
|
1025
|
+
$ !== r.value && (r.value = $, J()), E !== u.value && (u.value = E, p()), V.value = t.isBefore(U, X);
|
|
1022
1026
|
}), Z(() => {
|
|
1023
|
-
const v = Me.filterProps(e),
|
|
1027
|
+
const v = Me.filterProps(e), k = H(Ae.filterProps(e), ["viewMode"]), O = Ye.filterProps(e), N = pe.filterProps(e), U = H(_e.filterProps(e), ["modelValue"]), X = H(Ie.filterProps(e), ["modelValue"]), $ = {
|
|
1024
1028
|
color: C.value,
|
|
1025
1029
|
header: S.value,
|
|
1026
1030
|
transition: M.value
|
|
1027
1031
|
};
|
|
1028
|
-
return
|
|
1032
|
+
return b(Me, B(v, {
|
|
1029
1033
|
color: C.value,
|
|
1030
|
-
class: ["v-date-picker", `v-date-picker--${
|
|
1034
|
+
class: ["v-date-picker", `v-date-picker--${d.value}`, {
|
|
1031
1035
|
"v-date-picker--show-week": e.showWeek
|
|
1032
|
-
},
|
|
1036
|
+
}, o.value, e.class],
|
|
1033
1037
|
style: [{
|
|
1034
1038
|
"--v-date-picker-landscape-header-width": ve(e.landscapeHeaderWidth)
|
|
1035
1039
|
}, e.style]
|
|
@@ -1037,71 +1041,71 @@ const Ue = U({
|
|
|
1037
1041
|
title: () => n.title?.() ?? P("div", {
|
|
1038
1042
|
class: "v-date-picker__title"
|
|
1039
1043
|
}, [i(e.title)]),
|
|
1040
|
-
header: () => n.header ?
|
|
1044
|
+
header: () => n.header ? b(fe, {
|
|
1041
1045
|
defaults: {
|
|
1042
1046
|
VDatePickerHeader: {
|
|
1043
|
-
|
|
1047
|
+
...$
|
|
1044
1048
|
}
|
|
1045
1049
|
}
|
|
1046
1050
|
}, {
|
|
1047
|
-
default: () => [n.header?.(
|
|
1048
|
-
}) :
|
|
1051
|
+
default: () => [n.header?.($)]
|
|
1052
|
+
}) : b(Ye, B({
|
|
1049
1053
|
key: "header"
|
|
1050
|
-
}, O,
|
|
1051
|
-
onClick:
|
|
1054
|
+
}, O, $, {
|
|
1055
|
+
onClick: d.value !== "month" ? T : void 0
|
|
1052
1056
|
}), {
|
|
1053
1057
|
prepend: n.prepend,
|
|
1054
1058
|
append: n.append
|
|
1055
1059
|
}),
|
|
1056
|
-
default: () => P(Q, null, [
|
|
1057
|
-
disabled:
|
|
1058
|
-
viewMode:
|
|
1060
|
+
default: () => P(Q, null, [b(Ae, B(k, {
|
|
1061
|
+
disabled: _.value,
|
|
1062
|
+
viewMode: d.value,
|
|
1059
1063
|
text: I.value,
|
|
1060
1064
|
monthText: s.value,
|
|
1061
1065
|
yearText: x.value,
|
|
1062
1066
|
"onClick:next": he,
|
|
1063
1067
|
"onClick:prev": ke,
|
|
1064
1068
|
"onClick:nextYear": ue,
|
|
1065
|
-
"onClick:prevYear":
|
|
1066
|
-
"onClick:month":
|
|
1067
|
-
"onClick:year":
|
|
1069
|
+
"onClick:prevYear": y,
|
|
1070
|
+
"onClick:month": R,
|
|
1071
|
+
"onClick:year": re
|
|
1068
1072
|
}), {
|
|
1069
1073
|
default: n.controls
|
|
1070
|
-
}),
|
|
1074
|
+
}), b(ot, {
|
|
1071
1075
|
hideOnLeave: !0
|
|
1072
1076
|
}, {
|
|
1073
|
-
default: () => [
|
|
1077
|
+
default: () => [d.value === "months" ? b(_e, B({
|
|
1074
1078
|
key: "date-picker-months"
|
|
1075
|
-
},
|
|
1079
|
+
}, U, {
|
|
1076
1080
|
modelValue: r.value,
|
|
1077
|
-
"onUpdate:modelValue": [(E) => r.value = E,
|
|
1078
|
-
min:
|
|
1079
|
-
max:
|
|
1080
|
-
year:
|
|
1081
|
+
"onUpdate:modelValue": [(E) => r.value = E, J],
|
|
1082
|
+
min: h.value,
|
|
1083
|
+
max: g.value,
|
|
1084
|
+
year: u.value,
|
|
1081
1085
|
allowedMonths: q.value
|
|
1082
1086
|
}), {
|
|
1083
1087
|
month: n.month
|
|
1084
|
-
}) :
|
|
1088
|
+
}) : d.value === "year" ? b(Ie, B({
|
|
1085
1089
|
key: "date-picker-years"
|
|
1086
|
-
},
|
|
1087
|
-
modelValue:
|
|
1088
|
-
"onUpdate:modelValue": [(E) =>
|
|
1089
|
-
min:
|
|
1090
|
-
max:
|
|
1090
|
+
}, X, {
|
|
1091
|
+
modelValue: u.value,
|
|
1092
|
+
"onUpdate:modelValue": [(E) => u.value = E, p],
|
|
1093
|
+
min: h.value,
|
|
1094
|
+
max: g.value,
|
|
1091
1095
|
allowedYears: W.value
|
|
1092
1096
|
}), {
|
|
1093
1097
|
year: n.year
|
|
1094
|
-
}) :
|
|
1098
|
+
}) : b(pe, B({
|
|
1095
1099
|
key: "date-picker-month"
|
|
1096
1100
|
}, N, {
|
|
1097
|
-
modelValue:
|
|
1098
|
-
"onUpdate:modelValue": (E) =>
|
|
1101
|
+
modelValue: c.value,
|
|
1102
|
+
"onUpdate:modelValue": (E) => c.value = E,
|
|
1099
1103
|
month: r.value,
|
|
1100
|
-
"onUpdate:month": [(E) => r.value = E,
|
|
1101
|
-
year:
|
|
1102
|
-
"onUpdate:year": [(E) =>
|
|
1103
|
-
min:
|
|
1104
|
-
max:
|
|
1104
|
+
"onUpdate:month": [(E) => r.value = E, J],
|
|
1105
|
+
year: u.value,
|
|
1106
|
+
"onUpdate:year": [(E) => u.value = E, p],
|
|
1107
|
+
min: h.value,
|
|
1108
|
+
max: g.value
|
|
1105
1109
|
}), {
|
|
1106
1110
|
day: n.day
|
|
1107
1111
|
})]
|
|
@@ -1111,7 +1115,7 @@ const Ue = U({
|
|
|
1111
1115
|
}), {};
|
|
1112
1116
|
}
|
|
1113
1117
|
});
|
|
1114
|
-
class
|
|
1118
|
+
class ee {
|
|
1115
1119
|
constructor(a, l) {
|
|
1116
1120
|
this.order = a, this.separator = l;
|
|
1117
1121
|
}
|
|
@@ -1124,81 +1128,81 @@ class X {
|
|
|
1124
1128
|
return ["y", "m", "d"].every((n) => l.includes(n)) && ["/", "-", "."].some((n) => a.includes(n));
|
|
1125
1129
|
}
|
|
1126
1130
|
static parse(a) {
|
|
1127
|
-
if (!
|
|
1131
|
+
if (!ee.canBeParsed(a))
|
|
1128
1132
|
throw new Error(`[${a}] cannot be parsed into date format specification`);
|
|
1129
|
-
const l = a.toLowerCase().split("").filter((t, i,
|
|
1130
|
-
return new
|
|
1133
|
+
const l = a.toLowerCase().split("").filter((t, i, o) => "dmy".includes(t) && o.indexOf(t) === i).join(""), n = ["/", "-", "."].find((t) => a.includes(t));
|
|
1134
|
+
return new ee(l, n);
|
|
1131
1135
|
}
|
|
1132
1136
|
}
|
|
1133
|
-
const Mt =
|
|
1137
|
+
const Mt = j({
|
|
1134
1138
|
inputFormat: {
|
|
1135
1139
|
type: String,
|
|
1136
|
-
validator: (e) => !e ||
|
|
1140
|
+
validator: (e) => !e || ee.canBeParsed(e)
|
|
1137
1141
|
}
|
|
1138
1142
|
}, "date-format");
|
|
1139
1143
|
function St(e, a) {
|
|
1140
|
-
const l =
|
|
1144
|
+
const l = ae();
|
|
1141
1145
|
function n() {
|
|
1142
|
-
const
|
|
1146
|
+
const d = a.value ?? "en-US", h = Intl.DateTimeFormat(d, {
|
|
1143
1147
|
year: "numeric",
|
|
1144
1148
|
month: "2-digit",
|
|
1145
1149
|
day: "2-digit"
|
|
1146
1150
|
}).format(l.toJsDate(l.parseISO("1999-12-07"))).replace(/(07)|(٠٧)|(٢٩)|(۱۶)|(০৭)/, "dd").replace(/(12)|(١٢)|(٠٨)|(۰۹)|(১২)/, "mm").replace(/(1999)|(2542)|(١٩٩٩)|(١٤٢٠)|(۱۳۷۸)|(১৯৯৯)/, "yyyy").replace(/[^ymd\-/.]/g, "").replace(/\.$/, "");
|
|
1147
|
-
return
|
|
1151
|
+
return ee.canBeParsed(h) ? h : (ut(`Date format inferred from locale [${d}] is invalid: [${h}]`), "mm/dd/yyyy");
|
|
1148
1152
|
}
|
|
1149
|
-
const t = z(() =>
|
|
1150
|
-
function i(
|
|
1151
|
-
function
|
|
1152
|
-
const S =
|
|
1153
|
+
const t = z(() => ee.canBeParsed(e.inputFormat) ? ee.parse(e.inputFormat) : ee.parse(n()));
|
|
1154
|
+
function i(d) {
|
|
1155
|
+
function h(V) {
|
|
1156
|
+
const S = V.trim().split(t.value.separator);
|
|
1153
1157
|
return {
|
|
1154
1158
|
y: Number(S[t.value.order.indexOf("y")]),
|
|
1155
1159
|
m: Number(S[t.value.order.indexOf("m")]),
|
|
1156
1160
|
d: Number(S[t.value.order.indexOf("d")])
|
|
1157
1161
|
};
|
|
1158
1162
|
}
|
|
1159
|
-
function
|
|
1163
|
+
function g(V) {
|
|
1160
1164
|
const {
|
|
1161
1165
|
y: S,
|
|
1162
1166
|
m: A,
|
|
1163
1167
|
d: I
|
|
1164
|
-
} =
|
|
1168
|
+
} = V;
|
|
1165
1169
|
return !S || !A || !I || A < 1 || A > 12 || I < 1 || I > 31 ? null : {
|
|
1166
|
-
year:
|
|
1170
|
+
year: f(S),
|
|
1167
1171
|
month: A,
|
|
1168
1172
|
day: I
|
|
1169
1173
|
};
|
|
1170
1174
|
}
|
|
1171
|
-
function
|
|
1175
|
+
function f(V) {
|
|
1172
1176
|
const S = l.getYear(l.date());
|
|
1173
|
-
if (
|
|
1174
|
-
return
|
|
1177
|
+
if (V > 100 || S % 100 >= 50)
|
|
1178
|
+
return V;
|
|
1175
1179
|
const A = ~~(S / 100) * 100;
|
|
1176
|
-
return
|
|
1180
|
+
return V < 50 ? A + V : A - 100 + V;
|
|
1177
1181
|
}
|
|
1178
|
-
const
|
|
1182
|
+
const D = h(d), C = g(D);
|
|
1179
1183
|
if (!C) return null;
|
|
1180
1184
|
const {
|
|
1181
1185
|
year: Y,
|
|
1182
1186
|
month: r,
|
|
1183
1187
|
day: m
|
|
1184
|
-
} = C,
|
|
1185
|
-
return l.parseISO(`${Y}-${
|
|
1188
|
+
} = C, u = (V) => String(V).padStart(2, "0");
|
|
1189
|
+
return l.parseISO(`${Y}-${u(r)}-${u(m)}`);
|
|
1186
1190
|
}
|
|
1187
|
-
function
|
|
1188
|
-
return !!i(
|
|
1191
|
+
function o(d) {
|
|
1192
|
+
return !!i(d);
|
|
1189
1193
|
}
|
|
1190
|
-
function d
|
|
1191
|
-
const
|
|
1192
|
-
return t.value.order.split("").map((
|
|
1194
|
+
function c(d) {
|
|
1195
|
+
const h = l.toISO(d).split("T")[0].split("-");
|
|
1196
|
+
return t.value.order.split("").map((g) => h["ymd".indexOf(g)]).join(t.value.separator);
|
|
1193
1197
|
}
|
|
1194
1198
|
return {
|
|
1195
|
-
isValid:
|
|
1199
|
+
isValid: o,
|
|
1196
1200
|
parseDate: i,
|
|
1197
|
-
formatDate:
|
|
1201
|
+
formatDate: c,
|
|
1198
1202
|
parserFormat: z(() => t.value.format)
|
|
1199
1203
|
};
|
|
1200
1204
|
}
|
|
1201
|
-
const Ct =
|
|
1205
|
+
const Ct = j({
|
|
1202
1206
|
displayFormat: {
|
|
1203
1207
|
type: [Function, String],
|
|
1204
1208
|
default: void 0
|
|
@@ -1218,13 +1222,13 @@ const Ct = U({
|
|
|
1218
1222
|
mobile: null
|
|
1219
1223
|
}),
|
|
1220
1224
|
...gt(),
|
|
1221
|
-
...
|
|
1225
|
+
...Re({
|
|
1222
1226
|
hideActions: !0
|
|
1223
1227
|
}),
|
|
1224
1228
|
...kt({
|
|
1225
1229
|
prependIcon: "$calendar"
|
|
1226
1230
|
}),
|
|
1227
|
-
...
|
|
1231
|
+
...H(ze({
|
|
1228
1232
|
hideHeader: !0,
|
|
1229
1233
|
showAdjacentMonths: !0
|
|
1230
1234
|
}), ["location", "rounded", "height", "minHeight", "maxHeight"])
|
|
@@ -1246,101 +1250,101 @@ const Ct = U({
|
|
|
1246
1250
|
const {
|
|
1247
1251
|
t,
|
|
1248
1252
|
current: i
|
|
1249
|
-
} = oe(),
|
|
1250
|
-
isValid:
|
|
1251
|
-
parseDate:
|
|
1252
|
-
formatDate:
|
|
1253
|
-
parserFormat:
|
|
1253
|
+
} = oe(), o = ae(), {
|
|
1254
|
+
isValid: c,
|
|
1255
|
+
parseDate: d,
|
|
1256
|
+
formatDate: h,
|
|
1257
|
+
parserFormat: g
|
|
1254
1258
|
} = St(e, i), {
|
|
1255
|
-
mobile:
|
|
1259
|
+
mobile: f
|
|
1256
1260
|
} = dt(e), {
|
|
1257
|
-
InputIcon:
|
|
1261
|
+
InputIcon: D
|
|
1258
1262
|
} = ht(e), {
|
|
1259
1263
|
clampDate: C,
|
|
1260
1264
|
isInAllowedRange: Y
|
|
1261
|
-
} =
|
|
1262
|
-
function s(
|
|
1263
|
-
return typeof e.displayFormat == "function" ? e.displayFormat(
|
|
1265
|
+
} = be(e), r = () => e.multiple ? [] : null, m = L(e, "modelValue", r(), (y) => Array.isArray(y) ? y.map((T) => o.toJsDate(T)) : y && o.toJsDate(y), (y) => Array.isArray(y) ? y.map((T) => o.date(T)) : y && o.date(y)), u = L(e, "menu"), V = le(!1), S = le(e.focused), A = se(), I = se(["save"]);
|
|
1266
|
+
function s(y) {
|
|
1267
|
+
return typeof e.displayFormat == "function" ? e.displayFormat(y) : e.displayFormat ? o.format(y, e.displayFormat ?? "keyboardDate") : h(y);
|
|
1264
1268
|
}
|
|
1265
1269
|
const x = w(() => {
|
|
1266
|
-
const
|
|
1267
|
-
if (!
|
|
1270
|
+
const y = te(m.value);
|
|
1271
|
+
if (!y.length) return null;
|
|
1268
1272
|
if (e.multiple === !0)
|
|
1269
|
-
return t("$vuetify.datePicker.itemsSelected",
|
|
1273
|
+
return t("$vuetify.datePicker.itemsSelected", y.length);
|
|
1270
1274
|
if (e.multiple === "range") {
|
|
1271
|
-
const T =
|
|
1272
|
-
return !
|
|
1275
|
+
const T = y[0], R = y[y.length - 1];
|
|
1276
|
+
return !o.isValid(T) || !o.isValid(R) ? "" : `${s(o.date(T))} - ${s(o.date(R))}`;
|
|
1273
1277
|
}
|
|
1274
|
-
return
|
|
1278
|
+
return o.isValid(m.value) ? s(o.date(m.value)) : "";
|
|
1275
1279
|
}), M = w(() => {
|
|
1276
|
-
if (
|
|
1277
|
-
return
|
|
1278
|
-
}),
|
|
1279
|
-
ce(
|
|
1280
|
-
|
|
1280
|
+
if (f.value)
|
|
1281
|
+
return V.value ? "text" : "none";
|
|
1282
|
+
}), _ = w(() => !e.disabled && !e.readonly), W = w(() => e.updateOn.length ? !(f.value && V.value) && e.readonly : !0);
|
|
1283
|
+
ce(u, (y) => {
|
|
1284
|
+
y || (V.value = !1, I.value = ["save"]);
|
|
1281
1285
|
});
|
|
1282
|
-
function q(
|
|
1283
|
-
|
|
1286
|
+
function q(y) {
|
|
1287
|
+
y.key === "Enter" && ((!u.value || !S.value) && (u.value = !0), e.updateOn.includes("enter") && !e.readonly && ue(y.target));
|
|
1284
1288
|
}
|
|
1285
|
-
function
|
|
1286
|
-
|
|
1289
|
+
function ne(y) {
|
|
1290
|
+
y.preventDefault(), y.stopPropagation(), u.value && f.value ? V.value = !0 : u.value = !0;
|
|
1287
1291
|
}
|
|
1288
1292
|
function me() {
|
|
1289
|
-
l("cancel"),
|
|
1293
|
+
l("cancel"), u.value = !1, V.value = !1;
|
|
1290
1294
|
}
|
|
1291
|
-
function ye(
|
|
1292
|
-
l("save",
|
|
1295
|
+
function ye(y) {
|
|
1296
|
+
l("save", y), u.value = !1;
|
|
1293
1297
|
}
|
|
1294
|
-
function he(
|
|
1295
|
-
|
|
1298
|
+
function he(y) {
|
|
1299
|
+
y == null && (m.value = r());
|
|
1296
1300
|
}
|
|
1297
|
-
function ke(
|
|
1298
|
-
e.updateOn.includes("blur") && !e.readonly && ue(
|
|
1301
|
+
function ke(y) {
|
|
1302
|
+
e.updateOn.includes("blur") && !e.readonly && ue(y.target), f.value && V.value && !S.value && (u.value = !1, V.value = !1);
|
|
1299
1303
|
}
|
|
1300
|
-
function ue(
|
|
1304
|
+
function ue(y) {
|
|
1301
1305
|
let {
|
|
1302
1306
|
value: T
|
|
1303
|
-
} =
|
|
1307
|
+
} = y;
|
|
1304
1308
|
if (!T.trim())
|
|
1305
1309
|
m.value = r();
|
|
1306
1310
|
else if (!e.multiple)
|
|
1307
|
-
|
|
1311
|
+
c(T) && (m.value = C(d(T)));
|
|
1308
1312
|
else {
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1313
|
+
const R = T.trim().split(/\D+-\D+|[^\d\-/.]+/);
|
|
1314
|
+
if (R.every(c))
|
|
1311
1315
|
if (e.multiple === "range") {
|
|
1312
|
-
const [
|
|
1313
|
-
m.value = Ne(
|
|
1316
|
+
const [re, J] = R.map(d).map(C).toSorted((p, v) => o.isAfter(p, v) ? 1 : -1);
|
|
1317
|
+
m.value = Ne(o, re, J);
|
|
1314
1318
|
} else
|
|
1315
|
-
m.value =
|
|
1319
|
+
m.value = R.map(d).filter(Y);
|
|
1316
1320
|
}
|
|
1317
1321
|
}
|
|
1318
1322
|
return Z(() => {
|
|
1319
|
-
const
|
|
1320
|
-
...Oe.filterProps(
|
|
1323
|
+
const y = !!(e.prependIcon || n.prepend), T = Se.filterProps(e), R = {
|
|
1324
|
+
...Oe.filterProps(H(e, ["active", "bgColor", "color", "location", "rounded", "maxWidth", "minWidth", "width"])),
|
|
1321
1325
|
...e.pickerProps
|
|
1322
|
-
},
|
|
1323
|
-
return
|
|
1326
|
+
}, re = st(n, ["title", "header", "day", "month", "year"]), J = we.filterProps(H(e, ["placeholder"]));
|
|
1327
|
+
return b(we, B({
|
|
1324
1328
|
ref: A
|
|
1325
|
-
},
|
|
1329
|
+
}, J, {
|
|
1326
1330
|
class: ["v-date-input", e.class],
|
|
1327
1331
|
style: e.style,
|
|
1328
1332
|
modelValue: x.value,
|
|
1329
1333
|
inputmode: M.value,
|
|
1330
|
-
placeholder: e.placeholder ??
|
|
1334
|
+
placeholder: e.placeholder ?? g.value,
|
|
1331
1335
|
readonly: W.value,
|
|
1332
|
-
onKeydown:
|
|
1333
|
-
focused:
|
|
1336
|
+
onKeydown: _.value ? q : void 0,
|
|
1337
|
+
focused: u.value || S.value,
|
|
1334
1338
|
onBlur: ke,
|
|
1335
1339
|
validationValue: m.value,
|
|
1336
|
-
"onClick:control":
|
|
1340
|
+
"onClick:control": _.value ? ne : void 0,
|
|
1337
1341
|
"onUpdate:modelValue": he,
|
|
1338
|
-
"onUpdate:focused": (
|
|
1342
|
+
"onUpdate:focused": (p) => S.value = p
|
|
1339
1343
|
}), {
|
|
1340
1344
|
...n,
|
|
1341
|
-
default: () => P(Q, null, [
|
|
1342
|
-
modelValue:
|
|
1343
|
-
"onUpdate:modelValue": (
|
|
1345
|
+
default: () => P(Q, null, [b(ct, {
|
|
1346
|
+
modelValue: u.value,
|
|
1347
|
+
"onUpdate:modelValue": (p) => u.value = p,
|
|
1344
1348
|
activator: "parent",
|
|
1345
1349
|
minWidth: "0",
|
|
1346
1350
|
eager: S.value,
|
|
@@ -1348,51 +1352,51 @@ const Ct = U({
|
|
|
1348
1352
|
closeOnContentClick: !1,
|
|
1349
1353
|
openOnClick: !1
|
|
1350
1354
|
}, {
|
|
1351
|
-
default: () => [
|
|
1355
|
+
default: () => [b(Se, B(T, {
|
|
1352
1356
|
modelValue: m.value,
|
|
1353
|
-
"onUpdate:modelValue": (
|
|
1357
|
+
"onUpdate:modelValue": (p) => m.value = p,
|
|
1354
1358
|
disabled: I.value,
|
|
1355
1359
|
onSave: ye,
|
|
1356
1360
|
onCancel: me
|
|
1357
1361
|
}), {
|
|
1358
|
-
default: (
|
|
1362
|
+
default: (p) => {
|
|
1359
1363
|
let {
|
|
1360
|
-
actions:
|
|
1361
|
-
model:
|
|
1362
|
-
save:
|
|
1363
|
-
cancel:
|
|
1364
|
-
isPristine:
|
|
1365
|
-
} =
|
|
1366
|
-
function
|
|
1367
|
-
e.hideActions ? (m.value =
|
|
1364
|
+
actions: v,
|
|
1365
|
+
model: k,
|
|
1366
|
+
save: O,
|
|
1367
|
+
cancel: N,
|
|
1368
|
+
isPristine: U
|
|
1369
|
+
} = p;
|
|
1370
|
+
function X($) {
|
|
1371
|
+
e.hideActions ? (m.value = $, e.multiple || (u.value = !1)) : k.value = $, l("save", $), I.value = [];
|
|
1368
1372
|
}
|
|
1369
|
-
return
|
|
1370
|
-
modelValue: e.hideActions ? m.value :
|
|
1371
|
-
"onUpdate:modelValue": (
|
|
1372
|
-
onMousedown: (
|
|
1373
|
+
return b(Oe, B(R, {
|
|
1374
|
+
modelValue: e.hideActions ? m.value : k.value,
|
|
1375
|
+
"onUpdate:modelValue": ($) => X($),
|
|
1376
|
+
onMousedown: ($) => $.preventDefault()
|
|
1373
1377
|
}), {
|
|
1374
|
-
...
|
|
1378
|
+
...re,
|
|
1375
1379
|
actions: e.hideActions ? void 0 : () => n.actions?.({
|
|
1376
|
-
save:
|
|
1377
|
-
cancel:
|
|
1378
|
-
isPristine:
|
|
1379
|
-
}) ??
|
|
1380
|
+
save: O,
|
|
1381
|
+
cancel: N,
|
|
1382
|
+
isPristine: U
|
|
1383
|
+
}) ?? v()
|
|
1380
1384
|
});
|
|
1381
1385
|
}
|
|
1382
1386
|
})]
|
|
1383
1387
|
}), n.default?.()]),
|
|
1384
|
-
prepend: (
|
|
1388
|
+
prepend: y ? (p) => n.prepend ? n.prepend(p) : e.prependIcon && b(D, {
|
|
1385
1389
|
key: "prepend-icon",
|
|
1386
1390
|
name: "prepend",
|
|
1387
|
-
tabindex: -1,
|
|
1388
|
-
onClick:
|
|
1389
|
-
}, null)
|
|
1391
|
+
tabindex: e["onClick:prepend"] ? void 0 : -1,
|
|
1392
|
+
onClick: _.value ? ne : void 0
|
|
1393
|
+
}, null) : void 0
|
|
1390
1394
|
});
|
|
1391
1395
|
}), ft({}, A);
|
|
1392
1396
|
}
|
|
1393
1397
|
}), Ot = {
|
|
1394
1398
|
__name: "Datepicker",
|
|
1395
|
-
props: /* @__PURE__ */
|
|
1399
|
+
props: /* @__PURE__ */ Ge({
|
|
1396
1400
|
returnFormat: {
|
|
1397
1401
|
type: String,
|
|
1398
1402
|
default: "DD-MM-YYYY"
|
|
@@ -1403,20 +1407,20 @@ const Ct = U({
|
|
|
1403
1407
|
}),
|
|
1404
1408
|
emits: ["update:modelValue"],
|
|
1405
1409
|
setup(e) {
|
|
1406
|
-
const a =
|
|
1410
|
+
const a = Qe(e, "modelValue"), l = e, n = w({
|
|
1407
1411
|
get: () => {
|
|
1408
1412
|
const t = l.returnFormat, i = Array.isArray(a.value);
|
|
1409
|
-
let
|
|
1410
|
-
return i ?
|
|
1413
|
+
let o;
|
|
1414
|
+
return i ? o = a.value.filter((c) => G(c, t).isValid()).map((c) => new Date(G(c, t).format())) : G(a.value, t).isValid() && (o = new Date(G(a.value, t).format())), o;
|
|
1411
1415
|
},
|
|
1412
1416
|
set: (t) => {
|
|
1413
1417
|
const i = l.returnFormat;
|
|
1414
|
-
Array.isArray(t) ? a.value = t.filter((
|
|
1418
|
+
Array.isArray(t) ? a.value = t.filter((c) => G(c).isValid()).map((c) => G(c).format(i)) : a.value = G(t).isValid() ? G(t).format(i) : void 0;
|
|
1415
1419
|
}
|
|
1416
1420
|
});
|
|
1417
|
-
return (t, i) => (tt(), et(
|
|
1418
|
-
modelValue:
|
|
1419
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
1421
|
+
return (t, i) => (tt(), et(De(At), {
|
|
1422
|
+
modelValue: De(n),
|
|
1423
|
+
"onUpdate:modelValue": i[0] || (i[0] = (o) => at(n) ? n.value = o : null)
|
|
1420
1424
|
}, null, 8, ["modelValue"]));
|
|
1421
1425
|
}
|
|
1422
1426
|
};
|