@oslokommune/punkt-react 19.15.6 → 19.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -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/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,14 @@
|
|
|
1
|
+
import { constructFrom as e } from "./constructFrom.js";
|
|
2
|
+
import t from "./toDate.js";
|
|
3
|
+
import n from "./startOfISOWeek.js";
|
|
4
|
+
//#region ../../node_modules/date-fns/getISOWeekYear.js
|
|
5
|
+
function r(r, i) {
|
|
6
|
+
let a = t(r, i?.in), o = a.getFullYear(), s = e(a, 0);
|
|
7
|
+
s.setFullYear(o + 1, 0, 4), s.setHours(0, 0, 0, 0);
|
|
8
|
+
let c = n(s), l = e(a, 0);
|
|
9
|
+
l.setFullYear(o, 0, 4), l.setHours(0, 0, 0, 0);
|
|
10
|
+
let u = n(l);
|
|
11
|
+
return a.getTime() >= c.getTime() ? o + 1 : a.getTime() >= u.getTime() ? o : o - 1;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as default, r as getISOWeekYear };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { millisecondsInWeek as e } from "./constants.js";
|
|
2
|
+
import t from "./toDate.js";
|
|
3
|
+
import n from "./startOfWeek.js";
|
|
4
|
+
import r from "./startOfWeekYear.js";
|
|
5
|
+
//#region ../../node_modules/date-fns/getWeek.js
|
|
6
|
+
function i(i, a) {
|
|
7
|
+
let o = t(i, a?.in), s = n(o, a) - +r(o, a);
|
|
8
|
+
return Math.round(s / e) + 1;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { i as default, i as getWeek };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { constructFrom as e } from "./constructFrom.js";
|
|
2
|
+
import t from "./toDate.js";
|
|
3
|
+
import { getDefaultOptions as n } from "./_lib/defaultOptions.js";
|
|
4
|
+
import r from "./startOfWeek.js";
|
|
5
|
+
//#region ../../node_modules/date-fns/getWeekYear.js
|
|
6
|
+
function i(i, a) {
|
|
7
|
+
let o = t(i, a?.in), s = o.getFullYear(), c = n(), l = a?.firstWeekContainsDate ?? a?.locale?.options?.firstWeekContainsDate ?? c.firstWeekContainsDate ?? c.locale?.options?.firstWeekContainsDate ?? 1, u = e(a?.in || i, 0);
|
|
8
|
+
u.setFullYear(s + 1, 0, l), u.setHours(0, 0, 0, 0);
|
|
9
|
+
let d = r(u, a), f = e(a?.in || i, 0);
|
|
10
|
+
f.setFullYear(s, 0, l), f.setHours(0, 0, 0, 0);
|
|
11
|
+
let p = r(f, a);
|
|
12
|
+
return +o >= +d ? s + 1 : +o >= +p ? s : s - 1;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { i as default, i as getWeekYear };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return (t = {}) => {
|
|
4
|
+
let n = t.width ? String(t.width) : e.defaultWidth;
|
|
5
|
+
return e.formats[n] || e.formats[e.defaultWidth];
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { e as buildFormatLongFn };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/locale/_lib/buildLocalizeFn.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return (t, n) => {
|
|
4
|
+
let r = n?.context ? String(n.context) : "standalone", i;
|
|
5
|
+
if (r === "formatting" && e.formattingValues) {
|
|
6
|
+
let t = e.defaultFormattingWidth || e.defaultWidth, r = n?.width ? String(n.width) : t;
|
|
7
|
+
i = e.formattingValues[r] || e.formattingValues[t];
|
|
8
|
+
} else {
|
|
9
|
+
let t = e.defaultWidth, r = n?.width ? String(n.width) : e.defaultWidth;
|
|
10
|
+
i = e.values[r] || e.values[t];
|
|
11
|
+
}
|
|
12
|
+
let a = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
13
|
+
return i[a];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { e as buildLocalizeFn };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/locale/_lib/buildMatchFn.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return (r, i = {}) => {
|
|
4
|
+
let a = i.width, o = a && e.matchPatterns[a] || e.matchPatterns[e.defaultMatchWidth], s = r.match(o);
|
|
5
|
+
if (!s) return null;
|
|
6
|
+
let c = s[0], l = a && e.parsePatterns[a] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(l) ? n(l, (e) => e.test(c)) : t(l, (e) => e.test(c)), d;
|
|
7
|
+
d = e.valueCallback ? e.valueCallback(u) : u, d = i.valueCallback ? i.valueCallback(d) : d;
|
|
8
|
+
let f = r.slice(c.length);
|
|
9
|
+
return {
|
|
10
|
+
value: d,
|
|
11
|
+
rest: f
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function t(e, t) {
|
|
16
|
+
for (let n in e) if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n])) return n;
|
|
17
|
+
}
|
|
18
|
+
function n(e, t) {
|
|
19
|
+
for (let n = 0; n < e.length; n++) if (t(e[n])) return n;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { e as buildMatchFn };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return (t, n = {}) => {
|
|
4
|
+
let r = t.match(e.matchPattern);
|
|
5
|
+
if (!r) return null;
|
|
6
|
+
let i = r[0], a = t.match(e.parsePattern);
|
|
7
|
+
if (!a) return null;
|
|
8
|
+
let o = e.valueCallback ? e.valueCallback(a[0]) : a[0];
|
|
9
|
+
o = n.valueCallback ? n.valueCallback(o) : o;
|
|
10
|
+
let s = t.slice(i.length);
|
|
11
|
+
return {
|
|
12
|
+
value: o,
|
|
13
|
+
rest: s
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { e as buildMatchPatternFn };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/locale/en-US/_lib/formatDistance.js
|
|
2
|
+
var e = {
|
|
3
|
+
lessThanXSeconds: {
|
|
4
|
+
one: "less than a second",
|
|
5
|
+
other: "less than {{count}} seconds"
|
|
6
|
+
},
|
|
7
|
+
xSeconds: {
|
|
8
|
+
one: "1 second",
|
|
9
|
+
other: "{{count}} seconds"
|
|
10
|
+
},
|
|
11
|
+
halfAMinute: "half a minute",
|
|
12
|
+
lessThanXMinutes: {
|
|
13
|
+
one: "less than a minute",
|
|
14
|
+
other: "less than {{count}} minutes"
|
|
15
|
+
},
|
|
16
|
+
xMinutes: {
|
|
17
|
+
one: "1 minute",
|
|
18
|
+
other: "{{count}} minutes"
|
|
19
|
+
},
|
|
20
|
+
aboutXHours: {
|
|
21
|
+
one: "about 1 hour",
|
|
22
|
+
other: "about {{count}} hours"
|
|
23
|
+
},
|
|
24
|
+
xHours: {
|
|
25
|
+
one: "1 hour",
|
|
26
|
+
other: "{{count}} hours"
|
|
27
|
+
},
|
|
28
|
+
xDays: {
|
|
29
|
+
one: "1 day",
|
|
30
|
+
other: "{{count}} days"
|
|
31
|
+
},
|
|
32
|
+
aboutXWeeks: {
|
|
33
|
+
one: "about 1 week",
|
|
34
|
+
other: "about {{count}} weeks"
|
|
35
|
+
},
|
|
36
|
+
xWeeks: {
|
|
37
|
+
one: "1 week",
|
|
38
|
+
other: "{{count}} weeks"
|
|
39
|
+
},
|
|
40
|
+
aboutXMonths: {
|
|
41
|
+
one: "about 1 month",
|
|
42
|
+
other: "about {{count}} months"
|
|
43
|
+
},
|
|
44
|
+
xMonths: {
|
|
45
|
+
one: "1 month",
|
|
46
|
+
other: "{{count}} months"
|
|
47
|
+
},
|
|
48
|
+
aboutXYears: {
|
|
49
|
+
one: "about 1 year",
|
|
50
|
+
other: "about {{count}} years"
|
|
51
|
+
},
|
|
52
|
+
xYears: {
|
|
53
|
+
one: "1 year",
|
|
54
|
+
other: "{{count}} years"
|
|
55
|
+
},
|
|
56
|
+
overXYears: {
|
|
57
|
+
one: "over 1 year",
|
|
58
|
+
other: "over {{count}} years"
|
|
59
|
+
},
|
|
60
|
+
almostXYears: {
|
|
61
|
+
one: "almost 1 year",
|
|
62
|
+
other: "almost {{count}} years"
|
|
63
|
+
}
|
|
64
|
+
}, t = (t, n, r) => {
|
|
65
|
+
let i, a = e[t];
|
|
66
|
+
return i = typeof a == "string" ? a : n === 1 ? a.one : a.other.replace("{{count}}", n.toString()), r?.addSuffix ? r.comparison && r.comparison > 0 ? "in " + i : i + " ago" : i;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { t as formatDistance };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { buildFormatLongFn as e } from "../../_lib/buildFormatLongFn.js";
|
|
2
|
+
var t = {
|
|
3
|
+
date: e({
|
|
4
|
+
formats: {
|
|
5
|
+
full: "EEEE, MMMM do, y",
|
|
6
|
+
long: "MMMM do, y",
|
|
7
|
+
medium: "MMM d, y",
|
|
8
|
+
short: "MM/dd/yyyy"
|
|
9
|
+
},
|
|
10
|
+
defaultWidth: "full"
|
|
11
|
+
}),
|
|
12
|
+
time: e({
|
|
13
|
+
formats: {
|
|
14
|
+
full: "h:mm:ss a zzzz",
|
|
15
|
+
long: "h:mm:ss a z",
|
|
16
|
+
medium: "h:mm:ss a",
|
|
17
|
+
short: "h:mm a"
|
|
18
|
+
},
|
|
19
|
+
defaultWidth: "full"
|
|
20
|
+
}),
|
|
21
|
+
dateTime: e({
|
|
22
|
+
formats: {
|
|
23
|
+
full: "{{date}} 'at' {{time}}",
|
|
24
|
+
long: "{{date}} 'at' {{time}}",
|
|
25
|
+
medium: "{{date}}, {{time}}",
|
|
26
|
+
short: "{{date}}, {{time}}"
|
|
27
|
+
},
|
|
28
|
+
defaultWidth: "full"
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { t as formatLong };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region ../../node_modules/date-fns/locale/en-US/_lib/formatRelative.js
|
|
2
|
+
var e = {
|
|
3
|
+
lastWeek: "'last' eeee 'at' p",
|
|
4
|
+
yesterday: "'yesterday at' p",
|
|
5
|
+
today: "'today at' p",
|
|
6
|
+
tomorrow: "'tomorrow at' p",
|
|
7
|
+
nextWeek: "eeee 'at' p",
|
|
8
|
+
other: "P"
|
|
9
|
+
}, t = (t, n, r, i) => e[t];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as formatRelative };
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { buildLocalizeFn as e } from "../../_lib/buildLocalizeFn.js";
|
|
2
|
+
var t = {
|
|
3
|
+
ordinalNumber: (e, t) => {
|
|
4
|
+
let n = Number(e), r = n % 100;
|
|
5
|
+
if (r > 20 || r < 10) switch (r % 10) {
|
|
6
|
+
case 1: return n + "st";
|
|
7
|
+
case 2: return n + "nd";
|
|
8
|
+
case 3: return n + "rd";
|
|
9
|
+
}
|
|
10
|
+
return n + "th";
|
|
11
|
+
},
|
|
12
|
+
era: e({
|
|
13
|
+
values: {
|
|
14
|
+
narrow: ["B", "A"],
|
|
15
|
+
abbreviated: ["BC", "AD"],
|
|
16
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
17
|
+
},
|
|
18
|
+
defaultWidth: "wide"
|
|
19
|
+
}),
|
|
20
|
+
quarter: e({
|
|
21
|
+
values: {
|
|
22
|
+
narrow: [
|
|
23
|
+
"1",
|
|
24
|
+
"2",
|
|
25
|
+
"3",
|
|
26
|
+
"4"
|
|
27
|
+
],
|
|
28
|
+
abbreviated: [
|
|
29
|
+
"Q1",
|
|
30
|
+
"Q2",
|
|
31
|
+
"Q3",
|
|
32
|
+
"Q4"
|
|
33
|
+
],
|
|
34
|
+
wide: [
|
|
35
|
+
"1st quarter",
|
|
36
|
+
"2nd quarter",
|
|
37
|
+
"3rd quarter",
|
|
38
|
+
"4th quarter"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
defaultWidth: "wide",
|
|
42
|
+
argumentCallback: (e) => e - 1
|
|
43
|
+
}),
|
|
44
|
+
month: e({
|
|
45
|
+
values: {
|
|
46
|
+
narrow: [
|
|
47
|
+
"J",
|
|
48
|
+
"F",
|
|
49
|
+
"M",
|
|
50
|
+
"A",
|
|
51
|
+
"M",
|
|
52
|
+
"J",
|
|
53
|
+
"J",
|
|
54
|
+
"A",
|
|
55
|
+
"S",
|
|
56
|
+
"O",
|
|
57
|
+
"N",
|
|
58
|
+
"D"
|
|
59
|
+
],
|
|
60
|
+
abbreviated: [
|
|
61
|
+
"Jan",
|
|
62
|
+
"Feb",
|
|
63
|
+
"Mar",
|
|
64
|
+
"Apr",
|
|
65
|
+
"May",
|
|
66
|
+
"Jun",
|
|
67
|
+
"Jul",
|
|
68
|
+
"Aug",
|
|
69
|
+
"Sep",
|
|
70
|
+
"Oct",
|
|
71
|
+
"Nov",
|
|
72
|
+
"Dec"
|
|
73
|
+
],
|
|
74
|
+
wide: [
|
|
75
|
+
"January",
|
|
76
|
+
"February",
|
|
77
|
+
"March",
|
|
78
|
+
"April",
|
|
79
|
+
"May",
|
|
80
|
+
"June",
|
|
81
|
+
"July",
|
|
82
|
+
"August",
|
|
83
|
+
"September",
|
|
84
|
+
"October",
|
|
85
|
+
"November",
|
|
86
|
+
"December"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
defaultWidth: "wide"
|
|
90
|
+
}),
|
|
91
|
+
day: e({
|
|
92
|
+
values: {
|
|
93
|
+
narrow: [
|
|
94
|
+
"S",
|
|
95
|
+
"M",
|
|
96
|
+
"T",
|
|
97
|
+
"W",
|
|
98
|
+
"T",
|
|
99
|
+
"F",
|
|
100
|
+
"S"
|
|
101
|
+
],
|
|
102
|
+
short: [
|
|
103
|
+
"Su",
|
|
104
|
+
"Mo",
|
|
105
|
+
"Tu",
|
|
106
|
+
"We",
|
|
107
|
+
"Th",
|
|
108
|
+
"Fr",
|
|
109
|
+
"Sa"
|
|
110
|
+
],
|
|
111
|
+
abbreviated: [
|
|
112
|
+
"Sun",
|
|
113
|
+
"Mon",
|
|
114
|
+
"Tue",
|
|
115
|
+
"Wed",
|
|
116
|
+
"Thu",
|
|
117
|
+
"Fri",
|
|
118
|
+
"Sat"
|
|
119
|
+
],
|
|
120
|
+
wide: [
|
|
121
|
+
"Sunday",
|
|
122
|
+
"Monday",
|
|
123
|
+
"Tuesday",
|
|
124
|
+
"Wednesday",
|
|
125
|
+
"Thursday",
|
|
126
|
+
"Friday",
|
|
127
|
+
"Saturday"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
defaultWidth: "wide"
|
|
131
|
+
}),
|
|
132
|
+
dayPeriod: e({
|
|
133
|
+
values: {
|
|
134
|
+
narrow: {
|
|
135
|
+
am: "a",
|
|
136
|
+
pm: "p",
|
|
137
|
+
midnight: "mi",
|
|
138
|
+
noon: "n",
|
|
139
|
+
morning: "morning",
|
|
140
|
+
afternoon: "afternoon",
|
|
141
|
+
evening: "evening",
|
|
142
|
+
night: "night"
|
|
143
|
+
},
|
|
144
|
+
abbreviated: {
|
|
145
|
+
am: "AM",
|
|
146
|
+
pm: "PM",
|
|
147
|
+
midnight: "midnight",
|
|
148
|
+
noon: "noon",
|
|
149
|
+
morning: "morning",
|
|
150
|
+
afternoon: "afternoon",
|
|
151
|
+
evening: "evening",
|
|
152
|
+
night: "night"
|
|
153
|
+
},
|
|
154
|
+
wide: {
|
|
155
|
+
am: "a.m.",
|
|
156
|
+
pm: "p.m.",
|
|
157
|
+
midnight: "midnight",
|
|
158
|
+
noon: "noon",
|
|
159
|
+
morning: "morning",
|
|
160
|
+
afternoon: "afternoon",
|
|
161
|
+
evening: "evening",
|
|
162
|
+
night: "night"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
defaultWidth: "wide",
|
|
166
|
+
formattingValues: {
|
|
167
|
+
narrow: {
|
|
168
|
+
am: "a",
|
|
169
|
+
pm: "p",
|
|
170
|
+
midnight: "mi",
|
|
171
|
+
noon: "n",
|
|
172
|
+
morning: "in the morning",
|
|
173
|
+
afternoon: "in the afternoon",
|
|
174
|
+
evening: "in the evening",
|
|
175
|
+
night: "at night"
|
|
176
|
+
},
|
|
177
|
+
abbreviated: {
|
|
178
|
+
am: "AM",
|
|
179
|
+
pm: "PM",
|
|
180
|
+
midnight: "midnight",
|
|
181
|
+
noon: "noon",
|
|
182
|
+
morning: "in the morning",
|
|
183
|
+
afternoon: "in the afternoon",
|
|
184
|
+
evening: "in the evening",
|
|
185
|
+
night: "at night"
|
|
186
|
+
},
|
|
187
|
+
wide: {
|
|
188
|
+
am: "a.m.",
|
|
189
|
+
pm: "p.m.",
|
|
190
|
+
midnight: "midnight",
|
|
191
|
+
noon: "noon",
|
|
192
|
+
morning: "in the morning",
|
|
193
|
+
afternoon: "in the afternoon",
|
|
194
|
+
evening: "in the evening",
|
|
195
|
+
night: "at night"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
defaultFormattingWidth: "wide"
|
|
199
|
+
})
|
|
200
|
+
};
|
|
201
|
+
//#endregion
|
|
202
|
+
export { t as localize };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { buildMatchFn as e } from "../../_lib/buildMatchFn.js";
|
|
2
|
+
import { buildMatchPatternFn as t } from "../../_lib/buildMatchPatternFn.js";
|
|
3
|
+
var n = {
|
|
4
|
+
ordinalNumber: t({
|
|
5
|
+
matchPattern: /^(\d+)(th|st|nd|rd)?/i,
|
|
6
|
+
parsePattern: /\d+/i,
|
|
7
|
+
valueCallback: (e) => parseInt(e, 10)
|
|
8
|
+
}),
|
|
9
|
+
era: e({
|
|
10
|
+
matchPatterns: {
|
|
11
|
+
narrow: /^(b|a)/i,
|
|
12
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
13
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
14
|
+
},
|
|
15
|
+
defaultMatchWidth: "wide",
|
|
16
|
+
parsePatterns: { any: [/^b/i, /^(a|c)/i] },
|
|
17
|
+
defaultParseWidth: "any"
|
|
18
|
+
}),
|
|
19
|
+
quarter: e({
|
|
20
|
+
matchPatterns: {
|
|
21
|
+
narrow: /^[1234]/i,
|
|
22
|
+
abbreviated: /^q[1234]/i,
|
|
23
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
24
|
+
},
|
|
25
|
+
defaultMatchWidth: "wide",
|
|
26
|
+
parsePatterns: { any: [
|
|
27
|
+
/1/i,
|
|
28
|
+
/2/i,
|
|
29
|
+
/3/i,
|
|
30
|
+
/4/i
|
|
31
|
+
] },
|
|
32
|
+
defaultParseWidth: "any",
|
|
33
|
+
valueCallback: (e) => e + 1
|
|
34
|
+
}),
|
|
35
|
+
month: e({
|
|
36
|
+
matchPatterns: {
|
|
37
|
+
narrow: /^[jfmasond]/i,
|
|
38
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
39
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
40
|
+
},
|
|
41
|
+
defaultMatchWidth: "wide",
|
|
42
|
+
parsePatterns: {
|
|
43
|
+
narrow: [
|
|
44
|
+
/^j/i,
|
|
45
|
+
/^f/i,
|
|
46
|
+
/^m/i,
|
|
47
|
+
/^a/i,
|
|
48
|
+
/^m/i,
|
|
49
|
+
/^j/i,
|
|
50
|
+
/^j/i,
|
|
51
|
+
/^a/i,
|
|
52
|
+
/^s/i,
|
|
53
|
+
/^o/i,
|
|
54
|
+
/^n/i,
|
|
55
|
+
/^d/i
|
|
56
|
+
],
|
|
57
|
+
any: [
|
|
58
|
+
/^ja/i,
|
|
59
|
+
/^f/i,
|
|
60
|
+
/^mar/i,
|
|
61
|
+
/^ap/i,
|
|
62
|
+
/^may/i,
|
|
63
|
+
/^jun/i,
|
|
64
|
+
/^jul/i,
|
|
65
|
+
/^au/i,
|
|
66
|
+
/^s/i,
|
|
67
|
+
/^o/i,
|
|
68
|
+
/^n/i,
|
|
69
|
+
/^d/i
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
defaultParseWidth: "any"
|
|
73
|
+
}),
|
|
74
|
+
day: e({
|
|
75
|
+
matchPatterns: {
|
|
76
|
+
narrow: /^[smtwf]/i,
|
|
77
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
78
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
79
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
80
|
+
},
|
|
81
|
+
defaultMatchWidth: "wide",
|
|
82
|
+
parsePatterns: {
|
|
83
|
+
narrow: [
|
|
84
|
+
/^s/i,
|
|
85
|
+
/^m/i,
|
|
86
|
+
/^t/i,
|
|
87
|
+
/^w/i,
|
|
88
|
+
/^t/i,
|
|
89
|
+
/^f/i,
|
|
90
|
+
/^s/i
|
|
91
|
+
],
|
|
92
|
+
any: [
|
|
93
|
+
/^su/i,
|
|
94
|
+
/^m/i,
|
|
95
|
+
/^tu/i,
|
|
96
|
+
/^w/i,
|
|
97
|
+
/^th/i,
|
|
98
|
+
/^f/i,
|
|
99
|
+
/^sa/i
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
defaultParseWidth: "any"
|
|
103
|
+
}),
|
|
104
|
+
dayPeriod: e({
|
|
105
|
+
matchPatterns: {
|
|
106
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
107
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
108
|
+
},
|
|
109
|
+
defaultMatchWidth: "any",
|
|
110
|
+
parsePatterns: { any: {
|
|
111
|
+
am: /^a/i,
|
|
112
|
+
pm: /^p/i,
|
|
113
|
+
midnight: /^mi/i,
|
|
114
|
+
noon: /^no/i,
|
|
115
|
+
morning: /morning/i,
|
|
116
|
+
afternoon: /afternoon/i,
|
|
117
|
+
evening: /evening/i,
|
|
118
|
+
night: /night/i
|
|
119
|
+
} },
|
|
120
|
+
defaultParseWidth: "any"
|
|
121
|
+
})
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
export { n as match };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { formatDistance as e } from "./en-US/_lib/formatDistance.js";
|
|
2
|
+
import { formatLong as t } from "./en-US/_lib/formatLong.js";
|
|
3
|
+
import { formatRelative as n } from "./en-US/_lib/formatRelative.js";
|
|
4
|
+
import { localize as r } from "./en-US/_lib/localize.js";
|
|
5
|
+
import { match as i } from "./en-US/_lib/match.js";
|
|
6
|
+
//#region ../../node_modules/date-fns/locale/en-US.js
|
|
7
|
+
var a = {
|
|
8
|
+
code: "en-US",
|
|
9
|
+
formatDistance: e,
|
|
10
|
+
formatLong: t,
|
|
11
|
+
formatRelative: n,
|
|
12
|
+
localize: r,
|
|
13
|
+
match: i,
|
|
14
|
+
options: {
|
|
15
|
+
weekStartsOn: 0,
|
|
16
|
+
firstWeekContainsDate: 1
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { a as default, a as enUS };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { constructFrom as e } from "./constructFrom.js";
|
|
2
|
+
import t from "./startOfISOWeek.js";
|
|
3
|
+
import n from "./getISOWeekYear.js";
|
|
4
|
+
//#region ../../node_modules/date-fns/startOfISOWeekYear.js
|
|
5
|
+
function r(r, i) {
|
|
6
|
+
let a = n(r, i), o = e(i?.in || r, 0);
|
|
7
|
+
return o.setFullYear(a, 0, 4), o.setHours(0, 0, 0, 0), t(o);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as default, r as startOfISOWeekYear };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e from "./toDate.js";
|
|
2
|
+
import { getDefaultOptions as t } from "./_lib/defaultOptions.js";
|
|
3
|
+
//#region ../../node_modules/date-fns/startOfWeek.js
|
|
4
|
+
function n(n, r) {
|
|
5
|
+
let i = t(), a = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? i.weekStartsOn ?? i.locale?.options?.weekStartsOn ?? 0, o = e(n, r?.in), s = o.getDay(), c = (s < a ? 7 : 0) + s - a;
|
|
6
|
+
return o.setDate(o.getDate() - c), o.setHours(0, 0, 0, 0), o;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as default, n as startOfWeek };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { constructFrom as e } from "./constructFrom.js";
|
|
2
|
+
import { getDefaultOptions as t } from "./_lib/defaultOptions.js";
|
|
3
|
+
import n from "./startOfWeek.js";
|
|
4
|
+
import r from "./getWeekYear.js";
|
|
5
|
+
//#region ../../node_modules/date-fns/startOfWeekYear.js
|
|
6
|
+
function i(i, a) {
|
|
7
|
+
let o = t(), s = a?.firstWeekContainsDate ?? a?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, c = r(i, a), l = e(a?.in || i, 0);
|
|
8
|
+
return l.setFullYear(c, 0, s), l.setHours(0, 0, 0, 0), n(l, a);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { i as default, i as startOfWeekYear };
|