@spear-ai/spectral 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateTimePicker/Calendar.js +364 -359
- package/dist/DateTimePicker/DateTimeUtils.js +2 -2
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +4 -4
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
- package/dist/MultiSelect/MultiSelectBase.js +29 -29
- package/dist/RadioGroup.js +2 -2
- package/dist/Select.js +38 -38
- package/dist/Tabs/TabsBase.js +2 -2
- package/dist/Tray.js +2 -2
- package/dist/index-Cl8VeY0o.js +149 -0
- package/dist/{proxy-CgaCj1WQ.js → proxy-CO_-Vget.js} +3107 -2803
- package/dist/styles/spectral.css +1 -1
- package/dist/{use-animation-CR-SdV2l.js → use-animation-DhEPRwZ3.js} +1 -1
- package/dist/utils/twUtils.js +528 -369
- package/package.json +33 -33
- package/dist/index-DdFoGvON.js +0 -146
|
@@ -146,19 +146,19 @@ function Pn(e) {
|
|
|
146
146
|
function Mt(e) {
|
|
147
147
|
const t = ie(e.timeZone, e), r = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
|
|
148
148
|
n.setUTCHours(n.getUTCHours() - 1);
|
|
149
|
-
const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(),
|
|
150
|
-
|
|
149
|
+
const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), i = o - a, s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
150
|
+
i && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + i);
|
|
151
151
|
const c = o - r;
|
|
152
152
|
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
153
153
|
const u = /* @__PURE__ */ new Date(+e);
|
|
154
154
|
u.setUTCSeconds(0);
|
|
155
155
|
const f = o > 0 ? u.getSeconds() : (u.getSeconds() - 60) % 60, l = Math.round(-(ie(e.timeZone, e) * 60)) % 60;
|
|
156
156
|
(l || f) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + l), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + l + f));
|
|
157
|
-
const h = ie(e.timeZone, e),
|
|
158
|
-
if (
|
|
159
|
-
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) +
|
|
160
|
-
const
|
|
161
|
-
|
|
157
|
+
const h = ie(e.timeZone, e), g = h > 0 ? Math.floor(h) : Math.ceil(h), C = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - g, O = g !== r, T = C - c;
|
|
158
|
+
if (O && T) {
|
|
159
|
+
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + T);
|
|
160
|
+
const M = ie(e.timeZone, e), b = M > 0 ? Math.floor(M) : Math.ceil(M), D = g - b;
|
|
161
|
+
D && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + D), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + D));
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
class A extends J {
|
|
@@ -233,12 +233,12 @@ function Ot(e, t, r) {
|
|
|
233
233
|
if (isNaN(t)) return I(e, NaN);
|
|
234
234
|
if (!t)
|
|
235
235
|
return n;
|
|
236
|
-
const o = n.getDate(),
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
return o >=
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
const o = n.getDate(), a = I(e, n.getTime());
|
|
237
|
+
a.setMonth(n.getMonth() + t + 1, 0);
|
|
238
|
+
const i = a.getDate();
|
|
239
|
+
return o >= i ? a : (n.setFullYear(
|
|
240
|
+
a.getFullYear(),
|
|
241
|
+
a.getMonth(),
|
|
242
242
|
o
|
|
243
243
|
), n);
|
|
244
244
|
}
|
|
@@ -247,8 +247,8 @@ function De() {
|
|
|
247
247
|
return _n;
|
|
248
248
|
}
|
|
249
249
|
function de(e, t) {
|
|
250
|
-
const r = De(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = P(e, t?.in),
|
|
251
|
-
return o.setDate(o.getDate() -
|
|
250
|
+
const r = De(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = P(e, t?.in), a = o.getDay(), i = (a < n ? 7 : 0) + a - n;
|
|
251
|
+
return o.setDate(o.getDate() - i), o.setHours(0, 0, 0, 0), o;
|
|
252
252
|
}
|
|
253
253
|
function we(e, t) {
|
|
254
254
|
return de(e, { ...t, weekStartsOn: 1 });
|
|
@@ -256,10 +256,10 @@ function we(e, t) {
|
|
|
256
256
|
function vt(e, t) {
|
|
257
257
|
const r = P(e, t?.in), n = r.getFullYear(), o = I(r, 0);
|
|
258
258
|
o.setFullYear(n + 1, 0, 4), o.setHours(0, 0, 0, 0);
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
const s = we(
|
|
262
|
-
return r.getTime() >=
|
|
259
|
+
const a = we(o), i = I(r, 0);
|
|
260
|
+
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
|
|
261
|
+
const s = we(i);
|
|
262
|
+
return r.getTime() >= a.getTime() ? n + 1 : r.getTime() >= s.getTime() ? n : n - 1;
|
|
263
263
|
}
|
|
264
264
|
function lt(e) {
|
|
265
265
|
const t = P(e), r = new Date(
|
|
@@ -291,7 +291,7 @@ function Qe(e, t, r) {
|
|
|
291
291
|
r?.in,
|
|
292
292
|
e,
|
|
293
293
|
t
|
|
294
|
-
),
|
|
294
|
+
), a = Me(n), i = Me(o), s = +a - lt(a), c = +i - lt(i);
|
|
295
295
|
return Math.round((s - c) / En);
|
|
296
296
|
}
|
|
297
297
|
function Fn(e, t) {
|
|
@@ -308,16 +308,16 @@ function Hn(e, t) {
|
|
|
308
308
|
let r, n = t?.in;
|
|
309
309
|
return e.forEach((o) => {
|
|
310
310
|
!n && typeof o == "object" && (n = I.bind(null, o));
|
|
311
|
-
const
|
|
312
|
-
(!r || r <
|
|
311
|
+
const a = P(o, n);
|
|
312
|
+
(!r || r < a || isNaN(+a)) && (r = a);
|
|
313
313
|
}), I(n, r || NaN);
|
|
314
314
|
}
|
|
315
315
|
function An(e, t) {
|
|
316
316
|
let r, n = t?.in;
|
|
317
317
|
return e.forEach((o) => {
|
|
318
318
|
!n && typeof o == "object" && (n = I.bind(null, o));
|
|
319
|
-
const
|
|
320
|
-
(!r || r >
|
|
319
|
+
const a = P(o, n);
|
|
320
|
+
(!r || r > a || isNaN(+a)) && (r = a);
|
|
321
321
|
}), I(n, r || NaN);
|
|
322
322
|
}
|
|
323
323
|
function qn(e, t, r) {
|
|
@@ -339,8 +339,8 @@ function St(e, t, r) {
|
|
|
339
339
|
r?.in,
|
|
340
340
|
e,
|
|
341
341
|
t
|
|
342
|
-
),
|
|
343
|
-
return
|
|
342
|
+
), a = n.getFullYear() - o.getFullYear(), i = n.getMonth() - o.getMonth();
|
|
343
|
+
return a * 12 + i;
|
|
344
344
|
}
|
|
345
345
|
function Gn(e, t) {
|
|
346
346
|
const r = P(e, t?.in), n = r.getMonth();
|
|
@@ -353,12 +353,12 @@ function Ct(e, t) {
|
|
|
353
353
|
function $n(e, t) {
|
|
354
354
|
const { start: r, end: n } = Ct(t?.in, e);
|
|
355
355
|
let o = +r > +n;
|
|
356
|
-
const
|
|
357
|
-
|
|
356
|
+
const a = o ? +r : +n, i = o ? n : r;
|
|
357
|
+
i.setHours(0, 0, 0, 0), i.setDate(1);
|
|
358
358
|
let s = 1;
|
|
359
359
|
const c = [];
|
|
360
|
-
for (; +
|
|
361
|
-
c.push(I(r,
|
|
360
|
+
for (; +i <= a; )
|
|
361
|
+
c.push(I(r, i)), i.setMonth(i.getMonth() + s);
|
|
362
362
|
return o ? c.reverse() : c;
|
|
363
363
|
}
|
|
364
364
|
function Rn(e, t) {
|
|
@@ -376,17 +376,17 @@ function Nt(e, t) {
|
|
|
376
376
|
function Qn(e, t) {
|
|
377
377
|
const { start: r, end: n } = Ct(t?.in, e);
|
|
378
378
|
let o = +r > +n;
|
|
379
|
-
const
|
|
380
|
-
|
|
379
|
+
const a = o ? +r : +n, i = o ? n : r;
|
|
380
|
+
i.setHours(0, 0, 0, 0), i.setMonth(0, 1);
|
|
381
381
|
let s = 1;
|
|
382
382
|
const c = [];
|
|
383
|
-
for (; +
|
|
384
|
-
c.push(I(r,
|
|
383
|
+
for (; +i <= a; )
|
|
384
|
+
c.push(I(r, i)), i.setFullYear(i.getFullYear() + s);
|
|
385
385
|
return o ? c.reverse() : c;
|
|
386
386
|
}
|
|
387
387
|
function Yt(e, t) {
|
|
388
|
-
const r = De(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = P(e, t?.in),
|
|
389
|
-
return o.setDate(o.getDate() +
|
|
388
|
+
const r = De(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = P(e, t?.in), a = o.getDay(), i = (a < n ? -7 : 0) + 6 - (a - n);
|
|
389
|
+
return o.setDate(o.getDate() + i), o.setHours(23, 59, 59, 999), o;
|
|
390
390
|
}
|
|
391
391
|
function Xn(e, t) {
|
|
392
392
|
return Yt(e, { ...t, weekStartsOn: 1 });
|
|
@@ -505,14 +505,14 @@ function me(e) {
|
|
|
505
505
|
const n = r?.context ? String(r.context) : "standalone";
|
|
506
506
|
let o;
|
|
507
507
|
if (n === "formatting" && e.formattingValues) {
|
|
508
|
-
const
|
|
509
|
-
o = e.formattingValues[s] || e.formattingValues[
|
|
508
|
+
const i = e.defaultFormattingWidth || e.defaultWidth, s = r?.width ? String(r.width) : i;
|
|
509
|
+
o = e.formattingValues[s] || e.formattingValues[i];
|
|
510
510
|
} else {
|
|
511
|
-
const
|
|
512
|
-
o = e.values[s] || e.values[
|
|
511
|
+
const i = e.defaultWidth, s = r?.width ? String(r.width) : e.defaultWidth;
|
|
512
|
+
o = e.values[s] || e.values[i];
|
|
513
513
|
}
|
|
514
|
-
const
|
|
515
|
-
return o[
|
|
514
|
+
const a = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
515
|
+
return o[a];
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
const nr = {
|
|
@@ -668,19 +668,19 @@ const nr = {
|
|
|
668
668
|
};
|
|
669
669
|
function ye(e) {
|
|
670
670
|
return (t, r = {}) => {
|
|
671
|
-
const n = r.width, o = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth],
|
|
672
|
-
if (!
|
|
671
|
+
const n = r.width, o = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], a = t.match(o);
|
|
672
|
+
if (!a)
|
|
673
673
|
return null;
|
|
674
|
-
const
|
|
674
|
+
const i = a[0], s = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? fr(s, (l) => l.test(i)) : (
|
|
675
675
|
// [TODO] -- I challenge you to fix the type
|
|
676
|
-
lr(s, (l) => l.test(
|
|
676
|
+
lr(s, (l) => l.test(i))
|
|
677
677
|
);
|
|
678
678
|
let u;
|
|
679
679
|
u = e.valueCallback ? e.valueCallback(c) : c, u = r.valueCallback ? (
|
|
680
680
|
// [TODO] -- I challenge you to fix the type
|
|
681
681
|
r.valueCallback(u)
|
|
682
682
|
) : u;
|
|
683
|
-
const f = t.slice(
|
|
683
|
+
const f = t.slice(i.length);
|
|
684
684
|
return { value: u, rest: f };
|
|
685
685
|
};
|
|
686
686
|
}
|
|
@@ -698,12 +698,12 @@ function dr(e) {
|
|
|
698
698
|
return (t, r = {}) => {
|
|
699
699
|
const n = t.match(e.matchPattern);
|
|
700
700
|
if (!n) return null;
|
|
701
|
-
const o = n[0],
|
|
702
|
-
if (!
|
|
703
|
-
let
|
|
704
|
-
|
|
701
|
+
const o = n[0], a = t.match(e.parsePattern);
|
|
702
|
+
if (!a) return null;
|
|
703
|
+
let i = e.valueCallback ? e.valueCallback(a[0]) : a[0];
|
|
704
|
+
i = r.valueCallback ? r.valueCallback(i) : i;
|
|
705
705
|
const s = t.slice(o.length);
|
|
706
|
-
return { value:
|
|
706
|
+
return { value: i, rest: s };
|
|
707
707
|
};
|
|
708
708
|
}
|
|
709
709
|
const hr = /^(\d+)(th|st|nd|rd)?/i, mr = /\d+/i, yr = {
|
|
@@ -831,16 +831,16 @@ function Xe(e, t) {
|
|
|
831
831
|
return Math.round(n / Dt) + 1;
|
|
832
832
|
}
|
|
833
833
|
function Tt(e, t) {
|
|
834
|
-
const r = P(e, t?.in), n = r.getFullYear(), o = De(),
|
|
835
|
-
|
|
836
|
-
const s = de(
|
|
837
|
-
c.setFullYear(n, 0,
|
|
834
|
+
const r = P(e, t?.in), n = r.getFullYear(), o = De(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, i = I(t?.in || e, 0);
|
|
835
|
+
i.setFullYear(n + 1, 0, a), i.setHours(0, 0, 0, 0);
|
|
836
|
+
const s = de(i, t), c = I(t?.in || e, 0);
|
|
837
|
+
c.setFullYear(n, 0, a), c.setHours(0, 0, 0, 0);
|
|
838
838
|
const u = de(c, t);
|
|
839
839
|
return +r >= +s ? n + 1 : +r >= +u ? n : n - 1;
|
|
840
840
|
}
|
|
841
841
|
function Cr(e, t) {
|
|
842
|
-
const r = De(), n = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = Tt(e, t),
|
|
843
|
-
return
|
|
842
|
+
const r = De(), n = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = Tt(e, t), a = I(t?.in || e, 0);
|
|
843
|
+
return a.setFullYear(o, 0, n), a.setHours(0, 0, 0, 0), de(a, t);
|
|
844
844
|
}
|
|
845
845
|
function Ue(e, t) {
|
|
846
846
|
const r = P(e, t?.in), n = +de(r, t) - +Cr(r, t);
|
|
@@ -937,12 +937,12 @@ const se = {
|
|
|
937
937
|
},
|
|
938
938
|
// Local week-numbering year
|
|
939
939
|
Y: function(e, t, r, n) {
|
|
940
|
-
const o = Tt(e, n),
|
|
940
|
+
const o = Tt(e, n), a = o > 0 ? o : 1 - o;
|
|
941
941
|
if (t === "YY") {
|
|
942
|
-
const
|
|
943
|
-
return x(
|
|
942
|
+
const i = a % 100;
|
|
943
|
+
return x(i, 2);
|
|
944
944
|
}
|
|
945
|
-
return t === "Yo" ? r.ordinalNumber(
|
|
945
|
+
return t === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : x(a, t.length);
|
|
946
946
|
},
|
|
947
947
|
// ISO week-numbering year
|
|
948
948
|
R: function(e, t) {
|
|
@@ -1133,17 +1133,17 @@ const se = {
|
|
|
1133
1133
|
},
|
|
1134
1134
|
// Local day of week
|
|
1135
1135
|
e: function(e, t, r, n) {
|
|
1136
|
-
const o = e.getDay(),
|
|
1136
|
+
const o = e.getDay(), a = (o - n.weekStartsOn + 8) % 7 || 7;
|
|
1137
1137
|
switch (t) {
|
|
1138
1138
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1139
1139
|
case "e":
|
|
1140
|
-
return String(
|
|
1140
|
+
return String(a);
|
|
1141
1141
|
// Padded numerical value
|
|
1142
1142
|
case "ee":
|
|
1143
|
-
return x(
|
|
1143
|
+
return x(a, 2);
|
|
1144
1144
|
// 1st, 2nd, ..., 7th
|
|
1145
1145
|
case "eo":
|
|
1146
|
-
return r.ordinalNumber(
|
|
1146
|
+
return r.ordinalNumber(a, { unit: "day" });
|
|
1147
1147
|
case "eee":
|
|
1148
1148
|
return r.day(o, {
|
|
1149
1149
|
width: "abbreviated",
|
|
@@ -1170,17 +1170,17 @@ const se = {
|
|
|
1170
1170
|
},
|
|
1171
1171
|
// Stand-alone local day of week
|
|
1172
1172
|
c: function(e, t, r, n) {
|
|
1173
|
-
const o = e.getDay(),
|
|
1173
|
+
const o = e.getDay(), a = (o - n.weekStartsOn + 8) % 7 || 7;
|
|
1174
1174
|
switch (t) {
|
|
1175
1175
|
// Numerical value (same as in `e`)
|
|
1176
1176
|
case "c":
|
|
1177
|
-
return String(
|
|
1177
|
+
return String(a);
|
|
1178
1178
|
// Padded numerical value
|
|
1179
1179
|
case "cc":
|
|
1180
|
-
return x(
|
|
1180
|
+
return x(a, t.length);
|
|
1181
1181
|
// 1st, 2nd, ..., 7th
|
|
1182
1182
|
case "co":
|
|
1183
|
-
return r.ordinalNumber(
|
|
1183
|
+
return r.ordinalNumber(a, { unit: "day" });
|
|
1184
1184
|
case "ccc":
|
|
1185
1185
|
return r.day(o, {
|
|
1186
1186
|
width: "abbreviated",
|
|
@@ -1431,15 +1431,15 @@ const se = {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
};
|
|
1433
1433
|
function dt(e, t = "") {
|
|
1434
|
-
const r = e > 0 ? "-" : "+", n = Math.abs(e), o = Math.trunc(n / 60),
|
|
1435
|
-
return
|
|
1434
|
+
const r = e > 0 ? "-" : "+", n = Math.abs(e), o = Math.trunc(n / 60), a = n % 60;
|
|
1435
|
+
return a === 0 ? r + String(o) : r + String(o) + t + x(a, 2);
|
|
1436
1436
|
}
|
|
1437
1437
|
function ht(e, t) {
|
|
1438
1438
|
return e % 60 === 0 ? (e > 0 ? "-" : "+") + x(Math.abs(e) / 60, 2) : ae(e, t);
|
|
1439
1439
|
}
|
|
1440
1440
|
function ae(e, t = "") {
|
|
1441
|
-
const r = e > 0 ? "-" : "+", n = Math.abs(e), o = x(Math.trunc(n / 60), 2),
|
|
1442
|
-
return r + o + t +
|
|
1441
|
+
const r = e > 0 ? "-" : "+", n = Math.abs(e), o = x(Math.trunc(n / 60), 2), a = x(n % 60, 2);
|
|
1442
|
+
return r + o + t + a;
|
|
1443
1443
|
}
|
|
1444
1444
|
const mt = (e, t) => {
|
|
1445
1445
|
switch (e) {
|
|
@@ -1467,22 +1467,22 @@ const mt = (e, t) => {
|
|
|
1467
1467
|
const r = e.match(/(P+)(p+)?/) || [], n = r[1], o = r[2];
|
|
1468
1468
|
if (!o)
|
|
1469
1469
|
return mt(e, t);
|
|
1470
|
-
let
|
|
1470
|
+
let a;
|
|
1471
1471
|
switch (n) {
|
|
1472
1472
|
case "P":
|
|
1473
|
-
|
|
1473
|
+
a = t.dateTime({ width: "short" });
|
|
1474
1474
|
break;
|
|
1475
1475
|
case "PP":
|
|
1476
|
-
|
|
1476
|
+
a = t.dateTime({ width: "medium" });
|
|
1477
1477
|
break;
|
|
1478
1478
|
case "PPP":
|
|
1479
|
-
|
|
1479
|
+
a = t.dateTime({ width: "long" });
|
|
1480
1480
|
break;
|
|
1481
1481
|
default:
|
|
1482
|
-
|
|
1482
|
+
a = t.dateTime({ width: "full" });
|
|
1483
1483
|
break;
|
|
1484
1484
|
}
|
|
1485
|
-
return
|
|
1485
|
+
return a.replace("{{date}}", mt(n, t)).replace("{{time}}", xt(o, t));
|
|
1486
1486
|
}, Yr = {
|
|
1487
1487
|
p: xt,
|
|
1488
1488
|
P: Nr
|
|
@@ -1503,7 +1503,7 @@ function Br(e, t, r) {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
const Ir = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Hr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ar = /^'([^]*?)'?$/, qr = /''/g, jr = /[a-zA-Z]/;
|
|
1505
1505
|
function pe(e, t, r) {
|
|
1506
|
-
const n = De(), o = r?.locale ?? n.locale ?? fe,
|
|
1506
|
+
const n = De(), o = r?.locale ?? n.locale ?? fe, a = r?.firstWeekContainsDate ?? r?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, i = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = P(e, r?.in);
|
|
1507
1507
|
if (!jn(s))
|
|
1508
1508
|
throw new RangeError("Invalid time value");
|
|
1509
1509
|
let c = t.match(Hr).map((f) => {
|
|
@@ -1529,8 +1529,8 @@ function pe(e, t, r) {
|
|
|
1529
1529
|
});
|
|
1530
1530
|
o.localize.preprocessor && (c = o.localize.preprocessor(s, c));
|
|
1531
1531
|
const u = {
|
|
1532
|
-
firstWeekContainsDate:
|
|
1533
|
-
weekStartsOn:
|
|
1532
|
+
firstWeekContainsDate: a,
|
|
1533
|
+
weekStartsOn: i,
|
|
1534
1534
|
locale: o
|
|
1535
1535
|
};
|
|
1536
1536
|
return c.map((f) => {
|
|
@@ -1546,8 +1546,8 @@ function Gr(e) {
|
|
|
1546
1546
|
return t ? t[1].replace(qr, "'") : e;
|
|
1547
1547
|
}
|
|
1548
1548
|
function $r(e, t) {
|
|
1549
|
-
const r = P(e, t?.in), n = r.getFullYear(), o = r.getMonth(),
|
|
1550
|
-
return
|
|
1549
|
+
const r = P(e, t?.in), n = r.getFullYear(), o = r.getMonth(), a = I(r, 0);
|
|
1550
|
+
return a.setFullYear(n, o + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
|
|
1551
1551
|
}
|
|
1552
1552
|
function Rr(e, t) {
|
|
1553
1553
|
return P(e, t?.in).getMonth();
|
|
@@ -1578,10 +1578,10 @@ function Vr(e, t, r) {
|
|
|
1578
1578
|
return n.getFullYear() === o.getFullYear();
|
|
1579
1579
|
}
|
|
1580
1580
|
function Zr(e, t, r) {
|
|
1581
|
-
const n = P(e, r?.in), o = n.getFullYear(),
|
|
1582
|
-
|
|
1583
|
-
const s = $r(
|
|
1584
|
-
return n.setMonth(t, Math.min(
|
|
1581
|
+
const n = P(e, r?.in), o = n.getFullYear(), a = n.getDate(), i = I(e, 0);
|
|
1582
|
+
i.setFullYear(o, t, 15), i.setHours(0, 0, 0, 0);
|
|
1583
|
+
const s = $r(i);
|
|
1584
|
+
return n.setMonth(t, Math.min(a, s)), n;
|
|
1585
1585
|
}
|
|
1586
1586
|
function Kr(e, t, r) {
|
|
1587
1587
|
const n = P(e, r?.in);
|
|
@@ -1589,8 +1589,8 @@ function Kr(e, t, r) {
|
|
|
1589
1589
|
}
|
|
1590
1590
|
const yt = 5, Jr = 4;
|
|
1591
1591
|
function Lr(e, t) {
|
|
1592
|
-
const r = t.startOfMonth(e), n = r.getDay() > 0 ? r.getDay() : 7, o = t.addDays(e, -n + 1),
|
|
1593
|
-
return t.getMonth(e) === t.getMonth(
|
|
1592
|
+
const r = t.startOfMonth(e), n = r.getDay() > 0 ? r.getDay() : 7, o = t.addDays(e, -n + 1), a = t.addDays(o, yt * 7 - 1);
|
|
1593
|
+
return t.getMonth(e) === t.getMonth(a) ? yt : Jr;
|
|
1594
1594
|
}
|
|
1595
1595
|
function Pt(e, t) {
|
|
1596
1596
|
const r = t.startOfMonth(e), n = r.getDay();
|
|
@@ -1605,9 +1605,9 @@ const Et = {
|
|
|
1605
1605
|
labels: {
|
|
1606
1606
|
labelDayButton: (e, t, r, n) => {
|
|
1607
1607
|
let o;
|
|
1608
|
-
n && typeof n.format == "function" ? o = n.format.bind(n) : o = (
|
|
1609
|
-
let
|
|
1610
|
-
return t.today && (
|
|
1608
|
+
n && typeof n.format == "function" ? o = n.format.bind(n) : o = (i, s) => pe(i, s, { locale: fe, ...r });
|
|
1609
|
+
let a = o(e, "PPPP");
|
|
1610
|
+
return t.today && (a = `Today, ${a}`), t.selected && (a = `${a}, selected`), a;
|
|
1611
1611
|
},
|
|
1612
1612
|
labelMonthDropdown: "Choose the Month",
|
|
1613
1613
|
labelNext: "Go to the Next Month",
|
|
@@ -1616,19 +1616,19 @@ const Et = {
|
|
|
1616
1616
|
labelYearDropdown: "Choose the Year",
|
|
1617
1617
|
labelGrid: (e, t, r) => {
|
|
1618
1618
|
let n;
|
|
1619
|
-
return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o,
|
|
1619
|
+
return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o, a) => pe(o, a, { locale: fe, ...t }), n(e, "LLLL yyyy");
|
|
1620
1620
|
},
|
|
1621
1621
|
labelGridcell: (e, t, r, n) => {
|
|
1622
1622
|
let o;
|
|
1623
|
-
n && typeof n.format == "function" ? o = n.format.bind(n) : o = (
|
|
1624
|
-
let
|
|
1625
|
-
return t?.today && (
|
|
1623
|
+
n && typeof n.format == "function" ? o = n.format.bind(n) : o = (i, s) => pe(i, s, { locale: fe, ...r });
|
|
1624
|
+
let a = o(e, "PPPP");
|
|
1625
|
+
return t?.today && (a = `Today, ${a}`), a;
|
|
1626
1626
|
},
|
|
1627
1627
|
labelNav: "Navigation bar",
|
|
1628
1628
|
labelWeekNumberHeader: "Week Number",
|
|
1629
1629
|
labelWeekday: (e, t, r) => {
|
|
1630
1630
|
let n;
|
|
1631
|
-
return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o,
|
|
1631
|
+
return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o, a) => pe(o, a, { locale: fe, ...t }), n(e, "cccc");
|
|
1632
1632
|
}
|
|
1633
1633
|
}
|
|
1634
1634
|
};
|
|
@@ -1640,17 +1640,17 @@ class G {
|
|
|
1640
1640
|
* @param overrides Custom overrides for the date library functions.
|
|
1641
1641
|
*/
|
|
1642
1642
|
constructor(t, r) {
|
|
1643
|
-
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? A.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, o,
|
|
1644
|
-
const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : Qn(n),
|
|
1645
|
-
if (
|
|
1643
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? A.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, o, a) => this.overrides?.newDate ? this.overrides.newDate(n, o, a) : this.options.timeZone ? new A(n, o, a, this.options.timeZone) : new Date(n, o, a), this.addDays = (n, o) => this.overrides?.addDays ? this.overrides.addDays(n, o) : kt(n, o), this.addMonths = (n, o) => this.overrides?.addMonths ? this.overrides.addMonths(n, o) : Ot(n, o), this.addWeeks = (n, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, o) : Bn(n, o), this.addYears = (n, o) => this.overrides?.addYears ? this.overrides.addYears(n, o) : In(n, o), this.differenceInCalendarDays = (n, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, o) : Qe(n, o), this.differenceInCalendarMonths = (n, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, o) : St(n, o), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : $n(n), this.eachYearOfInterval = (n) => {
|
|
1644
|
+
const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : Qn(n), a = new Set(o.map((s) => this.getYear(s)));
|
|
1645
|
+
if (a.size === o.length)
|
|
1646
1646
|
return o;
|
|
1647
|
-
const
|
|
1648
|
-
return
|
|
1649
|
-
|
|
1650
|
-
}),
|
|
1651
|
-
}, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : eo(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : Xn(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Gn(n), this.endOfWeek = (n, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, o) : Yt(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : zn(n), this.format = (n, o,
|
|
1652
|
-
const
|
|
1653
|
-
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(
|
|
1647
|
+
const i = [];
|
|
1648
|
+
return a.forEach((s) => {
|
|
1649
|
+
i.push(new Date(s, 0, 1));
|
|
1650
|
+
}), i;
|
|
1651
|
+
}, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : eo(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : Xn(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Gn(n), this.endOfWeek = (n, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, o) : Yt(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : zn(n), this.format = (n, o, a) => {
|
|
1652
|
+
const i = this.overrides?.format ? this.overrides.format(n, o, this.options) : pe(n, o, this.options);
|
|
1653
|
+
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
1654
1654
|
}, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Xe(n), this.getMonth = (n, o) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : Rr(n, this.options), this.getYear = (n, o) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : zr(n, this.options), this.getWeek = (n, o) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : Ue(n, this.options), this.isAfter = (n, o) => this.overrides?.isAfter ? this.overrides.isAfter(n, o) : Qr(n, o), this.isBefore = (n, o) => this.overrides?.isBefore ? this.overrides.isBefore(n, o) : Xr(n, o), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : Wt(n), this.isSameDay = (n, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, o) : qn(n, o), this.isSameMonth = (n, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, o) : Ur(n, o), this.isSameYear = (n, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, o) : Vr(n, o), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : Hn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : An(n), this.setMonth = (n, o) => this.overrides?.setMonth ? this.overrides.setMonth(n, o) : Zr(n, o), this.setYear = (n, o) => this.overrides?.setYear ? this.overrides.setYear(n, o) : Kr(n, o), this.startOfBroadcastWeek = (n, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : Pt(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : Me(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : we(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : Rn(n), this.startOfWeek = (n, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(n, this.options) : de(n, this.options), this.startOfYear = (n) => this.overrides?.startOfYear ? this.overrides.startOfYear(n) : Nt(n), this.options = { locale: Et, ...t }, this.overrides = r;
|
|
1655
1655
|
}
|
|
1656
1656
|
/**
|
|
@@ -1703,10 +1703,10 @@ class G {
|
|
|
1703
1703
|
* @since 9.11.0
|
|
1704
1704
|
*/
|
|
1705
1705
|
formatMonthYear(t) {
|
|
1706
|
-
const { locale: r, timeZone: n, numerals: o } = this.options,
|
|
1707
|
-
if (
|
|
1706
|
+
const { locale: r, timeZone: n, numerals: o } = this.options, a = r?.code;
|
|
1707
|
+
if (a && G.yearFirstLocales.has(a))
|
|
1708
1708
|
try {
|
|
1709
|
-
return new Intl.DateTimeFormat(
|
|
1709
|
+
return new Intl.DateTimeFormat(a, {
|
|
1710
1710
|
month: "long",
|
|
1711
1711
|
year: "numeric",
|
|
1712
1712
|
timeZone: n,
|
|
@@ -1714,8 +1714,8 @@ class G {
|
|
|
1714
1714
|
}).format(t);
|
|
1715
1715
|
} catch {
|
|
1716
1716
|
}
|
|
1717
|
-
const
|
|
1718
|
-
return this.format(t,
|
|
1717
|
+
const i = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
1718
|
+
return this.format(t, i);
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
1721
|
G.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
@@ -1810,11 +1810,11 @@ var j;
|
|
|
1810
1810
|
e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
|
|
1811
1811
|
})(j || (j = {}));
|
|
1812
1812
|
function co(e) {
|
|
1813
|
-
const { options: t, className: r, components: n, classNames: o, ...
|
|
1813
|
+
const { options: t, className: r, components: n, classNames: o, ...a } = e, i = [o[y.Dropdown], r].join(" "), s = t?.find(({ value: c }) => c === a.value);
|
|
1814
1814
|
return d.createElement(
|
|
1815
1815
|
"span",
|
|
1816
|
-
{ "data-disabled":
|
|
1817
|
-
d.createElement(n.Select, { className:
|
|
1816
|
+
{ "data-disabled": a.disabled, className: o[y.DropdownRoot] },
|
|
1817
|
+
d.createElement(n.Select, { className: i, ...a }, t?.map(({ value: c, label: u, disabled: f }) => d.createElement(n.Option, { key: c, value: c, disabled: f }, u))),
|
|
1818
1818
|
d.createElement(
|
|
1819
1819
|
"span",
|
|
1820
1820
|
{ className: o[y.CaptionLabel], "aria-hidden": !0 },
|
|
@@ -1855,23 +1855,23 @@ function go(e) {
|
|
|
1855
1855
|
return d.createElement(t.Dropdown, { ...e });
|
|
1856
1856
|
}
|
|
1857
1857
|
function po(e) {
|
|
1858
|
-
const { onPreviousClick: t, onNextClick: r, previousMonth: n, nextMonth: o, ...
|
|
1858
|
+
const { onPreviousClick: t, onNextClick: r, previousMonth: n, nextMonth: o, ...a } = e, { components: i, classNames: s, labels: { labelPrevious: c, labelNext: u } } = ke(), f = R((h) => {
|
|
1859
1859
|
o && r?.(h);
|
|
1860
1860
|
}, [o, r]), l = R((h) => {
|
|
1861
1861
|
n && t?.(h);
|
|
1862
1862
|
}, [n, t]);
|
|
1863
1863
|
return d.createElement(
|
|
1864
1864
|
"nav",
|
|
1865
|
-
{ ...
|
|
1865
|
+
{ ...a },
|
|
1866
1866
|
d.createElement(
|
|
1867
|
-
|
|
1867
|
+
i.PreviousMonthButton,
|
|
1868
1868
|
{ type: "button", className: s[y.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": c(n), onClick: l },
|
|
1869
|
-
d.createElement(
|
|
1869
|
+
d.createElement(i.Chevron, { disabled: n ? void 0 : !0, className: s[y.Chevron], orientation: "left" })
|
|
1870
1870
|
),
|
|
1871
1871
|
d.createElement(
|
|
1872
|
-
|
|
1872
|
+
i.NextMonthButton,
|
|
1873
1873
|
{ type: "button", className: s[y.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": u(o), onClick: f },
|
|
1874
|
-
d.createElement(
|
|
1874
|
+
d.createElement(i.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: s[y.Chevron] })
|
|
1875
1875
|
)
|
|
1876
1876
|
);
|
|
1877
1877
|
}
|
|
@@ -1951,9 +1951,9 @@ const To = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1951
1951
|
YearsDropdown: Yo
|
|
1952
1952
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1953
1953
|
function ne(e, t, r = !1, n = L) {
|
|
1954
|
-
let { from: o, to:
|
|
1955
|
-
const { differenceInCalendarDays:
|
|
1956
|
-
return o &&
|
|
1954
|
+
let { from: o, to: a } = e;
|
|
1955
|
+
const { differenceInCalendarDays: i, isSameDay: s } = n;
|
|
1956
|
+
return o && a ? (i(a, o) < 0 && ([o, a] = [a, o]), i(t, o) >= (r ? 1 : 0) && i(a, t) >= (r ? 1 : 0)) : !r && a ? s(a, t) : !r && o ? s(o, t) : !1;
|
|
1957
1957
|
}
|
|
1958
1958
|
function Ve(e) {
|
|
1959
1959
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
@@ -1974,7 +1974,7 @@ function It(e, t) {
|
|
|
1974
1974
|
return Array.isArray(e) && e.every(t.isDate);
|
|
1975
1975
|
}
|
|
1976
1976
|
function re(e, t, r = L) {
|
|
1977
|
-
const n = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays:
|
|
1977
|
+
const n = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: a, isAfter: i } = r;
|
|
1978
1978
|
return n.some((s) => {
|
|
1979
1979
|
if (typeof s == "boolean")
|
|
1980
1980
|
return s;
|
|
@@ -1987,26 +1987,26 @@ function re(e, t, r = L) {
|
|
|
1987
1987
|
if (Bt(s))
|
|
1988
1988
|
return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
|
|
1989
1989
|
if (Ve(s)) {
|
|
1990
|
-
const c =
|
|
1991
|
-
return
|
|
1990
|
+
const c = a(s.before, e), u = a(s.after, e), f = c > 0, l = u < 0;
|
|
1991
|
+
return i(s.before, s.after) ? l && f : f || l;
|
|
1992
1992
|
}
|
|
1993
|
-
return Ze(s) ?
|
|
1993
|
+
return Ze(s) ? a(e, s.after) > 0 : Ke(s) ? a(s.before, e) > 0 : typeof s == "function" ? s(e) : !1;
|
|
1994
1994
|
});
|
|
1995
1995
|
}
|
|
1996
1996
|
function xo(e, t, r, n, o) {
|
|
1997
|
-
const { disabled:
|
|
1997
|
+
const { disabled: a, hidden: i, modifiers: s, showOutsideDays: c, broadcastCalendar: u, today: f = o.today() } = t, { isSameDay: l, isSameMonth: h, startOfMonth: g, isBefore: v, endOfMonth: C, isAfter: O } = o, T = r && g(r), M = n && C(n), b = {
|
|
1998
1998
|
[_.focused]: [],
|
|
1999
1999
|
[_.outside]: [],
|
|
2000
2000
|
[_.disabled]: [],
|
|
2001
2001
|
[_.hidden]: [],
|
|
2002
2002
|
[_.today]: []
|
|
2003
|
-
},
|
|
2003
|
+
}, D = {};
|
|
2004
2004
|
for (const p of e) {
|
|
2005
|
-
const { date: m, displayMonth: W } = p, E = !!(W && !h(m, W)), H = !!(
|
|
2005
|
+
const { date: m, displayMonth: W } = p, E = !!(W && !h(m, W)), H = !!(T && v(m, T)), F = !!(M && O(m, M)), Z = !!(a && re(m, a, o)), oe = !!(i && re(m, i, o)) || H || F || // Broadcast calendar will show outside days as default
|
|
2006
2006
|
!u && !c && E || u && c === !1 && E, ee = l(m, f);
|
|
2007
|
-
E &&
|
|
2007
|
+
E && b.outside.push(p), Z && b.disabled.push(p), oe && b.hidden.push(p), ee && b.today.push(p), s && Object.keys(s).forEach(($) => {
|
|
2008
2008
|
const ce = s?.[$];
|
|
2009
|
-
ce && re(m, ce, o) && (
|
|
2009
|
+
ce && re(m, ce, o) && (D[$] ? D[$].push(p) : D[$] = [p]);
|
|
2010
2010
|
});
|
|
2011
2011
|
}
|
|
2012
2012
|
return (p) => {
|
|
@@ -2017,12 +2017,12 @@ function xo(e, t, r, n, o) {
|
|
|
2017
2017
|
[_.outside]: !1,
|
|
2018
2018
|
[_.today]: !1
|
|
2019
2019
|
}, W = {};
|
|
2020
|
-
for (const E in
|
|
2021
|
-
const H =
|
|
2020
|
+
for (const E in b) {
|
|
2021
|
+
const H = b[E];
|
|
2022
2022
|
m[E] = H.some((F) => F === p);
|
|
2023
2023
|
}
|
|
2024
|
-
for (const E in
|
|
2025
|
-
W[E] =
|
|
2024
|
+
for (const E in D)
|
|
2025
|
+
W[E] = D[E].some((H) => H === p);
|
|
2026
2026
|
return {
|
|
2027
2027
|
...m,
|
|
2028
2028
|
// custom modifiers should override all the previous ones
|
|
@@ -2031,7 +2031,7 @@ function xo(e, t, r, n, o) {
|
|
|
2031
2031
|
};
|
|
2032
2032
|
}
|
|
2033
2033
|
function Po(e, t, r = {}) {
|
|
2034
|
-
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [
|
|
2034
|
+
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [a]) => (r[a] ? o.push(r[a]) : t[_[a]] ? o.push(t[_[a]]) : t[V[a]] && o.push(t[V[a]]), o), [t[y.Day]]);
|
|
2035
2035
|
}
|
|
2036
2036
|
function Eo(e) {
|
|
2037
2037
|
return {
|
|
@@ -2177,13 +2177,13 @@ function Vo(e, t) {
|
|
|
2177
2177
|
};
|
|
2178
2178
|
}
|
|
2179
2179
|
function Zo(e, t, r, n, o) {
|
|
2180
|
-
const { startOfMonth:
|
|
2180
|
+
const { startOfMonth: a, startOfYear: i, endOfYear: s, eachMonthOfInterval: c, getMonth: u } = o;
|
|
2181
2181
|
return c({
|
|
2182
|
-
start:
|
|
2182
|
+
start: i(e),
|
|
2183
2183
|
end: s(e)
|
|
2184
2184
|
}).map((h) => {
|
|
2185
|
-
const
|
|
2186
|
-
return { value:
|
|
2185
|
+
const g = n.formatMonthDropdown(h, o), v = u(h), C = t && h < a(t) || r && h > a(r) || !1;
|
|
2186
|
+
return { value: v, label: g, disabled: C };
|
|
2187
2187
|
});
|
|
2188
2188
|
}
|
|
2189
2189
|
function Ko(e, t = {}, r = {}) {
|
|
@@ -2196,72 +2196,72 @@ function Ko(e, t = {}, r = {}) {
|
|
|
2196
2196
|
}), n;
|
|
2197
2197
|
}
|
|
2198
2198
|
function Jo(e, t, r, n) {
|
|
2199
|
-
const o = n ?? e.today(),
|
|
2199
|
+
const o = n ?? e.today(), a = r ? e.startOfBroadcastWeek(o, e) : t ? e.startOfISOWeek(o) : e.startOfWeek(o), i = [];
|
|
2200
2200
|
for (let s = 0; s < 7; s++) {
|
|
2201
|
-
const c = e.addDays(
|
|
2202
|
-
|
|
2201
|
+
const c = e.addDays(a, s);
|
|
2202
|
+
i.push(c);
|
|
2203
2203
|
}
|
|
2204
|
-
return
|
|
2204
|
+
return i;
|
|
2205
2205
|
}
|
|
2206
2206
|
function Lo(e, t, r, n, o = !1) {
|
|
2207
2207
|
if (!e || !t)
|
|
2208
2208
|
return;
|
|
2209
|
-
const { startOfYear:
|
|
2209
|
+
const { startOfYear: a, endOfYear: i, eachYearOfInterval: s, getYear: c } = n, u = a(e), f = i(t), l = s({ start: u, end: f });
|
|
2210
2210
|
return o && l.reverse(), l.map((h) => {
|
|
2211
|
-
const
|
|
2211
|
+
const g = r.formatYearDropdown(h, n);
|
|
2212
2212
|
return {
|
|
2213
2213
|
value: c(h),
|
|
2214
|
-
label:
|
|
2214
|
+
label: g,
|
|
2215
2215
|
disabled: !1
|
|
2216
2216
|
};
|
|
2217
2217
|
});
|
|
2218
2218
|
}
|
|
2219
2219
|
function es(e, t = {}) {
|
|
2220
|
-
const { weekStartsOn: r, locale: n } = t, o = r ?? n?.options?.weekStartsOn ?? 0,
|
|
2220
|
+
const { weekStartsOn: r, locale: n } = t, o = r ?? n?.options?.weekStartsOn ?? 0, a = (s) => {
|
|
2221
2221
|
const c = typeof s == "number" || typeof s == "string" ? new Date(s) : s;
|
|
2222
2222
|
return new A(c.getFullYear(), c.getMonth(), c.getDate(), 12, 0, 0, e);
|
|
2223
|
-
},
|
|
2224
|
-
const c =
|
|
2223
|
+
}, i = (s) => {
|
|
2224
|
+
const c = a(s);
|
|
2225
2225
|
return new Date(c.getFullYear(), c.getMonth(), c.getDate(), 0, 0, 0, 0);
|
|
2226
2226
|
};
|
|
2227
2227
|
return {
|
|
2228
|
-
today: () =>
|
|
2228
|
+
today: () => a(A.tz(e)),
|
|
2229
2229
|
newDate: (s, c, u) => new A(s, c, u, 12, 0, 0, e),
|
|
2230
|
-
startOfDay: (s) =>
|
|
2230
|
+
startOfDay: (s) => a(s),
|
|
2231
2231
|
startOfWeek: (s, c) => {
|
|
2232
|
-
const u =
|
|
2232
|
+
const u = a(s), f = c?.weekStartsOn ?? o, l = (u.getDay() - f + 7) % 7;
|
|
2233
2233
|
return u.setDate(u.getDate() - l), u;
|
|
2234
2234
|
},
|
|
2235
2235
|
startOfISOWeek: (s) => {
|
|
2236
|
-
const c =
|
|
2236
|
+
const c = a(s), u = (c.getDay() - 1 + 7) % 7;
|
|
2237
2237
|
return c.setDate(c.getDate() - u), c;
|
|
2238
2238
|
},
|
|
2239
2239
|
startOfMonth: (s) => {
|
|
2240
|
-
const c =
|
|
2240
|
+
const c = a(s);
|
|
2241
2241
|
return c.setDate(1), c;
|
|
2242
2242
|
},
|
|
2243
2243
|
startOfYear: (s) => {
|
|
2244
|
-
const c =
|
|
2244
|
+
const c = a(s);
|
|
2245
2245
|
return c.setMonth(0, 1), c;
|
|
2246
2246
|
},
|
|
2247
2247
|
endOfWeek: (s, c) => {
|
|
2248
|
-
const u =
|
|
2248
|
+
const u = a(s), h = (((c?.weekStartsOn ?? o) + 6) % 7 - u.getDay() + 7) % 7;
|
|
2249
2249
|
return u.setDate(u.getDate() + h), u;
|
|
2250
2250
|
},
|
|
2251
2251
|
endOfISOWeek: (s) => {
|
|
2252
|
-
const c =
|
|
2252
|
+
const c = a(s), u = (7 - c.getDay()) % 7;
|
|
2253
2253
|
return c.setDate(c.getDate() + u), c;
|
|
2254
2254
|
},
|
|
2255
2255
|
endOfMonth: (s) => {
|
|
2256
|
-
const c =
|
|
2256
|
+
const c = a(s);
|
|
2257
2257
|
return c.setMonth(c.getMonth() + 1, 0), c;
|
|
2258
2258
|
},
|
|
2259
2259
|
endOfYear: (s) => {
|
|
2260
|
-
const c =
|
|
2260
|
+
const c = a(s);
|
|
2261
2261
|
return c.setMonth(11, 31), c;
|
|
2262
2262
|
},
|
|
2263
2263
|
eachMonthOfInterval: (s) => {
|
|
2264
|
-
const c =
|
|
2264
|
+
const c = a(s.start), u = a(s.end), f = [], l = new A(c.getFullYear(), c.getMonth(), 1, 12, 0, 0, e), h = u.getFullYear() * 12 + u.getMonth();
|
|
2265
2265
|
for (; l.getFullYear() * 12 + l.getMonth() <= h; )
|
|
2266
2266
|
f.push(new A(l, e)), l.setMonth(l.getMonth() + 1, 1);
|
|
2267
2267
|
return f;
|
|
@@ -2269,44 +2269,44 @@ function es(e, t = {}) {
|
|
|
2269
2269
|
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
2270
2270
|
// mutate the same TZDate, and return it.
|
|
2271
2271
|
addDays: (s, c) => {
|
|
2272
|
-
const u =
|
|
2272
|
+
const u = a(s);
|
|
2273
2273
|
return u.setDate(u.getDate() + c), u;
|
|
2274
2274
|
},
|
|
2275
2275
|
addWeeks: (s, c) => {
|
|
2276
|
-
const u =
|
|
2276
|
+
const u = a(s);
|
|
2277
2277
|
return u.setDate(u.getDate() + c * 7), u;
|
|
2278
2278
|
},
|
|
2279
2279
|
addMonths: (s, c) => {
|
|
2280
|
-
const u =
|
|
2280
|
+
const u = a(s);
|
|
2281
2281
|
return u.setMonth(u.getMonth() + c), u;
|
|
2282
2282
|
},
|
|
2283
2283
|
addYears: (s, c) => {
|
|
2284
|
-
const u =
|
|
2284
|
+
const u = a(s);
|
|
2285
2285
|
return u.setFullYear(u.getFullYear() + c), u;
|
|
2286
2286
|
},
|
|
2287
2287
|
eachYearOfInterval: (s) => {
|
|
2288
|
-
const c =
|
|
2288
|
+
const c = a(s.start), u = a(s.end), f = [], l = new A(c.getFullYear(), 0, 1, 12, 0, 0, e);
|
|
2289
2289
|
for (; l.getFullYear() <= u.getFullYear(); )
|
|
2290
2290
|
f.push(new A(l, e)), l.setFullYear(l.getFullYear() + 1, 0, 1);
|
|
2291
2291
|
return f;
|
|
2292
2292
|
},
|
|
2293
2293
|
getWeek: (s, c) => {
|
|
2294
|
-
const u =
|
|
2294
|
+
const u = i(s);
|
|
2295
2295
|
return Ue(u, {
|
|
2296
2296
|
weekStartsOn: c?.weekStartsOn ?? o,
|
|
2297
2297
|
firstWeekContainsDate: c?.firstWeekContainsDate ?? n?.options?.firstWeekContainsDate ?? 1
|
|
2298
2298
|
});
|
|
2299
2299
|
},
|
|
2300
2300
|
getISOWeek: (s) => {
|
|
2301
|
-
const c =
|
|
2301
|
+
const c = i(s);
|
|
2302
2302
|
return Xe(c);
|
|
2303
2303
|
},
|
|
2304
2304
|
differenceInCalendarDays: (s, c) => {
|
|
2305
|
-
const u =
|
|
2305
|
+
const u = i(s), f = i(c);
|
|
2306
2306
|
return Qe(u, f);
|
|
2307
2307
|
},
|
|
2308
2308
|
differenceInCalendarMonths: (s, c) => {
|
|
2309
|
-
const u =
|
|
2309
|
+
const u = i(s), f = i(c);
|
|
2310
2310
|
return St(u, f);
|
|
2311
2311
|
}
|
|
2312
2312
|
};
|
|
@@ -2314,42 +2314,42 @@ function es(e, t = {}) {
|
|
|
2314
2314
|
const Oe = (e) => e instanceof HTMLElement ? e : null, qe = (e) => [
|
|
2315
2315
|
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2316
2316
|
], ts = (e) => Oe(e.querySelector("[data-animated-month]")), je = (e) => Oe(e.querySelector("[data-animated-caption]")), Ge = (e) => Oe(e.querySelector("[data-animated-weeks]")), ns = (e) => Oe(e.querySelector("[data-animated-nav]")), rs = (e) => Oe(e.querySelector("[data-animated-weekdays]"));
|
|
2317
|
-
function os(e, t, { classNames: r, months: n, focused: o, dateLib:
|
|
2318
|
-
const
|
|
2317
|
+
function os(e, t, { classNames: r, months: n, focused: o, dateLib: a }) {
|
|
2318
|
+
const i = Ce(null), s = Ce(n), c = Ce(!1);
|
|
2319
2319
|
Cn(() => {
|
|
2320
2320
|
const u = s.current;
|
|
2321
2321
|
if (s.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
2322
2322
|
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2323
2323
|
n.length === 0 || u.length === 0 || n.length !== u.length)
|
|
2324
2324
|
return;
|
|
2325
|
-
const f =
|
|
2326
|
-
if (C instanceof HTMLElement ? (qe(C).forEach((
|
|
2327
|
-
if (!(
|
|
2325
|
+
const f = a.isSameMonth(n[0].date, u[0].date), l = a.isAfter(n[0].date, u[0].date), h = l ? r[j.caption_after_enter] : r[j.caption_before_enter], g = l ? r[j.weeks_after_enter] : r[j.weeks_before_enter], v = i.current, C = e.current.cloneNode(!0);
|
|
2326
|
+
if (C instanceof HTMLElement ? (qe(C).forEach((b) => {
|
|
2327
|
+
if (!(b instanceof HTMLElement))
|
|
2328
2328
|
return;
|
|
2329
|
-
const
|
|
2330
|
-
|
|
2331
|
-
const p = je(
|
|
2329
|
+
const D = ts(b);
|
|
2330
|
+
D && b.contains(D) && b.removeChild(D);
|
|
2331
|
+
const p = je(b);
|
|
2332
2332
|
p && p.classList.remove(h);
|
|
2333
|
-
const m = Ge(
|
|
2334
|
-
m && m.classList.remove(
|
|
2335
|
-
}),
|
|
2333
|
+
const m = Ge(b);
|
|
2334
|
+
m && m.classList.remove(g);
|
|
2335
|
+
}), i.current = C) : i.current = null, c.current || f || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
2336
2336
|
o)
|
|
2337
2337
|
return;
|
|
2338
|
-
const
|
|
2339
|
-
if (
|
|
2338
|
+
const O = v instanceof HTMLElement ? qe(v) : [], T = qe(e.current);
|
|
2339
|
+
if (T?.every((M) => M instanceof HTMLElement) && O && O.every((M) => M instanceof HTMLElement)) {
|
|
2340
2340
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
2341
|
-
const
|
|
2342
|
-
|
|
2343
|
-
const p = D
|
|
2341
|
+
const M = ns(e.current);
|
|
2342
|
+
M && (M.style.zIndex = "1"), T.forEach((b, D) => {
|
|
2343
|
+
const p = O[D];
|
|
2344
2344
|
if (!p)
|
|
2345
2345
|
return;
|
|
2346
|
-
|
|
2347
|
-
const m = je(
|
|
2346
|
+
b.style.position = "relative", b.style.overflow = "hidden";
|
|
2347
|
+
const m = je(b);
|
|
2348
2348
|
m && m.classList.add(h);
|
|
2349
|
-
const W = Ge(
|
|
2350
|
-
W && W.classList.add(
|
|
2349
|
+
const W = Ge(b);
|
|
2350
|
+
W && W.classList.add(g);
|
|
2351
2351
|
const E = () => {
|
|
2352
|
-
c.current = !1, e.current && (e.current.style.isolation = ""),
|
|
2352
|
+
c.current = !1, e.current && (e.current.style.isolation = ""), M && (M.style.zIndex = ""), m && m.classList.remove(h), W && W.classList.remove(g), b.style.position = "", b.style.overflow = "", b.contains(p) && b.removeChild(p);
|
|
2353
2353
|
};
|
|
2354
2354
|
p.style.pointerEvents = "none", p.style.position = "absolute", p.style.overflow = "hidden", p.setAttribute("aria-hidden", "true");
|
|
2355
2355
|
const H = rs(p);
|
|
@@ -2357,15 +2357,15 @@ function os(e, t, { classNames: r, months: n, focused: o, dateLib: i }) {
|
|
|
2357
2357
|
const F = je(p);
|
|
2358
2358
|
F && (F.classList.add(l ? r[j.caption_before_exit] : r[j.caption_after_exit]), F.addEventListener("animationend", E));
|
|
2359
2359
|
const Z = Ge(p);
|
|
2360
|
-
Z && Z.classList.add(l ? r[j.weeks_before_exit] : r[j.weeks_after_exit]),
|
|
2360
|
+
Z && Z.classList.add(l ? r[j.weeks_before_exit] : r[j.weeks_after_exit]), b.insertBefore(p, b.firstChild);
|
|
2361
2361
|
});
|
|
2362
2362
|
}
|
|
2363
2363
|
});
|
|
2364
2364
|
}
|
|
2365
2365
|
function ss(e, t, r, n) {
|
|
2366
|
-
const o = e[0],
|
|
2366
|
+
const o = e[0], a = e[e.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: c } = r ?? {}, { addDays: u, differenceInCalendarDays: f, differenceInCalendarMonths: l, endOfBroadcastWeek: h, endOfISOWeek: g, endOfMonth: v, endOfWeek: C, isAfter: O, startOfBroadcastWeek: T, startOfISOWeek: M, startOfWeek: b } = n, D = c ? T(o, n) : i ? M(o) : b(o), p = c ? h(a) : i ? g(v(a)) : C(v(a)), m = t && (c ? h(t) : i ? g(t) : C(t)), W = m && O(p, m) ? m : p, E = f(W, D), H = l(a, o) + 1, F = [];
|
|
2367
2367
|
for (let ee = 0; ee <= E; ee++) {
|
|
2368
|
-
const $ = u(
|
|
2368
|
+
const $ = u(D, ee);
|
|
2369
2369
|
F.push($);
|
|
2370
2370
|
}
|
|
2371
2371
|
const oe = (c ? 35 : 42) * H;
|
|
@@ -2381,23 +2381,23 @@ function ss(e, t, r, n) {
|
|
|
2381
2381
|
function as(e) {
|
|
2382
2382
|
const t = [];
|
|
2383
2383
|
return e.reduce((r, n) => {
|
|
2384
|
-
const o = n.weeks.reduce((
|
|
2384
|
+
const o = n.weeks.reduce((a, i) => a.concat(i.days.slice()), t.slice());
|
|
2385
2385
|
return r.concat(o.slice());
|
|
2386
2386
|
}, t.slice());
|
|
2387
2387
|
}
|
|
2388
2388
|
function is(e, t, r, n) {
|
|
2389
|
-
const { numberOfMonths: o = 1 } = r,
|
|
2390
|
-
for (let
|
|
2391
|
-
const s = n.addMonths(e,
|
|
2389
|
+
const { numberOfMonths: o = 1 } = r, a = [];
|
|
2390
|
+
for (let i = 0; i < o; i++) {
|
|
2391
|
+
const s = n.addMonths(e, i);
|
|
2392
2392
|
if (t && s > t)
|
|
2393
2393
|
break;
|
|
2394
|
-
|
|
2394
|
+
a.push(s);
|
|
2395
2395
|
}
|
|
2396
|
-
return
|
|
2396
|
+
return a;
|
|
2397
2397
|
}
|
|
2398
2398
|
function gt(e, t, r, n) {
|
|
2399
|
-
const { month: o, defaultMonth:
|
|
2400
|
-
let c = o ||
|
|
2399
|
+
const { month: o, defaultMonth: a, today: i = n.today(), numberOfMonths: s = 1 } = e;
|
|
2400
|
+
let c = o || a || i;
|
|
2401
2401
|
const { differenceInCalendarMonths: u, addMonths: f, startOfMonth: l } = n;
|
|
2402
2402
|
if (r && u(r, c) < s - 1) {
|
|
2403
2403
|
const h = -1 * (s - 1);
|
|
@@ -2406,46 +2406,46 @@ function gt(e, t, r, n) {
|
|
|
2406
2406
|
return t && u(c, t) < 0 && (c = t), l(c);
|
|
2407
2407
|
}
|
|
2408
2408
|
function cs(e, t, r, n) {
|
|
2409
|
-
const { addDays: o, endOfBroadcastWeek:
|
|
2410
|
-
const
|
|
2411
|
-
if (r.fixedWeeks &&
|
|
2409
|
+
const { addDays: o, endOfBroadcastWeek: a, endOfISOWeek: i, endOfMonth: s, endOfWeek: c, getISOWeek: u, getWeek: f, startOfBroadcastWeek: l, startOfISOWeek: h, startOfWeek: g } = n, v = e.reduce((C, O) => {
|
|
2410
|
+
const T = r.broadcastCalendar ? l(O, n) : r.ISOWeek ? h(O) : g(O), M = r.broadcastCalendar ? a(O) : r.ISOWeek ? i(s(O)) : c(s(O)), b = t.filter((W) => W >= T && W <= M), D = r.broadcastCalendar ? 35 : 42;
|
|
2411
|
+
if (r.fixedWeeks && b.length < D) {
|
|
2412
2412
|
const W = t.filter((E) => {
|
|
2413
|
-
const H =
|
|
2414
|
-
return E >
|
|
2413
|
+
const H = D - b.length;
|
|
2414
|
+
return E > M && E <= o(M, H);
|
|
2415
2415
|
});
|
|
2416
|
-
|
|
2416
|
+
b.push(...W);
|
|
2417
2417
|
}
|
|
2418
|
-
const p =
|
|
2419
|
-
const H = r.ISOWeek ? u(E) : f(E), F = W.find((oe) => oe.weekNumber === H), Z = new _t(E,
|
|
2418
|
+
const p = b.reduce((W, E) => {
|
|
2419
|
+
const H = r.ISOWeek ? u(E) : f(E), F = W.find((oe) => oe.weekNumber === H), Z = new _t(E, O, n);
|
|
2420
2420
|
return F ? F.days.push(Z) : W.push(new no(H, [Z])), W;
|
|
2421
|
-
}, []), m = new to(
|
|
2421
|
+
}, []), m = new to(O, p);
|
|
2422
2422
|
return C.push(m), C;
|
|
2423
2423
|
}, []);
|
|
2424
|
-
return r.reverseMonths ?
|
|
2424
|
+
return r.reverseMonths ? v.reverse() : v;
|
|
2425
2425
|
}
|
|
2426
2426
|
function us(e, t) {
|
|
2427
2427
|
let { startMonth: r, endMonth: n } = e;
|
|
2428
|
-
const { startOfYear: o, startOfDay:
|
|
2429
|
-
!r &&
|
|
2430
|
-
const
|
|
2431
|
-
return r ? r =
|
|
2432
|
-
r &&
|
|
2433
|
-
n &&
|
|
2428
|
+
const { startOfYear: o, startOfDay: a, startOfMonth: i, endOfMonth: s, addYears: c, endOfYear: u, newDate: f, today: l } = t, { fromYear: h, toYear: g, fromMonth: v, toMonth: C } = e;
|
|
2429
|
+
!r && v && (r = v), !r && h && (r = t.newDate(h, 0, 1)), !n && C && (n = C), !n && g && (n = f(g, 11, 31));
|
|
2430
|
+
const O = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
2431
|
+
return r ? r = i(r) : h ? r = f(h, 0, 1) : !r && O && (r = o(c(e.today ?? l(), -100))), n ? n = s(n) : g ? n = f(g, 11, 31) : !n && O && (n = u(e.today ?? l())), [
|
|
2432
|
+
r && a(r),
|
|
2433
|
+
n && a(n)
|
|
2434
2434
|
];
|
|
2435
2435
|
}
|
|
2436
2436
|
function ls(e, t, r, n) {
|
|
2437
2437
|
if (r.disableNavigation)
|
|
2438
2438
|
return;
|
|
2439
|
-
const { pagedNavigation: o, numberOfMonths:
|
|
2439
|
+
const { pagedNavigation: o, numberOfMonths: a = 1 } = r, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: c } = n, u = o ? a : 1, f = i(e);
|
|
2440
2440
|
if (!t)
|
|
2441
2441
|
return s(f, u);
|
|
2442
|
-
if (!(c(t, e) <
|
|
2442
|
+
if (!(c(t, e) < a))
|
|
2443
2443
|
return s(f, u);
|
|
2444
2444
|
}
|
|
2445
2445
|
function fs(e, t, r, n) {
|
|
2446
2446
|
if (r.disableNavigation)
|
|
2447
2447
|
return;
|
|
2448
|
-
const { pagedNavigation: o, numberOfMonths:
|
|
2448
|
+
const { pagedNavigation: o, numberOfMonths: a } = r, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: c } = n, u = o ? a ?? 1 : 1, f = i(e);
|
|
2449
2449
|
if (!t)
|
|
2450
2450
|
return s(f, -u);
|
|
2451
2451
|
if (!(c(f, t) <= 0))
|
|
@@ -2460,21 +2460,21 @@ function Ye(e, t) {
|
|
|
2460
2460
|
return [t === void 0 ? r : t, n];
|
|
2461
2461
|
}
|
|
2462
2462
|
function hs(e, t) {
|
|
2463
|
-
const [r, n] = us(e, t), { startOfMonth: o, endOfMonth:
|
|
2464
|
-
|
|
2463
|
+
const [r, n] = us(e, t), { startOfMonth: o, endOfMonth: a } = t, i = gt(e, r, n, t), [s, c] = Ye(
|
|
2464
|
+
i,
|
|
2465
2465
|
// initialMonth is always computed from props.month if provided
|
|
2466
|
-
e.month ?
|
|
2466
|
+
e.month ? i : void 0
|
|
2467
2467
|
);
|
|
2468
2468
|
Nn(() => {
|
|
2469
|
-
const
|
|
2470
|
-
c(
|
|
2469
|
+
const D = gt(e, r, n, t);
|
|
2470
|
+
c(D);
|
|
2471
2471
|
}, [e.timeZone]);
|
|
2472
|
-
const { months: u, weeks: f, days: l, previousMonth: h, nextMonth:
|
|
2473
|
-
const
|
|
2472
|
+
const { months: u, weeks: f, days: l, previousMonth: h, nextMonth: g } = be(() => {
|
|
2473
|
+
const D = is(s, n, { numberOfMonths: e.numberOfMonths }, t), p = ss(D, e.endMonth ? a(e.endMonth) : void 0, {
|
|
2474
2474
|
ISOWeek: e.ISOWeek,
|
|
2475
2475
|
fixedWeeks: e.fixedWeeks,
|
|
2476
2476
|
broadcastCalendar: e.broadcastCalendar
|
|
2477
|
-
}, t), m = cs(
|
|
2477
|
+
}, t), m = cs(D, p, {
|
|
2478
2478
|
broadcastCalendar: e.broadcastCalendar,
|
|
2479
2479
|
fixedWeeks: e.fixedWeeks,
|
|
2480
2480
|
ISOWeek: e.ISOWeek,
|
|
@@ -2500,10 +2500,10 @@ function hs(e, t) {
|
|
|
2500
2500
|
e.numberOfMonths,
|
|
2501
2501
|
e.pagedNavigation,
|
|
2502
2502
|
e.reverseMonths
|
|
2503
|
-
]), { disableNavigation:
|
|
2504
|
-
if (
|
|
2503
|
+
]), { disableNavigation: v, onMonthChange: C } = e, O = (D) => f.some((p) => p.days.some((m) => m.isEqualTo(D))), T = (D) => {
|
|
2504
|
+
if (v)
|
|
2505
2505
|
return;
|
|
2506
|
-
let p = o(
|
|
2506
|
+
let p = o(D);
|
|
2507
2507
|
r && p < o(r) && (p = o(r)), n && p > o(n) && (p = o(n)), c(p), C?.(p);
|
|
2508
2508
|
};
|
|
2509
2509
|
return {
|
|
@@ -2513,10 +2513,10 @@ function hs(e, t) {
|
|
|
2513
2513
|
navStart: r,
|
|
2514
2514
|
navEnd: n,
|
|
2515
2515
|
previousMonth: h,
|
|
2516
|
-
nextMonth:
|
|
2517
|
-
goToMonth:
|
|
2518
|
-
goToDay: (
|
|
2519
|
-
D
|
|
2516
|
+
nextMonth: g,
|
|
2517
|
+
goToMonth: T,
|
|
2518
|
+
goToDay: (D) => {
|
|
2519
|
+
O(D) || T(D.date);
|
|
2520
2520
|
}
|
|
2521
2521
|
};
|
|
2522
2522
|
}
|
|
@@ -2528,33 +2528,33 @@ function pt(e) {
|
|
|
2528
2528
|
return !e[_.disabled] && !e[_.hidden] && !e[_.outside];
|
|
2529
2529
|
}
|
|
2530
2530
|
function ms(e, t, r, n) {
|
|
2531
|
-
let o,
|
|
2532
|
-
for (const
|
|
2533
|
-
const s = t(
|
|
2534
|
-
pt(s) && (s[_.focused] &&
|
|
2531
|
+
let o, a = -1;
|
|
2532
|
+
for (const i of e) {
|
|
2533
|
+
const s = t(i);
|
|
2534
|
+
pt(s) && (s[_.focused] && a < K.FocusedModifier ? (o = i, a = K.FocusedModifier) : n?.isEqualTo(i) && a < K.LastFocused ? (o = i, a = K.LastFocused) : r(i.date) && a < K.Selected ? (o = i, a = K.Selected) : s[_.today] && a < K.Today && (o = i, a = K.Today));
|
|
2535
2535
|
}
|
|
2536
|
-
return o || (o = e.find((
|
|
2536
|
+
return o || (o = e.find((i) => pt(t(i)))), o;
|
|
2537
2537
|
}
|
|
2538
|
-
function ys(e, t, r, n, o,
|
|
2539
|
-
const { ISOWeek: s, broadcastCalendar: c } =
|
|
2538
|
+
function ys(e, t, r, n, o, a, i) {
|
|
2539
|
+
const { ISOWeek: s, broadcastCalendar: c } = a, { addDays: u, addMonths: f, addWeeks: l, addYears: h, endOfBroadcastWeek: g, endOfISOWeek: v, endOfWeek: C, max: O, min: T, startOfBroadcastWeek: M, startOfISOWeek: b, startOfWeek: D } = i;
|
|
2540
2540
|
let m = {
|
|
2541
2541
|
day: u,
|
|
2542
2542
|
week: l,
|
|
2543
2543
|
month: f,
|
|
2544
2544
|
year: h,
|
|
2545
|
-
startOfWeek: (W) => c ?
|
|
2546
|
-
endOfWeek: (W) => c ?
|
|
2545
|
+
startOfWeek: (W) => c ? M(W, i) : s ? b(W) : D(W),
|
|
2546
|
+
endOfWeek: (W) => c ? g(W) : s ? v(W) : C(W)
|
|
2547
2547
|
}[e](r, t === "after" ? 1 : -1);
|
|
2548
|
-
return t === "before" && n ? m =
|
|
2548
|
+
return t === "before" && n ? m = O([n, m]) : t === "after" && o && (m = T([o, m])), m;
|
|
2549
2549
|
}
|
|
2550
|
-
function Vt(e, t, r, n, o,
|
|
2550
|
+
function Vt(e, t, r, n, o, a, i, s = 0) {
|
|
2551
2551
|
if (s > 365)
|
|
2552
2552
|
return;
|
|
2553
|
-
const c = ys(e, t, r.date, n, o,
|
|
2554
|
-
return !u && !f ? h : Vt(e, t, h, n, o,
|
|
2553
|
+
const c = ys(e, t, r.date, n, o, a, i), u = !!(a.disabled && re(c, a.disabled, i)), f = !!(a.hidden && re(c, a.hidden, i)), l = c, h = new _t(c, l, i);
|
|
2554
|
+
return !u && !f ? h : Vt(e, t, h, n, o, a, i, s + 1);
|
|
2555
2555
|
}
|
|
2556
2556
|
function gs(e, t, r, n, o) {
|
|
2557
|
-
const { autoFocus:
|
|
2557
|
+
const { autoFocus: a } = e, [i, s] = Re(), c = ms(t.days, r, n || (() => !1), i), [u, f] = Re(a ? c : void 0);
|
|
2558
2558
|
return {
|
|
2559
2559
|
isFocusTarget: (C) => !!c?.isEqualTo(C),
|
|
2560
2560
|
setFocused: f,
|
|
@@ -2562,55 +2562,55 @@ function gs(e, t, r, n, o) {
|
|
|
2562
2562
|
blur: () => {
|
|
2563
2563
|
s(u), f(void 0);
|
|
2564
2564
|
},
|
|
2565
|
-
moveFocus: (C,
|
|
2565
|
+
moveFocus: (C, O) => {
|
|
2566
2566
|
if (!u)
|
|
2567
2567
|
return;
|
|
2568
|
-
const
|
|
2569
|
-
|
|
2568
|
+
const T = Vt(C, O, u, t.navStart, t.navEnd, e, o);
|
|
2569
|
+
T && (e.disableNavigation && !t.days.some((b) => b.isEqualTo(T)) || (t.goToDay(T), f(T)));
|
|
2570
2570
|
}
|
|
2571
2571
|
};
|
|
2572
2572
|
}
|
|
2573
2573
|
function ps(e, t) {
|
|
2574
|
-
const { selected: r, required: n, onSelect: o } = e, [
|
|
2574
|
+
const { selected: r, required: n, onSelect: o } = e, [a, i] = Ye(r, o ? r : void 0), s = o ? r : a, { isSameDay: c } = t, u = (g) => s?.some((v) => c(v, g)) ?? !1, { min: f, max: l } = e;
|
|
2575
2575
|
return {
|
|
2576
2576
|
selected: s,
|
|
2577
|
-
select: (
|
|
2578
|
-
let
|
|
2579
|
-
if (u(
|
|
2577
|
+
select: (g, v, C) => {
|
|
2578
|
+
let O = [...s ?? []];
|
|
2579
|
+
if (u(g)) {
|
|
2580
2580
|
if (s?.length === f || n && s?.length === 1)
|
|
2581
2581
|
return;
|
|
2582
|
-
|
|
2582
|
+
O = s?.filter((T) => !c(T, g));
|
|
2583
2583
|
} else
|
|
2584
|
-
s?.length === l ?
|
|
2585
|
-
return o ||
|
|
2584
|
+
s?.length === l ? O = [g] : O = [...O, g];
|
|
2585
|
+
return o || i(O), o?.(O, g, v, C), O;
|
|
2586
2586
|
},
|
|
2587
2587
|
isSelected: u
|
|
2588
2588
|
};
|
|
2589
2589
|
}
|
|
2590
|
-
function bs(e, t, r = 0, n = 0, o = !1,
|
|
2591
|
-
const { from:
|
|
2590
|
+
function bs(e, t, r = 0, n = 0, o = !1, a = L) {
|
|
2591
|
+
const { from: i, to: s } = t || {}, { isSameDay: c, isAfter: u, isBefore: f } = a;
|
|
2592
2592
|
let l;
|
|
2593
|
-
if (!
|
|
2593
|
+
if (!i && !s)
|
|
2594
2594
|
l = { from: e, to: r > 0 ? void 0 : e };
|
|
2595
|
-
else if (
|
|
2596
|
-
c(
|
|
2597
|
-
else if (
|
|
2598
|
-
if (c(
|
|
2599
|
-
o ? l = { from:
|
|
2600
|
-
else if (c(
|
|
2601
|
-
l = { from:
|
|
2595
|
+
else if (i && !s)
|
|
2596
|
+
c(i, e) ? r === 0 ? l = { from: i, to: e } : o ? l = { from: i, to: void 0 } : l = void 0 : f(e, i) ? l = { from: e, to: i } : l = { from: i, to: e };
|
|
2597
|
+
else if (i && s)
|
|
2598
|
+
if (c(i, e) && c(s, e))
|
|
2599
|
+
o ? l = { from: i, to: s } : l = void 0;
|
|
2600
|
+
else if (c(i, e))
|
|
2601
|
+
l = { from: i, to: r > 0 ? void 0 : e };
|
|
2602
2602
|
else if (c(s, e))
|
|
2603
2603
|
l = { from: e, to: r > 0 ? void 0 : e };
|
|
2604
|
-
else if (f(e,
|
|
2604
|
+
else if (f(e, i))
|
|
2605
2605
|
l = { from: e, to: s };
|
|
2606
|
-
else if (u(e,
|
|
2607
|
-
l = { from:
|
|
2606
|
+
else if (u(e, i))
|
|
2607
|
+
l = { from: i, to: e };
|
|
2608
2608
|
else if (u(e, s))
|
|
2609
|
-
l = { from:
|
|
2609
|
+
l = { from: i, to: e };
|
|
2610
2610
|
else
|
|
2611
2611
|
throw new Error("Invalid range");
|
|
2612
2612
|
if (l?.from && l?.to) {
|
|
2613
|
-
const h =
|
|
2613
|
+
const h = a.differenceInCalendarDays(l.to, l.from);
|
|
2614
2614
|
n > 0 && h > n ? l = { from: e, to: void 0 } : r > 1 && h < r && (l = { from: e, to: void 0 });
|
|
2615
2615
|
}
|
|
2616
2616
|
return l;
|
|
@@ -2618,8 +2618,8 @@ function bs(e, t, r = 0, n = 0, o = !1, i = L) {
|
|
|
2618
2618
|
function ws(e, t, r = L) {
|
|
2619
2619
|
const n = Array.isArray(t) ? t : [t];
|
|
2620
2620
|
let o = e.from;
|
|
2621
|
-
const
|
|
2622
|
-
for (let s = 0; s <=
|
|
2621
|
+
const a = r.differenceInCalendarDays(e.to, e.from), i = Math.min(a, 6);
|
|
2622
|
+
for (let s = 0; s <= i; s++) {
|
|
2623
2623
|
if (n.includes(o.getDay()))
|
|
2624
2624
|
return !0;
|
|
2625
2625
|
o = r.addDays(o, 1);
|
|
@@ -2636,12 +2636,12 @@ function Ms(e, t, r = L) {
|
|
|
2636
2636
|
to: r.addDays(s.before, -1)
|
|
2637
2637
|
}, r) : re(e.from, s, r) || re(e.to, s, r) : Ze(s) || Ke(s) ? re(e.from, s, r) || re(e.to, s, r) : !1))
|
|
2638
2638
|
return !0;
|
|
2639
|
-
const
|
|
2640
|
-
if (
|
|
2639
|
+
const i = n.filter((s) => typeof s == "function");
|
|
2640
|
+
if (i.length) {
|
|
2641
2641
|
let s = e.from;
|
|
2642
2642
|
const c = r.differenceInCalendarDays(e.to, e.from);
|
|
2643
2643
|
for (let u = 0; u <= c; u++) {
|
|
2644
|
-
if (
|
|
2644
|
+
if (i.some((f) => f(s)))
|
|
2645
2645
|
return !0;
|
|
2646
2646
|
s = r.addDays(s, 1);
|
|
2647
2647
|
}
|
|
@@ -2649,23 +2649,28 @@ function Ms(e, t, r = L) {
|
|
|
2649
2649
|
return !1;
|
|
2650
2650
|
}
|
|
2651
2651
|
function Ds(e, t) {
|
|
2652
|
-
const { disabled: r, excludeDisabled: n,
|
|
2652
|
+
const { disabled: r, excludeDisabled: n, resetOnSelect: o, selected: a, required: i, onSelect: s } = e, [c, u] = Ye(a, s ? a : void 0), f = s ? a : c;
|
|
2653
2653
|
return {
|
|
2654
|
-
selected:
|
|
2655
|
-
select: (
|
|
2656
|
-
const { min:
|
|
2657
|
-
|
|
2654
|
+
selected: f,
|
|
2655
|
+
select: (g, v, C) => {
|
|
2656
|
+
const { min: O, max: T } = e;
|
|
2657
|
+
let M;
|
|
2658
|
+
if (g) {
|
|
2659
|
+
const b = f?.from, D = f?.to, p = !!b && !!D, m = !!b && !!D && t.isSameDay(b, D) && t.isSameDay(g, b);
|
|
2660
|
+
o && (p || !f?.from) ? !i && m ? M = void 0 : M = { from: g, to: void 0 } : M = bs(g, f, O, T, i, t);
|
|
2661
|
+
}
|
|
2662
|
+
return n && r && M?.from && M.to && Ms({ from: M.from, to: M.to }, r, t) && (M.from = g, M.to = void 0), s || u(M), s?.(M, g, v, C), M;
|
|
2658
2663
|
},
|
|
2659
|
-
isSelected: (
|
|
2664
|
+
isSelected: (g) => f && ne(f, g, !1, t)
|
|
2660
2665
|
};
|
|
2661
2666
|
}
|
|
2662
2667
|
function ks(e, t) {
|
|
2663
|
-
const { selected: r, required: n, onSelect: o } = e, [
|
|
2668
|
+
const { selected: r, required: n, onSelect: o } = e, [a, i] = Ye(r, o ? r : void 0), s = o ? r : a, { isSameDay: c } = t;
|
|
2664
2669
|
return {
|
|
2665
2670
|
selected: s,
|
|
2666
|
-
select: (l, h,
|
|
2667
|
-
let
|
|
2668
|
-
return !n && s && s && c(l, s) && (
|
|
2671
|
+
select: (l, h, g) => {
|
|
2672
|
+
let v = l;
|
|
2673
|
+
return !n && s && s && c(l, s) && (v = void 0), o || i(v), o?.(v, l, h, g), v;
|
|
2669
2674
|
},
|
|
2670
2675
|
isSelected: (l) => s ? c(s, l) : !1
|
|
2671
2676
|
};
|
|
@@ -2712,21 +2717,21 @@ function vs(e) {
|
|
|
2712
2717
|
if (r && (t = {
|
|
2713
2718
|
...e,
|
|
2714
2719
|
timeZone: r
|
|
2715
|
-
}, t.today && (t.today = z(t.today, r)), t.month && (t.month = z(t.month, r)), t.defaultMonth && (t.defaultMonth = z(t.defaultMonth, r)), t.startMonth && (t.startMonth = z(t.startMonth, r)), t.endMonth && (t.endMonth = z(t.endMonth, r)), t.mode === "single" && t.selected ? t.selected = z(t.selected, r) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((
|
|
2720
|
+
}, t.today && (t.today = z(t.today, r)), t.month && (t.month = z(t.month, r)), t.defaultMonth && (t.defaultMonth = z(t.defaultMonth, r)), t.startMonth && (t.startMonth = z(t.startMonth, r)), t.endMonth && (t.endMonth = z(t.endMonth, r)), t.mode === "single" && t.selected ? t.selected = z(t.selected, r) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((k) => z(k, r)) : t.mode === "range" && t.selected && (t.selected = {
|
|
2716
2721
|
from: t.selected.from ? z(t.selected.from, r) : t.selected.from,
|
|
2717
2722
|
to: t.selected.to ? z(t.selected.to, r) : t.selected.to
|
|
2718
2723
|
}), t.disabled !== void 0 && (t.disabled = $e(t.disabled, r)), t.hidden !== void 0 && (t.hidden = $e(t.hidden, r)), t.modifiers)) {
|
|
2719
|
-
const
|
|
2724
|
+
const k = {};
|
|
2720
2725
|
Object.keys(t.modifiers).forEach((Y) => {
|
|
2721
|
-
|
|
2722
|
-
}), t.modifiers =
|
|
2726
|
+
k[Y] = $e(t.modifiers?.[Y], r);
|
|
2727
|
+
}), t.modifiers = k;
|
|
2723
2728
|
}
|
|
2724
|
-
const { components: n, formatters: o, labels:
|
|
2725
|
-
const
|
|
2729
|
+
const { components: n, formatters: o, labels: a, dateLib: i, locale: s, classNames: c } = be(() => {
|
|
2730
|
+
const k = { ...Et, ...t.locale }, Y = t.broadcastCalendar ? 1 : t.weekStartsOn, w = t.noonSafe && t.timeZone ? es(t.timeZone, {
|
|
2726
2731
|
weekStartsOn: Y,
|
|
2727
|
-
locale:
|
|
2728
|
-
}) : void 0, N = t.dateLib &&
|
|
2729
|
-
locale:
|
|
2732
|
+
locale: k
|
|
2733
|
+
}) : void 0, N = t.dateLib && w ? { ...w, ...t.dateLib } : t.dateLib ?? w, q = new G({
|
|
2734
|
+
locale: k,
|
|
2730
2735
|
weekStartsOn: Y,
|
|
2731
2736
|
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
2732
2737
|
useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
|
|
@@ -2739,7 +2744,7 @@ function vs(e) {
|
|
|
2739
2744
|
components: Eo(t.components),
|
|
2740
2745
|
formatters: Ro(t.formatters),
|
|
2741
2746
|
labels: Vo(t.labels, q.options),
|
|
2742
|
-
locale:
|
|
2747
|
+
locale: k,
|
|
2743
2748
|
classNames: { ...Fo(), ...t.classNames }
|
|
2744
2749
|
};
|
|
2745
2750
|
}, [
|
|
@@ -2758,51 +2763,51 @@ function vs(e) {
|
|
|
2758
2763
|
t.labels,
|
|
2759
2764
|
t.classNames
|
|
2760
2765
|
]);
|
|
2761
|
-
t.today || (t = { ...t, today:
|
|
2762
|
-
const { captionLayout: u, mode: f, navLayout: l, numberOfMonths: h = 1, onDayBlur:
|
|
2763
|
-
Q && (te(Q),
|
|
2764
|
-
}, [Q, te,
|
|
2765
|
-
X && (te(X),
|
|
2766
|
-
}, [te, X,
|
|
2767
|
-
|
|
2768
|
-
}, [_e,
|
|
2769
|
-
Se(
|
|
2770
|
-
}, [C, Se]), fn = R((
|
|
2771
|
-
et(),
|
|
2772
|
-
}, [et,
|
|
2766
|
+
t.today || (t = { ...t, today: i.today() });
|
|
2767
|
+
const { captionLayout: u, mode: f, navLayout: l, numberOfMonths: h = 1, onDayBlur: g, onDayClick: v, onDayFocus: C, onDayKeyDown: O, onDayMouseEnter: T, onDayMouseLeave: M, onNextClick: b, onPrevClick: D, showWeekNumber: p, styles: m } = t, { formatCaption: W, formatDay: E, formatMonthDropdown: H, formatWeekNumber: F, formatWeekNumberHeader: Z, formatWeekdayName: oe, formatYearDropdown: ee } = o, $ = hs(t, i), { days: ce, months: ve, navStart: Te, navEnd: xe, previousMonth: Q, nextMonth: X, goToMonth: te } = $, Pe = xo(ce, t, Te, xe, i), { isSelected: Ee, select: _e, selected: We } = Os(t, i) ?? {}, { blur: et, focused: tt, isFocusTarget: Zt, moveFocus: nt, setFocused: Se } = gs(t, $, Pe, Ee ?? (() => !1), i), { labelDayButton: Kt, labelGridcell: Jt, labelGrid: Lt, labelMonthDropdown: en, labelNav: rt, labelPrevious: tn, labelNext: nn, labelWeekday: rn, labelWeekNumber: on, labelWeekNumberHeader: sn, labelYearDropdown: an } = a, cn = be(() => Jo(i, t.ISOWeek, t.broadcastCalendar, t.today), [i, t.ISOWeek, t.broadcastCalendar, t.today]), ot = f !== void 0 || v !== void 0, Fe = R(() => {
|
|
2768
|
+
Q && (te(Q), D?.(Q));
|
|
2769
|
+
}, [Q, te, D]), Be = R(() => {
|
|
2770
|
+
X && (te(X), b?.(X));
|
|
2771
|
+
}, [te, X, b]), un = R((k, Y) => (w) => {
|
|
2772
|
+
w.preventDefault(), w.stopPropagation(), Se(k), !Y.disabled && (_e?.(k.date, Y, w), v?.(k.date, Y, w));
|
|
2773
|
+
}, [_e, v, Se]), ln = R((k, Y) => (w) => {
|
|
2774
|
+
Se(k), C?.(k.date, Y, w);
|
|
2775
|
+
}, [C, Se]), fn = R((k, Y) => (w) => {
|
|
2776
|
+
et(), g?.(k.date, Y, w);
|
|
2777
|
+
}, [et, g]), dn = R((k, Y) => (w) => {
|
|
2773
2778
|
const N = {
|
|
2774
2779
|
ArrowLeft: [
|
|
2775
|
-
|
|
2780
|
+
w.shiftKey ? "month" : "day",
|
|
2776
2781
|
t.dir === "rtl" ? "after" : "before"
|
|
2777
2782
|
],
|
|
2778
2783
|
ArrowRight: [
|
|
2779
|
-
|
|
2784
|
+
w.shiftKey ? "month" : "day",
|
|
2780
2785
|
t.dir === "rtl" ? "before" : "after"
|
|
2781
2786
|
],
|
|
2782
|
-
ArrowDown: [
|
|
2783
|
-
ArrowUp: [
|
|
2784
|
-
PageUp: [
|
|
2785
|
-
PageDown: [
|
|
2787
|
+
ArrowDown: [w.shiftKey ? "year" : "week", "after"],
|
|
2788
|
+
ArrowUp: [w.shiftKey ? "year" : "week", "before"],
|
|
2789
|
+
PageUp: [w.shiftKey ? "year" : "month", "before"],
|
|
2790
|
+
PageDown: [w.shiftKey ? "year" : "month", "after"],
|
|
2786
2791
|
Home: ["startOfWeek", "before"],
|
|
2787
2792
|
End: ["endOfWeek", "after"]
|
|
2788
2793
|
};
|
|
2789
|
-
if (N[
|
|
2790
|
-
|
|
2791
|
-
const [q, S] = N[
|
|
2794
|
+
if (N[w.key]) {
|
|
2795
|
+
w.preventDefault(), w.stopPropagation();
|
|
2796
|
+
const [q, S] = N[w.key];
|
|
2792
2797
|
nt(q, S);
|
|
2793
2798
|
}
|
|
2794
|
-
|
|
2795
|
-
}, [nt,
|
|
2796
|
-
|
|
2797
|
-
}, [
|
|
2798
|
-
|
|
2799
|
-
}, [
|
|
2800
|
-
const
|
|
2799
|
+
O?.(k.date, Y, w);
|
|
2800
|
+
}, [nt, O, t.dir]), hn = R((k, Y) => (w) => {
|
|
2801
|
+
T?.(k.date, Y, w);
|
|
2802
|
+
}, [T]), mn = R((k, Y) => (w) => {
|
|
2803
|
+
M?.(k.date, Y, w);
|
|
2804
|
+
}, [M]), yn = R((k) => (Y) => {
|
|
2805
|
+
const w = Number(Y.target.value), N = i.setMonth(i.startOfMonth(k), w);
|
|
2801
2806
|
te(N);
|
|
2802
|
-
}, [
|
|
2803
|
-
const
|
|
2807
|
+
}, [i, te]), gn = R((k) => (Y) => {
|
|
2808
|
+
const w = Number(Y.target.value), N = i.setYear(i.startOfMonth(k), w);
|
|
2804
2809
|
te(N);
|
|
2805
|
-
}, [
|
|
2810
|
+
}, [i, te]), { className: pn, style: bn } = be(() => ({
|
|
2806
2811
|
className: [c[y.Root], t.className].filter(Boolean).join(" "),
|
|
2807
2812
|
style: { ...m?.[y.Root], ...t.style }
|
|
2808
2813
|
}), [c, t.className, t.style, m]), wn = _o(t), st = Ce(null);
|
|
@@ -2810,7 +2815,7 @@ function vs(e) {
|
|
|
2810
2815
|
classNames: c,
|
|
2811
2816
|
months: ve,
|
|
2812
2817
|
focused: tt,
|
|
2813
|
-
dateLib:
|
|
2818
|
+
dateLib: i
|
|
2814
2819
|
});
|
|
2815
2820
|
const Mn = {
|
|
2816
2821
|
dayPickerProps: t,
|
|
@@ -2825,7 +2830,7 @@ function vs(e) {
|
|
|
2825
2830
|
components: n,
|
|
2826
2831
|
classNames: c,
|
|
2827
2832
|
styles: m,
|
|
2828
|
-
labels:
|
|
2833
|
+
labels: a,
|
|
2829
2834
|
formatters: o
|
|
2830
2835
|
};
|
|
2831
2836
|
return d.createElement(
|
|
@@ -2833,12 +2838,12 @@ function vs(e) {
|
|
|
2833
2838
|
{ value: Mn },
|
|
2834
2839
|
d.createElement(
|
|
2835
2840
|
n.Root,
|
|
2836
|
-
{ rootRef: t.animate ? st : void 0, className: pn, style: bn, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...wn },
|
|
2841
|
+
{ rootRef: t.animate ? st : void 0, className: pn, style: bn, dir: t.dir, id: t.id, lang: t.lang ?? s.code, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...wn },
|
|
2837
2842
|
d.createElement(
|
|
2838
2843
|
n.Months,
|
|
2839
2844
|
{ className: c[y.Months], style: m?.[y.Months] },
|
|
2840
2845
|
!t.hideNavigation && !l && d.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": rt(), onPreviousClick: Fe, onNextClick: Be, previousMonth: Q, nextMonth: X }),
|
|
2841
|
-
ve.map((
|
|
2846
|
+
ve.map((k, Y) => d.createElement(
|
|
2842
2847
|
n.Month,
|
|
2843
2848
|
{
|
|
2844
2849
|
"data-animated-month": t.animate ? "true" : void 0,
|
|
@@ -2847,19 +2852,19 @@ function vs(e) {
|
|
|
2847
2852
|
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
2848
2853
|
key: Y,
|
|
2849
2854
|
displayIndex: Y,
|
|
2850
|
-
calendarMonth:
|
|
2855
|
+
calendarMonth: k
|
|
2851
2856
|
},
|
|
2852
2857
|
l === "around" && !t.hideNavigation && Y === 0 && d.createElement(
|
|
2853
2858
|
n.PreviousMonthButton,
|
|
2854
2859
|
{ type: "button", className: c[y.PreviousMonthButton], tabIndex: Q ? void 0 : -1, "aria-disabled": Q ? void 0 : !0, "aria-label": tn(Q), onClick: Fe, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2855
2860
|
d.createElement(n.Chevron, { disabled: Q ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
2856
2861
|
),
|
|
2857
|
-
d.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[y.MonthCaption], style: m?.[y.MonthCaption], calendarMonth:
|
|
2862
|
+
d.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[y.MonthCaption], style: m?.[y.MonthCaption], calendarMonth: k, displayIndex: Y }, u?.startsWith("dropdown") ? d.createElement(
|
|
2858
2863
|
n.DropdownNav,
|
|
2859
2864
|
{ className: c[y.Dropdowns], style: m?.[y.Dropdowns] },
|
|
2860
2865
|
(() => {
|
|
2861
|
-
const
|
|
2862
|
-
return
|
|
2866
|
+
const w = u === "dropdown" || u === "dropdown-months" ? d.createElement(n.MonthsDropdown, { key: "month", className: c[y.MonthsDropdown], "aria-label": en(), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: yn(k.date), options: Zo(k.date, Te, xe, o, i), style: m?.[y.Dropdown], value: i.getMonth(k.date) }) : d.createElement("span", { key: "month" }, H(k.date, i)), N = u === "dropdown" || u === "dropdown-years" ? d.createElement(n.YearsDropdown, { key: "year", className: c[y.YearsDropdown], "aria-label": an(i.options), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: gn(k.date), options: Lo(Te, xe, o, i, !!t.reverseYears), style: m?.[y.Dropdown], value: i.getYear(k.date) }) : d.createElement("span", { key: "year" }, ee(k.date, i));
|
|
2867
|
+
return i.getMonthYearOrder() === "year-first" ? [N, w] : [w, N];
|
|
2863
2868
|
})(),
|
|
2864
2869
|
d.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
2865
2870
|
border: 0,
|
|
@@ -2872,8 +2877,8 @@ function vs(e) {
|
|
|
2872
2877
|
width: "1px",
|
|
2873
2878
|
whiteSpace: "nowrap",
|
|
2874
2879
|
wordWrap: "normal"
|
|
2875
|
-
} }, W(
|
|
2876
|
-
) : d.createElement(n.CaptionLabel, { className: c[y.CaptionLabel], role: "status", "aria-live": "polite" }, W(
|
|
2880
|
+
} }, W(k.date, i.options, i))
|
|
2881
|
+
) : d.createElement(n.CaptionLabel, { className: c[y.CaptionLabel], role: "status", "aria-live": "polite" }, W(k.date, i.options, i))),
|
|
2877
2882
|
l === "around" && !t.hideNavigation && Y === h - 1 && d.createElement(
|
|
2878
2883
|
n.NextMonthButton,
|
|
2879
2884
|
{ type: "button", className: c[y.NextMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label": nn(X), onClick: Be, "data-animated-button": t.animate ? "true" : void 0 },
|
|
@@ -2882,27 +2887,27 @@ function vs(e) {
|
|
|
2882
2887
|
Y === h - 1 && l === "after" && !t.hideNavigation && d.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": rt(), onPreviousClick: Fe, onNextClick: Be, previousMonth: Q, nextMonth: X }),
|
|
2883
2888
|
d.createElement(
|
|
2884
2889
|
n.MonthGrid,
|
|
2885
|
-
{ role: "grid", "aria-multiselectable": f === "multiple" || f === "range", "aria-label": Lt(
|
|
2890
|
+
{ role: "grid", "aria-multiselectable": f === "multiple" || f === "range", "aria-label": Lt(k.date, i.options, i) || void 0, className: c[y.MonthGrid], style: m?.[y.MonthGrid] },
|
|
2886
2891
|
!t.hideWeekdays && d.createElement(
|
|
2887
2892
|
n.Weekdays,
|
|
2888
2893
|
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: c[y.Weekdays], style: m?.[y.Weekdays] },
|
|
2889
|
-
p && d.createElement(n.WeekNumberHeader, { "aria-label": sn(
|
|
2890
|
-
cn.map((
|
|
2894
|
+
p && d.createElement(n.WeekNumberHeader, { "aria-label": sn(i.options), className: c[y.WeekNumberHeader], style: m?.[y.WeekNumberHeader], scope: "col" }, Z()),
|
|
2895
|
+
cn.map((w) => d.createElement(n.Weekday, { "aria-label": rn(w, i.options, i), className: c[y.Weekday], key: String(w), style: m?.[y.Weekday], scope: "col" }, oe(w, i.options, i)))
|
|
2891
2896
|
),
|
|
2892
|
-
d.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[y.Weeks], style: m?.[y.Weeks] },
|
|
2897
|
+
d.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[y.Weeks], style: m?.[y.Weeks] }, k.weeks.map((w) => d.createElement(
|
|
2893
2898
|
n.Week,
|
|
2894
|
-
{ className: c[y.Week], key:
|
|
2895
|
-
p && d.createElement(n.WeekNumber, { week:
|
|
2899
|
+
{ className: c[y.Week], key: w.weekNumber, style: m?.[y.Week], week: w },
|
|
2900
|
+
p && d.createElement(n.WeekNumber, { week: w, style: m?.[y.WeekNumber], "aria-label": on(w.weekNumber, {
|
|
2896
2901
|
locale: s
|
|
2897
|
-
}), className: c[y.WeekNumber], scope: "row", role: "rowheader" }, F(
|
|
2898
|
-
|
|
2902
|
+
}), className: c[y.WeekNumber], scope: "row", role: "rowheader" }, F(w.weekNumber, i)),
|
|
2903
|
+
w.days.map((N) => {
|
|
2899
2904
|
const { date: q } = N, S = Pe(N);
|
|
2900
2905
|
if (S[_.focused] = !S.hidden && !!tt?.isEqualTo(N), S[V.selected] = Ee?.(q) || S.selected, Ne(We)) {
|
|
2901
2906
|
const { from: Ie, to: He } = We;
|
|
2902
|
-
S[V.range_start] = !!(Ie && He &&
|
|
2907
|
+
S[V.range_start] = !!(Ie && He && i.isSameDay(q, Ie)), S[V.range_end] = !!(Ie && He && i.isSameDay(q, He)), S[V.range_middle] = ne(We, q, !0, i);
|
|
2903
2908
|
}
|
|
2904
|
-
const Dn = Ko(S, m, t.modifiersStyles), kn = Po(S, c, t.modifiersClassNames), On = !ot && !S.hidden ? Jt(q, S,
|
|
2905
|
-
return d.createElement(n.Day, { key: `${N.isoDate}_${N.displayMonthId}`, day: N, modifiers: S, className: kn.join(" "), style: Dn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": On, "data-day": N.isoDate, "data-month": N.outside ? N.dateMonthId : void 0, "data-selected": S.selected || void 0, "data-disabled": S.disabled || void 0, "data-hidden": S.hidden || void 0, "data-outside": N.outside || void 0, "data-focused": S.focused || void 0, "data-today": S.today || void 0 }, !S.hidden && ot ? d.createElement(n.DayButton, { className: c[y.DayButton], style: m?.[y.DayButton], type: "button", day: N, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: Zt(N) ? 0 : -1, "aria-label": Kt(q, S,
|
|
2909
|
+
const Dn = Ko(S, m, t.modifiersStyles), kn = Po(S, c, t.modifiersClassNames), On = !ot && !S.hidden ? Jt(q, S, i.options, i) : void 0;
|
|
2910
|
+
return d.createElement(n.Day, { key: `${N.isoDate}_${N.displayMonthId}`, day: N, modifiers: S, className: kn.join(" "), style: Dn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": On, "data-day": N.isoDate, "data-month": N.outside ? N.dateMonthId : void 0, "data-selected": S.selected || void 0, "data-disabled": S.disabled || void 0, "data-hidden": S.hidden || void 0, "data-outside": N.outside || void 0, "data-focused": S.focused || void 0, "data-today": S.today || void 0 }, !S.hidden && ot ? d.createElement(n.DayButton, { className: c[y.DayButton], style: m?.[y.DayButton], type: "button", day: N, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: Zt(N) ? 0 : -1, "aria-label": Kt(q, S, i.options, i), onClick: un(N, S), onBlur: fn(N, S), onFocus: ln(N, S), onKeyDown: dn(N, S), onMouseEnter: hn(N, S), onMouseLeave: mn(N, S) }, E(q, i.options, i)) : !S.hidden && E(N.date, i.options, i));
|
|
2906
2911
|
})
|
|
2907
2912
|
)))
|
|
2908
2913
|
)
|
|
@@ -2912,12 +2917,12 @@ function vs(e) {
|
|
|
2912
2917
|
)
|
|
2913
2918
|
);
|
|
2914
2919
|
}
|
|
2915
|
-
const Ws = ({ classNames: e, disabled: t, disablePastDates: r = !0, fixedWeeks: n, locale: o, showOutsideDays:
|
|
2920
|
+
const Ws = ({ classNames: e, disabled: t, disablePastDates: r = !0, fixedWeeks: n, locale: o, showOutsideDays: a = !0, ...i }) => {
|
|
2916
2921
|
const s = be(() => /* @__PURE__ */ new Date(), []), c = [...r ? [{ before: s }] : [], ...Array.isArray(t) ? t : t ? [t] : []];
|
|
2917
2922
|
return /* @__PURE__ */ at(
|
|
2918
2923
|
vs,
|
|
2919
2924
|
{
|
|
2920
|
-
...
|
|
2925
|
+
...i,
|
|
2921
2926
|
classNames: {
|
|
2922
2927
|
months: B("months relative flex"),
|
|
2923
2928
|
month: B("month"),
|
|
@@ -2950,7 +2955,7 @@ const Ws = ({ classNames: e, disabled: t, disablePastDates: r = !0, fixedWeeks:
|
|
|
2950
2955
|
disabled: c.length > 0 ? c : void 0,
|
|
2951
2956
|
fixedWeeks: n,
|
|
2952
2957
|
locale: o,
|
|
2953
|
-
showOutsideDays:
|
|
2958
|
+
showOutsideDays: a
|
|
2954
2959
|
}
|
|
2955
2960
|
);
|
|
2956
2961
|
};
|