@situaction/traq-ui-ste 1.1.21 → 1.1.22
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/components/calendar/Calendar.js +257 -256
- package/dist/styles/Calendar.css +1 -1
- package/package.json +1 -1
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as E, jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import { useState as O, useRef as I, useEffect as B } from "react";
|
|
3
3
|
import { IconButton as z } from "../icon-button/IconButton.js";
|
|
4
|
-
import { Button as
|
|
5
|
-
import '../../styles/Calendar.css';const
|
|
6
|
-
calendar:
|
|
7
|
-
relative:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
import { Button as Se } from "../button/Button.js";
|
|
5
|
+
import '../../styles/Calendar.css';const Ne = "_calendar_1b30a_6", je = "_relative_1b30a_15", Ee = "_dropDownCtn_1b30a_18", Fe = "_calendarHeader_1b30a_28", Le = "_calendarWeekdays_1b30a_38", $e = "_calendarGrid_1b30a_39", He = "_calendarDay_1b30a_49", qe = "_today_1b30a_64", Ae = "_selected_1b30a_67", Je = "_disabled_1b30a_74", Re = "_inRange_1b30a_81", Xe = "_dropdown_1b30a_84", Be = "_yearList_1b30a_96", Ve = "_yearItem_1b30a_103", Qe = "_loading_1b30a_111", M = {
|
|
6
|
+
calendar: Ne,
|
|
7
|
+
relative: je,
|
|
8
|
+
dropDownCtn: Ee,
|
|
9
|
+
calendarHeader: Fe,
|
|
10
|
+
calendarWeekdays: Le,
|
|
11
|
+
calendarGrid: $e,
|
|
12
|
+
calendarDay: He,
|
|
13
|
+
today: qe,
|
|
14
|
+
selected: Ae,
|
|
15
|
+
disabled: Je,
|
|
16
|
+
inRange: Re,
|
|
17
|
+
dropdown: Xe,
|
|
18
|
+
yearList: Be,
|
|
19
|
+
yearItem: Ve,
|
|
20
|
+
loading: Qe
|
|
20
21
|
};
|
|
21
22
|
function h(t) {
|
|
22
23
|
const e = Object.prototype.toString.call(t);
|
|
23
24
|
return t instanceof Date || typeof t == "object" && e === "[object Date]" ? new t.constructor(+t) : typeof t == "number" || e === "[object Number]" || typeof t == "string" || e === "[object String]" ? new Date(t) : /* @__PURE__ */ new Date(NaN);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function k(t, e) {
|
|
26
27
|
return t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function Ge(t, e) {
|
|
29
30
|
const n = h(t);
|
|
30
|
-
return isNaN(e) ?
|
|
31
|
+
return isNaN(e) ? k(t, NaN) : (n.setDate(n.getDate() + e), n);
|
|
31
32
|
}
|
|
32
33
|
function ie(t, e) {
|
|
33
34
|
const n = h(t);
|
|
34
|
-
if (isNaN(e)) return
|
|
35
|
+
if (isNaN(e)) return k(t, NaN);
|
|
35
36
|
if (!e)
|
|
36
37
|
return n;
|
|
37
|
-
const a = n.getDate(), r =
|
|
38
|
+
const a = n.getDate(), r = k(t, n.getTime());
|
|
38
39
|
r.setMonth(n.getMonth() + e + 1, 0);
|
|
39
40
|
const i = r.getDate();
|
|
40
41
|
return a >= i ? r : (n.setFullYear(
|
|
@@ -43,28 +44,28 @@ function ie(t, e) {
|
|
|
43
44
|
a
|
|
44
45
|
), n);
|
|
45
46
|
}
|
|
46
|
-
const se = 6048e5,
|
|
47
|
-
let
|
|
47
|
+
const se = 6048e5, Ie = 864e5;
|
|
48
|
+
let ze = {};
|
|
48
49
|
function A() {
|
|
49
|
-
return
|
|
50
|
+
return ze;
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function N(t, e) {
|
|
52
53
|
var s, l, f, w;
|
|
53
54
|
const n = A(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((l = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : l.weekStartsOn) ?? n.weekStartsOn ?? ((w = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : w.weekStartsOn) ?? 0, r = h(t), i = r.getDay(), c = (i < a ? 7 : 0) + i - a;
|
|
54
55
|
return r.setDate(r.getDate() - c), r.setHours(0, 0, 0, 0), r;
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
57
|
+
function H(t) {
|
|
58
|
+
return N(t, { weekStartsOn: 1 });
|
|
58
59
|
}
|
|
59
60
|
function oe(t) {
|
|
60
|
-
const e = h(t), n = e.getFullYear(), a =
|
|
61
|
+
const e = h(t), n = e.getFullYear(), a = k(t, 0);
|
|
61
62
|
a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
62
|
-
const r =
|
|
63
|
+
const r = H(a), i = k(t, 0);
|
|
63
64
|
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
|
|
64
|
-
const c =
|
|
65
|
+
const c = H(i);
|
|
65
66
|
return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= c.getTime() ? n : n - 1;
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
+
function q(t) {
|
|
68
69
|
const e = h(t);
|
|
69
70
|
return e.setHours(0, 0, 0, 0), e;
|
|
70
71
|
}
|
|
@@ -82,44 +83,44 @@ function Z(t) {
|
|
|
82
83
|
);
|
|
83
84
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
-
const n =
|
|
87
|
-
return Math.round((r - i) /
|
|
86
|
+
function Ze(t, e) {
|
|
87
|
+
const n = q(t), a = q(e), r = +n - Z(n), i = +a - Z(a);
|
|
88
|
+
return Math.round((r - i) / Ie);
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
const e = oe(t), n =
|
|
91
|
-
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0),
|
|
90
|
+
function Ue(t) {
|
|
91
|
+
const e = oe(t), n = k(t, 0);
|
|
92
|
+
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), H(n);
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
-
const n =
|
|
94
|
+
function Y(t, e) {
|
|
95
|
+
const n = q(t), a = q(e);
|
|
95
96
|
return +n == +a;
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function Ke(t) {
|
|
98
99
|
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
-
if (!
|
|
101
|
+
function et(t) {
|
|
102
|
+
if (!Ke(t) && typeof t != "number")
|
|
102
103
|
return !1;
|
|
103
104
|
const e = h(t);
|
|
104
105
|
return !isNaN(Number(e));
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
+
function tt(t) {
|
|
107
108
|
const e = h(t), n = e.getMonth();
|
|
108
109
|
return e.setFullYear(e.getFullYear(), n + 1, 0), e.setHours(23, 59, 59, 999), e;
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function nt(t) {
|
|
111
112
|
const e = h(t);
|
|
112
113
|
return e.setDate(1), e.setHours(0, 0, 0, 0), e;
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
const e = h(t), n =
|
|
115
|
+
function at(t) {
|
|
116
|
+
const e = h(t), n = k(t, 0);
|
|
116
117
|
return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function rt(t, e) {
|
|
119
120
|
const n = e == null ? void 0 : e.weekStartsOn, a = h(t), r = a.getDay(), i = (r < n ? -7 : 0) + 6 - (r - n);
|
|
120
121
|
return a.setDate(a.getDate() + i), a.setHours(23, 59, 59, 999), a;
|
|
121
122
|
}
|
|
122
|
-
const
|
|
123
|
+
const it = {
|
|
123
124
|
lessThanXSeconds: {
|
|
124
125
|
one: "less than a second",
|
|
125
126
|
other: "less than {{count}} seconds"
|
|
@@ -181,53 +182,53 @@ const rt = {
|
|
|
181
182
|
one: "almost 1 year",
|
|
182
183
|
other: "almost {{count}} years"
|
|
183
184
|
}
|
|
184
|
-
},
|
|
185
|
+
}, st = (t, e, n) => {
|
|
185
186
|
let a;
|
|
186
|
-
const r =
|
|
187
|
+
const r = it[t];
|
|
187
188
|
return typeof r == "string" ? a = r : e === 1 ? a = r.one : a = r.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + a : a + " ago" : a;
|
|
188
189
|
};
|
|
189
|
-
function
|
|
190
|
+
function S(t) {
|
|
190
191
|
return (e = {}) => {
|
|
191
192
|
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
192
193
|
return t.formats[n] || t.formats[t.defaultWidth];
|
|
193
194
|
};
|
|
194
195
|
}
|
|
195
|
-
const
|
|
196
|
+
const ot = {
|
|
196
197
|
full: "EEEE, MMMM do, y",
|
|
197
198
|
long: "MMMM do, y",
|
|
198
199
|
medium: "MMM d, y",
|
|
199
200
|
short: "MM/dd/yyyy"
|
|
200
|
-
},
|
|
201
|
+
}, ct = {
|
|
201
202
|
full: "h:mm:ss a zzzz",
|
|
202
203
|
long: "h:mm:ss a z",
|
|
203
204
|
medium: "h:mm:ss a",
|
|
204
205
|
short: "h:mm a"
|
|
205
|
-
},
|
|
206
|
+
}, ut = {
|
|
206
207
|
full: "{{date}} 'at' {{time}}",
|
|
207
208
|
long: "{{date}} 'at' {{time}}",
|
|
208
209
|
medium: "{{date}}, {{time}}",
|
|
209
210
|
short: "{{date}}, {{time}}"
|
|
210
|
-
},
|
|
211
|
-
date:
|
|
212
|
-
formats: st,
|
|
213
|
-
defaultWidth: "full"
|
|
214
|
-
}),
|
|
215
|
-
time: C({
|
|
211
|
+
}, dt = {
|
|
212
|
+
date: S({
|
|
216
213
|
formats: ot,
|
|
217
214
|
defaultWidth: "full"
|
|
218
215
|
}),
|
|
219
|
-
|
|
216
|
+
time: S({
|
|
220
217
|
formats: ct,
|
|
221
218
|
defaultWidth: "full"
|
|
219
|
+
}),
|
|
220
|
+
dateTime: S({
|
|
221
|
+
formats: ut,
|
|
222
|
+
defaultWidth: "full"
|
|
222
223
|
})
|
|
223
|
-
},
|
|
224
|
+
}, lt = {
|
|
224
225
|
lastWeek: "'last' eeee 'at' p",
|
|
225
226
|
yesterday: "'yesterday at' p",
|
|
226
227
|
today: "'today at' p",
|
|
227
228
|
tomorrow: "'tomorrow at' p",
|
|
228
229
|
nextWeek: "eeee 'at' p",
|
|
229
230
|
other: "P"
|
|
230
|
-
},
|
|
231
|
+
}, mt = (t, e, n, a) => lt[t];
|
|
231
232
|
function p(t) {
|
|
232
233
|
return (e, n) => {
|
|
233
234
|
const a = n != null && n.context ? String(n.context) : "standalone";
|
|
@@ -243,15 +244,15 @@ function p(t) {
|
|
|
243
244
|
return r[i];
|
|
244
245
|
};
|
|
245
246
|
}
|
|
246
|
-
const
|
|
247
|
+
const ht = {
|
|
247
248
|
narrow: ["B", "A"],
|
|
248
249
|
abbreviated: ["BC", "AD"],
|
|
249
250
|
wide: ["Before Christ", "Anno Domini"]
|
|
250
|
-
},
|
|
251
|
+
}, ft = {
|
|
251
252
|
narrow: ["1", "2", "3", "4"],
|
|
252
253
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
253
254
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
254
|
-
},
|
|
255
|
+
}, gt = {
|
|
255
256
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
256
257
|
abbreviated: [
|
|
257
258
|
"Jan",
|
|
@@ -281,7 +282,7 @@ const mt = {
|
|
|
281
282
|
"November",
|
|
282
283
|
"December"
|
|
283
284
|
]
|
|
284
|
-
},
|
|
285
|
+
}, wt = {
|
|
285
286
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
286
287
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
287
288
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -294,7 +295,7 @@ const mt = {
|
|
|
294
295
|
"Friday",
|
|
295
296
|
"Saturday"
|
|
296
297
|
]
|
|
297
|
-
},
|
|
298
|
+
}, bt = {
|
|
298
299
|
narrow: {
|
|
299
300
|
am: "a",
|
|
300
301
|
pm: "p",
|
|
@@ -356,7 +357,7 @@ const mt = {
|
|
|
356
357
|
evening: "in the evening",
|
|
357
358
|
night: "at night"
|
|
358
359
|
}
|
|
359
|
-
},
|
|
360
|
+
}, Mt = (t, e) => {
|
|
360
361
|
const n = Number(t), a = n % 100;
|
|
361
362
|
if (a > 20 || a < 10)
|
|
362
363
|
switch (a % 10) {
|
|
@@ -368,40 +369,40 @@ const mt = {
|
|
|
368
369
|
return n + "rd";
|
|
369
370
|
}
|
|
370
371
|
return n + "th";
|
|
371
|
-
},
|
|
372
|
-
ordinalNumber:
|
|
372
|
+
}, vt = {
|
|
373
|
+
ordinalNumber: Mt,
|
|
373
374
|
era: p({
|
|
374
|
-
values:
|
|
375
|
+
values: ht,
|
|
375
376
|
defaultWidth: "wide"
|
|
376
377
|
}),
|
|
377
378
|
quarter: p({
|
|
378
|
-
values:
|
|
379
|
+
values: ft,
|
|
379
380
|
defaultWidth: "wide",
|
|
380
381
|
argumentCallback: (t) => t - 1
|
|
381
382
|
}),
|
|
382
383
|
month: p({
|
|
383
|
-
values:
|
|
384
|
+
values: gt,
|
|
384
385
|
defaultWidth: "wide"
|
|
385
386
|
}),
|
|
386
387
|
day: p({
|
|
387
|
-
values:
|
|
388
|
+
values: wt,
|
|
388
389
|
defaultWidth: "wide"
|
|
389
390
|
}),
|
|
390
391
|
dayPeriod: p({
|
|
391
|
-
values:
|
|
392
|
+
values: bt,
|
|
392
393
|
defaultWidth: "wide",
|
|
393
394
|
formattingValues: yt,
|
|
394
395
|
defaultFormattingWidth: "wide"
|
|
395
396
|
})
|
|
396
397
|
};
|
|
397
|
-
function
|
|
398
|
+
function D(t) {
|
|
398
399
|
return (e, n = {}) => {
|
|
399
400
|
const a = n.width, r = a && t.matchPatterns[a] || t.matchPatterns[t.defaultMatchWidth], i = e.match(r);
|
|
400
401
|
if (!i)
|
|
401
402
|
return null;
|
|
402
|
-
const c = i[0], s = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], l = Array.isArray(s) ?
|
|
403
|
+
const c = i[0], s = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], l = Array.isArray(s) ? pt(s, (v) => v.test(c)) : (
|
|
403
404
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
404
|
-
|
|
405
|
+
Pt(s, (v) => v.test(c))
|
|
405
406
|
);
|
|
406
407
|
let f;
|
|
407
408
|
f = t.valueCallback ? t.valueCallback(l) : l, f = n.valueCallback ? (
|
|
@@ -412,12 +413,12 @@ function k(t) {
|
|
|
412
413
|
return { value: f, rest: w };
|
|
413
414
|
};
|
|
414
415
|
}
|
|
415
|
-
function
|
|
416
|
+
function Pt(t, e) {
|
|
416
417
|
for (const n in t)
|
|
417
418
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
418
419
|
return n;
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
+
function pt(t, e) {
|
|
421
422
|
for (let n = 0; n < t.length; n++)
|
|
422
423
|
if (e(t[n]))
|
|
423
424
|
return n;
|
|
@@ -434,19 +435,19 @@ function ce(t) {
|
|
|
434
435
|
return { value: c, rest: s };
|
|
435
436
|
};
|
|
436
437
|
}
|
|
437
|
-
const
|
|
438
|
+
const Dt = /^(\d+)(th|st|nd|rd)?/i, kt = /\d+/i, Ot = {
|
|
438
439
|
narrow: /^(b|a)/i,
|
|
439
440
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
440
441
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
441
|
-
}, Ot = {
|
|
442
|
-
any: [/^b/i, /^(a|c)/i]
|
|
443
442
|
}, Wt = {
|
|
443
|
+
any: [/^b/i, /^(a|c)/i]
|
|
444
|
+
}, xt = {
|
|
444
445
|
narrow: /^[1234]/i,
|
|
445
446
|
abbreviated: /^q[1234]/i,
|
|
446
447
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
447
|
-
}, xt = {
|
|
448
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
449
448
|
}, Tt = {
|
|
449
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
450
|
+
}, _t = {
|
|
450
451
|
narrow: /^[jfmasond]/i,
|
|
451
452
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
452
453
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
@@ -479,7 +480,7 @@ const pt = /^(\d+)(th|st|nd|rd)?/i, kt = /\d+/i, Dt = {
|
|
|
479
480
|
/^n/i,
|
|
480
481
|
/^d/i
|
|
481
482
|
]
|
|
482
|
-
},
|
|
483
|
+
}, Ct = {
|
|
483
484
|
narrow: /^[smtwf]/i,
|
|
484
485
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
485
486
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
@@ -487,7 +488,7 @@ const pt = /^(\d+)(th|st|nd|rd)?/i, kt = /\d+/i, Dt = {
|
|
|
487
488
|
}, St = {
|
|
488
489
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
489
490
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
490
|
-
},
|
|
491
|
+
}, Nt = {
|
|
491
492
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
492
493
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
493
494
|
}, jt = {
|
|
@@ -501,79 +502,79 @@ const pt = /^(\d+)(th|st|nd|rd)?/i, kt = /\d+/i, Dt = {
|
|
|
501
502
|
evening: /evening/i,
|
|
502
503
|
night: /night/i
|
|
503
504
|
}
|
|
504
|
-
},
|
|
505
|
+
}, Et = {
|
|
505
506
|
ordinalNumber: ce({
|
|
506
|
-
matchPattern:
|
|
507
|
+
matchPattern: Dt,
|
|
507
508
|
parsePattern: kt,
|
|
508
509
|
valueCallback: (t) => parseInt(t, 10)
|
|
509
510
|
}),
|
|
510
|
-
era:
|
|
511
|
-
matchPatterns:
|
|
511
|
+
era: D({
|
|
512
|
+
matchPatterns: Ot,
|
|
512
513
|
defaultMatchWidth: "wide",
|
|
513
|
-
parsePatterns:
|
|
514
|
+
parsePatterns: Wt,
|
|
514
515
|
defaultParseWidth: "any"
|
|
515
516
|
}),
|
|
516
|
-
quarter:
|
|
517
|
-
matchPatterns:
|
|
517
|
+
quarter: D({
|
|
518
|
+
matchPatterns: xt,
|
|
518
519
|
defaultMatchWidth: "wide",
|
|
519
|
-
parsePatterns:
|
|
520
|
+
parsePatterns: Tt,
|
|
520
521
|
defaultParseWidth: "any",
|
|
521
522
|
valueCallback: (t) => t + 1
|
|
522
523
|
}),
|
|
523
|
-
month:
|
|
524
|
-
matchPatterns:
|
|
524
|
+
month: D({
|
|
525
|
+
matchPatterns: _t,
|
|
525
526
|
defaultMatchWidth: "wide",
|
|
526
527
|
parsePatterns: Yt,
|
|
527
528
|
defaultParseWidth: "any"
|
|
528
529
|
}),
|
|
529
|
-
day:
|
|
530
|
-
matchPatterns:
|
|
530
|
+
day: D({
|
|
531
|
+
matchPatterns: Ct,
|
|
531
532
|
defaultMatchWidth: "wide",
|
|
532
533
|
parsePatterns: St,
|
|
533
534
|
defaultParseWidth: "any"
|
|
534
535
|
}),
|
|
535
|
-
dayPeriod:
|
|
536
|
-
matchPatterns:
|
|
536
|
+
dayPeriod: D({
|
|
537
|
+
matchPatterns: Nt,
|
|
537
538
|
defaultMatchWidth: "any",
|
|
538
539
|
parsePatterns: jt,
|
|
539
540
|
defaultParseWidth: "any"
|
|
540
541
|
})
|
|
541
|
-
},
|
|
542
|
+
}, Ft = {
|
|
542
543
|
code: "en-US",
|
|
543
|
-
formatDistance:
|
|
544
|
-
formatLong:
|
|
545
|
-
formatRelative:
|
|
546
|
-
localize:
|
|
547
|
-
match:
|
|
544
|
+
formatDistance: st,
|
|
545
|
+
formatLong: dt,
|
|
546
|
+
formatRelative: mt,
|
|
547
|
+
localize: vt,
|
|
548
|
+
match: Et,
|
|
548
549
|
options: {
|
|
549
550
|
weekStartsOn: 0,
|
|
550
551
|
firstWeekContainsDate: 1
|
|
551
552
|
}
|
|
552
553
|
};
|
|
553
|
-
function
|
|
554
|
+
function Lt(t) {
|
|
554
555
|
const e = h(t);
|
|
555
|
-
return
|
|
556
|
+
return Ze(e, at(e)) + 1;
|
|
556
557
|
}
|
|
557
|
-
function
|
|
558
|
-
const e = h(t), n =
|
|
558
|
+
function $t(t) {
|
|
559
|
+
const e = h(t), n = +H(e) - +Ue(e);
|
|
559
560
|
return Math.round(n / se) + 1;
|
|
560
561
|
}
|
|
561
562
|
function ue(t, e) {
|
|
562
563
|
var w, v, x, T;
|
|
563
|
-
const n = h(t), a = n.getFullYear(), r = A(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((v = (w = e == null ? void 0 : e.locale) == null ? void 0 : w.options) == null ? void 0 : v.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((T = (x = r.locale) == null ? void 0 : x.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, c =
|
|
564
|
+
const n = h(t), a = n.getFullYear(), r = A(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((v = (w = e == null ? void 0 : e.locale) == null ? void 0 : w.options) == null ? void 0 : v.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((T = (x = r.locale) == null ? void 0 : x.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, c = k(t, 0);
|
|
564
565
|
c.setFullYear(a + 1, 0, i), c.setHours(0, 0, 0, 0);
|
|
565
|
-
const s =
|
|
566
|
+
const s = N(c, e), l = k(t, 0);
|
|
566
567
|
l.setFullYear(a, 0, i), l.setHours(0, 0, 0, 0);
|
|
567
|
-
const f =
|
|
568
|
+
const f = N(l, e);
|
|
568
569
|
return n.getTime() >= s.getTime() ? a + 1 : n.getTime() >= f.getTime() ? a : a - 1;
|
|
569
570
|
}
|
|
570
|
-
function
|
|
571
|
+
function Ht(t, e) {
|
|
571
572
|
var s, l, f, w;
|
|
572
|
-
const n = A(), a = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((l = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : l.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((w = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, r = ue(t, e), i =
|
|
573
|
-
return i.setFullYear(r, 0, a), i.setHours(0, 0, 0, 0),
|
|
573
|
+
const n = A(), a = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((l = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : l.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((w = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, r = ue(t, e), i = k(t, 0);
|
|
574
|
+
return i.setFullYear(r, 0, a), i.setHours(0, 0, 0, 0), N(i, e);
|
|
574
575
|
}
|
|
575
|
-
function
|
|
576
|
-
const n = h(t), a = +
|
|
576
|
+
function qt(t, e) {
|
|
577
|
+
const n = h(t), a = +N(n, e) - +Ht(n, e);
|
|
577
578
|
return Math.round(a / se) + 1;
|
|
578
579
|
}
|
|
579
580
|
function u(t, e) {
|
|
@@ -634,7 +635,7 @@ const W = {
|
|
|
634
635
|
);
|
|
635
636
|
return u(r, e.length);
|
|
636
637
|
}
|
|
637
|
-
},
|
|
638
|
+
}, C = {
|
|
638
639
|
am: "am",
|
|
639
640
|
pm: "pm",
|
|
640
641
|
midnight: "midnight",
|
|
@@ -801,12 +802,12 @@ const W = {
|
|
|
801
802
|
},
|
|
802
803
|
// Local week of year
|
|
803
804
|
w: function(t, e, n, a) {
|
|
804
|
-
const r =
|
|
805
|
+
const r = qt(t, a);
|
|
805
806
|
return e === "wo" ? n.ordinalNumber(r, { unit: "week" }) : u(r, e.length);
|
|
806
807
|
},
|
|
807
808
|
// ISO week of year
|
|
808
809
|
I: function(t, e, n) {
|
|
809
|
-
const a =
|
|
810
|
+
const a = $t(t);
|
|
810
811
|
return e === "Io" ? n.ordinalNumber(a, { unit: "week" }) : u(a, e.length);
|
|
811
812
|
},
|
|
812
813
|
// Day of the month
|
|
@@ -815,7 +816,7 @@ const W = {
|
|
|
815
816
|
},
|
|
816
817
|
// Day of year
|
|
817
818
|
D: function(t, e, n) {
|
|
818
|
-
const a =
|
|
819
|
+
const a = Lt(t);
|
|
819
820
|
return e === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : u(a, e.length);
|
|
820
821
|
},
|
|
821
822
|
// Day of week
|
|
@@ -978,7 +979,7 @@ const W = {
|
|
|
978
979
|
b: function(t, e, n) {
|
|
979
980
|
const a = t.getHours();
|
|
980
981
|
let r;
|
|
981
|
-
switch (a === 12 ? r =
|
|
982
|
+
switch (a === 12 ? r = C.noon : a === 0 ? r = C.midnight : r = a / 12 >= 1 ? "pm" : "am", e) {
|
|
982
983
|
case "b":
|
|
983
984
|
case "bb":
|
|
984
985
|
return n.dayPeriod(r, {
|
|
@@ -1007,7 +1008,7 @@ const W = {
|
|
|
1007
1008
|
B: function(t, e, n) {
|
|
1008
1009
|
const a = t.getHours();
|
|
1009
1010
|
let r;
|
|
1010
|
-
switch (a >= 17 ? r =
|
|
1011
|
+
switch (a >= 17 ? r = C.evening : a >= 12 ? r = C.afternoon : a >= 4 ? r = C.morning : r = C.night, e) {
|
|
1011
1012
|
case "B":
|
|
1012
1013
|
case "BB":
|
|
1013
1014
|
case "BBB":
|
|
@@ -1072,11 +1073,11 @@ const W = {
|
|
|
1072
1073
|
return ee(a);
|
|
1073
1074
|
case "XXXX":
|
|
1074
1075
|
case "XX":
|
|
1075
|
-
return
|
|
1076
|
+
return _(a);
|
|
1076
1077
|
case "XXXXX":
|
|
1077
1078
|
case "XXX":
|
|
1078
1079
|
default:
|
|
1079
|
-
return
|
|
1080
|
+
return _(a, ":");
|
|
1080
1081
|
}
|
|
1081
1082
|
},
|
|
1082
1083
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
@@ -1087,11 +1088,11 @@ const W = {
|
|
|
1087
1088
|
return ee(a);
|
|
1088
1089
|
case "xxxx":
|
|
1089
1090
|
case "xx":
|
|
1090
|
-
return
|
|
1091
|
+
return _(a);
|
|
1091
1092
|
case "xxxxx":
|
|
1092
1093
|
case "xxx":
|
|
1093
1094
|
default:
|
|
1094
|
-
return
|
|
1095
|
+
return _(a, ":");
|
|
1095
1096
|
}
|
|
1096
1097
|
},
|
|
1097
1098
|
// Timezone (GMT)
|
|
@@ -1104,7 +1105,7 @@ const W = {
|
|
|
1104
1105
|
return "GMT" + K(a, ":");
|
|
1105
1106
|
case "OOOO":
|
|
1106
1107
|
default:
|
|
1107
|
-
return "GMT" +
|
|
1108
|
+
return "GMT" + _(a, ":");
|
|
1108
1109
|
}
|
|
1109
1110
|
},
|
|
1110
1111
|
// Timezone (specific non-location)
|
|
@@ -1117,7 +1118,7 @@ const W = {
|
|
|
1117
1118
|
return "GMT" + K(a, ":");
|
|
1118
1119
|
case "zzzz":
|
|
1119
1120
|
default:
|
|
1120
|
-
return "GMT" +
|
|
1121
|
+
return "GMT" + _(a, ":");
|
|
1121
1122
|
}
|
|
1122
1123
|
},
|
|
1123
1124
|
// Seconds timestamp
|
|
@@ -1136,9 +1137,9 @@ function K(t, e = "") {
|
|
|
1136
1137
|
return i === 0 ? n + String(r) : n + String(r) + e + u(i, 2);
|
|
1137
1138
|
}
|
|
1138
1139
|
function ee(t, e) {
|
|
1139
|
-
return t % 60 === 0 ? (t > 0 ? "-" : "+") + u(Math.abs(t) / 60, 2) :
|
|
1140
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + u(Math.abs(t) / 60, 2) : _(t, e);
|
|
1140
1141
|
}
|
|
1141
|
-
function
|
|
1142
|
+
function _(t, e = "") {
|
|
1142
1143
|
const n = t > 0 ? "-" : "+", a = Math.abs(t), r = u(Math.trunc(a / 60), 2), i = u(a % 60, 2);
|
|
1143
1144
|
return n + r + e + i;
|
|
1144
1145
|
}
|
|
@@ -1166,7 +1167,7 @@ const te = (t, e) => {
|
|
|
1166
1167
|
default:
|
|
1167
1168
|
return e.time({ width: "full" });
|
|
1168
1169
|
}
|
|
1169
|
-
},
|
|
1170
|
+
}, At = (t, e) => {
|
|
1170
1171
|
const n = t.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
|
|
1171
1172
|
if (!r)
|
|
1172
1173
|
return te(t, e);
|
|
@@ -1187,50 +1188,50 @@ const te = (t, e) => {
|
|
|
1187
1188
|
break;
|
|
1188
1189
|
}
|
|
1189
1190
|
return i.replace("{{date}}", te(a, e)).replace("{{time}}", de(r, e));
|
|
1190
|
-
},
|
|
1191
|
+
}, Jt = {
|
|
1191
1192
|
p: de,
|
|
1192
|
-
P:
|
|
1193
|
-
},
|
|
1194
|
-
function Bt(t) {
|
|
1195
|
-
return Jt.test(t);
|
|
1196
|
-
}
|
|
1193
|
+
P: At
|
|
1194
|
+
}, Rt = /^D+$/, Xt = /^Y+$/, Bt = ["D", "DD", "YY", "YYYY"];
|
|
1197
1195
|
function Vt(t) {
|
|
1198
1196
|
return Rt.test(t);
|
|
1199
1197
|
}
|
|
1200
|
-
function Qt(t
|
|
1201
|
-
|
|
1202
|
-
if (console.warn(a), Xt.includes(t)) throw new RangeError(a);
|
|
1198
|
+
function Qt(t) {
|
|
1199
|
+
return Xt.test(t);
|
|
1203
1200
|
}
|
|
1204
1201
|
function Gt(t, e, n) {
|
|
1202
|
+
const a = It(t, e, n);
|
|
1203
|
+
if (console.warn(a), Bt.includes(t)) throw new RangeError(a);
|
|
1204
|
+
}
|
|
1205
|
+
function It(t, e, n) {
|
|
1205
1206
|
const a = t[0] === "Y" ? "years" : "days of the month";
|
|
1206
1207
|
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1207
1208
|
}
|
|
1208
|
-
const
|
|
1209
|
+
const zt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Zt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ut = /^'([^]*?)'?$/, Kt = /''/g, en = /[a-zA-Z]/;
|
|
1209
1210
|
function ne(t, e, n) {
|
|
1210
|
-
var w, v, x, T,
|
|
1211
|
-
const a = A(), r = (n == null ? void 0 : n.locale) ?? a.locale ??
|
|
1212
|
-
if (!
|
|
1211
|
+
var w, v, x, T, F, L, j, $;
|
|
1212
|
+
const a = A(), r = (n == null ? void 0 : n.locale) ?? a.locale ?? Ft, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((v = (w = n == null ? void 0 : n.locale) == null ? void 0 : w.options) == null ? void 0 : v.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((T = (x = a.locale) == null ? void 0 : x.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, c = (n == null ? void 0 : n.weekStartsOn) ?? ((L = (F = n == null ? void 0 : n.locale) == null ? void 0 : F.options) == null ? void 0 : L.weekStartsOn) ?? a.weekStartsOn ?? (($ = (j = a.locale) == null ? void 0 : j.options) == null ? void 0 : $.weekStartsOn) ?? 0, s = h(t);
|
|
1213
|
+
if (!et(s))
|
|
1213
1214
|
throw new RangeError("Invalid time value");
|
|
1214
|
-
let l = e.match(
|
|
1215
|
-
const
|
|
1216
|
-
if (
|
|
1217
|
-
const P =
|
|
1218
|
-
return P(
|
|
1215
|
+
let l = e.match(Zt).map((y) => {
|
|
1216
|
+
const b = y[0];
|
|
1217
|
+
if (b === "p" || b === "P") {
|
|
1218
|
+
const P = Jt[b];
|
|
1219
|
+
return P(y, r.formatLong);
|
|
1219
1220
|
}
|
|
1220
|
-
return
|
|
1221
|
-
}).join("").match(
|
|
1222
|
-
if (
|
|
1221
|
+
return y;
|
|
1222
|
+
}).join("").match(zt).map((y) => {
|
|
1223
|
+
if (y === "''")
|
|
1223
1224
|
return { isToken: !1, value: "'" };
|
|
1224
|
-
const
|
|
1225
|
-
if (
|
|
1226
|
-
return { isToken: !1, value:
|
|
1227
|
-
if (U[
|
|
1228
|
-
return { isToken: !0, value:
|
|
1229
|
-
if (
|
|
1225
|
+
const b = y[0];
|
|
1226
|
+
if (b === "'")
|
|
1227
|
+
return { isToken: !1, value: tn(y) };
|
|
1228
|
+
if (U[b])
|
|
1229
|
+
return { isToken: !0, value: y };
|
|
1230
|
+
if (b.match(en))
|
|
1230
1231
|
throw new RangeError(
|
|
1231
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1232
|
+
"Format string contains an unescaped latin alphabet character `" + b + "`"
|
|
1232
1233
|
);
|
|
1233
|
-
return { isToken: !1, value:
|
|
1234
|
+
return { isToken: !1, value: y };
|
|
1234
1235
|
});
|
|
1235
1236
|
r.localize.preprocessor && (l = r.localize.preprocessor(s, l));
|
|
1236
1237
|
const f = {
|
|
@@ -1238,17 +1239,17 @@ function ne(t, e, n) {
|
|
|
1238
1239
|
weekStartsOn: c,
|
|
1239
1240
|
locale: r
|
|
1240
1241
|
};
|
|
1241
|
-
return l.map((
|
|
1242
|
-
if (!
|
|
1243
|
-
const
|
|
1244
|
-
(!(n != null && n.useAdditionalWeekYearTokens) &&
|
|
1245
|
-
const P = U[
|
|
1246
|
-
return P(s,
|
|
1242
|
+
return l.map((y) => {
|
|
1243
|
+
if (!y.isToken) return y.value;
|
|
1244
|
+
const b = y.value;
|
|
1245
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && Qt(b) || !(n != null && n.useAdditionalDayOfYearTokens) && Vt(b)) && Gt(b, e, String(t));
|
|
1246
|
+
const P = U[b[0]];
|
|
1247
|
+
return P(s, b, r.localize, f);
|
|
1247
1248
|
}).join("");
|
|
1248
1249
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const e = t.match(
|
|
1251
|
-
return e ? e[1].replace(
|
|
1250
|
+
function tn(t) {
|
|
1251
|
+
const e = t.match(Ut);
|
|
1252
|
+
return e ? e[1].replace(Kt, "'") : t;
|
|
1252
1253
|
}
|
|
1253
1254
|
function ae(t, e) {
|
|
1254
1255
|
const n = h(t), a = h(e);
|
|
@@ -1258,14 +1259,14 @@ function re(t, e) {
|
|
|
1258
1259
|
const n = h(t), a = h(e);
|
|
1259
1260
|
return +n < +a;
|
|
1260
1261
|
}
|
|
1261
|
-
function
|
|
1262
|
+
function nn(t, e) {
|
|
1262
1263
|
const n = h(t), a = h(e);
|
|
1263
1264
|
return n.getFullYear() === a.getFullYear() && n.getMonth() === a.getMonth();
|
|
1264
1265
|
}
|
|
1265
|
-
function
|
|
1266
|
+
function an(t, e) {
|
|
1266
1267
|
return ie(t, -e);
|
|
1267
1268
|
}
|
|
1268
|
-
const
|
|
1269
|
+
const rn = {
|
|
1269
1270
|
lessThanXSeconds: {
|
|
1270
1271
|
one: "moins d’une seconde",
|
|
1271
1272
|
other: "moins de {{count}} secondes"
|
|
@@ -1327,54 +1328,54 @@ const an = {
|
|
|
1327
1328
|
one: "presqu’un an",
|
|
1328
1329
|
other: "presque {{count}} ans"
|
|
1329
1330
|
}
|
|
1330
|
-
},
|
|
1331
|
+
}, sn = (t, e, n) => {
|
|
1331
1332
|
let a;
|
|
1332
|
-
const r =
|
|
1333
|
+
const r = rn[t];
|
|
1333
1334
|
return typeof r == "string" ? a = r : e === 1 ? a = r.one : a = r.other.replace("{{count}}", String(e)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "dans " + a : "il y a " + a : a;
|
|
1334
|
-
},
|
|
1335
|
+
}, on = {
|
|
1335
1336
|
full: "EEEE d MMMM y",
|
|
1336
1337
|
long: "d MMMM y",
|
|
1337
1338
|
medium: "d MMM y",
|
|
1338
1339
|
short: "dd/MM/y"
|
|
1339
|
-
},
|
|
1340
|
+
}, cn = {
|
|
1340
1341
|
full: "HH:mm:ss zzzz",
|
|
1341
1342
|
long: "HH:mm:ss z",
|
|
1342
1343
|
medium: "HH:mm:ss",
|
|
1343
1344
|
short: "HH:mm"
|
|
1344
|
-
},
|
|
1345
|
+
}, un = {
|
|
1345
1346
|
full: "{{date}} 'à' {{time}}",
|
|
1346
1347
|
long: "{{date}} 'à' {{time}}",
|
|
1347
1348
|
medium: "{{date}}, {{time}}",
|
|
1348
1349
|
short: "{{date}}, {{time}}"
|
|
1349
|
-
},
|
|
1350
|
-
date:
|
|
1351
|
-
formats: sn,
|
|
1352
|
-
defaultWidth: "full"
|
|
1353
|
-
}),
|
|
1354
|
-
time: C({
|
|
1350
|
+
}, dn = {
|
|
1351
|
+
date: S({
|
|
1355
1352
|
formats: on,
|
|
1356
1353
|
defaultWidth: "full"
|
|
1357
1354
|
}),
|
|
1358
|
-
|
|
1355
|
+
time: S({
|
|
1359
1356
|
formats: cn,
|
|
1360
1357
|
defaultWidth: "full"
|
|
1358
|
+
}),
|
|
1359
|
+
dateTime: S({
|
|
1360
|
+
formats: un,
|
|
1361
|
+
defaultWidth: "full"
|
|
1361
1362
|
})
|
|
1362
|
-
},
|
|
1363
|
+
}, ln = {
|
|
1363
1364
|
lastWeek: "eeee 'dernier à' p",
|
|
1364
1365
|
yesterday: "'hier à' p",
|
|
1365
1366
|
today: "'aujourd’hui à' p",
|
|
1366
1367
|
tomorrow: "'demain à' p'",
|
|
1367
1368
|
nextWeek: "eeee 'prochain à' p",
|
|
1368
1369
|
other: "P"
|
|
1369
|
-
},
|
|
1370
|
+
}, mn = (t, e, n, a) => ln[t], hn = {
|
|
1370
1371
|
narrow: ["av. J.-C", "ap. J.-C"],
|
|
1371
1372
|
abbreviated: ["av. J.-C", "ap. J.-C"],
|
|
1372
1373
|
wide: ["avant Jésus-Christ", "après Jésus-Christ"]
|
|
1373
|
-
},
|
|
1374
|
+
}, fn = {
|
|
1374
1375
|
narrow: ["T1", "T2", "T3", "T4"],
|
|
1375
1376
|
abbreviated: ["1er trim.", "2ème trim.", "3ème trim.", "4ème trim."],
|
|
1376
1377
|
wide: ["1er trimestre", "2ème trimestre", "3ème trimestre", "4ème trimestre"]
|
|
1377
|
-
},
|
|
1378
|
+
}, gn = {
|
|
1378
1379
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1379
1380
|
abbreviated: [
|
|
1380
1381
|
"janv.",
|
|
@@ -1404,7 +1405,7 @@ const an = {
|
|
|
1404
1405
|
"novembre",
|
|
1405
1406
|
"décembre"
|
|
1406
1407
|
]
|
|
1407
|
-
},
|
|
1408
|
+
}, wn = {
|
|
1408
1409
|
narrow: ["D", "L", "M", "M", "J", "V", "S"],
|
|
1409
1410
|
short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
|
|
1410
1411
|
abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
|
|
@@ -1417,7 +1418,7 @@ const an = {
|
|
|
1417
1418
|
"vendredi",
|
|
1418
1419
|
"samedi"
|
|
1419
1420
|
]
|
|
1420
|
-
},
|
|
1421
|
+
}, bn = {
|
|
1421
1422
|
narrow: {
|
|
1422
1423
|
am: "AM",
|
|
1423
1424
|
pm: "PM",
|
|
@@ -1454,51 +1455,51 @@ const an = {
|
|
|
1454
1455
|
const r = ["year", "week", "hour", "minute", "second"];
|
|
1455
1456
|
let i;
|
|
1456
1457
|
return n === 1 ? i = a && r.includes(a) ? "ère" : "er" : i = "ème", n + i;
|
|
1457
|
-
},
|
|
1458
|
+
}, Mn = ["MMM", "MMMM"], vn = {
|
|
1458
1459
|
preprocessor: (t, e) => t.getDate() === 1 || !e.some(
|
|
1459
|
-
(a) => a.isToken &&
|
|
1460
|
+
(a) => a.isToken && Mn.includes(a.value)
|
|
1460
1461
|
) ? e : e.map(
|
|
1461
1462
|
(a) => a.isToken && a.value === "do" ? { isToken: !0, value: "d" } : a
|
|
1462
1463
|
),
|
|
1463
1464
|
ordinalNumber: yn,
|
|
1464
1465
|
era: p({
|
|
1465
|
-
values:
|
|
1466
|
+
values: hn,
|
|
1466
1467
|
defaultWidth: "wide"
|
|
1467
1468
|
}),
|
|
1468
1469
|
quarter: p({
|
|
1469
|
-
values:
|
|
1470
|
+
values: fn,
|
|
1470
1471
|
defaultWidth: "wide",
|
|
1471
1472
|
argumentCallback: (t) => t - 1
|
|
1472
1473
|
}),
|
|
1473
1474
|
month: p({
|
|
1474
|
-
values:
|
|
1475
|
+
values: gn,
|
|
1475
1476
|
defaultWidth: "wide"
|
|
1476
1477
|
}),
|
|
1477
1478
|
day: p({
|
|
1478
|
-
values:
|
|
1479
|
+
values: wn,
|
|
1479
1480
|
defaultWidth: "wide"
|
|
1480
1481
|
}),
|
|
1481
1482
|
dayPeriod: p({
|
|
1482
|
-
values:
|
|
1483
|
+
values: bn,
|
|
1483
1484
|
defaultWidth: "wide"
|
|
1484
1485
|
})
|
|
1485
|
-
},
|
|
1486
|
+
}, Pn = /^(\d+)(ième|ère|ème|er|e)?/i, pn = /\d+/i, Dn = {
|
|
1486
1487
|
narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
|
|
1487
1488
|
abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
|
|
1488
1489
|
wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
|
|
1489
1490
|
}, kn = {
|
|
1490
1491
|
any: [/^av/i, /^ap/i]
|
|
1491
|
-
},
|
|
1492
|
+
}, On = {
|
|
1492
1493
|
narrow: /^T?[1234]/i,
|
|
1493
1494
|
abbreviated: /^[1234](er|ème|e)? trim\.?/i,
|
|
1494
1495
|
wide: /^[1234](er|ème|e)? trimestre/i
|
|
1495
|
-
}, On = {
|
|
1496
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1497
1496
|
}, Wn = {
|
|
1497
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1498
|
+
}, xn = {
|
|
1498
1499
|
narrow: /^[jfmasond]/i,
|
|
1499
1500
|
abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
|
|
1500
1501
|
wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
|
|
1501
|
-
},
|
|
1502
|
+
}, Tn = {
|
|
1502
1503
|
narrow: [
|
|
1503
1504
|
/^j/i,
|
|
1504
1505
|
/^f/i,
|
|
@@ -1527,7 +1528,7 @@ const an = {
|
|
|
1527
1528
|
/^n/i,
|
|
1528
1529
|
/^d/i
|
|
1529
1530
|
]
|
|
1530
|
-
},
|
|
1531
|
+
}, _n = {
|
|
1531
1532
|
narrow: /^[lmjvsd]/i,
|
|
1532
1533
|
short: /^(di|lu|ma|me|je|ve|sa)/i,
|
|
1533
1534
|
abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
|
|
@@ -1535,7 +1536,7 @@ const an = {
|
|
|
1535
1536
|
}, Yn = {
|
|
1536
1537
|
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
|
|
1537
1538
|
any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
|
|
1538
|
-
},
|
|
1539
|
+
}, Cn = {
|
|
1539
1540
|
narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
|
|
1540
1541
|
any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
|
|
1541
1542
|
}, Sn = {
|
|
@@ -1549,61 +1550,61 @@ const an = {
|
|
|
1549
1550
|
evening: /soir/i,
|
|
1550
1551
|
night: /nuit/i
|
|
1551
1552
|
}
|
|
1552
|
-
},
|
|
1553
|
+
}, Nn = {
|
|
1553
1554
|
ordinalNumber: ce({
|
|
1554
|
-
matchPattern:
|
|
1555
|
-
parsePattern:
|
|
1555
|
+
matchPattern: Pn,
|
|
1556
|
+
parsePattern: pn,
|
|
1556
1557
|
valueCallback: (t) => parseInt(t)
|
|
1557
1558
|
}),
|
|
1558
|
-
era:
|
|
1559
|
-
matchPatterns:
|
|
1559
|
+
era: D({
|
|
1560
|
+
matchPatterns: Dn,
|
|
1560
1561
|
defaultMatchWidth: "wide",
|
|
1561
1562
|
parsePatterns: kn,
|
|
1562
1563
|
defaultParseWidth: "any"
|
|
1563
1564
|
}),
|
|
1564
|
-
quarter:
|
|
1565
|
-
matchPatterns:
|
|
1565
|
+
quarter: D({
|
|
1566
|
+
matchPatterns: On,
|
|
1566
1567
|
defaultMatchWidth: "wide",
|
|
1567
|
-
parsePatterns:
|
|
1568
|
+
parsePatterns: Wn,
|
|
1568
1569
|
defaultParseWidth: "any",
|
|
1569
1570
|
valueCallback: (t) => t + 1
|
|
1570
1571
|
}),
|
|
1571
|
-
month:
|
|
1572
|
-
matchPatterns:
|
|
1572
|
+
month: D({
|
|
1573
|
+
matchPatterns: xn,
|
|
1573
1574
|
defaultMatchWidth: "wide",
|
|
1574
|
-
parsePatterns:
|
|
1575
|
+
parsePatterns: Tn,
|
|
1575
1576
|
defaultParseWidth: "any"
|
|
1576
1577
|
}),
|
|
1577
|
-
day:
|
|
1578
|
-
matchPatterns:
|
|
1578
|
+
day: D({
|
|
1579
|
+
matchPatterns: _n,
|
|
1579
1580
|
defaultMatchWidth: "wide",
|
|
1580
1581
|
parsePatterns: Yn,
|
|
1581
1582
|
defaultParseWidth: "any"
|
|
1582
1583
|
}),
|
|
1583
|
-
dayPeriod:
|
|
1584
|
-
matchPatterns:
|
|
1584
|
+
dayPeriod: D({
|
|
1585
|
+
matchPatterns: Cn,
|
|
1585
1586
|
defaultMatchWidth: "any",
|
|
1586
1587
|
parsePatterns: Sn,
|
|
1587
1588
|
defaultParseWidth: "any"
|
|
1588
1589
|
})
|
|
1589
1590
|
}, jn = {
|
|
1590
1591
|
code: "fr",
|
|
1591
|
-
formatDistance:
|
|
1592
|
-
formatLong:
|
|
1593
|
-
formatRelative:
|
|
1594
|
-
localize:
|
|
1595
|
-
match:
|
|
1592
|
+
formatDistance: sn,
|
|
1593
|
+
formatLong: dn,
|
|
1594
|
+
formatRelative: mn,
|
|
1595
|
+
localize: vn,
|
|
1596
|
+
match: Nn,
|
|
1596
1597
|
options: {
|
|
1597
1598
|
weekStartsOn: 1,
|
|
1598
1599
|
firstWeekContainsDate: 4
|
|
1599
1600
|
}
|
|
1600
|
-
},
|
|
1601
|
-
const [i, c] = O(() => t && e && "start" in e ? e.start : /* @__PURE__ */ new Date()), [s, l] = O(e || null), [f, w] = O(!1), [v, x] = O(null), [T,
|
|
1601
|
+
}, Hn = ({ selectRange: t = !1, selectedDate: e, onDateSelect: n, maxDateSelected: a, minDateSelected: r }) => {
|
|
1602
|
+
const [i, c] = O(() => t && e && "start" in e ? e.start : /* @__PURE__ */ new Date()), [s, l] = O(e || null), [f, w] = O(!1), [v, x] = O(null), [T, F] = O([]), [L, j] = O(!1), [$, y] = O((/* @__PURE__ */ new Date()).getFullYear()), b = 1900, P = I(null), J = I(null), le = /* @__PURE__ */ new Date(), V = nt(i), me = tt(i), he = N(V, { weekStartsOn: 1 }), fe = rt(me, { weekStartsOn: 1 }), [R, ge] = O(null);
|
|
1602
1603
|
B(() => {
|
|
1603
1604
|
l(e || null), t && e && "start" in e ? c(e.start) : !t && e instanceof Date && c(e);
|
|
1604
1605
|
}, [e, t]);
|
|
1605
1606
|
const Q = (o) => {
|
|
1606
|
-
c((d) => o > 0 ? ie(d, 1) :
|
|
1607
|
+
c((d) => o > 0 ? ie(d, 1) : an(d, 1));
|
|
1607
1608
|
}, we = (o) => {
|
|
1608
1609
|
if (t)
|
|
1609
1610
|
if (R !== null && o)
|
|
@@ -1619,17 +1620,17 @@ const an = {
|
|
|
1619
1620
|
ge(o), n(
|
|
1620
1621
|
t ? s : o
|
|
1621
1622
|
);
|
|
1622
|
-
},
|
|
1623
|
+
}, be = () => w((o) => !o);
|
|
1623
1624
|
B(() => {
|
|
1624
1625
|
G();
|
|
1625
1626
|
}, []);
|
|
1626
1627
|
const G = () => {
|
|
1627
|
-
|
|
1628
|
+
L || (j(!0), setTimeout(() => {
|
|
1628
1629
|
const o = [];
|
|
1629
|
-
let d =
|
|
1630
|
-
for (let m = 0; m < 10 && !(d <
|
|
1630
|
+
let d = $;
|
|
1631
|
+
for (let m = 0; m < 10 && !(d < b); m++)
|
|
1631
1632
|
o.push(d), d -= 1;
|
|
1632
|
-
o.length > 0 && (
|
|
1633
|
+
o.length > 0 && (F((m) => [...m, ...o]), y(d)), j(!1);
|
|
1633
1634
|
}, 500));
|
|
1634
1635
|
};
|
|
1635
1636
|
B(() => {
|
|
@@ -1638,27 +1639,27 @@ const an = {
|
|
|
1638
1639
|
o && P.current && (P.current.scrollTop = o.offsetTop - P.current.offsetTop);
|
|
1639
1640
|
}
|
|
1640
1641
|
}, [f, v]);
|
|
1641
|
-
const
|
|
1642
|
+
const ye = () => ["Lu", "Ma", "Me", "Je", "Ve", "Sa", "Di"].map((d, m) => /* @__PURE__ */ g("div", { className: M.calendarWeekdays, children: d }, m)), Me = () => {
|
|
1642
1643
|
let o = [], d = he;
|
|
1643
1644
|
for (; d <= fe; )
|
|
1644
|
-
o.push(d), d =
|
|
1645
|
-
return o.map((m,
|
|
1646
|
-
const X = s && typeof s == "object" && "start" in s && "end" in s,
|
|
1645
|
+
o.push(d), d = Ge(d, 1);
|
|
1646
|
+
return o.map((m, De) => {
|
|
1647
|
+
const X = s && typeof s == "object" && "start" in s && "end" in s, ke = X && Y(m, s.start), Oe = X && Y(m, s.end), We = X && ae(m, s.start) && re(m, s.end), xe = r && (re(m, r) || Y(m, r)), Te = a && (ae(m, a) || Y(m, a)), _e = r && xe || a && Te, Ye = !nn(m, V), Ce = _e || Ye;
|
|
1647
1648
|
return /* @__PURE__ */ g(
|
|
1648
1649
|
"div",
|
|
1649
1650
|
{
|
|
1650
1651
|
className: `
|
|
1651
1652
|
${M.calendarDay}
|
|
1652
|
-
${
|
|
1653
|
-
${s &&
|
|
1654
|
-
${
|
|
1653
|
+
${Y(m, le) ? M.today : ""}
|
|
1654
|
+
${s && Y(m, s) ? M.selected : ""}
|
|
1655
|
+
${ke || Oe ? M.selected : ""} // Applique 'selected' si start ou end
|
|
1655
1656
|
${We ? M.inRange : ""} // Applique 'inRange' si la date est entre start et end
|
|
1656
|
-
${
|
|
1657
|
+
${Ce ? M.disabled : ""}
|
|
1657
1658
|
`,
|
|
1658
1659
|
onClick: () => we(m),
|
|
1659
1660
|
children: ne(m, "d")
|
|
1660
1661
|
},
|
|
1661
|
-
|
|
1662
|
+
De
|
|
1662
1663
|
);
|
|
1663
1664
|
});
|
|
1664
1665
|
}, ve = (o) => {
|
|
@@ -1672,23 +1673,23 @@ const an = {
|
|
|
1672
1673
|
document.removeEventListener("click", o);
|
|
1673
1674
|
};
|
|
1674
1675
|
}, pe = (o) => {
|
|
1675
|
-
const d = ne(o, "
|
|
1676
|
+
const d = ne(o, "MMM yyyy", { locale: jn });
|
|
1676
1677
|
return d.charAt(0).toUpperCase() + d.slice(1);
|
|
1677
1678
|
};
|
|
1678
|
-
return /* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */ g(z, { size: "s", mode: "ghost", onClick: () => Q(-1), children: /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ E("div", { className: M.calendar, onClick: Pe, children: [
|
|
1680
|
+
/* @__PURE__ */ E("div", { className: `${M.calendarHeader}`, children: [
|
|
1681
|
+
/* @__PURE__ */ g(z, { size: "s", mode: "ghost", onClick: () => Q(-1), children: /* @__PURE__ */ E("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: [
|
|
1681
1682
|
/* @__PURE__ */ g("path", { d: "M160,48V208L80,128Z", opacity: "0.2" }),
|
|
1682
1683
|
/* @__PURE__ */ g("path", { d: "M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z" })
|
|
1683
1684
|
] }) }),
|
|
1684
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ E("div", { ref: J, className: M.dropDownCtn, children: [
|
|
1685
1686
|
/* @__PURE__ */ g(
|
|
1686
|
-
|
|
1687
|
+
Se,
|
|
1687
1688
|
{
|
|
1688
1689
|
size: "s",
|
|
1689
1690
|
mode: "tertiary",
|
|
1690
1691
|
label: pe(i),
|
|
1691
|
-
onClick:
|
|
1692
|
+
onClick: be,
|
|
1692
1693
|
childrenRight: f ? /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ g("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }) }) : /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ g("path", { d: "M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z" }) })
|
|
1693
1694
|
}
|
|
1694
1695
|
),
|
|
@@ -1713,15 +1714,15 @@ const an = {
|
|
|
1713
1714
|
}
|
|
1714
1715
|
) })
|
|
1715
1716
|
] }),
|
|
1716
|
-
/* @__PURE__ */ g(z, { size: "s", mode: "ghost", onClick: () => Q(1), children: /* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ g(z, { size: "s", mode: "ghost", onClick: () => Q(1), children: /* @__PURE__ */ E("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: [
|
|
1717
1718
|
/* @__PURE__ */ g("path", { d: "M176,128,96,208V48Z", opacity: "0.2" }),
|
|
1718
1719
|
/* @__PURE__ */ g("path", { d: "M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z" })
|
|
1719
1720
|
] }) })
|
|
1720
1721
|
] }),
|
|
1721
|
-
/* @__PURE__ */ g("div", { className: `${M.calendarWeekdays} labelSmall`, children:
|
|
1722
|
+
/* @__PURE__ */ g("div", { className: `${M.calendarWeekdays} labelSmall`, children: ye() }),
|
|
1722
1723
|
/* @__PURE__ */ g("div", { className: `${M.calendarGrid} textSmall`, children: Me() })
|
|
1723
1724
|
] });
|
|
1724
1725
|
};
|
|
1725
1726
|
export {
|
|
1726
|
-
|
|
1727
|
+
Hn as Calendar
|
|
1727
1728
|
};
|
package/dist/styles/Calendar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._calendar_1b30a_6{border:1px solid var(--general-border-window);background:var(--dropdown-window-background);border-radius:.375rem;box-shadow:0 4px 16px 0 var(--shadow-color-low);padding:.375rem;box-sizing:border-box;width:280px}._calendar_1b30a_6 ._relative_1b30a_15{position:relative}._calendar_1b30a_6 ._dropDownCtn_1b30a_18{position:relative;width:120px;display:flex;justify-content:center;align-items:center}._calendar_1b30a_6 ._dropDownCtn_1b30a_18 button{width:120px}._calendar_1b30a_6 ._calendarHeader_1b30a_28{display:flex;justify-content:center;align-items:center;margin-bottom:12px;gap:.25rem}._calendar_1b30a_6 ._calendarHeader_1b30a_28 span{font-weight:700}._calendar_1b30a_6 ._calendarWeekdays_1b30a_38,._calendar_1b30a_6 ._calendarGrid_1b30a_39{display:grid;grid-template-columns:repeat(7,1fr);gap:.125rem}._calendar_1b30a_6 ._calendarWeekdays_1b30a_38{color:var(--calendar-cell-base-inactiv-num);font-size:.75em;font-weight:600}._calendar_1b30a_6 ._calendarDay_1b30a_49,._calendar_1b30a_6 ._calendarWeekdays_1b30a_38 div{width:36px;height:36px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600}._calendar_1b30a_6 ._calendarDay_1b30a_49{border-radius:.25rem;cursor:pointer;color:var(--calendar-cell-base-default-num)}._calendar_1b30a_6 ._calendarDay_1b30a_49._today_1b30a_64{border:1px solid var(--calendar-cell-tooday-default-border)}._calendar_1b30a_6 ._calendarDay_1b30a_49._selected_1b30a_67{background:var(--calendar-cell-active-background);color:var(--calendar-cell-active-num)}._calendar_1b30a_6 ._calendarDay_1b30a_49._selected_1b30a_67:hover{background:var(--calendar-cell-active-background)}._calendar_1b30a_6 ._calendarDay_1b30a_49._disabled_1b30a_74{color:var(--calendar-cell-base-inactiv-num);pointer-events:none}._calendar_1b30a_6 ._calendarDay_1b30a_49:hover{background:var(--calendar-cell-base-hover-background)}._calendar_1b30a_6 ._calendarDay_1b30a_49._inRange_1b30a_81{background-color:var(--calendar-cell-base-hover-background)}._calendar_1b30a_6 ._dropdown_1b30a_84{position:absolute;top:32px;min-width:120px;border:1px solid var(--general-border-window);background:var(--dropdown-window-background);border-radius:.25rem;box-shadow:0 8px 36px 0 var(--shadow-color-medium);z-index:10;padding:.25rem;max-height:130px}._calendar_1b30a_6 ._yearList_1b30a_96{max-height:130px;overflow-y:auto;display:flex;flex-direction:column;gap:.125rem}._calendar_1b30a_6 ._yearItem_1b30a_103{padding:.25rem .375rem;cursor:pointer;border-radius:.125rem}._calendar_1b30a_6 ._yearItem_1b30a_103:hover{background:var(--dropdown-line-background-hover)}._calendar_1b30a_6 ._loading_1b30a_111{text-align:center;font-size:.75em;color:var(--calendar-cell-base-default-num)}
|