@konstructio/ui 0.1.1-alpha.5 → 0.1.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chevron-down-CVce9Mvh.js → chevron-down-BLZPftpV.js} +2 -2
- package/dist/components/Autocomplete/Autocomplete.js +46 -54
- package/dist/components/Autocomplete/Autocomplete.variants.js +29 -48
- package/dist/components/Autocomplete/components/List/List.js +37 -47
- package/dist/components/Autocomplete/components/List/List.variants.js +34 -69
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Button/Button.variants.js +110 -134
- package/dist/components/Checkbox/Checkbox.variants.js +5 -5
- package/dist/components/Datepicker/DatePicker.js +754 -705
- package/dist/components/Dropdown/Dropdown.variants.js +8 -8
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Input/Input.js +47 -47
- package/dist/components/Input/Input.variants.js +10 -10
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/Loading/Loading.variants.js +4 -4
- package/dist/components/Radio/Radio.variants.js +4 -4
- package/dist/components/Switch/Switch.js +90 -86
- package/dist/components/Switch/Switch.variants.js +16 -12
- package/dist/components/Tabs/Tabs.variants.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Toast/Toast.variants.js +7 -5
- package/dist/{createLucideIcon-BpsAkT97.js → createLucideIcon-DbC6TvM5.js} +4 -4
- package/dist/index.d.ts +3 -4
- package/dist/package.json +17 -17
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +204 -189
- package/dist/ui/kubefirst-theme.css +3 -1
- package/dist/ui/theme.css +2 -2
- package/package.json +17 -17
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as Ee } from "react/jsx-runtime";
|
|
2
|
-
import l, { createContext as sn, useContext as an, useCallback as
|
|
2
|
+
import l, { createContext as sn, useContext as an, useCallback as j, useRef as ke, useLayoutEffect as cn, useState as De, useEffect as un, useMemo as Pe } from "react";
|
|
3
3
|
import { cn as ue } from "../../utils/index.js";
|
|
4
4
|
import { datePickerVariants as fn } from "./DatePicker.variants.js";
|
|
5
|
-
import { c as st } from "../../createLucideIcon-
|
|
5
|
+
import { c as st } from "../../createLucideIcon-DbC6TvM5.js";
|
|
6
6
|
import '../../DatePicker.css';/**
|
|
7
|
-
* @license lucide-react v0.
|
|
7
|
+
* @license lucide-react v0.544.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
const dn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], ln = st("chevron-left", dn);
|
|
13
13
|
/**
|
|
14
|
-
* @license lucide-react v0.
|
|
14
|
+
* @license lucide-react v0.544.0 - ISC
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the ISC license.
|
|
17
17
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -28,34 +28,34 @@ function yn(e, t, n = "long") {
|
|
|
28
28
|
const gn = {}, le = {};
|
|
29
29
|
function ne(e, t) {
|
|
30
30
|
try {
|
|
31
|
-
const
|
|
31
|
+
const r = (gn[e] ||= new Intl.DateTimeFormat("en-US", {
|
|
32
32
|
timeZone: e,
|
|
33
33
|
timeZoneName: "longOffset"
|
|
34
34
|
}).format)(t).split("GMT")[1];
|
|
35
|
-
return
|
|
35
|
+
return r in le ? le[r] : Le(r, r.split(":"));
|
|
36
36
|
} catch {
|
|
37
37
|
if (e in le) return le[e];
|
|
38
38
|
const n = e?.match(pn);
|
|
39
|
-
return n ?
|
|
39
|
+
return n ? Le(e, n.slice(1)) : NaN;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
const pn = /([+-]\d\d):?(\d\d)?/;
|
|
43
|
-
function
|
|
44
|
-
const n = +(t[0] || 0),
|
|
45
|
-
return le[e] = n * 60 +
|
|
43
|
+
function Le(e, t) {
|
|
44
|
+
const n = +(t[0] || 0), r = +(t[1] || 0), o = +(t[2] || 0) / 60;
|
|
45
|
+
return le[e] = n * 60 + r > 0 ? n * 60 + r + o : n * 60 - r - o;
|
|
46
46
|
}
|
|
47
|
-
class
|
|
47
|
+
class X extends Date {
|
|
48
48
|
//#region static
|
|
49
49
|
constructor(...t) {
|
|
50
50
|
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)), at(this), He(this)) : this.setTime(Date.now());
|
|
51
51
|
}
|
|
52
52
|
static tz(t, ...n) {
|
|
53
|
-
return n.length ? new
|
|
53
|
+
return n.length ? new X(...n, t) : new X(Date.now(), t);
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region time zone
|
|
57
57
|
withTimeZone(t) {
|
|
58
|
-
return new
|
|
58
|
+
return new X(+this, t);
|
|
59
59
|
}
|
|
60
60
|
getTimezoneOffset() {
|
|
61
61
|
const t = -ne(this.timeZone, this);
|
|
@@ -69,19 +69,19 @@ class L extends Date {
|
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region date-fns integration
|
|
71
71
|
[Symbol.for("constructDateFrom")](t) {
|
|
72
|
-
return new
|
|
72
|
+
return new X(+new Date(t), this.timeZone);
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const Qe = /^(get|set)(?!UTC)/;
|
|
77
77
|
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
78
|
-
if (!
|
|
79
|
-
const t = e.replace(
|
|
80
|
-
|
|
78
|
+
if (!Qe.test(e)) return;
|
|
79
|
+
const t = e.replace(Qe, "$1UTC");
|
|
80
|
+
X.prototype[t] && (e.startsWith("get") ? X.prototype[e] = function() {
|
|
81
81
|
return this.internal[t]();
|
|
82
|
-
} : (
|
|
82
|
+
} : (X.prototype[e] = function() {
|
|
83
83
|
return Date.prototype[t].apply(this.internal, arguments), wn(this), +this;
|
|
84
|
-
},
|
|
84
|
+
}, X.prototype[t] = function() {
|
|
85
85
|
return Date.prototype[t].apply(this, arguments), He(this), +this;
|
|
86
86
|
}));
|
|
87
87
|
});
|
|
@@ -92,24 +92,24 @@ function wn(e) {
|
|
|
92
92
|
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()), at(e);
|
|
93
93
|
}
|
|
94
94
|
function at(e) {
|
|
95
|
-
const t = ne(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t),
|
|
96
|
-
|
|
97
|
-
const
|
|
95
|
+
const t = ne(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), r = /* @__PURE__ */ new Date(+e);
|
|
96
|
+
r.setUTCHours(r.getUTCHours() - 1);
|
|
97
|
+
const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), s = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), i = o - s, a = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
98
98
|
i && a && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + i);
|
|
99
|
-
const c =
|
|
99
|
+
const c = o - n;
|
|
100
100
|
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
101
101
|
const f = /* @__PURE__ */ new Date(+e);
|
|
102
102
|
f.setUTCSeconds(0);
|
|
103
|
-
const d =
|
|
103
|
+
const d = o > 0 ? f.getSeconds() : (f.getSeconds() - 60) % 60, u = Math.round(-(ne(e.timeZone, e) * 60)) % 60;
|
|
104
104
|
(u || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + u + d));
|
|
105
105
|
const h = ne(e.timeZone, e), g = h > 0 ? Math.floor(h) : Math.ceil(h), O = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - g, w = g !== n, W = O - c;
|
|
106
106
|
if (w && W) {
|
|
107
107
|
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + W);
|
|
108
|
-
const N = ne(e.timeZone, e),
|
|
109
|
-
|
|
108
|
+
const N = ne(e.timeZone, e), M = N > 0 ? Math.floor(N) : Math.ceil(N), T = g - M;
|
|
109
|
+
T && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + T), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + T));
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
class I extends
|
|
112
|
+
class I extends X {
|
|
113
113
|
//#region static
|
|
114
114
|
static tz(t, ...n) {
|
|
115
115
|
return n.length ? new I(...n, t) : new I(Date.now(), t);
|
|
@@ -117,19 +117,19 @@ class I extends L {
|
|
|
117
117
|
//#endregion
|
|
118
118
|
//#region representation
|
|
119
119
|
toISOString() {
|
|
120
|
-
const [t, n,
|
|
121
|
-
return this.internal.toISOString().slice(0, -1) +
|
|
120
|
+
const [t, n, r] = this.tzComponents(), o = `${t}${n}:${r}`;
|
|
121
|
+
return this.internal.toISOString().slice(0, -1) + o;
|
|
122
122
|
}
|
|
123
123
|
toString() {
|
|
124
124
|
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
125
125
|
}
|
|
126
126
|
toDateString() {
|
|
127
|
-
const [t, n,
|
|
128
|
-
return `${t?.slice(0, -1)} ${
|
|
127
|
+
const [t, n, r, o] = this.internal.toUTCString().split(" ");
|
|
128
|
+
return `${t?.slice(0, -1)} ${r} ${n} ${o}`;
|
|
129
129
|
}
|
|
130
130
|
toTimeString() {
|
|
131
|
-
const t = this.internal.toUTCString().split(" ")[4], [n,
|
|
132
|
-
return `${t} GMT${n}${
|
|
131
|
+
const t = this.internal.toUTCString().split(" ")[4], [n, r, o] = this.tzComponents();
|
|
132
|
+
return `${t} GMT${n}${r}${o} (${yn(this.timeZone, this)})`;
|
|
133
133
|
}
|
|
134
134
|
toLocaleString(t, n) {
|
|
135
135
|
return Date.prototype.toLocaleString.call(this, t, {
|
|
@@ -152,8 +152,8 @@ class I extends L {
|
|
|
152
152
|
//#endregion
|
|
153
153
|
//#region private
|
|
154
154
|
tzComponents() {
|
|
155
|
-
const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+",
|
|
156
|
-
return [n,
|
|
155
|
+
const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+", r = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), o = String(Math.abs(t) % 60).padStart(2, "0");
|
|
156
|
+
return [n, r, o];
|
|
157
157
|
}
|
|
158
158
|
//#endregion
|
|
159
159
|
withTimeZone(t) {
|
|
@@ -169,48 +169,48 @@ const it = 6048e5, bn = 864e5, Xe = Symbol.for("constructDateFrom");
|
|
|
169
169
|
function F(e, t) {
|
|
170
170
|
return typeof e == "function" ? e(t) : e && typeof e == "object" && Xe in e ? e[Xe](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Y(e, t) {
|
|
173
173
|
return F(t || e, e);
|
|
174
174
|
}
|
|
175
175
|
function ct(e, t, n) {
|
|
176
|
-
const
|
|
177
|
-
return isNaN(t) ? F(e, NaN) : (t &&
|
|
176
|
+
const r = Y(e, n?.in);
|
|
177
|
+
return isNaN(t) ? F(e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
178
178
|
}
|
|
179
179
|
function ut(e, t, n) {
|
|
180
|
-
const
|
|
180
|
+
const r = Y(e, n?.in);
|
|
181
181
|
if (isNaN(t)) return F(e, NaN);
|
|
182
182
|
if (!t)
|
|
183
|
-
return
|
|
184
|
-
const
|
|
185
|
-
s.setMonth(
|
|
183
|
+
return r;
|
|
184
|
+
const o = r.getDate(), s = F(e, r.getTime());
|
|
185
|
+
s.setMonth(r.getMonth() + t + 1, 0);
|
|
186
186
|
const i = s.getDate();
|
|
187
|
-
return
|
|
187
|
+
return o >= i ? s : (r.setFullYear(
|
|
188
188
|
s.getFullYear(),
|
|
189
189
|
s.getMonth(),
|
|
190
|
-
|
|
191
|
-
),
|
|
190
|
+
o
|
|
191
|
+
), r);
|
|
192
192
|
}
|
|
193
193
|
let Mn = {};
|
|
194
194
|
function ye() {
|
|
195
195
|
return Mn;
|
|
196
196
|
}
|
|
197
197
|
function ie(e, t) {
|
|
198
|
-
const n = ye(),
|
|
199
|
-
return
|
|
198
|
+
const n = ye(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, o = Y(e, t?.in), s = o.getDay(), i = (s < r ? 7 : 0) + s - r;
|
|
199
|
+
return o.setDate(o.getDate() - i), o.setHours(0, 0, 0, 0), o;
|
|
200
200
|
}
|
|
201
201
|
function he(e, t) {
|
|
202
202
|
return ie(e, { ...t, weekStartsOn: 1 });
|
|
203
203
|
}
|
|
204
204
|
function ft(e, t) {
|
|
205
|
-
const n =
|
|
206
|
-
|
|
207
|
-
const s = he(
|
|
208
|
-
i.setFullYear(
|
|
205
|
+
const n = Y(e, t?.in), r = n.getFullYear(), o = F(n, 0);
|
|
206
|
+
o.setFullYear(r + 1, 0, 4), o.setHours(0, 0, 0, 0);
|
|
207
|
+
const s = he(o), i = F(n, 0);
|
|
208
|
+
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
209
209
|
const a = he(i);
|
|
210
|
-
return n.getTime() >= s.getTime() ?
|
|
210
|
+
return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= a.getTime() ? r : r - 1;
|
|
211
211
|
}
|
|
212
212
|
function Ue(e) {
|
|
213
|
-
const t =
|
|
213
|
+
const t = Y(e), n = new Date(
|
|
214
214
|
Date.UTC(
|
|
215
215
|
t.getFullYear(),
|
|
216
216
|
t.getMonth(),
|
|
@@ -226,25 +226,25 @@ function Ue(e) {
|
|
|
226
226
|
function ce(e, ...t) {
|
|
227
227
|
const n = F.bind(
|
|
228
228
|
null,
|
|
229
|
-
t.find((
|
|
229
|
+
t.find((r) => typeof r == "object")
|
|
230
230
|
);
|
|
231
231
|
return t.map(n);
|
|
232
232
|
}
|
|
233
233
|
function me(e, t) {
|
|
234
|
-
const n =
|
|
234
|
+
const n = Y(e, t?.in);
|
|
235
235
|
return n.setHours(0, 0, 0, 0), n;
|
|
236
236
|
}
|
|
237
237
|
function dt(e, t, n) {
|
|
238
|
-
const [
|
|
238
|
+
const [r, o] = ce(
|
|
239
239
|
n?.in,
|
|
240
240
|
e,
|
|
241
241
|
t
|
|
242
|
-
), s = me(
|
|
242
|
+
), s = me(r), i = me(o), a = +s - Ue(s), c = +i - Ue(i);
|
|
243
243
|
return Math.round((a - c) / bn);
|
|
244
244
|
}
|
|
245
245
|
function kn(e, t) {
|
|
246
|
-
const n = ft(e, t),
|
|
247
|
-
return
|
|
246
|
+
const n = ft(e, t), r = F(e, 0);
|
|
247
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), he(r);
|
|
248
248
|
}
|
|
249
249
|
function Dn(e, t, n) {
|
|
250
250
|
return ct(e, t * 7, n);
|
|
@@ -253,77 +253,77 @@ function vn(e, t, n) {
|
|
|
253
253
|
return ut(e, t * 12, n);
|
|
254
254
|
}
|
|
255
255
|
function On(e, t) {
|
|
256
|
-
let n,
|
|
257
|
-
return e.forEach((
|
|
258
|
-
!
|
|
259
|
-
const s =
|
|
256
|
+
let n, r = t?.in;
|
|
257
|
+
return e.forEach((o) => {
|
|
258
|
+
!r && typeof o == "object" && (r = F.bind(null, o));
|
|
259
|
+
const s = Y(o, r);
|
|
260
260
|
(!n || n < s || isNaN(+s)) && (n = s);
|
|
261
|
-
}), F(
|
|
261
|
+
}), F(r, n || NaN);
|
|
262
262
|
}
|
|
263
263
|
function Wn(e, t) {
|
|
264
|
-
let n,
|
|
265
|
-
return e.forEach((
|
|
266
|
-
!
|
|
267
|
-
const s =
|
|
264
|
+
let n, r = t?.in;
|
|
265
|
+
return e.forEach((o) => {
|
|
266
|
+
!r && typeof o == "object" && (r = F.bind(null, o));
|
|
267
|
+
const s = Y(o, r);
|
|
268
268
|
(!n || n > s || isNaN(+s)) && (n = s);
|
|
269
|
-
}), F(
|
|
269
|
+
}), F(r, n || NaN);
|
|
270
270
|
}
|
|
271
271
|
function Sn(e, t, n) {
|
|
272
|
-
const [
|
|
272
|
+
const [r, o] = ce(
|
|
273
273
|
n?.in,
|
|
274
274
|
e,
|
|
275
275
|
t
|
|
276
276
|
);
|
|
277
|
-
return +me(
|
|
277
|
+
return +me(r) == +me(o);
|
|
278
278
|
}
|
|
279
279
|
function lt(e) {
|
|
280
280
|
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
281
281
|
}
|
|
282
282
|
function Cn(e) {
|
|
283
|
-
return !(!lt(e) && typeof e != "number" || isNaN(+
|
|
283
|
+
return !(!lt(e) && typeof e != "number" || isNaN(+Y(e)));
|
|
284
284
|
}
|
|
285
285
|
function Nn(e, t, n) {
|
|
286
|
-
const [
|
|
286
|
+
const [r, o] = ce(
|
|
287
287
|
n?.in,
|
|
288
288
|
e,
|
|
289
289
|
t
|
|
290
|
-
), s =
|
|
290
|
+
), s = r.getFullYear() - o.getFullYear(), i = r.getMonth() - o.getMonth();
|
|
291
291
|
return s * 12 + i;
|
|
292
292
|
}
|
|
293
293
|
function xn(e, t) {
|
|
294
|
-
const n =
|
|
295
|
-
return n.setFullYear(n.getFullYear(),
|
|
296
|
-
}
|
|
297
|
-
function Tn(e, t) {
|
|
298
|
-
const [n, o] = ce(e, t.start, t.end);
|
|
299
|
-
return { start: n, end: o };
|
|
294
|
+
const n = Y(e, t?.in), r = n.getMonth();
|
|
295
|
+
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
300
296
|
}
|
|
301
297
|
function Yn(e, t) {
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
298
|
+
const [n, r] = ce(e, t.start, t.end);
|
|
299
|
+
return { start: n, end: r };
|
|
300
|
+
}
|
|
301
|
+
function Tn(e, t) {
|
|
302
|
+
const { start: n, end: r } = Yn(t?.in, e);
|
|
303
|
+
let o = +n > +r;
|
|
304
|
+
const s = o ? +n : +r, i = o ? r : n;
|
|
305
305
|
i.setHours(0, 0, 0, 0), i.setDate(1);
|
|
306
306
|
let a = 1;
|
|
307
307
|
const c = [];
|
|
308
308
|
for (; +i <= s; )
|
|
309
309
|
c.push(F(n, i)), i.setMonth(i.getMonth() + a);
|
|
310
|
-
return
|
|
310
|
+
return o ? c.reverse() : c;
|
|
311
311
|
}
|
|
312
312
|
function En(e, t) {
|
|
313
|
-
const n =
|
|
313
|
+
const n = Y(e, t?.in);
|
|
314
314
|
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
315
315
|
}
|
|
316
316
|
function Pn(e, t) {
|
|
317
|
-
const n =
|
|
318
|
-
return n.setFullYear(
|
|
317
|
+
const n = Y(e, t?.in), r = n.getFullYear();
|
|
318
|
+
return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
|
|
319
319
|
}
|
|
320
320
|
function ht(e, t) {
|
|
321
|
-
const n =
|
|
321
|
+
const n = Y(e, t?.in);
|
|
322
322
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
323
323
|
}
|
|
324
324
|
function mt(e, t) {
|
|
325
|
-
const n = ye(),
|
|
326
|
-
return
|
|
325
|
+
const n = ye(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, o = Y(e, t?.in), s = o.getDay(), i = (s < r ? -7 : 0) + 6 - (s - r);
|
|
326
|
+
return o.setDate(o.getDate() + i), o.setHours(23, 59, 59, 999), o;
|
|
327
327
|
}
|
|
328
328
|
function _n(e, t) {
|
|
329
329
|
return mt(e, { ...t, weekStartsOn: 1 });
|
|
@@ -391,9 +391,9 @@ const Fn = {
|
|
|
391
391
|
other: "almost {{count}} years"
|
|
392
392
|
}
|
|
393
393
|
}, Bn = (e, t, n) => {
|
|
394
|
-
let
|
|
395
|
-
const
|
|
396
|
-
return typeof
|
|
394
|
+
let r;
|
|
395
|
+
const o = Fn[e];
|
|
396
|
+
return typeof o == "string" ? r = o : t === 1 ? r = o.one : r = o.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
397
397
|
};
|
|
398
398
|
function _e(e) {
|
|
399
399
|
return (t = {}) => {
|
|
@@ -436,20 +436,20 @@ const In = {
|
|
|
436
436
|
tomorrow: "'tomorrow at' p",
|
|
437
437
|
nextWeek: "eeee 'at' p",
|
|
438
438
|
other: "P"
|
|
439
|
-
}, $n = (e, t, n,
|
|
439
|
+
}, $n = (e, t, n, r) => jn[e];
|
|
440
440
|
function fe(e) {
|
|
441
441
|
return (t, n) => {
|
|
442
|
-
const
|
|
443
|
-
let
|
|
444
|
-
if (
|
|
442
|
+
const r = n?.context ? String(n.context) : "standalone";
|
|
443
|
+
let o;
|
|
444
|
+
if (r === "formatting" && e.formattingValues) {
|
|
445
445
|
const i = e.defaultFormattingWidth || e.defaultWidth, a = n?.width ? String(n.width) : i;
|
|
446
|
-
|
|
446
|
+
o = e.formattingValues[a] || e.formattingValues[i];
|
|
447
447
|
} else {
|
|
448
448
|
const i = e.defaultWidth, a = n?.width ? String(n.width) : e.defaultWidth;
|
|
449
|
-
|
|
449
|
+
o = e.values[a] || e.values[i];
|
|
450
450
|
}
|
|
451
451
|
const s = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
452
|
-
return
|
|
452
|
+
return o[s];
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
455
|
const Rn = {
|
|
@@ -503,7 +503,7 @@ const Rn = {
|
|
|
503
503
|
"Friday",
|
|
504
504
|
"Saturday"
|
|
505
505
|
]
|
|
506
|
-
},
|
|
506
|
+
}, Ln = {
|
|
507
507
|
narrow: {
|
|
508
508
|
am: "a",
|
|
509
509
|
pm: "p",
|
|
@@ -534,7 +534,7 @@ const Rn = {
|
|
|
534
534
|
evening: "evening",
|
|
535
535
|
night: "night"
|
|
536
536
|
}
|
|
537
|
-
},
|
|
537
|
+
}, Qn = {
|
|
538
538
|
narrow: {
|
|
539
539
|
am: "a",
|
|
540
540
|
pm: "p",
|
|
@@ -566,9 +566,9 @@ const Rn = {
|
|
|
566
566
|
night: "at night"
|
|
567
567
|
}
|
|
568
568
|
}, Xn = (e, t) => {
|
|
569
|
-
const n = Number(e),
|
|
570
|
-
if (
|
|
571
|
-
switch (
|
|
569
|
+
const n = Number(e), r = n % 100;
|
|
570
|
+
if (r > 20 || r < 10)
|
|
571
|
+
switch (r % 10) {
|
|
572
572
|
case 1:
|
|
573
573
|
return n + "st";
|
|
574
574
|
case 2:
|
|
@@ -597,18 +597,18 @@ const Rn = {
|
|
|
597
597
|
defaultWidth: "wide"
|
|
598
598
|
}),
|
|
599
599
|
dayPeriod: fe({
|
|
600
|
-
values:
|
|
600
|
+
values: Ln,
|
|
601
601
|
defaultWidth: "wide",
|
|
602
|
-
formattingValues:
|
|
602
|
+
formattingValues: Qn,
|
|
603
603
|
defaultFormattingWidth: "wide"
|
|
604
604
|
})
|
|
605
605
|
};
|
|
606
606
|
function de(e) {
|
|
607
607
|
return (t, n = {}) => {
|
|
608
|
-
const
|
|
608
|
+
const r = n.width, o = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], s = t.match(o);
|
|
609
609
|
if (!s)
|
|
610
610
|
return null;
|
|
611
|
-
const i = s[0], a =
|
|
611
|
+
const i = s[0], a = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(a) ? Kn(a, (u) => u.test(i)) : (
|
|
612
612
|
// [TODO] -- I challenge you to fix the type
|
|
613
613
|
Vn(a, (u) => u.test(i))
|
|
614
614
|
);
|
|
@@ -633,33 +633,33 @@ function Kn(e, t) {
|
|
|
633
633
|
}
|
|
634
634
|
function Jn(e) {
|
|
635
635
|
return (t, n = {}) => {
|
|
636
|
-
const
|
|
637
|
-
if (!
|
|
638
|
-
const
|
|
636
|
+
const r = t.match(e.matchPattern);
|
|
637
|
+
if (!r) return null;
|
|
638
|
+
const o = r[0], s = t.match(e.parsePattern);
|
|
639
639
|
if (!s) return null;
|
|
640
640
|
let i = e.valueCallback ? e.valueCallback(s[0]) : s[0];
|
|
641
641
|
i = n.valueCallback ? n.valueCallback(i) : i;
|
|
642
|
-
const a = t.slice(
|
|
642
|
+
const a = t.slice(o.length);
|
|
643
643
|
return { value: i, rest: a };
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
-
const
|
|
646
|
+
const er = /^(\d+)(th|st|nd|rd)?/i, tr = /\d+/i, nr = {
|
|
647
647
|
narrow: /^(b|a)/i,
|
|
648
648
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
649
649
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
650
|
-
},
|
|
650
|
+
}, rr = {
|
|
651
651
|
any: [/^b/i, /^(a|c)/i]
|
|
652
|
-
},
|
|
652
|
+
}, or = {
|
|
653
653
|
narrow: /^[1234]/i,
|
|
654
654
|
abbreviated: /^q[1234]/i,
|
|
655
655
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
656
|
-
},
|
|
656
|
+
}, sr = {
|
|
657
657
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
658
|
-
},
|
|
658
|
+
}, ar = {
|
|
659
659
|
narrow: /^[jfmasond]/i,
|
|
660
660
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
661
661
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
662
|
-
},
|
|
662
|
+
}, ir = {
|
|
663
663
|
narrow: [
|
|
664
664
|
/^j/i,
|
|
665
665
|
/^f/i,
|
|
@@ -688,18 +688,18 @@ const eo = /^(\d+)(th|st|nd|rd)?/i, to = /\d+/i, no = {
|
|
|
688
688
|
/^n/i,
|
|
689
689
|
/^d/i
|
|
690
690
|
]
|
|
691
|
-
},
|
|
691
|
+
}, cr = {
|
|
692
692
|
narrow: /^[smtwf]/i,
|
|
693
693
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
694
694
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
695
695
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
696
|
-
},
|
|
696
|
+
}, ur = {
|
|
697
697
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
698
698
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
699
|
-
},
|
|
699
|
+
}, fr = {
|
|
700
700
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
701
701
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
702
|
-
},
|
|
702
|
+
}, dr = {
|
|
703
703
|
any: {
|
|
704
704
|
am: /^a/i,
|
|
705
705
|
pm: /^p/i,
|
|
@@ -710,41 +710,41 @@ const eo = /^(\d+)(th|st|nd|rd)?/i, to = /\d+/i, no = {
|
|
|
710
710
|
evening: /evening/i,
|
|
711
711
|
night: /night/i
|
|
712
712
|
}
|
|
713
|
-
},
|
|
713
|
+
}, lr = {
|
|
714
714
|
ordinalNumber: Jn({
|
|
715
|
-
matchPattern:
|
|
716
|
-
parsePattern:
|
|
715
|
+
matchPattern: er,
|
|
716
|
+
parsePattern: tr,
|
|
717
717
|
valueCallback: (e) => parseInt(e, 10)
|
|
718
718
|
}),
|
|
719
719
|
era: de({
|
|
720
|
-
matchPatterns:
|
|
720
|
+
matchPatterns: nr,
|
|
721
721
|
defaultMatchWidth: "wide",
|
|
722
|
-
parsePatterns:
|
|
722
|
+
parsePatterns: rr,
|
|
723
723
|
defaultParseWidth: "any"
|
|
724
724
|
}),
|
|
725
725
|
quarter: de({
|
|
726
|
-
matchPatterns:
|
|
726
|
+
matchPatterns: or,
|
|
727
727
|
defaultMatchWidth: "wide",
|
|
728
|
-
parsePatterns:
|
|
728
|
+
parsePatterns: sr,
|
|
729
729
|
defaultParseWidth: "any",
|
|
730
730
|
valueCallback: (e) => e + 1
|
|
731
731
|
}),
|
|
732
732
|
month: de({
|
|
733
|
-
matchPatterns:
|
|
733
|
+
matchPatterns: ar,
|
|
734
734
|
defaultMatchWidth: "wide",
|
|
735
|
-
parsePatterns:
|
|
735
|
+
parsePatterns: ir,
|
|
736
736
|
defaultParseWidth: "any"
|
|
737
737
|
}),
|
|
738
738
|
day: de({
|
|
739
|
-
matchPatterns:
|
|
739
|
+
matchPatterns: cr,
|
|
740
740
|
defaultMatchWidth: "wide",
|
|
741
|
-
parsePatterns:
|
|
741
|
+
parsePatterns: ur,
|
|
742
742
|
defaultParseWidth: "any"
|
|
743
743
|
}),
|
|
744
744
|
dayPeriod: de({
|
|
745
|
-
matchPatterns:
|
|
745
|
+
matchPatterns: fr,
|
|
746
746
|
defaultMatchWidth: "any",
|
|
747
|
-
parsePatterns:
|
|
747
|
+
parsePatterns: dr,
|
|
748
748
|
defaultParseWidth: "any"
|
|
749
749
|
})
|
|
750
750
|
}, qe = {
|
|
@@ -753,45 +753,45 @@ const eo = /^(\d+)(th|st|nd|rd)?/i, to = /\d+/i, no = {
|
|
|
753
753
|
formatLong: An,
|
|
754
754
|
formatRelative: $n,
|
|
755
755
|
localize: Un,
|
|
756
|
-
match:
|
|
756
|
+
match: lr,
|
|
757
757
|
options: {
|
|
758
758
|
weekStartsOn: 0,
|
|
759
759
|
firstWeekContainsDate: 1
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
|
-
function
|
|
763
|
-
const n =
|
|
762
|
+
function hr(e, t) {
|
|
763
|
+
const n = Y(e, t?.in);
|
|
764
764
|
return dt(n, ht(n)) + 1;
|
|
765
765
|
}
|
|
766
766
|
function yt(e, t) {
|
|
767
|
-
const n =
|
|
768
|
-
return Math.round(
|
|
767
|
+
const n = Y(e, t?.in), r = +he(n) - +kn(n);
|
|
768
|
+
return Math.round(r / it) + 1;
|
|
769
769
|
}
|
|
770
770
|
function gt(e, t) {
|
|
771
|
-
const n =
|
|
772
|
-
i.setFullYear(
|
|
771
|
+
const n = Y(e, t?.in), r = n.getFullYear(), o = ye(), s = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, i = F(t?.in || e, 0);
|
|
772
|
+
i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
|
|
773
773
|
const a = ie(i, t), c = F(t?.in || e, 0);
|
|
774
|
-
c.setFullYear(
|
|
774
|
+
c.setFullYear(r, 0, s), c.setHours(0, 0, 0, 0);
|
|
775
775
|
const f = ie(c, t);
|
|
776
|
-
return +n >= +a ?
|
|
776
|
+
return +n >= +a ? r + 1 : +n >= +f ? r : r - 1;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
const n = ye(),
|
|
780
|
-
return s.setFullYear(
|
|
778
|
+
function mr(e, t) {
|
|
779
|
+
const n = ye(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, o = gt(e, t), s = F(t?.in || e, 0);
|
|
780
|
+
return s.setFullYear(o, 0, r), s.setHours(0, 0, 0, 0), ie(s, t);
|
|
781
781
|
}
|
|
782
782
|
function pt(e, t) {
|
|
783
|
-
const n =
|
|
784
|
-
return Math.round(
|
|
783
|
+
const n = Y(e, t?.in), r = +ie(n, t) - +mr(n, t);
|
|
784
|
+
return Math.round(r / it) + 1;
|
|
785
785
|
}
|
|
786
786
|
function x(e, t) {
|
|
787
|
-
const n = e < 0 ? "-" : "",
|
|
788
|
-
return n +
|
|
787
|
+
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
788
|
+
return n + r;
|
|
789
789
|
}
|
|
790
790
|
const ee = {
|
|
791
791
|
// Year
|
|
792
792
|
y(e, t) {
|
|
793
|
-
const n = e.getFullYear(),
|
|
794
|
-
return x(t === "yy" ?
|
|
793
|
+
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
794
|
+
return x(t === "yy" ? r % 100 : r, t.length);
|
|
795
795
|
},
|
|
796
796
|
// Month
|
|
797
797
|
M(e, t) {
|
|
@@ -836,10 +836,10 @@ const ee = {
|
|
|
836
836
|
},
|
|
837
837
|
// Fraction of second
|
|
838
838
|
S(e, t) {
|
|
839
|
-
const n = t.length,
|
|
840
|
-
|
|
839
|
+
const n = t.length, r = e.getMilliseconds(), o = Math.trunc(
|
|
840
|
+
r * Math.pow(10, n - 3)
|
|
841
841
|
);
|
|
842
|
-
return x(
|
|
842
|
+
return x(o, t.length);
|
|
843
843
|
}
|
|
844
844
|
}, ae = {
|
|
845
845
|
midnight: "midnight",
|
|
@@ -851,33 +851,33 @@ const ee = {
|
|
|
851
851
|
}, Ve = {
|
|
852
852
|
// Era
|
|
853
853
|
G: function(e, t, n) {
|
|
854
|
-
const
|
|
854
|
+
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
855
855
|
switch (t) {
|
|
856
856
|
// AD, BC
|
|
857
857
|
case "G":
|
|
858
858
|
case "GG":
|
|
859
859
|
case "GGG":
|
|
860
|
-
return n.era(
|
|
860
|
+
return n.era(r, { width: "abbreviated" });
|
|
861
861
|
// A, B
|
|
862
862
|
case "GGGGG":
|
|
863
|
-
return n.era(
|
|
863
|
+
return n.era(r, { width: "narrow" });
|
|
864
864
|
// Anno Domini, Before Christ
|
|
865
865
|
case "GGGG":
|
|
866
866
|
default:
|
|
867
|
-
return n.era(
|
|
867
|
+
return n.era(r, { width: "wide" });
|
|
868
868
|
}
|
|
869
869
|
},
|
|
870
870
|
// Year
|
|
871
871
|
y: function(e, t, n) {
|
|
872
872
|
if (t === "yo") {
|
|
873
|
-
const
|
|
874
|
-
return n.ordinalNumber(
|
|
873
|
+
const r = e.getFullYear(), o = r > 0 ? r : 1 - r;
|
|
874
|
+
return n.ordinalNumber(o, { unit: "year" });
|
|
875
875
|
}
|
|
876
876
|
return ee.y(e, t);
|
|
877
877
|
},
|
|
878
878
|
// Local week-numbering year
|
|
879
|
-
Y: function(e, t, n,
|
|
880
|
-
const
|
|
879
|
+
Y: function(e, t, n, r) {
|
|
880
|
+
const o = gt(e, r), s = o > 0 ? o : 1 - o;
|
|
881
881
|
if (t === "YY") {
|
|
882
882
|
const i = s % 100;
|
|
883
883
|
return x(i, 2);
|
|
@@ -904,33 +904,33 @@ const ee = {
|
|
|
904
904
|
},
|
|
905
905
|
// Quarter
|
|
906
906
|
Q: function(e, t, n) {
|
|
907
|
-
const
|
|
907
|
+
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
908
908
|
switch (t) {
|
|
909
909
|
// 1, 2, 3, 4
|
|
910
910
|
case "Q":
|
|
911
|
-
return String(
|
|
911
|
+
return String(r);
|
|
912
912
|
// 01, 02, 03, 04
|
|
913
913
|
case "QQ":
|
|
914
|
-
return x(
|
|
914
|
+
return x(r, 2);
|
|
915
915
|
// 1st, 2nd, 3rd, 4th
|
|
916
916
|
case "Qo":
|
|
917
|
-
return n.ordinalNumber(
|
|
917
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
918
918
|
// Q1, Q2, Q3, Q4
|
|
919
919
|
case "QQQ":
|
|
920
|
-
return n.quarter(
|
|
920
|
+
return n.quarter(r, {
|
|
921
921
|
width: "abbreviated",
|
|
922
922
|
context: "formatting"
|
|
923
923
|
});
|
|
924
924
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
925
925
|
case "QQQQQ":
|
|
926
|
-
return n.quarter(
|
|
926
|
+
return n.quarter(r, {
|
|
927
927
|
width: "narrow",
|
|
928
928
|
context: "formatting"
|
|
929
929
|
});
|
|
930
930
|
// 1st quarter, 2nd quarter, ...
|
|
931
931
|
case "QQQQ":
|
|
932
932
|
default:
|
|
933
|
-
return n.quarter(
|
|
933
|
+
return n.quarter(r, {
|
|
934
934
|
width: "wide",
|
|
935
935
|
context: "formatting"
|
|
936
936
|
});
|
|
@@ -938,33 +938,33 @@ const ee = {
|
|
|
938
938
|
},
|
|
939
939
|
// Stand-alone quarter
|
|
940
940
|
q: function(e, t, n) {
|
|
941
|
-
const
|
|
941
|
+
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
942
942
|
switch (t) {
|
|
943
943
|
// 1, 2, 3, 4
|
|
944
944
|
case "q":
|
|
945
|
-
return String(
|
|
945
|
+
return String(r);
|
|
946
946
|
// 01, 02, 03, 04
|
|
947
947
|
case "qq":
|
|
948
|
-
return x(
|
|
948
|
+
return x(r, 2);
|
|
949
949
|
// 1st, 2nd, 3rd, 4th
|
|
950
950
|
case "qo":
|
|
951
|
-
return n.ordinalNumber(
|
|
951
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
952
952
|
// Q1, Q2, Q3, Q4
|
|
953
953
|
case "qqq":
|
|
954
|
-
return n.quarter(
|
|
954
|
+
return n.quarter(r, {
|
|
955
955
|
width: "abbreviated",
|
|
956
956
|
context: "standalone"
|
|
957
957
|
});
|
|
958
958
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
959
959
|
case "qqqqq":
|
|
960
|
-
return n.quarter(
|
|
960
|
+
return n.quarter(r, {
|
|
961
961
|
width: "narrow",
|
|
962
962
|
context: "standalone"
|
|
963
963
|
});
|
|
964
964
|
// 1st quarter, 2nd quarter, ...
|
|
965
965
|
case "qqqq":
|
|
966
966
|
default:
|
|
967
|
-
return n.quarter(
|
|
967
|
+
return n.quarter(r, {
|
|
968
968
|
width: "wide",
|
|
969
969
|
context: "standalone"
|
|
970
970
|
});
|
|
@@ -972,72 +972,72 @@ const ee = {
|
|
|
972
972
|
},
|
|
973
973
|
// Month
|
|
974
974
|
M: function(e, t, n) {
|
|
975
|
-
const
|
|
975
|
+
const r = e.getMonth();
|
|
976
976
|
switch (t) {
|
|
977
977
|
case "M":
|
|
978
978
|
case "MM":
|
|
979
979
|
return ee.M(e, t);
|
|
980
980
|
// 1st, 2nd, ..., 12th
|
|
981
981
|
case "Mo":
|
|
982
|
-
return n.ordinalNumber(
|
|
982
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
983
983
|
// Jan, Feb, ..., Dec
|
|
984
984
|
case "MMM":
|
|
985
|
-
return n.month(
|
|
985
|
+
return n.month(r, {
|
|
986
986
|
width: "abbreviated",
|
|
987
987
|
context: "formatting"
|
|
988
988
|
});
|
|
989
989
|
// J, F, ..., D
|
|
990
990
|
case "MMMMM":
|
|
991
|
-
return n.month(
|
|
991
|
+
return n.month(r, {
|
|
992
992
|
width: "narrow",
|
|
993
993
|
context: "formatting"
|
|
994
994
|
});
|
|
995
995
|
// January, February, ..., December
|
|
996
996
|
case "MMMM":
|
|
997
997
|
default:
|
|
998
|
-
return n.month(
|
|
998
|
+
return n.month(r, { width: "wide", context: "formatting" });
|
|
999
999
|
}
|
|
1000
1000
|
},
|
|
1001
1001
|
// Stand-alone month
|
|
1002
1002
|
L: function(e, t, n) {
|
|
1003
|
-
const
|
|
1003
|
+
const r = e.getMonth();
|
|
1004
1004
|
switch (t) {
|
|
1005
1005
|
// 1, 2, ..., 12
|
|
1006
1006
|
case "L":
|
|
1007
|
-
return String(
|
|
1007
|
+
return String(r + 1);
|
|
1008
1008
|
// 01, 02, ..., 12
|
|
1009
1009
|
case "LL":
|
|
1010
|
-
return x(
|
|
1010
|
+
return x(r + 1, 2);
|
|
1011
1011
|
// 1st, 2nd, ..., 12th
|
|
1012
1012
|
case "Lo":
|
|
1013
|
-
return n.ordinalNumber(
|
|
1013
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
1014
1014
|
// Jan, Feb, ..., Dec
|
|
1015
1015
|
case "LLL":
|
|
1016
|
-
return n.month(
|
|
1016
|
+
return n.month(r, {
|
|
1017
1017
|
width: "abbreviated",
|
|
1018
1018
|
context: "standalone"
|
|
1019
1019
|
});
|
|
1020
1020
|
// J, F, ..., D
|
|
1021
1021
|
case "LLLLL":
|
|
1022
|
-
return n.month(
|
|
1022
|
+
return n.month(r, {
|
|
1023
1023
|
width: "narrow",
|
|
1024
1024
|
context: "standalone"
|
|
1025
1025
|
});
|
|
1026
1026
|
// January, February, ..., December
|
|
1027
1027
|
case "LLLL":
|
|
1028
1028
|
default:
|
|
1029
|
-
return n.month(
|
|
1029
|
+
return n.month(r, { width: "wide", context: "standalone" });
|
|
1030
1030
|
}
|
|
1031
1031
|
},
|
|
1032
1032
|
// Local week of year
|
|
1033
|
-
w: function(e, t, n,
|
|
1034
|
-
const
|
|
1035
|
-
return t === "wo" ? n.ordinalNumber(
|
|
1033
|
+
w: function(e, t, n, r) {
|
|
1034
|
+
const o = pt(e, r);
|
|
1035
|
+
return t === "wo" ? n.ordinalNumber(o, { unit: "week" }) : x(o, t.length);
|
|
1036
1036
|
},
|
|
1037
1037
|
// ISO week of year
|
|
1038
1038
|
I: function(e, t, n) {
|
|
1039
|
-
const
|
|
1040
|
-
return t === "Io" ? n.ordinalNumber(
|
|
1039
|
+
const r = yt(e);
|
|
1040
|
+
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : x(r, t.length);
|
|
1041
1041
|
},
|
|
1042
1042
|
// Day of the month
|
|
1043
1043
|
d: function(e, t, n) {
|
|
@@ -1045,45 +1045,45 @@ const ee = {
|
|
|
1045
1045
|
},
|
|
1046
1046
|
// Day of year
|
|
1047
1047
|
D: function(e, t, n) {
|
|
1048
|
-
const
|
|
1049
|
-
return t === "Do" ? n.ordinalNumber(
|
|
1048
|
+
const r = hr(e);
|
|
1049
|
+
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : x(r, t.length);
|
|
1050
1050
|
},
|
|
1051
1051
|
// Day of week
|
|
1052
1052
|
E: function(e, t, n) {
|
|
1053
|
-
const
|
|
1053
|
+
const r = e.getDay();
|
|
1054
1054
|
switch (t) {
|
|
1055
1055
|
// Tue
|
|
1056
1056
|
case "E":
|
|
1057
1057
|
case "EE":
|
|
1058
1058
|
case "EEE":
|
|
1059
|
-
return n.day(
|
|
1059
|
+
return n.day(r, {
|
|
1060
1060
|
width: "abbreviated",
|
|
1061
1061
|
context: "formatting"
|
|
1062
1062
|
});
|
|
1063
1063
|
// T
|
|
1064
1064
|
case "EEEEE":
|
|
1065
|
-
return n.day(
|
|
1065
|
+
return n.day(r, {
|
|
1066
1066
|
width: "narrow",
|
|
1067
1067
|
context: "formatting"
|
|
1068
1068
|
});
|
|
1069
1069
|
// Tu
|
|
1070
1070
|
case "EEEEEE":
|
|
1071
|
-
return n.day(
|
|
1071
|
+
return n.day(r, {
|
|
1072
1072
|
width: "short",
|
|
1073
1073
|
context: "formatting"
|
|
1074
1074
|
});
|
|
1075
1075
|
// Tuesday
|
|
1076
1076
|
case "EEEE":
|
|
1077
1077
|
default:
|
|
1078
|
-
return n.day(
|
|
1078
|
+
return n.day(r, {
|
|
1079
1079
|
width: "wide",
|
|
1080
1080
|
context: "formatting"
|
|
1081
1081
|
});
|
|
1082
1082
|
}
|
|
1083
1083
|
},
|
|
1084
1084
|
// Local day of week
|
|
1085
|
-
e: function(e, t, n,
|
|
1086
|
-
const
|
|
1085
|
+
e: function(e, t, n, r) {
|
|
1086
|
+
const o = e.getDay(), s = (o - r.weekStartsOn + 8) % 7 || 7;
|
|
1087
1087
|
switch (t) {
|
|
1088
1088
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1089
1089
|
case "e":
|
|
@@ -1095,34 +1095,34 @@ const ee = {
|
|
|
1095
1095
|
case "eo":
|
|
1096
1096
|
return n.ordinalNumber(s, { unit: "day" });
|
|
1097
1097
|
case "eee":
|
|
1098
|
-
return n.day(
|
|
1098
|
+
return n.day(o, {
|
|
1099
1099
|
width: "abbreviated",
|
|
1100
1100
|
context: "formatting"
|
|
1101
1101
|
});
|
|
1102
1102
|
// T
|
|
1103
1103
|
case "eeeee":
|
|
1104
|
-
return n.day(
|
|
1104
|
+
return n.day(o, {
|
|
1105
1105
|
width: "narrow",
|
|
1106
1106
|
context: "formatting"
|
|
1107
1107
|
});
|
|
1108
1108
|
// Tu
|
|
1109
1109
|
case "eeeeee":
|
|
1110
|
-
return n.day(
|
|
1110
|
+
return n.day(o, {
|
|
1111
1111
|
width: "short",
|
|
1112
1112
|
context: "formatting"
|
|
1113
1113
|
});
|
|
1114
1114
|
// Tuesday
|
|
1115
1115
|
case "eeee":
|
|
1116
1116
|
default:
|
|
1117
|
-
return n.day(
|
|
1117
|
+
return n.day(o, {
|
|
1118
1118
|
width: "wide",
|
|
1119
1119
|
context: "formatting"
|
|
1120
1120
|
});
|
|
1121
1121
|
}
|
|
1122
1122
|
},
|
|
1123
1123
|
// Stand-alone local day of week
|
|
1124
|
-
c: function(e, t, n,
|
|
1125
|
-
const
|
|
1124
|
+
c: function(e, t, n, r) {
|
|
1125
|
+
const o = e.getDay(), s = (o - r.weekStartsOn + 8) % 7 || 7;
|
|
1126
1126
|
switch (t) {
|
|
1127
1127
|
// Numerical value (same as in `e`)
|
|
1128
1128
|
case "c":
|
|
@@ -1134,26 +1134,26 @@ const ee = {
|
|
|
1134
1134
|
case "co":
|
|
1135
1135
|
return n.ordinalNumber(s, { unit: "day" });
|
|
1136
1136
|
case "ccc":
|
|
1137
|
-
return n.day(
|
|
1137
|
+
return n.day(o, {
|
|
1138
1138
|
width: "abbreviated",
|
|
1139
1139
|
context: "standalone"
|
|
1140
1140
|
});
|
|
1141
1141
|
// T
|
|
1142
1142
|
case "ccccc":
|
|
1143
|
-
return n.day(
|
|
1143
|
+
return n.day(o, {
|
|
1144
1144
|
width: "narrow",
|
|
1145
1145
|
context: "standalone"
|
|
1146
1146
|
});
|
|
1147
1147
|
// Tu
|
|
1148
1148
|
case "cccccc":
|
|
1149
|
-
return n.day(
|
|
1149
|
+
return n.day(o, {
|
|
1150
1150
|
width: "short",
|
|
1151
1151
|
context: "standalone"
|
|
1152
1152
|
});
|
|
1153
1153
|
// Tuesday
|
|
1154
1154
|
case "cccc":
|
|
1155
1155
|
default:
|
|
1156
|
-
return n.day(
|
|
1156
|
+
return n.day(o, {
|
|
1157
1157
|
width: "wide",
|
|
1158
1158
|
context: "standalone"
|
|
1159
1159
|
});
|
|
@@ -1161,39 +1161,39 @@ const ee = {
|
|
|
1161
1161
|
},
|
|
1162
1162
|
// ISO day of week
|
|
1163
1163
|
i: function(e, t, n) {
|
|
1164
|
-
const
|
|
1164
|
+
const r = e.getDay(), o = r === 0 ? 7 : r;
|
|
1165
1165
|
switch (t) {
|
|
1166
1166
|
// 2
|
|
1167
1167
|
case "i":
|
|
1168
|
-
return String(
|
|
1168
|
+
return String(o);
|
|
1169
1169
|
// 02
|
|
1170
1170
|
case "ii":
|
|
1171
|
-
return x(
|
|
1171
|
+
return x(o, t.length);
|
|
1172
1172
|
// 2nd
|
|
1173
1173
|
case "io":
|
|
1174
|
-
return n.ordinalNumber(
|
|
1174
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
1175
1175
|
// Tue
|
|
1176
1176
|
case "iii":
|
|
1177
|
-
return n.day(
|
|
1177
|
+
return n.day(r, {
|
|
1178
1178
|
width: "abbreviated",
|
|
1179
1179
|
context: "formatting"
|
|
1180
1180
|
});
|
|
1181
1181
|
// T
|
|
1182
1182
|
case "iiiii":
|
|
1183
|
-
return n.day(
|
|
1183
|
+
return n.day(r, {
|
|
1184
1184
|
width: "narrow",
|
|
1185
1185
|
context: "formatting"
|
|
1186
1186
|
});
|
|
1187
1187
|
// Tu
|
|
1188
1188
|
case "iiiiii":
|
|
1189
|
-
return n.day(
|
|
1189
|
+
return n.day(r, {
|
|
1190
1190
|
width: "short",
|
|
1191
1191
|
context: "formatting"
|
|
1192
1192
|
});
|
|
1193
1193
|
// Tuesday
|
|
1194
1194
|
case "iiii":
|
|
1195
1195
|
default:
|
|
1196
|
-
return n.day(
|
|
1196
|
+
return n.day(r, {
|
|
1197
1197
|
width: "wide",
|
|
1198
1198
|
context: "formatting"
|
|
1199
1199
|
});
|
|
@@ -1201,27 +1201,27 @@ const ee = {
|
|
|
1201
1201
|
},
|
|
1202
1202
|
// AM or PM
|
|
1203
1203
|
a: function(e, t, n) {
|
|
1204
|
-
const
|
|
1204
|
+
const o = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1205
1205
|
switch (t) {
|
|
1206
1206
|
case "a":
|
|
1207
1207
|
case "aa":
|
|
1208
|
-
return n.dayPeriod(
|
|
1208
|
+
return n.dayPeriod(o, {
|
|
1209
1209
|
width: "abbreviated",
|
|
1210
1210
|
context: "formatting"
|
|
1211
1211
|
});
|
|
1212
1212
|
case "aaa":
|
|
1213
|
-
return n.dayPeriod(
|
|
1213
|
+
return n.dayPeriod(o, {
|
|
1214
1214
|
width: "abbreviated",
|
|
1215
1215
|
context: "formatting"
|
|
1216
1216
|
}).toLowerCase();
|
|
1217
1217
|
case "aaaaa":
|
|
1218
|
-
return n.dayPeriod(
|
|
1218
|
+
return n.dayPeriod(o, {
|
|
1219
1219
|
width: "narrow",
|
|
1220
1220
|
context: "formatting"
|
|
1221
1221
|
});
|
|
1222
1222
|
case "aaaa":
|
|
1223
1223
|
default:
|
|
1224
|
-
return n.dayPeriod(
|
|
1224
|
+
return n.dayPeriod(o, {
|
|
1225
1225
|
width: "wide",
|
|
1226
1226
|
context: "formatting"
|
|
1227
1227
|
});
|
|
@@ -1229,28 +1229,28 @@ const ee = {
|
|
|
1229
1229
|
},
|
|
1230
1230
|
// AM, PM, midnight, noon
|
|
1231
1231
|
b: function(e, t, n) {
|
|
1232
|
-
const
|
|
1233
|
-
let
|
|
1234
|
-
switch (
|
|
1232
|
+
const r = e.getHours();
|
|
1233
|
+
let o;
|
|
1234
|
+
switch (r === 12 ? o = ae.noon : r === 0 ? o = ae.midnight : o = r / 12 >= 1 ? "pm" : "am", t) {
|
|
1235
1235
|
case "b":
|
|
1236
1236
|
case "bb":
|
|
1237
|
-
return n.dayPeriod(
|
|
1237
|
+
return n.dayPeriod(o, {
|
|
1238
1238
|
width: "abbreviated",
|
|
1239
1239
|
context: "formatting"
|
|
1240
1240
|
});
|
|
1241
1241
|
case "bbb":
|
|
1242
|
-
return n.dayPeriod(
|
|
1242
|
+
return n.dayPeriod(o, {
|
|
1243
1243
|
width: "abbreviated",
|
|
1244
1244
|
context: "formatting"
|
|
1245
1245
|
}).toLowerCase();
|
|
1246
1246
|
case "bbbbb":
|
|
1247
|
-
return n.dayPeriod(
|
|
1247
|
+
return n.dayPeriod(o, {
|
|
1248
1248
|
width: "narrow",
|
|
1249
1249
|
context: "formatting"
|
|
1250
1250
|
});
|
|
1251
1251
|
case "bbbb":
|
|
1252
1252
|
default:
|
|
1253
|
-
return n.dayPeriod(
|
|
1253
|
+
return n.dayPeriod(o, {
|
|
1254
1254
|
width: "wide",
|
|
1255
1255
|
context: "formatting"
|
|
1256
1256
|
});
|
|
@@ -1258,24 +1258,24 @@ const ee = {
|
|
|
1258
1258
|
},
|
|
1259
1259
|
// in the morning, in the afternoon, in the evening, at night
|
|
1260
1260
|
B: function(e, t, n) {
|
|
1261
|
-
const
|
|
1262
|
-
let
|
|
1263
|
-
switch (
|
|
1261
|
+
const r = e.getHours();
|
|
1262
|
+
let o;
|
|
1263
|
+
switch (r >= 17 ? o = ae.evening : r >= 12 ? o = ae.afternoon : r >= 4 ? o = ae.morning : o = ae.night, t) {
|
|
1264
1264
|
case "B":
|
|
1265
1265
|
case "BB":
|
|
1266
1266
|
case "BBB":
|
|
1267
|
-
return n.dayPeriod(
|
|
1267
|
+
return n.dayPeriod(o, {
|
|
1268
1268
|
width: "abbreviated",
|
|
1269
1269
|
context: "formatting"
|
|
1270
1270
|
});
|
|
1271
1271
|
case "BBBBB":
|
|
1272
|
-
return n.dayPeriod(
|
|
1272
|
+
return n.dayPeriod(o, {
|
|
1273
1273
|
width: "narrow",
|
|
1274
1274
|
context: "formatting"
|
|
1275
1275
|
});
|
|
1276
1276
|
case "BBBB":
|
|
1277
1277
|
default:
|
|
1278
|
-
return n.dayPeriod(
|
|
1278
|
+
return n.dayPeriod(o, {
|
|
1279
1279
|
width: "wide",
|
|
1280
1280
|
context: "formatting"
|
|
1281
1281
|
});
|
|
@@ -1284,8 +1284,8 @@ const ee = {
|
|
|
1284
1284
|
// Hour [1-12]
|
|
1285
1285
|
h: function(e, t, n) {
|
|
1286
1286
|
if (t === "ho") {
|
|
1287
|
-
let
|
|
1288
|
-
return
|
|
1287
|
+
let r = e.getHours() % 12;
|
|
1288
|
+
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1289
1289
|
}
|
|
1290
1290
|
return ee.h(e, t);
|
|
1291
1291
|
},
|
|
@@ -1295,13 +1295,13 @@ const ee = {
|
|
|
1295
1295
|
},
|
|
1296
1296
|
// Hour [0-11]
|
|
1297
1297
|
K: function(e, t, n) {
|
|
1298
|
-
const
|
|
1299
|
-
return t === "Ko" ? n.ordinalNumber(
|
|
1298
|
+
const r = e.getHours() % 12;
|
|
1299
|
+
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : x(r, t.length);
|
|
1300
1300
|
},
|
|
1301
1301
|
// Hour [1-24]
|
|
1302
1302
|
k: function(e, t, n) {
|
|
1303
|
-
let
|
|
1304
|
-
return
|
|
1303
|
+
let r = e.getHours();
|
|
1304
|
+
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : x(r, t.length);
|
|
1305
1305
|
},
|
|
1306
1306
|
// Minute
|
|
1307
1307
|
m: function(e, t, n) {
|
|
@@ -1317,19 +1317,19 @@ const ee = {
|
|
|
1317
1317
|
},
|
|
1318
1318
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1319
1319
|
X: function(e, t, n) {
|
|
1320
|
-
const
|
|
1321
|
-
if (
|
|
1320
|
+
const r = e.getTimezoneOffset();
|
|
1321
|
+
if (r === 0)
|
|
1322
1322
|
return "Z";
|
|
1323
1323
|
switch (t) {
|
|
1324
1324
|
// Hours and optional minutes
|
|
1325
1325
|
case "X":
|
|
1326
|
-
return Je(
|
|
1326
|
+
return Je(r);
|
|
1327
1327
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1328
1328
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1329
1329
|
// so this token always has the same output as `XX`
|
|
1330
1330
|
case "XXXX":
|
|
1331
1331
|
case "XX":
|
|
1332
|
-
return te(
|
|
1332
|
+
return te(r);
|
|
1333
1333
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1334
1334
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1335
1335
|
// so this token always has the same output as `XXX`
|
|
@@ -1337,22 +1337,22 @@ const ee = {
|
|
|
1337
1337
|
case "XXX":
|
|
1338
1338
|
// Hours and minutes with `:` delimiter
|
|
1339
1339
|
default:
|
|
1340
|
-
return te(
|
|
1340
|
+
return te(r, ":");
|
|
1341
1341
|
}
|
|
1342
1342
|
},
|
|
1343
1343
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1344
1344
|
x: function(e, t, n) {
|
|
1345
|
-
const
|
|
1345
|
+
const r = e.getTimezoneOffset();
|
|
1346
1346
|
switch (t) {
|
|
1347
1347
|
// Hours and optional minutes
|
|
1348
1348
|
case "x":
|
|
1349
|
-
return Je(
|
|
1349
|
+
return Je(r);
|
|
1350
1350
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1351
1351
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1352
1352
|
// so this token always has the same output as `xx`
|
|
1353
1353
|
case "xxxx":
|
|
1354
1354
|
case "xx":
|
|
1355
|
-
return te(
|
|
1355
|
+
return te(r);
|
|
1356
1356
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1357
1357
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1358
1358
|
// so this token always has the same output as `xxx`
|
|
@@ -1360,43 +1360,43 @@ const ee = {
|
|
|
1360
1360
|
case "xxx":
|
|
1361
1361
|
// Hours and minutes with `:` delimiter
|
|
1362
1362
|
default:
|
|
1363
|
-
return te(
|
|
1363
|
+
return te(r, ":");
|
|
1364
1364
|
}
|
|
1365
1365
|
},
|
|
1366
1366
|
// Timezone (GMT)
|
|
1367
1367
|
O: function(e, t, n) {
|
|
1368
|
-
const
|
|
1368
|
+
const r = e.getTimezoneOffset();
|
|
1369
1369
|
switch (t) {
|
|
1370
1370
|
// Short
|
|
1371
1371
|
case "O":
|
|
1372
1372
|
case "OO":
|
|
1373
1373
|
case "OOO":
|
|
1374
|
-
return "GMT" + Ke(
|
|
1374
|
+
return "GMT" + Ke(r, ":");
|
|
1375
1375
|
// Long
|
|
1376
1376
|
case "OOOO":
|
|
1377
1377
|
default:
|
|
1378
|
-
return "GMT" + te(
|
|
1378
|
+
return "GMT" + te(r, ":");
|
|
1379
1379
|
}
|
|
1380
1380
|
},
|
|
1381
1381
|
// Timezone (specific non-location)
|
|
1382
1382
|
z: function(e, t, n) {
|
|
1383
|
-
const
|
|
1383
|
+
const r = e.getTimezoneOffset();
|
|
1384
1384
|
switch (t) {
|
|
1385
1385
|
// Short
|
|
1386
1386
|
case "z":
|
|
1387
1387
|
case "zz":
|
|
1388
1388
|
case "zzz":
|
|
1389
|
-
return "GMT" + Ke(
|
|
1389
|
+
return "GMT" + Ke(r, ":");
|
|
1390
1390
|
// Long
|
|
1391
1391
|
case "zzzz":
|
|
1392
1392
|
default:
|
|
1393
|
-
return "GMT" + te(
|
|
1393
|
+
return "GMT" + te(r, ":");
|
|
1394
1394
|
}
|
|
1395
1395
|
},
|
|
1396
1396
|
// Seconds timestamp
|
|
1397
1397
|
t: function(e, t, n) {
|
|
1398
|
-
const
|
|
1399
|
-
return x(
|
|
1398
|
+
const r = Math.trunc(+e / 1e3);
|
|
1399
|
+
return x(r, t.length);
|
|
1400
1400
|
},
|
|
1401
1401
|
// Milliseconds timestamp
|
|
1402
1402
|
T: function(e, t, n) {
|
|
@@ -1404,15 +1404,15 @@ const ee = {
|
|
|
1404
1404
|
}
|
|
1405
1405
|
};
|
|
1406
1406
|
function Ke(e, t = "") {
|
|
1407
|
-
const n = e > 0 ? "-" : "+",
|
|
1408
|
-
return s === 0 ? n + String(
|
|
1407
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = Math.trunc(r / 60), s = r % 60;
|
|
1408
|
+
return s === 0 ? n + String(o) : n + String(o) + t + x(s, 2);
|
|
1409
1409
|
}
|
|
1410
1410
|
function Je(e, t) {
|
|
1411
1411
|
return e % 60 === 0 ? (e > 0 ? "-" : "+") + x(Math.abs(e) / 60, 2) : te(e, t);
|
|
1412
1412
|
}
|
|
1413
1413
|
function te(e, t = "") {
|
|
1414
|
-
const n = e > 0 ? "-" : "+",
|
|
1415
|
-
return n +
|
|
1414
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = x(Math.trunc(r / 60), 2), s = x(r % 60, 2);
|
|
1415
|
+
return n + o + t + s;
|
|
1416
1416
|
}
|
|
1417
1417
|
const et = (e, t) => {
|
|
1418
1418
|
switch (e) {
|
|
@@ -1438,12 +1438,12 @@ const et = (e, t) => {
|
|
|
1438
1438
|
default:
|
|
1439
1439
|
return t.time({ width: "full" });
|
|
1440
1440
|
}
|
|
1441
|
-
},
|
|
1442
|
-
const n = e.match(/(P+)(p+)?/) || [],
|
|
1443
|
-
if (!
|
|
1441
|
+
}, yr = (e, t) => {
|
|
1442
|
+
const n = e.match(/(P+)(p+)?/) || [], r = n[1], o = n[2];
|
|
1443
|
+
if (!o)
|
|
1444
1444
|
return et(e, t);
|
|
1445
1445
|
let s;
|
|
1446
|
-
switch (
|
|
1446
|
+
switch (r) {
|
|
1447
1447
|
case "P":
|
|
1448
1448
|
s = t.dateTime({ width: "short" });
|
|
1449
1449
|
break;
|
|
@@ -1458,125 +1458,125 @@ const et = (e, t) => {
|
|
|
1458
1458
|
s = t.dateTime({ width: "full" });
|
|
1459
1459
|
break;
|
|
1460
1460
|
}
|
|
1461
|
-
return s.replace("{{date}}", et(
|
|
1462
|
-
},
|
|
1461
|
+
return s.replace("{{date}}", et(r, t)).replace("{{time}}", wt(o, t));
|
|
1462
|
+
}, gr = {
|
|
1463
1463
|
p: wt,
|
|
1464
|
-
P:
|
|
1465
|
-
},
|
|
1466
|
-
function
|
|
1467
|
-
return
|
|
1464
|
+
P: yr
|
|
1465
|
+
}, pr = /^D+$/, wr = /^Y+$/, br = ["D", "DD", "YY", "YYYY"];
|
|
1466
|
+
function Mr(e) {
|
|
1467
|
+
return pr.test(e);
|
|
1468
1468
|
}
|
|
1469
|
-
function
|
|
1470
|
-
return
|
|
1469
|
+
function kr(e) {
|
|
1470
|
+
return wr.test(e);
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1473
|
-
const
|
|
1474
|
-
if (console.warn(
|
|
1472
|
+
function Dr(e, t, n) {
|
|
1473
|
+
const r = vr(e, t, n);
|
|
1474
|
+
if (console.warn(r), br.includes(e)) throw new RangeError(r);
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1477
|
-
const
|
|
1478
|
-
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${
|
|
1476
|
+
function vr(e, t, n) {
|
|
1477
|
+
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1478
|
+
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1479
1479
|
}
|
|
1480
|
-
const
|
|
1481
|
-
function
|
|
1482
|
-
const
|
|
1480
|
+
const Or = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Wr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Sr = /^'([^]*?)'?$/, Cr = /''/g, Nr = /[a-zA-Z]/;
|
|
1481
|
+
function xr(e, t, n) {
|
|
1482
|
+
const r = ye(), o = n?.locale ?? r.locale ?? qe, s = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, i = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = Y(e, n?.in);
|
|
1483
1483
|
if (!Cn(a))
|
|
1484
1484
|
throw new RangeError("Invalid time value");
|
|
1485
|
-
let c = t.match(
|
|
1485
|
+
let c = t.match(Wr).map((d) => {
|
|
1486
1486
|
const u = d[0];
|
|
1487
1487
|
if (u === "p" || u === "P") {
|
|
1488
|
-
const h =
|
|
1489
|
-
return h(d,
|
|
1488
|
+
const h = gr[u];
|
|
1489
|
+
return h(d, o.formatLong);
|
|
1490
1490
|
}
|
|
1491
1491
|
return d;
|
|
1492
|
-
}).join("").match(
|
|
1492
|
+
}).join("").match(Or).map((d) => {
|
|
1493
1493
|
if (d === "''")
|
|
1494
1494
|
return { isToken: !1, value: "'" };
|
|
1495
1495
|
const u = d[0];
|
|
1496
1496
|
if (u === "'")
|
|
1497
|
-
return { isToken: !1, value:
|
|
1497
|
+
return { isToken: !1, value: Yr(d) };
|
|
1498
1498
|
if (Ve[u])
|
|
1499
1499
|
return { isToken: !0, value: d };
|
|
1500
|
-
if (u.match(
|
|
1500
|
+
if (u.match(Nr))
|
|
1501
1501
|
throw new RangeError(
|
|
1502
1502
|
"Format string contains an unescaped latin alphabet character `" + u + "`"
|
|
1503
1503
|
);
|
|
1504
1504
|
return { isToken: !1, value: d };
|
|
1505
1505
|
});
|
|
1506
|
-
|
|
1506
|
+
o.localize.preprocessor && (c = o.localize.preprocessor(a, c));
|
|
1507
1507
|
const f = {
|
|
1508
1508
|
firstWeekContainsDate: s,
|
|
1509
1509
|
weekStartsOn: i,
|
|
1510
|
-
locale:
|
|
1510
|
+
locale: o
|
|
1511
1511
|
};
|
|
1512
1512
|
return c.map((d) => {
|
|
1513
1513
|
if (!d.isToken) return d.value;
|
|
1514
1514
|
const u = d.value;
|
|
1515
|
-
(!n?.useAdditionalWeekYearTokens &&
|
|
1515
|
+
(!n?.useAdditionalWeekYearTokens && kr(u) || !n?.useAdditionalDayOfYearTokens && Mr(u)) && Dr(u, t, String(e));
|
|
1516
1516
|
const h = Ve[u[0]];
|
|
1517
|
-
return h(a, u,
|
|
1517
|
+
return h(a, u, o.localize, f);
|
|
1518
1518
|
}).join("");
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1521
|
-
const t = e.match(
|
|
1522
|
-
return t ? t[1].replace(
|
|
1520
|
+
function Yr(e) {
|
|
1521
|
+
const t = e.match(Sr);
|
|
1522
|
+
return t ? t[1].replace(Cr, "'") : e;
|
|
1523
1523
|
}
|
|
1524
|
-
function
|
|
1525
|
-
const n =
|
|
1526
|
-
return s.setFullYear(
|
|
1524
|
+
function Tr(e, t) {
|
|
1525
|
+
const n = Y(e, t?.in), r = n.getFullYear(), o = n.getMonth(), s = F(n, 0);
|
|
1526
|
+
return s.setFullYear(r, o + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1529
|
-
return
|
|
1528
|
+
function Er(e, t) {
|
|
1529
|
+
return Y(e, t?.in).getMonth();
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1532
|
-
return
|
|
1531
|
+
function Pr(e, t) {
|
|
1532
|
+
return Y(e, t?.in).getFullYear();
|
|
1533
1533
|
}
|
|
1534
|
-
function
|
|
1535
|
-
return +
|
|
1534
|
+
function _r(e, t) {
|
|
1535
|
+
return +Y(e) > +Y(t);
|
|
1536
1536
|
}
|
|
1537
|
-
function
|
|
1538
|
-
return +
|
|
1537
|
+
function Fr(e, t) {
|
|
1538
|
+
return +Y(e) < +Y(t);
|
|
1539
1539
|
}
|
|
1540
|
-
function
|
|
1541
|
-
const [
|
|
1540
|
+
function Br(e, t, n) {
|
|
1541
|
+
const [r, o] = ce(
|
|
1542
1542
|
n?.in,
|
|
1543
1543
|
e,
|
|
1544
1544
|
t
|
|
1545
1545
|
);
|
|
1546
|
-
return
|
|
1546
|
+
return r.getFullYear() === o.getFullYear() && r.getMonth() === o.getMonth();
|
|
1547
1547
|
}
|
|
1548
|
-
function
|
|
1549
|
-
const [
|
|
1548
|
+
function Ir(e, t, n) {
|
|
1549
|
+
const [r, o] = ce(
|
|
1550
1550
|
n?.in,
|
|
1551
1551
|
e,
|
|
1552
1552
|
t
|
|
1553
1553
|
);
|
|
1554
|
-
return
|
|
1554
|
+
return r.getFullYear() === o.getFullYear();
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const
|
|
1558
|
-
i.setFullYear(
|
|
1559
|
-
const a =
|
|
1560
|
-
return
|
|
1556
|
+
function Hr(e, t, n) {
|
|
1557
|
+
const r = Y(e, n?.in), o = r.getFullYear(), s = r.getDate(), i = F(e, 0);
|
|
1558
|
+
i.setFullYear(o, t, 15), i.setHours(0, 0, 0, 0);
|
|
1559
|
+
const a = Tr(i);
|
|
1560
|
+
return r.setMonth(t, Math.min(s, a)), r;
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1563
|
-
const
|
|
1564
|
-
return isNaN(+
|
|
1562
|
+
function qr(e, t, n) {
|
|
1563
|
+
const r = Y(e, n?.in);
|
|
1564
|
+
return isNaN(+r) ? F(e, NaN) : (r.setFullYear(t), r);
|
|
1565
1565
|
}
|
|
1566
|
-
const tt = 5,
|
|
1567
|
-
function
|
|
1568
|
-
const n = t.startOfMonth(e),
|
|
1569
|
-
return t.getMonth(e) === t.getMonth(s) ? tt :
|
|
1566
|
+
const tt = 5, Ar = 4;
|
|
1567
|
+
function jr(e, t) {
|
|
1568
|
+
const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, o = t.addDays(e, -r + 1), s = t.addDays(o, tt * 7 - 1);
|
|
1569
|
+
return t.getMonth(e) === t.getMonth(s) ? tt : Ar;
|
|
1570
1570
|
}
|
|
1571
1571
|
function bt(e, t) {
|
|
1572
|
-
const n = t.startOfMonth(e),
|
|
1573
|
-
return
|
|
1572
|
+
const n = t.startOfMonth(e), r = n.getDay();
|
|
1573
|
+
return r === 1 ? n : r === 0 ? t.addDays(n, -1 * 6) : t.addDays(n, -1 * (r - 1));
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
const n = bt(e, t),
|
|
1577
|
-
return t.addDays(n,
|
|
1575
|
+
function $r(e, t) {
|
|
1576
|
+
const n = bt(e, t), r = jr(e, t);
|
|
1577
|
+
return t.addDays(n, r * 7 - 1);
|
|
1578
1578
|
}
|
|
1579
|
-
class
|
|
1579
|
+
class R {
|
|
1580
1580
|
/**
|
|
1581
1581
|
* Creates an instance of `DateLib`.
|
|
1582
1582
|
*
|
|
@@ -1584,10 +1584,10 @@ class J {
|
|
|
1584
1584
|
* @param overrides Custom overrides for the date library functions.
|
|
1585
1585
|
*/
|
|
1586
1586
|
constructor(t, n) {
|
|
1587
|
-
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? I.tz(this.options.timeZone) : new this.Date(), this.newDate = (
|
|
1588
|
-
const i = this.overrides?.format ? this.overrides.format(
|
|
1587
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? I.tz(this.options.timeZone) : new this.Date(), this.newDate = (r, o, s) => this.overrides?.newDate ? this.overrides.newDate(r, o, s) : this.options.timeZone ? new I(r, o, s, this.options.timeZone) : new Date(r, o, s), this.addDays = (r, o) => this.overrides?.addDays ? this.overrides.addDays(r, o) : ct(r, o), this.addMonths = (r, o) => this.overrides?.addMonths ? this.overrides.addMonths(r, o) : ut(r, o), this.addWeeks = (r, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(r, o) : Dn(r, o), this.addYears = (r, o) => this.overrides?.addYears ? this.overrides.addYears(r, o) : vn(r, o), this.differenceInCalendarDays = (r, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, o) : dt(r, o), this.differenceInCalendarMonths = (r, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, o) : Nn(r, o), this.eachMonthOfInterval = (r) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : Tn(r), this.endOfBroadcastWeek = (r) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : $r(r, this), this.endOfISOWeek = (r) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(r) : _n(r), this.endOfMonth = (r) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(r) : xn(r), this.endOfWeek = (r, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(r, o) : mt(r, this.options), this.endOfYear = (r) => this.overrides?.endOfYear ? this.overrides.endOfYear(r) : Pn(r), this.format = (r, o, s) => {
|
|
1588
|
+
const i = this.overrides?.format ? this.overrides.format(r, o, this.options) : xr(r, o, this.options);
|
|
1589
1589
|
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
1590
|
-
}, this.getISOWeek = (
|
|
1590
|
+
}, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) : yt(r), this.getMonth = (r, o) => this.overrides?.getMonth ? this.overrides.getMonth(r, this.options) : Er(r, this.options), this.getYear = (r, o) => this.overrides?.getYear ? this.overrides.getYear(r, this.options) : Pr(r, this.options), this.getWeek = (r, o) => this.overrides?.getWeek ? this.overrides.getWeek(r, this.options) : pt(r, this.options), this.isAfter = (r, o) => this.overrides?.isAfter ? this.overrides.isAfter(r, o) : _r(r, o), this.isBefore = (r, o) => this.overrides?.isBefore ? this.overrides.isBefore(r, o) : Fr(r, o), this.isDate = (r) => this.overrides?.isDate ? this.overrides.isDate(r) : lt(r), this.isSameDay = (r, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(r, o) : Sn(r, o), this.isSameMonth = (r, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(r, o) : Br(r, o), this.isSameYear = (r, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(r, o) : Ir(r, o), this.max = (r) => this.overrides?.max ? this.overrides.max(r) : On(r), this.min = (r) => this.overrides?.min ? this.overrides.min(r) : Wn(r), this.setMonth = (r, o) => this.overrides?.setMonth ? this.overrides.setMonth(r, o) : Hr(r, o), this.setYear = (r, o) => this.overrides?.setYear ? this.overrides.setYear(r, o) : qr(r, o), this.startOfBroadcastWeek = (r, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : bt(r, this), this.startOfDay = (r) => this.overrides?.startOfDay ? this.overrides.startOfDay(r) : me(r), this.startOfISOWeek = (r) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(r) : he(r), this.startOfMonth = (r) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(r) : En(r), this.startOfWeek = (r, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(r, this.options) : ie(r, this.options), this.startOfYear = (r) => this.overrides?.startOfYear ? this.overrides.startOfYear(r) : ht(r), this.options = { locale: qe, ...t }, this.overrides = n;
|
|
1591
1591
|
}
|
|
1592
1592
|
/**
|
|
1593
1593
|
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
@@ -1599,10 +1599,10 @@ class J {
|
|
|
1599
1599
|
getDigitMap() {
|
|
1600
1600
|
const { numerals: t = "latn" } = this.options, n = new Intl.NumberFormat("en-US", {
|
|
1601
1601
|
numberingSystem: t
|
|
1602
|
-
}),
|
|
1603
|
-
for (let
|
|
1604
|
-
o
|
|
1605
|
-
return
|
|
1602
|
+
}), r = {};
|
|
1603
|
+
for (let o = 0; o < 10; o++)
|
|
1604
|
+
r[o.toString()] = n.format(o);
|
|
1605
|
+
return r;
|
|
1606
1606
|
}
|
|
1607
1607
|
/**
|
|
1608
1608
|
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
@@ -1613,7 +1613,7 @@ class J {
|
|
|
1613
1613
|
*/
|
|
1614
1614
|
replaceDigits(t) {
|
|
1615
1615
|
const n = this.getDigitMap();
|
|
1616
|
-
return t.replace(/\d/g, (
|
|
1616
|
+
return t.replace(/\d/g, (r) => n[r] || r);
|
|
1617
1617
|
}
|
|
1618
1618
|
/**
|
|
1619
1619
|
* Formats a number using the configured numbering system.
|
|
@@ -1625,11 +1625,58 @@ class J {
|
|
|
1625
1625
|
formatNumber(t) {
|
|
1626
1626
|
return this.replaceDigits(t.toString());
|
|
1627
1627
|
}
|
|
1628
|
+
/**
|
|
1629
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
1630
|
+
* locale.
|
|
1631
|
+
*/
|
|
1632
|
+
getMonthYearOrder() {
|
|
1633
|
+
const t = this.options.locale?.code;
|
|
1634
|
+
return t && R.yearFirstLocales.has(t) ? "year-first" : "month-first";
|
|
1635
|
+
}
|
|
1636
|
+
/**
|
|
1637
|
+
* Formats the month/year pair respecting locale conventions.
|
|
1638
|
+
*
|
|
1639
|
+
* @since 9.11.0
|
|
1640
|
+
*/
|
|
1641
|
+
formatMonthYear(t) {
|
|
1642
|
+
const { locale: n, timeZone: r, numerals: o } = this.options, s = n?.code;
|
|
1643
|
+
if (s && R.yearFirstLocales.has(s))
|
|
1644
|
+
try {
|
|
1645
|
+
return new Intl.DateTimeFormat(s, {
|
|
1646
|
+
month: "long",
|
|
1647
|
+
year: "numeric",
|
|
1648
|
+
timeZone: r,
|
|
1649
|
+
numberingSystem: o
|
|
1650
|
+
}).format(t);
|
|
1651
|
+
} catch {
|
|
1652
|
+
}
|
|
1653
|
+
const i = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
1654
|
+
return this.format(t, i);
|
|
1655
|
+
}
|
|
1628
1656
|
}
|
|
1629
|
-
|
|
1657
|
+
R.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
1658
|
+
"eu",
|
|
1659
|
+
"hu",
|
|
1660
|
+
"ja",
|
|
1661
|
+
"ja-Hira",
|
|
1662
|
+
"ja-JP",
|
|
1663
|
+
"ko",
|
|
1664
|
+
"ko-KR",
|
|
1665
|
+
"lt",
|
|
1666
|
+
"lt-LT",
|
|
1667
|
+
"lv",
|
|
1668
|
+
"lv-LV",
|
|
1669
|
+
"mn",
|
|
1670
|
+
"mn-MN",
|
|
1671
|
+
"zh",
|
|
1672
|
+
"zh-CN",
|
|
1673
|
+
"zh-HK",
|
|
1674
|
+
"zh-TW"
|
|
1675
|
+
]);
|
|
1676
|
+
const U = new R();
|
|
1630
1677
|
class Mt {
|
|
1631
|
-
constructor(t, n,
|
|
1632
|
-
this.date = t, this.displayMonth = n, this.outside = !!(n && !
|
|
1678
|
+
constructor(t, n, r = U) {
|
|
1679
|
+
this.date = t, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(t, n)), this.dateLib = r;
|
|
1633
1680
|
}
|
|
1634
1681
|
/**
|
|
1635
1682
|
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
@@ -1642,29 +1689,29 @@ class Mt {
|
|
|
1642
1689
|
return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
|
|
1643
1690
|
}
|
|
1644
1691
|
}
|
|
1645
|
-
class
|
|
1692
|
+
class Rr {
|
|
1646
1693
|
constructor(t, n) {
|
|
1647
1694
|
this.date = t, this.weeks = n;
|
|
1648
1695
|
}
|
|
1649
1696
|
}
|
|
1650
|
-
class
|
|
1697
|
+
class Zr {
|
|
1651
1698
|
constructor(t, n) {
|
|
1652
1699
|
this.days = n, this.weekNumber = t;
|
|
1653
1700
|
}
|
|
1654
1701
|
}
|
|
1655
|
-
function
|
|
1702
|
+
function Gr(e) {
|
|
1656
1703
|
return l.createElement("button", { ...e });
|
|
1657
1704
|
}
|
|
1658
|
-
function
|
|
1705
|
+
function zr(e) {
|
|
1659
1706
|
return l.createElement("span", { ...e });
|
|
1660
1707
|
}
|
|
1661
|
-
function
|
|
1662
|
-
const { size: t = 24, orientation: n = "left", className:
|
|
1708
|
+
function Lr(e) {
|
|
1709
|
+
const { size: t = 24, orientation: n = "left", className: r } = e;
|
|
1663
1710
|
return (
|
|
1664
1711
|
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
1665
1712
|
l.createElement(
|
|
1666
1713
|
"svg",
|
|
1667
|
-
{ className:
|
|
1714
|
+
{ className: r, width: t, height: t, viewBox: "0 0 24 24" },
|
|
1668
1715
|
n === "up" && l.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
1669
1716
|
n === "down" && l.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
1670
1717
|
n === "left" && l.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
@@ -1672,15 +1719,15 @@ function Lo(e) {
|
|
|
1672
1719
|
)
|
|
1673
1720
|
);
|
|
1674
1721
|
}
|
|
1675
|
-
function
|
|
1676
|
-
const { day: t, modifiers: n, ...
|
|
1677
|
-
return l.createElement("td", { ...
|
|
1722
|
+
function Qr(e) {
|
|
1723
|
+
const { day: t, modifiers: n, ...r } = e;
|
|
1724
|
+
return l.createElement("td", { ...r });
|
|
1678
1725
|
}
|
|
1679
|
-
function
|
|
1680
|
-
const { day: t, modifiers: n, ...
|
|
1726
|
+
function Xr(e) {
|
|
1727
|
+
const { day: t, modifiers: n, ...r } = e, o = l.useRef(null);
|
|
1681
1728
|
return l.useEffect(() => {
|
|
1682
|
-
n.focused &&
|
|
1683
|
-
}, [n.focused]), l.createElement("button", { ref:
|
|
1729
|
+
n.focused && o.current?.focus();
|
|
1730
|
+
}, [n.focused]), l.createElement("button", { ref: o, ...r });
|
|
1684
1731
|
}
|
|
1685
1732
|
var m;
|
|
1686
1733
|
(function(e) {
|
|
@@ -1690,46 +1737,46 @@ var _;
|
|
|
1690
1737
|
(function(e) {
|
|
1691
1738
|
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
1692
1739
|
})(_ || (_ = {}));
|
|
1693
|
-
var
|
|
1740
|
+
var L;
|
|
1694
1741
|
(function(e) {
|
|
1695
1742
|
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
1696
|
-
})(
|
|
1697
|
-
var
|
|
1743
|
+
})(L || (L = {}));
|
|
1744
|
+
var $;
|
|
1698
1745
|
(function(e) {
|
|
1699
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";
|
|
1700
|
-
})(
|
|
1701
|
-
function
|
|
1702
|
-
const { options: t, className: n, components:
|
|
1747
|
+
})($ || ($ = {}));
|
|
1748
|
+
function Ur(e) {
|
|
1749
|
+
const { options: t, className: n, components: r, classNames: o, ...s } = e, i = [o[m.Dropdown], n].join(" "), a = t?.find(({ value: c }) => c === s.value);
|
|
1703
1750
|
return l.createElement(
|
|
1704
1751
|
"span",
|
|
1705
|
-
{ "data-disabled": s.disabled, className:
|
|
1706
|
-
l.createElement(
|
|
1752
|
+
{ "data-disabled": s.disabled, className: o[m.DropdownRoot] },
|
|
1753
|
+
l.createElement(r.Select, { className: i, ...s }, t?.map(({ value: c, label: f, disabled: d }) => l.createElement(r.Option, { key: c, value: c, disabled: d }, f))),
|
|
1707
1754
|
l.createElement(
|
|
1708
1755
|
"span",
|
|
1709
|
-
{ className:
|
|
1756
|
+
{ className: o[m.CaptionLabel], "aria-hidden": !0 },
|
|
1710
1757
|
a?.label,
|
|
1711
|
-
l.createElement(
|
|
1758
|
+
l.createElement(r.Chevron, { orientation: "down", size: 18, className: o[m.Chevron] })
|
|
1712
1759
|
)
|
|
1713
1760
|
);
|
|
1714
1761
|
}
|
|
1715
|
-
function
|
|
1762
|
+
function Vr(e) {
|
|
1716
1763
|
return l.createElement("div", { ...e });
|
|
1717
1764
|
}
|
|
1718
|
-
function
|
|
1765
|
+
function Kr(e) {
|
|
1719
1766
|
return l.createElement("div", { ...e });
|
|
1720
1767
|
}
|
|
1721
|
-
function
|
|
1722
|
-
const { calendarMonth: t, displayIndex: n, ...
|
|
1723
|
-
return l.createElement("div", { ...
|
|
1768
|
+
function Jr(e) {
|
|
1769
|
+
const { calendarMonth: t, displayIndex: n, ...r } = e;
|
|
1770
|
+
return l.createElement("div", { ...r }, e.children);
|
|
1724
1771
|
}
|
|
1725
|
-
function
|
|
1726
|
-
const { calendarMonth: t, displayIndex: n, ...
|
|
1727
|
-
return l.createElement("div", { ...
|
|
1772
|
+
function eo(e) {
|
|
1773
|
+
const { calendarMonth: t, displayIndex: n, ...r } = e;
|
|
1774
|
+
return l.createElement("div", { ...r });
|
|
1728
1775
|
}
|
|
1729
|
-
function
|
|
1776
|
+
function to(e) {
|
|
1730
1777
|
return l.createElement("table", { ...e });
|
|
1731
1778
|
}
|
|
1732
|
-
function
|
|
1779
|
+
function no(e) {
|
|
1733
1780
|
return l.createElement("div", { ...e });
|
|
1734
1781
|
}
|
|
1735
1782
|
const kt = sn(void 0);
|
|
@@ -1739,82 +1786,82 @@ function ge() {
|
|
|
1739
1786
|
throw new Error("useDayPicker() must be used within a custom component.");
|
|
1740
1787
|
return e;
|
|
1741
1788
|
}
|
|
1742
|
-
function
|
|
1789
|
+
function ro(e) {
|
|
1743
1790
|
const { components: t } = ge();
|
|
1744
1791
|
return l.createElement(t.Dropdown, { ...e });
|
|
1745
1792
|
}
|
|
1746
|
-
function
|
|
1747
|
-
const { onPreviousClick: t, onNextClick: n, previousMonth:
|
|
1748
|
-
|
|
1749
|
-
}, [
|
|
1750
|
-
|
|
1751
|
-
}, [
|
|
1793
|
+
function oo(e) {
|
|
1794
|
+
const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: o, ...s } = e, { components: i, classNames: a, labels: { labelPrevious: c, labelNext: f } } = ge(), d = j((h) => {
|
|
1795
|
+
o && n?.(h);
|
|
1796
|
+
}, [o, n]), u = j((h) => {
|
|
1797
|
+
r && t?.(h);
|
|
1798
|
+
}, [r, t]);
|
|
1752
1799
|
return l.createElement(
|
|
1753
1800
|
"nav",
|
|
1754
1801
|
{ ...s },
|
|
1755
1802
|
l.createElement(
|
|
1756
1803
|
i.PreviousMonthButton,
|
|
1757
|
-
{ type: "button", className: a[m.PreviousMonthButton], tabIndex:
|
|
1758
|
-
l.createElement(i.Chevron, { disabled:
|
|
1804
|
+
{ type: "button", className: a[m.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": c(r), onClick: u },
|
|
1805
|
+
l.createElement(i.Chevron, { disabled: r ? void 0 : !0, className: a[m.Chevron], orientation: "left" })
|
|
1759
1806
|
),
|
|
1760
1807
|
l.createElement(
|
|
1761
1808
|
i.NextMonthButton,
|
|
1762
|
-
{ type: "button", className: a[m.NextMonthButton], tabIndex:
|
|
1763
|
-
l.createElement(i.Chevron, { disabled:
|
|
1809
|
+
{ type: "button", className: a[m.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": f(o), onClick: d },
|
|
1810
|
+
l.createElement(i.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: a[m.Chevron] })
|
|
1764
1811
|
)
|
|
1765
1812
|
);
|
|
1766
1813
|
}
|
|
1767
|
-
function
|
|
1814
|
+
function so(e) {
|
|
1768
1815
|
const { components: t } = ge();
|
|
1769
1816
|
return l.createElement(t.Button, { ...e });
|
|
1770
1817
|
}
|
|
1771
|
-
function
|
|
1818
|
+
function ao(e) {
|
|
1772
1819
|
return l.createElement("option", { ...e });
|
|
1773
1820
|
}
|
|
1774
|
-
function
|
|
1821
|
+
function io(e) {
|
|
1775
1822
|
const { components: t } = ge();
|
|
1776
1823
|
return l.createElement(t.Button, { ...e });
|
|
1777
1824
|
}
|
|
1778
|
-
function
|
|
1825
|
+
function co(e) {
|
|
1779
1826
|
const { rootRef: t, ...n } = e;
|
|
1780
1827
|
return l.createElement("div", { ...n, ref: t });
|
|
1781
1828
|
}
|
|
1782
|
-
function
|
|
1829
|
+
function uo(e) {
|
|
1783
1830
|
return l.createElement("select", { ...e });
|
|
1784
1831
|
}
|
|
1785
|
-
function
|
|
1832
|
+
function fo(e) {
|
|
1786
1833
|
const { week: t, ...n } = e;
|
|
1787
1834
|
return l.createElement("tr", { ...n });
|
|
1788
1835
|
}
|
|
1789
|
-
function
|
|
1836
|
+
function lo(e) {
|
|
1790
1837
|
return l.createElement("th", { ...e });
|
|
1791
1838
|
}
|
|
1792
|
-
function
|
|
1839
|
+
function ho(e) {
|
|
1793
1840
|
return l.createElement(
|
|
1794
1841
|
"thead",
|
|
1795
1842
|
{ "aria-hidden": !0 },
|
|
1796
1843
|
l.createElement("tr", { ...e })
|
|
1797
1844
|
);
|
|
1798
1845
|
}
|
|
1799
|
-
function
|
|
1846
|
+
function mo(e) {
|
|
1800
1847
|
const { week: t, ...n } = e;
|
|
1801
1848
|
return l.createElement("th", { ...n });
|
|
1802
1849
|
}
|
|
1803
|
-
function
|
|
1850
|
+
function yo(e) {
|
|
1804
1851
|
return l.createElement("th", { ...e });
|
|
1805
1852
|
}
|
|
1806
|
-
function
|
|
1853
|
+
function go(e) {
|
|
1807
1854
|
return l.createElement("tbody", { ...e });
|
|
1808
1855
|
}
|
|
1809
|
-
function
|
|
1856
|
+
function po(e) {
|
|
1810
1857
|
const { components: t } = ge();
|
|
1811
1858
|
return l.createElement(t.Dropdown, { ...e });
|
|
1812
1859
|
}
|
|
1813
|
-
const
|
|
1814
|
-
function
|
|
1815
|
-
let { from:
|
|
1816
|
-
const { differenceInCalendarDays: i, isSameDay: a } =
|
|
1817
|
-
return
|
|
1860
|
+
const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Button: Gr, CaptionLabel: zr, Chevron: Lr, Day: Qr, DayButton: Xr, Dropdown: Ur, DropdownNav: Vr, Footer: Kr, Month: Jr, MonthCaption: eo, MonthGrid: to, Months: no, MonthsDropdown: ro, Nav: oo, NextMonthButton: so, Option: ao, PreviousMonthButton: io, Root: co, Select: uo, Week: fo, WeekNumber: mo, WeekNumberHeader: yo, Weekday: lo, Weekdays: ho, Weeks: go, YearsDropdown: po }, Symbol.toStringTag, { value: "Module" }));
|
|
1861
|
+
function K(e, t, n = !1, r = U) {
|
|
1862
|
+
let { from: o, to: s } = e;
|
|
1863
|
+
const { differenceInCalendarDays: i, isSameDay: a } = r;
|
|
1864
|
+
return o && s ? (i(s, o) < 0 && ([o, s] = [s, o]), i(t, o) >= (n ? 1 : 0) && i(s, t) >= (n ? 1 : 0)) : !n && s ? a(s, t) : !n && o ? a(o, t) : !1;
|
|
1818
1865
|
}
|
|
1819
1866
|
function Dt(e) {
|
|
1820
1867
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
@@ -1834,17 +1881,17 @@ function Wt(e) {
|
|
|
1834
1881
|
function St(e, t) {
|
|
1835
1882
|
return Array.isArray(e) && e.every(t.isDate);
|
|
1836
1883
|
}
|
|
1837
|
-
function
|
|
1838
|
-
const
|
|
1839
|
-
return
|
|
1884
|
+
function J(e, t, n = U) {
|
|
1885
|
+
const r = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: s, isAfter: i } = n;
|
|
1886
|
+
return r.some((a) => {
|
|
1840
1887
|
if (typeof a == "boolean")
|
|
1841
1888
|
return a;
|
|
1842
1889
|
if (n.isDate(a))
|
|
1843
|
-
return
|
|
1890
|
+
return o(e, a);
|
|
1844
1891
|
if (St(a, n))
|
|
1845
1892
|
return a.includes(e);
|
|
1846
1893
|
if (Ae(a))
|
|
1847
|
-
return
|
|
1894
|
+
return K(a, e, !1, n);
|
|
1848
1895
|
if (Wt(a))
|
|
1849
1896
|
return Array.isArray(a.dayOfWeek) ? a.dayOfWeek.includes(e.getDay()) : a.dayOfWeek === e.getDay();
|
|
1850
1897
|
if (Dt(a)) {
|
|
@@ -1854,53 +1901,53 @@ function K(e, t, n = X) {
|
|
|
1854
1901
|
return vt(a) ? s(e, a.after) > 0 : Ot(a) ? s(a.before, e) > 0 : typeof a == "function" ? a(e) : !1;
|
|
1855
1902
|
});
|
|
1856
1903
|
}
|
|
1857
|
-
function
|
|
1858
|
-
const { disabled: s, hidden: i, modifiers: a, showOutsideDays: c, broadcastCalendar: f, today: d } = t, { isSameDay: u, isSameMonth: h, startOfMonth: g, isBefore: p, endOfMonth: O, isAfter: w } =
|
|
1904
|
+
function bo(e, t, n, r, o) {
|
|
1905
|
+
const { disabled: s, hidden: i, modifiers: a, showOutsideDays: c, broadcastCalendar: f, today: d } = t, { isSameDay: u, isSameMonth: h, startOfMonth: g, isBefore: p, endOfMonth: O, isAfter: w } = o, W = n && g(n), N = r && O(r), M = {
|
|
1859
1906
|
[_.focused]: [],
|
|
1860
1907
|
[_.outside]: [],
|
|
1861
1908
|
[_.disabled]: [],
|
|
1862
1909
|
[_.hidden]: [],
|
|
1863
1910
|
[_.today]: []
|
|
1864
|
-
},
|
|
1911
|
+
}, T = {};
|
|
1865
1912
|
for (const y of e) {
|
|
1866
|
-
const { date:
|
|
1867
|
-
!f && !c && C || f && c === !1 && C,
|
|
1868
|
-
C &&
|
|
1869
|
-
const se = a?.[
|
|
1870
|
-
se &&
|
|
1913
|
+
const { date: D, displayMonth: k } = y, C = !!(k && !h(D, k)), B = !!(W && p(D, W)), H = !!(N && w(D, N)), q = !!(s && J(D, s, o)), Z = !!(i && J(D, i, o)) || B || H || // Broadcast calendar will show outside days as default
|
|
1914
|
+
!f && !c && C || f && c === !1 && C, re = u(D, d ?? o.today());
|
|
1915
|
+
C && M.outside.push(y), q && M.disabled.push(y), Z && M.hidden.push(y), re && M.today.push(y), a && Object.keys(a).forEach((oe) => {
|
|
1916
|
+
const se = a?.[oe];
|
|
1917
|
+
se && J(D, se, o) && (T[oe] ? T[oe].push(y) : T[oe] = [y]);
|
|
1871
1918
|
});
|
|
1872
1919
|
}
|
|
1873
1920
|
return (y) => {
|
|
1874
|
-
const
|
|
1921
|
+
const D = {
|
|
1875
1922
|
[_.focused]: !1,
|
|
1876
1923
|
[_.disabled]: !1,
|
|
1877
1924
|
[_.hidden]: !1,
|
|
1878
1925
|
[_.outside]: !1,
|
|
1879
1926
|
[_.today]: !1
|
|
1880
|
-
},
|
|
1881
|
-
for (const C in
|
|
1882
|
-
const B =
|
|
1883
|
-
|
|
1927
|
+
}, k = {};
|
|
1928
|
+
for (const C in M) {
|
|
1929
|
+
const B = M[C];
|
|
1930
|
+
D[C] = B.some((H) => H === y);
|
|
1884
1931
|
}
|
|
1885
|
-
for (const C in
|
|
1886
|
-
|
|
1932
|
+
for (const C in T)
|
|
1933
|
+
k[C] = T[C].some((B) => B === y);
|
|
1887
1934
|
return {
|
|
1888
|
-
...
|
|
1935
|
+
...D,
|
|
1889
1936
|
// custom modifiers should override all the previous ones
|
|
1890
|
-
...
|
|
1937
|
+
...k
|
|
1891
1938
|
};
|
|
1892
1939
|
};
|
|
1893
1940
|
}
|
|
1894
|
-
function
|
|
1895
|
-
return Object.entries(e).filter(([,
|
|
1941
|
+
function Mo(e, t, n = {}) {
|
|
1942
|
+
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [s]) => (n[s] ? o.push(n[s]) : t[_[s]] ? o.push(t[_[s]]) : t[L[s]] && o.push(t[L[s]]), o), [t[m.Day]]);
|
|
1896
1943
|
}
|
|
1897
|
-
function
|
|
1944
|
+
function ko(e) {
|
|
1898
1945
|
return {
|
|
1899
|
-
...
|
|
1946
|
+
...wo,
|
|
1900
1947
|
...e
|
|
1901
1948
|
};
|
|
1902
1949
|
}
|
|
1903
|
-
function
|
|
1950
|
+
function Do(e) {
|
|
1904
1951
|
const t = {
|
|
1905
1952
|
"data-mode": e.mode ?? void 0,
|
|
1906
1953
|
"data-required": "required" in e ? e.required : void 0,
|
|
@@ -1909,87 +1956,87 @@ function Dr(e) {
|
|
|
1909
1956
|
"data-broadcast-calendar": e.broadcastCalendar || void 0,
|
|
1910
1957
|
"data-nav-layout": e.navLayout || void 0
|
|
1911
1958
|
};
|
|
1912
|
-
return Object.entries(e).forEach(([n,
|
|
1913
|
-
n.startsWith("data-") && (t[n] =
|
|
1959
|
+
return Object.entries(e).forEach(([n, r]) => {
|
|
1960
|
+
n.startsWith("data-") && (t[n] = r);
|
|
1914
1961
|
}), t;
|
|
1915
1962
|
}
|
|
1916
|
-
function
|
|
1963
|
+
function vo() {
|
|
1917
1964
|
const e = {};
|
|
1918
1965
|
for (const t in m)
|
|
1919
1966
|
e[m[t]] = `rdp-${m[t]}`;
|
|
1920
1967
|
for (const t in _)
|
|
1921
1968
|
e[_[t]] = `rdp-${_[t]}`;
|
|
1922
|
-
for (const t in
|
|
1923
|
-
e[
|
|
1924
|
-
for (const t in
|
|
1925
|
-
e[
|
|
1969
|
+
for (const t in L)
|
|
1970
|
+
e[L[t]] = `rdp-${L[t]}`;
|
|
1971
|
+
for (const t in $)
|
|
1972
|
+
e[$[t]] = `rdp-${$[t]}`;
|
|
1926
1973
|
return e;
|
|
1927
1974
|
}
|
|
1928
1975
|
function Ct(e, t, n) {
|
|
1929
|
-
return (n ?? new
|
|
1976
|
+
return (n ?? new R(t)).formatMonthYear(e);
|
|
1930
1977
|
}
|
|
1931
|
-
const
|
|
1932
|
-
function
|
|
1933
|
-
return (n ?? new
|
|
1978
|
+
const Oo = Ct;
|
|
1979
|
+
function Wo(e, t, n) {
|
|
1980
|
+
return (n ?? new R(t)).format(e, "d");
|
|
1934
1981
|
}
|
|
1935
|
-
function
|
|
1982
|
+
function So(e, t = U) {
|
|
1936
1983
|
return t.format(e, "LLLL");
|
|
1937
1984
|
}
|
|
1938
|
-
function
|
|
1939
|
-
return (n ?? new
|
|
1985
|
+
function Co(e, t, n) {
|
|
1986
|
+
return (n ?? new R(t)).format(e, "cccccc");
|
|
1940
1987
|
}
|
|
1941
|
-
function
|
|
1988
|
+
function No(e, t = U) {
|
|
1942
1989
|
return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
|
|
1943
1990
|
}
|
|
1944
|
-
function
|
|
1991
|
+
function xo() {
|
|
1945
1992
|
return "";
|
|
1946
1993
|
}
|
|
1947
|
-
function Nt(e, t =
|
|
1994
|
+
function Nt(e, t = U) {
|
|
1948
1995
|
return t.format(e, "yyyy");
|
|
1949
1996
|
}
|
|
1950
|
-
const
|
|
1951
|
-
function
|
|
1997
|
+
const Yo = Nt, To = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, formatCaption: Ct, formatDay: Wo, formatMonthCaption: Oo, formatMonthDropdown: So, formatWeekNumber: No, formatWeekNumberHeader: xo, formatWeekdayName: Co, formatYearCaption: Yo, formatYearDropdown: Nt }, Symbol.toStringTag, { value: "Module" }));
|
|
1998
|
+
function Eo(e) {
|
|
1952
1999
|
return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
|
|
1953
|
-
...
|
|
2000
|
+
...To,
|
|
1954
2001
|
...e
|
|
1955
2002
|
};
|
|
1956
2003
|
}
|
|
1957
|
-
function
|
|
1958
|
-
const { startOfMonth: s, startOfYear: i, endOfYear: a, eachMonthOfInterval: c, getMonth: f } =
|
|
2004
|
+
function Po(e, t, n, r, o) {
|
|
2005
|
+
const { startOfMonth: s, startOfYear: i, endOfYear: a, eachMonthOfInterval: c, getMonth: f } = o;
|
|
1959
2006
|
return c({
|
|
1960
2007
|
start: i(e),
|
|
1961
2008
|
end: a(e)
|
|
1962
2009
|
}).map((h) => {
|
|
1963
|
-
const g =
|
|
2010
|
+
const g = r.formatMonthDropdown(h, o), p = f(h), O = t && h < s(t) || n && h > s(n) || !1;
|
|
1964
2011
|
return { value: p, label: g, disabled: O };
|
|
1965
2012
|
});
|
|
1966
2013
|
}
|
|
1967
|
-
function
|
|
1968
|
-
let
|
|
1969
|
-
return Object.entries(e).filter(([,
|
|
1970
|
-
|
|
1971
|
-
...
|
|
1972
|
-
...n?.[
|
|
2014
|
+
function _o(e, t = {}, n = {}) {
|
|
2015
|
+
let r = { ...t?.[m.Day] };
|
|
2016
|
+
return Object.entries(e).filter(([, o]) => o === !0).forEach(([o]) => {
|
|
2017
|
+
r = {
|
|
2018
|
+
...r,
|
|
2019
|
+
...n?.[o]
|
|
1973
2020
|
};
|
|
1974
|
-
}),
|
|
2021
|
+
}), r;
|
|
1975
2022
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const
|
|
2023
|
+
function Fo(e, t, n) {
|
|
2024
|
+
const r = e.today(), o = t ? e.startOfISOWeek(r) : e.startOfWeek(r), s = [];
|
|
1978
2025
|
for (let i = 0; i < 7; i++) {
|
|
1979
|
-
const a = e.addDays(
|
|
2026
|
+
const a = e.addDays(o, i);
|
|
1980
2027
|
s.push(a);
|
|
1981
2028
|
}
|
|
1982
2029
|
return s;
|
|
1983
2030
|
}
|
|
1984
|
-
function
|
|
2031
|
+
function Bo(e, t, n, r, o = !1) {
|
|
1985
2032
|
if (!e || !t)
|
|
1986
2033
|
return;
|
|
1987
|
-
const { startOfYear: s, endOfYear: i, addYears: a, getYear: c, isBefore: f, isSameYear: d } =
|
|
2034
|
+
const { startOfYear: s, endOfYear: i, addYears: a, getYear: c, isBefore: f, isSameYear: d } = r, u = s(e), h = i(t), g = [];
|
|
1988
2035
|
let p = u;
|
|
1989
2036
|
for (; f(p, h) || d(p, h); )
|
|
1990
2037
|
g.push(p), p = a(p, 1);
|
|
1991
|
-
return
|
|
1992
|
-
const w = n.formatYearDropdown(O,
|
|
2038
|
+
return o && g.reverse(), g.map((O) => {
|
|
2039
|
+
const w = n.formatYearDropdown(O, r);
|
|
1993
2040
|
return {
|
|
1994
2041
|
value: c(O),
|
|
1995
2042
|
label: w,
|
|
@@ -1997,180 +2044,180 @@ function Br(e, t, n, o, r = !1) {
|
|
|
1997
2044
|
};
|
|
1998
2045
|
});
|
|
1999
2046
|
}
|
|
2000
|
-
function xt(e, t, n,
|
|
2001
|
-
let
|
|
2002
|
-
return t.today && (
|
|
2047
|
+
function xt(e, t, n, r) {
|
|
2048
|
+
let o = (r ?? new R(n)).format(e, "PPPP");
|
|
2049
|
+
return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
|
|
2003
2050
|
}
|
|
2004
|
-
const
|
|
2005
|
-
function
|
|
2006
|
-
return (n ?? new
|
|
2051
|
+
const Io = xt;
|
|
2052
|
+
function Yt(e, t, n) {
|
|
2053
|
+
return (n ?? new R(t)).formatMonthYear(e);
|
|
2007
2054
|
}
|
|
2008
|
-
const
|
|
2009
|
-
function
|
|
2010
|
-
let
|
|
2011
|
-
return t?.today && (
|
|
2055
|
+
const Ho = Yt;
|
|
2056
|
+
function qo(e, t, n, r) {
|
|
2057
|
+
let o = (r ?? new R(n)).format(e, "PPPP");
|
|
2058
|
+
return t?.today && (o = `Today, ${o}`), o;
|
|
2012
2059
|
}
|
|
2013
|
-
function
|
|
2060
|
+
function Ao(e) {
|
|
2014
2061
|
return "Choose the Month";
|
|
2015
2062
|
}
|
|
2016
|
-
function
|
|
2063
|
+
function jo() {
|
|
2017
2064
|
return "";
|
|
2018
2065
|
}
|
|
2019
|
-
function $
|
|
2066
|
+
function $o(e) {
|
|
2020
2067
|
return "Go to the Next Month";
|
|
2021
2068
|
}
|
|
2022
|
-
function
|
|
2069
|
+
function Ro(e) {
|
|
2023
2070
|
return "Go to the Previous Month";
|
|
2024
2071
|
}
|
|
2025
|
-
function
|
|
2026
|
-
return (n ?? new
|
|
2072
|
+
function Zo(e, t, n) {
|
|
2073
|
+
return (n ?? new R(t)).format(e, "cccc");
|
|
2027
2074
|
}
|
|
2028
|
-
function
|
|
2075
|
+
function Go(e, t) {
|
|
2029
2076
|
return `Week ${e}`;
|
|
2030
2077
|
}
|
|
2031
|
-
function
|
|
2078
|
+
function zo(e) {
|
|
2032
2079
|
return "Week Number";
|
|
2033
2080
|
}
|
|
2034
|
-
function
|
|
2081
|
+
function Lo(e) {
|
|
2035
2082
|
return "Choose the Year";
|
|
2036
2083
|
}
|
|
2037
|
-
const
|
|
2084
|
+
const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, labelCaption: Ho, labelDay: Io, labelDayButton: xt, labelGrid: Yt, labelGridcell: qo, labelMonthDropdown: Ao, labelNav: jo, labelNext: $o, labelPrevious: Ro, labelWeekNumber: Go, labelWeekNumberHeader: zo, labelWeekday: Zo, labelYearDropdown: Lo }, Symbol.toStringTag, { value: "Module" })), pe = (e) => e instanceof HTMLElement ? e : null, Fe = (e) => [
|
|
2038
2085
|
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2039
|
-
],
|
|
2040
|
-
function
|
|
2041
|
-
const i = ke(null), a = ke(
|
|
2086
|
+
], Xo = (e) => pe(e.querySelector("[data-animated-month]")), Be = (e) => pe(e.querySelector("[data-animated-caption]")), Ie = (e) => pe(e.querySelector("[data-animated-weeks]")), Uo = (e) => pe(e.querySelector("[data-animated-nav]")), Vo = (e) => pe(e.querySelector("[data-animated-weekdays]"));
|
|
2087
|
+
function Ko(e, t, { classNames: n, months: r, focused: o, dateLib: s }) {
|
|
2088
|
+
const i = ke(null), a = ke(r), c = ke(!1);
|
|
2042
2089
|
cn(() => {
|
|
2043
2090
|
const f = a.current;
|
|
2044
|
-
if (a.current =
|
|
2091
|
+
if (a.current = r, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
2045
2092
|
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2046
|
-
|
|
2093
|
+
r.length === 0 || f.length === 0 || r.length !== f.length)
|
|
2047
2094
|
return;
|
|
2048
|
-
const d = s.isSameMonth(
|
|
2049
|
-
if (O instanceof HTMLElement ? (Fe(O).forEach((
|
|
2050
|
-
if (!(
|
|
2095
|
+
const d = s.isSameMonth(r[0].date, f[0].date), u = s.isAfter(r[0].date, f[0].date), h = u ? n[$.caption_after_enter] : n[$.caption_before_enter], g = u ? n[$.weeks_after_enter] : n[$.weeks_before_enter], p = i.current, O = e.current.cloneNode(!0);
|
|
2096
|
+
if (O instanceof HTMLElement ? (Fe(O).forEach((M) => {
|
|
2097
|
+
if (!(M instanceof HTMLElement))
|
|
2051
2098
|
return;
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2054
|
-
const y = Be(
|
|
2099
|
+
const T = Xo(M);
|
|
2100
|
+
T && M.contains(T) && M.removeChild(T);
|
|
2101
|
+
const y = Be(M);
|
|
2055
2102
|
y && y.classList.remove(h);
|
|
2056
|
-
const
|
|
2057
|
-
|
|
2103
|
+
const D = Ie(M);
|
|
2104
|
+
D && D.classList.remove(g);
|
|
2058
2105
|
}), i.current = O) : i.current = null, c.current || d || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
2059
|
-
|
|
2106
|
+
o)
|
|
2060
2107
|
return;
|
|
2061
2108
|
const w = p instanceof HTMLElement ? Fe(p) : [], W = Fe(e.current);
|
|
2062
2109
|
if (W?.every((N) => N instanceof HTMLElement) && w && w.every((N) => N instanceof HTMLElement)) {
|
|
2063
2110
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
2064
|
-
const N =
|
|
2065
|
-
N && (N.style.zIndex = "1"), W.forEach((
|
|
2066
|
-
const y = w[
|
|
2111
|
+
const N = Uo(e.current);
|
|
2112
|
+
N && (N.style.zIndex = "1"), W.forEach((M, T) => {
|
|
2113
|
+
const y = w[T];
|
|
2067
2114
|
if (!y)
|
|
2068
2115
|
return;
|
|
2069
|
-
|
|
2070
|
-
const
|
|
2071
|
-
|
|
2072
|
-
const
|
|
2073
|
-
|
|
2116
|
+
M.style.position = "relative", M.style.overflow = "hidden";
|
|
2117
|
+
const D = Be(M);
|
|
2118
|
+
D && D.classList.add(h);
|
|
2119
|
+
const k = Ie(M);
|
|
2120
|
+
k && k.classList.add(g);
|
|
2074
2121
|
const C = () => {
|
|
2075
|
-
c.current = !1, e.current && (e.current.style.isolation = ""), N && (N.style.zIndex = ""),
|
|
2122
|
+
c.current = !1, e.current && (e.current.style.isolation = ""), N && (N.style.zIndex = ""), D && D.classList.remove(h), k && k.classList.remove(g), M.style.position = "", M.style.overflow = "", M.contains(y) && M.removeChild(y);
|
|
2076
2123
|
};
|
|
2077
2124
|
y.style.pointerEvents = "none", y.style.position = "absolute", y.style.overflow = "hidden", y.setAttribute("aria-hidden", "true");
|
|
2078
|
-
const B =
|
|
2125
|
+
const B = Vo(y);
|
|
2079
2126
|
B && (B.style.opacity = "0");
|
|
2080
2127
|
const H = Be(y);
|
|
2081
|
-
H && (H.classList.add(u ? n[
|
|
2128
|
+
H && (H.classList.add(u ? n[$.caption_before_exit] : n[$.caption_after_exit]), H.addEventListener("animationend", C));
|
|
2082
2129
|
const q = Ie(y);
|
|
2083
|
-
q && q.classList.add(u ? n[
|
|
2130
|
+
q && q.classList.add(u ? n[$.weeks_before_exit] : n[$.weeks_after_exit]), M.insertBefore(y, M.firstChild);
|
|
2084
2131
|
});
|
|
2085
2132
|
}
|
|
2086
2133
|
});
|
|
2087
2134
|
}
|
|
2088
|
-
function
|
|
2089
|
-
const
|
|
2090
|
-
for (let q = 0; q <=
|
|
2091
|
-
const
|
|
2092
|
-
if (t && w(
|
|
2135
|
+
function Jo(e, t, n, r) {
|
|
2136
|
+
const o = e[0], s = e[e.length - 1], { ISOWeek: i, fixedWeeks: a, broadcastCalendar: c } = n ?? {}, { addDays: f, differenceInCalendarDays: d, differenceInCalendarMonths: u, endOfBroadcastWeek: h, endOfISOWeek: g, endOfMonth: p, endOfWeek: O, isAfter: w, startOfBroadcastWeek: W, startOfISOWeek: N, startOfWeek: M } = r, T = c ? W(o, r) : i ? N(o) : M(o), y = c ? h(s) : i ? g(p(s)) : O(p(s)), D = d(y, T), k = u(s, o) + 1, C = [];
|
|
2137
|
+
for (let q = 0; q <= D; q++) {
|
|
2138
|
+
const Z = f(T, q);
|
|
2139
|
+
if (t && w(Z, t))
|
|
2093
2140
|
break;
|
|
2094
|
-
C.push(
|
|
2141
|
+
C.push(Z);
|
|
2095
2142
|
}
|
|
2096
|
-
const H = (c ? 35 : 42) *
|
|
2143
|
+
const H = (c ? 35 : 42) * k;
|
|
2097
2144
|
if (a && C.length < H) {
|
|
2098
2145
|
const q = H - C.length;
|
|
2099
|
-
for (let
|
|
2100
|
-
const
|
|
2101
|
-
C.push(
|
|
2146
|
+
for (let Z = 0; Z < q; Z++) {
|
|
2147
|
+
const re = f(C[C.length - 1], 1);
|
|
2148
|
+
C.push(re);
|
|
2102
2149
|
}
|
|
2103
2150
|
}
|
|
2104
2151
|
return C;
|
|
2105
2152
|
}
|
|
2106
2153
|
function es(e) {
|
|
2107
2154
|
const t = [];
|
|
2108
|
-
return e.reduce((n,
|
|
2109
|
-
const
|
|
2110
|
-
return n.concat(
|
|
2155
|
+
return e.reduce((n, r) => {
|
|
2156
|
+
const o = r.weeks.reduce((s, i) => s.concat(i.days.slice()), t.slice());
|
|
2157
|
+
return n.concat(o.slice());
|
|
2111
2158
|
}, t.slice());
|
|
2112
2159
|
}
|
|
2113
|
-
function ts(e, t, n,
|
|
2114
|
-
const { numberOfMonths:
|
|
2115
|
-
for (let i = 0; i <
|
|
2116
|
-
const a =
|
|
2160
|
+
function ts(e, t, n, r) {
|
|
2161
|
+
const { numberOfMonths: o = 1 } = n, s = [];
|
|
2162
|
+
for (let i = 0; i < o; i++) {
|
|
2163
|
+
const a = r.addMonths(e, i);
|
|
2117
2164
|
if (t && a > t)
|
|
2118
2165
|
break;
|
|
2119
2166
|
s.push(a);
|
|
2120
2167
|
}
|
|
2121
2168
|
return s;
|
|
2122
2169
|
}
|
|
2123
|
-
function nt(e, t, n,
|
|
2124
|
-
const { month:
|
|
2125
|
-
let c =
|
|
2126
|
-
const { differenceInCalendarMonths: f, addMonths: d, startOfMonth: u } =
|
|
2170
|
+
function nt(e, t, n, r) {
|
|
2171
|
+
const { month: o, defaultMonth: s, today: i = r.today(), numberOfMonths: a = 1 } = e;
|
|
2172
|
+
let c = o || s || i;
|
|
2173
|
+
const { differenceInCalendarMonths: f, addMonths: d, startOfMonth: u } = r;
|
|
2127
2174
|
if (n && f(n, c) < a - 1) {
|
|
2128
2175
|
const h = -1 * (a - 1);
|
|
2129
2176
|
c = d(n, h);
|
|
2130
2177
|
}
|
|
2131
2178
|
return t && f(c, t) < 0 && (c = t), u(c);
|
|
2132
2179
|
}
|
|
2133
|
-
function ns(e, t, n,
|
|
2134
|
-
const { addDays:
|
|
2135
|
-
const W = n.broadcastCalendar ? u(w,
|
|
2136
|
-
if (n.fixedWeeks &&
|
|
2137
|
-
const
|
|
2138
|
-
const B =
|
|
2139
|
-
return C > N && C <=
|
|
2180
|
+
function ns(e, t, n, r) {
|
|
2181
|
+
const { addDays: o, endOfBroadcastWeek: s, endOfISOWeek: i, endOfMonth: a, endOfWeek: c, getISOWeek: f, getWeek: d, startOfBroadcastWeek: u, startOfISOWeek: h, startOfWeek: g } = r, p = e.reduce((O, w) => {
|
|
2182
|
+
const W = n.broadcastCalendar ? u(w, r) : n.ISOWeek ? h(w) : g(w), N = n.broadcastCalendar ? s(w) : n.ISOWeek ? i(a(w)) : c(a(w)), M = t.filter((k) => k >= W && k <= N), T = n.broadcastCalendar ? 35 : 42;
|
|
2183
|
+
if (n.fixedWeeks && M.length < T) {
|
|
2184
|
+
const k = t.filter((C) => {
|
|
2185
|
+
const B = T - M.length;
|
|
2186
|
+
return C > N && C <= o(N, B);
|
|
2140
2187
|
});
|
|
2141
|
-
|
|
2188
|
+
M.push(...k);
|
|
2142
2189
|
}
|
|
2143
|
-
const y =
|
|
2144
|
-
const B = n.ISOWeek ? f(C) : d(C), H =
|
|
2145
|
-
return H ? H.days.push(q) :
|
|
2146
|
-
}, []),
|
|
2147
|
-
return O.push(
|
|
2190
|
+
const y = M.reduce((k, C) => {
|
|
2191
|
+
const B = n.ISOWeek ? f(C) : d(C), H = k.find((Z) => Z.weekNumber === B), q = new Mt(C, w, r);
|
|
2192
|
+
return H ? H.days.push(q) : k.push(new Zr(B, [q])), k;
|
|
2193
|
+
}, []), D = new Rr(w, y);
|
|
2194
|
+
return O.push(D), O;
|
|
2148
2195
|
}, []);
|
|
2149
2196
|
return n.reverseMonths ? p.reverse() : p;
|
|
2150
2197
|
}
|
|
2151
|
-
function
|
|
2152
|
-
let { startMonth: n, endMonth:
|
|
2153
|
-
const { startOfYear:
|
|
2154
|
-
!n && p && (n = p), !n && h && (n = t.newDate(h, 0, 1)), !
|
|
2198
|
+
function rs(e, t) {
|
|
2199
|
+
let { startMonth: n, endMonth: r } = e;
|
|
2200
|
+
const { startOfYear: o, startOfDay: s, startOfMonth: i, endOfMonth: a, addYears: c, endOfYear: f, newDate: d, today: u } = t, { fromYear: h, toYear: g, fromMonth: p, toMonth: O } = e;
|
|
2201
|
+
!n && p && (n = p), !n && h && (n = t.newDate(h, 0, 1)), !r && O && (r = O), !r && g && (r = d(g, 11, 31));
|
|
2155
2202
|
const w = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
2156
|
-
return n ? n = i(n) : h ? n = d(h, 0, 1) : !n && w && (n =
|
|
2203
|
+
return n ? n = i(n) : h ? n = d(h, 0, 1) : !n && w && (n = o(c(e.today ?? u(), -100))), r ? r = a(r) : g ? r = d(g, 11, 31) : !r && w && (r = f(e.today ?? u())), [
|
|
2157
2204
|
n && s(n),
|
|
2158
|
-
|
|
2205
|
+
r && s(r)
|
|
2159
2206
|
];
|
|
2160
2207
|
}
|
|
2161
|
-
function
|
|
2208
|
+
function os(e, t, n, r) {
|
|
2162
2209
|
if (n.disableNavigation)
|
|
2163
2210
|
return;
|
|
2164
|
-
const { pagedNavigation:
|
|
2211
|
+
const { pagedNavigation: o, numberOfMonths: s = 1 } = n, { startOfMonth: i, addMonths: a, differenceInCalendarMonths: c } = r, f = o ? s : 1, d = i(e);
|
|
2165
2212
|
if (!t)
|
|
2166
2213
|
return a(d, f);
|
|
2167
2214
|
if (!(c(t, e) < s))
|
|
2168
2215
|
return a(d, f);
|
|
2169
2216
|
}
|
|
2170
|
-
function ss(e, t, n,
|
|
2217
|
+
function ss(e, t, n, r) {
|
|
2171
2218
|
if (n.disableNavigation)
|
|
2172
2219
|
return;
|
|
2173
|
-
const { pagedNavigation:
|
|
2220
|
+
const { pagedNavigation: o, numberOfMonths: s } = n, { startOfMonth: i, addMonths: a, differenceInCalendarMonths: c } = r, f = o ? s ?? 1 : 1, d = i(e);
|
|
2174
2221
|
if (!t)
|
|
2175
2222
|
return a(d, -f);
|
|
2176
2223
|
if (!(c(d, t) <= 0))
|
|
@@ -2178,39 +2225,39 @@ function ss(e, t, n, o) {
|
|
|
2178
2225
|
}
|
|
2179
2226
|
function as(e) {
|
|
2180
2227
|
const t = [];
|
|
2181
|
-
return e.reduce((n,
|
|
2228
|
+
return e.reduce((n, r) => n.concat(r.weeks.slice()), t.slice());
|
|
2182
2229
|
}
|
|
2183
2230
|
function ve(e, t) {
|
|
2184
|
-
const [n,
|
|
2185
|
-
return [t === void 0 ? n : t,
|
|
2231
|
+
const [n, r] = De(e);
|
|
2232
|
+
return [t === void 0 ? n : t, r];
|
|
2186
2233
|
}
|
|
2187
2234
|
function is(e, t) {
|
|
2188
|
-
const [n,
|
|
2235
|
+
const [n, r] = rs(e, t), { startOfMonth: o, endOfMonth: s } = t, i = nt(e, n, r, t), [a, c] = ve(
|
|
2189
2236
|
i,
|
|
2190
2237
|
// initialMonth is always computed from props.month if provided
|
|
2191
2238
|
e.month ? i : void 0
|
|
2192
2239
|
);
|
|
2193
2240
|
un(() => {
|
|
2194
|
-
const
|
|
2195
|
-
c(
|
|
2241
|
+
const D = nt(e, n, r, t);
|
|
2242
|
+
c(D);
|
|
2196
2243
|
}, [e.timeZone]);
|
|
2197
|
-
const f = ts(a,
|
|
2244
|
+
const f = ts(a, r, e, t), d = Jo(f, e.endMonth ? s(e.endMonth) : void 0, e, t), u = ns(f, d, e, t), h = as(u), g = es(u), p = ss(a, n, e, t), O = os(a, r, e, t), { disableNavigation: w, onMonthChange: W } = e, N = (D) => h.some((k) => k.days.some((C) => C.isEqualTo(D))), M = (D) => {
|
|
2198
2245
|
if (w)
|
|
2199
2246
|
return;
|
|
2200
|
-
let
|
|
2201
|
-
n &&
|
|
2247
|
+
let k = o(D);
|
|
2248
|
+
n && k < o(n) && (k = o(n)), r && k > o(r) && (k = o(r)), c(k), W?.(k);
|
|
2202
2249
|
};
|
|
2203
2250
|
return {
|
|
2204
2251
|
months: u,
|
|
2205
2252
|
weeks: h,
|
|
2206
2253
|
days: g,
|
|
2207
2254
|
navStart: n,
|
|
2208
|
-
navEnd:
|
|
2255
|
+
navEnd: r,
|
|
2209
2256
|
previousMonth: p,
|
|
2210
2257
|
nextMonth: O,
|
|
2211
|
-
goToMonth:
|
|
2212
|
-
goToDay: (
|
|
2213
|
-
N(
|
|
2258
|
+
goToMonth: M,
|
|
2259
|
+
goToDay: (D) => {
|
|
2260
|
+
N(D) || M(D.date);
|
|
2214
2261
|
}
|
|
2215
2262
|
};
|
|
2216
2263
|
}
|
|
@@ -2218,37 +2265,37 @@ var Q;
|
|
|
2218
2265
|
(function(e) {
|
|
2219
2266
|
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
2220
2267
|
})(Q || (Q = {}));
|
|
2221
|
-
function
|
|
2268
|
+
function rt(e) {
|
|
2222
2269
|
return !e[_.disabled] && !e[_.hidden] && !e[_.outside];
|
|
2223
2270
|
}
|
|
2224
|
-
function cs(e, t, n,
|
|
2225
|
-
let
|
|
2271
|
+
function cs(e, t, n, r) {
|
|
2272
|
+
let o, s = -1;
|
|
2226
2273
|
for (const i of e) {
|
|
2227
2274
|
const a = t(i);
|
|
2228
|
-
|
|
2275
|
+
rt(a) && (a[_.focused] && s < Q.FocusedModifier ? (o = i, s = Q.FocusedModifier) : r?.isEqualTo(i) && s < Q.LastFocused ? (o = i, s = Q.LastFocused) : n(i.date) && s < Q.Selected ? (o = i, s = Q.Selected) : a[_.today] && s < Q.Today && (o = i, s = Q.Today));
|
|
2229
2276
|
}
|
|
2230
|
-
return
|
|
2277
|
+
return o || (o = e.find((i) => rt(t(i)))), o;
|
|
2231
2278
|
}
|
|
2232
|
-
function us(e, t, n,
|
|
2233
|
-
const { ISOWeek: a, broadcastCalendar: c } = s, { addDays: f, addMonths: d, addWeeks: u, addYears: h, endOfBroadcastWeek: g, endOfISOWeek: p, endOfWeek: O, max: w, min: W, startOfBroadcastWeek: N, startOfISOWeek:
|
|
2234
|
-
let
|
|
2279
|
+
function us(e, t, n, r, o, s, i) {
|
|
2280
|
+
const { ISOWeek: a, broadcastCalendar: c } = s, { addDays: f, addMonths: d, addWeeks: u, addYears: h, endOfBroadcastWeek: g, endOfISOWeek: p, endOfWeek: O, max: w, min: W, startOfBroadcastWeek: N, startOfISOWeek: M, startOfWeek: T } = i;
|
|
2281
|
+
let D = {
|
|
2235
2282
|
day: f,
|
|
2236
2283
|
week: u,
|
|
2237
2284
|
month: d,
|
|
2238
2285
|
year: h,
|
|
2239
|
-
startOfWeek: (
|
|
2240
|
-
endOfWeek: (
|
|
2286
|
+
startOfWeek: (k) => c ? N(k, i) : a ? M(k) : T(k),
|
|
2287
|
+
endOfWeek: (k) => c ? g(k) : a ? p(k) : O(k)
|
|
2241
2288
|
}[e](n, t === "after" ? 1 : -1);
|
|
2242
|
-
return t === "before" &&
|
|
2289
|
+
return t === "before" && r ? D = w([r, D]) : t === "after" && o && (D = W([o, D])), D;
|
|
2243
2290
|
}
|
|
2244
|
-
function
|
|
2291
|
+
function Tt(e, t, n, r, o, s, i, a = 0) {
|
|
2245
2292
|
if (a > 365)
|
|
2246
2293
|
return;
|
|
2247
|
-
const c = us(e, t, n.date,
|
|
2248
|
-
return !f && !d ? h :
|
|
2294
|
+
const c = us(e, t, n.date, r, o, s, i), f = !!(s.disabled && J(c, s.disabled, i)), d = !!(s.hidden && J(c, s.hidden, i)), u = c, h = new Mt(c, u, i);
|
|
2295
|
+
return !f && !d ? h : Tt(e, t, h, r, o, s, i, a + 1);
|
|
2249
2296
|
}
|
|
2250
|
-
function fs(e, t, n,
|
|
2251
|
-
const { autoFocus: s } = e, [i, a] = De(), c = cs(t.days, n,
|
|
2297
|
+
function fs(e, t, n, r, o) {
|
|
2298
|
+
const { autoFocus: s } = e, [i, a] = De(), c = cs(t.days, n, r || (() => !1), i), [f, d] = De(s ? c : void 0);
|
|
2252
2299
|
return {
|
|
2253
2300
|
isFocusTarget: (O) => !!c?.isEqualTo(O),
|
|
2254
2301
|
setFocused: d,
|
|
@@ -2259,38 +2306,38 @@ function fs(e, t, n, o, r) {
|
|
|
2259
2306
|
moveFocus: (O, w) => {
|
|
2260
2307
|
if (!f)
|
|
2261
2308
|
return;
|
|
2262
|
-
const W =
|
|
2309
|
+
const W = Tt(O, w, f, t.navStart, t.navEnd, e, o);
|
|
2263
2310
|
W && (t.goToDay(W), d(W));
|
|
2264
2311
|
}
|
|
2265
2312
|
};
|
|
2266
2313
|
}
|
|
2267
2314
|
function ds(e, t) {
|
|
2268
|
-
const { selected: n, required:
|
|
2315
|
+
const { selected: n, required: r, onSelect: o } = e, [s, i] = ve(n, o ? n : void 0), a = o ? n : s, { isSameDay: c } = t, f = (g) => a?.some((p) => c(p, g)) ?? !1, { min: d, max: u } = e;
|
|
2269
2316
|
return {
|
|
2270
2317
|
selected: a,
|
|
2271
2318
|
select: (g, p, O) => {
|
|
2272
2319
|
let w = [...a ?? []];
|
|
2273
2320
|
if (f(g)) {
|
|
2274
|
-
if (a?.length === d ||
|
|
2321
|
+
if (a?.length === d || r && a?.length === 1)
|
|
2275
2322
|
return;
|
|
2276
2323
|
w = a?.filter((W) => !c(W, g));
|
|
2277
2324
|
} else
|
|
2278
2325
|
a?.length === u ? w = [g] : w = [...w, g];
|
|
2279
|
-
return
|
|
2326
|
+
return o || i(w), o?.(w, g, p, O), w;
|
|
2280
2327
|
},
|
|
2281
2328
|
isSelected: f
|
|
2282
2329
|
};
|
|
2283
2330
|
}
|
|
2284
|
-
function ls(e, t, n = 0,
|
|
2331
|
+
function ls(e, t, n = 0, r = 0, o = !1, s = U) {
|
|
2285
2332
|
const { from: i, to: a } = t || {}, { isSameDay: c, isAfter: f, isBefore: d } = s;
|
|
2286
2333
|
let u;
|
|
2287
2334
|
if (!i && !a)
|
|
2288
2335
|
u = { from: e, to: n > 0 ? void 0 : e };
|
|
2289
2336
|
else if (i && !a)
|
|
2290
|
-
c(i, e) ? n === 0 ? u = { from: i, to: e } :
|
|
2337
|
+
c(i, e) ? n === 0 ? u = { from: i, to: e } : o ? u = { from: i, to: void 0 } : u = void 0 : d(e, i) ? u = { from: e, to: i } : u = { from: i, to: e };
|
|
2291
2338
|
else if (i && a)
|
|
2292
2339
|
if (c(i, e) && c(a, e))
|
|
2293
|
-
|
|
2340
|
+
o ? u = { from: i, to: a } : u = void 0;
|
|
2294
2341
|
else if (c(i, e))
|
|
2295
2342
|
u = { from: i, to: n > 0 ? void 0 : e };
|
|
2296
2343
|
else if (c(a, e))
|
|
@@ -2305,32 +2352,32 @@ function ls(e, t, n = 0, o = 0, r = !1, s = X) {
|
|
|
2305
2352
|
throw new Error("Invalid range");
|
|
2306
2353
|
if (u?.from && u?.to) {
|
|
2307
2354
|
const h = s.differenceInCalendarDays(u.to, u.from);
|
|
2308
|
-
|
|
2355
|
+
r > 0 && h > r ? u = { from: e, to: void 0 } : n > 1 && h < n && (u = { from: e, to: void 0 });
|
|
2309
2356
|
}
|
|
2310
2357
|
return u;
|
|
2311
2358
|
}
|
|
2312
|
-
function hs(e, t, n =
|
|
2313
|
-
const
|
|
2314
|
-
let
|
|
2359
|
+
function hs(e, t, n = U) {
|
|
2360
|
+
const r = Array.isArray(t) ? t : [t];
|
|
2361
|
+
let o = e.from;
|
|
2315
2362
|
const s = n.differenceInCalendarDays(e.to, e.from), i = Math.min(s, 6);
|
|
2316
2363
|
for (let a = 0; a <= i; a++) {
|
|
2317
|
-
if (
|
|
2364
|
+
if (r.includes(o.getDay()))
|
|
2318
2365
|
return !0;
|
|
2319
|
-
|
|
2366
|
+
o = n.addDays(o, 1);
|
|
2320
2367
|
}
|
|
2321
2368
|
return !1;
|
|
2322
2369
|
}
|
|
2323
|
-
function
|
|
2324
|
-
return
|
|
2370
|
+
function ot(e, t, n = U) {
|
|
2371
|
+
return K(e, t.from, !1, n) || K(e, t.to, !1, n) || K(t, e.from, !1, n) || K(t, e.to, !1, n);
|
|
2325
2372
|
}
|
|
2326
|
-
function ms(e, t, n =
|
|
2327
|
-
const
|
|
2328
|
-
if (
|
|
2373
|
+
function ms(e, t, n = U) {
|
|
2374
|
+
const r = Array.isArray(t) ? t : [t];
|
|
2375
|
+
if (r.filter((a) => typeof a != "function").some((a) => typeof a == "boolean" ? a : n.isDate(a) ? K(e, a, !1, n) : St(a, n) ? a.some((c) => K(e, c, !1, n)) : Ae(a) ? a.from && a.to ? ot(e, { from: a.from, to: a.to }, n) : !1 : Wt(a) ? hs(e, a.dayOfWeek, n) : Dt(a) ? n.isAfter(a.before, a.after) ? ot(e, {
|
|
2329
2376
|
from: n.addDays(a.after, 1),
|
|
2330
2377
|
to: n.addDays(a.before, -1)
|
|
2331
|
-
}, n) :
|
|
2378
|
+
}, n) : J(e.from, a, n) || J(e.to, a, n) : vt(a) || Ot(a) ? J(e.from, a, n) || J(e.to, a, n) : !1))
|
|
2332
2379
|
return !0;
|
|
2333
|
-
const i =
|
|
2380
|
+
const i = r.filter((a) => typeof a == "function");
|
|
2334
2381
|
if (i.length) {
|
|
2335
2382
|
let a = e.from;
|
|
2336
2383
|
const c = n.differenceInCalendarDays(e.to, e.from);
|
|
@@ -2343,36 +2390,36 @@ function ms(e, t, n = X) {
|
|
|
2343
2390
|
return !1;
|
|
2344
2391
|
}
|
|
2345
2392
|
function ys(e, t) {
|
|
2346
|
-
const { disabled: n, excludeDisabled:
|
|
2393
|
+
const { disabled: n, excludeDisabled: r, selected: o, required: s, onSelect: i } = e, [a, c] = ve(o, i ? o : void 0), f = i ? o : a;
|
|
2347
2394
|
return {
|
|
2348
2395
|
selected: f,
|
|
2349
2396
|
select: (h, g, p) => {
|
|
2350
2397
|
const { min: O, max: w } = e, W = h ? ls(h, f, O, w, s, t) : void 0;
|
|
2351
|
-
return
|
|
2398
|
+
return r && n && W?.from && W.to && ms({ from: W.from, to: W.to }, n, t) && (W.from = h, W.to = void 0), i || c(W), i?.(W, h, g, p), W;
|
|
2352
2399
|
},
|
|
2353
|
-
isSelected: (h) => f &&
|
|
2400
|
+
isSelected: (h) => f && K(f, h, !1, t)
|
|
2354
2401
|
};
|
|
2355
2402
|
}
|
|
2356
2403
|
function gs(e, t) {
|
|
2357
|
-
const { selected: n, required:
|
|
2404
|
+
const { selected: n, required: r, onSelect: o } = e, [s, i] = ve(n, o ? n : void 0), a = o ? n : s, { isSameDay: c } = t;
|
|
2358
2405
|
return {
|
|
2359
2406
|
selected: a,
|
|
2360
2407
|
select: (u, h, g) => {
|
|
2361
2408
|
let p = u;
|
|
2362
|
-
return !
|
|
2409
|
+
return !r && a && a && c(u, a) && (p = void 0), o || i(p), o?.(p, u, h, g), p;
|
|
2363
2410
|
},
|
|
2364
2411
|
isSelected: (u) => a ? c(a, u) : !1
|
|
2365
2412
|
};
|
|
2366
2413
|
}
|
|
2367
2414
|
function ps(e, t) {
|
|
2368
|
-
const n = gs(e, t),
|
|
2415
|
+
const n = gs(e, t), r = ds(e, t), o = ys(e, t);
|
|
2369
2416
|
switch (e.mode) {
|
|
2370
2417
|
case "single":
|
|
2371
2418
|
return n;
|
|
2372
2419
|
case "multiple":
|
|
2373
|
-
return o;
|
|
2374
|
-
case "range":
|
|
2375
2420
|
return r;
|
|
2421
|
+
case "range":
|
|
2422
|
+
return o;
|
|
2376
2423
|
default:
|
|
2377
2424
|
return;
|
|
2378
2425
|
}
|
|
@@ -2385,10 +2432,10 @@ function ws(e) {
|
|
|
2385
2432
|
from: t.selected.from ? new I(t.selected.from, t.timeZone) : void 0,
|
|
2386
2433
|
to: t.selected.to ? new I(t.selected.to, t.timeZone) : void 0
|
|
2387
2434
|
}));
|
|
2388
|
-
const { components: n, formatters:
|
|
2435
|
+
const { components: n, formatters: r, labels: o, dateLib: s, locale: i, classNames: a } = Pe(() => {
|
|
2389
2436
|
const v = { ...qe, ...t.locale };
|
|
2390
2437
|
return {
|
|
2391
|
-
dateLib: new
|
|
2438
|
+
dateLib: new R({
|
|
2392
2439
|
locale: v,
|
|
2393
2440
|
weekStartsOn: t.broadcastCalendar ? 1 : t.weekStartsOn,
|
|
2394
2441
|
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
@@ -2397,11 +2444,11 @@ function ws(e) {
|
|
|
2397
2444
|
timeZone: t.timeZone,
|
|
2398
2445
|
numerals: t.numerals
|
|
2399
2446
|
}, t.dateLib),
|
|
2400
|
-
components:
|
|
2401
|
-
formatters:
|
|
2402
|
-
labels: { ...
|
|
2447
|
+
components: ko(t.components),
|
|
2448
|
+
formatters: Eo(t.formatters),
|
|
2449
|
+
labels: { ...Qo, ...t.labels },
|
|
2403
2450
|
locale: v,
|
|
2404
|
-
classNames: { ...
|
|
2451
|
+
classNames: { ...vo(), ...t.classNames }
|
|
2405
2452
|
};
|
|
2406
2453
|
}, [
|
|
2407
2454
|
t.locale,
|
|
@@ -2417,54 +2464,54 @@ function ws(e) {
|
|
|
2417
2464
|
t.formatters,
|
|
2418
2465
|
t.labels,
|
|
2419
2466
|
t.classNames
|
|
2420
|
-
]), { captionLayout: c, mode: f, navLayout: d, numberOfMonths: u = 1, onDayBlur: h, onDayClick: g, onDayFocus: p, onDayKeyDown: O, onDayMouseEnter: w, onDayMouseLeave: W, onNextClick: N, onPrevClick:
|
|
2421
|
-
|
|
2422
|
-
}, [
|
|
2423
|
-
|
|
2424
|
-
}, [
|
|
2425
|
-
|
|
2426
|
-
}, [Ce, g, Me]), Gt =
|
|
2427
|
-
Me(v), p?.(v.date,
|
|
2428
|
-
}, [p, Me]), zt =
|
|
2429
|
-
je(), h?.(v.date,
|
|
2430
|
-
}, [je, h]),
|
|
2431
|
-
const
|
|
2467
|
+
]), { captionLayout: c, mode: f, navLayout: d, numberOfMonths: u = 1, onDayBlur: h, onDayClick: g, onDayFocus: p, onDayKeyDown: O, onDayMouseEnter: w, onDayMouseLeave: W, onNextClick: N, onPrevClick: M, showWeekNumber: T, styles: y } = t, { formatCaption: D, formatDay: k, formatMonthDropdown: C, formatWeekNumber: B, formatWeekNumberHeader: H, formatWeekdayName: q, formatYearDropdown: Z } = r, re = is(t, s), { days: oe, months: se, navStart: we, navEnd: Oe, previousMonth: G, nextMonth: z, goToMonth: V } = re, We = bo(oe, t, we, Oe, s), { isSelected: Se, select: Ce, selected: be } = ps(t, s) ?? {}, { blur: je, focused: $e, isFocusTarget: Et, moveFocus: Re, setFocused: Me } = fs(t, re, We, Se ?? (() => !1), s), { labelDayButton: Pt, labelGridcell: _t, labelGrid: Ft, labelMonthDropdown: Bt, labelNav: Ze, labelPrevious: It, labelNext: Ht, labelWeekday: qt, labelWeekNumber: At, labelWeekNumberHeader: jt, labelYearDropdown: $t } = o, Rt = Pe(() => Fo(s, t.ISOWeek), [s, t.ISOWeek]), Ge = f !== void 0 || g !== void 0, Ne = j(() => {
|
|
2468
|
+
G && (V(G), M?.(G));
|
|
2469
|
+
}, [G, V, M]), xe = j(() => {
|
|
2470
|
+
z && (V(z), N?.(z));
|
|
2471
|
+
}, [V, z, N]), Zt = j((v, P) => (b) => {
|
|
2472
|
+
b.preventDefault(), b.stopPropagation(), Me(v), Ce?.(v.date, P, b), g?.(v.date, P, b);
|
|
2473
|
+
}, [Ce, g, Me]), Gt = j((v, P) => (b) => {
|
|
2474
|
+
Me(v), p?.(v.date, P, b);
|
|
2475
|
+
}, [p, Me]), zt = j((v, P) => (b) => {
|
|
2476
|
+
je(), h?.(v.date, P, b);
|
|
2477
|
+
}, [je, h]), Lt = j((v, P) => (b) => {
|
|
2478
|
+
const E = {
|
|
2432
2479
|
ArrowLeft: [
|
|
2433
|
-
|
|
2480
|
+
b.shiftKey ? "month" : "day",
|
|
2434
2481
|
t.dir === "rtl" ? "after" : "before"
|
|
2435
2482
|
],
|
|
2436
2483
|
ArrowRight: [
|
|
2437
|
-
|
|
2484
|
+
b.shiftKey ? "month" : "day",
|
|
2438
2485
|
t.dir === "rtl" ? "before" : "after"
|
|
2439
2486
|
],
|
|
2440
|
-
ArrowDown: [
|
|
2441
|
-
ArrowUp: [
|
|
2442
|
-
PageUp: [
|
|
2443
|
-
PageDown: [
|
|
2487
|
+
ArrowDown: [b.shiftKey ? "year" : "week", "after"],
|
|
2488
|
+
ArrowUp: [b.shiftKey ? "year" : "week", "before"],
|
|
2489
|
+
PageUp: [b.shiftKey ? "year" : "month", "before"],
|
|
2490
|
+
PageDown: [b.shiftKey ? "year" : "month", "after"],
|
|
2444
2491
|
Home: ["startOfWeek", "before"],
|
|
2445
2492
|
End: ["endOfWeek", "after"]
|
|
2446
2493
|
};
|
|
2447
|
-
if (
|
|
2448
|
-
|
|
2449
|
-
const [
|
|
2450
|
-
Re(
|
|
2494
|
+
if (E[b.key]) {
|
|
2495
|
+
b.preventDefault(), b.stopPropagation();
|
|
2496
|
+
const [A, S] = E[b.key];
|
|
2497
|
+
Re(A, S);
|
|
2451
2498
|
}
|
|
2452
|
-
O?.(v.date,
|
|
2453
|
-
}, [Re, O, t.dir]),
|
|
2454
|
-
w?.(v.date,
|
|
2455
|
-
}, [w]), Xt =
|
|
2456
|
-
W?.(v.date,
|
|
2457
|
-
}, [W]), Ut =
|
|
2458
|
-
const
|
|
2459
|
-
|
|
2460
|
-
}, [s,
|
|
2461
|
-
const
|
|
2462
|
-
|
|
2463
|
-
}, [s,
|
|
2499
|
+
O?.(v.date, P, b);
|
|
2500
|
+
}, [Re, O, t.dir]), Qt = j((v, P) => (b) => {
|
|
2501
|
+
w?.(v.date, P, b);
|
|
2502
|
+
}, [w]), Xt = j((v, P) => (b) => {
|
|
2503
|
+
W?.(v.date, P, b);
|
|
2504
|
+
}, [W]), Ut = j((v) => (P) => {
|
|
2505
|
+
const b = Number(P.target.value), E = s.setMonth(s.startOfMonth(v), b);
|
|
2506
|
+
V(E);
|
|
2507
|
+
}, [s, V]), Vt = j((v) => (P) => {
|
|
2508
|
+
const b = Number(P.target.value), E = s.setYear(s.startOfMonth(v), b);
|
|
2509
|
+
V(E);
|
|
2510
|
+
}, [s, V]), { className: Kt, style: Jt } = Pe(() => ({
|
|
2464
2511
|
className: [a[m.Root], t.className].filter(Boolean).join(" "),
|
|
2465
2512
|
style: { ...y?.[m.Root], ...t.style }
|
|
2466
|
-
}), [a, t.className, t.style, y]), en =
|
|
2467
|
-
|
|
2513
|
+
}), [a, t.className, t.style, y]), en = Do(t), ze = ke(null);
|
|
2514
|
+
Ko(ze, !!t.animate, {
|
|
2468
2515
|
classNames: a,
|
|
2469
2516
|
months: se,
|
|
2470
2517
|
focused: $e,
|
|
@@ -2476,47 +2523,49 @@ function ws(e) {
|
|
|
2476
2523
|
select: Ce,
|
|
2477
2524
|
isSelected: Se,
|
|
2478
2525
|
months: se,
|
|
2479
|
-
nextMonth:
|
|
2480
|
-
previousMonth:
|
|
2481
|
-
goToMonth:
|
|
2526
|
+
nextMonth: z,
|
|
2527
|
+
previousMonth: G,
|
|
2528
|
+
goToMonth: V,
|
|
2482
2529
|
getModifiers: We,
|
|
2483
2530
|
components: n,
|
|
2484
2531
|
classNames: a,
|
|
2485
2532
|
styles: y,
|
|
2486
|
-
labels:
|
|
2487
|
-
formatters:
|
|
2533
|
+
labels: o,
|
|
2534
|
+
formatters: r
|
|
2488
2535
|
};
|
|
2489
2536
|
return l.createElement(
|
|
2490
2537
|
kt.Provider,
|
|
2491
2538
|
{ value: tn },
|
|
2492
2539
|
l.createElement(
|
|
2493
2540
|
n.Root,
|
|
2494
|
-
{ rootRef: t.animate ? ze : void 0, className: Kt, style: Jt, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], ...en },
|
|
2541
|
+
{ rootRef: t.animate ? ze : void 0, className: Kt, style: Jt, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...en },
|
|
2495
2542
|
l.createElement(
|
|
2496
2543
|
n.Months,
|
|
2497
2544
|
{ className: a[m.Months], style: y?.[m.Months] },
|
|
2498
|
-
!t.hideNavigation && !d && l.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: a[m.Nav], style: y?.[m.Nav], "aria-label": Ze(), onPreviousClick: Ne, onNextClick: xe, previousMonth:
|
|
2499
|
-
se.map((v,
|
|
2545
|
+
!t.hideNavigation && !d && l.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: a[m.Nav], style: y?.[m.Nav], "aria-label": Ze(), onPreviousClick: Ne, onNextClick: xe, previousMonth: G, nextMonth: z }),
|
|
2546
|
+
se.map((v, P) => l.createElement(
|
|
2500
2547
|
n.Month,
|
|
2501
2548
|
{
|
|
2502
2549
|
"data-animated-month": t.animate ? "true" : void 0,
|
|
2503
2550
|
className: a[m.Month],
|
|
2504
2551
|
style: y?.[m.Month],
|
|
2505
2552
|
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
2506
|
-
key:
|
|
2507
|
-
displayIndex:
|
|
2553
|
+
key: P,
|
|
2554
|
+
displayIndex: P,
|
|
2508
2555
|
calendarMonth: v
|
|
2509
2556
|
},
|
|
2510
|
-
d === "around" && !t.hideNavigation &&
|
|
2557
|
+
d === "around" && !t.hideNavigation && P === 0 && l.createElement(
|
|
2511
2558
|
n.PreviousMonthButton,
|
|
2512
|
-
{ type: "button", className: a[m.PreviousMonthButton], tabIndex:
|
|
2513
|
-
l.createElement(n.Chevron, { disabled:
|
|
2559
|
+
{ type: "button", className: a[m.PreviousMonthButton], tabIndex: G ? void 0 : -1, "aria-disabled": G ? void 0 : !0, "aria-label": It(G), onClick: Ne, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2560
|
+
l.createElement(n.Chevron, { disabled: G ? void 0 : !0, className: a[m.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
2514
2561
|
),
|
|
2515
|
-
l.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: a[m.MonthCaption], style: y?.[m.MonthCaption], calendarMonth: v, displayIndex:
|
|
2562
|
+
l.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: a[m.MonthCaption], style: y?.[m.MonthCaption], calendarMonth: v, displayIndex: P }, c?.startsWith("dropdown") ? l.createElement(
|
|
2516
2563
|
n.DropdownNav,
|
|
2517
2564
|
{ className: a[m.Dropdowns], style: y?.[m.Dropdowns] },
|
|
2518
|
-
|
|
2519
|
-
|
|
2565
|
+
(() => {
|
|
2566
|
+
const b = c === "dropdown" || c === "dropdown-months" ? l.createElement(n.MonthsDropdown, { key: "month", className: a[m.MonthsDropdown], "aria-label": Bt(), classNames: a, components: n, disabled: !!t.disableNavigation, onChange: Ut(v.date), options: Po(v.date, we, Oe, r, s), style: y?.[m.Dropdown], value: s.getMonth(v.date) }) : l.createElement("span", { key: "month" }, C(v.date, s)), E = c === "dropdown" || c === "dropdown-years" ? l.createElement(n.YearsDropdown, { key: "year", className: a[m.YearsDropdown], "aria-label": $t(s.options), classNames: a, components: n, disabled: !!t.disableNavigation, onChange: Vt(v.date), options: Bo(we, Oe, r, s, !!t.reverseYears), style: y?.[m.Dropdown], value: s.getYear(v.date) }) : l.createElement("span", { key: "year" }, Z(v.date, s));
|
|
2567
|
+
return s.getMonthYearOrder() === "year-first" ? [E, b] : [b, E];
|
|
2568
|
+
})(),
|
|
2520
2569
|
l.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
2521
2570
|
border: 0,
|
|
2522
2571
|
clip: "rect(0 0 0 0)",
|
|
@@ -2528,43 +2577,43 @@ function ws(e) {
|
|
|
2528
2577
|
width: "1px",
|
|
2529
2578
|
whiteSpace: "nowrap",
|
|
2530
2579
|
wordWrap: "normal"
|
|
2531
|
-
} },
|
|
2580
|
+
} }, D(v.date, s.options, s))
|
|
2532
2581
|
) : (
|
|
2533
2582
|
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
2534
|
-
l.createElement(n.CaptionLabel, { className: a[m.CaptionLabel], role: "status", "aria-live": "polite" },
|
|
2583
|
+
l.createElement(n.CaptionLabel, { className: a[m.CaptionLabel], role: "status", "aria-live": "polite" }, D(v.date, s.options, s))
|
|
2535
2584
|
)),
|
|
2536
|
-
d === "around" && !t.hideNavigation &&
|
|
2585
|
+
d === "around" && !t.hideNavigation && P === u - 1 && l.createElement(
|
|
2537
2586
|
n.NextMonthButton,
|
|
2538
|
-
{ type: "button", className: a[m.NextMonthButton], tabIndex:
|
|
2539
|
-
l.createElement(n.Chevron, { disabled:
|
|
2587
|
+
{ type: "button", className: a[m.NextMonthButton], tabIndex: z ? void 0 : -1, "aria-disabled": z ? void 0 : !0, "aria-label": Ht(z), onClick: xe, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2588
|
+
l.createElement(n.Chevron, { disabled: z ? void 0 : !0, className: a[m.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
2540
2589
|
),
|
|
2541
|
-
|
|
2590
|
+
P === u - 1 && d === "after" && !t.hideNavigation && l.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: a[m.Nav], style: y?.[m.Nav], "aria-label": Ze(), onPreviousClick: Ne, onNextClick: xe, previousMonth: G, nextMonth: z }),
|
|
2542
2591
|
l.createElement(
|
|
2543
2592
|
n.MonthGrid,
|
|
2544
2593
|
{ role: "grid", "aria-multiselectable": f === "multiple" || f === "range", "aria-label": Ft(v.date, s.options, s) || void 0, className: a[m.MonthGrid], style: y?.[m.MonthGrid] },
|
|
2545
2594
|
!t.hideWeekdays && l.createElement(
|
|
2546
2595
|
n.Weekdays,
|
|
2547
2596
|
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: a[m.Weekdays], style: y?.[m.Weekdays] },
|
|
2548
|
-
|
|
2549
|
-
Rt.map((
|
|
2597
|
+
T && l.createElement(n.WeekNumberHeader, { "aria-label": jt(s.options), className: a[m.WeekNumberHeader], style: y?.[m.WeekNumberHeader], scope: "col" }, H()),
|
|
2598
|
+
Rt.map((b) => l.createElement(n.Weekday, { "aria-label": qt(b, s.options, s), className: a[m.Weekday], key: String(b), style: y?.[m.Weekday], scope: "col" }, q(b, s.options, s)))
|
|
2550
2599
|
),
|
|
2551
|
-
l.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: a[m.Weeks], style: y?.[m.Weeks] }, v.weeks.map((
|
|
2600
|
+
l.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: a[m.Weeks], style: y?.[m.Weeks] }, v.weeks.map((b) => l.createElement(
|
|
2552
2601
|
n.Week,
|
|
2553
|
-
{ className: a[m.Week], key:
|
|
2554
|
-
|
|
2555
|
-
l.createElement(n.WeekNumber, { week:
|
|
2602
|
+
{ className: a[m.Week], key: b.weekNumber, style: y?.[m.Week], week: b },
|
|
2603
|
+
T && // biome-ignore lint/a11y/useSemanticElements: react component
|
|
2604
|
+
l.createElement(n.WeekNumber, { week: b, style: y?.[m.WeekNumber], "aria-label": At(b.weekNumber, {
|
|
2556
2605
|
locale: i
|
|
2557
|
-
}), className: a[m.WeekNumber], scope: "row", role: "rowheader" }, B(
|
|
2558
|
-
|
|
2559
|
-
const { date:
|
|
2560
|
-
if (S[_.focused] = !S.hidden && !!$e?.isEqualTo(
|
|
2561
|
-
const { from:
|
|
2562
|
-
S[
|
|
2606
|
+
}), className: a[m.WeekNumber], scope: "row", role: "rowheader" }, B(b.weekNumber, s)),
|
|
2607
|
+
b.days.map((E) => {
|
|
2608
|
+
const { date: A } = E, S = We(E);
|
|
2609
|
+
if (S[_.focused] = !S.hidden && !!$e?.isEqualTo(E), S[L.selected] = Se?.(A) || S.selected, Ae(be)) {
|
|
2610
|
+
const { from: Ye, to: Te } = be;
|
|
2611
|
+
S[L.range_start] = !!(Ye && Te && s.isSameDay(A, Ye)), S[L.range_end] = !!(Ye && Te && s.isSameDay(A, Te)), S[L.range_middle] = K(be, A, !0, s);
|
|
2563
2612
|
}
|
|
2564
|
-
const nn =
|
|
2613
|
+
const nn = _o(S, y, t.modifiersStyles), rn = Mo(S, a, t.modifiersClassNames), on = !Ge && !S.hidden ? _t(A, S, s.options, s) : void 0;
|
|
2565
2614
|
return (
|
|
2566
2615
|
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
2567
|
-
l.createElement(n.Day, { key: `${s.format(
|
|
2616
|
+
l.createElement(n.Day, { key: `${s.format(A, "yyyy-MM-dd")}_${s.format(E.displayMonth, "yyyy-MM")}`, day: E, modifiers: S, className: rn.join(" "), style: nn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": on, "data-day": s.format(A, "yyyy-MM-dd"), "data-month": E.outside ? s.format(A, "yyyy-MM") : void 0, "data-selected": S.selected || void 0, "data-disabled": S.disabled || void 0, "data-hidden": S.hidden || void 0, "data-outside": E.outside || void 0, "data-focused": S.focused || void 0, "data-today": S.today || void 0 }, !S.hidden && Ge ? l.createElement(n.DayButton, { className: a[m.DayButton], style: y?.[m.DayButton], type: "button", day: E, modifiers: S, disabled: S.disabled || void 0, tabIndex: Et(E) ? 0 : -1, "aria-label": Pt(A, S, s.options, s), onClick: Zt(E, S), onBlur: zt(E, S), onFocus: Gt(E, S), onKeyDown: Lt(E, S), onMouseEnter: Qt(E, S), onMouseLeave: Xt(E, S) }, k(A, s.options, s)) : !S.hidden && k(E.date, s.options, s))
|
|
2568
2617
|
);
|
|
2569
2618
|
})
|
|
2570
2619
|
)))
|
|
@@ -2580,15 +2629,15 @@ const bs = ({
|
|
|
2580
2629
|
className: e,
|
|
2581
2630
|
showOutsideDays: t = !0,
|
|
2582
2631
|
animate: n = !0,
|
|
2583
|
-
arrowClassName:
|
|
2584
|
-
monthsClassName:
|
|
2632
|
+
arrowClassName: r,
|
|
2633
|
+
monthsClassName: o,
|
|
2585
2634
|
defaultSelected: s,
|
|
2586
2635
|
onSelect: i,
|
|
2587
2636
|
...a
|
|
2588
2637
|
}) => {
|
|
2589
2638
|
const [c, f] = De(
|
|
2590
2639
|
() => s
|
|
2591
|
-
), d =
|
|
2640
|
+
), d = j(
|
|
2592
2641
|
(u) => {
|
|
2593
2642
|
u && (f(u), i?.(u));
|
|
2594
2643
|
},
|
|
@@ -2612,12 +2661,12 @@ const bs = ({
|
|
|
2612
2661
|
month_caption: "text-slate-700 font-semibold text-sm pl-1 h-[32px] flex items-center",
|
|
2613
2662
|
months: ue(
|
|
2614
2663
|
"flex flex-col relative px-5 py-4 rounded-lg shadow-md px-6 py-4 w-[307px] justify-center items-center",
|
|
2615
|
-
|
|
2664
|
+
o
|
|
2616
2665
|
),
|
|
2617
2666
|
month: "flex flex-col gap-4",
|
|
2618
2667
|
nav: ue(
|
|
2619
2668
|
"absolute right-4 top-3.5 flex justify-center items-center gap-[4px]",
|
|
2620
|
-
|
|
2669
|
+
r
|
|
2621
2670
|
),
|
|
2622
2671
|
outside: "text-slate-400",
|
|
2623
2672
|
selected: "[&>button]:bg-blue-600 [&>button]:text-white [&>button]:hover:bg-blue-700 [&>button]:transition-all [&>button]:duration-300 [&>button]:rounded-full",
|