@keenmate/web-daterangepicker 1.3.0 → 1.4.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/README.md +111 -63
- package/dist/style.css +1 -1
- package/dist/web-daterangepicker.js +569 -553
- package/dist/web-daterangepicker.umd.js +9 -9
- package/package.json +1 -1
- package/src/scss/_base.scss +37 -1
|
@@ -7,8 +7,8 @@ function Xt(e) {
|
|
|
7
7
|
try {
|
|
8
8
|
const n = new Intl.Locale(navigator.language);
|
|
9
9
|
if ("weekInfo" in n && n.weekInfo && "firstDay" in n.weekInfo) {
|
|
10
|
-
const
|
|
11
|
-
return
|
|
10
|
+
const i = n.weekInfo.firstDay;
|
|
11
|
+
return i === 7 ? 0 : i;
|
|
12
12
|
}
|
|
13
13
|
} catch {
|
|
14
14
|
}
|
|
@@ -40,66 +40,66 @@ function me(e) {
|
|
|
40
40
|
const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
|
|
41
41
|
return `${a}-${t}-${n}`;
|
|
42
42
|
}
|
|
43
|
-
function Jt(e, a, t, n,
|
|
44
|
-
const
|
|
45
|
-
return !!(a && e < a || t && e > t ||
|
|
43
|
+
function Jt(e, a, t, n, i) {
|
|
44
|
+
const r = me(e), o = e.getDay();
|
|
45
|
+
return !!(a && e < a || t && e > t || i && i.includes(o) || n.has(r));
|
|
46
46
|
}
|
|
47
47
|
function ct(e, a) {
|
|
48
48
|
for (let t = 0; t < 12; t++) {
|
|
49
49
|
const n = new Date(a, t + 1, 0).getDate();
|
|
50
|
-
for (let
|
|
51
|
-
const
|
|
52
|
-
if (!e.isDateDisabledInternal(
|
|
50
|
+
for (let i = 1; i <= n; i++) {
|
|
51
|
+
const r = new Date(a, t, i);
|
|
52
|
+
if (!e.isDateDisabledInternal(r))
|
|
53
53
|
return !0;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return !1;
|
|
57
57
|
}
|
|
58
58
|
function Qt(e, a, t) {
|
|
59
|
-
const n = new Date(e),
|
|
60
|
-
n.setHours(0, 0, 0, 0),
|
|
61
|
-
const
|
|
62
|
-
for (;
|
|
63
|
-
if (t(
|
|
59
|
+
const n = new Date(e), i = new Date(a);
|
|
60
|
+
n.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
61
|
+
const r = new Date(n);
|
|
62
|
+
for (; r <= i; ) {
|
|
63
|
+
if (t(r))
|
|
64
64
|
return !0;
|
|
65
|
-
|
|
65
|
+
r.setDate(r.getDate() + 1);
|
|
66
66
|
}
|
|
67
67
|
return !1;
|
|
68
68
|
}
|
|
69
69
|
function Zt(e, a, t) {
|
|
70
|
-
const n = [],
|
|
71
|
-
|
|
72
|
-
const o = new Date(
|
|
73
|
-
for (; o <=
|
|
70
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
71
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
72
|
+
const o = new Date(i);
|
|
73
|
+
for (; o <= r; )
|
|
74
74
|
t(o) || n.push(new Date(o)), o.setDate(o.getDate() + 1);
|
|
75
75
|
return n;
|
|
76
76
|
}
|
|
77
77
|
function ea(e, a, t) {
|
|
78
|
-
const n = [],
|
|
79
|
-
|
|
80
|
-
const o = new Date(
|
|
81
|
-
for (; o <=
|
|
78
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
79
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
80
|
+
const o = new Date(i);
|
|
81
|
+
for (; o <= r; )
|
|
82
82
|
t(o) && n.push(new Date(o)), o.setDate(o.getDate() + 1);
|
|
83
83
|
return n;
|
|
84
84
|
}
|
|
85
85
|
function ta(e, a, t) {
|
|
86
|
-
const n = new Date(e),
|
|
87
|
-
n.setHours(0, 0, 0, 0),
|
|
88
|
-
let
|
|
86
|
+
const n = new Date(e), i = new Date(a);
|
|
87
|
+
n.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
88
|
+
let r = new Date(n);
|
|
89
89
|
const o = new Date(n);
|
|
90
|
-
for (o.setDate(o.getDate() + 1); o <=
|
|
90
|
+
for (o.setDate(o.getDate() + 1); o <= i; ) {
|
|
91
91
|
if (t(o))
|
|
92
|
-
return
|
|
93
|
-
|
|
92
|
+
return r;
|
|
93
|
+
r = new Date(o), o.setDate(o.getDate() + 1);
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return i;
|
|
96
96
|
}
|
|
97
97
|
function aa(e, a, t) {
|
|
98
|
-
const n = [],
|
|
99
|
-
|
|
98
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
99
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
100
100
|
let o = null;
|
|
101
|
-
const s = new Date(
|
|
102
|
-
for (; s <=
|
|
101
|
+
const s = new Date(i);
|
|
102
|
+
for (; s <= r; ) {
|
|
103
103
|
if (!t(s))
|
|
104
104
|
o || (o = new Date(s));
|
|
105
105
|
else if (o) {
|
|
@@ -108,7 +108,7 @@ function aa(e, a, t) {
|
|
|
108
108
|
}
|
|
109
109
|
s.setDate(s.getDate() + 1);
|
|
110
110
|
}
|
|
111
|
-
return o && n.push({ start: o, end: new Date(
|
|
111
|
+
return o && n.push({ start: o, end: new Date(r) }), n;
|
|
112
112
|
}
|
|
113
113
|
function ut(e) {
|
|
114
114
|
return pt(e, /* @__PURE__ */ new Date());
|
|
@@ -119,23 +119,23 @@ function pt(e, a) {
|
|
|
119
119
|
function na(e, a, t) {
|
|
120
120
|
return !a || !t ? !1 : e > a && e < t;
|
|
121
121
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
122
|
+
var ia = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
123
|
+
function ra(e) {
|
|
124
124
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
125
125
|
}
|
|
126
126
|
var gt = { exports: {} };
|
|
127
127
|
(function(e) {
|
|
128
128
|
(function(a, t) {
|
|
129
129
|
e.exports ? e.exports = t() : a.log = t();
|
|
130
|
-
})(
|
|
130
|
+
})(ia, function() {
|
|
131
131
|
var a = function() {
|
|
132
|
-
}, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent),
|
|
132
|
+
}, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), i = [
|
|
133
133
|
"trace",
|
|
134
134
|
"debug",
|
|
135
135
|
"info",
|
|
136
136
|
"warn",
|
|
137
137
|
"error"
|
|
138
|
-
],
|
|
138
|
+
], r = {}, o = null;
|
|
139
139
|
function s(f, y) {
|
|
140
140
|
var h = f[y];
|
|
141
141
|
if (typeof h.bind == "function")
|
|
@@ -155,8 +155,8 @@ var gt = { exports: {} };
|
|
|
155
155
|
return f === "debug" && (f = "log"), typeof console === t ? !1 : f === "trace" && n ? d : console[f] !== void 0 ? s(console, f) : console.log !== void 0 ? s(console, "log") : a;
|
|
156
156
|
}
|
|
157
157
|
function c() {
|
|
158
|
-
for (var f = this.getLevel(), y = 0; y <
|
|
159
|
-
var h =
|
|
158
|
+
for (var f = this.getLevel(), y = 0; y < i.length; y++) {
|
|
159
|
+
var h = i[y];
|
|
160
160
|
this[h] = y < f ? a : this.methodFactory(h, f, this.name);
|
|
161
161
|
}
|
|
162
162
|
if (this.log = this.debug, typeof console === t && f < this.levels.SILENT)
|
|
@@ -174,7 +174,7 @@ var gt = { exports: {} };
|
|
|
174
174
|
var h = this, M, C, E, _ = "loglevel";
|
|
175
175
|
typeof f == "string" ? _ += ":" + f : typeof f == "symbol" && (_ = void 0);
|
|
176
176
|
function v(S) {
|
|
177
|
-
var R = (
|
|
177
|
+
var R = (i[S] || "silent").toUpperCase();
|
|
178
178
|
if (!(typeof window === t || !_)) {
|
|
179
179
|
try {
|
|
180
180
|
window.localStorage[_] = R;
|
|
@@ -196,9 +196,9 @@ var gt = { exports: {} };
|
|
|
196
196
|
}
|
|
197
197
|
if (typeof S === t)
|
|
198
198
|
try {
|
|
199
|
-
var R = window.document.cookie,
|
|
199
|
+
var R = window.document.cookie, T = encodeURIComponent(_), L = R.indexOf(T + "=");
|
|
200
200
|
L !== -1 && (S = /^([^;]+)/.exec(
|
|
201
|
-
R.slice(L +
|
|
201
|
+
R.slice(L + T.length + 1)
|
|
202
202
|
)[1]);
|
|
203
203
|
} catch {
|
|
204
204
|
}
|
|
@@ -244,8 +244,8 @@ var gt = { exports: {} };
|
|
|
244
244
|
h.setLevel(h.levels.SILENT, S);
|
|
245
245
|
}, h.rebuild = function() {
|
|
246
246
|
if (o !== h && (M = D(o.getLevel())), c.call(h), o === h)
|
|
247
|
-
for (var S in
|
|
248
|
-
|
|
247
|
+
for (var S in r)
|
|
248
|
+
r[S].rebuild();
|
|
249
249
|
}, M = D(
|
|
250
250
|
o ? o.getLevel() : "WARN"
|
|
251
251
|
);
|
|
@@ -255,8 +255,8 @@ var gt = { exports: {} };
|
|
|
255
255
|
o = new g(), o.getLogger = function(y) {
|
|
256
256
|
if (typeof y != "symbol" && typeof y != "string" || y === "")
|
|
257
257
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
258
|
-
var h =
|
|
259
|
-
return h || (h =
|
|
258
|
+
var h = r[y];
|
|
259
|
+
return h || (h = r[y] = new g(
|
|
260
260
|
y,
|
|
261
261
|
o.methodFactory
|
|
262
262
|
)), h;
|
|
@@ -265,12 +265,12 @@ var gt = { exports: {} };
|
|
|
265
265
|
return o.noConflict = function() {
|
|
266
266
|
return typeof window !== t && window.log === o && (window.log = m), o;
|
|
267
267
|
}, o.getLoggers = function() {
|
|
268
|
-
return
|
|
268
|
+
return r;
|
|
269
269
|
}, o.default = o, o;
|
|
270
270
|
});
|
|
271
271
|
})(gt);
|
|
272
272
|
var oa = gt.exports;
|
|
273
|
-
const Y = /* @__PURE__ */
|
|
273
|
+
const Y = /* @__PURE__ */ ra(oa), sa = [
|
|
274
274
|
"DRP",
|
|
275
275
|
"DRP:RENDERING",
|
|
276
276
|
"DRP:INTERACTION",
|
|
@@ -292,22 +292,22 @@ const Y = /* @__PURE__ */ ia(oa), sa = [
|
|
|
292
292
|
// Red
|
|
293
293
|
}, la = Y.methodFactory, ca = (e, a, t) => {
|
|
294
294
|
const n = la.call(Y, e, a, t);
|
|
295
|
-
return (...
|
|
296
|
-
const
|
|
295
|
+
return (...i) => {
|
|
296
|
+
const r = da[e] || "#6b7280", s = `%c[${(/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
|
|
297
297
|
hour12: !1,
|
|
298
298
|
hour: "2-digit",
|
|
299
299
|
minute: "2-digit",
|
|
300
300
|
second: "2-digit",
|
|
301
301
|
fractionalSecondDigits: 3
|
|
302
302
|
})}] [${e.toUpperCase()}] ${t ? `[${t}]` : ""}`;
|
|
303
|
-
n(s, `color: ${
|
|
303
|
+
n(s, `color: ${r}`, ...i);
|
|
304
304
|
};
|
|
305
305
|
}, ht = [];
|
|
306
306
|
function Q(e) {
|
|
307
307
|
const a = Y.getLogger(e);
|
|
308
308
|
return a.methodFactory = ca, a.setLevel("silent"), ht.push(a), a;
|
|
309
309
|
}
|
|
310
|
-
const
|
|
310
|
+
const k = Q("DRP"), de = Q("DRP:RENDERING"), oe = Q("DRP:INTERACTION"), re = Q("DRP:SELECTION"), w = Q("DRP:NAVIGATION"), O = Q("DRP:UI"), ee = Q("DRP:VALIDATION"), U = Q("DRP:DRAG");
|
|
311
311
|
Y.setLevel("silent");
|
|
312
312
|
const We = (e) => {
|
|
313
313
|
Y.setLevel(e), ht.forEach((a) => a.setLevel(e));
|
|
@@ -317,10 +317,10 @@ const We = (e) => {
|
|
|
317
317
|
We("silent");
|
|
318
318
|
}, ua = (e, a = "debug") => {
|
|
319
319
|
const n = {
|
|
320
|
-
DRP:
|
|
320
|
+
DRP: k,
|
|
321
321
|
"DRP:RENDERING": de,
|
|
322
322
|
"DRP:INTERACTION": oe,
|
|
323
|
-
"DRP:SELECTION":
|
|
323
|
+
"DRP:SELECTION": re,
|
|
324
324
|
"DRP:NAVIGATION": w,
|
|
325
325
|
"DRP:UI": O,
|
|
326
326
|
"DRP:VALIDATION": ee,
|
|
@@ -366,9 +366,9 @@ function Ge(e) {
|
|
|
366
366
|
}
|
|
367
367
|
function ma(e, a, t) {
|
|
368
368
|
t === void 0 && (t = !1);
|
|
369
|
-
const n = we(e),
|
|
370
|
-
let o =
|
|
371
|
-
return a.reference[
|
|
369
|
+
const n = we(e), i = Ge(e), r = Ke(i);
|
|
370
|
+
let o = i === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
371
|
+
return a.reference[r] > a.floating[r] && (o = Ee(o)), [o, Ee(o)];
|
|
372
372
|
}
|
|
373
373
|
function ba(e) {
|
|
374
374
|
const a = Ee(e);
|
|
@@ -377,12 +377,12 @@ function ba(e) {
|
|
|
377
377
|
function He(e) {
|
|
378
378
|
return e.replace(/start|end/g, (a) => ha[a]);
|
|
379
379
|
}
|
|
380
|
-
const nt = ["left", "right"],
|
|
380
|
+
const nt = ["left", "right"], it = ["right", "left"], ya = ["top", "bottom"], va = ["bottom", "top"];
|
|
381
381
|
function Da(e, a, t) {
|
|
382
382
|
switch (e) {
|
|
383
383
|
case "top":
|
|
384
384
|
case "bottom":
|
|
385
|
-
return t ? a ?
|
|
385
|
+
return t ? a ? it : nt : a ? nt : it;
|
|
386
386
|
case "left":
|
|
387
387
|
case "right":
|
|
388
388
|
return a ? ya : va;
|
|
@@ -391,9 +391,9 @@ function Da(e, a, t) {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
function _a(e, a, t, n) {
|
|
394
|
-
const
|
|
395
|
-
let
|
|
396
|
-
return
|
|
394
|
+
const i = we(e);
|
|
395
|
+
let r = Da(ne(e), t === "start", n);
|
|
396
|
+
return i && (r = r.map((o) => o + "-" + i), a && (r = r.concat(r.map(He)))), r;
|
|
397
397
|
}
|
|
398
398
|
function Ee(e) {
|
|
399
399
|
return e.replace(/left|right|bottom|top/g, (a) => ga[a]);
|
|
@@ -420,31 +420,31 @@ function Re(e) {
|
|
|
420
420
|
x: a,
|
|
421
421
|
y: t,
|
|
422
422
|
width: n,
|
|
423
|
-
height:
|
|
423
|
+
height: i
|
|
424
424
|
} = e;
|
|
425
425
|
return {
|
|
426
426
|
width: n,
|
|
427
|
-
height:
|
|
427
|
+
height: i,
|
|
428
428
|
top: t,
|
|
429
429
|
left: a,
|
|
430
430
|
right: a + n,
|
|
431
|
-
bottom: t +
|
|
431
|
+
bottom: t + i,
|
|
432
432
|
x: a,
|
|
433
433
|
y: t
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function rt(e, a, t) {
|
|
437
437
|
let {
|
|
438
438
|
reference: n,
|
|
439
|
-
floating:
|
|
439
|
+
floating: i
|
|
440
440
|
} = e;
|
|
441
|
-
const
|
|
441
|
+
const r = X(a), o = Ge(a), s = Ke(o), d = ne(a), l = r === "y", c = n.x + n.width / 2 - i.width / 2, p = n.y + n.height / 2 - i.height / 2, u = n[s] / 2 - i[s] / 2;
|
|
442
442
|
let g;
|
|
443
443
|
switch (d) {
|
|
444
444
|
case "top":
|
|
445
445
|
g = {
|
|
446
446
|
x: c,
|
|
447
|
-
y: n.y -
|
|
447
|
+
y: n.y - i.height
|
|
448
448
|
};
|
|
449
449
|
break;
|
|
450
450
|
case "bottom":
|
|
@@ -461,7 +461,7 @@ function it(e, a, t) {
|
|
|
461
461
|
break;
|
|
462
462
|
case "left":
|
|
463
463
|
g = {
|
|
464
|
-
x: n.x -
|
|
464
|
+
x: n.x - i.width,
|
|
465
465
|
y: p
|
|
466
466
|
};
|
|
467
467
|
break;
|
|
@@ -484,18 +484,18 @@ function it(e, a, t) {
|
|
|
484
484
|
const xa = async (e, a, t) => {
|
|
485
485
|
const {
|
|
486
486
|
placement: n = "bottom",
|
|
487
|
-
strategy:
|
|
488
|
-
middleware:
|
|
487
|
+
strategy: i = "absolute",
|
|
488
|
+
middleware: r = [],
|
|
489
489
|
platform: o
|
|
490
|
-
} = t, s =
|
|
490
|
+
} = t, s = r.filter(Boolean), d = await (o.isRTL == null ? void 0 : o.isRTL(a));
|
|
491
491
|
let l = await o.getElementRects({
|
|
492
492
|
reference: e,
|
|
493
493
|
floating: a,
|
|
494
|
-
strategy:
|
|
494
|
+
strategy: i
|
|
495
495
|
}), {
|
|
496
496
|
x: c,
|
|
497
497
|
y: p
|
|
498
|
-
} =
|
|
498
|
+
} = rt(l, n, d), u = n, g = {}, m = 0;
|
|
499
499
|
for (let f = 0; f < s.length; f++) {
|
|
500
500
|
const {
|
|
501
501
|
name: y,
|
|
@@ -510,7 +510,7 @@ const xa = async (e, a, t) => {
|
|
|
510
510
|
y: p,
|
|
511
511
|
initialPlacement: n,
|
|
512
512
|
placement: u,
|
|
513
|
-
strategy:
|
|
513
|
+
strategy: i,
|
|
514
514
|
middlewareData: g,
|
|
515
515
|
rects: l,
|
|
516
516
|
platform: o,
|
|
@@ -528,17 +528,17 @@ const xa = async (e, a, t) => {
|
|
|
528
528
|
}, _ && m <= 50 && (m++, typeof _ == "object" && (_.placement && (u = _.placement), _.rects && (l = _.rects === !0 ? await o.getElementRects({
|
|
529
529
|
reference: e,
|
|
530
530
|
floating: a,
|
|
531
|
-
strategy:
|
|
531
|
+
strategy: i
|
|
532
532
|
}) : _.rects), {
|
|
533
533
|
x: c,
|
|
534
534
|
y: p
|
|
535
|
-
} =
|
|
535
|
+
} = rt(l, u, d)), f = -1);
|
|
536
536
|
}
|
|
537
537
|
return {
|
|
538
538
|
x: c,
|
|
539
539
|
y: p,
|
|
540
540
|
placement: u,
|
|
541
|
-
strategy:
|
|
541
|
+
strategy: i,
|
|
542
542
|
middlewareData: g
|
|
543
543
|
};
|
|
544
544
|
};
|
|
@@ -547,8 +547,8 @@ async function vt(e, a) {
|
|
|
547
547
|
a === void 0 && (a = {});
|
|
548
548
|
const {
|
|
549
549
|
x: n,
|
|
550
|
-
y:
|
|
551
|
-
platform:
|
|
550
|
+
y: i,
|
|
551
|
+
platform: r,
|
|
552
552
|
rects: o,
|
|
553
553
|
elements: s,
|
|
554
554
|
strategy: d
|
|
@@ -558,23 +558,23 @@ async function vt(e, a) {
|
|
|
558
558
|
elementContext: p = "floating",
|
|
559
559
|
altBoundary: u = !1,
|
|
560
560
|
padding: g = 0
|
|
561
|
-
} = _e(a, e), m = yt(g), y = s[u ? p === "floating" ? "reference" : "floating" : p], h = Re(await
|
|
562
|
-
element: (t = await (
|
|
561
|
+
} = _e(a, e), m = yt(g), y = s[u ? p === "floating" ? "reference" : "floating" : p], h = Re(await r.getClippingRect({
|
|
562
|
+
element: (t = await (r.isElement == null ? void 0 : r.isElement(y))) == null || t ? y : y.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(s.floating)),
|
|
563
563
|
boundary: l,
|
|
564
564
|
rootBoundary: c,
|
|
565
565
|
strategy: d
|
|
566
566
|
})), M = p === "floating" ? {
|
|
567
567
|
x: n,
|
|
568
|
-
y:
|
|
568
|
+
y: i,
|
|
569
569
|
width: o.floating.width,
|
|
570
570
|
height: o.floating.height
|
|
571
|
-
} : o.reference, C = await (
|
|
571
|
+
} : o.reference, C = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(s.floating)), E = await (r.isElement == null ? void 0 : r.isElement(C)) ? await (r.getScale == null ? void 0 : r.getScale(C)) || {
|
|
572
572
|
x: 1,
|
|
573
573
|
y: 1
|
|
574
574
|
} : {
|
|
575
575
|
x: 1,
|
|
576
576
|
y: 1
|
|
577
|
-
}, _ = Re(
|
|
577
|
+
}, _ = Re(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
578
578
|
elements: s,
|
|
579
579
|
rect: M,
|
|
580
580
|
offsetParent: C,
|
|
@@ -594,8 +594,8 @@ const Ma = (e) => ({
|
|
|
594
594
|
const {
|
|
595
595
|
x: t,
|
|
596
596
|
y: n,
|
|
597
|
-
placement:
|
|
598
|
-
rects:
|
|
597
|
+
placement: i,
|
|
598
|
+
rects: r,
|
|
599
599
|
platform: o,
|
|
600
600
|
elements: s,
|
|
601
601
|
middlewareData: d
|
|
@@ -608,20 +608,20 @@ const Ma = (e) => ({
|
|
|
608
608
|
const p = yt(c), u = {
|
|
609
609
|
x: t,
|
|
610
610
|
y: n
|
|
611
|
-
}, g = Ge(
|
|
611
|
+
}, g = Ge(i), m = Ke(g), f = await o.getDimensions(l), y = g === "y", h = y ? "top" : "left", M = y ? "bottom" : "right", C = y ? "clientHeight" : "clientWidth", E = r.reference[m] + r.reference[g] - u[g] - r.floating[m], _ = u[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
|
|
612
612
|
let I = v ? v[C] : 0;
|
|
613
|
-
(!I || !await (o.isElement == null ? void 0 : o.isElement(v))) && (I = s.floating[C] ||
|
|
614
|
-
const A = E / 2 - _ / 2, D = I / 2 - f[m] / 2 - 1, x = le(p[h], D), S = le(p[M], D), R = x,
|
|
613
|
+
(!I || !await (o.isElement == null ? void 0 : o.isElement(v))) && (I = s.floating[C] || r.floating[m]);
|
|
614
|
+
const A = E / 2 - _ / 2, D = I / 2 - f[m] / 2 - 1, x = le(p[h], D), S = le(p[M], D), R = x, T = I - f[m] - S, L = I / 2 - f[m] / 2 + A, z = Be(R, L, T), N = !d.arrow && we(i) != null && L !== z && r.reference[m] / 2 - (L < R ? x : S) - f[m] / 2 < 0, $ = N ? L < R ? L - R : L - T : 0;
|
|
615
615
|
return {
|
|
616
616
|
[g]: u[g] + $,
|
|
617
617
|
data: {
|
|
618
|
-
[g]:
|
|
619
|
-
centerOffset: L -
|
|
620
|
-
...
|
|
618
|
+
[g]: z,
|
|
619
|
+
centerOffset: L - z - $,
|
|
620
|
+
...N && {
|
|
621
621
|
alignmentOffset: $
|
|
622
622
|
}
|
|
623
623
|
},
|
|
624
|
-
reset:
|
|
624
|
+
reset: N
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
627
|
}), Sa = function(e) {
|
|
@@ -631,8 +631,8 @@ const Ma = (e) => ({
|
|
|
631
631
|
async fn(a) {
|
|
632
632
|
var t, n;
|
|
633
633
|
const {
|
|
634
|
-
placement:
|
|
635
|
-
middlewareData:
|
|
634
|
+
placement: i,
|
|
635
|
+
middlewareData: r,
|
|
636
636
|
rects: o,
|
|
637
637
|
initialPlacement: s,
|
|
638
638
|
platform: d,
|
|
@@ -646,23 +646,23 @@ const Ma = (e) => ({
|
|
|
646
646
|
flipAlignment: f = !0,
|
|
647
647
|
...y
|
|
648
648
|
} = _e(e, a);
|
|
649
|
-
if ((t =
|
|
649
|
+
if ((t = r.arrow) != null && t.alignmentOffset)
|
|
650
650
|
return {};
|
|
651
|
-
const h = ne(
|
|
651
|
+
const h = ne(i), M = X(s), C = ne(s) === s, E = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), _ = u || (C || !f ? [Ee(s)] : ba(s)), v = m !== "none";
|
|
652
652
|
!u && v && _.push(..._a(s, f, m, E));
|
|
653
653
|
const I = [s, ..._], A = await vt(a, y), D = [];
|
|
654
|
-
let x = ((n =
|
|
654
|
+
let x = ((n = r.flip) == null ? void 0 : n.overflows) || [];
|
|
655
655
|
if (c && D.push(A[h]), p) {
|
|
656
|
-
const L = ma(
|
|
656
|
+
const L = ma(i, o, E);
|
|
657
657
|
D.push(A[L[0]], A[L[1]]);
|
|
658
658
|
}
|
|
659
659
|
if (x = [...x, {
|
|
660
|
-
placement:
|
|
660
|
+
placement: i,
|
|
661
661
|
overflows: D
|
|
662
662
|
}], !D.every((L) => L <= 0)) {
|
|
663
663
|
var S, R;
|
|
664
|
-
const L = (((S =
|
|
665
|
-
if (
|
|
664
|
+
const L = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1, z = I[L];
|
|
665
|
+
if (z && (!(p === "alignment" ? M !== X(z) : !1) || // We leave the current main axis only if every placement on that axis
|
|
666
666
|
// overflows the main axis.
|
|
667
667
|
x.every((P) => X(P.placement) === M ? P.overflows[0] > 0 : !0)))
|
|
668
668
|
return {
|
|
@@ -671,15 +671,15 @@ const Ma = (e) => ({
|
|
|
671
671
|
overflows: x
|
|
672
672
|
},
|
|
673
673
|
reset: {
|
|
674
|
-
placement:
|
|
674
|
+
placement: z
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
|
-
let
|
|
678
|
-
if (!
|
|
677
|
+
let N = (R = x.filter(($) => $.overflows[0] <= 0).sort(($, P) => $.overflows[1] - P.overflows[1])[0]) == null ? void 0 : R.placement;
|
|
678
|
+
if (!N)
|
|
679
679
|
switch (g) {
|
|
680
680
|
case "bestFit": {
|
|
681
|
-
var
|
|
682
|
-
const $ = (
|
|
681
|
+
var T;
|
|
682
|
+
const $ = (T = x.filter((P) => {
|
|
683
683
|
if (v) {
|
|
684
684
|
const V = X(P.placement);
|
|
685
685
|
return V === M || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -687,18 +687,18 @@ const Ma = (e) => ({
|
|
|
687
687
|
V === "y";
|
|
688
688
|
}
|
|
689
689
|
return !0;
|
|
690
|
-
}).map((P) => [P.placement, P.overflows.filter((V) => V > 0).reduce((V, q) => V + q, 0)]).sort((P, V) => P[1] - V[1])[0]) == null ? void 0 :
|
|
691
|
-
$ && (
|
|
690
|
+
}).map((P) => [P.placement, P.overflows.filter((V) => V > 0).reduce((V, q) => V + q, 0)]).sort((P, V) => P[1] - V[1])[0]) == null ? void 0 : T[0];
|
|
691
|
+
$ && (N = $);
|
|
692
692
|
break;
|
|
693
693
|
}
|
|
694
694
|
case "initialPlacement":
|
|
695
|
-
|
|
695
|
+
N = s;
|
|
696
696
|
break;
|
|
697
697
|
}
|
|
698
|
-
if (
|
|
698
|
+
if (i !== N)
|
|
699
699
|
return {
|
|
700
700
|
reset: {
|
|
701
|
-
placement:
|
|
701
|
+
placement: N
|
|
702
702
|
}
|
|
703
703
|
};
|
|
704
704
|
}
|
|
@@ -710,8 +710,8 @@ async function Ia(e, a) {
|
|
|
710
710
|
const {
|
|
711
711
|
placement: t,
|
|
712
712
|
platform: n,
|
|
713
|
-
elements:
|
|
714
|
-
} = e,
|
|
713
|
+
elements: i
|
|
714
|
+
} = e, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), o = ne(t), s = we(t), d = X(t) === "y", l = Ca.has(o) ? -1 : 1, c = r && d ? -1 : 1, p = _e(a, e);
|
|
715
715
|
let {
|
|
716
716
|
mainAxis: u,
|
|
717
717
|
crossAxis: g,
|
|
@@ -740,14 +740,14 @@ const Ea = function(e) {
|
|
|
740
740
|
async fn(a) {
|
|
741
741
|
var t, n;
|
|
742
742
|
const {
|
|
743
|
-
x:
|
|
744
|
-
y:
|
|
743
|
+
x: i,
|
|
744
|
+
y: r,
|
|
745
745
|
placement: o,
|
|
746
746
|
middlewareData: s
|
|
747
747
|
} = a, d = await Ia(a, e);
|
|
748
748
|
return o === ((t = s.offset) == null ? void 0 : t.placement) && (n = s.arrow) != null && n.alignmentOffset ? {} : {
|
|
749
|
-
x:
|
|
750
|
-
y:
|
|
749
|
+
x: i + d.x,
|
|
750
|
+
y: r + d.y,
|
|
751
751
|
data: {
|
|
752
752
|
...d,
|
|
753
753
|
placement: o
|
|
@@ -763,9 +763,9 @@ const Ea = function(e) {
|
|
|
763
763
|
const {
|
|
764
764
|
x: t,
|
|
765
765
|
y: n,
|
|
766
|
-
placement:
|
|
766
|
+
placement: i
|
|
767
767
|
} = a, {
|
|
768
|
-
mainAxis:
|
|
768
|
+
mainAxis: r = !0,
|
|
769
769
|
crossAxis: o = !1,
|
|
770
770
|
limiter: s = {
|
|
771
771
|
fn: (y) => {
|
|
@@ -783,9 +783,9 @@ const Ea = function(e) {
|
|
|
783
783
|
} = _e(e, a), l = {
|
|
784
784
|
x: t,
|
|
785
785
|
y: n
|
|
786
|
-
}, c = await vt(a, d), p = X(ne(
|
|
786
|
+
}, c = await vt(a, d), p = X(ne(i)), u = bt(p);
|
|
787
787
|
let g = l[u], m = l[p];
|
|
788
|
-
if (
|
|
788
|
+
if (r) {
|
|
789
789
|
const y = u === "y" ? "top" : "left", h = u === "y" ? "bottom" : "right", M = g + c[y], C = g - c[h];
|
|
790
790
|
g = Be(M, g, C);
|
|
791
791
|
}
|
|
@@ -804,7 +804,7 @@ const Ea = function(e) {
|
|
|
804
804
|
x: f.x - t,
|
|
805
805
|
y: f.y - n,
|
|
806
806
|
enabled: {
|
|
807
|
-
[u]:
|
|
807
|
+
[u]: r,
|
|
808
808
|
[p]: o
|
|
809
809
|
}
|
|
810
810
|
}
|
|
@@ -844,17 +844,17 @@ function xe(e) {
|
|
|
844
844
|
overflow: a,
|
|
845
845
|
overflowX: t,
|
|
846
846
|
overflowY: n,
|
|
847
|
-
display:
|
|
847
|
+
display: i
|
|
848
848
|
} = H(e);
|
|
849
|
-
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !Aa.has(
|
|
849
|
+
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !Aa.has(i);
|
|
850
850
|
}
|
|
851
851
|
const La = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
852
|
-
function
|
|
852
|
+
function ka(e) {
|
|
853
853
|
return La.has(ge(e));
|
|
854
854
|
}
|
|
855
|
-
const
|
|
856
|
-
function
|
|
857
|
-
return
|
|
855
|
+
const Ta = [":popover-open", ":modal"];
|
|
856
|
+
function ze(e) {
|
|
857
|
+
return Ta.some((a) => {
|
|
858
858
|
try {
|
|
859
859
|
return e.matches(a);
|
|
860
860
|
} catch {
|
|
@@ -862,17 +862,17 @@ function Ne(e) {
|
|
|
862
862
|
}
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
const $a = ["transform", "translate", "scale", "rotate", "perspective"], Pa = ["transform", "translate", "scale", "rotate", "perspective", "filter"],
|
|
865
|
+
const $a = ["transform", "translate", "scale", "rotate", "perspective"], Pa = ["transform", "translate", "scale", "rotate", "perspective", "filter"], za = ["paint", "layout", "strict", "content"];
|
|
866
866
|
function Xe(e) {
|
|
867
867
|
const a = Je(), t = B(e) ? H(e) : e;
|
|
868
|
-
return $a.some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !a && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !a && (t.filter ? t.filter !== "none" : !1) || Pa.some((n) => (t.willChange || "").includes(n)) ||
|
|
868
|
+
return $a.some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !a && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !a && (t.filter ? t.filter !== "none" : !1) || Pa.some((n) => (t.willChange || "").includes(n)) || za.some((n) => (t.contain || "").includes(n));
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Na(e) {
|
|
871
871
|
let a = J(e);
|
|
872
872
|
for (; K(a) && !ce(a); ) {
|
|
873
873
|
if (Xe(a))
|
|
874
874
|
return a;
|
|
875
|
-
if (
|
|
875
|
+
if (ze(a))
|
|
876
876
|
return null;
|
|
877
877
|
a = J(a);
|
|
878
878
|
}
|
|
@@ -888,7 +888,7 @@ function ce(e) {
|
|
|
888
888
|
function H(e) {
|
|
889
889
|
return F(e).getComputedStyle(e);
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function Ne(e) {
|
|
892
892
|
return B(e) ? {
|
|
893
893
|
scrollLeft: e.scrollLeft,
|
|
894
894
|
scrollTop: e.scrollTop
|
|
@@ -916,12 +916,12 @@ function _t(e) {
|
|
|
916
916
|
function ue(e, a, t) {
|
|
917
917
|
var n;
|
|
918
918
|
a === void 0 && (a = []), t === void 0 && (t = !0);
|
|
919
|
-
const
|
|
920
|
-
if (
|
|
919
|
+
const i = _t(e), r = i === ((n = e.ownerDocument) == null ? void 0 : n.body), o = F(i);
|
|
920
|
+
if (r) {
|
|
921
921
|
const s = Ve(o);
|
|
922
|
-
return a.concat(o, o.visualViewport || [], xe(
|
|
922
|
+
return a.concat(o, o.visualViewport || [], xe(i) ? i : [], s && t ? ue(s) : []);
|
|
923
923
|
}
|
|
924
|
-
return a.concat(
|
|
924
|
+
return a.concat(i, ue(i, [], t));
|
|
925
925
|
}
|
|
926
926
|
function Ve(e) {
|
|
927
927
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
@@ -929,8 +929,8 @@ function Ve(e) {
|
|
|
929
929
|
function wt(e) {
|
|
930
930
|
const a = H(e);
|
|
931
931
|
let t = parseFloat(a.width) || 0, n = parseFloat(a.height) || 0;
|
|
932
|
-
const
|
|
933
|
-
return s && (t =
|
|
932
|
+
const i = K(e), r = i ? e.offsetWidth : t, o = i ? e.offsetHeight : n, s = Ie(t) !== r || Ie(n) !== o;
|
|
933
|
+
return s && (t = r, n = o), {
|
|
934
934
|
width: t,
|
|
935
935
|
height: n,
|
|
936
936
|
$: s
|
|
@@ -945,10 +945,10 @@ function se(e) {
|
|
|
945
945
|
return W(1);
|
|
946
946
|
const t = a.getBoundingClientRect(), {
|
|
947
947
|
width: n,
|
|
948
|
-
height:
|
|
949
|
-
$:
|
|
948
|
+
height: i,
|
|
949
|
+
$: r
|
|
950
950
|
} = wt(a);
|
|
951
|
-
let o = (
|
|
951
|
+
let o = (r ? Ie(t.width) : t.width) / n, s = (r ? Ie(t.height) : t.height) / i;
|
|
952
952
|
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
953
953
|
x: o,
|
|
954
954
|
y: s
|
|
@@ -965,15 +965,15 @@ function xt(e) {
|
|
|
965
965
|
function Ya(e, a, t) {
|
|
966
966
|
return a === void 0 && (a = !1), !t || a && t !== F(e) ? !1 : a;
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function ie(e, a, t, n) {
|
|
969
969
|
a === void 0 && (a = !1), t === void 0 && (t = !1);
|
|
970
|
-
const
|
|
970
|
+
const i = e.getBoundingClientRect(), r = Qe(e);
|
|
971
971
|
let o = W(1);
|
|
972
972
|
a && (n ? B(n) && (o = se(n)) : o = se(e));
|
|
973
|
-
const s = Ya(
|
|
974
|
-
let d = (
|
|
975
|
-
if (
|
|
976
|
-
const u = F(
|
|
973
|
+
const s = Ya(r, t, n) ? xt(r) : W(0);
|
|
974
|
+
let d = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, c = i.width / o.x, p = i.height / o.y;
|
|
975
|
+
if (r) {
|
|
976
|
+
const u = F(r), g = n && B(n) ? F(n) : n;
|
|
977
977
|
let m = u, f = Ve(m);
|
|
978
978
|
for (; f && n && g !== m; ) {
|
|
979
979
|
const y = se(f), h = f.getBoundingClientRect(), M = H(f), C = h.left + (f.clientLeft + parseFloat(M.paddingLeft)) * y.x, E = h.top + (f.clientTop + parseFloat(M.paddingTop)) * y.y;
|
|
@@ -988,14 +988,14 @@ function re(e, a, t, n) {
|
|
|
988
988
|
});
|
|
989
989
|
}
|
|
990
990
|
function Fe(e, a) {
|
|
991
|
-
const t =
|
|
992
|
-
return a ? a.left + t :
|
|
991
|
+
const t = Ne(e).scrollLeft;
|
|
992
|
+
return a ? a.left + t : ie(G(e)).left + t;
|
|
993
993
|
}
|
|
994
994
|
function Mt(e, a) {
|
|
995
|
-
const t = e.getBoundingClientRect(), n = t.left + a.scrollLeft - Fe(e, t),
|
|
995
|
+
const t = e.getBoundingClientRect(), n = t.left + a.scrollLeft - Fe(e, t), i = t.top + a.scrollTop;
|
|
996
996
|
return {
|
|
997
997
|
x: n,
|
|
998
|
-
y:
|
|
998
|
+
y: i
|
|
999
999
|
};
|
|
1000
1000
|
}
|
|
1001
1001
|
function Ba(e) {
|
|
@@ -1003,21 +1003,21 @@ function Ba(e) {
|
|
|
1003
1003
|
elements: a,
|
|
1004
1004
|
rect: t,
|
|
1005
1005
|
offsetParent: n,
|
|
1006
|
-
strategy:
|
|
1006
|
+
strategy: i
|
|
1007
1007
|
} = e;
|
|
1008
|
-
const
|
|
1009
|
-
if (n === o || s &&
|
|
1008
|
+
const r = i === "fixed", o = G(n), s = a ? ze(a.floating) : !1;
|
|
1009
|
+
if (n === o || s && r)
|
|
1010
1010
|
return t;
|
|
1011
1011
|
let d = {
|
|
1012
1012
|
scrollLeft: 0,
|
|
1013
1013
|
scrollTop: 0
|
|
1014
1014
|
}, l = W(1);
|
|
1015
1015
|
const c = W(0), p = K(n);
|
|
1016
|
-
if ((p || !p && !
|
|
1017
|
-
const g =
|
|
1016
|
+
if ((p || !p && !r) && ((ge(n) !== "body" || xe(o)) && (d = Ne(n)), K(n))) {
|
|
1017
|
+
const g = ie(n);
|
|
1018
1018
|
l = se(n), c.x = g.x + n.clientLeft, c.y = g.y + n.clientTop;
|
|
1019
1019
|
}
|
|
1020
|
-
const u = o && !p && !
|
|
1020
|
+
const u = o && !p && !r ? Mt(o, d) : W(0);
|
|
1021
1021
|
return {
|
|
1022
1022
|
width: t.width * l.x,
|
|
1023
1023
|
height: t.height * l.y,
|
|
@@ -1029,32 +1029,32 @@ function Ha(e) {
|
|
|
1029
1029
|
return Array.from(e.getClientRects());
|
|
1030
1030
|
}
|
|
1031
1031
|
function Va(e) {
|
|
1032
|
-
const a = G(e), t =
|
|
1032
|
+
const a = G(e), t = Ne(e), n = e.ownerDocument.body, i = te(a.scrollWidth, a.clientWidth, n.scrollWidth, n.clientWidth), r = te(a.scrollHeight, a.clientHeight, n.scrollHeight, n.clientHeight);
|
|
1033
1033
|
let o = -t.scrollLeft + Fe(e);
|
|
1034
1034
|
const s = -t.scrollTop;
|
|
1035
|
-
return H(n).direction === "rtl" && (o += te(a.clientWidth, n.clientWidth) -
|
|
1036
|
-
width:
|
|
1037
|
-
height:
|
|
1035
|
+
return H(n).direction === "rtl" && (o += te(a.clientWidth, n.clientWidth) - i), {
|
|
1036
|
+
width: i,
|
|
1037
|
+
height: r,
|
|
1038
1038
|
x: o,
|
|
1039
1039
|
y: s
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
1042
|
const st = 25;
|
|
1043
1043
|
function qa(e, a) {
|
|
1044
|
-
const t = F(e), n = G(e),
|
|
1045
|
-
let
|
|
1046
|
-
if (
|
|
1047
|
-
|
|
1044
|
+
const t = F(e), n = G(e), i = t.visualViewport;
|
|
1045
|
+
let r = n.clientWidth, o = n.clientHeight, s = 0, d = 0;
|
|
1046
|
+
if (i) {
|
|
1047
|
+
r = i.width, o = i.height;
|
|
1048
1048
|
const c = Je();
|
|
1049
|
-
(!c || c && a === "fixed") && (s =
|
|
1049
|
+
(!c || c && a === "fixed") && (s = i.offsetLeft, d = i.offsetTop);
|
|
1050
1050
|
}
|
|
1051
1051
|
const l = Fe(n);
|
|
1052
1052
|
if (l <= 0) {
|
|
1053
1053
|
const c = n.ownerDocument, p = c.body, u = getComputedStyle(p), g = c.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, m = Math.abs(n.clientWidth - p.clientWidth - g);
|
|
1054
|
-
m <= st && (
|
|
1055
|
-
} else l <= st && (
|
|
1054
|
+
m <= st && (r -= m);
|
|
1055
|
+
} else l <= st && (r += l);
|
|
1056
1056
|
return {
|
|
1057
|
-
width:
|
|
1057
|
+
width: r,
|
|
1058
1058
|
height: o,
|
|
1059
1059
|
x: s,
|
|
1060
1060
|
y: d
|
|
@@ -1062,7 +1062,7 @@ function qa(e, a) {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
const Ua = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1064
1064
|
function ja(e, a) {
|
|
1065
|
-
const t =
|
|
1065
|
+
const t = ie(e, !0, a === "fixed"), n = t.top + e.clientTop, i = t.left + e.clientLeft, r = K(e) ? se(e) : W(1), o = e.clientWidth * r.x, s = e.clientHeight * r.y, d = i * r.x, l = n * r.y;
|
|
1066
1066
|
return {
|
|
1067
1067
|
width: o,
|
|
1068
1068
|
height: s,
|
|
@@ -1079,10 +1079,10 @@ function dt(e, a, t) {
|
|
|
1079
1079
|
else if (B(a))
|
|
1080
1080
|
n = ja(a, t);
|
|
1081
1081
|
else {
|
|
1082
|
-
const
|
|
1082
|
+
const i = xt(e);
|
|
1083
1083
|
n = {
|
|
1084
|
-
x: a.x -
|
|
1085
|
-
y: a.y -
|
|
1084
|
+
x: a.x - i.x,
|
|
1085
|
+
y: a.y - i.y,
|
|
1086
1086
|
width: a.width,
|
|
1087
1087
|
height: a.height
|
|
1088
1088
|
};
|
|
@@ -1097,12 +1097,12 @@ function Wa(e, a) {
|
|
|
1097
1097
|
const t = a.get(e);
|
|
1098
1098
|
if (t)
|
|
1099
1099
|
return t;
|
|
1100
|
-
let n = ue(e, [], !1).filter((s) => B(s) && ge(s) !== "body"),
|
|
1101
|
-
const
|
|
1102
|
-
let o =
|
|
1100
|
+
let n = ue(e, [], !1).filter((s) => B(s) && ge(s) !== "body"), i = null;
|
|
1101
|
+
const r = H(e).position === "fixed";
|
|
1102
|
+
let o = r ? J(e) : e;
|
|
1103
1103
|
for (; B(o) && !ce(o); ) {
|
|
1104
1104
|
const s = H(o), d = Xe(o);
|
|
1105
|
-
!d && s.position === "fixed" && (
|
|
1105
|
+
!d && s.position === "fixed" && (i = null), (r ? !d && !i : !d && s.position === "static" && !!i && Ua.has(i.position) || xe(o) && !d && St(e, o)) ? n = n.filter((c) => c !== o) : i = s, o = J(o);
|
|
1106
1106
|
}
|
|
1107
1107
|
return a.set(e, n), n;
|
|
1108
1108
|
}
|
|
@@ -1111,12 +1111,12 @@ function Ka(e) {
|
|
|
1111
1111
|
element: a,
|
|
1112
1112
|
boundary: t,
|
|
1113
1113
|
rootBoundary: n,
|
|
1114
|
-
strategy:
|
|
1114
|
+
strategy: i
|
|
1115
1115
|
} = e;
|
|
1116
|
-
const o = [...t === "clippingAncestors" ?
|
|
1117
|
-
const p = dt(a, c,
|
|
1116
|
+
const o = [...t === "clippingAncestors" ? ze(a) ? [] : Wa(a, this._c) : [].concat(t), n], s = o[0], d = o.reduce((l, c) => {
|
|
1117
|
+
const p = dt(a, c, i);
|
|
1118
1118
|
return l.top = te(p.top, l.top), l.right = le(p.right, l.right), l.bottom = le(p.bottom, l.bottom), l.left = te(p.left, l.left), l;
|
|
1119
|
-
}, dt(a, s,
|
|
1119
|
+
}, dt(a, s, i));
|
|
1120
1120
|
return {
|
|
1121
1121
|
width: d.right - d.left,
|
|
1122
1122
|
height: d.bottom - d.top,
|
|
@@ -1135,22 +1135,22 @@ function Ga(e) {
|
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
1137
|
function Xa(e, a, t) {
|
|
1138
|
-
const n = K(a),
|
|
1138
|
+
const n = K(a), i = G(a), r = t === "fixed", o = ie(e, !0, r, a);
|
|
1139
1139
|
let s = {
|
|
1140
1140
|
scrollLeft: 0,
|
|
1141
1141
|
scrollTop: 0
|
|
1142
1142
|
};
|
|
1143
1143
|
const d = W(0);
|
|
1144
1144
|
function l() {
|
|
1145
|
-
d.x = Fe(
|
|
1145
|
+
d.x = Fe(i);
|
|
1146
1146
|
}
|
|
1147
|
-
if (n || !n && !
|
|
1148
|
-
if ((ge(a) !== "body" || xe(
|
|
1149
|
-
const g =
|
|
1147
|
+
if (n || !n && !r)
|
|
1148
|
+
if ((ge(a) !== "body" || xe(i)) && (s = Ne(a)), n) {
|
|
1149
|
+
const g = ie(a, !0, r, a);
|
|
1150
1150
|
d.x = g.x + a.clientLeft, d.y = g.y + a.clientTop;
|
|
1151
|
-
} else
|
|
1152
|
-
|
|
1153
|
-
const c =
|
|
1151
|
+
} else i && l();
|
|
1152
|
+
r && !n && i && l();
|
|
1153
|
+
const c = i && !n && !r ? Mt(i, s) : W(0), p = o.left + s.scrollLeft - d.x - c.x, u = o.top + s.scrollTop - d.y - c.y;
|
|
1154
1154
|
return {
|
|
1155
1155
|
x: p,
|
|
1156
1156
|
y: u,
|
|
@@ -1171,21 +1171,21 @@ function lt(e, a) {
|
|
|
1171
1171
|
}
|
|
1172
1172
|
function Ct(e, a) {
|
|
1173
1173
|
const t = F(e);
|
|
1174
|
-
if (
|
|
1174
|
+
if (ze(e))
|
|
1175
1175
|
return t;
|
|
1176
1176
|
if (!K(e)) {
|
|
1177
|
-
let
|
|
1178
|
-
for (;
|
|
1179
|
-
if (B(
|
|
1180
|
-
return
|
|
1181
|
-
|
|
1177
|
+
let i = J(e);
|
|
1178
|
+
for (; i && !ce(i); ) {
|
|
1179
|
+
if (B(i) && !Ye(i))
|
|
1180
|
+
return i;
|
|
1181
|
+
i = J(i);
|
|
1182
1182
|
}
|
|
1183
1183
|
return t;
|
|
1184
1184
|
}
|
|
1185
1185
|
let n = lt(e, a);
|
|
1186
|
-
for (; n &&
|
|
1186
|
+
for (; n && ka(n) && Ye(n); )
|
|
1187
1187
|
n = lt(n, a);
|
|
1188
|
-
return n && ce(n) && Ye(n) && !Xe(n) ? t : n ||
|
|
1188
|
+
return n && ce(n) && Ye(n) && !Xe(n) ? t : n || Na(e) || t;
|
|
1189
1189
|
}
|
|
1190
1190
|
const Ja = async function(e) {
|
|
1191
1191
|
const a = this.getOffsetParent || Ct, t = this.getDimensions, n = await t(e.floating);
|
|
@@ -1219,13 +1219,13 @@ function Et(e, a) {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
function Za(e, a) {
|
|
1221
1221
|
let t = null, n;
|
|
1222
|
-
const
|
|
1223
|
-
function
|
|
1222
|
+
const i = G(e);
|
|
1223
|
+
function r() {
|
|
1224
1224
|
var s;
|
|
1225
1225
|
clearTimeout(n), (s = t) == null || s.disconnect(), t = null;
|
|
1226
1226
|
}
|
|
1227
1227
|
function o(s, d) {
|
|
1228
|
-
s === void 0 && (s = !1), d === void 0 && (d = 1),
|
|
1228
|
+
s === void 0 && (s = !1), d === void 0 && (d = 1), r();
|
|
1229
1229
|
const l = e.getBoundingClientRect(), {
|
|
1230
1230
|
left: c,
|
|
1231
1231
|
top: p,
|
|
@@ -1234,7 +1234,7 @@ function Za(e, a) {
|
|
|
1234
1234
|
} = l;
|
|
1235
1235
|
if (s || a(), !u || !g)
|
|
1236
1236
|
return;
|
|
1237
|
-
const m = Me(p), f = Me(
|
|
1237
|
+
const m = Me(p), f = Me(i.clientWidth - (c + u)), y = Me(i.clientHeight - (p + g)), h = Me(c), C = {
|
|
1238
1238
|
rootMargin: -m + "px " + -f + "px " + -y + "px " + -h + "px",
|
|
1239
1239
|
threshold: te(0, le(1, d)) || 1
|
|
1240
1240
|
};
|
|
@@ -1254,28 +1254,28 @@ function Za(e, a) {
|
|
|
1254
1254
|
t = new IntersectionObserver(_, {
|
|
1255
1255
|
...C,
|
|
1256
1256
|
// Handle <iframe>s
|
|
1257
|
-
root:
|
|
1257
|
+
root: i.ownerDocument
|
|
1258
1258
|
});
|
|
1259
1259
|
} catch {
|
|
1260
1260
|
t = new IntersectionObserver(_, C);
|
|
1261
1261
|
}
|
|
1262
1262
|
t.observe(e);
|
|
1263
1263
|
}
|
|
1264
|
-
return o(!0),
|
|
1264
|
+
return o(!0), r;
|
|
1265
1265
|
}
|
|
1266
1266
|
function Rt(e, a, t, n) {
|
|
1267
1267
|
n === void 0 && (n = {});
|
|
1268
1268
|
const {
|
|
1269
|
-
ancestorScroll:
|
|
1270
|
-
ancestorResize:
|
|
1269
|
+
ancestorScroll: i = !0,
|
|
1270
|
+
ancestorResize: r = !0,
|
|
1271
1271
|
elementResize: o = typeof ResizeObserver == "function",
|
|
1272
1272
|
layoutShift: s = typeof IntersectionObserver == "function",
|
|
1273
1273
|
animationFrame: d = !1
|
|
1274
|
-
} = n, l = Qe(e), c =
|
|
1274
|
+
} = n, l = Qe(e), c = i || r ? [...l ? ue(l) : [], ...ue(a)] : [];
|
|
1275
1275
|
c.forEach((h) => {
|
|
1276
|
-
|
|
1276
|
+
i && h.addEventListener("scroll", t, {
|
|
1277
1277
|
passive: !0
|
|
1278
|
-
}),
|
|
1278
|
+
}), r && h.addEventListener("resize", t);
|
|
1279
1279
|
});
|
|
1280
1280
|
const p = l && s ? Za(l, t) : null;
|
|
1281
1281
|
let u = -1, g = null;
|
|
@@ -1286,30 +1286,30 @@ function Rt(e, a, t, n) {
|
|
|
1286
1286
|
(C = g) == null || C.observe(a);
|
|
1287
1287
|
})), t();
|
|
1288
1288
|
}), l && !d && g.observe(l), g.observe(a));
|
|
1289
|
-
let m, f = d ?
|
|
1289
|
+
let m, f = d ? ie(e) : null;
|
|
1290
1290
|
d && y();
|
|
1291
1291
|
function y() {
|
|
1292
|
-
const h =
|
|
1292
|
+
const h = ie(e);
|
|
1293
1293
|
f && !Et(f, h) && t(), f = h, m = requestAnimationFrame(y);
|
|
1294
1294
|
}
|
|
1295
1295
|
return t(), () => {
|
|
1296
1296
|
var h;
|
|
1297
1297
|
c.forEach((M) => {
|
|
1298
|
-
|
|
1298
|
+
i && M.removeEventListener("scroll", t), r && M.removeEventListener("resize", t);
|
|
1299
1299
|
}), p == null || p(), (h = g) == null || h.disconnect(), g = null, d && cancelAnimationFrame(m);
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
1302
|
const Ae = Ea, Le = Ra, Ze = Sa, At = Ma, et = (e, a, t) => {
|
|
1303
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1303
|
+
const n = /* @__PURE__ */ new Map(), i = {
|
|
1304
1304
|
platform: It,
|
|
1305
1305
|
...t
|
|
1306
|
-
},
|
|
1307
|
-
...
|
|
1306
|
+
}, r = {
|
|
1307
|
+
...i.platform,
|
|
1308
1308
|
_c: n
|
|
1309
1309
|
};
|
|
1310
1310
|
return xa(e, a, {
|
|
1311
|
-
...
|
|
1312
|
-
platform:
|
|
1311
|
+
...i,
|
|
1312
|
+
platform: r
|
|
1313
1313
|
});
|
|
1314
1314
|
}, en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1315
1315
|
__proto__: null,
|
|
@@ -1324,7 +1324,7 @@ const Ae = Ea, Le = Ra, Ze = Sa, At = Ma, et = (e, a, t) => {
|
|
|
1324
1324
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1325
1325
|
let Se = null;
|
|
1326
1326
|
function Lt(e) {
|
|
1327
|
-
e.options.positioningMode !== "inline" && (O.debug("show() - adding visible class"), e.requiresApplyButton() && e.input && (e.originalInputValue = e.input.value, O.debug("show() - stored original input value:", e.originalInputValue)), e.isFirstRender && (e.renderCalendar(), e.isFirstRender = !1,
|
|
1327
|
+
e.options.positioningMode !== "inline" && (O.debug("show() - adding visible class"), e.requiresApplyButton() && e.input && (e.originalInputValue = e.input.value, O.debug("show() - stored original input value:", e.originalInputValue)), e.isFirstRender && (e.renderCalendar(), e.isFirstRender = !1, Tt(e)), e.calendar.classList.add("drp-date-picker--visible"), e.isCalendarActive = !0, O.debug("show() - calendar classes:", e.calendar.className), qe(e), Se = Rt(e.input, e.calendar, () => {
|
|
1328
1328
|
qe(e);
|
|
1329
1329
|
}), e.clickOutsideHandler && setTimeout(() => {
|
|
1330
1330
|
document.addEventListener("click", e.clickOutsideHandler);
|
|
@@ -1333,7 +1333,7 @@ function Lt(e) {
|
|
|
1333
1333
|
O.debug("show() - computed styles - display:", a.display, "position:", a.position, "left:", a.left, "top:", a.top, "z-index:", a.zIndex);
|
|
1334
1334
|
}, 100));
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function kt(e) {
|
|
1337
1337
|
if (e.options.positioningMode !== "inline" && e.calendar.classList.contains("drp-date-picker--visible")) {
|
|
1338
1338
|
Se && (Se(), Se = null), e.clickOutsideHandler && document.removeEventListener("click", e.clickOutsideHandler), e.calendar.classList.remove("drp-date-picker--visible"), e.isCalendarActive = !1, e.requiresApplyButton() && e.pendingSelection && e.input && (O.debug("hide() - restoring original input value:", e.originalInputValue), e.originalInputValue !== null && (e.input.value = e.originalInputValue), e.options.selectionMode === "range" ? (e.selectedStartDate = e.committedStartDate, e.selectedEndDate = e.committedEndDate) : e.options.selectionMode === "single" && (e.selectedDate = e.committedDate), O.debug("hide() - reverted selection state")), e.pendingSelection = null;
|
|
1339
1339
|
for (let a = 0; a < e.showingRollingSelector.length; a++)
|
|
@@ -1342,7 +1342,7 @@ function Tt(e) {
|
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
function tn(e) {
|
|
1345
|
-
e.calendar.classList.contains("drp-date-picker--visible") ?
|
|
1345
|
+
e.calendar.classList.contains("drp-date-picker--visible") ? kt(e) : Lt(e);
|
|
1346
1346
|
}
|
|
1347
1347
|
async function qe(e) {
|
|
1348
1348
|
if (O.debug("position() - locked placement:", e.lockedPlacement), !e.input)
|
|
@@ -1356,7 +1356,7 @@ async function qe(e) {
|
|
|
1356
1356
|
async function an(e, a, t) {
|
|
1357
1357
|
if (!e.tooltip || !e.tooltipArrow) return;
|
|
1358
1358
|
e.currentTooltipTarget = a, e.tooltip.innerHTML = t, e.tooltip.appendChild(e.tooltipArrow), e.tooltip.classList.add("drp-date-picker__tooltip--visible");
|
|
1359
|
-
const { x: n, y:
|
|
1359
|
+
const { x: n, y: i, placement: r, middlewareData: o } = await et(a, e.tooltip, {
|
|
1360
1360
|
placement: "top",
|
|
1361
1361
|
middleware: [
|
|
1362
1362
|
Ae(6),
|
|
@@ -1367,14 +1367,14 @@ async function an(e, a, t) {
|
|
|
1367
1367
|
});
|
|
1368
1368
|
if (Object.assign(e.tooltip.style, {
|
|
1369
1369
|
left: `${n}px`,
|
|
1370
|
-
top: `${
|
|
1370
|
+
top: `${i}px`
|
|
1371
1371
|
}), o.arrow) {
|
|
1372
1372
|
const { x: s, y: d } = o.arrow, l = {
|
|
1373
1373
|
top: "bottom",
|
|
1374
1374
|
right: "left",
|
|
1375
1375
|
bottom: "top",
|
|
1376
1376
|
left: "right"
|
|
1377
|
-
}[
|
|
1377
|
+
}[r.split("-")[0]];
|
|
1378
1378
|
Object.assign(e.tooltipArrow.style, {
|
|
1379
1379
|
left: s != null ? `${s}px` : "",
|
|
1380
1380
|
top: d != null ? `${d}px` : "",
|
|
@@ -1387,7 +1387,7 @@ async function an(e, a, t) {
|
|
|
1387
1387
|
function nn(e) {
|
|
1388
1388
|
e.tooltip && (e.tooltip.classList.remove("drp-date-picker__tooltip--visible"), e.currentTooltipTarget = void 0);
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function ke(e) {
|
|
1391
1391
|
if (e.loadingOverlay) return;
|
|
1392
1392
|
const a = document.createElement("div");
|
|
1393
1393
|
a.className = "drp-date-picker__loading-overlay", a.innerHTML = `
|
|
@@ -1399,13 +1399,13 @@ function ae(e) {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
function j(e, a, t) {
|
|
1401
1401
|
for (let n = 1; n <= 31; n++) {
|
|
1402
|
-
const
|
|
1403
|
-
if (
|
|
1402
|
+
const i = new Date(a, t, n);
|
|
1403
|
+
if (i.getMonth() === t && !e.isDateDisabledInternal(i))
|
|
1404
1404
|
return !0;
|
|
1405
1405
|
}
|
|
1406
1406
|
return !1;
|
|
1407
1407
|
}
|
|
1408
|
-
async function
|
|
1408
|
+
async function Tt(e) {
|
|
1409
1409
|
var a, t;
|
|
1410
1410
|
if (e.options.beforeMonthChangedCallback) {
|
|
1411
1411
|
if (e.isMonthChanging) {
|
|
@@ -1414,47 +1414,47 @@ async function kt(e) {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
try {
|
|
1416
1416
|
if (e.isMonthChanging = !0, e.options.unifiedNavigation) {
|
|
1417
|
-
const n = e.options.unifiedNavigationAnchorIndex ?? 0,
|
|
1417
|
+
const n = e.options.unifiedNavigationAnchorIndex ?? 0, i = e.monthDates[n], r = i.getFullYear(), o = i.getMonth();
|
|
1418
1418
|
let s = 1 / 0, d = 1 / 0, l = -1 / 0, c = -1 / 0;
|
|
1419
1419
|
for (let A = 0; A < e.monthDates.length; A++) {
|
|
1420
1420
|
const D = e.monthDates[A], x = D.getFullYear(), S = D.getMonth();
|
|
1421
1421
|
(x < s || x === s && S < d) && (s = x, d = S), (x > l || x === l && S > c) && (l = x, c = S);
|
|
1422
1422
|
}
|
|
1423
1423
|
const g = (new Date(s, d, 1).getDay() - e.weekStartDay + 7) % 7, m = new Date(s, d, 1 - g), f = new Date(l, c + 1, 0).getDate(), h = new Date(l, c, f).getDay(), M = (e.weekStartDay + 6 - h) % 7, C = new Date(l, c, f + M), E = {
|
|
1424
|
-
year:
|
|
1424
|
+
year: r,
|
|
1425
1425
|
month: o,
|
|
1426
1426
|
monthIndex: n,
|
|
1427
1427
|
firstVisibleDate: m,
|
|
1428
1428
|
lastVisibleDate: C
|
|
1429
1429
|
};
|
|
1430
|
-
w.debug(`handleInitialMonthLoad() [UNIFIED] - calling callback for ${
|
|
1430
|
+
w.debug(`handleInitialMonthLoad() [UNIFIED] - calling callback for ${r}-${o + 1}, range: ${m.toISOString().split("T")[0]} to ${C.toISOString().split("T")[0]}`);
|
|
1431
1431
|
const _ = e.options.beforeMonthChangedCallback(E), v = _ instanceof Promise;
|
|
1432
|
-
v &&
|
|
1432
|
+
v && ke(e);
|
|
1433
1433
|
const I = await Promise.resolve(_);
|
|
1434
1434
|
v && ae(e), w.debug(`handleInitialMonthLoad() [UNIFIED] - callback completed, metadata items: ${((a = I.metadata) == null ? void 0 : a.size) || 0}`), I.metadata && (e.bulkMetadataCache = I.metadata, w.debug(`handleInitialMonthLoad() [UNIFIED] - bulk metadata cache updated with ${I.metadata.size} entries`), e.renderCalendar());
|
|
1435
1435
|
} else {
|
|
1436
1436
|
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - calling callback for ${e.monthDates.length} months`);
|
|
1437
1437
|
const n = /* @__PURE__ */ new Map();
|
|
1438
|
-
let
|
|
1439
|
-
for (let
|
|
1440
|
-
const o = e.monthDates[
|
|
1438
|
+
let i = !1;
|
|
1439
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1440
|
+
const o = e.monthDates[r], s = o.getFullYear(), d = o.getMonth(), p = (new Date(s, d, 1).getDay() - e.weekStartDay + 7) % 7, u = new Date(s, d, 1 - p), g = new Date(u);
|
|
1441
1441
|
g.setDate(u.getDate() + 41);
|
|
1442
1442
|
const m = {
|
|
1443
1443
|
year: s,
|
|
1444
1444
|
month: d,
|
|
1445
|
-
monthIndex:
|
|
1445
|
+
monthIndex: r,
|
|
1446
1446
|
firstVisibleDate: u,
|
|
1447
1447
|
lastVisibleDate: g
|
|
1448
1448
|
};
|
|
1449
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${
|
|
1449
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${r} - calling callback for ${s}-${d + 1}, range: ${u.toISOString().split("T")[0]} to ${g.toISOString().split("T")[0]}`);
|
|
1450
1450
|
const f = e.options.beforeMonthChangedCallback(m);
|
|
1451
|
-
f instanceof Promise && !
|
|
1451
|
+
f instanceof Promise && !i && (i = !0, ke(e));
|
|
1452
1452
|
const h = await Promise.resolve(f);
|
|
1453
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${
|
|
1453
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${r} - callback completed, metadata items: ${((t = h.metadata) == null ? void 0 : t.size) || 0}`), h.metadata && h.metadata.forEach((M, C) => {
|
|
1454
1454
|
n.set(C, M);
|
|
1455
1455
|
});
|
|
1456
1456
|
}
|
|
1457
|
-
|
|
1457
|
+
i && ae(e), n.size > 0 && (e.bulkMetadataCache = n, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined metadata cache updated with ${n.size} entries`), e.renderCalendar());
|
|
1458
1458
|
}
|
|
1459
1459
|
} catch (n) {
|
|
1460
1460
|
ae(e), w.debug("handleInitialMonthLoad() - error in callback:", n), console.error("[DateRangePicker] Error in beforeMonthChangedCallback (initial load):", n);
|
|
@@ -1464,14 +1464,14 @@ async function kt(e) {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
1466
1466
|
async function Z(e, a, t, n) {
|
|
1467
|
-
var
|
|
1467
|
+
var i;
|
|
1468
1468
|
if (!e.options.beforeMonthChangedCallback)
|
|
1469
1469
|
return !0;
|
|
1470
1470
|
if (e.isMonthChanging)
|
|
1471
1471
|
return w.debug("handleBeforeMonthChange() - already changing month, ignoring"), !1;
|
|
1472
1472
|
try {
|
|
1473
1473
|
e.isMonthChanging = !0;
|
|
1474
|
-
let
|
|
1474
|
+
let r, o;
|
|
1475
1475
|
if (e.options.unifiedNavigation) {
|
|
1476
1476
|
let p = 1 / 0, u = 1 / 0, g = -1 / 0, m = -1 / 0;
|
|
1477
1477
|
for (let v = 0; v < e.monthDates.length; v++) {
|
|
@@ -1479,29 +1479,29 @@ async function Z(e, a, t, n) {
|
|
|
1479
1479
|
(A < p || A === p && D < u) && (p = A, u = D), (A > g || A === g && D > m) && (g = A, m = D);
|
|
1480
1480
|
}
|
|
1481
1481
|
const h = (new Date(p, u, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1482
|
-
|
|
1482
|
+
r = new Date(p, u, 1 - h);
|
|
1483
1483
|
const M = new Date(g, m + 1, 0).getDate(), E = new Date(g, m, M).getDay(), _ = (e.weekStartDay + 6 - E) % 7;
|
|
1484
1484
|
o = new Date(g, m, M + _);
|
|
1485
1485
|
} else {
|
|
1486
1486
|
const g = (new Date(a, t, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1487
|
-
|
|
1487
|
+
r = new Date(a, t, 1 - g), o = new Date(r), o.setDate(r.getDate() + 41);
|
|
1488
1488
|
}
|
|
1489
1489
|
const s = {
|
|
1490
1490
|
year: a,
|
|
1491
1491
|
month: t,
|
|
1492
1492
|
monthIndex: n,
|
|
1493
|
-
firstVisibleDate:
|
|
1493
|
+
firstVisibleDate: r,
|
|
1494
1494
|
lastVisibleDate: o
|
|
1495
1495
|
};
|
|
1496
|
-
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${
|
|
1496
|
+
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${r.toISOString().split("T")[0]} to ${o.toISOString().split("T")[0]}`);
|
|
1497
1497
|
const d = e.options.beforeMonthChangedCallback(s), l = d instanceof Promise;
|
|
1498
|
-
l &&
|
|
1498
|
+
l && ke(e);
|
|
1499
1499
|
const c = await Promise.resolve(d);
|
|
1500
|
-
return l && ae(e), c.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${c.message || "no reason provided"}`), c.message && console.warn(`[DateRangePicker] Month navigation blocked: ${c.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((
|
|
1500
|
+
return l && ae(e), c.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${c.message || "no reason provided"}`), c.message && console.warn(`[DateRangePicker] Month navigation blocked: ${c.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((i = c.metadata) == null ? void 0 : i.size) || 0}`), c.metadata ? e.bulkMetadataCache ? (c.metadata.forEach((p, u) => {
|
|
1501
1501
|
e.bulkMetadataCache.set(u, p);
|
|
1502
1502
|
}), w.debug(`handleBeforeMonthChange() - merged ${c.metadata.size} entries into cache (total: ${e.bulkMetadataCache.size})`)) : (e.bulkMetadataCache = c.metadata, w.debug(`handleBeforeMonthChange() - bulk metadata cache created with ${c.metadata.size} entries`)) : e.bulkMetadataCache = null, !0);
|
|
1503
|
-
} catch (
|
|
1504
|
-
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:",
|
|
1503
|
+
} catch (r) {
|
|
1504
|
+
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:", r), console.error("[DateRangePicker] Error in beforeMonthChangedCallback:", r), !1;
|
|
1505
1505
|
} finally {
|
|
1506
1506
|
e.isMonthChanging = !1;
|
|
1507
1507
|
}
|
|
@@ -1515,8 +1515,8 @@ async function on(e, a, t) {
|
|
|
1515
1515
|
w.debug(`selectYear() Col${t} - navigation blocked by callback`);
|
|
1516
1516
|
return;
|
|
1517
1517
|
}
|
|
1518
|
-
const
|
|
1519
|
-
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${
|
|
1518
|
+
const r = e.monthDates[t].getFullYear();
|
|
1519
|
+
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${r} to ${a}`), De(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1520
1520
|
}
|
|
1521
1521
|
async function sn(e, a, t) {
|
|
1522
1522
|
const n = e.monthDates[t].getFullYear();
|
|
@@ -1524,81 +1524,81 @@ async function sn(e, a, t) {
|
|
|
1524
1524
|
w.debug(`selectMonth() Col${t} - navigation blocked by callback`);
|
|
1525
1525
|
return;
|
|
1526
1526
|
}
|
|
1527
|
-
const
|
|
1528
|
-
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${
|
|
1527
|
+
const r = e.monthDates[t].getMonth();
|
|
1528
|
+
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${r + 1} to ${a + 1}`), De(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1529
1529
|
}
|
|
1530
1530
|
function De(e, a) {
|
|
1531
1531
|
const t = e.monthDates[a];
|
|
1532
1532
|
if (a < e.monthDates.length - 1) {
|
|
1533
1533
|
const n = e.monthDates[a + 1];
|
|
1534
|
-
if (
|
|
1534
|
+
if (Te(t, n)) {
|
|
1535
1535
|
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a + 1}, shifting forward`);
|
|
1536
|
-
const
|
|
1537
|
-
e.monthDates[a + 1] =
|
|
1536
|
+
const i = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
1537
|
+
e.monthDates[a + 1] = i, De(e, a + 1);
|
|
1538
1538
|
}
|
|
1539
1539
|
}
|
|
1540
1540
|
if (a > 0) {
|
|
1541
1541
|
const n = e.monthDates[a - 1];
|
|
1542
|
-
if (
|
|
1542
|
+
if (Te(n, t)) {
|
|
1543
1543
|
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a - 1}, shifting backward`);
|
|
1544
|
-
const
|
|
1545
|
-
e.monthDates[a - 1] =
|
|
1544
|
+
const i = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
1545
|
+
e.monthDates[a - 1] = i, De(e, a - 1);
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1550
|
-
const t = e.getFullYear(), n = e.getMonth(),
|
|
1551
|
-
return t >
|
|
1549
|
+
function Te(e, a) {
|
|
1550
|
+
const t = e.getFullYear(), n = e.getMonth(), i = a.getFullYear(), r = a.getMonth();
|
|
1551
|
+
return t > i || t === i && n >= r;
|
|
1552
1552
|
}
|
|
1553
1553
|
async function be(e, a) {
|
|
1554
1554
|
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
1555
1555
|
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
1556
|
-
const n = e.monthDates[t],
|
|
1557
|
-
if (!j(e,
|
|
1556
|
+
const n = e.monthDates[t], i = new Date(n.getFullYear(), n.getMonth() - 1, 1);
|
|
1557
|
+
if (!j(e, i.getFullYear(), i.getMonth())) {
|
|
1558
1558
|
w.debug(`prevMonth() Col${t} - navigation blocked: target month has no enabled days`);
|
|
1559
1559
|
return;
|
|
1560
1560
|
}
|
|
1561
|
-
if (!await Z(e,
|
|
1561
|
+
if (!await Z(e, i.getFullYear(), i.getMonth(), t)) {
|
|
1562
1562
|
w.debug(`prevMonth() Col${t} - navigation blocked by callback`);
|
|
1563
1563
|
return;
|
|
1564
1564
|
}
|
|
1565
|
-
if (e.monthDates[t] =
|
|
1565
|
+
if (e.monthDates[t] = i, w.debug(`prevMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${i.getFullYear()}-${i.getMonth() + 1}`), t > 0) {
|
|
1566
1566
|
const o = e.monthDates[t - 1];
|
|
1567
|
-
|
|
1567
|
+
Te(o, i) && (w.debug(`prevMonth() Col${t} - collision detected with Col${t - 1}, shifting previous columns back`), await be(e, t - 1));
|
|
1568
1568
|
}
|
|
1569
1569
|
e.renderCalendar();
|
|
1570
1570
|
}
|
|
1571
1571
|
async function ye(e, a) {
|
|
1572
1572
|
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
1573
1573
|
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
1574
|
-
const n = e.monthDates[t],
|
|
1575
|
-
if (!j(e,
|
|
1574
|
+
const n = e.monthDates[t], i = new Date(n.getFullYear(), n.getMonth() + 1, 1);
|
|
1575
|
+
if (!j(e, i.getFullYear(), i.getMonth())) {
|
|
1576
1576
|
w.debug(`nextMonth() Col${t} - navigation blocked: target month has no enabled days`);
|
|
1577
1577
|
return;
|
|
1578
1578
|
}
|
|
1579
|
-
if (!await Z(e,
|
|
1579
|
+
if (!await Z(e, i.getFullYear(), i.getMonth(), t)) {
|
|
1580
1580
|
w.debug(`nextMonth() Col${t} - navigation blocked by callback`);
|
|
1581
1581
|
return;
|
|
1582
1582
|
}
|
|
1583
|
-
if (e.monthDates[t] =
|
|
1583
|
+
if (e.monthDates[t] = i, w.debug(`nextMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${i.getFullYear()}-${i.getMonth() + 1}`), t < e.monthDates.length - 1) {
|
|
1584
1584
|
const o = e.monthDates[t + 1];
|
|
1585
|
-
|
|
1585
|
+
Te(i, o) && (w.debug(`nextMonth() Col${t} - collision detected with Col${t + 1}, shifting next columns forward`), await ye(e, t + 1));
|
|
1586
1586
|
}
|
|
1587
1587
|
e.renderCalendar();
|
|
1588
1588
|
}
|
|
1589
|
-
function fe(e, a, t, n,
|
|
1590
|
-
let
|
|
1589
|
+
function fe(e, a, t, n, i) {
|
|
1590
|
+
let r = a, o = 0;
|
|
1591
1591
|
const s = 60;
|
|
1592
1592
|
for (; o < s; ) {
|
|
1593
|
-
if (
|
|
1594
|
-
const l = n[
|
|
1593
|
+
if (r >= 0 && r < n.length) {
|
|
1594
|
+
const l = n[r].dataset.date;
|
|
1595
1595
|
if (l) {
|
|
1596
1596
|
const [c, p, u] = l.split("-").map(Number), g = new Date(c, p - 1, u);
|
|
1597
1597
|
if (!e.isDateDisabledInternal(g))
|
|
1598
|
-
return { index:
|
|
1598
|
+
return { index: r, monthChanged: !1 };
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
|
-
if (
|
|
1601
|
+
if (r += t, o++, r < 0 || r >= n.length)
|
|
1602
1602
|
return { index: null, monthChanged: !0, direction: t > 0 ? "next" : "prev" };
|
|
1603
1603
|
}
|
|
1604
1604
|
return { index: null, monthChanged: !1 };
|
|
@@ -1618,8 +1618,8 @@ function dn(e, a) {
|
|
|
1618
1618
|
e.focusedDayIndex = c !== -1 ? c : 0, w.debug(`moveFocus() Col${e.activeMonthIndex} - initialized focusedDayIndex to ${e.focusedDayIndex} (today or first day), will move by offset ${a}`);
|
|
1619
1619
|
}
|
|
1620
1620
|
(o = n[e.focusedDayIndex]) == null || o.classList.remove("drp-date-picker__day--focused");
|
|
1621
|
-
const
|
|
1622
|
-
if (
|
|
1621
|
+
const i = e.focusedDayIndex + a;
|
|
1622
|
+
if (i < 0) {
|
|
1623
1623
|
const c = e.activeMonthIndex;
|
|
1624
1624
|
if (a === -1)
|
|
1625
1625
|
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`), be(e, e.activeMonthIndex), setTimeout(() => {
|
|
@@ -1639,14 +1639,14 @@ function dn(e, a) {
|
|
|
1639
1639
|
if (!M) return;
|
|
1640
1640
|
const C = M.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), _ = C[C.length - 1].dataset.date;
|
|
1641
1641
|
if (_) {
|
|
1642
|
-
const [A, D, x] = _.split("-").map(Number), R = new Date(A, D - 1, x).getDay(),
|
|
1643
|
-
e.focusedDayIndex = C.length - 1 -
|
|
1642
|
+
const [A, D, x] = _.split("-").map(Number), R = new Date(A, D - 1, x).getDay(), T = (R - h + 7) % 7;
|
|
1643
|
+
e.focusedDayIndex = C.length - 1 - T, w.debug(`moveFocus() Col${c} - last day weekday ${R}, target ${h}, focusing on day ${e.focusedDayIndex + 1}`), (v = C[e.focusedDayIndex]) == null || v.classList.add("drp-date-picker__day--focused"), (I = C[e.focusedDayIndex]) == null || I.scrollIntoView({ block: "nearest" });
|
|
1644
1644
|
}
|
|
1645
1645
|
}, 0);
|
|
1646
1646
|
}
|
|
1647
1647
|
}
|
|
1648
1648
|
return;
|
|
1649
|
-
} else if (
|
|
1649
|
+
} else if (i >= n.length) {
|
|
1650
1650
|
const c = e.activeMonthIndex;
|
|
1651
1651
|
if (a === 1)
|
|
1652
1652
|
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`), ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
@@ -1666,24 +1666,24 @@ function dn(e, a) {
|
|
|
1666
1666
|
if (!M) return;
|
|
1667
1667
|
const C = M.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), _ = C[0].dataset.date;
|
|
1668
1668
|
if (_) {
|
|
1669
|
-
const [A, D, x] = _.split("-").map(Number), R = new Date(A, D - 1, x).getDay(),
|
|
1670
|
-
e.focusedDayIndex =
|
|
1669
|
+
const [A, D, x] = _.split("-").map(Number), R = new Date(A, D - 1, x).getDay(), T = (h - R + 7) % 7;
|
|
1670
|
+
e.focusedDayIndex = T, w.debug(`moveFocus() Col${c} - first day weekday ${R}, target ${h}, focusing on day ${e.focusedDayIndex + 1}`), (v = C[e.focusedDayIndex]) == null || v.classList.add("drp-date-picker__day--focused"), (I = C[e.focusedDayIndex]) == null || I.scrollIntoView({ block: "nearest" });
|
|
1671
1671
|
}
|
|
1672
1672
|
}, 0);
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
1675
|
return;
|
|
1676
1676
|
}
|
|
1677
|
-
const
|
|
1678
|
-
if (
|
|
1677
|
+
const r = fe(e, i, a, n, e.activeMonthIndex);
|
|
1678
|
+
if (r.monthChanged) {
|
|
1679
1679
|
const c = e.activeMonthIndex;
|
|
1680
|
-
|
|
1680
|
+
r.direction === "next" ? ye(e, e.activeMonthIndex) : be(e, e.activeMonthIndex), setTimeout(() => {
|
|
1681
1681
|
var m, f;
|
|
1682
1682
|
const p = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1683
1683
|
if (!p) return;
|
|
1684
1684
|
const u = p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = fe(
|
|
1685
1685
|
e,
|
|
1686
|
-
|
|
1686
|
+
r.direction === "next" ? 0 : u.length - 1,
|
|
1687
1687
|
a,
|
|
1688
1688
|
u
|
|
1689
1689
|
);
|
|
@@ -1691,7 +1691,7 @@ function dn(e, a) {
|
|
|
1691
1691
|
}, 0);
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
1694
|
-
|
|
1694
|
+
r.index !== null ? (e.focusedDayIndex = r.index, (s = n[e.focusedDayIndex]) == null || s.classList.add("drp-date-picker__day--focused"), (d = n[e.focusedDayIndex]) == null || d.scrollIntoView({ block: "nearest" })) : (w.debug("moveFocus() - no enabled day found in search range"), (l = n[e.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"));
|
|
1695
1695
|
}
|
|
1696
1696
|
async function ln(e) {
|
|
1697
1697
|
if (!e.options.unifiedNavigation) return;
|
|
@@ -1701,9 +1701,9 @@ async function ln(e) {
|
|
|
1701
1701
|
return;
|
|
1702
1702
|
}
|
|
1703
1703
|
if (await Z(e, n.getFullYear(), n.getMonth(), a)) {
|
|
1704
|
-
for (let
|
|
1705
|
-
const o =
|
|
1706
|
-
e.monthDates[
|
|
1704
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1705
|
+
const o = r - a;
|
|
1706
|
+
e.monthDates[r] = new Date(n.getFullYear(), n.getMonth() + o, 1);
|
|
1707
1707
|
}
|
|
1708
1708
|
e.renderCalendar();
|
|
1709
1709
|
}
|
|
@@ -1716,9 +1716,9 @@ async function cn(e) {
|
|
|
1716
1716
|
return;
|
|
1717
1717
|
}
|
|
1718
1718
|
if (await Z(e, n.getFullYear(), n.getMonth(), a)) {
|
|
1719
|
-
for (let
|
|
1720
|
-
const o =
|
|
1721
|
-
e.monthDates[
|
|
1719
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1720
|
+
const o = r - a;
|
|
1721
|
+
e.monthDates[r] = new Date(n.getFullYear(), n.getMonth() + o, 1);
|
|
1722
1722
|
}
|
|
1723
1723
|
e.renderCalendar();
|
|
1724
1724
|
}
|
|
@@ -1727,9 +1727,9 @@ async function un(e, a) {
|
|
|
1727
1727
|
if (!e.options.unifiedNavigation) return;
|
|
1728
1728
|
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getFullYear();
|
|
1729
1729
|
if (w.debug(`setUnifiedMonth(${a}) - anchor index: ${t}, year: ${n}`), !!await Z(e, n, a, t)) {
|
|
1730
|
-
for (let
|
|
1731
|
-
const o =
|
|
1732
|
-
e.monthDates[
|
|
1730
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1731
|
+
const o = r - t;
|
|
1732
|
+
e.monthDates[r] = new Date(n, a + o, 1);
|
|
1733
1733
|
}
|
|
1734
1734
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1735
1735
|
}
|
|
@@ -1741,9 +1741,9 @@ async function gn(e, a) {
|
|
|
1741
1741
|
if (!e.options.unifiedNavigation) return;
|
|
1742
1742
|
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getMonth();
|
|
1743
1743
|
if (w.debug(`setUnifiedYear(${a}) - anchor index: ${t}, month: ${n}`), !!await Z(e, a, n, t)) {
|
|
1744
|
-
for (let
|
|
1745
|
-
const o =
|
|
1746
|
-
e.monthDates[
|
|
1744
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1745
|
+
const o = r - t;
|
|
1746
|
+
e.monthDates[r] = new Date(a, n + o, 1);
|
|
1747
1747
|
}
|
|
1748
1748
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1749
1749
|
}
|
|
@@ -1751,14 +1751,14 @@ async function gn(e, a) {
|
|
|
1751
1751
|
function $t(e, a, t) {
|
|
1752
1752
|
if (!e) {
|
|
1753
1753
|
if (t != null && t.normalizedMinDate || t != null && t.normalizedMaxDate) {
|
|
1754
|
-
const n = t.normalizedMinDate ? t.normalizedMinDate.getFullYear() : a - 1,
|
|
1755
|
-
return { min: n, max:
|
|
1754
|
+
const n = t.normalizedMinDate ? t.normalizedMinDate.getFullYear() : a - 1, i = t.normalizedMaxDate ? t.normalizedMaxDate.getFullYear() : a + 1;
|
|
1755
|
+
return { min: n, max: i };
|
|
1756
1756
|
}
|
|
1757
1757
|
return { min: a - 1, max: a + 1 };
|
|
1758
1758
|
}
|
|
1759
1759
|
if (e.includes("-")) {
|
|
1760
|
-
const [n,
|
|
1761
|
-
return { min: parseInt(n, 10), max: parseInt(
|
|
1760
|
+
const [n, i] = e.split("-");
|
|
1761
|
+
return { min: parseInt(n, 10), max: parseInt(i, 10) };
|
|
1762
1762
|
} else {
|
|
1763
1763
|
const n = parseInt(e, 10);
|
|
1764
1764
|
return { min: n, max: n };
|
|
@@ -1773,7 +1773,7 @@ function Pt(e) {
|
|
|
1773
1773
|
function hn(e) {
|
|
1774
1774
|
de.debug("[DatePicker 18] renderCalendar called, showingRollingSelector:", e.showingRollingSelector, `activeCol: ${e.activeMonthIndex}`), de.debug("[DatePicker 18] monthDates array:", e.monthDates.map((a, t) => `Col${t}: ${a.getFullYear()}-${a.getMonth() + 1}`).join(", ")), e.options.unifiedNavigation && e.showingUnifiedRollingSelector && mn(e);
|
|
1775
1775
|
for (let a = 0; a < e.options.visibleMonthsCount; a++)
|
|
1776
|
-
e.showingRollingSelector[a] ? Ft(e, a) :
|
|
1776
|
+
e.showingRollingSelector[a] ? Ft(e, a) : zt(e, a);
|
|
1777
1777
|
if (e.focusedDayIndex !== null) {
|
|
1778
1778
|
const a = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
1779
1779
|
if (a) {
|
|
@@ -1783,14 +1783,14 @@ function hn(e) {
|
|
|
1783
1783
|
}
|
|
1784
1784
|
e.options.selectionMode === "range" && !e.isDragging && e.initDragListeners(), e.actionsContainer && e.renderButtons(e.actionsContainer);
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1786
|
+
function zt(e, a) {
|
|
1787
1787
|
de.debug(`[DatePicker Col${a} 19] renderNormalView called for month`, a);
|
|
1788
1788
|
const t = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
1789
1789
|
if (!t) return;
|
|
1790
1790
|
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
1791
1791
|
n == null || n.classList.remove("drp-date-picker__rolling-selector--visible");
|
|
1792
|
-
const
|
|
1793
|
-
if (
|
|
1792
|
+
const i = e.monthDates[a], r = t.querySelector(".drp-date-picker__month-year");
|
|
1793
|
+
if (r && (r.textContent = `${e.monthNames[i.getMonth()]} ${i.getFullYear()}`), e.options.unifiedNavigation && a === 0 && e.unifiedRangeDisplay) {
|
|
1794
1794
|
e.unifiedRollingSelector && !e.showingUnifiedRollingSelector && e.unifiedRollingSelector.classList.remove("drp-date-picker__unified-rolling-selector--visible");
|
|
1795
1795
|
const y = e.monthDates[0], h = e.monthDates[e.monthDates.length - 1], M = e.options.unifiedNavigationAnchorIndex ?? 0, C = e.monthDates[M];
|
|
1796
1796
|
if (e.options.getUnifiedHeaderCallback) {
|
|
@@ -1813,7 +1813,7 @@ function Nt(e, a) {
|
|
|
1813
1813
|
x && (j(e, A, D) ? (x.removeAttribute("disabled"), x.classList.remove("drp-date-picker__nav--disabled")) : (x.setAttribute("disabled", "true"), x.classList.add("drp-date-picker__nav--disabled")));
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
|
-
const o =
|
|
1816
|
+
const o = i.getFullYear(), s = i.getMonth(), d = s === 0 ? 11 : s - 1, l = s === 0 ? o - 1 : o, c = t.querySelector(".drp-date-picker__nav--prev");
|
|
1817
1817
|
c && (j(e, l, d) ? (c.removeAttribute("disabled"), c.classList.remove("drp-date-picker__nav--disabled")) : (c.setAttribute("disabled", "true"), c.classList.add("drp-date-picker__nav--disabled")));
|
|
1818
1818
|
const p = s === 11 ? 0 : s + 1, u = s === 11 ? o + 1 : o, g = t.querySelector(".drp-date-picker__nav--next");
|
|
1819
1819
|
g && (j(e, u, p) ? (g.removeAttribute("disabled"), g.classList.remove("drp-date-picker__nav--disabled")) : (g.setAttribute("disabled", "true"), g.classList.add("drp-date-picker__nav--disabled")));
|
|
@@ -1821,15 +1821,15 @@ function Nt(e, a) {
|
|
|
1821
1821
|
...e.weekdayNames.slice(e.weekStartDay),
|
|
1822
1822
|
...e.weekdayNames.slice(0, e.weekStartDay)
|
|
1823
1823
|
];
|
|
1824
|
-
m && (m.innerHTML = f.map((y) => `<div class="drp-date-picker__weekday">${y}</div>`).join("")),
|
|
1824
|
+
m && (m.innerHTML = f.map((y) => `<div class="drp-date-picker__weekday">${y}</div>`).join("")), Nt(e, a, i);
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1826
|
+
function Nt(e, a, t) {
|
|
1827
1827
|
de.debug(`[DatePicker Col${a} 20] renderDays called for month`, a);
|
|
1828
1828
|
const n = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
1829
1829
|
if (!n) return;
|
|
1830
|
-
const
|
|
1831
|
-
de.debug(`[DatePicker Col${a} 21] Rendering days for:`,
|
|
1832
|
-
const d = (new Date(
|
|
1830
|
+
const i = n.querySelector(".drp-date-picker__days"), r = t.getFullYear(), o = t.getMonth();
|
|
1831
|
+
de.debug(`[DatePicker Col${a} 21] Rendering days for:`, r, o + 1);
|
|
1832
|
+
const d = (new Date(r, o, 1).getDay() - e.weekStartDay + 7) % 7, l = new Date(r, o + 1, 0).getDate(), c = new Date(r, o, 0).getDate(), p = new Date(r, o - 1, 1), u = p.getFullYear(), g = p.getMonth(), m = new Date(r, o + 1, 1), f = m.getFullYear(), y = m.getMonth(), h = [];
|
|
1833
1833
|
for (let v = d - 1; v >= 0; v--) {
|
|
1834
1834
|
const I = c - v, A = new Date(u, g, I);
|
|
1835
1835
|
h.push({
|
|
@@ -1841,10 +1841,10 @@ function zt(e, a, t) {
|
|
|
1841
1841
|
});
|
|
1842
1842
|
}
|
|
1843
1843
|
for (let v = 1; v <= l; v++) {
|
|
1844
|
-
const I = new Date(
|
|
1844
|
+
const I = new Date(r, o, v);
|
|
1845
1845
|
h.push({
|
|
1846
1846
|
date: I,
|
|
1847
|
-
year:
|
|
1847
|
+
year: r,
|
|
1848
1848
|
month: o,
|
|
1849
1849
|
day: v,
|
|
1850
1850
|
isOtherMonth: !1
|
|
@@ -1870,7 +1870,7 @@ function zt(e, a, t) {
|
|
|
1870
1870
|
const x = e.getDateInfoInternal(D.date);
|
|
1871
1871
|
let S = (x == null ? void 0 : x.badgeTooltip) || "";
|
|
1872
1872
|
if (e.options.badgeTooltipCallback && (x != null && x.badgeText)) {
|
|
1873
|
-
const
|
|
1873
|
+
const T = {
|
|
1874
1874
|
date: D.date,
|
|
1875
1875
|
dateString: me(D.date),
|
|
1876
1876
|
dayNumber: D.day,
|
|
@@ -1886,7 +1886,7 @@ function zt(e, a, t) {
|
|
|
1886
1886
|
element: null,
|
|
1887
1887
|
// Not available during string rendering
|
|
1888
1888
|
picker: e
|
|
1889
|
-
}, L = e.options.badgeTooltipCallback(
|
|
1889
|
+
}, L = e.options.badgeTooltipCallback(T);
|
|
1890
1890
|
L !== null && (S = L);
|
|
1891
1891
|
}
|
|
1892
1892
|
return {
|
|
@@ -1911,14 +1911,14 @@ function zt(e, a, t) {
|
|
|
1911
1911
|
D.isOtherMonth && x.push("drp-date-picker__day--other-month");
|
|
1912
1912
|
const S = e.getDateInfoInternal(D.date), R = S && S.isDisabled !== void 0 ? S.isDisabled : e.isDateDisabledInternal(D.date);
|
|
1913
1913
|
R && x.push("drp-date-picker__day--disabled"), S && S.dayClass && x.push(S.dayClass), e.isToday(D.date) && x.push("drp-date-picker__day--today");
|
|
1914
|
-
let
|
|
1915
|
-
e.options.selectionMode === "single" ?
|
|
1916
|
-
let L = !1,
|
|
1914
|
+
let T = !1;
|
|
1915
|
+
e.options.selectionMode === "single" ? T = e.isSameDay(D.date, e.selectedDate) : e.options.selectionMode === "multiple" && (T = e.selectedDates.some((q) => e.isSameDay(D.date, q))), T && x.push("drp-date-picker__day--selected");
|
|
1916
|
+
let L = !1, z = !1, N = !1;
|
|
1917
1917
|
if (e.options.selectionMode === "range")
|
|
1918
|
-
L = e.isSameDay(D.date, e.selectedStartDate),
|
|
1918
|
+
L = e.isSameDay(D.date, e.selectedStartDate), z = e.isSameDay(D.date, e.selectedEndDate), N = e.isInRange(D.date), L && x.push("drp-date-picker__day--range-start"), z && x.push("drp-date-picker__day--range-end"), N && (!R || e.options.highlightDisabledInRange) && x.push("drp-date-picker__day--in-range");
|
|
1919
1919
|
else if (e.options.selectionMode === "multiple")
|
|
1920
1920
|
for (const q of e.selectedRanges)
|
|
1921
|
-
e.isSameDay(D.date, q.start) && (L = !0, x.push("drp-date-picker__day--range-start")), e.isSameDay(D.date, q.end) && (
|
|
1921
|
+
e.isSameDay(D.date, q.start) && (L = !0, x.push("drp-date-picker__day--range-start")), e.isSameDay(D.date, q.end) && (z = !0, x.push("drp-date-picker__day--range-end")), D.date >= q.start && D.date <= q.end && (N = !0, (!R || e.options.highlightDisabledInRange) && x.push("drp-date-picker__day--in-range"));
|
|
1922
1922
|
const $ = `${D.year}-${String(D.month + 1).padStart(2, "0")}-${String(D.day).padStart(2, "0")}`;
|
|
1923
1923
|
let P = (S == null ? void 0 : S.dayTooltip) || "";
|
|
1924
1924
|
if (e.options.dayTooltipCallback) {
|
|
@@ -1927,10 +1927,10 @@ function zt(e, a, t) {
|
|
|
1927
1927
|
dateString: $,
|
|
1928
1928
|
dayNumber: D.day,
|
|
1929
1929
|
isDisabled: R,
|
|
1930
|
-
isSelected:
|
|
1930
|
+
isSelected: T,
|
|
1931
1931
|
isStartDate: L,
|
|
1932
|
-
isEndDate:
|
|
1933
|
-
isInRange:
|
|
1932
|
+
isEndDate: z,
|
|
1933
|
+
isInRange: N,
|
|
1934
1934
|
isToday: e.isToday(D.date),
|
|
1935
1935
|
isWeekend: D.date.getDay() === 0 || D.date.getDay() === 6,
|
|
1936
1936
|
monthIndex: a,
|
|
@@ -1945,15 +1945,15 @@ function zt(e, a, t) {
|
|
|
1945
1945
|
}
|
|
1946
1946
|
_ += "</div>";
|
|
1947
1947
|
}
|
|
1948
|
-
|
|
1948
|
+
i && (i.innerHTML = _, fn(e, a, i));
|
|
1949
1949
|
}
|
|
1950
1950
|
function fn(e, a, t) {
|
|
1951
1951
|
if (!e.options.renderDayCallback && !e.options.renderDayContentCallback)
|
|
1952
1952
|
return;
|
|
1953
|
-
t.querySelectorAll(".drp-date-picker__day").forEach((
|
|
1954
|
-
const
|
|
1953
|
+
t.querySelectorAll(".drp-date-picker__day").forEach((i) => {
|
|
1954
|
+
const r = i, o = r.getAttribute("data-date"), s = parseInt(r.getAttribute("data-day-number") || "0", 10);
|
|
1955
1955
|
if (!o) return;
|
|
1956
|
-
const [d, l, c] = o.split("-"), p = new Date(parseInt(d), parseInt(l) - 1, parseInt(c)), u =
|
|
1956
|
+
const [d, l, c] = o.split("-"), p = new Date(parseInt(d), parseInt(l) - 1, parseInt(c)), u = r.querySelector(`slot[name="day-${o}"]`);
|
|
1957
1957
|
if (u && u.assignedNodes().length > 0)
|
|
1958
1958
|
return;
|
|
1959
1959
|
const m = e.isDateDisabledInternal(p), f = e.isToday(p), y = p.getDay() === 0 || p.getDay() === 6, h = e.options.selectionMode === "single" && e.isSameDay(p, e.selectedDate), M = e.options.selectionMode === "range" && e.isSameDay(p, e.selectedStartDate), C = e.options.selectionMode === "range" && e.isSameDay(p, e.selectedEndDate), E = e.options.selectionMode === "range" && e.isInRange(p), _ = {
|
|
@@ -1968,7 +1968,7 @@ function fn(e, a, t) {
|
|
|
1968
1968
|
isToday: f,
|
|
1969
1969
|
isWeekend: y,
|
|
1970
1970
|
monthIndex: a,
|
|
1971
|
-
element:
|
|
1971
|
+
element: r,
|
|
1972
1972
|
picker: e
|
|
1973
1973
|
};
|
|
1974
1974
|
if (e.options.renderDayCallback)
|
|
@@ -1992,10 +1992,10 @@ function Ft(e, a) {
|
|
|
1992
1992
|
if (!t) return;
|
|
1993
1993
|
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
1994
1994
|
n == null || n.classList.add("drp-date-picker__rolling-selector--visible");
|
|
1995
|
-
const
|
|
1995
|
+
const i = e.monthDates[a], r = i.getFullYear(), o = i.getMonth(), s = $t(e.options.rollingYearRange, r, e), d = Pt(e.options.rollingMonthRange), l = n == null ? void 0 : n.querySelector('[data-list="years"]');
|
|
1996
1996
|
let c = "";
|
|
1997
1997
|
for (let u = s.min; u <= s.max; u++) {
|
|
1998
|
-
const g = u ===
|
|
1998
|
+
const g = u === r ? "drp-date-picker__rolling-item--selected" : "", f = ct(e, u) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
1999
1999
|
c += `<div class="drp-date-picker__rolling-item ${g} ${f}" data-year="${u}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${u}</span></div>`;
|
|
2000
2000
|
}
|
|
2001
2001
|
l && (l.innerHTML = c);
|
|
@@ -2003,7 +2003,7 @@ function Ft(e, a) {
|
|
|
2003
2003
|
if (p) {
|
|
2004
2004
|
let u = "";
|
|
2005
2005
|
for (let g = d.min - 1; g <= d.max - 1; g++) {
|
|
2006
|
-
const m = e.monthNames[g], f = g === o ? "drp-date-picker__rolling-item--selected" : "", h = j(e,
|
|
2006
|
+
const m = e.monthNames[g], f = g === o ? "drp-date-picker__rolling-item--selected" : "", h = j(e, r, g) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2007
2007
|
u += `<div class="drp-date-picker__rolling-item ${f} ${h}" data-month="${g}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${m}</span></div>`;
|
|
2008
2008
|
}
|
|
2009
2009
|
p.innerHTML = u;
|
|
@@ -2012,9 +2012,9 @@ function Ft(e, a) {
|
|
|
2012
2012
|
function mn(e) {
|
|
2013
2013
|
if (!e.options.unifiedNavigation || !e.unifiedRollingSelector) return;
|
|
2014
2014
|
e.unifiedRollingSelector.classList.add("drp-date-picker__unified-rolling-selector--visible");
|
|
2015
|
-
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(),
|
|
2015
|
+
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(), i = t.getMonth(), r = e.getEffectiveYearRange(), o = e.getEffectiveMonthRange(), s = e.unifiedRollingSelector.querySelector('[data-list="years"]');
|
|
2016
2016
|
let d = "";
|
|
2017
|
-
for (let c =
|
|
2017
|
+
for (let c = r.min; c <= r.max; c++) {
|
|
2018
2018
|
const p = c === n ? "drp-date-picker__rolling-item--selected" : "", g = ct(e, c) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2019
2019
|
d += `<div class="drp-date-picker__rolling-item ${p} ${g}" data-year="${c}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${c}</span></div>`;
|
|
2020
2020
|
}
|
|
@@ -2023,7 +2023,7 @@ function mn(e) {
|
|
|
2023
2023
|
if (l) {
|
|
2024
2024
|
let c = "";
|
|
2025
2025
|
for (let p = o.min - 1; p <= o.max - 1; p++) {
|
|
2026
|
-
const u = e.monthNames[p], g = p ===
|
|
2026
|
+
const u = e.monthNames[p], g = p === i ? "drp-date-picker__rolling-item--selected" : "", f = j(e, n, p) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2027
2027
|
c += `<div class="drp-date-picker__rolling-item ${g} ${f}" data-month="${p}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${u}</span></div>`;
|
|
2028
2028
|
}
|
|
2029
2029
|
l.innerHTML = c;
|
|
@@ -2034,12 +2034,12 @@ function bn(e) {
|
|
|
2034
2034
|
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2035
2035
|
if (a)
|
|
2036
2036
|
if (e.selectedStartDate && e.selectedEndDate) {
|
|
2037
|
-
let t, n,
|
|
2037
|
+
let t, n, i, r, o;
|
|
2038
2038
|
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2039
2039
|
n = e.getEnabledDatesInRange(
|
|
2040
2040
|
e.selectedStartDate,
|
|
2041
2041
|
e.selectedEndDate
|
|
2042
|
-
), t = n.length,
|
|
2042
|
+
), t = n.length, r = n, e.options.disabledDatesHandling === "split" && (o = e.splitRangeByDisabled(
|
|
2043
2043
|
e.selectedStartDate,
|
|
2044
2044
|
e.selectedEndDate
|
|
2045
2045
|
));
|
|
@@ -2047,7 +2047,7 @@ function bn(e) {
|
|
|
2047
2047
|
n = e.getEnabledDatesInRange(
|
|
2048
2048
|
e.selectedStartDate,
|
|
2049
2049
|
e.selectedEndDate
|
|
2050
|
-
),
|
|
2050
|
+
), i = e.getDisabledDatesInRange(
|
|
2051
2051
|
e.selectedStartDate,
|
|
2052
2052
|
e.selectedEndDate
|
|
2053
2053
|
);
|
|
@@ -2069,7 +2069,7 @@ function bn(e) {
|
|
|
2069
2069
|
localeStrings: e.localeStrings,
|
|
2070
2070
|
isPreview: !1
|
|
2071
2071
|
};
|
|
2072
|
-
n && (d.enabledDates = n),
|
|
2072
|
+
n && (d.enabledDates = n), i && (d.disabledDates = i), r && (d.dates = r), o && (d.dateRanges = o), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2073
2073
|
} else
|
|
2074
2074
|
a.innerHTML = `
|
|
2075
2075
|
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
@@ -2083,12 +2083,12 @@ function Ot(e) {
|
|
|
2083
2083
|
if (e.options.selectionMode !== "range") return;
|
|
2084
2084
|
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2085
2085
|
if (a && e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2086
|
-
let t, n,
|
|
2086
|
+
let t, n, i, r, o;
|
|
2087
2087
|
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2088
2088
|
n = e.getEnabledDatesInRange(
|
|
2089
2089
|
e.dragPreviewStart,
|
|
2090
2090
|
e.dragPreviewEnd
|
|
2091
|
-
), t = n.length,
|
|
2091
|
+
), t = n.length, r = n, e.options.disabledDatesHandling === "split" && (o = e.splitRangeByDisabled(
|
|
2092
2092
|
e.dragPreviewStart,
|
|
2093
2093
|
e.dragPreviewEnd
|
|
2094
2094
|
));
|
|
@@ -2096,7 +2096,7 @@ function Ot(e) {
|
|
|
2096
2096
|
n = e.getEnabledDatesInRange(
|
|
2097
2097
|
e.dragPreviewStart,
|
|
2098
2098
|
e.dragPreviewEnd
|
|
2099
|
-
),
|
|
2099
|
+
), i = e.getDisabledDatesInRange(
|
|
2100
2100
|
e.dragPreviewStart,
|
|
2101
2101
|
e.dragPreviewEnd
|
|
2102
2102
|
);
|
|
@@ -2118,7 +2118,7 @@ function Ot(e) {
|
|
|
2118
2118
|
localeStrings: e.localeStrings,
|
|
2119
2119
|
isPreview: !0
|
|
2120
2120
|
};
|
|
2121
|
-
n && (d.enabledDates = n),
|
|
2121
|
+
n && (d.enabledDates = n), i && (d.disabledDates = i), r && (d.dates = r), o && (d.dateRanges = o), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2122
2122
|
} else
|
|
2123
2123
|
a.innerHTML = `
|
|
2124
2124
|
<span style="opacity: 0.7;">${e.localeStrings.preview}: </span>
|
|
@@ -2129,22 +2129,22 @@ function Ot(e) {
|
|
|
2129
2129
|
}
|
|
2130
2130
|
}
|
|
2131
2131
|
function yn(e) {
|
|
2132
|
-
if (e.calendar.querySelectorAll(".drp-date-picker__day--drag-preview, .drp-date-picker__day--drag-invalid").forEach((
|
|
2133
|
-
|
|
2132
|
+
if (e.calendar.querySelectorAll(".drp-date-picker__day--drag-preview, .drp-date-picker__day--drag-invalid").forEach((i) => {
|
|
2133
|
+
i.classList.remove("drp-date-picker__day--drag-preview", "drp-date-picker__day--drag-invalid");
|
|
2134
2134
|
}), !e.dragPreviewStart || !e.dragPreviewEnd) return;
|
|
2135
2135
|
const t = e.options.disabledDatesHandling === "block" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd);
|
|
2136
|
-
e.calendar.querySelectorAll(".drp-date-picker__day").forEach((
|
|
2137
|
-
const
|
|
2138
|
-
if (!
|
|
2139
|
-
const [o, s, d] =
|
|
2140
|
-
l >= e.dragPreviewStart && l <= e.dragPreviewEnd && (
|
|
2136
|
+
e.calendar.querySelectorAll(".drp-date-picker__day").forEach((i) => {
|
|
2137
|
+
const r = i.dataset.date;
|
|
2138
|
+
if (!r) return;
|
|
2139
|
+
const [o, s, d] = r.split("-").map(Number), l = new Date(o, s - 1, d);
|
|
2140
|
+
l >= e.dragPreviewStart && l <= e.dragPreviewEnd && (i.classList.add("drp-date-picker__day--drag-preview"), t && i.classList.add("drp-date-picker__day--drag-invalid"));
|
|
2141
2141
|
}), Ot(e);
|
|
2142
2142
|
}
|
|
2143
2143
|
async function Yt(e, a) {
|
|
2144
2144
|
if (!e.options.beforeDateSelectCallback)
|
|
2145
2145
|
return { isValid: !0 };
|
|
2146
2146
|
try {
|
|
2147
|
-
e.isValidating = !0,
|
|
2147
|
+
e.isValidating = !0, ke(e);
|
|
2148
2148
|
const t = await Promise.resolve(e.options.beforeDateSelectCallback(a));
|
|
2149
2149
|
switch (ae(e), e.isValidating = !1, t.action) {
|
|
2150
2150
|
case "accept":
|
|
@@ -2173,8 +2173,8 @@ async function Bt(e, a, t) {
|
|
|
2173
2173
|
return ee.debug(" PREVENT mode - range contains disabled dates"), { isValid: !1, message: "Range contains disabled dates" };
|
|
2174
2174
|
} else if (e.options.disabledDatesHandling === "block" && (ee.debug(" Checking BLOCK mode"), e.hasDisabledDatesInRange(a, t))) {
|
|
2175
2175
|
ee.debug(" BLOCK mode - range contains disabled dates, adjusting");
|
|
2176
|
-
const
|
|
2177
|
-
return ee.debug(" BLOCK mode - adjusted end:",
|
|
2176
|
+
const i = e.findLastEnabledBeforeGap(a, t);
|
|
2177
|
+
return ee.debug(" BLOCK mode - adjusted end:", i), { isValid: !0, adjustedStart: a, adjustedEnd: i };
|
|
2178
2178
|
}
|
|
2179
2179
|
const n = await Yt(e, { start: a, end: t });
|
|
2180
2180
|
return n.isValid ? n.adjustedStart || n.adjustedEnd ? {
|
|
@@ -2190,36 +2190,36 @@ async function vn(e, a) {
|
|
|
2190
2190
|
Y.warn("selectDay() - called with invalid element:", a);
|
|
2191
2191
|
return;
|
|
2192
2192
|
}
|
|
2193
|
-
const [t, n,
|
|
2193
|
+
const [t, n, i] = a.dataset.date.split("-").map(Number), r = new Date(t, n - 1, i);
|
|
2194
2194
|
a.classList.contains("drp-date-picker__day--other-month");
|
|
2195
2195
|
const o = a.closest(".drp-date-picker__days");
|
|
2196
2196
|
if (o && o instanceof HTMLElement) {
|
|
2197
|
-
e.activeMonthIndex = parseInt(o.dataset.monthIndex || "0") || 0,
|
|
2197
|
+
e.activeMonthIndex = parseInt(o.dataset.monthIndex || "0") || 0, re.debug(`Col${e.activeMonthIndex} selectDay - activeMonthIndex:`, e.activeMonthIndex);
|
|
2198
2198
|
const s = o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
2199
|
-
e.focusedDayIndex = Array.from(s).indexOf(a),
|
|
2199
|
+
e.focusedDayIndex = Array.from(s).indexOf(a), re.debug(`Col${e.activeMonthIndex} selectDay - set focusedDayIndex to:`, e.focusedDayIndex);
|
|
2200
2200
|
}
|
|
2201
2201
|
if (e.options.selectionMode === "single") {
|
|
2202
|
-
const s = await Yt(e,
|
|
2202
|
+
const s = await Yt(e, r);
|
|
2203
2203
|
if (!s.isValid) {
|
|
2204
|
-
|
|
2204
|
+
re.debug("Single mode selection prevented by beforeDateSelectCallback");
|
|
2205
2205
|
return;
|
|
2206
2206
|
}
|
|
2207
|
-
const d = s.adjustedDate ||
|
|
2207
|
+
const d = s.adjustedDate || r;
|
|
2208
2208
|
e.selectedDate = d, e.input && (e.requiresApplyButton() || (e.input.value = e.formatDate(d))), e.requiresApplyButton() ? e.pendingSelection = d : e.options.onSelect && e.options.onSelect(d), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
2209
2209
|
} else if (e.options.selectionMode === "multiple") {
|
|
2210
|
-
const s = `${
|
|
2211
|
-
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(
|
|
2210
|
+
const s = `${r.getFullYear()}-${String(r.getMonth() + 1).padStart(2, "0")}-${String(r.getDate()).padStart(2, "0")}`, d = e.selectedDates.findIndex((l) => `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` === s);
|
|
2211
|
+
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(r)), e.input && !e.requiresApplyButton()) {
|
|
2212
2212
|
const l = e.selectedDates.length + e.selectedRanges.length;
|
|
2213
2213
|
e.input.value = l > 0 ? `${l} selection(s)` : "";
|
|
2214
2214
|
}
|
|
2215
2215
|
e.selectedRanges.length > 0 && e.selectedDates.length > 0 ? e.pendingSelection = [...e.selectedRanges, ...e.selectedDates] : e.selectedRanges.length > 0 ? e.pendingSelection = e.selectedRanges : e.pendingSelection = e.selectedDates;
|
|
2216
2216
|
} else if (!e.selectedStartDate || e.selectedEndDate)
|
|
2217
|
-
e.selectedStartDate =
|
|
2217
|
+
e.selectedStartDate = r, e.selectedEndDate = null, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ...`));
|
|
2218
2218
|
else {
|
|
2219
|
-
let s = e.selectedStartDate, d =
|
|
2220
|
-
|
|
2219
|
+
let s = e.selectedStartDate, d = r;
|
|
2220
|
+
r < e.selectedStartDate && (d = e.selectedStartDate, s = r), re.debug(" selectDay - calling validateRangeAsync with:", s, d);
|
|
2221
2221
|
const l = await Bt(e, s, d);
|
|
2222
|
-
if (
|
|
2222
|
+
if (re.debug(" selectDay - validation result:", l), !l.isValid) {
|
|
2223
2223
|
l.message && Y.warn("selectDay() - range validation failed:", l.message), e.renderCalendar(), e.updateSummary();
|
|
2224
2224
|
return;
|
|
2225
2225
|
}
|
|
@@ -2273,14 +2273,14 @@ function wn(e) {
|
|
|
2273
2273
|
function xn(e) {
|
|
2274
2274
|
e.options.selectionMode === "range" && e.calendar.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--disabled)").forEach((t) => {
|
|
2275
2275
|
t.addEventListener("mousedown", (n) => {
|
|
2276
|
-
const
|
|
2276
|
+
const i = n, r = t, o = i.clientX, s = i.clientY, d = 5;
|
|
2277
2277
|
let l = !1, c = !1;
|
|
2278
|
-
const p =
|
|
2278
|
+
const p = r.classList.contains("drp-date-picker__day--range-start"), u = r.classList.contains("drp-date-picker__day--range-end");
|
|
2279
2279
|
let g;
|
|
2280
2280
|
p && e.selectedStartDate && e.selectedEndDate ? g = "start" : u && e.selectedStartDate && e.selectedEndDate ? g = "end" : g = "start";
|
|
2281
2281
|
const m = (y) => {
|
|
2282
2282
|
const h = Math.abs(y.clientX - o), M = Math.abs(y.clientY - s);
|
|
2283
|
-
!l && (h > d || M > d) && (l = !0), l && !c && (c = !0, Ht(e,
|
|
2283
|
+
!l && (h > d || M > d) && (l = !0), l && !c && (c = !0, Ht(e, i, g, r), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", f));
|
|
2284
2284
|
}, f = () => {
|
|
2285
2285
|
document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", f);
|
|
2286
2286
|
};
|
|
@@ -2290,24 +2290,24 @@ function xn(e) {
|
|
|
2290
2290
|
}
|
|
2291
2291
|
function Ht(e, a, t, n) {
|
|
2292
2292
|
a.preventDefault(), a.stopPropagation(), e.isDragging = !0, e.draggingType = t;
|
|
2293
|
-
const
|
|
2293
|
+
const i = n, r = i.dataset.date;
|
|
2294
2294
|
let o = null;
|
|
2295
|
-
if (
|
|
2296
|
-
const [s, d, l] =
|
|
2295
|
+
if (r) {
|
|
2296
|
+
const [s, d, l] = r.split("-").map(Number);
|
|
2297
2297
|
o = new Date(s, d - 1, l);
|
|
2298
2298
|
}
|
|
2299
2299
|
!e.selectedStartDate && !e.selectedEndDate ? o && (e.originalStartDate = o, e.originalEndDate = null, e.draggingType = "end") : o && e.selectedStartDate && !e.selectedEndDate ? o.getTime() === e.selectedStartDate.getTime() ? (e.originalStartDate = new Date(e.selectedStartDate), e.originalEndDate = null) : (e.selectedStartDate = null, e.selectedEndDate = null, e.focusedDayIndex = null, e.calendar.querySelectorAll(".drp-date-picker__day--range-start, .drp-date-picker__day--range-end, .drp-date-picker__day--selected, .drp-date-picker__day--focused").forEach((d) => {
|
|
2300
2300
|
d.classList.remove("drp-date-picker__day--range-start", "drp-date-picker__day--range-end", "drp-date-picker__day--selected", "drp-date-picker__day--focused");
|
|
2301
|
-
}), e.originalStartDate = o, e.originalEndDate = null, e.draggingType = "end") : (e.selectedStartDate && (e.originalStartDate = new Date(e.selectedStartDate)), e.selectedEndDate && (e.originalEndDate = new Date(e.selectedEndDate))),
|
|
2301
|
+
}), e.originalStartDate = o, e.originalEndDate = null, e.draggingType = "end") : (e.selectedStartDate && (e.originalStartDate = new Date(e.selectedStartDate)), e.selectedEndDate && (e.originalEndDate = new Date(e.selectedEndDate))), i.classList.add("drp-date-picker__day--dragging"), U.debug(`Started dragging ${t} date`), e.onDragMoveBound = (s) => Vt(e, s), e.onDragEndBound = async (s) => await qt(e), document.addEventListener("mousemove", e.onDragMoveBound), document.addEventListener("mouseup", e.onDragEndBound), document.body.style.cursor = "grabbing";
|
|
2302
2302
|
}
|
|
2303
2303
|
function Vt(e, a) {
|
|
2304
2304
|
if (!e.isDragging) return;
|
|
2305
2305
|
let t = null;
|
|
2306
2306
|
e.containerElement instanceof ShadowRoot && "elementsFromPoint" in e.containerElement ? t = e.containerElement.elementsFromPoint(a.clientX, a.clientY)[0] || null : t = document.elementFromPoint(a.clientX, a.clientY);
|
|
2307
|
-
const n = t == null ? void 0 : t.closest(".drp-date-picker__nav--prev"),
|
|
2308
|
-
if (n ||
|
|
2307
|
+
const n = t == null ? void 0 : t.closest(".drp-date-picker__nav--prev"), i = t == null ? void 0 : t.closest(".drp-date-picker__nav--next");
|
|
2308
|
+
if (n || i) {
|
|
2309
2309
|
if (!e.navInterval) {
|
|
2310
|
-
const u = (n ||
|
|
2310
|
+
const u = (n || i).closest(".drp-date-picker__month");
|
|
2311
2311
|
if (u && u instanceof HTMLElement) {
|
|
2312
2312
|
const g = parseInt(u.dataset.monthIndex || "0"), m = !!n;
|
|
2313
2313
|
m ? e.prevMonth(g) : e.nextMonth(g), e.navInterval = window.setInterval(() => {
|
|
@@ -2318,13 +2318,13 @@ function Vt(e, a) {
|
|
|
2318
2318
|
return;
|
|
2319
2319
|
} else
|
|
2320
2320
|
e.navInterval && (clearInterval(e.navInterval), e.navInterval = null);
|
|
2321
|
-
const
|
|
2322
|
-
if (!
|
|
2323
|
-
const o =
|
|
2321
|
+
const r = t;
|
|
2322
|
+
if (!r || !r.classList.contains("drp-date-picker__day")) return;
|
|
2323
|
+
const o = r.dataset.date;
|
|
2324
2324
|
if (!o) return;
|
|
2325
2325
|
const [s, d, l] = o.split("-").map(Number);
|
|
2326
2326
|
let c = new Date(s, d - 1, l);
|
|
2327
|
-
if (
|
|
2327
|
+
if (r.classList.contains("drp-date-picker__day--disabled")) {
|
|
2328
2328
|
const p = e.draggingType === "start" ? e.originalEndDate && c > e.originalEndDate ? "backward" : "forward" : e.originalStartDate && c < e.originalStartDate ? "forward" : "backward";
|
|
2329
2329
|
c = $e(e, c, p);
|
|
2330
2330
|
}
|
|
@@ -2350,13 +2350,13 @@ async function qt(e, a) {
|
|
|
2350
2350
|
if (U.debug("Ended dragging, finalizing selection"), e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2351
2351
|
let t = $e(e, e.dragPreviewStart, "forward"), n = $e(e, e.dragPreviewEnd, "backward");
|
|
2352
2352
|
t > n && ([t, n] = [n, t]), U.debug("onDragEnd - calling validateRangeAsync with:", t, n);
|
|
2353
|
-
const
|
|
2354
|
-
if (U.debug("onDragEnd - validation result:",
|
|
2355
|
-
|
|
2353
|
+
const i = await Bt(e, t, n);
|
|
2354
|
+
if (U.debug("onDragEnd - validation result:", i), !i.isValid)
|
|
2355
|
+
i.message && Y.warn("onDragEnd() - drag validation failed:", i.message);
|
|
2356
2356
|
else {
|
|
2357
|
-
e.selectedStartDate =
|
|
2358
|
-
const
|
|
2359
|
-
e.requiresApplyButton() ? e.pendingSelection =
|
|
2357
|
+
e.selectedStartDate = i.adjustedStart || t, e.selectedEndDate = i.adjustedEnd || n, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
2358
|
+
const r = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
2359
|
+
e.requiresApplyButton() ? e.pendingSelection = r : e.options.onSelect && e.options.onSelect(r);
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
2362
|
if (e.isDragging = !1, e.draggingType = null, e.dragPreviewStart = null, e.dragPreviewEnd = null, e.calendar.querySelectorAll(".drp-date-picker__day--dragging").forEach((t) => {
|
|
@@ -2364,12 +2364,12 @@ async function qt(e, a) {
|
|
|
2364
2364
|
}), e.onDragMoveBound && document.removeEventListener("mousemove", e.onDragMoveBound), e.onDragEndBound && document.removeEventListener("mouseup", e.onDragEndBound), e.navInterval && (clearInterval(e.navInterval), e.navInterval = null), document.body.style.cursor = "", e.renderCalendar(), e.updateSummary(), e.selectedEndDate) {
|
|
2365
2365
|
const t = e.selectedEndDate;
|
|
2366
2366
|
for (let n = 0; n < e.monthDates.length; n++) {
|
|
2367
|
-
const
|
|
2368
|
-
if (t.getFullYear() ===
|
|
2367
|
+
const i = e.monthDates[n];
|
|
2368
|
+
if (t.getFullYear() === i.getFullYear() && t.getMonth() === i.getMonth()) {
|
|
2369
2369
|
e.activeMonthIndex = n;
|
|
2370
|
-
const
|
|
2371
|
-
if (
|
|
2372
|
-
const o =
|
|
2370
|
+
const r = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${n}"]`);
|
|
2371
|
+
if (r) {
|
|
2372
|
+
const o = r.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), s = Array.from(o).findIndex((d) => {
|
|
2373
2373
|
const l = d.dataset.date;
|
|
2374
2374
|
if (!l) return !1;
|
|
2375
2375
|
const [c, p, u] = l.split("-").map(Number), g = new Date(c, p - 1, u);
|
|
@@ -2385,16 +2385,16 @@ async function qt(e, a) {
|
|
|
2385
2385
|
}
|
|
2386
2386
|
}
|
|
2387
2387
|
function $e(e, a, t = "forward") {
|
|
2388
|
-
let
|
|
2389
|
-
if (
|
|
2390
|
-
return
|
|
2391
|
-
const
|
|
2388
|
+
let i = new Date(a);
|
|
2389
|
+
if (i.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(i))
|
|
2390
|
+
return i;
|
|
2391
|
+
const r = t === "forward" ? 1 : -1;
|
|
2392
2392
|
for (let s = 1; s <= 60; s++) {
|
|
2393
2393
|
const d = new Date(a);
|
|
2394
|
-
if (d.setDate(d.getDate() + s *
|
|
2394
|
+
if (d.setDate(d.getDate() + s * r), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
2395
2395
|
return d;
|
|
2396
2396
|
}
|
|
2397
|
-
const o = -
|
|
2397
|
+
const o = -r;
|
|
2398
2398
|
for (let s = 1; s <= 60; s++) {
|
|
2399
2399
|
const d = new Date(a);
|
|
2400
2400
|
if (d.setDate(d.getDate() + s * o), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
@@ -2403,34 +2403,34 @@ function $e(e, a, t = "forward") {
|
|
|
2403
2403
|
return a;
|
|
2404
2404
|
}
|
|
2405
2405
|
function Mn(e, a) {
|
|
2406
|
-
const t = a.target, n = t.value,
|
|
2406
|
+
const t = a.target, n = t.value, i = t.selectionStart || 0, r = e._previousInputValue || "", o = n.length < r.length, { separator: s } = e.formatInfo;
|
|
2407
2407
|
if (e.options.selectionMode === "range") {
|
|
2408
2408
|
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}to ]`, "gi"), ""), l = Ut(e, d);
|
|
2409
2409
|
if (l !== n) {
|
|
2410
2410
|
t.value = l;
|
|
2411
|
-
let c =
|
|
2411
|
+
let c = i;
|
|
2412
2412
|
if (o)
|
|
2413
|
-
c =
|
|
2413
|
+
c = i;
|
|
2414
2414
|
else if (l.length > n.length)
|
|
2415
2415
|
if (l.includes(" to ") && !n.includes(" to ")) {
|
|
2416
2416
|
const p = l.indexOf(" to ");
|
|
2417
|
-
|
|
2417
|
+
i >= p && i <= p + 4 ? c = p + 4 : c = i + (l.length - n.length);
|
|
2418
2418
|
} else
|
|
2419
|
-
c =
|
|
2419
|
+
c = i + (l.length - n.length);
|
|
2420
2420
|
t.setSelectionRange(c, c);
|
|
2421
2421
|
}
|
|
2422
2422
|
} else {
|
|
2423
2423
|
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), l = pe(e, d);
|
|
2424
2424
|
if (l !== n) {
|
|
2425
2425
|
t.value = l;
|
|
2426
|
-
let c =
|
|
2426
|
+
let c = i;
|
|
2427
2427
|
if (o)
|
|
2428
|
-
c =
|
|
2429
|
-
else if (l.length > n.length && l[
|
|
2430
|
-
c =
|
|
2428
|
+
c = i;
|
|
2429
|
+
else if (l.length > n.length && l[i] === s)
|
|
2430
|
+
c = i + 1;
|
|
2431
2431
|
else if (l.length > n.length) {
|
|
2432
|
-
const p = (n.substring(0,
|
|
2433
|
-
c =
|
|
2432
|
+
const p = (n.substring(0, i).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length, g = (l.substring(0, i).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length - p;
|
|
2433
|
+
c = i + g;
|
|
2434
2434
|
}
|
|
2435
2435
|
t.setSelectionRange(c, c);
|
|
2436
2436
|
}
|
|
@@ -2439,39 +2439,39 @@ function Mn(e, a) {
|
|
|
2439
2439
|
}
|
|
2440
2440
|
function pe(e, a) {
|
|
2441
2441
|
var c, p, u;
|
|
2442
|
-
const { separator: t, parts: n, maxLength:
|
|
2442
|
+
const { separator: t, parts: n, maxLength: i } = e.formatInfo, r = a.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), ""), o = n.year ? n.year.length : 4, s = [
|
|
2443
2443
|
{ type: "year", pos: ((c = n.year) == null ? void 0 : c.index) ?? 0, length: o },
|
|
2444
2444
|
{ type: "month", pos: ((p = n.month) == null ? void 0 : p.index) ?? 1, length: 2 },
|
|
2445
2445
|
{ type: "day", pos: ((u = n.day) == null ? void 0 : u.index) ?? 2, length: 2 }
|
|
2446
2446
|
].sort((g, m) => g.pos - m.pos);
|
|
2447
2447
|
let d = "", l = 0;
|
|
2448
2448
|
for (let g = 0; g < s.length; g++) {
|
|
2449
|
-
const m = s[g], f =
|
|
2449
|
+
const m = s[g], f = r.substring(l, l + m.length);
|
|
2450
2450
|
if (!f) break;
|
|
2451
2451
|
d += f, l += f.length, g < s.length - 1 && f.length === m.length && (d += t);
|
|
2452
2452
|
}
|
|
2453
|
-
return d.substring(0,
|
|
2453
|
+
return d.substring(0, i);
|
|
2454
2454
|
}
|
|
2455
2455
|
function Ut(e, a) {
|
|
2456
|
-
const { separator: t, maxLength: n } = e.formatInfo,
|
|
2457
|
-
let
|
|
2458
|
-
if (a.includes(
|
|
2459
|
-
const d = a.split(
|
|
2460
|
-
|
|
2456
|
+
const { separator: t, maxLength: n } = e.formatInfo, i = " to ";
|
|
2457
|
+
let r = "", o = "";
|
|
2458
|
+
if (a.includes(i)) {
|
|
2459
|
+
const d = a.split(i);
|
|
2460
|
+
r = d[0], o = d.slice(1).join(i);
|
|
2461
2461
|
} else
|
|
2462
|
-
|
|
2463
|
-
const s = pe(e,
|
|
2462
|
+
r = a;
|
|
2463
|
+
const s = pe(e, r);
|
|
2464
2464
|
if (s.length === n)
|
|
2465
|
-
if (a.includes(
|
|
2465
|
+
if (a.includes(i)) {
|
|
2466
2466
|
const d = pe(e, o);
|
|
2467
|
-
return s +
|
|
2467
|
+
return s + i + d;
|
|
2468
2468
|
} else
|
|
2469
|
-
return s +
|
|
2469
|
+
return s + i;
|
|
2470
2470
|
else
|
|
2471
2471
|
return s;
|
|
2472
2472
|
}
|
|
2473
2473
|
function Sn(e, a) {
|
|
2474
|
-
const { key: t, ctrlKey: n, metaKey:
|
|
2474
|
+
const { key: t, ctrlKey: n, metaKey: i } = a, { separator: r } = e.formatInfo;
|
|
2475
2475
|
if (e.calendar.classList.contains("drp-date-picker--visible") && ["ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(t)) {
|
|
2476
2476
|
a.preventDefault();
|
|
2477
2477
|
return;
|
|
@@ -2488,61 +2488,61 @@ function Sn(e, a) {
|
|
|
2488
2488
|
"ArrowDown",
|
|
2489
2489
|
"Home",
|
|
2490
2490
|
"End"
|
|
2491
|
-
].includes(t) || n ||
|
|
2492
|
-
if (t ===
|
|
2491
|
+
].includes(t) || n || i)) {
|
|
2492
|
+
if (t === r) {
|
|
2493
2493
|
const s = a.target, d = s.selectionStart || 0, l = s.value;
|
|
2494
2494
|
let c = 0;
|
|
2495
2495
|
for (let u = d - 1; u >= 0; u--)
|
|
2496
|
-
if (l[u] ===
|
|
2496
|
+
if (l[u] === r || l[u] === " ") {
|
|
2497
2497
|
c = u + 1;
|
|
2498
2498
|
break;
|
|
2499
2499
|
}
|
|
2500
2500
|
const p = l.substring(c, d);
|
|
2501
2501
|
if (/^\d$/.test(p)) {
|
|
2502
2502
|
a.preventDefault();
|
|
2503
|
-
const u = l.substring(0, c) + "0" + p +
|
|
2503
|
+
const u = l.substring(0, c) + "0" + p + r + l.substring(d);
|
|
2504
2504
|
s.value = u;
|
|
2505
|
-
const g = c + 2 +
|
|
2505
|
+
const g = c + 2 + r.length;
|
|
2506
2506
|
s.setSelectionRange(g, g), e._previousInputValue = u, s.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
2507
2507
|
return;
|
|
2508
2508
|
}
|
|
2509
2509
|
}
|
|
2510
|
-
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !==
|
|
2510
|
+
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !== r && t !== " " && t.toLowerCase() !== "t" && t.toLowerCase() !== "o" && a.preventDefault() : !/^\d$/.test(t) && t !== r && a.preventDefault();
|
|
2511
2511
|
}
|
|
2512
2512
|
}
|
|
2513
2513
|
function Cn(e, a) {
|
|
2514
2514
|
var u;
|
|
2515
2515
|
a.preventDefault();
|
|
2516
|
-
const t = ((u = a.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: n } = e.formatInfo,
|
|
2516
|
+
const t = ((u = a.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: n } = e.formatInfo, i = t.replace(new RegExp(`[^0-9${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), r = pe(e, i), o = a.target, s = o.selectionStart || 0, d = o.selectionEnd || 0, l = o.value, c = l.substring(0, s) + r + l.substring(d);
|
|
2517
2517
|
o.value = pe(e, c);
|
|
2518
|
-
const p = s +
|
|
2518
|
+
const p = s + r.length;
|
|
2519
2519
|
o.setSelectionRange(p, p), o.dispatchEvent(new Event("input", { bubbles: !0 })), tt(e);
|
|
2520
2520
|
}
|
|
2521
2521
|
function tt(e) {
|
|
2522
2522
|
if (!e.input) return;
|
|
2523
2523
|
const a = e.input.value;
|
|
2524
2524
|
if (oe.debug("updateCalendarFromInput - value:", a), !a) return;
|
|
2525
|
-
const { separator: t, parts: n, maxLength:
|
|
2526
|
-
if (oe.debug("Format info:", { separator: t, parts: n, maxLength:
|
|
2525
|
+
const { separator: t, parts: n, maxLength: i } = e.formatInfo;
|
|
2526
|
+
if (oe.debug("Format info:", { separator: t, parts: n, maxLength: i }), e.options.selectionMode === "range" && a.includes(" to ")) {
|
|
2527
2527
|
const o = a.split(" to "), s = o[0], d = o[1];
|
|
2528
2528
|
oe.debug("Range parts - start:", s, "end:", d), Ce(e, s, "start"), d && Ce(e, d, "end");
|
|
2529
2529
|
return;
|
|
2530
2530
|
}
|
|
2531
|
-
const
|
|
2532
|
-
Ce(e, a,
|
|
2531
|
+
const r = e.options.selectionMode === "range" ? "start" : "single";
|
|
2532
|
+
Ce(e, a, r);
|
|
2533
2533
|
}
|
|
2534
2534
|
function Ce(e, a, t = "single") {
|
|
2535
|
-
const { separator: n, parts:
|
|
2535
|
+
const { separator: n, parts: i, maxLength: r } = e.formatInfo, o = a.split(n);
|
|
2536
2536
|
let s = null, d = null, l = null;
|
|
2537
2537
|
if (o.forEach((c, p) => {
|
|
2538
2538
|
if (c) {
|
|
2539
|
-
if (
|
|
2539
|
+
if (i.year && i.year.index === p) {
|
|
2540
2540
|
const u = parseInt(c, 10);
|
|
2541
|
-
|
|
2542
|
-
} else if (
|
|
2541
|
+
i.year.length === 4 && c.length === 4 ? s = u : i.year.length === 2 && c.length === 2 && (s = u < 100 ? u + 2e3 : u);
|
|
2542
|
+
} else if (i.month && i.month.index === p) {
|
|
2543
2543
|
const u = parseInt(c, 10);
|
|
2544
2544
|
c.length === 2 && u >= 1 && u <= 12 && (d = u);
|
|
2545
|
-
} else if (
|
|
2545
|
+
} else if (i.day && i.day.index === p) {
|
|
2546
2546
|
const u = parseInt(c, 10);
|
|
2547
2547
|
c.length === 2 && u >= 1 && u <= 31 && (l = u);
|
|
2548
2548
|
}
|
|
@@ -2637,9 +2637,9 @@ function En(e) {
|
|
|
2637
2637
|
const a = Oe(e);
|
|
2638
2638
|
try {
|
|
2639
2639
|
const t = new Intl.DateTimeFormat(a, { weekday: "short" }), n = [];
|
|
2640
|
-
for (let
|
|
2641
|
-
const
|
|
2642
|
-
n.push(t.format(
|
|
2640
|
+
for (let i = 0; i < 7; i++) {
|
|
2641
|
+
const r = new Date(2017, 0, i + 1);
|
|
2642
|
+
n.push(t.format(r));
|
|
2643
2643
|
}
|
|
2644
2644
|
return n;
|
|
2645
2645
|
} catch (t) {
|
|
@@ -2650,9 +2650,9 @@ function Rn(e) {
|
|
|
2650
2650
|
const a = Oe(e);
|
|
2651
2651
|
try {
|
|
2652
2652
|
const t = new Intl.DateTimeFormat(a, { month: "long" }), n = [];
|
|
2653
|
-
for (let
|
|
2654
|
-
const
|
|
2655
|
-
n.push(t.format(
|
|
2653
|
+
for (let i = 0; i < 12; i++) {
|
|
2654
|
+
const r = new Date(2017, i, 1);
|
|
2655
|
+
n.push(t.format(r));
|
|
2656
2656
|
}
|
|
2657
2657
|
return n;
|
|
2658
2658
|
} catch (t) {
|
|
@@ -2672,7 +2672,7 @@ function Rn(e) {
|
|
|
2672
2672
|
];
|
|
2673
2673
|
}
|
|
2674
2674
|
}
|
|
2675
|
-
const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale: 1;--drp-cell-scale: 1;--drp-spacing-xs-base: .25rem;--drp-spacing-sm-base: .5rem;--drp-spacing-md-base: 1rem;--drp-spacing-lg-base: 1.5rem;--drp-spacing-xl-base: 2rem;--drp-spacing-xs: calc(var(--drp-spacing-xs-base) * var(--drp-spacing-scale));--drp-spacing-sm: calc(var(--drp-spacing-sm-base) * var(--drp-spacing-scale));--drp-spacing-md: calc(var(--drp-spacing-md-base) * var(--drp-spacing-scale));--drp-spacing-lg: calc(var(--drp-spacing-lg-base) * var(--drp-spacing-scale));--drp-spacing-xl: calc(var(--drp-spacing-xl-base) * var(--drp-spacing-scale));--drp-font-size-2xs-base: .625rem;--drp-font-size-xs-base: .75rem;--drp-font-size-sm-base: .875rem;--drp-font-size-base-base: 1rem;--drp-font-size-lg-base: 1.125rem;--drp-font-size-xl-base: 1.25rem;--drp-font-size-2xl-base: 1.5rem;--drp-font-weight-medium: 500;--drp-font-weight-semibold: 600;--drp-card-bg: #ffffff;--drp-border-color: #e5e7eb;--drp-primary-bg: #f3f4f6;--drp-primary-bg-hover: #e5e7eb;--drp-accent-color: #3b82f6;--drp-accent-color-hover: #2563eb;--drp-text-primary: #111827;--drp-text-secondary: #6b7280;--drp-accent-text-color: #ffffff;--drp-button-text-color: #ffffff;--drp-tooltip-bg: #111827;--drp-tooltip-color: #ffffff;--drp-border-width-base: 1px;--drp-border-radius: .375rem;--drp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-input-padding-h: .75rem;--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-input-background: var(--drp-card-bg);--drp-input-color: var(--drp-text-primary);--drp-input-border-color: var(--drp-border-color);--drp-input-border-color-hover: var(--drp-accent-color);--drp-input-border-color-focus: var(--drp-accent-color);--drp-input-placeholder-color: var(--drp-text-secondary);--drp-input-disabled-background: var(--drp-primary-bg);--drp-input-focus-shadow-color: rgba(59, 130, 246, .1);--drp-input-focus-shadow-size: 3px;--drp-input-icon-opacity: .6;--drp-input-size-sm-font: .875rem;--drp-input-size-sm-padding-v: .25rem;--drp-input-size-sm-padding-h: .5rem;--drp-input-size-sm-height: 2rem;--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: 1rem;--drp-input-size-md-padding-v: .5rem;--drp-input-size-md-padding-h: .75rem;--drp-input-size-md-height: 2.5rem;--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: 1.125rem;--drp-input-size-lg-padding-v: 1rem;--drp-input-size-lg-padding-h: 1rem;--drp-input-size-lg-height: 3rem;--drp-input-size-lg-icon-size: 1.125em;--drp-header-text-color: var(--drp-text-primary);--drp-header-bg-hover: var(--drp-primary-bg);--drp-header-bg-active: var(--drp-primary-bg-hover);--drp-nav-text-color: var(--drp-text-primary);--drp-nav-border-color: var(--drp-border-color);--drp-nav-bg-hover: var(--drp-primary-bg);--drp-nav-bg-active: var(--drp-primary-bg-hover);--drp-nav-border-hover: var(--drp-accent-color);--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-scrollbar-thumb: var(--drp-border-color);--drp-rolling-scrollbar-thumb-hover: var(--drp-accent-color);--drp-rolling-item-bg-hover: var(--drp-primary-bg);--drp-rolling-item-bg-selected: var(--drp-accent-color);--drp-rolling-item-color-selected: var(--drp-accent-text-color);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-weekday-color: var(--drp-text-secondary);--drp-day-text-color: var(--drp-text-primary);--drp-day-bg-hover: var(--drp-primary-bg);--drp-day-border-hover: var(--drp-accent-color);--drp-day-today-border: var(--drp-accent-color);--drp-day-selected-bg: var(--drp-accent-color);--drp-day-selected-color: var(--drp-accent-text-color);--drp-day-selected-bg-hover: var(--drp-accent-color-hover);--drp-day-focused-outline: var(--drp-accent-color);--drp-day-disabled-color: var(--drp-text-secondary);--drp-day-other-month-color: var(--drp-text-secondary);--drp-day-range-bg: var(--drp-accent-color);--drp-day-range-color: var(--drp-accent-text-color);--drp-summary-text-color: var(--drp-text-secondary);--drp-summary-border-color: var(--drp-border-color);--drp-summary-count-color: var(--drp-accent-color);--drp-button-border-color: var(--drp-border-color);--drp-button-bg-hover: var(--drp-primary-bg);--drp-button-border-hover: var(--drp-accent-color);--drp-button-today-color: var(--drp-accent-color);--drp-button-clear-color: var(--drp-text-secondary);--drp-button-cancel-color: var(--drp-text-secondary);--drp-button-apply-bg: var(--drp-accent-color);--drp-button-apply-color: var(--drp-button-text-color);--drp-button-apply-border: var(--drp-accent-color);--drp-button-apply-bg-hover: var(--drp-accent-color-hover);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-accent-text-color);--drp-badge-count-bg: #ef4444;--drp-badge-count-color: #ffffff;--drp-badge-text-bg: var(--drp-text-secondary);--drp-badge-text-color: #ffffff;--drp-unified-range-text-color: var(--drp-text-primary);--drp-unified-range-bg-hover: var(--drp-primary-bg);--drp-unified-range-bg-active: var(--drp-primary-bg-hover);--drp-unified-month-color: var(--drp-text-secondary);--drp-unified-rolling-disabled-color: var(--drp-text-secondary)}.drp-input{width:100%;font-family:inherit;font-size:var(--drp-input-size-md-font);line-height:1.5;color:var(--drp-input-color);background-color:var(--drp-input-background);border:var(--drp-border-width-base) solid var(--drp-input-border-color);border-radius:var(--drp-border-radius);padding:var(--drp-input-size-md-padding-v) var(--drp-input-size-md-padding-h);padding-right:calc(var(--drp-input-size-md-padding-h) * 2.5);height:var(--drp-input-size-md-height);box-sizing:border-box;transition:border-color var(--drp-transition-fast) var(--drp-easing-snappy),box-shadow var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-input::placeholder{color:var(--drp-input-placeholder-color);opacity:.6}.drp-input:hover:not(:disabled){border-color:var(--drp-input-border-color-hover)}.drp-input:focus{outline:none;border-color:var(--drp-input-border-color-focus);box-shadow:0 0 0 var(--drp-input-focus-shadow-size) var(--drp-input-focus-shadow-color)}.drp-input:disabled{opacity:.6;cursor:not-allowed;background-color:var(--drp-input-disabled-background)}.drp-input.drp-input--sm{font-size:var(--drp-input-size-sm-font);padding:var(--drp-input-size-sm-padding-v) var(--drp-input-size-sm-padding-h);padding-right:calc(var(--drp-input-size-sm-padding-h) * 2.5);height:var(--drp-input-size-sm-height)}.drp-input.drp-input--lg{font-size:var(--drp-input-size-lg-font);padding:var(--drp-input-size-lg-padding-v) var(--drp-input-size-lg-padding-h);padding-right:calc(var(--drp-input-size-lg-padding-h) * 2.5);height:var(--drp-input-size-lg-height)}.drp-date-picker-input{position:relative;cursor:pointer;display:inline-block;width:100%}.drp-date-picker-input:after{content:"📅";position:absolute;right:var(--drp-input-size-md-padding-h);top:50%;transform:translateY(-50%);pointer-events:none;opacity:var(--drp-input-icon-opacity);font-size:var(--drp-input-size-md-icon-size)}.drp-date-picker-input.drp-date-picker-input--sm:after{right:var(--drp-input-size-sm-padding-h);font-size:var(--drp-input-size-sm-icon-size)}.drp-date-picker-input.drp-date-picker-input--lg:after{right:var(--drp-input-size-lg-padding-h);font-size:var(--drp-input-size-lg-icon-size)}.drp-date-picker{position:absolute;z-index:9500;background:var(--drp-card-bg);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:280px;max-width:calc(100vw - 2rem);box-sizing:border-box;-webkit-user-select:none;user-select:none;--drp-font-size-2xs: calc(var(--drp-font-size-2xs-base) * var(--drp-font-scale));--drp-font-size-xs: calc(var(--drp-font-size-xs-base) * var(--drp-font-scale));--drp-font-size-sm: calc(var(--drp-font-size-sm-base) * var(--drp-font-scale));--drp-font-size-base: calc(var(--drp-font-size-base-base) * var(--drp-font-scale));--drp-font-size-lg: calc(var(--drp-font-size-lg-base) * var(--drp-font-scale));--drp-font-size-xl: calc(var(--drp-font-size-xl-base) * var(--drp-font-scale));--drp-font-size-2xl: calc(var(--drp-font-size-2xl-base) * var(--drp-font-scale))}.drp-date-picker:not(.drp-date-picker--visible){display:none}.drp-date-picker--inline{position:relative!important;display:block!important;z-index:auto;min-width:0;max-width:100%;width:fit-content;box-sizing:border-box}.drp-date-picker__months{display:flex;gap:var(--drp-spacing-lg)}.drp-date-picker--inline .drp-date-picker__months{flex-wrap:wrap}.drp-date-picker__months--grid{display:grid;grid-template-columns:repeat(var(--drp-grid-columns, 3),minmax(0,1fr));grid-template-rows:repeat(var(--drp-grid-rows, 2),auto);gap:var(--drp-spacing-lg);width:100%}@media (max-width: 1200px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),3),minmax(0,1fr))}}@media (max-width: 768px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),2),minmax(0,1fr))}}@media (max-width: 480px){.drp-date-picker__months--grid{grid-template-columns:minmax(0,1fr)}}.drp-date-picker__month{flex:1;min-width:calc(280px * var(--drp-cell-scale));display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:calc(250px * var(--drp-cell-scale))}.drp-date-picker__months--grid .drp-date-picker__month{min-width:0;width:100%}.drp-date-picker__calendar-container{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.drp-date-picker__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-md);gap:var(--drp-spacing-sm)}.drp-date-picker__header--static{justify-content:center}.drp-date-picker__header--static .drp-date-picker__month-year{cursor:default}.drp-date-picker__header--static .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker__month-year{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-base);color:var(--drp-header-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__month-year:hover{background-color:var(--drp-header-bg-hover)}.drp-date-picker__month-year:active{background-color:var(--drp-header-bg-active)}.drp-date-picker__nav{width:calc(2rem * var(--drp-cell-scale));height:calc(2rem * var(--drp-cell-scale));display:flex;align-items:center;justify-content:center;border:var(--drp-border-width-base) solid var(--drp-nav-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-lg);color:var(--drp-nav-text-color)}.drp-date-picker__nav:hover{background-color:var(--drp-nav-bg-hover);border-color:var(--drp-nav-border-hover)}.drp-date-picker__nav:active{background-color:var(--drp-nav-bg-active)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:.6;cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border-color:var(--drp-nav-border-color)}.drp-date-picker__nav--prev:before{content:"‹"}.drp-date-picker__nav--next:before{content:"›"}.drp-date-picker__rolling-selector{position:absolute;top:0;right:0;bottom:0;left:0;display:none;z-index:10}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible{display:flex}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__weekdays,.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__days{visibility:hidden}.drp-date-picker__rolling-selector{gap:var(--drp-spacing-xs)}.drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker__unified-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-lg);gap:var(--drp-spacing-sm);padding:0 var(--drp-spacing-sm)}.drp-date-picker__unified-range{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-lg);color:var(--drp-unified-range-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__unified-range:hover{background-color:var(--drp-unified-range-bg-hover)}.drp-date-picker__unified-range:active{background-color:var(--drp-unified-range-bg-active)}.drp-date-picker__unified-range--static{cursor:default!important}.drp-date-picker__unified-range--static:hover,.drp-date-picker__unified-range--static:active{background-color:transparent}.drp-date-picker__unified-rolling-selector{position:absolute;top:calc(var(--drp-spacing-lg) + var(--drp-spacing-lg) * 2);left:50%;transform:translate(-50%);width:min(90%,450px);height:350px;max-height:350px;display:none;z-index:100;background:var(--drp-card-bg);gap:var(--drp-spacing-xs)}.drp-date-picker__unified-rolling-selector--visible{display:flex}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__nav{display:none}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year{cursor:default;font-size:var(--drp-font-size-base);font-weight:var(--drp-font-weight-normal);color:var(--drp-unified-month-color)}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__rolling-selector{display:none!important}.drp-date-picker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-sm)}.drp-date-picker__weekday{text-align:center;font-size:var(--drp-font-size-xs);font-weight:var(--drp-font-weight-semibold);color:var(--drp-weekday-color);padding:var(--drp-spacing-xs);text-transform:uppercase}.drp-date-picker__days{display:flex;flex-direction:column;gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-md)}.drp-date-picker__date-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs)}.drp-date-picker__day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-sm);color:var(--drp-day-text-color);border-radius:var(--drp-border-radius);cursor:pointer;border:calc(2px * var(--drp-cell-scale)) solid transparent;position:relative}.drp-date-picker__day:hover:not(.drp-date-picker__day--disabled):not(.drp-date-picker__day--other-month){background-color:var(--drp-day-bg-hover);border-color:var(--drp-day-border-hover)}.drp-date-picker__day--today{border-color:var(--drp-day-today-border);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected{background-color:var(--drp-day-selected-bg);color:var(--drp-day-selected-color);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected:hover{background-color:var(--drp-day-selected-bg-hover)}.drp-date-picker__day--focused{outline:calc(2px * var(--drp-cell-scale)) solid var(--drp-day-focused-outline);outline-offset:calc(2px * var(--drp-cell-scale))}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:.6;cursor:not-allowed;position:relative}.drp-date-picker__day--disabled:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-image:repeating-linear-gradient(45deg,rgba(0,0,0,.1) 0px,rgba(0,0,0,.1) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:.5}.drp-date-picker__day--other-month.drp-date-picker__day--range-start,.drp-date-picker__day--other-month.drp-date-picker__day--range-end,.drp-date-picker__day--other-month.drp-date-picker__day--in-range,.drp-date-picker__day--other-month.drp-date-picker__day--drag-preview{opacity:1}.drp-date-picker__day--range-start,.drp-date-picker__day--range-end{background-color:var(--drp-day-range-bg);color:var(--drp-day-range-color);font-weight:var(--drp-font-weight-semibold);cursor:grab;-webkit-user-select:none;user-select:none}.drp-date-picker__day--range-start:active,.drp-date-picker__day--range-end:active{cursor:grabbing}.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) 15%,transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) 25%,transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:.7;transform:scale(1.1);transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__day--drag-preview{background-color:color-mix(in srgb,var(--drp-day-range-bg) 30%,transparent);border:calc(2px * var(--drp-cell-scale)) dashed var(--drp-day-range-bg)}.drp-date-picker__day--drag-preview.drp-date-picker__day--range-start,.drp-date-picker__day--drag-preview.drp-date-picker__day--range-end{background-color:color-mix(in srgb,var(--drp-day-range-bg) 60%,transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,#ef4444 20%,transparent)!important;border-color:#ef4444!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,#ef4444 10%,transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#ef4444 20%,transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,#10b981 10%,transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#10b981 20%,transparent)}.drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed;pointer-events:none;text-decoration:line-through}.drp-date-picker__rolling-item--disabled:hover{background-color:transparent}.drp-date-picker__badge-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-xs);max-height:calc(1rem * var(--drp-cell-scale));min-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:calc(1px * var(--drp-cell-scale)) calc(2px * var(--drp-cell-scale));border-radius:2px;cursor:pointer;height:100%;max-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell:empty{visibility:hidden}.drp-date-picker__badge-cell:hover:not(:empty){transform:scale(1.05)}.drp-date-picker__badge-cell.badge-number{background-color:var(--drp-badge-number-bg);color:var(--drp-badge-number-color);font-size:.7rem;font-weight:600}.drp-date-picker__badge-cell.badge-count{background-color:var(--drp-badge-count-bg);color:var(--drp-badge-count-color);font-size:.7rem;font-weight:700}.drp-date-picker__badge-cell.badge-text{background-color:var(--drp-badge-text-bg);color:var(--drp-badge-text-color);font-size:.65rem;font-weight:700;text-transform:uppercase}.drp-date-picker__summary{text-align:center;padding:var(--drp-spacing-md);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color);font-size:var(--drp-font-size-sm);color:var(--drp-summary-text-color)}.drp-date-picker__summary--visible{display:block}.drp-date-picker__summary--hidden{display:none}.drp-date-picker__summary-count{font-weight:var(--drp-font-weight-semibold);color:var(--drp-summary-count-color);font-size:var(--drp-font-size-base)}.drp-date-picker__actions{display:flex;gap:var(--drp-spacing-sm);justify-content:space-between;padding-top:var(--drp-spacing-sm);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color)}.drp-date-picker__button{flex:1;padding:var(--drp-spacing-sm) var(--drp-spacing-md);border:var(--drp-border-width-base) solid var(--drp-button-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-sm);font-weight:var(--drp-font-weight-medium)}.drp-date-picker__button:hover{background-color:var(--drp-button-bg-hover);border-color:var(--drp-button-border-hover)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-disabled-opacity, .6);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:transparent;border-color:var(--drp-button-border-color)}.drp-date-picker__button--today{color:var(--drp-button-today-color)}.drp-date-picker__button--clear{color:var(--drp-button-clear-color)}.drp-date-picker__button--apply{background-color:var(--drp-button-apply-bg);color:var(--drp-button-apply-color);border-color:var(--drp-button-apply-border)}.drp-date-picker__button--apply:hover{background-color:var(--drp-button-apply-bg-hover)}.drp-date-picker__button--cancel{color:var(--drp-button-cancel-color)}.drp-date-picker__tooltip{position:absolute;z-index:9999;background-color:var(--drp-tooltip-bg);color:var(--drp-tooltip-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius);font-size:var(--drp-font-size-xs);line-height:1.4;max-width:200px;word-wrap:break-word;pointer-events:none;opacity:0;transition:opacity var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__tooltip--visible{opacity:1}.drp-date-picker__tooltip-arrow{position:absolute;background-color:var(--drp-tooltip-bg);width:8px;height:8px;transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fffc;display:flex;align-items:center;justify-content:center;z-index:9500;border-radius:.375rem}.drp-date-picker__loading-spinner{width:40px;height:40px;border:4px solid #e5e7eb;border-top-color:#3b82f6;border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.drp-date-picker.drp-font-xs{--drp-font-scale: .6}.drp-date-picker.drp-font-sm{--drp-font-scale: .8}.drp-date-picker.drp-font-md{--drp-font-scale: 1}.drp-date-picker.drp-font-lg{--drp-font-scale: 1.5}.drp-date-picker.drp-font-xl{--drp-font-scale: 2}.drp-date-picker.drp-spacing-xs{--drp-spacing-scale: .6}.drp-date-picker.drp-spacing-sm{--drp-spacing-scale: .8}.drp-date-picker.drp-spacing-md{--drp-spacing-scale: 1}.drp-date-picker.drp-spacing-lg{--drp-spacing-scale: 1.5}.drp-date-picker.drp-spacing-xl{--drp-spacing-scale: 2}.drp-date-picker.drp-cell-xs{--drp-cell-scale: .6}.drp-date-picker.drp-cell-sm{--drp-cell-scale: .8}.drp-date-picker.drp-cell-md{--drp-cell-scale: 1}.drp-date-picker.drp-cell-lg{--drp-cell-scale: 1.5}.drp-date-picker.drp-cell-xl{--drp-cell-scale: 2}@media (max-width: 1200px){.drp-responsive.drp-font-xl{--drp-font-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-font-xl{--drp-font-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-font-lg{--drp-font-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-font-lg{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-md{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-sm{--drp-font-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-md{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-sm{--drp-spacing-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-cell-lg{--drp-cell-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-cell-lg{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-md{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-sm{--drp-cell-scale: .6}}.drp-date-picker--xs{--drp-font-scale: .6;--drp-spacing-scale: .6;--drp-cell-scale: .6;min-width:168px}.drp-date-picker--sm{--drp-font-scale: .8;--drp-spacing-scale: .8;--drp-cell-scale: .8;min-width:224px}.drp-date-picker--lg{--drp-font-scale: 1.5;--drp-spacing-scale: 1.5;--drp-cell-scale: 1.5;min-width:420px}.drp-date-picker--xl{--drp-font-scale: 2;--drp-spacing-scale: 2;--drp-cell-scale: 2;min-width:560px}.drp-date-picker.drp-transitions-enabled .drp-date-picker__badge-cell{transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__nav,.drp-date-picker.drp-transitions-enabled .drp-date-picker__action-btn{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy),border-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__month-year,.drp-date-picker.drp-transitions-enabled .drp-date-picker__rolling-item{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker--inline{position:static;display:block;box-shadow:none}', ve = class ve {
|
|
2675
|
+
const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale: 1;--drp-cell-scale: 1;--drp-spacing-xs-base: .25rem;--drp-spacing-sm-base: .5rem;--drp-spacing-md-base: 1rem;--drp-spacing-lg-base: 1.5rem;--drp-spacing-xl-base: 2rem;--drp-spacing-xs: calc(var(--drp-spacing-xs-base) * var(--drp-spacing-scale));--drp-spacing-sm: calc(var(--drp-spacing-sm-base) * var(--drp-spacing-scale));--drp-spacing-md: calc(var(--drp-spacing-md-base) * var(--drp-spacing-scale));--drp-spacing-lg: calc(var(--drp-spacing-lg-base) * var(--drp-spacing-scale));--drp-spacing-xl: calc(var(--drp-spacing-xl-base) * var(--drp-spacing-scale));--drp-font-size-2xs-base: .625rem;--drp-font-size-xs-base: .75rem;--drp-font-size-sm-base: .875rem;--drp-font-size-base-base: 1rem;--drp-font-size-lg-base: 1.125rem;--drp-font-size-xl-base: 1.25rem;--drp-font-size-2xl-base: 1.5rem;--drp-font-weight-medium: 500;--drp-font-weight-semibold: 600;--drp-card-bg: #ffffff;--drp-border-color: #e5e7eb;--drp-primary-bg: #f3f4f6;--drp-primary-bg-hover: #e5e7eb;--drp-accent-color: #3b82f6;--drp-accent-color-hover: #2563eb;--drp-text-primary: #111827;--drp-text-secondary: #6b7280;--drp-accent-text-color: #ffffff;--drp-button-text-color: #ffffff;--drp-tooltip-bg: #111827;--drp-tooltip-color: #ffffff;--drp-border-width-base: 1px;--drp-border-radius: .375rem;--drp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-input-padding-h: .75rem;--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-input-background: var(--drp-card-bg);--drp-input-color: var(--drp-text-primary);--drp-input-border-color: var(--drp-border-color);--drp-input-border-color-hover: var(--drp-accent-color);--drp-input-border-color-focus: var(--drp-accent-color);--drp-input-placeholder-color: var(--drp-text-secondary);--drp-input-disabled-background: var(--drp-primary-bg);--drp-input-focus-shadow-color: rgba(59, 130, 246, .1);--drp-input-focus-shadow-size: 3px;--drp-input-icon-opacity: .6;--drp-input-size-xs-font: .75rem;--drp-input-size-xs-padding-v: .25rem;--drp-input-size-xs-padding-h: .25rem;--drp-input-size-xs-height: 1.5rem;--drp-input-size-xs-icon-size: .75em;--drp-input-size-sm-font: .875rem;--drp-input-size-sm-padding-v: .25rem;--drp-input-size-sm-padding-h: .5rem;--drp-input-size-sm-height: 2rem;--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: 1rem;--drp-input-size-md-padding-v: .5rem;--drp-input-size-md-padding-h: .75rem;--drp-input-size-md-height: 2.5rem;--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: 1.125rem;--drp-input-size-lg-padding-v: 1rem;--drp-input-size-lg-padding-h: 1rem;--drp-input-size-lg-height: 3rem;--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: 1.25rem;--drp-input-size-xl-padding-v: 1rem;--drp-input-size-xl-padding-h: 1.5rem;--drp-input-size-xl-height: 3.5rem;--drp-input-size-xl-icon-size: 1.25em;--drp-header-text-color: var(--drp-text-primary);--drp-header-bg-hover: var(--drp-primary-bg);--drp-header-bg-active: var(--drp-primary-bg-hover);--drp-nav-text-color: var(--drp-text-primary);--drp-nav-border-color: var(--drp-border-color);--drp-nav-bg-hover: var(--drp-primary-bg);--drp-nav-bg-active: var(--drp-primary-bg-hover);--drp-nav-border-hover: var(--drp-accent-color);--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-scrollbar-thumb: var(--drp-border-color);--drp-rolling-scrollbar-thumb-hover: var(--drp-accent-color);--drp-rolling-item-bg-hover: var(--drp-primary-bg);--drp-rolling-item-bg-selected: var(--drp-accent-color);--drp-rolling-item-color-selected: var(--drp-accent-text-color);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-weekday-color: var(--drp-text-secondary);--drp-day-text-color: var(--drp-text-primary);--drp-day-bg-hover: var(--drp-primary-bg);--drp-day-border-hover: var(--drp-accent-color);--drp-day-today-border: var(--drp-accent-color);--drp-day-selected-bg: var(--drp-accent-color);--drp-day-selected-color: var(--drp-accent-text-color);--drp-day-selected-bg-hover: var(--drp-accent-color-hover);--drp-day-focused-outline: var(--drp-accent-color);--drp-day-disabled-color: var(--drp-text-secondary);--drp-day-other-month-color: var(--drp-text-secondary);--drp-day-range-bg: var(--drp-accent-color);--drp-day-range-color: var(--drp-accent-text-color);--drp-summary-text-color: var(--drp-text-secondary);--drp-summary-border-color: var(--drp-border-color);--drp-summary-count-color: var(--drp-accent-color);--drp-button-border-color: var(--drp-border-color);--drp-button-bg-hover: var(--drp-primary-bg);--drp-button-border-hover: var(--drp-accent-color);--drp-button-today-color: var(--drp-accent-color);--drp-button-clear-color: var(--drp-text-secondary);--drp-button-cancel-color: var(--drp-text-secondary);--drp-button-apply-bg: var(--drp-accent-color);--drp-button-apply-color: var(--drp-button-text-color);--drp-button-apply-border: var(--drp-accent-color);--drp-button-apply-bg-hover: var(--drp-accent-color-hover);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-accent-text-color);--drp-badge-count-bg: #ef4444;--drp-badge-count-color: #ffffff;--drp-badge-text-bg: var(--drp-text-secondary);--drp-badge-text-color: #ffffff;--drp-unified-range-text-color: var(--drp-text-primary);--drp-unified-range-bg-hover: var(--drp-primary-bg);--drp-unified-range-bg-active: var(--drp-primary-bg-hover);--drp-unified-month-color: var(--drp-text-secondary);--drp-unified-rolling-disabled-color: var(--drp-text-secondary)}.drp-input{width:100%;font-family:inherit;font-size:var(--drp-input-size-md-font);line-height:1.5;color:var(--drp-input-color);background-color:var(--drp-input-background);border:var(--drp-border-width-base) solid var(--drp-input-border-color);border-radius:var(--drp-border-radius);padding:var(--drp-input-size-md-padding-v) var(--drp-input-size-md-padding-h);padding-right:calc(var(--drp-input-size-md-padding-h) * 2.5);height:var(--drp-input-size-md-height);box-sizing:border-box;transition:border-color var(--drp-transition-fast) var(--drp-easing-snappy),box-shadow var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-input::placeholder{color:var(--drp-input-placeholder-color);opacity:.6}.drp-input:hover:not(:disabled){border-color:var(--drp-input-border-color-hover)}.drp-input:focus{outline:none;border-color:var(--drp-input-border-color-focus);box-shadow:0 0 0 var(--drp-input-focus-shadow-size) var(--drp-input-focus-shadow-color)}.drp-input:disabled{opacity:.6;cursor:not-allowed;background-color:var(--drp-input-disabled-background)}.drp-input.drp-input--xs{font-size:var(--drp-input-size-xs-font);padding:var(--drp-input-size-xs-padding-v) var(--drp-input-size-xs-padding-h);padding-right:calc(var(--drp-input-size-xs-padding-h) * 2.5);height:var(--drp-input-size-xs-height)}.drp-input.drp-input--sm{font-size:var(--drp-input-size-sm-font);padding:var(--drp-input-size-sm-padding-v) var(--drp-input-size-sm-padding-h);padding-right:calc(var(--drp-input-size-sm-padding-h) * 2.5);height:var(--drp-input-size-sm-height)}.drp-input.drp-input--lg{font-size:var(--drp-input-size-lg-font);padding:var(--drp-input-size-lg-padding-v) var(--drp-input-size-lg-padding-h);padding-right:calc(var(--drp-input-size-lg-padding-h) * 2.5);height:var(--drp-input-size-lg-height)}.drp-input.drp-input--xl{font-size:var(--drp-input-size-xl-font);padding:var(--drp-input-size-xl-padding-v) var(--drp-input-size-xl-padding-h);padding-right:calc(var(--drp-input-size-xl-padding-h) * 2.5);height:var(--drp-input-size-xl-height)}.drp-date-picker-input{position:relative;cursor:pointer;display:inline-block;width:100%}.drp-date-picker-input:after{content:"📅";position:absolute;right:var(--drp-input-size-md-padding-h);top:50%;transform:translateY(-50%);pointer-events:none;opacity:var(--drp-input-icon-opacity);font-size:var(--drp-input-size-md-icon-size)}.drp-date-picker-input.drp-date-picker-input--xs:after{right:var(--drp-input-size-xs-padding-h);font-size:var(--drp-input-size-xs-icon-size)}.drp-date-picker-input.drp-date-picker-input--sm:after{right:var(--drp-input-size-sm-padding-h);font-size:var(--drp-input-size-sm-icon-size)}.drp-date-picker-input.drp-date-picker-input--lg:after{right:var(--drp-input-size-lg-padding-h);font-size:var(--drp-input-size-lg-icon-size)}.drp-date-picker-input.drp-date-picker-input--xl:after{right:var(--drp-input-size-xl-padding-h);font-size:var(--drp-input-size-xl-icon-size)}.drp-date-picker{position:absolute;z-index:9500;background:var(--drp-card-bg);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:280px;max-width:calc(100vw - 2rem);box-sizing:border-box;-webkit-user-select:none;user-select:none;--drp-font-size-2xs: calc(var(--drp-font-size-2xs-base) * var(--drp-font-scale));--drp-font-size-xs: calc(var(--drp-font-size-xs-base) * var(--drp-font-scale));--drp-font-size-sm: calc(var(--drp-font-size-sm-base) * var(--drp-font-scale));--drp-font-size-base: calc(var(--drp-font-size-base-base) * var(--drp-font-scale));--drp-font-size-lg: calc(var(--drp-font-size-lg-base) * var(--drp-font-scale));--drp-font-size-xl: calc(var(--drp-font-size-xl-base) * var(--drp-font-scale));--drp-font-size-2xl: calc(var(--drp-font-size-2xl-base) * var(--drp-font-scale))}.drp-date-picker:not(.drp-date-picker--visible){display:none}.drp-date-picker--inline{position:relative!important;display:block!important;z-index:auto;min-width:0;max-width:100%;width:fit-content;box-sizing:border-box}.drp-date-picker__months{display:flex;gap:var(--drp-spacing-lg)}.drp-date-picker--inline .drp-date-picker__months{flex-wrap:wrap}.drp-date-picker__months--grid{display:grid;grid-template-columns:repeat(var(--drp-grid-columns, 3),minmax(0,1fr));grid-template-rows:repeat(var(--drp-grid-rows, 2),auto);gap:var(--drp-spacing-lg);width:100%}@media (max-width: 1200px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),3),minmax(0,1fr))}}@media (max-width: 768px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),2),minmax(0,1fr))}}@media (max-width: 480px){.drp-date-picker__months--grid{grid-template-columns:minmax(0,1fr)}}.drp-date-picker__month{flex:1;min-width:calc(280px * var(--drp-cell-scale));display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:calc(250px * var(--drp-cell-scale))}.drp-date-picker__months--grid .drp-date-picker__month{min-width:0;width:100%}.drp-date-picker__calendar-container{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.drp-date-picker__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-md);gap:var(--drp-spacing-sm)}.drp-date-picker__header--static{justify-content:center}.drp-date-picker__header--static .drp-date-picker__month-year{cursor:default}.drp-date-picker__header--static .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker__month-year{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-base);color:var(--drp-header-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__month-year:hover{background-color:var(--drp-header-bg-hover)}.drp-date-picker__month-year:active{background-color:var(--drp-header-bg-active)}.drp-date-picker__nav{width:calc(2rem * var(--drp-cell-scale));height:calc(2rem * var(--drp-cell-scale));display:flex;align-items:center;justify-content:center;border:var(--drp-border-width-base) solid var(--drp-nav-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-lg);color:var(--drp-nav-text-color)}.drp-date-picker__nav:hover{background-color:var(--drp-nav-bg-hover);border-color:var(--drp-nav-border-hover)}.drp-date-picker__nav:active{background-color:var(--drp-nav-bg-active)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:.6;cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border-color:var(--drp-nav-border-color)}.drp-date-picker__nav--prev:before{content:"‹"}.drp-date-picker__nav--next:before{content:"›"}.drp-date-picker__rolling-selector{position:absolute;top:0;right:0;bottom:0;left:0;display:none;z-index:10}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible{display:flex}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__weekdays,.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__days{visibility:hidden}.drp-date-picker__rolling-selector{gap:var(--drp-spacing-xs)}.drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker__unified-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-lg);gap:var(--drp-spacing-sm);padding:0 var(--drp-spacing-sm)}.drp-date-picker__unified-range{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-lg);color:var(--drp-unified-range-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__unified-range:hover{background-color:var(--drp-unified-range-bg-hover)}.drp-date-picker__unified-range:active{background-color:var(--drp-unified-range-bg-active)}.drp-date-picker__unified-range--static{cursor:default!important}.drp-date-picker__unified-range--static:hover,.drp-date-picker__unified-range--static:active{background-color:transparent}.drp-date-picker__unified-rolling-selector{position:absolute;top:calc(var(--drp-spacing-lg) + var(--drp-spacing-lg) * 2);left:50%;transform:translate(-50%);width:min(90%,450px);height:350px;max-height:350px;display:none;z-index:100;background:var(--drp-card-bg);gap:var(--drp-spacing-xs)}.drp-date-picker__unified-rolling-selector--visible{display:flex}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__nav{display:none}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year{cursor:default;font-size:var(--drp-font-size-base);font-weight:var(--drp-font-weight-normal);color:var(--drp-unified-month-color)}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__rolling-selector{display:none!important}.drp-date-picker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-sm)}.drp-date-picker__weekday{text-align:center;font-size:var(--drp-font-size-xs);font-weight:var(--drp-font-weight-semibold);color:var(--drp-weekday-color);padding:var(--drp-spacing-xs);text-transform:uppercase}.drp-date-picker__days{display:flex;flex-direction:column;gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-md)}.drp-date-picker__date-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs)}.drp-date-picker__day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-sm);color:var(--drp-day-text-color);border-radius:var(--drp-border-radius);cursor:pointer;border:calc(2px * var(--drp-cell-scale)) solid transparent;position:relative}.drp-date-picker__day:hover:not(.drp-date-picker__day--disabled):not(.drp-date-picker__day--other-month){background-color:var(--drp-day-bg-hover);border-color:var(--drp-day-border-hover)}.drp-date-picker__day--today{border-color:var(--drp-day-today-border);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected{background-color:var(--drp-day-selected-bg);color:var(--drp-day-selected-color);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected:hover{background-color:var(--drp-day-selected-bg-hover)}.drp-date-picker__day--focused{outline:calc(2px * var(--drp-cell-scale)) solid var(--drp-day-focused-outline);outline-offset:calc(2px * var(--drp-cell-scale))}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:.6;cursor:not-allowed;position:relative}.drp-date-picker__day--disabled:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-image:repeating-linear-gradient(45deg,rgba(0,0,0,.1) 0px,rgba(0,0,0,.1) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:.5}.drp-date-picker__day--other-month.drp-date-picker__day--range-start,.drp-date-picker__day--other-month.drp-date-picker__day--range-end,.drp-date-picker__day--other-month.drp-date-picker__day--in-range,.drp-date-picker__day--other-month.drp-date-picker__day--drag-preview{opacity:1}.drp-date-picker__day--range-start,.drp-date-picker__day--range-end{background-color:var(--drp-day-range-bg);color:var(--drp-day-range-color);font-weight:var(--drp-font-weight-semibold);cursor:grab;-webkit-user-select:none;user-select:none}.drp-date-picker__day--range-start:active,.drp-date-picker__day--range-end:active{cursor:grabbing}.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) 15%,transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) 25%,transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:.7;transform:scale(1.1);transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__day--drag-preview{background-color:color-mix(in srgb,var(--drp-day-range-bg) 30%,transparent);border:calc(2px * var(--drp-cell-scale)) dashed var(--drp-day-range-bg)}.drp-date-picker__day--drag-preview.drp-date-picker__day--range-start,.drp-date-picker__day--drag-preview.drp-date-picker__day--range-end{background-color:color-mix(in srgb,var(--drp-day-range-bg) 60%,transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,#ef4444 20%,transparent)!important;border-color:#ef4444!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,#ef4444 10%,transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#ef4444 20%,transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,#10b981 10%,transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#10b981 20%,transparent)}.drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed;pointer-events:none;text-decoration:line-through}.drp-date-picker__rolling-item--disabled:hover{background-color:transparent}.drp-date-picker__badge-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-xs);max-height:calc(1rem * var(--drp-cell-scale));min-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:calc(1px * var(--drp-cell-scale)) calc(2px * var(--drp-cell-scale));border-radius:2px;cursor:pointer;height:100%;max-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell:empty{visibility:hidden}.drp-date-picker__badge-cell:hover:not(:empty){transform:scale(1.05)}.drp-date-picker__badge-cell.badge-number{background-color:var(--drp-badge-number-bg);color:var(--drp-badge-number-color);font-size:.7rem;font-weight:600}.drp-date-picker__badge-cell.badge-count{background-color:var(--drp-badge-count-bg);color:var(--drp-badge-count-color);font-size:.7rem;font-weight:700}.drp-date-picker__badge-cell.badge-text{background-color:var(--drp-badge-text-bg);color:var(--drp-badge-text-color);font-size:.65rem;font-weight:700;text-transform:uppercase}.drp-date-picker__summary{text-align:center;padding:var(--drp-spacing-md);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color);font-size:var(--drp-font-size-sm);color:var(--drp-summary-text-color)}.drp-date-picker__summary--visible{display:block}.drp-date-picker__summary--hidden{display:none}.drp-date-picker__summary-count{font-weight:var(--drp-font-weight-semibold);color:var(--drp-summary-count-color);font-size:var(--drp-font-size-base)}.drp-date-picker__actions{display:flex;gap:var(--drp-spacing-sm);justify-content:space-between;padding-top:var(--drp-spacing-sm);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color)}.drp-date-picker__button{flex:1;padding:var(--drp-spacing-sm) var(--drp-spacing-md);border:var(--drp-border-width-base) solid var(--drp-button-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-sm);font-weight:var(--drp-font-weight-medium)}.drp-date-picker__button:hover{background-color:var(--drp-button-bg-hover);border-color:var(--drp-button-border-hover)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-disabled-opacity, .6);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:transparent;border-color:var(--drp-button-border-color)}.drp-date-picker__button--today{color:var(--drp-button-today-color)}.drp-date-picker__button--clear{color:var(--drp-button-clear-color)}.drp-date-picker__button--apply{background-color:var(--drp-button-apply-bg);color:var(--drp-button-apply-color);border-color:var(--drp-button-apply-border)}.drp-date-picker__button--apply:hover{background-color:var(--drp-button-apply-bg-hover)}.drp-date-picker__button--cancel{color:var(--drp-button-cancel-color)}.drp-date-picker__tooltip{position:absolute;z-index:9999;background-color:var(--drp-tooltip-bg);color:var(--drp-tooltip-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius);font-size:var(--drp-font-size-xs);line-height:1.4;max-width:200px;word-wrap:break-word;pointer-events:none;opacity:0;transition:opacity var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__tooltip--visible{opacity:1}.drp-date-picker__tooltip-arrow{position:absolute;background-color:var(--drp-tooltip-bg);width:8px;height:8px;transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fffc;display:flex;align-items:center;justify-content:center;z-index:9500;border-radius:.375rem}.drp-date-picker__loading-spinner{width:40px;height:40px;border:4px solid #e5e7eb;border-top-color:#3b82f6;border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.drp-date-picker.drp-font-xs{--drp-font-scale: .6}.drp-date-picker.drp-font-sm{--drp-font-scale: .8}.drp-date-picker.drp-font-md{--drp-font-scale: 1}.drp-date-picker.drp-font-lg{--drp-font-scale: 1.5}.drp-date-picker.drp-font-xl{--drp-font-scale: 2}.drp-date-picker.drp-spacing-xs{--drp-spacing-scale: .6}.drp-date-picker.drp-spacing-sm{--drp-spacing-scale: .8}.drp-date-picker.drp-spacing-md{--drp-spacing-scale: 1}.drp-date-picker.drp-spacing-lg{--drp-spacing-scale: 1.5}.drp-date-picker.drp-spacing-xl{--drp-spacing-scale: 2}.drp-date-picker.drp-cell-xs{--drp-cell-scale: .6}.drp-date-picker.drp-cell-sm{--drp-cell-scale: .8}.drp-date-picker.drp-cell-md{--drp-cell-scale: 1}.drp-date-picker.drp-cell-lg{--drp-cell-scale: 1.5}.drp-date-picker.drp-cell-xl{--drp-cell-scale: 2}@media (max-width: 1200px){.drp-responsive.drp-font-xl{--drp-font-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-font-xl{--drp-font-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-font-lg{--drp-font-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-font-lg{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-md{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-sm{--drp-font-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-md{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-sm{--drp-spacing-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-cell-lg{--drp-cell-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-cell-lg{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-md{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-sm{--drp-cell-scale: .6}}.drp-date-picker--xs{--drp-font-scale: .6;--drp-spacing-scale: .6;--drp-cell-scale: .6;min-width:168px}.drp-date-picker--sm{--drp-font-scale: .8;--drp-spacing-scale: .8;--drp-cell-scale: .8;min-width:224px}.drp-date-picker--lg{--drp-font-scale: 1.5;--drp-spacing-scale: 1.5;--drp-cell-scale: 1.5;min-width:420px}.drp-date-picker--xl{--drp-font-scale: 2;--drp-spacing-scale: 2;--drp-cell-scale: 2;min-width:560px}.drp-date-picker.drp-transitions-enabled .drp-date-picker__badge-cell{transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__nav,.drp-date-picker.drp-transitions-enabled .drp-date-picker__action-btn{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy),border-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__month-year,.drp-date-picker.drp-transitions-enabled .drp-date-picker__rolling-item{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker--inline{position:static;display:block;box-shadow:none}', ve = class ve {
|
|
2676
2676
|
constructor(a, t = {}) {
|
|
2677
2677
|
b(this, "input");
|
|
2678
2678
|
b(this, "options");
|
|
@@ -2810,39 +2810,39 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2810
2810
|
showClearButton: t.showClearButton !== void 0 ? t.showClearButton : !0,
|
|
2811
2811
|
showApplyButton: t.showApplyButton !== void 0 ? t.showApplyButton : t.selectionMode === "range" || t.selectionMode === "multiple"
|
|
2812
2812
|
}, this.options.showDebugInfo ? ft() : mt(), this.options.unifiedNavigation && this.options.unifiedNavigationAnchorIndex !== void 0) {
|
|
2813
|
-
const
|
|
2814
|
-
(this.options.unifiedNavigationAnchorIndex < 0 || this.options.unifiedNavigationAnchorIndex >
|
|
2813
|
+
const i = this.options.visibleMonthsCount - 1;
|
|
2814
|
+
(this.options.unifiedNavigationAnchorIndex < 0 || this.options.unifiedNavigationAnchorIndex > i) && (console.warn(`unifiedNavigationAnchorIndex (${this.options.unifiedNavigationAnchorIndex}) out of bounds. Using 0.`), this.options.unifiedNavigationAnchorIndex = 0);
|
|
2815
2815
|
}
|
|
2816
|
-
this.weekStartDay = Xt(this.options.weekStartDay),
|
|
2816
|
+
this.weekStartDay = Xt(this.options.weekStartDay), k.debug("Week starts on day:", this.weekStartDay), k.debug("disabledDatesHandling:", this.options.disabledDatesHandling), this.locale = Oe(this.options.locale), this.localeStrings = In(this.locale, this.options.customStrings), this.weekdayNames = En(this.locale), this.monthNames = this.options.monthNames || Rn(this.locale), k.debug("Locale:", this.locale, "Weekdays:", this.weekdayNames, "Months:", this.monthNames), this.initializeDateRestrictions(), this.formatInfo = this.parseFormat(this.options.dateFormatMask), k.debug("Format info:", this.formatInfo), this._previousInputValue = "", this.currentDate = /* @__PURE__ */ new Date();
|
|
2817
2817
|
let n;
|
|
2818
2818
|
if (this.options.initialDate)
|
|
2819
|
-
n = he(this.options.initialDate) || /* @__PURE__ */ new Date(),
|
|
2819
|
+
n = he(this.options.initialDate) || /* @__PURE__ */ new Date(), k.debug(`Using initialDate: ${n.toISOString()}`);
|
|
2820
2820
|
else if (this.options.rollingYearRange || this.options.rollingMonthRange) {
|
|
2821
|
-
const
|
|
2822
|
-
n = new Date(o, s, 1),
|
|
2823
|
-
} else this.normalizedMinDate && this.normalizedMinDate > /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMinDate),
|
|
2821
|
+
const i = this.getEffectiveYearRange(), r = this.getEffectiveMonthRange(), o = i.min, s = r.min - 1;
|
|
2822
|
+
n = new Date(o, s, 1), k.debug(`Using first allowed year/month as initial: ${n.toISOString()}`);
|
|
2823
|
+
} else this.normalizedMinDate && this.normalizedMinDate > /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMinDate), k.debug(`Using minDate as initial: ${n.toISOString()}`)) : this.normalizedMaxDate && this.normalizedMaxDate < /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMaxDate), k.debug(`Using maxDate as initial: ${n.toISOString()}`)) : (n = /* @__PURE__ */ new Date(), k.debug(`Using current date as initial: ${n.toISOString()}`));
|
|
2824
2824
|
this.monthDates = [];
|
|
2825
|
-
for (let
|
|
2826
|
-
const
|
|
2827
|
-
this.monthDates.push(
|
|
2825
|
+
for (let i = 0; i < this.options.visibleMonthsCount; i++) {
|
|
2826
|
+
const r = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
2827
|
+
this.monthDates.push(r), k.debug(`monthDates[${i}] = ${r.getFullYear()}-${r.getMonth() + 1}`);
|
|
2828
2828
|
}
|
|
2829
2829
|
if (this.options.selectionMode === "range") {
|
|
2830
2830
|
this.displayMonths = [];
|
|
2831
|
-
for (let
|
|
2832
|
-
const
|
|
2831
|
+
for (let i = 0; i < this.options.visibleMonthsCount; i++) {
|
|
2832
|
+
const r = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
2833
2833
|
this.displayMonths.push({
|
|
2834
|
-
month:
|
|
2835
|
-
year:
|
|
2834
|
+
month: r.getMonth(),
|
|
2835
|
+
year: r.getFullYear()
|
|
2836
2836
|
});
|
|
2837
2837
|
}
|
|
2838
2838
|
}
|
|
2839
2839
|
this.selectedDate = null, this.selectedStartDate = null, this.selectedEndDate = null, this.selectedRanges = [], this.selectedDates = [], this.pendingSelection = null, this.focusedDayIndex = null, this.activeMonthIndex = 0, this.showingRollingSelector = [];
|
|
2840
|
-
for (let
|
|
2840
|
+
for (let i = 0; i < this.options.visibleMonthsCount; i++)
|
|
2841
2841
|
this.showingRollingSelector.push(!1);
|
|
2842
2842
|
this.draggingType = null, this.isDragging = !1, this.dragStartDate = null, this.originalStartDate = null, this.originalEndDate = null, this.dragPreviewStart = null, this.dragPreviewEnd = null, this.autoScrollInterval = null, this.init();
|
|
2843
2843
|
}
|
|
2844
2844
|
init() {
|
|
2845
|
-
|
|
2845
|
+
k.debug("Init called"), this.createCalendar(), this.input && (this.attachInputListeners(), this.input.value && (k.debug("Parsing pre-filled value:", this.input.value), this.updateCalendarFromInput())), this.options.positioningMode === "inline" && (this.renderCalendar(), this.calendar.classList.add("drp-date-picker--visible", "drp-date-picker--inline"), this.isCalendarActive = !0, this.isFirstRender = !1, Tt(this), this.clickOutsideHandler && document.addEventListener("click", this.clickOutsideHandler)), k.debug("Init complete");
|
|
2846
2846
|
}
|
|
2847
2847
|
/**
|
|
2848
2848
|
* Initialize and normalize date restrictions
|
|
@@ -2859,8 +2859,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2859
2859
|
this.options.specialDates.forEach((t) => {
|
|
2860
2860
|
const n = he(t[a]);
|
|
2861
2861
|
if (n) {
|
|
2862
|
-
const
|
|
2863
|
-
this.normalizedSpecialDates.set(
|
|
2862
|
+
const i = me(n);
|
|
2863
|
+
this.normalizedSpecialDates.set(i, t);
|
|
2864
2864
|
} else
|
|
2865
2865
|
console.warn("[Special Dates] Failed to normalize date:", t[a]);
|
|
2866
2866
|
});
|
|
@@ -2899,12 +2899,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2899
2899
|
return;
|
|
2900
2900
|
} else if (n.isVisible !== void 0 && !n.isVisible)
|
|
2901
2901
|
return;
|
|
2902
|
-
const
|
|
2903
|
-
|
|
2904
|
-
const
|
|
2905
|
-
|
|
2902
|
+
const i = document.createElement("button");
|
|
2903
|
+
i.className = `drp-date-picker__button drp-date-picker__button--${n.action}`;
|
|
2904
|
+
const r = n.getClassCallback ? n.getClassCallback(this) : n.cssClass;
|
|
2905
|
+
r && (Array.isArray(r) ? i.classList.add(...r) : i.classList.add(r));
|
|
2906
2906
|
const o = n.getTextCallback ? n.getTextCallback(this) : n.text;
|
|
2907
|
-
|
|
2907
|
+
i.innerHTML = o, (n.isDisabledCallback ? n.isDisabledCallback(this) : n.isDisabled ?? !1) && (i.disabled = !0), i.dataset.action = n.action, n.onClick && (i._customOnClick = n.onClick), a.appendChild(i);
|
|
2908
2908
|
}), this.attachActionButtonTooltips();
|
|
2909
2909
|
}
|
|
2910
2910
|
/**
|
|
@@ -2929,13 +2929,13 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2929
2929
|
attachActionButtonTooltips() {
|
|
2930
2930
|
if (!this.actionsContainer) return;
|
|
2931
2931
|
this.actionsContainer.querySelectorAll(".drp-date-picker__action").forEach((t) => {
|
|
2932
|
-
const n = t,
|
|
2933
|
-
if (!
|
|
2934
|
-
const o = (this.options.actionButtons || this.getDefaultButtons()).find((l) => l.action ===
|
|
2932
|
+
const n = t, i = n.dataset.action;
|
|
2933
|
+
if (!i) return;
|
|
2934
|
+
const o = (this.options.actionButtons || this.getDefaultButtons()).find((l) => l.action === i);
|
|
2935
2935
|
if (!o) return;
|
|
2936
2936
|
let s;
|
|
2937
2937
|
if (o.getTooltipCallback ? s = o.getTooltipCallback(this) : s = o.tooltip, !s) return;
|
|
2938
|
-
const d = `action-${
|
|
2938
|
+
const d = `action-${i}-${Date.now()}-${Math.random()}`;
|
|
2939
2939
|
this.createActionButtonTooltip(n, s, d);
|
|
2940
2940
|
});
|
|
2941
2941
|
}
|
|
@@ -2943,16 +2943,16 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2943
2943
|
* Create a Floating UI tooltip for an action button
|
|
2944
2944
|
*/
|
|
2945
2945
|
createActionButtonTooltip(a, t, n) {
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2946
|
+
const i = document.createElement("div");
|
|
2947
|
+
i.className = "drp-date-picker__tooltip", i.textContent = t, (this.options.container || document.body).appendChild(i), this.actionButtonTooltips.set(n, i);
|
|
2948
2948
|
let o, s;
|
|
2949
2949
|
const d = () => {
|
|
2950
2950
|
clearTimeout(s), o = window.setTimeout(() => {
|
|
2951
|
-
|
|
2951
|
+
i.classList.add("drp-date-picker__tooltip--visible"), this.positionActionButtonTooltip(a, i, n);
|
|
2952
2952
|
}, 300);
|
|
2953
2953
|
}, l = () => {
|
|
2954
2954
|
clearTimeout(o), s = window.setTimeout(() => {
|
|
2955
|
-
|
|
2955
|
+
i.classList.remove("drp-date-picker__tooltip--visible");
|
|
2956
2956
|
const c = this.actionButtonTooltipCleanups.get(n);
|
|
2957
2957
|
c && (c(), this.actionButtonTooltipCleanups.delete(n));
|
|
2958
2958
|
}, 100);
|
|
@@ -2963,13 +2963,13 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2963
2963
|
* Position action button tooltip using Floating UI
|
|
2964
2964
|
*/
|
|
2965
2965
|
async positionActionButtonTooltip(a, t, n) {
|
|
2966
|
-
const { computePosition:
|
|
2967
|
-
|
|
2966
|
+
const { computePosition: i, flip: r, shift: o, offset: s, autoUpdate: d } = await Promise.resolve().then(() => en), l = d(a, t, () => {
|
|
2967
|
+
i(a, t, {
|
|
2968
2968
|
placement: "top",
|
|
2969
2969
|
strategy: "fixed",
|
|
2970
2970
|
middleware: [
|
|
2971
2971
|
s(8),
|
|
2972
|
-
|
|
2972
|
+
r(),
|
|
2973
2973
|
o({ padding: 8 })
|
|
2974
2974
|
]
|
|
2975
2975
|
}).then(({ x: c, y: p }) => {
|
|
@@ -2998,8 +2998,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2998
2998
|
const t = this.getEffectiveYearRange(), n = a.getFullYear();
|
|
2999
2999
|
if (n < t.min || n > t.max)
|
|
3000
3000
|
return !0;
|
|
3001
|
-
const
|
|
3002
|
-
return
|
|
3001
|
+
const i = this.getEffectiveMonthRange(), r = a.getMonth() + 1;
|
|
3002
|
+
return r < i.min || r > i.max ? !0 : Jt(
|
|
3003
3003
|
a,
|
|
3004
3004
|
this.normalizedMinDate,
|
|
3005
3005
|
this.normalizedMaxDate,
|
|
@@ -3029,12 +3029,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3029
3029
|
};
|
|
3030
3030
|
}
|
|
3031
3031
|
if (this.normalizedSpecialDates.has(t)) {
|
|
3032
|
-
const n = this.normalizedSpecialDates.get(t),
|
|
3032
|
+
const n = this.normalizedSpecialDates.get(t), i = this.options.badgeTextMember || "badgeText", r = this.options.badgeClassMember || "badgeClass", o = this.options.dayClassMember || "dayClass", s = this.options.badgeTooltipMember || "badgeTooltip", d = this.options.dayTooltipMember || "dayTooltip", l = this.options.isDisabledMember || "isDisabled";
|
|
3033
3033
|
return {
|
|
3034
3034
|
isDisabled: n[l] !== void 0 ? n[l] : this.isDateDisabledInternal(a),
|
|
3035
|
-
badgeClass: n[
|
|
3035
|
+
badgeClass: n[r],
|
|
3036
3036
|
dayClass: n[o],
|
|
3037
|
-
badgeText: n[
|
|
3037
|
+
badgeText: n[i],
|
|
3038
3038
|
badgeTooltip: n[s],
|
|
3039
3039
|
dayTooltip: n[d]
|
|
3040
3040
|
};
|
|
@@ -3095,12 +3095,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3095
3095
|
return this.options.selectionMode === "multiple" ? !1 : this.options.autoClose === "selection";
|
|
3096
3096
|
}
|
|
3097
3097
|
createCalendar() {
|
|
3098
|
-
if (
|
|
3098
|
+
if (k.debug("Creating calendar"), this.calendar = document.createElement("div"), this.calendar.className = "drp-date-picker", this.options.unifiedNavigation && this.calendar.classList.add("drp-date-picker--unified-nav"), this.options.unifiedNavigation) {
|
|
3099
3099
|
this.unifiedHeader = document.createElement("div"), this.unifiedHeader.className = "drp-date-picker__unified-header";
|
|
3100
|
-
const n = this.options.unifiedHeaderInteractive ? "" : " drp-date-picker__unified-range--static",
|
|
3100
|
+
const n = this.options.unifiedHeaderInteractive ? "" : " drp-date-picker__unified-range--static", i = this.options.unifiedHeaderInteractive ? ' data-action="toggle-unified-rolling"' : "";
|
|
3101
3101
|
this.unifiedHeader.innerHTML = `
|
|
3102
3102
|
<button class="drp-date-picker__nav drp-date-picker__nav--prev" data-action="unified-prev"></button>
|
|
3103
|
-
<div class="drp-date-picker__unified-range${n}"${
|
|
3103
|
+
<div class="drp-date-picker__unified-range${n}"${i}></div>
|
|
3104
3104
|
<button class="drp-date-picker__nav drp-date-picker__nav--next" data-action="unified-next"></button>
|
|
3105
3105
|
`, this.unifiedRollingSelector = document.createElement("div"), this.unifiedRollingSelector.className = "drp-date-picker__unified-rolling-selector", this.unifiedRollingSelector.innerHTML = `
|
|
3106
3106
|
<div class="drp-date-picker__rolling-list" data-list="years" data-unified="true"></div>
|
|
@@ -3110,17 +3110,17 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3110
3110
|
const a = document.createElement("div");
|
|
3111
3111
|
this.options.monthLayout === "grid" ? (a.className = "drp-date-picker__months drp-date-picker__months--grid", this.options.gridRows && a.style.setProperty("--drp-grid-rows", String(this.options.gridRows)), this.options.gridColumns && a.style.setProperty("--drp-grid-columns", String(this.options.gridColumns))) : a.className = "drp-date-picker__months drp-date-picker__months--horizontal";
|
|
3112
3112
|
for (let n = 0; n < this.options.visibleMonthsCount; n++) {
|
|
3113
|
-
const
|
|
3114
|
-
|
|
3115
|
-
const
|
|
3113
|
+
const i = document.createElement("div");
|
|
3114
|
+
i.className = "drp-date-picker__month", i.dataset.monthIndex = String(n);
|
|
3115
|
+
const r = this.options.unifiedNavigation ? `<div class="drp-date-picker__header drp-date-picker__header--static">
|
|
3116
3116
|
<div class="drp-date-picker__month-year"></div>
|
|
3117
3117
|
</div>` : `<div class="drp-date-picker__header">
|
|
3118
3118
|
<button class="drp-date-picker__nav drp-date-picker__nav--prev" data-action="prev" data-month-index="${n}"></button>
|
|
3119
3119
|
<div class="drp-date-picker__month-year" data-action="toggle-rolling" data-month-index="${n}"></div>
|
|
3120
3120
|
<button class="drp-date-picker__nav drp-date-picker__nav--next" data-action="next" data-month-index="${n}"></button>
|
|
3121
3121
|
</div>`;
|
|
3122
|
-
|
|
3123
|
-
${
|
|
3122
|
+
i.innerHTML = `
|
|
3123
|
+
${r}
|
|
3124
3124
|
<div class="drp-date-picker__calendar-container">
|
|
3125
3125
|
<div class="drp-date-picker__rolling-selector" data-month-index="${n}">
|
|
3126
3126
|
<div class="drp-date-picker__rolling-list" data-list="years" data-month-index="${n}"></div>
|
|
@@ -3129,40 +3129,40 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3129
3129
|
<div class="drp-date-picker__weekdays"></div>
|
|
3130
3130
|
<div class="drp-date-picker__days" data-month-index="${n}"></div>
|
|
3131
3131
|
</div>
|
|
3132
|
-
`, a.appendChild(
|
|
3132
|
+
`, a.appendChild(i);
|
|
3133
3133
|
}
|
|
3134
3134
|
if (this.calendar.appendChild(a), this.options.selectionMode === "range") {
|
|
3135
3135
|
const n = document.createElement("div");
|
|
3136
3136
|
n.className = "drp-date-picker__summary drp-date-picker__summary--hidden", this.calendar.appendChild(n);
|
|
3137
3137
|
}
|
|
3138
3138
|
const t = document.createElement("div");
|
|
3139
|
-
t.className = "drp-date-picker__actions", this.renderButtons(t), t.children.length > 0 && this.calendar.appendChild(t), this.containerElement.appendChild(this.calendar),
|
|
3139
|
+
t.className = "drp-date-picker__actions", this.renderButtons(t), t.children.length > 0 && this.calendar.appendChild(t), this.containerElement.appendChild(this.calendar), k.debug("Calendar appended to container:", this.calendar), this.tooltip = document.createElement("div"), this.tooltip.className = "drp-date-picker__tooltip", this.tooltipArrow = document.createElement("div"), this.tooltipArrow.className = "drp-date-picker__tooltip-arrow", this.tooltip.appendChild(this.tooltipArrow), this.containerElement.appendChild(this.tooltip), this.attachCalendarListeners(), this.showingRollingSelector = new Array(this.options.visibleMonthsCount).fill(!1);
|
|
3140
3140
|
}
|
|
3141
3141
|
attachInputListeners() {
|
|
3142
3142
|
if (!this.input) return;
|
|
3143
|
-
|
|
3143
|
+
k.debug("Attaching input listeners");
|
|
3144
3144
|
const a = this.options.calendarOpenTrigger || "focus";
|
|
3145
3145
|
a === "focus" ? this.input.addEventListener("focus", () => {
|
|
3146
|
-
|
|
3146
|
+
k.debug("Input focused - opening calendar"), this.show();
|
|
3147
3147
|
}) : a === "typing" && this.input.addEventListener("input", (t) => {
|
|
3148
|
-
!this.calendar.classList.contains("drp-date-picker--visible") && this.input && this.input.value.length > 0 && (
|
|
3148
|
+
!this.calendar.classList.contains("drp-date-picker--visible") && this.input && this.input.value.length > 0 && (k.debug("User started typing - opening calendar"), this.show());
|
|
3149
3149
|
}), this.input.addEventListener("input", (t) => this.handleInputMask(t)), this.input.addEventListener("keydown", (t) => this.handleKeydown(t)), this.input.addEventListener("paste", (t) => this.handlePaste(t));
|
|
3150
3150
|
}
|
|
3151
3151
|
attachCalendarListeners() {
|
|
3152
3152
|
this.calendar.addEventListener("click", async (a) => {
|
|
3153
3153
|
const t = a.target;
|
|
3154
3154
|
a.stopPropagation();
|
|
3155
|
-
const n = t.dataset.action,
|
|
3155
|
+
const n = t.dataset.action, i = t.dataset.monthIndex, r = i ? parseInt(i) : 0;
|
|
3156
3156
|
if (n === "prev" || n === "next" || n === "unified-prev" || n === "unified-next") {
|
|
3157
3157
|
const o = t;
|
|
3158
3158
|
if (o.disabled || o.classList.contains("drp-date-picker__nav--disabled"))
|
|
3159
3159
|
return;
|
|
3160
3160
|
}
|
|
3161
|
-
if (n === "prev") this.prevMonth(
|
|
3162
|
-
else if (n === "next") this.nextMonth(
|
|
3161
|
+
if (n === "prev") this.prevMonth(r);
|
|
3162
|
+
else if (n === "next") this.nextMonth(r);
|
|
3163
3163
|
else if (n === "unified-prev") this.unifiedPrevMonth();
|
|
3164
3164
|
else if (n === "unified-next") this.unifiedNextMonth();
|
|
3165
|
-
else if (n === "toggle-rolling") this.toggleRollingSelector(
|
|
3165
|
+
else if (n === "toggle-rolling") this.toggleRollingSelector(r);
|
|
3166
3166
|
else if (n === "toggle-unified-rolling") this.toggleUnifiedRollingSelector();
|
|
3167
3167
|
else if (n === "today") this.selectToday();
|
|
3168
3168
|
else if (n === "clear") this.clearSelection();
|
|
@@ -3201,14 +3201,14 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3201
3201
|
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1, o = !0), o && this.renderCalendar();
|
|
3202
3202
|
}
|
|
3203
3203
|
}), this.calendar.addEventListener("mouseenter", (a) => {
|
|
3204
|
-
const t = a.target, n = t.closest(".drp-date-picker__day"),
|
|
3205
|
-
if (
|
|
3206
|
-
const o =
|
|
3207
|
-
o && this.showTooltip(
|
|
3204
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), i = t.closest(".drp-date-picker__badge-cell"), r = n || i;
|
|
3205
|
+
if (r && r instanceof HTMLElement) {
|
|
3206
|
+
const o = r.dataset.tooltip;
|
|
3207
|
+
o && this.showTooltip(r, o);
|
|
3208
3208
|
}
|
|
3209
3209
|
}, !0), this.calendar.addEventListener("mouseleave", (a) => {
|
|
3210
|
-
const t = a.target, n = t.closest(".drp-date-picker__day"),
|
|
3211
|
-
|
|
3210
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), i = t.closest(".drp-date-picker__badge-cell"), r = n || i;
|
|
3211
|
+
r && this.currentTooltipTarget === r && this.hideTooltip();
|
|
3212
3212
|
}, !0), this.calendar.addEventListener("mousedown", (a) => {
|
|
3213
3213
|
this.isCalendarActive = !0, a.stopPropagation();
|
|
3214
3214
|
}), this.calendar.addEventListener("focusin", () => {
|
|
@@ -3216,9 +3216,9 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3216
3216
|
}), document.addEventListener("mousedown", (a) => {
|
|
3217
3217
|
this.calendar.contains(a.target) || (this.isCalendarActive = !1);
|
|
3218
3218
|
}, !0), document.addEventListener("keydown", (a) => {
|
|
3219
|
-
var t, n,
|
|
3219
|
+
var t, n, i, r;
|
|
3220
3220
|
if (this.calendar.classList.contains("drp-date-picker--visible") && this.isCalendarActive) {
|
|
3221
|
-
if (
|
|
3221
|
+
if (k.debug("Keydown", a.key, "Ctrl:", a.ctrlKey, "Meta:", a.metaKey, "Shift:", a.shiftKey, "Alt:", a.altKey), a.key === "Escape")
|
|
3222
3222
|
this.hide(), a.preventDefault();
|
|
3223
3223
|
else if (a.key === "ArrowUp")
|
|
3224
3224
|
this.moveFocus(-7), a.preventDefault();
|
|
@@ -3335,15 +3335,15 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3335
3335
|
var g, m;
|
|
3336
3336
|
const p = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), u = p == null ? void 0 : p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3337
3337
|
u && (this.focusedDayIndex = u.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((f) => f.classList.remove("drp-date-picker__day--focused")), (g = u[this.focusedDayIndex]) == null || g.classList.add("drp-date-picker__day--focused"), (m = u[this.focusedDayIndex]) == null || m.scrollIntoView({ block: "nearest" }));
|
|
3338
|
-
}, 0)) : (this.focusedDayIndex = l.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((p) => p.classList.remove("drp-date-picker__day--focused")), (
|
|
3338
|
+
}, 0)) : (this.focusedDayIndex = l.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((p) => p.classList.remove("drp-date-picker__day--focused")), (i = l[this.focusedDayIndex]) == null || i.classList.add("drp-date-picker__day--focused"), (r = l[this.focusedDayIndex]) == null || r.scrollIntoView({ block: "nearest" }));
|
|
3339
3339
|
}
|
|
3340
3340
|
a.preventDefault();
|
|
3341
3341
|
}
|
|
3342
3342
|
}
|
|
3343
3343
|
}), this.clickOutsideHandler = (a) => {
|
|
3344
3344
|
var s;
|
|
3345
|
-
const t = a.composedPath(), n = t[0],
|
|
3346
|
-
if (!
|
|
3345
|
+
const t = a.composedPath(), n = t[0], i = t.includes(this.calendar), r = this.input && t.includes(this.input), o = (s = n.closest) == null ? void 0 : s.call(n, "[data-calendar-button]");
|
|
3346
|
+
if (!i && !r && !o)
|
|
3347
3347
|
if (this.options.positioningMode === "floating")
|
|
3348
3348
|
this.hide();
|
|
3349
3349
|
else {
|
|
@@ -3358,8 +3358,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3358
3358
|
parseFormat(a) {
|
|
3359
3359
|
const t = {};
|
|
3360
3360
|
let n = "";
|
|
3361
|
-
return a.includes("-") ? n = "-" : a.includes("/") ? n = "/" : a.includes(".") && (n = "."), a.split(n).forEach((
|
|
3362
|
-
|
|
3361
|
+
return a.includes("-") ? n = "-" : a.includes("/") ? n = "/" : a.includes(".") && (n = "."), a.split(n).forEach((r, o) => {
|
|
3362
|
+
r === "YYYY" || r === "YY" ? t.year = { index: o, length: r.length } : r === "MM" || r === "M" ? t.month = { index: o, length: 2 } : (r === "DD" || r === "D") && (t.day = { index: o, length: 2 });
|
|
3363
3363
|
}), {
|
|
3364
3364
|
format: a,
|
|
3365
3365
|
separator: n,
|
|
@@ -3369,9 +3369,9 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3369
3369
|
}
|
|
3370
3370
|
formatDate(a) {
|
|
3371
3371
|
if (!a) return "";
|
|
3372
|
-
const t = a.getFullYear(), n = String(a.getMonth() + 1).padStart(2, "0"),
|
|
3372
|
+
const t = a.getFullYear(), n = String(a.getMonth() + 1).padStart(2, "0"), i = String(a.getDate()).padStart(2, "0"), { format: r, separator: o, parts: s } = this.formatInfo, d = [];
|
|
3373
3373
|
for (let l = 0; l < 3; l++)
|
|
3374
|
-
s.year && s.year.index === l ? d.push(s.year.length === 2 ? String(t).slice(-2) : t) : s.month && s.month.index === l ? d.push(n) : s.day && s.day.index === l && d.push(
|
|
3374
|
+
s.year && s.year.index === l ? d.push(s.year.length === 2 ? String(t).slice(-2) : t) : s.month && s.month.index === l ? d.push(n) : s.day && s.day.index === l && d.push(i);
|
|
3375
3375
|
return d.join(o);
|
|
3376
3376
|
}
|
|
3377
3377
|
// Reactive getters/setters for programmatic control
|
|
@@ -3429,7 +3429,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3429
3429
|
return Lt(this);
|
|
3430
3430
|
}
|
|
3431
3431
|
hide() {
|
|
3432
|
-
return
|
|
3432
|
+
return kt(this);
|
|
3433
3433
|
}
|
|
3434
3434
|
toggle() {
|
|
3435
3435
|
return tn(this);
|
|
@@ -3448,10 +3448,10 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3448
3448
|
return hn(this);
|
|
3449
3449
|
}
|
|
3450
3450
|
renderNormalView(a) {
|
|
3451
|
-
return
|
|
3451
|
+
return zt(this, a);
|
|
3452
3452
|
}
|
|
3453
3453
|
renderDays(a, t) {
|
|
3454
|
-
return
|
|
3454
|
+
return Nt(this, a, t);
|
|
3455
3455
|
}
|
|
3456
3456
|
renderRollingSelector(a) {
|
|
3457
3457
|
return Ft(this, a);
|
|
@@ -3500,7 +3500,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3500
3500
|
setUnifiedYear(a) {
|
|
3501
3501
|
return gn(this, a);
|
|
3502
3502
|
}
|
|
3503
|
-
findNextEnabledDayIndex(a, t, n,
|
|
3503
|
+
findNextEnabledDayIndex(a, t, n, i) {
|
|
3504
3504
|
return fe(this, a, t, n);
|
|
3505
3505
|
}
|
|
3506
3506
|
moveFocus(a) {
|
|
@@ -3581,11 +3581,11 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3581
3581
|
*/
|
|
3582
3582
|
static injectGlobalStyles(a = !1) {
|
|
3583
3583
|
if (ve.stylesInjected && !a) {
|
|
3584
|
-
|
|
3584
|
+
k.debug("Styles already injected, skipping");
|
|
3585
3585
|
return;
|
|
3586
3586
|
}
|
|
3587
3587
|
const t = document.createElement("style");
|
|
3588
|
-
t.setAttribute("data-source", "web-daterangepicker"), t.textContent = jt, document.head.appendChild(t), ve.stylesInjected = !0,
|
|
3588
|
+
t.setAttribute("data-source", "web-daterangepicker"), t.textContent = jt, document.head.appendChild(t), ve.stylesInjected = !0, k.info("Global styles injected successfully");
|
|
3589
3589
|
}
|
|
3590
3590
|
/**
|
|
3591
3591
|
* Check if styles appear to be loaded
|
|
@@ -3676,14 +3676,20 @@ class Wt extends HTMLElement {
|
|
|
3676
3676
|
"show-apply-button",
|
|
3677
3677
|
"unified-navigation",
|
|
3678
3678
|
"unified-navigation-anchor-index",
|
|
3679
|
-
"unified-header-interactive"
|
|
3679
|
+
"unified-header-interactive",
|
|
3680
|
+
"input-size"
|
|
3680
3681
|
];
|
|
3681
3682
|
}
|
|
3682
3683
|
applySizeStyles() {
|
|
3683
3684
|
const t = this.shadow.querySelector(".drp-date-picker");
|
|
3684
3685
|
if (!t) return;
|
|
3685
|
-
const n = this.getAttribute("spacing"),
|
|
3686
|
-
t.classList.remove("drp-spacing-xs", "drp-spacing-sm", "drp-spacing-lg", "drp-spacing-xl"), t.classList.remove("drp-font-xs", "drp-font-sm", "drp-font-lg", "drp-font-xl"), t.classList.remove("drp-cell-xs", "drp-cell-sm", "drp-cell-lg", "drp-cell-xl"), n && n !== "md" && t.classList.add(`drp-spacing-${n}`),
|
|
3686
|
+
const n = this.getAttribute("spacing"), i = this.getAttribute("font-size"), r = this.getAttribute("cell-size"), o = this.hasAttribute("enable-transitions");
|
|
3687
|
+
t.classList.remove("drp-spacing-xs", "drp-spacing-sm", "drp-spacing-lg", "drp-spacing-xl"), t.classList.remove("drp-font-xs", "drp-font-sm", "drp-font-lg", "drp-font-xl"), t.classList.remove("drp-cell-xs", "drp-cell-sm", "drp-cell-lg", "drp-cell-xl"), n && n !== "md" && t.classList.add(`drp-spacing-${n}`), i && i !== "md" && t.classList.add(`drp-font-${i}`), r && r !== "md" && t.classList.add(`drp-cell-${r}`), o ? t.classList.add("drp-transitions-enabled") : t.classList.remove("drp-transitions-enabled");
|
|
3688
|
+
}
|
|
3689
|
+
applyInputSizeStyles() {
|
|
3690
|
+
if (!this.inputElement) return;
|
|
3691
|
+
const t = this.getAttribute("input-size");
|
|
3692
|
+
this.inputElement.classList.remove("drp-input--xs", "drp-input--sm", "drp-input--lg", "drp-input--xl"), this.inputElement.classList.remove("drp-date-picker-input--xs", "drp-date-picker-input--sm", "drp-date-picker-input--lg", "drp-date-picker-input--xl"), t && t !== "md" && (this.inputElement.classList.add(`drp-input--${t}`), this.inputElement.classList.add(`drp-date-picker-input--${t}`));
|
|
3687
3693
|
}
|
|
3688
3694
|
connectedCallback() {
|
|
3689
3695
|
this.render(), this.initializePicker();
|
|
@@ -3691,39 +3697,43 @@ class Wt extends HTMLElement {
|
|
|
3691
3697
|
disconnectedCallback() {
|
|
3692
3698
|
this.picker && this.picker.destroy();
|
|
3693
3699
|
}
|
|
3694
|
-
attributeChangedCallback(t, n,
|
|
3695
|
-
if (n !==
|
|
3700
|
+
attributeChangedCallback(t, n, i) {
|
|
3701
|
+
if (n !== i) {
|
|
3696
3702
|
if (t === "spacing" || t === "font-size" || t === "cell-size" || t === "enable-transitions") {
|
|
3697
3703
|
this.applySizeStyles(), this.picker && t === "cell-size" && this.picker.renderCalendar();
|
|
3698
3704
|
return;
|
|
3699
3705
|
}
|
|
3700
|
-
|
|
3706
|
+
if (t === "input-size") {
|
|
3707
|
+
this.applyInputSizeStyles();
|
|
3708
|
+
return;
|
|
3709
|
+
}
|
|
3710
|
+
this.picker && t !== "value" && t !== "placeholder" && (this.picker.destroy(), this.initializePicker()), t === "value" && this.inputElement && i !== null && (this.inputElement.value = i), t === "placeholder" && this.inputElement && i !== null && (this.inputElement.placeholder = i), t === "disabled" && this.inputElement && (i !== null ? this.inputElement.disabled = !0 : this.inputElement.disabled = !1);
|
|
3701
3711
|
}
|
|
3702
3712
|
}
|
|
3703
3713
|
render() {
|
|
3704
3714
|
const t = document.createElement("style");
|
|
3705
3715
|
if (t.textContent = jt, this.shadow.appendChild(t), (this.getAttribute("positioning-mode") || "floating") === "floating") {
|
|
3706
3716
|
this.inputElement = document.createElement("input"), this.inputElement.type = "text", this.inputElement.classList.add("drp-input", "drp-date-picker-input");
|
|
3707
|
-
const
|
|
3708
|
-
|
|
3709
|
-
const
|
|
3710
|
-
|
|
3717
|
+
const i = this.getAttribute("placeholder");
|
|
3718
|
+
i && (this.inputElement.placeholder = i);
|
|
3719
|
+
const r = this.getAttribute("value");
|
|
3720
|
+
r && (this.inputElement.value = r), this.hasAttribute("disabled") && (this.inputElement.disabled = !0), this.shadow.appendChild(this.inputElement), this.applyInputSizeStyles();
|
|
3711
3721
|
}
|
|
3712
3722
|
}
|
|
3713
3723
|
initializePicker() {
|
|
3714
3724
|
const t = this.getAttribute("positioning-mode") || "floating";
|
|
3715
3725
|
if (t === "floating" && !this.inputElement) return;
|
|
3716
3726
|
let n;
|
|
3717
|
-
const
|
|
3718
|
-
|
|
3719
|
-
let
|
|
3727
|
+
const i = this.getAttribute("disabled-weekdays");
|
|
3728
|
+
i && (n = i.split(",").map((l) => parseInt(l.trim())).filter((l) => !isNaN(l) && l >= 0 && l <= 6));
|
|
3729
|
+
let r;
|
|
3720
3730
|
const o = this.getAttribute("week-start-day");
|
|
3721
3731
|
if (o)
|
|
3722
3732
|
if (o === "auto")
|
|
3723
|
-
|
|
3733
|
+
r = "auto";
|
|
3724
3734
|
else {
|
|
3725
3735
|
const l = parseInt(o);
|
|
3726
|
-
!isNaN(l) && l >= 0 && l <= 6 && (
|
|
3736
|
+
!isNaN(l) && l >= 0 && l <= 6 && (r = l);
|
|
3727
3737
|
}
|
|
3728
3738
|
const s = {
|
|
3729
3739
|
selectionMode: this.getAttribute("selection-mode") || "single",
|
|
@@ -3744,7 +3754,7 @@ class Wt extends HTMLElement {
|
|
|
3744
3754
|
// Positioning
|
|
3745
3755
|
calendarPlacement: this.getAttribute("calendar-placement") || void 0,
|
|
3746
3756
|
// New options
|
|
3747
|
-
weekStartDay:
|
|
3757
|
+
weekStartDay: r,
|
|
3748
3758
|
minDate: this.getAttribute("min-date") || void 0,
|
|
3749
3759
|
maxDate: this.getAttribute("max-date") || void 0,
|
|
3750
3760
|
initialDate: this.getAttribute("initial-date") || void 0,
|
|
@@ -3805,11 +3815,11 @@ class Wt extends HTMLElement {
|
|
|
3805
3815
|
}));
|
|
3806
3816
|
}
|
|
3807
3817
|
handleDateSelect(t) {
|
|
3808
|
-
var
|
|
3818
|
+
var r;
|
|
3809
3819
|
const n = {
|
|
3810
3820
|
date: t instanceof Date ? t : void 0,
|
|
3811
3821
|
dateRange: t instanceof Date || Array.isArray(t) ? void 0 : t,
|
|
3812
|
-
formattedValue: ((
|
|
3822
|
+
formattedValue: ((r = this.inputElement) == null ? void 0 : r.value) || ""
|
|
3813
3823
|
};
|
|
3814
3824
|
if (!this.picker) {
|
|
3815
3825
|
this.dispatchEvent(new CustomEvent("date-select", { detail: n, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: n, bubbles: !0, composed: !0 }));
|
|
@@ -3817,10 +3827,10 @@ class Wt extends HTMLElement {
|
|
|
3817
3827
|
}
|
|
3818
3828
|
if (this.picker.requiresApplyButton() && this.picker.pendingSelection)
|
|
3819
3829
|
return;
|
|
3820
|
-
const
|
|
3830
|
+
const i = this.picker.options.disabledDatesHandling;
|
|
3821
3831
|
if (!(t instanceof Date) && !Array.isArray(t) && "start" in t && "end" in t) {
|
|
3822
3832
|
const o = t.start, s = t.end;
|
|
3823
|
-
switch (
|
|
3833
|
+
switch (i) {
|
|
3824
3834
|
case "allow":
|
|
3825
3835
|
n.enabledDates = this.picker.getEnabledDatesInRange(o, s), n.disabledDates = this.picker.getDisabledDatesInRange(o, s), n.getEnabledDateCount = () => n.enabledDates.length, n.getTotalDays = () => Math.floor((s.getTime() - o.getTime()) / 864e5) + 1;
|
|
3826
3836
|
break;
|
|
@@ -3970,6 +3980,12 @@ class Wt extends HTMLElement {
|
|
|
3970
3980
|
set enableTransitions(t) {
|
|
3971
3981
|
t ? this.setAttribute("enable-transitions", "") : this.removeAttribute("enable-transitions");
|
|
3972
3982
|
}
|
|
3983
|
+
get inputSize() {
|
|
3984
|
+
return this.getAttribute("input-size") || "md";
|
|
3985
|
+
}
|
|
3986
|
+
set inputSize(t) {
|
|
3987
|
+
this.setAttribute("input-size", t);
|
|
3988
|
+
}
|
|
3973
3989
|
// Complex data properties (not attributes)
|
|
3974
3990
|
get specialDates() {
|
|
3975
3991
|
return this._specialDates;
|
|
@@ -4129,10 +4145,10 @@ function An() {
|
|
|
4129
4145
|
return Array.from(document.querySelectorAll("web-daterangepicker"));
|
|
4130
4146
|
}
|
|
4131
4147
|
typeof window < "u" && (window.components = window.components || {}, window.components["web-daterangepicker"] = {
|
|
4132
|
-
version: () => "1.
|
|
4148
|
+
version: () => "1.4.0",
|
|
4133
4149
|
config: {
|
|
4134
4150
|
name: "@keenmate/web-daterangepicker",
|
|
4135
|
-
version: "1.
|
|
4151
|
+
version: "1.4.0",
|
|
4136
4152
|
author: "Keenmate",
|
|
4137
4153
|
license: "MIT",
|
|
4138
4154
|
repository: "git+https://github.com/keenmate/web-daterangepicker.git",
|