prometeo-design-system 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button-Bc0LYLfg.js +183 -0
- package/dist/Button.es.js +2 -151
- package/dist/DatePicker.es.js +413 -382
- package/dist/DrawerDesktop.es.js +128 -53
- package/dist/Input.es.js +67 -63
- package/dist/components/DatePicker/DatePicker.d.ts +6 -6
- package/dist/components/Drawer/DrawerDesktop.d.ts +6 -4
- package/dist/components/Drawer/DrawerDesktop_old.d.ts +15 -0
- package/dist/components/Input/Input.d.ts +3 -1
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +13 -13
- package/package.json +1 -1
- package/dist/components/Drawer/DrawerDesktopV2.d.ts +0 -11
- package/dist/index-BOQuZ0gG.js +0 -34
- /package/dist/pages/{Drawer.d.ts → DrawersPage.d.ts} +0 -0
package/dist/DatePicker.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as $ } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
-
import m, { createContext as mn, useContext as hn, useCallback as q, useRef as
|
|
2
|
+
import m, { createContext as mn, useContext as hn, useCallback as q, useRef as Se, useLayoutEffect as yn, useState as he, useEffect as _e, useMemo as fe, memo as pn } from "react";
|
|
3
3
|
import { InputMultiple as gn } from "./InputMultiple.es.js";
|
|
4
4
|
import wn from "./Input.es.js";
|
|
5
5
|
import { createPortal as bn } from "react-dom";
|
|
6
|
-
import { Icons as
|
|
7
|
-
import { c as
|
|
8
|
-
import
|
|
6
|
+
import { Icons as Mt } from "./Icons.es.js";
|
|
7
|
+
import { c as Be } from "./cn-B6yFEsav.js";
|
|
8
|
+
import { B as vt } from "./Button-Bc0LYLfg.js";
|
|
9
9
|
function Mn(e, t, n = "long") {
|
|
10
10
|
return new Intl.DateTimeFormat("en-US", {
|
|
11
11
|
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
@@ -14,29 +14,29 @@ function Mn(e, t, n = "long") {
|
|
|
14
14
|
timeZoneName: n
|
|
15
15
|
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
16
16
|
}
|
|
17
|
-
const vn = {},
|
|
18
|
-
function
|
|
17
|
+
const vn = {}, Fe = {};
|
|
18
|
+
function ke(e, t) {
|
|
19
19
|
try {
|
|
20
20
|
const o = (vn[e] ||= new Intl.DateTimeFormat("en-US", {
|
|
21
21
|
timeZone: e,
|
|
22
22
|
timeZoneName: "longOffset"
|
|
23
23
|
}).format)(t).split("GMT")[1];
|
|
24
|
-
return o in
|
|
24
|
+
return o in Fe ? Fe[o] : Dt(o, o.split(":"));
|
|
25
25
|
} catch {
|
|
26
|
-
if (e in
|
|
26
|
+
if (e in Fe) return Fe[e];
|
|
27
27
|
const n = e?.match(Dn);
|
|
28
|
-
return n ?
|
|
28
|
+
return n ? Dt(e, n.slice(1)) : NaN;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
const Dn = /([+-]\d\d):?(\d\d)?/;
|
|
32
|
-
function
|
|
32
|
+
function Dt(e, t) {
|
|
33
33
|
const n = +(t[0] || 0), o = +(t[1] || 0), r = +(t[2] || 0) / 60;
|
|
34
|
-
return
|
|
34
|
+
return Fe[e] = n * 60 + o > 0 ? n * 60 + o + r : n * 60 - o - r;
|
|
35
35
|
}
|
|
36
36
|
class re extends Date {
|
|
37
37
|
//#region static
|
|
38
38
|
constructor(...t) {
|
|
39
|
-
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(
|
|
39
|
+
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ke(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)), _t(this), pt(this)) : this.setTime(Date.now());
|
|
40
40
|
}
|
|
41
41
|
static tz(t, ...n) {
|
|
42
42
|
return n.length ? new re(...n, t) : new re(Date.now(), t);
|
|
@@ -47,13 +47,13 @@ class re extends Date {
|
|
|
47
47
|
return new re(+this, t);
|
|
48
48
|
}
|
|
49
49
|
getTimezoneOffset() {
|
|
50
|
-
const t = -
|
|
50
|
+
const t = -ke(this.timeZone, this);
|
|
51
51
|
return t > 0 ? Math.floor(t) : Math.ceil(t);
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region time
|
|
55
55
|
setTime(t) {
|
|
56
|
-
return Date.prototype.setTime.apply(this, arguments),
|
|
56
|
+
return Date.prototype.setTime.apply(this, arguments), pt(this), +this;
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region date-fns integration
|
|
@@ -62,26 +62,26 @@ class re extends Date {
|
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const kt = /^(get|set)(?!UTC)/;
|
|
66
66
|
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
67
|
-
if (!
|
|
68
|
-
const t = e.replace(
|
|
67
|
+
if (!kt.test(e)) return;
|
|
68
|
+
const t = e.replace(kt, "$1UTC");
|
|
69
69
|
re.prototype[t] && (e.startsWith("get") ? re.prototype[e] = function() {
|
|
70
70
|
return this.internal[t]();
|
|
71
71
|
} : (re.prototype[e] = function() {
|
|
72
72
|
return Date.prototype[t].apply(this.internal, arguments), kn(this), +this;
|
|
73
73
|
}, re.prototype[t] = function() {
|
|
74
|
-
return Date.prototype[t].apply(this, arguments),
|
|
74
|
+
return Date.prototype[t].apply(this, arguments), pt(this), +this;
|
|
75
75
|
}));
|
|
76
76
|
});
|
|
77
|
-
function
|
|
78
|
-
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-
|
|
77
|
+
function pt(e) {
|
|
78
|
+
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-ke(e.timeZone, e) * 60));
|
|
79
79
|
}
|
|
80
80
|
function kn(e) {
|
|
81
|
-
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()),
|
|
81
|
+
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()), _t(e);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
const t =
|
|
83
|
+
function _t(e) {
|
|
84
|
+
const t = ke(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), o = /* @__PURE__ */ new Date(+e);
|
|
85
85
|
o.setUTCHours(o.getUTCHours() - 1);
|
|
86
86
|
const r = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+o)).getTimezoneOffset(), i = r - a, s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
87
87
|
i && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + i);
|
|
@@ -89,19 +89,19 @@ function Nt(e) {
|
|
|
89
89
|
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
90
90
|
const d = /* @__PURE__ */ new Date(+e);
|
|
91
91
|
d.setUTCSeconds(0);
|
|
92
|
-
const l = r > 0 ? d.getSeconds() : (d.getSeconds() - 60) % 60, u = Math.round(-(
|
|
92
|
+
const l = r > 0 ? d.getSeconds() : (d.getSeconds() - 60) % 60, u = Math.round(-(ke(e.timeZone, e) * 60)) % 60;
|
|
93
93
|
(u || l) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + u + l));
|
|
94
|
-
const f =
|
|
94
|
+
const f = ke(e.timeZone, e), w = f > 0 ? Math.floor(f) : Math.ceil(f), W = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - w, b = w !== n, O = W - c;
|
|
95
95
|
if (b && O) {
|
|
96
96
|
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + O);
|
|
97
|
-
const y =
|
|
97
|
+
const y = ke(e.timeZone, e), g = y > 0 ? Math.floor(y) : Math.ceil(y), x = w - g;
|
|
98
98
|
x && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + x), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + x));
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class R extends re {
|
|
102
102
|
//#region static
|
|
103
103
|
static tz(t, ...n) {
|
|
104
|
-
return n.length ? new
|
|
104
|
+
return n.length ? new R(...n, t) : new R(Date.now(), t);
|
|
105
105
|
}
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region representation
|
|
@@ -146,26 +146,26 @@ class L extends re {
|
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
148
|
withTimeZone(t) {
|
|
149
|
-
return new
|
|
149
|
+
return new R(+this, t);
|
|
150
150
|
}
|
|
151
151
|
//#region date-fns integration
|
|
152
152
|
[Symbol.for("constructDateFrom")](t) {
|
|
153
|
-
return new
|
|
153
|
+
return new R(+new Date(t), this.timeZone);
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
156
|
}
|
|
157
|
-
const
|
|
157
|
+
const Ft = 6048e5, On = 864e5, Ot = Symbol.for("constructDateFrom");
|
|
158
158
|
function A(e, t) {
|
|
159
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" &&
|
|
159
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && Ot in e ? e[Ot](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
160
160
|
}
|
|
161
161
|
function Y(e, t) {
|
|
162
162
|
return A(t || e, e);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Bt(e, t, n) {
|
|
165
165
|
const o = Y(e, n?.in);
|
|
166
166
|
return isNaN(t) ? A(e, NaN) : (t && o.setDate(o.getDate() + t), o);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function It(e, t, n) {
|
|
169
169
|
const o = Y(e, n?.in);
|
|
170
170
|
if (isNaN(t)) return A(e, NaN);
|
|
171
171
|
if (!t)
|
|
@@ -180,25 +180,25 @@ function Yt(e, t, n) {
|
|
|
180
180
|
), o);
|
|
181
181
|
}
|
|
182
182
|
let Wn = {};
|
|
183
|
-
function
|
|
183
|
+
function He() {
|
|
184
184
|
return Wn;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const n =
|
|
186
|
+
function xe(e, t) {
|
|
187
|
+
const n = He(), o = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, r = Y(e, t?.in), a = r.getDay(), i = (a < o ? 7 : 0) + a - o;
|
|
188
188
|
return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
190
|
+
function Ie(e, t) {
|
|
191
|
+
return xe(e, { ...t, weekStartsOn: 1 });
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function jt(e, t) {
|
|
194
194
|
const n = Y(e, t?.in), o = n.getFullYear(), r = A(n, 0);
|
|
195
195
|
r.setFullYear(o + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
196
|
-
const a =
|
|
196
|
+
const a = Ie(r), i = A(n, 0);
|
|
197
197
|
i.setFullYear(o, 0, 4), i.setHours(0, 0, 0, 0);
|
|
198
|
-
const s =
|
|
198
|
+
const s = Ie(i);
|
|
199
199
|
return n.getTime() >= a.getTime() ? o + 1 : n.getTime() >= s.getTime() ? o : o - 1;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Wt(e) {
|
|
202
202
|
const t = Y(e), n = new Date(
|
|
203
203
|
Date.UTC(
|
|
204
204
|
t.getFullYear(),
|
|
@@ -212,34 +212,34 @@ function Mt(e) {
|
|
|
212
212
|
);
|
|
213
213
|
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Ne(e, ...t) {
|
|
216
216
|
const n = A.bind(
|
|
217
217
|
null,
|
|
218
218
|
t.find((o) => typeof o == "object")
|
|
219
219
|
);
|
|
220
220
|
return t.map(n);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function je(e, t) {
|
|
223
223
|
const n = Y(e, t?.in);
|
|
224
224
|
return n.setHours(0, 0, 0, 0), n;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
const [o, r] =
|
|
226
|
+
function Ht(e, t, n) {
|
|
227
|
+
const [o, r] = Ne(
|
|
228
228
|
n?.in,
|
|
229
229
|
e,
|
|
230
230
|
t
|
|
231
|
-
), a =
|
|
231
|
+
), a = je(o), i = je(r), s = +a - Wt(a), c = +i - Wt(i);
|
|
232
232
|
return Math.round((s - c) / On);
|
|
233
233
|
}
|
|
234
234
|
function Sn(e, t) {
|
|
235
|
-
const n =
|
|
236
|
-
return o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0),
|
|
235
|
+
const n = jt(e, t), o = A(e, 0);
|
|
236
|
+
return o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0), Ie(o);
|
|
237
237
|
}
|
|
238
238
|
function Cn(e, t, n) {
|
|
239
|
-
return
|
|
239
|
+
return Bt(e, t * 7, n);
|
|
240
240
|
}
|
|
241
241
|
function xn(e, t, n) {
|
|
242
|
-
return
|
|
242
|
+
return It(e, t * 12, n);
|
|
243
243
|
}
|
|
244
244
|
function Nn(e, t) {
|
|
245
245
|
let n, o = t?.in;
|
|
@@ -258,21 +258,21 @@ function Pn(e, t) {
|
|
|
258
258
|
}), A(o, n || NaN);
|
|
259
259
|
}
|
|
260
260
|
function Tn(e, t, n) {
|
|
261
|
-
const [o, r] =
|
|
261
|
+
const [o, r] = Ne(
|
|
262
262
|
n?.in,
|
|
263
263
|
e,
|
|
264
264
|
t
|
|
265
265
|
);
|
|
266
|
-
return +
|
|
266
|
+
return +je(o) == +je(r);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function At(e) {
|
|
269
269
|
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
270
270
|
}
|
|
271
271
|
function Yn(e) {
|
|
272
|
-
return !(!
|
|
272
|
+
return !(!At(e) && typeof e != "number" || isNaN(+Y(e)));
|
|
273
273
|
}
|
|
274
274
|
function En(e, t, n) {
|
|
275
|
-
const [o, r] =
|
|
275
|
+
const [o, r] = Ne(
|
|
276
276
|
n?.in,
|
|
277
277
|
e,
|
|
278
278
|
t
|
|
@@ -283,12 +283,12 @@ function _n(e, t) {
|
|
|
283
283
|
const n = Y(e, t?.in), o = n.getMonth();
|
|
284
284
|
return n.setFullYear(n.getFullYear(), o + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
const [n, o] =
|
|
286
|
+
function $t(e, t) {
|
|
287
|
+
const [n, o] = Ne(e, t.start, t.end);
|
|
288
288
|
return { start: n, end: o };
|
|
289
289
|
}
|
|
290
290
|
function Fn(e, t) {
|
|
291
|
-
const { start: n, end: o } =
|
|
291
|
+
const { start: n, end: o } = $t(t?.in, e);
|
|
292
292
|
let r = +n > +o;
|
|
293
293
|
const a = r ? +n : +o, i = r ? o : n;
|
|
294
294
|
i.setHours(0, 0, 0, 0), i.setDate(1);
|
|
@@ -302,16 +302,16 @@ function Bn(e, t) {
|
|
|
302
302
|
const n = Y(e, t?.in);
|
|
303
303
|
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function In(e, t) {
|
|
306
306
|
const n = Y(e, t?.in), o = n.getFullYear();
|
|
307
307
|
return n.setFullYear(o + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function qt(e, t) {
|
|
310
310
|
const n = Y(e, t?.in);
|
|
311
311
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
const { start: n, end: o } =
|
|
313
|
+
function jn(e, t) {
|
|
314
|
+
const { start: n, end: o } = $t(t?.in, e);
|
|
315
315
|
let r = +n > +o;
|
|
316
316
|
const a = r ? +n : +o, i = r ? o : n;
|
|
317
317
|
i.setHours(0, 0, 0, 0), i.setMonth(0, 1);
|
|
@@ -321,12 +321,12 @@ function In(e, t) {
|
|
|
321
321
|
c.push(A(n, i)), i.setFullYear(i.getFullYear() + s);
|
|
322
322
|
return r ? c.reverse() : c;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
const n =
|
|
324
|
+
function Rt(e, t) {
|
|
325
|
+
const n = He(), o = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, r = Y(e, t?.in), a = r.getDay(), i = (a < o ? -7 : 0) + 6 - (a - o);
|
|
326
326
|
return r.setDate(r.getDate() + i), r.setHours(23, 59, 59, 999), r;
|
|
327
327
|
}
|
|
328
328
|
function Hn(e, t) {
|
|
329
|
-
return
|
|
329
|
+
return Rt(e, { ...t, weekStartsOn: 1 });
|
|
330
330
|
}
|
|
331
331
|
const An = {
|
|
332
332
|
lessThanXSeconds: {
|
|
@@ -395,7 +395,7 @@ const An = {
|
|
|
395
395
|
const r = An[e];
|
|
396
396
|
return typeof r == "string" ? o = r : t === 1 ? o = r.one : o = r.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + o : o + " ago" : o;
|
|
397
397
|
};
|
|
398
|
-
function
|
|
398
|
+
function Ce(e) {
|
|
399
399
|
return (t = {}) => {
|
|
400
400
|
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
401
401
|
return e.formats[n] || e.formats[e.defaultWidth];
|
|
@@ -417,15 +417,15 @@ const qn = {
|
|
|
417
417
|
medium: "{{date}}, {{time}}",
|
|
418
418
|
short: "{{date}}, {{time}}"
|
|
419
419
|
}, zn = {
|
|
420
|
-
date:
|
|
420
|
+
date: Ce({
|
|
421
421
|
formats: qn,
|
|
422
422
|
defaultWidth: "full"
|
|
423
423
|
}),
|
|
424
|
-
time:
|
|
424
|
+
time: Ce({
|
|
425
425
|
formats: Rn,
|
|
426
426
|
defaultWidth: "full"
|
|
427
427
|
}),
|
|
428
|
-
dateTime:
|
|
428
|
+
dateTime: Ce({
|
|
429
429
|
formats: Ln,
|
|
430
430
|
defaultWidth: "full"
|
|
431
431
|
})
|
|
@@ -631,7 +631,7 @@ function oo(e, t) {
|
|
|
631
631
|
if (t(e[n]))
|
|
632
632
|
return n;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function Lt(e) {
|
|
635
635
|
return (t, n = {}) => {
|
|
636
636
|
const o = t.match(e.matchPattern);
|
|
637
637
|
if (!o) return null;
|
|
@@ -711,7 +711,7 @@ const ro = /^(\d+)(th|st|nd|rd)?/i, ao = /\d+/i, so = {
|
|
|
711
711
|
night: /night/i
|
|
712
712
|
}
|
|
713
713
|
}, go = {
|
|
714
|
-
ordinalNumber:
|
|
714
|
+
ordinalNumber: Lt({
|
|
715
715
|
matchPattern: ro,
|
|
716
716
|
parsePattern: ao,
|
|
717
717
|
valueCallback: (e) => parseInt(e, 10)
|
|
@@ -747,7 +747,7 @@ const ro = /^(\d+)(th|st|nd|rd)?/i, ao = /\d+/i, so = {
|
|
|
747
747
|
parsePatterns: po,
|
|
748
748
|
defaultParseWidth: "any"
|
|
749
749
|
})
|
|
750
|
-
},
|
|
750
|
+
}, wt = {
|
|
751
751
|
code: "en-US",
|
|
752
752
|
formatDistance: $n,
|
|
753
753
|
formatLong: zn,
|
|
@@ -761,33 +761,33 @@ const ro = /^(\d+)(th|st|nd|rd)?/i, ao = /\d+/i, so = {
|
|
|
761
761
|
};
|
|
762
762
|
function wo(e, t) {
|
|
763
763
|
const n = Y(e, t?.in);
|
|
764
|
-
return
|
|
764
|
+
return Ht(n, qt(n)) + 1;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
const n = Y(e, t?.in), o = +
|
|
768
|
-
return Math.round(o /
|
|
766
|
+
function zt(e, t) {
|
|
767
|
+
const n = Y(e, t?.in), o = +Ie(n) - +Sn(n);
|
|
768
|
+
return Math.round(o / Ft) + 1;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
const n = Y(e, t?.in), o = n.getFullYear(), r =
|
|
770
|
+
function Zt(e, t) {
|
|
771
|
+
const n = Y(e, t?.in), o = n.getFullYear(), r = He(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, i = A(t?.in || e, 0);
|
|
772
772
|
i.setFullYear(o + 1, 0, a), i.setHours(0, 0, 0, 0);
|
|
773
|
-
const s =
|
|
773
|
+
const s = xe(i, t), c = A(t?.in || e, 0);
|
|
774
774
|
c.setFullYear(o, 0, a), c.setHours(0, 0, 0, 0);
|
|
775
|
-
const d =
|
|
775
|
+
const d = xe(c, t);
|
|
776
776
|
return +n >= +s ? o + 1 : +n >= +d ? o : o - 1;
|
|
777
777
|
}
|
|
778
778
|
function bo(e, t) {
|
|
779
|
-
const n =
|
|
780
|
-
return a.setFullYear(r, 0, o), a.setHours(0, 0, 0, 0),
|
|
779
|
+
const n = He(), o = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, r = Zt(e, t), a = A(t?.in || e, 0);
|
|
780
|
+
return a.setFullYear(r, 0, o), a.setHours(0, 0, 0, 0), xe(a, t);
|
|
781
781
|
}
|
|
782
|
-
function
|
|
783
|
-
const n = Y(e, t?.in), o = +
|
|
784
|
-
return Math.round(o /
|
|
782
|
+
function Gt(e, t) {
|
|
783
|
+
const n = Y(e, t?.in), o = +xe(n, t) - +bo(n, t);
|
|
784
|
+
return Math.round(o / Ft) + 1;
|
|
785
785
|
}
|
|
786
786
|
function T(e, t) {
|
|
787
787
|
const n = e < 0 ? "-" : "", o = Math.abs(e).toString().padStart(t, "0");
|
|
788
788
|
return n + o;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
790
|
+
const me = {
|
|
791
791
|
// Year
|
|
792
792
|
y(e, t) {
|
|
793
793
|
const n = e.getFullYear(), o = n > 0 ? n : 1 - n;
|
|
@@ -841,14 +841,14 @@ const he = {
|
|
|
841
841
|
);
|
|
842
842
|
return T(r, t.length);
|
|
843
843
|
}
|
|
844
|
-
},
|
|
844
|
+
}, We = {
|
|
845
845
|
midnight: "midnight",
|
|
846
846
|
noon: "noon",
|
|
847
847
|
morning: "morning",
|
|
848
848
|
afternoon: "afternoon",
|
|
849
849
|
evening: "evening",
|
|
850
850
|
night: "night"
|
|
851
|
-
},
|
|
851
|
+
}, St = {
|
|
852
852
|
// Era
|
|
853
853
|
G: function(e, t, n) {
|
|
854
854
|
const o = e.getFullYear() > 0 ? 1 : 0;
|
|
@@ -873,11 +873,11 @@ const he = {
|
|
|
873
873
|
const o = e.getFullYear(), r = o > 0 ? o : 1 - o;
|
|
874
874
|
return n.ordinalNumber(r, { unit: "year" });
|
|
875
875
|
}
|
|
876
|
-
return
|
|
876
|
+
return me.y(e, t);
|
|
877
877
|
},
|
|
878
878
|
// Local week-numbering year
|
|
879
879
|
Y: function(e, t, n, o) {
|
|
880
|
-
const r =
|
|
880
|
+
const r = Zt(e, o), a = r > 0 ? r : 1 - r;
|
|
881
881
|
if (t === "YY") {
|
|
882
882
|
const i = a % 100;
|
|
883
883
|
return T(i, 2);
|
|
@@ -886,7 +886,7 @@ const he = {
|
|
|
886
886
|
},
|
|
887
887
|
// ISO week-numbering year
|
|
888
888
|
R: function(e, t) {
|
|
889
|
-
const n =
|
|
889
|
+
const n = jt(e);
|
|
890
890
|
return T(n, t.length);
|
|
891
891
|
},
|
|
892
892
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
@@ -976,7 +976,7 @@ const he = {
|
|
|
976
976
|
switch (t) {
|
|
977
977
|
case "M":
|
|
978
978
|
case "MM":
|
|
979
|
-
return
|
|
979
|
+
return me.M(e, t);
|
|
980
980
|
// 1st, 2nd, ..., 12th
|
|
981
981
|
case "Mo":
|
|
982
982
|
return n.ordinalNumber(o + 1, { unit: "month" });
|
|
@@ -1031,17 +1031,17 @@ const he = {
|
|
|
1031
1031
|
},
|
|
1032
1032
|
// Local week of year
|
|
1033
1033
|
w: function(e, t, n, o) {
|
|
1034
|
-
const r =
|
|
1034
|
+
const r = Gt(e, o);
|
|
1035
1035
|
return t === "wo" ? n.ordinalNumber(r, { unit: "week" }) : T(r, t.length);
|
|
1036
1036
|
},
|
|
1037
1037
|
// ISO week of year
|
|
1038
1038
|
I: function(e, t, n) {
|
|
1039
|
-
const o =
|
|
1039
|
+
const o = zt(e);
|
|
1040
1040
|
return t === "Io" ? n.ordinalNumber(o, { unit: "week" }) : T(o, t.length);
|
|
1041
1041
|
},
|
|
1042
1042
|
// Day of the month
|
|
1043
1043
|
d: function(e, t, n) {
|
|
1044
|
-
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) :
|
|
1044
|
+
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : me.d(e, t);
|
|
1045
1045
|
},
|
|
1046
1046
|
// Day of year
|
|
1047
1047
|
D: function(e, t, n) {
|
|
@@ -1231,7 +1231,7 @@ const he = {
|
|
|
1231
1231
|
b: function(e, t, n) {
|
|
1232
1232
|
const o = e.getHours();
|
|
1233
1233
|
let r;
|
|
1234
|
-
switch (o === 12 ? r =
|
|
1234
|
+
switch (o === 12 ? r = We.noon : o === 0 ? r = We.midnight : r = o / 12 >= 1 ? "pm" : "am", t) {
|
|
1235
1235
|
case "b":
|
|
1236
1236
|
case "bb":
|
|
1237
1237
|
return n.dayPeriod(r, {
|
|
@@ -1260,7 +1260,7 @@ const he = {
|
|
|
1260
1260
|
B: function(e, t, n) {
|
|
1261
1261
|
const o = e.getHours();
|
|
1262
1262
|
let r;
|
|
1263
|
-
switch (o >= 17 ? r =
|
|
1263
|
+
switch (o >= 17 ? r = We.evening : o >= 12 ? r = We.afternoon : o >= 4 ? r = We.morning : r = We.night, t) {
|
|
1264
1264
|
case "B":
|
|
1265
1265
|
case "BB":
|
|
1266
1266
|
case "BBB":
|
|
@@ -1287,11 +1287,11 @@ const he = {
|
|
|
1287
1287
|
let o = e.getHours() % 12;
|
|
1288
1288
|
return o === 0 && (o = 12), n.ordinalNumber(o, { unit: "hour" });
|
|
1289
1289
|
}
|
|
1290
|
-
return
|
|
1290
|
+
return me.h(e, t);
|
|
1291
1291
|
},
|
|
1292
1292
|
// Hour [0-23]
|
|
1293
1293
|
H: function(e, t, n) {
|
|
1294
|
-
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) :
|
|
1294
|
+
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : me.H(e, t);
|
|
1295
1295
|
},
|
|
1296
1296
|
// Hour [0-11]
|
|
1297
1297
|
K: function(e, t, n) {
|
|
@@ -1305,15 +1305,15 @@ const he = {
|
|
|
1305
1305
|
},
|
|
1306
1306
|
// Minute
|
|
1307
1307
|
m: function(e, t, n) {
|
|
1308
|
-
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) :
|
|
1308
|
+
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : me.m(e, t);
|
|
1309
1309
|
},
|
|
1310
1310
|
// Second
|
|
1311
1311
|
s: function(e, t, n) {
|
|
1312
|
-
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) :
|
|
1312
|
+
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : me.s(e, t);
|
|
1313
1313
|
},
|
|
1314
1314
|
// Fraction of second
|
|
1315
1315
|
S: function(e, t) {
|
|
1316
|
-
return
|
|
1316
|
+
return me.S(e, t);
|
|
1317
1317
|
},
|
|
1318
1318
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1319
1319
|
X: function(e, t, n) {
|
|
@@ -1323,13 +1323,13 @@ const he = {
|
|
|
1323
1323
|
switch (t) {
|
|
1324
1324
|
// Hours and optional minutes
|
|
1325
1325
|
case "X":
|
|
1326
|
-
return
|
|
1326
|
+
return xt(o);
|
|
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
|
|
1332
|
+
return De(o);
|
|
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,7 +1337,7 @@ const he = {
|
|
|
1337
1337
|
case "XXX":
|
|
1338
1338
|
// Hours and minutes with `:` delimiter
|
|
1339
1339
|
default:
|
|
1340
|
-
return
|
|
1340
|
+
return De(o, ":");
|
|
1341
1341
|
}
|
|
1342
1342
|
},
|
|
1343
1343
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
@@ -1346,13 +1346,13 @@ const he = {
|
|
|
1346
1346
|
switch (t) {
|
|
1347
1347
|
// Hours and optional minutes
|
|
1348
1348
|
case "x":
|
|
1349
|
-
return
|
|
1349
|
+
return xt(o);
|
|
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
|
|
1355
|
+
return De(o);
|
|
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,7 +1360,7 @@ const he = {
|
|
|
1360
1360
|
case "xxx":
|
|
1361
1361
|
// Hours and minutes with `:` delimiter
|
|
1362
1362
|
default:
|
|
1363
|
-
return
|
|
1363
|
+
return De(o, ":");
|
|
1364
1364
|
}
|
|
1365
1365
|
},
|
|
1366
1366
|
// Timezone (GMT)
|
|
@@ -1371,11 +1371,11 @@ const he = {
|
|
|
1371
1371
|
case "O":
|
|
1372
1372
|
case "OO":
|
|
1373
1373
|
case "OOO":
|
|
1374
|
-
return "GMT" +
|
|
1374
|
+
return "GMT" + Ct(o, ":");
|
|
1375
1375
|
// Long
|
|
1376
1376
|
case "OOOO":
|
|
1377
1377
|
default:
|
|
1378
|
-
return "GMT" +
|
|
1378
|
+
return "GMT" + De(o, ":");
|
|
1379
1379
|
}
|
|
1380
1380
|
},
|
|
1381
1381
|
// Timezone (specific non-location)
|
|
@@ -1386,11 +1386,11 @@ const he = {
|
|
|
1386
1386
|
case "z":
|
|
1387
1387
|
case "zz":
|
|
1388
1388
|
case "zzz":
|
|
1389
|
-
return "GMT" +
|
|
1389
|
+
return "GMT" + Ct(o, ":");
|
|
1390
1390
|
// Long
|
|
1391
1391
|
case "zzzz":
|
|
1392
1392
|
default:
|
|
1393
|
-
return "GMT" +
|
|
1393
|
+
return "GMT" + De(o, ":");
|
|
1394
1394
|
}
|
|
1395
1395
|
},
|
|
1396
1396
|
// Seconds timestamp
|
|
@@ -1403,18 +1403,18 @@ const he = {
|
|
|
1403
1403
|
return T(+e, t.length);
|
|
1404
1404
|
}
|
|
1405
1405
|
};
|
|
1406
|
-
function
|
|
1406
|
+
function Ct(e, t = "") {
|
|
1407
1407
|
const n = e > 0 ? "-" : "+", o = Math.abs(e), r = Math.trunc(o / 60), a = o % 60;
|
|
1408
1408
|
return a === 0 ? n + String(r) : n + String(r) + t + T(a, 2);
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1411
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") + T(Math.abs(e) / 60, 2) :
|
|
1410
|
+
function xt(e, t) {
|
|
1411
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + T(Math.abs(e) / 60, 2) : De(e, t);
|
|
1412
1412
|
}
|
|
1413
|
-
function
|
|
1413
|
+
function De(e, t = "") {
|
|
1414
1414
|
const n = e > 0 ? "-" : "+", o = Math.abs(e), r = T(Math.trunc(o / 60), 2), a = T(o % 60, 2);
|
|
1415
1415
|
return n + r + t + a;
|
|
1416
1416
|
}
|
|
1417
|
-
const
|
|
1417
|
+
const Nt = (e, t) => {
|
|
1418
1418
|
switch (e) {
|
|
1419
1419
|
case "P":
|
|
1420
1420
|
return t.date({ width: "short" });
|
|
@@ -1426,7 +1426,7 @@ const Ot = (e, t) => {
|
|
|
1426
1426
|
default:
|
|
1427
1427
|
return t.date({ width: "full" });
|
|
1428
1428
|
}
|
|
1429
|
-
},
|
|
1429
|
+
}, Vt = (e, t) => {
|
|
1430
1430
|
switch (e) {
|
|
1431
1431
|
case "p":
|
|
1432
1432
|
return t.time({ width: "short" });
|
|
@@ -1441,7 +1441,7 @@ const Ot = (e, t) => {
|
|
|
1441
1441
|
}, Mo = (e, t) => {
|
|
1442
1442
|
const n = e.match(/(P+)(p+)?/) || [], o = n[1], r = n[2];
|
|
1443
1443
|
if (!r)
|
|
1444
|
-
return
|
|
1444
|
+
return Nt(e, t);
|
|
1445
1445
|
let a;
|
|
1446
1446
|
switch (o) {
|
|
1447
1447
|
case "P":
|
|
@@ -1458,9 +1458,9 @@ const Ot = (e, t) => {
|
|
|
1458
1458
|
a = t.dateTime({ width: "full" });
|
|
1459
1459
|
break;
|
|
1460
1460
|
}
|
|
1461
|
-
return a.replace("{{date}}",
|
|
1461
|
+
return a.replace("{{date}}", Nt(o, t)).replace("{{time}}", Vt(r, t));
|
|
1462
1462
|
}, vo = {
|
|
1463
|
-
p:
|
|
1463
|
+
p: Vt,
|
|
1464
1464
|
P: Mo
|
|
1465
1465
|
}, Do = /^D+$/, ko = /^Y+$/, Oo = ["D", "DD", "YY", "YYYY"];
|
|
1466
1466
|
function Wo(e) {
|
|
@@ -1479,7 +1479,7 @@ function xo(e, t, n) {
|
|
|
1479
1479
|
}
|
|
1480
1480
|
const No = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Po = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, To = /^'([^]*?)'?$/, Yo = /''/g, Eo = /[a-zA-Z]/;
|
|
1481
1481
|
function _o(e, t, n) {
|
|
1482
|
-
const o =
|
|
1482
|
+
const o = He(), r = n?.locale ?? o.locale ?? wt, a = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, i = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? o.weekStartsOn ?? o.locale?.options?.weekStartsOn ?? 0, s = Y(e, n?.in);
|
|
1483
1483
|
if (!Yn(s))
|
|
1484
1484
|
throw new RangeError("Invalid time value");
|
|
1485
1485
|
let c = t.match(Po).map((l) => {
|
|
@@ -1495,7 +1495,7 @@ function _o(e, t, n) {
|
|
|
1495
1495
|
const u = l[0];
|
|
1496
1496
|
if (u === "'")
|
|
1497
1497
|
return { isToken: !1, value: Fo(l) };
|
|
1498
|
-
if (
|
|
1498
|
+
if (St[u])
|
|
1499
1499
|
return { isToken: !0, value: l };
|
|
1500
1500
|
if (u.match(Eo))
|
|
1501
1501
|
throw new RangeError(
|
|
@@ -1513,7 +1513,7 @@ function _o(e, t, n) {
|
|
|
1513
1513
|
if (!l.isToken) return l.value;
|
|
1514
1514
|
const u = l.value;
|
|
1515
1515
|
(!n?.useAdditionalWeekYearTokens && So(u) || !n?.useAdditionalDayOfYearTokens && Wo(u)) && Co(u, t, String(e));
|
|
1516
|
-
const f =
|
|
1516
|
+
const f = St[u[0]];
|
|
1517
1517
|
return f(s, u, r.localize, d);
|
|
1518
1518
|
}).join("");
|
|
1519
1519
|
}
|
|
@@ -1525,10 +1525,10 @@ function Bo(e, t) {
|
|
|
1525
1525
|
const n = Y(e, t?.in), o = n.getFullYear(), r = n.getMonth(), a = A(n, 0);
|
|
1526
1526
|
return a.setFullYear(o, r + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1528
|
+
function Io(e, t) {
|
|
1529
1529
|
return Y(e, t?.in).getMonth();
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1531
|
+
function jo(e, t) {
|
|
1532
1532
|
return Y(e, t?.in).getFullYear();
|
|
1533
1533
|
}
|
|
1534
1534
|
function Ho(e, t) {
|
|
@@ -1538,7 +1538,7 @@ function Ao(e, t) {
|
|
|
1538
1538
|
return +Y(e) < +Y(t);
|
|
1539
1539
|
}
|
|
1540
1540
|
function $o(e, t, n) {
|
|
1541
|
-
const [o, r] =
|
|
1541
|
+
const [o, r] = Ne(
|
|
1542
1542
|
n?.in,
|
|
1543
1543
|
e,
|
|
1544
1544
|
t
|
|
@@ -1546,7 +1546,7 @@ function $o(e, t, n) {
|
|
|
1546
1546
|
return o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth();
|
|
1547
1547
|
}
|
|
1548
1548
|
function qo(e, t, n) {
|
|
1549
|
-
const [o, r] =
|
|
1549
|
+
const [o, r] = Ne(
|
|
1550
1550
|
n?.in,
|
|
1551
1551
|
e,
|
|
1552
1552
|
t
|
|
@@ -1563,17 +1563,17 @@ function Lo(e, t, n) {
|
|
|
1563
1563
|
const o = Y(e, n?.in);
|
|
1564
1564
|
return isNaN(+o) ? A(e, NaN) : (o.setFullYear(t), o);
|
|
1565
1565
|
}
|
|
1566
|
-
const
|
|
1566
|
+
const Pt = 5, zo = 4;
|
|
1567
1567
|
function Zo(e, t) {
|
|
1568
|
-
const n = t.startOfMonth(e), o = n.getDay() > 0 ? n.getDay() : 7, r = t.addDays(e, -o + 1), a = t.addDays(r,
|
|
1569
|
-
return t.getMonth(e) === t.getMonth(a) ?
|
|
1568
|
+
const n = t.startOfMonth(e), o = n.getDay() > 0 ? n.getDay() : 7, r = t.addDays(e, -o + 1), a = t.addDays(r, Pt * 7 - 1);
|
|
1569
|
+
return t.getMonth(e) === t.getMonth(a) ? Pt : zo;
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1571
|
+
function Xt(e, t) {
|
|
1572
1572
|
const n = t.startOfMonth(e), o = n.getDay();
|
|
1573
1573
|
return o === 1 ? n : o === 0 ? t.addDays(n, -6) : t.addDays(n, -1 * (o - 1));
|
|
1574
1574
|
}
|
|
1575
1575
|
function Go(e, t) {
|
|
1576
|
-
const n =
|
|
1576
|
+
const n = Xt(e, t), o = Zo(e, t);
|
|
1577
1577
|
return t.addDays(n, o * 7 - 1);
|
|
1578
1578
|
}
|
|
1579
1579
|
class K {
|
|
@@ -1584,18 +1584,18 @@ class K {
|
|
|
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 ?
|
|
1588
|
-
const r = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(o) :
|
|
1587
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? R.tz(this.options.timeZone) : new this.Date(), this.newDate = (o, r, a) => this.overrides?.newDate ? this.overrides.newDate(o, r, a) : this.options.timeZone ? new R(o, r, a, this.options.timeZone) : new Date(o, r, a), this.addDays = (o, r) => this.overrides?.addDays ? this.overrides.addDays(o, r) : Bt(o, r), this.addMonths = (o, r) => this.overrides?.addMonths ? this.overrides.addMonths(o, r) : It(o, r), this.addWeeks = (o, r) => this.overrides?.addWeeks ? this.overrides.addWeeks(o, r) : Cn(o, r), this.addYears = (o, r) => this.overrides?.addYears ? this.overrides.addYears(o, r) : xn(o, r), this.differenceInCalendarDays = (o, r) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(o, r) : Ht(o, r), this.differenceInCalendarMonths = (o, r) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(o, r) : En(o, r), this.eachMonthOfInterval = (o) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(o) : Fn(o), this.eachYearOfInterval = (o) => {
|
|
1588
|
+
const r = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(o) : jn(o), a = new Set(r.map((s) => this.getYear(s)));
|
|
1589
1589
|
if (a.size === r.length)
|
|
1590
1590
|
return r;
|
|
1591
1591
|
const i = [];
|
|
1592
1592
|
return a.forEach((s) => {
|
|
1593
1593
|
i.push(new Date(s, 0, 1));
|
|
1594
1594
|
}), i;
|
|
1595
|
-
}, this.endOfBroadcastWeek = (o) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(o) : Go(o, this), this.endOfISOWeek = (o) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(o) : Hn(o), this.endOfMonth = (o) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(o) : _n(o), this.endOfWeek = (o, r) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(o, r) :
|
|
1595
|
+
}, this.endOfBroadcastWeek = (o) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(o) : Go(o, this), this.endOfISOWeek = (o) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(o) : Hn(o), this.endOfMonth = (o) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(o) : _n(o), this.endOfWeek = (o, r) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(o, r) : Rt(o, this.options), this.endOfYear = (o) => this.overrides?.endOfYear ? this.overrides.endOfYear(o) : In(o), this.format = (o, r, a) => {
|
|
1596
1596
|
const i = this.overrides?.format ? this.overrides.format(o, r, this.options) : _o(o, r, this.options);
|
|
1597
1597
|
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
1598
|
-
}, this.getISOWeek = (o) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(o) :
|
|
1598
|
+
}, this.getISOWeek = (o) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(o) : zt(o), this.getMonth = (o, r) => this.overrides?.getMonth ? this.overrides.getMonth(o, this.options) : Io(o, this.options), this.getYear = (o, r) => this.overrides?.getYear ? this.overrides.getYear(o, this.options) : jo(o, this.options), this.getWeek = (o, r) => this.overrides?.getWeek ? this.overrides.getWeek(o, this.options) : Gt(o, this.options), this.isAfter = (o, r) => this.overrides?.isAfter ? this.overrides.isAfter(o, r) : Ho(o, r), this.isBefore = (o, r) => this.overrides?.isBefore ? this.overrides.isBefore(o, r) : Ao(o, r), this.isDate = (o) => this.overrides?.isDate ? this.overrides.isDate(o) : At(o), this.isSameDay = (o, r) => this.overrides?.isSameDay ? this.overrides.isSameDay(o, r) : Tn(o, r), this.isSameMonth = (o, r) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(o, r) : $o(o, r), this.isSameYear = (o, r) => this.overrides?.isSameYear ? this.overrides.isSameYear(o, r) : qo(o, r), this.max = (o) => this.overrides?.max ? this.overrides.max(o) : Nn(o), this.min = (o) => this.overrides?.min ? this.overrides.min(o) : Pn(o), this.setMonth = (o, r) => this.overrides?.setMonth ? this.overrides.setMonth(o, r) : Ro(o, r), this.setYear = (o, r) => this.overrides?.setYear ? this.overrides.setYear(o, r) : Lo(o, r), this.startOfBroadcastWeek = (o, r) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(o, this) : Xt(o, this), this.startOfDay = (o) => this.overrides?.startOfDay ? this.overrides.startOfDay(o) : je(o), this.startOfISOWeek = (o) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(o) : Ie(o), this.startOfMonth = (o) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(o) : Bn(o), this.startOfWeek = (o, r) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(o, this.options) : xe(o, this.options), this.startOfYear = (o) => this.overrides?.startOfYear ? this.overrides.startOfYear(o) : qt(o), this.options = { locale: wt, ...t }, this.overrides = n;
|
|
1599
1599
|
}
|
|
1600
1600
|
/**
|
|
1601
1601
|
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
@@ -1682,7 +1682,7 @@ K.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
|
1682
1682
|
"zh-TW"
|
|
1683
1683
|
]);
|
|
1684
1684
|
const ae = new K();
|
|
1685
|
-
class
|
|
1685
|
+
class Qt {
|
|
1686
1686
|
constructor(t, n, o = ae) {
|
|
1687
1687
|
this.date = t, this.displayMonth = n, this.outside = !!(n && !o.isSameMonth(t, n)), this.dateLib = o;
|
|
1688
1688
|
}
|
|
@@ -1741,10 +1741,10 @@ var p;
|
|
|
1741
1741
|
(function(e) {
|
|
1742
1742
|
e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
|
|
1743
1743
|
})(p || (p = {}));
|
|
1744
|
-
var
|
|
1744
|
+
var j;
|
|
1745
1745
|
(function(e) {
|
|
1746
1746
|
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
1747
|
-
})(
|
|
1747
|
+
})(j || (j = {}));
|
|
1748
1748
|
var J;
|
|
1749
1749
|
(function(e) {
|
|
1750
1750
|
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
@@ -1787,19 +1787,19 @@ function sr(e) {
|
|
|
1787
1787
|
function ir(e) {
|
|
1788
1788
|
return m.createElement("div", { ...e });
|
|
1789
1789
|
}
|
|
1790
|
-
const
|
|
1791
|
-
function
|
|
1792
|
-
const e = hn(
|
|
1790
|
+
const Ut = mn(void 0);
|
|
1791
|
+
function Ae() {
|
|
1792
|
+
const e = hn(Ut);
|
|
1793
1793
|
if (e === void 0)
|
|
1794
1794
|
throw new Error("useDayPicker() must be used within a custom component.");
|
|
1795
1795
|
return e;
|
|
1796
1796
|
}
|
|
1797
1797
|
function cr(e) {
|
|
1798
|
-
const { components: t } =
|
|
1798
|
+
const { components: t } = Ae();
|
|
1799
1799
|
return m.createElement(t.Dropdown, { ...e });
|
|
1800
1800
|
}
|
|
1801
1801
|
function ur(e) {
|
|
1802
|
-
const { onPreviousClick: t, onNextClick: n, previousMonth: o, nextMonth: r, ...a } = e, { components: i, classNames: s, labels: { labelPrevious: c, labelNext: d } } =
|
|
1802
|
+
const { onPreviousClick: t, onNextClick: n, previousMonth: o, nextMonth: r, ...a } = e, { components: i, classNames: s, labels: { labelPrevious: c, labelNext: d } } = Ae(), l = q((f) => {
|
|
1803
1803
|
r && n?.(f);
|
|
1804
1804
|
}, [r, n]), u = q((f) => {
|
|
1805
1805
|
o && t?.(f);
|
|
@@ -1820,14 +1820,14 @@ function ur(e) {
|
|
|
1820
1820
|
);
|
|
1821
1821
|
}
|
|
1822
1822
|
function dr(e) {
|
|
1823
|
-
const { components: t } =
|
|
1823
|
+
const { components: t } = Ae();
|
|
1824
1824
|
return m.createElement(t.Button, { ...e });
|
|
1825
1825
|
}
|
|
1826
1826
|
function lr(e) {
|
|
1827
1827
|
return m.createElement("option", { ...e });
|
|
1828
1828
|
}
|
|
1829
1829
|
function fr(e) {
|
|
1830
|
-
const { components: t } =
|
|
1830
|
+
const { components: t } = Ae();
|
|
1831
1831
|
return m.createElement(t.Button, { ...e });
|
|
1832
1832
|
}
|
|
1833
1833
|
function mr(e) {
|
|
@@ -1862,7 +1862,7 @@ function Mr(e) {
|
|
|
1862
1862
|
return m.createElement("tbody", { ...e });
|
|
1863
1863
|
}
|
|
1864
1864
|
function vr(e) {
|
|
1865
|
-
const { components: t } =
|
|
1865
|
+
const { components: t } = Ae();
|
|
1866
1866
|
return m.createElement(t.Dropdown, { ...e });
|
|
1867
1867
|
}
|
|
1868
1868
|
const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -1899,22 +1899,22 @@ function de(e, t, n = !1, o = ae) {
|
|
|
1899
1899
|
const { differenceInCalendarDays: i, isSameDay: s } = o;
|
|
1900
1900
|
return r && a ? (i(a, r) < 0 && ([r, a] = [a, r]), i(t, r) >= (n ? 1 : 0) && i(a, t) >= (n ? 1 : 0)) : !n && a ? s(a, t) : !n && r ? s(r, t) : !1;
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1902
|
+
function Kt(e) {
|
|
1903
1903
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
1904
1904
|
}
|
|
1905
|
-
function
|
|
1905
|
+
function bt(e) {
|
|
1906
1906
|
return !!(e && typeof e == "object" && "from" in e);
|
|
1907
1907
|
}
|
|
1908
|
-
function
|
|
1908
|
+
function Jt(e) {
|
|
1909
1909
|
return !!(e && typeof e == "object" && "after" in e);
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1911
|
+
function en(e) {
|
|
1912
1912
|
return !!(e && typeof e == "object" && "before" in e);
|
|
1913
1913
|
}
|
|
1914
|
-
function
|
|
1914
|
+
function tn(e) {
|
|
1915
1915
|
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1917
|
+
function nn(e, t) {
|
|
1918
1918
|
return Array.isArray(e) && e.every(t.isDate);
|
|
1919
1919
|
}
|
|
1920
1920
|
function le(e, t, n = ae) {
|
|
@@ -1924,49 +1924,49 @@ function le(e, t, n = ae) {
|
|
|
1924
1924
|
return s;
|
|
1925
1925
|
if (n.isDate(s))
|
|
1926
1926
|
return r(e, s);
|
|
1927
|
-
if (
|
|
1927
|
+
if (nn(s, n))
|
|
1928
1928
|
return s.includes(e);
|
|
1929
|
-
if (
|
|
1929
|
+
if (bt(s))
|
|
1930
1930
|
return de(s, e, !1, n);
|
|
1931
|
-
if (
|
|
1931
|
+
if (tn(s))
|
|
1932
1932
|
return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
|
|
1933
|
-
if (
|
|
1933
|
+
if (Kt(s)) {
|
|
1934
1934
|
const c = a(s.before, e), d = a(s.after, e), l = c > 0, u = d < 0;
|
|
1935
1935
|
return i(s.before, s.after) ? u && l : l || u;
|
|
1936
1936
|
}
|
|
1937
|
-
return
|
|
1937
|
+
return Jt(s) ? a(e, s.after) > 0 : en(s) ? a(s.before, e) > 0 : typeof s == "function" ? s(e) : !1;
|
|
1938
1938
|
});
|
|
1939
1939
|
}
|
|
1940
1940
|
function kr(e, t, n, o, r) {
|
|
1941
1941
|
const { disabled: a, hidden: i, modifiers: s, showOutsideDays: c, broadcastCalendar: d, today: l } = t, { isSameDay: u, isSameMonth: f, startOfMonth: w, isBefore: D, endOfMonth: W, isAfter: b } = r, O = n && w(n), y = o && W(o), g = {
|
|
1942
|
-
[
|
|
1943
|
-
[
|
|
1944
|
-
[
|
|
1945
|
-
[
|
|
1946
|
-
[
|
|
1942
|
+
[j.focused]: [],
|
|
1943
|
+
[j.outside]: [],
|
|
1944
|
+
[j.disabled]: [],
|
|
1945
|
+
[j.hidden]: [],
|
|
1946
|
+
[j.today]: []
|
|
1947
1947
|
}, x = {};
|
|
1948
1948
|
for (const h of e) {
|
|
1949
|
-
const { date: v, displayMonth: M } = h, C = !!(M && !f(v, M)),
|
|
1950
|
-
!d && !c && C || d && c === !1 && C,
|
|
1951
|
-
C && g.outside.push(h), H && g.disabled.push(h), F && g.hidden.push(h),
|
|
1949
|
+
const { date: v, displayMonth: M } = h, C = !!(M && !f(v, M)), I = !!(O && D(v, O)), _ = !!(y && b(v, y)), H = !!(a && le(v, a, r)), F = !!(i && le(v, i, r)) || I || _ || // Broadcast calendar will show outside days as default
|
|
1950
|
+
!d && !c && C || d && c === !1 && C, Z = u(v, l ?? r.today());
|
|
1951
|
+
C && g.outside.push(h), H && g.disabled.push(h), F && g.hidden.push(h), Z && g.today.push(h), s && Object.keys(s).forEach((se) => {
|
|
1952
1952
|
const ee = s?.[se];
|
|
1953
1953
|
ee && le(v, ee, r) && (x[se] ? x[se].push(h) : x[se] = [h]);
|
|
1954
1954
|
});
|
|
1955
1955
|
}
|
|
1956
1956
|
return (h) => {
|
|
1957
1957
|
const v = {
|
|
1958
|
-
[
|
|
1959
|
-
[
|
|
1960
|
-
[
|
|
1961
|
-
[
|
|
1962
|
-
[
|
|
1958
|
+
[j.focused]: !1,
|
|
1959
|
+
[j.disabled]: !1,
|
|
1960
|
+
[j.hidden]: !1,
|
|
1961
|
+
[j.outside]: !1,
|
|
1962
|
+
[j.today]: !1
|
|
1963
1963
|
}, M = {};
|
|
1964
1964
|
for (const C in g) {
|
|
1965
|
-
const
|
|
1966
|
-
v[C] =
|
|
1965
|
+
const I = g[C];
|
|
1966
|
+
v[C] = I.some((_) => _ === h);
|
|
1967
1967
|
}
|
|
1968
1968
|
for (const C in x)
|
|
1969
|
-
M[C] = x[C].some((
|
|
1969
|
+
M[C] = x[C].some((I) => I === h);
|
|
1970
1970
|
return {
|
|
1971
1971
|
...v,
|
|
1972
1972
|
// custom modifiers should override all the previous ones
|
|
@@ -1975,7 +1975,7 @@ function kr(e, t, n, o, r) {
|
|
|
1975
1975
|
};
|
|
1976
1976
|
}
|
|
1977
1977
|
function Or(e, t, n = {}) {
|
|
1978
|
-
return Object.entries(e).filter(([, r]) => r === !0).reduce((r, [a]) => (n[a] ? r.push(n[a]) : t[
|
|
1978
|
+
return Object.entries(e).filter(([, r]) => r === !0).reduce((r, [a]) => (n[a] ? r.push(n[a]) : t[j[a]] ? r.push(t[j[a]]) : t[J[a]] && r.push(t[J[a]]), r), [t[p.Day]]);
|
|
1979
1979
|
}
|
|
1980
1980
|
function Wr(e) {
|
|
1981
1981
|
return {
|
|
@@ -2000,18 +2000,18 @@ function Cr() {
|
|
|
2000
2000
|
const e = {};
|
|
2001
2001
|
for (const t in p)
|
|
2002
2002
|
e[p[t]] = `rdp-${p[t]}`;
|
|
2003
|
-
for (const t in
|
|
2004
|
-
e[
|
|
2003
|
+
for (const t in j)
|
|
2004
|
+
e[j[t]] = `rdp-${j[t]}`;
|
|
2005
2005
|
for (const t in J)
|
|
2006
2006
|
e[J[t]] = `rdp-${J[t]}`;
|
|
2007
2007
|
for (const t in U)
|
|
2008
2008
|
e[U[t]] = `rdp-${U[t]}`;
|
|
2009
2009
|
return e;
|
|
2010
2010
|
}
|
|
2011
|
-
function
|
|
2011
|
+
function on(e, t, n) {
|
|
2012
2012
|
return (n ?? new K(t)).formatMonthYear(e);
|
|
2013
2013
|
}
|
|
2014
|
-
const xr =
|
|
2014
|
+
const xr = on;
|
|
2015
2015
|
function Nr(e, t, n) {
|
|
2016
2016
|
return (n ?? new K(t)).format(e, "d");
|
|
2017
2017
|
}
|
|
@@ -2027,12 +2027,12 @@ function Yr(e, t = ae) {
|
|
|
2027
2027
|
function Er() {
|
|
2028
2028
|
return "";
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2030
|
+
function rn(e, t = ae) {
|
|
2031
2031
|
return t.format(e, "yyyy");
|
|
2032
2032
|
}
|
|
2033
|
-
const _r =
|
|
2033
|
+
const _r = rn, Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2034
2034
|
__proto__: null,
|
|
2035
|
-
formatCaption:
|
|
2035
|
+
formatCaption: on,
|
|
2036
2036
|
formatDay: Nr,
|
|
2037
2037
|
formatMonthCaption: xr,
|
|
2038
2038
|
formatMonthDropdown: Pr,
|
|
@@ -2040,7 +2040,7 @@ const _r = Jt, Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
2040
2040
|
formatWeekNumberHeader: Er,
|
|
2041
2041
|
formatWeekdayName: Tr,
|
|
2042
2042
|
formatYearCaption: _r,
|
|
2043
|
-
formatYearDropdown:
|
|
2043
|
+
formatYearDropdown: rn
|
|
2044
2044
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2045
2045
|
function Br(e) {
|
|
2046
2046
|
return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
|
|
@@ -2048,7 +2048,7 @@ function Br(e) {
|
|
|
2048
2048
|
...e
|
|
2049
2049
|
};
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2051
|
+
function Ir(e, t, n, o, r) {
|
|
2052
2052
|
const { startOfMonth: a, startOfYear: i, endOfYear: s, eachMonthOfInterval: c, getMonth: d } = r;
|
|
2053
2053
|
return c({
|
|
2054
2054
|
start: i(e),
|
|
@@ -2058,7 +2058,7 @@ function jr(e, t, n, o, r) {
|
|
|
2058
2058
|
return { value: D, label: w, disabled: W };
|
|
2059
2059
|
});
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2061
|
+
function jr(e, t = {}, n = {}) {
|
|
2062
2062
|
let o = { ...t?.[p.Day] };
|
|
2063
2063
|
return Object.entries(e).filter(([, r]) => r === !0).forEach(([r]) => {
|
|
2064
2064
|
o = {
|
|
@@ -2088,15 +2088,15 @@ function Ar(e, t, n, o, r = !1) {
|
|
|
2088
2088
|
};
|
|
2089
2089
|
});
|
|
2090
2090
|
}
|
|
2091
|
-
function
|
|
2091
|
+
function an(e, t, n, o) {
|
|
2092
2092
|
let r = (o ?? new K(n)).format(e, "PPPP");
|
|
2093
2093
|
return t.today && (r = `Today, ${r}`), t.selected && (r = `${r}, selected`), r;
|
|
2094
2094
|
}
|
|
2095
|
-
const $r =
|
|
2096
|
-
function
|
|
2095
|
+
const $r = an;
|
|
2096
|
+
function sn(e, t, n) {
|
|
2097
2097
|
return (n ?? new K(t)).formatMonthYear(e);
|
|
2098
2098
|
}
|
|
2099
|
-
const qr =
|
|
2099
|
+
const qr = sn;
|
|
2100
2100
|
function Rr(e, t, n, o) {
|
|
2101
2101
|
let r = (o ?? new K(n)).format(e, "PPPP");
|
|
2102
2102
|
return t?.today && (r = `Today, ${r}`), r;
|
|
@@ -2129,8 +2129,8 @@ const Kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2129
2129
|
__proto__: null,
|
|
2130
2130
|
labelCaption: qr,
|
|
2131
2131
|
labelDay: $r,
|
|
2132
|
-
labelDayButton:
|
|
2133
|
-
labelGrid:
|
|
2132
|
+
labelDayButton: an,
|
|
2133
|
+
labelGrid: sn,
|
|
2134
2134
|
labelGridcell: Rr,
|
|
2135
2135
|
labelMonthDropdown: Lr,
|
|
2136
2136
|
labelNav: zr,
|
|
@@ -2140,11 +2140,11 @@ const Kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2140
2140
|
labelWeekNumberHeader: Qr,
|
|
2141
2141
|
labelWeekday: Vr,
|
|
2142
2142
|
labelYearDropdown: Ur
|
|
2143
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2143
|
+
}, Symbol.toStringTag, { value: "Module" })), $e = (e) => e instanceof HTMLElement ? e : null, lt = (e) => [
|
|
2144
2144
|
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2145
|
-
], Jr = (e) =>
|
|
2145
|
+
], Jr = (e) => $e(e.querySelector("[data-animated-month]")), ft = (e) => $e(e.querySelector("[data-animated-caption]")), mt = (e) => $e(e.querySelector("[data-animated-weeks]")), ea = (e) => $e(e.querySelector("[data-animated-nav]")), ta = (e) => $e(e.querySelector("[data-animated-weekdays]"));
|
|
2146
2146
|
function na(e, t, { classNames: n, months: o, focused: r, dateLib: a }) {
|
|
2147
|
-
const i =
|
|
2147
|
+
const i = Se(null), s = Se(o), c = Se(!1);
|
|
2148
2148
|
yn(() => {
|
|
2149
2149
|
const d = s.current;
|
|
2150
2150
|
if (s.current = o, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
@@ -2152,19 +2152,19 @@ function na(e, t, { classNames: n, months: o, focused: r, dateLib: a }) {
|
|
|
2152
2152
|
o.length === 0 || d.length === 0 || o.length !== d.length)
|
|
2153
2153
|
return;
|
|
2154
2154
|
const l = a.isSameMonth(o[0].date, d[0].date), u = a.isAfter(o[0].date, d[0].date), f = u ? n[U.caption_after_enter] : n[U.caption_before_enter], w = u ? n[U.weeks_after_enter] : n[U.weeks_before_enter], D = i.current, W = e.current.cloneNode(!0);
|
|
2155
|
-
if (W instanceof HTMLElement ? (
|
|
2155
|
+
if (W instanceof HTMLElement ? (lt(W).forEach((g) => {
|
|
2156
2156
|
if (!(g instanceof HTMLElement))
|
|
2157
2157
|
return;
|
|
2158
2158
|
const x = Jr(g);
|
|
2159
2159
|
x && g.contains(x) && g.removeChild(x);
|
|
2160
|
-
const h =
|
|
2160
|
+
const h = ft(g);
|
|
2161
2161
|
h && h.classList.remove(f);
|
|
2162
|
-
const v =
|
|
2162
|
+
const v = mt(g);
|
|
2163
2163
|
v && v.classList.remove(w);
|
|
2164
2164
|
}), i.current = W) : i.current = null, c.current || l || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
2165
2165
|
r)
|
|
2166
2166
|
return;
|
|
2167
|
-
const b = D instanceof HTMLElement ?
|
|
2167
|
+
const b = D instanceof HTMLElement ? lt(D) : [], O = lt(e.current);
|
|
2168
2168
|
if (O?.every((y) => y instanceof HTMLElement) && b && b.every((y) => y instanceof HTMLElement)) {
|
|
2169
2169
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
2170
2170
|
const y = ea(e.current);
|
|
@@ -2173,19 +2173,19 @@ function na(e, t, { classNames: n, months: o, focused: r, dateLib: a }) {
|
|
|
2173
2173
|
if (!h)
|
|
2174
2174
|
return;
|
|
2175
2175
|
g.style.position = "relative", g.style.overflow = "hidden";
|
|
2176
|
-
const v =
|
|
2176
|
+
const v = ft(g);
|
|
2177
2177
|
v && v.classList.add(f);
|
|
2178
|
-
const M =
|
|
2178
|
+
const M = mt(g);
|
|
2179
2179
|
M && M.classList.add(w);
|
|
2180
2180
|
const C = () => {
|
|
2181
2181
|
c.current = !1, e.current && (e.current.style.isolation = ""), y && (y.style.zIndex = ""), v && v.classList.remove(f), M && M.classList.remove(w), g.style.position = "", g.style.overflow = "", g.contains(h) && g.removeChild(h);
|
|
2182
2182
|
};
|
|
2183
2183
|
h.style.pointerEvents = "none", h.style.position = "absolute", h.style.overflow = "hidden", h.setAttribute("aria-hidden", "true");
|
|
2184
|
-
const
|
|
2185
|
-
|
|
2186
|
-
const _ =
|
|
2184
|
+
const I = ta(h);
|
|
2185
|
+
I && (I.style.opacity = "0");
|
|
2186
|
+
const _ = ft(h);
|
|
2187
2187
|
_ && (_.classList.add(u ? n[U.caption_before_exit] : n[U.caption_after_exit]), _.addEventListener("animationend", C));
|
|
2188
|
-
const H =
|
|
2188
|
+
const H = mt(h);
|
|
2189
2189
|
H && H.classList.add(u ? n[U.weeks_before_exit] : n[U.weeks_after_exit]), g.insertBefore(h, g.firstChild);
|
|
2190
2190
|
});
|
|
2191
2191
|
}
|
|
@@ -2203,8 +2203,8 @@ function oa(e, t, n, o) {
|
|
|
2203
2203
|
if (s && C.length < _) {
|
|
2204
2204
|
const H = _ - C.length;
|
|
2205
2205
|
for (let F = 0; F < H; F++) {
|
|
2206
|
-
const
|
|
2207
|
-
C.push(
|
|
2206
|
+
const Z = d(C[C.length - 1], 1);
|
|
2207
|
+
C.push(Z);
|
|
2208
2208
|
}
|
|
2209
2209
|
}
|
|
2210
2210
|
return C;
|
|
@@ -2226,7 +2226,7 @@ function aa(e, t, n, o) {
|
|
|
2226
2226
|
}
|
|
2227
2227
|
return a;
|
|
2228
2228
|
}
|
|
2229
|
-
function
|
|
2229
|
+
function Tt(e, t, n, o) {
|
|
2230
2230
|
const { month: r, defaultMonth: a, today: i = o.today(), numberOfMonths: s = 1 } = e;
|
|
2231
2231
|
let c = r || a || i;
|
|
2232
2232
|
const { differenceInCalendarMonths: d, addMonths: l, startOfMonth: u } = o;
|
|
@@ -2241,14 +2241,14 @@ function sa(e, t, n, o) {
|
|
|
2241
2241
|
const O = n.broadcastCalendar ? u(b, o) : n.ISOWeek ? f(b) : w(b), y = n.broadcastCalendar ? a(b) : n.ISOWeek ? i(s(b)) : c(s(b)), g = t.filter((M) => M >= O && M <= y), x = n.broadcastCalendar ? 35 : 42;
|
|
2242
2242
|
if (n.fixedWeeks && g.length < x) {
|
|
2243
2243
|
const M = t.filter((C) => {
|
|
2244
|
-
const
|
|
2245
|
-
return C > y && C <= r(y,
|
|
2244
|
+
const I = x - g.length;
|
|
2245
|
+
return C > y && C <= r(y, I);
|
|
2246
2246
|
});
|
|
2247
2247
|
g.push(...M);
|
|
2248
2248
|
}
|
|
2249
2249
|
const h = g.reduce((M, C) => {
|
|
2250
|
-
const
|
|
2251
|
-
return _ ? _.days.push(H) : M.push(new Xo(
|
|
2250
|
+
const I = n.ISOWeek ? d(C) : l(C), _ = M.find((F) => F.weekNumber === I), H = new Qt(C, b, o);
|
|
2251
|
+
return _ ? _.days.push(H) : M.push(new Xo(I, [H])), M;
|
|
2252
2252
|
}, []), v = new Vo(b, h);
|
|
2253
2253
|
return W.push(v), W;
|
|
2254
2254
|
}, []);
|
|
@@ -2286,18 +2286,18 @@ function da(e) {
|
|
|
2286
2286
|
const t = [];
|
|
2287
2287
|
return e.reduce((n, o) => n.concat(o.weeks.slice()), t.slice());
|
|
2288
2288
|
}
|
|
2289
|
-
function
|
|
2290
|
-
const [n, o] =
|
|
2289
|
+
function nt(e, t) {
|
|
2290
|
+
const [n, o] = he(e);
|
|
2291
2291
|
return [t === void 0 ? n : t, o];
|
|
2292
2292
|
}
|
|
2293
2293
|
function la(e, t) {
|
|
2294
|
-
const [n, o] = ia(e, t), { startOfMonth: r, endOfMonth: a } = t, i =
|
|
2294
|
+
const [n, o] = ia(e, t), { startOfMonth: r, endOfMonth: a } = t, i = Tt(e, n, o, t), [s, c] = nt(
|
|
2295
2295
|
i,
|
|
2296
2296
|
// initialMonth is always computed from props.month if provided
|
|
2297
2297
|
e.month ? i : void 0
|
|
2298
2298
|
);
|
|
2299
|
-
|
|
2300
|
-
const v =
|
|
2299
|
+
_e(() => {
|
|
2300
|
+
const v = Tt(e, n, o, t);
|
|
2301
2301
|
c(v);
|
|
2302
2302
|
}, [e.timeZone]);
|
|
2303
2303
|
const d = aa(s, o, e, t), l = oa(d, e.endMonth ? a(e.endMonth) : void 0, e, t), u = sa(d, l, e, t), f = da(u), w = ra(u), D = ua(s, n, e, t), W = ca(s, o, e, t), { disableNavigation: b, onMonthChange: O } = e, y = (v) => f.some((M) => M.days.some((C) => C.isEqualTo(v))), g = (v) => {
|
|
@@ -2324,16 +2324,16 @@ var te;
|
|
|
2324
2324
|
(function(e) {
|
|
2325
2325
|
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
2326
2326
|
})(te || (te = {}));
|
|
2327
|
-
function
|
|
2328
|
-
return !e[
|
|
2327
|
+
function Yt(e) {
|
|
2328
|
+
return !e[j.disabled] && !e[j.hidden] && !e[j.outside];
|
|
2329
2329
|
}
|
|
2330
2330
|
function fa(e, t, n, o) {
|
|
2331
2331
|
let r, a = -1;
|
|
2332
2332
|
for (const i of e) {
|
|
2333
2333
|
const s = t(i);
|
|
2334
|
-
|
|
2334
|
+
Yt(s) && (s[j.focused] && a < te.FocusedModifier ? (r = i, a = te.FocusedModifier) : o?.isEqualTo(i) && a < te.LastFocused ? (r = i, a = te.LastFocused) : n(i.date) && a < te.Selected ? (r = i, a = te.Selected) : s[j.today] && a < te.Today && (r = i, a = te.Today));
|
|
2335
2335
|
}
|
|
2336
|
-
return r || (r = e.find((i) =>
|
|
2336
|
+
return r || (r = e.find((i) => Yt(t(i)))), r;
|
|
2337
2337
|
}
|
|
2338
2338
|
function ma(e, t, n, o, r, a, i) {
|
|
2339
2339
|
const { ISOWeek: s, broadcastCalendar: c } = a, { addDays: d, addMonths: l, addWeeks: u, addYears: f, endOfBroadcastWeek: w, endOfISOWeek: D, endOfWeek: W, max: b, min: O, startOfBroadcastWeek: y, startOfISOWeek: g, startOfWeek: x } = i;
|
|
@@ -2347,14 +2347,14 @@ function ma(e, t, n, o, r, a, i) {
|
|
|
2347
2347
|
}[e](n, t === "after" ? 1 : -1);
|
|
2348
2348
|
return t === "before" && o ? v = b([o, v]) : t === "after" && r && (v = O([r, v])), v;
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2350
|
+
function cn(e, t, n, o, r, a, i, s = 0) {
|
|
2351
2351
|
if (s > 365)
|
|
2352
2352
|
return;
|
|
2353
|
-
const c = ma(e, t, n.date, o, r, a, i), d = !!(a.disabled && le(c, a.disabled, i)), l = !!(a.hidden && le(c, a.hidden, i)), u = c, f = new
|
|
2354
|
-
return !d && !l ? f :
|
|
2353
|
+
const c = ma(e, t, n.date, o, r, a, i), d = !!(a.disabled && le(c, a.disabled, i)), l = !!(a.hidden && le(c, a.hidden, i)), u = c, f = new Qt(c, u, i);
|
|
2354
|
+
return !d && !l ? f : cn(e, t, f, o, r, a, i, s + 1);
|
|
2355
2355
|
}
|
|
2356
2356
|
function ha(e, t, n, o, r) {
|
|
2357
|
-
const { autoFocus: a } = e, [i, s] =
|
|
2357
|
+
const { autoFocus: a } = e, [i, s] = he(), c = fa(t.days, n, o || (() => !1), i), [d, l] = he(a ? c : void 0);
|
|
2358
2358
|
return {
|
|
2359
2359
|
isFocusTarget: (W) => !!c?.isEqualTo(W),
|
|
2360
2360
|
setFocused: l,
|
|
@@ -2365,13 +2365,13 @@ function ha(e, t, n, o, r) {
|
|
|
2365
2365
|
moveFocus: (W, b) => {
|
|
2366
2366
|
if (!d)
|
|
2367
2367
|
return;
|
|
2368
|
-
const O =
|
|
2368
|
+
const O = cn(W, b, d, t.navStart, t.navEnd, e, r);
|
|
2369
2369
|
O && (e.disableNavigation && !t.days.some((g) => g.isEqualTo(O)) || (t.goToDay(O), l(O)));
|
|
2370
2370
|
}
|
|
2371
2371
|
};
|
|
2372
2372
|
}
|
|
2373
2373
|
function ya(e, t) {
|
|
2374
|
-
const { selected: n, required: o, onSelect: r } = e, [a, i] =
|
|
2374
|
+
const { selected: n, required: o, onSelect: r } = e, [a, i] = nt(n, r ? n : void 0), s = r ? n : a, { isSameDay: c } = t, d = (w) => s?.some((D) => c(D, w)) ?? !1, { min: l, max: u } = e;
|
|
2375
2375
|
return {
|
|
2376
2376
|
selected: s,
|
|
2377
2377
|
select: (w, D, W) => {
|
|
@@ -2426,15 +2426,15 @@ function ga(e, t, n = ae) {
|
|
|
2426
2426
|
}
|
|
2427
2427
|
return !1;
|
|
2428
2428
|
}
|
|
2429
|
-
function
|
|
2429
|
+
function Et(e, t, n = ae) {
|
|
2430
2430
|
return de(e, t.from, !1, n) || de(e, t.to, !1, n) || de(t, e.from, !1, n) || de(t, e.to, !1, n);
|
|
2431
2431
|
}
|
|
2432
2432
|
function wa(e, t, n = ae) {
|
|
2433
2433
|
const o = Array.isArray(t) ? t : [t];
|
|
2434
|
-
if (o.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : n.isDate(s) ? de(e, s, !1, n) :
|
|
2434
|
+
if (o.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : n.isDate(s) ? de(e, s, !1, n) : nn(s, n) ? s.some((c) => de(e, c, !1, n)) : bt(s) ? s.from && s.to ? Et(e, { from: s.from, to: s.to }, n) : !1 : tn(s) ? ga(e, s.dayOfWeek, n) : Kt(s) ? n.isAfter(s.before, s.after) ? Et(e, {
|
|
2435
2435
|
from: n.addDays(s.after, 1),
|
|
2436
2436
|
to: n.addDays(s.before, -1)
|
|
2437
|
-
}, n) : le(e.from, s, n) || le(e.to, s, n) :
|
|
2437
|
+
}, n) : le(e.from, s, n) || le(e.to, s, n) : Jt(s) || en(s) ? le(e.from, s, n) || le(e.to, s, n) : !1))
|
|
2438
2438
|
return !0;
|
|
2439
2439
|
const i = o.filter((s) => typeof s == "function");
|
|
2440
2440
|
if (i.length) {
|
|
@@ -2449,7 +2449,7 @@ function wa(e, t, n = ae) {
|
|
|
2449
2449
|
return !1;
|
|
2450
2450
|
}
|
|
2451
2451
|
function ba(e, t) {
|
|
2452
|
-
const { disabled: n, excludeDisabled: o, selected: r, required: a, onSelect: i } = e, [s, c] =
|
|
2452
|
+
const { disabled: n, excludeDisabled: o, selected: r, required: a, onSelect: i } = e, [s, c] = nt(r, i ? r : void 0), d = i ? r : s;
|
|
2453
2453
|
return {
|
|
2454
2454
|
selected: d,
|
|
2455
2455
|
select: (f, w, D) => {
|
|
@@ -2460,7 +2460,7 @@ function ba(e, t) {
|
|
|
2460
2460
|
};
|
|
2461
2461
|
}
|
|
2462
2462
|
function Ma(e, t) {
|
|
2463
|
-
const { selected: n, required: o, onSelect: r } = e, [a, i] =
|
|
2463
|
+
const { selected: n, required: o, onSelect: r } = e, [a, i] = nt(n, r ? n : void 0), s = r ? n : a, { isSameDay: c } = t;
|
|
2464
2464
|
return {
|
|
2465
2465
|
selected: s,
|
|
2466
2466
|
select: (u, f, w) => {
|
|
@@ -2483,16 +2483,16 @@ function va(e, t) {
|
|
|
2483
2483
|
return;
|
|
2484
2484
|
}
|
|
2485
2485
|
}
|
|
2486
|
-
function
|
|
2486
|
+
function ht(e) {
|
|
2487
2487
|
let t = e;
|
|
2488
2488
|
t.timeZone && (t = {
|
|
2489
2489
|
...e
|
|
2490
|
-
}, t.today && (t.today = new
|
|
2491
|
-
from: t.selected.from ? new
|
|
2492
|
-
to: t.selected.to ? new
|
|
2490
|
+
}, t.today && (t.today = new R(t.today, t.timeZone)), t.month && (t.month = new R(t.month, t.timeZone)), t.defaultMonth && (t.defaultMonth = new R(t.defaultMonth, t.timeZone)), t.startMonth && (t.startMonth = new R(t.startMonth, t.timeZone)), t.endMonth && (t.endMonth = new R(t.endMonth, t.timeZone)), t.mode === "single" && t.selected ? t.selected = new R(t.selected, t.timeZone) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((S) => new R(S, t.timeZone)) : t.mode === "range" && t.selected && (t.selected = {
|
|
2491
|
+
from: t.selected.from ? new R(t.selected.from, t.timeZone) : void 0,
|
|
2492
|
+
to: t.selected.to ? new R(t.selected.to, t.timeZone) : void 0
|
|
2493
2493
|
}));
|
|
2494
2494
|
const { components: n, formatters: o, labels: r, dateLib: a, locale: i, classNames: s } = fe(() => {
|
|
2495
|
-
const S = { ...
|
|
2495
|
+
const S = { ...wt, ...t.locale };
|
|
2496
2496
|
return {
|
|
2497
2497
|
dateLib: new K({
|
|
2498
2498
|
locale: S,
|
|
@@ -2523,17 +2523,17 @@ function it(e) {
|
|
|
2523
2523
|
t.formatters,
|
|
2524
2524
|
t.labels,
|
|
2525
2525
|
t.classNames
|
|
2526
|
-
]), { captionLayout: c, mode: d, navLayout: l, numberOfMonths: u = 1, onDayBlur: f, onDayClick: w, onDayFocus: D, onDayKeyDown: W, onDayMouseEnter: b, onDayMouseLeave: O, onNextClick: y, onPrevClick: g, showWeekNumber: x, styles: h } = t, { formatCaption: v, formatDay: M, formatMonthDropdown: C, formatWeekNumber:
|
|
2527
|
-
|
|
2528
|
-
}, [
|
|
2529
|
-
|
|
2530
|
-
}, [
|
|
2531
|
-
k.preventDefault(), k.stopPropagation(),
|
|
2532
|
-
}, [
|
|
2533
|
-
|
|
2534
|
-
}, [D,
|
|
2535
|
-
|
|
2536
|
-
}, [
|
|
2526
|
+
]), { captionLayout: c, mode: d, navLayout: l, numberOfMonths: u = 1, onDayBlur: f, onDayClick: w, onDayFocus: D, onDayKeyDown: W, onDayMouseEnter: b, onDayMouseLeave: O, onNextClick: y, onPrevClick: g, showWeekNumber: x, styles: h } = t, { formatCaption: v, formatDay: M, formatMonthDropdown: C, formatWeekNumber: I, formatWeekNumberHeader: _, formatWeekdayName: H, formatYearDropdown: F } = o, Z = la(t, a), { days: se, months: ee, navStart: ie, navEnd: ce, previousMonth: G, nextMonth: V, goToMonth: L } = Z, Oe = kr(se, t, ie, ce, a), { isSelected: ye, select: X, selected: pe } = va(t, a) ?? {}, { blur: Pe, focused: qe, isFocusTarget: ot, moveFocus: Re, setFocused: ge } = ha(t, Z, Oe, ye ?? (() => !1), a), { labelDayButton: Le, labelGridcell: ze, labelGrid: rt, labelMonthDropdown: N, labelNav: z, labelPrevious: ue, labelNext: we, labelWeekday: be, labelWeekNumber: Me, labelWeekNumberHeader: at, labelYearDropdown: st } = r, Ze = fe(() => Hr(a, t.ISOWeek), [a, t.ISOWeek]), Te = d !== void 0 || w !== void 0, Ye = q(() => {
|
|
2527
|
+
G && (L(G), g?.(G));
|
|
2528
|
+
}, [G, L, g]), ve = q(() => {
|
|
2529
|
+
V && (L(V), y?.(V));
|
|
2530
|
+
}, [L, V, y]), it = q((S, B) => (k) => {
|
|
2531
|
+
k.preventDefault(), k.stopPropagation(), ge(S), X?.(S.date, B, k), w?.(S.date, B, k);
|
|
2532
|
+
}, [X, w, ge]), Ge = q((S, B) => (k) => {
|
|
2533
|
+
ge(S), D?.(S.date, B, k);
|
|
2534
|
+
}, [D, ge]), Ve = q((S, B) => (k) => {
|
|
2535
|
+
Pe(), f?.(S.date, B, k);
|
|
2536
|
+
}, [Pe, f]), Ee = q((S, B) => (k) => {
|
|
2537
2537
|
const E = {
|
|
2538
2538
|
ArrowLeft: [
|
|
2539
2539
|
k.shiftKey ? "month" : "day",
|
|
@@ -2553,39 +2553,39 @@ function it(e) {
|
|
|
2553
2553
|
if (E[k.key]) {
|
|
2554
2554
|
k.preventDefault(), k.stopPropagation();
|
|
2555
2555
|
const [Q, P] = E[k.key];
|
|
2556
|
-
|
|
2556
|
+
Re(Q, P);
|
|
2557
2557
|
}
|
|
2558
2558
|
W?.(S.date, B, k);
|
|
2559
|
-
}, [
|
|
2559
|
+
}, [Re, W, t.dir]), Xe = q((S, B) => (k) => {
|
|
2560
2560
|
b?.(S.date, B, k);
|
|
2561
|
-
}, [b]),
|
|
2561
|
+
}, [b]), Qe = q((S, B) => (k) => {
|
|
2562
2562
|
O?.(S.date, B, k);
|
|
2563
|
-
}, [O]),
|
|
2563
|
+
}, [O]), Ue = q((S) => (B) => {
|
|
2564
2564
|
const k = Number(B.target.value), E = a.setMonth(a.startOfMonth(S), k);
|
|
2565
|
-
|
|
2566
|
-
}, [a,
|
|
2565
|
+
L(E);
|
|
2566
|
+
}, [a, L]), Ke = q((S) => (B) => {
|
|
2567
2567
|
const k = Number(B.target.value), E = a.setYear(a.startOfMonth(S), k);
|
|
2568
|
-
|
|
2569
|
-
}, [a,
|
|
2568
|
+
L(E);
|
|
2569
|
+
}, [a, L]), { className: ct, style: Je } = fe(() => ({
|
|
2570
2570
|
className: [s[p.Root], t.className].filter(Boolean).join(" "),
|
|
2571
2571
|
style: { ...h?.[p.Root], ...t.style }
|
|
2572
|
-
}), [s, t.className, t.style, h]),
|
|
2573
|
-
na(
|
|
2572
|
+
}), [s, t.className, t.style, h]), et = Sr(t), tt = Se(null);
|
|
2573
|
+
na(tt, !!t.animate, {
|
|
2574
2574
|
classNames: s,
|
|
2575
2575
|
months: ee,
|
|
2576
|
-
focused:
|
|
2576
|
+
focused: qe,
|
|
2577
2577
|
dateLib: a
|
|
2578
2578
|
});
|
|
2579
2579
|
const un = {
|
|
2580
2580
|
dayPickerProps: t,
|
|
2581
|
-
selected:
|
|
2582
|
-
select:
|
|
2583
|
-
isSelected:
|
|
2581
|
+
selected: pe,
|
|
2582
|
+
select: X,
|
|
2583
|
+
isSelected: ye,
|
|
2584
2584
|
months: ee,
|
|
2585
|
-
nextMonth:
|
|
2586
|
-
previousMonth:
|
|
2587
|
-
goToMonth:
|
|
2588
|
-
getModifiers:
|
|
2585
|
+
nextMonth: V,
|
|
2586
|
+
previousMonth: G,
|
|
2587
|
+
goToMonth: L,
|
|
2588
|
+
getModifiers: Oe,
|
|
2589
2589
|
components: n,
|
|
2590
2590
|
classNames: s,
|
|
2591
2591
|
styles: h,
|
|
@@ -2593,15 +2593,15 @@ function it(e) {
|
|
|
2593
2593
|
formatters: o
|
|
2594
2594
|
};
|
|
2595
2595
|
return m.createElement(
|
|
2596
|
-
|
|
2596
|
+
Ut.Provider,
|
|
2597
2597
|
{ value: un },
|
|
2598
2598
|
m.createElement(
|
|
2599
2599
|
n.Root,
|
|
2600
|
-
{ rootRef: t.animate ?
|
|
2600
|
+
{ rootRef: t.animate ? tt : void 0, className: ct, style: Je, 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"], ...et },
|
|
2601
2601
|
m.createElement(
|
|
2602
2602
|
n.Months,
|
|
2603
2603
|
{ className: s[p.Months], style: h?.[p.Months] },
|
|
2604
|
-
!t.hideNavigation && !l && m.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: s[p.Nav], style: h?.[p.Nav], "aria-label":
|
|
2604
|
+
!t.hideNavigation && !l && m.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: s[p.Nav], style: h?.[p.Nav], "aria-label": z(), onPreviousClick: Ye, onNextClick: ve, previousMonth: G, nextMonth: V }),
|
|
2605
2605
|
ee.map((S, B) => m.createElement(
|
|
2606
2606
|
n.Month,
|
|
2607
2607
|
{
|
|
@@ -2615,14 +2615,14 @@ function it(e) {
|
|
|
2615
2615
|
},
|
|
2616
2616
|
l === "around" && !t.hideNavigation && B === 0 && m.createElement(
|
|
2617
2617
|
n.PreviousMonthButton,
|
|
2618
|
-
{ type: "button", className: s[p.PreviousMonthButton], tabIndex:
|
|
2619
|
-
m.createElement(n.Chevron, { disabled:
|
|
2618
|
+
{ type: "button", className: s[p.PreviousMonthButton], tabIndex: G ? void 0 : -1, "aria-disabled": G ? void 0 : !0, "aria-label": ue(G), onClick: Ye, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2619
|
+
m.createElement(n.Chevron, { disabled: G ? void 0 : !0, className: s[p.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
2620
2620
|
),
|
|
2621
2621
|
m.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: s[p.MonthCaption], style: h?.[p.MonthCaption], calendarMonth: S, displayIndex: B }, c?.startsWith("dropdown") ? m.createElement(
|
|
2622
2622
|
n.DropdownNav,
|
|
2623
2623
|
{ className: s[p.Dropdowns], style: h?.[p.Dropdowns] },
|
|
2624
2624
|
(() => {
|
|
2625
|
-
const k = c === "dropdown" || c === "dropdown-months" ? m.createElement(n.MonthsDropdown, { key: "month", className: s[p.MonthsDropdown], "aria-label":
|
|
2625
|
+
const k = c === "dropdown" || c === "dropdown-months" ? m.createElement(n.MonthsDropdown, { key: "month", className: s[p.MonthsDropdown], "aria-label": N(), classNames: s, components: n, disabled: !!t.disableNavigation, onChange: Ue(S.date), options: Ir(S.date, ie, ce, o, a), style: h?.[p.Dropdown], value: a.getMonth(S.date) }) : m.createElement("span", { key: "month" }, C(S.date, a)), E = c === "dropdown" || c === "dropdown-years" ? m.createElement(n.YearsDropdown, { key: "year", className: s[p.YearsDropdown], "aria-label": st(a.options), classNames: s, components: n, disabled: !!t.disableNavigation, onChange: Ke(S.date), options: Ar(ie, ce, o, a, !!t.reverseYears), style: h?.[p.Dropdown], value: a.getYear(S.date) }) : m.createElement("span", { key: "year" }, F(S.date, a));
|
|
2626
2626
|
return a.getMonthYearOrder() === "year-first" ? [E, k] : [k, E];
|
|
2627
2627
|
})(),
|
|
2628
2628
|
m.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
@@ -2643,36 +2643,36 @@ function it(e) {
|
|
|
2643
2643
|
)),
|
|
2644
2644
|
l === "around" && !t.hideNavigation && B === u - 1 && m.createElement(
|
|
2645
2645
|
n.NextMonthButton,
|
|
2646
|
-
{ type: "button", className: s[p.NextMonthButton], tabIndex:
|
|
2647
|
-
m.createElement(n.Chevron, { disabled:
|
|
2646
|
+
{ type: "button", className: s[p.NextMonthButton], tabIndex: V ? void 0 : -1, "aria-disabled": V ? void 0 : !0, "aria-label": we(V), onClick: ve, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2647
|
+
m.createElement(n.Chevron, { disabled: V ? void 0 : !0, className: s[p.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
2648
2648
|
),
|
|
2649
|
-
B === u - 1 && l === "after" && !t.hideNavigation && m.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: s[p.Nav], style: h?.[p.Nav], "aria-label":
|
|
2649
|
+
B === u - 1 && l === "after" && !t.hideNavigation && m.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: s[p.Nav], style: h?.[p.Nav], "aria-label": z(), onPreviousClick: Ye, onNextClick: ve, previousMonth: G, nextMonth: V }),
|
|
2650
2650
|
m.createElement(
|
|
2651
2651
|
n.MonthGrid,
|
|
2652
|
-
{ role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label":
|
|
2652
|
+
{ role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": rt(S.date, a.options, a) || void 0, className: s[p.MonthGrid], style: h?.[p.MonthGrid] },
|
|
2653
2653
|
!t.hideWeekdays && m.createElement(
|
|
2654
2654
|
n.Weekdays,
|
|
2655
2655
|
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: s[p.Weekdays], style: h?.[p.Weekdays] },
|
|
2656
|
-
x && m.createElement(n.WeekNumberHeader, { "aria-label":
|
|
2657
|
-
|
|
2656
|
+
x && m.createElement(n.WeekNumberHeader, { "aria-label": at(a.options), className: s[p.WeekNumberHeader], style: h?.[p.WeekNumberHeader], scope: "col" }, _()),
|
|
2657
|
+
Ze.map((k) => m.createElement(n.Weekday, { "aria-label": be(k, a.options, a), className: s[p.Weekday], key: String(k), style: h?.[p.Weekday], scope: "col" }, H(k, a.options, a)))
|
|
2658
2658
|
),
|
|
2659
2659
|
m.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: s[p.Weeks], style: h?.[p.Weeks] }, S.weeks.map((k) => m.createElement(
|
|
2660
2660
|
n.Week,
|
|
2661
2661
|
{ className: s[p.Week], key: k.weekNumber, style: h?.[p.Week], week: k },
|
|
2662
2662
|
x && // biome-ignore lint/a11y/useSemanticElements: react component
|
|
2663
|
-
m.createElement(n.WeekNumber, { week: k, style: h?.[p.WeekNumber], "aria-label":
|
|
2663
|
+
m.createElement(n.WeekNumber, { week: k, style: h?.[p.WeekNumber], "aria-label": Me(k.weekNumber, {
|
|
2664
2664
|
locale: i
|
|
2665
|
-
}), className: s[p.WeekNumber], scope: "row", role: "rowheader" },
|
|
2665
|
+
}), className: s[p.WeekNumber], scope: "row", role: "rowheader" }, I(k.weekNumber, a)),
|
|
2666
2666
|
k.days.map((E) => {
|
|
2667
|
-
const { date: Q } = E, P =
|
|
2668
|
-
if (P[
|
|
2669
|
-
const { from:
|
|
2670
|
-
P[J.range_start] = !!(
|
|
2667
|
+
const { date: Q } = E, P = Oe(E);
|
|
2668
|
+
if (P[j.focused] = !P.hidden && !!qe?.isEqualTo(E), P[J.selected] = ye?.(Q) || P.selected, bt(pe)) {
|
|
2669
|
+
const { from: ut, to: dt } = pe;
|
|
2670
|
+
P[J.range_start] = !!(ut && dt && a.isSameDay(Q, ut)), P[J.range_end] = !!(ut && dt && a.isSameDay(Q, dt)), P[J.range_middle] = de(pe, Q, !0, a);
|
|
2671
2671
|
}
|
|
2672
|
-
const dn =
|
|
2672
|
+
const dn = jr(P, h, t.modifiersStyles), ln = Or(P, s, t.modifiersClassNames), fn = !Te && !P.hidden ? ze(Q, P, a.options, a) : void 0;
|
|
2673
2673
|
return (
|
|
2674
2674
|
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
2675
|
-
m.createElement(n.Day, { key: `${a.format(Q, "yyyy-MM-dd")}_${a.format(E.displayMonth, "yyyy-MM")}`, day: E, modifiers: P, className: ln.join(" "), style: dn, role: "gridcell", "aria-selected": P.selected || void 0, "aria-label": fn, "data-day": a.format(Q, "yyyy-MM-dd"), "data-month": E.outside ? a.format(Q, "yyyy-MM") : void 0, "data-selected": P.selected || void 0, "data-disabled": P.disabled || void 0, "data-hidden": P.hidden || void 0, "data-outside": E.outside || void 0, "data-focused": P.focused || void 0, "data-today": P.today || void 0 }, !P.hidden &&
|
|
2675
|
+
m.createElement(n.Day, { key: `${a.format(Q, "yyyy-MM-dd")}_${a.format(E.displayMonth, "yyyy-MM")}`, day: E, modifiers: P, className: ln.join(" "), style: dn, role: "gridcell", "aria-selected": P.selected || void 0, "aria-label": fn, "data-day": a.format(Q, "yyyy-MM-dd"), "data-month": E.outside ? a.format(Q, "yyyy-MM") : void 0, "data-selected": P.selected || void 0, "data-disabled": P.disabled || void 0, "data-hidden": P.hidden || void 0, "data-outside": E.outside || void 0, "data-focused": P.focused || void 0, "data-today": P.today || void 0 }, !P.hidden && Te ? m.createElement(n.DayButton, { className: s[p.DayButton], style: h?.[p.DayButton], type: "button", day: E, modifiers: P, disabled: P.disabled || void 0, tabIndex: ot(E) ? 0 : -1, "aria-label": Le(Q, P, a.options, a), onClick: it(E, P), onBlur: Ve(E, P), onFocus: Ge(E, P), onKeyDown: Ee(E, P), onMouseEnter: Xe(E, P), onMouseLeave: Qe(E, P) }, M(Q, a.options, a)) : !P.hidden && M(E.date, a.options, a))
|
|
2676
2676
|
);
|
|
2677
2677
|
})
|
|
2678
2678
|
)))
|
|
@@ -2766,15 +2766,15 @@ const Da = {
|
|
|
2766
2766
|
medium: "{{date}}, {{time}}",
|
|
2767
2767
|
short: "{{date}}, {{time}}"
|
|
2768
2768
|
}, Ca = {
|
|
2769
|
-
date:
|
|
2769
|
+
date: Ce({
|
|
2770
2770
|
formats: Oa,
|
|
2771
2771
|
defaultWidth: "full"
|
|
2772
2772
|
}),
|
|
2773
|
-
time:
|
|
2773
|
+
time: Ce({
|
|
2774
2774
|
formats: Wa,
|
|
2775
2775
|
defaultWidth: "full"
|
|
2776
2776
|
}),
|
|
2777
|
-
dateTime:
|
|
2777
|
+
dateTime: Ce({
|
|
2778
2778
|
formats: Sa,
|
|
2779
2779
|
defaultWidth: "full"
|
|
2780
2780
|
})
|
|
@@ -2905,8 +2905,8 @@ const Da = {
|
|
|
2905
2905
|
evening: "de la tarde",
|
|
2906
2906
|
night: "de la noche"
|
|
2907
2907
|
}
|
|
2908
|
-
},
|
|
2909
|
-
ordinalNumber:
|
|
2908
|
+
}, Ia = (e, t) => Number(e) + "º", ja = {
|
|
2909
|
+
ordinalNumber: Ia,
|
|
2910
2910
|
era: ne({
|
|
2911
2911
|
values: Ta,
|
|
2912
2912
|
defaultWidth: "wide"
|
|
@@ -3002,7 +3002,7 @@ const Da = {
|
|
|
3002
3002
|
night: /noche/i
|
|
3003
3003
|
}
|
|
3004
3004
|
}, Ua = {
|
|
3005
|
-
ordinalNumber:
|
|
3005
|
+
ordinalNumber: Lt({
|
|
3006
3006
|
matchPattern: Ha,
|
|
3007
3007
|
parsePattern: Aa,
|
|
3008
3008
|
valueCallback: function(e) {
|
|
@@ -3040,91 +3040,119 @@ const Da = {
|
|
|
3040
3040
|
parsePatterns: Qa,
|
|
3041
3041
|
defaultParseWidth: "any"
|
|
3042
3042
|
})
|
|
3043
|
-
},
|
|
3043
|
+
}, yt = {
|
|
3044
3044
|
code: "es",
|
|
3045
3045
|
formatDistance: ka,
|
|
3046
3046
|
formatLong: Ca,
|
|
3047
3047
|
formatRelative: Pa,
|
|
3048
|
-
localize:
|
|
3048
|
+
localize: ja,
|
|
3049
3049
|
match: Ua,
|
|
3050
3050
|
options: {
|
|
3051
3051
|
weekStartsOn: 1,
|
|
3052
3052
|
firstWeekContainsDate: 1
|
|
3053
3053
|
}
|
|
3054
3054
|
}, ss = (e) => {
|
|
3055
|
-
const {
|
|
3056
|
-
|
|
3055
|
+
const {
|
|
3056
|
+
mode: t = "single",
|
|
3057
|
+
required: n = !1,
|
|
3058
|
+
selected: o,
|
|
3059
|
+
onSelect: r,
|
|
3060
|
+
disabledDates: a,
|
|
3061
|
+
header: i,
|
|
3062
|
+
footer: s,
|
|
3063
|
+
hideOutsideDays: c = !1,
|
|
3064
|
+
numberOfMonths: d = 1,
|
|
3065
|
+
startMonth: l,
|
|
3066
|
+
endMonth: u,
|
|
3067
|
+
showActionButtons: f = !1,
|
|
3068
|
+
applyLabel: w = "Aplicar",
|
|
3069
|
+
cancelLabel: D = "Cancelar",
|
|
3070
|
+
onApply: W,
|
|
3071
|
+
onCancel: b,
|
|
3072
|
+
hideFooter: O = !1,
|
|
3073
|
+
variant: y = "input",
|
|
3074
|
+
inputProps: g,
|
|
3075
|
+
label: x = "",
|
|
3076
|
+
name: h = "datepicker",
|
|
3077
|
+
className: v
|
|
3078
|
+
} = e, M = t === "range" || t === "multiple" ? e.min : void 0, C = t === "range" || t === "multiple" ? e.max : void 0, I = t === "range" ? e.excludeDisabled : void 0, [_, H] = he({}), [F, Z] = he(!1), [se, ee] = he(!1), [ie, ce] = he(o), [G, V] = he(!1), L = Se(null), Oe = Se(null), ye = f ? ie : o, X = f ? o : ye;
|
|
3079
|
+
_e(() => {
|
|
3080
|
+
window.innerWidth < 768 ? V(!0) : V(!1);
|
|
3081
|
+
}, []), _e(() => {
|
|
3057
3082
|
f && ce(o);
|
|
3058
|
-
}, [o, f]),
|
|
3083
|
+
}, [o, f]), _e(() => {
|
|
3059
3084
|
if (y !== "input" || !F) return;
|
|
3060
|
-
const N = (
|
|
3061
|
-
|
|
3085
|
+
const N = (z) => {
|
|
3086
|
+
L.current && !L.current.contains(z.target) && (Z(!1), f && ce(o));
|
|
3062
3087
|
};
|
|
3063
3088
|
return document.addEventListener("mousedown", N), () => {
|
|
3064
3089
|
document.removeEventListener("mousedown", N);
|
|
3065
3090
|
};
|
|
3066
|
-
}, [y, F, o, f]),
|
|
3067
|
-
if (!F || y !== "input" || !
|
|
3091
|
+
}, [y, F, o, f]), _e(() => {
|
|
3092
|
+
if (!F || y !== "input" || !L.current) {
|
|
3068
3093
|
ee(!1);
|
|
3069
3094
|
return;
|
|
3070
3095
|
}
|
|
3071
|
-
const N =
|
|
3072
|
-
const
|
|
3073
|
-
if (!
|
|
3074
|
-
const
|
|
3096
|
+
const N = 16, z = () => {
|
|
3097
|
+
const be = L?.current?.getBoundingClientRect(), Me = Oe?.current?.getBoundingClientRect();
|
|
3098
|
+
if (!be || !Me) return;
|
|
3099
|
+
const at = window.innerHeight, st = window.innerWidth, Ze = be.height, Te = be.width, Ye = Me.left, ve = Me.bottom, it = ve, Ge = at - ve, Ve = st - Me.left, Ee = Te - Ve, Xe = Ee > 0 && Ve >= Te + N, Qe = it >= Ze + N, Ue = Ge >= Ze + N, Ke = !Ue && Qe, ct = !Ue && !Qe;
|
|
3100
|
+
let Je = Ke ? void 0 : `${ve + 8}px`, et = Ke ? `${Ge + Me.height + 8}px` : void 0;
|
|
3101
|
+
ct && (Je = void 0, et = `${N}px`);
|
|
3102
|
+
const tt = Ee > 0 ? Ee : 0;
|
|
3075
3103
|
H(
|
|
3076
3104
|
{
|
|
3077
|
-
top:
|
|
3078
|
-
bottom:
|
|
3079
|
-
right:
|
|
3080
|
-
left:
|
|
3105
|
+
top: Je,
|
|
3106
|
+
bottom: et,
|
|
3107
|
+
right: Xe ? "0" : void 0,
|
|
3108
|
+
left: Xe ? void 0 : `${Ye - tt}px`
|
|
3081
3109
|
}
|
|
3082
3110
|
), ee(!0);
|
|
3083
3111
|
}, ue = () => {
|
|
3084
|
-
|
|
3112
|
+
Z(!1), ee(!1);
|
|
3085
3113
|
};
|
|
3086
3114
|
window.addEventListener("scroll", ue, !0);
|
|
3087
|
-
const
|
|
3115
|
+
const we = setTimeout(z, 0);
|
|
3088
3116
|
return () => {
|
|
3089
|
-
clearTimeout(
|
|
3117
|
+
clearTimeout(we), window.removeEventListener("scroll", ue, !0);
|
|
3090
3118
|
};
|
|
3091
3119
|
}, [F, y]);
|
|
3092
|
-
const
|
|
3093
|
-
W?.(ie), r?.(ie), y === "input" &&
|
|
3094
|
-
}, [W, r, ie, y]),
|
|
3095
|
-
ce(o), b?.(), y === "input" &&
|
|
3096
|
-
}, [b, o, y]),
|
|
3120
|
+
const pe = q(() => {
|
|
3121
|
+
W?.(ie), r?.(ie), y === "input" && Z(!1);
|
|
3122
|
+
}, [W, r, ie, y]), Pe = q(() => {
|
|
3123
|
+
ce(o), b?.(), y === "input" && Z(!1);
|
|
3124
|
+
}, [b, o, y]), qe = fe(() => {
|
|
3097
3125
|
if (!X) return "";
|
|
3098
3126
|
if (t === "single")
|
|
3099
3127
|
return X.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3100
3128
|
if (t === "range") {
|
|
3101
3129
|
const N = X;
|
|
3102
3130
|
if (!N.from) return "";
|
|
3103
|
-
const
|
|
3104
|
-
if (!N.to) return
|
|
3131
|
+
const z = N.from.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3132
|
+
if (!N.to) return z;
|
|
3105
3133
|
const ue = N.to.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3106
|
-
return `${
|
|
3134
|
+
return `${z} - ${ue}`;
|
|
3107
3135
|
}
|
|
3108
3136
|
if (t === "multiple") {
|
|
3109
3137
|
const N = X;
|
|
3110
3138
|
return N.length === 0 ? "" : N.length === 1 ? N[0].toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" }) : `${N.length} fechas seleccionadas`;
|
|
3111
3139
|
}
|
|
3112
3140
|
return "";
|
|
3113
|
-
}, [X, t]),
|
|
3141
|
+
}, [X, t]), ot = fe(() => y === "input" || y === "input-and-calendar", [y]), Re = fe(() => y === "only-calendar" || y === "input-and-calendar" || y === "input", [y]), ge = q((N) => {
|
|
3114
3142
|
r?.(N);
|
|
3115
|
-
}, [r]),
|
|
3116
|
-
const
|
|
3143
|
+
}, [r]), Le = q((N) => {
|
|
3144
|
+
const z = new Date(parseInt(N.slice(6, 10)), parseInt(N.slice(3, 5)) - 1, parseInt(N.slice(0, 2)));
|
|
3117
3145
|
if (t === "multiple") {
|
|
3118
|
-
const
|
|
3119
|
-
f ? (r?.(
|
|
3146
|
+
const we = (X || []).filter((be) => be.getTime() !== z.getTime());
|
|
3147
|
+
f ? (r?.(we), ce(we)) : ge(we);
|
|
3120
3148
|
}
|
|
3121
|
-
}, [t, X, f, r,
|
|
3149
|
+
}, [t, X, f, r, ge]), ze = q((N) => {
|
|
3122
3150
|
if (f) {
|
|
3123
3151
|
ce(N);
|
|
3124
3152
|
return;
|
|
3125
3153
|
}
|
|
3126
|
-
y === "input" && t === "single" &&
|
|
3127
|
-
}, [f, y, t, r]),
|
|
3154
|
+
y === "input" && t === "single" && Z(!1), r?.(N);
|
|
3155
|
+
}, [f, y, t, r]), rt = q(() => {
|
|
3128
3156
|
const N = X || [];
|
|
3129
3157
|
return /* @__PURE__ */ $.jsx(
|
|
3130
3158
|
gn,
|
|
@@ -3132,70 +3160,70 @@ const Da = {
|
|
|
3132
3160
|
label: x,
|
|
3133
3161
|
placeholder: "Seleccione una o más fechas",
|
|
3134
3162
|
name: h,
|
|
3135
|
-
value: N.sort((
|
|
3163
|
+
value: N.sort((z, ue) => z.getTime() - ue.getTime()).map((z) => z.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" })),
|
|
3136
3164
|
onChange: () => {
|
|
3137
3165
|
},
|
|
3138
|
-
onClick: () =>
|
|
3139
|
-
className:
|
|
3166
|
+
onClick: () => Z(!0),
|
|
3167
|
+
className: Be("w-[360px]", g?.className),
|
|
3140
3168
|
readonly: !0,
|
|
3141
|
-
onValueDelete:
|
|
3142
|
-
icon: /* @__PURE__ */ $.jsx(
|
|
3169
|
+
onValueDelete: Le,
|
|
3170
|
+
icon: /* @__PURE__ */ $.jsx(Mt.Calendar, {})
|
|
3143
3171
|
}
|
|
3144
3172
|
);
|
|
3145
|
-
}, [X, x, h,
|
|
3146
|
-
return /* @__PURE__ */ $.jsxs("div", { className: "relative w-max flex flex-col gap-2", children: [
|
|
3147
|
-
|
|
3173
|
+
}, [X, x, h, Le, g]);
|
|
3174
|
+
return /* @__PURE__ */ $.jsxs("div", { className: Be("relative w-max flex flex-col gap-2 lg:min-w-[360px] min-w-auto", g?.className), children: [
|
|
3175
|
+
ot && /* @__PURE__ */ $.jsx(
|
|
3148
3176
|
"div",
|
|
3149
3177
|
{
|
|
3150
|
-
ref:
|
|
3151
|
-
className: "relative w-
|
|
3152
|
-
children: t === "multiple" ?
|
|
3178
|
+
ref: Oe,
|
|
3179
|
+
className: "relative w-full",
|
|
3180
|
+
children: t === "multiple" ? rt() : /* @__PURE__ */ $.jsx(
|
|
3153
3181
|
wn,
|
|
3154
3182
|
{
|
|
3155
|
-
|
|
3183
|
+
readOnly: !0,
|
|
3156
3184
|
...g,
|
|
3157
|
-
icon: /* @__PURE__ */ $.jsx(
|
|
3185
|
+
icon: /* @__PURE__ */ $.jsx(Mt.Calendar, {}),
|
|
3158
3186
|
iconPosition: "right",
|
|
3159
3187
|
type: "text",
|
|
3160
|
-
value:
|
|
3188
|
+
value: qe,
|
|
3161
3189
|
onChange: () => {
|
|
3162
3190
|
},
|
|
3163
3191
|
name: h,
|
|
3164
3192
|
label: x,
|
|
3165
3193
|
onFocus: (N) => {
|
|
3166
|
-
N.stopPropagation(), y === "input" &&
|
|
3194
|
+
N.stopPropagation(), y === "input" && Z(!0);
|
|
3167
3195
|
}
|
|
3168
3196
|
}
|
|
3169
3197
|
)
|
|
3170
3198
|
}
|
|
3171
3199
|
),
|
|
3172
|
-
|
|
3200
|
+
Re && (y === "input" ? document?.body && bn(
|
|
3173
3201
|
/* @__PURE__ */ $.jsx(
|
|
3174
|
-
|
|
3202
|
+
gt,
|
|
3175
3203
|
{
|
|
3176
3204
|
mode: t,
|
|
3177
3205
|
footer: s,
|
|
3178
3206
|
header: i,
|
|
3179
3207
|
selected: o,
|
|
3180
|
-
ref:
|
|
3208
|
+
ref: L,
|
|
3181
3209
|
endMonth: u,
|
|
3182
3210
|
required: n,
|
|
3183
|
-
onApply:
|
|
3184
|
-
onCancel:
|
|
3211
|
+
onApply: pe,
|
|
3212
|
+
onCancel: Pe,
|
|
3185
3213
|
hideFooter: O,
|
|
3186
3214
|
startMonth: l,
|
|
3187
3215
|
applyLabel: w,
|
|
3188
3216
|
cancelLabel: D,
|
|
3189
|
-
displayValue:
|
|
3217
|
+
displayValue: ye,
|
|
3190
3218
|
disabledDates: a,
|
|
3191
|
-
numberOfMonths: d,
|
|
3192
|
-
onSelect:
|
|
3219
|
+
numberOfMonths: G ? 1 : d,
|
|
3220
|
+
onSelect: ze,
|
|
3193
3221
|
hideOutsideDays: c,
|
|
3194
3222
|
showActionButtons: f,
|
|
3195
3223
|
min: M,
|
|
3196
3224
|
max: C,
|
|
3197
|
-
excludeDisabled:
|
|
3198
|
-
className:
|
|
3225
|
+
excludeDisabled: I,
|
|
3226
|
+
className: Be("bg-neutral-strong-default text-neutral-default-default shadow", v),
|
|
3199
3227
|
style: {
|
|
3200
3228
|
top: _?.top,
|
|
3201
3229
|
left: _?.left,
|
|
@@ -3211,7 +3239,7 @@ const Da = {
|
|
|
3211
3239
|
),
|
|
3212
3240
|
document.body
|
|
3213
3241
|
) : /* @__PURE__ */ $.jsx(
|
|
3214
|
-
|
|
3242
|
+
gt,
|
|
3215
3243
|
{
|
|
3216
3244
|
min: M,
|
|
3217
3245
|
max: C,
|
|
@@ -3222,23 +3250,23 @@ const Da = {
|
|
|
3222
3250
|
endMonth: u,
|
|
3223
3251
|
selected: o,
|
|
3224
3252
|
className: v,
|
|
3225
|
-
onApply:
|
|
3253
|
+
onApply: pe,
|
|
3226
3254
|
startMonth: l,
|
|
3227
3255
|
applyLabel: w,
|
|
3228
3256
|
hideFooter: O,
|
|
3229
|
-
onCancel:
|
|
3257
|
+
onCancel: Pe,
|
|
3230
3258
|
cancelLabel: D,
|
|
3231
|
-
displayValue:
|
|
3259
|
+
displayValue: ye,
|
|
3232
3260
|
disabledDates: a,
|
|
3233
|
-
numberOfMonths: d,
|
|
3234
|
-
onSelect:
|
|
3261
|
+
numberOfMonths: G ? 1 : d,
|
|
3262
|
+
onSelect: ze,
|
|
3235
3263
|
hideOutsideDays: c,
|
|
3236
3264
|
showActionButtons: f,
|
|
3237
|
-
excludeDisabled:
|
|
3265
|
+
excludeDisabled: I
|
|
3238
3266
|
}
|
|
3239
3267
|
))
|
|
3240
3268
|
] });
|
|
3241
|
-
},
|
|
3269
|
+
}, gt = pn((e) => {
|
|
3242
3270
|
const {
|
|
3243
3271
|
ref: t,
|
|
3244
3272
|
min: n,
|
|
@@ -3264,7 +3292,7 @@ const Da = {
|
|
|
3264
3292
|
cancelLabel: v = "Cancelar",
|
|
3265
3293
|
hideOutsideDays: M = !1,
|
|
3266
3294
|
showActionButtons: C = !1
|
|
3267
|
-
} = e,
|
|
3295
|
+
} = e, I = fe(() => {
|
|
3268
3296
|
if (l) {
|
|
3269
3297
|
if (y === "single")
|
|
3270
3298
|
return l;
|
|
@@ -3296,25 +3324,28 @@ const Da = {
|
|
|
3296
3324
|
// Días fuera del mes actual
|
|
3297
3325
|
outside: "text-neutral-medium-default",
|
|
3298
3326
|
//Contenedor
|
|
3299
|
-
months: "flex gap-4 justify-center relative ",
|
|
3300
|
-
root: "px-2 text-neutral-default-default"
|
|
3327
|
+
months: "flex gap-4 justify-center relative w-full flex-wrap overflow-auto ",
|
|
3328
|
+
root: "px-2 text-neutral-default-default "
|
|
3301
3329
|
}), []);
|
|
3302
3330
|
return /* @__PURE__ */ $.jsxs(
|
|
3303
3331
|
"div",
|
|
3304
3332
|
{
|
|
3305
3333
|
ref: t,
|
|
3306
|
-
className:
|
|
3334
|
+
className: Be(
|
|
3307
3335
|
"border border-neutral-default-default rounded-lg",
|
|
3308
|
-
g > 1 ? `w-[${g * 360}px]` : "w-[360px]",
|
|
3309
3336
|
w
|
|
3310
3337
|
),
|
|
3311
|
-
style:
|
|
3338
|
+
style: {
|
|
3339
|
+
...r,
|
|
3340
|
+
width: g * 360,
|
|
3341
|
+
overflowX: "auto"
|
|
3342
|
+
},
|
|
3312
3343
|
children: [
|
|
3313
3344
|
a && /* @__PURE__ */ $.jsx("div", { className: "pt-6 pl-6 pr-3 pb-2 min-h-[68px]", children: typeof a == "string" ? /* @__PURE__ */ $.jsx("p", { className: "prometeo-fonts-label-large text-neutral-medium-default w-64 ", children: a }) : a }),
|
|
3314
3345
|
y === "single" && /* @__PURE__ */ $.jsx(
|
|
3315
|
-
|
|
3346
|
+
ht,
|
|
3316
3347
|
{
|
|
3317
|
-
locale:
|
|
3348
|
+
locale: yt,
|
|
3318
3349
|
mode: "single",
|
|
3319
3350
|
captionLayout: "dropdown-months",
|
|
3320
3351
|
formatters: _,
|
|
@@ -3322,7 +3353,7 @@ const Da = {
|
|
|
3322
3353
|
required: u,
|
|
3323
3354
|
disabled: b,
|
|
3324
3355
|
selected: W,
|
|
3325
|
-
defaultMonth:
|
|
3356
|
+
defaultMonth: I,
|
|
3326
3357
|
className: "px-3",
|
|
3327
3358
|
showOutsideDays: !M,
|
|
3328
3359
|
numberOfMonths: g,
|
|
@@ -3332,7 +3363,7 @@ const Da = {
|
|
|
3332
3363
|
}
|
|
3333
3364
|
),
|
|
3334
3365
|
y === "range" && /* @__PURE__ */ $.jsx(
|
|
3335
|
-
|
|
3366
|
+
ht,
|
|
3336
3367
|
{
|
|
3337
3368
|
mode: "range",
|
|
3338
3369
|
captionLayout: "dropdown-months",
|
|
@@ -3340,7 +3371,7 @@ const Da = {
|
|
|
3340
3371
|
classNames: H,
|
|
3341
3372
|
numberOfMonths: g,
|
|
3342
3373
|
selected: W,
|
|
3343
|
-
defaultMonth:
|
|
3374
|
+
defaultMonth: I,
|
|
3344
3375
|
onSelect: d,
|
|
3345
3376
|
required: u,
|
|
3346
3377
|
disabled: b,
|
|
@@ -3349,19 +3380,19 @@ const Da = {
|
|
|
3349
3380
|
min: n,
|
|
3350
3381
|
max: o,
|
|
3351
3382
|
pagedNavigation: !0,
|
|
3352
|
-
locale:
|
|
3383
|
+
locale: yt,
|
|
3353
3384
|
excludeDisabled: O ?? !0
|
|
3354
3385
|
}
|
|
3355
3386
|
),
|
|
3356
3387
|
y === "multiple" && /* @__PURE__ */ $.jsx(
|
|
3357
|
-
|
|
3388
|
+
ht,
|
|
3358
3389
|
{
|
|
3359
3390
|
mode: "multiple",
|
|
3360
3391
|
captionLayout: "dropdown-months",
|
|
3361
3392
|
formatters: _,
|
|
3362
3393
|
classNames: H,
|
|
3363
3394
|
selected: W,
|
|
3364
|
-
defaultMonth:
|
|
3395
|
+
defaultMonth: I,
|
|
3365
3396
|
onSelect: d,
|
|
3366
3397
|
required: u,
|
|
3367
3398
|
disabled: b,
|
|
@@ -3369,15 +3400,15 @@ const Da = {
|
|
|
3369
3400
|
endMonth: f,
|
|
3370
3401
|
min: n,
|
|
3371
3402
|
max: o,
|
|
3372
|
-
locale:
|
|
3403
|
+
locale: yt
|
|
3373
3404
|
}
|
|
3374
3405
|
),
|
|
3375
|
-
!x && /* @__PURE__ */ $.jsx("div", { className:
|
|
3406
|
+
!x && /* @__PURE__ */ $.jsx("div", { className: Be(
|
|
3376
3407
|
"w-full min-h-[40px] pt-2 px-3 pb-3 flex items-center relative"
|
|
3377
3408
|
), children: typeof i == "string" ? /* @__PURE__ */ $.jsx("p", { className: "prometeo-fonts-label-large text-neutral-medium-default w-64 ", children: i }) : i }),
|
|
3378
3409
|
C && /* @__PURE__ */ $.jsxs("div", { className: "w-full px-3 pb-3 pt-2 flex gap-2 justify-end ", children: [
|
|
3379
3410
|
/* @__PURE__ */ $.jsx(
|
|
3380
|
-
|
|
3411
|
+
vt,
|
|
3381
3412
|
{
|
|
3382
3413
|
variant: "text",
|
|
3383
3414
|
onClick: c,
|
|
@@ -3386,7 +3417,7 @@ const Da = {
|
|
|
3386
3417
|
}
|
|
3387
3418
|
),
|
|
3388
3419
|
/* @__PURE__ */ $.jsx(
|
|
3389
|
-
|
|
3420
|
+
vt,
|
|
3390
3421
|
{
|
|
3391
3422
|
onClick: s,
|
|
3392
3423
|
variant: "text",
|
|
@@ -3399,7 +3430,7 @@ const Da = {
|
|
|
3399
3430
|
}
|
|
3400
3431
|
);
|
|
3401
3432
|
});
|
|
3402
|
-
|
|
3433
|
+
gt.displayName = "Calendar";
|
|
3403
3434
|
export {
|
|
3404
3435
|
ss as default
|
|
3405
3436
|
};
|