@abgov/react-components 6.10.0-next.1 → 6.11.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/experimental/badge/badge.d.ts +33 -0
- package/experimental/button/button.d.ts +43 -0
- package/experimental/calendar/calendar.d.ts +30 -0
- package/experimental/callout/callout.d.ts +33 -0
- package/experimental/checkbox/checkbox.d.ts +52 -0
- package/experimental/date-picker/date-picker.d.ts +43 -0
- package/experimental/drawer/drawer.d.ts +31 -0
- package/experimental/dropdown/dropdown-item.d.ts +26 -0
- package/experimental/dropdown/dropdown.d.ts +62 -0
- package/experimental/file-upload-card/file-upload-card.d.ts +32 -0
- package/experimental/file-upload-input/file-upload-input.d.ts +27 -0
- package/experimental/filter-chip/filter-chip.d.ts +31 -0
- package/experimental/footer/footer.d.ts +24 -0
- package/experimental/footer-meta-section/footer-meta-section.d.ts +18 -0
- package/experimental/footer-nav-section/footer-nav-section.d.ts +22 -0
- package/experimental/form-item/form-item.d.ts +46 -0
- package/experimental/index.d.ts +30 -2
- package/experimental/input/input.d.ts +124 -0
- package/experimental/link/link.d.ts +32 -0
- package/experimental/modal/modal.d.ts +44 -0
- package/experimental/notification/notification.d.ts +31 -0
- package/experimental/pagination/pagination.d.ts +29 -0
- package/experimental/radio-group/radio-group.d.ts +40 -0
- package/experimental/radio-group/radio.d.ts +42 -0
- package/experimental/side-menu/side-menu.d.ts +19 -0
- package/experimental/side-menu-group/side-menu-group.d.ts +24 -0
- package/experimental/side-menu-heading/side-menu-heading.d.ts +23 -0
- package/experimental/table/table-sort-header.d.ts +20 -0
- package/experimental/table/table.d.ts +30 -0
- package/experimental/tabs/tabs.d.ts +27 -0
- package/experimental/textarea/textarea.d.ts +53 -0
- package/experimental/work-side-menu-group/work-side-menu-group.d.ts +22 -0
- package/experimental.js +1160 -64
- package/experimental.js.map +1 -1
- package/experimental.mjs +1163 -68
- package/experimental.mjs.map +1 -1
- package/index.js +139 -1753
- package/index.js.map +1 -1
- package/index.mjs +68 -1683
- package/index.mjs.map +1 -1
- package/lib/badge/badge.d.ts +0 -16
- package/lib/button/button.d.ts +0 -22
- package/lib/calendar/calendar.d.ts +0 -16
- package/lib/callout/callout.d.ts +0 -16
- package/lib/checkbox/checkbox.d.ts +0 -25
- package/lib/date-picker/date-picker.d.ts +0 -21
- package/lib/drawer/drawer.d.ts +0 -15
- package/lib/dropdown/dropdown-item.d.ts +0 -15
- package/lib/dropdown/dropdown.d.ts +0 -29
- package/lib/file-upload-card/file-upload-card.d.ts +0 -17
- package/lib/file-upload-input/file-upload-input.d.ts +0 -15
- package/lib/filter-chip/filter-chip.d.ts +0 -15
- package/lib/footer/footer.d.ts +0 -12
- package/lib/footer-meta-section/footer-meta-section.d.ts +0 -10
- package/lib/footer-nav-section/footer-nav-section.d.ts +0 -12
- package/lib/form-item/form-item.d.ts +0 -19
- package/lib/input/input.d.ts +0 -38
- package/lib/link/link.d.ts +0 -15
- package/lib/modal/modal.d.ts +1 -23
- package/lib/notification/notification.d.ts +0 -14
- package/lib/pagination/pagination.d.ts +0 -15
- package/lib/radio-group/radio-group.d.ts +0 -19
- package/lib/radio-group/radio.d.ts +0 -20
- package/lib/side-menu/side-menu.d.ts +0 -10
- package/lib/side-menu-group/side-menu-group.d.ts +0 -12
- package/lib/side-menu-heading/side-menu-heading.d.ts +0 -11
- package/lib/tab/tab.d.ts +3 -1
- package/lib/table/table-sort-header.d.ts +0 -11
- package/lib/table/table.d.ts +0 -14
- package/lib/tabs/tabs.d.ts +0 -14
- package/lib/textarea/textarea.d.ts +0 -25
- package/package.json +1 -1
- package/parseISO-BHUUf1QW.mjs +1693 -0
- package/parseISO-BHUUf1QW.mjs.map +1 -0
- package/parseISO-Dj57mwuH.js +1692 -0
- package/parseISO-Dj57mwuH.js.map +1 -0
- package/experimental/form/form-summary.d.ts +0 -10
- package/experimental/form/form.d.ts +0 -23
- package/experimental/resizable-panel/ResizablePanel.d.ts +0 -7
- package/icon-B3p90m2x.js +0 -75
- package/icon-B3p90m2x.js.map +0 -1
- package/icon-CCNDGfBO.mjs +0 -76
- package/icon-CCNDGfBO.mjs.map +0 -1
- package/style.css +0 -49
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var _PublicFormController_instances, updateObjectListState_fn, dispatchError_fn;
|
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
13
13
|
const jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
const react = require("react");
|
|
15
|
-
const
|
|
15
|
+
const parseISO = require("./parseISO-Dj57mwuH.js");
|
|
16
16
|
function GoabAccordion({
|
|
17
17
|
open,
|
|
18
18
|
onChange,
|
|
@@ -21,7 +21,7 @@ function GoabAccordion({
|
|
|
21
21
|
...rest
|
|
22
22
|
}) {
|
|
23
23
|
const ref = react.useRef(null);
|
|
24
|
-
const _props =
|
|
24
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
25
25
|
react.useEffect(() => {
|
|
26
26
|
const element = ref.current;
|
|
27
27
|
if (element && onChange) {
|
|
@@ -54,7 +54,7 @@ function GoabAppHeader({
|
|
|
54
54
|
...rest
|
|
55
55
|
}) {
|
|
56
56
|
const el = react.useRef(null);
|
|
57
|
-
const _props =
|
|
57
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
58
58
|
react.useEffect(() => {
|
|
59
59
|
if (!el.current) {
|
|
60
60
|
return;
|
|
@@ -85,25 +85,21 @@ function GoabAppHeaderMenu({
|
|
|
85
85
|
children,
|
|
86
86
|
...rest
|
|
87
87
|
}) {
|
|
88
|
-
const _props =
|
|
88
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
89
89
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-app-header-menu", { ..._props, children });
|
|
90
90
|
}
|
|
91
|
-
function getIconValue(
|
|
92
|
-
if (
|
|
93
|
-
return
|
|
91
|
+
function getIconValue(icon, iconType) {
|
|
92
|
+
if (icon !== void 0) {
|
|
93
|
+
return icon ? "true" : "false";
|
|
94
94
|
}
|
|
95
95
|
return iconType ? "true" : "false";
|
|
96
96
|
}
|
|
97
|
-
function GoabBadge({
|
|
98
|
-
|
|
99
|
-
iconType,
|
|
100
|
-
...rest
|
|
101
|
-
}) {
|
|
102
|
-
const _props = icon.transformProps(rest, icon.lowercase);
|
|
97
|
+
function GoabBadge({ icon, iconType, ...rest }) {
|
|
98
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
103
99
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
100
|
"goa-badge",
|
|
105
101
|
{
|
|
106
|
-
icon: getIconValue(icon
|
|
102
|
+
icon: getIconValue(icon, iconType),
|
|
107
103
|
icontype: iconType,
|
|
108
104
|
..._props
|
|
109
105
|
}
|
|
@@ -112,7 +108,7 @@ function GoabBadge({
|
|
|
112
108
|
function GoabInfoBadge({
|
|
113
109
|
content,
|
|
114
110
|
testId,
|
|
115
|
-
icon
|
|
111
|
+
icon,
|
|
116
112
|
mt,
|
|
117
113
|
mr,
|
|
118
114
|
mb,
|
|
@@ -123,7 +119,7 @@ function GoabInfoBadge({
|
|
|
123
119
|
GoabBadge,
|
|
124
120
|
{
|
|
125
121
|
type: "information",
|
|
126
|
-
icon
|
|
122
|
+
icon,
|
|
127
123
|
content,
|
|
128
124
|
testId,
|
|
129
125
|
ariaLabel,
|
|
@@ -137,7 +133,7 @@ function GoabInfoBadge({
|
|
|
137
133
|
function GoabSuccessBadge({
|
|
138
134
|
content,
|
|
139
135
|
testId,
|
|
140
|
-
icon
|
|
136
|
+
icon,
|
|
141
137
|
mt,
|
|
142
138
|
mr,
|
|
143
139
|
mb,
|
|
@@ -148,7 +144,7 @@ function GoabSuccessBadge({
|
|
|
148
144
|
GoabBadge,
|
|
149
145
|
{
|
|
150
146
|
type: "success",
|
|
151
|
-
icon
|
|
147
|
+
icon,
|
|
152
148
|
content,
|
|
153
149
|
ariaLabel,
|
|
154
150
|
testId,
|
|
@@ -162,7 +158,7 @@ function GoabSuccessBadge({
|
|
|
162
158
|
function GoabImportantBadge({
|
|
163
159
|
content,
|
|
164
160
|
testId,
|
|
165
|
-
icon
|
|
161
|
+
icon,
|
|
166
162
|
mt,
|
|
167
163
|
mr,
|
|
168
164
|
mb,
|
|
@@ -173,7 +169,7 @@ function GoabImportantBadge({
|
|
|
173
169
|
GoabBadge,
|
|
174
170
|
{
|
|
175
171
|
type: "important",
|
|
176
|
-
icon
|
|
172
|
+
icon,
|
|
177
173
|
content,
|
|
178
174
|
testId,
|
|
179
175
|
ariaLabel,
|
|
@@ -187,7 +183,7 @@ function GoabImportantBadge({
|
|
|
187
183
|
function GoabEmergencyBadge({
|
|
188
184
|
content,
|
|
189
185
|
testId,
|
|
190
|
-
icon
|
|
186
|
+
icon,
|
|
191
187
|
mt,
|
|
192
188
|
mr,
|
|
193
189
|
mb,
|
|
@@ -198,7 +194,7 @@ function GoabEmergencyBadge({
|
|
|
198
194
|
GoabBadge,
|
|
199
195
|
{
|
|
200
196
|
type: "emergency",
|
|
201
|
-
icon
|
|
197
|
+
icon,
|
|
202
198
|
content,
|
|
203
199
|
testId,
|
|
204
200
|
ariaLabel,
|
|
@@ -214,9 +210,9 @@ function GoabBlock({
|
|
|
214
210
|
children,
|
|
215
211
|
...rest
|
|
216
212
|
}) {
|
|
217
|
-
const _props =
|
|
213
|
+
const _props = parseISO.transformProps(
|
|
218
214
|
{ testid: testId, ...rest },
|
|
219
|
-
|
|
215
|
+
parseISO.kebab
|
|
220
216
|
);
|
|
221
217
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-block", { ..._props, children });
|
|
222
218
|
}
|
|
@@ -229,7 +225,7 @@ function GoabButton({
|
|
|
229
225
|
...rest
|
|
230
226
|
}) {
|
|
231
227
|
const el = react.useRef(null);
|
|
232
|
-
const _props =
|
|
228
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
233
229
|
react.useEffect(() => {
|
|
234
230
|
if (!el.current) {
|
|
235
231
|
return;
|
|
@@ -262,7 +258,7 @@ function GoabButtonGroup({
|
|
|
262
258
|
children,
|
|
263
259
|
...rest
|
|
264
260
|
}) {
|
|
265
|
-
const _props =
|
|
261
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
266
262
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-button-group", { ..._props, children });
|
|
267
263
|
}
|
|
268
264
|
function GoabCalendar({
|
|
@@ -273,7 +269,7 @@ function GoabCalendar({
|
|
|
273
269
|
...rest
|
|
274
270
|
}) {
|
|
275
271
|
const ref = react.useRef(null);
|
|
276
|
-
const _props =
|
|
272
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
277
273
|
react.useEffect(() => {
|
|
278
274
|
if (!ref.current) {
|
|
279
275
|
return;
|
|
@@ -309,9 +305,9 @@ const GoabCallout = ({
|
|
|
309
305
|
children,
|
|
310
306
|
...rest
|
|
311
307
|
}) => {
|
|
312
|
-
const _props =
|
|
308
|
+
const _props = parseISO.transformProps(
|
|
313
309
|
{ type, icontheme: iconTheme, size, arialive: ariaLive, ...rest },
|
|
314
|
-
|
|
310
|
+
parseISO.lowercase
|
|
315
311
|
);
|
|
316
312
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-callout", { ..._props, children });
|
|
317
313
|
};
|
|
@@ -329,7 +325,7 @@ function GoabCheckbox({
|
|
|
329
325
|
...rest
|
|
330
326
|
}) {
|
|
331
327
|
const el = react.useRef(null);
|
|
332
|
-
const _props =
|
|
328
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
333
329
|
react.useEffect(() => {
|
|
334
330
|
if (!el.current) {
|
|
335
331
|
return;
|
|
@@ -428,7 +424,7 @@ const GoabChip = ({
|
|
|
428
424
|
...rest
|
|
429
425
|
}) => {
|
|
430
426
|
const el = react.useRef(null);
|
|
431
|
-
const _props =
|
|
427
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
432
428
|
react.useEffect(() => {
|
|
433
429
|
if (!el.current) return;
|
|
434
430
|
if (!onClick) return;
|
|
@@ -453,7 +449,7 @@ const GoabChip = ({
|
|
|
453
449
|
};
|
|
454
450
|
const GoabCircularProgress = ({
|
|
455
451
|
visible,
|
|
456
|
-
message
|
|
452
|
+
message,
|
|
457
453
|
progress,
|
|
458
454
|
variant,
|
|
459
455
|
size,
|
|
@@ -463,7 +459,7 @@ const GoabCircularProgress = ({
|
|
|
463
459
|
"goa-circular-progress",
|
|
464
460
|
{
|
|
465
461
|
visible: visible ? "true" : void 0,
|
|
466
|
-
message
|
|
462
|
+
message,
|
|
467
463
|
progress,
|
|
468
464
|
variant,
|
|
469
465
|
size,
|
|
@@ -478,7 +474,7 @@ function GoabContainer({
|
|
|
478
474
|
children,
|
|
479
475
|
...rest
|
|
480
476
|
}) {
|
|
481
|
-
const _props =
|
|
477
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
482
478
|
const headingContent = heading || title;
|
|
483
479
|
return /* @__PURE__ */ jsxRuntime.jsxs("goa-container", { ..._props, children: [
|
|
484
480
|
headingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "title", children: headingContent }),
|
|
@@ -513,7 +509,7 @@ function GoabDatePicker({
|
|
|
513
509
|
...rest
|
|
514
510
|
}) {
|
|
515
511
|
const ref = react.useRef(null);
|
|
516
|
-
const _props =
|
|
512
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
517
513
|
react.useEffect(() => {
|
|
518
514
|
if (value && typeof value !== "string") {
|
|
519
515
|
console.warn("Using a `Date` type for value is deprecated. Instead use a string of the format `yyyy-mm-dd`");
|
|
@@ -563,7 +559,7 @@ function GoabDetails({
|
|
|
563
559
|
children,
|
|
564
560
|
...rest
|
|
565
561
|
}) {
|
|
566
|
-
const _props =
|
|
562
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
567
563
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
568
564
|
"goa-details",
|
|
569
565
|
{
|
|
@@ -585,6 +581,45 @@ function GoabDivider(props) {
|
|
|
585
581
|
}
|
|
586
582
|
);
|
|
587
583
|
}
|
|
584
|
+
function GoabDrawer({
|
|
585
|
+
position,
|
|
586
|
+
open,
|
|
587
|
+
heading,
|
|
588
|
+
maxSize,
|
|
589
|
+
testId,
|
|
590
|
+
actions,
|
|
591
|
+
children,
|
|
592
|
+
onClose
|
|
593
|
+
}) {
|
|
594
|
+
const el = react.useRef(null);
|
|
595
|
+
react.useEffect(() => {
|
|
596
|
+
var _a;
|
|
597
|
+
if (!(el == null ? void 0 : el.current) || !onClose) {
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
(_a = el.current) == null ? void 0 : _a.addEventListener("_close", onClose);
|
|
601
|
+
return () => {
|
|
602
|
+
var _a2;
|
|
603
|
+
(_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_close", onClose);
|
|
604
|
+
};
|
|
605
|
+
}, [el, onClose]);
|
|
606
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
607
|
+
"goa-drawer",
|
|
608
|
+
{
|
|
609
|
+
ref: el,
|
|
610
|
+
position,
|
|
611
|
+
open: open ? true : void 0,
|
|
612
|
+
heading: typeof heading === "string" ? heading : void 0,
|
|
613
|
+
maxsize: maxSize,
|
|
614
|
+
testid: testId,
|
|
615
|
+
children: [
|
|
616
|
+
heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
|
|
617
|
+
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
|
|
618
|
+
children
|
|
619
|
+
]
|
|
620
|
+
}
|
|
621
|
+
);
|
|
622
|
+
}
|
|
588
623
|
function stringify(value) {
|
|
589
624
|
if (typeof value === "undefined") {
|
|
590
625
|
return "";
|
|
@@ -607,7 +642,7 @@ function GoabDropdown({
|
|
|
607
642
|
...rest
|
|
608
643
|
}) {
|
|
609
644
|
const el = react.useRef(null);
|
|
610
|
-
const _props =
|
|
645
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
611
646
|
react.useEffect(() => {
|
|
612
647
|
if (!el.current) {
|
|
613
648
|
return;
|
|
@@ -673,7 +708,7 @@ function GoabFileUploadCard({
|
|
|
673
708
|
...rest
|
|
674
709
|
}) {
|
|
675
710
|
const el = react.useRef(null);
|
|
676
|
-
const _props =
|
|
711
|
+
const _props = parseISO.transformProps({ filename, ...rest }, parseISO.lowercase);
|
|
677
712
|
react.useEffect(() => {
|
|
678
713
|
if (!el.current) return;
|
|
679
714
|
const current = el.current;
|
|
@@ -693,7 +728,7 @@ function GoabFileUploadInput({
|
|
|
693
728
|
...rest
|
|
694
729
|
}) {
|
|
695
730
|
const el = react.useRef(null);
|
|
696
|
-
const _props =
|
|
731
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
697
732
|
react.useEffect(() => {
|
|
698
733
|
if (!el.current) return;
|
|
699
734
|
const current = el.current;
|
|
@@ -712,21 +747,21 @@ function GoabAppFooter({
|
|
|
712
747
|
children,
|
|
713
748
|
...rest
|
|
714
749
|
}) {
|
|
715
|
-
const _props =
|
|
750
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
716
751
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer", { ..._props, children });
|
|
717
752
|
}
|
|
718
753
|
function GoabAppFooterMetaSection({
|
|
719
754
|
children,
|
|
720
755
|
...rest
|
|
721
756
|
}) {
|
|
722
|
-
const _props =
|
|
757
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
723
758
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer-meta-section", { slot: "meta", ..._props, children });
|
|
724
759
|
}
|
|
725
760
|
function GoabAppFooterNavSection({
|
|
726
761
|
children,
|
|
727
762
|
...rest
|
|
728
763
|
}) {
|
|
729
|
-
const _props =
|
|
764
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
730
765
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer-nav-section", { slot: "nav", ..._props, children });
|
|
731
766
|
}
|
|
732
767
|
function GoabFieldset({
|
|
@@ -735,7 +770,7 @@ function GoabFieldset({
|
|
|
735
770
|
...rest
|
|
736
771
|
}) {
|
|
737
772
|
const ref = react.useRef(null);
|
|
738
|
-
const _props =
|
|
773
|
+
const _props = parseISO.transformProps(rest, parseISO.kebab);
|
|
739
774
|
react.useEffect(() => {
|
|
740
775
|
if (!ref.current) return;
|
|
741
776
|
const current = ref.current;
|
|
@@ -760,7 +795,7 @@ function GoabPublicFormPage({
|
|
|
760
795
|
...rest
|
|
761
796
|
}) {
|
|
762
797
|
const ref = react.useRef(null);
|
|
763
|
-
const _props =
|
|
798
|
+
const _props = parseISO.transformProps(rest, parseISO.kebab);
|
|
764
799
|
react.useEffect(() => {
|
|
765
800
|
if (!ref.current) return;
|
|
766
801
|
const current = ref.current;
|
|
@@ -782,9 +817,9 @@ function GoabPublicFormSummary({
|
|
|
782
817
|
heading = "",
|
|
783
818
|
...rest
|
|
784
819
|
}) {
|
|
785
|
-
const _props =
|
|
820
|
+
const _props = parseISO.transformProps(
|
|
786
821
|
{ heading, ...rest },
|
|
787
|
-
|
|
822
|
+
parseISO.lowercase
|
|
788
823
|
);
|
|
789
824
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-summary", { ..._props });
|
|
790
825
|
}
|
|
@@ -797,7 +832,7 @@ function GoabPublicForm({
|
|
|
797
832
|
}) {
|
|
798
833
|
const ref = react.useRef(null);
|
|
799
834
|
const initialized = react.useRef(false);
|
|
800
|
-
const _props =
|
|
835
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
801
836
|
react.useLayoutEffect(() => {
|
|
802
837
|
if (!ref.current) return;
|
|
803
838
|
const current = ref.current;
|
|
@@ -845,9 +880,9 @@ function GoabPublicSubform({
|
|
|
845
880
|
...rest
|
|
846
881
|
}) {
|
|
847
882
|
const ref = react.useRef(null);
|
|
848
|
-
const _props =
|
|
883
|
+
const _props = parseISO.transformProps(
|
|
849
884
|
{ id, name, "continue-msg": continueMsg, ...rest },
|
|
850
|
-
|
|
885
|
+
parseISO.kebab
|
|
851
886
|
);
|
|
852
887
|
react.useEffect(() => {
|
|
853
888
|
if (!ref.current) return;
|
|
@@ -883,9 +918,9 @@ function GoabPublicSubformIndex({
|
|
|
883
918
|
children,
|
|
884
919
|
...rest
|
|
885
920
|
}) {
|
|
886
|
-
const _props =
|
|
921
|
+
const _props = parseISO.transformProps(
|
|
887
922
|
{ heading, "section-title": sectionTitle, "action-button-text": actionButtonText, "button-visibility": buttonVisibility, ...rest },
|
|
888
|
-
|
|
923
|
+
parseISO.kebab
|
|
889
924
|
);
|
|
890
925
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-public-subform-index", { slot: "subform-index", ..._props, children });
|
|
891
926
|
}
|
|
@@ -894,9 +929,9 @@ function GoabPublicFormTask({
|
|
|
894
929
|
children,
|
|
895
930
|
...rest
|
|
896
931
|
}) {
|
|
897
|
-
const _props =
|
|
932
|
+
const _props = parseISO.transformProps(
|
|
898
933
|
{ status, ...rest },
|
|
899
|
-
|
|
934
|
+
parseISO.lowercase
|
|
900
935
|
);
|
|
901
936
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-task", { ..._props, children });
|
|
902
937
|
}
|
|
@@ -904,7 +939,7 @@ function GoabPublicFormTaskList({
|
|
|
904
939
|
children,
|
|
905
940
|
...rest
|
|
906
941
|
}) {
|
|
907
|
-
const _props =
|
|
942
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
908
943
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-task-list", { ..._props, children });
|
|
909
944
|
}
|
|
910
945
|
function GoabFormItem({
|
|
@@ -914,7 +949,7 @@ function GoabFormItem({
|
|
|
914
949
|
children,
|
|
915
950
|
...rest
|
|
916
951
|
}) {
|
|
917
|
-
const _props =
|
|
952
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
918
953
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
919
954
|
"goa-form-item",
|
|
920
955
|
{
|
|
@@ -1036,9 +1071,9 @@ function GoabIconButton({
|
|
|
1036
1071
|
...rest
|
|
1037
1072
|
}) {
|
|
1038
1073
|
const ref = react.useRef(null);
|
|
1039
|
-
const _props =
|
|
1074
|
+
const _props = parseISO.transformProps(
|
|
1040
1075
|
{ variant, size, ...rest },
|
|
1041
|
-
|
|
1076
|
+
parseISO.lowercase
|
|
1042
1077
|
);
|
|
1043
1078
|
react.useEffect(() => {
|
|
1044
1079
|
if (!ref.current) {
|
|
@@ -1068,1675 +1103,18 @@ function GoabIconButton({
|
|
|
1068
1103
|
}
|
|
1069
1104
|
);
|
|
1070
1105
|
}
|
|
1071
|
-
function
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
function constructFrom(date, value) {
|
|
1082
|
-
if (date instanceof Date) {
|
|
1083
|
-
return new date.constructor(value);
|
|
1084
|
-
} else {
|
|
1085
|
-
return new Date(value);
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
const millisecondsInWeek = 6048e5;
|
|
1089
|
-
const millisecondsInDay = 864e5;
|
|
1090
|
-
const millisecondsInMinute = 6e4;
|
|
1091
|
-
const millisecondsInHour = 36e5;
|
|
1092
|
-
let defaultOptions = {};
|
|
1093
|
-
function getDefaultOptions() {
|
|
1094
|
-
return defaultOptions;
|
|
1095
|
-
}
|
|
1096
|
-
function startOfWeek(date, options) {
|
|
1097
|
-
var _a, _b, _c, _d;
|
|
1098
|
-
const defaultOptions2 = getDefaultOptions();
|
|
1099
|
-
const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0;
|
|
1100
|
-
const _date = toDate(date);
|
|
1101
|
-
const day = _date.getDay();
|
|
1102
|
-
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
1103
|
-
_date.setDate(_date.getDate() - diff);
|
|
1104
|
-
_date.setHours(0, 0, 0, 0);
|
|
1105
|
-
return _date;
|
|
1106
|
-
}
|
|
1107
|
-
function startOfISOWeek(date) {
|
|
1108
|
-
return startOfWeek(date, { weekStartsOn: 1 });
|
|
1109
|
-
}
|
|
1110
|
-
function getISOWeekYear(date) {
|
|
1111
|
-
const _date = toDate(date);
|
|
1112
|
-
const year = _date.getFullYear();
|
|
1113
|
-
const fourthOfJanuaryOfNextYear = constructFrom(date, 0);
|
|
1114
|
-
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
1115
|
-
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
|
1116
|
-
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
|
|
1117
|
-
const fourthOfJanuaryOfThisYear = constructFrom(date, 0);
|
|
1118
|
-
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
|
1119
|
-
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
|
1120
|
-
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
|
|
1121
|
-
if (_date.getTime() >= startOfNextYear.getTime()) {
|
|
1122
|
-
return year + 1;
|
|
1123
|
-
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
|
1124
|
-
return year;
|
|
1125
|
-
} else {
|
|
1126
|
-
return year - 1;
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
function startOfDay(date) {
|
|
1130
|
-
const _date = toDate(date);
|
|
1131
|
-
_date.setHours(0, 0, 0, 0);
|
|
1132
|
-
return _date;
|
|
1133
|
-
}
|
|
1134
|
-
function getTimezoneOffsetInMilliseconds(date) {
|
|
1135
|
-
const _date = toDate(date);
|
|
1136
|
-
const utcDate = new Date(
|
|
1137
|
-
Date.UTC(
|
|
1138
|
-
_date.getFullYear(),
|
|
1139
|
-
_date.getMonth(),
|
|
1140
|
-
_date.getDate(),
|
|
1141
|
-
_date.getHours(),
|
|
1142
|
-
_date.getMinutes(),
|
|
1143
|
-
_date.getSeconds(),
|
|
1144
|
-
_date.getMilliseconds()
|
|
1145
|
-
)
|
|
1146
|
-
);
|
|
1147
|
-
utcDate.setUTCFullYear(_date.getFullYear());
|
|
1148
|
-
return +date - +utcDate;
|
|
1149
|
-
}
|
|
1150
|
-
function differenceInCalendarDays(dateLeft, dateRight) {
|
|
1151
|
-
const startOfDayLeft = startOfDay(dateLeft);
|
|
1152
|
-
const startOfDayRight = startOfDay(dateRight);
|
|
1153
|
-
const timestampLeft = +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);
|
|
1154
|
-
const timestampRight = +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);
|
|
1155
|
-
return Math.round((timestampLeft - timestampRight) / millisecondsInDay);
|
|
1156
|
-
}
|
|
1157
|
-
function startOfISOWeekYear(date) {
|
|
1158
|
-
const year = getISOWeekYear(date);
|
|
1159
|
-
const fourthOfJanuary = constructFrom(date, 0);
|
|
1160
|
-
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
1161
|
-
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
1162
|
-
return startOfISOWeek(fourthOfJanuary);
|
|
1163
|
-
}
|
|
1164
|
-
function isDate(value) {
|
|
1165
|
-
return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
|
|
1166
|
-
}
|
|
1167
|
-
function isValid(date) {
|
|
1168
|
-
if (!isDate(date) && typeof date !== "number") {
|
|
1169
|
-
return false;
|
|
1170
|
-
}
|
|
1171
|
-
const _date = toDate(date);
|
|
1172
|
-
return !isNaN(Number(_date));
|
|
1173
|
-
}
|
|
1174
|
-
function startOfYear(date) {
|
|
1175
|
-
const cleanDate = toDate(date);
|
|
1176
|
-
const _date = constructFrom(date, 0);
|
|
1177
|
-
_date.setFullYear(cleanDate.getFullYear(), 0, 1);
|
|
1178
|
-
_date.setHours(0, 0, 0, 0);
|
|
1179
|
-
return _date;
|
|
1180
|
-
}
|
|
1181
|
-
const formatDistanceLocale = {
|
|
1182
|
-
lessThanXSeconds: {
|
|
1183
|
-
one: "less than a second",
|
|
1184
|
-
other: "less than {{count}} seconds"
|
|
1185
|
-
},
|
|
1186
|
-
xSeconds: {
|
|
1187
|
-
one: "1 second",
|
|
1188
|
-
other: "{{count}} seconds"
|
|
1189
|
-
},
|
|
1190
|
-
halfAMinute: "half a minute",
|
|
1191
|
-
lessThanXMinutes: {
|
|
1192
|
-
one: "less than a minute",
|
|
1193
|
-
other: "less than {{count}} minutes"
|
|
1194
|
-
},
|
|
1195
|
-
xMinutes: {
|
|
1196
|
-
one: "1 minute",
|
|
1197
|
-
other: "{{count}} minutes"
|
|
1198
|
-
},
|
|
1199
|
-
aboutXHours: {
|
|
1200
|
-
one: "about 1 hour",
|
|
1201
|
-
other: "about {{count}} hours"
|
|
1202
|
-
},
|
|
1203
|
-
xHours: {
|
|
1204
|
-
one: "1 hour",
|
|
1205
|
-
other: "{{count}} hours"
|
|
1206
|
-
},
|
|
1207
|
-
xDays: {
|
|
1208
|
-
one: "1 day",
|
|
1209
|
-
other: "{{count}} days"
|
|
1210
|
-
},
|
|
1211
|
-
aboutXWeeks: {
|
|
1212
|
-
one: "about 1 week",
|
|
1213
|
-
other: "about {{count}} weeks"
|
|
1214
|
-
},
|
|
1215
|
-
xWeeks: {
|
|
1216
|
-
one: "1 week",
|
|
1217
|
-
other: "{{count}} weeks"
|
|
1218
|
-
},
|
|
1219
|
-
aboutXMonths: {
|
|
1220
|
-
one: "about 1 month",
|
|
1221
|
-
other: "about {{count}} months"
|
|
1222
|
-
},
|
|
1223
|
-
xMonths: {
|
|
1224
|
-
one: "1 month",
|
|
1225
|
-
other: "{{count}} months"
|
|
1226
|
-
},
|
|
1227
|
-
aboutXYears: {
|
|
1228
|
-
one: "about 1 year",
|
|
1229
|
-
other: "about {{count}} years"
|
|
1230
|
-
},
|
|
1231
|
-
xYears: {
|
|
1232
|
-
one: "1 year",
|
|
1233
|
-
other: "{{count}} years"
|
|
1234
|
-
},
|
|
1235
|
-
overXYears: {
|
|
1236
|
-
one: "over 1 year",
|
|
1237
|
-
other: "over {{count}} years"
|
|
1238
|
-
},
|
|
1239
|
-
almostXYears: {
|
|
1240
|
-
one: "almost 1 year",
|
|
1241
|
-
other: "almost {{count}} years"
|
|
1242
|
-
}
|
|
1243
|
-
};
|
|
1244
|
-
const formatDistance = (token, count, options) => {
|
|
1245
|
-
let result;
|
|
1246
|
-
const tokenValue = formatDistanceLocale[token];
|
|
1247
|
-
if (typeof tokenValue === "string") {
|
|
1248
|
-
result = tokenValue;
|
|
1249
|
-
} else if (count === 1) {
|
|
1250
|
-
result = tokenValue.one;
|
|
1251
|
-
} else {
|
|
1252
|
-
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
1253
|
-
}
|
|
1254
|
-
if (options == null ? void 0 : options.addSuffix) {
|
|
1255
|
-
if (options.comparison && options.comparison > 0) {
|
|
1256
|
-
return "in " + result;
|
|
1257
|
-
} else {
|
|
1258
|
-
return result + " ago";
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
return result;
|
|
1262
|
-
};
|
|
1263
|
-
function buildFormatLongFn(args) {
|
|
1264
|
-
return (options = {}) => {
|
|
1265
|
-
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
1266
|
-
const format2 = args.formats[width] || args.formats[args.defaultWidth];
|
|
1267
|
-
return format2;
|
|
1268
|
-
};
|
|
1269
|
-
}
|
|
1270
|
-
const dateFormats = {
|
|
1271
|
-
full: "EEEE, MMMM do, y",
|
|
1272
|
-
long: "MMMM do, y",
|
|
1273
|
-
medium: "MMM d, y",
|
|
1274
|
-
short: "MM/dd/yyyy"
|
|
1275
|
-
};
|
|
1276
|
-
const timeFormats = {
|
|
1277
|
-
full: "h:mm:ss a zzzz",
|
|
1278
|
-
long: "h:mm:ss a z",
|
|
1279
|
-
medium: "h:mm:ss a",
|
|
1280
|
-
short: "h:mm a"
|
|
1281
|
-
};
|
|
1282
|
-
const dateTimeFormats = {
|
|
1283
|
-
full: "{{date}} 'at' {{time}}",
|
|
1284
|
-
long: "{{date}} 'at' {{time}}",
|
|
1285
|
-
medium: "{{date}}, {{time}}",
|
|
1286
|
-
short: "{{date}}, {{time}}"
|
|
1287
|
-
};
|
|
1288
|
-
const formatLong = {
|
|
1289
|
-
date: buildFormatLongFn({
|
|
1290
|
-
formats: dateFormats,
|
|
1291
|
-
defaultWidth: "full"
|
|
1292
|
-
}),
|
|
1293
|
-
time: buildFormatLongFn({
|
|
1294
|
-
formats: timeFormats,
|
|
1295
|
-
defaultWidth: "full"
|
|
1296
|
-
}),
|
|
1297
|
-
dateTime: buildFormatLongFn({
|
|
1298
|
-
formats: dateTimeFormats,
|
|
1299
|
-
defaultWidth: "full"
|
|
1300
|
-
})
|
|
1301
|
-
};
|
|
1302
|
-
const formatRelativeLocale = {
|
|
1303
|
-
lastWeek: "'last' eeee 'at' p",
|
|
1304
|
-
yesterday: "'yesterday at' p",
|
|
1305
|
-
today: "'today at' p",
|
|
1306
|
-
tomorrow: "'tomorrow at' p",
|
|
1307
|
-
nextWeek: "eeee 'at' p",
|
|
1308
|
-
other: "P"
|
|
1309
|
-
};
|
|
1310
|
-
const formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
|
1311
|
-
function buildLocalizeFn(args) {
|
|
1312
|
-
return (value, options) => {
|
|
1313
|
-
const context = (options == null ? void 0 : options.context) ? String(options.context) : "standalone";
|
|
1314
|
-
let valuesArray;
|
|
1315
|
-
if (context === "formatting" && args.formattingValues) {
|
|
1316
|
-
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
1317
|
-
const width = (options == null ? void 0 : options.width) ? String(options.width) : defaultWidth;
|
|
1318
|
-
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
1319
|
-
} else {
|
|
1320
|
-
const defaultWidth = args.defaultWidth;
|
|
1321
|
-
const width = (options == null ? void 0 : options.width) ? String(options.width) : args.defaultWidth;
|
|
1322
|
-
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
1323
|
-
}
|
|
1324
|
-
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
1325
|
-
return valuesArray[index];
|
|
1326
|
-
};
|
|
1327
|
-
}
|
|
1328
|
-
const eraValues = {
|
|
1329
|
-
narrow: ["B", "A"],
|
|
1330
|
-
abbreviated: ["BC", "AD"],
|
|
1331
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
1332
|
-
};
|
|
1333
|
-
const quarterValues = {
|
|
1334
|
-
narrow: ["1", "2", "3", "4"],
|
|
1335
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1336
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1337
|
-
};
|
|
1338
|
-
const monthValues = {
|
|
1339
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1340
|
-
abbreviated: [
|
|
1341
|
-
"Jan",
|
|
1342
|
-
"Feb",
|
|
1343
|
-
"Mar",
|
|
1344
|
-
"Apr",
|
|
1345
|
-
"May",
|
|
1346
|
-
"Jun",
|
|
1347
|
-
"Jul",
|
|
1348
|
-
"Aug",
|
|
1349
|
-
"Sep",
|
|
1350
|
-
"Oct",
|
|
1351
|
-
"Nov",
|
|
1352
|
-
"Dec"
|
|
1353
|
-
],
|
|
1354
|
-
wide: [
|
|
1355
|
-
"January",
|
|
1356
|
-
"February",
|
|
1357
|
-
"March",
|
|
1358
|
-
"April",
|
|
1359
|
-
"May",
|
|
1360
|
-
"June",
|
|
1361
|
-
"July",
|
|
1362
|
-
"August",
|
|
1363
|
-
"September",
|
|
1364
|
-
"October",
|
|
1365
|
-
"November",
|
|
1366
|
-
"December"
|
|
1367
|
-
]
|
|
1368
|
-
};
|
|
1369
|
-
const dayValues = {
|
|
1370
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1371
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1372
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1373
|
-
wide: [
|
|
1374
|
-
"Sunday",
|
|
1375
|
-
"Monday",
|
|
1376
|
-
"Tuesday",
|
|
1377
|
-
"Wednesday",
|
|
1378
|
-
"Thursday",
|
|
1379
|
-
"Friday",
|
|
1380
|
-
"Saturday"
|
|
1381
|
-
]
|
|
1382
|
-
};
|
|
1383
|
-
const dayPeriodValues = {
|
|
1384
|
-
narrow: {
|
|
1385
|
-
am: "a",
|
|
1386
|
-
pm: "p",
|
|
1387
|
-
midnight: "mi",
|
|
1388
|
-
noon: "n",
|
|
1389
|
-
morning: "morning",
|
|
1390
|
-
afternoon: "afternoon",
|
|
1391
|
-
evening: "evening",
|
|
1392
|
-
night: "night"
|
|
1393
|
-
},
|
|
1394
|
-
abbreviated: {
|
|
1395
|
-
am: "AM",
|
|
1396
|
-
pm: "PM",
|
|
1397
|
-
midnight: "midnight",
|
|
1398
|
-
noon: "noon",
|
|
1399
|
-
morning: "morning",
|
|
1400
|
-
afternoon: "afternoon",
|
|
1401
|
-
evening: "evening",
|
|
1402
|
-
night: "night"
|
|
1403
|
-
},
|
|
1404
|
-
wide: {
|
|
1405
|
-
am: "a.m.",
|
|
1406
|
-
pm: "p.m.",
|
|
1407
|
-
midnight: "midnight",
|
|
1408
|
-
noon: "noon",
|
|
1409
|
-
morning: "morning",
|
|
1410
|
-
afternoon: "afternoon",
|
|
1411
|
-
evening: "evening",
|
|
1412
|
-
night: "night"
|
|
1413
|
-
}
|
|
1414
|
-
};
|
|
1415
|
-
const formattingDayPeriodValues = {
|
|
1416
|
-
narrow: {
|
|
1417
|
-
am: "a",
|
|
1418
|
-
pm: "p",
|
|
1419
|
-
midnight: "mi",
|
|
1420
|
-
noon: "n",
|
|
1421
|
-
morning: "in the morning",
|
|
1422
|
-
afternoon: "in the afternoon",
|
|
1423
|
-
evening: "in the evening",
|
|
1424
|
-
night: "at night"
|
|
1425
|
-
},
|
|
1426
|
-
abbreviated: {
|
|
1427
|
-
am: "AM",
|
|
1428
|
-
pm: "PM",
|
|
1429
|
-
midnight: "midnight",
|
|
1430
|
-
noon: "noon",
|
|
1431
|
-
morning: "in the morning",
|
|
1432
|
-
afternoon: "in the afternoon",
|
|
1433
|
-
evening: "in the evening",
|
|
1434
|
-
night: "at night"
|
|
1435
|
-
},
|
|
1436
|
-
wide: {
|
|
1437
|
-
am: "a.m.",
|
|
1438
|
-
pm: "p.m.",
|
|
1439
|
-
midnight: "midnight",
|
|
1440
|
-
noon: "noon",
|
|
1441
|
-
morning: "in the morning",
|
|
1442
|
-
afternoon: "in the afternoon",
|
|
1443
|
-
evening: "in the evening",
|
|
1444
|
-
night: "at night"
|
|
1445
|
-
}
|
|
1446
|
-
};
|
|
1447
|
-
const ordinalNumber = (dirtyNumber, _options) => {
|
|
1448
|
-
const number = Number(dirtyNumber);
|
|
1449
|
-
const rem100 = number % 100;
|
|
1450
|
-
if (rem100 > 20 || rem100 < 10) {
|
|
1451
|
-
switch (rem100 % 10) {
|
|
1452
|
-
case 1:
|
|
1453
|
-
return number + "st";
|
|
1454
|
-
case 2:
|
|
1455
|
-
return number + "nd";
|
|
1456
|
-
case 3:
|
|
1457
|
-
return number + "rd";
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
return number + "th";
|
|
1461
|
-
};
|
|
1462
|
-
const localize = {
|
|
1463
|
-
ordinalNumber,
|
|
1464
|
-
era: buildLocalizeFn({
|
|
1465
|
-
values: eraValues,
|
|
1466
|
-
defaultWidth: "wide"
|
|
1467
|
-
}),
|
|
1468
|
-
quarter: buildLocalizeFn({
|
|
1469
|
-
values: quarterValues,
|
|
1470
|
-
defaultWidth: "wide",
|
|
1471
|
-
argumentCallback: (quarter) => quarter - 1
|
|
1472
|
-
}),
|
|
1473
|
-
month: buildLocalizeFn({
|
|
1474
|
-
values: monthValues,
|
|
1475
|
-
defaultWidth: "wide"
|
|
1476
|
-
}),
|
|
1477
|
-
day: buildLocalizeFn({
|
|
1478
|
-
values: dayValues,
|
|
1479
|
-
defaultWidth: "wide"
|
|
1480
|
-
}),
|
|
1481
|
-
dayPeriod: buildLocalizeFn({
|
|
1482
|
-
values: dayPeriodValues,
|
|
1483
|
-
defaultWidth: "wide",
|
|
1484
|
-
formattingValues: formattingDayPeriodValues,
|
|
1485
|
-
defaultFormattingWidth: "wide"
|
|
1486
|
-
})
|
|
1487
|
-
};
|
|
1488
|
-
function buildMatchFn(args) {
|
|
1489
|
-
return (string, options = {}) => {
|
|
1490
|
-
const width = options.width;
|
|
1491
|
-
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
1492
|
-
const matchResult = string.match(matchPattern);
|
|
1493
|
-
if (!matchResult) {
|
|
1494
|
-
return null;
|
|
1495
|
-
}
|
|
1496
|
-
const matchedString = matchResult[0];
|
|
1497
|
-
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
1498
|
-
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
1499
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
1500
|
-
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
1501
|
-
);
|
|
1502
|
-
let value;
|
|
1503
|
-
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
1504
|
-
value = options.valueCallback ? (
|
|
1505
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
1506
|
-
options.valueCallback(value)
|
|
1507
|
-
) : value;
|
|
1508
|
-
const rest = string.slice(matchedString.length);
|
|
1509
|
-
return { value, rest };
|
|
1510
|
-
};
|
|
1511
|
-
}
|
|
1512
|
-
function findKey(object, predicate) {
|
|
1513
|
-
for (const key in object) {
|
|
1514
|
-
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
1515
|
-
return key;
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
return void 0;
|
|
1519
|
-
}
|
|
1520
|
-
function findIndex(array, predicate) {
|
|
1521
|
-
for (let key = 0; key < array.length; key++) {
|
|
1522
|
-
if (predicate(array[key])) {
|
|
1523
|
-
return key;
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
return void 0;
|
|
1527
|
-
}
|
|
1528
|
-
function buildMatchPatternFn(args) {
|
|
1529
|
-
return (string, options = {}) => {
|
|
1530
|
-
const matchResult = string.match(args.matchPattern);
|
|
1531
|
-
if (!matchResult) return null;
|
|
1532
|
-
const matchedString = matchResult[0];
|
|
1533
|
-
const parseResult = string.match(args.parsePattern);
|
|
1534
|
-
if (!parseResult) return null;
|
|
1535
|
-
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
1536
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
1537
|
-
const rest = string.slice(matchedString.length);
|
|
1538
|
-
return { value, rest };
|
|
1539
|
-
};
|
|
1540
|
-
}
|
|
1541
|
-
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
1542
|
-
const parseOrdinalNumberPattern = /\d+/i;
|
|
1543
|
-
const matchEraPatterns = {
|
|
1544
|
-
narrow: /^(b|a)/i,
|
|
1545
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1546
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1547
|
-
};
|
|
1548
|
-
const parseEraPatterns = {
|
|
1549
|
-
any: [/^b/i, /^(a|c)/i]
|
|
1550
|
-
};
|
|
1551
|
-
const matchQuarterPatterns = {
|
|
1552
|
-
narrow: /^[1234]/i,
|
|
1553
|
-
abbreviated: /^q[1234]/i,
|
|
1554
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1555
|
-
};
|
|
1556
|
-
const parseQuarterPatterns = {
|
|
1557
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1558
|
-
};
|
|
1559
|
-
const matchMonthPatterns = {
|
|
1560
|
-
narrow: /^[jfmasond]/i,
|
|
1561
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1562
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1563
|
-
};
|
|
1564
|
-
const parseMonthPatterns = {
|
|
1565
|
-
narrow: [
|
|
1566
|
-
/^j/i,
|
|
1567
|
-
/^f/i,
|
|
1568
|
-
/^m/i,
|
|
1569
|
-
/^a/i,
|
|
1570
|
-
/^m/i,
|
|
1571
|
-
/^j/i,
|
|
1572
|
-
/^j/i,
|
|
1573
|
-
/^a/i,
|
|
1574
|
-
/^s/i,
|
|
1575
|
-
/^o/i,
|
|
1576
|
-
/^n/i,
|
|
1577
|
-
/^d/i
|
|
1578
|
-
],
|
|
1579
|
-
any: [
|
|
1580
|
-
/^ja/i,
|
|
1581
|
-
/^f/i,
|
|
1582
|
-
/^mar/i,
|
|
1583
|
-
/^ap/i,
|
|
1584
|
-
/^may/i,
|
|
1585
|
-
/^jun/i,
|
|
1586
|
-
/^jul/i,
|
|
1587
|
-
/^au/i,
|
|
1588
|
-
/^s/i,
|
|
1589
|
-
/^o/i,
|
|
1590
|
-
/^n/i,
|
|
1591
|
-
/^d/i
|
|
1592
|
-
]
|
|
1593
|
-
};
|
|
1594
|
-
const matchDayPatterns = {
|
|
1595
|
-
narrow: /^[smtwf]/i,
|
|
1596
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1597
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1598
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1599
|
-
};
|
|
1600
|
-
const parseDayPatterns = {
|
|
1601
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1602
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1603
|
-
};
|
|
1604
|
-
const matchDayPeriodPatterns = {
|
|
1605
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1606
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1607
|
-
};
|
|
1608
|
-
const parseDayPeriodPatterns = {
|
|
1609
|
-
any: {
|
|
1610
|
-
am: /^a/i,
|
|
1611
|
-
pm: /^p/i,
|
|
1612
|
-
midnight: /^mi/i,
|
|
1613
|
-
noon: /^no/i,
|
|
1614
|
-
morning: /morning/i,
|
|
1615
|
-
afternoon: /afternoon/i,
|
|
1616
|
-
evening: /evening/i,
|
|
1617
|
-
night: /night/i
|
|
1618
|
-
}
|
|
1619
|
-
};
|
|
1620
|
-
const match = {
|
|
1621
|
-
ordinalNumber: buildMatchPatternFn({
|
|
1622
|
-
matchPattern: matchOrdinalNumberPattern,
|
|
1623
|
-
parsePattern: parseOrdinalNumberPattern,
|
|
1624
|
-
valueCallback: (value) => parseInt(value, 10)
|
|
1625
|
-
}),
|
|
1626
|
-
era: buildMatchFn({
|
|
1627
|
-
matchPatterns: matchEraPatterns,
|
|
1628
|
-
defaultMatchWidth: "wide",
|
|
1629
|
-
parsePatterns: parseEraPatterns,
|
|
1630
|
-
defaultParseWidth: "any"
|
|
1631
|
-
}),
|
|
1632
|
-
quarter: buildMatchFn({
|
|
1633
|
-
matchPatterns: matchQuarterPatterns,
|
|
1634
|
-
defaultMatchWidth: "wide",
|
|
1635
|
-
parsePatterns: parseQuarterPatterns,
|
|
1636
|
-
defaultParseWidth: "any",
|
|
1637
|
-
valueCallback: (index) => index + 1
|
|
1638
|
-
}),
|
|
1639
|
-
month: buildMatchFn({
|
|
1640
|
-
matchPatterns: matchMonthPatterns,
|
|
1641
|
-
defaultMatchWidth: "wide",
|
|
1642
|
-
parsePatterns: parseMonthPatterns,
|
|
1643
|
-
defaultParseWidth: "any"
|
|
1644
|
-
}),
|
|
1645
|
-
day: buildMatchFn({
|
|
1646
|
-
matchPatterns: matchDayPatterns,
|
|
1647
|
-
defaultMatchWidth: "wide",
|
|
1648
|
-
parsePatterns: parseDayPatterns,
|
|
1649
|
-
defaultParseWidth: "any"
|
|
1650
|
-
}),
|
|
1651
|
-
dayPeriod: buildMatchFn({
|
|
1652
|
-
matchPatterns: matchDayPeriodPatterns,
|
|
1653
|
-
defaultMatchWidth: "any",
|
|
1654
|
-
parsePatterns: parseDayPeriodPatterns,
|
|
1655
|
-
defaultParseWidth: "any"
|
|
1656
|
-
})
|
|
1657
|
-
};
|
|
1658
|
-
const enUS = {
|
|
1659
|
-
code: "en-US",
|
|
1660
|
-
formatDistance,
|
|
1661
|
-
formatLong,
|
|
1662
|
-
formatRelative,
|
|
1663
|
-
localize,
|
|
1664
|
-
match,
|
|
1665
|
-
options: {
|
|
1666
|
-
weekStartsOn: 0,
|
|
1667
|
-
firstWeekContainsDate: 1
|
|
1668
|
-
}
|
|
1669
|
-
};
|
|
1670
|
-
function getDayOfYear(date) {
|
|
1671
|
-
const _date = toDate(date);
|
|
1672
|
-
const diff = differenceInCalendarDays(_date, startOfYear(_date));
|
|
1673
|
-
const dayOfYear = diff + 1;
|
|
1674
|
-
return dayOfYear;
|
|
1675
|
-
}
|
|
1676
|
-
function getISOWeek(date) {
|
|
1677
|
-
const _date = toDate(date);
|
|
1678
|
-
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
|
|
1679
|
-
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1680
|
-
}
|
|
1681
|
-
function getWeekYear(date, options) {
|
|
1682
|
-
var _a, _b, _c, _d;
|
|
1683
|
-
const _date = toDate(date);
|
|
1684
|
-
const year = _date.getFullYear();
|
|
1685
|
-
const defaultOptions2 = getDefaultOptions();
|
|
1686
|
-
const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1;
|
|
1687
|
-
const firstWeekOfNextYear = constructFrom(date, 0);
|
|
1688
|
-
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
|
|
1689
|
-
firstWeekOfNextYear.setHours(0, 0, 0, 0);
|
|
1690
|
-
const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
|
|
1691
|
-
const firstWeekOfThisYear = constructFrom(date, 0);
|
|
1692
|
-
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
|
|
1693
|
-
firstWeekOfThisYear.setHours(0, 0, 0, 0);
|
|
1694
|
-
const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
|
|
1695
|
-
if (_date.getTime() >= startOfNextYear.getTime()) {
|
|
1696
|
-
return year + 1;
|
|
1697
|
-
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
|
1698
|
-
return year;
|
|
1699
|
-
} else {
|
|
1700
|
-
return year - 1;
|
|
1701
|
-
}
|
|
1702
|
-
}
|
|
1703
|
-
function startOfWeekYear(date, options) {
|
|
1704
|
-
var _a, _b, _c, _d;
|
|
1705
|
-
const defaultOptions2 = getDefaultOptions();
|
|
1706
|
-
const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1;
|
|
1707
|
-
const year = getWeekYear(date, options);
|
|
1708
|
-
const firstWeek = constructFrom(date, 0);
|
|
1709
|
-
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
1710
|
-
firstWeek.setHours(0, 0, 0, 0);
|
|
1711
|
-
const _date = startOfWeek(firstWeek, options);
|
|
1712
|
-
return _date;
|
|
1713
|
-
}
|
|
1714
|
-
function getWeek(date, options) {
|
|
1715
|
-
const _date = toDate(date);
|
|
1716
|
-
const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
|
|
1717
|
-
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1718
|
-
}
|
|
1719
|
-
function addLeadingZeros(number, targetLength) {
|
|
1720
|
-
const sign = number < 0 ? "-" : "";
|
|
1721
|
-
const output = Math.abs(number).toString().padStart(targetLength, "0");
|
|
1722
|
-
return sign + output;
|
|
1723
|
-
}
|
|
1724
|
-
const lightFormatters = {
|
|
1725
|
-
// Year
|
|
1726
|
-
y(date, token) {
|
|
1727
|
-
const signedYear = date.getFullYear();
|
|
1728
|
-
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
1729
|
-
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
|
|
1730
|
-
},
|
|
1731
|
-
// Month
|
|
1732
|
-
M(date, token) {
|
|
1733
|
-
const month = date.getMonth();
|
|
1734
|
-
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
1735
|
-
},
|
|
1736
|
-
// Day of the month
|
|
1737
|
-
d(date, token) {
|
|
1738
|
-
return addLeadingZeros(date.getDate(), token.length);
|
|
1739
|
-
},
|
|
1740
|
-
// AM or PM
|
|
1741
|
-
a(date, token) {
|
|
1742
|
-
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1743
|
-
switch (token) {
|
|
1744
|
-
case "a":
|
|
1745
|
-
case "aa":
|
|
1746
|
-
return dayPeriodEnumValue.toUpperCase();
|
|
1747
|
-
case "aaa":
|
|
1748
|
-
return dayPeriodEnumValue;
|
|
1749
|
-
case "aaaaa":
|
|
1750
|
-
return dayPeriodEnumValue[0];
|
|
1751
|
-
case "aaaa":
|
|
1752
|
-
default:
|
|
1753
|
-
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
|
1754
|
-
}
|
|
1755
|
-
},
|
|
1756
|
-
// Hour [1-12]
|
|
1757
|
-
h(date, token) {
|
|
1758
|
-
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
|
|
1759
|
-
},
|
|
1760
|
-
// Hour [0-23]
|
|
1761
|
-
H(date, token) {
|
|
1762
|
-
return addLeadingZeros(date.getHours(), token.length);
|
|
1763
|
-
},
|
|
1764
|
-
// Minute
|
|
1765
|
-
m(date, token) {
|
|
1766
|
-
return addLeadingZeros(date.getMinutes(), token.length);
|
|
1767
|
-
},
|
|
1768
|
-
// Second
|
|
1769
|
-
s(date, token) {
|
|
1770
|
-
return addLeadingZeros(date.getSeconds(), token.length);
|
|
1771
|
-
},
|
|
1772
|
-
// Fraction of second
|
|
1773
|
-
S(date, token) {
|
|
1774
|
-
const numberOfDigits = token.length;
|
|
1775
|
-
const milliseconds = date.getMilliseconds();
|
|
1776
|
-
const fractionalSeconds = Math.trunc(
|
|
1777
|
-
milliseconds * Math.pow(10, numberOfDigits - 3)
|
|
1778
|
-
);
|
|
1779
|
-
return addLeadingZeros(fractionalSeconds, token.length);
|
|
1780
|
-
}
|
|
1781
|
-
};
|
|
1782
|
-
const dayPeriodEnum = {
|
|
1783
|
-
midnight: "midnight",
|
|
1784
|
-
noon: "noon",
|
|
1785
|
-
morning: "morning",
|
|
1786
|
-
afternoon: "afternoon",
|
|
1787
|
-
evening: "evening",
|
|
1788
|
-
night: "night"
|
|
1789
|
-
};
|
|
1790
|
-
const formatters = {
|
|
1791
|
-
// Era
|
|
1792
|
-
G: function(date, token, localize2) {
|
|
1793
|
-
const era = date.getFullYear() > 0 ? 1 : 0;
|
|
1794
|
-
switch (token) {
|
|
1795
|
-
// AD, BC
|
|
1796
|
-
case "G":
|
|
1797
|
-
case "GG":
|
|
1798
|
-
case "GGG":
|
|
1799
|
-
return localize2.era(era, { width: "abbreviated" });
|
|
1800
|
-
// A, B
|
|
1801
|
-
case "GGGGG":
|
|
1802
|
-
return localize2.era(era, { width: "narrow" });
|
|
1803
|
-
// Anno Domini, Before Christ
|
|
1804
|
-
case "GGGG":
|
|
1805
|
-
default:
|
|
1806
|
-
return localize2.era(era, { width: "wide" });
|
|
1807
|
-
}
|
|
1808
|
-
},
|
|
1809
|
-
// Year
|
|
1810
|
-
y: function(date, token, localize2) {
|
|
1811
|
-
if (token === "yo") {
|
|
1812
|
-
const signedYear = date.getFullYear();
|
|
1813
|
-
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
1814
|
-
return localize2.ordinalNumber(year, { unit: "year" });
|
|
1815
|
-
}
|
|
1816
|
-
return lightFormatters.y(date, token);
|
|
1817
|
-
},
|
|
1818
|
-
// Local week-numbering year
|
|
1819
|
-
Y: function(date, token, localize2, options) {
|
|
1820
|
-
const signedWeekYear = getWeekYear(date, options);
|
|
1821
|
-
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
1822
|
-
if (token === "YY") {
|
|
1823
|
-
const twoDigitYear = weekYear % 100;
|
|
1824
|
-
return addLeadingZeros(twoDigitYear, 2);
|
|
1825
|
-
}
|
|
1826
|
-
if (token === "Yo") {
|
|
1827
|
-
return localize2.ordinalNumber(weekYear, { unit: "year" });
|
|
1828
|
-
}
|
|
1829
|
-
return addLeadingZeros(weekYear, token.length);
|
|
1830
|
-
},
|
|
1831
|
-
// ISO week-numbering year
|
|
1832
|
-
R: function(date, token) {
|
|
1833
|
-
const isoWeekYear = getISOWeekYear(date);
|
|
1834
|
-
return addLeadingZeros(isoWeekYear, token.length);
|
|
1835
|
-
},
|
|
1836
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
1837
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
1838
|
-
// | Year | `y` | `u` |
|
|
1839
|
-
// |------|-----|-----|
|
|
1840
|
-
// | AC 1 | 1 | 1 |
|
|
1841
|
-
// | BC 1 | 1 | 0 |
|
|
1842
|
-
// | BC 2 | 2 | -1 |
|
|
1843
|
-
// Also `yy` always returns the last two digits of a year,
|
|
1844
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
1845
|
-
u: function(date, token) {
|
|
1846
|
-
const year = date.getFullYear();
|
|
1847
|
-
return addLeadingZeros(year, token.length);
|
|
1848
|
-
},
|
|
1849
|
-
// Quarter
|
|
1850
|
-
Q: function(date, token, localize2) {
|
|
1851
|
-
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
1852
|
-
switch (token) {
|
|
1853
|
-
// 1, 2, 3, 4
|
|
1854
|
-
case "Q":
|
|
1855
|
-
return String(quarter);
|
|
1856
|
-
// 01, 02, 03, 04
|
|
1857
|
-
case "QQ":
|
|
1858
|
-
return addLeadingZeros(quarter, 2);
|
|
1859
|
-
// 1st, 2nd, 3rd, 4th
|
|
1860
|
-
case "Qo":
|
|
1861
|
-
return localize2.ordinalNumber(quarter, { unit: "quarter" });
|
|
1862
|
-
// Q1, Q2, Q3, Q4
|
|
1863
|
-
case "QQQ":
|
|
1864
|
-
return localize2.quarter(quarter, {
|
|
1865
|
-
width: "abbreviated",
|
|
1866
|
-
context: "formatting"
|
|
1867
|
-
});
|
|
1868
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1869
|
-
case "QQQQQ":
|
|
1870
|
-
return localize2.quarter(quarter, {
|
|
1871
|
-
width: "narrow",
|
|
1872
|
-
context: "formatting"
|
|
1873
|
-
});
|
|
1874
|
-
// 1st quarter, 2nd quarter, ...
|
|
1875
|
-
case "QQQQ":
|
|
1876
|
-
default:
|
|
1877
|
-
return localize2.quarter(quarter, {
|
|
1878
|
-
width: "wide",
|
|
1879
|
-
context: "formatting"
|
|
1880
|
-
});
|
|
1881
|
-
}
|
|
1882
|
-
},
|
|
1883
|
-
// Stand-alone quarter
|
|
1884
|
-
q: function(date, token, localize2) {
|
|
1885
|
-
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
1886
|
-
switch (token) {
|
|
1887
|
-
// 1, 2, 3, 4
|
|
1888
|
-
case "q":
|
|
1889
|
-
return String(quarter);
|
|
1890
|
-
// 01, 02, 03, 04
|
|
1891
|
-
case "qq":
|
|
1892
|
-
return addLeadingZeros(quarter, 2);
|
|
1893
|
-
// 1st, 2nd, 3rd, 4th
|
|
1894
|
-
case "qo":
|
|
1895
|
-
return localize2.ordinalNumber(quarter, { unit: "quarter" });
|
|
1896
|
-
// Q1, Q2, Q3, Q4
|
|
1897
|
-
case "qqq":
|
|
1898
|
-
return localize2.quarter(quarter, {
|
|
1899
|
-
width: "abbreviated",
|
|
1900
|
-
context: "standalone"
|
|
1901
|
-
});
|
|
1902
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1903
|
-
case "qqqqq":
|
|
1904
|
-
return localize2.quarter(quarter, {
|
|
1905
|
-
width: "narrow",
|
|
1906
|
-
context: "standalone"
|
|
1907
|
-
});
|
|
1908
|
-
// 1st quarter, 2nd quarter, ...
|
|
1909
|
-
case "qqqq":
|
|
1910
|
-
default:
|
|
1911
|
-
return localize2.quarter(quarter, {
|
|
1912
|
-
width: "wide",
|
|
1913
|
-
context: "standalone"
|
|
1914
|
-
});
|
|
1915
|
-
}
|
|
1916
|
-
},
|
|
1917
|
-
// Month
|
|
1918
|
-
M: function(date, token, localize2) {
|
|
1919
|
-
const month = date.getMonth();
|
|
1920
|
-
switch (token) {
|
|
1921
|
-
case "M":
|
|
1922
|
-
case "MM":
|
|
1923
|
-
return lightFormatters.M(date, token);
|
|
1924
|
-
// 1st, 2nd, ..., 12th
|
|
1925
|
-
case "Mo":
|
|
1926
|
-
return localize2.ordinalNumber(month + 1, { unit: "month" });
|
|
1927
|
-
// Jan, Feb, ..., Dec
|
|
1928
|
-
case "MMM":
|
|
1929
|
-
return localize2.month(month, {
|
|
1930
|
-
width: "abbreviated",
|
|
1931
|
-
context: "formatting"
|
|
1932
|
-
});
|
|
1933
|
-
// J, F, ..., D
|
|
1934
|
-
case "MMMMM":
|
|
1935
|
-
return localize2.month(month, {
|
|
1936
|
-
width: "narrow",
|
|
1937
|
-
context: "formatting"
|
|
1938
|
-
});
|
|
1939
|
-
// January, February, ..., December
|
|
1940
|
-
case "MMMM":
|
|
1941
|
-
default:
|
|
1942
|
-
return localize2.month(month, { width: "wide", context: "formatting" });
|
|
1943
|
-
}
|
|
1944
|
-
},
|
|
1945
|
-
// Stand-alone month
|
|
1946
|
-
L: function(date, token, localize2) {
|
|
1947
|
-
const month = date.getMonth();
|
|
1948
|
-
switch (token) {
|
|
1949
|
-
// 1, 2, ..., 12
|
|
1950
|
-
case "L":
|
|
1951
|
-
return String(month + 1);
|
|
1952
|
-
// 01, 02, ..., 12
|
|
1953
|
-
case "LL":
|
|
1954
|
-
return addLeadingZeros(month + 1, 2);
|
|
1955
|
-
// 1st, 2nd, ..., 12th
|
|
1956
|
-
case "Lo":
|
|
1957
|
-
return localize2.ordinalNumber(month + 1, { unit: "month" });
|
|
1958
|
-
// Jan, Feb, ..., Dec
|
|
1959
|
-
case "LLL":
|
|
1960
|
-
return localize2.month(month, {
|
|
1961
|
-
width: "abbreviated",
|
|
1962
|
-
context: "standalone"
|
|
1963
|
-
});
|
|
1964
|
-
// J, F, ..., D
|
|
1965
|
-
case "LLLLL":
|
|
1966
|
-
return localize2.month(month, {
|
|
1967
|
-
width: "narrow",
|
|
1968
|
-
context: "standalone"
|
|
1969
|
-
});
|
|
1970
|
-
// January, February, ..., December
|
|
1971
|
-
case "LLLL":
|
|
1972
|
-
default:
|
|
1973
|
-
return localize2.month(month, { width: "wide", context: "standalone" });
|
|
1974
|
-
}
|
|
1975
|
-
},
|
|
1976
|
-
// Local week of year
|
|
1977
|
-
w: function(date, token, localize2, options) {
|
|
1978
|
-
const week = getWeek(date, options);
|
|
1979
|
-
if (token === "wo") {
|
|
1980
|
-
return localize2.ordinalNumber(week, { unit: "week" });
|
|
1981
|
-
}
|
|
1982
|
-
return addLeadingZeros(week, token.length);
|
|
1983
|
-
},
|
|
1984
|
-
// ISO week of year
|
|
1985
|
-
I: function(date, token, localize2) {
|
|
1986
|
-
const isoWeek = getISOWeek(date);
|
|
1987
|
-
if (token === "Io") {
|
|
1988
|
-
return localize2.ordinalNumber(isoWeek, { unit: "week" });
|
|
1989
|
-
}
|
|
1990
|
-
return addLeadingZeros(isoWeek, token.length);
|
|
1991
|
-
},
|
|
1992
|
-
// Day of the month
|
|
1993
|
-
d: function(date, token, localize2) {
|
|
1994
|
-
if (token === "do") {
|
|
1995
|
-
return localize2.ordinalNumber(date.getDate(), { unit: "date" });
|
|
1996
|
-
}
|
|
1997
|
-
return lightFormatters.d(date, token);
|
|
1998
|
-
},
|
|
1999
|
-
// Day of year
|
|
2000
|
-
D: function(date, token, localize2) {
|
|
2001
|
-
const dayOfYear = getDayOfYear(date);
|
|
2002
|
-
if (token === "Do") {
|
|
2003
|
-
return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
|
2004
|
-
}
|
|
2005
|
-
return addLeadingZeros(dayOfYear, token.length);
|
|
2006
|
-
},
|
|
2007
|
-
// Day of week
|
|
2008
|
-
E: function(date, token, localize2) {
|
|
2009
|
-
const dayOfWeek = date.getDay();
|
|
2010
|
-
switch (token) {
|
|
2011
|
-
// Tue
|
|
2012
|
-
case "E":
|
|
2013
|
-
case "EE":
|
|
2014
|
-
case "EEE":
|
|
2015
|
-
return localize2.day(dayOfWeek, {
|
|
2016
|
-
width: "abbreviated",
|
|
2017
|
-
context: "formatting"
|
|
2018
|
-
});
|
|
2019
|
-
// T
|
|
2020
|
-
case "EEEEE":
|
|
2021
|
-
return localize2.day(dayOfWeek, {
|
|
2022
|
-
width: "narrow",
|
|
2023
|
-
context: "formatting"
|
|
2024
|
-
});
|
|
2025
|
-
// Tu
|
|
2026
|
-
case "EEEEEE":
|
|
2027
|
-
return localize2.day(dayOfWeek, {
|
|
2028
|
-
width: "short",
|
|
2029
|
-
context: "formatting"
|
|
2030
|
-
});
|
|
2031
|
-
// Tuesday
|
|
2032
|
-
case "EEEE":
|
|
2033
|
-
default:
|
|
2034
|
-
return localize2.day(dayOfWeek, {
|
|
2035
|
-
width: "wide",
|
|
2036
|
-
context: "formatting"
|
|
2037
|
-
});
|
|
2038
|
-
}
|
|
2039
|
-
},
|
|
2040
|
-
// Local day of week
|
|
2041
|
-
e: function(date, token, localize2, options) {
|
|
2042
|
-
const dayOfWeek = date.getDay();
|
|
2043
|
-
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
2044
|
-
switch (token) {
|
|
2045
|
-
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
2046
|
-
case "e":
|
|
2047
|
-
return String(localDayOfWeek);
|
|
2048
|
-
// Padded numerical value
|
|
2049
|
-
case "ee":
|
|
2050
|
-
return addLeadingZeros(localDayOfWeek, 2);
|
|
2051
|
-
// 1st, 2nd, ..., 7th
|
|
2052
|
-
case "eo":
|
|
2053
|
-
return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
2054
|
-
case "eee":
|
|
2055
|
-
return localize2.day(dayOfWeek, {
|
|
2056
|
-
width: "abbreviated",
|
|
2057
|
-
context: "formatting"
|
|
2058
|
-
});
|
|
2059
|
-
// T
|
|
2060
|
-
case "eeeee":
|
|
2061
|
-
return localize2.day(dayOfWeek, {
|
|
2062
|
-
width: "narrow",
|
|
2063
|
-
context: "formatting"
|
|
2064
|
-
});
|
|
2065
|
-
// Tu
|
|
2066
|
-
case "eeeeee":
|
|
2067
|
-
return localize2.day(dayOfWeek, {
|
|
2068
|
-
width: "short",
|
|
2069
|
-
context: "formatting"
|
|
2070
|
-
});
|
|
2071
|
-
// Tuesday
|
|
2072
|
-
case "eeee":
|
|
2073
|
-
default:
|
|
2074
|
-
return localize2.day(dayOfWeek, {
|
|
2075
|
-
width: "wide",
|
|
2076
|
-
context: "formatting"
|
|
2077
|
-
});
|
|
2078
|
-
}
|
|
2079
|
-
},
|
|
2080
|
-
// Stand-alone local day of week
|
|
2081
|
-
c: function(date, token, localize2, options) {
|
|
2082
|
-
const dayOfWeek = date.getDay();
|
|
2083
|
-
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
2084
|
-
switch (token) {
|
|
2085
|
-
// Numerical value (same as in `e`)
|
|
2086
|
-
case "c":
|
|
2087
|
-
return String(localDayOfWeek);
|
|
2088
|
-
// Padded numerical value
|
|
2089
|
-
case "cc":
|
|
2090
|
-
return addLeadingZeros(localDayOfWeek, token.length);
|
|
2091
|
-
// 1st, 2nd, ..., 7th
|
|
2092
|
-
case "co":
|
|
2093
|
-
return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
2094
|
-
case "ccc":
|
|
2095
|
-
return localize2.day(dayOfWeek, {
|
|
2096
|
-
width: "abbreviated",
|
|
2097
|
-
context: "standalone"
|
|
2098
|
-
});
|
|
2099
|
-
// T
|
|
2100
|
-
case "ccccc":
|
|
2101
|
-
return localize2.day(dayOfWeek, {
|
|
2102
|
-
width: "narrow",
|
|
2103
|
-
context: "standalone"
|
|
2104
|
-
});
|
|
2105
|
-
// Tu
|
|
2106
|
-
case "cccccc":
|
|
2107
|
-
return localize2.day(dayOfWeek, {
|
|
2108
|
-
width: "short",
|
|
2109
|
-
context: "standalone"
|
|
2110
|
-
});
|
|
2111
|
-
// Tuesday
|
|
2112
|
-
case "cccc":
|
|
2113
|
-
default:
|
|
2114
|
-
return localize2.day(dayOfWeek, {
|
|
2115
|
-
width: "wide",
|
|
2116
|
-
context: "standalone"
|
|
2117
|
-
});
|
|
2118
|
-
}
|
|
2119
|
-
},
|
|
2120
|
-
// ISO day of week
|
|
2121
|
-
i: function(date, token, localize2) {
|
|
2122
|
-
const dayOfWeek = date.getDay();
|
|
2123
|
-
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
2124
|
-
switch (token) {
|
|
2125
|
-
// 2
|
|
2126
|
-
case "i":
|
|
2127
|
-
return String(isoDayOfWeek);
|
|
2128
|
-
// 02
|
|
2129
|
-
case "ii":
|
|
2130
|
-
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
2131
|
-
// 2nd
|
|
2132
|
-
case "io":
|
|
2133
|
-
return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
|
2134
|
-
// Tue
|
|
2135
|
-
case "iii":
|
|
2136
|
-
return localize2.day(dayOfWeek, {
|
|
2137
|
-
width: "abbreviated",
|
|
2138
|
-
context: "formatting"
|
|
2139
|
-
});
|
|
2140
|
-
// T
|
|
2141
|
-
case "iiiii":
|
|
2142
|
-
return localize2.day(dayOfWeek, {
|
|
2143
|
-
width: "narrow",
|
|
2144
|
-
context: "formatting"
|
|
2145
|
-
});
|
|
2146
|
-
// Tu
|
|
2147
|
-
case "iiiiii":
|
|
2148
|
-
return localize2.day(dayOfWeek, {
|
|
2149
|
-
width: "short",
|
|
2150
|
-
context: "formatting"
|
|
2151
|
-
});
|
|
2152
|
-
// Tuesday
|
|
2153
|
-
case "iiii":
|
|
2154
|
-
default:
|
|
2155
|
-
return localize2.day(dayOfWeek, {
|
|
2156
|
-
width: "wide",
|
|
2157
|
-
context: "formatting"
|
|
2158
|
-
});
|
|
2159
|
-
}
|
|
2160
|
-
},
|
|
2161
|
-
// AM or PM
|
|
2162
|
-
a: function(date, token, localize2) {
|
|
2163
|
-
const hours = date.getHours();
|
|
2164
|
-
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
2165
|
-
switch (token) {
|
|
2166
|
-
case "a":
|
|
2167
|
-
case "aa":
|
|
2168
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2169
|
-
width: "abbreviated",
|
|
2170
|
-
context: "formatting"
|
|
2171
|
-
});
|
|
2172
|
-
case "aaa":
|
|
2173
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2174
|
-
width: "abbreviated",
|
|
2175
|
-
context: "formatting"
|
|
2176
|
-
}).toLowerCase();
|
|
2177
|
-
case "aaaaa":
|
|
2178
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2179
|
-
width: "narrow",
|
|
2180
|
-
context: "formatting"
|
|
2181
|
-
});
|
|
2182
|
-
case "aaaa":
|
|
2183
|
-
default:
|
|
2184
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2185
|
-
width: "wide",
|
|
2186
|
-
context: "formatting"
|
|
2187
|
-
});
|
|
2188
|
-
}
|
|
2189
|
-
},
|
|
2190
|
-
// AM, PM, midnight, noon
|
|
2191
|
-
b: function(date, token, localize2) {
|
|
2192
|
-
const hours = date.getHours();
|
|
2193
|
-
let dayPeriodEnumValue;
|
|
2194
|
-
if (hours === 12) {
|
|
2195
|
-
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
2196
|
-
} else if (hours === 0) {
|
|
2197
|
-
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
2198
|
-
} else {
|
|
2199
|
-
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
2200
|
-
}
|
|
2201
|
-
switch (token) {
|
|
2202
|
-
case "b":
|
|
2203
|
-
case "bb":
|
|
2204
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2205
|
-
width: "abbreviated",
|
|
2206
|
-
context: "formatting"
|
|
2207
|
-
});
|
|
2208
|
-
case "bbb":
|
|
2209
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2210
|
-
width: "abbreviated",
|
|
2211
|
-
context: "formatting"
|
|
2212
|
-
}).toLowerCase();
|
|
2213
|
-
case "bbbbb":
|
|
2214
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2215
|
-
width: "narrow",
|
|
2216
|
-
context: "formatting"
|
|
2217
|
-
});
|
|
2218
|
-
case "bbbb":
|
|
2219
|
-
default:
|
|
2220
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2221
|
-
width: "wide",
|
|
2222
|
-
context: "formatting"
|
|
2223
|
-
});
|
|
2224
|
-
}
|
|
2225
|
-
},
|
|
2226
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
2227
|
-
B: function(date, token, localize2) {
|
|
2228
|
-
const hours = date.getHours();
|
|
2229
|
-
let dayPeriodEnumValue;
|
|
2230
|
-
if (hours >= 17) {
|
|
2231
|
-
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
2232
|
-
} else if (hours >= 12) {
|
|
2233
|
-
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
2234
|
-
} else if (hours >= 4) {
|
|
2235
|
-
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
2236
|
-
} else {
|
|
2237
|
-
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
2238
|
-
}
|
|
2239
|
-
switch (token) {
|
|
2240
|
-
case "B":
|
|
2241
|
-
case "BB":
|
|
2242
|
-
case "BBB":
|
|
2243
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2244
|
-
width: "abbreviated",
|
|
2245
|
-
context: "formatting"
|
|
2246
|
-
});
|
|
2247
|
-
case "BBBBB":
|
|
2248
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2249
|
-
width: "narrow",
|
|
2250
|
-
context: "formatting"
|
|
2251
|
-
});
|
|
2252
|
-
case "BBBB":
|
|
2253
|
-
default:
|
|
2254
|
-
return localize2.dayPeriod(dayPeriodEnumValue, {
|
|
2255
|
-
width: "wide",
|
|
2256
|
-
context: "formatting"
|
|
2257
|
-
});
|
|
2258
|
-
}
|
|
2259
|
-
},
|
|
2260
|
-
// Hour [1-12]
|
|
2261
|
-
h: function(date, token, localize2) {
|
|
2262
|
-
if (token === "ho") {
|
|
2263
|
-
let hours = date.getHours() % 12;
|
|
2264
|
-
if (hours === 0) hours = 12;
|
|
2265
|
-
return localize2.ordinalNumber(hours, { unit: "hour" });
|
|
2266
|
-
}
|
|
2267
|
-
return lightFormatters.h(date, token);
|
|
2268
|
-
},
|
|
2269
|
-
// Hour [0-23]
|
|
2270
|
-
H: function(date, token, localize2) {
|
|
2271
|
-
if (token === "Ho") {
|
|
2272
|
-
return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
|
|
2273
|
-
}
|
|
2274
|
-
return lightFormatters.H(date, token);
|
|
2275
|
-
},
|
|
2276
|
-
// Hour [0-11]
|
|
2277
|
-
K: function(date, token, localize2) {
|
|
2278
|
-
const hours = date.getHours() % 12;
|
|
2279
|
-
if (token === "Ko") {
|
|
2280
|
-
return localize2.ordinalNumber(hours, { unit: "hour" });
|
|
2281
|
-
}
|
|
2282
|
-
return addLeadingZeros(hours, token.length);
|
|
2283
|
-
},
|
|
2284
|
-
// Hour [1-24]
|
|
2285
|
-
k: function(date, token, localize2) {
|
|
2286
|
-
let hours = date.getHours();
|
|
2287
|
-
if (hours === 0) hours = 24;
|
|
2288
|
-
if (token === "ko") {
|
|
2289
|
-
return localize2.ordinalNumber(hours, { unit: "hour" });
|
|
2290
|
-
}
|
|
2291
|
-
return addLeadingZeros(hours, token.length);
|
|
2292
|
-
},
|
|
2293
|
-
// Minute
|
|
2294
|
-
m: function(date, token, localize2) {
|
|
2295
|
-
if (token === "mo") {
|
|
2296
|
-
return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
|
2297
|
-
}
|
|
2298
|
-
return lightFormatters.m(date, token);
|
|
2299
|
-
},
|
|
2300
|
-
// Second
|
|
2301
|
-
s: function(date, token, localize2) {
|
|
2302
|
-
if (token === "so") {
|
|
2303
|
-
return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
|
|
2304
|
-
}
|
|
2305
|
-
return lightFormatters.s(date, token);
|
|
2306
|
-
},
|
|
2307
|
-
// Fraction of second
|
|
2308
|
-
S: function(date, token) {
|
|
2309
|
-
return lightFormatters.S(date, token);
|
|
2310
|
-
},
|
|
2311
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
2312
|
-
X: function(date, token, _localize) {
|
|
2313
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
2314
|
-
if (timezoneOffset === 0) {
|
|
2315
|
-
return "Z";
|
|
2316
|
-
}
|
|
2317
|
-
switch (token) {
|
|
2318
|
-
// Hours and optional minutes
|
|
2319
|
-
case "X":
|
|
2320
|
-
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
2321
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
2322
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2323
|
-
// so this token always has the same output as `XX`
|
|
2324
|
-
case "XXXX":
|
|
2325
|
-
case "XX":
|
|
2326
|
-
return formatTimezone(timezoneOffset);
|
|
2327
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
2328
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2329
|
-
// so this token always has the same output as `XXX`
|
|
2330
|
-
case "XXXXX":
|
|
2331
|
-
case "XXX":
|
|
2332
|
-
// Hours and minutes with `:` delimiter
|
|
2333
|
-
default:
|
|
2334
|
-
return formatTimezone(timezoneOffset, ":");
|
|
2335
|
-
}
|
|
2336
|
-
},
|
|
2337
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
2338
|
-
x: function(date, token, _localize) {
|
|
2339
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
2340
|
-
switch (token) {
|
|
2341
|
-
// Hours and optional minutes
|
|
2342
|
-
case "x":
|
|
2343
|
-
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
2344
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
2345
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2346
|
-
// so this token always has the same output as `xx`
|
|
2347
|
-
case "xxxx":
|
|
2348
|
-
case "xx":
|
|
2349
|
-
return formatTimezone(timezoneOffset);
|
|
2350
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
2351
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2352
|
-
// so this token always has the same output as `xxx`
|
|
2353
|
-
case "xxxxx":
|
|
2354
|
-
case "xxx":
|
|
2355
|
-
// Hours and minutes with `:` delimiter
|
|
2356
|
-
default:
|
|
2357
|
-
return formatTimezone(timezoneOffset, ":");
|
|
2358
|
-
}
|
|
2359
|
-
},
|
|
2360
|
-
// Timezone (GMT)
|
|
2361
|
-
O: function(date, token, _localize) {
|
|
2362
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
2363
|
-
switch (token) {
|
|
2364
|
-
// Short
|
|
2365
|
-
case "O":
|
|
2366
|
-
case "OO":
|
|
2367
|
-
case "OOO":
|
|
2368
|
-
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
2369
|
-
// Long
|
|
2370
|
-
case "OOOO":
|
|
2371
|
-
default:
|
|
2372
|
-
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
2373
|
-
}
|
|
2374
|
-
},
|
|
2375
|
-
// Timezone (specific non-location)
|
|
2376
|
-
z: function(date, token, _localize) {
|
|
2377
|
-
const timezoneOffset = date.getTimezoneOffset();
|
|
2378
|
-
switch (token) {
|
|
2379
|
-
// Short
|
|
2380
|
-
case "z":
|
|
2381
|
-
case "zz":
|
|
2382
|
-
case "zzz":
|
|
2383
|
-
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
2384
|
-
// Long
|
|
2385
|
-
case "zzzz":
|
|
2386
|
-
default:
|
|
2387
|
-
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
2388
|
-
}
|
|
2389
|
-
},
|
|
2390
|
-
// Seconds timestamp
|
|
2391
|
-
t: function(date, token, _localize) {
|
|
2392
|
-
const timestamp = Math.trunc(date.getTime() / 1e3);
|
|
2393
|
-
return addLeadingZeros(timestamp, token.length);
|
|
2394
|
-
},
|
|
2395
|
-
// Milliseconds timestamp
|
|
2396
|
-
T: function(date, token, _localize) {
|
|
2397
|
-
const timestamp = date.getTime();
|
|
2398
|
-
return addLeadingZeros(timestamp, token.length);
|
|
2399
|
-
}
|
|
2400
|
-
};
|
|
2401
|
-
function formatTimezoneShort(offset, delimiter = "") {
|
|
2402
|
-
const sign = offset > 0 ? "-" : "+";
|
|
2403
|
-
const absOffset = Math.abs(offset);
|
|
2404
|
-
const hours = Math.trunc(absOffset / 60);
|
|
2405
|
-
const minutes = absOffset % 60;
|
|
2406
|
-
if (minutes === 0) {
|
|
2407
|
-
return sign + String(hours);
|
|
2408
|
-
}
|
|
2409
|
-
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
2410
|
-
}
|
|
2411
|
-
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
|
2412
|
-
if (offset % 60 === 0) {
|
|
2413
|
-
const sign = offset > 0 ? "-" : "+";
|
|
2414
|
-
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
2415
|
-
}
|
|
2416
|
-
return formatTimezone(offset, delimiter);
|
|
2417
|
-
}
|
|
2418
|
-
function formatTimezone(offset, delimiter = "") {
|
|
2419
|
-
const sign = offset > 0 ? "-" : "+";
|
|
2420
|
-
const absOffset = Math.abs(offset);
|
|
2421
|
-
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
|
|
2422
|
-
const minutes = addLeadingZeros(absOffset % 60, 2);
|
|
2423
|
-
return sign + hours + delimiter + minutes;
|
|
2424
|
-
}
|
|
2425
|
-
const dateLongFormatter = (pattern, formatLong2) => {
|
|
2426
|
-
switch (pattern) {
|
|
2427
|
-
case "P":
|
|
2428
|
-
return formatLong2.date({ width: "short" });
|
|
2429
|
-
case "PP":
|
|
2430
|
-
return formatLong2.date({ width: "medium" });
|
|
2431
|
-
case "PPP":
|
|
2432
|
-
return formatLong2.date({ width: "long" });
|
|
2433
|
-
case "PPPP":
|
|
2434
|
-
default:
|
|
2435
|
-
return formatLong2.date({ width: "full" });
|
|
2436
|
-
}
|
|
2437
|
-
};
|
|
2438
|
-
const timeLongFormatter = (pattern, formatLong2) => {
|
|
2439
|
-
switch (pattern) {
|
|
2440
|
-
case "p":
|
|
2441
|
-
return formatLong2.time({ width: "short" });
|
|
2442
|
-
case "pp":
|
|
2443
|
-
return formatLong2.time({ width: "medium" });
|
|
2444
|
-
case "ppp":
|
|
2445
|
-
return formatLong2.time({ width: "long" });
|
|
2446
|
-
case "pppp":
|
|
2447
|
-
default:
|
|
2448
|
-
return formatLong2.time({ width: "full" });
|
|
2449
|
-
}
|
|
2450
|
-
};
|
|
2451
|
-
const dateTimeLongFormatter = (pattern, formatLong2) => {
|
|
2452
|
-
const matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
2453
|
-
const datePattern = matchResult[1];
|
|
2454
|
-
const timePattern = matchResult[2];
|
|
2455
|
-
if (!timePattern) {
|
|
2456
|
-
return dateLongFormatter(pattern, formatLong2);
|
|
2457
|
-
}
|
|
2458
|
-
let dateTimeFormat;
|
|
2459
|
-
switch (datePattern) {
|
|
2460
|
-
case "P":
|
|
2461
|
-
dateTimeFormat = formatLong2.dateTime({ width: "short" });
|
|
2462
|
-
break;
|
|
2463
|
-
case "PP":
|
|
2464
|
-
dateTimeFormat = formatLong2.dateTime({ width: "medium" });
|
|
2465
|
-
break;
|
|
2466
|
-
case "PPP":
|
|
2467
|
-
dateTimeFormat = formatLong2.dateTime({ width: "long" });
|
|
2468
|
-
break;
|
|
2469
|
-
case "PPPP":
|
|
2470
|
-
default:
|
|
2471
|
-
dateTimeFormat = formatLong2.dateTime({ width: "full" });
|
|
2472
|
-
break;
|
|
2473
|
-
}
|
|
2474
|
-
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
|
|
2475
|
-
};
|
|
2476
|
-
const longFormatters = {
|
|
2477
|
-
p: timeLongFormatter,
|
|
2478
|
-
P: dateTimeLongFormatter
|
|
2479
|
-
};
|
|
2480
|
-
const dayOfYearTokenRE = /^D+$/;
|
|
2481
|
-
const weekYearTokenRE = /^Y+$/;
|
|
2482
|
-
const throwTokens = ["D", "DD", "YY", "YYYY"];
|
|
2483
|
-
function isProtectedDayOfYearToken(token) {
|
|
2484
|
-
return dayOfYearTokenRE.test(token);
|
|
2485
|
-
}
|
|
2486
|
-
function isProtectedWeekYearToken(token) {
|
|
2487
|
-
return weekYearTokenRE.test(token);
|
|
2488
|
-
}
|
|
2489
|
-
function warnOrThrowProtectedError(token, format2, input) {
|
|
2490
|
-
const _message = message(token, format2, input);
|
|
2491
|
-
console.warn(_message);
|
|
2492
|
-
if (throwTokens.includes(token)) throw new RangeError(_message);
|
|
2493
|
-
}
|
|
2494
|
-
function message(token, format2, input) {
|
|
2495
|
-
const subject = token[0] === "Y" ? "years" : "days of the month";
|
|
2496
|
-
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format2}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
2497
|
-
}
|
|
2498
|
-
const formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
2499
|
-
const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
2500
|
-
const escapedStringRegExp = /^'([^]*?)'?$/;
|
|
2501
|
-
const doubleQuoteRegExp = /''/g;
|
|
2502
|
-
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
2503
|
-
function format(date, formatStr, options) {
|
|
2504
|
-
var _a, _b, _c, _d;
|
|
2505
|
-
const defaultOptions2 = getDefaultOptions();
|
|
2506
|
-
const locale = defaultOptions2.locale ?? enUS;
|
|
2507
|
-
const firstWeekContainsDate = defaultOptions2.firstWeekContainsDate ?? ((_b = (_a = defaultOptions2.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? 1;
|
|
2508
|
-
const weekStartsOn = defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0;
|
|
2509
|
-
const originalDate = toDate(date);
|
|
2510
|
-
if (!isValid(originalDate)) {
|
|
2511
|
-
throw new RangeError("Invalid time value");
|
|
2512
|
-
}
|
|
2513
|
-
let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
|
|
2514
|
-
const firstCharacter = substring[0];
|
|
2515
|
-
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
2516
|
-
const longFormatter = longFormatters[firstCharacter];
|
|
2517
|
-
return longFormatter(substring, locale.formatLong);
|
|
2518
|
-
}
|
|
2519
|
-
return substring;
|
|
2520
|
-
}).join("").match(formattingTokensRegExp).map((substring) => {
|
|
2521
|
-
if (substring === "''") {
|
|
2522
|
-
return { isToken: false, value: "'" };
|
|
2523
|
-
}
|
|
2524
|
-
const firstCharacter = substring[0];
|
|
2525
|
-
if (firstCharacter === "'") {
|
|
2526
|
-
return { isToken: false, value: cleanEscapedString(substring) };
|
|
2527
|
-
}
|
|
2528
|
-
if (formatters[firstCharacter]) {
|
|
2529
|
-
return { isToken: true, value: substring };
|
|
2530
|
-
}
|
|
2531
|
-
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
2532
|
-
throw new RangeError(
|
|
2533
|
-
"Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
|
|
2534
|
-
);
|
|
2535
|
-
}
|
|
2536
|
-
return { isToken: false, value: substring };
|
|
2537
|
-
});
|
|
2538
|
-
if (locale.localize.preprocessor) {
|
|
2539
|
-
parts = locale.localize.preprocessor(originalDate, parts);
|
|
2540
|
-
}
|
|
2541
|
-
const formatterOptions = {
|
|
2542
|
-
firstWeekContainsDate,
|
|
2543
|
-
weekStartsOn,
|
|
2544
|
-
locale
|
|
2545
|
-
};
|
|
2546
|
-
return parts.map((part) => {
|
|
2547
|
-
if (!part.isToken) return part.value;
|
|
2548
|
-
const token = part.value;
|
|
2549
|
-
if (isProtectedWeekYearToken(token) || isProtectedDayOfYearToken(token)) {
|
|
2550
|
-
warnOrThrowProtectedError(token, formatStr, String(date));
|
|
2551
|
-
}
|
|
2552
|
-
const formatter = formatters[token[0]];
|
|
2553
|
-
return formatter(originalDate, token, locale.localize, formatterOptions);
|
|
2554
|
-
}).join("");
|
|
2555
|
-
}
|
|
2556
|
-
function cleanEscapedString(input) {
|
|
2557
|
-
const matched = input.match(escapedStringRegExp);
|
|
2558
|
-
if (!matched) {
|
|
2559
|
-
return input;
|
|
2560
|
-
}
|
|
2561
|
-
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
2562
|
-
}
|
|
2563
|
-
function parseISO(argument, options) {
|
|
2564
|
-
const additionalDigits = 2;
|
|
2565
|
-
const dateStrings = splitDateString(argument);
|
|
2566
|
-
let date;
|
|
2567
|
-
if (dateStrings.date) {
|
|
2568
|
-
const parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
2569
|
-
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
|
2570
|
-
}
|
|
2571
|
-
if (!date || isNaN(date.getTime())) {
|
|
2572
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
2573
|
-
}
|
|
2574
|
-
const timestamp = date.getTime();
|
|
2575
|
-
let time = 0;
|
|
2576
|
-
let offset;
|
|
2577
|
-
if (dateStrings.time) {
|
|
2578
|
-
time = parseTime(dateStrings.time);
|
|
2579
|
-
if (isNaN(time)) {
|
|
2580
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
2581
|
-
}
|
|
2582
|
-
}
|
|
2583
|
-
if (dateStrings.timezone) {
|
|
2584
|
-
offset = parseTimezone(dateStrings.timezone);
|
|
2585
|
-
if (isNaN(offset)) {
|
|
2586
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
2587
|
-
}
|
|
2588
|
-
} else {
|
|
2589
|
-
const dirtyDate = new Date(timestamp + time);
|
|
2590
|
-
const result = /* @__PURE__ */ new Date(0);
|
|
2591
|
-
result.setFullYear(
|
|
2592
|
-
dirtyDate.getUTCFullYear(),
|
|
2593
|
-
dirtyDate.getUTCMonth(),
|
|
2594
|
-
dirtyDate.getUTCDate()
|
|
2595
|
-
);
|
|
2596
|
-
result.setHours(
|
|
2597
|
-
dirtyDate.getUTCHours(),
|
|
2598
|
-
dirtyDate.getUTCMinutes(),
|
|
2599
|
-
dirtyDate.getUTCSeconds(),
|
|
2600
|
-
dirtyDate.getUTCMilliseconds()
|
|
2601
|
-
);
|
|
2602
|
-
return result;
|
|
2603
|
-
}
|
|
2604
|
-
return new Date(timestamp + time + offset);
|
|
2605
|
-
}
|
|
2606
|
-
const patterns = {
|
|
2607
|
-
dateTimeDelimiter: /[T ]/,
|
|
2608
|
-
timeZoneDelimiter: /[Z ]/i,
|
|
2609
|
-
timezone: /([Z+-].*)$/
|
|
2610
|
-
};
|
|
2611
|
-
const dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
2612
|
-
const timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
2613
|
-
const timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
2614
|
-
function splitDateString(dateString) {
|
|
2615
|
-
const dateStrings = {};
|
|
2616
|
-
const array = dateString.split(patterns.dateTimeDelimiter);
|
|
2617
|
-
let timeString;
|
|
2618
|
-
if (array.length > 2) {
|
|
2619
|
-
return dateStrings;
|
|
2620
|
-
}
|
|
2621
|
-
if (/:/.test(array[0])) {
|
|
2622
|
-
timeString = array[0];
|
|
2623
|
-
} else {
|
|
2624
|
-
dateStrings.date = array[0];
|
|
2625
|
-
timeString = array[1];
|
|
2626
|
-
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
|
2627
|
-
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
|
2628
|
-
timeString = dateString.substr(
|
|
2629
|
-
dateStrings.date.length,
|
|
2630
|
-
dateString.length
|
|
2631
|
-
);
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
if (timeString) {
|
|
2635
|
-
const token = patterns.timezone.exec(timeString);
|
|
2636
|
-
if (token) {
|
|
2637
|
-
dateStrings.time = timeString.replace(token[1], "");
|
|
2638
|
-
dateStrings.timezone = token[1];
|
|
2639
|
-
} else {
|
|
2640
|
-
dateStrings.time = timeString;
|
|
1106
|
+
function GoabIcon({
|
|
1107
|
+
inverted,
|
|
1108
|
+
...rest
|
|
1109
|
+
}) {
|
|
1110
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
1111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1112
|
+
"goa-icon",
|
|
1113
|
+
{
|
|
1114
|
+
inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
|
|
1115
|
+
..._props
|
|
2641
1116
|
}
|
|
2642
|
-
}
|
|
2643
|
-
return dateStrings;
|
|
2644
|
-
}
|
|
2645
|
-
function parseYear(dateString, additionalDigits) {
|
|
2646
|
-
const regex = new RegExp(
|
|
2647
|
-
"^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)"
|
|
2648
1117
|
);
|
|
2649
|
-
const captures = dateString.match(regex);
|
|
2650
|
-
if (!captures) return { year: NaN, restDateString: "" };
|
|
2651
|
-
const year = captures[1] ? parseInt(captures[1]) : null;
|
|
2652
|
-
const century = captures[2] ? parseInt(captures[2]) : null;
|
|
2653
|
-
return {
|
|
2654
|
-
year: century === null ? year : century * 100,
|
|
2655
|
-
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
|
2656
|
-
};
|
|
2657
|
-
}
|
|
2658
|
-
function parseDate(dateString, year) {
|
|
2659
|
-
if (year === null) return /* @__PURE__ */ new Date(NaN);
|
|
2660
|
-
const captures = dateString.match(dateRegex);
|
|
2661
|
-
if (!captures) return /* @__PURE__ */ new Date(NaN);
|
|
2662
|
-
const isWeekDate = !!captures[4];
|
|
2663
|
-
const dayOfYear = parseDateUnit(captures[1]);
|
|
2664
|
-
const month = parseDateUnit(captures[2]) - 1;
|
|
2665
|
-
const day = parseDateUnit(captures[3]);
|
|
2666
|
-
const week = parseDateUnit(captures[4]);
|
|
2667
|
-
const dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
2668
|
-
if (isWeekDate) {
|
|
2669
|
-
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
2670
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
2671
|
-
}
|
|
2672
|
-
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
2673
|
-
} else {
|
|
2674
|
-
const date = /* @__PURE__ */ new Date(0);
|
|
2675
|
-
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
|
|
2676
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
2677
|
-
}
|
|
2678
|
-
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
2679
|
-
return date;
|
|
2680
|
-
}
|
|
2681
|
-
}
|
|
2682
|
-
function parseDateUnit(value) {
|
|
2683
|
-
return value ? parseInt(value) : 1;
|
|
2684
|
-
}
|
|
2685
|
-
function parseTime(timeString) {
|
|
2686
|
-
const captures = timeString.match(timeRegex);
|
|
2687
|
-
if (!captures) return NaN;
|
|
2688
|
-
const hours = parseTimeUnit(captures[1]);
|
|
2689
|
-
const minutes = parseTimeUnit(captures[2]);
|
|
2690
|
-
const seconds = parseTimeUnit(captures[3]);
|
|
2691
|
-
if (!validateTime(hours, minutes, seconds)) {
|
|
2692
|
-
return NaN;
|
|
2693
|
-
}
|
|
2694
|
-
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3;
|
|
2695
|
-
}
|
|
2696
|
-
function parseTimeUnit(value) {
|
|
2697
|
-
return value && parseFloat(value.replace(",", ".")) || 0;
|
|
2698
|
-
}
|
|
2699
|
-
function parseTimezone(timezoneString) {
|
|
2700
|
-
if (timezoneString === "Z") return 0;
|
|
2701
|
-
const captures = timezoneString.match(timezoneRegex);
|
|
2702
|
-
if (!captures) return 0;
|
|
2703
|
-
const sign = captures[1] === "+" ? -1 : 1;
|
|
2704
|
-
const hours = parseInt(captures[2]);
|
|
2705
|
-
const minutes = captures[3] && parseInt(captures[3]) || 0;
|
|
2706
|
-
if (!validateTimezone(hours, minutes)) {
|
|
2707
|
-
return NaN;
|
|
2708
|
-
}
|
|
2709
|
-
return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
|
|
2710
|
-
}
|
|
2711
|
-
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
2712
|
-
const date = /* @__PURE__ */ new Date(0);
|
|
2713
|
-
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
2714
|
-
const fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
2715
|
-
const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
2716
|
-
date.setUTCDate(date.getUTCDate() + diff);
|
|
2717
|
-
return date;
|
|
2718
|
-
}
|
|
2719
|
-
const daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2720
|
-
function isLeapYearIndex(year) {
|
|
2721
|
-
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
2722
|
-
}
|
|
2723
|
-
function validateDate(year, month, date) {
|
|
2724
|
-
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
|
|
2725
|
-
}
|
|
2726
|
-
function validateDayOfYearDate(year, dayOfYear) {
|
|
2727
|
-
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
|
2728
|
-
}
|
|
2729
|
-
function validateWeekDate(_year, week, day) {
|
|
2730
|
-
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
2731
|
-
}
|
|
2732
|
-
function validateTime(hours, minutes, seconds) {
|
|
2733
|
-
if (hours === 24) {
|
|
2734
|
-
return minutes === 0 && seconds === 0;
|
|
2735
|
-
}
|
|
2736
|
-
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
|
2737
|
-
}
|
|
2738
|
-
function validateTimezone(_hours, minutes) {
|
|
2739
|
-
return minutes >= 0 && minutes <= 59;
|
|
2740
1118
|
}
|
|
2741
1119
|
function GoabInput({
|
|
2742
1120
|
variant = "goa",
|
|
@@ -2755,7 +1133,7 @@ function GoabInput({
|
|
|
2755
1133
|
...rest
|
|
2756
1134
|
}) {
|
|
2757
1135
|
const ref = react.useRef(null);
|
|
2758
|
-
const _props =
|
|
1136
|
+
const _props = parseISO.transformProps({ variant, textalign: textAlign, ...rest }, parseISO.lowercase);
|
|
2759
1137
|
react.useEffect(() => {
|
|
2760
1138
|
if (!ref.current) {
|
|
2761
1139
|
return;
|
|
@@ -2816,11 +1194,11 @@ const onDateChangeHandler = (onChange) => {
|
|
|
2816
1194
|
onChange == null ? void 0 : onChange({ name, value: "", event });
|
|
2817
1195
|
return;
|
|
2818
1196
|
}
|
|
2819
|
-
if (typeof value === "string" && isValid(new Date(value))) {
|
|
2820
|
-
onChange == null ? void 0 : onChange({ name, value: parseISO(value), event });
|
|
1197
|
+
if (typeof value === "string" && parseISO.isValid(new Date(value))) {
|
|
1198
|
+
onChange == null ? void 0 : onChange({ name, value: parseISO.parseISO(value), event });
|
|
2821
1199
|
return;
|
|
2822
1200
|
}
|
|
2823
|
-
if (isValid(value)) {
|
|
1201
|
+
if (parseISO.isValid(value)) {
|
|
2824
1202
|
onChange == null ? void 0 : onChange({ name, value, event });
|
|
2825
1203
|
return;
|
|
2826
1204
|
}
|
|
@@ -2840,12 +1218,12 @@ function toString(value, tmpl = "yyyy-MM-dd") {
|
|
|
2840
1218
|
return "";
|
|
2841
1219
|
}
|
|
2842
1220
|
if (typeof value === "string") {
|
|
2843
|
-
return format(parseISO(value), tmpl);
|
|
1221
|
+
return parseISO.format(parseISO.parseISO(value), tmpl);
|
|
2844
1222
|
}
|
|
2845
1223
|
if (value.toISOString() === (/* @__PURE__ */ new Date(0)).toISOString()) {
|
|
2846
1224
|
return "";
|
|
2847
1225
|
}
|
|
2848
|
-
return format(value, tmpl);
|
|
1226
|
+
return parseISO.format(value, tmpl);
|
|
2849
1227
|
}
|
|
2850
1228
|
function GoabInputText(props) {
|
|
2851
1229
|
return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "text" });
|
|
@@ -3003,7 +1381,7 @@ function GoabLink({
|
|
|
3003
1381
|
children,
|
|
3004
1382
|
...rest
|
|
3005
1383
|
}) {
|
|
3006
|
-
const _props =
|
|
1384
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
3007
1385
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3008
1386
|
"goa-link",
|
|
3009
1387
|
{
|
|
@@ -3019,9 +1397,9 @@ function GoALinkButton({
|
|
|
3019
1397
|
children,
|
|
3020
1398
|
...rest
|
|
3021
1399
|
}) {
|
|
3022
|
-
const _props =
|
|
1400
|
+
const _props = parseISO.transformProps(
|
|
3023
1401
|
{ type, ...rest },
|
|
3024
|
-
|
|
1402
|
+
parseISO.lowercase
|
|
3025
1403
|
);
|
|
3026
1404
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-link-button", { ..._props, children });
|
|
3027
1405
|
}
|
|
@@ -3033,9 +1411,9 @@ function GoabMenuButton({
|
|
|
3033
1411
|
...rest
|
|
3034
1412
|
}) {
|
|
3035
1413
|
const el = react.useRef(null);
|
|
3036
|
-
const _props =
|
|
1414
|
+
const _props = parseISO.transformProps(
|
|
3037
1415
|
{ type, testid: testId, ...rest },
|
|
3038
|
-
|
|
1416
|
+
parseISO.kebab
|
|
3039
1417
|
);
|
|
3040
1418
|
react.useEffect(() => {
|
|
3041
1419
|
if (!el.current) {
|
|
@@ -3057,7 +1435,7 @@ function GoabMenuButton({
|
|
|
3057
1435
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ..._props, ref: el, children });
|
|
3058
1436
|
}
|
|
3059
1437
|
function GoabMenuAction(props) {
|
|
3060
|
-
const _props =
|
|
1438
|
+
const _props = parseISO.transformProps(props, parseISO.lowercase);
|
|
3061
1439
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-action", { ..._props });
|
|
3062
1440
|
}
|
|
3063
1441
|
function GoabMicrositeHeader({
|
|
@@ -3239,7 +1617,7 @@ function GoabPopover({
|
|
|
3239
1617
|
children,
|
|
3240
1618
|
...rest
|
|
3241
1619
|
}) {
|
|
3242
|
-
const _props =
|
|
1620
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
3243
1621
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3244
1622
|
"goa-popover",
|
|
3245
1623
|
{
|
|
@@ -3305,7 +1683,7 @@ function GoabRadioGroup({
|
|
|
3305
1683
|
...rest
|
|
3306
1684
|
}) {
|
|
3307
1685
|
const el = react.useRef(null);
|
|
3308
|
-
const _props =
|
|
1686
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
3309
1687
|
react.useEffect(() => {
|
|
3310
1688
|
if (!el.current) return;
|
|
3311
1689
|
const listener = (e) => {
|
|
@@ -3447,7 +1825,7 @@ function GoabTableSortHeader({
|
|
|
3447
1825
|
children,
|
|
3448
1826
|
...rest
|
|
3449
1827
|
}) {
|
|
3450
|
-
const _props =
|
|
1828
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
3451
1829
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-table-sort-header", { ..._props, children });
|
|
3452
1830
|
}
|
|
3453
1831
|
function GoabTabs({
|
|
@@ -3473,11 +1851,19 @@ function GoabTabs({
|
|
|
3473
1851
|
}, [onChange]);
|
|
3474
1852
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-tabs", { ref, initialtab: initialTab, testid: testId, variant, children });
|
|
3475
1853
|
}
|
|
3476
|
-
function GoabTab({ heading, disabled, children }) {
|
|
3477
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
1854
|
+
function GoabTab({ heading, disabled, slug, children }) {
|
|
1855
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1856
|
+
"goa-tab",
|
|
1857
|
+
{
|
|
1858
|
+
slug,
|
|
1859
|
+
disabled: disabled ? "true" : void 0,
|
|
1860
|
+
heading: typeof heading === "string" ? heading : void 0,
|
|
1861
|
+
children: [
|
|
1862
|
+
typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "heading", children: heading }),
|
|
1863
|
+
children
|
|
1864
|
+
]
|
|
1865
|
+
}
|
|
1866
|
+
);
|
|
3481
1867
|
}
|
|
3482
1868
|
const GoabTemporaryNotificationCtrl = ({
|
|
3483
1869
|
verticalPosition = "bottom",
|
|
@@ -3486,9 +1872,9 @@ const GoabTemporaryNotificationCtrl = ({
|
|
|
3486
1872
|
...rest
|
|
3487
1873
|
}) => {
|
|
3488
1874
|
const el = react.useRef(null);
|
|
3489
|
-
const _props =
|
|
1875
|
+
const _props = parseISO.transformProps(
|
|
3490
1876
|
{ "vertical-position": verticalPosition, "horizontal-position": horizontalPosition, ...rest },
|
|
3491
|
-
|
|
1877
|
+
parseISO.kebab
|
|
3492
1878
|
);
|
|
3493
1879
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3494
1880
|
"goa-temp-notification-ctrl",
|
|
@@ -3505,7 +1891,7 @@ function GoabText({
|
|
|
3505
1891
|
children,
|
|
3506
1892
|
...rest
|
|
3507
1893
|
}) {
|
|
3508
|
-
const _props =
|
|
1894
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
3509
1895
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3510
1896
|
"goa-text",
|
|
3511
1897
|
{
|
|
@@ -3525,7 +1911,7 @@ function GoabTextArea({
|
|
|
3525
1911
|
...rest
|
|
3526
1912
|
}) {
|
|
3527
1913
|
const el = react.useRef(null);
|
|
3528
|
-
const _props =
|
|
1914
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
3529
1915
|
react.useEffect(() => {
|
|
3530
1916
|
if (!el.current) {
|
|
3531
1917
|
return;
|
|
@@ -3586,7 +1972,7 @@ function GoabTooltip({
|
|
|
3586
1972
|
children,
|
|
3587
1973
|
...rest
|
|
3588
1974
|
}) {
|
|
3589
|
-
const _props =
|
|
1975
|
+
const _props = parseISO.transformProps(rest, parseISO.lowercase);
|
|
3590
1976
|
const isStringContent = typeof content === "string";
|
|
3591
1977
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3592
1978
|
"goa-tooltip",
|
|
@@ -3622,9 +2008,9 @@ const GoabFilterChip = ({
|
|
|
3622
2008
|
...rest
|
|
3623
2009
|
}) => {
|
|
3624
2010
|
const el = react.useRef(null);
|
|
3625
|
-
const _props =
|
|
2011
|
+
const _props = parseISO.transformProps(
|
|
3626
2012
|
{ icontheme: iconTheme, ...rest },
|
|
3627
|
-
|
|
2013
|
+
parseISO.lowercase
|
|
3628
2014
|
);
|
|
3629
2015
|
react.useEffect(() => {
|
|
3630
2016
|
if (!el.current) return;
|
|
@@ -4050,8 +2436,6 @@ function usePublicFormController(type = "details") {
|
|
|
4050
2436
|
controller: controllerRef.current
|
|
4051
2437
|
};
|
|
4052
2438
|
}
|
|
4053
|
-
exports.GoabDrawer = icon.GoabDrawer;
|
|
4054
|
-
exports.GoabIcon = icon.GoabIcon;
|
|
4055
2439
|
exports.GoALinkButton = GoALinkButton;
|
|
4056
2440
|
exports.GoabAccordion = GoabAccordion;
|
|
4057
2441
|
exports.GoabAppFooter = GoabAppFooter;
|
|
@@ -4074,6 +2458,7 @@ exports.GoabDataGrid = GoabDataGrid;
|
|
|
4074
2458
|
exports.GoabDatePicker = GoabDatePicker;
|
|
4075
2459
|
exports.GoabDetails = GoabDetails;
|
|
4076
2460
|
exports.GoabDivider = GoabDivider;
|
|
2461
|
+
exports.GoabDrawer = GoabDrawer;
|
|
4077
2462
|
exports.GoabDropdown = GoabDropdown;
|
|
4078
2463
|
exports.GoabDropdownItem = GoabDropdownItem;
|
|
4079
2464
|
exports.GoabDropdownOption = GoabDropdownOption;
|
|
@@ -4088,6 +2473,7 @@ exports.GoabFormStepper = GoabFormStepper;
|
|
|
4088
2473
|
exports.GoabGrid = GoabGrid;
|
|
4089
2474
|
exports.GoabHeroBanner = GoabHeroBanner;
|
|
4090
2475
|
exports.GoabHeroBannerActions = GoabHeroBannerActions;
|
|
2476
|
+
exports.GoabIcon = GoabIcon;
|
|
4091
2477
|
exports.GoabIconButton = GoabIconButton;
|
|
4092
2478
|
exports.GoabImportantBadge = GoabImportantBadge;
|
|
4093
2479
|
exports.GoabInfoBadge = GoabInfoBadge;
|