@keenmate/web-daterangepicker 1.8.0 → 1.9.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 +13 -7
- package/dist/style.css +1 -1
- package/dist/web-daterangepicker.js +1251 -1251
- package/dist/web-daterangepicker.umd.js +5 -5
- package/package.json +1 -1
- package/src/css/_base.css +3 -3
- package/src/css/_header-navigation.css +6 -5
- package/src/css/_summary-actions.css +3 -3
- package/src/css/_variables.css +13 -3
|
@@ -196,16 +196,16 @@ var gt = { exports: {} };
|
|
|
196
196
|
}
|
|
197
197
|
if (typeof S === t)
|
|
198
198
|
try {
|
|
199
|
-
var E = window.document.cookie,
|
|
199
|
+
var E = window.document.cookie, T = encodeURIComponent(D), A = E.indexOf(T + "=");
|
|
200
200
|
A !== -1 && (S = /^([^;]+)/.exec(
|
|
201
|
-
E.slice(A +
|
|
201
|
+
E.slice(A + T.length + 1)
|
|
202
202
|
)[1]);
|
|
203
203
|
} catch {
|
|
204
204
|
}
|
|
205
205
|
return m.levels[S] === void 0 && (S = void 0), S;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function k() {
|
|
209
209
|
if (!(typeof window === t || !D)) {
|
|
210
210
|
try {
|
|
211
211
|
window.localStorage.removeItem(D);
|
|
@@ -237,7 +237,7 @@ var gt = { exports: {} };
|
|
|
237
237
|
}, m.setDefaultLevel = function(S) {
|
|
238
238
|
C = y(S), R() || m.setLevel(S, !1);
|
|
239
239
|
}, m.resetLevel = function() {
|
|
240
|
-
x = null,
|
|
240
|
+
x = null, k(), c.call(m);
|
|
241
241
|
}, m.enableAll = function(S) {
|
|
242
242
|
m.setLevel(m.levels.TRACE, S);
|
|
243
243
|
}, m.disableAll = function(S) {
|
|
@@ -309,12 +309,12 @@ function J(e) {
|
|
|
309
309
|
}
|
|
310
310
|
const L = J("DRP"), de = J("DRP:RENDERING"), oe = J("DRP:INTERACTION"), ie = J("DRP:SELECTION"), w = J("DRP:NAVIGATION"), H = J("DRP:UI"), Z = J("DRP:VALIDATION"), ee = J("DRP:DRAG");
|
|
311
311
|
O.setLevel("silent");
|
|
312
|
-
const
|
|
312
|
+
const Ke = (e) => {
|
|
313
313
|
O.setLevel(e), ht.forEach((a) => a.setLevel(e));
|
|
314
314
|
}, ft = () => {
|
|
315
|
-
|
|
315
|
+
Ke("debug");
|
|
316
316
|
}, mt = () => {
|
|
317
|
-
|
|
317
|
+
Ke("silent");
|
|
318
318
|
}, ua = (e, a = "debug") => {
|
|
319
319
|
const n = {
|
|
320
320
|
DRP: L,
|
|
@@ -339,7 +339,7 @@ const We = (e) => {
|
|
|
339
339
|
start: "end",
|
|
340
340
|
end: "start"
|
|
341
341
|
};
|
|
342
|
-
function
|
|
342
|
+
function Be(e, a, t) {
|
|
343
343
|
return te(e, le(a, t));
|
|
344
344
|
}
|
|
345
345
|
function _e(e, a) {
|
|
@@ -354,27 +354,27 @@ function we(e) {
|
|
|
354
354
|
function bt(e) {
|
|
355
355
|
return e === "x" ? "y" : "x";
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function Ge(e) {
|
|
358
358
|
return e === "y" ? "height" : "width";
|
|
359
359
|
}
|
|
360
360
|
const fa = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
361
361
|
function G(e) {
|
|
362
362
|
return fa.has(ne(e)) ? "y" : "x";
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function Xe(e) {
|
|
365
365
|
return bt(G(e));
|
|
366
366
|
}
|
|
367
367
|
function ma(e, a, t) {
|
|
368
368
|
t === void 0 && (t = !1);
|
|
369
|
-
const n = we(e), r =
|
|
369
|
+
const n = we(e), r = Xe(e), o = Ge(r);
|
|
370
370
|
let i = r === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
371
371
|
return a.reference[o] > a.floating[o] && (i = Ee(i)), [i, Ee(i)];
|
|
372
372
|
}
|
|
373
373
|
function ba(e) {
|
|
374
374
|
const a = Ee(e);
|
|
375
|
-
return [
|
|
375
|
+
return [Ve(e), a, Ve(a)];
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function Ve(e) {
|
|
378
378
|
return e.replace(/start|end/g, (a) => ha[a]);
|
|
379
379
|
}
|
|
380
380
|
const nt = ["left", "right"], rt = ["right", "left"], ya = ["top", "bottom"], va = ["bottom", "top"];
|
|
@@ -393,7 +393,7 @@ function Da(e, a, t) {
|
|
|
393
393
|
function _a(e, a, t, n) {
|
|
394
394
|
const r = we(e);
|
|
395
395
|
let o = Da(ne(e), t === "start", n);
|
|
396
|
-
return r && (o = o.map((i) => i + "-" + r), a && (o = o.concat(o.map(
|
|
396
|
+
return r && (o = o.map((i) => i + "-" + r), a && (o = o.concat(o.map(Ve)))), o;
|
|
397
397
|
}
|
|
398
398
|
function Ee(e) {
|
|
399
399
|
return e.replace(/left|right|bottom|top/g, (a) => ga[a]);
|
|
@@ -438,7 +438,7 @@ function it(e, a, t) {
|
|
|
438
438
|
reference: n,
|
|
439
439
|
floating: r
|
|
440
440
|
} = e;
|
|
441
|
-
const o = G(a), i =
|
|
441
|
+
const o = G(a), i = Xe(a), s = Ge(i), d = ne(a), l = o === "y", c = n.x + n.width / 2 - r.width / 2, u = n.y + n.height / 2 - r.height / 2, p = n[s] / 2 - r[s] / 2;
|
|
442
442
|
let g;
|
|
443
443
|
switch (d) {
|
|
444
444
|
case "top":
|
|
@@ -608,10 +608,10 @@ const Ma = (e) => ({
|
|
|
608
608
|
const u = yt(c), p = {
|
|
609
609
|
x: t,
|
|
610
610
|
y: n
|
|
611
|
-
}, g =
|
|
611
|
+
}, g = Xe(r), f = Ge(g), h = await i.getDimensions(l), v = g === "y", m = v ? "top" : "left", M = v ? "bottom" : "right", C = v ? "clientHeight" : "clientWidth", x = o.reference[f] + o.reference[g] - p[g] - o.floating[f], D = p[g] - o.reference[g], _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
|
|
612
612
|
let R = _ ? _[C] : 0;
|
|
613
613
|
(!R || !await (i.isElement == null ? void 0 : i.isElement(_))) && (R = s.floating[C] || o.floating[f]);
|
|
614
|
-
const
|
|
614
|
+
const k = x / 2 - D / 2, y = R / 2 - h[f] / 2 - 1, I = le(u[m], y), S = le(u[M], y), E = I, T = R - h[f] - S, A = R / 2 - h[f] / 2 + k, $ = Be(E, A, T), N = !d.arrow && we(r) != null && A !== $ && o.reference[f] / 2 - (A < E ? I : S) - h[f] / 2 < 0, z = N ? A < E ? A - E : A - T : 0;
|
|
615
615
|
return {
|
|
616
616
|
[g]: p[g] + z,
|
|
617
617
|
data: {
|
|
@@ -650,11 +650,11 @@ const Ma = (e) => ({
|
|
|
650
650
|
return {};
|
|
651
651
|
const m = ne(r), M = G(s), C = ne(s) === s, x = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), D = p || (C || !h ? [Ee(s)] : ba(s)), _ = f !== "none";
|
|
652
652
|
!p && _ && D.push(..._a(s, h, f, x));
|
|
653
|
-
const R = [s, ...D],
|
|
653
|
+
const R = [s, ...D], k = await vt(a, v), y = [];
|
|
654
654
|
let I = ((n = o.flip) == null ? void 0 : n.overflows) || [];
|
|
655
|
-
if (c && y.push(
|
|
655
|
+
if (c && y.push(k[m]), u) {
|
|
656
656
|
const A = ma(r, i, x);
|
|
657
|
-
y.push(
|
|
657
|
+
y.push(k[A[0]], k[A[1]]);
|
|
658
658
|
}
|
|
659
659
|
if (I = [...I, {
|
|
660
660
|
placement: r,
|
|
@@ -678,8 +678,8 @@ const Ma = (e) => ({
|
|
|
678
678
|
if (!N)
|
|
679
679
|
switch (g) {
|
|
680
680
|
case "bestFit": {
|
|
681
|
-
var
|
|
682
|
-
const z = (
|
|
681
|
+
var T;
|
|
682
|
+
const z = (T = I.filter((P) => {
|
|
683
683
|
if (_) {
|
|
684
684
|
const V = G(P.placement);
|
|
685
685
|
return V === M || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -687,7 +687,7 @@ 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 :
|
|
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
691
|
z && (N = z);
|
|
692
692
|
break;
|
|
693
693
|
}
|
|
@@ -787,11 +787,11 @@ const Ea = function(e) {
|
|
|
787
787
|
let g = l[p], f = l[u];
|
|
788
788
|
if (o) {
|
|
789
789
|
const v = p === "y" ? "top" : "left", m = p === "y" ? "bottom" : "right", M = g + c[v], C = g - c[m];
|
|
790
|
-
g =
|
|
790
|
+
g = Be(M, g, C);
|
|
791
791
|
}
|
|
792
792
|
if (i) {
|
|
793
793
|
const v = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", M = f + c[v], C = f - c[m];
|
|
794
|
-
f =
|
|
794
|
+
f = Be(M, f, C);
|
|
795
795
|
}
|
|
796
796
|
const h = s.fn({
|
|
797
797
|
...a,
|
|
@@ -848,9 +848,9 @@ function xe(e) {
|
|
|
848
848
|
} = B(e);
|
|
849
849
|
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !Aa.has(r);
|
|
850
850
|
}
|
|
851
|
-
const
|
|
852
|
-
function
|
|
853
|
-
return
|
|
851
|
+
const Ta = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
852
|
+
function ka(e) {
|
|
853
|
+
return Ta.has(he(e));
|
|
854
854
|
}
|
|
855
855
|
const La = [":popover-open", ":modal"];
|
|
856
856
|
function Pe(e) {
|
|
@@ -863,14 +863,14 @@ function Pe(e) {
|
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
865
|
const $a = ["transform", "translate", "scale", "rotate", "perspective"], za = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Pa = ["paint", "layout", "strict", "content"];
|
|
866
|
-
function
|
|
867
|
-
const a =
|
|
866
|
+
function Je(e) {
|
|
867
|
+
const a = Qe(), t = Y(e) ? B(e) : e;
|
|
868
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) || za.some((n) => (t.willChange || "").includes(n)) || Pa.some((n) => (t.contain || "").includes(n));
|
|
869
869
|
}
|
|
870
870
|
function Na(e) {
|
|
871
871
|
let a = X(e);
|
|
872
872
|
for (; W(a) && !ce(a); ) {
|
|
873
|
-
if (
|
|
873
|
+
if (Je(a))
|
|
874
874
|
return a;
|
|
875
875
|
if (Pe(a))
|
|
876
876
|
return null;
|
|
@@ -878,7 +878,7 @@ function Na(e) {
|
|
|
878
878
|
}
|
|
879
879
|
return null;
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function Qe() {
|
|
882
882
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
883
883
|
}
|
|
884
884
|
const Fa = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
@@ -918,12 +918,12 @@ function ue(e, a, t) {
|
|
|
918
918
|
a === void 0 && (a = []), t === void 0 && (t = !0);
|
|
919
919
|
const r = _t(e), o = r === ((n = e.ownerDocument) == null ? void 0 : n.body), i = F(r);
|
|
920
920
|
if (o) {
|
|
921
|
-
const s =
|
|
921
|
+
const s = qe(i);
|
|
922
922
|
return a.concat(i, i.visualViewport || [], xe(r) ? r : [], s && t ? ue(s) : []);
|
|
923
923
|
}
|
|
924
924
|
return a.concat(r, ue(r, [], t));
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function qe(e) {
|
|
927
927
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
928
928
|
}
|
|
929
929
|
function wt(e) {
|
|
@@ -936,11 +936,11 @@ function wt(e) {
|
|
|
936
936
|
$: s
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function Ze(e) {
|
|
940
940
|
return Y(e) ? e : e.contextElement;
|
|
941
941
|
}
|
|
942
942
|
function se(e) {
|
|
943
|
-
const a =
|
|
943
|
+
const a = Ze(e);
|
|
944
944
|
if (!W(a))
|
|
945
945
|
return j(1);
|
|
946
946
|
const t = a.getBoundingClientRect(), {
|
|
@@ -957,7 +957,7 @@ function se(e) {
|
|
|
957
957
|
const Ha = /* @__PURE__ */ j(0);
|
|
958
958
|
function xt(e) {
|
|
959
959
|
const a = F(e);
|
|
960
|
-
return !
|
|
960
|
+
return !Qe() || !a.visualViewport ? Ha : {
|
|
961
961
|
x: a.visualViewport.offsetLeft,
|
|
962
962
|
y: a.visualViewport.offsetTop
|
|
963
963
|
};
|
|
@@ -967,17 +967,17 @@ function Oa(e, a, t) {
|
|
|
967
967
|
}
|
|
968
968
|
function re(e, a, t, n) {
|
|
969
969
|
a === void 0 && (a = !1), t === void 0 && (t = !1);
|
|
970
|
-
const r = e.getBoundingClientRect(), o =
|
|
970
|
+
const r = e.getBoundingClientRect(), o = Ze(e);
|
|
971
971
|
let i = j(1);
|
|
972
972
|
a && (n ? Y(n) && (i = se(n)) : i = se(e));
|
|
973
973
|
const s = Oa(o, t, n) ? xt(o) : j(0);
|
|
974
974
|
let d = (r.left + s.x) / i.x, l = (r.top + s.y) / i.y, c = r.width / i.x, u = r.height / i.y;
|
|
975
975
|
if (o) {
|
|
976
976
|
const p = F(o), g = n && Y(n) ? F(n) : n;
|
|
977
|
-
let f = p, h =
|
|
977
|
+
let f = p, h = qe(f);
|
|
978
978
|
for (; h && n && g !== f; ) {
|
|
979
979
|
const v = se(h), m = h.getBoundingClientRect(), M = B(h), C = m.left + (h.clientLeft + parseFloat(M.paddingLeft)) * v.x, x = m.top + (h.clientTop + parseFloat(M.paddingTop)) * v.y;
|
|
980
|
-
d *= v.x, l *= v.y, c *= v.x, u *= v.y, d += C, l += x, f = F(h), h =
|
|
980
|
+
d *= v.x, l *= v.y, c *= v.x, u *= v.y, d += C, l += x, f = F(h), h = qe(f);
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
983
|
return Re({
|
|
@@ -1045,7 +1045,7 @@ function qa(e, a) {
|
|
|
1045
1045
|
let o = n.clientWidth, i = n.clientHeight, s = 0, d = 0;
|
|
1046
1046
|
if (r) {
|
|
1047
1047
|
o = r.width, i = r.height;
|
|
1048
|
-
const c =
|
|
1048
|
+
const c = Qe();
|
|
1049
1049
|
(!c || c && a === "fixed") && (s = r.offsetLeft, d = r.offsetTop);
|
|
1050
1050
|
}
|
|
1051
1051
|
const l = Fe(n);
|
|
@@ -1101,7 +1101,7 @@ function Wa(e, a) {
|
|
|
1101
1101
|
const o = B(e).position === "fixed";
|
|
1102
1102
|
let i = o ? X(e) : e;
|
|
1103
1103
|
for (; Y(i) && !ce(i); ) {
|
|
1104
|
-
const s = B(i), d =
|
|
1104
|
+
const s = B(i), d = Je(i);
|
|
1105
1105
|
!d && s.position === "fixed" && (r = null), (o ? !d && !r : !d && s.position === "static" && !!r && Ua.has(r.position) || xe(i) && !d && St(e, i)) ? n = n.filter((c) => c !== i) : r = s, i = X(i);
|
|
1106
1106
|
}
|
|
1107
1107
|
return a.set(e, n), n;
|
|
@@ -1158,7 +1158,7 @@ function Xa(e, a, t) {
|
|
|
1158
1158
|
height: i.height
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function Ye(e) {
|
|
1162
1162
|
return B(e).position === "static";
|
|
1163
1163
|
}
|
|
1164
1164
|
function lt(e, a) {
|
|
@@ -1176,16 +1176,16 @@ function Ct(e, a) {
|
|
|
1176
1176
|
if (!W(e)) {
|
|
1177
1177
|
let r = X(e);
|
|
1178
1178
|
for (; r && !ce(r); ) {
|
|
1179
|
-
if (Y(r) && !
|
|
1179
|
+
if (Y(r) && !Ye(r))
|
|
1180
1180
|
return r;
|
|
1181
1181
|
r = X(r);
|
|
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) &&
|
|
1188
|
+
return n && ce(n) && Ye(n) && !Je(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);
|
|
@@ -1271,7 +1271,7 @@ function Rt(e, a, t, n) {
|
|
|
1271
1271
|
elementResize: i = typeof ResizeObserver == "function",
|
|
1272
1272
|
layoutShift: s = typeof IntersectionObserver == "function",
|
|
1273
1273
|
animationFrame: d = !1
|
|
1274
|
-
} = n, l =
|
|
1274
|
+
} = n, l = Ze(e), c = r || o ? [...l ? ue(l) : [], ...ue(a)] : [];
|
|
1275
1275
|
c.forEach((m) => {
|
|
1276
1276
|
r && m.addEventListener("scroll", t, {
|
|
1277
1277
|
passive: !0
|
|
@@ -1299,7 +1299,7 @@ function Rt(e, a, t, n) {
|
|
|
1299
1299
|
}), u == null || u(), (m = g) == null || m.disconnect(), g = null, d && cancelAnimationFrame(f);
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
|
-
const Ae = Ea,
|
|
1302
|
+
const Ae = Ea, Te = Ra, et = Sa, At = Ma, tt = (e, a, t) => {
|
|
1303
1303
|
const n = /* @__PURE__ */ new Map(), r = {
|
|
1304
1304
|
platform: It,
|
|
1305
1305
|
...t
|
|
@@ -1315,1277 +1315,1277 @@ const Ae = Ea, ke = Ra, Ze = Sa, At = Ma, et = (e, a, t) => {
|
|
|
1315
1315
|
__proto__: null,
|
|
1316
1316
|
arrow: At,
|
|
1317
1317
|
autoUpdate: Rt,
|
|
1318
|
-
computePosition:
|
|
1319
|
-
flip:
|
|
1318
|
+
computePosition: tt,
|
|
1319
|
+
flip: et,
|
|
1320
1320
|
getOverflowAncestors: ue,
|
|
1321
1321
|
offset: Ae,
|
|
1322
1322
|
platform: It,
|
|
1323
|
-
shift:
|
|
1323
|
+
shift: Te
|
|
1324
1324
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1325
|
+
async function Tt(e, a) {
|
|
1326
|
+
if (!e.options.beforeDateSelectCallback)
|
|
1327
|
+
return { isValid: !0 };
|
|
1328
|
+
try {
|
|
1329
|
+
e.isValidating = !0, Le(e);
|
|
1330
|
+
const t = await Promise.resolve(e.options.beforeDateSelectCallback(a));
|
|
1331
|
+
switch (ae(e), e.isValidating = !1, t.action) {
|
|
1332
|
+
case "accept":
|
|
1333
|
+
return { isValid: !0 };
|
|
1334
|
+
case "adjust":
|
|
1335
|
+
return a instanceof Date && t.adjustedDate ? { isValid: !0, adjustedDate: t.adjustedDate, message: t.message } : typeof a == "object" && "start" in a && t.adjustedStartDate && t.adjustedEndDate ? {
|
|
1336
|
+
isValid: !0,
|
|
1337
|
+
adjustedStart: t.adjustedStartDate,
|
|
1338
|
+
adjustedEnd: t.adjustedEndDate,
|
|
1339
|
+
message: t.message
|
|
1340
|
+
} : { isValid: !1, message: t.message || "Invalid adjustment" };
|
|
1341
|
+
case "restore":
|
|
1342
|
+
return { isValid: !1, message: t.message };
|
|
1343
|
+
case "clear":
|
|
1344
|
+
return e.clearSelection(), { isValid: !1, message: t.message };
|
|
1345
|
+
default:
|
|
1346
|
+
return { isValid: !1, message: "Unknown validation action" };
|
|
1347
|
+
}
|
|
1348
|
+
} catch (t) {
|
|
1349
|
+
return ae(e), e.isValidating = !1, O.error("beforeDateSelectCallback error:", t), { isValid: !1, message: "Validation error occurred" };
|
|
1342
1350
|
}
|
|
1343
1351
|
}
|
|
1344
|
-
function
|
|
1345
|
-
|
|
1352
|
+
async function kt(e, a, t) {
|
|
1353
|
+
if (Z.debug(" validateRangeAsync called - mode:", e.options.disabledDatesHandling, "start:", a, "end:", t), e.options.disabledDatesHandling === "prevent") {
|
|
1354
|
+
if (Z.debug(" Checking PREVENT mode"), e.hasDisabledDatesInRange(a, t))
|
|
1355
|
+
return Z.debug(" PREVENT mode - range contains disabled dates"), { isValid: !1, message: "Range contains disabled dates" };
|
|
1356
|
+
} else if (e.options.disabledDatesHandling === "block" && (Z.debug(" Checking BLOCK mode"), e.hasDisabledDatesInRange(a, t))) {
|
|
1357
|
+
Z.debug(" BLOCK mode - range contains disabled dates, adjusting");
|
|
1358
|
+
const r = e.findLastEnabledBeforeGap(a, t);
|
|
1359
|
+
return Z.debug(" BLOCK mode - adjusted end:", r), { isValid: !0, adjustedStart: a, adjustedEnd: r };
|
|
1360
|
+
}
|
|
1361
|
+
const n = await Tt(e, { start: a, end: t });
|
|
1362
|
+
return n.isValid ? n.adjustedStart || n.adjustedEnd ? {
|
|
1363
|
+
isValid: !0,
|
|
1364
|
+
adjustedStart: n.adjustedStart,
|
|
1365
|
+
adjustedEnd: n.adjustedEnd,
|
|
1366
|
+
message: n.message
|
|
1367
|
+
} : { isValid: !0 } : n;
|
|
1346
1368
|
}
|
|
1347
|
-
async function
|
|
1348
|
-
if (
|
|
1369
|
+
async function tn(e, a) {
|
|
1370
|
+
if (a.classList.contains("drp-date-picker__day--disabled")) return;
|
|
1371
|
+
if (!a.dataset || !a.dataset.date) {
|
|
1372
|
+
O.warn("selectDay() - called with invalid element:", a);
|
|
1349
1373
|
return;
|
|
1350
|
-
const a = e.lockedPlacement ? [Ae(8), ke({ padding: 8 })] : [Ae(8), Ze(), ke({ padding: 8 })], t = await et(e.input, e.calendar, {
|
|
1351
|
-
placement: e.lockedPlacement || e.options.calendarPlacement,
|
|
1352
|
-
middleware: a
|
|
1353
|
-
});
|
|
1354
|
-
H.debug("position() - FloatingUI computed - x:", t.x, "y:", t.y, "placement:", t.placement), e.lockedPlacement || (e.lockedPlacement = t.placement, H.debug("position() - locked placement to:", e.lockedPlacement)), e.calendar.style.left = `${t.x}px`, e.calendar.style.top = `${t.y}px`, H.debug("position() - applied styles to calendar");
|
|
1355
|
-
}
|
|
1356
|
-
async function an(e, a, t) {
|
|
1357
|
-
if (!e.tooltip || !e.tooltipArrow) return;
|
|
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: r, placement: o, middlewareData: i } = await et(a, e.tooltip, {
|
|
1360
|
-
placement: "top",
|
|
1361
|
-
middleware: [
|
|
1362
|
-
Ae(6),
|
|
1363
|
-
Ze(),
|
|
1364
|
-
ke({ padding: 5 }),
|
|
1365
|
-
At({ element: e.tooltipArrow })
|
|
1366
|
-
]
|
|
1367
|
-
});
|
|
1368
|
-
if (Object.assign(e.tooltip.style, {
|
|
1369
|
-
left: `${n}px`,
|
|
1370
|
-
top: `${r}px`
|
|
1371
|
-
}), i.arrow) {
|
|
1372
|
-
const { x: s, y: d } = i.arrow, l = {
|
|
1373
|
-
top: "bottom",
|
|
1374
|
-
right: "left",
|
|
1375
|
-
bottom: "top",
|
|
1376
|
-
left: "right"
|
|
1377
|
-
}[o.split("-")[0]];
|
|
1378
|
-
Object.assign(e.tooltipArrow.style, {
|
|
1379
|
-
left: s != null ? `${s}px` : "",
|
|
1380
|
-
top: d != null ? `${d}px` : "",
|
|
1381
|
-
right: "",
|
|
1382
|
-
bottom: "",
|
|
1383
|
-
[l]: "-4px"
|
|
1384
|
-
});
|
|
1385
1374
|
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
a.className = "drp-date-picker__loading-overlay", a.innerHTML = `
|
|
1394
|
-
<div class="drp-date-picker__loading-spinner"></div>
|
|
1395
|
-
`, e.calendar.appendChild(a), e.loadingOverlay = a;
|
|
1396
|
-
}
|
|
1397
|
-
function ae(e) {
|
|
1398
|
-
e.loadingOverlay && (e.loadingOverlay.remove(), e.loadingOverlay = void 0);
|
|
1399
|
-
}
|
|
1400
|
-
function U(e, a, t) {
|
|
1401
|
-
for (let n = 1; n <= 31; n++) {
|
|
1402
|
-
const r = new Date(a, t, n);
|
|
1403
|
-
if (r.getMonth() === t && !e.isDateDisabledInternal(r))
|
|
1404
|
-
return !0;
|
|
1375
|
+
const [t, n, r] = a.dataset.date.split("-").map(Number), o = new Date(t, n - 1, r);
|
|
1376
|
+
a.classList.contains("drp-date-picker__day--other-month");
|
|
1377
|
+
const i = a.closest(".drp-date-picker__days");
|
|
1378
|
+
if (i && i instanceof HTMLElement) {
|
|
1379
|
+
e.activeMonthIndex = parseInt(i.dataset.monthIndex || "0") || 0, ie.debug(`Col${e.activeMonthIndex} selectDay - activeMonthIndex:`, e.activeMonthIndex);
|
|
1380
|
+
const s = i.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
1381
|
+
e.focusedDayIndex = Array.from(s).indexOf(a), ie.debug(`Col${e.activeMonthIndex} selectDay - set focusedDayIndex to:`, e.focusedDayIndex);
|
|
1405
1382
|
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
if (e.options.beforeMonthChangedCallback) {
|
|
1411
|
-
if (e.isMonthChanging) {
|
|
1412
|
-
w.debug("handleInitialMonthLoad() - already changing month, skipping");
|
|
1383
|
+
if (e.options.selectionMode === "single") {
|
|
1384
|
+
const s = await Tt(e, o);
|
|
1385
|
+
if (!s.isValid) {
|
|
1386
|
+
ie.debug("Single mode selection prevented by beforeDateSelectCallback");
|
|
1413
1387
|
return;
|
|
1414
1388
|
}
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
const y = await Promise.resolve(R);
|
|
1434
|
-
T && ae(e), w.debug(`handleInitialMonthLoad() [UNIFIED] - callback completed, metadata items: ${((a = y.metadata) == null ? void 0 : a.size) || 0}, monthHeaders: ${((t = y.monthHeaders) == null ? void 0 : t.size) || 0}`), y.metadata && (e.bulkMetadataCache = y.metadata, w.debug(`handleInitialMonthLoad() [UNIFIED] - bulk metadata cache updated with ${y.metadata.size} entries`)), y.monthHeaders && (e.monthHeadersCache = y.monthHeaders, w.debug(`handleInitialMonthLoad() [UNIFIED] - month headers cache updated with ${y.monthHeaders.size} entries`)), (y.metadata || y.monthHeaders) && e.renderCalendar();
|
|
1435
|
-
} else {
|
|
1436
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - calling callback for ${e.monthDates.length} months`);
|
|
1437
|
-
const o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1438
|
-
let s = !1;
|
|
1439
|
-
for (let d = 0; d < e.monthDates.length; d++) {
|
|
1440
|
-
const l = e.monthDates[d], c = l.getFullYear(), u = l.getMonth(), f = (new Date(c, u, 1).getDay() - e.weekStartDay + 7) % 7, h = new Date(c, u, 1 - f), v = new Date(h);
|
|
1441
|
-
v.setDate(h.getDate() + 41);
|
|
1442
|
-
const m = {
|
|
1443
|
-
year: c,
|
|
1444
|
-
month: u,
|
|
1445
|
-
monthIndex: d,
|
|
1446
|
-
firstVisibleDate: h,
|
|
1447
|
-
lastVisibleDate: v
|
|
1448
|
-
};
|
|
1449
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - calling callback for ${c}-${u + 1}, range: ${h.toISOString().split("T")[0]} to ${v.toISOString().split("T")[0]}`);
|
|
1450
|
-
const M = e.options.beforeMonthChangedCallback(m);
|
|
1451
|
-
M instanceof Promise && !s && (s = !0, Te(e));
|
|
1452
|
-
const x = await Promise.resolve(M);
|
|
1453
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - callback completed, metadata items: ${((n = x.metadata) == null ? void 0 : n.size) || 0}, monthHeaders: ${((r = x.monthHeaders) == null ? void 0 : r.size) || 0}`), x.metadata && x.metadata.forEach((D, _) => {
|
|
1454
|
-
o.set(_, D);
|
|
1455
|
-
}), x.monthHeaders && x.monthHeaders.forEach((D, _) => {
|
|
1456
|
-
i.set(_, D);
|
|
1457
|
-
});
|
|
1458
|
-
}
|
|
1459
|
-
s && ae(e), o.size > 0 && (e.bulkMetadataCache = o, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined metadata cache updated with ${o.size} entries`)), i.size > 0 && (e.monthHeadersCache = i, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined month headers cache updated with ${i.size} entries`)), (o.size > 0 || i.size > 0) && e.renderCalendar();
|
|
1460
|
-
}
|
|
1461
|
-
} catch (o) {
|
|
1462
|
-
ae(e), w.debug("handleInitialMonthLoad() - error in callback:", o), console.error("[DateRangePicker] Error in beforeMonthChangedCallback (initial load):", o);
|
|
1463
|
-
} finally {
|
|
1464
|
-
e.isMonthChanging = !1;
|
|
1389
|
+
const d = s.adjustedDate || o;
|
|
1390
|
+
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();
|
|
1391
|
+
} else if (e.options.selectionMode === "multiple") {
|
|
1392
|
+
const s = `${o.getFullYear()}-${String(o.getMonth() + 1).padStart(2, "0")}-${String(o.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);
|
|
1393
|
+
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(o)), e.input && !e.requiresApplyButton()) {
|
|
1394
|
+
const l = e.selectedDates.length + e.selectedRanges.length;
|
|
1395
|
+
e.input.value = l > 0 ? `${l} selection(s)` : "";
|
|
1396
|
+
}
|
|
1397
|
+
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;
|
|
1398
|
+
} else if (!e.selectedStartDate || e.selectedEndDate)
|
|
1399
|
+
e.selectedStartDate = o, e.selectedEndDate = null, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ...`));
|
|
1400
|
+
else {
|
|
1401
|
+
let s = e.selectedStartDate, d = o;
|
|
1402
|
+
o < e.selectedStartDate && (d = e.selectedStartDate, s = o), ie.debug(" selectDay - calling validateRangeAsync with:", s, d);
|
|
1403
|
+
const l = await kt(e, s, d);
|
|
1404
|
+
if (ie.debug(" selectDay - validation result:", l), !l.isValid) {
|
|
1405
|
+
l.message && O.warn("selectDay() - range validation failed:", l.message), e.renderCalendar(), e.updateSummary();
|
|
1406
|
+
return;
|
|
1465
1407
|
}
|
|
1408
|
+
e.selectedStartDate = l.adjustedStart || s, e.selectedEndDate = l.adjustedEnd || d, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
1409
|
+
const c = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
1410
|
+
e.requiresApplyButton() ? e.pendingSelection = c : e.options.onSelect && e.options.onSelect(c), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
1466
1411
|
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1412
|
+
if (e.renderCalendar(), e.updateSummary(), e.options.selectionMode === "range" && e.selectedEndDate) {
|
|
1413
|
+
const s = e.selectedEndDate;
|
|
1414
|
+
for (let d = 0; d < e.monthDates.length; d++) {
|
|
1415
|
+
const l = e.monthDates[d];
|
|
1416
|
+
if (s.getFullYear() === l.getFullYear() && s.getMonth() === l.getMonth()) {
|
|
1417
|
+
e.activeMonthIndex = d;
|
|
1418
|
+
const c = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${d}"]`);
|
|
1419
|
+
if (c) {
|
|
1420
|
+
const u = c.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), p = Array.from(u).findIndex((g) => {
|
|
1421
|
+
const f = g.dataset.date;
|
|
1422
|
+
if (!f) return !1;
|
|
1423
|
+
const [h, v, m] = f.split("-").map(Number), M = new Date(h, v - 1, m);
|
|
1424
|
+
return e.isSameDay(M, s);
|
|
1425
|
+
});
|
|
1426
|
+
p !== -1 && (e.focusedDayIndex = p, u.forEach((g) => g.classList.remove("drp-date-picker__day--focused")), u[p] && u[p].classList.add("drp-date-picker__day--focused"));
|
|
1427
|
+
}
|
|
1428
|
+
break;
|
|
1482
1429
|
}
|
|
1483
|
-
const M = (new Date(p, g, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1484
|
-
i = new Date(p, g, 1 - M);
|
|
1485
|
-
const C = new Date(f, h + 1, 0).getDate(), D = new Date(f, h, C).getDay(), _ = (e.weekStartDay + 6 - D) % 7;
|
|
1486
|
-
s = new Date(f, h, C + _);
|
|
1487
|
-
} else {
|
|
1488
|
-
const f = (new Date(a, t, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1489
|
-
i = new Date(a, t, 1 - f), s = new Date(i), s.setDate(i.getDate() + 41);
|
|
1490
1430
|
}
|
|
1491
|
-
const d = {
|
|
1492
|
-
year: a,
|
|
1493
|
-
month: t,
|
|
1494
|
-
monthIndex: n,
|
|
1495
|
-
firstVisibleDate: i,
|
|
1496
|
-
lastVisibleDate: s
|
|
1497
|
-
};
|
|
1498
|
-
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${i.toISOString().split("T")[0]} to ${s.toISOString().split("T")[0]}`);
|
|
1499
|
-
const l = e.options.beforeMonthChangedCallback(d), c = l instanceof Promise;
|
|
1500
|
-
c && Te(e);
|
|
1501
|
-
const u = await Promise.resolve(l);
|
|
1502
|
-
return c && ae(e), u.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${u.message || "no reason provided"}`), u.message && console.warn(`[DateRangePicker] Month navigation blocked: ${u.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((r = u.metadata) == null ? void 0 : r.size) || 0}, monthHeaders: ${((o = u.monthHeaders) == null ? void 0 : o.size) || 0}`), u.metadata ? e.bulkMetadataCache ? (u.metadata.forEach((p, g) => {
|
|
1503
|
-
e.bulkMetadataCache.set(g, p);
|
|
1504
|
-
}), w.debug(`handleBeforeMonthChange() - merged ${u.metadata.size} entries into cache (total: ${e.bulkMetadataCache.size})`)) : (e.bulkMetadataCache = u.metadata, w.debug(`handleBeforeMonthChange() - bulk metadata cache created with ${u.metadata.size} entries`)) : e.bulkMetadataCache = null, u.monthHeaders && (e.monthHeadersCache ? (u.monthHeaders.forEach((p, g) => {
|
|
1505
|
-
e.monthHeadersCache.set(g, p);
|
|
1506
|
-
}), w.debug(`handleBeforeMonthChange() - merged ${u.monthHeaders.size} entries into headers cache (total: ${e.monthHeadersCache.size})`)) : (e.monthHeadersCache = u.monthHeaders, w.debug(`handleBeforeMonthChange() - month headers cache created with ${u.monthHeaders.size} entries`))), !0);
|
|
1507
|
-
} catch (i) {
|
|
1508
|
-
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:", i), console.error("[DateRangePicker] Error in beforeMonthChangedCallback:", i), !1;
|
|
1509
|
-
} finally {
|
|
1510
|
-
e.isMonthChanging = !1;
|
|
1511
1431
|
}
|
|
1512
1432
|
}
|
|
1513
|
-
function
|
|
1514
|
-
e.
|
|
1433
|
+
function an(e) {
|
|
1434
|
+
e.monthDates[e.activeMonthIndex] = /* @__PURE__ */ new Date(), e.selectedDate = /* @__PURE__ */ new Date(), e.input && (e.requiresApplyButton() || (e.input.value = e.formatDate(e.selectedDate))), e.requiresApplyButton() ? e.pendingSelection = e.selectedDate : e.options.onSelect && e.options.onSelect(e.selectedDate), e.renderCalendar(), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
1515
1435
|
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1436
|
+
function nn(e) {
|
|
1437
|
+
e.selectedDate = null, e.selectedStartDate = null, e.selectedEndDate = null, e.selectedRanges = [], e.selectedDates = [], e.pendingSelection = null, e.dragPreviewStart = null, e.dragPreviewEnd = null, e.focusedDayIndex = null, e.input && (e.input.value = ""), e.renderCalendar(), e.updateSummary();
|
|
1438
|
+
}
|
|
1439
|
+
function rn(e) {
|
|
1440
|
+
if (e.input) {
|
|
1441
|
+
if (e.options.selectionMode === "range" && e.selectedStartDate && e.selectedEndDate)
|
|
1442
|
+
e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`;
|
|
1443
|
+
else if (e.options.selectionMode === "single" && e.selectedDate)
|
|
1444
|
+
e.input.value = e.formatDate(e.selectedDate);
|
|
1445
|
+
else if (e.options.selectionMode === "multiple") {
|
|
1446
|
+
const a = e.selectedDates.length + e.selectedRanges.length;
|
|
1447
|
+
e.input.value = a > 0 ? `${a} selection(s)` : "";
|
|
1448
|
+
}
|
|
1521
1449
|
}
|
|
1522
|
-
|
|
1523
|
-
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${o} to ${a}`), pe(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1450
|
+
e.pendingSelection && (e.options.onSelect && e.options.onSelect(e.pendingSelection), e.pendingSelection = null), e.options.selectionMode === "range" ? (e.committedStartDate = e.selectedStartDate, e.committedEndDate = e.selectedEndDate) : e.options.selectionMode === "single" && (e.committedDate = e.selectedDate), e.options.positioningMode === "floating" && e.hide();
|
|
1524
1451
|
}
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1452
|
+
function on(e) {
|
|
1453
|
+
e.options.selectionMode === "range" && e.calendar.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--disabled)").forEach((t) => {
|
|
1454
|
+
t.addEventListener("mousedown", (n) => {
|
|
1455
|
+
const r = n, o = t, i = r.clientX, s = r.clientY, d = 5;
|
|
1456
|
+
let l = !1, c = !1;
|
|
1457
|
+
const u = o.classList.contains("drp-date-picker__day--range-start"), p = o.classList.contains("drp-date-picker__day--range-end");
|
|
1458
|
+
let g;
|
|
1459
|
+
u && e.selectedStartDate && e.selectedEndDate ? g = "start" : p && e.selectedStartDate && e.selectedEndDate ? g = "end" : g = "start";
|
|
1460
|
+
const f = (v) => {
|
|
1461
|
+
const m = Math.abs(v.clientX - i), M = Math.abs(v.clientY - s);
|
|
1462
|
+
!l && (m > d || M > d) && (l = !0), l && !c && (c = !0, Lt(e, r, g, o), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h));
|
|
1463
|
+
}, h = () => {
|
|
1464
|
+
document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h);
|
|
1465
|
+
};
|
|
1466
|
+
document.addEventListener("mousemove", f), document.addEventListener("mouseup", h);
|
|
1467
|
+
});
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
function Lt(e, a, t, n) {
|
|
1471
|
+
a.preventDefault(), a.stopPropagation(), e.isDragging = !0, e.draggingType = t;
|
|
1472
|
+
const r = n, o = r.dataset.date;
|
|
1473
|
+
let i = null;
|
|
1474
|
+
if (o) {
|
|
1475
|
+
const [s, d, l] = o.split("-").map(Number);
|
|
1476
|
+
i = new Date(s, d - 1, l);
|
|
1530
1477
|
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1478
|
+
!e.selectedStartDate && !e.selectedEndDate ? i && (e.originalStartDate = i, e.originalEndDate = null, e.draggingType = "end") : i && e.selectedStartDate && !e.selectedEndDate ? i.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) => {
|
|
1479
|
+
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");
|
|
1480
|
+
}), e.originalStartDate = i, e.originalEndDate = null, e.draggingType = "end") : (e.selectedStartDate && (e.originalStartDate = new Date(e.selectedStartDate)), e.selectedEndDate && (e.originalEndDate = new Date(e.selectedEndDate))), r.classList.add("drp-date-picker__day--dragging"), ee.debug(`Started dragging ${t} date`), e.onDragMoveBound = (s) => $t(e, s), e.onDragEndBound = async (s) => await zt(e), document.addEventListener("mousemove", e.onDragMoveBound), document.addEventListener("mouseup", e.onDragEndBound), document.body.style.cursor = "grabbing";
|
|
1533
1481
|
}
|
|
1534
|
-
function
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1482
|
+
function $t(e, a) {
|
|
1483
|
+
if (!e.isDragging) return;
|
|
1484
|
+
let t = null;
|
|
1485
|
+
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);
|
|
1486
|
+
const n = t == null ? void 0 : t.closest(".drp-date-picker__nav--prev"), r = t == null ? void 0 : t.closest(".drp-date-picker__nav--next");
|
|
1487
|
+
if (n || r) {
|
|
1488
|
+
if (!e.navInterval) {
|
|
1489
|
+
const p = (n || r).closest(".drp-date-picker__month");
|
|
1490
|
+
if (p && p instanceof HTMLElement) {
|
|
1491
|
+
const g = parseInt(p.dataset.monthIndex || "0"), f = !!n;
|
|
1492
|
+
f ? e.prevMonth(g) : e.nextMonth(g), e.navInterval = window.setInterval(() => {
|
|
1493
|
+
f ? e.prevMonth(g) : e.nextMonth(g);
|
|
1494
|
+
}, 1e3);
|
|
1495
|
+
}
|
|
1542
1496
|
}
|
|
1497
|
+
return;
|
|
1498
|
+
} else
|
|
1499
|
+
e.navInterval && (clearInterval(e.navInterval), e.navInterval = null);
|
|
1500
|
+
const o = t;
|
|
1501
|
+
if (!o || !o.classList.contains("drp-date-picker__day")) return;
|
|
1502
|
+
const i = o.dataset.date;
|
|
1503
|
+
if (!i) return;
|
|
1504
|
+
const [s, d, l] = i.split("-").map(Number);
|
|
1505
|
+
let c = new Date(s, d - 1, l);
|
|
1506
|
+
if (o.classList.contains("drp-date-picker__day--disabled")) {
|
|
1507
|
+
const u = e.draggingType === "start" ? e.originalEndDate && c > e.originalEndDate ? "backward" : "forward" : e.originalStartDate && c < e.originalStartDate ? "forward" : "backward";
|
|
1508
|
+
c = ke(e, c, u);
|
|
1543
1509
|
}
|
|
1544
|
-
if (
|
|
1545
|
-
const
|
|
1546
|
-
if (
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
e.monthDates[a - 1] = r, pe(e, a - 1);
|
|
1510
|
+
if (e.draggingType === "start" && e.originalEndDate ? (e.dragPreviewStart = c, e.dragPreviewEnd = e.originalEndDate, e.dragPreviewStart > e.dragPreviewEnd && ([e.dragPreviewStart, e.dragPreviewEnd] = [e.dragPreviewEnd, e.dragPreviewStart], e.draggingType = "end")) : e.originalStartDate && (e.dragPreviewStart = e.originalStartDate, e.dragPreviewEnd = c, e.dragPreviewEnd < e.dragPreviewStart && ([e.dragPreviewStart, e.dragPreviewEnd] = [e.dragPreviewEnd, e.dragPreviewStart], e.draggingType = "start")), e.dragPreviewStart && e.dragPreviewEnd) {
|
|
1511
|
+
const u = e.options.disabledDatesHandling;
|
|
1512
|
+
if (ee.debug("onDragMove - mode:", u, "start:", e.dragPreviewStart, "end:", e.dragPreviewEnd), u === "prevent" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd)) {
|
|
1513
|
+
ee.debug("PREVENT mode - range contains disabled dates, blocking preview update");
|
|
1514
|
+
return;
|
|
1550
1515
|
}
|
|
1551
1516
|
}
|
|
1517
|
+
e.updateDragPreview();
|
|
1552
1518
|
}
|
|
1553
|
-
function
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1519
|
+
async function zt(e, a) {
|
|
1520
|
+
if (e.isDragging) {
|
|
1521
|
+
if (ee.debug("Ended dragging, finalizing selection"), e.dragPreviewStart && e.dragPreviewEnd) {
|
|
1522
|
+
let t = ke(e, e.dragPreviewStart, "forward"), n = ke(e, e.dragPreviewEnd, "backward");
|
|
1523
|
+
t > n && ([t, n] = [n, t]), ee.debug("onDragEnd - calling validateRangeAsync with:", t, n);
|
|
1524
|
+
const r = await kt(e, t, n);
|
|
1525
|
+
if (ee.debug("onDragEnd - validation result:", r), !r.isValid)
|
|
1526
|
+
r.message && O.warn("onDragEnd() - drag validation failed:", r.message);
|
|
1527
|
+
else {
|
|
1528
|
+
e.selectedStartDate = r.adjustedStart || t, e.selectedEndDate = r.adjustedEnd || n, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
1529
|
+
const o = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
1530
|
+
e.requiresApplyButton() ? e.pendingSelection = o : e.options.onSelect && e.options.onSelect(o);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
if (e.isDragging = !1, e.draggingType = null, e.dragPreviewStart = null, e.dragPreviewEnd = null, e.calendar.querySelectorAll(".drp-date-picker__day--dragging").forEach((t) => {
|
|
1534
|
+
t.classList.remove("drp-date-picker__day--dragging");
|
|
1535
|
+
}), 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) {
|
|
1536
|
+
const t = e.selectedEndDate;
|
|
1537
|
+
for (let n = 0; n < e.monthDates.length; n++) {
|
|
1538
|
+
const r = e.monthDates[n];
|
|
1539
|
+
if (t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth()) {
|
|
1540
|
+
e.activeMonthIndex = n;
|
|
1541
|
+
const o = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${n}"]`);
|
|
1542
|
+
if (o) {
|
|
1543
|
+
const i = o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), s = Array.from(i).findIndex((d) => {
|
|
1544
|
+
const l = d.dataset.date;
|
|
1545
|
+
if (!l) return !1;
|
|
1546
|
+
const [c, u, p] = l.split("-").map(Number), g = new Date(c, u - 1, p);
|
|
1547
|
+
return e.isSameDay(g, t);
|
|
1548
|
+
});
|
|
1549
|
+
s !== -1 && (e.focusedDayIndex = s, i.forEach((d) => d.classList.remove("drp-date-picker__day--focused")), i[s] && i[s].classList.add("drp-date-picker__day--focused"));
|
|
1550
|
+
}
|
|
1551
|
+
break;
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
1572
1556
|
}
|
|
1573
|
-
e.renderCalendar();
|
|
1574
1557
|
}
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
w.debug(`nextMonth() Col${t} - navigation blocked by callback`);
|
|
1585
|
-
return;
|
|
1558
|
+
function ke(e, a, t = "forward") {
|
|
1559
|
+
let r = new Date(a);
|
|
1560
|
+
if (r.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(r))
|
|
1561
|
+
return r;
|
|
1562
|
+
const o = t === "forward" ? 1 : -1;
|
|
1563
|
+
for (let s = 1; s <= 60; s++) {
|
|
1564
|
+
const d = new Date(a);
|
|
1565
|
+
if (d.setDate(d.getDate() + s * o), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
1566
|
+
return d;
|
|
1586
1567
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1568
|
+
const i = -o;
|
|
1569
|
+
for (let s = 1; s <= 60; s++) {
|
|
1570
|
+
const d = new Date(a);
|
|
1571
|
+
if (d.setDate(d.getDate() + s * i), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
1572
|
+
return d;
|
|
1590
1573
|
}
|
|
1591
|
-
|
|
1574
|
+
return a;
|
|
1592
1575
|
}
|
|
1593
|
-
function
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
if (
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1576
|
+
function sn(e, a) {
|
|
1577
|
+
const t = a.target, n = t.value, r = t.selectionStart || 0, o = e._previousInputValue || "", i = n.length < o.length, { separator: s } = e.formatInfo;
|
|
1578
|
+
if (e.options.selectionMode === "range") {
|
|
1579
|
+
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}to ]`, "gi"), ""), l = Pt(e, d);
|
|
1580
|
+
if (l !== n) {
|
|
1581
|
+
t.value = l;
|
|
1582
|
+
let c = r;
|
|
1583
|
+
if (i)
|
|
1584
|
+
c = r;
|
|
1585
|
+
else if (l.length > n.length)
|
|
1586
|
+
if (l.includes(" to ") && !n.includes(" to ")) {
|
|
1587
|
+
const u = l.indexOf(" to ");
|
|
1588
|
+
r >= u && r <= u + 4 ? c = u + 4 : c = r + (l.length - n.length);
|
|
1589
|
+
} else
|
|
1590
|
+
c = r + (l.length - n.length);
|
|
1591
|
+
t.setSelectionRange(c, c);
|
|
1592
|
+
}
|
|
1593
|
+
} else {
|
|
1594
|
+
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), l = pe(e, d);
|
|
1595
|
+
if (l !== n) {
|
|
1596
|
+
t.value = l;
|
|
1597
|
+
let c = r;
|
|
1598
|
+
if (i)
|
|
1599
|
+
c = r;
|
|
1600
|
+
else if (l.length > n.length && l[r] === s)
|
|
1601
|
+
c = r + 1;
|
|
1602
|
+
else if (l.length > n.length) {
|
|
1603
|
+
const u = (n.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length, g = (l.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length - u;
|
|
1604
|
+
c = r + g;
|
|
1603
1605
|
}
|
|
1606
|
+
t.setSelectionRange(c, c);
|
|
1604
1607
|
}
|
|
1605
|
-
if (o += t, i++, o < 0 || o >= n.length)
|
|
1606
|
-
return { index: null, monthChanged: !0, direction: t > 0 ? "next" : "prev" };
|
|
1607
1608
|
}
|
|
1608
|
-
|
|
1609
|
+
e._previousInputValue = t.value, He(e);
|
|
1610
|
+
}
|
|
1611
|
+
function pe(e, a) {
|
|
1612
|
+
var c, u, p;
|
|
1613
|
+
const { separator: t, parts: n, maxLength: r } = e.formatInfo, o = a.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), ""), i = n.year ? n.year.length : 4, s = [
|
|
1614
|
+
{ type: "year", pos: ((c = n.year) == null ? void 0 : c.index) ?? 0, length: i },
|
|
1615
|
+
{ type: "month", pos: ((u = n.month) == null ? void 0 : u.index) ?? 1, length: 2 },
|
|
1616
|
+
{ type: "day", pos: ((p = n.day) == null ? void 0 : p.index) ?? 2, length: 2 }
|
|
1617
|
+
].sort((g, f) => g.pos - f.pos);
|
|
1618
|
+
let d = "", l = 0;
|
|
1619
|
+
for (let g = 0; g < s.length; g++) {
|
|
1620
|
+
const f = s[g], h = o.substring(l, l + f.length);
|
|
1621
|
+
if (!h) break;
|
|
1622
|
+
d += h, l += h.length, g < s.length - 1 && h.length === f.length && (d += t);
|
|
1623
|
+
}
|
|
1624
|
+
return d.substring(0, r);
|
|
1625
|
+
}
|
|
1626
|
+
function Pt(e, a) {
|
|
1627
|
+
const { separator: t, maxLength: n } = e.formatInfo, r = " to ";
|
|
1628
|
+
let o = "", i = "";
|
|
1629
|
+
if (a.includes(r)) {
|
|
1630
|
+
const d = a.split(r);
|
|
1631
|
+
o = d[0], i = d.slice(1).join(r);
|
|
1632
|
+
} else
|
|
1633
|
+
o = a;
|
|
1634
|
+
const s = pe(e, o);
|
|
1635
|
+
if (s.length === n)
|
|
1636
|
+
if (a.includes(r)) {
|
|
1637
|
+
const d = pe(e, i);
|
|
1638
|
+
return s + r + d;
|
|
1639
|
+
} else
|
|
1640
|
+
return s + r;
|
|
1641
|
+
else
|
|
1642
|
+
return s;
|
|
1609
1643
|
}
|
|
1610
1644
|
function dn(e, a) {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
if (!t) {
|
|
1615
|
-
w.debug(`moveFocus() Col${e.activeMonthIndex} - ERROR: daysContainer not found!`);
|
|
1645
|
+
const { key: t, ctrlKey: n, metaKey: r } = a, { separator: o } = e.formatInfo;
|
|
1646
|
+
if (e.calendar.classList.contains("drp-date-picker--visible") && ["ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(t)) {
|
|
1647
|
+
a.preventDefault();
|
|
1616
1648
|
return;
|
|
1617
1649
|
}
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
e.focusedDayIndex = C.length - 1 - k, w.debug(`moveFocus() Col${c} - last day weekday ${E}, target ${m}, focusing on day ${e.focusedDayIndex + 1}`), (_ = C[e.focusedDayIndex]) == null || _.classList.add("drp-date-picker__day--focused"), (R = C[e.focusedDayIndex]) == null || R.scrollIntoView({ block: "nearest" });
|
|
1648
|
-
}
|
|
1649
|
-
}, 0);
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
return;
|
|
1653
|
-
} else if (r >= n.length) {
|
|
1654
|
-
const c = e.activeMonthIndex;
|
|
1655
|
-
if (a === 1)
|
|
1656
|
-
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`), ve(e, e.activeMonthIndex), setTimeout(() => {
|
|
1657
|
-
var f, h;
|
|
1658
|
-
const u = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1659
|
-
if (!u) return;
|
|
1660
|
-
const p = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = me(e, 0, 1, p);
|
|
1661
|
-
g.index !== null && (e.focusedDayIndex = g.index, (f = p[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = p[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
1662
|
-
}, 0);
|
|
1663
|
-
else {
|
|
1664
|
-
const p = n[e.focusedDayIndex].dataset.date;
|
|
1665
|
-
if (p) {
|
|
1666
|
-
const [g, f, h] = p.split("-").map(Number), m = new Date(g, f - 1, h).getDay();
|
|
1667
|
-
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${h} is weekday ${m}, going to next month`), ve(e, e.activeMonthIndex), setTimeout(() => {
|
|
1668
|
-
var _, R;
|
|
1669
|
-
const M = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1670
|
-
if (!M) return;
|
|
1671
|
-
const C = M.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), D = C[0].dataset.date;
|
|
1672
|
-
if (D) {
|
|
1673
|
-
const [T, y, I] = D.split("-").map(Number), E = new Date(T, y - 1, I).getDay(), k = (m - E + 7) % 7;
|
|
1674
|
-
e.focusedDayIndex = k, w.debug(`moveFocus() Col${c} - first day weekday ${E}, target ${m}, focusing on day ${e.focusedDayIndex + 1}`), (_ = C[e.focusedDayIndex]) == null || _.classList.add("drp-date-picker__day--focused"), (R = C[e.focusedDayIndex]) == null || R.scrollIntoView({ block: "nearest" });
|
|
1675
|
-
}
|
|
1676
|
-
}, 0);
|
|
1650
|
+
if (!([
|
|
1651
|
+
"Backspace",
|
|
1652
|
+
"Delete",
|
|
1653
|
+
"Tab",
|
|
1654
|
+
"Escape",
|
|
1655
|
+
"Enter",
|
|
1656
|
+
"ArrowLeft",
|
|
1657
|
+
"ArrowRight",
|
|
1658
|
+
"ArrowUp",
|
|
1659
|
+
"ArrowDown",
|
|
1660
|
+
"Home",
|
|
1661
|
+
"End"
|
|
1662
|
+
].includes(t) || n || r)) {
|
|
1663
|
+
if (t === o) {
|
|
1664
|
+
const s = a.target, d = s.selectionStart || 0, l = s.value;
|
|
1665
|
+
let c = 0;
|
|
1666
|
+
for (let p = d - 1; p >= 0; p--)
|
|
1667
|
+
if (l[p] === o || l[p] === " ") {
|
|
1668
|
+
c = p + 1;
|
|
1669
|
+
break;
|
|
1670
|
+
}
|
|
1671
|
+
const u = l.substring(c, d);
|
|
1672
|
+
if (/^\d$/.test(u)) {
|
|
1673
|
+
a.preventDefault();
|
|
1674
|
+
const p = l.substring(0, c) + "0" + u + o + l.substring(d);
|
|
1675
|
+
s.value = p;
|
|
1676
|
+
const g = c + 2 + o.length;
|
|
1677
|
+
s.setSelectionRange(g, g), e._previousInputValue = p, s.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
1678
|
+
return;
|
|
1677
1679
|
}
|
|
1678
1680
|
}
|
|
1679
|
-
|
|
1680
|
-
}
|
|
1681
|
-
const o = me(e, r, a, n, e.activeMonthIndex);
|
|
1682
|
-
if (o.monthChanged) {
|
|
1683
|
-
const c = e.activeMonthIndex;
|
|
1684
|
-
o.direction === "next" ? ve(e, e.activeMonthIndex) : ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
1685
|
-
var f, h;
|
|
1686
|
-
const u = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1687
|
-
if (!u) return;
|
|
1688
|
-
const p = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = me(
|
|
1689
|
-
e,
|
|
1690
|
-
o.direction === "next" ? 0 : p.length - 1,
|
|
1691
|
-
a,
|
|
1692
|
-
p
|
|
1693
|
-
);
|
|
1694
|
-
g.index !== null && (e.focusedDayIndex = g.index, (f = p[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = p[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
1695
|
-
}, 0);
|
|
1696
|
-
return;
|
|
1681
|
+
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !== o && t !== " " && t.toLowerCase() !== "t" && t.toLowerCase() !== "o" && a.preventDefault() : !/^\d$/.test(t) && t !== o && a.preventDefault();
|
|
1697
1682
|
}
|
|
1698
|
-
o.index !== null ? (e.focusedDayIndex = o.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"));
|
|
1699
1683
|
}
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1684
|
+
function ln(e, a) {
|
|
1685
|
+
var p;
|
|
1686
|
+
a.preventDefault();
|
|
1687
|
+
const t = ((p = a.clipboardData) == null ? void 0 : p.getData("text")) || "", { separator: n } = e.formatInfo, r = t.replace(new RegExp(`[^0-9${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), o = pe(e, r), i = a.target, s = i.selectionStart || 0, d = i.selectionEnd || 0, l = i.value, c = l.substring(0, s) + o + l.substring(d);
|
|
1688
|
+
i.value = pe(e, c);
|
|
1689
|
+
const u = s + o.length;
|
|
1690
|
+
i.setSelectionRange(u, u), i.dispatchEvent(new Event("input", { bubbles: !0 })), He(e);
|
|
1691
|
+
}
|
|
1692
|
+
function He(e) {
|
|
1693
|
+
if (!e.input) return;
|
|
1694
|
+
const a = e.input.value;
|
|
1695
|
+
if (oe.debug("updateCalendarFromInput - value:", a), !a) {
|
|
1696
|
+
e.clearSelection(), e.renderCalendar();
|
|
1705
1697
|
return;
|
|
1706
1698
|
}
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
}
|
|
1712
|
-
e.renderCalendar();
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
async function cn(e) {
|
|
1716
|
-
if (!e.options.unifiedNavigation) return;
|
|
1717
|
-
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
1718
|
-
if (w.debug(`unifiedPrevMonth() - anchor index: ${a}, current: ${t.getFullYear()}-${t.getMonth() + 1}, new: ${n.getFullYear()}-${n.getMonth() + 1}`), !U(e, n.getFullYear(), n.getMonth())) {
|
|
1719
|
-
w.debug("unifiedPrevMonth() - navigation blocked: target month has no enabled days");
|
|
1699
|
+
const { separator: t, parts: n, maxLength: r } = e.formatInfo;
|
|
1700
|
+
if (oe.debug("Format info:", { separator: t, parts: n, maxLength: r }), e.options.selectionMode === "range" && a.includes(" to ")) {
|
|
1701
|
+
const i = a.split(" to "), s = i[0], d = i[1];
|
|
1702
|
+
oe.debug("Range parts - start:", s, "end:", d), Se(e, s, "start"), d ? Se(e, d, "end") : e.selectedEndDate = null;
|
|
1720
1703
|
return;
|
|
1721
1704
|
}
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1705
|
+
const o = e.options.selectionMode === "range" ? "start" : "single";
|
|
1706
|
+
Se(e, a, o);
|
|
1707
|
+
}
|
|
1708
|
+
function Se(e, a, t = "single") {
|
|
1709
|
+
const { separator: n, parts: r, maxLength: o } = e.formatInfo, i = a.split(n);
|
|
1710
|
+
let s = null, d = null, l = null;
|
|
1711
|
+
if (i.forEach((c, u) => {
|
|
1712
|
+
if (c) {
|
|
1713
|
+
if (r.year && r.year.index === u) {
|
|
1714
|
+
const p = parseInt(c, 10);
|
|
1715
|
+
r.year.length === 4 && c.length === 4 ? s = p : r.year.length === 2 && c.length === 2 && (s = p < 100 ? p + 2e3 : p);
|
|
1716
|
+
} else if (r.month && r.month.index === u) {
|
|
1717
|
+
const p = parseInt(c, 10);
|
|
1718
|
+
c.length === 2 && p >= 1 && p <= 12 && (d = p);
|
|
1719
|
+
} else if (r.day && r.day.index === u) {
|
|
1720
|
+
const p = parseInt(c, 10);
|
|
1721
|
+
c.length === 2 && p >= 1 && p <= 31 && (l = p);
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
}), oe.debug(`parseAndUpdateSingleDate(${t}) - year:`, s, "month:", d, "day:", l), s !== null || d !== null) {
|
|
1725
|
+
const c = s || (/* @__PURE__ */ new Date()).getFullYear(), u = d !== null ? d - 1 : (/* @__PURE__ */ new Date()).getMonth();
|
|
1726
|
+
if (e.options.selectionMode === "single") {
|
|
1727
|
+
e.monthDates = [];
|
|
1728
|
+
for (let p = 0; p < e.options.visibleMonthsCount; p++) {
|
|
1729
|
+
const g = new Date(c, u + p, 1);
|
|
1730
|
+
e.monthDates.push(g);
|
|
1731
|
+
}
|
|
1732
|
+
} else if (e.options.selectionMode === "range" && (t === "start" || !e.selectedStartDate)) {
|
|
1733
|
+
if (e.displayMonths = [
|
|
1734
|
+
{ month: u, year: c }
|
|
1735
|
+
], e.options.visibleMonthsCount > 1) {
|
|
1736
|
+
const p = new Date(c, u + 1, 1);
|
|
1737
|
+
e.displayMonths.push({
|
|
1738
|
+
month: p.getMonth(),
|
|
1739
|
+
year: p.getFullYear()
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
e.monthDates = [];
|
|
1743
|
+
for (let p = 0; p < e.options.visibleMonthsCount; p++) {
|
|
1744
|
+
const g = e.displayMonths[p], f = new Date(g.year, g.month, 1);
|
|
1745
|
+
e.monthDates.push(f);
|
|
1746
|
+
}
|
|
1726
1747
|
}
|
|
1727
1748
|
e.renderCalendar();
|
|
1728
1749
|
}
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getFullYear();
|
|
1733
|
-
if (w.debug(`setUnifiedMonth(${a}) - anchor index: ${t}, year: ${n}`), !!await Q(e, n, a, t)) {
|
|
1734
|
-
for (let o = 0; o < e.monthDates.length; o++) {
|
|
1735
|
-
const i = o - t;
|
|
1736
|
-
e.monthDates[o] = new Date(n, a + i, 1);
|
|
1737
|
-
}
|
|
1738
|
-
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1750
|
+
if (s !== null && d !== null && l !== null) {
|
|
1751
|
+
const c = new Date(s, d - 1, l);
|
|
1752
|
+
c.getMonth() === d - 1 && (t === "single" ? e.selectedDate = c : t === "start" ? e.selectedStartDate = c : t === "end" && (e.selectedEndDate = c), e.renderCalendar(), e.options.selectionMode === "range" && e.updateSummary(), oe.debug(`Set ${t} date:`, c));
|
|
1739
1753
|
}
|
|
1740
1754
|
}
|
|
1741
|
-
|
|
1742
|
-
|
|
1755
|
+
let Ce = null;
|
|
1756
|
+
function Nt(e) {
|
|
1757
|
+
e.options.positioningMode !== "inline" && (H.debug("show() - adding visible class"), e.requiresApplyButton() && e.input && (e.originalInputValue = e.input.value, H.debug("show() - stored original input value:", e.originalInputValue)), He(e), e.isFirstRender && (e.renderCalendar(), e.isFirstRender = !1, Ht(e)), e.calendar.classList.add("drp-date-picker--visible"), e.isCalendarActive = !0, H.debug("show() - calendar classes:", e.calendar.className), Ue(e), Ce = Rt(e.input, e.calendar, () => {
|
|
1758
|
+
Ue(e);
|
|
1759
|
+
}), e.clickOutsideHandler && setTimeout(() => {
|
|
1760
|
+
document.addEventListener("click", e.clickOutsideHandler);
|
|
1761
|
+
}, 0), setTimeout(() => {
|
|
1762
|
+
const a = window.getComputedStyle(e.calendar);
|
|
1763
|
+
H.debug("show() - computed styles - display:", a.display, "position:", a.position, "left:", a.left, "top:", a.top, "z-index:", a.zIndex);
|
|
1764
|
+
}, 100));
|
|
1743
1765
|
}
|
|
1744
|
-
|
|
1745
|
-
if (
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
e.monthDates[o] = new Date(a, n + i, 1);
|
|
1751
|
-
}
|
|
1752
|
-
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1766
|
+
function Ft(e) {
|
|
1767
|
+
if (e.options.positioningMode !== "inline" && e.calendar.classList.contains("drp-date-picker--visible")) {
|
|
1768
|
+
Ce && (Ce(), Ce = 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 && (H.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), H.debug("hide() - reverted selection state")), e.pendingSelection = null;
|
|
1769
|
+
for (let a = 0; a < e.showingRollingSelector.length; a++)
|
|
1770
|
+
e.showingRollingSelector[a] = !1;
|
|
1771
|
+
e.isFirstRender || e.renderCalendar(), e.lockedPlacement = void 0;
|
|
1753
1772
|
}
|
|
1754
1773
|
}
|
|
1755
|
-
function
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1774
|
+
function cn(e) {
|
|
1775
|
+
e.calendar.classList.contains("drp-date-picker--visible") ? Ft(e) : Nt(e);
|
|
1776
|
+
}
|
|
1777
|
+
async function Ue(e) {
|
|
1778
|
+
if (H.debug("position() - locked placement:", e.lockedPlacement), !e.input)
|
|
1779
|
+
return;
|
|
1780
|
+
const a = e.lockedPlacement ? [Ae(8), Te({ padding: 8 })] : [Ae(8), et(), Te({ padding: 8 })], t = await tt(e.input, e.calendar, {
|
|
1781
|
+
placement: e.lockedPlacement || e.options.calendarPlacement,
|
|
1782
|
+
middleware: a
|
|
1783
|
+
});
|
|
1784
|
+
H.debug("position() - FloatingUI computed - x:", t.x, "y:", t.y, "placement:", t.placement), e.lockedPlacement || (e.lockedPlacement = t.placement, H.debug("position() - locked placement to:", e.lockedPlacement)), e.calendar.style.left = `${t.x}px`, e.calendar.style.top = `${t.y}px`, H.debug("position() - applied styles to calendar");
|
|
1785
|
+
}
|
|
1786
|
+
async function un(e, a, t) {
|
|
1787
|
+
if (!e.tooltip || !e.tooltipArrow) return;
|
|
1788
|
+
e.currentTooltipTarget = a, e.tooltip.innerHTML = t, e.tooltip.appendChild(e.tooltipArrow), e.tooltip.classList.add("drp-date-picker__tooltip--visible");
|
|
1789
|
+
const { x: n, y: r, placement: o, middlewareData: i } = await tt(a, e.tooltip, {
|
|
1790
|
+
placement: "top",
|
|
1791
|
+
middleware: [
|
|
1792
|
+
Ae(6),
|
|
1793
|
+
et(),
|
|
1794
|
+
Te({ padding: 5 }),
|
|
1795
|
+
At({ element: e.tooltipArrow })
|
|
1796
|
+
]
|
|
1797
|
+
});
|
|
1798
|
+
if (Object.assign(e.tooltip.style, {
|
|
1799
|
+
left: `${n}px`,
|
|
1800
|
+
top: `${r}px`
|
|
1801
|
+
}), i.arrow) {
|
|
1802
|
+
const { x: s, y: d } = i.arrow, l = {
|
|
1803
|
+
top: "bottom",
|
|
1804
|
+
right: "left",
|
|
1805
|
+
bottom: "top",
|
|
1806
|
+
left: "right"
|
|
1807
|
+
}[o.split("-")[0]];
|
|
1808
|
+
Object.assign(e.tooltipArrow.style, {
|
|
1809
|
+
left: s != null ? `${s}px` : "",
|
|
1810
|
+
top: d != null ? `${d}px` : "",
|
|
1811
|
+
right: "",
|
|
1812
|
+
bottom: "",
|
|
1813
|
+
[l]: "-4px"
|
|
1814
|
+
});
|
|
1769
1815
|
}
|
|
1770
1816
|
}
|
|
1771
|
-
function
|
|
1772
|
-
|
|
1773
|
-
return { min: 1, max: 12 };
|
|
1774
|
-
const [a, t] = e.split("-");
|
|
1775
|
-
return { min: parseInt(a, 10), max: parseInt(t, 10) };
|
|
1817
|
+
function pn(e) {
|
|
1818
|
+
e.tooltip && (e.tooltip.classList.remove("drp-date-picker__tooltip--visible"), e.currentTooltipTarget = void 0);
|
|
1776
1819
|
}
|
|
1777
|
-
function
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1820
|
+
function Le(e) {
|
|
1821
|
+
if (e.loadingOverlay) return;
|
|
1822
|
+
const a = document.createElement("div");
|
|
1823
|
+
a.className = "drp-date-picker__loading-overlay", a.innerHTML = `
|
|
1824
|
+
<div class="drp-date-picker__loading-spinner"></div>
|
|
1825
|
+
`, e.calendar.appendChild(a), e.loadingOverlay = a;
|
|
1826
|
+
}
|
|
1827
|
+
function ae(e) {
|
|
1828
|
+
e.loadingOverlay && (e.loadingOverlay.remove(), e.loadingOverlay = void 0);
|
|
1829
|
+
}
|
|
1830
|
+
function U(e, a, t) {
|
|
1831
|
+
for (let n = 1; n <= 31; n++) {
|
|
1832
|
+
const r = new Date(a, t, n);
|
|
1833
|
+
if (r.getMonth() === t && !e.isDateDisabledInternal(r))
|
|
1834
|
+
return !0;
|
|
1787
1835
|
}
|
|
1788
|
-
|
|
1836
|
+
return !1;
|
|
1789
1837
|
}
|
|
1790
|
-
function
|
|
1791
|
-
var
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
n == null || n.classList.remove("drp-date-picker__rolling-selector--visible");
|
|
1797
|
-
const r = e.monthDates[a], o = r.getFullYear(), i = r.getMonth(), s = e.monthNames[i], d = t.querySelector(".drp-date-picker__month-year");
|
|
1798
|
-
if (d) {
|
|
1799
|
-
const x = `${o}-${String(i + 1).padStart(2, "0")}`;
|
|
1800
|
-
let D;
|
|
1801
|
-
(C = e.monthHeadersCache) != null && C.has(x) ? D = e.monthHeadersCache.get(x) : e.options.getMonthHeaderCallback ? D = e.options.getMonthHeaderCallback({
|
|
1802
|
-
month: r,
|
|
1803
|
-
monthIndex: a,
|
|
1804
|
-
monthName: s,
|
|
1805
|
-
year: o
|
|
1806
|
-
}) : D = `${s} ${o}`, d.textContent = D;
|
|
1807
|
-
}
|
|
1808
|
-
if (e.options.unifiedNavigation && a === 0 && e.unifiedRangeDisplay) {
|
|
1809
|
-
e.unifiedRollingSelector && !e.showingUnifiedRollingSelector && e.unifiedRollingSelector.classList.remove("drp-date-picker__unified-rolling-selector--visible");
|
|
1810
|
-
const x = e.monthDates[0], D = e.monthDates[e.monthDates.length - 1], _ = e.options.unifiedNavigationAnchorIndex ?? 0, R = e.monthDates[_];
|
|
1811
|
-
if (e.options.getUnifiedHeaderCallback) {
|
|
1812
|
-
const y = e.options.getUnifiedHeaderCallback({
|
|
1813
|
-
firstMonth: x,
|
|
1814
|
-
lastMonth: D,
|
|
1815
|
-
anchorMonth: R,
|
|
1816
|
-
monthNames: e.monthNames
|
|
1817
|
-
});
|
|
1818
|
-
e.unifiedRangeDisplay.textContent = y;
|
|
1819
|
-
} else {
|
|
1820
|
-
const y = e.monthNames[x.getMonth()], I = e.monthNames[D.getMonth()], S = x.getFullYear(), E = D.getFullYear();
|
|
1821
|
-
S === E ? e.unifiedRangeDisplay.textContent = `${y} ${S} - ${I} ${E}` : e.unifiedRangeDisplay.textContent = `${y} ${S} - ${I} ${E}`;
|
|
1838
|
+
async function Ht(e) {
|
|
1839
|
+
var a, t, n, r;
|
|
1840
|
+
if (e.options.beforeMonthChangedCallback) {
|
|
1841
|
+
if (e.isMonthChanging) {
|
|
1842
|
+
w.debug("handleInitialMonthLoad() - already changing month, skipping");
|
|
1843
|
+
return;
|
|
1822
1844
|
}
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1845
|
+
try {
|
|
1846
|
+
if (e.isMonthChanging = !0, e.options.unifiedNavigation) {
|
|
1847
|
+
const o = e.options.unifiedNavigationAnchorIndex ?? 0, i = e.monthDates[o], s = i.getFullYear(), d = i.getMonth();
|
|
1848
|
+
let l = 1 / 0, c = 1 / 0, u = -1 / 0, p = -1 / 0;
|
|
1849
|
+
for (let I = 0; I < e.monthDates.length; I++) {
|
|
1850
|
+
const S = e.monthDates[I], E = S.getFullYear(), T = S.getMonth();
|
|
1851
|
+
(E < l || E === l && T < c) && (l = E, c = T), (E > u || E === u && T > p) && (u = E, p = T);
|
|
1852
|
+
}
|
|
1853
|
+
const h = (new Date(l, c, 1).getDay() - e.weekStartDay + 7) % 7, v = new Date(l, c, 1 - h), m = new Date(u, p + 1, 0).getDate(), C = new Date(u, p, m).getDay(), x = (e.weekStartDay + 6 - C) % 7, D = new Date(u, p, m + x), _ = {
|
|
1854
|
+
year: s,
|
|
1855
|
+
month: d,
|
|
1856
|
+
monthIndex: o,
|
|
1857
|
+
firstVisibleDate: v,
|
|
1858
|
+
lastVisibleDate: D
|
|
1859
|
+
};
|
|
1860
|
+
w.debug(`handleInitialMonthLoad() [UNIFIED] - calling callback for ${s}-${d + 1}, range: ${v.toISOString().split("T")[0]} to ${D.toISOString().split("T")[0]}`);
|
|
1861
|
+
const R = e.options.beforeMonthChangedCallback(_), k = R instanceof Promise;
|
|
1862
|
+
k && Le(e);
|
|
1863
|
+
const y = await Promise.resolve(R);
|
|
1864
|
+
k && ae(e), w.debug(`handleInitialMonthLoad() [UNIFIED] - callback completed, metadata items: ${((a = y.metadata) == null ? void 0 : a.size) || 0}, monthHeaders: ${((t = y.monthHeaders) == null ? void 0 : t.size) || 0}`), y.metadata && (e.bulkMetadataCache = y.metadata, w.debug(`handleInitialMonthLoad() [UNIFIED] - bulk metadata cache updated with ${y.metadata.size} entries`)), y.monthHeaders && (e.monthHeadersCache = y.monthHeaders, w.debug(`handleInitialMonthLoad() [UNIFIED] - month headers cache updated with ${y.monthHeaders.size} entries`)), (y.metadata || y.monthHeaders) && e.renderCalendar();
|
|
1865
|
+
} else {
|
|
1866
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - calling callback for ${e.monthDates.length} months`);
|
|
1867
|
+
const o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1868
|
+
let s = !1;
|
|
1869
|
+
for (let d = 0; d < e.monthDates.length; d++) {
|
|
1870
|
+
const l = e.monthDates[d], c = l.getFullYear(), u = l.getMonth(), f = (new Date(c, u, 1).getDay() - e.weekStartDay + 7) % 7, h = new Date(c, u, 1 - f), v = new Date(h);
|
|
1871
|
+
v.setDate(h.getDate() + 41);
|
|
1872
|
+
const m = {
|
|
1873
|
+
year: c,
|
|
1874
|
+
month: u,
|
|
1875
|
+
monthIndex: d,
|
|
1876
|
+
firstVisibleDate: h,
|
|
1877
|
+
lastVisibleDate: v
|
|
1878
|
+
};
|
|
1879
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - calling callback for ${c}-${u + 1}, range: ${h.toISOString().split("T")[0]} to ${v.toISOString().split("T")[0]}`);
|
|
1880
|
+
const M = e.options.beforeMonthChangedCallback(m);
|
|
1881
|
+
M instanceof Promise && !s && (s = !0, Le(e));
|
|
1882
|
+
const x = await Promise.resolve(M);
|
|
1883
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - callback completed, metadata items: ${((n = x.metadata) == null ? void 0 : n.size) || 0}, monthHeaders: ${((r = x.monthHeaders) == null ? void 0 : r.size) || 0}`), x.metadata && x.metadata.forEach((D, _) => {
|
|
1884
|
+
o.set(_, D);
|
|
1885
|
+
}), x.monthHeaders && x.monthHeaders.forEach((D, _) => {
|
|
1886
|
+
i.set(_, D);
|
|
1887
|
+
});
|
|
1888
|
+
}
|
|
1889
|
+
s && ae(e), o.size > 0 && (e.bulkMetadataCache = o, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined metadata cache updated with ${o.size} entries`)), i.size > 0 && (e.monthHeadersCache = i, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined month headers cache updated with ${i.size} entries`)), (o.size > 0 || i.size > 0) && e.renderCalendar();
|
|
1890
|
+
}
|
|
1891
|
+
} catch (o) {
|
|
1892
|
+
ae(e), w.debug("handleInitialMonthLoad() - error in callback:", o), console.error("[DateRangePicker] Error in beforeMonthChangedCallback (initial load):", o);
|
|
1893
|
+
} finally {
|
|
1894
|
+
e.isMonthChanging = !1;
|
|
1829
1895
|
}
|
|
1830
1896
|
}
|
|
1831
|
-
const l = r.getFullYear(), c = r.getMonth(), u = c === 0 ? 11 : c - 1, p = c === 0 ? l - 1 : l, g = t.querySelector(".drp-date-picker__nav--prev");
|
|
1832
|
-
g && (U(e, p, u) ? (g.removeAttribute("disabled"), g.classList.remove("drp-date-picker__nav--disabled")) : (g.setAttribute("disabled", "true"), g.classList.add("drp-date-picker__nav--disabled")));
|
|
1833
|
-
const f = c === 11 ? 0 : c + 1, h = c === 11 ? l + 1 : l, v = t.querySelector(".drp-date-picker__nav--next");
|
|
1834
|
-
v && (U(e, h, f) ? (v.removeAttribute("disabled"), v.classList.remove("drp-date-picker__nav--disabled")) : (v.setAttribute("disabled", "true"), v.classList.add("drp-date-picker__nav--disabled")));
|
|
1835
|
-
const m = t.querySelector(".drp-date-picker__weekdays"), M = [
|
|
1836
|
-
...e.weekdayNames.slice(e.weekStartDay),
|
|
1837
|
-
...e.weekdayNames.slice(0, e.weekStartDay)
|
|
1838
|
-
];
|
|
1839
|
-
m && (m.innerHTML = M.map((x) => `<div class="drp-date-picker__weekday">${x}</div>`).join("")), Nt(e, a, r);
|
|
1840
1897
|
}
|
|
1841
|
-
function
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
isOtherMonth: !0
|
|
1856
|
-
});
|
|
1857
|
-
}
|
|
1858
|
-
for (let _ = 1; _ <= l; _++) {
|
|
1859
|
-
const R = new Date(o, i, _);
|
|
1860
|
-
m.push({
|
|
1861
|
-
date: R,
|
|
1862
|
-
year: o,
|
|
1863
|
-
month: i,
|
|
1864
|
-
day: _,
|
|
1865
|
-
isOtherMonth: !1
|
|
1866
|
-
});
|
|
1867
|
-
}
|
|
1868
|
-
const C = Math.ceil((d + l) / 7) * 7 - (d + l);
|
|
1869
|
-
for (let _ = 1; _ <= C; _++) {
|
|
1870
|
-
const R = new Date(h, v, _);
|
|
1871
|
-
m.push({
|
|
1872
|
-
date: R,
|
|
1873
|
-
year: h,
|
|
1874
|
-
month: v,
|
|
1875
|
-
day: _,
|
|
1876
|
-
isOtherMonth: !0
|
|
1877
|
-
});
|
|
1878
|
-
}
|
|
1879
|
-
const x = [];
|
|
1880
|
-
for (let _ = 0; _ < m.length; _ += 7)
|
|
1881
|
-
x.push(m.slice(_, _ + 7));
|
|
1882
|
-
let D = "";
|
|
1883
|
-
for (const _ of x) {
|
|
1884
|
-
const R = _.map((y) => {
|
|
1885
|
-
const I = e.getDateInfoInternal(y.date);
|
|
1886
|
-
let S = (I == null ? void 0 : I.badgeTooltip) || "";
|
|
1887
|
-
if (e.options.badgeTooltipCallback && (I != null && I.badgeText)) {
|
|
1888
|
-
const k = {
|
|
1889
|
-
date: y.date,
|
|
1890
|
-
dateString: be(y.date),
|
|
1891
|
-
dayNumber: y.day,
|
|
1892
|
-
isDisabled: e.isDateDisabledInternal(y.date),
|
|
1893
|
-
isSelected: !1,
|
|
1894
|
-
// Will be set below
|
|
1895
|
-
isStartDate: !1,
|
|
1896
|
-
isEndDate: !1,
|
|
1897
|
-
isInRange: !1,
|
|
1898
|
-
isToday: ut(y.date),
|
|
1899
|
-
isWeekend: y.date.getDay() === 0 || y.date.getDay() === 6,
|
|
1900
|
-
monthIndex: a,
|
|
1901
|
-
element: null,
|
|
1902
|
-
// Not available during string rendering
|
|
1903
|
-
picker: e
|
|
1904
|
-
}, A = e.options.badgeTooltipCallback(k);
|
|
1905
|
-
A !== null && (S = A);
|
|
1906
|
-
}
|
|
1907
|
-
return {
|
|
1908
|
-
text: (I == null ? void 0 : I.badgeText) || "",
|
|
1909
|
-
tooltip: S,
|
|
1910
|
-
class: (I == null ? void 0 : I.badgeClass) || ""
|
|
1911
|
-
};
|
|
1912
|
-
});
|
|
1913
|
-
if (R.some((y) => y.text)) {
|
|
1914
|
-
D += '<div class="drp-date-picker__badge-row">';
|
|
1915
|
-
for (const y of R)
|
|
1916
|
-
if (y.text) {
|
|
1917
|
-
const I = y.tooltip ? ` data-tooltip="${y.tooltip.replace(/"/g, """)}"` : "", S = y.class ? ` ${y.class}` : "";
|
|
1918
|
-
D += `<div class="drp-date-picker__badge-cell${S}"${I}>${y.text}</div>`;
|
|
1919
|
-
} else
|
|
1920
|
-
D += '<div class="drp-date-picker__badge-cell"></div>';
|
|
1921
|
-
D += "</div>";
|
|
1922
|
-
}
|
|
1923
|
-
D += '<div class="drp-date-picker__date-row">';
|
|
1924
|
-
for (const y of _) {
|
|
1925
|
-
const I = ["drp-date-picker__day"];
|
|
1926
|
-
y.isOtherMonth && I.push("drp-date-picker__day--other-month");
|
|
1927
|
-
const S = e.getDateInfoInternal(y.date), E = S && S.isDisabled !== void 0 ? S.isDisabled : e.isDateDisabledInternal(y.date);
|
|
1928
|
-
E && I.push("drp-date-picker__day--disabled"), S && S.dayClass && I.push(S.dayClass), e.isToday(y.date) && I.push("drp-date-picker__day--today");
|
|
1929
|
-
let k = !1;
|
|
1930
|
-
e.options.selectionMode === "single" ? k = e.isSameDay(y.date, e.selectedDate) : e.options.selectionMode === "multiple" && (k = e.selectedDates.some((q) => e.isSameDay(y.date, q))), k && I.push("drp-date-picker__day--selected");
|
|
1931
|
-
let A = !1, $ = !1, N = !1;
|
|
1932
|
-
if (e.options.selectionMode === "range")
|
|
1933
|
-
A = e.isSameDay(y.date, e.selectedStartDate), $ = e.isSameDay(y.date, e.selectedEndDate), N = e.isInRange(y.date), A && I.push("drp-date-picker__day--range-start"), $ && I.push("drp-date-picker__day--range-end"), N && (!E || e.options.highlightDisabledInRange) && I.push("drp-date-picker__day--in-range");
|
|
1934
|
-
else if (e.options.selectionMode === "multiple")
|
|
1935
|
-
for (const q of e.selectedRanges)
|
|
1936
|
-
e.isSameDay(y.date, q.start) && (A = !0, I.push("drp-date-picker__day--range-start")), e.isSameDay(y.date, q.end) && ($ = !0, I.push("drp-date-picker__day--range-end")), y.date >= q.start && y.date <= q.end && (N = !0, (!E || e.options.highlightDisabledInRange) && I.push("drp-date-picker__day--in-range"));
|
|
1937
|
-
const z = `${y.year}-${String(y.month + 1).padStart(2, "0")}-${String(y.day).padStart(2, "0")}`;
|
|
1938
|
-
let P = (S == null ? void 0 : S.dayTooltip) || "";
|
|
1939
|
-
if (e.options.dayTooltipCallback) {
|
|
1940
|
-
const q = {
|
|
1941
|
-
date: y.date,
|
|
1942
|
-
dateString: z,
|
|
1943
|
-
dayNumber: y.day,
|
|
1944
|
-
isDisabled: E,
|
|
1945
|
-
isSelected: k,
|
|
1946
|
-
isStartDate: A,
|
|
1947
|
-
isEndDate: $,
|
|
1948
|
-
isInRange: N,
|
|
1949
|
-
isToday: e.isToday(y.date),
|
|
1950
|
-
isWeekend: y.date.getDay() === 0 || y.date.getDay() === 6,
|
|
1951
|
-
monthIndex: a,
|
|
1952
|
-
element: null,
|
|
1953
|
-
// Not available during string rendering
|
|
1954
|
-
picker: e
|
|
1955
|
-
}, at = e.options.dayTooltipCallback(q);
|
|
1956
|
-
at !== null && (P = at);
|
|
1898
|
+
async function Q(e, a, t, n) {
|
|
1899
|
+
var r, o;
|
|
1900
|
+
if (!e.options.beforeMonthChangedCallback)
|
|
1901
|
+
return !0;
|
|
1902
|
+
if (e.isMonthChanging)
|
|
1903
|
+
return w.debug("handleBeforeMonthChange() - already changing month, ignoring"), !1;
|
|
1904
|
+
try {
|
|
1905
|
+
e.isMonthChanging = !0;
|
|
1906
|
+
let i, s;
|
|
1907
|
+
if (e.options.unifiedNavigation) {
|
|
1908
|
+
let p = 1 / 0, g = 1 / 0, f = -1 / 0, h = -1 / 0;
|
|
1909
|
+
for (let R = 0; R < e.monthDates.length; R++) {
|
|
1910
|
+
const k = e.monthDates[R], y = k.getFullYear(), I = k.getMonth();
|
|
1911
|
+
(y < p || y === p && I < g) && (p = y, g = I), (y > f || y === f && I > h) && (f = y, h = I);
|
|
1957
1912
|
}
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1913
|
+
const M = (new Date(p, g, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1914
|
+
i = new Date(p, g, 1 - M);
|
|
1915
|
+
const C = new Date(f, h + 1, 0).getDate(), D = new Date(f, h, C).getDay(), _ = (e.weekStartDay + 6 - D) % 7;
|
|
1916
|
+
s = new Date(f, h, C + _);
|
|
1917
|
+
} else {
|
|
1918
|
+
const f = (new Date(a, t, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1919
|
+
i = new Date(a, t, 1 - f), s = new Date(i), s.setDate(i.getDate() + 41);
|
|
1960
1920
|
}
|
|
1961
|
-
|
|
1921
|
+
const d = {
|
|
1922
|
+
year: a,
|
|
1923
|
+
month: t,
|
|
1924
|
+
monthIndex: n,
|
|
1925
|
+
firstVisibleDate: i,
|
|
1926
|
+
lastVisibleDate: s
|
|
1927
|
+
};
|
|
1928
|
+
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${i.toISOString().split("T")[0]} to ${s.toISOString().split("T")[0]}`);
|
|
1929
|
+
const l = e.options.beforeMonthChangedCallback(d), c = l instanceof Promise;
|
|
1930
|
+
c && Le(e);
|
|
1931
|
+
const u = await Promise.resolve(l);
|
|
1932
|
+
return c && ae(e), u.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${u.message || "no reason provided"}`), u.message && console.warn(`[DateRangePicker] Month navigation blocked: ${u.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((r = u.metadata) == null ? void 0 : r.size) || 0}, monthHeaders: ${((o = u.monthHeaders) == null ? void 0 : o.size) || 0}`), u.metadata ? e.bulkMetadataCache ? (u.metadata.forEach((p, g) => {
|
|
1933
|
+
e.bulkMetadataCache.set(g, p);
|
|
1934
|
+
}), w.debug(`handleBeforeMonthChange() - merged ${u.metadata.size} entries into cache (total: ${e.bulkMetadataCache.size})`)) : (e.bulkMetadataCache = u.metadata, w.debug(`handleBeforeMonthChange() - bulk metadata cache created with ${u.metadata.size} entries`)) : e.bulkMetadataCache = null, u.monthHeaders && (e.monthHeadersCache ? (u.monthHeaders.forEach((p, g) => {
|
|
1935
|
+
e.monthHeadersCache.set(g, p);
|
|
1936
|
+
}), w.debug(`handleBeforeMonthChange() - merged ${u.monthHeaders.size} entries into headers cache (total: ${e.monthHeadersCache.size})`)) : (e.monthHeadersCache = u.monthHeaders, w.debug(`handleBeforeMonthChange() - month headers cache created with ${u.monthHeaders.size} entries`))), !0);
|
|
1937
|
+
} catch (i) {
|
|
1938
|
+
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:", i), console.error("[DateRangePicker] Error in beforeMonthChangedCallback:", i), !1;
|
|
1939
|
+
} finally {
|
|
1940
|
+
e.isMonthChanging = !1;
|
|
1962
1941
|
}
|
|
1963
|
-
r && (r.innerHTML = D, fn(e, a, r));
|
|
1964
1942
|
}
|
|
1965
|
-
function
|
|
1966
|
-
|
|
1943
|
+
function gn(e, a) {
|
|
1944
|
+
e.showingRollingSelector[a] = !e.showingRollingSelector[a], e.renderCalendar();
|
|
1945
|
+
}
|
|
1946
|
+
async function hn(e, a, t) {
|
|
1947
|
+
const n = e.monthDates[t].getMonth();
|
|
1948
|
+
if (!await Q(e, a, n, t)) {
|
|
1949
|
+
w.debug(`selectYear() Col${t} - navigation blocked by callback`);
|
|
1967
1950
|
return;
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
const [d, l, c] = i.split("-"), u = new Date(parseInt(d), parseInt(l) - 1, parseInt(c)), p = o.querySelector(`slot[name="day-${i}"]`);
|
|
1972
|
-
if (p && p.assignedNodes().length > 0)
|
|
1973
|
-
return;
|
|
1974
|
-
const f = e.isDateDisabledInternal(u), h = e.isToday(u), v = u.getDay() === 0 || u.getDay() === 6, m = e.options.selectionMode === "single" && e.isSameDay(u, e.selectedDate), M = e.options.selectionMode === "range" && e.isSameDay(u, e.selectedStartDate), C = e.options.selectionMode === "range" && e.isSameDay(u, e.selectedEndDate), x = e.options.selectionMode === "range" && e.isInRange(u), D = {
|
|
1975
|
-
date: u,
|
|
1976
|
-
dateString: i,
|
|
1977
|
-
dayNumber: s,
|
|
1978
|
-
isDisabled: f,
|
|
1979
|
-
isSelected: m || M || C,
|
|
1980
|
-
isStartDate: M,
|
|
1981
|
-
isEndDate: C,
|
|
1982
|
-
isInRange: x,
|
|
1983
|
-
isToday: h,
|
|
1984
|
-
isWeekend: v,
|
|
1985
|
-
monthIndex: a,
|
|
1986
|
-
element: o,
|
|
1987
|
-
picker: e
|
|
1988
|
-
};
|
|
1989
|
-
if (e.options.renderDayCallback)
|
|
1990
|
-
try {
|
|
1991
|
-
const _ = e.options.renderDayCallback(D);
|
|
1992
|
-
_ != null && (typeof _ == "string" ? p && (p.innerHTML = _) : _ instanceof HTMLElement && p && (p.innerHTML = "", p.appendChild(_)));
|
|
1993
|
-
} catch (_) {
|
|
1994
|
-
console.error("[DatePicker] Error in renderDayCallback:", _);
|
|
1995
|
-
}
|
|
1996
|
-
else if (e.options.renderDayContentCallback)
|
|
1997
|
-
try {
|
|
1998
|
-
const _ = e.options.renderDayContentCallback(D);
|
|
1999
|
-
_ != null && (typeof _ == "string" ? p && (p.innerHTML += _) : _ instanceof HTMLElement && p && p.appendChild(_));
|
|
2000
|
-
} catch (_) {
|
|
2001
|
-
console.error("[DatePicker] Error in renderDayContentCallback:", _);
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
1951
|
+
}
|
|
1952
|
+
const o = e.monthDates[t].getFullYear();
|
|
1953
|
+
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${o} to ${a}`), ge(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
2004
1954
|
}
|
|
2005
|
-
function
|
|
2006
|
-
const
|
|
2007
|
-
if (!t)
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
1955
|
+
async function fn(e, a, t) {
|
|
1956
|
+
const n = e.monthDates[t].getFullYear();
|
|
1957
|
+
if (!await Q(e, n, a, t)) {
|
|
1958
|
+
w.debug(`selectMonth() Col${t} - navigation blocked by callback`);
|
|
1959
|
+
return;
|
|
1960
|
+
}
|
|
1961
|
+
const o = e.monthDates[t].getMonth();
|
|
1962
|
+
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${o + 1} to ${a + 1}`), ge(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1963
|
+
}
|
|
1964
|
+
function ge(e, a) {
|
|
1965
|
+
const t = e.monthDates[a];
|
|
1966
|
+
if (a < e.monthDates.length - 1) {
|
|
1967
|
+
const n = e.monthDates[a + 1];
|
|
1968
|
+
if ($e(t, n)) {
|
|
1969
|
+
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a + 1}, shifting forward`);
|
|
1970
|
+
const r = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
1971
|
+
e.monthDates[a + 1] = r, ge(e, a + 1);
|
|
1972
|
+
}
|
|
2015
1973
|
}
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
p += `<div class="drp-date-picker__rolling-item ${h} ${m}" data-month="${g}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${f}</span></div>`;
|
|
1974
|
+
if (a > 0) {
|
|
1975
|
+
const n = e.monthDates[a - 1];
|
|
1976
|
+
if ($e(n, t)) {
|
|
1977
|
+
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a - 1}, shifting backward`);
|
|
1978
|
+
const r = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
1979
|
+
e.monthDates[a - 1] = r, ge(e, a - 1);
|
|
2023
1980
|
}
|
|
2024
|
-
u.innerHTML = p;
|
|
2025
1981
|
}
|
|
2026
1982
|
}
|
|
2027
|
-
function
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
1983
|
+
function $e(e, a) {
|
|
1984
|
+
const t = e.getFullYear(), n = e.getMonth(), r = a.getFullYear(), o = a.getMonth();
|
|
1985
|
+
return t > r || t === r && n >= o;
|
|
1986
|
+
}
|
|
1987
|
+
async function ye(e, a) {
|
|
1988
|
+
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
1989
|
+
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
1990
|
+
const n = e.monthDates[t], r = new Date(n.getFullYear(), n.getMonth() - 1, 1);
|
|
1991
|
+
if (!U(e, r.getFullYear(), r.getMonth())) {
|
|
1992
|
+
w.debug(`prevMonth() Col${t} - navigation blocked: target month has no enabled days`);
|
|
1993
|
+
return;
|
|
2035
1994
|
}
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
}
|
|
2044
|
-
l.innerHTML = c;
|
|
1995
|
+
if (!await Q(e, r.getFullYear(), r.getMonth(), t)) {
|
|
1996
|
+
w.debug(`prevMonth() Col${t} - navigation blocked by callback`);
|
|
1997
|
+
return;
|
|
1998
|
+
}
|
|
1999
|
+
if (e.monthDates[t] = r, w.debug(`prevMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${r.getFullYear()}-${r.getMonth() + 1}`), t > 0) {
|
|
2000
|
+
const i = e.monthDates[t - 1];
|
|
2001
|
+
$e(i, r) && (w.debug(`prevMonth() Col${t} - collision detected with Col${t - 1}, shifting previous columns back`), await ye(e, t - 1));
|
|
2045
2002
|
}
|
|
2003
|
+
e.renderCalendar();
|
|
2046
2004
|
}
|
|
2047
|
-
function
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
e.selectedEndDate
|
|
2065
|
-
), r = e.getDisabledDatesInRange(
|
|
2066
|
-
e.selectedStartDate,
|
|
2067
|
-
e.selectedEndDate
|
|
2068
|
-
);
|
|
2069
|
-
const d = 1e3 * 60 * 60 * 24, l = e.selectedEndDate.getTime() - e.selectedStartDate.getTime();
|
|
2070
|
-
t = Math.floor(l / d) + 1;
|
|
2071
|
-
} else {
|
|
2072
|
-
const l = e.selectedEndDate.getTime() - e.selectedStartDate.getTime();
|
|
2073
|
-
t = Math.floor(l / 864e5) + 1;
|
|
2074
|
-
}
|
|
2075
|
-
const s = t > 0 ? t - 1 : 0;
|
|
2076
|
-
if (a.className = "drp-date-picker__summary drp-date-picker__summary--visible", e.options.formatSummaryCallback) {
|
|
2077
|
-
const d = {
|
|
2078
|
-
days: t,
|
|
2079
|
-
nights: s,
|
|
2080
|
-
startDate: e.selectedStartDate,
|
|
2081
|
-
endDate: e.selectedEndDate,
|
|
2082
|
-
selectionMode: e.options.selectionMode,
|
|
2083
|
-
disabledDatesHandling: e.options.disabledDatesHandling,
|
|
2084
|
-
localeStrings: e.localeStrings,
|
|
2085
|
-
isPreview: !1
|
|
2086
|
-
};
|
|
2087
|
-
n && (d.enabledDates = n), r && (d.disabledDates = r), o && (d.dates = o), i && (d.dateRanges = i), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2088
|
-
} else
|
|
2089
|
-
a.innerHTML = `
|
|
2090
|
-
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
2091
|
-
<span>, </span>
|
|
2092
|
-
<span class="drp-date-picker__summary-count">${s} ${s === 1 ? e.localeStrings.night : e.localeStrings.nights}</span>
|
|
2093
|
-
`;
|
|
2094
|
-
} else
|
|
2095
|
-
a.className = "drp-date-picker__summary drp-date-picker__summary--hidden", a.innerHTML = "";
|
|
2005
|
+
async function ve(e, a) {
|
|
2006
|
+
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
2007
|
+
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
2008
|
+
const n = e.monthDates[t], r = new Date(n.getFullYear(), n.getMonth() + 1, 1);
|
|
2009
|
+
if (!U(e, r.getFullYear(), r.getMonth())) {
|
|
2010
|
+
w.debug(`nextMonth() Col${t} - navigation blocked: target month has no enabled days`);
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
if (!await Q(e, r.getFullYear(), r.getMonth(), t)) {
|
|
2014
|
+
w.debug(`nextMonth() Col${t} - navigation blocked by callback`);
|
|
2015
|
+
return;
|
|
2016
|
+
}
|
|
2017
|
+
if (e.monthDates[t] = r, w.debug(`nextMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${r.getFullYear()}-${r.getMonth() + 1}`), t < e.monthDates.length - 1) {
|
|
2018
|
+
const i = e.monthDates[t + 1];
|
|
2019
|
+
$e(r, i) && (w.debug(`nextMonth() Col${t} - collision detected with Col${t + 1}, shifting next columns forward`), await ve(e, t + 1));
|
|
2020
|
+
}
|
|
2021
|
+
e.renderCalendar();
|
|
2096
2022
|
}
|
|
2097
|
-
function
|
|
2098
|
-
|
|
2099
|
-
const
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
e.
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
e.dragPreviewEnd
|
|
2109
|
-
));
|
|
2110
|
-
else if (e.options.disabledDatesHandling === "allow") {
|
|
2111
|
-
n = e.getEnabledDatesInRange(
|
|
2112
|
-
e.dragPreviewStart,
|
|
2113
|
-
e.dragPreviewEnd
|
|
2114
|
-
), r = e.getDisabledDatesInRange(
|
|
2115
|
-
e.dragPreviewStart,
|
|
2116
|
-
e.dragPreviewEnd
|
|
2117
|
-
);
|
|
2118
|
-
const d = 1e3 * 60 * 60 * 24, l = e.dragPreviewEnd.getTime() - e.dragPreviewStart.getTime();
|
|
2119
|
-
t = Math.floor(l / d) + 1;
|
|
2120
|
-
} else {
|
|
2121
|
-
const l = e.dragPreviewEnd.getTime() - e.dragPreviewStart.getTime();
|
|
2122
|
-
t = Math.floor(l / 864e5) + 1;
|
|
2023
|
+
function me(e, a, t, n, r) {
|
|
2024
|
+
let o = a, i = 0;
|
|
2025
|
+
const s = 60;
|
|
2026
|
+
for (; i < s; ) {
|
|
2027
|
+
if (o >= 0 && o < n.length) {
|
|
2028
|
+
const l = n[o].dataset.date;
|
|
2029
|
+
if (l) {
|
|
2030
|
+
const [c, u, p] = l.split("-").map(Number), g = new Date(c, u - 1, p);
|
|
2031
|
+
if (!e.isDateDisabledInternal(g))
|
|
2032
|
+
return { index: o, monthChanged: !1 };
|
|
2033
|
+
}
|
|
2123
2034
|
}
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
const d = {
|
|
2127
|
-
days: t,
|
|
2128
|
-
nights: s,
|
|
2129
|
-
startDate: e.dragPreviewStart,
|
|
2130
|
-
endDate: e.dragPreviewEnd,
|
|
2131
|
-
selectionMode: e.options.selectionMode,
|
|
2132
|
-
disabledDatesHandling: e.options.disabledDatesHandling,
|
|
2133
|
-
localeStrings: e.localeStrings,
|
|
2134
|
-
isPreview: !0
|
|
2135
|
-
};
|
|
2136
|
-
n && (d.enabledDates = n), r && (d.disabledDates = r), o && (d.dates = o), i && (d.dateRanges = i), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2137
|
-
} else
|
|
2138
|
-
a.innerHTML = `
|
|
2139
|
-
<span style="opacity: 0.7;">${e.localeStrings.preview}: </span>
|
|
2140
|
-
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
2141
|
-
<span>, </span>
|
|
2142
|
-
<span class="drp-date-picker__summary-count">${s} ${s === 1 ? e.localeStrings.night : e.localeStrings.nights}</span>
|
|
2143
|
-
`;
|
|
2035
|
+
if (o += t, i++, o < 0 || o >= n.length)
|
|
2036
|
+
return { index: null, monthChanged: !0, direction: t > 0 ? "next" : "prev" };
|
|
2144
2037
|
}
|
|
2038
|
+
return { index: null, monthChanged: !1 };
|
|
2145
2039
|
}
|
|
2146
|
-
function
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2040
|
+
function mn(e, a) {
|
|
2041
|
+
var i, s, d, l;
|
|
2042
|
+
w.debug(`moveFocus(${a}) Col${e.activeMonthIndex} - focusedDayIndex:`, e.focusedDayIndex);
|
|
2043
|
+
const t = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
2044
|
+
if (!t) {
|
|
2045
|
+
w.debug(`moveFocus() Col${e.activeMonthIndex} - ERROR: daysContainer not found!`);
|
|
2046
|
+
return;
|
|
2047
|
+
}
|
|
2048
|
+
const n = t.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
2049
|
+
if (w.debug(`moveFocus() Col${e.activeMonthIndex} - found ${n.length} days in column`), n.length === 0) return;
|
|
2050
|
+
if (e.focusedDayIndex === null) {
|
|
2051
|
+
const c = Array.from(n).findIndex((u) => u.classList.contains("drp-date-picker__day--today"));
|
|
2052
|
+
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}`);
|
|
2053
|
+
}
|
|
2054
|
+
(i = n[e.focusedDayIndex]) == null || i.classList.remove("drp-date-picker__day--focused");
|
|
2055
|
+
const r = e.focusedDayIndex + a;
|
|
2056
|
+
if (r < 0) {
|
|
2057
|
+
const c = e.activeMonthIndex;
|
|
2058
|
+
if (a === -1)
|
|
2059
|
+
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`), ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
2060
|
+
var f, h;
|
|
2061
|
+
const u = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2062
|
+
if (!u) return;
|
|
2063
|
+
const p = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = me(e, p.length - 1, -1, p);
|
|
2064
|
+
g.index !== null && (e.focusedDayIndex = g.index, (f = p[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = p[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
2065
|
+
}, 0);
|
|
2066
|
+
else {
|
|
2067
|
+
const p = n[e.focusedDayIndex].dataset.date;
|
|
2068
|
+
if (p) {
|
|
2069
|
+
const [g, f, h] = p.split("-").map(Number), m = new Date(g, f - 1, h).getDay();
|
|
2070
|
+
w.debug(`moveFocus() Col${c} - edge navigation UP: current day ${h} is weekday ${m}, going to prev month`), ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
2071
|
+
var _, R;
|
|
2072
|
+
const M = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2073
|
+
if (!M) return;
|
|
2074
|
+
const C = M.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), D = C[C.length - 1].dataset.date;
|
|
2075
|
+
if (D) {
|
|
2076
|
+
const [k, y, I] = D.split("-").map(Number), E = new Date(k, y - 1, I).getDay(), T = (E - m + 7) % 7;
|
|
2077
|
+
e.focusedDayIndex = C.length - 1 - T, w.debug(`moveFocus() Col${c} - last day weekday ${E}, target ${m}, focusing on day ${e.focusedDayIndex + 1}`), (_ = C[e.focusedDayIndex]) == null || _.classList.add("drp-date-picker__day--focused"), (R = C[e.focusedDayIndex]) == null || R.scrollIntoView({ block: "nearest" });
|
|
2078
|
+
}
|
|
2079
|
+
}, 0);
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
return;
|
|
2083
|
+
} else if (r >= n.length) {
|
|
2084
|
+
const c = e.activeMonthIndex;
|
|
2085
|
+
if (a === 1)
|
|
2086
|
+
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`), ve(e, e.activeMonthIndex), setTimeout(() => {
|
|
2087
|
+
var f, h;
|
|
2088
|
+
const u = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2089
|
+
if (!u) return;
|
|
2090
|
+
const p = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = me(e, 0, 1, p);
|
|
2091
|
+
g.index !== null && (e.focusedDayIndex = g.index, (f = p[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = p[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
2092
|
+
}, 0);
|
|
2093
|
+
else {
|
|
2094
|
+
const p = n[e.focusedDayIndex].dataset.date;
|
|
2095
|
+
if (p) {
|
|
2096
|
+
const [g, f, h] = p.split("-").map(Number), m = new Date(g, f - 1, h).getDay();
|
|
2097
|
+
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${h} is weekday ${m}, going to next month`), ve(e, e.activeMonthIndex), setTimeout(() => {
|
|
2098
|
+
var _, R;
|
|
2099
|
+
const M = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2100
|
+
if (!M) return;
|
|
2101
|
+
const C = M.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), D = C[0].dataset.date;
|
|
2102
|
+
if (D) {
|
|
2103
|
+
const [k, y, I] = D.split("-").map(Number), E = new Date(k, y - 1, I).getDay(), T = (m - E + 7) % 7;
|
|
2104
|
+
e.focusedDayIndex = T, w.debug(`moveFocus() Col${c} - first day weekday ${E}, target ${m}, focusing on day ${e.focusedDayIndex + 1}`), (_ = C[e.focusedDayIndex]) == null || _.classList.add("drp-date-picker__day--focused"), (R = C[e.focusedDayIndex]) == null || R.scrollIntoView({ block: "nearest" });
|
|
2105
|
+
}
|
|
2106
|
+
}, 0);
|
|
2107
|
+
}
|
|
2180
2108
|
}
|
|
2181
|
-
|
|
2182
|
-
return ae(e), e.isValidating = !1, O.error("beforeDateSelectCallback error:", t), { isValid: !1, message: "Validation error occurred" };
|
|
2109
|
+
return;
|
|
2183
2110
|
}
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2111
|
+
const o = me(e, r, a, n, e.activeMonthIndex);
|
|
2112
|
+
if (o.monthChanged) {
|
|
2113
|
+
const c = e.activeMonthIndex;
|
|
2114
|
+
o.direction === "next" ? ve(e, e.activeMonthIndex) : ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
2115
|
+
var f, h;
|
|
2116
|
+
const u = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2117
|
+
if (!u) return;
|
|
2118
|
+
const p = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = me(
|
|
2119
|
+
e,
|
|
2120
|
+
o.direction === "next" ? 0 : p.length - 1,
|
|
2121
|
+
a,
|
|
2122
|
+
p
|
|
2123
|
+
);
|
|
2124
|
+
g.index !== null && (e.focusedDayIndex = g.index, (f = p[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = p[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
2125
|
+
}, 0);
|
|
2126
|
+
return;
|
|
2193
2127
|
}
|
|
2194
|
-
|
|
2195
|
-
return n.isValid ? n.adjustedStart || n.adjustedEnd ? {
|
|
2196
|
-
isValid: !0,
|
|
2197
|
-
adjustedStart: n.adjustedStart,
|
|
2198
|
-
adjustedEnd: n.adjustedEnd,
|
|
2199
|
-
message: n.message
|
|
2200
|
-
} : { isValid: !0 } : n;
|
|
2128
|
+
o.index !== null ? (e.focusedDayIndex = o.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"));
|
|
2201
2129
|
}
|
|
2202
|
-
async function
|
|
2203
|
-
if (
|
|
2204
|
-
|
|
2205
|
-
|
|
2130
|
+
async function bn(e) {
|
|
2131
|
+
if (!e.options.unifiedNavigation) return;
|
|
2132
|
+
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
2133
|
+
if (w.debug(`unifiedNextMonth() - anchor index: ${a}, current: ${t.getFullYear()}-${t.getMonth() + 1}, new: ${n.getFullYear()}-${n.getMonth() + 1}`), !U(e, n.getFullYear(), n.getMonth())) {
|
|
2134
|
+
w.debug("unifiedNextMonth() - navigation blocked: target month has no enabled days");
|
|
2206
2135
|
return;
|
|
2207
2136
|
}
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
e.activeMonthIndex = parseInt(i.dataset.monthIndex || "0") || 0, ie.debug(`Col${e.activeMonthIndex} selectDay - activeMonthIndex:`, e.activeMonthIndex);
|
|
2213
|
-
const s = i.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
2214
|
-
e.focusedDayIndex = Array.from(s).indexOf(a), ie.debug(`Col${e.activeMonthIndex} selectDay - set focusedDayIndex to:`, e.focusedDayIndex);
|
|
2215
|
-
}
|
|
2216
|
-
if (e.options.selectionMode === "single") {
|
|
2217
|
-
const s = await Ot(e, o);
|
|
2218
|
-
if (!s.isValid) {
|
|
2219
|
-
ie.debug("Single mode selection prevented by beforeDateSelectCallback");
|
|
2220
|
-
return;
|
|
2221
|
-
}
|
|
2222
|
-
const d = s.adjustedDate || o;
|
|
2223
|
-
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();
|
|
2224
|
-
} else if (e.options.selectionMode === "multiple") {
|
|
2225
|
-
const s = `${o.getFullYear()}-${String(o.getMonth() + 1).padStart(2, "0")}-${String(o.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);
|
|
2226
|
-
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(o)), e.input && !e.requiresApplyButton()) {
|
|
2227
|
-
const l = e.selectedDates.length + e.selectedRanges.length;
|
|
2228
|
-
e.input.value = l > 0 ? `${l} selection(s)` : "";
|
|
2229
|
-
}
|
|
2230
|
-
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;
|
|
2231
|
-
} else if (!e.selectedStartDate || e.selectedEndDate)
|
|
2232
|
-
e.selectedStartDate = o, e.selectedEndDate = null, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ...`));
|
|
2233
|
-
else {
|
|
2234
|
-
let s = e.selectedStartDate, d = o;
|
|
2235
|
-
o < e.selectedStartDate && (d = e.selectedStartDate, s = o), ie.debug(" selectDay - calling validateRangeAsync with:", s, d);
|
|
2236
|
-
const l = await Yt(e, s, d);
|
|
2237
|
-
if (ie.debug(" selectDay - validation result:", l), !l.isValid) {
|
|
2238
|
-
l.message && O.warn("selectDay() - range validation failed:", l.message), e.renderCalendar(), e.updateSummary();
|
|
2239
|
-
return;
|
|
2137
|
+
if (await Q(e, n.getFullYear(), n.getMonth(), a)) {
|
|
2138
|
+
for (let o = 0; o < e.monthDates.length; o++) {
|
|
2139
|
+
const i = o - a;
|
|
2140
|
+
e.monthDates[o] = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
2240
2141
|
}
|
|
2241
|
-
e.
|
|
2242
|
-
const c = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
2243
|
-
e.requiresApplyButton() ? e.pendingSelection = c : e.options.onSelect && e.options.onSelect(c), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
2142
|
+
e.renderCalendar();
|
|
2244
2143
|
}
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
return e.isSameDay(M, s);
|
|
2258
|
-
});
|
|
2259
|
-
p !== -1 && (e.focusedDayIndex = p, u.forEach((g) => g.classList.remove("drp-date-picker__day--focused")), u[p] && u[p].classList.add("drp-date-picker__day--focused"));
|
|
2260
|
-
}
|
|
2261
|
-
break;
|
|
2262
|
-
}
|
|
2144
|
+
}
|
|
2145
|
+
async function yn(e) {
|
|
2146
|
+
if (!e.options.unifiedNavigation) return;
|
|
2147
|
+
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
2148
|
+
if (w.debug(`unifiedPrevMonth() - anchor index: ${a}, current: ${t.getFullYear()}-${t.getMonth() + 1}, new: ${n.getFullYear()}-${n.getMonth() + 1}`), !U(e, n.getFullYear(), n.getMonth())) {
|
|
2149
|
+
w.debug("unifiedPrevMonth() - navigation blocked: target month has no enabled days");
|
|
2150
|
+
return;
|
|
2151
|
+
}
|
|
2152
|
+
if (await Q(e, n.getFullYear(), n.getMonth(), a)) {
|
|
2153
|
+
for (let o = 0; o < e.monthDates.length; o++) {
|
|
2154
|
+
const i = o - a;
|
|
2155
|
+
e.monthDates[o] = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
2263
2156
|
}
|
|
2157
|
+
e.renderCalendar();
|
|
2264
2158
|
}
|
|
2265
2159
|
}
|
|
2266
|
-
function
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
if (e.pendingSelection) {
|
|
2274
|
-
if (e.input) {
|
|
2275
|
-
if (e.options.selectionMode === "range")
|
|
2276
|
-
e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`;
|
|
2277
|
-
else if (e.options.selectionMode === "single")
|
|
2278
|
-
e.input.value = e.formatDate(e.selectedDate);
|
|
2279
|
-
else if (e.options.selectionMode === "multiple") {
|
|
2280
|
-
const a = e.selectedDates.length + e.selectedRanges.length;
|
|
2281
|
-
e.input.value = a > 0 ? `${a} selection(s)` : "";
|
|
2282
|
-
}
|
|
2160
|
+
async function vn(e, a) {
|
|
2161
|
+
if (!e.options.unifiedNavigation) return;
|
|
2162
|
+
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getFullYear();
|
|
2163
|
+
if (w.debug(`setUnifiedMonth(${a}) - anchor index: ${t}, year: ${n}`), !!await Q(e, n, a, t)) {
|
|
2164
|
+
for (let o = 0; o < e.monthDates.length; o++) {
|
|
2165
|
+
const i = o - t;
|
|
2166
|
+
e.monthDates[o] = new Date(n, a + i, 1);
|
|
2283
2167
|
}
|
|
2284
|
-
e.
|
|
2168
|
+
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
2285
2169
|
}
|
|
2286
|
-
e.options.autoClose !== "never" && e.options.positioningMode === "floating" && e.hide();
|
|
2287
2170
|
}
|
|
2288
|
-
function
|
|
2289
|
-
e.options.
|
|
2290
|
-
t.addEventListener("mousedown", (n) => {
|
|
2291
|
-
const r = n, o = t, i = r.clientX, s = r.clientY, d = 5;
|
|
2292
|
-
let l = !1, c = !1;
|
|
2293
|
-
const u = o.classList.contains("drp-date-picker__day--range-start"), p = o.classList.contains("drp-date-picker__day--range-end");
|
|
2294
|
-
let g;
|
|
2295
|
-
u && e.selectedStartDate && e.selectedEndDate ? g = "start" : p && e.selectedStartDate && e.selectedEndDate ? g = "end" : g = "start";
|
|
2296
|
-
const f = (v) => {
|
|
2297
|
-
const m = Math.abs(v.clientX - i), M = Math.abs(v.clientY - s);
|
|
2298
|
-
!l && (m > d || M > d) && (l = !0), l && !c && (c = !0, Bt(e, r, g, o), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h));
|
|
2299
|
-
}, h = () => {
|
|
2300
|
-
document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h);
|
|
2301
|
-
};
|
|
2302
|
-
document.addEventListener("mousemove", f), document.addEventListener("mouseup", h);
|
|
2303
|
-
});
|
|
2304
|
-
});
|
|
2171
|
+
function Dn(e) {
|
|
2172
|
+
e.options.unifiedNavigation && (e.showingUnifiedRollingSelector = !e.showingUnifiedRollingSelector, w.debug(`toggleUnifiedRollingSelector() - now ${e.showingUnifiedRollingSelector ? "visible" : "hidden"}`), e.renderCalendar());
|
|
2305
2173
|
}
|
|
2306
|
-
function
|
|
2307
|
-
|
|
2308
|
-
const
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2174
|
+
async function _n(e, a) {
|
|
2175
|
+
if (!e.options.unifiedNavigation) return;
|
|
2176
|
+
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getMonth();
|
|
2177
|
+
if (w.debug(`setUnifiedYear(${a}) - anchor index: ${t}, month: ${n}`), !!await Q(e, a, n, t)) {
|
|
2178
|
+
for (let o = 0; o < e.monthDates.length; o++) {
|
|
2179
|
+
const i = o - t;
|
|
2180
|
+
e.monthDates[o] = new Date(a, n + i, 1);
|
|
2181
|
+
}
|
|
2182
|
+
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
2313
2183
|
}
|
|
2314
|
-
!e.selectedStartDate && !e.selectedEndDate ? i && (e.originalStartDate = i, e.originalEndDate = null, e.draggingType = "end") : i && e.selectedStartDate && !e.selectedEndDate ? i.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) => {
|
|
2315
|
-
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");
|
|
2316
|
-
}), e.originalStartDate = i, e.originalEndDate = null, e.draggingType = "end") : (e.selectedStartDate && (e.originalStartDate = new Date(e.selectedStartDate)), e.selectedEndDate && (e.originalEndDate = new Date(e.selectedEndDate))), r.classList.add("drp-date-picker__day--dragging"), ee.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";
|
|
2317
2184
|
}
|
|
2318
|
-
function
|
|
2319
|
-
if (!e
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
if (n || r) {
|
|
2324
|
-
if (!e.navInterval) {
|
|
2325
|
-
const p = (n || r).closest(".drp-date-picker__month");
|
|
2326
|
-
if (p && p instanceof HTMLElement) {
|
|
2327
|
-
const g = parseInt(p.dataset.monthIndex || "0"), f = !!n;
|
|
2328
|
-
f ? e.prevMonth(g) : e.nextMonth(g), e.navInterval = window.setInterval(() => {
|
|
2329
|
-
f ? e.prevMonth(g) : e.nextMonth(g);
|
|
2330
|
-
}, 1e3);
|
|
2331
|
-
}
|
|
2185
|
+
function Ot(e, a, t) {
|
|
2186
|
+
if (!e) {
|
|
2187
|
+
if (t != null && t.normalizedMinDate || t != null && t.normalizedMaxDate) {
|
|
2188
|
+
const n = t.normalizedMinDate ? t.normalizedMinDate.getFullYear() : a - 1, r = t.normalizedMaxDate ? t.normalizedMaxDate.getFullYear() : a + 1;
|
|
2189
|
+
return { min: n, max: r };
|
|
2332
2190
|
}
|
|
2333
|
-
return;
|
|
2334
|
-
} else
|
|
2335
|
-
e.navInterval && (clearInterval(e.navInterval), e.navInterval = null);
|
|
2336
|
-
const o = t;
|
|
2337
|
-
if (!o || !o.classList.contains("drp-date-picker__day")) return;
|
|
2338
|
-
const i = o.dataset.date;
|
|
2339
|
-
if (!i) return;
|
|
2340
|
-
const [s, d, l] = i.split("-").map(Number);
|
|
2341
|
-
let c = new Date(s, d - 1, l);
|
|
2342
|
-
if (o.classList.contains("drp-date-picker__day--disabled")) {
|
|
2343
|
-
const u = e.draggingType === "start" ? e.originalEndDate && c > e.originalEndDate ? "backward" : "forward" : e.originalStartDate && c < e.originalStartDate ? "forward" : "backward";
|
|
2344
|
-
c = $e(e, c, u);
|
|
2191
|
+
return { min: a - 1, max: a + 1 };
|
|
2345
2192
|
}
|
|
2346
|
-
if (e.
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
}
|
|
2193
|
+
if (e.includes("-")) {
|
|
2194
|
+
const [n, r] = e.split("-");
|
|
2195
|
+
return { min: parseInt(n, 10), max: parseInt(r, 10) };
|
|
2196
|
+
} else {
|
|
2197
|
+
const n = parseInt(e, 10);
|
|
2198
|
+
return { min: n, max: n };
|
|
2352
2199
|
}
|
|
2353
|
-
e.updateDragPreview();
|
|
2354
2200
|
}
|
|
2355
|
-
|
|
2356
|
-
if (e
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
t.classList.remove("drp-date-picker__day--dragging");
|
|
2371
|
-
}), 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) {
|
|
2372
|
-
const t = e.selectedEndDate;
|
|
2373
|
-
for (let n = 0; n < e.monthDates.length; n++) {
|
|
2374
|
-
const r = e.monthDates[n];
|
|
2375
|
-
if (t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth()) {
|
|
2376
|
-
e.activeMonthIndex = n;
|
|
2377
|
-
const o = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${n}"]`);
|
|
2378
|
-
if (o) {
|
|
2379
|
-
const i = o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), s = Array.from(i).findIndex((d) => {
|
|
2380
|
-
const l = d.dataset.date;
|
|
2381
|
-
if (!l) return !1;
|
|
2382
|
-
const [c, u, p] = l.split("-").map(Number), g = new Date(c, u - 1, p);
|
|
2383
|
-
return e.isSameDay(g, t);
|
|
2384
|
-
});
|
|
2385
|
-
s !== -1 && (e.focusedDayIndex = s, i.forEach((d) => d.classList.remove("drp-date-picker__day--focused")), i[s] && i[s].classList.add("drp-date-picker__day--focused"));
|
|
2386
|
-
}
|
|
2387
|
-
break;
|
|
2388
|
-
}
|
|
2389
|
-
}
|
|
2201
|
+
function Yt(e) {
|
|
2202
|
+
if (!e)
|
|
2203
|
+
return { min: 1, max: 12 };
|
|
2204
|
+
const [a, t] = e.split("-");
|
|
2205
|
+
return { min: parseInt(a, 10), max: parseInt(t, 10) };
|
|
2206
|
+
}
|
|
2207
|
+
function wn(e) {
|
|
2208
|
+
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);
|
|
2209
|
+
for (let a = 0; a < e.options.visibleMonthsCount; a++)
|
|
2210
|
+
e.showingRollingSelector[a] ? qt(e, a) : Bt(e, a);
|
|
2211
|
+
if (e.focusedDayIndex !== null) {
|
|
2212
|
+
const a = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
2213
|
+
if (a) {
|
|
2214
|
+
const t = a.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
2215
|
+
t[e.focusedDayIndex] && t[e.focusedDayIndex].classList.add("drp-date-picker__day--focused");
|
|
2390
2216
|
}
|
|
2391
|
-
e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
2392
2217
|
}
|
|
2218
|
+
e.options.selectionMode === "range" && !e.isDragging && e.initDragListeners(), e.actionsContainer && e.renderButtons(e.actionsContainer);
|
|
2393
2219
|
}
|
|
2394
|
-
function
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2220
|
+
function Bt(e, a) {
|
|
2221
|
+
var C;
|
|
2222
|
+
de.debug(`[DatePicker Col${a} 19] renderNormalView called for month`, a);
|
|
2223
|
+
const t = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
2224
|
+
if (!t) return;
|
|
2225
|
+
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
2226
|
+
n == null || n.classList.remove("drp-date-picker__rolling-selector--visible");
|
|
2227
|
+
const r = e.monthDates[a], o = r.getFullYear(), i = r.getMonth(), s = e.monthNames[i], d = t.querySelector(".drp-date-picker__month-year");
|
|
2228
|
+
if (d) {
|
|
2229
|
+
const x = `${o}-${String(i + 1).padStart(2, "0")}`;
|
|
2230
|
+
let D;
|
|
2231
|
+
(C = e.monthHeadersCache) != null && C.has(x) ? D = e.monthHeadersCache.get(x) : e.options.getMonthHeaderCallback ? D = e.options.getMonthHeaderCallback({
|
|
2232
|
+
month: r,
|
|
2233
|
+
monthIndex: a,
|
|
2234
|
+
monthName: s,
|
|
2235
|
+
year: o
|
|
2236
|
+
}) : D = `${s} ${o}`, d.textContent = D;
|
|
2409
2237
|
}
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
r >= u && r <= u + 4 ? c = u + 4 : c = r + (l.length - n.length);
|
|
2425
|
-
} else
|
|
2426
|
-
c = r + (l.length - n.length);
|
|
2427
|
-
t.setSelectionRange(c, c);
|
|
2238
|
+
if (e.options.unifiedNavigation && a === 0 && e.unifiedRangeDisplay) {
|
|
2239
|
+
e.unifiedRollingSelector && !e.showingUnifiedRollingSelector && e.unifiedRollingSelector.classList.remove("drp-date-picker__unified-rolling-selector--visible");
|
|
2240
|
+
const x = e.monthDates[0], D = e.monthDates[e.monthDates.length - 1], _ = e.options.unifiedNavigationAnchorIndex ?? 0, R = e.monthDates[_];
|
|
2241
|
+
if (e.options.getUnifiedHeaderCallback) {
|
|
2242
|
+
const y = e.options.getUnifiedHeaderCallback({
|
|
2243
|
+
firstMonth: x,
|
|
2244
|
+
lastMonth: D,
|
|
2245
|
+
anchorMonth: R,
|
|
2246
|
+
monthNames: e.monthNames
|
|
2247
|
+
});
|
|
2248
|
+
e.unifiedRangeDisplay.textContent = y;
|
|
2249
|
+
} else {
|
|
2250
|
+
const y = e.monthNames[x.getMonth()], I = e.monthNames[D.getMonth()], S = x.getFullYear(), E = D.getFullYear();
|
|
2251
|
+
S === E ? e.unifiedRangeDisplay.textContent = `${y} ${S} - ${I} ${E}` : e.unifiedRangeDisplay.textContent = `${y} ${S} - ${I} ${E}`;
|
|
2428
2252
|
}
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
c = r;
|
|
2436
|
-
else if (l.length > n.length && l[r] === s)
|
|
2437
|
-
c = r + 1;
|
|
2438
|
-
else if (l.length > n.length) {
|
|
2439
|
-
const u = (n.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length, g = (l.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length - u;
|
|
2440
|
-
c = r + g;
|
|
2441
|
-
}
|
|
2442
|
-
t.setSelectionRange(c, c);
|
|
2253
|
+
const k = e.unifiedHeader;
|
|
2254
|
+
if (k) {
|
|
2255
|
+
const y = x.getMonth() === 0 ? x.getFullYear() - 1 : x.getFullYear(), I = x.getMonth() === 0 ? 11 : x.getMonth() - 1, S = k.querySelector(".drp-date-picker__nav--prev");
|
|
2256
|
+
S && (U(e, y, I) ? (S.removeAttribute("disabled"), S.classList.remove("drp-date-picker__nav--disabled")) : (S.setAttribute("disabled", "true"), S.classList.add("drp-date-picker__nav--disabled")));
|
|
2257
|
+
const E = D.getMonth() === 11 ? D.getFullYear() + 1 : D.getFullYear(), T = D.getMonth() === 11 ? 0 : D.getMonth() + 1, A = k.querySelector(".drp-date-picker__nav--next");
|
|
2258
|
+
A && (U(e, E, T) ? (A.removeAttribute("disabled"), A.classList.remove("drp-date-picker__nav--disabled")) : (A.setAttribute("disabled", "true"), A.classList.add("drp-date-picker__nav--disabled")));
|
|
2443
2259
|
}
|
|
2444
2260
|
}
|
|
2445
|
-
|
|
2261
|
+
const l = r.getFullYear(), c = r.getMonth(), u = c === 0 ? 11 : c - 1, p = c === 0 ? l - 1 : l, g = t.querySelector(".drp-date-picker__nav--prev");
|
|
2262
|
+
g && (U(e, p, u) ? (g.removeAttribute("disabled"), g.classList.remove("drp-date-picker__nav--disabled")) : (g.setAttribute("disabled", "true"), g.classList.add("drp-date-picker__nav--disabled")));
|
|
2263
|
+
const f = c === 11 ? 0 : c + 1, h = c === 11 ? l + 1 : l, v = t.querySelector(".drp-date-picker__nav--next");
|
|
2264
|
+
v && (U(e, h, f) ? (v.removeAttribute("disabled"), v.classList.remove("drp-date-picker__nav--disabled")) : (v.setAttribute("disabled", "true"), v.classList.add("drp-date-picker__nav--disabled")));
|
|
2265
|
+
const m = t.querySelector(".drp-date-picker__weekdays"), M = [
|
|
2266
|
+
...e.weekdayNames.slice(e.weekStartDay),
|
|
2267
|
+
...e.weekdayNames.slice(0, e.weekStartDay)
|
|
2268
|
+
];
|
|
2269
|
+
m && (m.innerHTML = M.map((x) => `<div class="drp-date-picker__weekday">${x}</div>`).join("")), Vt(e, a, r);
|
|
2446
2270
|
}
|
|
2447
|
-
function
|
|
2448
|
-
|
|
2449
|
-
const
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
let
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2271
|
+
function Vt(e, a, t) {
|
|
2272
|
+
de.debug(`[DatePicker Col${a} 20] renderDays called for month`, a);
|
|
2273
|
+
const n = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
2274
|
+
if (!n) return;
|
|
2275
|
+
const r = n.querySelector(".drp-date-picker__days"), o = t.getFullYear(), i = t.getMonth();
|
|
2276
|
+
de.debug(`[DatePicker Col${a} 21] Rendering days for:`, o, i + 1);
|
|
2277
|
+
const d = (new Date(o, i, 1).getDay() - e.weekStartDay + 7) % 7, l = new Date(o, i + 1, 0).getDate(), c = new Date(o, i, 0).getDate(), u = new Date(o, i - 1, 1), p = u.getFullYear(), g = u.getMonth(), f = new Date(o, i + 1, 1), h = f.getFullYear(), v = f.getMonth(), m = [];
|
|
2278
|
+
for (let _ = d - 1; _ >= 0; _--) {
|
|
2279
|
+
const R = c - _, k = new Date(p, g, R);
|
|
2280
|
+
m.push({
|
|
2281
|
+
date: k,
|
|
2282
|
+
year: p,
|
|
2283
|
+
month: g,
|
|
2284
|
+
day: R,
|
|
2285
|
+
isOtherMonth: !0
|
|
2286
|
+
});
|
|
2459
2287
|
}
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
o = a;
|
|
2470
|
-
const s = ge(e, o);
|
|
2471
|
-
if (s.length === n)
|
|
2472
|
-
if (a.includes(r)) {
|
|
2473
|
-
const d = ge(e, i);
|
|
2474
|
-
return s + r + d;
|
|
2475
|
-
} else
|
|
2476
|
-
return s + r;
|
|
2477
|
-
else
|
|
2478
|
-
return s;
|
|
2479
|
-
}
|
|
2480
|
-
function Sn(e, a) {
|
|
2481
|
-
const { key: t, ctrlKey: n, metaKey: r } = a, { separator: o } = e.formatInfo;
|
|
2482
|
-
if (e.calendar.classList.contains("drp-date-picker--visible") && ["ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(t)) {
|
|
2483
|
-
a.preventDefault();
|
|
2484
|
-
return;
|
|
2288
|
+
for (let _ = 1; _ <= l; _++) {
|
|
2289
|
+
const R = new Date(o, i, _);
|
|
2290
|
+
m.push({
|
|
2291
|
+
date: R,
|
|
2292
|
+
year: o,
|
|
2293
|
+
month: i,
|
|
2294
|
+
day: _,
|
|
2295
|
+
isOtherMonth: !1
|
|
2296
|
+
});
|
|
2485
2297
|
}
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2298
|
+
const C = Math.ceil((d + l) / 7) * 7 - (d + l);
|
|
2299
|
+
for (let _ = 1; _ <= C; _++) {
|
|
2300
|
+
const R = new Date(h, v, _);
|
|
2301
|
+
m.push({
|
|
2302
|
+
date: R,
|
|
2303
|
+
year: h,
|
|
2304
|
+
month: v,
|
|
2305
|
+
day: _,
|
|
2306
|
+
isOtherMonth: !0
|
|
2307
|
+
});
|
|
2308
|
+
}
|
|
2309
|
+
const x = [];
|
|
2310
|
+
for (let _ = 0; _ < m.length; _ += 7)
|
|
2311
|
+
x.push(m.slice(_, _ + 7));
|
|
2312
|
+
let D = "";
|
|
2313
|
+
for (const _ of x) {
|
|
2314
|
+
const R = _.map((y) => {
|
|
2315
|
+
const I = e.getDateInfoInternal(y.date);
|
|
2316
|
+
let S = (I == null ? void 0 : I.badgeTooltip) || "";
|
|
2317
|
+
if (e.options.badgeTooltipCallback && (I != null && I.badgeText)) {
|
|
2318
|
+
const T = {
|
|
2319
|
+
date: y.date,
|
|
2320
|
+
dateString: be(y.date),
|
|
2321
|
+
dayNumber: y.day,
|
|
2322
|
+
isDisabled: e.isDateDisabledInternal(y.date),
|
|
2323
|
+
isSelected: !1,
|
|
2324
|
+
// Will be set below
|
|
2325
|
+
isStartDate: !1,
|
|
2326
|
+
isEndDate: !1,
|
|
2327
|
+
isInRange: !1,
|
|
2328
|
+
isToday: ut(y.date),
|
|
2329
|
+
isWeekend: y.date.getDay() === 0 || y.date.getDay() === 6,
|
|
2330
|
+
monthIndex: a,
|
|
2331
|
+
element: null,
|
|
2332
|
+
// Not available during string rendering
|
|
2333
|
+
picker: e
|
|
2334
|
+
}, A = e.options.badgeTooltipCallback(T);
|
|
2335
|
+
A !== null && (S = A);
|
|
2336
|
+
}
|
|
2337
|
+
return {
|
|
2338
|
+
text: (I == null ? void 0 : I.badgeText) || "",
|
|
2339
|
+
tooltip: S,
|
|
2340
|
+
class: (I == null ? void 0 : I.badgeClass) || ""
|
|
2341
|
+
};
|
|
2342
|
+
});
|
|
2343
|
+
if (R.some((y) => y.text)) {
|
|
2344
|
+
D += '<div class="drp-date-picker__badge-row">';
|
|
2345
|
+
for (const y of R)
|
|
2346
|
+
if (y.text) {
|
|
2347
|
+
const I = y.tooltip ? ` data-tooltip="${y.tooltip.replace(/"/g, """)}"` : "", S = y.class ? ` ${y.class}` : "";
|
|
2348
|
+
D += `<div class="drp-date-picker__badge-cell${S}"${I}>${y.text}</div>`;
|
|
2349
|
+
} else
|
|
2350
|
+
D += '<div class="drp-date-picker__badge-cell"></div>';
|
|
2351
|
+
D += "</div>";
|
|
2352
|
+
}
|
|
2353
|
+
D += '<div class="drp-date-picker__date-row">';
|
|
2354
|
+
for (const y of _) {
|
|
2355
|
+
const I = ["drp-date-picker__day"];
|
|
2356
|
+
y.isOtherMonth && I.push("drp-date-picker__day--other-month");
|
|
2357
|
+
const S = e.getDateInfoInternal(y.date), E = S && S.isDisabled !== void 0 ? S.isDisabled : e.isDateDisabledInternal(y.date);
|
|
2358
|
+
E && I.push("drp-date-picker__day--disabled"), S && S.dayClass && I.push(S.dayClass), e.isToday(y.date) && I.push("drp-date-picker__day--today");
|
|
2359
|
+
let T = !1;
|
|
2360
|
+
e.options.selectionMode === "single" ? T = e.isSameDay(y.date, e.selectedDate) : e.options.selectionMode === "multiple" && (T = e.selectedDates.some((q) => e.isSameDay(y.date, q))), T && I.push("drp-date-picker__day--selected");
|
|
2361
|
+
let A = !1, $ = !1, N = !1;
|
|
2362
|
+
if (e.options.selectionMode === "range")
|
|
2363
|
+
A = e.isSameDay(y.date, e.selectedStartDate), $ = e.isSameDay(y.date, e.selectedEndDate), N = e.isInRange(y.date), A && I.push("drp-date-picker__day--range-start"), $ && I.push("drp-date-picker__day--range-end"), N && (!E || e.options.highlightDisabledInRange) && I.push("drp-date-picker__day--in-range");
|
|
2364
|
+
else if (e.options.selectionMode === "multiple")
|
|
2365
|
+
for (const q of e.selectedRanges)
|
|
2366
|
+
e.isSameDay(y.date, q.start) && (A = !0, I.push("drp-date-picker__day--range-start")), e.isSameDay(y.date, q.end) && ($ = !0, I.push("drp-date-picker__day--range-end")), y.date >= q.start && y.date <= q.end && (N = !0, (!E || e.options.highlightDisabledInRange) && I.push("drp-date-picker__day--in-range"));
|
|
2367
|
+
const z = `${y.year}-${String(y.month + 1).padStart(2, "0")}-${String(y.day).padStart(2, "0")}`;
|
|
2368
|
+
let P = (S == null ? void 0 : S.dayTooltip) || "";
|
|
2369
|
+
if (e.options.dayTooltipCallback) {
|
|
2370
|
+
const q = {
|
|
2371
|
+
date: y.date,
|
|
2372
|
+
dateString: z,
|
|
2373
|
+
dayNumber: y.day,
|
|
2374
|
+
isDisabled: E,
|
|
2375
|
+
isSelected: T,
|
|
2376
|
+
isStartDate: A,
|
|
2377
|
+
isEndDate: $,
|
|
2378
|
+
isInRange: N,
|
|
2379
|
+
isToday: e.isToday(y.date),
|
|
2380
|
+
isWeekend: y.date.getDay() === 0 || y.date.getDay() === 6,
|
|
2381
|
+
monthIndex: a,
|
|
2382
|
+
element: null,
|
|
2383
|
+
// Not available during string rendering
|
|
2384
|
+
picker: e
|
|
2385
|
+
}, at = e.options.dayTooltipCallback(q);
|
|
2386
|
+
at !== null && (P = at);
|
|
2515
2387
|
}
|
|
2388
|
+
const V = P ? ` data-tooltip="${P.replace(/"/g, """)}"` : "";
|
|
2389
|
+
D += `<div class="${I.join(" ")}" data-date="${z}" data-day-number="${y.day}"${V}>`, D += `<slot name="day-${z}">${y.day}</slot>`, D += "</div>";
|
|
2516
2390
|
}
|
|
2517
|
-
|
|
2391
|
+
D += "</div>";
|
|
2518
2392
|
}
|
|
2393
|
+
r && (r.innerHTML = D, xn(e, a, r));
|
|
2519
2394
|
}
|
|
2520
|
-
function
|
|
2521
|
-
|
|
2522
|
-
a.preventDefault();
|
|
2523
|
-
const t = ((p = a.clipboardData) == null ? void 0 : p.getData("text")) || "", { separator: n } = e.formatInfo, r = t.replace(new RegExp(`[^0-9${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), o = ge(e, r), i = a.target, s = i.selectionStart || 0, d = i.selectionEnd || 0, l = i.value, c = l.substring(0, s) + o + l.substring(d);
|
|
2524
|
-
i.value = ge(e, c);
|
|
2525
|
-
const u = s + o.length;
|
|
2526
|
-
i.setSelectionRange(u, u), i.dispatchEvent(new Event("input", { bubbles: !0 })), tt(e);
|
|
2527
|
-
}
|
|
2528
|
-
function tt(e) {
|
|
2529
|
-
if (!e.input) return;
|
|
2530
|
-
const a = e.input.value;
|
|
2531
|
-
if (oe.debug("updateCalendarFromInput - value:", a), !a) return;
|
|
2532
|
-
const { separator: t, parts: n, maxLength: r } = e.formatInfo;
|
|
2533
|
-
if (oe.debug("Format info:", { separator: t, parts: n, maxLength: r }), e.options.selectionMode === "range" && a.includes(" to ")) {
|
|
2534
|
-
const i = a.split(" to "), s = i[0], d = i[1];
|
|
2535
|
-
oe.debug("Range parts - start:", s, "end:", d), Ce(e, s, "start"), d && Ce(e, d, "end");
|
|
2395
|
+
function xn(e, a, t) {
|
|
2396
|
+
if (!e.options.renderDayCallback && !e.options.renderDayContentCallback)
|
|
2536
2397
|
return;
|
|
2398
|
+
t.querySelectorAll(".drp-date-picker__day").forEach((r) => {
|
|
2399
|
+
const o = r, i = o.getAttribute("data-date"), s = parseInt(o.getAttribute("data-day-number") || "0", 10);
|
|
2400
|
+
if (!i) return;
|
|
2401
|
+
const [d, l, c] = i.split("-"), u = new Date(parseInt(d), parseInt(l) - 1, parseInt(c)), p = o.querySelector(`slot[name="day-${i}"]`);
|
|
2402
|
+
if (p && p.assignedNodes().length > 0)
|
|
2403
|
+
return;
|
|
2404
|
+
const f = e.isDateDisabledInternal(u), h = e.isToday(u), v = u.getDay() === 0 || u.getDay() === 6, m = e.options.selectionMode === "single" && e.isSameDay(u, e.selectedDate), M = e.options.selectionMode === "range" && e.isSameDay(u, e.selectedStartDate), C = e.options.selectionMode === "range" && e.isSameDay(u, e.selectedEndDate), x = e.options.selectionMode === "range" && e.isInRange(u), D = {
|
|
2405
|
+
date: u,
|
|
2406
|
+
dateString: i,
|
|
2407
|
+
dayNumber: s,
|
|
2408
|
+
isDisabled: f,
|
|
2409
|
+
isSelected: m || M || C,
|
|
2410
|
+
isStartDate: M,
|
|
2411
|
+
isEndDate: C,
|
|
2412
|
+
isInRange: x,
|
|
2413
|
+
isToday: h,
|
|
2414
|
+
isWeekend: v,
|
|
2415
|
+
monthIndex: a,
|
|
2416
|
+
element: o,
|
|
2417
|
+
picker: e
|
|
2418
|
+
};
|
|
2419
|
+
if (e.options.renderDayCallback)
|
|
2420
|
+
try {
|
|
2421
|
+
const _ = e.options.renderDayCallback(D);
|
|
2422
|
+
_ != null && (typeof _ == "string" ? p && (p.innerHTML = _) : _ instanceof HTMLElement && p && (p.innerHTML = "", p.appendChild(_)));
|
|
2423
|
+
} catch (_) {
|
|
2424
|
+
console.error("[DatePicker] Error in renderDayCallback:", _);
|
|
2425
|
+
}
|
|
2426
|
+
else if (e.options.renderDayContentCallback)
|
|
2427
|
+
try {
|
|
2428
|
+
const _ = e.options.renderDayContentCallback(D);
|
|
2429
|
+
_ != null && (typeof _ == "string" ? p && (p.innerHTML += _) : _ instanceof HTMLElement && p && p.appendChild(_));
|
|
2430
|
+
} catch (_) {
|
|
2431
|
+
console.error("[DatePicker] Error in renderDayContentCallback:", _);
|
|
2432
|
+
}
|
|
2433
|
+
});
|
|
2434
|
+
}
|
|
2435
|
+
function qt(e, a) {
|
|
2436
|
+
const t = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
2437
|
+
if (!t) return;
|
|
2438
|
+
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
2439
|
+
n == null || n.classList.add("drp-date-picker__rolling-selector--visible");
|
|
2440
|
+
const r = e.monthDates[a], o = r.getFullYear(), i = r.getMonth(), s = Ot(e.options.rollingYearRange, o, e), d = Yt(e.options.rollingMonthRange), l = n == null ? void 0 : n.querySelector('[data-list="years"]');
|
|
2441
|
+
let c = "";
|
|
2442
|
+
for (let p = s.min; p <= s.max; p++) {
|
|
2443
|
+
const g = p === o ? "drp-date-picker__rolling-item--selected" : "", h = ct(e, p) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2444
|
+
c += `<div class="drp-date-picker__rolling-item ${g} ${h}" data-year="${p}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${p}</span></div>`;
|
|
2445
|
+
}
|
|
2446
|
+
l && (l.innerHTML = c);
|
|
2447
|
+
const u = n == null ? void 0 : n.querySelector('[data-list="months"]');
|
|
2448
|
+
if (u) {
|
|
2449
|
+
let p = "";
|
|
2450
|
+
for (let g = d.min - 1; g <= d.max - 1; g++) {
|
|
2451
|
+
const f = e.monthNames[g], h = g === i ? "drp-date-picker__rolling-item--selected" : "", m = U(e, o, g) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2452
|
+
p += `<div class="drp-date-picker__rolling-item ${h} ${m}" data-month="${g}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${f}</span></div>`;
|
|
2453
|
+
}
|
|
2454
|
+
u.innerHTML = p;
|
|
2537
2455
|
}
|
|
2538
|
-
const o = e.options.selectionMode === "range" ? "start" : "single";
|
|
2539
|
-
Ce(e, a, o);
|
|
2540
2456
|
}
|
|
2541
|
-
function
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2457
|
+
function Mn(e) {
|
|
2458
|
+
if (!e.options.unifiedNavigation || !e.unifiedRollingSelector) return;
|
|
2459
|
+
e.unifiedRollingSelector.classList.add("drp-date-picker__unified-rolling-selector--visible");
|
|
2460
|
+
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(), r = t.getMonth(), o = e.getEffectiveYearRange(), i = e.getEffectiveMonthRange(), s = e.unifiedRollingSelector.querySelector('[data-list="years"]');
|
|
2461
|
+
let d = "";
|
|
2462
|
+
for (let c = o.min; c <= o.max; c++) {
|
|
2463
|
+
const u = c === n ? "drp-date-picker__rolling-item--selected" : "", g = ct(e, c) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2464
|
+
d += `<div class="drp-date-picker__rolling-item ${u} ${g}" data-year="${c}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${c}</span></div>`;
|
|
2465
|
+
}
|
|
2466
|
+
s && (s.innerHTML = d);
|
|
2467
|
+
const l = e.unifiedRollingSelector.querySelector('[data-list="months"]');
|
|
2468
|
+
if (l) {
|
|
2469
|
+
let c = "";
|
|
2470
|
+
for (let u = i.min - 1; u <= i.max - 1; u++) {
|
|
2471
|
+
const p = e.monthNames[u], g = u === r ? "drp-date-picker__rolling-item--selected" : "", h = U(e, n, u) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2472
|
+
c += `<div class="drp-date-picker__rolling-item ${g} ${h}" data-month="${u}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${p}</span></div>`;
|
|
2556
2473
|
}
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
if (e.
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
e.
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
e.
|
|
2474
|
+
l.innerHTML = c;
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
function Sn(e) {
|
|
2478
|
+
if (e.options.selectionMode !== "range") return;
|
|
2479
|
+
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2480
|
+
if (a)
|
|
2481
|
+
if (e.selectedStartDate && e.selectedEndDate) {
|
|
2482
|
+
let t, n, r, o, i;
|
|
2483
|
+
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2484
|
+
n = e.getEnabledDatesInRange(
|
|
2485
|
+
e.selectedStartDate,
|
|
2486
|
+
e.selectedEndDate
|
|
2487
|
+
), t = n.length, o = n, e.options.disabledDatesHandling === "split" && (i = e.splitRangeByDisabled(
|
|
2488
|
+
e.selectedStartDate,
|
|
2489
|
+
e.selectedEndDate
|
|
2490
|
+
));
|
|
2491
|
+
else if (e.options.disabledDatesHandling === "allow") {
|
|
2492
|
+
n = e.getEnabledDatesInRange(
|
|
2493
|
+
e.selectedStartDate,
|
|
2494
|
+
e.selectedEndDate
|
|
2495
|
+
), r = e.getDisabledDatesInRange(
|
|
2496
|
+
e.selectedStartDate,
|
|
2497
|
+
e.selectedEndDate
|
|
2498
|
+
);
|
|
2499
|
+
const d = 1e3 * 60 * 60 * 24, l = e.selectedEndDate.getTime() - e.selectedStartDate.getTime();
|
|
2500
|
+
t = Math.floor(l / d) + 1;
|
|
2501
|
+
} else {
|
|
2502
|
+
const l = e.selectedEndDate.getTime() - e.selectedStartDate.getTime();
|
|
2503
|
+
t = Math.floor(l / 864e5) + 1;
|
|
2579
2504
|
}
|
|
2505
|
+
const s = t > 0 ? t - 1 : 0;
|
|
2506
|
+
if (a.className = "drp-date-picker__summary drp-date-picker__summary--visible", e.options.formatSummaryCallback) {
|
|
2507
|
+
const d = {
|
|
2508
|
+
days: t,
|
|
2509
|
+
nights: s,
|
|
2510
|
+
startDate: e.selectedStartDate,
|
|
2511
|
+
endDate: e.selectedEndDate,
|
|
2512
|
+
selectionMode: e.options.selectionMode,
|
|
2513
|
+
disabledDatesHandling: e.options.disabledDatesHandling,
|
|
2514
|
+
localeStrings: e.localeStrings,
|
|
2515
|
+
isPreview: !1
|
|
2516
|
+
};
|
|
2517
|
+
n && (d.enabledDates = n), r && (d.disabledDates = r), o && (d.dates = o), i && (d.dateRanges = i), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2518
|
+
} else
|
|
2519
|
+
a.innerHTML = `
|
|
2520
|
+
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
2521
|
+
<span>, </span>
|
|
2522
|
+
<span class="drp-date-picker__summary-count">${s} ${s === 1 ? e.localeStrings.night : e.localeStrings.nights}</span>
|
|
2523
|
+
`;
|
|
2524
|
+
} else
|
|
2525
|
+
a.className = "drp-date-picker__summary drp-date-picker__summary--hidden", a.innerHTML = "";
|
|
2526
|
+
}
|
|
2527
|
+
function Ut(e) {
|
|
2528
|
+
if (e.options.selectionMode !== "range") return;
|
|
2529
|
+
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2530
|
+
if (a && e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2531
|
+
let t, n, r, o, i;
|
|
2532
|
+
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2533
|
+
n = e.getEnabledDatesInRange(
|
|
2534
|
+
e.dragPreviewStart,
|
|
2535
|
+
e.dragPreviewEnd
|
|
2536
|
+
), t = n.length, o = n, e.options.disabledDatesHandling === "split" && (i = e.splitRangeByDisabled(
|
|
2537
|
+
e.dragPreviewStart,
|
|
2538
|
+
e.dragPreviewEnd
|
|
2539
|
+
));
|
|
2540
|
+
else if (e.options.disabledDatesHandling === "allow") {
|
|
2541
|
+
n = e.getEnabledDatesInRange(
|
|
2542
|
+
e.dragPreviewStart,
|
|
2543
|
+
e.dragPreviewEnd
|
|
2544
|
+
), r = e.getDisabledDatesInRange(
|
|
2545
|
+
e.dragPreviewStart,
|
|
2546
|
+
e.dragPreviewEnd
|
|
2547
|
+
);
|
|
2548
|
+
const d = 1e3 * 60 * 60 * 24, l = e.dragPreviewEnd.getTime() - e.dragPreviewStart.getTime();
|
|
2549
|
+
t = Math.floor(l / d) + 1;
|
|
2550
|
+
} else {
|
|
2551
|
+
const l = e.dragPreviewEnd.getTime() - e.dragPreviewStart.getTime();
|
|
2552
|
+
t = Math.floor(l / 864e5) + 1;
|
|
2580
2553
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2554
|
+
const s = t > 0 ? t - 1 : 0;
|
|
2555
|
+
if (a.className = "drp-date-picker__summary drp-date-picker__summary--visible", e.options.formatSummaryCallback) {
|
|
2556
|
+
const d = {
|
|
2557
|
+
days: t,
|
|
2558
|
+
nights: s,
|
|
2559
|
+
startDate: e.dragPreviewStart,
|
|
2560
|
+
endDate: e.dragPreviewEnd,
|
|
2561
|
+
selectionMode: e.options.selectionMode,
|
|
2562
|
+
disabledDatesHandling: e.options.disabledDatesHandling,
|
|
2563
|
+
localeStrings: e.localeStrings,
|
|
2564
|
+
isPreview: !0
|
|
2565
|
+
};
|
|
2566
|
+
n && (d.enabledDates = n), r && (d.disabledDates = r), o && (d.dates = o), i && (d.dateRanges = i), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2567
|
+
} else
|
|
2568
|
+
a.innerHTML = `
|
|
2569
|
+
<span style="opacity: 0.7;">${e.localeStrings.preview}: </span>
|
|
2570
|
+
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
2571
|
+
<span>, </span>
|
|
2572
|
+
<span class="drp-date-picker__summary-count">${s} ${s === 1 ? e.localeStrings.night : e.localeStrings.nights}</span>
|
|
2573
|
+
`;
|
|
2586
2574
|
}
|
|
2587
2575
|
}
|
|
2588
|
-
|
|
2576
|
+
function Cn(e) {
|
|
2577
|
+
if (e.calendar.querySelectorAll(".drp-date-picker__day--drag-preview, .drp-date-picker__day--drag-invalid").forEach((r) => {
|
|
2578
|
+
r.classList.remove("drp-date-picker__day--drag-preview", "drp-date-picker__day--drag-invalid");
|
|
2579
|
+
}), !e.dragPreviewStart || !e.dragPreviewEnd) return;
|
|
2580
|
+
const t = e.options.disabledDatesHandling === "block" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd);
|
|
2581
|
+
e.calendar.querySelectorAll(".drp-date-picker__day").forEach((r) => {
|
|
2582
|
+
const o = r.dataset.date;
|
|
2583
|
+
if (!o) return;
|
|
2584
|
+
const [i, s, d] = o.split("-").map(Number), l = new Date(i, s - 1, d);
|
|
2585
|
+
l >= e.dragPreviewStart && l <= e.dragPreviewEnd && (r.classList.add("drp-date-picker__day--drag-preview"), t && r.classList.add("drp-date-picker__day--drag-invalid"));
|
|
2586
|
+
}), Ut(e);
|
|
2587
|
+
}
|
|
2588
|
+
const je = {
|
|
2589
2589
|
en: {
|
|
2590
2590
|
today: "Today",
|
|
2591
2591
|
clear: "Clear",
|
|
@@ -2627,21 +2627,21 @@ const Ue = {
|
|
|
2627
2627
|
nights: "noches"
|
|
2628
2628
|
}
|
|
2629
2629
|
};
|
|
2630
|
-
function
|
|
2630
|
+
function Oe(e) {
|
|
2631
2631
|
if (e !== "auto")
|
|
2632
2632
|
return e;
|
|
2633
2633
|
if (typeof navigator < "u" && navigator.language) {
|
|
2634
2634
|
const a = navigator.language.split("-")[0].toLowerCase();
|
|
2635
|
-
return
|
|
2635
|
+
return je[a] ? a : "en";
|
|
2636
2636
|
}
|
|
2637
2637
|
return "en";
|
|
2638
2638
|
}
|
|
2639
2639
|
function In(e, a) {
|
|
2640
|
-
const t =
|
|
2640
|
+
const t = Oe(e), n = je[t] || je.en;
|
|
2641
2641
|
return a ? { ...n, ...a } : n;
|
|
2642
2642
|
}
|
|
2643
2643
|
function En(e) {
|
|
2644
|
-
const a =
|
|
2644
|
+
const a = Oe(e);
|
|
2645
2645
|
try {
|
|
2646
2646
|
const t = new Intl.DateTimeFormat(a, { weekday: "short" }), n = [];
|
|
2647
2647
|
for (let r = 0; r < 7; r++) {
|
|
@@ -2654,7 +2654,7 @@ function En(e) {
|
|
|
2654
2654
|
}
|
|
2655
2655
|
}
|
|
2656
2656
|
function Rn(e) {
|
|
2657
|
-
const a =
|
|
2657
|
+
const a = Oe(e);
|
|
2658
2658
|
try {
|
|
2659
2659
|
const t = new Intl.DateTimeFormat(a, { month: "long" }), n = [];
|
|
2660
2660
|
for (let r = 0; r < 12; r++) {
|
|
@@ -2679,7 +2679,7 @@ function Rn(e) {
|
|
|
2679
2679
|
];
|
|
2680
2680
|
}
|
|
2681
2681
|
}
|
|
2682
|
-
const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(--base-font-family, inherit));--drp-spacing-xs: calc(.4 * var(--drp-rem));--drp-spacing-sm: calc(.8 * var(--drp-rem));--drp-spacing-md: calc(1.6 * var(--drp-rem));--drp-spacing-lg: calc(2.4 * var(--drp-rem));--drp-spacing-xl: calc(3.2 * var(--drp-rem));--drp-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--drp-rem));--drp-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--drp-rem));--drp-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--drp-rem));--drp-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--drp-rem));--drp-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--drp-rem));--drp-font-size-xl: calc(var(--base-font-size-xl, 2) * var(--drp-rem));--drp-font-size-2xl: calc(var(--base-font-size-2xl, 2.4) * var(--drp-rem));--drp-font-weight-normal: var(--base-font-weight-normal, 400);--drp-font-weight-medium: var(--base-font-weight-medium, 500);--drp-font-weight-semibold: var(--base-font-weight-semibold, 600);--drp-line-height-tight: var(--base-line-height-tight, 1.25);--drp-line-height-normal: var(--base-line-height-normal, 1.5);--drp-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--drp-dropdown-background: var(--base-dropdown-background, #ffffff);--drp-border-color: var(--base-border-color, #e5e7eb);--drp-primary-bg: var(--base-primary-bg, #f3f4f6);--drp-primary-bg-hover: var(--base-primary-bg-hover, #e5e7eb);--drp-accent-color: var(--base-accent-color, #3b82f6);--drp-accent-color-hover: var(--base-accent-color-hover, #2563eb);--drp-text-primary: var(--base-text-color-1, #111827);--drp-text-secondary: var(--base-text-color-3, #6b7280);--drp-text-on-accent: var(--base-text-on-accent, #ffffff);--drp-button-text-color: var(--drp-text-on-accent);--drp-tooltip-background: var(--base-tooltip-background, #111827);--drp-tooltip-text-color: var(--base-tooltip-text-color, #ffffff);--drp-loading-overlay-background: rgba(255, 255, 255, .8);--drp-loading-spinner-color: var(--drp-border-color);--drp-loading-spinner-accent: var(--drp-accent-color);--drp-border-width-base: 1px;--drp-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--drp-rem));--drp-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--drp-rem));--drp-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--drp-rem));--drp-border-radius: var(--drp-border-radius-md);--drp-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-z-index-dropdown: 9500;--drp-z-index-tooltip: 9999;--drp-input-padding-h: calc(1.2 * var(--drp-rem));--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-opacity-disabled: .6;--drp-opacity-other-month: .5;--drp-opacity-hover: .8;--drp-opacity-dragging: .7;--drp-input-background: var(--base-input-background, var(--drp-dropdown-background));--drp-input-color: var(--base-input-color, var(--drp-text-primary));--drp-input-border-color: var(--base-input-border-color, var(--drp-border-color));--drp-input-border-color-hover: var(--base-input-border-color-hover, var(--drp-accent-color));--drp-input-border-color-focus: var(--base-input-border-color-focus, var(--drp-accent-color));--drp-input-placeholder-color: var(--base-input-placeholder-color, var(--drp-text-secondary));--drp-input-background-disabled: var(--base-input-background-disabled, 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: var(--drp-font-size-xs);--drp-input-size-xs-padding-v: var(--drp-spacing-xs);--drp-input-size-xs-padding-h: calc(.8 * var(--drp-rem));--drp-input-size-xs-height: calc(var(--base-input-size-xs-height, 3.1) * var(--drp-rem));--drp-input-size-xs-icon-size: .75em;--drp-input-size-sm-font: calc(1.3 * var(--drp-rem));--drp-input-size-sm-padding-v: calc(.5 * var(--drp-rem));--drp-input-size-sm-padding-h: var(--drp-spacing-sm);--drp-input-size-sm-height: calc(var(--base-input-size-sm-height, 3.3) * var(--drp-rem));--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: calc(1.4 * var(--drp-rem));--drp-input-size-md-padding-v: var(--drp-spacing-sm);--drp-input-size-md-padding-h: calc(1.2 * var(--drp-rem));--drp-input-size-md-height: calc(var(--base-input-size-md-height, 3.5) * var(--drp-rem));--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: calc(1.6 * var(--drp-rem));--drp-input-size-lg-padding-v: calc(1 * var(--drp-rem));--drp-input-size-lg-padding-h: calc(1.4 * var(--drp-rem));--drp-input-size-lg-height: calc(var(--base-input-size-lg-height, 3.8) * var(--drp-rem));--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: calc(1.8 * var(--drp-rem));--drp-input-size-xl-padding-v: calc(1.2 * var(--drp-rem));--drp-input-size-xl-padding-h: calc(1.6 * var(--drp-rem));--drp-input-size-xl-height: calc(var(--base-input-size-xl-height, 4.1) * var(--drp-rem));--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-nav-size: calc(3.2 * var(--drp-rem));--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-scrollbar-width: 6px;--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-text-on-accent);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-rolling-item-justify-content: center;--drp-rolling-item-min-height: calc(3.2 * var(--drp-rem));--drp-rolling-item-padding-v: var(--drp-spacing-xs);--drp-rolling-item-padding-h: var(--drp-spacing-md);--drp-rolling-item-font-size: var(--drp-font-size-sm);--drp-rolling-item-font-weight-selected: var(--drp-font-weight-semibold);--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-text-on-accent);--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-text-on-accent);--drp-day-border-width: 2px;--drp-day-border-color: transparent;--drp-day-focused-outline-width: 2px;--drp-day-focused-outline-offset: 2px;--drp-day-in-range-bg-opacity: .15;--drp-day-in-range-hover-bg-opacity: .25;--drp-day-drag-preview-bg-opacity: .3;--drp-day-drag-preview-edge-bg-opacity: .6;--drp-day-disabled-pattern-opacity: .1;--drp-day-dragging-scale: 1.1;--drp-day-drag-preview-border-style: dashed;--drp-day-drag-invalid-bg: #ef4444;--drp-day-drag-invalid-bg-opacity: .2;--drp-holiday-color: #ef4444;--drp-holiday-bg-opacity: .1;--drp-holiday-hover-bg-opacity: .2;--drp-event-color: #10b981;--drp-event-bg-opacity: .1;--drp-event-hover-bg-opacity: .2;--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-font-size: var(--drp-font-size-2xs);--drp-badge-padding-v: 1px;--drp-badge-padding-h: 2px;--drp-badge-border-radius: 2px;--drp-badge-max-height: var(--drp-font-size-base);--drp-badge-row-height: var(--drp-badge-max-height);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-text-on-accent);--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-tooltip-line-height: 1.4;--drp-tooltip-max-width: 200px;--drp-tooltip-arrow-size: 8px;--drp-month-min-width: 280px;--drp-month-min-width-inline: 250px;--drp-calendar-max-width: calc(100vw - 2rem) }.drp-input{width:100%;font-family:var(--drp-font-family, var(--base-font-family, inherit));font-size:var(--drp-input-size-md-font);line-height:var(--drp-line-height-normal);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:var(--drp-opacity-disabled);cursor:not-allowed;background-color:var(--drp-input-background-disabled)}.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:var(--drp-z-index-dropdown);font-family:var(--drp-font-family, var(--base-font-family, inherit));background:var(--drp-dropdown-background);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius-lg);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:var(--drp-month-min-width);max-width:var(--drp-calendar-max-width);box-sizing:border-box;-webkit-user-select:none;user-select:none}.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:var(--drp-month-min-width);display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:var(--drp-month-min-width-inline)}.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:var(--drp-nav-size);height:var(--drp-nav-size);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:var(--drp-opacity-disabled);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;gap:var(--drp-spacing-xs)}.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-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-lg);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:var(--drp-rolling-scrollbar-width)}.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:var(--drp-rolling-item-padding-v) var(--drp-rolling-item-padding-h);cursor:pointer;font-size:var(--drp-rolling-item-font-size);min-height:var(--drp-rolling-item-min-height);flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content)}.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:var(--drp-rolling-item-font-weight-selected)}.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-dropdown-background);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-lg);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:var(--drp-rolling-scrollbar-width)}.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:var(--drp-rolling-item-padding-v) var(--drp-rolling-item-padding-h);cursor:pointer;font-size:var(--drp-rolling-item-font-size);min-height:var(--drp-rolling-item-min-height);flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content)}.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:var(--drp-rolling-item-font-weight-selected)}.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-sm);cursor:pointer;border:var(--drp-day-border-width) solid var(--drp-day-border-color);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:var(--drp-day-focused-outline-width) solid var(--drp-day-focused-outline);outline-offset:var(--drp-day-focused-outline-offset)}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:var(--drp-opacity-disabled);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,var(--drp-day-disabled-pattern-opacity)) 0px,rgba(0,0,0,var(--drp-day-disabled-pattern-opacity)) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius-sm);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--disabled.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) calc(var(--drp-day-in-range-bg-opacity) * 100%),transparent)}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:var(--drp-opacity-other-month)}.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) calc(var(--drp-day-in-range-bg-opacity) * 100%),transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) calc(var(--drp-day-in-range-hover-bg-opacity) * 100%),transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:var(--drp-opacity-dragging);transform:scale(var(--drp-day-dragging-scale));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) calc(var(--drp-day-drag-preview-bg-opacity) * 100%),transparent);border:var(--drp-day-border-width) var(--drp-day-drag-preview-border-style) 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) calc(var(--drp-day-drag-preview-edge-bg-opacity) * 100%),transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,var(--drp-day-drag-invalid-bg) calc(var(--drp-day-drag-invalid-bg-opacity) * 100%),transparent)!important;border-color:var(--drp-day-drag-invalid-bg)!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,var(--drp-holiday-color) calc(var(--drp-holiday-bg-opacity) * 100%),transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,var(--drp-holiday-color) calc(var(--drp-holiday-hover-bg-opacity) * 100%),transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,var(--drp-event-color) calc(var(--drp-event-bg-opacity) * 100%),transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,var(--drp-event-color) calc(var(--drp-event-hover-bg-opacity) * 100%),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);max-height:var(--drp-badge-row-height);min-height:var(--drp-badge-row-height)}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:var(--drp-badge-padding-v) var(--drp-badge-padding-h);border-radius:var(--drp-badge-border-radius);cursor:pointer;max-height:var(--drp-badge-row-height)}.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:calc(1.12 * var(--drp-rem));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:calc(1.12 * var(--drp-rem));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:calc(1.04 * var(--drp-rem));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-family:inherit;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-opacity-disabled);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:var(--drp-z-index-tooltip);background-color:var(--drp-tooltip-background);color:var(--drp-tooltip-text-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius-sm);font-size:var(--drp-font-size-xs);line-height:var(--drp-tooltip-line-height);max-width:var(--drp-tooltip-max-width);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-background);width:var(--drp-tooltip-arrow-size);height:var(--drp-tooltip-arrow-size);transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:var(--drp-loading-overlay-background);display:flex;align-items:center;justify-content:center;z-index:var(--drp-z-index-dropdown);border-radius:var(--drp-border-radius-lg)}.drp-date-picker__loading-spinner{width:40px;height:40px;border:4px solid var(--drp-loading-spinner-color);border-top-color:var(--drp-loading-spinner-accent);border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.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}', De = class De {
|
|
2682
|
+
const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(--base-font-family, inherit));--drp-spacing-xs: calc(.4 * var(--drp-rem));--drp-spacing-sm: calc(.8 * var(--drp-rem));--drp-spacing-md: calc(1.6 * var(--drp-rem));--drp-spacing-lg: calc(2.4 * var(--drp-rem));--drp-spacing-xl: calc(3.2 * var(--drp-rem));--drp-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--drp-rem));--drp-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--drp-rem));--drp-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--drp-rem));--drp-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--drp-rem));--drp-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--drp-rem));--drp-font-size-xl: calc(var(--base-font-size-xl, 2) * var(--drp-rem));--drp-font-size-2xl: calc(var(--base-font-size-2xl, 2.4) * var(--drp-rem));--drp-font-weight-normal: var(--base-font-weight-normal, 400);--drp-font-weight-medium: var(--base-font-weight-medium, 500);--drp-font-weight-semibold: var(--base-font-weight-semibold, 600);--drp-line-height-tight: var(--base-line-height-tight, 1.25);--drp-line-height-normal: var(--base-line-height-normal, 1.5);--drp-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--drp-dropdown-background: var(--base-dropdown-background, #ffffff);--drp-border-color: var(--base-border-color, #e5e7eb);--drp-border: var(--base-border, var(--drp-border-width-base) solid var(--drp-border-color));--drp-primary-bg: var(--base-primary-bg, #f3f4f6);--drp-primary-bg-hover: var(--base-primary-bg-hover, #e5e7eb);--drp-accent-color: var(--base-accent-color, #3b82f6);--drp-accent-color-hover: var(--base-accent-color-hover, #2563eb);--drp-text-primary: var(--base-text-color-1, #111827);--drp-text-secondary: var(--base-text-color-3, #6b7280);--drp-text-on-accent: var(--base-text-on-accent, #ffffff);--drp-button-text-color: var(--drp-text-on-accent);--drp-tooltip-background: var(--base-tooltip-background, #111827);--drp-tooltip-text-color: var(--base-tooltip-text-color, #ffffff);--drp-loading-overlay-background: rgba(255, 255, 255, .8);--drp-loading-spinner-color: var(--drp-border-color);--drp-loading-spinner-accent: var(--drp-accent-color);--drp-border-width-base: 1px;--drp-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--drp-rem));--drp-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--drp-rem));--drp-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--drp-rem));--drp-border-radius: var(--drp-border-radius-md);--drp-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-z-index-dropdown: 9500;--drp-z-index-tooltip: 9999;--drp-input-padding-h: calc(1.2 * var(--drp-rem));--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-opacity-disabled: .6;--drp-opacity-other-month: .5;--drp-opacity-hover: .8;--drp-opacity-dragging: .7;--drp-input-background: var(--base-input-background, var(--drp-dropdown-background));--drp-input-color: var(--base-input-color, var(--drp-text-primary));--drp-input-border: var(--base-input-border, var(--drp-border));--drp-input-border-hover: var(--base-input-border-hover, var(--drp-border-width-base) solid var(--drp-accent-color));--drp-input-border-focus: var(--base-input-border-focus, var(--drp-border-width-base) solid var(--drp-accent-color));--drp-input-placeholder-color: var(--base-input-placeholder-color, var(--drp-text-secondary));--drp-input-background-disabled: var(--base-input-background-disabled, 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: var(--drp-font-size-xs);--drp-input-size-xs-padding-v: var(--drp-spacing-xs);--drp-input-size-xs-padding-h: calc(.8 * var(--drp-rem));--drp-input-size-xs-height: calc(var(--base-input-size-xs-height, 3.1) * var(--drp-rem));--drp-input-size-xs-icon-size: .75em;--drp-input-size-sm-font: calc(1.3 * var(--drp-rem));--drp-input-size-sm-padding-v: calc(.5 * var(--drp-rem));--drp-input-size-sm-padding-h: var(--drp-spacing-sm);--drp-input-size-sm-height: calc(var(--base-input-size-sm-height, 3.3) * var(--drp-rem));--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: calc(1.4 * var(--drp-rem));--drp-input-size-md-padding-v: var(--drp-spacing-sm);--drp-input-size-md-padding-h: calc(1.2 * var(--drp-rem));--drp-input-size-md-height: calc(var(--base-input-size-md-height, 3.5) * var(--drp-rem));--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: calc(1.6 * var(--drp-rem));--drp-input-size-lg-padding-v: calc(1 * var(--drp-rem));--drp-input-size-lg-padding-h: calc(1.4 * var(--drp-rem));--drp-input-size-lg-height: calc(var(--base-input-size-lg-height, 3.8) * var(--drp-rem));--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: calc(1.8 * var(--drp-rem));--drp-input-size-xl-padding-v: calc(1.2 * var(--drp-rem));--drp-input-size-xl-padding-h: calc(1.6 * var(--drp-rem));--drp-input-size-xl-height: calc(var(--base-input-size-xl-height, 4.1) * var(--drp-rem));--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-border: var(--drp-border);--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-nav-border-hover-full: var(--drp-border-width-base) solid var(--drp-nav-border-hover);--drp-nav-size: calc(3.2 * var(--drp-rem));--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-border: var(--drp-border);--drp-rolling-scrollbar-width: 6px;--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-color: var(--drp-text-primary);--drp-rolling-item-bg-selected: var(--drp-accent-color);--drp-rolling-item-color-selected: var(--drp-text-on-accent);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-rolling-item-justify-content: center;--drp-rolling-item-min-height: calc(3.2 * var(--drp-rem));--drp-rolling-item-padding-v: var(--drp-spacing-xs);--drp-rolling-item-padding-h: var(--drp-spacing-md);--drp-rolling-item-font-size: var(--drp-font-size-sm);--drp-rolling-item-font-weight-selected: var(--drp-font-weight-semibold);--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-text-on-accent);--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-text-on-accent);--drp-day-border-width: 2px;--drp-day-border-color: transparent;--drp-day-focused-outline-width: 2px;--drp-day-focused-outline-offset: 2px;--drp-day-in-range-bg-opacity: .15;--drp-day-in-range-hover-bg-opacity: .25;--drp-day-drag-preview-bg-opacity: .3;--drp-day-drag-preview-edge-bg-opacity: .6;--drp-day-disabled-pattern-opacity: .1;--drp-day-dragging-scale: 1.1;--drp-day-drag-preview-border-style: dashed;--drp-day-drag-invalid-bg: #ef4444;--drp-day-drag-invalid-bg-opacity: .2;--drp-holiday-color: #ef4444;--drp-holiday-bg-opacity: .1;--drp-holiday-hover-bg-opacity: .2;--drp-event-color: #10b981;--drp-event-bg-opacity: .1;--drp-event-hover-bg-opacity: .2;--drp-summary-text-color: var(--drp-text-secondary);--drp-summary-border-color: var(--drp-border-color);--drp-summary-border: var(--drp-border);--drp-summary-count-color: var(--drp-accent-color);--drp-button-border-color: var(--drp-border-color);--drp-button-border: var(--drp-border);--drp-button-bg-hover: var(--drp-primary-bg);--drp-button-border-hover: var(--drp-accent-color);--drp-button-border-hover-full: var(--drp-border-width-base) solid var(--drp-button-border-hover);--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-font-size: var(--drp-font-size-2xs);--drp-badge-padding-v: 1px;--drp-badge-padding-h: 2px;--drp-badge-border-radius: 2px;--drp-badge-max-height: var(--drp-font-size-base);--drp-badge-row-height: var(--drp-badge-max-height);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-text-on-accent);--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-tooltip-line-height: 1.4;--drp-tooltip-max-width: 200px;--drp-tooltip-arrow-size: 8px;--drp-month-min-width: 280px;--drp-month-min-width-inline: 250px;--drp-calendar-max-width: calc(100vw - 2rem) }.drp-input{width:100%;font-family:var(--drp-font-family, var(--base-font-family, inherit));font-size:var(--drp-input-size-md-font);line-height:var(--drp-line-height-normal);color:var(--drp-input-color);background-color:var(--drp-input-background);border:var(--drp-input-border);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:var(--drp-input-border-hover)}.drp-input:focus{outline:none;border:var(--drp-input-border-focus);box-shadow:0 0 0 var(--drp-input-focus-shadow-size) var(--drp-input-focus-shadow-color)}.drp-input:disabled{opacity:var(--drp-opacity-disabled);cursor:not-allowed;background-color:var(--drp-input-background-disabled)}.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:var(--drp-z-index-dropdown);font-family:var(--drp-font-family, var(--base-font-family, inherit));background:var(--drp-dropdown-background);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius-lg);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:var(--drp-month-min-width);max-width:var(--drp-calendar-max-width);box-sizing:border-box;-webkit-user-select:none;user-select:none}.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:var(--drp-month-min-width);display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:var(--drp-month-min-width-inline)}.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:var(--drp-nav-size);height:var(--drp-nav-size);display:flex;align-items:center;justify-content:center;border:var(--drp-nav-border);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:var(--drp-nav-border-hover-full)}.drp-date-picker__nav:active{background-color:var(--drp-nav-bg-active)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:var(--drp-opacity-disabled);cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border:var(--drp-nav-border)}.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;gap:var(--drp-spacing-xs)}.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-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-rolling-border);border-radius:var(--drp-border-radius-lg);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:var(--drp-rolling-scrollbar-width)}.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:var(--drp-rolling-item-padding-v) var(--drp-rolling-item-padding-h);cursor:pointer;font-size:var(--drp-rolling-item-font-size);color:var(--drp-rolling-item-color);min-height:var(--drp-rolling-item-min-height);flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content)}.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:var(--drp-rolling-item-font-weight-selected)}.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-dropdown-background);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-rolling-border);border-radius:var(--drp-border-radius-lg);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:var(--drp-rolling-scrollbar-width)}.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:var(--drp-rolling-item-padding-v) var(--drp-rolling-item-padding-h);cursor:pointer;font-size:var(--drp-rolling-item-font-size);min-height:var(--drp-rolling-item-min-height);flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content)}.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:var(--drp-rolling-item-font-weight-selected)}.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-sm);cursor:pointer;border:var(--drp-day-border-width) solid var(--drp-day-border-color);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:var(--drp-day-focused-outline-width) solid var(--drp-day-focused-outline);outline-offset:var(--drp-day-focused-outline-offset)}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:var(--drp-opacity-disabled);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,var(--drp-day-disabled-pattern-opacity)) 0px,rgba(0,0,0,var(--drp-day-disabled-pattern-opacity)) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius-sm);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--disabled.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) calc(var(--drp-day-in-range-bg-opacity) * 100%),transparent)}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:var(--drp-opacity-other-month)}.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) calc(var(--drp-day-in-range-bg-opacity) * 100%),transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) calc(var(--drp-day-in-range-hover-bg-opacity) * 100%),transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:var(--drp-opacity-dragging);transform:scale(var(--drp-day-dragging-scale));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) calc(var(--drp-day-drag-preview-bg-opacity) * 100%),transparent);border:var(--drp-day-border-width) var(--drp-day-drag-preview-border-style) 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) calc(var(--drp-day-drag-preview-edge-bg-opacity) * 100%),transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,var(--drp-day-drag-invalid-bg) calc(var(--drp-day-drag-invalid-bg-opacity) * 100%),transparent)!important;border-color:var(--drp-day-drag-invalid-bg)!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,var(--drp-holiday-color) calc(var(--drp-holiday-bg-opacity) * 100%),transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,var(--drp-holiday-color) calc(var(--drp-holiday-hover-bg-opacity) * 100%),transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,var(--drp-event-color) calc(var(--drp-event-bg-opacity) * 100%),transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,var(--drp-event-color) calc(var(--drp-event-hover-bg-opacity) * 100%),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);max-height:var(--drp-badge-row-height);min-height:var(--drp-badge-row-height)}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:var(--drp-badge-padding-v) var(--drp-badge-padding-h);border-radius:var(--drp-badge-border-radius);cursor:pointer;max-height:var(--drp-badge-row-height)}.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:calc(1.12 * var(--drp-rem));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:calc(1.12 * var(--drp-rem));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:calc(1.04 * var(--drp-rem));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-button-border);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-family:inherit;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:var(--drp-button-border-hover-full)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-opacity-disabled);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:transparent;border:var(--drp-button-border)}.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:var(--drp-z-index-tooltip);background-color:var(--drp-tooltip-background);color:var(--drp-tooltip-text-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius-sm);font-size:var(--drp-font-size-xs);line-height:var(--drp-tooltip-line-height);max-width:var(--drp-tooltip-max-width);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-background);width:var(--drp-tooltip-arrow-size);height:var(--drp-tooltip-arrow-size);transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:var(--drp-loading-overlay-background);display:flex;align-items:center;justify-content:center;z-index:var(--drp-z-index-dropdown);border-radius:var(--drp-border-radius-lg)}.drp-date-picker__loading-spinner{width:40px;height:40px;border:4px solid var(--drp-loading-spinner-color);border-top-color:var(--drp-loading-spinner-accent);border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.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}', De = class De {
|
|
2683
2683
|
constructor(a, t = {}) {
|
|
2684
2684
|
b(this, "input");
|
|
2685
2685
|
b(this, "options");
|
|
@@ -2822,7 +2822,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2822
2822
|
const r = this.options.visibleMonthsCount - 1;
|
|
2823
2823
|
(this.options.unifiedNavigationAnchorIndex < 0 || this.options.unifiedNavigationAnchorIndex > r) && (console.warn(`unifiedNavigationAnchorIndex (${this.options.unifiedNavigationAnchorIndex}) out of bounds. Using 0.`), this.options.unifiedNavigationAnchorIndex = 0);
|
|
2824
2824
|
}
|
|
2825
|
-
this.weekStartDay = Xt(this.options.weekStartDay), L.debug("Week starts on day:", this.weekStartDay), L.debug("disabledDatesHandling:", this.options.disabledDatesHandling), this.locale =
|
|
2825
|
+
this.weekStartDay = Xt(this.options.weekStartDay), L.debug("Week starts on day:", this.weekStartDay), L.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), L.debug("Locale:", this.locale, "Weekdays:", this.weekdayNames, "Months:", this.monthNames), this.initializeDateRestrictions(), this.formatInfo = this.parseFormat(this.options.dateFormatMask), L.debug("Format info:", this.formatInfo), this._previousInputValue = "", this.currentDate = /* @__PURE__ */ new Date();
|
|
2826
2826
|
let n;
|
|
2827
2827
|
if (this.options.initialDate)
|
|
2828
2828
|
n = fe(this.options.initialDate) || /* @__PURE__ */ new Date(), L.debug(`Using initialDate: ${n.toISOString()}`);
|
|
@@ -2851,7 +2851,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2851
2851
|
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();
|
|
2852
2852
|
}
|
|
2853
2853
|
init() {
|
|
2854
|
-
L.debug("Init called"), this.createCalendar(), this.input && (this.attachInputListeners(), this.input.value && (L.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,
|
|
2854
|
+
L.debug("Init called"), this.createCalendar(), this.input && (this.attachInputListeners(), this.input.value && (L.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, Ht(this), this.clickOutsideHandler && document.addEventListener("click", this.clickOutsideHandler)), L.debug("Init complete");
|
|
2855
2855
|
}
|
|
2856
2856
|
/**
|
|
2857
2857
|
* Initialize and normalize date restrictions
|
|
@@ -2882,7 +2882,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2882
2882
|
*/
|
|
2883
2883
|
getEffectiveYearRange() {
|
|
2884
2884
|
const a = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2885
|
-
return
|
|
2885
|
+
return Ot(this.options.rollingYearRange, a, this);
|
|
2886
2886
|
}
|
|
2887
2887
|
/**
|
|
2888
2888
|
* Get effective month range considering all constraints
|
|
@@ -2890,7 +2890,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2890
2890
|
* Considers: rollingMonthRange option, or defaults to all months (1-12)
|
|
2891
2891
|
*/
|
|
2892
2892
|
getEffectiveMonthRange() {
|
|
2893
|
-
return
|
|
2893
|
+
return Yt(this.options.rollingMonthRange);
|
|
2894
2894
|
}
|
|
2895
2895
|
/**
|
|
2896
2896
|
* Render action buttons based on configuration
|
|
@@ -3094,7 +3094,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3094
3094
|
* @returns true if Apply button is required and events should be deferred
|
|
3095
3095
|
*/
|
|
3096
3096
|
requiresApplyButton() {
|
|
3097
|
-
return this.options.autoClose === "apply"
|
|
3097
|
+
return this.options.autoClose === "apply";
|
|
3098
3098
|
}
|
|
3099
3099
|
/**
|
|
3100
3100
|
* Determine if calendar should auto-close after selection
|
|
@@ -3281,7 +3281,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3281
3281
|
a.preventDefault();
|
|
3282
3282
|
}
|
|
3283
3283
|
} else if (a.key === "t" || a.key === "T")
|
|
3284
|
-
this.monthDates[this.activeMonthIndex] = /* @__PURE__ */ new Date(),
|
|
3284
|
+
this.monthDates[this.activeMonthIndex] = /* @__PURE__ */ new Date(), ge(this, this.activeMonthIndex), this.renderCalendar(), setTimeout(() => {
|
|
3285
3285
|
const i = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), s = i == null ? void 0 : i.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3286
3286
|
if (s) {
|
|
3287
3287
|
const d = Array.from(s).findIndex((l) => l.classList.contains("drp-date-picker__day--today"));
|
|
@@ -3441,57 +3441,57 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3441
3441
|
}
|
|
3442
3442
|
// UI methods - wrappers for pure functions
|
|
3443
3443
|
show() {
|
|
3444
|
-
return
|
|
3444
|
+
return Nt(this);
|
|
3445
3445
|
}
|
|
3446
3446
|
hide() {
|
|
3447
|
-
return
|
|
3447
|
+
return Ft(this);
|
|
3448
3448
|
}
|
|
3449
3449
|
toggle() {
|
|
3450
|
-
return
|
|
3450
|
+
return cn(this);
|
|
3451
3451
|
}
|
|
3452
3452
|
position() {
|
|
3453
|
-
return
|
|
3453
|
+
return Ue(this);
|
|
3454
3454
|
}
|
|
3455
3455
|
showTooltip(a, t) {
|
|
3456
|
-
return
|
|
3456
|
+
return un(this, a, t);
|
|
3457
3457
|
}
|
|
3458
3458
|
hideTooltip() {
|
|
3459
|
-
return
|
|
3459
|
+
return pn(this);
|
|
3460
3460
|
}
|
|
3461
3461
|
// Rendering methods - wrappers for pure functions
|
|
3462
3462
|
renderCalendar() {
|
|
3463
|
-
return
|
|
3463
|
+
return wn(this);
|
|
3464
3464
|
}
|
|
3465
3465
|
renderNormalView(a) {
|
|
3466
|
-
return
|
|
3466
|
+
return Bt(this, a);
|
|
3467
3467
|
}
|
|
3468
3468
|
renderDays(a, t) {
|
|
3469
|
-
return
|
|
3469
|
+
return Vt(this, a, t);
|
|
3470
3470
|
}
|
|
3471
3471
|
renderRollingSelector(a) {
|
|
3472
|
-
return
|
|
3472
|
+
return qt(this, a);
|
|
3473
3473
|
}
|
|
3474
3474
|
updateSummary() {
|
|
3475
|
-
return
|
|
3475
|
+
return Sn(this);
|
|
3476
3476
|
}
|
|
3477
3477
|
updateSummaryWithPreview() {
|
|
3478
|
-
return
|
|
3478
|
+
return Ut(this);
|
|
3479
3479
|
}
|
|
3480
3480
|
updateDragPreview() {
|
|
3481
|
-
return
|
|
3481
|
+
return Cn(this);
|
|
3482
3482
|
}
|
|
3483
3483
|
// Navigation methods - wrappers for pure functions
|
|
3484
3484
|
toggleRollingSelector(a) {
|
|
3485
|
-
return
|
|
3485
|
+
return gn(this, a);
|
|
3486
3486
|
}
|
|
3487
3487
|
selectYear(a, t) {
|
|
3488
|
-
return
|
|
3488
|
+
return hn(this, a, t);
|
|
3489
3489
|
}
|
|
3490
3490
|
selectMonth(a, t) {
|
|
3491
|
-
return
|
|
3491
|
+
return fn(this, a, t);
|
|
3492
3492
|
}
|
|
3493
3493
|
checkAndResolveCollisions(a) {
|
|
3494
|
-
return
|
|
3494
|
+
return ge(this, a);
|
|
3495
3495
|
}
|
|
3496
3496
|
prevMonth(a) {
|
|
3497
3497
|
return ye(this, a);
|
|
@@ -3501,75 +3501,75 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3501
3501
|
}
|
|
3502
3502
|
// Unified navigation methods
|
|
3503
3503
|
unifiedPrevMonth() {
|
|
3504
|
-
return
|
|
3504
|
+
return yn(this);
|
|
3505
3505
|
}
|
|
3506
3506
|
unifiedNextMonth() {
|
|
3507
|
-
return
|
|
3507
|
+
return bn(this);
|
|
3508
3508
|
}
|
|
3509
3509
|
toggleUnifiedRollingSelector() {
|
|
3510
|
-
return
|
|
3510
|
+
return Dn(this);
|
|
3511
3511
|
}
|
|
3512
3512
|
setUnifiedMonth(a) {
|
|
3513
|
-
return
|
|
3513
|
+
return vn(this, a);
|
|
3514
3514
|
}
|
|
3515
3515
|
setUnifiedYear(a) {
|
|
3516
|
-
return
|
|
3516
|
+
return _n(this, a);
|
|
3517
3517
|
}
|
|
3518
3518
|
findNextEnabledDayIndex(a, t, n, r) {
|
|
3519
3519
|
return me(this, a, t, n);
|
|
3520
3520
|
}
|
|
3521
3521
|
moveFocus(a) {
|
|
3522
|
-
return
|
|
3522
|
+
return mn(this, a);
|
|
3523
3523
|
}
|
|
3524
3524
|
// Selection methods - wrappers for pure functions
|
|
3525
3525
|
async selectDay(a) {
|
|
3526
|
-
return await
|
|
3526
|
+
return await tn(this, a);
|
|
3527
3527
|
}
|
|
3528
3528
|
selectToday() {
|
|
3529
|
-
return
|
|
3529
|
+
return an(this);
|
|
3530
3530
|
}
|
|
3531
3531
|
clearSelection() {
|
|
3532
|
-
return
|
|
3532
|
+
return nn(this);
|
|
3533
3533
|
}
|
|
3534
3534
|
apply() {
|
|
3535
|
-
return
|
|
3535
|
+
return rn(this);
|
|
3536
3536
|
}
|
|
3537
3537
|
// Interaction methods - wrappers for pure functions
|
|
3538
3538
|
initDragListeners() {
|
|
3539
|
-
return
|
|
3539
|
+
return on(this);
|
|
3540
3540
|
}
|
|
3541
3541
|
startDrag(a, t, n) {
|
|
3542
|
-
return
|
|
3542
|
+
return Lt(this, a, t, n);
|
|
3543
3543
|
}
|
|
3544
3544
|
onDragMove(a) {
|
|
3545
|
-
return
|
|
3545
|
+
return $t(this, a);
|
|
3546
3546
|
}
|
|
3547
3547
|
async onDragEnd(a) {
|
|
3548
|
-
return await
|
|
3548
|
+
return await zt(this);
|
|
3549
3549
|
}
|
|
3550
3550
|
findNearestEnabledDate(a, t = "forward") {
|
|
3551
|
-
return
|
|
3551
|
+
return ke(this, a, t);
|
|
3552
3552
|
}
|
|
3553
3553
|
handleInputMask(a) {
|
|
3554
|
-
return
|
|
3554
|
+
return sn(this, a);
|
|
3555
3555
|
}
|
|
3556
3556
|
applyMask(a) {
|
|
3557
|
-
return
|
|
3557
|
+
return pe(this, a);
|
|
3558
3558
|
}
|
|
3559
3559
|
applyRangeMask(a) {
|
|
3560
|
-
return
|
|
3560
|
+
return Pt(this, a);
|
|
3561
3561
|
}
|
|
3562
3562
|
handleKeydown(a) {
|
|
3563
|
-
return
|
|
3563
|
+
return dn(this, a);
|
|
3564
3564
|
}
|
|
3565
3565
|
handlePaste(a) {
|
|
3566
|
-
return
|
|
3566
|
+
return ln(this, a);
|
|
3567
3567
|
}
|
|
3568
3568
|
updateCalendarFromInput() {
|
|
3569
|
-
return
|
|
3569
|
+
return He(this);
|
|
3570
3570
|
}
|
|
3571
3571
|
parseAndUpdateSingleDate(a, t = "single") {
|
|
3572
|
-
return
|
|
3572
|
+
return Se(this, a, t);
|
|
3573
3573
|
}
|
|
3574
3574
|
/**
|
|
3575
3575
|
* Inject global styles for the date picker
|
|
@@ -3621,7 +3621,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3621
3621
|
};
|
|
3622
3622
|
// Static flag to track if styles have been injected
|
|
3623
3623
|
b(De, "stylesInjected", !1);
|
|
3624
|
-
let
|
|
3624
|
+
let We = De;
|
|
3625
3625
|
class Wt extends HTMLElement {
|
|
3626
3626
|
constructor() {
|
|
3627
3627
|
super();
|
|
@@ -3809,7 +3809,7 @@ class Wt extends HTMLElement {
|
|
|
3809
3809
|
showClearButton: this.hasAttribute("show-clear-button") ? this.getAttribute("show-clear-button") === "true" : void 0,
|
|
3810
3810
|
showApplyButton: this.hasAttribute("show-apply-button") ? this.getAttribute("show-apply-button") === "true" : void 0
|
|
3811
3811
|
}, d = t === "inline" ? null : this.inputElement;
|
|
3812
|
-
if (this.picker = new
|
|
3812
|
+
if (this.picker = new We(d, s), this._customStylesCallback) {
|
|
3813
3813
|
const l = this._customStylesCallback();
|
|
3814
3814
|
if (l) {
|
|
3815
3815
|
const c = document.createElement("style");
|
|
@@ -4146,10 +4146,10 @@ function An() {
|
|
|
4146
4146
|
return Array.from(document.querySelectorAll("web-daterangepicker"));
|
|
4147
4147
|
}
|
|
4148
4148
|
typeof window < "u" && (window.components = window.components || {}, window.components["web-daterangepicker"] = {
|
|
4149
|
-
version: () => "1.
|
|
4149
|
+
version: () => "1.9.0",
|
|
4150
4150
|
config: {
|
|
4151
4151
|
name: "@keenmate/web-daterangepicker",
|
|
4152
|
-
version: "1.
|
|
4152
|
+
version: "1.9.0",
|
|
4153
4153
|
author: "Keenmate",
|
|
4154
4154
|
license: "MIT",
|
|
4155
4155
|
repository: "git+https://github.com/keenmate/web-daterangepicker.git",
|
|
@@ -4162,12 +4162,12 @@ typeof window < "u" && (window.components = window.components || {}, window.comp
|
|
|
4162
4162
|
logging: {
|
|
4163
4163
|
enableLogging: ft,
|
|
4164
4164
|
disableLogging: mt,
|
|
4165
|
-
setLogLevel:
|
|
4165
|
+
setLogLevel: Ke,
|
|
4166
4166
|
setCategoryLevel: ua,
|
|
4167
4167
|
getCategories: pa
|
|
4168
4168
|
}
|
|
4169
4169
|
}, window.components["web-daterangepicker"].register());
|
|
4170
4170
|
export {
|
|
4171
|
-
|
|
4171
|
+
We as DateRangePicker,
|
|
4172
4172
|
Wt as WebDaterangepickerElement
|
|
4173
4173
|
};
|