@oslokommune/punkt-react 19.15.6 → 19.16.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/CHANGELOG.md +30 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/accordion/Accordion.js +28 -0
- package/dist/components/accordion/AccordionItem.js +60 -0
- package/dist/components/alert/Alert.js +76 -0
- package/dist/components/backlink/BackLink.js +35 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +67 -0
- package/dist/components/button/Button.js +54 -0
- package/dist/components/calendar/Calendar.js +49 -0
- package/dist/components/calendar/CalendarGrid.js +99 -0
- package/dist/components/calendar/CalendarNav.js +89 -0
- package/dist/components/calendar/calendar-utils.js +44 -0
- package/dist/components/calendar/useCalendarState.js +214 -0
- package/dist/components/card/Card.js +99 -0
- package/dist/components/checkbox/Checkbox.js +101 -0
- package/dist/components/checkboxgroup/CheckboxGroup.js +88 -0
- package/dist/components/checkboxgroup/CheckboxGroupContext.js +5 -0
- package/dist/components/combobox/Combobox.js +65 -0
- package/dist/components/combobox/ComboboxInput.js +87 -0
- package/dist/components/combobox/ComboboxTags.js +82 -0
- package/dist/components/combobox/Listbox.js +136 -0
- package/dist/components/combobox/useComboboxState.js +577 -0
- package/dist/components/consent/Consent.js +110 -0
- package/dist/components/datepicker/DateTags.js +28 -0
- package/dist/components/datepicker/Datepicker.js +79 -0
- package/dist/components/datepicker/DatepickerInputs.js +149 -0
- package/dist/components/datepicker/DatepickerPopup.js +41 -0
- package/dist/components/datepicker/useDatepickerState.js +243 -0
- package/dist/components/fileupload/DropZone.js +131 -0
- package/dist/components/fileupload/FileUpload.js +223 -0
- package/dist/components/fileupload/FileUploadContext.d.ts +2 -0
- package/dist/components/fileupload/FileUploadContext.js +6 -0
- package/dist/components/fileupload/QueueDisplay.js +67 -0
- package/dist/components/fileupload/QueueItemContent.js +88 -0
- package/dist/components/fileupload/Subcomponents.js +265 -0
- package/dist/components/fileupload/Truncate.js +22 -0
- package/dist/components/fileupload/extensions/Comments.js +128 -0
- package/dist/components/fileupload/extensions/Remove.js +9 -0
- package/dist/components/fileupload/extensions/Rename.js +66 -0
- package/dist/components/fileupload/hooks/useFileAttributes.js +25 -0
- package/dist/components/fileupload/hooks/useImageObjectUrl.js +15 -0
- package/dist/components/fileupload/hooks/useImagePreview.js +24 -0
- package/dist/components/fileupload/hooks/useOperationState.js +31 -0
- package/dist/components/fileupload/hooks/useRequiredFormValidation.js +23 -0
- package/dist/components/fileupload/types.d.ts +0 -1
- package/dist/components/fileupload/types.js +12 -0
- package/dist/components/footer/Footer.js +134 -0
- package/dist/components/footer/FooterGlobal.js +105 -0
- package/dist/components/footerSimple/FooterSimple.js +87 -0
- package/dist/components/header/Header.js +15 -0
- package/dist/components/header/HeaderGlobal.js +286 -0
- package/dist/components/header/HeaderService.js +281 -0
- package/dist/components/header-menu/HeaderMenu.js +197 -0
- package/dist/components/headerUserMenu/UserMenu.js +134 -0
- package/dist/components/heading/Heading.js +37 -0
- package/dist/components/helptext/Helptext.js +50 -0
- package/dist/components/icon/Icon.d.ts +6 -0
- package/dist/components/icon/Icon.js +69 -0
- package/dist/components/input/Input.js +23 -0
- package/dist/components/inputwrapper/InputWrapper.js +128 -0
- package/dist/components/link/Link.js +34 -0
- package/dist/components/linkcard/LinkCard.js +38 -0
- package/dist/components/loader/Loader.js +47 -0
- package/dist/components/messagebox/Messagebox.js +50 -0
- package/dist/components/modal/Modal.js +89 -0
- package/dist/components/progressbar/Progressbar.js +62 -0
- package/dist/components/radio/RadioButton.js +85 -0
- package/dist/components/radiogroup/RadioGroup.js +70 -0
- package/dist/components/radiogroup/RadioGroupContext.js +5 -0
- package/dist/components/searchinput/SearchInput.js +102 -0
- package/dist/components/select/Select.js +56 -0
- package/dist/components/stepper/Step.js +78 -0
- package/dist/components/stepper/Stepper.js +21 -0
- package/dist/components/strings/PktStringsProvider.js +21 -0
- package/dist/components/table/Table.js +19 -0
- package/dist/components/table/TableBody.js +13 -0
- package/dist/components/table/TableDataCell.js +14 -0
- package/dist/components/table/TableHeader.js +12 -0
- package/dist/components/table/TableHeaderCell.js +12 -0
- package/dist/components/table/TableRow.js +12 -0
- package/dist/components/tabs/TabItem.js +60 -0
- package/dist/components/tabs/Tabs.js +90 -0
- package/dist/components/tag/Tag.js +76 -0
- package/dist/components/textarea/Textarea.js +74 -0
- package/dist/components/textinput/Textinput.js +106 -0
- package/dist/components/timepicker/Timepicker.js +224 -0
- package/dist/components/timepicker/useTimepickerState.js +483 -0
- package/dist/hooks/useElementWidth.js +23 -0
- package/dist/hooks/useFocusModality.js +28 -0
- package/dist/hooks/useGeneratedId.js +8 -0
- package/dist/hooks/useHeaderChrome.js +36 -0
- package/dist/hooks/useOptionGroupField.js +70 -0
- package/dist/hooks/useOwnerForm.js +15 -0
- package/dist/hooks/usePktStrings.js +16 -0
- package/dist/hooks/useScrollLock.js +12 -0
- package/dist/node_modules/@date-fns/tz/date/index.js +57 -0
- package/dist/node_modules/@date-fns/tz/date/mini.js +75 -0
- package/dist/node_modules/@date-fns/tz/index.js +6 -0
- package/dist/node_modules/@date-fns/tz/tz/index.js +1 -0
- package/dist/node_modules/@date-fns/tz/tzName/index.js +10 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +22 -0
- package/dist/node_modules/classnames/index.js +32 -0
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +6 -0
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.js +389 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +43 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +38 -0
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +8 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +8 -0
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +11 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +23 -0
- package/dist/node_modules/date-fns/addDays.js +9 -0
- package/dist/node_modules/date-fns/constants.js +10 -0
- package/dist/node_modules/date-fns/constructFrom.js +7 -0
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +11 -0
- package/dist/node_modules/date-fns/eachDayOfInterval.js +15 -0
- package/dist/node_modules/date-fns/endOfDay.js +8 -0
- package/dist/node_modules/date-fns/format.js +59 -0
- package/dist/node_modules/date-fns/getDayOfYear.js +10 -0
- package/dist/node_modules/date-fns/getISODay.js +8 -0
- package/dist/node_modules/date-fns/getISOWeek.js +11 -0
- package/dist/node_modules/date-fns/getISOWeekYear.js +14 -0
- package/dist/node_modules/date-fns/getWeek.js +11 -0
- package/dist/node_modules/date-fns/getWeekYear.js +15 -0
- package/dist/node_modules/date-fns/isDate.js +6 -0
- package/dist/node_modules/date-fns/isValid.js +8 -0
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +17 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +22 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +18 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +69 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +32 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +202 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +124 -0
- package/dist/node_modules/date-fns/locale/en-US.js +20 -0
- package/dist/node_modules/date-fns/startOfDay.js +8 -0
- package/dist/node_modules/date-fns/startOfISOWeek.js +10 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +10 -0
- package/dist/node_modules/date-fns/startOfWeek.js +9 -0
- package/dist/node_modules/date-fns/startOfWeekYear.js +11 -0
- package/dist/node_modules/date-fns/startOfYear.js +8 -0
- package/dist/node_modules/date-fns/toDate.js +7 -0
- package/dist/punkt-react.cjs +1 -1
- package/dist/punkt-react.js +55 -9388
- package/dist/shared-strings/consent.js +113 -0
- package/dist/shared-strings/format.js +18 -0
- package/dist/shared-strings/nb.js +201 -0
- package/dist/shared-strings/resolve.js +40 -0
- package/dist/shared-strings/store.js +35 -0
- package/dist/shared-types/accordion.js +4 -0
- package/dist/shared-types/calendar.js +12 -0
- package/dist/shared-types/card.js +15 -0
- package/dist/shared-types/checkbox.js +15 -0
- package/dist/shared-types/combobox.js +19 -0
- package/dist/shared-types/consent.js +8 -0
- package/dist/shared-types/footer.js +4 -0
- package/dist/shared-types/header-footer.js +4 -0
- package/dist/shared-types/icon.js +7 -0
- package/dist/shared-types/messagebox.js +8 -0
- package/dist/shared-types/option-group.js +14 -0
- package/dist/shared-types/radiobutton.js +11 -0
- package/dist/shared-types/select.js +14 -0
- package/dist/shared-types/table.js +8 -0
- package/dist/shared-utils/calendar/calendar-grid.js +19 -0
- package/dist/shared-utils/calendar/date-validation.js +19 -0
- package/dist/shared-utils/calendar/keyboard-navigation.js +26 -0
- package/dist/shared-utils/calendar/selection-manager.js +52 -0
- package/dist/shared-utils/combobox/input-utils.js +39 -0
- package/dist/shared-utils/combobox/keyboard-navigation.js +41 -0
- package/dist/shared-utils/combobox/option-utils.js +48 -0
- package/dist/shared-utils/date-utils.js +71 -0
- package/dist/shared-utils/datepicker-utils.js +32 -0
- package/dist/shared-utils/device-utils.js +7 -0
- package/dist/shared-utils/fileupload/announcements.js +21 -0
- package/dist/shared-utils/fileupload/filename.js +8 -0
- package/dist/shared-utils/fileupload/focus-trap.js +2 -0
- package/dist/shared-utils/fileupload/formats.js +29 -0
- package/dist/shared-utils/fileupload/index.js +11 -0
- package/dist/shared-utils/fileupload/navigation.js +6 -0
- package/dist/shared-utils/fileupload/size.js +25 -0
- package/dist/shared-utils/fileupload/transfers.js +23 -0
- package/dist/shared-utils/fileupload/truncate.js +9 -0
- package/dist/shared-utils/fileupload/validation.js +32 -0
- package/dist/shared-utils/focus-trap/index.js +60 -0
- package/dist/shared-utils/forms/described-by.js +7 -0
- package/dist/shared-utils/header-footer/external-domain.js +30 -0
- package/dist/shared-utils/header-footer/fetch-header-footer-data.js +29 -0
- package/dist/shared-utils/header-footer/icon-map.js +55 -0
- package/dist/shared-utils/header-footer/select-megamenu.js +7 -0
- package/dist/shared-utils/scroll-lock/index.js +21 -0
- package/dist/shared-utils/timepicker/options.js +10 -0
- package/dist/shared-utils/timepicker/stepper.js +10 -0
- package/dist/shared-utils/timepicker/time-utils.js +7 -0
- package/dist/shared-utils/value-utils.js +12 -0
- package/dist/utils/nativeInputValue.js +6 -0
- package/dist/utils/stableKeys.js +13 -0
- package/dist/utils/stringutils.js +7 -0
- package/package.json +3 -2
- package/src/components/checkbox/Checkbox.tsx +2 -0
- package/src/components/combobox/types.ts +0 -2
- package/src/components/fileupload/FileUpload.tsx +3 -1
- package/src/components/fileupload/FileUploadContext.ts +7 -0
- package/src/components/fileupload/QueueDisplay.tsx +3 -3
- package/src/components/fileupload/Subcomponents.tsx +2 -7
- package/src/components/fileupload/extensions/Comments.tsx +2 -1
- package/src/components/fileupload/extensions/Rename.tsx +2 -1
- package/src/components/fileupload/types.ts +1 -2
- package/src/components/header/Header.test.tsx +0 -7
- package/src/components/header/Header.tsx +0 -2
- package/src/components/heading/Heading.tsx +0 -2
- package/src/components/hydration.test.tsx +61 -15
- package/src/components/icon/Icon.test.tsx +0 -7
- package/src/components/icon/Icon.tsx +7 -0
- package/src/components/input/Input.tsx +0 -2
- package/src/components/link/Link.tsx +0 -2
- package/src/components/radio/RadioButton.tsx +2 -0
- package/src/components/server-components.test.ts +69 -0
- package/src/components/stepper/Step.tsx +0 -2
- package/src/components/stepper/Stepper.tsx +0 -2
- package/src/components/strings/PktStringsProvider.tsx +2 -0
- package/src/components/table/Table.tsx +0 -2
- package/src/components/table/TableBody.tsx +1 -3
- package/src/components/table/TableDataCell.tsx +0 -2
- package/src/components/table/TableHeader.tsx +0 -2
- package/src/components/table/TableHeaderCell.tsx +0 -2
- package/src/components/table/TableRow.tsx +0 -2
- package/dist/components/accordion/Accordion.test.d.ts +0 -0
- package/dist/components/alert/Alert.test.d.ts +0 -0
- package/dist/components/backlink/BackLink.test.d.ts +0 -0
- package/dist/components/breadcrumbs/Breadcrumbs.test.d.ts +0 -1
- package/dist/components/button/Button.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.accessibility.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.constraints.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.core.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.interaction.test.d.ts +0 -0
- package/dist/components/calendar/Calendar.selection.test.d.ts +0 -0
- package/dist/components/card/Card.test.d.ts +0 -0
- package/dist/components/checkbox/Checkbox.test.d.ts +0 -0
- package/dist/components/checkboxgroup/CheckboxGroup.forms.test.d.ts +0 -0
- package/dist/components/checkboxgroup/CheckboxGroup.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.accessibility.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.core.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.interaction.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.preselection.test.d.ts +0 -0
- package/dist/components/combobox/Combobox.selection.test.d.ts +0 -0
- package/dist/components/consent/Consent.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.accessibility.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.core.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.input.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.selection.test.d.ts +0 -0
- package/dist/components/datepicker/Datepicker.validation.test.d.ts +0 -0
- package/dist/components/fileupload/FileUpload.test.d.ts +0 -0
- package/dist/components/fileupload/QueueDisplay.test.d.ts +0 -0
- package/dist/components/fileupload/Truncate.test.d.ts +0 -0
- package/dist/components/footer/Footer.accessibility.test.d.ts +0 -0
- package/dist/components/footer/Footer.test.d.ts +0 -1
- package/dist/components/footerSimple/FooterSimple.test.d.ts +0 -1
- package/dist/components/formAttribute.test.d.ts +0 -1
- package/dist/components/header/Header.test.d.ts +0 -0
- package/dist/components/header/HeaderGlobal.accessibility.test.d.ts +0 -0
- package/dist/components/header/HeaderGlobal.test.d.ts +0 -0
- package/dist/components/header/HeaderService.accessibility.test.d.ts +0 -0
- package/dist/components/header/HeaderService.test.d.ts +0 -0
- package/dist/components/header-menu/HeaderMenu.test.d.ts +0 -0
- package/dist/components/headerUserMenu/UserMenu.test.d.ts +0 -0
- package/dist/components/heading/Heading.test.d.ts +0 -0
- package/dist/components/helptext/Helptext.test.d.ts +0 -0
- package/dist/components/helptext/helptextAssociation.test.d.ts +0 -1
- package/dist/components/hydration.test.d.ts +0 -1
- package/dist/components/icon/Icon.test.d.ts +0 -9
- package/dist/components/inputwrapper/InputWrapper.test.d.ts +0 -0
- package/dist/components/link/Link.test.d.ts +0 -1
- package/dist/components/linkcard/LinkCard.test.d.ts +0 -0
- package/dist/components/loader/Loader.test.d.ts +0 -0
- package/dist/components/messagebox/Messagebox.test.d.ts +0 -1
- package/dist/components/modal/Modal.test.d.ts +0 -0
- package/dist/components/progressbar/Progressbar.test.d.ts +0 -0
- package/dist/components/radio/RadioButton.test.d.ts +0 -0
- package/dist/components/radiogroup/RadioGroup.forms.test.d.ts +0 -0
- package/dist/components/radiogroup/RadioGroup.test.d.ts +0 -0
- package/dist/components/searchinput/SearchInput.test.d.ts +0 -0
- package/dist/components/select/Select.test.d.ts +0 -0
- package/dist/components/ssr.test.d.ts +0 -1
- package/dist/components/stepper/Stepper.test.d.ts +0 -0
- package/dist/components/strings/strings-override.test.d.ts +0 -1
- package/dist/components/table/Table.test.d.ts +0 -0
- package/dist/components/tabs/Tabs.test.d.ts +0 -0
- package/dist/components/tag/Tag.test.d.ts +0 -0
- package/dist/components/textarea/Textarea.test.d.ts +0 -0
- package/dist/components/textinput/Textinput.test.d.ts +0 -0
- package/dist/components/timepicker/Timepicker.test.d.ts +0 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import e from "../../getISOWeekYear.js";
|
|
2
|
+
import t from "../../getDayOfYear.js";
|
|
3
|
+
import n from "../../getISOWeek.js";
|
|
4
|
+
import r from "../../getWeekYear.js";
|
|
5
|
+
import i from "../../getWeek.js";
|
|
6
|
+
import { addLeadingZeros as a } from "../addLeadingZeros.js";
|
|
7
|
+
import { lightFormatters as o } from "./lightFormatters.js";
|
|
8
|
+
//#region ../../node_modules/date-fns/_lib/format/formatters.js
|
|
9
|
+
var s = {
|
|
10
|
+
am: "am",
|
|
11
|
+
pm: "pm",
|
|
12
|
+
midnight: "midnight",
|
|
13
|
+
noon: "noon",
|
|
14
|
+
morning: "morning",
|
|
15
|
+
afternoon: "afternoon",
|
|
16
|
+
evening: "evening",
|
|
17
|
+
night: "night"
|
|
18
|
+
}, c = {
|
|
19
|
+
G: function(e, t, n) {
|
|
20
|
+
let r = +(e.getFullYear() > 0);
|
|
21
|
+
switch (t) {
|
|
22
|
+
case "G":
|
|
23
|
+
case "GG":
|
|
24
|
+
case "GGG": return n.era(r, { width: "abbreviated" });
|
|
25
|
+
case "GGGGG": return n.era(r, { width: "narrow" });
|
|
26
|
+
default: return n.era(r, { width: "wide" });
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
y: function(e, t, n) {
|
|
30
|
+
if (t === "yo") {
|
|
31
|
+
let t = e.getFullYear(), r = t > 0 ? t : 1 - t;
|
|
32
|
+
return n.ordinalNumber(r, { unit: "year" });
|
|
33
|
+
}
|
|
34
|
+
return o.y(e, t);
|
|
35
|
+
},
|
|
36
|
+
Y: function(e, t, n, i) {
|
|
37
|
+
let o = r(e, i), s = o > 0 ? o : 1 - o;
|
|
38
|
+
if (t === "YY") {
|
|
39
|
+
let e = s % 100;
|
|
40
|
+
return a(e, 2);
|
|
41
|
+
}
|
|
42
|
+
return t === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : a(s, t.length);
|
|
43
|
+
},
|
|
44
|
+
R: function(t, n) {
|
|
45
|
+
let r = e(t);
|
|
46
|
+
return a(r, n.length);
|
|
47
|
+
},
|
|
48
|
+
u: function(e, t) {
|
|
49
|
+
let n = e.getFullYear();
|
|
50
|
+
return a(n, t.length);
|
|
51
|
+
},
|
|
52
|
+
Q: function(e, t, n) {
|
|
53
|
+
let r = Math.ceil((e.getMonth() + 1) / 3);
|
|
54
|
+
switch (t) {
|
|
55
|
+
case "Q": return String(r);
|
|
56
|
+
case "QQ": return a(r, 2);
|
|
57
|
+
case "Qo": return n.ordinalNumber(r, { unit: "quarter" });
|
|
58
|
+
case "QQQ": return n.quarter(r, {
|
|
59
|
+
width: "abbreviated",
|
|
60
|
+
context: "formatting"
|
|
61
|
+
});
|
|
62
|
+
case "QQQQQ": return n.quarter(r, {
|
|
63
|
+
width: "narrow",
|
|
64
|
+
context: "formatting"
|
|
65
|
+
});
|
|
66
|
+
default: return n.quarter(r, {
|
|
67
|
+
width: "wide",
|
|
68
|
+
context: "formatting"
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
q: function(e, t, n) {
|
|
73
|
+
let r = Math.ceil((e.getMonth() + 1) / 3);
|
|
74
|
+
switch (t) {
|
|
75
|
+
case "q": return String(r);
|
|
76
|
+
case "qq": return a(r, 2);
|
|
77
|
+
case "qo": return n.ordinalNumber(r, { unit: "quarter" });
|
|
78
|
+
case "qqq": return n.quarter(r, {
|
|
79
|
+
width: "abbreviated",
|
|
80
|
+
context: "standalone"
|
|
81
|
+
});
|
|
82
|
+
case "qqqqq": return n.quarter(r, {
|
|
83
|
+
width: "narrow",
|
|
84
|
+
context: "standalone"
|
|
85
|
+
});
|
|
86
|
+
default: return n.quarter(r, {
|
|
87
|
+
width: "wide",
|
|
88
|
+
context: "standalone"
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
M: function(e, t, n) {
|
|
93
|
+
let r = e.getMonth();
|
|
94
|
+
switch (t) {
|
|
95
|
+
case "M":
|
|
96
|
+
case "MM": return o.M(e, t);
|
|
97
|
+
case "Mo": return n.ordinalNumber(r + 1, { unit: "month" });
|
|
98
|
+
case "MMM": return n.month(r, {
|
|
99
|
+
width: "abbreviated",
|
|
100
|
+
context: "formatting"
|
|
101
|
+
});
|
|
102
|
+
case "MMMMM": return n.month(r, {
|
|
103
|
+
width: "narrow",
|
|
104
|
+
context: "formatting"
|
|
105
|
+
});
|
|
106
|
+
default: return n.month(r, {
|
|
107
|
+
width: "wide",
|
|
108
|
+
context: "formatting"
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
L: function(e, t, n) {
|
|
113
|
+
let r = e.getMonth();
|
|
114
|
+
switch (t) {
|
|
115
|
+
case "L": return String(r + 1);
|
|
116
|
+
case "LL": return a(r + 1, 2);
|
|
117
|
+
case "Lo": return n.ordinalNumber(r + 1, { unit: "month" });
|
|
118
|
+
case "LLL": return n.month(r, {
|
|
119
|
+
width: "abbreviated",
|
|
120
|
+
context: "standalone"
|
|
121
|
+
});
|
|
122
|
+
case "LLLLL": return n.month(r, {
|
|
123
|
+
width: "narrow",
|
|
124
|
+
context: "standalone"
|
|
125
|
+
});
|
|
126
|
+
default: return n.month(r, {
|
|
127
|
+
width: "wide",
|
|
128
|
+
context: "standalone"
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
w: function(e, t, n, r) {
|
|
133
|
+
let o = i(e, r);
|
|
134
|
+
return t === "wo" ? n.ordinalNumber(o, { unit: "week" }) : a(o, t.length);
|
|
135
|
+
},
|
|
136
|
+
I: function(e, t, r) {
|
|
137
|
+
let i = n(e);
|
|
138
|
+
return t === "Io" ? r.ordinalNumber(i, { unit: "week" }) : a(i, t.length);
|
|
139
|
+
},
|
|
140
|
+
d: function(e, t, n) {
|
|
141
|
+
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : o.d(e, t);
|
|
142
|
+
},
|
|
143
|
+
D: function(e, n, r) {
|
|
144
|
+
let i = t(e);
|
|
145
|
+
return n === "Do" ? r.ordinalNumber(i, { unit: "dayOfYear" }) : a(i, n.length);
|
|
146
|
+
},
|
|
147
|
+
E: function(e, t, n) {
|
|
148
|
+
let r = e.getDay();
|
|
149
|
+
switch (t) {
|
|
150
|
+
case "E":
|
|
151
|
+
case "EE":
|
|
152
|
+
case "EEE": return n.day(r, {
|
|
153
|
+
width: "abbreviated",
|
|
154
|
+
context: "formatting"
|
|
155
|
+
});
|
|
156
|
+
case "EEEEE": return n.day(r, {
|
|
157
|
+
width: "narrow",
|
|
158
|
+
context: "formatting"
|
|
159
|
+
});
|
|
160
|
+
case "EEEEEE": return n.day(r, {
|
|
161
|
+
width: "short",
|
|
162
|
+
context: "formatting"
|
|
163
|
+
});
|
|
164
|
+
default: return n.day(r, {
|
|
165
|
+
width: "wide",
|
|
166
|
+
context: "formatting"
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
e: function(e, t, n, r) {
|
|
171
|
+
let i = e.getDay(), o = (i - r.weekStartsOn + 8) % 7 || 7;
|
|
172
|
+
switch (t) {
|
|
173
|
+
case "e": return String(o);
|
|
174
|
+
case "ee": return a(o, 2);
|
|
175
|
+
case "eo": return n.ordinalNumber(o, { unit: "day" });
|
|
176
|
+
case "eee": return n.day(i, {
|
|
177
|
+
width: "abbreviated",
|
|
178
|
+
context: "formatting"
|
|
179
|
+
});
|
|
180
|
+
case "eeeee": return n.day(i, {
|
|
181
|
+
width: "narrow",
|
|
182
|
+
context: "formatting"
|
|
183
|
+
});
|
|
184
|
+
case "eeeeee": return n.day(i, {
|
|
185
|
+
width: "short",
|
|
186
|
+
context: "formatting"
|
|
187
|
+
});
|
|
188
|
+
default: return n.day(i, {
|
|
189
|
+
width: "wide",
|
|
190
|
+
context: "formatting"
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
c: function(e, t, n, r) {
|
|
195
|
+
let i = e.getDay(), o = (i - r.weekStartsOn + 8) % 7 || 7;
|
|
196
|
+
switch (t) {
|
|
197
|
+
case "c": return String(o);
|
|
198
|
+
case "cc": return a(o, t.length);
|
|
199
|
+
case "co": return n.ordinalNumber(o, { unit: "day" });
|
|
200
|
+
case "ccc": return n.day(i, {
|
|
201
|
+
width: "abbreviated",
|
|
202
|
+
context: "standalone"
|
|
203
|
+
});
|
|
204
|
+
case "ccccc": return n.day(i, {
|
|
205
|
+
width: "narrow",
|
|
206
|
+
context: "standalone"
|
|
207
|
+
});
|
|
208
|
+
case "cccccc": return n.day(i, {
|
|
209
|
+
width: "short",
|
|
210
|
+
context: "standalone"
|
|
211
|
+
});
|
|
212
|
+
default: return n.day(i, {
|
|
213
|
+
width: "wide",
|
|
214
|
+
context: "standalone"
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
i: function(e, t, n) {
|
|
219
|
+
let r = e.getDay(), i = r === 0 ? 7 : r;
|
|
220
|
+
switch (t) {
|
|
221
|
+
case "i": return String(i);
|
|
222
|
+
case "ii": return a(i, t.length);
|
|
223
|
+
case "io": return n.ordinalNumber(i, { unit: "day" });
|
|
224
|
+
case "iii": return n.day(r, {
|
|
225
|
+
width: "abbreviated",
|
|
226
|
+
context: "formatting"
|
|
227
|
+
});
|
|
228
|
+
case "iiiii": return n.day(r, {
|
|
229
|
+
width: "narrow",
|
|
230
|
+
context: "formatting"
|
|
231
|
+
});
|
|
232
|
+
case "iiiiii": return n.day(r, {
|
|
233
|
+
width: "short",
|
|
234
|
+
context: "formatting"
|
|
235
|
+
});
|
|
236
|
+
default: return n.day(r, {
|
|
237
|
+
width: "wide",
|
|
238
|
+
context: "formatting"
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
a: function(e, t, n) {
|
|
243
|
+
let r = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
244
|
+
switch (t) {
|
|
245
|
+
case "a":
|
|
246
|
+
case "aa": return n.dayPeriod(r, {
|
|
247
|
+
width: "abbreviated",
|
|
248
|
+
context: "formatting"
|
|
249
|
+
});
|
|
250
|
+
case "aaa": return n.dayPeriod(r, {
|
|
251
|
+
width: "abbreviated",
|
|
252
|
+
context: "formatting"
|
|
253
|
+
}).toLowerCase();
|
|
254
|
+
case "aaaaa": return n.dayPeriod(r, {
|
|
255
|
+
width: "narrow",
|
|
256
|
+
context: "formatting"
|
|
257
|
+
});
|
|
258
|
+
default: return n.dayPeriod(r, {
|
|
259
|
+
width: "wide",
|
|
260
|
+
context: "formatting"
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
b: function(e, t, n) {
|
|
265
|
+
let r = e.getHours(), i;
|
|
266
|
+
switch (i = r === 12 ? s.noon : r === 0 ? s.midnight : r / 12 >= 1 ? "pm" : "am", t) {
|
|
267
|
+
case "b":
|
|
268
|
+
case "bb": return n.dayPeriod(i, {
|
|
269
|
+
width: "abbreviated",
|
|
270
|
+
context: "formatting"
|
|
271
|
+
});
|
|
272
|
+
case "bbb": return n.dayPeriod(i, {
|
|
273
|
+
width: "abbreviated",
|
|
274
|
+
context: "formatting"
|
|
275
|
+
}).toLowerCase();
|
|
276
|
+
case "bbbbb": return n.dayPeriod(i, {
|
|
277
|
+
width: "narrow",
|
|
278
|
+
context: "formatting"
|
|
279
|
+
});
|
|
280
|
+
default: return n.dayPeriod(i, {
|
|
281
|
+
width: "wide",
|
|
282
|
+
context: "formatting"
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
B: function(e, t, n) {
|
|
287
|
+
let r = e.getHours(), i;
|
|
288
|
+
switch (i = r >= 17 ? s.evening : r >= 12 ? s.afternoon : r >= 4 ? s.morning : s.night, t) {
|
|
289
|
+
case "B":
|
|
290
|
+
case "BB":
|
|
291
|
+
case "BBB": return n.dayPeriod(i, {
|
|
292
|
+
width: "abbreviated",
|
|
293
|
+
context: "formatting"
|
|
294
|
+
});
|
|
295
|
+
case "BBBBB": return n.dayPeriod(i, {
|
|
296
|
+
width: "narrow",
|
|
297
|
+
context: "formatting"
|
|
298
|
+
});
|
|
299
|
+
default: return n.dayPeriod(i, {
|
|
300
|
+
width: "wide",
|
|
301
|
+
context: "formatting"
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
h: function(e, t, n) {
|
|
306
|
+
if (t === "ho") {
|
|
307
|
+
let t = e.getHours() % 12;
|
|
308
|
+
return t === 0 && (t = 12), n.ordinalNumber(t, { unit: "hour" });
|
|
309
|
+
}
|
|
310
|
+
return o.h(e, t);
|
|
311
|
+
},
|
|
312
|
+
H: function(e, t, n) {
|
|
313
|
+
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : o.H(e, t);
|
|
314
|
+
},
|
|
315
|
+
K: function(e, t, n) {
|
|
316
|
+
let r = e.getHours() % 12;
|
|
317
|
+
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : a(r, t.length);
|
|
318
|
+
},
|
|
319
|
+
k: function(e, t, n) {
|
|
320
|
+
let r = e.getHours();
|
|
321
|
+
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : a(r, t.length);
|
|
322
|
+
},
|
|
323
|
+
m: function(e, t, n) {
|
|
324
|
+
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : o.m(e, t);
|
|
325
|
+
},
|
|
326
|
+
s: function(e, t, n) {
|
|
327
|
+
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : o.s(e, t);
|
|
328
|
+
},
|
|
329
|
+
S: function(e, t) {
|
|
330
|
+
return o.S(e, t);
|
|
331
|
+
},
|
|
332
|
+
X: function(e, t, n) {
|
|
333
|
+
let r = e.getTimezoneOffset();
|
|
334
|
+
if (r === 0) return "Z";
|
|
335
|
+
switch (t) {
|
|
336
|
+
case "X": return u(r);
|
|
337
|
+
case "XXXX":
|
|
338
|
+
case "XX": return d(r);
|
|
339
|
+
default: return d(r, ":");
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
x: function(e, t, n) {
|
|
343
|
+
let r = e.getTimezoneOffset();
|
|
344
|
+
switch (t) {
|
|
345
|
+
case "x": return u(r);
|
|
346
|
+
case "xxxx":
|
|
347
|
+
case "xx": return d(r);
|
|
348
|
+
default: return d(r, ":");
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
O: function(e, t, n) {
|
|
352
|
+
let r = e.getTimezoneOffset();
|
|
353
|
+
switch (t) {
|
|
354
|
+
case "O":
|
|
355
|
+
case "OO":
|
|
356
|
+
case "OOO": return "GMT" + l(r, ":");
|
|
357
|
+
default: return "GMT" + d(r, ":");
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
z: function(e, t, n) {
|
|
361
|
+
let r = e.getTimezoneOffset();
|
|
362
|
+
switch (t) {
|
|
363
|
+
case "z":
|
|
364
|
+
case "zz":
|
|
365
|
+
case "zzz": return "GMT" + l(r, ":");
|
|
366
|
+
default: return "GMT" + d(r, ":");
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
t: function(e, t, n) {
|
|
370
|
+
let r = Math.trunc(e / 1e3);
|
|
371
|
+
return a(r, t.length);
|
|
372
|
+
},
|
|
373
|
+
T: function(e, t, n) {
|
|
374
|
+
return a(+e, t.length);
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
function l(e, t = "") {
|
|
378
|
+
let n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.trunc(r / 60), o = r % 60;
|
|
379
|
+
return o === 0 ? n + String(i) : n + String(i) + t + a(o, 2);
|
|
380
|
+
}
|
|
381
|
+
function u(e, t) {
|
|
382
|
+
return e % 60 == 0 ? (e > 0 ? "-" : "+") + a(Math.abs(e) / 60, 2) : d(e, t);
|
|
383
|
+
}
|
|
384
|
+
function d(e, t = "") {
|
|
385
|
+
let n = e > 0 ? "-" : "+", r = Math.abs(e), i = a(Math.trunc(r / 60), 2), o = a(r % 60, 2);
|
|
386
|
+
return n + i + t + o;
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
export { c as formatters };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { addLeadingZeros as e } from "../addLeadingZeros.js";
|
|
2
|
+
//#region ../../node_modules/date-fns/_lib/format/lightFormatters.js
|
|
3
|
+
var t = {
|
|
4
|
+
y(t, n) {
|
|
5
|
+
let r = t.getFullYear(), i = r > 0 ? r : 1 - r;
|
|
6
|
+
return e(n === "yy" ? i % 100 : i, n.length);
|
|
7
|
+
},
|
|
8
|
+
M(t, n) {
|
|
9
|
+
let r = t.getMonth();
|
|
10
|
+
return n === "M" ? String(r + 1) : e(r + 1, 2);
|
|
11
|
+
},
|
|
12
|
+
d(t, n) {
|
|
13
|
+
return e(t.getDate(), n.length);
|
|
14
|
+
},
|
|
15
|
+
a(e, t) {
|
|
16
|
+
let n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
17
|
+
switch (t) {
|
|
18
|
+
case "a":
|
|
19
|
+
case "aa": return n.toUpperCase();
|
|
20
|
+
case "aaa": return n;
|
|
21
|
+
case "aaaaa": return n[0];
|
|
22
|
+
default: return n === "am" ? "a.m." : "p.m.";
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
h(t, n) {
|
|
26
|
+
return e(t.getHours() % 12 || 12, n.length);
|
|
27
|
+
},
|
|
28
|
+
H(t, n) {
|
|
29
|
+
return e(t.getHours(), n.length);
|
|
30
|
+
},
|
|
31
|
+
m(t, n) {
|
|
32
|
+
return e(t.getMinutes(), n.length);
|
|
33
|
+
},
|
|
34
|
+
s(t, n) {
|
|
35
|
+
return e(t.getSeconds(), n.length);
|
|
36
|
+
},
|
|
37
|
+
S(t, n) {
|
|
38
|
+
let r = n.length, i = t.getMilliseconds(), a = Math.trunc(i * 10 ** (r - 3));
|
|
39
|
+
return e(a, n.length);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { t as lightFormatters };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/_lib/format/longFormatters.js
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
switch (e) {
|
|
4
|
+
case "P": return t.date({ width: "short" });
|
|
5
|
+
case "PP": return t.date({ width: "medium" });
|
|
6
|
+
case "PPP": return t.date({ width: "long" });
|
|
7
|
+
default: return t.date({ width: "full" });
|
|
8
|
+
}
|
|
9
|
+
}, t = (e, t) => {
|
|
10
|
+
switch (e) {
|
|
11
|
+
case "p": return t.time({ width: "short" });
|
|
12
|
+
case "pp": return t.time({ width: "medium" });
|
|
13
|
+
case "ppp": return t.time({ width: "long" });
|
|
14
|
+
default: return t.time({ width: "full" });
|
|
15
|
+
}
|
|
16
|
+
}, n = {
|
|
17
|
+
p: t,
|
|
18
|
+
P: (n, r) => {
|
|
19
|
+
let i = n.match(/(P+)(p+)?/) || [], a = i[1], o = i[2];
|
|
20
|
+
if (!o) return e(n, r);
|
|
21
|
+
let s;
|
|
22
|
+
switch (a) {
|
|
23
|
+
case "P":
|
|
24
|
+
s = r.dateTime({ width: "short" });
|
|
25
|
+
break;
|
|
26
|
+
case "PP":
|
|
27
|
+
s = r.dateTime({ width: "medium" });
|
|
28
|
+
break;
|
|
29
|
+
case "PPP":
|
|
30
|
+
s = r.dateTime({ width: "long" });
|
|
31
|
+
break;
|
|
32
|
+
default: s = r.dateTime({ width: "full" });
|
|
33
|
+
}
|
|
34
|
+
return s.replace("{{date}}", e(a, r)).replace("{{time}}", t(o, r));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { n as longFormatters };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import e from "../toDate.js";
|
|
2
|
+
//#region ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
|
3
|
+
function t(t) {
|
|
4
|
+
let n = e(t), r = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds()));
|
|
5
|
+
return r.setUTCFullYear(n.getFullYear()), t - +r;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as getTimezoneOffsetInMilliseconds };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { constructFrom as e } from "../constructFrom.js";
|
|
2
|
+
//#region ../../node_modules/date-fns/_lib/normalizeDates.js
|
|
3
|
+
function t(t, ...n) {
|
|
4
|
+
let r = e.bind(null, t || n.find((e) => typeof e == "object"));
|
|
5
|
+
return n.map(r);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as normalizeDates };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { normalizeDates as e } from "./normalizeDates.js";
|
|
2
|
+
//#region ../../node_modules/date-fns/_lib/normalizeInterval.js
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
let [r, i] = e(t, n.start, n.end);
|
|
5
|
+
return {
|
|
6
|
+
start: r,
|
|
7
|
+
end: i
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as normalizeInterval };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/_lib/protectedTokens.js
|
|
2
|
+
var e = /^D+$/, t = /^Y+$/, n = [
|
|
3
|
+
"D",
|
|
4
|
+
"DD",
|
|
5
|
+
"YY",
|
|
6
|
+
"YYYY"
|
|
7
|
+
];
|
|
8
|
+
function r(t) {
|
|
9
|
+
return e.test(t);
|
|
10
|
+
}
|
|
11
|
+
function i(e) {
|
|
12
|
+
return t.test(e);
|
|
13
|
+
}
|
|
14
|
+
function a(e, t, r) {
|
|
15
|
+
let i = o(e, t, r);
|
|
16
|
+
if (console.warn(i), n.includes(e)) throw RangeError(i);
|
|
17
|
+
}
|
|
18
|
+
function o(e, t, n) {
|
|
19
|
+
let r = e[0] === "Y" ? "years" : "days of the month";
|
|
20
|
+
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { r as isProtectedDayOfYearToken, i as isProtectedWeekYearToken, a as warnOrThrowProtectedError };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { constructFrom as e } from "./constructFrom.js";
|
|
2
|
+
import t from "./toDate.js";
|
|
3
|
+
//#region ../../node_modules/date-fns/addDays.js
|
|
4
|
+
function n(n, r, i) {
|
|
5
|
+
let a = t(n, i?.in);
|
|
6
|
+
return isNaN(r) ? e(i?.in || n, NaN) : (r && a.setDate(a.getDate() + r), a);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as addDays, n as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/constants.js
|
|
2
|
+
var e = 365.2425, t = 10 ** 8 * 24 * 60 * 60 * 1e3;
|
|
3
|
+
-t;
|
|
4
|
+
var n = 6048e5, r = 864e5, i = 3600, a = i * 24;
|
|
5
|
+
a * 7;
|
|
6
|
+
var o = a * e, s = o / 12;
|
|
7
|
+
s * 3;
|
|
8
|
+
var c = Symbol.for("constructDateFrom");
|
|
9
|
+
//#endregion
|
|
10
|
+
export { c as constructFromSymbol, e as daysInYear, t as maxTime, r as millisecondsInDay, n as millisecondsInWeek, a as secondsInDay, i as secondsInHour, s as secondsInMonth, o as secondsInYear };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { constructFromSymbol as e } from "./constants.js";
|
|
2
|
+
//#region ../../node_modules/date-fns/constructFrom.js
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
return typeof t == "function" ? t(n) : t && typeof t == "object" && e in t ? t[e](n) : t instanceof Date ? new t.constructor(n) : new Date(n);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as constructFrom, t as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { millisecondsInDay as e } from "./constants.js";
|
|
2
|
+
import { getTimezoneOffsetInMilliseconds as t } from "./_lib/getTimezoneOffsetInMilliseconds.js";
|
|
3
|
+
import { normalizeDates as n } from "./_lib/normalizeDates.js";
|
|
4
|
+
import r from "./startOfDay.js";
|
|
5
|
+
//#region ../../node_modules/date-fns/differenceInCalendarDays.js
|
|
6
|
+
function i(i, a, o) {
|
|
7
|
+
let [s, c] = n(o?.in, i, a), l = r(s), u = r(c), d = +l - t(l), f = +u - t(u);
|
|
8
|
+
return Math.round((d - f) / e);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { i as default, i as differenceInCalendarDays };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { constructFrom as e } from "./constructFrom.js";
|
|
2
|
+
import { normalizeInterval as t } from "./_lib/normalizeInterval.js";
|
|
3
|
+
//#region ../../node_modules/date-fns/eachDayOfInterval.js
|
|
4
|
+
function n(n, r) {
|
|
5
|
+
let { start: i, end: a } = t(r?.in, n), o = +i > +a, s = o ? +i : +a, c = o ? a : i;
|
|
6
|
+
c.setHours(0, 0, 0, 0);
|
|
7
|
+
let l = r?.step ?? 1;
|
|
8
|
+
if (!l) return [];
|
|
9
|
+
l < 0 && (l = -l, o = !o);
|
|
10
|
+
let u = [];
|
|
11
|
+
for (; +c <= s;) u.push(e(i, c)), c.setDate(c.getDate() + l), c.setHours(0, 0, 0, 0);
|
|
12
|
+
return o ? u.reverse() : u;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as default, n as eachDayOfInterval };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import e from "./toDate.js";
|
|
2
|
+
import { getDefaultOptions as t } from "./_lib/defaultOptions.js";
|
|
3
|
+
import n from "./isValid.js";
|
|
4
|
+
import r from "./locale/en-US.js";
|
|
5
|
+
import { formatters as i } from "./_lib/format/formatters.js";
|
|
6
|
+
import { longFormatters as a } from "./_lib/format/longFormatters.js";
|
|
7
|
+
import { isProtectedDayOfYearToken as o, isProtectedWeekYearToken as s, warnOrThrowProtectedError as c } from "./_lib/protectedTokens.js";
|
|
8
|
+
//#region ../../node_modules/date-fns/format.js
|
|
9
|
+
var l = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, u = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, d = /^'([^]*?)'?$/, f = /''/g, p = /[a-zA-Z]/;
|
|
10
|
+
function m(d, f, m) {
|
|
11
|
+
let g = t(), _ = m?.locale ?? g.locale ?? r, v = m?.firstWeekContainsDate ?? m?.locale?.options?.firstWeekContainsDate ?? g.firstWeekContainsDate ?? g.locale?.options?.firstWeekContainsDate ?? 1, y = m?.weekStartsOn ?? m?.locale?.options?.weekStartsOn ?? g.weekStartsOn ?? g.locale?.options?.weekStartsOn ?? 0, b = e(d, m?.in);
|
|
12
|
+
if (!n(b)) throw RangeError("Invalid time value");
|
|
13
|
+
let x = f.match(u).map((e) => {
|
|
14
|
+
let t = e[0];
|
|
15
|
+
if (t === "p" || t === "P") {
|
|
16
|
+
let n = a[t];
|
|
17
|
+
return n(e, _.formatLong);
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}).join("").match(l).map((e) => {
|
|
21
|
+
if (e === "''") return {
|
|
22
|
+
isToken: !1,
|
|
23
|
+
value: "'"
|
|
24
|
+
};
|
|
25
|
+
let t = e[0];
|
|
26
|
+
if (t === "'") return {
|
|
27
|
+
isToken: !1,
|
|
28
|
+
value: h(e)
|
|
29
|
+
};
|
|
30
|
+
if (i[t]) return {
|
|
31
|
+
isToken: !0,
|
|
32
|
+
value: e
|
|
33
|
+
};
|
|
34
|
+
if (t.match(p)) throw RangeError("Format string contains an unescaped latin alphabet character `" + t + "`");
|
|
35
|
+
return {
|
|
36
|
+
isToken: !1,
|
|
37
|
+
value: e
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
_.localize.preprocessor && (x = _.localize.preprocessor(b, x));
|
|
41
|
+
let S = {
|
|
42
|
+
firstWeekContainsDate: v,
|
|
43
|
+
weekStartsOn: y,
|
|
44
|
+
locale: _
|
|
45
|
+
};
|
|
46
|
+
return x.map((e) => {
|
|
47
|
+
if (!e.isToken) return e.value;
|
|
48
|
+
let t = e.value;
|
|
49
|
+
(!m?.useAdditionalWeekYearTokens && s(t) || !m?.useAdditionalDayOfYearTokens && o(t)) && c(t, f, String(d));
|
|
50
|
+
let n = i[t[0]];
|
|
51
|
+
return n(b, t, _.localize, S);
|
|
52
|
+
}).join("");
|
|
53
|
+
}
|
|
54
|
+
function h(e) {
|
|
55
|
+
let t = e.match(d);
|
|
56
|
+
return t ? t[1].replace(f, "'") : e;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { m as default, m as format, m as formatDate, i as formatters, a as longFormatters };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e from "./toDate.js";
|
|
2
|
+
import t from "./differenceInCalendarDays.js";
|
|
3
|
+
import n from "./startOfYear.js";
|
|
4
|
+
//#region ../../node_modules/date-fns/getDayOfYear.js
|
|
5
|
+
function r(r, i) {
|
|
6
|
+
let a = e(r, i?.in);
|
|
7
|
+
return t(a, n(a)) + 1;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as default, r as getDayOfYear };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { millisecondsInWeek as e } from "./constants.js";
|
|
2
|
+
import t from "./toDate.js";
|
|
3
|
+
import n from "./startOfISOWeek.js";
|
|
4
|
+
import r from "./startOfISOWeekYear.js";
|
|
5
|
+
//#region ../../node_modules/date-fns/getISOWeek.js
|
|
6
|
+
function i(i, a) {
|
|
7
|
+
let o = t(i, a?.in), s = n(o) - +r(o);
|
|
8
|
+
return Math.round(s / e) + 1;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { i as default, i as getISOWeek };
|