@purpur/library 9.4.1 → 9.5.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/CHANGELOG.json +39 -0
- package/CHANGELOG.md +23 -1
- package/dist/LICENSE.txt +8 -1
- package/dist/calendar-BXQ3v62X.js +2 -0
- package/dist/{calendar-CBBV8n3x.js.map → calendar-BXQ3v62X.js.map} +1 -1
- package/dist/{calendar-DEXw83mu.mjs → calendar-d53vgYqR.mjs} +481 -465
- package/dist/{calendar-DEXw83mu.mjs.map → calendar-d53vgYqR.mjs.map} +1 -1
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.es.js +3 -3
- package/dist/comparison-table-C74IAVqz.js +2 -0
- package/dist/comparison-table-C74IAVqz.js.map +1 -0
- package/dist/comparison-table-DctKxmX9.mjs +267 -0
- package/dist/comparison-table-DctKxmX9.mjs.map +1 -0
- package/dist/comparison-table.cjs.js +1 -1
- package/dist/comparison-table.es.js +1 -1
- package/dist/components/calendar/src/calendar.d.ts +4 -11
- package/dist/components/calendar/src/calendar.d.ts.map +1 -1
- package/dist/components/comparison-table/src/comparison-table.d.ts.map +1 -1
- package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts +2 -1
- package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts.map +1 -1
- package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts +1 -2
- package/dist/components/comparison-table/src/components/ScrollProgress/scroll-progress.d.ts.map +1 -1
- package/dist/components/date-field/src/date-field.d.ts.map +1 -1
- package/dist/components/date-picker/src/date-picker.d.ts +11 -2
- package/dist/components/date-picker/src/date-picker.d.ts.map +1 -1
- package/dist/components/date-range-field/src/date-range-field.d.ts +27 -0
- package/dist/components/date-range-field/src/date-range-field.d.ts.map +1 -0
- package/dist/components-metadata.js +10 -0
- package/dist/date-field-BKKty89_.js +2 -0
- package/dist/{date-field-BJaomFjs.js.map → date-field-BKKty89_.js.map} +1 -1
- package/dist/{date-field-D3rTtf9Y.mjs → date-field-Cv5CKR1y.mjs} +276 -268
- package/dist/{date-field-D3rTtf9Y.mjs.map → date-field-Cv5CKR1y.mjs.map} +1 -1
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.es.js +1 -1
- package/dist/date-picker-CzxhZxsw.mjs +1611 -0
- package/dist/date-picker-CzxhZxsw.mjs.map +1 -0
- package/dist/date-picker-uyPKJulK.js +2 -0
- package/dist/date-picker-uyPKJulK.js.map +1 -0
- package/dist/date-picker.cjs.js +1 -1
- package/dist/date-picker.es.js +1 -1
- package/dist/date-range-field-CFcjprIl.mjs +142 -0
- package/dist/date-range-field-CFcjprIl.mjs.map +1 -0
- package/dist/date-range-field-D8vLeSwp.js +2 -0
- package/dist/date-range-field-D8vLeSwp.js.map +1 -0
- package/dist/date-range-field.cjs.js +2 -0
- package/dist/date-range-field.cjs.js.map +1 -0
- package/dist/date-range-field.es.js +5 -0
- package/dist/date-range-field.es.js.map +1 -0
- package/dist/{floating-ui.react-dom-gsHLgcoR.mjs → floating-ui.react-dom-EredA301.mjs} +3 -3
- package/dist/{floating-ui.react-dom-gsHLgcoR.mjs.map → floating-ui.react-dom-EredA301.mjs.map} +1 -1
- package/dist/{format-DpkYPs7O.mjs → format-CWOXI-dC.mjs} +8 -8
- package/dist/{format-DpkYPs7O.mjs.map → format-CWOXI-dC.mjs.map} +1 -1
- package/dist/libraries/library/src/date-range-field.d.ts +6 -0
- package/dist/libraries/library/src/date-range-field.d.ts.map +1 -0
- package/dist/libraries/library/src/library.d.ts +1 -0
- package/dist/libraries/library/src/library.d.ts.map +1 -1
- package/dist/library.cjs.js +1 -1
- package/dist/library.es.js +636 -633
- package/dist/library.es.js.map +1 -1
- package/dist/{popover-_xJATlhN.mjs → popover-I26xNbTz.mjs} +2 -2
- package/dist/{popover-_xJATlhN.mjs.map → popover-I26xNbTz.mjs.map} +1 -1
- package/dist/popover.es.js +1 -1
- package/dist/purpur.css +1 -1
- package/dist/{stepper-CNnx_NiR.mjs → stepper-CWR2vGPj.mjs} +2 -2
- package/dist/{stepper-CNnx_NiR.mjs.map → stepper-CWR2vGPj.mjs.map} +1 -1
- package/dist/stepper.es.js +1 -1
- package/dist/{table-D_sdSJyr.mjs → table-g_n68i4s.mjs} +2 -2
- package/dist/{table-D_sdSJyr.mjs.map → table-g_n68i4s.mjs.map} +1 -1
- package/dist/table.es.js +1 -1
- package/dist/{tooltip-VlURN8H3.mjs → tooltip-LU2Cy-QC.mjs} +2 -2
- package/dist/{tooltip-VlURN8H3.mjs.map → tooltip-LU2Cy-QC.mjs.map} +1 -1
- package/dist/tooltip.es.js +1 -1
- package/dist/{zh-TW-oiRD71xW.mjs → zh-TW-DrQ6h7hA.mjs} +2 -2
- package/dist/{zh-TW-oiRD71xW.mjs.map → zh-TW-DrQ6h7hA.mjs.map} +1 -1
- package/package.json +22 -21
- package/src/aliases.ts +7 -0
- package/src/date-range-field.ts +6 -0
- package/src/entries.js +1 -0
- package/src/library.ts +2 -0
- package/dist/calendar-CBBV8n3x.js +0 -2
- package/dist/comparison-table-8bOJmz-L.mjs +0 -275
- package/dist/comparison-table-8bOJmz-L.mjs.map +0 -1
- package/dist/comparison-table-mKL2IHXW.js +0 -2
- package/dist/comparison-table-mKL2IHXW.js.map +0 -1
- package/dist/date-field-BJaomFjs.js +0 -2
- package/dist/date-picker-CbUNbOhn.mjs +0 -1415
- package/dist/date-picker-CbUNbOhn.mjs.map +0 -1
- package/dist/date-picker-DYXNB5aU.js +0 -2
- package/dist/date-picker-DYXNB5aU.js.map +0 -1
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { jsx as ae } from "react/jsx-runtime";
|
|
2
|
-
import d, { createContext as At, useContext as Ht, useCallback as H, useRef as
|
|
2
|
+
import d, { createContext as At, useContext as Ht, useCallback as H, useRef as ce, useLayoutEffect as Zt, useState as pe, useEffect as Ue, useMemo as Ce } from "react";
|
|
3
3
|
import { b as Ae } from "./button-4-yWOgtD.mjs";
|
|
4
4
|
import { l as jt } from "./chevron-left.es-UFhf3v35.mjs";
|
|
5
5
|
import { n as zt } from "./chevron-right.es-D7aVK4ER.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { t as I, c as L, a as Ge, r as le, u as Ee, g as qt, v as Rt, p as Ut, j as Gt, i as Kt, x as Lt, h as Vt, s as Jt, y as Qt, e as Ke } from "./format-CWOXI-dC.mjs";
|
|
8
|
+
function Xt(e, t, n = "long") {
|
|
8
9
|
return new Intl.DateTimeFormat("en-US", {
|
|
9
10
|
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
10
11
|
hour: "numeric",
|
|
11
12
|
timeZone: e,
|
|
12
|
-
timeZoneName:
|
|
13
|
+
timeZoneName: n
|
|
13
14
|
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
14
15
|
}
|
|
15
16
|
const en = {}, ie = {};
|
|
16
17
|
function ne(e, t) {
|
|
17
18
|
try {
|
|
18
|
-
const
|
|
19
|
+
const o = (en[e] ||= new Intl.DateTimeFormat("en-US", {
|
|
19
20
|
timeZone: e,
|
|
20
21
|
timeZoneName: "longOffset"
|
|
21
22
|
}).format)(t).split("GMT")[1];
|
|
22
|
-
return
|
|
23
|
+
return o in ie ? ie[o] : He(o, o.split(":"));
|
|
23
24
|
} catch {
|
|
24
25
|
if (e in ie) return ie[e];
|
|
25
|
-
const
|
|
26
|
-
return
|
|
26
|
+
const n = e?.match(tn);
|
|
27
|
+
return n ? He(e, n.slice(1)) : NaN;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
const tn = /([+-]\d\d):?(\d\d)?/;
|
|
30
31
|
function He(e, t) {
|
|
31
|
-
const
|
|
32
|
-
return ie[e] =
|
|
32
|
+
const n = +(t[0] || 0), o = +(t[1] || 0), s = +(t[2] || 0) / 60;
|
|
33
|
+
return ie[e] = n * 60 + o > 0 ? n * 60 + o + s : n * 60 - o - s;
|
|
33
34
|
}
|
|
34
35
|
class K extends Date {
|
|
35
36
|
//#region static
|
|
36
37
|
constructor(...t) {
|
|
37
38
|
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ne(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), Le(this), Te(this)) : this.setTime(Date.now());
|
|
38
39
|
}
|
|
39
|
-
static tz(t, ...
|
|
40
|
-
return
|
|
40
|
+
static tz(t, ...n) {
|
|
41
|
+
return n.length ? new K(...n, t) : new K(Date.now(), t);
|
|
41
42
|
}
|
|
42
43
|
//#endregion
|
|
43
44
|
//#region time zone
|
|
@@ -79,68 +80,68 @@ function nn(e) {
|
|
|
79
80
|
Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), Le(e);
|
|
80
81
|
}
|
|
81
82
|
function Le(e) {
|
|
82
|
-
const t = ne(e.timeZone, e),
|
|
83
|
-
|
|
84
|
-
const s = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), r = -(/* @__PURE__ */ new Date(+
|
|
83
|
+
const t = ne(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), o = /* @__PURE__ */ new Date(+e);
|
|
84
|
+
o.setUTCHours(o.getUTCHours() - 1);
|
|
85
|
+
const s = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), r = -(/* @__PURE__ */ new Date(+o)).getTimezoneOffset(), i = s - r, a = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
85
86
|
i && a && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + i);
|
|
86
|
-
const c = s -
|
|
87
|
+
const c = s - n;
|
|
87
88
|
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
88
89
|
const l = /* @__PURE__ */ new Date(+e);
|
|
89
90
|
l.setUTCSeconds(0);
|
|
90
|
-
const
|
|
91
|
-
(f ||
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) +
|
|
95
|
-
const W = ne(e.timeZone, e),
|
|
91
|
+
const h = s > 0 ? l.getSeconds() : (l.getSeconds() - 60) % 60, f = Math.round(-(ne(e.timeZone, e) * 60)) % 60;
|
|
92
|
+
(f || h) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + f), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + f + h));
|
|
93
|
+
const u = ne(e.timeZone, e), p = u > 0 ? Math.floor(u) : Math.ceil(u), O = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - p, k = p !== n, g = O - c;
|
|
94
|
+
if (k && g) {
|
|
95
|
+
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + g);
|
|
96
|
+
const W = ne(e.timeZone, e), M = W > 0 ? Math.floor(W) : Math.ceil(W), S = p - M;
|
|
96
97
|
S && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + S), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + S));
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
class F extends K {
|
|
100
101
|
//#region static
|
|
101
|
-
static tz(t, ...
|
|
102
|
-
return
|
|
102
|
+
static tz(t, ...n) {
|
|
103
|
+
return n.length ? new F(...n, t) : new F(Date.now(), t);
|
|
103
104
|
}
|
|
104
105
|
//#endregion
|
|
105
106
|
//#region representation
|
|
106
107
|
toISOString() {
|
|
107
|
-
const [t,
|
|
108
|
+
const [t, n, o] = this.tzComponents(), s = `${t}${n}:${o}`;
|
|
108
109
|
return this.internal.toISOString().slice(0, -1) + s;
|
|
109
110
|
}
|
|
110
111
|
toString() {
|
|
111
112
|
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
112
113
|
}
|
|
113
114
|
toDateString() {
|
|
114
|
-
const [t,
|
|
115
|
-
return `${t?.slice(0, -1)} ${
|
|
115
|
+
const [t, n, o, s] = this.internal.toUTCString().split(" ");
|
|
116
|
+
return `${t?.slice(0, -1)} ${o} ${n} ${s}`;
|
|
116
117
|
}
|
|
117
118
|
toTimeString() {
|
|
118
|
-
const t = this.internal.toUTCString().split(" ")[4], [
|
|
119
|
-
return `${t} GMT${
|
|
119
|
+
const t = this.internal.toUTCString().split(" ")[4], [n, o, s] = this.tzComponents();
|
|
120
|
+
return `${t} GMT${n}${o}${s} (${Xt(this.timeZone, this)})`;
|
|
120
121
|
}
|
|
121
|
-
toLocaleString(t,
|
|
122
|
+
toLocaleString(t, n) {
|
|
122
123
|
return Date.prototype.toLocaleString.call(this, t, {
|
|
123
|
-
...
|
|
124
|
-
timeZone:
|
|
124
|
+
...n,
|
|
125
|
+
timeZone: n?.timeZone || this.timeZone
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
|
-
toLocaleDateString(t,
|
|
128
|
+
toLocaleDateString(t, n) {
|
|
128
129
|
return Date.prototype.toLocaleDateString.call(this, t, {
|
|
129
|
-
...
|
|
130
|
-
timeZone:
|
|
130
|
+
...n,
|
|
131
|
+
timeZone: n?.timeZone || this.timeZone
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
|
-
toLocaleTimeString(t,
|
|
134
|
+
toLocaleTimeString(t, n) {
|
|
134
135
|
return Date.prototype.toLocaleTimeString.call(this, t, {
|
|
135
|
-
...
|
|
136
|
-
timeZone:
|
|
136
|
+
...n,
|
|
137
|
+
timeZone: n?.timeZone || this.timeZone
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
140
|
//#endregion
|
|
140
141
|
//#region private
|
|
141
142
|
tzComponents() {
|
|
142
|
-
const t = this.getTimezoneOffset(),
|
|
143
|
-
return [
|
|
143
|
+
const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+", o = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), s = String(Math.abs(t) % 60).padStart(2, "0");
|
|
144
|
+
return [n, o, s];
|
|
144
145
|
}
|
|
145
146
|
//#endregion
|
|
146
147
|
withTimeZone(t) {
|
|
@@ -168,146 +169,146 @@ var A;
|
|
|
168
169
|
(function(e) {
|
|
169
170
|
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";
|
|
170
171
|
})(A || (A = {}));
|
|
171
|
-
function Ve(e, t,
|
|
172
|
-
const
|
|
172
|
+
function Ve(e, t, n) {
|
|
173
|
+
const o = I(e, n?.in);
|
|
173
174
|
if (isNaN(t)) return L(e, NaN);
|
|
174
175
|
if (!t)
|
|
175
|
-
return
|
|
176
|
-
const s =
|
|
177
|
-
r.setMonth(
|
|
176
|
+
return o;
|
|
177
|
+
const s = o.getDate(), r = L(e, o.getTime());
|
|
178
|
+
r.setMonth(o.getMonth() + t + 1, 0);
|
|
178
179
|
const i = r.getDate();
|
|
179
|
-
return s >= i ? r : (
|
|
180
|
+
return s >= i ? r : (o.setFullYear(
|
|
180
181
|
r.getFullYear(),
|
|
181
182
|
r.getMonth(),
|
|
182
183
|
s
|
|
183
|
-
),
|
|
184
|
+
), o);
|
|
184
185
|
}
|
|
185
|
-
function on(e, t,
|
|
186
|
-
return Ge(e, t * 7,
|
|
186
|
+
function on(e, t, n) {
|
|
187
|
+
return Ge(e, t * 7, n);
|
|
187
188
|
}
|
|
188
|
-
function sn(e, t,
|
|
189
|
-
return Ve(e, t * 12,
|
|
189
|
+
function sn(e, t, n) {
|
|
190
|
+
return Ve(e, t * 12, n);
|
|
190
191
|
}
|
|
191
192
|
function rn(e, t) {
|
|
192
|
-
let
|
|
193
|
+
let n, o = t?.in;
|
|
193
194
|
return e.forEach((s) => {
|
|
194
|
-
!
|
|
195
|
-
const r = I(s,
|
|
196
|
-
(!
|
|
197
|
-
}), L(
|
|
195
|
+
!o && typeof s == "object" && (o = L.bind(null, s));
|
|
196
|
+
const r = I(s, o);
|
|
197
|
+
(!n || n < r || isNaN(+r)) && (n = r);
|
|
198
|
+
}), L(o, n || NaN);
|
|
198
199
|
}
|
|
199
200
|
function an(e, t) {
|
|
200
|
-
let
|
|
201
|
+
let n, o = t?.in;
|
|
201
202
|
return e.forEach((s) => {
|
|
202
|
-
!
|
|
203
|
-
const r = I(s,
|
|
204
|
-
(!
|
|
205
|
-
}), L(
|
|
206
|
-
}
|
|
207
|
-
function cn(e, t,
|
|
208
|
-
const [
|
|
209
|
-
|
|
203
|
+
!o && typeof s == "object" && (o = L.bind(null, s));
|
|
204
|
+
const r = I(s, o);
|
|
205
|
+
(!n || n > r || isNaN(+r)) && (n = r);
|
|
206
|
+
}), L(o, n || NaN);
|
|
207
|
+
}
|
|
208
|
+
function cn(e, t, n) {
|
|
209
|
+
const [o, s] = le(
|
|
210
|
+
n?.in,
|
|
210
211
|
e,
|
|
211
212
|
t
|
|
212
213
|
);
|
|
213
|
-
return +Ee(
|
|
214
|
+
return +Ee(o) == +Ee(s);
|
|
214
215
|
}
|
|
215
|
-
function ln(e, t,
|
|
216
|
-
const [
|
|
217
|
-
|
|
216
|
+
function ln(e, t, n) {
|
|
217
|
+
const [o, s] = le(
|
|
218
|
+
n?.in,
|
|
218
219
|
e,
|
|
219
220
|
t
|
|
220
|
-
), r =
|
|
221
|
+
), r = o.getFullYear() - s.getFullYear(), i = o.getMonth() - s.getMonth();
|
|
221
222
|
return r * 12 + i;
|
|
222
223
|
}
|
|
223
224
|
function fn(e, t) {
|
|
224
|
-
const
|
|
225
|
-
return
|
|
225
|
+
const n = I(e, t?.in), o = n.getMonth();
|
|
226
|
+
return n.setFullYear(n.getFullYear(), o + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
226
227
|
}
|
|
227
228
|
function dn(e, t) {
|
|
228
|
-
const [
|
|
229
|
-
return { start:
|
|
229
|
+
const [n, o] = le(e, t.start, t.end);
|
|
230
|
+
return { start: n, end: o };
|
|
230
231
|
}
|
|
231
232
|
function un(e, t) {
|
|
232
|
-
const { start:
|
|
233
|
-
let s = +
|
|
234
|
-
const r = s ? +
|
|
233
|
+
const { start: n, end: o } = dn(t?.in, e);
|
|
234
|
+
let s = +n > +o;
|
|
235
|
+
const r = s ? +n : +o, i = s ? o : n;
|
|
235
236
|
i.setHours(0, 0, 0, 0), i.setDate(1);
|
|
236
237
|
let a = 1;
|
|
237
238
|
const c = [];
|
|
238
239
|
for (; +i <= r; )
|
|
239
|
-
c.push(L(
|
|
240
|
+
c.push(L(n, i)), i.setMonth(i.getMonth() + a);
|
|
240
241
|
return s ? c.reverse() : c;
|
|
241
242
|
}
|
|
242
243
|
function hn(e, t) {
|
|
243
|
-
const
|
|
244
|
-
return
|
|
244
|
+
const n = I(e, t?.in);
|
|
245
|
+
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
245
246
|
}
|
|
246
247
|
function mn(e, t) {
|
|
247
|
-
const
|
|
248
|
-
return
|
|
248
|
+
const n = I(e, t?.in), o = n.getFullYear();
|
|
249
|
+
return n.setFullYear(o + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
|
|
249
250
|
}
|
|
250
251
|
function Je(e, t) {
|
|
251
|
-
const
|
|
252
|
+
const n = qt(), o = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = I(e, t?.in), r = s.getDay(), i = (r < o ? -7 : 0) + 6 - (r - o);
|
|
252
253
|
return s.setDate(s.getDate() + i), s.setHours(23, 59, 59, 999), s;
|
|
253
254
|
}
|
|
254
255
|
function yn(e, t) {
|
|
255
256
|
return Je(e, { ...t, weekStartsOn: 1 });
|
|
256
257
|
}
|
|
257
258
|
function pn(e, t) {
|
|
258
|
-
const
|
|
259
|
-
return r.setFullYear(
|
|
259
|
+
const n = I(e, t?.in), o = n.getFullYear(), s = n.getMonth(), r = L(n, 0);
|
|
260
|
+
return r.setFullYear(o, s + 1, 0), r.setHours(0, 0, 0, 0), r.getDate();
|
|
260
261
|
}
|
|
261
|
-
function
|
|
262
|
+
function Mn(e, t) {
|
|
262
263
|
return I(e, t?.in).getMonth();
|
|
263
264
|
}
|
|
264
|
-
function
|
|
265
|
+
function Dn(e, t) {
|
|
265
266
|
return I(e, t?.in).getFullYear();
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
+
function kn(e, t) {
|
|
268
269
|
return +I(e) > +I(t);
|
|
269
270
|
}
|
|
270
271
|
function bn(e, t) {
|
|
271
272
|
return +I(e) < +I(t);
|
|
272
273
|
}
|
|
273
|
-
function wn(e, t,
|
|
274
|
-
const [
|
|
275
|
-
|
|
274
|
+
function wn(e, t, n) {
|
|
275
|
+
const [o, s] = le(
|
|
276
|
+
n?.in,
|
|
276
277
|
e,
|
|
277
278
|
t
|
|
278
279
|
);
|
|
279
|
-
return
|
|
280
|
+
return o.getFullYear() === s.getFullYear() && o.getMonth() === s.getMonth();
|
|
280
281
|
}
|
|
281
|
-
function vn(e, t,
|
|
282
|
-
const [
|
|
283
|
-
|
|
282
|
+
function vn(e, t, n) {
|
|
283
|
+
const [o, s] = le(
|
|
284
|
+
n?.in,
|
|
284
285
|
e,
|
|
285
286
|
t
|
|
286
287
|
);
|
|
287
|
-
return
|
|
288
|
+
return o.getFullYear() === s.getFullYear();
|
|
288
289
|
}
|
|
289
|
-
function
|
|
290
|
-
const
|
|
290
|
+
function gn(e, t, n) {
|
|
291
|
+
const o = I(e, n?.in), s = o.getFullYear(), r = o.getDate(), i = L(e, 0);
|
|
291
292
|
i.setFullYear(s, t, 15), i.setHours(0, 0, 0, 0);
|
|
292
293
|
const a = pn(i);
|
|
293
|
-
return
|
|
294
|
+
return o.setMonth(t, Math.min(r, a)), o;
|
|
294
295
|
}
|
|
295
|
-
function
|
|
296
|
-
const
|
|
297
|
-
return isNaN(+
|
|
296
|
+
function On(e, t, n) {
|
|
297
|
+
const o = I(e, n?.in);
|
|
298
|
+
return isNaN(+o) ? L(e, NaN) : (o.setFullYear(t), o);
|
|
298
299
|
}
|
|
299
300
|
const je = 5, _n = 4;
|
|
300
301
|
function Cn(e, t) {
|
|
301
|
-
const
|
|
302
|
+
const n = t.startOfMonth(e), o = n.getDay() > 0 ? n.getDay() : 7, s = t.addDays(e, -o + 1), r = t.addDays(s, je * 7 - 1);
|
|
302
303
|
return t.getMonth(e) === t.getMonth(r) ? je : _n;
|
|
303
304
|
}
|
|
304
305
|
function Qe(e, t) {
|
|
305
|
-
const
|
|
306
|
-
return
|
|
306
|
+
const n = t.startOfMonth(e), o = n.getDay();
|
|
307
|
+
return o === 1 ? n : o === 0 ? t.addDays(n, -6) : t.addDays(n, -1 * (o - 1));
|
|
307
308
|
}
|
|
308
309
|
function Wn(e, t) {
|
|
309
|
-
const
|
|
310
|
-
return t.addDays(
|
|
310
|
+
const n = Qe(e, t), o = Cn(e, t);
|
|
311
|
+
return t.addDays(n, o * 7 - 1);
|
|
311
312
|
}
|
|
312
313
|
class ee {
|
|
313
314
|
/**
|
|
@@ -316,11 +317,11 @@ class ee {
|
|
|
316
317
|
* @param options Configuration options for the date library.
|
|
317
318
|
* @param overrides Custom overrides for the date library functions.
|
|
318
319
|
*/
|
|
319
|
-
constructor(t,
|
|
320
|
-
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? F.tz(this.options.timeZone) : new this.Date(), this.newDate = (
|
|
321
|
-
const i = this.overrides?.format ? this.overrides.format(
|
|
320
|
+
constructor(t, n) {
|
|
321
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? F.tz(this.options.timeZone) : new this.Date(), this.newDate = (o, s, r) => this.overrides?.newDate ? this.overrides.newDate(o, s, r) : this.options.timeZone ? new F(o, s, r, this.options.timeZone) : new Date(o, s, r), this.addDays = (o, s) => this.overrides?.addDays ? this.overrides.addDays(o, s) : Ge(o, s), this.addMonths = (o, s) => this.overrides?.addMonths ? this.overrides.addMonths(o, s) : Ve(o, s), this.addWeeks = (o, s) => this.overrides?.addWeeks ? this.overrides.addWeeks(o, s) : on(o, s), this.addYears = (o, s) => this.overrides?.addYears ? this.overrides.addYears(o, s) : sn(o, s), this.differenceInCalendarDays = (o, s) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(o, s) : Rt(o, s), this.differenceInCalendarMonths = (o, s) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(o, s) : ln(o, s), this.eachMonthOfInterval = (o) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(o) : un(o), this.endOfBroadcastWeek = (o) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(o) : Wn(o, this), this.endOfISOWeek = (o) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(o) : yn(o), this.endOfMonth = (o) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(o) : fn(o), this.endOfWeek = (o, s) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(o, s) : Je(o, this.options), this.endOfYear = (o) => this.overrides?.endOfYear ? this.overrides.endOfYear(o) : mn(o), this.format = (o, s, r) => {
|
|
322
|
+
const i = this.overrides?.format ? this.overrides.format(o, s, this.options) : Ut(o, s, this.options);
|
|
322
323
|
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
323
|
-
}, this.getISOWeek = (
|
|
324
|
+
}, this.getISOWeek = (o) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(o) : Gt(o), this.getMonth = (o, s) => this.overrides?.getMonth ? this.overrides.getMonth(o, this.options) : Mn(o, this.options), this.getYear = (o, s) => this.overrides?.getYear ? this.overrides.getYear(o, this.options) : Dn(o, this.options), this.getWeek = (o, s) => this.overrides?.getWeek ? this.overrides.getWeek(o, this.options) : Kt(o, this.options), this.isAfter = (o, s) => this.overrides?.isAfter ? this.overrides.isAfter(o, s) : kn(o, s), this.isBefore = (o, s) => this.overrides?.isBefore ? this.overrides.isBefore(o, s) : bn(o, s), this.isDate = (o) => this.overrides?.isDate ? this.overrides.isDate(o) : Lt(o), this.isSameDay = (o, s) => this.overrides?.isSameDay ? this.overrides.isSameDay(o, s) : cn(o, s), this.isSameMonth = (o, s) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(o, s) : wn(o, s), this.isSameYear = (o, s) => this.overrides?.isSameYear ? this.overrides.isSameYear(o, s) : vn(o, s), this.max = (o) => this.overrides?.max ? this.overrides.max(o) : rn(o), this.min = (o) => this.overrides?.min ? this.overrides.min(o) : an(o), this.setMonth = (o, s) => this.overrides?.setMonth ? this.overrides.setMonth(o, s) : gn(o, s), this.setYear = (o, s) => this.overrides?.setYear ? this.overrides.setYear(o, s) : On(o, s), this.startOfBroadcastWeek = (o, s) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(o, this) : Qe(o, this), this.startOfDay = (o) => this.overrides?.startOfDay ? this.overrides.startOfDay(o) : Ee(o), this.startOfISOWeek = (o) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(o) : Vt(o), this.startOfMonth = (o) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(o) : hn(o), this.startOfWeek = (o, s) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(o, this.options) : Jt(o, this.options), this.startOfYear = (o) => this.overrides?.startOfYear ? this.overrides.startOfYear(o) : Qt(o), this.options = { locale: Ke, ...t }, this.overrides = n;
|
|
324
325
|
}
|
|
325
326
|
/**
|
|
326
327
|
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
@@ -330,12 +331,12 @@ class ee {
|
|
|
330
331
|
* @returns A record mapping Arabic digits to the target numerals.
|
|
331
332
|
*/
|
|
332
333
|
getDigitMap() {
|
|
333
|
-
const { numerals: t = "latn" } = this.options,
|
|
334
|
+
const { numerals: t = "latn" } = this.options, n = new Intl.NumberFormat("en-US", {
|
|
334
335
|
numberingSystem: t
|
|
335
|
-
}),
|
|
336
|
+
}), o = {};
|
|
336
337
|
for (let s = 0; s < 10; s++)
|
|
337
|
-
|
|
338
|
-
return
|
|
338
|
+
o[s.toString()] = n.format(s);
|
|
339
|
+
return o;
|
|
339
340
|
}
|
|
340
341
|
/**
|
|
341
342
|
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
@@ -345,8 +346,8 @@ class ee {
|
|
|
345
346
|
* @returns The string with digits replaced.
|
|
346
347
|
*/
|
|
347
348
|
replaceDigits(t) {
|
|
348
|
-
const
|
|
349
|
-
return t.replace(/\d/g, (
|
|
349
|
+
const n = this.getDigitMap();
|
|
350
|
+
return t.replace(/\d/g, (o) => n[o] || o);
|
|
350
351
|
}
|
|
351
352
|
/**
|
|
352
353
|
* Formats a number using the configured numbering system.
|
|
@@ -361,8 +362,8 @@ class ee {
|
|
|
361
362
|
}
|
|
362
363
|
const V = new ee();
|
|
363
364
|
class Xe {
|
|
364
|
-
constructor(t,
|
|
365
|
-
this.date = t, this.displayMonth =
|
|
365
|
+
constructor(t, n, o = V) {
|
|
366
|
+
this.date = t, this.displayMonth = n, this.outside = !!(n && !o.isSameMonth(t, n)), this.dateLib = o;
|
|
366
367
|
}
|
|
367
368
|
/**
|
|
368
369
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -376,19 +377,19 @@ class Xe {
|
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
379
|
class Nn {
|
|
379
|
-
constructor(t,
|
|
380
|
-
this.date = t, this.weeks =
|
|
380
|
+
constructor(t, n) {
|
|
381
|
+
this.date = t, this.weeks = n;
|
|
381
382
|
}
|
|
382
383
|
}
|
|
383
384
|
class Sn {
|
|
384
|
-
constructor(t,
|
|
385
|
-
this.days =
|
|
385
|
+
constructor(t, n) {
|
|
386
|
+
this.days = n, this.weekNumber = t;
|
|
386
387
|
}
|
|
387
388
|
}
|
|
388
|
-
function Q(e, t,
|
|
389
|
+
function Q(e, t, n = !1, o = V) {
|
|
389
390
|
let { from: s, to: r } = e;
|
|
390
|
-
const { differenceInCalendarDays: i, isSameDay: a } =
|
|
391
|
-
return s && r ? (i(r, s) < 0 && ([s, r] = [r, s]), i(t, s) >= (
|
|
391
|
+
const { differenceInCalendarDays: i, isSameDay: a } = o;
|
|
392
|
+
return s && r ? (i(r, s) < 0 && ([s, r] = [r, s]), i(t, s) >= (n ? 1 : 0) && i(r, t) >= (n ? 1 : 0)) : !n && r ? a(r, t) : !n && s ? a(s, t) : !1;
|
|
392
393
|
}
|
|
393
394
|
function et(e) {
|
|
394
395
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
@@ -408,28 +409,28 @@ function ot(e) {
|
|
|
408
409
|
function st(e, t) {
|
|
409
410
|
return Array.isArray(e) && e.every(t.isDate);
|
|
410
411
|
}
|
|
411
|
-
function X(e, t,
|
|
412
|
-
const
|
|
413
|
-
return
|
|
412
|
+
function X(e, t, n = V) {
|
|
413
|
+
const o = Array.isArray(t) ? t : [t], { isSameDay: s, differenceInCalendarDays: r, isAfter: i } = n;
|
|
414
|
+
return o.some((a) => {
|
|
414
415
|
if (typeof a == "boolean")
|
|
415
416
|
return a;
|
|
416
|
-
if (
|
|
417
|
+
if (n.isDate(a))
|
|
417
418
|
return s(e, a);
|
|
418
|
-
if (st(a,
|
|
419
|
+
if (st(a, n))
|
|
419
420
|
return a.includes(e);
|
|
420
421
|
if (Ye(a))
|
|
421
|
-
return Q(a, e, !1,
|
|
422
|
+
return Q(a, e, !1, n);
|
|
422
423
|
if (ot(a))
|
|
423
424
|
return Array.isArray(a.dayOfWeek) ? a.dayOfWeek.includes(e.getDay()) : a.dayOfWeek === e.getDay();
|
|
424
425
|
if (et(a)) {
|
|
425
|
-
const c = r(a.before, e), l = r(a.after, e),
|
|
426
|
-
return i(a.before, a.after) ? f &&
|
|
426
|
+
const c = r(a.before, e), l = r(a.after, e), h = c > 0, f = l < 0;
|
|
427
|
+
return i(a.before, a.after) ? f && h : h || f;
|
|
427
428
|
}
|
|
428
429
|
return tt(a) ? r(e, a.after) > 0 : nt(a) ? r(a.before, e) > 0 : typeof a == "function" ? a(e) : !1;
|
|
429
430
|
});
|
|
430
431
|
}
|
|
431
|
-
function En(e, t,
|
|
432
|
-
const { disabled: r, hidden: i, modifiers: a, showOutsideDays: c, broadcastCalendar: l, today:
|
|
432
|
+
function En(e, t, n, o, s) {
|
|
433
|
+
const { disabled: r, hidden: i, modifiers: a, showOutsideDays: c, broadcastCalendar: l, today: h } = t, { isSameDay: f, isSameMonth: u, startOfMonth: p, isBefore: w, endOfMonth: O, isAfter: k } = s, g = n && p(n), W = o && O(o), M = {
|
|
433
434
|
[T.focused]: [],
|
|
434
435
|
[T.outside]: [],
|
|
435
436
|
[T.disabled]: [],
|
|
@@ -437,9 +438,9 @@ function En(e, t, o, n, s) {
|
|
|
437
438
|
[T.today]: []
|
|
438
439
|
}, S = {};
|
|
439
440
|
for (const y of e) {
|
|
440
|
-
const { date: b, displayMonth:
|
|
441
|
-
!l && !c && _ || l && c === !1 && _, oe = f(b,
|
|
442
|
-
_ &&
|
|
441
|
+
const { date: b, displayMonth: D } = y, _ = !!(D && !u(b, D)), Y = !!(g && w(b, g)), $ = !!(W && k(b, W)), P = !!(r && X(b, r, s)), Z = !!(i && X(b, i, s)) || Y || $ || // Broadcast calendar will show outside days as default
|
|
442
|
+
!l && !c && _ || l && c === !1 && _, oe = f(b, h ?? s.today());
|
|
443
|
+
_ && M.outside.push(y), P && M.disabled.push(y), Z && M.hidden.push(y), oe && M.today.push(y), a && Object.keys(a).forEach((se) => {
|
|
443
444
|
const re = a?.[se];
|
|
444
445
|
re && X(b, re, s) && (S[se] ? S[se].push(y) : S[se] = [y]);
|
|
445
446
|
});
|
|
@@ -451,22 +452,22 @@ function En(e, t, o, n, s) {
|
|
|
451
452
|
[T.hidden]: !1,
|
|
452
453
|
[T.outside]: !1,
|
|
453
454
|
[T.today]: !1
|
|
454
|
-
},
|
|
455
|
-
for (const _ in
|
|
456
|
-
const Y =
|
|
455
|
+
}, D = {};
|
|
456
|
+
for (const _ in M) {
|
|
457
|
+
const Y = M[_];
|
|
457
458
|
b[_] = Y.some(($) => $ === y);
|
|
458
459
|
}
|
|
459
460
|
for (const _ in S)
|
|
460
|
-
|
|
461
|
+
D[_] = S[_].some((Y) => Y === y);
|
|
461
462
|
return {
|
|
462
463
|
...b,
|
|
463
464
|
// custom modifiers should override all the previous ones
|
|
464
|
-
...
|
|
465
|
+
...D
|
|
465
466
|
};
|
|
466
467
|
};
|
|
467
468
|
}
|
|
468
|
-
function Tn(e, t,
|
|
469
|
-
return Object.entries(e).filter(([, s]) => s === !0).reduce((s, [r]) => (
|
|
469
|
+
function Tn(e, t, n = {}) {
|
|
470
|
+
return Object.entries(e).filter(([, s]) => s === !0).reduce((s, [r]) => (n[r] ? s.push(n[r]) : t[T[r]] ? s.push(t[T[r]]) : t[R[r]] && s.push(t[R[r]]), s), [t[m.Day]]);
|
|
470
471
|
}
|
|
471
472
|
function Yn(e) {
|
|
472
473
|
return d.createElement("button", { ...e });
|
|
@@ -475,37 +476,37 @@ function Bn(e) {
|
|
|
475
476
|
return d.createElement("span", { ...e });
|
|
476
477
|
}
|
|
477
478
|
function xn(e) {
|
|
478
|
-
const { size: t = 24, orientation:
|
|
479
|
+
const { size: t = 24, orientation: n = "left", className: o } = e;
|
|
479
480
|
return d.createElement(
|
|
480
481
|
"svg",
|
|
481
|
-
{ className:
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
482
|
+
{ className: o, width: t, height: t, viewBox: "0 0 24 24" },
|
|
483
|
+
n === "up" && d.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
484
|
+
n === "down" && d.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
485
|
+
n === "left" && d.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
486
|
+
n === "right" && d.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
486
487
|
);
|
|
487
488
|
}
|
|
488
489
|
function Fn(e) {
|
|
489
|
-
const { day: t, modifiers:
|
|
490
|
-
return d.createElement("td", { ...
|
|
490
|
+
const { day: t, modifiers: n, ...o } = e;
|
|
491
|
+
return d.createElement("td", { ...o });
|
|
491
492
|
}
|
|
492
493
|
function In(e) {
|
|
493
|
-
const { day: t, modifiers:
|
|
494
|
+
const { day: t, modifiers: n, ...o } = e, s = d.useRef(null);
|
|
494
495
|
return d.useEffect(() => {
|
|
495
|
-
|
|
496
|
-
}, [
|
|
496
|
+
n.focused && s.current?.focus();
|
|
497
|
+
}, [n.focused]), d.createElement("button", { ref: s, ...o });
|
|
497
498
|
}
|
|
498
499
|
function $n(e) {
|
|
499
|
-
const { options: t, className:
|
|
500
|
+
const { options: t, className: n, components: o, classNames: s, ...r } = e, i = [s[m.Dropdown], n].join(" "), a = t?.find(({ value: c }) => c === r.value);
|
|
500
501
|
return d.createElement(
|
|
501
502
|
"span",
|
|
502
503
|
{ "data-disabled": r.disabled, className: s[m.DropdownRoot] },
|
|
503
|
-
d.createElement(
|
|
504
|
+
d.createElement(o.Select, { className: i, ...r }, t?.map(({ value: c, label: l, disabled: h }) => d.createElement(o.Option, { key: c, value: c, disabled: h }, l))),
|
|
504
505
|
d.createElement(
|
|
505
506
|
"span",
|
|
506
507
|
{ className: s[m.CaptionLabel], "aria-hidden": !0 },
|
|
507
508
|
a?.label,
|
|
508
|
-
d.createElement(
|
|
509
|
+
d.createElement(o.Chevron, { orientation: "down", size: 18, className: s[m.Chevron] })
|
|
509
510
|
)
|
|
510
511
|
);
|
|
511
512
|
}
|
|
@@ -516,12 +517,12 @@ function An(e) {
|
|
|
516
517
|
return d.createElement("div", { ...e });
|
|
517
518
|
}
|
|
518
519
|
function Hn(e) {
|
|
519
|
-
const { calendarMonth: t, displayIndex:
|
|
520
|
-
return d.createElement("div", { ...
|
|
520
|
+
const { calendarMonth: t, displayIndex: n, ...o } = e;
|
|
521
|
+
return d.createElement("div", { ...o }, e.children);
|
|
521
522
|
}
|
|
522
523
|
function Zn(e) {
|
|
523
|
-
const { calendarMonth: t, displayIndex:
|
|
524
|
-
return d.createElement("div", { ...
|
|
524
|
+
const { calendarMonth: t, displayIndex: n, ...o } = e;
|
|
525
|
+
return d.createElement("div", { ...o });
|
|
525
526
|
}
|
|
526
527
|
function jn(e) {
|
|
527
528
|
return d.createElement("table", { ...e });
|
|
@@ -530,58 +531,58 @@ function zn(e) {
|
|
|
530
531
|
return d.createElement("div", { ...e });
|
|
531
532
|
}
|
|
532
533
|
const rt = At(void 0);
|
|
533
|
-
function
|
|
534
|
+
function fe() {
|
|
534
535
|
const e = Ht(rt);
|
|
535
536
|
if (e === void 0)
|
|
536
537
|
throw new Error("useDayPicker() must be used within a custom component.");
|
|
537
538
|
return e;
|
|
538
539
|
}
|
|
539
540
|
function qn(e) {
|
|
540
|
-
const { components: t } =
|
|
541
|
+
const { components: t } = fe();
|
|
541
542
|
return d.createElement(t.Dropdown, { ...e });
|
|
542
543
|
}
|
|
543
544
|
function Rn(e) {
|
|
544
|
-
const { onPreviousClick: t, onNextClick:
|
|
545
|
-
s &&
|
|
546
|
-
}, [s,
|
|
547
|
-
|
|
548
|
-
}, [
|
|
545
|
+
const { onPreviousClick: t, onNextClick: n, previousMonth: o, nextMonth: s, ...r } = e, { components: i, classNames: a, labels: { labelPrevious: c, labelNext: l } } = fe(), h = H((u) => {
|
|
546
|
+
s && n?.(u);
|
|
547
|
+
}, [s, n]), f = H((u) => {
|
|
548
|
+
o && t?.(u);
|
|
549
|
+
}, [o, t]);
|
|
549
550
|
return d.createElement(
|
|
550
551
|
"nav",
|
|
551
552
|
{ ...r },
|
|
552
553
|
d.createElement(
|
|
553
554
|
i.PreviousMonthButton,
|
|
554
|
-
{ type: "button", className: a[m.PreviousMonthButton], tabIndex:
|
|
555
|
-
d.createElement(i.Chevron, { disabled:
|
|
555
|
+
{ type: "button", className: a[m.PreviousMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": c(o), onClick: f },
|
|
556
|
+
d.createElement(i.Chevron, { disabled: o ? void 0 : !0, className: a[m.Chevron], orientation: "left" })
|
|
556
557
|
),
|
|
557
558
|
d.createElement(
|
|
558
559
|
i.NextMonthButton,
|
|
559
|
-
{ type: "button", className: a[m.NextMonthButton], tabIndex: s ? void 0 : -1, "aria-disabled": s ? void 0 : !0, "aria-label": l(s), onClick:
|
|
560
|
+
{ type: "button", className: a[m.NextMonthButton], tabIndex: s ? void 0 : -1, "aria-disabled": s ? void 0 : !0, "aria-label": l(s), onClick: h },
|
|
560
561
|
d.createElement(i.Chevron, { disabled: s ? void 0 : !0, orientation: "right", className: a[m.Chevron] })
|
|
561
562
|
)
|
|
562
563
|
);
|
|
563
564
|
}
|
|
564
565
|
function Un(e) {
|
|
565
|
-
const { components: t } =
|
|
566
|
+
const { components: t } = fe();
|
|
566
567
|
return d.createElement(t.Button, { ...e });
|
|
567
568
|
}
|
|
568
569
|
function Gn(e) {
|
|
569
570
|
return d.createElement("option", { ...e });
|
|
570
571
|
}
|
|
571
572
|
function Kn(e) {
|
|
572
|
-
const { components: t } =
|
|
573
|
+
const { components: t } = fe();
|
|
573
574
|
return d.createElement(t.Button, { ...e });
|
|
574
575
|
}
|
|
575
576
|
function Ln(e) {
|
|
576
|
-
const { rootRef: t, ...
|
|
577
|
-
return d.createElement("div", { ...
|
|
577
|
+
const { rootRef: t, ...n } = e;
|
|
578
|
+
return d.createElement("div", { ...n, ref: t });
|
|
578
579
|
}
|
|
579
580
|
function Vn(e) {
|
|
580
581
|
return d.createElement("select", { ...e });
|
|
581
582
|
}
|
|
582
583
|
function Jn(e) {
|
|
583
|
-
const { week: t, ...
|
|
584
|
-
return d.createElement("tr", { ...
|
|
584
|
+
const { week: t, ...n } = e;
|
|
585
|
+
return d.createElement("tr", { ...n });
|
|
585
586
|
}
|
|
586
587
|
function Qn(e) {
|
|
587
588
|
return d.createElement("th", { ...e });
|
|
@@ -594,8 +595,8 @@ function Xn(e) {
|
|
|
594
595
|
);
|
|
595
596
|
}
|
|
596
597
|
function eo(e) {
|
|
597
|
-
const { week: t, ...
|
|
598
|
-
return d.createElement("th", { ...
|
|
598
|
+
const { week: t, ...n } = e;
|
|
599
|
+
return d.createElement("th", { ...n });
|
|
599
600
|
}
|
|
600
601
|
function to(e) {
|
|
601
602
|
return d.createElement("th", { ...e });
|
|
@@ -604,7 +605,7 @@ function no(e) {
|
|
|
604
605
|
return d.createElement("tbody", { ...e });
|
|
605
606
|
}
|
|
606
607
|
function oo(e) {
|
|
607
|
-
const { components: t } =
|
|
608
|
+
const { components: t } = fe();
|
|
608
609
|
return d.createElement(t.Dropdown, { ...e });
|
|
609
610
|
}
|
|
610
611
|
const so = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -651,8 +652,8 @@ function ao(e) {
|
|
|
651
652
|
"data-broadcast-calendar": e.broadcastCalendar || void 0,
|
|
652
653
|
"data-nav-layout": e.navLayout || void 0
|
|
653
654
|
};
|
|
654
|
-
return Object.entries(e).forEach(([
|
|
655
|
-
|
|
655
|
+
return Object.entries(e).forEach(([n, o]) => {
|
|
656
|
+
n.startsWith("data-") && (t[n] = o);
|
|
656
657
|
}), t;
|
|
657
658
|
}
|
|
658
659
|
function at() {
|
|
@@ -667,12 +668,12 @@ function at() {
|
|
|
667
668
|
e[A[t]] = `rdp-${A[t]}`;
|
|
668
669
|
return e;
|
|
669
670
|
}
|
|
670
|
-
function it(e, t,
|
|
671
|
-
return (
|
|
671
|
+
function it(e, t, n) {
|
|
672
|
+
return (n ?? new ee(t)).format(e, "LLLL y");
|
|
672
673
|
}
|
|
673
674
|
const io = it;
|
|
674
|
-
function co(e, t,
|
|
675
|
-
return (
|
|
675
|
+
function co(e, t, n) {
|
|
676
|
+
return (n ?? new ee(t)).format(e, "d");
|
|
676
677
|
}
|
|
677
678
|
function lo(e, t = V) {
|
|
678
679
|
return t.format(e, "LLLL");
|
|
@@ -683,8 +684,8 @@ function fo(e, t = V) {
|
|
|
683
684
|
function uo() {
|
|
684
685
|
return "";
|
|
685
686
|
}
|
|
686
|
-
function ho(e, t,
|
|
687
|
-
return (
|
|
687
|
+
function ho(e, t, n) {
|
|
688
|
+
return (n ?? new ee(t)).format(e, "cccccc");
|
|
688
689
|
}
|
|
689
690
|
function ct(e, t = V) {
|
|
690
691
|
return t.format(e, "yyyy");
|
|
@@ -707,63 +708,63 @@ function po(e) {
|
|
|
707
708
|
...e
|
|
708
709
|
};
|
|
709
710
|
}
|
|
710
|
-
function
|
|
711
|
+
function Mo(e, t, n, o, s) {
|
|
711
712
|
const { startOfMonth: r, startOfYear: i, endOfYear: a, eachMonthOfInterval: c, getMonth: l } = s;
|
|
712
713
|
return c({
|
|
713
714
|
start: i(e),
|
|
714
715
|
end: a(e)
|
|
715
|
-
}).map((
|
|
716
|
-
const p =
|
|
717
|
-
return { value: w, label: p, disabled:
|
|
716
|
+
}).map((u) => {
|
|
717
|
+
const p = o.formatMonthDropdown(u, s), w = l(u), O = t && u < r(t) || n && u > r(n) || !1;
|
|
718
|
+
return { value: w, label: p, disabled: O };
|
|
718
719
|
});
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
-
let
|
|
721
|
+
function Do(e, t = {}, n = {}) {
|
|
722
|
+
let o = { ...t?.[m.Day] };
|
|
722
723
|
return Object.entries(e).filter(([, s]) => s === !0).forEach(([s]) => {
|
|
723
|
-
|
|
724
|
-
...
|
|
725
|
-
...
|
|
724
|
+
o = {
|
|
725
|
+
...o,
|
|
726
|
+
...n?.[s]
|
|
726
727
|
};
|
|
727
|
-
}),
|
|
728
|
+
}), o;
|
|
728
729
|
}
|
|
729
|
-
function
|
|
730
|
-
const
|
|
730
|
+
function ko(e, t, n) {
|
|
731
|
+
const o = e.today(), s = t ? e.startOfISOWeek(o) : e.startOfWeek(o), r = [];
|
|
731
732
|
for (let i = 0; i < 7; i++) {
|
|
732
733
|
const a = e.addDays(s, i);
|
|
733
734
|
r.push(a);
|
|
734
735
|
}
|
|
735
736
|
return r;
|
|
736
737
|
}
|
|
737
|
-
function bo(e, t,
|
|
738
|
+
function bo(e, t, n, o) {
|
|
738
739
|
if (!e || !t)
|
|
739
740
|
return;
|
|
740
|
-
const { startOfYear: s, endOfYear: r, addYears: i, getYear: a, isBefore: c, isSameYear: l } =
|
|
741
|
-
let p =
|
|
741
|
+
const { startOfYear: s, endOfYear: r, addYears: i, getYear: a, isBefore: c, isSameYear: l } = o, h = s(e), f = r(t), u = [];
|
|
742
|
+
let p = h;
|
|
742
743
|
for (; c(p, f) || l(p, f); )
|
|
743
|
-
|
|
744
|
-
return
|
|
745
|
-
const
|
|
744
|
+
u.push(p), p = i(p, 1);
|
|
745
|
+
return u.map((w) => {
|
|
746
|
+
const O = n.formatYearDropdown(w, o);
|
|
746
747
|
return {
|
|
747
748
|
value: a(w),
|
|
748
|
-
label:
|
|
749
|
+
label: O,
|
|
749
750
|
disabled: !1
|
|
750
751
|
};
|
|
751
752
|
});
|
|
752
753
|
}
|
|
753
|
-
function lt(e, t,
|
|
754
|
-
return (
|
|
754
|
+
function lt(e, t, n) {
|
|
755
|
+
return (n ?? new ee(t)).format(e, "LLLL y");
|
|
755
756
|
}
|
|
756
757
|
const wo = lt;
|
|
757
|
-
function vo(e, t,
|
|
758
|
-
let s = (
|
|
758
|
+
function vo(e, t, n, o) {
|
|
759
|
+
let s = (o ?? new ee(n)).format(e, "PPPP");
|
|
759
760
|
return t?.today && (s = `Today, ${s}`), s;
|
|
760
761
|
}
|
|
761
|
-
function ft(e, t,
|
|
762
|
-
let s = (
|
|
762
|
+
function ft(e, t, n, o) {
|
|
763
|
+
let s = (o ?? new ee(n)).format(e, "PPPP");
|
|
763
764
|
return t.today && (s = `Today, ${s}`), t.selected && (s = `${s}, selected`), s;
|
|
764
765
|
}
|
|
765
|
-
const
|
|
766
|
-
function
|
|
766
|
+
const go = ft;
|
|
767
|
+
function Oo() {
|
|
767
768
|
return "";
|
|
768
769
|
}
|
|
769
770
|
function _o(e) {
|
|
@@ -775,8 +776,8 @@ function Co(e) {
|
|
|
775
776
|
function Wo(e) {
|
|
776
777
|
return "Go to the Previous Month";
|
|
777
778
|
}
|
|
778
|
-
function No(e, t,
|
|
779
|
-
return (
|
|
779
|
+
function No(e, t, n) {
|
|
780
|
+
return (n ?? new ee(t)).format(e, "cccc");
|
|
780
781
|
}
|
|
781
782
|
function So(e, t) {
|
|
782
783
|
return `Week ${e}`;
|
|
@@ -790,78 +791,78 @@ function To(e) {
|
|
|
790
791
|
const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
791
792
|
__proto__: null,
|
|
792
793
|
labelCaption: wo,
|
|
793
|
-
labelDay:
|
|
794
|
+
labelDay: go,
|
|
794
795
|
labelDayButton: ft,
|
|
795
796
|
labelGrid: lt,
|
|
796
797
|
labelGridcell: vo,
|
|
797
798
|
labelMonthDropdown: _o,
|
|
798
|
-
labelNav:
|
|
799
|
+
labelNav: Oo,
|
|
799
800
|
labelNext: Co,
|
|
800
801
|
labelPrevious: Wo,
|
|
801
802
|
labelWeekNumber: So,
|
|
802
803
|
labelWeekNumberHeader: Eo,
|
|
803
804
|
labelWeekday: No,
|
|
804
805
|
labelYearDropdown: To
|
|
805
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
806
|
+
}, Symbol.toStringTag, { value: "Module" })), de = (e) => e instanceof HTMLElement ? e : null, We = (e) => [
|
|
806
807
|
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
807
|
-
], Bo = (e) =>
|
|
808
|
-
function Io(e, t, { classNames:
|
|
809
|
-
const i =
|
|
808
|
+
], Bo = (e) => de(e.querySelector("[data-animated-month]")), Ne = (e) => de(e.querySelector("[data-animated-caption]")), Se = (e) => de(e.querySelector("[data-animated-weeks]")), xo = (e) => de(e.querySelector("[data-animated-nav]")), Fo = (e) => de(e.querySelector("[data-animated-weekdays]"));
|
|
809
|
+
function Io(e, t, { classNames: n, months: o, focused: s, dateLib: r }) {
|
|
810
|
+
const i = ce(null), a = ce(o), c = ce(!1);
|
|
810
811
|
Zt(() => {
|
|
811
812
|
const l = a.current;
|
|
812
|
-
if (a.current =
|
|
813
|
+
if (a.current = o, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
813
814
|
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
814
|
-
|
|
815
|
+
o.length === 0 || l.length === 0 || o.length !== l.length)
|
|
815
816
|
return;
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
if (!(
|
|
817
|
+
const h = r.isSameMonth(o[0].date, l[0].date), f = r.isAfter(o[0].date, l[0].date), u = f ? n[A.caption_after_enter] : n[A.caption_before_enter], p = f ? n[A.weeks_after_enter] : n[A.weeks_before_enter], w = i.current, O = e.current.cloneNode(!0);
|
|
818
|
+
if (O instanceof HTMLElement ? (We(O).forEach((M) => {
|
|
819
|
+
if (!(M instanceof HTMLElement))
|
|
819
820
|
return;
|
|
820
|
-
const S = Bo(
|
|
821
|
-
S &&
|
|
822
|
-
const y = Ne(
|
|
823
|
-
y && y.classList.remove(
|
|
824
|
-
const b = Se(
|
|
821
|
+
const S = Bo(M);
|
|
822
|
+
S && M.contains(S) && M.removeChild(S);
|
|
823
|
+
const y = Ne(M);
|
|
824
|
+
y && y.classList.remove(u);
|
|
825
|
+
const b = Se(M);
|
|
825
826
|
b && b.classList.remove(p);
|
|
826
|
-
}), i.current =
|
|
827
|
+
}), i.current = O) : i.current = null, c.current || h || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
827
828
|
s)
|
|
828
829
|
return;
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
830
|
+
const k = w instanceof HTMLElement ? We(w) : [], g = We(e.current);
|
|
831
|
+
if (g && g.every((W) => W instanceof HTMLElement) && k && k.every((W) => W instanceof HTMLElement)) {
|
|
831
832
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
832
833
|
const W = xo(e.current);
|
|
833
|
-
W && (W.style.zIndex = "1"),
|
|
834
|
-
const y =
|
|
834
|
+
W && (W.style.zIndex = "1"), g.forEach((M, S) => {
|
|
835
|
+
const y = k[S];
|
|
835
836
|
if (!y)
|
|
836
837
|
return;
|
|
837
|
-
|
|
838
|
-
const b = Ne(
|
|
839
|
-
b && b.classList.add(
|
|
840
|
-
const
|
|
841
|
-
|
|
838
|
+
M.style.position = "relative", M.style.overflow = "hidden";
|
|
839
|
+
const b = Ne(M);
|
|
840
|
+
b && b.classList.add(u);
|
|
841
|
+
const D = Se(M);
|
|
842
|
+
D && D.classList.add(p);
|
|
842
843
|
const _ = () => {
|
|
843
|
-
c.current = !1, e.current && (e.current.style.isolation = ""), W && (W.style.zIndex = ""), b && b.classList.remove(
|
|
844
|
+
c.current = !1, e.current && (e.current.style.isolation = ""), W && (W.style.zIndex = ""), b && b.classList.remove(u), D && D.classList.remove(p), M.style.position = "", M.style.overflow = "", M.contains(y) && M.removeChild(y);
|
|
844
845
|
};
|
|
845
846
|
y.style.pointerEvents = "none", y.style.position = "absolute", y.style.overflow = "hidden", y.setAttribute("aria-hidden", "true");
|
|
846
847
|
const Y = Fo(y);
|
|
847
848
|
Y && (Y.style.opacity = "0");
|
|
848
849
|
const $ = Ne(y);
|
|
849
|
-
$ && ($.classList.add(f ?
|
|
850
|
+
$ && ($.classList.add(f ? n[A.caption_before_exit] : n[A.caption_after_exit]), $.addEventListener("animationend", _));
|
|
850
851
|
const P = Se(y);
|
|
851
|
-
P && P.classList.add(f ?
|
|
852
|
+
P && P.classList.add(f ? n[A.weeks_before_exit] : n[A.weeks_after_exit]), M.insertBefore(y, M.firstChild);
|
|
852
853
|
});
|
|
853
854
|
}
|
|
854
855
|
});
|
|
855
856
|
}
|
|
856
|
-
function $o(e, t,
|
|
857
|
-
const s = e[0], r = e[e.length - 1], { ISOWeek: i, fixedWeeks: a, broadcastCalendar: c } =
|
|
857
|
+
function $o(e, t, n, o) {
|
|
858
|
+
const s = e[0], r = e[e.length - 1], { ISOWeek: i, fixedWeeks: a, broadcastCalendar: c } = n ?? {}, { addDays: l, differenceInCalendarDays: h, differenceInCalendarMonths: f, endOfBroadcastWeek: u, endOfISOWeek: p, endOfMonth: w, endOfWeek: O, isAfter: k, startOfBroadcastWeek: g, startOfISOWeek: W, startOfWeek: M } = o, S = c ? g(s, o) : i ? W(s) : M(s), y = c ? u(r) : i ? p(w(r)) : O(w(r)), b = h(y, S), D = f(r, s) + 1, _ = [];
|
|
858
859
|
for (let P = 0; P <= b; P++) {
|
|
859
860
|
const Z = l(S, P);
|
|
860
|
-
if (t &&
|
|
861
|
+
if (t && k(Z, t))
|
|
861
862
|
break;
|
|
862
863
|
_.push(Z);
|
|
863
864
|
}
|
|
864
|
-
const $ = (c ? 35 : 42) *
|
|
865
|
+
const $ = (c ? 35 : 42) * D;
|
|
865
866
|
if (a && _.length < $) {
|
|
866
867
|
const P = $ - _.length;
|
|
867
868
|
for (let Z = 0; Z < P; Z++) {
|
|
@@ -873,112 +874,112 @@ function $o(e, t, o, n) {
|
|
|
873
874
|
}
|
|
874
875
|
function Po(e) {
|
|
875
876
|
const t = [];
|
|
876
|
-
return e.reduce((
|
|
877
|
-
const s =
|
|
878
|
-
return [...
|
|
877
|
+
return e.reduce((n, o) => {
|
|
878
|
+
const s = o.weeks.reduce((r, i) => [...r, ...i.days], t);
|
|
879
|
+
return [...n, ...s];
|
|
879
880
|
}, t);
|
|
880
881
|
}
|
|
881
|
-
function Ao(e, t,
|
|
882
|
-
const { numberOfMonths: s = 1 } =
|
|
882
|
+
function Ao(e, t, n, o) {
|
|
883
|
+
const { numberOfMonths: s = 1 } = n, r = [];
|
|
883
884
|
for (let i = 0; i < s; i++) {
|
|
884
|
-
const a =
|
|
885
|
+
const a = o.addMonths(e, i);
|
|
885
886
|
if (t && a > t)
|
|
886
887
|
break;
|
|
887
888
|
r.push(a);
|
|
888
889
|
}
|
|
889
890
|
return r;
|
|
890
891
|
}
|
|
891
|
-
function ze(e, t,
|
|
892
|
-
const { month: s, defaultMonth: r, today: i =
|
|
892
|
+
function ze(e, t, n, o) {
|
|
893
|
+
const { month: s, defaultMonth: r, today: i = o.today(), numberOfMonths: a = 1 } = e;
|
|
893
894
|
let c = s || r || i;
|
|
894
|
-
const { differenceInCalendarMonths: l, addMonths:
|
|
895
|
-
if (
|
|
896
|
-
const
|
|
897
|
-
c =
|
|
895
|
+
const { differenceInCalendarMonths: l, addMonths: h, startOfMonth: f } = o;
|
|
896
|
+
if (n && l(n, c) < a - 1) {
|
|
897
|
+
const u = -1 * (a - 1);
|
|
898
|
+
c = h(n, u);
|
|
898
899
|
}
|
|
899
900
|
return t && l(c, t) < 0 && (c = t), f(c);
|
|
900
901
|
}
|
|
901
|
-
function Ho(e, t,
|
|
902
|
-
const { addDays: s, endOfBroadcastWeek: r, endOfISOWeek: i, endOfMonth: a, endOfWeek: c, getISOWeek: l, getWeek:
|
|
903
|
-
const
|
|
904
|
-
if (
|
|
905
|
-
const
|
|
906
|
-
const Y = S -
|
|
902
|
+
function Ho(e, t, n, o) {
|
|
903
|
+
const { addDays: s, endOfBroadcastWeek: r, endOfISOWeek: i, endOfMonth: a, endOfWeek: c, getISOWeek: l, getWeek: h, startOfBroadcastWeek: f, startOfISOWeek: u, startOfWeek: p } = o, w = e.reduce((O, k) => {
|
|
904
|
+
const g = n.broadcastCalendar ? f(k, o) : n.ISOWeek ? u(k) : p(k), W = n.broadcastCalendar ? r(k) : n.ISOWeek ? i(a(k)) : c(a(k)), M = t.filter((D) => D >= g && D <= W), S = n.broadcastCalendar ? 35 : 42;
|
|
905
|
+
if (n.fixedWeeks && M.length < S) {
|
|
906
|
+
const D = t.filter((_) => {
|
|
907
|
+
const Y = S - M.length;
|
|
907
908
|
return _ > W && _ <= s(W, Y);
|
|
908
909
|
});
|
|
909
|
-
|
|
910
|
+
M.push(...D);
|
|
910
911
|
}
|
|
911
|
-
const y =
|
|
912
|
-
const Y =
|
|
913
|
-
return $ ? $.days.push(P) :
|
|
914
|
-
}, []), b = new Nn(
|
|
915
|
-
return
|
|
912
|
+
const y = M.reduce((D, _) => {
|
|
913
|
+
const Y = n.ISOWeek ? l(_) : h(_), $ = D.find((Z) => Z.weekNumber === Y), P = new Xe(_, k, o);
|
|
914
|
+
return $ ? $.days.push(P) : D.push(new Sn(Y, [P])), D;
|
|
915
|
+
}, []), b = new Nn(k, y);
|
|
916
|
+
return O.push(b), O;
|
|
916
917
|
}, []);
|
|
917
|
-
return
|
|
918
|
+
return n.reverseMonths ? w.reverse() : w;
|
|
918
919
|
}
|
|
919
920
|
function Zo(e, t) {
|
|
920
|
-
let { startMonth:
|
|
921
|
-
const { startOfYear: s, startOfDay: r, startOfMonth: i, endOfMonth: a, addYears: c, endOfYear: l, newDate:
|
|
922
|
-
!
|
|
923
|
-
const
|
|
924
|
-
return
|
|
925
|
-
|
|
926
|
-
|
|
921
|
+
let { startMonth: n, endMonth: o } = e;
|
|
922
|
+
const { startOfYear: s, startOfDay: r, startOfMonth: i, endOfMonth: a, addYears: c, endOfYear: l, newDate: h, today: f } = t, { fromYear: u, toYear: p, fromMonth: w, toMonth: O } = e;
|
|
923
|
+
!n && w && (n = w), !n && u && (n = t.newDate(u, 0, 1)), !o && O && (o = O), !o && p && (o = h(p, 11, 31));
|
|
924
|
+
const k = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
925
|
+
return n ? n = i(n) : u ? n = h(u, 0, 1) : !n && k && (n = s(c(e.today ?? f(), -100))), o ? o = a(o) : p ? o = h(p, 11, 31) : !o && k && (o = l(e.today ?? f())), [
|
|
926
|
+
n && r(n),
|
|
927
|
+
o && r(o)
|
|
927
928
|
];
|
|
928
929
|
}
|
|
929
|
-
function jo(e, t,
|
|
930
|
-
if (
|
|
930
|
+
function jo(e, t, n, o) {
|
|
931
|
+
if (n.disableNavigation)
|
|
931
932
|
return;
|
|
932
|
-
const { pagedNavigation: s, numberOfMonths: r = 1 } =
|
|
933
|
+
const { pagedNavigation: s, numberOfMonths: r = 1 } = n, { startOfMonth: i, addMonths: a, differenceInCalendarMonths: c } = o, l = s ? r : 1, h = i(e);
|
|
933
934
|
if (!t)
|
|
934
|
-
return a(
|
|
935
|
+
return a(h, l);
|
|
935
936
|
if (!(c(t, e) < r))
|
|
936
|
-
return a(
|
|
937
|
+
return a(h, l);
|
|
937
938
|
}
|
|
938
|
-
function zo(e, t,
|
|
939
|
-
if (
|
|
939
|
+
function zo(e, t, n, o) {
|
|
940
|
+
if (n.disableNavigation)
|
|
940
941
|
return;
|
|
941
|
-
const { pagedNavigation: s, numberOfMonths: r } =
|
|
942
|
+
const { pagedNavigation: s, numberOfMonths: r } = n, { startOfMonth: i, addMonths: a, differenceInCalendarMonths: c } = o, l = s ? r ?? 1 : 1, h = i(e);
|
|
942
943
|
if (!t)
|
|
943
|
-
return a(
|
|
944
|
-
if (!(c(
|
|
945
|
-
return a(
|
|
944
|
+
return a(h, -l);
|
|
945
|
+
if (!(c(h, t) <= 0))
|
|
946
|
+
return a(h, -l);
|
|
946
947
|
}
|
|
947
948
|
function qo(e) {
|
|
948
949
|
const t = [];
|
|
949
|
-
return e.reduce((
|
|
950
|
+
return e.reduce((n, o) => [...n, ...o.weeks], t);
|
|
950
951
|
}
|
|
951
|
-
function
|
|
952
|
-
const [
|
|
953
|
-
return [t === void 0 ?
|
|
952
|
+
function Me(e, t) {
|
|
953
|
+
const [n, o] = pe(e);
|
|
954
|
+
return [t === void 0 ? n : t, o];
|
|
954
955
|
}
|
|
955
956
|
function Ro(e, t) {
|
|
956
|
-
const [
|
|
957
|
+
const [n, o] = Zo(e, t), { startOfMonth: s, endOfMonth: r } = t, i = ze(e, n, o, t), [a, c] = Me(
|
|
957
958
|
i,
|
|
958
959
|
// initialMonth is always computed from props.month if provided
|
|
959
960
|
e.month ? i : void 0
|
|
960
961
|
);
|
|
961
962
|
Ue(() => {
|
|
962
|
-
const b = ze(e,
|
|
963
|
+
const b = ze(e, n, o, t);
|
|
963
964
|
c(b);
|
|
964
965
|
}, [e.timeZone]);
|
|
965
|
-
const l = Ao(a,
|
|
966
|
-
if (
|
|
966
|
+
const l = Ao(a, o, e, t), h = $o(l, e.endMonth ? r(e.endMonth) : void 0, e, t), f = Ho(l, h, e, t), u = qo(f), p = Po(f), w = zo(a, n, e, t), O = jo(a, o, e, t), { disableNavigation: k, onMonthChange: g } = e, W = (b) => u.some((D) => D.days.some((_) => _.isEqualTo(b))), M = (b) => {
|
|
967
|
+
if (k)
|
|
967
968
|
return;
|
|
968
|
-
let
|
|
969
|
-
|
|
969
|
+
let D = s(b);
|
|
970
|
+
n && D < s(n) && (D = s(n)), o && D > s(o) && (D = s(o)), c(D), g?.(D);
|
|
970
971
|
};
|
|
971
972
|
return {
|
|
972
973
|
months: f,
|
|
973
|
-
weeks:
|
|
974
|
+
weeks: u,
|
|
974
975
|
days: p,
|
|
975
|
-
navStart:
|
|
976
|
-
navEnd:
|
|
976
|
+
navStart: n,
|
|
977
|
+
navEnd: o,
|
|
977
978
|
previousMonth: w,
|
|
978
|
-
nextMonth:
|
|
979
|
-
goToMonth:
|
|
979
|
+
nextMonth: O,
|
|
980
|
+
goToMonth: M,
|
|
980
981
|
goToDay: (b) => {
|
|
981
|
-
W(b) ||
|
|
982
|
+
W(b) || M(b.date);
|
|
982
983
|
}
|
|
983
984
|
};
|
|
984
985
|
}
|
|
@@ -989,81 +990,81 @@ var G;
|
|
|
989
990
|
function qe(e) {
|
|
990
991
|
return !e[T.disabled] && !e[T.hidden] && !e[T.outside];
|
|
991
992
|
}
|
|
992
|
-
function Uo(e, t,
|
|
993
|
+
function Uo(e, t, n, o) {
|
|
993
994
|
let s, r = -1;
|
|
994
995
|
for (const i of e) {
|
|
995
996
|
const a = t(i);
|
|
996
|
-
qe(a) && (a[T.focused] && r < G.FocusedModifier ? (s = i, r = G.FocusedModifier) :
|
|
997
|
+
qe(a) && (a[T.focused] && r < G.FocusedModifier ? (s = i, r = G.FocusedModifier) : o?.isEqualTo(i) && r < G.LastFocused ? (s = i, r = G.LastFocused) : n(i.date) && r < G.Selected ? (s = i, r = G.Selected) : a[T.today] && r < G.Today && (s = i, r = G.Today));
|
|
997
998
|
}
|
|
998
999
|
return s || (s = e.find((i) => qe(t(i)))), s;
|
|
999
1000
|
}
|
|
1000
|
-
function Go(e, t,
|
|
1001
|
-
const { ISOWeek: a, broadcastCalendar: c } = r, { addDays: l, addMonths:
|
|
1001
|
+
function Go(e, t, n, o, s, r, i) {
|
|
1002
|
+
const { ISOWeek: a, broadcastCalendar: c } = r, { addDays: l, addMonths: h, addWeeks: f, addYears: u, endOfBroadcastWeek: p, endOfISOWeek: w, endOfWeek: O, max: k, min: g, startOfBroadcastWeek: W, startOfISOWeek: M, startOfWeek: S } = i;
|
|
1002
1003
|
let b = {
|
|
1003
1004
|
day: l,
|
|
1004
1005
|
week: f,
|
|
1005
|
-
month:
|
|
1006
|
-
year:
|
|
1007
|
-
startOfWeek: (
|
|
1008
|
-
endOfWeek: (
|
|
1009
|
-
}[e](
|
|
1010
|
-
return t === "before" &&
|
|
1011
|
-
}
|
|
1012
|
-
function dt(e, t,
|
|
1006
|
+
month: h,
|
|
1007
|
+
year: u,
|
|
1008
|
+
startOfWeek: (D) => c ? W(D, i) : a ? M(D) : S(D),
|
|
1009
|
+
endOfWeek: (D) => c ? p(D) : a ? w(D) : O(D)
|
|
1010
|
+
}[e](n, t === "after" ? 1 : -1);
|
|
1011
|
+
return t === "before" && o ? b = k([o, b]) : t === "after" && s && (b = g([s, b])), b;
|
|
1012
|
+
}
|
|
1013
|
+
function dt(e, t, n, o, s, r, i, a = 0) {
|
|
1013
1014
|
if (a > 365)
|
|
1014
1015
|
return;
|
|
1015
|
-
const c = Go(e, t,
|
|
1016
|
-
return !l && !
|
|
1016
|
+
const c = Go(e, t, n.date, o, s, r, i), l = !!(r.disabled && X(c, r.disabled, i)), h = !!(r.hidden && X(c, r.hidden, i)), f = c, u = new Xe(c, f, i);
|
|
1017
|
+
return !l && !h ? u : dt(e, t, u, o, s, r, i, a + 1);
|
|
1017
1018
|
}
|
|
1018
|
-
function Ko(e, t,
|
|
1019
|
-
const { autoFocus: r } = e, [i, a] = pe(), c = Uo(t.days,
|
|
1019
|
+
function Ko(e, t, n, o, s) {
|
|
1020
|
+
const { autoFocus: r } = e, [i, a] = pe(), c = Uo(t.days, n, o || (() => !1), i), [l, h] = pe(r ? c : void 0);
|
|
1020
1021
|
return {
|
|
1021
|
-
isFocusTarget: (
|
|
1022
|
-
setFocused:
|
|
1022
|
+
isFocusTarget: (O) => !!c?.isEqualTo(O),
|
|
1023
|
+
setFocused: h,
|
|
1023
1024
|
focused: l,
|
|
1024
1025
|
blur: () => {
|
|
1025
|
-
a(l),
|
|
1026
|
+
a(l), h(void 0);
|
|
1026
1027
|
},
|
|
1027
|
-
moveFocus: (
|
|
1028
|
+
moveFocus: (O, k) => {
|
|
1028
1029
|
if (!l)
|
|
1029
1030
|
return;
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1031
|
+
const g = dt(O, k, l, t.navStart, t.navEnd, e, s);
|
|
1032
|
+
g && (t.goToDay(g), h(g));
|
|
1032
1033
|
}
|
|
1033
1034
|
};
|
|
1034
1035
|
}
|
|
1035
1036
|
function Lo(e, t) {
|
|
1036
|
-
const { selected:
|
|
1037
|
+
const { selected: n, required: o, onSelect: s } = e, [r, i] = Me(n, s ? n : void 0), a = s ? n : r, { isSameDay: c } = t, l = (p) => a?.some((w) => c(w, p)) ?? !1, { min: h, max: f } = e;
|
|
1037
1038
|
return {
|
|
1038
1039
|
selected: a,
|
|
1039
|
-
select: (p, w,
|
|
1040
|
-
let
|
|
1040
|
+
select: (p, w, O) => {
|
|
1041
|
+
let k = [...a ?? []];
|
|
1041
1042
|
if (l(p)) {
|
|
1042
|
-
if (a?.length ===
|
|
1043
|
+
if (a?.length === h || o && a?.length === 1)
|
|
1043
1044
|
return;
|
|
1044
|
-
|
|
1045
|
+
k = a?.filter((g) => !c(g, p));
|
|
1045
1046
|
} else
|
|
1046
|
-
a?.length === f ?
|
|
1047
|
-
return s || i(
|
|
1047
|
+
a?.length === f ? k = [p] : k = [...k, p];
|
|
1048
|
+
return s || i(k), s?.(k, p, w, O), k;
|
|
1048
1049
|
},
|
|
1049
1050
|
isSelected: l
|
|
1050
1051
|
};
|
|
1051
1052
|
}
|
|
1052
|
-
function Vo(e, t,
|
|
1053
|
-
const { from: i, to: a } = t || {}, { isSameDay: c, isAfter: l, isBefore:
|
|
1053
|
+
function Vo(e, t, n = 0, o = 0, s = !1, r = V) {
|
|
1054
|
+
const { from: i, to: a } = t || {}, { isSameDay: c, isAfter: l, isBefore: h } = r;
|
|
1054
1055
|
let f;
|
|
1055
1056
|
if (!i && !a)
|
|
1056
|
-
f = { from: e, to:
|
|
1057
|
+
f = { from: e, to: n > 0 ? void 0 : e };
|
|
1057
1058
|
else if (i && !a)
|
|
1058
|
-
c(i, e) ? s ? f = { from: i, to: void 0 } : f = void 0 :
|
|
1059
|
+
c(i, e) ? s ? f = { from: i, to: void 0 } : f = void 0 : h(e, i) ? f = { from: e, to: i } : f = { from: i, to: e };
|
|
1059
1060
|
else if (i && a)
|
|
1060
1061
|
if (c(i, e) && c(a, e))
|
|
1061
1062
|
s ? f = { from: i, to: a } : f = void 0;
|
|
1062
1063
|
else if (c(i, e))
|
|
1063
|
-
f = { from: i, to:
|
|
1064
|
+
f = { from: i, to: n > 0 ? void 0 : e };
|
|
1064
1065
|
else if (c(a, e))
|
|
1065
|
-
f = { from: e, to:
|
|
1066
|
-
else if (
|
|
1066
|
+
f = { from: e, to: n > 0 ? void 0 : e };
|
|
1067
|
+
else if (h(e, i))
|
|
1067
1068
|
f = { from: e, to: a };
|
|
1068
1069
|
else if (l(e, i))
|
|
1069
1070
|
f = { from: i, to: e };
|
|
@@ -1072,73 +1073,73 @@ function Vo(e, t, o = 0, n = 0, s = !1, r = V) {
|
|
|
1072
1073
|
else
|
|
1073
1074
|
throw new Error("Invalid range");
|
|
1074
1075
|
if (f?.from && f?.to) {
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1076
|
+
const u = r.differenceInCalendarDays(f.to, f.from);
|
|
1077
|
+
o > 0 && u > o ? f = { from: e, to: void 0 } : n > 1 && u < n && (f = { from: e, to: void 0 });
|
|
1077
1078
|
}
|
|
1078
1079
|
return f;
|
|
1079
1080
|
}
|
|
1080
|
-
function Jo(e, t,
|
|
1081
|
-
const
|
|
1081
|
+
function Jo(e, t, n = V) {
|
|
1082
|
+
const o = Array.isArray(t) ? t : [t];
|
|
1082
1083
|
let s = e.from;
|
|
1083
|
-
const r =
|
|
1084
|
+
const r = n.differenceInCalendarDays(e.to, e.from), i = Math.min(r, 6);
|
|
1084
1085
|
for (let a = 0; a <= i; a++) {
|
|
1085
|
-
if (
|
|
1086
|
+
if (o.includes(s.getDay()))
|
|
1086
1087
|
return !0;
|
|
1087
|
-
s =
|
|
1088
|
+
s = n.addDays(s, 1);
|
|
1088
1089
|
}
|
|
1089
1090
|
return !1;
|
|
1090
1091
|
}
|
|
1091
|
-
function Re(e, t,
|
|
1092
|
-
return Q(e, t.from, !1,
|
|
1092
|
+
function Re(e, t, n = V) {
|
|
1093
|
+
return Q(e, t.from, !1, n) || Q(e, t.to, !1, n) || Q(t, e.from, !1, n) || Q(t, e.to, !1, n);
|
|
1093
1094
|
}
|
|
1094
|
-
function Qo(e, t,
|
|
1095
|
-
const
|
|
1096
|
-
if (
|
|
1097
|
-
from:
|
|
1098
|
-
to:
|
|
1099
|
-
},
|
|
1095
|
+
function Qo(e, t, n = V) {
|
|
1096
|
+
const o = Array.isArray(t) ? t : [t];
|
|
1097
|
+
if (o.filter((a) => typeof a != "function").some((a) => typeof a == "boolean" ? a : n.isDate(a) ? Q(e, a, !1, n) : st(a, n) ? a.some((c) => Q(e, c, !1, n)) : Ye(a) ? a.from && a.to ? Re(e, { from: a.from, to: a.to }, n) : !1 : ot(a) ? Jo(e, a.dayOfWeek, n) : et(a) ? n.isAfter(a.before, a.after) ? Re(e, {
|
|
1098
|
+
from: n.addDays(a.after, 1),
|
|
1099
|
+
to: n.addDays(a.before, -1)
|
|
1100
|
+
}, n) : X(e.from, a, n) || X(e.to, a, n) : tt(a) || nt(a) ? X(e.from, a, n) || X(e.to, a, n) : !1))
|
|
1100
1101
|
return !0;
|
|
1101
|
-
const i =
|
|
1102
|
+
const i = o.filter((a) => typeof a == "function");
|
|
1102
1103
|
if (i.length) {
|
|
1103
1104
|
let a = e.from;
|
|
1104
|
-
const c =
|
|
1105
|
+
const c = n.differenceInCalendarDays(e.to, e.from);
|
|
1105
1106
|
for (let l = 0; l <= c; l++) {
|
|
1106
|
-
if (i.some((
|
|
1107
|
+
if (i.some((h) => h(a)))
|
|
1107
1108
|
return !0;
|
|
1108
|
-
a =
|
|
1109
|
+
a = n.addDays(a, 1);
|
|
1109
1110
|
}
|
|
1110
1111
|
}
|
|
1111
1112
|
return !1;
|
|
1112
1113
|
}
|
|
1113
1114
|
function Xo(e, t) {
|
|
1114
|
-
const { disabled:
|
|
1115
|
+
const { disabled: n, excludeDisabled: o, selected: s, required: r, onSelect: i } = e, [a, c] = Me(s, i ? s : void 0), l = i ? s : a;
|
|
1115
1116
|
return {
|
|
1116
1117
|
selected: l,
|
|
1117
|
-
select: (
|
|
1118
|
-
const { min:
|
|
1119
|
-
return
|
|
1118
|
+
select: (u, p, w) => {
|
|
1119
|
+
const { min: O, max: k } = e, g = u ? Vo(u, l, O, k, r, t) : void 0;
|
|
1120
|
+
return o && n && g?.from && g.to && Qo({ from: g.from, to: g.to }, n, t) && (g.from = u, g.to = void 0), i || c(g), i?.(g, u, p, w), g;
|
|
1120
1121
|
},
|
|
1121
|
-
isSelected: (
|
|
1122
|
+
isSelected: (u) => l && Q(l, u, !1, t)
|
|
1122
1123
|
};
|
|
1123
1124
|
}
|
|
1124
1125
|
function es(e, t) {
|
|
1125
|
-
const { selected:
|
|
1126
|
+
const { selected: n, required: o, onSelect: s } = e, [r, i] = Me(n, s ? n : void 0), a = s ? n : r, { isSameDay: c } = t;
|
|
1126
1127
|
return {
|
|
1127
1128
|
selected: a,
|
|
1128
|
-
select: (f,
|
|
1129
|
+
select: (f, u, p) => {
|
|
1129
1130
|
let w = f;
|
|
1130
|
-
return !
|
|
1131
|
+
return !o && a && a && c(f, a) && (w = void 0), s || i(w), s?.(w, f, u, p), w;
|
|
1131
1132
|
},
|
|
1132
1133
|
isSelected: (f) => a ? c(a, f) : !1
|
|
1133
1134
|
};
|
|
1134
1135
|
}
|
|
1135
1136
|
function ts(e, t) {
|
|
1136
|
-
const
|
|
1137
|
+
const n = es(e, t), o = Lo(e, t), s = Xo(e, t);
|
|
1137
1138
|
switch (e.mode) {
|
|
1138
1139
|
case "single":
|
|
1139
|
-
return o;
|
|
1140
|
-
case "multiple":
|
|
1141
1140
|
return n;
|
|
1141
|
+
case "multiple":
|
|
1142
|
+
return o;
|
|
1142
1143
|
case "range":
|
|
1143
1144
|
return s;
|
|
1144
1145
|
default:
|
|
@@ -1153,7 +1154,7 @@ function ns(e) {
|
|
|
1153
1154
|
from: t.selected.from ? new F(t.selected.from, t.timeZone) : void 0,
|
|
1154
1155
|
to: t.selected.to ? new F(t.selected.to, t.timeZone) : void 0
|
|
1155
1156
|
}));
|
|
1156
|
-
const { components:
|
|
1157
|
+
const { components: n, formatters: o, labels: s, dateLib: r, locale: i, classNames: a } = Ce(() => {
|
|
1157
1158
|
const v = { ...Ke, ...t.locale };
|
|
1158
1159
|
return {
|
|
1159
1160
|
dateLib: new ee({
|
|
@@ -1185,17 +1186,17 @@ function ns(e) {
|
|
|
1185
1186
|
t.formatters,
|
|
1186
1187
|
t.labels,
|
|
1187
1188
|
t.classNames
|
|
1188
|
-
]), { captionLayout: c, mode: l, navLayout:
|
|
1189
|
-
j && (J(j),
|
|
1190
|
-
}, [j, J,
|
|
1189
|
+
]), { captionLayout: c, mode: l, navLayout: h, numberOfMonths: f = 1, onDayBlur: u, onDayClick: p, onDayFocus: w, onDayKeyDown: O, onDayMouseEnter: k, onDayMouseLeave: g, onNextClick: W, onPrevClick: M, showWeekNumber: S, styles: y } = t, { formatCaption: b, formatDay: D, formatMonthDropdown: _, formatWeekNumber: Y, formatWeekNumberHeader: $, formatWeekdayName: P, formatYearDropdown: Z } = o, oe = Ro(t, r), { days: se, months: re, navStart: ue, navEnd: De, previousMonth: j, nextMonth: z, goToMonth: J } = oe, ke = En(se, t, ue, De, r), { isSelected: be, select: we, selected: he } = ts(t, r) ?? {}, { blur: Be, focused: xe, isFocusTarget: ut, moveFocus: Fe, setFocused: me } = Ko(t, oe, ke, be ?? (() => !1), r), { labelDayButton: ht, labelGridcell: mt, labelGrid: yt, labelMonthDropdown: pt, labelNav: Ie, labelPrevious: Mt, labelNext: Dt, labelWeekday: kt, labelWeekNumber: bt, labelWeekNumberHeader: wt, labelYearDropdown: vt } = s, gt = Ce(() => ko(r, t.ISOWeek), [r, t.ISOWeek]), $e = l !== void 0 || p !== void 0, ve = H(() => {
|
|
1190
|
+
j && (J(j), M?.(j));
|
|
1191
|
+
}, [j, J, M]), ge = H(() => {
|
|
1191
1192
|
z && (J(z), W?.(z));
|
|
1192
|
-
}, [J, z, W]),
|
|
1193
|
-
C.preventDefault(), C.stopPropagation(),
|
|
1194
|
-
}, [we, p,
|
|
1195
|
-
|
|
1196
|
-
}, [w,
|
|
1197
|
-
Be(),
|
|
1198
|
-
}, [Be,
|
|
1193
|
+
}, [J, z, W]), Ot = H((v, E) => (C) => {
|
|
1194
|
+
C.preventDefault(), C.stopPropagation(), me(v), we?.(v.date, E, C), p?.(v.date, E, C);
|
|
1195
|
+
}, [we, p, me]), _t = H((v, E) => (C) => {
|
|
1196
|
+
me(v), w?.(v.date, E, C);
|
|
1197
|
+
}, [w, me]), Ct = H((v, E) => (C) => {
|
|
1198
|
+
Be(), u?.(v.date, E, C);
|
|
1199
|
+
}, [Be, u]), Wt = H((v, E) => (C) => {
|
|
1199
1200
|
const te = {
|
|
1200
1201
|
ArrowLeft: [
|
|
1201
1202
|
C.shiftKey ? "month" : "day",
|
|
@@ -1214,15 +1215,15 @@ function ns(e) {
|
|
|
1214
1215
|
};
|
|
1215
1216
|
if (te[C.key]) {
|
|
1216
1217
|
C.preventDefault(), C.stopPropagation();
|
|
1217
|
-
const [q,
|
|
1218
|
-
Fe(q,
|
|
1218
|
+
const [q, ye] = te[C.key];
|
|
1219
|
+
Fe(q, ye);
|
|
1219
1220
|
}
|
|
1220
|
-
g?.(v.date, E, C);
|
|
1221
|
-
}, [Fe, g, t.dir]), Nt = H((v, E) => (C) => {
|
|
1222
|
-
D?.(v.date, E, C);
|
|
1223
|
-
}, [D]), St = H((v, E) => (C) => {
|
|
1224
1221
|
O?.(v.date, E, C);
|
|
1225
|
-
}, [O]),
|
|
1222
|
+
}, [Fe, O, t.dir]), Nt = H((v, E) => (C) => {
|
|
1223
|
+
k?.(v.date, E, C);
|
|
1224
|
+
}, [k]), St = H((v, E) => (C) => {
|
|
1225
|
+
g?.(v.date, E, C);
|
|
1226
|
+
}, [g]), Et = H((v) => (E) => {
|
|
1226
1227
|
const C = Number(E.target.value), te = r.setMonth(r.startOfMonth(v), C);
|
|
1227
1228
|
J(te);
|
|
1228
1229
|
}, [r, J]), Tt = H((v) => (E) => {
|
|
@@ -1231,7 +1232,7 @@ function ns(e) {
|
|
|
1231
1232
|
}, [r, J]), { className: Yt, style: Bt } = Ce(() => ({
|
|
1232
1233
|
className: [a[m.Root], t.className].filter(Boolean).join(" "),
|
|
1233
1234
|
style: { ...y?.[m.Root], ...t.style }
|
|
1234
|
-
}), [a, t.className, t.style, y]), xt = ao(t), Pe =
|
|
1235
|
+
}), [a, t.className, t.style, y]), xt = ao(t), Pe = ce(null);
|
|
1235
1236
|
Io(Pe, !!t.animate, {
|
|
1236
1237
|
classNames: a,
|
|
1237
1238
|
months: re,
|
|
@@ -1240,45 +1241,45 @@ function ns(e) {
|
|
|
1240
1241
|
});
|
|
1241
1242
|
const Ft = {
|
|
1242
1243
|
dayPickerProps: t,
|
|
1243
|
-
selected:
|
|
1244
|
+
selected: he,
|
|
1244
1245
|
select: we,
|
|
1245
1246
|
isSelected: be,
|
|
1246
1247
|
months: re,
|
|
1247
1248
|
nextMonth: z,
|
|
1248
1249
|
previousMonth: j,
|
|
1249
1250
|
goToMonth: J,
|
|
1250
|
-
getModifiers:
|
|
1251
|
-
components:
|
|
1251
|
+
getModifiers: ke,
|
|
1252
|
+
components: n,
|
|
1252
1253
|
classNames: a,
|
|
1253
1254
|
styles: y,
|
|
1254
1255
|
labels: s,
|
|
1255
|
-
formatters:
|
|
1256
|
+
formatters: o
|
|
1256
1257
|
};
|
|
1257
1258
|
return d.createElement(
|
|
1258
1259
|
rt.Provider,
|
|
1259
1260
|
{ value: Ft },
|
|
1260
1261
|
d.createElement(
|
|
1261
|
-
|
|
1262
|
+
n.Root,
|
|
1262
1263
|
{ rootRef: t.animate ? Pe : void 0, className: Yt, style: Bt, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], ...xt },
|
|
1263
1264
|
d.createElement(
|
|
1264
|
-
|
|
1265
|
+
n.Months,
|
|
1265
1266
|
{ className: a[m.Months], style: y?.[m.Months] },
|
|
1266
|
-
!t.hideNavigation && !
|
|
1267
|
+
!t.hideNavigation && !h && d.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: a[m.Nav], style: y?.[m.Nav], "aria-label": Ie(), onPreviousClick: ve, onNextClick: ge, previousMonth: j, nextMonth: z }),
|
|
1267
1268
|
re.map((v, E) => {
|
|
1268
|
-
const C =
|
|
1269
|
+
const C = Mo(v.date, ue, De, o, r), te = bo(ue, De, o, r);
|
|
1269
1270
|
return d.createElement(
|
|
1270
|
-
|
|
1271
|
+
n.Month,
|
|
1271
1272
|
{ "data-animated-month": t.animate ? "true" : void 0, className: a[m.Month], style: y?.[m.Month], key: E, displayIndex: E, calendarMonth: v },
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
{ type: "button", className: a[m.PreviousMonthButton], tabIndex: j ? void 0 : -1, "aria-disabled": j ? void 0 : !0, "aria-label":
|
|
1275
|
-
d.createElement(
|
|
1273
|
+
h === "around" && !t.hideNavigation && E === 0 && d.createElement(
|
|
1274
|
+
n.PreviousMonthButton,
|
|
1275
|
+
{ type: "button", className: a[m.PreviousMonthButton], tabIndex: j ? void 0 : -1, "aria-disabled": j ? void 0 : !0, "aria-label": Mt(j), onClick: ve, "data-animated-button": t.animate ? "true" : void 0 },
|
|
1276
|
+
d.createElement(n.Chevron, { disabled: j ? void 0 : !0, className: a[m.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
1276
1277
|
),
|
|
1277
|
-
d.createElement(
|
|
1278
|
-
|
|
1278
|
+
d.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: a[m.MonthCaption], style: y?.[m.MonthCaption], calendarMonth: v, displayIndex: E }, c?.startsWith("dropdown") ? d.createElement(
|
|
1279
|
+
n.DropdownNav,
|
|
1279
1280
|
{ className: a[m.Dropdowns], style: y?.[m.Dropdowns] },
|
|
1280
|
-
c === "dropdown" || c === "dropdown-months" ? d.createElement(
|
|
1281
|
-
c === "dropdown" || c === "dropdown-years" ? d.createElement(
|
|
1281
|
+
c === "dropdown" || c === "dropdown-months" ? d.createElement(n.MonthsDropdown, { className: a[m.MonthsDropdown], "aria-label": pt(), classNames: a, components: n, disabled: !!t.disableNavigation, onChange: Et(v.date), options: C, style: y?.[m.Dropdown], value: r.getMonth(v.date) }) : d.createElement("span", null, _(v.date, r)),
|
|
1282
|
+
c === "dropdown" || c === "dropdown-years" ? d.createElement(n.YearsDropdown, { className: a[m.YearsDropdown], "aria-label": vt(r.options), classNames: a, components: n, disabled: !!t.disableNavigation, onChange: Tt(v.date), options: te, style: y?.[m.Dropdown], value: r.getYear(v.date) }) : d.createElement("span", null, Z(v.date, r)),
|
|
1282
1283
|
d.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
1283
1284
|
border: 0,
|
|
1284
1285
|
clip: "rect(0 0 0 0)",
|
|
@@ -1291,47 +1292,47 @@ function ns(e) {
|
|
|
1291
1292
|
whiteSpace: "nowrap",
|
|
1292
1293
|
wordWrap: "normal"
|
|
1293
1294
|
} }, b(v.date, r.options, r))
|
|
1294
|
-
) : d.createElement(
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
{ type: "button", className: a[m.NextMonthButton], tabIndex: z ? void 0 : -1, "aria-disabled": z ? void 0 : !0, "aria-label":
|
|
1298
|
-
d.createElement(
|
|
1295
|
+
) : d.createElement(n.CaptionLabel, { className: a[m.CaptionLabel], role: "status", "aria-live": "polite" }, b(v.date, r.options, r))),
|
|
1296
|
+
h === "around" && !t.hideNavigation && E === f - 1 && d.createElement(
|
|
1297
|
+
n.NextMonthButton,
|
|
1298
|
+
{ type: "button", className: a[m.NextMonthButton], tabIndex: z ? void 0 : -1, "aria-disabled": z ? void 0 : !0, "aria-label": Dt(z), onClick: ge, "data-animated-button": t.animate ? "true" : void 0 },
|
|
1299
|
+
d.createElement(n.Chevron, { disabled: z ? void 0 : !0, className: a[m.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
1299
1300
|
),
|
|
1300
|
-
E === f - 1 &&
|
|
1301
|
+
E === f - 1 && h === "after" && !t.hideNavigation && d.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: a[m.Nav], style: y?.[m.Nav], "aria-label": Ie(), onPreviousClick: ve, onNextClick: ge, previousMonth: j, nextMonth: z }),
|
|
1301
1302
|
d.createElement(
|
|
1302
|
-
|
|
1303
|
+
n.MonthGrid,
|
|
1303
1304
|
{ role: "grid", "aria-multiselectable": l === "multiple" || l === "range", "aria-label": yt(v.date, r.options, r) || void 0, className: a[m.MonthGrid], style: y?.[m.MonthGrid] },
|
|
1304
1305
|
!t.hideWeekdays && d.createElement(
|
|
1305
|
-
|
|
1306
|
+
n.Weekdays,
|
|
1306
1307
|
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: a[m.Weekdays], style: y?.[m.Weekdays] },
|
|
1307
|
-
S && d.createElement(
|
|
1308
|
-
|
|
1308
|
+
S && d.createElement(n.WeekNumberHeader, { "aria-label": wt(r.options), className: a[m.WeekNumberHeader], style: y?.[m.WeekNumberHeader], scope: "col" }, $()),
|
|
1309
|
+
gt.map((q, ye) => d.createElement(n.Weekday, { "aria-label": kt(q, r.options, r), className: a[m.Weekday], key: ye, style: y?.[m.Weekday], scope: "col" }, P(q, r.options, r)))
|
|
1309
1310
|
),
|
|
1310
|
-
d.createElement(
|
|
1311
|
-
|
|
1311
|
+
d.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: a[m.Weeks], style: y?.[m.Weeks] }, v.weeks.map((q, ye) => d.createElement(
|
|
1312
|
+
n.Week,
|
|
1312
1313
|
{ className: a[m.Week], key: q.weekNumber, style: y?.[m.Week], week: q },
|
|
1313
|
-
S && d.createElement(
|
|
1314
|
+
S && d.createElement(n.WeekNumber, { week: q, style: y?.[m.WeekNumber], "aria-label": bt(q.weekNumber, {
|
|
1314
1315
|
locale: i
|
|
1315
1316
|
}), className: a[m.WeekNumber], scope: "row", role: "rowheader" }, Y(q.weekNumber, r)),
|
|
1316
1317
|
q.days.map((B) => {
|
|
1317
|
-
const { date: U } = B, N =
|
|
1318
|
-
if (N[T.focused] = !N.hidden && !!xe?.isEqualTo(B), N[R.selected] = be?.(U) || N.selected, Ye(
|
|
1319
|
-
const { from:
|
|
1320
|
-
N[R.range_start] = !!(
|
|
1318
|
+
const { date: U } = B, N = ke(B);
|
|
1319
|
+
if (N[T.focused] = !N.hidden && !!xe?.isEqualTo(B), N[R.selected] = be?.(U) || N.selected, Ye(he)) {
|
|
1320
|
+
const { from: Oe, to: _e } = he;
|
|
1321
|
+
N[R.range_start] = !!(Oe && _e && r.isSameDay(U, Oe)), N[R.range_end] = !!(Oe && _e && r.isSameDay(U, _e)), N[R.range_middle] = Q(he, U, !0, r);
|
|
1321
1322
|
}
|
|
1322
|
-
const It =
|
|
1323
|
-
return d.createElement(
|
|
1323
|
+
const It = Do(N, y, t.modifiersStyles), $t = Tn(N, a, t.modifiersClassNames), Pt = !$e && !N.hidden ? mt(U, N, r.options, r) : void 0;
|
|
1324
|
+
return d.createElement(n.Day, { key: `${r.format(U, "yyyy-MM-dd")}_${r.format(B.displayMonth, "yyyy-MM")}`, day: B, modifiers: N, className: $t.join(" "), style: It, role: "gridcell", "aria-selected": N.selected || void 0, "aria-label": Pt, "data-day": r.format(U, "yyyy-MM-dd"), "data-month": B.outside ? r.format(U, "yyyy-MM") : void 0, "data-selected": N.selected || void 0, "data-disabled": N.disabled || void 0, "data-hidden": N.hidden || void 0, "data-outside": B.outside || void 0, "data-focused": N.focused || void 0, "data-today": N.today || void 0 }, !N.hidden && $e ? d.createElement(n.DayButton, { className: a[m.DayButton], style: y?.[m.DayButton], type: "button", day: B, modifiers: N, disabled: N.disabled || void 0, tabIndex: ut(B) ? 0 : -1, "aria-label": ht(U, N, r.options, r), onClick: Ot(B, N), onBlur: Ct(B, N), onFocus: _t(B, N), onKeyDown: Wt(B, N), onMouseEnter: Nt(B, N), onMouseLeave: St(B, N) }, D(U, r.options, r)) : !N.hidden && D(B.date, r.options, r));
|
|
1324
1325
|
})
|
|
1325
1326
|
)))
|
|
1326
1327
|
)
|
|
1327
1328
|
);
|
|
1328
1329
|
})
|
|
1329
1330
|
),
|
|
1330
|
-
t.footer && d.createElement(
|
|
1331
|
+
t.footer && d.createElement(n.Footer, { className: a[m.Footer], style: y?.[m.Footer], role: "status", "aria-live": "polite" }, t.footer)
|
|
1331
1332
|
)
|
|
1332
1333
|
);
|
|
1333
1334
|
}
|
|
1334
|
-
const os = "
|
|
1335
|
+
const os = "_root_8dbco_3", ss = "_months_8dbco_102", rs = "_month_8dbco_102", as = "_day_button_8dbco_108", is = "_day_8dbco_108", cs = "_selected_8dbco_116", ls = "_month_caption_8dbco_123", fs = "_dropdown_root_8dbco_131", ds = "_weekday_8dbco_134", us = "_week_number_8dbco_135", hs = "_range_middle_8dbco_144", ms = "_disabled_8dbco_152", ys = "_outside_8dbco_160", ps = "_button_next_8dbco_167", Ms = "_button_previous_8dbco_168", x = {
|
|
1335
1336
|
root: os,
|
|
1336
1337
|
months: ss,
|
|
1337
1338
|
month: rs,
|
|
@@ -1346,60 +1347,75 @@ const os = "_root_bdmmk_3", ss = "_months_bdmmk_88", rs = "_month_bdmmk_88", as
|
|
|
1346
1347
|
disabled: ms,
|
|
1347
1348
|
outside: ys,
|
|
1348
1349
|
button_next: ps,
|
|
1349
|
-
button_previous:
|
|
1350
|
-
},
|
|
1351
|
-
const { firstElementRef: t, ...
|
|
1350
|
+
button_previous: Ms
|
|
1351
|
+
}, Ds = (e) => {
|
|
1352
|
+
const { firstElementRef: t, ...n } = e, o = at(), s = {
|
|
1352
1353
|
...x,
|
|
1353
|
-
root: `${
|
|
1354
|
-
day_button: `${
|
|
1355
|
-
day: `${
|
|
1356
|
-
weekday: `${
|
|
1357
|
-
week_number: `${
|
|
1358
|
-
month_caption: `${
|
|
1359
|
-
disabled: `${
|
|
1360
|
-
dropdown: `${
|
|
1361
|
-
years_dropdown: `${
|
|
1362
|
-
outside: `${
|
|
1363
|
-
dropdown_root: `${
|
|
1364
|
-
months: `${
|
|
1365
|
-
month: `${
|
|
1366
|
-
button_next: `${
|
|
1367
|
-
button_previous: `${
|
|
1368
|
-
}, r = (/* @__PURE__ */ new Date()).getFullYear() - 10, i = (/* @__PURE__ */ new Date()).getFullYear() + 10, [a, c] = pe();
|
|
1354
|
+
root: `${o.root} ${x.root}`,
|
|
1355
|
+
day_button: `${o.day_button} ${x.day_button}`,
|
|
1356
|
+
day: `${o.day} ${x.day}`,
|
|
1357
|
+
weekday: `${o.weekday} ${x.weekday}`,
|
|
1358
|
+
week_number: `${o.week_number} ${x.week_number}`,
|
|
1359
|
+
month_caption: `${o.month_caption} ${x.month_caption}`,
|
|
1360
|
+
disabled: `${o.disabled} ${x.disabled}`,
|
|
1361
|
+
dropdown: `${o.dropdown} ${x.dropdown}`,
|
|
1362
|
+
years_dropdown: `${o.years_dropdown} ${x.years_dropdown}`,
|
|
1363
|
+
outside: `${o.outside} ${x.outside}`,
|
|
1364
|
+
dropdown_root: `${o.dropdown_root} ${x.dropdown_root}`,
|
|
1365
|
+
months: `${o.months} ${x.months}`,
|
|
1366
|
+
month: `${o.month} ${x.month}`,
|
|
1367
|
+
button_next: `${o.button_next} ${x.button_next}`,
|
|
1368
|
+
button_previous: `${o.button_previous} ${x.button_previous}`
|
|
1369
|
+
}, r = (/* @__PURE__ */ new Date()).getFullYear() - 10, i = (/* @__PURE__ */ new Date()).getFullYear() + 10, [a, c] = pe(() => n.defaultMonth ? n.defaultMonth : n.mode === "single" && n.selected instanceof Date ? n.selected : n.mode === "range" && n.selected && typeof n.selected == "object" && "from" in n.selected && n.selected.from instanceof Date ? n.selected.from : /* @__PURE__ */ new Date()), l = n.mode === "single" && n.selected instanceof Date ? n.selected : n.mode === "range" && n.selected && typeof n.selected == "object" && "from" in n.selected && n.selected.from instanceof Date ? n.selected.from : void 0, h = l?.getTime(), f = ce(!0);
|
|
1369
1370
|
return Ue(() => {
|
|
1370
|
-
|
|
1371
|
-
|
|
1371
|
+
if (f.current) {
|
|
1372
|
+
f.current = !1;
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
l && c((u) => u.getFullYear() === l.getFullYear() && u.getMonth() === l.getMonth() ? u : l);
|
|
1376
|
+
}, [h]), /* @__PURE__ */ ae(
|
|
1372
1377
|
ns,
|
|
1373
1378
|
{
|
|
1374
1379
|
weekStartsOn: 1,
|
|
1375
1380
|
captionLayout: "dropdown-years",
|
|
1376
1381
|
startMonth: new Date(r, 0),
|
|
1377
1382
|
endMonth: new Date(i, 11),
|
|
1378
|
-
...
|
|
1383
|
+
...n,
|
|
1379
1384
|
month: a,
|
|
1380
1385
|
onMonthChange: c,
|
|
1381
1386
|
classNames: s,
|
|
1382
1387
|
navLayout: "around",
|
|
1383
1388
|
components: {
|
|
1384
|
-
PreviousMonthButton: ({ ["aria-label"]:
|
|
1389
|
+
PreviousMonthButton: ({ ["aria-label"]: u, ...p }) => /* @__PURE__ */ ae(
|
|
1385
1390
|
Ae,
|
|
1386
1391
|
{
|
|
1387
1392
|
ref: t,
|
|
1388
|
-
variant: "
|
|
1393
|
+
variant: "tertiary-purple",
|
|
1389
1394
|
size: "sm",
|
|
1390
1395
|
iconOnly: !0,
|
|
1391
|
-
"aria-label":
|
|
1392
|
-
...
|
|
1396
|
+
"aria-label": u ?? "",
|
|
1397
|
+
...p,
|
|
1393
1398
|
children: /* @__PURE__ */ ae(jt, { size: "sm" })
|
|
1394
1399
|
}
|
|
1395
1400
|
),
|
|
1396
|
-
NextMonthButton: ({ ["aria-label"]:
|
|
1401
|
+
NextMonthButton: ({ ["aria-label"]: u, ...p }) => /* @__PURE__ */ ae(
|
|
1402
|
+
Ae,
|
|
1403
|
+
{
|
|
1404
|
+
variant: "tertiary-purple",
|
|
1405
|
+
size: "sm",
|
|
1406
|
+
iconOnly: !0,
|
|
1407
|
+
"aria-label": u ?? "",
|
|
1408
|
+
...p,
|
|
1409
|
+
children: /* @__PURE__ */ ae(zt, { size: "sm" })
|
|
1410
|
+
}
|
|
1411
|
+
)
|
|
1397
1412
|
}
|
|
1398
1413
|
}
|
|
1399
1414
|
);
|
|
1400
1415
|
};
|
|
1401
|
-
|
|
1416
|
+
Ds.displayName = "Calendar";
|
|
1402
1417
|
export {
|
|
1403
|
-
|
|
1418
|
+
Ds as C,
|
|
1419
|
+
cn as i
|
|
1404
1420
|
};
|
|
1405
|
-
//# sourceMappingURL=calendar-
|
|
1421
|
+
//# sourceMappingURL=calendar-d53vgYqR.mjs.map
|