@situaction/traq-ui-ste 1.1.16 → 1.1.18
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/README.md +42 -5
- package/dist/X-Bd1VjKAF.mjs +190 -0
- package/dist/components/accordion/Accordion.d.ts +3 -0
- package/dist/components/accordion/Accordion.js +6 -5
- package/dist/components/accordion/item/AccordionItem.d.ts +3 -0
- package/dist/components/accordion/item/AccordionItem.js +34 -30
- package/dist/components/button/Button.d.ts +2 -2
- package/dist/components/button/Button.js +4 -3
- package/dist/components/buttonControledScroll/ButtonControlledScroll.d.ts +11 -1
- package/dist/components/calendar/Calendar.d.ts +6 -0
- package/dist/components/calendar/Calendar.js +833 -509
- package/dist/components/card/Card.d.ts +7 -0
- package/dist/components/checkbox/Checkbox.d.ts +4 -0
- package/dist/components/icon/Icon.d.ts +18 -0
- package/dist/components/icon/Icon.js +78592 -0
- package/dist/components/icon-button/IconButton.d.ts +8 -3
- package/dist/components/input/Input.d.ts +5 -0
- package/dist/components/list/list-controls/ListControls.d.ts +19 -0
- package/dist/components/list/list-controls/ListControls.js +49 -0
- package/dist/components/list/nested-list/NestedList.d.ts +18 -0
- package/dist/components/list/nested-list/NestedList.js +19 -0
- package/dist/components/list/nested-list/item/NestedListItem.d.ts +23 -0
- package/dist/components/list/nested-list/item/NestedListItem.js +71 -0
- package/dist/components/menu/Menu.d.ts +59 -0
- package/dist/components/menu/Menu.js +121 -0
- package/dist/components/modal/Modal.d.ts +32 -0
- package/dist/components/modal/Modal.js +24 -0
- package/dist/components/panel/side-panel/SidePanel.d.ts +30 -0
- package/dist/components/panel/side-panel/SidePanel.js +47 -0
- package/dist/components/panel/side-panel-header/SidePanelHeader.d.ts +22 -0
- package/dist/components/panel/side-panel-header/SidePanelHeader.js +60 -0
- package/dist/components/select/Select.d.ts +34 -15
- package/dist/components/select/Select.js +79 -64
- package/dist/components/select-filter-input-tags/SelectFilterInputTags.d.ts +17 -0
- package/dist/components/select-filter-input-tags/SelectFilterInputTags.js +31 -0
- package/dist/components/select-multi-items/SelectMultiItems.d.ts +24 -0
- package/dist/components/select-multi-items/SelectMultiItems.js +44 -0
- package/dist/components/switch/Switch.d.ts +30 -0
- package/dist/components/switch/Switch.js +93 -0
- package/dist/components/tabs/Tabs.d.ts +4 -0
- package/dist/components/tabs/Tabs.js +14 -13
- package/dist/components/tag/Tag.d.ts +4 -0
- package/dist/components/tag-counter/TagCounter.d.ts +5 -0
- package/dist/components/theme/variables_dark.d.ts +9 -0
- package/dist/components/theme/variables_dark.js +10 -1
- package/dist/components/theme/variables_light.d.ts +9 -0
- package/dist/components/theme/variables_light.js +10 -1
- package/dist/components/title/Title.d.ts +3 -0
- package/dist/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/main.d.ts +15 -4
- package/dist/main.js +58 -34
- package/dist/styles/AccordionItem.css +1 -1
- package/dist/styles/Button.css +1 -1
- package/dist/styles/ListControls.css +1 -0
- package/dist/styles/Menu.css +1 -0
- package/dist/styles/Modal.css +1 -0
- package/dist/styles/NestedList.css +1 -0
- package/dist/styles/NestedListItem.css +1 -0
- package/dist/styles/Select.css +1 -1
- package/dist/styles/SelectFilterInputTags.css +1 -0
- package/dist/styles/SelectMultiItems.css +1 -0
- package/dist/styles/SidePanel.css +1 -0
- package/dist/styles/SidePanelHeader.css +1 -0
- package/dist/styles/Size.css +1 -0
- package/dist/styles/Switch.css +1 -0
- package/dist/styles/index.css +1 -0
- package/package.json +5 -4
- package/dist/styles/main.css +0 -1
|
@@ -1,69 +1,75 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { IconButton as
|
|
4
|
-
import { Button as
|
|
5
|
-
import '../../styles/Calendar.css';const
|
|
6
|
-
calendar:
|
|
7
|
-
relative:
|
|
1
|
+
import { jsxs as N, jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useRef as G, useEffect as X } from "react";
|
|
3
|
+
import { IconButton as I } from "../icon-button/IconButton.js";
|
|
4
|
+
import { Button as De } from "../button/Button.js";
|
|
5
|
+
import '../../styles/Calendar.css';const ke = "_calendar_1hajq_6", Oe = "_relative_1hajq_15", We = "_calendarHeader_1hajq_18", xe = "_calendarWeekdays_1hajq_28", Te = "_calendarGrid_1hajq_29", Se = "_calendarDay_1hajq_39", Ye = "_today_1hajq_54", _e = "_selected_1hajq_57", je = "_disabled_1hajq_64", Ce = "_inRange_1hajq_71", Ne = "_dropdown_1hajq_74", qe = "_yearList_1hajq_86", Ee = "_yearItem_1hajq_93", Fe = "_loading_1hajq_101", v = {
|
|
6
|
+
calendar: ke,
|
|
7
|
+
relative: Oe,
|
|
8
8
|
calendarHeader: We,
|
|
9
|
-
calendarWeekdays:
|
|
10
|
-
calendarGrid:
|
|
9
|
+
calendarWeekdays: xe,
|
|
10
|
+
calendarGrid: Te,
|
|
11
11
|
calendarDay: Se,
|
|
12
|
-
today:
|
|
13
|
-
selected:
|
|
14
|
-
disabled:
|
|
15
|
-
inRange:
|
|
12
|
+
today: Ye,
|
|
13
|
+
selected: _e,
|
|
14
|
+
disabled: je,
|
|
15
|
+
inRange: Ce,
|
|
16
16
|
dropdown: Ne,
|
|
17
|
-
yearList:
|
|
18
|
-
yearItem:
|
|
19
|
-
loading:
|
|
20
|
-
}
|
|
21
|
-
function
|
|
22
|
-
|
|
17
|
+
yearList: qe,
|
|
18
|
+
yearItem: Ee,
|
|
19
|
+
loading: Fe
|
|
20
|
+
};
|
|
21
|
+
function m(t) {
|
|
22
|
+
const e = Object.prototype.toString.call(t);
|
|
23
|
+
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);
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
25
|
+
function D(t, e) {
|
|
26
|
+
return t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return isNaN(e) ?
|
|
28
|
+
function Le(t, e) {
|
|
29
|
+
const n = m(t);
|
|
30
|
+
return isNaN(e) ? D(t, NaN) : (n.setDate(n.getDate() + e), n);
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
if (isNaN(e)) return
|
|
32
|
+
function ne(t, e) {
|
|
33
|
+
const n = m(t);
|
|
34
|
+
if (isNaN(e)) return D(t, NaN);
|
|
34
35
|
if (!e)
|
|
35
|
-
return
|
|
36
|
-
const a =
|
|
37
|
-
|
|
38
|
-
const i =
|
|
39
|
-
return a >= i ?
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
return n;
|
|
37
|
+
const a = n.getDate(), r = D(t, n.getTime());
|
|
38
|
+
r.setMonth(n.getMonth() + e + 1, 0);
|
|
39
|
+
const i = r.getDate();
|
|
40
|
+
return a >= i ? r : (n.setFullYear(
|
|
41
|
+
r.getFullYear(),
|
|
42
|
+
r.getMonth(),
|
|
42
43
|
a
|
|
43
|
-
),
|
|
44
|
+
), n);
|
|
45
|
+
}
|
|
46
|
+
const ae = 6048e5, $e = 864e5;
|
|
47
|
+
let He = {};
|
|
48
|
+
function A() {
|
|
49
|
+
return He;
|
|
44
50
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
function _(t, e) {
|
|
52
|
+
var d, h, f, b;
|
|
53
|
+
const n = A(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((h = (d = e == null ? void 0 : e.locale) == null ? void 0 : d.options) == null ? void 0 : h.weekStartsOn) ?? n.weekStartsOn ?? ((b = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : b.weekStartsOn) ?? 0, r = m(t), i = r.getDay(), o = (i < a ? 7 : 0) + i - a;
|
|
54
|
+
return r.setDate(r.getDate() - o), r.setHours(0, 0, 0, 0), r;
|
|
48
55
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
const n = H(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((l = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : l.weekStartsOn) ?? n.weekStartsOn ?? ((b = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : b.weekStartsOn) ?? 0, a = h(t, e == null ? void 0 : e.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
|
|
52
|
-
return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
|
|
56
|
+
function $(t) {
|
|
57
|
+
return _(t, { weekStartsOn: 1 });
|
|
53
58
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
59
|
+
function re(t) {
|
|
60
|
+
const e = m(t), n = e.getFullYear(), a = D(t, 0);
|
|
61
|
+
a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
62
|
+
const r = $(a), i = D(t, 0);
|
|
63
|
+
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
|
|
64
|
+
const o = $(i);
|
|
65
|
+
return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= o.getTime() ? n : n - 1;
|
|
56
66
|
}
|
|
57
|
-
function
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
const s = C(a), i = k(n, 0);
|
|
61
|
-
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
62
|
-
const c = C(i);
|
|
63
|
-
return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
|
|
67
|
+
function H(t) {
|
|
68
|
+
const e = m(t);
|
|
69
|
+
return e.setHours(0, 0, 0, 0), e;
|
|
64
70
|
}
|
|
65
|
-
function
|
|
66
|
-
const e =
|
|
71
|
+
function z(t) {
|
|
72
|
+
const e = m(t), n = new Date(
|
|
67
73
|
Date.UTC(
|
|
68
74
|
e.getFullYear(),
|
|
69
75
|
e.getMonth(),
|
|
@@ -76,60 +82,44 @@ function Z(t) {
|
|
|
76
82
|
);
|
|
77
83
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
78
84
|
}
|
|
79
|
-
function
|
|
80
|
-
const n =
|
|
81
|
-
|
|
82
|
-
e.find((r) => typeof r == "object")
|
|
83
|
-
);
|
|
84
|
-
return e.map(n);
|
|
85
|
-
}
|
|
86
|
-
function j(t, e) {
|
|
87
|
-
const n = h(t, e == null ? void 0 : e.in);
|
|
88
|
-
return n.setHours(0, 0, 0, 0), n;
|
|
85
|
+
function Ae(t, e) {
|
|
86
|
+
const n = H(t), a = H(e), r = +n - z(n), i = +a - z(a);
|
|
87
|
+
return Math.round((r - i) / $e);
|
|
89
88
|
}
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
t,
|
|
94
|
-
e
|
|
95
|
-
), s = j(r), i = j(a), c = +s - Z(s), l = +i - Z(i);
|
|
96
|
-
return Math.round((c - l) / Le);
|
|
89
|
+
function Je(t) {
|
|
90
|
+
const e = re(t), n = D(t, 0);
|
|
91
|
+
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), $(n);
|
|
97
92
|
}
|
|
98
|
-
function
|
|
99
|
-
const n =
|
|
100
|
-
return
|
|
93
|
+
function L(t, e) {
|
|
94
|
+
const n = H(t), a = H(e);
|
|
95
|
+
return +n == +a;
|
|
101
96
|
}
|
|
102
|
-
function
|
|
103
|
-
const [r, a] = G(
|
|
104
|
-
n == null ? void 0 : n.in,
|
|
105
|
-
t,
|
|
106
|
-
e
|
|
107
|
-
);
|
|
108
|
-
return +j(r) == +j(a);
|
|
109
|
-
}
|
|
110
|
-
function Ge(t) {
|
|
97
|
+
function Re(t) {
|
|
111
98
|
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
112
99
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
100
|
+
function Xe(t) {
|
|
101
|
+
if (!Re(t) && typeof t != "number")
|
|
102
|
+
return !1;
|
|
103
|
+
const e = m(t);
|
|
104
|
+
return !isNaN(Number(e));
|
|
115
105
|
}
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
return
|
|
106
|
+
function Ve(t) {
|
|
107
|
+
const e = m(t), n = e.getMonth();
|
|
108
|
+
return e.setFullYear(e.getFullYear(), n + 1, 0), e.setHours(23, 59, 59, 999), e;
|
|
119
109
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
return
|
|
110
|
+
function Qe(t) {
|
|
111
|
+
const e = m(t);
|
|
112
|
+
return e.setDate(1), e.setHours(0, 0, 0, 0), e;
|
|
123
113
|
}
|
|
124
|
-
function
|
|
125
|
-
const
|
|
126
|
-
return n.setFullYear(
|
|
114
|
+
function Be(t) {
|
|
115
|
+
const e = m(t), n = D(t, 0);
|
|
116
|
+
return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
127
117
|
}
|
|
128
|
-
function
|
|
129
|
-
const n = e == null ? void 0 : e.weekStartsOn,
|
|
130
|
-
return
|
|
118
|
+
function Ge(t, e) {
|
|
119
|
+
const n = e == null ? void 0 : e.weekStartsOn, a = m(t), r = a.getDay(), i = (r < n ? -7 : 0) + 6 - (r - n);
|
|
120
|
+
return a.setDate(a.getDate() + i), a.setHours(23, 59, 59, 999), a;
|
|
131
121
|
}
|
|
132
|
-
const
|
|
122
|
+
const Ie = {
|
|
133
123
|
lessThanXSeconds: {
|
|
134
124
|
one: "less than a second",
|
|
135
125
|
other: "less than {{count}} seconds"
|
|
@@ -191,18 +181,18 @@ const Je = {
|
|
|
191
181
|
one: "almost 1 year",
|
|
192
182
|
other: "almost {{count}} years"
|
|
193
183
|
}
|
|
194
|
-
},
|
|
195
|
-
let
|
|
196
|
-
const
|
|
197
|
-
return typeof
|
|
184
|
+
}, ze = (t, e, n) => {
|
|
185
|
+
let a;
|
|
186
|
+
const r = Ie[t];
|
|
187
|
+
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;
|
|
198
188
|
};
|
|
199
|
-
function
|
|
189
|
+
function Y(t) {
|
|
200
190
|
return (e = {}) => {
|
|
201
191
|
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
202
192
|
return t.formats[n] || t.formats[t.defaultWidth];
|
|
203
193
|
};
|
|
204
194
|
}
|
|
205
|
-
const
|
|
195
|
+
const Ze = {
|
|
206
196
|
full: "EEEE, MMMM do, y",
|
|
207
197
|
long: "MMMM do, y",
|
|
208
198
|
medium: "MMM d, y",
|
|
@@ -218,15 +208,15 @@ const ze = {
|
|
|
218
208
|
medium: "{{date}}, {{time}}",
|
|
219
209
|
short: "{{date}}, {{time}}"
|
|
220
210
|
}, et = {
|
|
221
|
-
date:
|
|
222
|
-
formats:
|
|
211
|
+
date: Y({
|
|
212
|
+
formats: Ze,
|
|
223
213
|
defaultWidth: "full"
|
|
224
214
|
}),
|
|
225
|
-
time:
|
|
215
|
+
time: Y({
|
|
226
216
|
formats: Ue,
|
|
227
217
|
defaultWidth: "full"
|
|
228
218
|
}),
|
|
229
|
-
dateTime:
|
|
219
|
+
dateTime: Y({
|
|
230
220
|
formats: Ke,
|
|
231
221
|
defaultWidth: "full"
|
|
232
222
|
})
|
|
@@ -237,31 +227,31 @@ const ze = {
|
|
|
237
227
|
tomorrow: "'tomorrow at' p",
|
|
238
228
|
nextWeek: "eeee 'at' p",
|
|
239
229
|
other: "P"
|
|
240
|
-
}, nt = (t, e, n,
|
|
241
|
-
function
|
|
230
|
+
}, nt = (t, e, n, a) => tt[t];
|
|
231
|
+
function P(t) {
|
|
242
232
|
return (e, n) => {
|
|
243
|
-
const
|
|
244
|
-
let
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
247
|
-
|
|
233
|
+
const a = n != null && n.context ? String(n.context) : "standalone";
|
|
234
|
+
let r;
|
|
235
|
+
if (a === "formatting" && t.formattingValues) {
|
|
236
|
+
const o = t.defaultFormattingWidth || t.defaultWidth, d = n != null && n.width ? String(n.width) : o;
|
|
237
|
+
r = t.formattingValues[d] || t.formattingValues[o];
|
|
248
238
|
} else {
|
|
249
|
-
const
|
|
250
|
-
|
|
239
|
+
const o = t.defaultWidth, d = n != null && n.width ? String(n.width) : t.defaultWidth;
|
|
240
|
+
r = t.values[d] || t.values[o];
|
|
251
241
|
}
|
|
252
|
-
const
|
|
253
|
-
return
|
|
242
|
+
const i = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
243
|
+
return r[i];
|
|
254
244
|
};
|
|
255
245
|
}
|
|
256
|
-
const
|
|
246
|
+
const at = {
|
|
257
247
|
narrow: ["B", "A"],
|
|
258
248
|
abbreviated: ["BC", "AD"],
|
|
259
249
|
wide: ["Before Christ", "Anno Domini"]
|
|
260
|
-
},
|
|
250
|
+
}, rt = {
|
|
261
251
|
narrow: ["1", "2", "3", "4"],
|
|
262
252
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
263
253
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
264
|
-
},
|
|
254
|
+
}, it = {
|
|
265
255
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
266
256
|
abbreviated: [
|
|
267
257
|
"Jan",
|
|
@@ -291,7 +281,7 @@ const rt = {
|
|
|
291
281
|
"November",
|
|
292
282
|
"December"
|
|
293
283
|
]
|
|
294
|
-
},
|
|
284
|
+
}, st = {
|
|
295
285
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
296
286
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
297
287
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -367,9 +357,9 @@ const rt = {
|
|
|
367
357
|
night: "at night"
|
|
368
358
|
}
|
|
369
359
|
}, ut = (t, e) => {
|
|
370
|
-
const n = Number(t),
|
|
371
|
-
if (
|
|
372
|
-
switch (
|
|
360
|
+
const n = Number(t), a = n % 100;
|
|
361
|
+
if (a > 20 || a < 10)
|
|
362
|
+
switch (a % 10) {
|
|
373
363
|
case 1:
|
|
374
364
|
return n + "st";
|
|
375
365
|
case 2:
|
|
@@ -380,45 +370,45 @@ const rt = {
|
|
|
380
370
|
return n + "th";
|
|
381
371
|
}, dt = {
|
|
382
372
|
ordinalNumber: ut,
|
|
383
|
-
era:
|
|
384
|
-
values:
|
|
373
|
+
era: P({
|
|
374
|
+
values: at,
|
|
385
375
|
defaultWidth: "wide"
|
|
386
376
|
}),
|
|
387
|
-
quarter:
|
|
388
|
-
values:
|
|
377
|
+
quarter: P({
|
|
378
|
+
values: rt,
|
|
389
379
|
defaultWidth: "wide",
|
|
390
380
|
argumentCallback: (t) => t - 1
|
|
391
381
|
}),
|
|
392
|
-
month:
|
|
393
|
-
values:
|
|
382
|
+
month: P({
|
|
383
|
+
values: it,
|
|
394
384
|
defaultWidth: "wide"
|
|
395
385
|
}),
|
|
396
|
-
day:
|
|
397
|
-
values:
|
|
386
|
+
day: P({
|
|
387
|
+
values: st,
|
|
398
388
|
defaultWidth: "wide"
|
|
399
389
|
}),
|
|
400
|
-
dayPeriod:
|
|
390
|
+
dayPeriod: P({
|
|
401
391
|
values: ot,
|
|
402
392
|
defaultWidth: "wide",
|
|
403
393
|
formattingValues: ct,
|
|
404
394
|
defaultFormattingWidth: "wide"
|
|
405
395
|
})
|
|
406
396
|
};
|
|
407
|
-
function
|
|
397
|
+
function p(t) {
|
|
408
398
|
return (e, n = {}) => {
|
|
409
|
-
const
|
|
410
|
-
if (!
|
|
399
|
+
const a = n.width, r = a && t.matchPatterns[a] || t.matchPatterns[t.defaultMatchWidth], i = e.match(r);
|
|
400
|
+
if (!i)
|
|
411
401
|
return null;
|
|
412
|
-
const
|
|
413
|
-
//
|
|
414
|
-
lt(
|
|
402
|
+
const o = i[0], d = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], h = Array.isArray(d) ? mt(d, (M) => M.test(o)) : (
|
|
403
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
404
|
+
lt(d, (M) => M.test(o))
|
|
415
405
|
);
|
|
416
406
|
let f;
|
|
417
|
-
f = t.valueCallback ? t.valueCallback(
|
|
418
|
-
//
|
|
407
|
+
f = t.valueCallback ? t.valueCallback(h) : h, f = n.valueCallback ? (
|
|
408
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
419
409
|
n.valueCallback(f)
|
|
420
410
|
) : f;
|
|
421
|
-
const b = e.slice(
|
|
411
|
+
const b = e.slice(o.length);
|
|
422
412
|
return { value: f, rest: b };
|
|
423
413
|
};
|
|
424
414
|
}
|
|
@@ -427,40 +417,40 @@ function lt(t, e) {
|
|
|
427
417
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
428
418
|
return n;
|
|
429
419
|
}
|
|
430
|
-
function
|
|
420
|
+
function mt(t, e) {
|
|
431
421
|
for (let n = 0; n < t.length; n++)
|
|
432
422
|
if (e(t[n]))
|
|
433
423
|
return n;
|
|
434
424
|
}
|
|
435
|
-
function
|
|
425
|
+
function ie(t) {
|
|
436
426
|
return (e, n = {}) => {
|
|
437
|
-
const
|
|
438
|
-
if (!
|
|
439
|
-
const
|
|
440
|
-
if (!
|
|
441
|
-
let
|
|
442
|
-
|
|
443
|
-
const
|
|
444
|
-
return { value:
|
|
427
|
+
const a = e.match(t.matchPattern);
|
|
428
|
+
if (!a) return null;
|
|
429
|
+
const r = a[0], i = e.match(t.parsePattern);
|
|
430
|
+
if (!i) return null;
|
|
431
|
+
let o = t.valueCallback ? t.valueCallback(i[0]) : i[0];
|
|
432
|
+
o = n.valueCallback ? n.valueCallback(o) : o;
|
|
433
|
+
const d = e.slice(r.length);
|
|
434
|
+
return { value: o, rest: d };
|
|
445
435
|
};
|
|
446
436
|
}
|
|
447
|
-
const
|
|
437
|
+
const ht = /^(\d+)(th|st|nd|rd)?/i, ft = /\d+/i, gt = {
|
|
448
438
|
narrow: /^(b|a)/i,
|
|
449
439
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
450
440
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
451
|
-
},
|
|
441
|
+
}, wt = {
|
|
452
442
|
any: [/^b/i, /^(a|c)/i]
|
|
453
|
-
},
|
|
443
|
+
}, yt = {
|
|
454
444
|
narrow: /^[1234]/i,
|
|
455
445
|
abbreviated: /^q[1234]/i,
|
|
456
446
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
457
|
-
},
|
|
447
|
+
}, bt = {
|
|
458
448
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
459
|
-
},
|
|
449
|
+
}, vt = {
|
|
460
450
|
narrow: /^[jfmasond]/i,
|
|
461
451
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
462
452
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
463
|
-
},
|
|
453
|
+
}, Mt = {
|
|
464
454
|
narrow: [
|
|
465
455
|
/^j/i,
|
|
466
456
|
/^f/i,
|
|
@@ -489,18 +479,18 @@ const mt = /^(\d+)(th|st|nd|rd)?/i, gt = /\d+/i, wt = {
|
|
|
489
479
|
/^n/i,
|
|
490
480
|
/^d/i
|
|
491
481
|
]
|
|
492
|
-
},
|
|
482
|
+
}, Pt = {
|
|
493
483
|
narrow: /^[smtwf]/i,
|
|
494
484
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
495
485
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
496
486
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
497
|
-
},
|
|
487
|
+
}, pt = {
|
|
498
488
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
499
489
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
500
|
-
},
|
|
490
|
+
}, Dt = {
|
|
501
491
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
502
492
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
503
|
-
},
|
|
493
|
+
}, kt = {
|
|
504
494
|
any: {
|
|
505
495
|
am: /^a/i,
|
|
506
496
|
pm: /^p/i,
|
|
@@ -511,99 +501,99 @@ const mt = /^(\d+)(th|st|nd|rd)?/i, gt = /\d+/i, wt = {
|
|
|
511
501
|
evening: /evening/i,
|
|
512
502
|
night: /night/i
|
|
513
503
|
}
|
|
514
|
-
},
|
|
515
|
-
ordinalNumber:
|
|
516
|
-
matchPattern:
|
|
517
|
-
parsePattern:
|
|
504
|
+
}, Ot = {
|
|
505
|
+
ordinalNumber: ie({
|
|
506
|
+
matchPattern: ht,
|
|
507
|
+
parsePattern: ft,
|
|
518
508
|
valueCallback: (t) => parseInt(t, 10)
|
|
519
509
|
}),
|
|
520
|
-
era:
|
|
521
|
-
matchPatterns:
|
|
510
|
+
era: p({
|
|
511
|
+
matchPatterns: gt,
|
|
522
512
|
defaultMatchWidth: "wide",
|
|
523
|
-
parsePatterns:
|
|
513
|
+
parsePatterns: wt,
|
|
524
514
|
defaultParseWidth: "any"
|
|
525
515
|
}),
|
|
526
|
-
quarter:
|
|
527
|
-
matchPatterns:
|
|
516
|
+
quarter: p({
|
|
517
|
+
matchPatterns: yt,
|
|
528
518
|
defaultMatchWidth: "wide",
|
|
529
|
-
parsePatterns:
|
|
519
|
+
parsePatterns: bt,
|
|
530
520
|
defaultParseWidth: "any",
|
|
531
521
|
valueCallback: (t) => t + 1
|
|
532
522
|
}),
|
|
533
|
-
month:
|
|
534
|
-
matchPatterns:
|
|
523
|
+
month: p({
|
|
524
|
+
matchPatterns: vt,
|
|
535
525
|
defaultMatchWidth: "wide",
|
|
536
|
-
parsePatterns:
|
|
526
|
+
parsePatterns: Mt,
|
|
537
527
|
defaultParseWidth: "any"
|
|
538
528
|
}),
|
|
539
|
-
day:
|
|
540
|
-
matchPatterns:
|
|
529
|
+
day: p({
|
|
530
|
+
matchPatterns: Pt,
|
|
541
531
|
defaultMatchWidth: "wide",
|
|
542
|
-
parsePatterns:
|
|
532
|
+
parsePatterns: pt,
|
|
543
533
|
defaultParseWidth: "any"
|
|
544
534
|
}),
|
|
545
|
-
dayPeriod:
|
|
546
|
-
matchPatterns:
|
|
535
|
+
dayPeriod: p({
|
|
536
|
+
matchPatterns: Dt,
|
|
547
537
|
defaultMatchWidth: "any",
|
|
548
|
-
parsePatterns:
|
|
538
|
+
parsePatterns: kt,
|
|
549
539
|
defaultParseWidth: "any"
|
|
550
540
|
})
|
|
551
|
-
},
|
|
541
|
+
}, Wt = {
|
|
552
542
|
code: "en-US",
|
|
553
|
-
formatDistance:
|
|
543
|
+
formatDistance: ze,
|
|
554
544
|
formatLong: et,
|
|
555
545
|
formatRelative: nt,
|
|
556
546
|
localize: dt,
|
|
557
|
-
match:
|
|
547
|
+
match: Ot,
|
|
558
548
|
options: {
|
|
559
549
|
weekStartsOn: 0,
|
|
560
550
|
firstWeekContainsDate: 1
|
|
561
551
|
}
|
|
562
552
|
};
|
|
563
|
-
function
|
|
564
|
-
const
|
|
565
|
-
return
|
|
553
|
+
function xt(t) {
|
|
554
|
+
const e = m(t);
|
|
555
|
+
return Ae(e, Be(e)) + 1;
|
|
566
556
|
}
|
|
567
|
-
function
|
|
568
|
-
const
|
|
569
|
-
return Math.round(
|
|
557
|
+
function Tt(t) {
|
|
558
|
+
const e = m(t), n = +$(e) - +Je(e);
|
|
559
|
+
return Math.round(n / ae) + 1;
|
|
570
560
|
}
|
|
571
561
|
function se(t, e) {
|
|
572
|
-
var b,
|
|
573
|
-
const n =
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
const f =
|
|
578
|
-
return
|
|
562
|
+
var b, M, W, x;
|
|
563
|
+
const n = m(t), a = n.getFullYear(), r = A(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((M = (b = e == null ? void 0 : e.locale) == null ? void 0 : b.options) == null ? void 0 : M.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((x = (W = r.locale) == null ? void 0 : W.options) == null ? void 0 : x.firstWeekContainsDate) ?? 1, o = D(t, 0);
|
|
564
|
+
o.setFullYear(a + 1, 0, i), o.setHours(0, 0, 0, 0);
|
|
565
|
+
const d = _(o, e), h = D(t, 0);
|
|
566
|
+
h.setFullYear(a, 0, i), h.setHours(0, 0, 0, 0);
|
|
567
|
+
const f = _(h, e);
|
|
568
|
+
return n.getTime() >= d.getTime() ? a + 1 : n.getTime() >= f.getTime() ? a : a - 1;
|
|
579
569
|
}
|
|
580
|
-
function
|
|
581
|
-
var
|
|
582
|
-
const n =
|
|
583
|
-
return
|
|
570
|
+
function St(t, e) {
|
|
571
|
+
var d, h, f, b;
|
|
572
|
+
const n = A(), a = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((h = (d = e == null ? void 0 : e.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((b = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, r = se(t, e), i = D(t, 0);
|
|
573
|
+
return i.setFullYear(r, 0, a), i.setHours(0, 0, 0, 0), _(i, e);
|
|
584
574
|
}
|
|
585
|
-
function
|
|
586
|
-
const n =
|
|
587
|
-
return Math.round(
|
|
575
|
+
function Yt(t, e) {
|
|
576
|
+
const n = m(t), a = +_(n, e) - +St(n, e);
|
|
577
|
+
return Math.round(a / ae) + 1;
|
|
588
578
|
}
|
|
589
|
-
function
|
|
590
|
-
const n = t < 0 ? "-" : "",
|
|
591
|
-
return n +
|
|
579
|
+
function c(t, e) {
|
|
580
|
+
const n = t < 0 ? "-" : "", a = Math.abs(t).toString().padStart(e, "0");
|
|
581
|
+
return n + a;
|
|
592
582
|
}
|
|
593
|
-
const
|
|
583
|
+
const O = {
|
|
594
584
|
// Year
|
|
595
585
|
y(t, e) {
|
|
596
|
-
const n = t.getFullYear(),
|
|
597
|
-
return
|
|
586
|
+
const n = t.getFullYear(), a = n > 0 ? n : 1 - n;
|
|
587
|
+
return c(e === "yy" ? a % 100 : a, e.length);
|
|
598
588
|
},
|
|
599
589
|
// Month
|
|
600
590
|
M(t, e) {
|
|
601
591
|
const n = t.getMonth();
|
|
602
|
-
return e === "M" ? String(n + 1) :
|
|
592
|
+
return e === "M" ? String(n + 1) : c(n + 1, 2);
|
|
603
593
|
},
|
|
604
594
|
// Day of the month
|
|
605
595
|
d(t, e) {
|
|
606
|
-
return
|
|
596
|
+
return c(t.getDate(), e.length);
|
|
607
597
|
},
|
|
608
598
|
// AM or PM
|
|
609
599
|
a(t, e) {
|
|
@@ -623,28 +613,28 @@ const P = {
|
|
|
623
613
|
},
|
|
624
614
|
// Hour [1-12]
|
|
625
615
|
h(t, e) {
|
|
626
|
-
return
|
|
616
|
+
return c(t.getHours() % 12 || 12, e.length);
|
|
627
617
|
},
|
|
628
618
|
// Hour [0-23]
|
|
629
619
|
H(t, e) {
|
|
630
|
-
return
|
|
620
|
+
return c(t.getHours(), e.length);
|
|
631
621
|
},
|
|
632
622
|
// Minute
|
|
633
623
|
m(t, e) {
|
|
634
|
-
return
|
|
624
|
+
return c(t.getMinutes(), e.length);
|
|
635
625
|
},
|
|
636
626
|
// Second
|
|
637
627
|
s(t, e) {
|
|
638
|
-
return
|
|
628
|
+
return c(t.getSeconds(), e.length);
|
|
639
629
|
},
|
|
640
630
|
// Fraction of second
|
|
641
631
|
S(t, e) {
|
|
642
|
-
const n = e.length,
|
|
643
|
-
|
|
632
|
+
const n = e.length, a = t.getMilliseconds(), r = Math.trunc(
|
|
633
|
+
a * Math.pow(10, n - 3)
|
|
644
634
|
);
|
|
645
|
-
return
|
|
635
|
+
return c(r, e.length);
|
|
646
636
|
}
|
|
647
|
-
},
|
|
637
|
+
}, S = {
|
|
648
638
|
am: "am",
|
|
649
639
|
pm: "pm",
|
|
650
640
|
midnight: "midnight",
|
|
@@ -653,43 +643,43 @@ const P = {
|
|
|
653
643
|
afternoon: "afternoon",
|
|
654
644
|
evening: "evening",
|
|
655
645
|
night: "night"
|
|
656
|
-
},
|
|
646
|
+
}, Z = {
|
|
657
647
|
// Era
|
|
658
648
|
G: function(t, e, n) {
|
|
659
|
-
const
|
|
649
|
+
const a = t.getFullYear() > 0 ? 1 : 0;
|
|
660
650
|
switch (e) {
|
|
661
651
|
case "G":
|
|
662
652
|
case "GG":
|
|
663
653
|
case "GGG":
|
|
664
|
-
return n.era(
|
|
654
|
+
return n.era(a, { width: "abbreviated" });
|
|
665
655
|
case "GGGGG":
|
|
666
|
-
return n.era(
|
|
656
|
+
return n.era(a, { width: "narrow" });
|
|
667
657
|
case "GGGG":
|
|
668
658
|
default:
|
|
669
|
-
return n.era(
|
|
659
|
+
return n.era(a, { width: "wide" });
|
|
670
660
|
}
|
|
671
661
|
},
|
|
672
662
|
// Year
|
|
673
663
|
y: function(t, e, n) {
|
|
674
664
|
if (e === "yo") {
|
|
675
|
-
const
|
|
676
|
-
return n.ordinalNumber(
|
|
665
|
+
const a = t.getFullYear(), r = a > 0 ? a : 1 - a;
|
|
666
|
+
return n.ordinalNumber(r, { unit: "year" });
|
|
677
667
|
}
|
|
678
|
-
return
|
|
668
|
+
return O.y(t, e);
|
|
679
669
|
},
|
|
680
670
|
// Local week-numbering year
|
|
681
|
-
Y: function(t, e, n,
|
|
682
|
-
const
|
|
671
|
+
Y: function(t, e, n, a) {
|
|
672
|
+
const r = se(t, a), i = r > 0 ? r : 1 - r;
|
|
683
673
|
if (e === "YY") {
|
|
684
|
-
const
|
|
685
|
-
return
|
|
674
|
+
const o = i % 100;
|
|
675
|
+
return c(o, 2);
|
|
686
676
|
}
|
|
687
|
-
return e === "Yo" ? n.ordinalNumber(
|
|
677
|
+
return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : c(i, e.length);
|
|
688
678
|
},
|
|
689
679
|
// ISO week-numbering year
|
|
690
680
|
R: function(t, e) {
|
|
691
|
-
const n =
|
|
692
|
-
return
|
|
681
|
+
const n = re(t);
|
|
682
|
+
return c(n, e.length);
|
|
693
683
|
},
|
|
694
684
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
695
685
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -702,31 +692,31 @@ const P = {
|
|
|
702
692
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
703
693
|
u: function(t, e) {
|
|
704
694
|
const n = t.getFullYear();
|
|
705
|
-
return
|
|
695
|
+
return c(n, e.length);
|
|
706
696
|
},
|
|
707
697
|
// Quarter
|
|
708
698
|
Q: function(t, e, n) {
|
|
709
|
-
const
|
|
699
|
+
const a = Math.ceil((t.getMonth() + 1) / 3);
|
|
710
700
|
switch (e) {
|
|
711
701
|
case "Q":
|
|
712
|
-
return String(
|
|
702
|
+
return String(a);
|
|
713
703
|
case "QQ":
|
|
714
|
-
return
|
|
704
|
+
return c(a, 2);
|
|
715
705
|
case "Qo":
|
|
716
|
-
return n.ordinalNumber(
|
|
706
|
+
return n.ordinalNumber(a, { unit: "quarter" });
|
|
717
707
|
case "QQQ":
|
|
718
|
-
return n.quarter(
|
|
708
|
+
return n.quarter(a, {
|
|
719
709
|
width: "abbreviated",
|
|
720
710
|
context: "formatting"
|
|
721
711
|
});
|
|
722
712
|
case "QQQQQ":
|
|
723
|
-
return n.quarter(
|
|
713
|
+
return n.quarter(a, {
|
|
724
714
|
width: "narrow",
|
|
725
715
|
context: "formatting"
|
|
726
716
|
});
|
|
727
717
|
case "QQQQ":
|
|
728
718
|
default:
|
|
729
|
-
return n.quarter(
|
|
719
|
+
return n.quarter(a, {
|
|
730
720
|
width: "wide",
|
|
731
721
|
context: "formatting"
|
|
732
722
|
});
|
|
@@ -734,27 +724,27 @@ const P = {
|
|
|
734
724
|
},
|
|
735
725
|
// Stand-alone quarter
|
|
736
726
|
q: function(t, e, n) {
|
|
737
|
-
const
|
|
727
|
+
const a = Math.ceil((t.getMonth() + 1) / 3);
|
|
738
728
|
switch (e) {
|
|
739
729
|
case "q":
|
|
740
|
-
return String(
|
|
730
|
+
return String(a);
|
|
741
731
|
case "qq":
|
|
742
|
-
return
|
|
732
|
+
return c(a, 2);
|
|
743
733
|
case "qo":
|
|
744
|
-
return n.ordinalNumber(
|
|
734
|
+
return n.ordinalNumber(a, { unit: "quarter" });
|
|
745
735
|
case "qqq":
|
|
746
|
-
return n.quarter(
|
|
736
|
+
return n.quarter(a, {
|
|
747
737
|
width: "abbreviated",
|
|
748
738
|
context: "standalone"
|
|
749
739
|
});
|
|
750
740
|
case "qqqqq":
|
|
751
|
-
return n.quarter(
|
|
741
|
+
return n.quarter(a, {
|
|
752
742
|
width: "narrow",
|
|
753
743
|
context: "standalone"
|
|
754
744
|
});
|
|
755
745
|
case "qqqq":
|
|
756
746
|
default:
|
|
757
|
-
return n.quarter(
|
|
747
|
+
return n.quarter(a, {
|
|
758
748
|
width: "wide",
|
|
759
749
|
context: "standalone"
|
|
760
750
|
});
|
|
@@ -762,162 +752,162 @@ const P = {
|
|
|
762
752
|
},
|
|
763
753
|
// Month
|
|
764
754
|
M: function(t, e, n) {
|
|
765
|
-
const
|
|
755
|
+
const a = t.getMonth();
|
|
766
756
|
switch (e) {
|
|
767
757
|
case "M":
|
|
768
758
|
case "MM":
|
|
769
|
-
return
|
|
759
|
+
return O.M(t, e);
|
|
770
760
|
case "Mo":
|
|
771
|
-
return n.ordinalNumber(
|
|
761
|
+
return n.ordinalNumber(a + 1, { unit: "month" });
|
|
772
762
|
case "MMM":
|
|
773
|
-
return n.month(
|
|
763
|
+
return n.month(a, {
|
|
774
764
|
width: "abbreviated",
|
|
775
765
|
context: "formatting"
|
|
776
766
|
});
|
|
777
767
|
case "MMMMM":
|
|
778
|
-
return n.month(
|
|
768
|
+
return n.month(a, {
|
|
779
769
|
width: "narrow",
|
|
780
770
|
context: "formatting"
|
|
781
771
|
});
|
|
782
772
|
case "MMMM":
|
|
783
773
|
default:
|
|
784
|
-
return n.month(
|
|
774
|
+
return n.month(a, { width: "wide", context: "formatting" });
|
|
785
775
|
}
|
|
786
776
|
},
|
|
787
777
|
// Stand-alone month
|
|
788
778
|
L: function(t, e, n) {
|
|
789
|
-
const
|
|
779
|
+
const a = t.getMonth();
|
|
790
780
|
switch (e) {
|
|
791
781
|
case "L":
|
|
792
|
-
return String(
|
|
782
|
+
return String(a + 1);
|
|
793
783
|
case "LL":
|
|
794
|
-
return
|
|
784
|
+
return c(a + 1, 2);
|
|
795
785
|
case "Lo":
|
|
796
|
-
return n.ordinalNumber(
|
|
786
|
+
return n.ordinalNumber(a + 1, { unit: "month" });
|
|
797
787
|
case "LLL":
|
|
798
|
-
return n.month(
|
|
788
|
+
return n.month(a, {
|
|
799
789
|
width: "abbreviated",
|
|
800
790
|
context: "standalone"
|
|
801
791
|
});
|
|
802
792
|
case "LLLLL":
|
|
803
|
-
return n.month(
|
|
793
|
+
return n.month(a, {
|
|
804
794
|
width: "narrow",
|
|
805
795
|
context: "standalone"
|
|
806
796
|
});
|
|
807
797
|
case "LLLL":
|
|
808
798
|
default:
|
|
809
|
-
return n.month(
|
|
799
|
+
return n.month(a, { width: "wide", context: "standalone" });
|
|
810
800
|
}
|
|
811
801
|
},
|
|
812
802
|
// Local week of year
|
|
813
|
-
w: function(t, e, n,
|
|
814
|
-
const
|
|
815
|
-
return e === "wo" ? n.ordinalNumber(
|
|
803
|
+
w: function(t, e, n, a) {
|
|
804
|
+
const r = Yt(t, a);
|
|
805
|
+
return e === "wo" ? n.ordinalNumber(r, { unit: "week" }) : c(r, e.length);
|
|
816
806
|
},
|
|
817
807
|
// ISO week of year
|
|
818
808
|
I: function(t, e, n) {
|
|
819
|
-
const
|
|
820
|
-
return e === "Io" ? n.ordinalNumber(
|
|
809
|
+
const a = Tt(t);
|
|
810
|
+
return e === "Io" ? n.ordinalNumber(a, { unit: "week" }) : c(a, e.length);
|
|
821
811
|
},
|
|
822
812
|
// Day of the month
|
|
823
813
|
d: function(t, e, n) {
|
|
824
|
-
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) :
|
|
814
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : O.d(t, e);
|
|
825
815
|
},
|
|
826
816
|
// Day of year
|
|
827
817
|
D: function(t, e, n) {
|
|
828
|
-
const
|
|
829
|
-
return e === "Do" ? n.ordinalNumber(
|
|
818
|
+
const a = xt(t);
|
|
819
|
+
return e === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : c(a, e.length);
|
|
830
820
|
},
|
|
831
821
|
// Day of week
|
|
832
822
|
E: function(t, e, n) {
|
|
833
|
-
const
|
|
823
|
+
const a = t.getDay();
|
|
834
824
|
switch (e) {
|
|
835
825
|
case "E":
|
|
836
826
|
case "EE":
|
|
837
827
|
case "EEE":
|
|
838
|
-
return n.day(
|
|
828
|
+
return n.day(a, {
|
|
839
829
|
width: "abbreviated",
|
|
840
830
|
context: "formatting"
|
|
841
831
|
});
|
|
842
832
|
case "EEEEE":
|
|
843
|
-
return n.day(
|
|
833
|
+
return n.day(a, {
|
|
844
834
|
width: "narrow",
|
|
845
835
|
context: "formatting"
|
|
846
836
|
});
|
|
847
837
|
case "EEEEEE":
|
|
848
|
-
return n.day(
|
|
838
|
+
return n.day(a, {
|
|
849
839
|
width: "short",
|
|
850
840
|
context: "formatting"
|
|
851
841
|
});
|
|
852
842
|
case "EEEE":
|
|
853
843
|
default:
|
|
854
|
-
return n.day(
|
|
844
|
+
return n.day(a, {
|
|
855
845
|
width: "wide",
|
|
856
846
|
context: "formatting"
|
|
857
847
|
});
|
|
858
848
|
}
|
|
859
849
|
},
|
|
860
850
|
// Local day of week
|
|
861
|
-
e: function(t, e, n,
|
|
862
|
-
const
|
|
851
|
+
e: function(t, e, n, a) {
|
|
852
|
+
const r = t.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
|
|
863
853
|
switch (e) {
|
|
864
854
|
case "e":
|
|
865
|
-
return String(
|
|
855
|
+
return String(i);
|
|
866
856
|
case "ee":
|
|
867
|
-
return
|
|
857
|
+
return c(i, 2);
|
|
868
858
|
case "eo":
|
|
869
|
-
return n.ordinalNumber(
|
|
859
|
+
return n.ordinalNumber(i, { unit: "day" });
|
|
870
860
|
case "eee":
|
|
871
|
-
return n.day(
|
|
861
|
+
return n.day(r, {
|
|
872
862
|
width: "abbreviated",
|
|
873
863
|
context: "formatting"
|
|
874
864
|
});
|
|
875
865
|
case "eeeee":
|
|
876
|
-
return n.day(
|
|
866
|
+
return n.day(r, {
|
|
877
867
|
width: "narrow",
|
|
878
868
|
context: "formatting"
|
|
879
869
|
});
|
|
880
870
|
case "eeeeee":
|
|
881
|
-
return n.day(
|
|
871
|
+
return n.day(r, {
|
|
882
872
|
width: "short",
|
|
883
873
|
context: "formatting"
|
|
884
874
|
});
|
|
885
875
|
case "eeee":
|
|
886
876
|
default:
|
|
887
|
-
return n.day(
|
|
877
|
+
return n.day(r, {
|
|
888
878
|
width: "wide",
|
|
889
879
|
context: "formatting"
|
|
890
880
|
});
|
|
891
881
|
}
|
|
892
882
|
},
|
|
893
883
|
// Stand-alone local day of week
|
|
894
|
-
c: function(t, e, n,
|
|
895
|
-
const
|
|
884
|
+
c: function(t, e, n, a) {
|
|
885
|
+
const r = t.getDay(), i = (r - a.weekStartsOn + 8) % 7 || 7;
|
|
896
886
|
switch (e) {
|
|
897
887
|
case "c":
|
|
898
|
-
return String(
|
|
888
|
+
return String(i);
|
|
899
889
|
case "cc":
|
|
900
|
-
return
|
|
890
|
+
return c(i, e.length);
|
|
901
891
|
case "co":
|
|
902
|
-
return n.ordinalNumber(
|
|
892
|
+
return n.ordinalNumber(i, { unit: "day" });
|
|
903
893
|
case "ccc":
|
|
904
|
-
return n.day(
|
|
894
|
+
return n.day(r, {
|
|
905
895
|
width: "abbreviated",
|
|
906
896
|
context: "standalone"
|
|
907
897
|
});
|
|
908
898
|
case "ccccc":
|
|
909
|
-
return n.day(
|
|
899
|
+
return n.day(r, {
|
|
910
900
|
width: "narrow",
|
|
911
901
|
context: "standalone"
|
|
912
902
|
});
|
|
913
903
|
case "cccccc":
|
|
914
|
-
return n.day(
|
|
904
|
+
return n.day(r, {
|
|
915
905
|
width: "short",
|
|
916
906
|
context: "standalone"
|
|
917
907
|
});
|
|
918
908
|
case "cccc":
|
|
919
909
|
default:
|
|
920
|
-
return n.day(
|
|
910
|
+
return n.day(r, {
|
|
921
911
|
width: "wide",
|
|
922
912
|
context: "standalone"
|
|
923
913
|
});
|
|
@@ -925,32 +915,32 @@ const P = {
|
|
|
925
915
|
},
|
|
926
916
|
// ISO day of week
|
|
927
917
|
i: function(t, e, n) {
|
|
928
|
-
const
|
|
918
|
+
const a = t.getDay(), r = a === 0 ? 7 : a;
|
|
929
919
|
switch (e) {
|
|
930
920
|
case "i":
|
|
931
|
-
return String(
|
|
921
|
+
return String(r);
|
|
932
922
|
case "ii":
|
|
933
|
-
return
|
|
923
|
+
return c(r, e.length);
|
|
934
924
|
case "io":
|
|
935
|
-
return n.ordinalNumber(
|
|
925
|
+
return n.ordinalNumber(r, { unit: "day" });
|
|
936
926
|
case "iii":
|
|
937
|
-
return n.day(
|
|
927
|
+
return n.day(a, {
|
|
938
928
|
width: "abbreviated",
|
|
939
929
|
context: "formatting"
|
|
940
930
|
});
|
|
941
931
|
case "iiiii":
|
|
942
|
-
return n.day(
|
|
932
|
+
return n.day(a, {
|
|
943
933
|
width: "narrow",
|
|
944
934
|
context: "formatting"
|
|
945
935
|
});
|
|
946
936
|
case "iiiiii":
|
|
947
|
-
return n.day(
|
|
937
|
+
return n.day(a, {
|
|
948
938
|
width: "short",
|
|
949
939
|
context: "formatting"
|
|
950
940
|
});
|
|
951
941
|
case "iiii":
|
|
952
942
|
default:
|
|
953
|
-
return n.day(
|
|
943
|
+
return n.day(a, {
|
|
954
944
|
width: "wide",
|
|
955
945
|
context: "formatting"
|
|
956
946
|
});
|
|
@@ -958,27 +948,27 @@ const P = {
|
|
|
958
948
|
},
|
|
959
949
|
// AM or PM
|
|
960
950
|
a: function(t, e, n) {
|
|
961
|
-
const
|
|
951
|
+
const r = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
962
952
|
switch (e) {
|
|
963
953
|
case "a":
|
|
964
954
|
case "aa":
|
|
965
|
-
return n.dayPeriod(
|
|
955
|
+
return n.dayPeriod(r, {
|
|
966
956
|
width: "abbreviated",
|
|
967
957
|
context: "formatting"
|
|
968
958
|
});
|
|
969
959
|
case "aaa":
|
|
970
|
-
return n.dayPeriod(
|
|
960
|
+
return n.dayPeriod(r, {
|
|
971
961
|
width: "abbreviated",
|
|
972
962
|
context: "formatting"
|
|
973
963
|
}).toLowerCase();
|
|
974
964
|
case "aaaaa":
|
|
975
|
-
return n.dayPeriod(
|
|
965
|
+
return n.dayPeriod(r, {
|
|
976
966
|
width: "narrow",
|
|
977
967
|
context: "formatting"
|
|
978
968
|
});
|
|
979
969
|
case "aaaa":
|
|
980
970
|
default:
|
|
981
|
-
return n.dayPeriod(
|
|
971
|
+
return n.dayPeriod(r, {
|
|
982
972
|
width: "wide",
|
|
983
973
|
context: "formatting"
|
|
984
974
|
});
|
|
@@ -986,28 +976,28 @@ const P = {
|
|
|
986
976
|
},
|
|
987
977
|
// AM, PM, midnight, noon
|
|
988
978
|
b: function(t, e, n) {
|
|
989
|
-
const
|
|
990
|
-
let
|
|
991
|
-
switch (
|
|
979
|
+
const a = t.getHours();
|
|
980
|
+
let r;
|
|
981
|
+
switch (a === 12 ? r = S.noon : a === 0 ? r = S.midnight : r = a / 12 >= 1 ? "pm" : "am", e) {
|
|
992
982
|
case "b":
|
|
993
983
|
case "bb":
|
|
994
|
-
return n.dayPeriod(
|
|
984
|
+
return n.dayPeriod(r, {
|
|
995
985
|
width: "abbreviated",
|
|
996
986
|
context: "formatting"
|
|
997
987
|
});
|
|
998
988
|
case "bbb":
|
|
999
|
-
return n.dayPeriod(
|
|
989
|
+
return n.dayPeriod(r, {
|
|
1000
990
|
width: "abbreviated",
|
|
1001
991
|
context: "formatting"
|
|
1002
992
|
}).toLowerCase();
|
|
1003
993
|
case "bbbbb":
|
|
1004
|
-
return n.dayPeriod(
|
|
994
|
+
return n.dayPeriod(r, {
|
|
1005
995
|
width: "narrow",
|
|
1006
996
|
context: "formatting"
|
|
1007
997
|
});
|
|
1008
998
|
case "bbbb":
|
|
1009
999
|
default:
|
|
1010
|
-
return n.dayPeriod(
|
|
1000
|
+
return n.dayPeriod(r, {
|
|
1011
1001
|
width: "wide",
|
|
1012
1002
|
context: "formatting"
|
|
1013
1003
|
});
|
|
@@ -1015,24 +1005,24 @@ const P = {
|
|
|
1015
1005
|
},
|
|
1016
1006
|
// in the morning, in the afternoon, in the evening, at night
|
|
1017
1007
|
B: function(t, e, n) {
|
|
1018
|
-
const
|
|
1019
|
-
let
|
|
1020
|
-
switch (
|
|
1008
|
+
const a = t.getHours();
|
|
1009
|
+
let r;
|
|
1010
|
+
switch (a >= 17 ? r = S.evening : a >= 12 ? r = S.afternoon : a >= 4 ? r = S.morning : r = S.night, e) {
|
|
1021
1011
|
case "B":
|
|
1022
1012
|
case "BB":
|
|
1023
1013
|
case "BBB":
|
|
1024
|
-
return n.dayPeriod(
|
|
1014
|
+
return n.dayPeriod(r, {
|
|
1025
1015
|
width: "abbreviated",
|
|
1026
1016
|
context: "formatting"
|
|
1027
1017
|
});
|
|
1028
1018
|
case "BBBBB":
|
|
1029
|
-
return n.dayPeriod(
|
|
1019
|
+
return n.dayPeriod(r, {
|
|
1030
1020
|
width: "narrow",
|
|
1031
1021
|
context: "formatting"
|
|
1032
1022
|
});
|
|
1033
1023
|
case "BBBB":
|
|
1034
1024
|
default:
|
|
1035
|
-
return n.dayPeriod(
|
|
1025
|
+
return n.dayPeriod(r, {
|
|
1036
1026
|
width: "wide",
|
|
1037
1027
|
context: "formatting"
|
|
1038
1028
|
});
|
|
@@ -1041,115 +1031,116 @@ const P = {
|
|
|
1041
1031
|
// Hour [1-12]
|
|
1042
1032
|
h: function(t, e, n) {
|
|
1043
1033
|
if (e === "ho") {
|
|
1044
|
-
let
|
|
1045
|
-
return
|
|
1034
|
+
let a = t.getHours() % 12;
|
|
1035
|
+
return a === 0 && (a = 12), n.ordinalNumber(a, { unit: "hour" });
|
|
1046
1036
|
}
|
|
1047
|
-
return
|
|
1037
|
+
return O.h(t, e);
|
|
1048
1038
|
},
|
|
1049
1039
|
// Hour [0-23]
|
|
1050
1040
|
H: function(t, e, n) {
|
|
1051
|
-
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) :
|
|
1041
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : O.H(t, e);
|
|
1052
1042
|
},
|
|
1053
1043
|
// Hour [0-11]
|
|
1054
1044
|
K: function(t, e, n) {
|
|
1055
|
-
const
|
|
1056
|
-
return e === "Ko" ? n.ordinalNumber(
|
|
1045
|
+
const a = t.getHours() % 12;
|
|
1046
|
+
return e === "Ko" ? n.ordinalNumber(a, { unit: "hour" }) : c(a, e.length);
|
|
1057
1047
|
},
|
|
1058
1048
|
// Hour [1-24]
|
|
1059
1049
|
k: function(t, e, n) {
|
|
1060
|
-
let
|
|
1061
|
-
return
|
|
1050
|
+
let a = t.getHours();
|
|
1051
|
+
return a === 0 && (a = 24), e === "ko" ? n.ordinalNumber(a, { unit: "hour" }) : c(a, e.length);
|
|
1062
1052
|
},
|
|
1063
1053
|
// Minute
|
|
1064
1054
|
m: function(t, e, n) {
|
|
1065
|
-
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) :
|
|
1055
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : O.m(t, e);
|
|
1066
1056
|
},
|
|
1067
1057
|
// Second
|
|
1068
1058
|
s: function(t, e, n) {
|
|
1069
|
-
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) :
|
|
1059
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : O.s(t, e);
|
|
1070
1060
|
},
|
|
1071
1061
|
// Fraction of second
|
|
1072
1062
|
S: function(t, e) {
|
|
1073
|
-
return
|
|
1063
|
+
return O.S(t, e);
|
|
1074
1064
|
},
|
|
1075
1065
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1076
1066
|
X: function(t, e, n) {
|
|
1077
|
-
const
|
|
1078
|
-
if (
|
|
1067
|
+
const a = t.getTimezoneOffset();
|
|
1068
|
+
if (a === 0)
|
|
1079
1069
|
return "Z";
|
|
1080
1070
|
switch (e) {
|
|
1081
1071
|
case "X":
|
|
1082
|
-
return K(
|
|
1072
|
+
return K(a);
|
|
1083
1073
|
case "XXXX":
|
|
1084
1074
|
case "XX":
|
|
1085
|
-
return
|
|
1075
|
+
return T(a);
|
|
1086
1076
|
case "XXXXX":
|
|
1087
1077
|
case "XXX":
|
|
1088
1078
|
default:
|
|
1089
|
-
return
|
|
1079
|
+
return T(a, ":");
|
|
1090
1080
|
}
|
|
1091
1081
|
},
|
|
1092
1082
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1093
1083
|
x: function(t, e, n) {
|
|
1094
|
-
const
|
|
1084
|
+
const a = t.getTimezoneOffset();
|
|
1095
1085
|
switch (e) {
|
|
1096
1086
|
case "x":
|
|
1097
|
-
return K(
|
|
1087
|
+
return K(a);
|
|
1098
1088
|
case "xxxx":
|
|
1099
1089
|
case "xx":
|
|
1100
|
-
return
|
|
1090
|
+
return T(a);
|
|
1101
1091
|
case "xxxxx":
|
|
1102
1092
|
case "xxx":
|
|
1103
1093
|
default:
|
|
1104
|
-
return
|
|
1094
|
+
return T(a, ":");
|
|
1105
1095
|
}
|
|
1106
1096
|
},
|
|
1107
1097
|
// Timezone (GMT)
|
|
1108
1098
|
O: function(t, e, n) {
|
|
1109
|
-
const
|
|
1099
|
+
const a = t.getTimezoneOffset();
|
|
1110
1100
|
switch (e) {
|
|
1111
1101
|
case "O":
|
|
1112
1102
|
case "OO":
|
|
1113
1103
|
case "OOO":
|
|
1114
|
-
return "GMT" + U(
|
|
1104
|
+
return "GMT" + U(a, ":");
|
|
1115
1105
|
case "OOOO":
|
|
1116
1106
|
default:
|
|
1117
|
-
return "GMT" +
|
|
1107
|
+
return "GMT" + T(a, ":");
|
|
1118
1108
|
}
|
|
1119
1109
|
},
|
|
1120
1110
|
// Timezone (specific non-location)
|
|
1121
1111
|
z: function(t, e, n) {
|
|
1122
|
-
const
|
|
1112
|
+
const a = t.getTimezoneOffset();
|
|
1123
1113
|
switch (e) {
|
|
1124
1114
|
case "z":
|
|
1125
1115
|
case "zz":
|
|
1126
1116
|
case "zzz":
|
|
1127
|
-
return "GMT" + U(
|
|
1117
|
+
return "GMT" + U(a, ":");
|
|
1128
1118
|
case "zzzz":
|
|
1129
1119
|
default:
|
|
1130
|
-
return "GMT" +
|
|
1120
|
+
return "GMT" + T(a, ":");
|
|
1131
1121
|
}
|
|
1132
1122
|
},
|
|
1133
1123
|
// Seconds timestamp
|
|
1134
1124
|
t: function(t, e, n) {
|
|
1135
|
-
const
|
|
1136
|
-
return
|
|
1125
|
+
const a = Math.trunc(t.getTime() / 1e3);
|
|
1126
|
+
return c(a, e.length);
|
|
1137
1127
|
},
|
|
1138
1128
|
// Milliseconds timestamp
|
|
1139
1129
|
T: function(t, e, n) {
|
|
1140
|
-
|
|
1130
|
+
const a = t.getTime();
|
|
1131
|
+
return c(a, e.length);
|
|
1141
1132
|
}
|
|
1142
1133
|
};
|
|
1143
1134
|
function U(t, e = "") {
|
|
1144
|
-
const n = t > 0 ? "-" : "+",
|
|
1145
|
-
return
|
|
1135
|
+
const n = t > 0 ? "-" : "+", a = Math.abs(t), r = Math.trunc(a / 60), i = a % 60;
|
|
1136
|
+
return i === 0 ? n + String(r) : n + String(r) + e + c(i, 2);
|
|
1146
1137
|
}
|
|
1147
1138
|
function K(t, e) {
|
|
1148
|
-
return t % 60 === 0 ? (t > 0 ? "-" : "+") +
|
|
1139
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + c(Math.abs(t) / 60, 2) : T(t, e);
|
|
1149
1140
|
}
|
|
1150
|
-
function
|
|
1151
|
-
const n = t > 0 ? "-" : "+",
|
|
1152
|
-
return n +
|
|
1141
|
+
function T(t, e = "") {
|
|
1142
|
+
const n = t > 0 ? "-" : "+", a = Math.abs(t), r = c(Math.trunc(a / 60), 2), i = c(a % 60, 2);
|
|
1143
|
+
return n + r + e + i;
|
|
1153
1144
|
}
|
|
1154
1145
|
const ee = (t, e) => {
|
|
1155
1146
|
switch (t) {
|
|
@@ -1163,7 +1154,7 @@ const ee = (t, e) => {
|
|
|
1163
1154
|
default:
|
|
1164
1155
|
return e.date({ width: "full" });
|
|
1165
1156
|
}
|
|
1166
|
-
},
|
|
1157
|
+
}, oe = (t, e) => {
|
|
1167
1158
|
switch (t) {
|
|
1168
1159
|
case "p":
|
|
1169
1160
|
return e.time({ width: "short" });
|
|
@@ -1175,229 +1166,562 @@ const ee = (t, e) => {
|
|
|
1175
1166
|
default:
|
|
1176
1167
|
return e.time({ width: "full" });
|
|
1177
1168
|
}
|
|
1178
|
-
},
|
|
1179
|
-
const n = t.match(/(P+)(p+)?/) || [],
|
|
1180
|
-
if (!
|
|
1169
|
+
}, _t = (t, e) => {
|
|
1170
|
+
const n = t.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
|
|
1171
|
+
if (!r)
|
|
1181
1172
|
return ee(t, e);
|
|
1182
|
-
let
|
|
1183
|
-
switch (
|
|
1173
|
+
let i;
|
|
1174
|
+
switch (a) {
|
|
1184
1175
|
case "P":
|
|
1185
|
-
|
|
1176
|
+
i = e.dateTime({ width: "short" });
|
|
1186
1177
|
break;
|
|
1187
1178
|
case "PP":
|
|
1188
|
-
|
|
1179
|
+
i = e.dateTime({ width: "medium" });
|
|
1189
1180
|
break;
|
|
1190
1181
|
case "PPP":
|
|
1191
|
-
|
|
1182
|
+
i = e.dateTime({ width: "long" });
|
|
1192
1183
|
break;
|
|
1193
1184
|
case "PPPP":
|
|
1194
1185
|
default:
|
|
1195
|
-
|
|
1186
|
+
i = e.dateTime({ width: "full" });
|
|
1196
1187
|
break;
|
|
1197
1188
|
}
|
|
1198
|
-
return
|
|
1199
|
-
},
|
|
1200
|
-
p:
|
|
1201
|
-
P:
|
|
1202
|
-
},
|
|
1203
|
-
function
|
|
1204
|
-
return Nt.test(t);
|
|
1205
|
-
}
|
|
1206
|
-
function Lt(t) {
|
|
1189
|
+
return i.replace("{{date}}", ee(a, e)).replace("{{time}}", oe(r, e));
|
|
1190
|
+
}, jt = {
|
|
1191
|
+
p: oe,
|
|
1192
|
+
P: _t
|
|
1193
|
+
}, Ct = /^D+$/, Nt = /^Y+$/, qt = ["D", "DD", "YY", "YYYY"];
|
|
1194
|
+
function Et(t) {
|
|
1207
1195
|
return Ct.test(t);
|
|
1208
1196
|
}
|
|
1209
|
-
function
|
|
1210
|
-
|
|
1211
|
-
|
|
1197
|
+
function Ft(t) {
|
|
1198
|
+
return Nt.test(t);
|
|
1199
|
+
}
|
|
1200
|
+
function Lt(t, e, n) {
|
|
1201
|
+
const a = $t(t, e, n);
|
|
1202
|
+
if (console.warn(a), qt.includes(t)) throw new RangeError(a);
|
|
1212
1203
|
}
|
|
1213
|
-
function
|
|
1214
|
-
const
|
|
1215
|
-
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${
|
|
1204
|
+
function $t(t, e, n) {
|
|
1205
|
+
const a = t[0] === "Y" ? "years" : "days of the month";
|
|
1206
|
+
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`;
|
|
1216
1207
|
}
|
|
1217
|
-
const
|
|
1208
|
+
const Ht = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, At = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Jt = /^'([^]*?)'?$/, Rt = /''/g, Xt = /[a-zA-Z]/;
|
|
1218
1209
|
function te(t, e, n) {
|
|
1219
|
-
var b,
|
|
1220
|
-
const
|
|
1221
|
-
if (!
|
|
1210
|
+
var b, M, W, x, j, q, E, F;
|
|
1211
|
+
const a = A(), r = (n == null ? void 0 : n.locale) ?? a.locale ?? Wt, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((M = (b = n == null ? void 0 : n.locale) == null ? void 0 : b.options) == null ? void 0 : M.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((x = (W = a.locale) == null ? void 0 : W.options) == null ? void 0 : x.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((q = (j = n == null ? void 0 : n.locale) == null ? void 0 : j.options) == null ? void 0 : q.weekStartsOn) ?? a.weekStartsOn ?? ((F = (E = a.locale) == null ? void 0 : E.options) == null ? void 0 : F.weekStartsOn) ?? 0, d = m(t);
|
|
1212
|
+
if (!Xe(d))
|
|
1222
1213
|
throw new RangeError("Invalid time value");
|
|
1223
|
-
let
|
|
1224
|
-
const
|
|
1225
|
-
if (
|
|
1226
|
-
const
|
|
1227
|
-
return
|
|
1214
|
+
let h = e.match(At).map((l) => {
|
|
1215
|
+
const g = l[0];
|
|
1216
|
+
if (g === "p" || g === "P") {
|
|
1217
|
+
const C = jt[g];
|
|
1218
|
+
return C(l, r.formatLong);
|
|
1228
1219
|
}
|
|
1229
|
-
return
|
|
1230
|
-
}).join("").match(
|
|
1231
|
-
if (
|
|
1220
|
+
return l;
|
|
1221
|
+
}).join("").match(Ht).map((l) => {
|
|
1222
|
+
if (l === "''")
|
|
1232
1223
|
return { isToken: !1, value: "'" };
|
|
1233
|
-
const
|
|
1234
|
-
if (
|
|
1235
|
-
return { isToken: !1, value:
|
|
1236
|
-
if (
|
|
1237
|
-
return { isToken: !0, value:
|
|
1238
|
-
if (
|
|
1224
|
+
const g = l[0];
|
|
1225
|
+
if (g === "'")
|
|
1226
|
+
return { isToken: !1, value: Vt(l) };
|
|
1227
|
+
if (Z[g])
|
|
1228
|
+
return { isToken: !0, value: l };
|
|
1229
|
+
if (g.match(Xt))
|
|
1239
1230
|
throw new RangeError(
|
|
1240
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1231
|
+
"Format string contains an unescaped latin alphabet character `" + g + "`"
|
|
1241
1232
|
);
|
|
1242
|
-
return { isToken: !1, value:
|
|
1233
|
+
return { isToken: !1, value: l };
|
|
1243
1234
|
});
|
|
1244
|
-
|
|
1235
|
+
r.localize.preprocessor && (h = r.localize.preprocessor(d, h));
|
|
1245
1236
|
const f = {
|
|
1246
|
-
firstWeekContainsDate:
|
|
1247
|
-
weekStartsOn:
|
|
1248
|
-
locale:
|
|
1237
|
+
firstWeekContainsDate: i,
|
|
1238
|
+
weekStartsOn: o,
|
|
1239
|
+
locale: r
|
|
1249
1240
|
};
|
|
1250
|
-
return
|
|
1251
|
-
if (!
|
|
1252
|
-
const
|
|
1253
|
-
(
|
|
1254
|
-
const
|
|
1255
|
-
return
|
|
1241
|
+
return h.map((l) => {
|
|
1242
|
+
if (!l.isToken) return l.value;
|
|
1243
|
+
const g = l.value;
|
|
1244
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && Ft(g) || !(n != null && n.useAdditionalDayOfYearTokens) && Et(g)) && Lt(g, e, String(t));
|
|
1245
|
+
const C = Z[g[0]];
|
|
1246
|
+
return C(d, g, r.localize, f);
|
|
1256
1247
|
}).join("");
|
|
1257
1248
|
}
|
|
1258
|
-
function
|
|
1259
|
-
const e = t.match(
|
|
1260
|
-
return e ? e[1].replace(
|
|
1249
|
+
function Vt(t) {
|
|
1250
|
+
const e = t.match(Jt);
|
|
1251
|
+
return e ? e[1].replace(Rt, "'") : t;
|
|
1261
1252
|
}
|
|
1262
|
-
function
|
|
1263
|
-
|
|
1253
|
+
function Qt(t, e) {
|
|
1254
|
+
const n = m(t), a = m(e);
|
|
1255
|
+
return n.getTime() > a.getTime();
|
|
1264
1256
|
}
|
|
1265
|
-
function
|
|
1266
|
-
|
|
1257
|
+
function Bt(t, e) {
|
|
1258
|
+
const n = m(t), a = m(e);
|
|
1259
|
+
return +n < +a;
|
|
1267
1260
|
}
|
|
1268
|
-
function
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1271
|
-
t,
|
|
1272
|
-
e
|
|
1273
|
-
);
|
|
1274
|
-
return r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth();
|
|
1261
|
+
function Gt(t, e) {
|
|
1262
|
+
const n = m(t), a = m(e);
|
|
1263
|
+
return n.getFullYear() === a.getFullYear() && n.getMonth() === a.getMonth();
|
|
1275
1264
|
}
|
|
1276
|
-
function
|
|
1277
|
-
return
|
|
1265
|
+
function It(t, e) {
|
|
1266
|
+
return ne(t, -e);
|
|
1278
1267
|
}
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1268
|
+
const zt = {
|
|
1269
|
+
lessThanXSeconds: {
|
|
1270
|
+
one: "moins d’une seconde",
|
|
1271
|
+
other: "moins de {{count}} secondes"
|
|
1272
|
+
},
|
|
1273
|
+
xSeconds: {
|
|
1274
|
+
one: "1 seconde",
|
|
1275
|
+
other: "{{count}} secondes"
|
|
1276
|
+
},
|
|
1277
|
+
halfAMinute: "30 secondes",
|
|
1278
|
+
lessThanXMinutes: {
|
|
1279
|
+
one: "moins d’une minute",
|
|
1280
|
+
other: "moins de {{count}} minutes"
|
|
1281
|
+
},
|
|
1282
|
+
xMinutes: {
|
|
1283
|
+
one: "1 minute",
|
|
1284
|
+
other: "{{count}} minutes"
|
|
1285
|
+
},
|
|
1286
|
+
aboutXHours: {
|
|
1287
|
+
one: "environ 1 heure",
|
|
1288
|
+
other: "environ {{count}} heures"
|
|
1289
|
+
},
|
|
1290
|
+
xHours: {
|
|
1291
|
+
one: "1 heure",
|
|
1292
|
+
other: "{{count}} heures"
|
|
1293
|
+
},
|
|
1294
|
+
xDays: {
|
|
1295
|
+
one: "1 jour",
|
|
1296
|
+
other: "{{count}} jours"
|
|
1297
|
+
},
|
|
1298
|
+
aboutXWeeks: {
|
|
1299
|
+
one: "environ 1 semaine",
|
|
1300
|
+
other: "environ {{count}} semaines"
|
|
1301
|
+
},
|
|
1302
|
+
xWeeks: {
|
|
1303
|
+
one: "1 semaine",
|
|
1304
|
+
other: "{{count}} semaines"
|
|
1305
|
+
},
|
|
1306
|
+
aboutXMonths: {
|
|
1307
|
+
one: "environ 1 mois",
|
|
1308
|
+
other: "environ {{count}} mois"
|
|
1309
|
+
},
|
|
1310
|
+
xMonths: {
|
|
1311
|
+
one: "1 mois",
|
|
1312
|
+
other: "{{count}} mois"
|
|
1313
|
+
},
|
|
1314
|
+
aboutXYears: {
|
|
1315
|
+
one: "environ 1 an",
|
|
1316
|
+
other: "environ {{count}} ans"
|
|
1317
|
+
},
|
|
1318
|
+
xYears: {
|
|
1319
|
+
one: "1 an",
|
|
1320
|
+
other: "{{count}} ans"
|
|
1321
|
+
},
|
|
1322
|
+
overXYears: {
|
|
1323
|
+
one: "plus d’un an",
|
|
1324
|
+
other: "plus de {{count}} ans"
|
|
1325
|
+
},
|
|
1326
|
+
almostXYears: {
|
|
1327
|
+
one: "presqu’un an",
|
|
1328
|
+
other: "presque {{count}} ans"
|
|
1329
|
+
}
|
|
1330
|
+
}, Zt = (t, e, n) => {
|
|
1331
|
+
let a;
|
|
1332
|
+
const r = zt[t];
|
|
1333
|
+
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
|
+
}, Ut = {
|
|
1335
|
+
full: "EEEE d MMMM y",
|
|
1336
|
+
long: "d MMMM y",
|
|
1337
|
+
medium: "d MMM y",
|
|
1338
|
+
short: "dd/MM/y"
|
|
1339
|
+
}, Kt = {
|
|
1340
|
+
full: "HH:mm:ss zzzz",
|
|
1341
|
+
long: "HH:mm:ss z",
|
|
1342
|
+
medium: "HH:mm:ss",
|
|
1343
|
+
short: "HH:mm"
|
|
1344
|
+
}, en = {
|
|
1345
|
+
full: "{{date}} 'à' {{time}}",
|
|
1346
|
+
long: "{{date}} 'à' {{time}}",
|
|
1347
|
+
medium: "{{date}}, {{time}}",
|
|
1348
|
+
short: "{{date}}, {{time}}"
|
|
1349
|
+
}, tn = {
|
|
1350
|
+
date: Y({
|
|
1351
|
+
formats: Ut,
|
|
1352
|
+
defaultWidth: "full"
|
|
1353
|
+
}),
|
|
1354
|
+
time: Y({
|
|
1355
|
+
formats: Kt,
|
|
1356
|
+
defaultWidth: "full"
|
|
1357
|
+
}),
|
|
1358
|
+
dateTime: Y({
|
|
1359
|
+
formats: en,
|
|
1360
|
+
defaultWidth: "full"
|
|
1361
|
+
})
|
|
1362
|
+
}, nn = {
|
|
1363
|
+
lastWeek: "eeee 'dernier à' p",
|
|
1364
|
+
yesterday: "'hier à' p",
|
|
1365
|
+
today: "'aujourd’hui à' p",
|
|
1366
|
+
tomorrow: "'demain à' p'",
|
|
1367
|
+
nextWeek: "eeee 'prochain à' p",
|
|
1368
|
+
other: "P"
|
|
1369
|
+
}, an = (t, e, n, a) => nn[t], rn = {
|
|
1370
|
+
narrow: ["av. J.-C", "ap. J.-C"],
|
|
1371
|
+
abbreviated: ["av. J.-C", "ap. J.-C"],
|
|
1372
|
+
wide: ["avant Jésus-Christ", "après Jésus-Christ"]
|
|
1373
|
+
}, sn = {
|
|
1374
|
+
narrow: ["T1", "T2", "T3", "T4"],
|
|
1375
|
+
abbreviated: ["1er trim.", "2ème trim.", "3ème trim.", "4ème trim."],
|
|
1376
|
+
wide: ["1er trimestre", "2ème trimestre", "3ème trimestre", "4ème trimestre"]
|
|
1377
|
+
}, on = {
|
|
1378
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1379
|
+
abbreviated: [
|
|
1380
|
+
"janv.",
|
|
1381
|
+
"févr.",
|
|
1382
|
+
"mars",
|
|
1383
|
+
"avr.",
|
|
1384
|
+
"mai",
|
|
1385
|
+
"juin",
|
|
1386
|
+
"juil.",
|
|
1387
|
+
"août",
|
|
1388
|
+
"sept.",
|
|
1389
|
+
"oct.",
|
|
1390
|
+
"nov.",
|
|
1391
|
+
"déc."
|
|
1392
|
+
],
|
|
1393
|
+
wide: [
|
|
1394
|
+
"janvier",
|
|
1395
|
+
"février",
|
|
1396
|
+
"mars",
|
|
1397
|
+
"avril",
|
|
1398
|
+
"mai",
|
|
1399
|
+
"juin",
|
|
1400
|
+
"juillet",
|
|
1401
|
+
"août",
|
|
1402
|
+
"septembre",
|
|
1403
|
+
"octobre",
|
|
1404
|
+
"novembre",
|
|
1405
|
+
"décembre"
|
|
1406
|
+
]
|
|
1407
|
+
}, cn = {
|
|
1408
|
+
narrow: ["D", "L", "M", "M", "J", "V", "S"],
|
|
1409
|
+
short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
|
|
1410
|
+
abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
|
|
1411
|
+
wide: [
|
|
1412
|
+
"dimanche",
|
|
1413
|
+
"lundi",
|
|
1414
|
+
"mardi",
|
|
1415
|
+
"mercredi",
|
|
1416
|
+
"jeudi",
|
|
1417
|
+
"vendredi",
|
|
1418
|
+
"samedi"
|
|
1419
|
+
]
|
|
1420
|
+
}, un = {
|
|
1421
|
+
narrow: {
|
|
1422
|
+
am: "AM",
|
|
1423
|
+
pm: "PM",
|
|
1424
|
+
midnight: "minuit",
|
|
1425
|
+
noon: "midi",
|
|
1426
|
+
morning: "mat.",
|
|
1427
|
+
afternoon: "ap.m.",
|
|
1428
|
+
evening: "soir",
|
|
1429
|
+
night: "mat."
|
|
1430
|
+
},
|
|
1431
|
+
abbreviated: {
|
|
1432
|
+
am: "AM",
|
|
1433
|
+
pm: "PM",
|
|
1434
|
+
midnight: "minuit",
|
|
1435
|
+
noon: "midi",
|
|
1436
|
+
morning: "matin",
|
|
1437
|
+
afternoon: "après-midi",
|
|
1438
|
+
evening: "soir",
|
|
1439
|
+
night: "matin"
|
|
1440
|
+
},
|
|
1441
|
+
wide: {
|
|
1442
|
+
am: "AM",
|
|
1443
|
+
pm: "PM",
|
|
1444
|
+
midnight: "minuit",
|
|
1445
|
+
noon: "midi",
|
|
1446
|
+
morning: "du matin",
|
|
1447
|
+
afternoon: "de l’après-midi",
|
|
1448
|
+
evening: "du soir",
|
|
1449
|
+
night: "du matin"
|
|
1450
|
+
}
|
|
1451
|
+
}, dn = (t, e) => {
|
|
1452
|
+
const n = Number(t), a = e == null ? void 0 : e.unit;
|
|
1453
|
+
if (n === 0) return "0";
|
|
1454
|
+
const r = ["year", "week", "hour", "minute", "second"];
|
|
1455
|
+
let i;
|
|
1456
|
+
return n === 1 ? i = a && r.includes(a) ? "ère" : "er" : i = "ème", n + i;
|
|
1457
|
+
}, ln = ["MMM", "MMMM"], mn = {
|
|
1458
|
+
preprocessor: (t, e) => t.getDate() === 1 || !e.some(
|
|
1459
|
+
(a) => a.isToken && ln.includes(a.value)
|
|
1460
|
+
) ? e : e.map(
|
|
1461
|
+
(a) => a.isToken && a.value === "do" ? { isToken: !0, value: "d" } : a
|
|
1462
|
+
),
|
|
1463
|
+
ordinalNumber: dn,
|
|
1464
|
+
era: P({
|
|
1465
|
+
values: rn,
|
|
1466
|
+
defaultWidth: "wide"
|
|
1467
|
+
}),
|
|
1468
|
+
quarter: P({
|
|
1469
|
+
values: sn,
|
|
1470
|
+
defaultWidth: "wide",
|
|
1471
|
+
argumentCallback: (t) => t - 1
|
|
1472
|
+
}),
|
|
1473
|
+
month: P({
|
|
1474
|
+
values: on,
|
|
1475
|
+
defaultWidth: "wide"
|
|
1476
|
+
}),
|
|
1477
|
+
day: P({
|
|
1478
|
+
values: cn,
|
|
1479
|
+
defaultWidth: "wide"
|
|
1480
|
+
}),
|
|
1481
|
+
dayPeriod: P({
|
|
1482
|
+
values: un,
|
|
1483
|
+
defaultWidth: "wide"
|
|
1484
|
+
})
|
|
1485
|
+
}, hn = /^(\d+)(ième|ère|ème|er|e)?/i, fn = /\d+/i, gn = {
|
|
1486
|
+
narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
|
|
1487
|
+
abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
|
|
1488
|
+
wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
|
|
1489
|
+
}, wn = {
|
|
1490
|
+
any: [/^av/i, /^ap/i]
|
|
1491
|
+
}, yn = {
|
|
1492
|
+
narrow: /^T?[1234]/i,
|
|
1493
|
+
abbreviated: /^[1234](er|ème|e)? trim\.?/i,
|
|
1494
|
+
wide: /^[1234](er|ème|e)? trimestre/i
|
|
1495
|
+
}, bn = {
|
|
1496
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1497
|
+
}, vn = {
|
|
1498
|
+
narrow: /^[jfmasond]/i,
|
|
1499
|
+
abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
|
|
1500
|
+
wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
|
|
1501
|
+
}, Mn = {
|
|
1502
|
+
narrow: [
|
|
1503
|
+
/^j/i,
|
|
1504
|
+
/^f/i,
|
|
1505
|
+
/^m/i,
|
|
1506
|
+
/^a/i,
|
|
1507
|
+
/^m/i,
|
|
1508
|
+
/^j/i,
|
|
1509
|
+
/^j/i,
|
|
1510
|
+
/^a/i,
|
|
1511
|
+
/^s/i,
|
|
1512
|
+
/^o/i,
|
|
1513
|
+
/^n/i,
|
|
1514
|
+
/^d/i
|
|
1515
|
+
],
|
|
1516
|
+
any: [
|
|
1517
|
+
/^ja/i,
|
|
1518
|
+
/^f/i,
|
|
1519
|
+
/^mar/i,
|
|
1520
|
+
/^av/i,
|
|
1521
|
+
/^ma/i,
|
|
1522
|
+
/^juin/i,
|
|
1523
|
+
/^juil/i,
|
|
1524
|
+
/^ao/i,
|
|
1525
|
+
/^s/i,
|
|
1526
|
+
/^o/i,
|
|
1527
|
+
/^n/i,
|
|
1528
|
+
/^d/i
|
|
1529
|
+
]
|
|
1530
|
+
}, Pn = {
|
|
1531
|
+
narrow: /^[lmjvsd]/i,
|
|
1532
|
+
short: /^(di|lu|ma|me|je|ve|sa)/i,
|
|
1533
|
+
abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
|
|
1534
|
+
wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
|
|
1535
|
+
}, pn = {
|
|
1536
|
+
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
|
|
1537
|
+
any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
|
|
1538
|
+
}, Dn = {
|
|
1539
|
+
narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
|
|
1540
|
+
any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
|
|
1541
|
+
}, kn = {
|
|
1542
|
+
any: {
|
|
1543
|
+
am: /^a/i,
|
|
1544
|
+
pm: /^p/i,
|
|
1545
|
+
midnight: /^min/i,
|
|
1546
|
+
noon: /^mid/i,
|
|
1547
|
+
morning: /mat/i,
|
|
1548
|
+
afternoon: /ap/i,
|
|
1549
|
+
evening: /soir/i,
|
|
1550
|
+
night: /nuit/i
|
|
1551
|
+
}
|
|
1552
|
+
}, On = {
|
|
1553
|
+
ordinalNumber: ie({
|
|
1554
|
+
matchPattern: hn,
|
|
1555
|
+
parsePattern: fn,
|
|
1556
|
+
valueCallback: (t) => parseInt(t)
|
|
1557
|
+
}),
|
|
1558
|
+
era: p({
|
|
1559
|
+
matchPatterns: gn,
|
|
1560
|
+
defaultMatchWidth: "wide",
|
|
1561
|
+
parsePatterns: wn,
|
|
1562
|
+
defaultParseWidth: "any"
|
|
1563
|
+
}),
|
|
1564
|
+
quarter: p({
|
|
1565
|
+
matchPatterns: yn,
|
|
1566
|
+
defaultMatchWidth: "wide",
|
|
1567
|
+
parsePatterns: bn,
|
|
1568
|
+
defaultParseWidth: "any",
|
|
1569
|
+
valueCallback: (t) => t + 1
|
|
1570
|
+
}),
|
|
1571
|
+
month: p({
|
|
1572
|
+
matchPatterns: vn,
|
|
1573
|
+
defaultMatchWidth: "wide",
|
|
1574
|
+
parsePatterns: Mn,
|
|
1575
|
+
defaultParseWidth: "any"
|
|
1576
|
+
}),
|
|
1577
|
+
day: p({
|
|
1578
|
+
matchPatterns: Pn,
|
|
1579
|
+
defaultMatchWidth: "wide",
|
|
1580
|
+
parsePatterns: pn,
|
|
1581
|
+
defaultParseWidth: "any"
|
|
1582
|
+
}),
|
|
1583
|
+
dayPeriod: p({
|
|
1584
|
+
matchPatterns: Dn,
|
|
1585
|
+
defaultMatchWidth: "any",
|
|
1586
|
+
parsePatterns: kn,
|
|
1587
|
+
defaultParseWidth: "any"
|
|
1588
|
+
})
|
|
1589
|
+
}, Wn = {
|
|
1590
|
+
code: "fr",
|
|
1591
|
+
formatDistance: Zt,
|
|
1592
|
+
formatLong: tn,
|
|
1593
|
+
formatRelative: an,
|
|
1594
|
+
localize: mn,
|
|
1595
|
+
match: On,
|
|
1596
|
+
options: {
|
|
1597
|
+
weekStartsOn: 1,
|
|
1598
|
+
firstWeekContainsDate: 4
|
|
1599
|
+
}
|
|
1600
|
+
}, _n = ({ selectRange: t = !1, selectedDate: e, onDateSelect: n }) => {
|
|
1601
|
+
const [a, r] = k(() => t && e && "start" in e ? e.start : /* @__PURE__ */ new Date()), [i, o] = k(e || null), [d, h] = k(!1), [f, b] = k(null), [M, W] = k([]), [x, j] = k(!1), [q, E] = k((/* @__PURE__ */ new Date()).getFullYear()), F = 1900, l = G(null), g = G(null), C = /* @__PURE__ */ new Date(), V = Qe(a), ce = Ve(a), ue = _(V, { weekStartsOn: 1 }), de = Ge(ce, { weekStartsOn: 1 }), [J, le] = k(null);
|
|
1602
|
+
X(() => {
|
|
1603
|
+
o(e || null), t && e && "start" in e ? r(e.start) : !t && e instanceof Date && r(e);
|
|
1283
1604
|
}, [e, t]);
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1286
|
-
},
|
|
1605
|
+
const Q = (s) => {
|
|
1606
|
+
r((u) => s > 0 ? ne(u, 1) : It(u, 1));
|
|
1607
|
+
}, me = (s) => {
|
|
1287
1608
|
if (t)
|
|
1288
|
-
if (
|
|
1289
|
-
|
|
1290
|
-
else if (!
|
|
1291
|
-
|
|
1609
|
+
if (J !== null && s)
|
|
1610
|
+
i && typeof i == "object" && "start" in i && "end" in i && (J === i.start ? s < i.start ? o({ start: s, end: i.start }) : o({ start: i.start, end: s }) : J === i.end && (s > i.end ? o({ start: i.end, end: s }) : o({ start: s, end: i.end })));
|
|
1611
|
+
else if (!i || !(typeof i == "object" && "start" in i))
|
|
1612
|
+
o({ start: s, end: s });
|
|
1292
1613
|
else {
|
|
1293
|
-
const { start:
|
|
1294
|
-
|
|
1614
|
+
const { start: u } = i;
|
|
1615
|
+
s < u ? o({ start: s, end: u }) : o({ start: u, end: s });
|
|
1295
1616
|
}
|
|
1296
1617
|
else
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
t ?
|
|
1618
|
+
o(s);
|
|
1619
|
+
le(s), n(
|
|
1620
|
+
t ? i : s
|
|
1300
1621
|
);
|
|
1301
|
-
},
|
|
1302
|
-
|
|
1303
|
-
|
|
1622
|
+
}, he = () => h((s) => !s);
|
|
1623
|
+
X(() => {
|
|
1624
|
+
B();
|
|
1304
1625
|
}, []);
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1307
|
-
const
|
|
1308
|
-
let
|
|
1309
|
-
for (let
|
|
1310
|
-
|
|
1311
|
-
|
|
1626
|
+
const B = () => {
|
|
1627
|
+
x || (j(!0), setTimeout(() => {
|
|
1628
|
+
const s = [];
|
|
1629
|
+
let u = q;
|
|
1630
|
+
for (let w = 0; w < 10 && !(u < F); w++)
|
|
1631
|
+
s.push(u), u -= 1;
|
|
1632
|
+
s.length > 0 && (W((w) => [...w, ...s]), E(u)), j(!1);
|
|
1312
1633
|
}, 500));
|
|
1313
1634
|
};
|
|
1314
|
-
|
|
1315
|
-
if (
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1635
|
+
X(() => {
|
|
1636
|
+
if (d && f && l.current) {
|
|
1637
|
+
const s = l.current.querySelector(`[data-year="${f}"]`);
|
|
1638
|
+
s && l.current && (l.current.scrollTop = s.offsetTop - l.current.offsetTop);
|
|
1318
1639
|
}
|
|
1319
|
-
}, [
|
|
1320
|
-
const
|
|
1321
|
-
let
|
|
1322
|
-
for (;
|
|
1323
|
-
|
|
1324
|
-
return
|
|
1325
|
-
const
|
|
1326
|
-
return /* @__PURE__ */
|
|
1640
|
+
}, [d, f]);
|
|
1641
|
+
const fe = () => ["Lu", "Ma", "Me", "Je", "Ve", "Sa", "Di"].map((u, w) => /* @__PURE__ */ y("div", { className: v.calendarWeekdays, children: u }, w)), ge = () => {
|
|
1642
|
+
let s = [], u = ue;
|
|
1643
|
+
for (; u <= de; )
|
|
1644
|
+
s.push(u), u = Le(u, 1);
|
|
1645
|
+
return s.map((w, ve) => {
|
|
1646
|
+
const R = i && typeof i == "object" && "start" in i && "end" in i, Me = R && L(w, i.start), Pe = R && L(w, i.end), pe = R && Qt(w, i.start) && Bt(w, i.end);
|
|
1647
|
+
return /* @__PURE__ */ y(
|
|
1327
1648
|
"div",
|
|
1328
1649
|
{
|
|
1329
1650
|
className: `
|
|
1330
|
-
${
|
|
1331
|
-
${
|
|
1332
|
-
${
|
|
1333
|
-
${
|
|
1334
|
-
${
|
|
1335
|
-
${
|
|
1651
|
+
${v.calendarDay}
|
|
1652
|
+
${L(w, C) ? v.today : ""}
|
|
1653
|
+
${i && L(w, i) ? v.selected : ""}
|
|
1654
|
+
${Me || Pe ? v.selected : ""} // Applique 'selected' si start ou end
|
|
1655
|
+
${pe ? v.inRange : ""} // Applique 'inRange' si la date est entre start et end
|
|
1656
|
+
${Gt(w, V) ? "" : v.disabled}
|
|
1336
1657
|
`,
|
|
1337
|
-
onClick: () =>
|
|
1338
|
-
children: te(
|
|
1658
|
+
onClick: () => me(w),
|
|
1659
|
+
children: te(w, "d")
|
|
1339
1660
|
},
|
|
1340
|
-
|
|
1661
|
+
ve
|
|
1341
1662
|
);
|
|
1342
1663
|
});
|
|
1343
|
-
},
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
},
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1664
|
+
}, we = (s) => {
|
|
1665
|
+
const u = s.currentTarget;
|
|
1666
|
+
u.scrollHeight === u.scrollTop + u.clientHeight && B();
|
|
1667
|
+
}, ye = () => {
|
|
1668
|
+
const s = (u) => {
|
|
1669
|
+
l.current && !l.current.contains(u.target) && g.current && !g.current.contains(u.target) && h(!1);
|
|
1349
1670
|
};
|
|
1350
|
-
return document.addEventListener("click",
|
|
1351
|
-
document.removeEventListener("click",
|
|
1671
|
+
return document.addEventListener("click", s), () => {
|
|
1672
|
+
document.removeEventListener("click", s);
|
|
1352
1673
|
};
|
|
1674
|
+
}, be = (s) => {
|
|
1675
|
+
const u = te(s, "MMMM yyyy", { locale: Wn });
|
|
1676
|
+
return u.charAt(0).toUpperCase() + u.slice(1);
|
|
1353
1677
|
};
|
|
1354
|
-
return /* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
/* @__PURE__ */
|
|
1358
|
-
/* @__PURE__ */
|
|
1678
|
+
return /* @__PURE__ */ N("div", { className: v.calendar, onClick: ye, children: [
|
|
1679
|
+
/* @__PURE__ */ N("div", { className: `${v.calendarHeader}`, children: [
|
|
1680
|
+
/* @__PURE__ */ y(I, { size: "s", mode: "ghost", onClick: () => Q(-1), children: /* @__PURE__ */ N("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: [
|
|
1681
|
+
/* @__PURE__ */ y("path", { d: "M160,48V208L80,128Z", opacity: "0.2" }),
|
|
1682
|
+
/* @__PURE__ */ y("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" })
|
|
1359
1683
|
] }) }),
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
|
|
1684
|
+
/* @__PURE__ */ N("div", { ref: g, className: v.relative, children: [
|
|
1685
|
+
/* @__PURE__ */ y(
|
|
1686
|
+
De,
|
|
1363
1687
|
{
|
|
1364
1688
|
size: "s",
|
|
1365
1689
|
mode: "tertiary",
|
|
1366
|
-
label:
|
|
1367
|
-
onClick:
|
|
1368
|
-
childrenRight:
|
|
1690
|
+
label: be(a),
|
|
1691
|
+
onClick: he,
|
|
1692
|
+
childrenRight: d ? /* @__PURE__ */ y("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ y("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__ */ y("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ y("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" }) })
|
|
1369
1693
|
}
|
|
1370
1694
|
),
|
|
1371
|
-
|
|
1695
|
+
d && /* @__PURE__ */ y("div", { className: v.dropdown, children: /* @__PURE__ */ y(
|
|
1372
1696
|
"div",
|
|
1373
1697
|
{
|
|
1374
|
-
ref:
|
|
1375
|
-
className:
|
|
1376
|
-
onScroll: (
|
|
1377
|
-
children:
|
|
1698
|
+
ref: l,
|
|
1699
|
+
className: v.yearList,
|
|
1700
|
+
onScroll: (s) => we(s),
|
|
1701
|
+
children: M.map((s) => /* @__PURE__ */ y(
|
|
1378
1702
|
"div",
|
|
1379
1703
|
{
|
|
1380
|
-
"data-year":
|
|
1381
|
-
className:
|
|
1704
|
+
"data-year": s,
|
|
1705
|
+
className: v.yearItem,
|
|
1382
1706
|
onClick: () => {
|
|
1383
|
-
b(
|
|
1707
|
+
b(s), r(new Date(s, a.getMonth())), h(!1);
|
|
1384
1708
|
},
|
|
1385
|
-
children:
|
|
1709
|
+
children: s
|
|
1386
1710
|
},
|
|
1387
|
-
|
|
1711
|
+
s
|
|
1388
1712
|
))
|
|
1389
1713
|
}
|
|
1390
1714
|
) })
|
|
1391
1715
|
] }),
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
/* @__PURE__ */
|
|
1394
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ y(I, { size: "s", mode: "ghost", onClick: () => Q(1), children: /* @__PURE__ */ N("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: [
|
|
1717
|
+
/* @__PURE__ */ y("path", { d: "M176,128,96,208V48Z", opacity: "0.2" }),
|
|
1718
|
+
/* @__PURE__ */ y("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" })
|
|
1395
1719
|
] }) })
|
|
1396
1720
|
] }),
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
/* @__PURE__ */
|
|
1721
|
+
/* @__PURE__ */ y("div", { className: `${v.calendarWeekdays} labelSmall`, children: fe() }),
|
|
1722
|
+
/* @__PURE__ */ y("div", { className: `${v.calendarGrid} textSmall`, children: ge() })
|
|
1399
1723
|
] });
|
|
1400
1724
|
};
|
|
1401
1725
|
export {
|
|
1402
|
-
|
|
1726
|
+
_n as Calendar
|
|
1403
1727
|
};
|