@la-batcave/ui 3.5.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert.d.ts +17 -7
- package/dist/Alert.js +31 -28
- package/dist/Button.js +29 -26
- package/dist/Card.d.ts +2 -6
- package/dist/Card.js +35 -58
- package/dist/CodeBlock.js +2 -2
- package/dist/Collapse.js +8 -8
- package/dist/Combobox.js +51 -51
- package/dist/DarkMode.js +11 -11
- package/dist/DatePicker.d.ts +5 -17
- package/dist/DatePicker.js +221 -205
- package/dist/Dialog.js +65 -65
- package/dist/Drawer.js +1 -1
- package/dist/Dropdown.js +10 -10
- package/dist/HoverCard.js +13 -13
- package/dist/Input.js +633 -626
- package/dist/LogViewer.js +1 -1
- package/dist/Menubar.js +25 -25
- package/dist/Pagination.js +17 -17
- package/dist/Popover.js +4 -4
- package/dist/Resizable.js +1 -1
- package/dist/Sheet.d.ts +1 -1
- package/dist/Sheet.js +21 -21
- package/dist/Sidebar.d.ts +39 -1
- package/dist/Sidebar.js +101 -63
- package/dist/Skeleton.js +9 -9
- package/dist/Table.js +31 -31
- package/dist/Tabs.d.ts +15 -11
- package/dist/Tabs.js +134 -125
- package/dist/Toast.js +35 -34
- package/dist/Tooltip.js +1 -1
- package/dist/Typography.js +9 -9
- package/dist/Widget.js +77 -81
- package/dist/index.css +1 -1
- package/package.json +3 -2
package/dist/DatePicker.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as V, jsxs as qe } from "react/jsx-runtime";
|
|
3
3
|
import * as Wn from "react";
|
|
4
|
-
import h, { createContext as Sn, useContext as Cn, useCallback as
|
|
4
|
+
import h, { createContext as Sn, useContext as Cn, useCallback as $, useRef as Se, useLayoutEffect as Nn, useState as Qe, useEffect as xn, useMemo as Ce } from "react";
|
|
5
5
|
import { R as Yn, T as Tn, P as Pn, C as En } from "./_shared/index-C3aZemLI.js";
|
|
6
|
-
import { Calendar as
|
|
7
|
-
import { c as
|
|
6
|
+
import { Calendar as _n, ChevronLeft as Fn, ChevronRight as Bn } from "lucide-react";
|
|
7
|
+
import { c as Ne } from "./_shared/utils-eGXXUFl7.js";
|
|
8
8
|
function In(e, t, r = "long") {
|
|
9
9
|
return new Intl.DateTimeFormat("en-US", {
|
|
10
10
|
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
@@ -230,14 +230,14 @@ function Ue(e, t, r) {
|
|
|
230
230
|
), a = we(n), i = we(o), s = +a - ft(a), c = +i - ft(i);
|
|
231
231
|
return Math.round((s - c) / jn);
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Rn(e, t) {
|
|
234
234
|
const r = Wt(e, t), n = B(e, 0);
|
|
235
235
|
return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), pe(n);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function $n(e, t, r) {
|
|
238
238
|
return Ot(e, t * 7, r);
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function zn(e, t, r) {
|
|
241
241
|
return vt(e, t * 12, r);
|
|
242
242
|
}
|
|
243
243
|
function Qn(e, t) {
|
|
@@ -394,7 +394,7 @@ const nr = {
|
|
|
394
394
|
const o = nr[e];
|
|
395
395
|
return typeof o == "string" ? n = o : t === 1 ? n = o.one : n = o.other.replace("{{count}}", t.toString()), r?.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
396
396
|
};
|
|
397
|
-
function
|
|
397
|
+
function je(e) {
|
|
398
398
|
return (t = {}) => {
|
|
399
399
|
const r = t.width ? String(t.width) : e.defaultWidth;
|
|
400
400
|
return e.formats[r] || e.formats[e.defaultWidth];
|
|
@@ -416,15 +416,15 @@ const or = {
|
|
|
416
416
|
medium: "{{date}}, {{time}}",
|
|
417
417
|
short: "{{date}}, {{time}}"
|
|
418
418
|
}, ir = {
|
|
419
|
-
date:
|
|
419
|
+
date: je({
|
|
420
420
|
formats: or,
|
|
421
421
|
defaultWidth: "full"
|
|
422
422
|
}),
|
|
423
|
-
time:
|
|
423
|
+
time: je({
|
|
424
424
|
formats: sr,
|
|
425
425
|
defaultWidth: "full"
|
|
426
426
|
}),
|
|
427
|
-
dateTime:
|
|
427
|
+
dateTime: je({
|
|
428
428
|
formats: ar,
|
|
429
429
|
defaultWidth: "full"
|
|
430
430
|
})
|
|
@@ -758,12 +758,12 @@ const Dr = /^(\d+)(th|st|nd|rd)?/i, kr = /\d+/i, Or = {
|
|
|
758
758
|
firstWeekContainsDate: 1
|
|
759
759
|
}
|
|
760
760
|
};
|
|
761
|
-
function
|
|
761
|
+
function _r(e, t) {
|
|
762
762
|
const r = P(e, t?.in);
|
|
763
763
|
return Ue(r, xt(r)) + 1;
|
|
764
764
|
}
|
|
765
765
|
function Ve(e, t) {
|
|
766
|
-
const r = P(e, t?.in), n = +pe(r) - +
|
|
766
|
+
const r = P(e, t?.in), n = +pe(r) - +Rn(r);
|
|
767
767
|
return Math.round(n / kt) + 1;
|
|
768
768
|
}
|
|
769
769
|
function Tt(e, t) {
|
|
@@ -774,12 +774,12 @@ function Tt(e, t) {
|
|
|
774
774
|
const u = de(c, t);
|
|
775
775
|
return +r >= +s ? n + 1 : +r >= +u ? n : n - 1;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Fr(e, t) {
|
|
778
778
|
const r = Me(), n = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = Tt(e, t), a = B(t?.in || e, 0);
|
|
779
779
|
return a.setFullYear(o, 0, n), a.setHours(0, 0, 0, 0), de(a, t);
|
|
780
780
|
}
|
|
781
781
|
function Ze(e, t) {
|
|
782
|
-
const r = P(e, t?.in), n = +de(r, t) - +
|
|
782
|
+
const r = P(e, t?.in), n = +de(r, t) - +Fr(r, t);
|
|
783
783
|
return Math.round(n / kt) + 1;
|
|
784
784
|
}
|
|
785
785
|
function T(e, t) {
|
|
@@ -1033,7 +1033,7 @@ const se = {
|
|
|
1033
1033
|
},
|
|
1034
1034
|
// Day of year
|
|
1035
1035
|
D: function(e, t, r) {
|
|
1036
|
-
const n =
|
|
1036
|
+
const n = _r(e);
|
|
1037
1037
|
return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : T(n, t.length);
|
|
1038
1038
|
},
|
|
1039
1039
|
// Day of week
|
|
@@ -1429,15 +1429,15 @@ function jr(e) {
|
|
|
1429
1429
|
function Gr(e) {
|
|
1430
1430
|
return Ar.test(e);
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const n =
|
|
1432
|
+
function Rr(e, t, r) {
|
|
1433
|
+
const n = $r(e, t, r);
|
|
1434
1434
|
if (console.warn(n), qr.includes(e)) throw new RangeError(n);
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function $r(e, t, r) {
|
|
1437
1437
|
const n = e[0] === "Y" ? "years" : "days of the month";
|
|
1438
1438
|
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1439
1439
|
}
|
|
1440
|
-
const
|
|
1440
|
+
const zr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Qr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Xr = /^'([^]*?)'?$/, Ur = /''/g, Vr = /[a-zA-Z]/;
|
|
1441
1441
|
function be(e, t, r) {
|
|
1442
1442
|
const n = Me(), 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);
|
|
1443
1443
|
if (!Vn(s))
|
|
@@ -1449,7 +1449,7 @@ function be(e, t, r) {
|
|
|
1449
1449
|
return m(f, o.formatLong);
|
|
1450
1450
|
}
|
|
1451
1451
|
return f;
|
|
1452
|
-
}).join("").match(
|
|
1452
|
+
}).join("").match(zr).map((f) => {
|
|
1453
1453
|
if (f === "''")
|
|
1454
1454
|
return { isToken: !1, value: "'" };
|
|
1455
1455
|
const l = f[0];
|
|
@@ -1472,7 +1472,7 @@ function be(e, t, r) {
|
|
|
1472
1472
|
return c.map((f) => {
|
|
1473
1473
|
if (!f.isToken) return f.value;
|
|
1474
1474
|
const l = f.value;
|
|
1475
|
-
(!r?.useAdditionalWeekYearTokens && Gr(l) || !r?.useAdditionalDayOfYearTokens && jr(l)) &&
|
|
1475
|
+
(!r?.useAdditionalWeekYearTokens && Gr(l) || !r?.useAdditionalDayOfYearTokens && jr(l)) && Rr(l, t, String(e));
|
|
1476
1476
|
const m = dt[l[0]];
|
|
1477
1477
|
return m(s, l, o.localize, u);
|
|
1478
1478
|
}).join("");
|
|
@@ -1536,7 +1536,7 @@ function co(e, t) {
|
|
|
1536
1536
|
const r = Et(e, t), n = io(e, t);
|
|
1537
1537
|
return t.addDays(r, n * 7 - 1);
|
|
1538
1538
|
}
|
|
1539
|
-
const
|
|
1539
|
+
const _t = {
|
|
1540
1540
|
...fe,
|
|
1541
1541
|
labels: {
|
|
1542
1542
|
labelDayButton: (e, t, r, n) => {
|
|
@@ -1568,7 +1568,7 @@ const Ft = {
|
|
|
1568
1568
|
}
|
|
1569
1569
|
}
|
|
1570
1570
|
};
|
|
1571
|
-
class
|
|
1571
|
+
class G {
|
|
1572
1572
|
/**
|
|
1573
1573
|
* Creates an instance of `DateLib`.
|
|
1574
1574
|
*
|
|
@@ -1576,7 +1576,7 @@ class j {
|
|
|
1576
1576
|
* @param overrides Custom overrides for the date library functions.
|
|
1577
1577
|
*/
|
|
1578
1578
|
constructor(t, r) {
|
|
1579
|
-
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? H.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 H(n, o, a, this.options.timeZone) : new Date(n, o, a), this.addDays = (n, o) => this.overrides?.addDays ? this.overrides.addDays(n, o) : Ot(n, o), this.addMonths = (n, o) => this.overrides?.addMonths ? this.overrides.addMonths(n, o) : vt(n, o), this.addWeeks = (n, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, o) :
|
|
1579
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? H.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 H(n, o, a, this.options.timeZone) : new Date(n, o, a), this.addDays = (n, o) => this.overrides?.addDays ? this.overrides.addDays(n, o) : Ot(n, o), this.addMonths = (n, o) => this.overrides?.addMonths ? this.overrides.addMonths(n, o) : vt(n, o), this.addWeeks = (n, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, o) : $n(n, o), this.addYears = (n, o) => this.overrides?.addYears ? this.overrides.addYears(n, o) : zn(n, o), this.differenceInCalendarDays = (n, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, o) : Ue(n, o), this.differenceInCalendarMonths = (n, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, o) : Ct(n, o), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : Kn(n), this.eachYearOfInterval = (n) => {
|
|
1580
1580
|
const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : er(n), a = new Set(o.map((s) => this.getYear(s)));
|
|
1581
1581
|
if (a.size === o.length)
|
|
1582
1582
|
return o;
|
|
@@ -1587,7 +1587,7 @@ class j {
|
|
|
1587
1587
|
}, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : co(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : tr(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Zn(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) : Ln(n), this.format = (n, o, a) => {
|
|
1588
1588
|
const i = this.overrides?.format ? this.overrides.format(n, o, this.options) : be(n, o, this.options);
|
|
1589
1589
|
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
1590
|
-
}, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Ve(n), this.getMonth = (n, o) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : Jr(n, this.options), this.getYear = (n, o) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : Lr(n, this.options), this.getWeek = (n, o) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : Ze(n, this.options), this.isAfter = (n, o) => this.overrides?.isAfter ? this.overrides.isAfter(n, o) : eo(n, o), this.isBefore = (n, o) => this.overrides?.isBefore ? this.overrides.isBefore(n, o) : to(n, o), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : St(n), this.isSameDay = (n, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, o) : Un(n, o), this.isSameMonth = (n, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, o) : no(n, o), this.isSameYear = (n, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, o) : ro(n, o), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : Qn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : Xn(n), this.setMonth = (n, o) => this.overrides?.setMonth ? this.overrides.setMonth(n, o) : oo(n, o), this.setYear = (n, o) => this.overrides?.setYear ? this.overrides.setYear(n, o) : so(n, o), this.startOfBroadcastWeek = (n, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : Et(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : we(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : pe(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : Jn(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) : xt(n), this.options = { locale:
|
|
1590
|
+
}, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Ve(n), this.getMonth = (n, o) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : Jr(n, this.options), this.getYear = (n, o) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : Lr(n, this.options), this.getWeek = (n, o) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : Ze(n, this.options), this.isAfter = (n, o) => this.overrides?.isAfter ? this.overrides.isAfter(n, o) : eo(n, o), this.isBefore = (n, o) => this.overrides?.isBefore ? this.overrides.isBefore(n, o) : to(n, o), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : St(n), this.isSameDay = (n, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, o) : Un(n, o), this.isSameMonth = (n, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, o) : no(n, o), this.isSameYear = (n, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, o) : ro(n, o), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : Qn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : Xn(n), this.setMonth = (n, o) => this.overrides?.setMonth ? this.overrides.setMonth(n, o) : oo(n, o), this.setYear = (n, o) => this.overrides?.setYear ? this.overrides.setYear(n, o) : so(n, o), this.startOfBroadcastWeek = (n, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : Et(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : we(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : pe(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : Jn(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) : xt(n), this.options = { locale: _t, ...t }, this.overrides = r;
|
|
1591
1591
|
}
|
|
1592
1592
|
/**
|
|
1593
1593
|
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
@@ -1631,7 +1631,7 @@ class j {
|
|
|
1631
1631
|
*/
|
|
1632
1632
|
getMonthYearOrder() {
|
|
1633
1633
|
const t = this.options.locale?.code;
|
|
1634
|
-
return t &&
|
|
1634
|
+
return t && G.yearFirstLocales.has(t) ? "year-first" : "month-first";
|
|
1635
1635
|
}
|
|
1636
1636
|
/**
|
|
1637
1637
|
* Formats the month/year pair respecting locale conventions.
|
|
@@ -1640,7 +1640,7 @@ class j {
|
|
|
1640
1640
|
*/
|
|
1641
1641
|
formatMonthYear(t) {
|
|
1642
1642
|
const { locale: r, timeZone: n, numerals: o } = this.options, a = r?.code;
|
|
1643
|
-
if (a &&
|
|
1643
|
+
if (a && G.yearFirstLocales.has(a))
|
|
1644
1644
|
try {
|
|
1645
1645
|
return new Intl.DateTimeFormat(a, {
|
|
1646
1646
|
month: "long",
|
|
@@ -1654,7 +1654,7 @@ class j {
|
|
|
1654
1654
|
return this.format(t, i);
|
|
1655
1655
|
}
|
|
1656
1656
|
}
|
|
1657
|
-
|
|
1657
|
+
G.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
1658
1658
|
"eu",
|
|
1659
1659
|
"hu",
|
|
1660
1660
|
"ja",
|
|
@@ -1673,8 +1673,8 @@ j.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
|
1673
1673
|
"zh-HK",
|
|
1674
1674
|
"zh-TW"
|
|
1675
1675
|
]);
|
|
1676
|
-
const L = new
|
|
1677
|
-
class
|
|
1676
|
+
const L = new G();
|
|
1677
|
+
class Ft {
|
|
1678
1678
|
constructor(t, r, n = L) {
|
|
1679
1679
|
this.date = t, this.displayMonth = r, this.outside = !!(r && !n.isSameMonth(t, r)), this.dateLib = n, this.isoDate = n.format(t, "yyyy-MM-dd"), this.displayMonthId = n.format(r, "yyyy-MM"), this.dateMonthId = n.format(t, "yyyy-MM");
|
|
1680
1680
|
}
|
|
@@ -1737,14 +1737,14 @@ var E;
|
|
|
1737
1737
|
(function(e) {
|
|
1738
1738
|
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
1739
1739
|
})(E || (E = {}));
|
|
1740
|
-
var
|
|
1740
|
+
var A;
|
|
1741
1741
|
(function(e) {
|
|
1742
1742
|
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
1743
|
-
})(
|
|
1744
|
-
var
|
|
1743
|
+
})(A || (A = {}));
|
|
1744
|
+
var j;
|
|
1745
1745
|
(function(e) {
|
|
1746
1746
|
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";
|
|
1747
|
-
})(
|
|
1747
|
+
})(j || (j = {}));
|
|
1748
1748
|
function bo(e) {
|
|
1749
1749
|
const { options: t, className: r, components: n, classNames: o, ...a } = e, i = [o[d.Dropdown], r].join(" "), s = t?.find(({ value: c }) => c === a.value);
|
|
1750
1750
|
return h.createElement(
|
|
@@ -1791,9 +1791,9 @@ function vo(e) {
|
|
|
1791
1791
|
return h.createElement(t.Dropdown, { ...e });
|
|
1792
1792
|
}
|
|
1793
1793
|
function Wo(e) {
|
|
1794
|
-
const { onPreviousClick: t, onNextClick: r, previousMonth: n, nextMonth: o, ...a } = e, { components: i, classNames: s, labels: { labelPrevious: c, labelNext: u } } = De(), f =
|
|
1794
|
+
const { onPreviousClick: t, onNextClick: r, previousMonth: n, nextMonth: o, ...a } = e, { components: i, classNames: s, labels: { labelPrevious: c, labelNext: u } } = De(), f = $((m) => {
|
|
1795
1795
|
o && r?.(m);
|
|
1796
|
-
}, [o, r]), l =
|
|
1796
|
+
}, [o, r]), l = $((m) => {
|
|
1797
1797
|
n && t?.(m);
|
|
1798
1798
|
}, [n, t]);
|
|
1799
1799
|
return h.createElement(
|
|
@@ -1843,11 +1843,11 @@ function Eo(e) {
|
|
|
1843
1843
|
h.createElement("tr", { ...e })
|
|
1844
1844
|
);
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function _o(e) {
|
|
1847
1847
|
const { week: t, ...r } = e;
|
|
1848
1848
|
return h.createElement("th", { ...r });
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function Fo(e) {
|
|
1851
1851
|
return h.createElement("th", { ...e });
|
|
1852
1852
|
}
|
|
1853
1853
|
function Bo(e) {
|
|
@@ -1879,8 +1879,8 @@ const Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1879
1879
|
Root: xo,
|
|
1880
1880
|
Select: Yo,
|
|
1881
1881
|
Week: To,
|
|
1882
|
-
WeekNumber:
|
|
1883
|
-
WeekNumberHeader:
|
|
1882
|
+
WeekNumber: _o,
|
|
1883
|
+
WeekNumberHeader: Fo,
|
|
1884
1884
|
Weekday: Po,
|
|
1885
1885
|
Weekdays: Eo,
|
|
1886
1886
|
Weeks: Bo,
|
|
@@ -1894,7 +1894,7 @@ function ne(e, t, r = !1, n = L) {
|
|
|
1894
1894
|
function Ke(e) {
|
|
1895
1895
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
1896
1896
|
}
|
|
1897
|
-
function
|
|
1897
|
+
function xe(e) {
|
|
1898
1898
|
return !!(e && typeof e == "object" && "from" in e);
|
|
1899
1899
|
}
|
|
1900
1900
|
function Je(e) {
|
|
@@ -1918,7 +1918,7 @@ function re(e, t, r = L) {
|
|
|
1918
1918
|
return o(e, s);
|
|
1919
1919
|
if (Ht(s, r))
|
|
1920
1920
|
return s.some((c) => o(e, c));
|
|
1921
|
-
if (
|
|
1921
|
+
if (xe(s))
|
|
1922
1922
|
return ne(s, e, !1, r);
|
|
1923
1923
|
if (It(s))
|
|
1924
1924
|
return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
|
|
@@ -1938,11 +1938,11 @@ function Ao(e, t, r, n, o) {
|
|
|
1938
1938
|
[E.today]: []
|
|
1939
1939
|
}, D = {};
|
|
1940
1940
|
for (const b of e) {
|
|
1941
|
-
const { date: y, displayMonth: W } = b,
|
|
1942
|
-
!u && !c &&
|
|
1943
|
-
|
|
1944
|
-
const ce = s?.[
|
|
1945
|
-
ce && re(y, ce, o) && (D[
|
|
1941
|
+
const { date: y, displayMonth: W } = b, _ = !!(W && !m(y, W)), I = !!(Y && v(y, Y)), F = !!(M && O(y, M)), Z = !!(a && re(y, a, o)), oe = !!(i && re(y, i, o)) || I || F || // Broadcast calendar will show outside days as default
|
|
1942
|
+
!u && !c && _ || u && c === !1 && _, ee = l(y, f);
|
|
1943
|
+
_ && p.outside.push(b), Z && p.disabled.push(b), oe && p.hidden.push(b), ee && p.today.push(b), s && Object.keys(s).forEach((R) => {
|
|
1944
|
+
const ce = s?.[R];
|
|
1945
|
+
ce && re(y, ce, o) && (D[R] ? D[R].push(b) : D[R] = [b]);
|
|
1946
1946
|
});
|
|
1947
1947
|
}
|
|
1948
1948
|
return (b) => {
|
|
@@ -1953,12 +1953,12 @@ function Ao(e, t, r, n, o) {
|
|
|
1953
1953
|
[E.outside]: !1,
|
|
1954
1954
|
[E.today]: !1
|
|
1955
1955
|
}, W = {};
|
|
1956
|
-
for (const
|
|
1957
|
-
const I = p[
|
|
1958
|
-
y[
|
|
1956
|
+
for (const _ in p) {
|
|
1957
|
+
const I = p[_];
|
|
1958
|
+
y[_] = I.some((F) => F === b);
|
|
1959
1959
|
}
|
|
1960
|
-
for (const
|
|
1961
|
-
W[
|
|
1960
|
+
for (const _ in D)
|
|
1961
|
+
W[_] = D[_].some((I) => I === b);
|
|
1962
1962
|
return {
|
|
1963
1963
|
...y,
|
|
1964
1964
|
// custom modifiers should override all the previous ones
|
|
@@ -1967,7 +1967,7 @@ function Ao(e, t, r, n, o) {
|
|
|
1967
1967
|
};
|
|
1968
1968
|
}
|
|
1969
1969
|
function qo(e, t, r = {}) {
|
|
1970
|
-
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [a]) => (r[a] ? o.push(r[a]) : t[E[a]] ? o.push(t[E[a]]) : t[
|
|
1970
|
+
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [a]) => (r[a] ? o.push(r[a]) : t[E[a]] ? o.push(t[E[a]]) : t[A[a]] && o.push(t[A[a]]), o), [t[d.Day]]);
|
|
1971
1971
|
}
|
|
1972
1972
|
function jo(e) {
|
|
1973
1973
|
return {
|
|
@@ -1988,30 +1988,30 @@ function Go(e) {
|
|
|
1988
1988
|
r.startsWith("data-") && (t[r] = n);
|
|
1989
1989
|
}), t;
|
|
1990
1990
|
}
|
|
1991
|
-
function
|
|
1991
|
+
function Ro() {
|
|
1992
1992
|
const e = {};
|
|
1993
1993
|
for (const t in d)
|
|
1994
1994
|
e[d[t]] = `rdp-${d[t]}`;
|
|
1995
1995
|
for (const t in E)
|
|
1996
1996
|
e[E[t]] = `rdp-${E[t]}`;
|
|
1997
|
-
for (const t in
|
|
1998
|
-
e[
|
|
1999
|
-
for (const t in
|
|
2000
|
-
e[
|
|
1997
|
+
for (const t in A)
|
|
1998
|
+
e[A[t]] = `rdp-${A[t]}`;
|
|
1999
|
+
for (const t in j)
|
|
2000
|
+
e[j[t]] = `rdp-${j[t]}`;
|
|
2001
2001
|
return e;
|
|
2002
2002
|
}
|
|
2003
2003
|
function At(e, t, r) {
|
|
2004
|
-
return (r ?? new
|
|
2004
|
+
return (r ?? new G(t)).formatMonthYear(e);
|
|
2005
2005
|
}
|
|
2006
|
-
const
|
|
2007
|
-
function
|
|
2008
|
-
return (r ?? new
|
|
2006
|
+
const $o = At;
|
|
2007
|
+
function zo(e, t, r) {
|
|
2008
|
+
return (r ?? new G(t)).format(e, "d");
|
|
2009
2009
|
}
|
|
2010
2010
|
function Qo(e, t = L) {
|
|
2011
2011
|
return t.format(e, "LLLL");
|
|
2012
2012
|
}
|
|
2013
2013
|
function Xo(e, t, r) {
|
|
2014
|
-
return (r ?? new
|
|
2014
|
+
return (r ?? new G(t)).format(e, "cccccc");
|
|
2015
2015
|
}
|
|
2016
2016
|
function Uo(e, t = L) {
|
|
2017
2017
|
return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
|
|
@@ -2025,8 +2025,8 @@ function qt(e, t = L) {
|
|
|
2025
2025
|
const Zo = qt, Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2026
2026
|
__proto__: null,
|
|
2027
2027
|
formatCaption: At,
|
|
2028
|
-
formatDay:
|
|
2029
|
-
formatMonthCaption:
|
|
2028
|
+
formatDay: zo,
|
|
2029
|
+
formatMonthCaption: $o,
|
|
2030
2030
|
formatMonthDropdown: Qo,
|
|
2031
2031
|
formatWeekNumber: Uo,
|
|
2032
2032
|
formatWeekNumberHeader: Vo,
|
|
@@ -2041,33 +2041,33 @@ function Jo(e) {
|
|
|
2041
2041
|
};
|
|
2042
2042
|
}
|
|
2043
2043
|
function et(e, t, r, n) {
|
|
2044
|
-
let o = (n ?? new
|
|
2044
|
+
let o = (n ?? new G(r)).format(e, "PPPP");
|
|
2045
2045
|
return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
|
|
2046
2046
|
}
|
|
2047
2047
|
const Lo = et;
|
|
2048
2048
|
function tt(e, t, r) {
|
|
2049
|
-
return (r ?? new
|
|
2049
|
+
return (r ?? new G(t)).formatMonthYear(e);
|
|
2050
2050
|
}
|
|
2051
2051
|
const es = tt;
|
|
2052
2052
|
function jt(e, t, r, n) {
|
|
2053
|
-
let o = (n ?? new
|
|
2053
|
+
let o = (n ?? new G(r)).format(e, "PPPP");
|
|
2054
2054
|
return t?.today && (o = `Today, ${o}`), o;
|
|
2055
2055
|
}
|
|
2056
2056
|
function Gt(e) {
|
|
2057
2057
|
return "Choose the Month";
|
|
2058
2058
|
}
|
|
2059
|
-
function
|
|
2059
|
+
function Rt() {
|
|
2060
2060
|
return "";
|
|
2061
2061
|
}
|
|
2062
2062
|
const ts = "Go to the Next Month";
|
|
2063
|
-
function
|
|
2063
|
+
function $t(e, t) {
|
|
2064
2064
|
return ts;
|
|
2065
2065
|
}
|
|
2066
|
-
function
|
|
2066
|
+
function zt(e) {
|
|
2067
2067
|
return "Go to the Previous Month";
|
|
2068
2068
|
}
|
|
2069
2069
|
function Qt(e, t, r) {
|
|
2070
|
-
return (r ?? new
|
|
2070
|
+
return (r ?? new G(t)).format(e, "cccc");
|
|
2071
2071
|
}
|
|
2072
2072
|
function Xt(e, t) {
|
|
2073
2073
|
return `Week ${e}`;
|
|
@@ -2086,9 +2086,9 @@ const ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2086
2086
|
labelGrid: tt,
|
|
2087
2087
|
labelGridcell: jt,
|
|
2088
2088
|
labelMonthDropdown: Gt,
|
|
2089
|
-
labelNav:
|
|
2090
|
-
labelNext:
|
|
2091
|
-
labelPrevious:
|
|
2089
|
+
labelNav: Rt,
|
|
2090
|
+
labelNext: $t,
|
|
2091
|
+
labelPrevious: zt,
|
|
2092
2092
|
labelWeekNumber: Xt,
|
|
2093
2093
|
labelWeekNumberHeader: Ut,
|
|
2094
2094
|
labelWeekday: Qt,
|
|
@@ -2101,13 +2101,13 @@ function rs(e, t) {
|
|
|
2101
2101
|
...e ?? {},
|
|
2102
2102
|
labelDayButton: U(et, e?.labelDayButton, r.labelDayButton),
|
|
2103
2103
|
labelMonthDropdown: U(Gt, e?.labelMonthDropdown, r.labelMonthDropdown),
|
|
2104
|
-
labelNext: U(
|
|
2105
|
-
labelPrevious: U(
|
|
2104
|
+
labelNext: U($t, e?.labelNext, r.labelNext),
|
|
2105
|
+
labelPrevious: U(zt, e?.labelPrevious, r.labelPrevious),
|
|
2106
2106
|
labelWeekNumber: U(Xt, e?.labelWeekNumber, r.labelWeekNumber),
|
|
2107
2107
|
labelYearDropdown: U(Vt, e?.labelYearDropdown, r.labelYearDropdown),
|
|
2108
2108
|
labelGrid: U(tt, e?.labelGrid, r.labelGrid),
|
|
2109
2109
|
labelGridcell: U(jt, e?.labelGridcell, r.labelGridcell),
|
|
2110
|
-
labelNav: U(
|
|
2110
|
+
labelNav: U(Rt, e?.labelNav, r.labelNav),
|
|
2111
2111
|
labelWeekNumberHeader: U(Ut, e?.labelWeekNumberHeader, r.labelWeekNumberHeader),
|
|
2112
2112
|
labelWeekday: U(Qt, e?.labelWeekday, r.labelWeekday)
|
|
2113
2113
|
};
|
|
@@ -2247,9 +2247,9 @@ function cs(e, t = {}) {
|
|
|
2247
2247
|
}
|
|
2248
2248
|
};
|
|
2249
2249
|
}
|
|
2250
|
-
const ke = (e) => e instanceof HTMLElement ? e : null,
|
|
2250
|
+
const ke = (e) => e instanceof HTMLElement ? e : null, Ge = (e) => [
|
|
2251
2251
|
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2252
|
-
], us = (e) => ke(e.querySelector("[data-animated-month]")),
|
|
2252
|
+
], us = (e) => ke(e.querySelector("[data-animated-month]")), Re = (e) => ke(e.querySelector("[data-animated-caption]")), $e = (e) => ke(e.querySelector("[data-animated-weeks]")), ls = (e) => ke(e.querySelector("[data-animated-nav]")), fs = (e) => ke(e.querySelector("[data-animated-weekdays]"));
|
|
2253
2253
|
function ds(e, t, { classNames: r, months: n, focused: o, dateLib: a }) {
|
|
2254
2254
|
const i = Se(null), s = Se(n), c = Se(!1);
|
|
2255
2255
|
Nn(() => {
|
|
@@ -2258,20 +2258,20 @@ function ds(e, t, { classNames: r, months: n, focused: o, dateLib: a }) {
|
|
|
2258
2258
|
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2259
2259
|
n.length === 0 || u.length === 0 || n.length !== u.length)
|
|
2260
2260
|
return;
|
|
2261
|
-
const f = a.isSameMonth(n[0].date, u[0].date), l = a.isAfter(n[0].date, u[0].date), m = l ? r[
|
|
2262
|
-
if (C instanceof HTMLElement ? (
|
|
2261
|
+
const f = a.isSameMonth(n[0].date, u[0].date), l = a.isAfter(n[0].date, u[0].date), m = 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);
|
|
2262
|
+
if (C instanceof HTMLElement ? (Ge(C).forEach((p) => {
|
|
2263
2263
|
if (!(p instanceof HTMLElement))
|
|
2264
2264
|
return;
|
|
2265
2265
|
const D = us(p);
|
|
2266
2266
|
D && p.contains(D) && p.removeChild(D);
|
|
2267
|
-
const b =
|
|
2267
|
+
const b = Re(p);
|
|
2268
2268
|
b && b.classList.remove(m);
|
|
2269
|
-
const y =
|
|
2269
|
+
const y = $e(p);
|
|
2270
2270
|
y && y.classList.remove(g);
|
|
2271
2271
|
}), 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
|
|
2272
2272
|
o)
|
|
2273
2273
|
return;
|
|
2274
|
-
const O = v instanceof HTMLElement ?
|
|
2274
|
+
const O = v instanceof HTMLElement ? Ge(v) : [], Y = Ge(e.current);
|
|
2275
2275
|
if (Y?.every((M) => M instanceof HTMLElement) && O && O.every((M) => M instanceof HTMLElement)) {
|
|
2276
2276
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
2277
2277
|
const M = ls(e.current);
|
|
@@ -2280,39 +2280,39 @@ function ds(e, t, { classNames: r, months: n, focused: o, dateLib: a }) {
|
|
|
2280
2280
|
if (!b)
|
|
2281
2281
|
return;
|
|
2282
2282
|
p.style.position = "relative", p.style.overflow = "hidden";
|
|
2283
|
-
const y =
|
|
2283
|
+
const y = Re(p);
|
|
2284
2284
|
y && y.classList.add(m);
|
|
2285
|
-
const W =
|
|
2285
|
+
const W = $e(p);
|
|
2286
2286
|
W && W.classList.add(g);
|
|
2287
|
-
const
|
|
2287
|
+
const _ = () => {
|
|
2288
2288
|
c.current = !1, e.current && (e.current.style.isolation = ""), M && (M.style.zIndex = ""), y && y.classList.remove(m), W && W.classList.remove(g), p.style.position = "", p.style.overflow = "", p.contains(b) && p.removeChild(b);
|
|
2289
2289
|
};
|
|
2290
2290
|
b.style.pointerEvents = "none", b.style.position = "absolute", b.style.overflow = "hidden", b.setAttribute("aria-hidden", "true");
|
|
2291
2291
|
const I = fs(b);
|
|
2292
2292
|
I && (I.style.opacity = "0");
|
|
2293
|
-
const
|
|
2294
|
-
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2293
|
+
const F = Re(b);
|
|
2294
|
+
F && (F.classList.add(l ? r[j.caption_before_exit] : r[j.caption_after_exit]), F.addEventListener("animationend", _));
|
|
2295
|
+
const Z = $e(b);
|
|
2296
|
+
Z && Z.classList.add(l ? r[j.weeks_before_exit] : r[j.weeks_after_exit]), p.insertBefore(b, p.firstChild);
|
|
2297
2297
|
});
|
|
2298
2298
|
}
|
|
2299
2299
|
});
|
|
2300
2300
|
}
|
|
2301
2301
|
function hs(e, t, r, n) {
|
|
2302
|
-
const o = e[0], a = e[e.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: c } = r ?? {}, { addDays: u, differenceInCalendarDays: f, differenceInCalendarMonths: l, endOfBroadcastWeek: m, endOfISOWeek: g, endOfMonth: v, endOfWeek: C, isAfter: O, startOfBroadcastWeek: Y, startOfISOWeek: M, startOfWeek: p } = n, D = c ? Y(o, n) : i ? M(o) : p(o), b = c ? m(a) : i ? g(v(a)) : C(v(a)), y = t && (c ? m(t) : i ? g(t) : C(t)), W = y && O(b, y) ? y : b,
|
|
2303
|
-
for (let ee = 0; ee <=
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2302
|
+
const o = e[0], a = e[e.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: c } = r ?? {}, { addDays: u, differenceInCalendarDays: f, differenceInCalendarMonths: l, endOfBroadcastWeek: m, endOfISOWeek: g, endOfMonth: v, endOfWeek: C, isAfter: O, startOfBroadcastWeek: Y, startOfISOWeek: M, startOfWeek: p } = n, D = c ? Y(o, n) : i ? M(o) : p(o), b = c ? m(a) : i ? g(v(a)) : C(v(a)), y = t && (c ? m(t) : i ? g(t) : C(t)), W = y && O(b, y) ? y : b, _ = f(W, D), I = l(a, o) + 1, F = [];
|
|
2303
|
+
for (let ee = 0; ee <= _; ee++) {
|
|
2304
|
+
const R = u(D, ee);
|
|
2305
|
+
F.push(R);
|
|
2306
2306
|
}
|
|
2307
2307
|
const oe = (c ? 35 : 42) * I;
|
|
2308
|
-
if (s &&
|
|
2309
|
-
const ee = oe -
|
|
2310
|
-
for (let
|
|
2311
|
-
const ce = u(
|
|
2312
|
-
|
|
2308
|
+
if (s && F.length < oe) {
|
|
2309
|
+
const ee = oe - F.length;
|
|
2310
|
+
for (let R = 0; R < ee; R++) {
|
|
2311
|
+
const ce = u(F[F.length - 1], 1);
|
|
2312
|
+
F.push(ce);
|
|
2313
2313
|
}
|
|
2314
2314
|
}
|
|
2315
|
-
return
|
|
2315
|
+
return F;
|
|
2316
2316
|
}
|
|
2317
2317
|
function ms(e) {
|
|
2318
2318
|
const t = [];
|
|
@@ -2345,15 +2345,15 @@ function gs(e, t, r, n) {
|
|
|
2345
2345
|
const { addDays: o, endOfBroadcastWeek: a, endOfISOWeek: i, endOfMonth: s, endOfWeek: c, getISOWeek: u, getWeek: f, startOfBroadcastWeek: l, startOfISOWeek: m, startOfWeek: g } = n, v = e.reduce((C, O) => {
|
|
2346
2346
|
const Y = r.broadcastCalendar ? l(O, n) : r.ISOWeek ? m(O) : g(O), M = r.broadcastCalendar ? a(O) : r.ISOWeek ? i(s(O)) : c(s(O)), p = t.filter((W) => W >= Y && W <= M), D = r.broadcastCalendar ? 35 : 42;
|
|
2347
2347
|
if (r.fixedWeeks && p.length < D) {
|
|
2348
|
-
const W = t.filter((
|
|
2348
|
+
const W = t.filter((_) => {
|
|
2349
2349
|
const I = D - p.length;
|
|
2350
|
-
return
|
|
2350
|
+
return _ > M && _ <= o(M, I);
|
|
2351
2351
|
});
|
|
2352
2352
|
p.push(...W);
|
|
2353
2353
|
}
|
|
2354
|
-
const b = p.reduce((W,
|
|
2355
|
-
const I = r.ISOWeek ? u(
|
|
2356
|
-
return
|
|
2354
|
+
const b = p.reduce((W, _) => {
|
|
2355
|
+
const I = r.ISOWeek ? u(_) : f(_), F = W.find((oe) => oe.weekNumber === I), Z = new Ft(_, O, n);
|
|
2356
|
+
return F ? F.days.push(Z) : W.push(new lo(I, [Z])), W;
|
|
2357
2357
|
}, []), y = new uo(O, b);
|
|
2358
2358
|
return C.push(y), C;
|
|
2359
2359
|
}, []);
|
|
@@ -2391,12 +2391,12 @@ function Ms(e) {
|
|
|
2391
2391
|
const t = [];
|
|
2392
2392
|
return e.reduce((r, n) => r.concat(n.weeks.slice()), t.slice());
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2395
|
-
const [r, n] =
|
|
2394
|
+
function Ye(e, t) {
|
|
2395
|
+
const [r, n] = Qe(e);
|
|
2396
2396
|
return [t === void 0 ? r : t, n];
|
|
2397
2397
|
}
|
|
2398
2398
|
function Ds(e, t) {
|
|
2399
|
-
const [r, n] = bs(e, t), { startOfMonth: o, endOfMonth: a } = t, i = bt(e, r, n, t), [s, c] =
|
|
2399
|
+
const [r, n] = bs(e, t), { startOfMonth: o, endOfMonth: a } = t, i = bt(e, r, n, t), [s, c] = Ye(
|
|
2400
2400
|
i,
|
|
2401
2401
|
// initialMonth is always computed from props.month if provided
|
|
2402
2402
|
e.month ? i : void 0
|
|
@@ -2415,13 +2415,13 @@ function Ds(e, t) {
|
|
|
2415
2415
|
fixedWeeks: e.fixedWeeks,
|
|
2416
2416
|
ISOWeek: e.ISOWeek,
|
|
2417
2417
|
reverseMonths: e.reverseMonths
|
|
2418
|
-
}, t), W = Ms(y),
|
|
2418
|
+
}, t), W = Ms(y), _ = ms(y), I = ws(s, r, e, t), F = ps(s, n, e, t);
|
|
2419
2419
|
return {
|
|
2420
2420
|
months: y,
|
|
2421
2421
|
weeks: W,
|
|
2422
|
-
days:
|
|
2422
|
+
days: _,
|
|
2423
2423
|
previousMonth: I,
|
|
2424
|
-
nextMonth:
|
|
2424
|
+
nextMonth: F
|
|
2425
2425
|
};
|
|
2426
2426
|
}, [
|
|
2427
2427
|
t,
|
|
@@ -2456,10 +2456,10 @@ function Ds(e, t) {
|
|
|
2456
2456
|
}
|
|
2457
2457
|
};
|
|
2458
2458
|
}
|
|
2459
|
-
var
|
|
2459
|
+
var K;
|
|
2460
2460
|
(function(e) {
|
|
2461
2461
|
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
2462
|
-
})(
|
|
2462
|
+
})(K || (K = {}));
|
|
2463
2463
|
function pt(e) {
|
|
2464
2464
|
return !e[E.disabled] && !e[E.hidden] && !e[E.outside];
|
|
2465
2465
|
}
|
|
@@ -2467,7 +2467,7 @@ function ks(e, t, r, n) {
|
|
|
2467
2467
|
let o, a = -1;
|
|
2468
2468
|
for (const i of e) {
|
|
2469
2469
|
const s = t(i);
|
|
2470
|
-
pt(s) && (s[E.focused] && a <
|
|
2470
|
+
pt(s) && (s[E.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[E.today] && a < K.Today && (o = i, a = K.Today));
|
|
2471
2471
|
}
|
|
2472
2472
|
return o || (o = e.find((i) => pt(t(i)))), o;
|
|
2473
2473
|
}
|
|
@@ -2486,11 +2486,11 @@ function Os(e, t, r, n, o, a, i) {
|
|
|
2486
2486
|
function Zt(e, t, r, n, o, a, i, s = 0) {
|
|
2487
2487
|
if (s > 365)
|
|
2488
2488
|
return;
|
|
2489
|
-
const c = Os(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, m = new
|
|
2489
|
+
const c = Os(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, m = new Ft(c, l, i);
|
|
2490
2490
|
return !u && !f ? m : Zt(e, t, m, n, o, a, i, s + 1);
|
|
2491
2491
|
}
|
|
2492
2492
|
function vs(e, t, r, n, o) {
|
|
2493
|
-
const { autoFocus: a } = e, [i, s] =
|
|
2493
|
+
const { autoFocus: a } = e, [i, s] = Qe(), c = ks(t.days, r, n || (() => !1), i), [u, f] = Qe(a ? c : void 0);
|
|
2494
2494
|
return {
|
|
2495
2495
|
isFocusTarget: (C) => !!c?.isEqualTo(C),
|
|
2496
2496
|
setFocused: f,
|
|
@@ -2507,7 +2507,7 @@ function vs(e, t, r, n, o) {
|
|
|
2507
2507
|
};
|
|
2508
2508
|
}
|
|
2509
2509
|
function Ws(e, t) {
|
|
2510
|
-
const { selected: r, required: n, onSelect: o } = e, [a, i] =
|
|
2510
|
+
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;
|
|
2511
2511
|
return {
|
|
2512
2512
|
selected: s,
|
|
2513
2513
|
select: (g, v, C) => {
|
|
@@ -2567,7 +2567,7 @@ function wt(e, t, r = L) {
|
|
|
2567
2567
|
}
|
|
2568
2568
|
function Ns(e, t, r = L) {
|
|
2569
2569
|
const n = Array.isArray(t) ? t : [t];
|
|
2570
|
-
if (n.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : r.isDate(s) ? ne(e, s, !1, r) : Ht(s, r) ? s.some((c) => ne(e, c, !1, r)) :
|
|
2570
|
+
if (n.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : r.isDate(s) ? ne(e, s, !1, r) : Ht(s, r) ? s.some((c) => ne(e, c, !1, r)) : xe(s) ? s.from && s.to ? wt(e, { from: s.from, to: s.to }, r) : !1 : It(s) ? Cs(e, s.dayOfWeek, r) : Ke(s) ? r.isAfter(s.before, s.after) ? wt(e, {
|
|
2571
2571
|
from: r.addDays(s.after, 1),
|
|
2572
2572
|
to: r.addDays(s.before, -1)
|
|
2573
2573
|
}, r) : re(e.from, s, r) || re(e.to, s, r) : Je(s) || Le(s) ? re(e.from, s, r) || re(e.to, s, r) : !1))
|
|
@@ -2585,7 +2585,7 @@ function Ns(e, t, r = L) {
|
|
|
2585
2585
|
return !1;
|
|
2586
2586
|
}
|
|
2587
2587
|
function xs(e, t) {
|
|
2588
|
-
const { disabled: r, excludeDisabled: n, resetOnSelect: o, selected: a, required: i, onSelect: s } = e, [c, u] =
|
|
2588
|
+
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;
|
|
2589
2589
|
return {
|
|
2590
2590
|
selected: f,
|
|
2591
2591
|
select: (g, v, C) => {
|
|
@@ -2601,7 +2601,7 @@ function xs(e, t) {
|
|
|
2601
2601
|
};
|
|
2602
2602
|
}
|
|
2603
2603
|
function Ys(e, t) {
|
|
2604
|
-
const { selected: r, required: n, onSelect: o } = e, [a, i] =
|
|
2604
|
+
const { selected: r, required: n, onSelect: o } = e, [a, i] = Ye(r, o ? r : void 0), s = o ? r : a, { isSameDay: c } = t;
|
|
2605
2605
|
return {
|
|
2606
2606
|
selected: s,
|
|
2607
2607
|
select: (l, m, g) => {
|
|
@@ -2624,17 +2624,17 @@ function Ts(e, t) {
|
|
|
2624
2624
|
return;
|
|
2625
2625
|
}
|
|
2626
2626
|
}
|
|
2627
|
-
function
|
|
2627
|
+
function z(e, t) {
|
|
2628
2628
|
return e instanceof H && e.timeZone === t ? e : new H(e, t);
|
|
2629
2629
|
}
|
|
2630
2630
|
function le(e, t, r) {
|
|
2631
|
-
return
|
|
2631
|
+
return z(e, t);
|
|
2632
2632
|
}
|
|
2633
2633
|
function Mt(e, t, r) {
|
|
2634
|
-
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? le(e, t) : Array.isArray(e) ? e.map((n) => n instanceof Date ? le(n, t) : n) :
|
|
2634
|
+
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? le(e, t) : Array.isArray(e) ? e.map((n) => n instanceof Date ? le(n, t) : n) : xe(e) ? {
|
|
2635
2635
|
...e,
|
|
2636
|
-
from: e.from ?
|
|
2637
|
-
to: e.to ?
|
|
2636
|
+
from: e.from ? z(e.from, t) : e.from,
|
|
2637
|
+
to: e.to ? z(e.to, t) : e.to
|
|
2638
2638
|
} : Ke(e) ? {
|
|
2639
2639
|
before: le(e.before, t),
|
|
2640
2640
|
after: le(e.after, t)
|
|
@@ -2644,7 +2644,7 @@ function Mt(e, t, r) {
|
|
|
2644
2644
|
before: le(e.before, t)
|
|
2645
2645
|
} : e;
|
|
2646
2646
|
}
|
|
2647
|
-
function
|
|
2647
|
+
function ze(e, t, r) {
|
|
2648
2648
|
return e && (Array.isArray(e) ? e.map((n) => Mt(n, t)) : Mt(e, t));
|
|
2649
2649
|
}
|
|
2650
2650
|
function Ps(e) {
|
|
@@ -2653,20 +2653,20 @@ function Ps(e) {
|
|
|
2653
2653
|
if (r && (t = {
|
|
2654
2654
|
...e,
|
|
2655
2655
|
timeZone: r
|
|
2656
|
-
}, t.today && (t.today =
|
|
2657
|
-
from: t.selected.from ?
|
|
2658
|
-
to: t.selected.to ?
|
|
2659
|
-
}), t.disabled !== void 0 && (t.disabled =
|
|
2656
|
+
}, 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 = {
|
|
2657
|
+
from: t.selected.from ? z(t.selected.from, r) : t.selected.from,
|
|
2658
|
+
to: t.selected.to ? z(t.selected.to, r) : t.selected.to
|
|
2659
|
+
}), t.disabled !== void 0 && (t.disabled = ze(t.disabled, r)), t.hidden !== void 0 && (t.hidden = ze(t.hidden, r)), t.modifiers)) {
|
|
2660
2660
|
const k = {};
|
|
2661
2661
|
Object.keys(t.modifiers).forEach((x) => {
|
|
2662
|
-
k[x] =
|
|
2662
|
+
k[x] = ze(t.modifiers?.[x], r);
|
|
2663
2663
|
}), t.modifiers = k;
|
|
2664
2664
|
}
|
|
2665
2665
|
const { components: n, formatters: o, labels: a, dateLib: i, locale: s, classNames: c } = Ce(() => {
|
|
2666
|
-
const k = { ...
|
|
2666
|
+
const k = { ..._t, ...t.locale }, x = t.broadcastCalendar ? 1 : t.weekStartsOn, w = t.noonSafe && t.timeZone ? cs(t.timeZone, {
|
|
2667
2667
|
weekStartsOn: x,
|
|
2668
2668
|
locale: k
|
|
2669
|
-
}) : void 0, N = t.dateLib && w ? { ...w, ...t.dateLib } : t.dateLib ?? w,
|
|
2669
|
+
}) : void 0, N = t.dateLib && w ? { ...w, ...t.dateLib } : t.dateLib ?? w, q = new G({
|
|
2670
2670
|
locale: k,
|
|
2671
2671
|
weekStartsOn: x,
|
|
2672
2672
|
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
@@ -2676,12 +2676,12 @@ function Ps(e) {
|
|
|
2676
2676
|
numerals: t.numerals
|
|
2677
2677
|
}, N);
|
|
2678
2678
|
return {
|
|
2679
|
-
dateLib:
|
|
2679
|
+
dateLib: q,
|
|
2680
2680
|
components: jo(t.components),
|
|
2681
2681
|
formatters: Jo(t.formatters),
|
|
2682
|
-
labels: rs(t.labels,
|
|
2682
|
+
labels: rs(t.labels, q.options),
|
|
2683
2683
|
locale: k,
|
|
2684
|
-
classNames: { ...
|
|
2684
|
+
classNames: { ...Ro(), ...t.classNames }
|
|
2685
2685
|
};
|
|
2686
2686
|
}, [
|
|
2687
2687
|
t.locale,
|
|
@@ -2700,17 +2700,17 @@ function Ps(e) {
|
|
|
2700
2700
|
t.classNames
|
|
2701
2701
|
]);
|
|
2702
2702
|
t.today || (t = { ...t, today: i.today() });
|
|
2703
|
-
const { captionLayout: u, mode: f, navLayout: l, numberOfMonths: m = 1, onDayBlur: g, onDayClick: v, onDayFocus: C, onDayKeyDown: O, onDayMouseEnter: Y, onDayMouseLeave: M, onNextClick: p, onPrevClick: D, showWeekNumber: b, styles: y } = t, { formatCaption: W, formatDay:
|
|
2703
|
+
const { captionLayout: u, mode: f, navLayout: l, numberOfMonths: m = 1, onDayBlur: g, onDayClick: v, onDayFocus: C, onDayKeyDown: O, onDayMouseEnter: Y, onDayMouseLeave: M, onNextClick: p, onPrevClick: D, showWeekNumber: b, styles: y } = t, { formatCaption: W, formatDay: _, formatMonthDropdown: I, formatWeekNumber: F, formatWeekNumberHeader: Z, formatWeekdayName: oe, formatYearDropdown: ee } = o, R = Ds(t, i), { days: ce, months: Oe, navStart: Te, navEnd: Pe, previousMonth: Q, nextMonth: X, goToMonth: te } = R, Ee = Ao(ce, t, Te, Pe, i), { isSelected: _e, select: Fe, selected: ve } = Ts(t, i) ?? {}, { blur: nt, focused: rt, isFocusTarget: Kt, moveFocus: ot, setFocused: We } = vs(t, R, Ee, _e ?? (() => !1), i), { labelDayButton: Jt, labelGridcell: Lt, labelGrid: en, labelMonthDropdown: tn, labelNav: st, labelPrevious: nn, labelNext: rn, labelWeekday: on, labelWeekNumber: sn, labelWeekNumberHeader: an, labelYearDropdown: cn } = a, un = Ce(() => as(i, t.ISOWeek, t.broadcastCalendar, t.today), [i, t.ISOWeek, t.broadcastCalendar, t.today]), at = f !== void 0 || v !== void 0, Be = $(() => {
|
|
2704
2704
|
Q && (te(Q), D?.(Q));
|
|
2705
|
-
}, [Q, te, D]),
|
|
2705
|
+
}, [Q, te, D]), Ie = $(() => {
|
|
2706
2706
|
X && (te(X), p?.(X));
|
|
2707
|
-
}, [te, X, p]), ln =
|
|
2707
|
+
}, [te, X, p]), ln = $((k, x) => (w) => {
|
|
2708
2708
|
w.preventDefault(), w.stopPropagation(), We(k), !x.disabled && (Fe?.(k.date, x, w), v?.(k.date, x, w));
|
|
2709
|
-
}, [Fe, v, We]), fn =
|
|
2709
|
+
}, [Fe, v, We]), fn = $((k, x) => (w) => {
|
|
2710
2710
|
We(k), C?.(k.date, x, w);
|
|
2711
|
-
}, [C, We]), dn =
|
|
2711
|
+
}, [C, We]), dn = $((k, x) => (w) => {
|
|
2712
2712
|
nt(), g?.(k.date, x, w);
|
|
2713
|
-
}, [nt, g]), hn =
|
|
2713
|
+
}, [nt, g]), hn = $((k, x) => (w) => {
|
|
2714
2714
|
const N = {
|
|
2715
2715
|
ArrowLeft: [
|
|
2716
2716
|
w.shiftKey ? "month" : "day",
|
|
@@ -2729,18 +2729,18 @@ function Ps(e) {
|
|
|
2729
2729
|
};
|
|
2730
2730
|
if (N[w.key]) {
|
|
2731
2731
|
w.preventDefault(), w.stopPropagation();
|
|
2732
|
-
const [
|
|
2733
|
-
ot(
|
|
2732
|
+
const [q, S] = N[w.key];
|
|
2733
|
+
ot(q, S);
|
|
2734
2734
|
}
|
|
2735
2735
|
O?.(k.date, x, w);
|
|
2736
|
-
}, [ot, O, t.dir]), mn =
|
|
2736
|
+
}, [ot, O, t.dir]), mn = $((k, x) => (w) => {
|
|
2737
2737
|
Y?.(k.date, x, w);
|
|
2738
|
-
}, [Y]), yn =
|
|
2738
|
+
}, [Y]), yn = $((k, x) => (w) => {
|
|
2739
2739
|
M?.(k.date, x, w);
|
|
2740
|
-
}, [M]), gn =
|
|
2740
|
+
}, [M]), gn = $((k) => (x) => {
|
|
2741
2741
|
const w = Number(x.target.value), N = i.setMonth(i.startOfMonth(k), w);
|
|
2742
2742
|
te(N);
|
|
2743
|
-
}, [i, te]), bn =
|
|
2743
|
+
}, [i, te]), bn = $((k) => (x) => {
|
|
2744
2744
|
const w = Number(x.target.value), N = i.setYear(i.startOfMonth(k), w);
|
|
2745
2745
|
te(N);
|
|
2746
2746
|
}, [i, te]), { className: pn, style: wn } = Ce(() => ({
|
|
@@ -2757,12 +2757,12 @@ function Ps(e) {
|
|
|
2757
2757
|
dayPickerProps: t,
|
|
2758
2758
|
selected: ve,
|
|
2759
2759
|
select: Fe,
|
|
2760
|
-
isSelected:
|
|
2760
|
+
isSelected: _e,
|
|
2761
2761
|
months: Oe,
|
|
2762
2762
|
nextMonth: X,
|
|
2763
2763
|
previousMonth: Q,
|
|
2764
2764
|
goToMonth: te,
|
|
2765
|
-
getModifiers:
|
|
2765
|
+
getModifiers: Ee,
|
|
2766
2766
|
components: n,
|
|
2767
2767
|
classNames: c,
|
|
2768
2768
|
styles: y,
|
|
@@ -2778,7 +2778,7 @@ function Ps(e) {
|
|
|
2778
2778
|
h.createElement(
|
|
2779
2779
|
n.Months,
|
|
2780
2780
|
{ className: c[d.Months], style: y?.[d.Months] },
|
|
2781
|
-
!t.hideNavigation && !l && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[d.Nav], style: y?.[d.Nav], "aria-label": st(), onPreviousClick:
|
|
2781
|
+
!t.hideNavigation && !l && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[d.Nav], style: y?.[d.Nav], "aria-label": st(), onPreviousClick: Be, onNextClick: Ie, previousMonth: Q, nextMonth: X }),
|
|
2782
2782
|
Oe.map((k, x) => h.createElement(
|
|
2783
2783
|
n.Month,
|
|
2784
2784
|
{
|
|
@@ -2792,14 +2792,14 @@ function Ps(e) {
|
|
|
2792
2792
|
},
|
|
2793
2793
|
l === "around" && !t.hideNavigation && x === 0 && h.createElement(
|
|
2794
2794
|
n.PreviousMonthButton,
|
|
2795
|
-
{ type: "button", className: c[d.PreviousMonthButton], tabIndex: Q ? void 0 : -1, "aria-disabled": Q ? void 0 : !0, "aria-label": nn(Q), onClick:
|
|
2795
|
+
{ type: "button", className: c[d.PreviousMonthButton], tabIndex: Q ? void 0 : -1, "aria-disabled": Q ? void 0 : !0, "aria-label": nn(Q), onClick: Be, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2796
2796
|
h.createElement(n.Chevron, { disabled: Q ? void 0 : !0, className: c[d.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
2797
2797
|
),
|
|
2798
2798
|
h.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[d.MonthCaption], style: y?.[d.MonthCaption], calendarMonth: k, displayIndex: x }, u?.startsWith("dropdown") ? h.createElement(
|
|
2799
2799
|
n.DropdownNav,
|
|
2800
2800
|
{ className: c[d.Dropdowns], style: y?.[d.Dropdowns] },
|
|
2801
2801
|
(() => {
|
|
2802
|
-
const w = u === "dropdown" || u === "dropdown-months" ? h.createElement(n.MonthsDropdown, { key: "month", className: c[d.MonthsDropdown], "aria-label": tn(), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: gn(k.date), options: os(k.date,
|
|
2802
|
+
const w = u === "dropdown" || u === "dropdown-months" ? h.createElement(n.MonthsDropdown, { key: "month", className: c[d.MonthsDropdown], "aria-label": tn(), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: gn(k.date), options: os(k.date, Te, Pe, o, i), style: y?.[d.Dropdown], value: i.getMonth(k.date) }) : h.createElement("span", { key: "month" }, I(k.date, i)), N = u === "dropdown" || u === "dropdown-years" ? h.createElement(n.YearsDropdown, { key: "year", className: c[d.YearsDropdown], "aria-label": cn(i.options), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: bn(k.date), options: is(Te, Pe, o, i, !!t.reverseYears), style: y?.[d.Dropdown], value: i.getYear(k.date) }) : h.createElement("span", { key: "year" }, ee(k.date, i));
|
|
2803
2803
|
return i.getMonthYearOrder() === "year-first" ? [N, w] : [w, N];
|
|
2804
2804
|
})(),
|
|
2805
2805
|
h.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
@@ -2817,17 +2817,17 @@ function Ps(e) {
|
|
|
2817
2817
|
) : h.createElement(n.CaptionLabel, { className: c[d.CaptionLabel], role: "status", "aria-live": "polite" }, W(k.date, i.options, i))),
|
|
2818
2818
|
l === "around" && !t.hideNavigation && x === m - 1 && h.createElement(
|
|
2819
2819
|
n.NextMonthButton,
|
|
2820
|
-
{ type: "button", className: c[d.NextMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label": rn(X), onClick:
|
|
2820
|
+
{ type: "button", className: c[d.NextMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label": rn(X), onClick: Ie, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2821
2821
|
h.createElement(n.Chevron, { disabled: X ? void 0 : !0, className: c[d.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
2822
2822
|
),
|
|
2823
|
-
x === m - 1 && l === "after" && !t.hideNavigation && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[d.Nav], style: y?.[d.Nav], "aria-label": st(), onPreviousClick:
|
|
2823
|
+
x === m - 1 && l === "after" && !t.hideNavigation && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[d.Nav], style: y?.[d.Nav], "aria-label": st(), onPreviousClick: Be, onNextClick: Ie, previousMonth: Q, nextMonth: X }),
|
|
2824
2824
|
h.createElement(
|
|
2825
2825
|
n.MonthGrid,
|
|
2826
2826
|
{ role: "grid", "aria-multiselectable": f === "multiple" || f === "range", "aria-label": en(k.date, i.options, i) || void 0, className: c[d.MonthGrid], style: y?.[d.MonthGrid] },
|
|
2827
2827
|
!t.hideWeekdays && h.createElement(
|
|
2828
2828
|
n.Weekdays,
|
|
2829
2829
|
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: c[d.Weekdays], style: y?.[d.Weekdays] },
|
|
2830
|
-
b && h.createElement(n.WeekNumberHeader, { "aria-label": an(i.options), className: c[d.WeekNumberHeader], style: y?.[d.WeekNumberHeader], scope: "col" },
|
|
2830
|
+
b && h.createElement(n.WeekNumberHeader, { "aria-label": an(i.options), className: c[d.WeekNumberHeader], style: y?.[d.WeekNumberHeader], scope: "col" }, Z()),
|
|
2831
2831
|
un.map((w) => h.createElement(n.Weekday, { "aria-label": on(w, i.options, i), className: c[d.Weekday], key: String(w), style: y?.[d.Weekday], scope: "col" }, oe(w, i.options, i)))
|
|
2832
2832
|
),
|
|
2833
2833
|
h.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[d.Weeks], style: y?.[d.Weeks] }, k.weeks.map((w) => h.createElement(
|
|
@@ -2835,15 +2835,15 @@ function Ps(e) {
|
|
|
2835
2835
|
{ className: c[d.Week], key: w.weekNumber, style: y?.[d.Week], week: w },
|
|
2836
2836
|
b && h.createElement(n.WeekNumber, { week: w, style: y?.[d.WeekNumber], "aria-label": sn(w.weekNumber, {
|
|
2837
2837
|
locale: s
|
|
2838
|
-
}), className: c[d.WeekNumber], scope: "row", role: "rowheader" },
|
|
2838
|
+
}), className: c[d.WeekNumber], scope: "row", role: "rowheader" }, F(w.weekNumber, i)),
|
|
2839
2839
|
w.days.map((N) => {
|
|
2840
|
-
const { date:
|
|
2841
|
-
if (S[E.focused] = !S.hidden && !!rt?.isEqualTo(N), S[
|
|
2842
|
-
const { from:
|
|
2843
|
-
S[
|
|
2840
|
+
const { date: q } = N, S = Ee(N);
|
|
2841
|
+
if (S[E.focused] = !S.hidden && !!rt?.isEqualTo(N), S[A.selected] = _e?.(q) || S.selected, xe(ve)) {
|
|
2842
|
+
const { from: He, to: Ae } = ve;
|
|
2843
|
+
S[A.range_start] = !!(He && Ae && i.isSameDay(q, He)), S[A.range_end] = !!(He && Ae && i.isSameDay(q, Ae)), S[A.range_middle] = ne(ve, q, !0, i);
|
|
2844
2844
|
}
|
|
2845
|
-
const kn = ss(S, y, t.modifiersStyles), On = qo(S, c, t.modifiersClassNames), vn = !at && !S.hidden ? Lt(
|
|
2846
|
-
return h.createElement(n.Day, { key: `${N.isoDate}_${N.displayMonthId}`, day: N, modifiers: S, className: On.join(" "), style: kn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": vn, "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 && at ? h.createElement(n.DayButton, { className: c[d.DayButton], style: y?.[d.DayButton], type: "button", day: N, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: Kt(N) ? 0 : -1, "aria-label": Jt(
|
|
2845
|
+
const kn = ss(S, y, t.modifiersStyles), On = qo(S, c, t.modifiersClassNames), vn = !at && !S.hidden ? Lt(q, S, i.options, i) : void 0;
|
|
2846
|
+
return h.createElement(n.Day, { key: `${N.isoDate}_${N.displayMonthId}`, day: N, modifiers: S, className: On.join(" "), style: kn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": vn, "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 && at ? h.createElement(n.DayButton, { className: c[d.DayButton], style: y?.[d.DayButton], type: "button", day: N, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: Kt(N) ? 0 : -1, "aria-label": Jt(q, S, i.options, i), onClick: ln(N, S), onBlur: dn(N, S), onFocus: fn(N, S), onKeyDown: hn(N, S), onMouseEnter: mn(N, S), onMouseLeave: yn(N, S) }, _(q, i.options, i)) : !S.hidden && _(N.date, i.options, i));
|
|
2847
2847
|
})
|
|
2848
2848
|
)))
|
|
2849
2849
|
)
|
|
@@ -2854,49 +2854,65 @@ function Ps(e) {
|
|
|
2854
2854
|
);
|
|
2855
2855
|
}
|
|
2856
2856
|
const Es = {
|
|
2857
|
-
[d.Months]: "flex flex-col sm:flex-row
|
|
2858
|
-
[d.Month]: "flex flex-col gap-
|
|
2859
|
-
[d.MonthCaption]: "flex items-center justify-
|
|
2860
|
-
[d.CaptionLabel]: "text-sm font-medium text-foreground",
|
|
2861
|
-
[d.Nav]: "flex items-center gap-1",
|
|
2862
|
-
[d.PreviousMonthButton]: "inline-flex items-center justify-center
|
|
2863
|
-
[d.NextMonthButton]: "inline-flex items-center justify-center
|
|
2857
|
+
[d.Months]: "relative flex flex-col gap-4 sm:flex-row",
|
|
2858
|
+
[d.Month]: "flex w-full flex-col gap-4",
|
|
2859
|
+
[d.MonthCaption]: "flex h-8 w-full items-center justify-center",
|
|
2860
|
+
[d.CaptionLabel]: "text-sm font-medium text-foreground select-none",
|
|
2861
|
+
[d.Nav]: "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
2862
|
+
[d.PreviousMonthButton]: "inline-flex items-center justify-center h-8 w-8 rounded-4xl p-0 select-none cursor-pointer bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground transition-colors aria-disabled:opacity-50",
|
|
2863
|
+
[d.NextMonthButton]: "inline-flex items-center justify-center h-8 w-8 rounded-4xl p-0 select-none cursor-pointer bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground transition-colors aria-disabled:opacity-50",
|
|
2864
2864
|
[d.MonthGrid]: "w-full border-collapse",
|
|
2865
2865
|
[d.Weekdays]: "flex",
|
|
2866
|
-
[d.Weekday]: "
|
|
2867
|
-
[d.Week]: "flex w-full mt-
|
|
2868
|
-
[d.Day]: "
|
|
2869
|
-
[d.DayButton]: "
|
|
2870
|
-
|
|
2871
|
-
[
|
|
2866
|
+
[d.Weekday]: "flex-1 text-[0.8rem] font-normal text-muted-foreground text-center select-none w-8",
|
|
2867
|
+
[d.Week]: "flex w-full mt-1",
|
|
2868
|
+
[d.Day]: "relative aspect-square h-full w-full p-0 text-center select-none",
|
|
2869
|
+
[d.DayButton]: "inline-flex items-center justify-center h-8 w-8 rounded-4xl text-sm font-normal transition-colors cursor-pointer border-none bg-transparent text-foreground hover:bg-muted",
|
|
2870
|
+
// Leave selection states empty — styled inline by the Day component below
|
|
2871
|
+
[A.selected]: "",
|
|
2872
|
+
[A.range_start]: "",
|
|
2873
|
+
[A.range_end]: "",
|
|
2874
|
+
[A.range_middle]: "",
|
|
2875
|
+
[E.today]: "bg-muted rounded-4xl",
|
|
2872
2876
|
[E.outside]: "text-muted-foreground opacity-50",
|
|
2873
|
-
[E.disabled]: "text-muted-foreground opacity-
|
|
2877
|
+
[E.disabled]: "text-muted-foreground opacity-50 cursor-not-allowed"
|
|
2874
2878
|
};
|
|
2879
|
+
function _s({ className: e, modifiers: t, ...r }) {
|
|
2880
|
+
let n = "";
|
|
2881
|
+
return t.range_middle ? n = "bg-primary/10 rounded-none [&>button]:text-foreground [&>button]:hover:bg-primary/20" : t.range_start ? n = "bg-primary/10 rounded-l-4xl rounded-r-none [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary" : t.range_end ? n = "bg-primary/10 rounded-r-4xl rounded-l-none [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary" : t.selected && (n = "bg-primary rounded-4xl [&>button]:text-primary-foreground [&>button]:hover:bg-primary"), /* @__PURE__ */ V(
|
|
2882
|
+
"td",
|
|
2883
|
+
{
|
|
2884
|
+
...r,
|
|
2885
|
+
className: Ne(e, n)
|
|
2886
|
+
}
|
|
2887
|
+
);
|
|
2888
|
+
}
|
|
2875
2889
|
function Fs({ orientation: e }) {
|
|
2876
|
-
return e === "left" ? /* @__PURE__ */
|
|
2890
|
+
return e === "left" ? /* @__PURE__ */ V(Fn, { size: 16 }) : /* @__PURE__ */ V(Bn, { size: 16 });
|
|
2877
2891
|
}
|
|
2878
|
-
function
|
|
2892
|
+
function Bs(e) {
|
|
2879
2893
|
return new Intl.DateTimeFormat("fr-FR", {
|
|
2880
2894
|
day: "numeric",
|
|
2881
2895
|
month: "long",
|
|
2882
2896
|
year: "numeric"
|
|
2883
2897
|
}).format(e);
|
|
2884
2898
|
}
|
|
2885
|
-
function
|
|
2899
|
+
function Is(e) {
|
|
2886
2900
|
const { className: t, ...r } = e;
|
|
2887
|
-
return /* @__PURE__ */
|
|
2901
|
+
return /* @__PURE__ */ V(
|
|
2888
2902
|
Ps,
|
|
2889
2903
|
{
|
|
2904
|
+
showOutsideDays: !0,
|
|
2890
2905
|
...r,
|
|
2891
2906
|
classNames: Es,
|
|
2892
|
-
className:
|
|
2907
|
+
className: Ne("p-3", t),
|
|
2893
2908
|
components: {
|
|
2894
|
-
Chevron: Fs
|
|
2909
|
+
Chevron: Fs,
|
|
2910
|
+
Day: _s
|
|
2895
2911
|
}
|
|
2896
2912
|
}
|
|
2897
2913
|
);
|
|
2898
2914
|
}
|
|
2899
|
-
function
|
|
2915
|
+
function Rs({
|
|
2900
2916
|
value: e,
|
|
2901
2917
|
onChange: t,
|
|
2902
2918
|
placeholder: r = "Choisir une date",
|
|
@@ -2906,37 +2922,37 @@ function Gs({
|
|
|
2906
2922
|
const [a, i] = Wn.useState(!1), s = (c) => {
|
|
2907
2923
|
t?.(c), c && i(!1);
|
|
2908
2924
|
};
|
|
2909
|
-
return /* @__PURE__ */
|
|
2910
|
-
n && /* @__PURE__ */
|
|
2911
|
-
/* @__PURE__ */
|
|
2912
|
-
/* @__PURE__ */
|
|
2925
|
+
return /* @__PURE__ */ qe("div", { className: "flex flex-col gap-1", children: [
|
|
2926
|
+
n && /* @__PURE__ */ V("span", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-0.5 block", children: n }),
|
|
2927
|
+
/* @__PURE__ */ qe(Yn, { open: a, onOpenChange: i, children: [
|
|
2928
|
+
/* @__PURE__ */ V(Tn, { asChild: !0, children: /* @__PURE__ */ qe(
|
|
2913
2929
|
"button",
|
|
2914
2930
|
{
|
|
2915
2931
|
type: "button",
|
|
2916
|
-
className:
|
|
2917
|
-
"flex items-center gap-2 bg-
|
|
2918
|
-
"focus:border-
|
|
2919
|
-
"hover:border-primary/40",
|
|
2932
|
+
className: Ne(
|
|
2933
|
+
"flex items-center gap-2 bg-input/50 border border-transparent rounded-3xl px-3 py-2 text-sm transition-[color,box-shadow,border-color] cursor-pointer h-9",
|
|
2934
|
+
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30",
|
|
2920
2935
|
e ? "text-foreground" : "text-muted-foreground",
|
|
2921
2936
|
o
|
|
2922
2937
|
),
|
|
2923
2938
|
children: [
|
|
2924
|
-
/* @__PURE__ */
|
|
2925
|
-
/* @__PURE__ */
|
|
2939
|
+
/* @__PURE__ */ V(_n, { size: 16, className: "text-muted-foreground shrink-0" }),
|
|
2940
|
+
/* @__PURE__ */ V("span", { className: "flex-1 text-left truncate", children: e ? Bs(e) : r })
|
|
2926
2941
|
]
|
|
2927
2942
|
}
|
|
2928
2943
|
) }),
|
|
2929
|
-
/* @__PURE__ */
|
|
2944
|
+
/* @__PURE__ */ V(Pn, { children: /* @__PURE__ */ V(
|
|
2930
2945
|
En,
|
|
2931
2946
|
{
|
|
2932
2947
|
align: "start",
|
|
2933
2948
|
sideOffset: 4,
|
|
2934
|
-
className:
|
|
2935
|
-
"z-50 rounded-
|
|
2936
|
-
"animate-in fade-in-0 zoom-in-95"
|
|
2949
|
+
className: Ne(
|
|
2950
|
+
"z-50 rounded-3xl bg-card shadow-lg ring-1 ring-foreground/5 dark:ring-foreground/10",
|
|
2951
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
2952
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
2937
2953
|
),
|
|
2938
|
-
children: /* @__PURE__ */
|
|
2939
|
-
|
|
2954
|
+
children: /* @__PURE__ */ V(
|
|
2955
|
+
Is,
|
|
2940
2956
|
{
|
|
2941
2957
|
mode: "single",
|
|
2942
2958
|
selected: e,
|
|
@@ -2949,6 +2965,6 @@ function Gs({
|
|
|
2949
2965
|
] });
|
|
2950
2966
|
}
|
|
2951
2967
|
export {
|
|
2952
|
-
|
|
2953
|
-
|
|
2968
|
+
Is as Calendar,
|
|
2969
|
+
Rs as DatePicker
|
|
2954
2970
|
};
|