@oslokommune/punkt-react 20.0.4 → 20.1.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 +13 -0
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/defineProperty.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPrimitive.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPropertyKey.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/typeof.js +1 -2
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/components/accordion/Accordion.js +1 -2
- package/dist/components/accordion/AccordionItem.js +9 -10
- package/dist/components/alert/Alert.js +7 -8
- package/dist/components/backlink/BackLink.js +1 -2
- package/dist/components/breadcrumbs/Breadcrumbs.js +1 -2
- package/dist/components/button/Button.js +35 -35
- package/dist/components/calendar/Calendar.js +1 -2
- package/dist/components/calendar/CalendarGrid.js +1 -2
- package/dist/components/calendar/CalendarNav.js +5 -6
- package/dist/components/calendar/calendar-utils.js +1 -2
- package/dist/components/calendar/useCalendarState.js +90 -91
- package/dist/components/card/Card.js +14 -15
- package/dist/components/checkbox/Checkbox.js +3 -8
- package/dist/components/checkboxgroup/CheckboxGroup.js +10 -11
- package/dist/components/checkboxgroup/CheckboxGroupContext.js +1 -2
- package/dist/components/combobox/Combobox.js +5 -6
- package/dist/components/combobox/ComboboxInput.js +6 -7
- package/dist/components/combobox/ComboboxTags.js +11 -12
- package/dist/components/combobox/Listbox.js +25 -26
- package/dist/components/combobox/useComboboxState.js +38 -39
- package/dist/components/consent/Consent.js +6 -7
- package/dist/components/datepicker/DateTags.js +14 -15
- package/dist/components/datepicker/Datepicker.js +1 -2
- package/dist/components/datepicker/DatepickerInputs.js +1 -2
- package/dist/components/datepicker/DatepickerPopup.js +5 -6
- package/dist/components/datepicker/useDatepickerState.js +20 -21
- package/dist/components/fileupload/DropZone.js +6 -7
- package/dist/components/fileupload/FileUpload.js +36 -37
- package/dist/components/fileupload/FileUploadContext.js +1 -2
- package/dist/components/fileupload/QueueDisplay.js +12 -13
- package/dist/components/fileupload/QueueItemContent.js +14 -15
- package/dist/components/fileupload/Subcomponents.js +70 -71
- package/dist/components/fileupload/Truncate.js +1 -2
- package/dist/components/fileupload/extensions/Comments.js +21 -22
- package/dist/components/fileupload/extensions/Remove.js +1 -2
- package/dist/components/fileupload/extensions/Rename.js +8 -9
- package/dist/components/fileupload/hooks/useFileAttributes.js +1 -2
- package/dist/components/fileupload/hooks/useImageObjectUrl.js +1 -2
- package/dist/components/fileupload/hooks/useImagePreview.js +1 -2
- package/dist/components/fileupload/hooks/useOperationState.js +1 -2
- package/dist/components/fileupload/hooks/useRequiredFormValidation.js +1 -2
- package/dist/components/fileupload/types.js +4 -5
- package/dist/components/footer/Footer.js +23 -24
- package/dist/components/footer/FooterGlobal.js +24 -25
- package/dist/components/footerSimple/FooterSimple.js +5 -6
- package/dist/components/header/Header.js +1 -2
- package/dist/components/header/HeaderGlobal.js +127 -128
- package/dist/components/header/HeaderService.js +84 -85
- package/dist/components/header-menu/HeaderMenu.js +34 -35
- package/dist/components/headerUserMenu/UserMenu.js +14 -15
- package/dist/components/heading/Heading.js +1 -2
- package/dist/components/helptext/Helptext.js +5 -6
- package/dist/components/icon/Icon.js +2 -3
- package/dist/components/input/Input.js +1 -2
- package/dist/components/inputwrapper/InputWrapper.js +12 -17
- package/dist/components/link/Link.js +1 -2
- package/dist/components/linkcard/LinkCard.js +2 -3
- package/dist/components/loader/Loader.js +2 -3
- package/dist/components/messagebox/Messagebox.js +6 -7
- package/dist/components/modal/Modal.js +13 -14
- package/dist/components/progressbar/Progressbar.js +5 -6
- package/dist/components/radio/RadioButton.js +3 -8
- package/dist/components/radiogroup/RadioGroup.js +1 -2
- package/dist/components/radiogroup/RadioGroupContext.js +1 -2
- package/dist/components/searchinput/SearchInput.js +11 -12
- package/dist/components/select/Select.js +6 -7
- package/dist/components/stepper/Step.js +1 -2
- package/dist/components/stepper/Stepper.js +1 -2
- package/dist/components/strings/PktStringsProvider.js +1 -2
- package/dist/components/table/Table.js +2 -3
- package/dist/components/table/TableBody.js +1 -2
- package/dist/components/table/TableDataCell.js +1 -2
- package/dist/components/table/TableHeader.js +1 -2
- package/dist/components/table/TableHeaderCell.js +1 -2
- package/dist/components/table/TableRow.js +1 -2
- package/dist/components/tabs/TabItem.js +1 -2
- package/dist/components/tabs/Tabs.js +5 -6
- package/dist/components/tag/Tag.js +6 -7
- package/dist/components/textarea/Textarea.js +5 -6
- package/dist/components/textinput/Textinput.js +6 -7
- package/dist/components/timepicker/Timepicker.js +6 -7
- package/dist/components/timepicker/useTimepickerState.js +27 -28
- package/dist/hooks/useElementWidth.js +1 -2
- package/dist/hooks/useFocusModality.js +1 -2
- package/dist/hooks/useGeneratedId.js +1 -2
- package/dist/hooks/useHeaderChrome.js +1 -2
- package/dist/hooks/useOptionGroupField.js +1 -2
- package/dist/hooks/useOwnerForm.js +1 -2
- package/dist/hooks/usePktStrings.js +1 -2
- package/dist/hooks/useScrollLock.js +1 -2
- package/dist/node_modules/@date-fns/tz/date/index.js +1 -2
- package/dist/node_modules/@date-fns/tz/date/mini.js +1 -2
- package/dist/node_modules/@date-fns/tz/index.js +3 -3
- package/dist/node_modules/@date-fns/tz/tzName/index.js +1 -2
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +1 -2
- package/dist/node_modules/classnames/index.js +1 -2
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +1 -2
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +1 -2
- package/dist/node_modules/date-fns/_lib/format/formatters.js +18 -19
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +1 -2
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +1 -2
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +1 -2
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +1 -2
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +1 -2
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +1 -2
- package/dist/node_modules/date-fns/addDays.js +1 -2
- package/dist/node_modules/date-fns/constants.js +1 -2
- package/dist/node_modules/date-fns/constructFrom.js +1 -2
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +6 -7
- package/dist/node_modules/date-fns/eachDayOfInterval.js +5 -6
- package/dist/node_modules/date-fns/endOfDay.js +1 -2
- package/dist/node_modules/date-fns/format.js +15 -16
- package/dist/node_modules/date-fns/getDayOfYear.js +6 -7
- package/dist/node_modules/date-fns/getISODay.js +1 -2
- package/dist/node_modules/date-fns/getISOWeek.js +5 -6
- package/dist/node_modules/date-fns/getISOWeekYear.js +6 -7
- package/dist/node_modules/date-fns/getWeek.js +5 -6
- package/dist/node_modules/date-fns/getWeekYear.js +8 -9
- package/dist/node_modules/date-fns/isDate.js +1 -2
- package/dist/node_modules/date-fns/isValid.js +4 -5
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US.js +1 -2
- package/dist/node_modules/date-fns/startOfDay.js +1 -2
- package/dist/node_modules/date-fns/startOfISOWeek.js +1 -2
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +5 -6
- package/dist/node_modules/date-fns/startOfWeek.js +4 -5
- package/dist/node_modules/date-fns/startOfWeekYear.js +7 -8
- package/dist/node_modules/date-fns/startOfYear.js +1 -2
- package/dist/node_modules/date-fns/toDate.js +1 -2
- package/dist/punkt-react.cjs +1 -1
- package/dist/shared-strings/consent.js +1 -2
- package/dist/shared-strings/format.js +1 -2
- package/dist/shared-strings/nb.js +1 -2
- package/dist/shared-strings/resolve.js +1 -2
- package/dist/shared-strings/store.js +1 -2
- package/dist/shared-types/accordion.js +1 -2
- package/dist/shared-types/button.d.ts +13 -0
- package/dist/shared-types/button.js +14 -0
- package/dist/shared-types/calendar.js +1 -2
- package/dist/shared-types/card.js +1 -2
- package/dist/shared-types/checkbox.js +1 -2
- package/dist/shared-types/combobox.js +1 -2
- package/dist/shared-types/consent.js +1 -2
- package/dist/shared-types/footer.js +1 -2
- package/dist/shared-types/header-footer.js +1 -2
- package/dist/shared-types/icon.js +1 -2
- package/dist/shared-types/index.d.ts +1 -1
- package/dist/shared-types/index.js +11 -10
- package/dist/shared-types/input-wrapper.js +1 -2
- package/dist/shared-types/linkcard.js +1 -2
- package/dist/shared-types/loader.js +1 -2
- package/dist/shared-types/messagebox.js +1 -2
- package/dist/shared-types/option-group.js +1 -2
- package/dist/shared-types/progressbar.js +1 -2
- package/dist/shared-types/radiobutton.js +1 -2
- package/dist/shared-types/select.js +1 -2
- package/dist/shared-types/size.js +1 -2
- package/dist/shared-types/table.js +1 -2
- package/dist/shared-types/tag.js +1 -2
- package/dist/shared-types/textarea.js +1 -2
- package/dist/shared-types/textinput.js +1 -2
- package/dist/shared-utils/calendar/calendar-grid.js +4 -5
- package/dist/shared-utils/calendar/date-validation.js +1 -2
- package/dist/shared-utils/calendar/keyboard-navigation.js +1 -2
- package/dist/shared-utils/calendar/selection-manager.js +31 -32
- package/dist/shared-utils/combobox/input-utils.js +1 -2
- package/dist/shared-utils/combobox/keyboard-navigation.js +1 -2
- package/dist/shared-utils/combobox/option-utils.js +1 -2
- package/dist/shared-utils/date-utils.js +10 -11
- package/dist/shared-utils/datepicker-utils.js +4 -5
- package/dist/shared-utils/device-utils.js +1 -2
- package/dist/shared-utils/fileupload/announcements.js +1 -2
- package/dist/shared-utils/fileupload/filename.js +1 -2
- package/dist/shared-utils/fileupload/formats.js +1 -2
- package/dist/shared-utils/fileupload/navigation.js +1 -2
- package/dist/shared-utils/fileupload/size.js +1 -2
- package/dist/shared-utils/fileupload/transfers.js +1 -2
- package/dist/shared-utils/fileupload/truncate.js +1 -2
- package/dist/shared-utils/fileupload/validation.js +8 -9
- package/dist/shared-utils/focus-trap/index.js +13 -31
- package/dist/shared-utils/forms/described-by.js +1 -2
- package/dist/shared-utils/header-footer/external-domain.js +1 -2
- package/dist/shared-utils/header-footer/fetch-header-footer-data.js +1 -2
- package/dist/shared-utils/header-footer/icon-map.js +1 -2
- package/dist/shared-utils/header-footer/select-megamenu.js +1 -2
- package/dist/shared-utils/scroll-lock/index.js +1 -2
- package/dist/shared-utils/timepicker/options.js +1 -2
- package/dist/shared-utils/timepicker/stepper.js +1 -2
- package/dist/shared-utils/timepicker/time-utils.js +1 -2
- package/dist/shared-utils/value-utils.js +1 -2
- package/dist/utils/nativeInputValue.js +1 -2
- package/dist/utils/stableKeys.js +1 -2
- package/dist/utils/stringutils.js +1 -2
- package/package.json +20 -21
- package/src/components/accordion/Accordion.test.tsx +2 -4
- package/src/components/button/Button.tsx +11 -11
- package/src/components/tag/Tag.tsx +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { PktIcon as e } from "../icon/Icon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { PktTabItem as t } from "./TabItem.js";
|
|
4
|
+
import { withStableKeys as n } from "../../utils/stableKeys.js";
|
|
5
5
|
import { Children as r, createContext as i, forwardRef as a, useContext as o, useEffect as s, useRef as c } from "react";
|
|
6
6
|
import { jsx as l } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/components/tabs/Tabs.tsx
|
|
8
8
|
var u = i(null), d = () => {
|
|
9
9
|
let e = o(u);
|
|
10
10
|
if (!e) throw Error("TabItem must be used within a Tabs component");
|
|
@@ -56,7 +56,7 @@ var u = i(null), d = () => {
|
|
|
56
56
|
name: o,
|
|
57
57
|
className: "pkt-tabs__separator-icon"
|
|
58
58
|
}) : null
|
|
59
|
-
}, t), k = (e) => !S || e.length <= 1 ? e : e.flatMap((t, n) => n < e.length - 1 ? [t, O(`separator-${n}`)] : [t]), A =
|
|
59
|
+
}, t), k = (e) => !S || e.length <= 1 ? e : e.flatMap((t, n) => n < e.length - 1 ? [t, O(`separator-${n}`)] : [t]), A = n(f ?? [], (e) => `${e.href ?? ""}|${e.text}`).map(({ item: e, key: n }, r) => /* @__PURE__ */ l(t, {
|
|
60
60
|
active: !e.disabled && e.active,
|
|
61
61
|
disabled: e.disabled,
|
|
62
62
|
href: e.href,
|
|
@@ -66,7 +66,7 @@ var u = i(null), d = () => {
|
|
|
66
66
|
tagSkin: e.tag?.skin,
|
|
67
67
|
index: r,
|
|
68
68
|
children: e.text
|
|
69
|
-
},
|
|
69
|
+
}, n)), j = ["pkt-tabs", S && "pkt-tabs--with-separator"].filter(Boolean).join(" "), M = k(b ? y : A || []);
|
|
70
70
|
return /* @__PURE__ */ l(u.Provider, {
|
|
71
71
|
value: {
|
|
72
72
|
arrowNav: v,
|
|
@@ -86,5 +86,4 @@ var u = i(null), d = () => {
|
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
f.displayName = "PktTabs";
|
|
89
|
-
//#endregion
|
|
90
89
|
export { f as PktTabs, d as useTabsContext };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
|
|
3
3
|
import { TAG_DEFAULTS as t } from "../../shared-types/tag.js";
|
|
4
|
-
import "../../shared-types/index.js";
|
|
5
4
|
import { require_classnames as n } from "../../node_modules/classnames/index.js";
|
|
5
|
+
import "../../shared-types/index.js";
|
|
6
6
|
import { PktIcon as r } from "../icon/Icon.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { usePktStrings as i } from "../../hooks/usePktStrings.js";
|
|
8
|
+
import { formatString as a } from "../../shared-strings/format.js";
|
|
9
9
|
import { forwardRef as o, useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
10
10
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/components/tag/Tag.tsx
|
|
12
12
|
var m = /* @__PURE__ */ e(n(), 1), h = o(({ children: e, skin: n = t.skin, state: o, textStyle: h = t.textStyle, size: g = t.size, closeTag: _ = t.closeTag, className: v, iconName: y, ariaLabel: b, onClose: x, type: S = t.type, "aria-description": C, strings: w, ...T }, E) => {
|
|
13
13
|
let [D, O] = d(!1), k = s(() => {
|
|
14
14
|
O(!0), x && x();
|
|
@@ -16,8 +16,8 @@ var m = /* @__PURE__ */ e(n(), 1), h = o(({ children: e, skin: n = t.skin, state
|
|
|
16
16
|
c(() => {
|
|
17
17
|
M(A.current?.textContent?.trim() ?? "");
|
|
18
18
|
}, [e]);
|
|
19
|
-
let N =
|
|
20
|
-
if (_ && !b) return j &&
|
|
19
|
+
let N = i(["tag"], w), P = l(() => {
|
|
20
|
+
if (_ && !b) return j && a(N.tag.remove, { label: j }) || C;
|
|
21
21
|
}, [
|
|
22
22
|
_,
|
|
23
23
|
b,
|
|
@@ -76,5 +76,4 @@ var m = /* @__PURE__ */ e(n(), 1), h = o(({ children: e, skin: n = t.skin, state
|
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
h.displayName = "PktTag";
|
|
79
|
-
//#endregion
|
|
80
79
|
export { h as PktTag };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { TEXTAREA_DEFAULTS as e } from "../../shared-types/textarea.js";
|
|
3
|
+
import { PktInputWrapper as t } from "../inputwrapper/InputWrapper.js";
|
|
3
4
|
import "../../shared-types/index.js";
|
|
4
|
-
import { useGeneratedId as t } from "../../hooks/useGeneratedId.js";
|
|
5
5
|
import { describedByIds as n } from "../../shared-utils/forms/described-by.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useGeneratedId as r } from "../../hooks/useGeneratedId.js";
|
|
7
7
|
import { forwardRef as i, useState as a } from "react";
|
|
8
8
|
import { jsx as o } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/components/textarea/Textarea.tsx
|
|
10
10
|
var s = i(({ id: i, ariaDescribedby: s, ariaLabelledby: c, counter: l, hasFieldset: u, counterMaxLength: d, className: f, disabled: p, errorMessage: m, hasError: h = e.hasError, helptext: g, helptextDropdown: _, helptextDropdownButton: v, inline: y, fullwidth: b = e.fullwidth, label: x, name: S, optionalTag: C = e.optionalTag, optionalText: w, requiredTag: T = e.requiredTag, requiredText: E, tagText: D = null, placeholder: O, rows: k, useWrapper: A = e.useWrapper, onChange: j, value: M, autoComplete: N, autocomplete: P, minLength: F, maxLength: I, readOnly: L, skipForwardTestid: R = !1, inputSize: z = e.inputSize, strings: B, ...V }, H) => {
|
|
11
11
|
let U = l ?? (d ?? 0) > 0, W = [
|
|
12
12
|
f,
|
|
13
13
|
"pkt-textinput",
|
|
14
14
|
"pkt-textarea"
|
|
15
|
-
].filter(Boolean).join(" "), G =
|
|
15
|
+
].filter(Boolean).join(" "), G = r(i), K = `${G}-input`, q = `${K}-label`, J = c || q, [Y, X] = a(0), Z = M === void 0 ? Y : M?.length || 0, Q = (e) => {
|
|
16
16
|
U && X(e.currentTarget?.value?.length || 0), j && j(e);
|
|
17
17
|
};
|
|
18
18
|
return /* @__PURE__ */ o("div", {
|
|
19
19
|
className: W,
|
|
20
|
-
children: /* @__PURE__ */ o(
|
|
20
|
+
children: /* @__PURE__ */ o(t, {
|
|
21
21
|
strings: B,
|
|
22
22
|
ariaDescribedby: s,
|
|
23
23
|
disabled: p,
|
|
@@ -72,5 +72,4 @@ var s = i(({ id: i, ariaDescribedby: s, ariaLabelledby: c, counter: l, hasFields
|
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
s.displayName = "PktTextarea";
|
|
75
|
-
//#endregion
|
|
76
75
|
export { s as PktTextarea };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { TEXTINPUT_DEFAULTS as e } from "../../shared-types/textinput.js";
|
|
3
|
-
import "../../shared-types/index.js";
|
|
4
3
|
import { PktIcon as t } from "../icon/Icon.js";
|
|
5
|
-
import {
|
|
4
|
+
import { PktInputWrapper as n } from "../inputwrapper/InputWrapper.js";
|
|
5
|
+
import "../../shared-types/index.js";
|
|
6
6
|
import { describedByIds as ee } from "../../shared-utils/forms/described-by.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useGeneratedId as te } from "../../hooks/useGeneratedId.js";
|
|
8
8
|
import { forwardRef as r, useState as i } from "react";
|
|
9
9
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
10
|
-
|
|
10
|
+
// src/components/textinput/Textinput.tsx
|
|
11
11
|
var s = r(({ id: r, ariaDescribedby: s, ariaLabelledby: c, autoComplete: l, autocomplete: u, counter: d, hasFieldset: ne, counterMaxLength: f, className: p, disabled: m = e.disabled, errorMessage: h, hasError: g = e.hasError, helptext: _, helptextDropdown: re, helptextDropdownButton: ie, iconNameRight: v, inline: y = e.inline, fullwidth: b = e.fullwidth, label: x, name: S, optionalTag: C = e.optionalTag, optionalText: w, requiredTag: T = e.requiredTag, requiredText: E, tagText: D = null, placeholder: O, prefix: k, suffix: A, type: j = e.type, useWrapper: M = e.useWrapper, omitSearchIcon: N = e.omitSearchIcon, value: P, minLength: F, maxLength: I, min: L, max: ae, step: R, size: z, readOnly: B, readonly: V, required: H = e.required, dataTestid: U, onChange: W, skipForwardTestid: G = !1, inputSize: K = e.inputSize, strings: q, ...J }, oe) => {
|
|
12
|
-
let Y = d ?? (f ?? 0) > 0, se = [p, "pkt-textinput"].filter(Boolean).join(" "), X = j === "search" && !v && !N, ce = j === "date" && P ? P.slice(0, 10) : P, [le, ue] = i(0), Z = P === void 0 ? le : P?.length || 0, Q =
|
|
12
|
+
let Y = d ?? (f ?? 0) > 0, se = [p, "pkt-textinput"].filter(Boolean).join(" "), X = j === "search" && !v && !N, ce = j === "date" && P ? P.slice(0, 10) : P, [le, ue] = i(0), Z = P === void 0 ? le : P?.length || 0, Q = te(r), $ = `${Q}`, de = `${$}-label`, fe = c || de, pe = (e) => {
|
|
13
13
|
Y && ue(e.currentTarget?.value?.length || 0), W && W(e);
|
|
14
14
|
};
|
|
15
15
|
return /* @__PURE__ */ a("div", {
|
|
16
16
|
className: se,
|
|
17
|
-
children: /* @__PURE__ */ a(
|
|
17
|
+
children: /* @__PURE__ */ a(n, {
|
|
18
18
|
strings: q,
|
|
19
19
|
ariaDescribedby: s,
|
|
20
20
|
disabled: m,
|
|
@@ -104,5 +104,4 @@ var s = r(({ id: r, ariaDescribedby: s, ariaLabelledby: c, autoComplete: l, auto
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
s.displayName = "PktTextinput";
|
|
107
|
-
//#endregion
|
|
108
107
|
export { s as PktTextinput };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { PktIcon as e } from "../icon/Icon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { PktInputWrapper as t } from "../inputwrapper/InputWrapper.js";
|
|
4
|
+
import { useTimepickerState as n } from "./useTimepickerState.js";
|
|
5
|
+
import { describedByIds as r } from "../../shared-utils/forms/described-by.js";
|
|
6
6
|
import { forwardRef as i } from "react";
|
|
7
7
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/components/timepicker/Timepicker.tsx
|
|
9
9
|
var s = i((i, s) => {
|
|
10
|
-
let { onChange: c, inputSize: l = "medium" } = i, u =
|
|
10
|
+
let { onChange: c, inputSize: l = "medium" } = i, u = n(i, s), d = u.strings.hours, f = u.strings.minutes, p = u.label ? `${d}, ${u.label}` : d, m = u.label ? `${f}, ${u.label}` : f, h = r({
|
|
11
11
|
id: u.hoursId,
|
|
12
12
|
hasHelptext: !!u.helptext,
|
|
13
13
|
ariaDescribedby: u.ariaDescribedby
|
|
@@ -192,7 +192,7 @@ var s = i((i, s) => {
|
|
|
192
192
|
id: u.id || void 0,
|
|
193
193
|
onFocus: u.handleFocusIn,
|
|
194
194
|
onBlur: u.handleFocusOut,
|
|
195
|
-
children: /* @__PURE__ */ a(
|
|
195
|
+
children: /* @__PURE__ */ a(t, {
|
|
196
196
|
strings: u.stringsOverride,
|
|
197
197
|
forId: u.hoursId,
|
|
198
198
|
label: u.label,
|
|
@@ -220,5 +220,4 @@ var s = i((i, s) => {
|
|
|
220
220
|
});
|
|
221
221
|
});
|
|
222
222
|
s.displayName = "PktTimepicker";
|
|
223
|
-
//#endregion
|
|
224
223
|
export { s as PktTimepicker };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { getHourOptions as e, getMinuteOptions as t, getMinuteStep as n } from "../../shared-utils/timepicker/options.js";
|
|
2
|
+
import { stepTime as r } from "../../shared-utils/timepicker/stepper.js";
|
|
3
|
+
import { isValidTimeString as i, timeToMinutes as a } from "../../shared-utils/timepicker/time-utils.js";
|
|
4
|
+
import { usePktStrings as ee } from "../../hooks/usePktStrings.js";
|
|
5
|
+
import { useOwnerForm as o } from "../../hooks/useOwnerForm.js";
|
|
6
|
+
import { setNativeInputValue as s } from "../../utils/nativeInputValue.js";
|
|
7
|
+
import { formatString as c } from "../../shared-strings/format.js";
|
|
8
8
|
import { useCallback as l, useEffect as u, useImperativeHandle as d, useLayoutEffect as te, useMemo as f, useRef as p, useState as m } from "react";
|
|
9
|
-
|
|
9
|
+
// src/components/timepicker/useTimepickerState.ts
|
|
10
10
|
function h(e) {
|
|
11
|
-
if (e &&
|
|
11
|
+
if (e && i(e)) {
|
|
12
12
|
let [t, n] = e.split(":");
|
|
13
13
|
return [t, n];
|
|
14
14
|
}
|
|
@@ -17,34 +17,34 @@ function h(e) {
|
|
|
17
17
|
function ne(e, t) {
|
|
18
18
|
return `${String(parseInt(e, 10)).padStart(2, "0")}:${String(parseInt(t, 10)).padStart(2, "0")}`;
|
|
19
19
|
}
|
|
20
|
-
function re(
|
|
21
|
-
let { required:
|
|
22
|
-
if (
|
|
20
|
+
function re(e, t, r) {
|
|
21
|
+
let { required: ee, min: o, max: s, step: l } = t;
|
|
22
|
+
if (ee && !e) return {
|
|
23
23
|
valid: !1,
|
|
24
24
|
message: r.valueMissing
|
|
25
25
|
};
|
|
26
|
-
if (!
|
|
27
|
-
if (!
|
|
26
|
+
if (!e) return { valid: !0 };
|
|
27
|
+
if (!i(e)) return {
|
|
28
28
|
valid: !1,
|
|
29
29
|
message: r.typeMismatch
|
|
30
30
|
};
|
|
31
|
-
let u =
|
|
32
|
-
return
|
|
31
|
+
let u = a(e), d = n(l);
|
|
32
|
+
return o && u < a(String(o)) ? {
|
|
33
33
|
valid: !1,
|
|
34
|
-
message:
|
|
35
|
-
} :
|
|
34
|
+
message: c(r.rangeUnderflowMin, { min: String(o) })
|
|
35
|
+
} : s && u > a(String(s)) ? {
|
|
36
36
|
valid: !1,
|
|
37
|
-
message:
|
|
37
|
+
message: c(r.rangeOverflowMax, { max: String(s) })
|
|
38
38
|
} : l && u % d !== 0 ? {
|
|
39
39
|
valid: !1,
|
|
40
|
-
message: d === 60 ? r.timeStepMismatchHour : d === 30 ? r.timeStepMismatchHalfHour :
|
|
40
|
+
message: d === 60 ? r.timeStepMismatchHour : d === 30 ? r.timeStepMismatchHalfHour : c(r.timeStepMismatch, { step: `${d}, ${d * 2}, ${d * 3}` })
|
|
41
41
|
} : { valid: !0 };
|
|
42
42
|
}
|
|
43
43
|
function ie(e) {
|
|
44
44
|
return e === 3600 || e < 3600 && 3600 % e == 0 && e % 60 == 0;
|
|
45
45
|
}
|
|
46
|
-
function ae(
|
|
47
|
-
let { id: c, label: ae, value: g, defaultValue: _, min: v, max: y, step: b = 60, hidePicker: oe = !1, stepArrows: se = !1, fullwidth: ce = !1, name: le, form: ue, disabled: x = !1, required: S = !1, helptext: de, helptextDropdown: fe, helptextDropdownButton: pe, hasError: me = !1, errorMessage: he, optionalTag: ge = !1, optionalText: _e, requiredTag: ve = !1, requiredText: ye, tagText: be, inline: xe = !1, useWrapper: Se = !0, ariaDescribedby: Ce, strings: we, className: Te, inputSize: Ee = "medium", onValueChange: C, onFocus: De, onBlur: Oe } =
|
|
46
|
+
function ae(i, a) {
|
|
47
|
+
let { id: c, label: ae, value: g, defaultValue: _, min: v, max: y, step: b = 60, hidePicker: oe = !1, stepArrows: se = !1, fullwidth: ce = !1, name: le, form: ue, disabled: x = !1, required: S = !1, helptext: de, helptextDropdown: fe, helptextDropdownButton: pe, hasError: me = !1, errorMessage: he, optionalTag: ge = !1, optionalText: _e, requiredTag: ve = !1, requiredText: ye, tagText: be, inline: xe = !1, useWrapper: Se = !0, ariaDescribedby: Ce, strings: we, className: Te, inputSize: Ee = "medium", onValueChange: C, onFocus: De, onBlur: Oe } = i, w = ee(["timepicker", "validation"], we), ke = w.timepicker, Ae = we, T = g !== void 0, je = g === void 0 ? _ ?? "" : g ?? "", Me = p(je), [Ne, E] = m(() => je), D = T ? g ?? "" : Ne, [Pe, Fe] = m(() => h(g === void 0 ? _ : g)[0]), [Ie, Le] = m(() => h(g === void 0 ? _ : g)[1]), O = p(Pe), k = p(Ie), A = l((e) => {
|
|
48
48
|
O.current = e, Fe(e);
|
|
49
49
|
}, []), j = l((e) => {
|
|
50
50
|
k.current = e, Le(e);
|
|
@@ -57,7 +57,7 @@ function ae(e, s) {
|
|
|
57
57
|
u(() => {
|
|
58
58
|
b != null && !ie(b) && console.warn(`PktTimepicker: step="${b}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`);
|
|
59
59
|
}, [b]);
|
|
60
|
-
let P = p(null), F = p(null), I = p(null), L = p(null), R = p(null), z = p(null), B =
|
|
60
|
+
let P = p(null), F = p(null), I = p(null), L = p(null), R = p(null), z = p(null), B = o(R, ue), V = p(0), H = p(-1), U = p(0), W = p(-1), [Be, G] = m(!1), K = f(() => n(b), [b]), Ve = f(() => e(v, y), [v, y]), He = f(() => t(b), [b]), Ue = `${c}-hours`, We = `${c}-minutes`, Ge = `${c}-popup`, Ke = `${c}-input`, q = f(() => re(D, {
|
|
61
61
|
required: S,
|
|
62
62
|
min: v,
|
|
63
63
|
max: y,
|
|
@@ -76,7 +76,7 @@ function ae(e, s) {
|
|
|
76
76
|
let J = l((e) => {
|
|
77
77
|
T || E(e);
|
|
78
78
|
let t = z.current;
|
|
79
|
-
t && (
|
|
79
|
+
t && (s(t, e), t.dispatchEvent(new Event("input", { bubbles: !0 })), C?.(e));
|
|
80
80
|
}, [T, C]), Y = l(() => {
|
|
81
81
|
let e = O.current, t = k.current;
|
|
82
82
|
if (e !== "" && t !== "") {
|
|
@@ -166,7 +166,7 @@ function ae(e, s) {
|
|
|
166
166
|
A,
|
|
167
167
|
j
|
|
168
168
|
]), Ye = l((e) => {
|
|
169
|
-
let t =
|
|
169
|
+
let t = r(O.current, k.current, e, K);
|
|
170
170
|
A(t.hours), j(t.minutes), `${t.hours}:${t.minutes}` !== D && J(`${t.hours}:${t.minutes}`);
|
|
171
171
|
}, [
|
|
172
172
|
K,
|
|
@@ -359,7 +359,7 @@ function ae(e, s) {
|
|
|
359
359
|
let t = L.current;
|
|
360
360
|
if (!t) return;
|
|
361
361
|
let n = e.relatedTarget;
|
|
362
|
-
|
|
362
|
+
n && t.contains(n) || Q();
|
|
363
363
|
}, [Q]), nt = l((e) => {
|
|
364
364
|
let t = R.current;
|
|
365
365
|
if (!t) return;
|
|
@@ -377,7 +377,7 @@ function ae(e, s) {
|
|
|
377
377
|
M,
|
|
378
378
|
Q
|
|
379
379
|
]);
|
|
380
|
-
return d(
|
|
380
|
+
return d(a, () => ({
|
|
381
381
|
get value() {
|
|
382
382
|
return z.current?.value ?? "";
|
|
383
383
|
},
|
|
@@ -479,5 +479,4 @@ function ae(e, s) {
|
|
|
479
479
|
effectiveValue: D
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
//#endregion
|
|
483
482
|
export { ae as useTimepickerState };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as e, useState as t, useSyncExternalStore as n } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/useElementWidth.ts
|
|
3
3
|
var r = () => () => {}, i = (i, a) => {
|
|
4
4
|
let o = a ?? Infinity, s = n(r, () => !1, () => !0), [c, l] = t(() => typeof window > "u" ? o : a ?? window.innerWidth);
|
|
5
5
|
return e(() => {
|
|
@@ -19,5 +19,4 @@ var r = () => () => {}, i = (i, a) => {
|
|
|
19
19
|
};
|
|
20
20
|
}, [i]), s ? o : c;
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { i as useElementWidth };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as e, useRef as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/useFocusModality.ts
|
|
3
3
|
function n(n) {
|
|
4
4
|
let r = t(null), i = t(!1), a = t(void 0), o = (e) => {
|
|
5
5
|
let t = r.current;
|
|
@@ -24,5 +24,4 @@ function n(n) {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { n as useFocusModality };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useElementWidth as e } from "./useElementWidth.js";
|
|
2
2
|
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useHeaderChrome.ts
|
|
4
4
|
function a({ forwardedRef: a, mobileBreakpoint: o, tabletBreakpoint: s, position: c, scrollBehavior: l, pauseScrollHide: u = !1 }) {
|
|
5
5
|
let d = r(null), f = t((e) => {
|
|
6
6
|
d.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
|
|
@@ -32,5 +32,4 @@ function a({ forwardedRef: a, mobileBreakpoint: o, tabletBreakpoint: s, position
|
|
|
32
32
|
}, [])
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { a as useHeaderChrome };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/useOptionGroupField.ts
|
|
3
3
|
var r = (e) => !e.matches(":disabled");
|
|
4
4
|
function i({ type: i, name: a, forwardedRef: o, onChange: s, onValueChange: c, onFocus: l, onBlur: u, onValueSet: d }) {
|
|
5
5
|
let f = n(null), p = n({
|
|
@@ -66,5 +66,4 @@ function i({ type: i, name: a, forwardedRef: o, onChange: s, onValueChange: c, o
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
export { r as isActiveOption, i as useOptionGroupField };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as e, useState as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/useOwnerForm.ts
|
|
3
3
|
var n = (e, t) => {
|
|
4
4
|
if (!e) return null;
|
|
5
5
|
if (t === void 0) return e.closest("form");
|
|
@@ -11,5 +11,4 @@ var n = (e, t) => {
|
|
|
11
11
|
o(n(r.current, i));
|
|
12
12
|
}, [r, i]), a;
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { r as useOwnerForm };
|
|
@@ -2,7 +2,7 @@ import { getPktStrings as e, subscribePktStrings as t } from "../shared-strings/
|
|
|
2
2
|
import { resolveStrings as n } from "../shared-strings/resolve.js";
|
|
3
3
|
import { PktStringsContext as r } from "../components/strings/PktStringsProvider.js";
|
|
4
4
|
import { useContext as i, useMemo as a, useSyncExternalStore as o } from "react";
|
|
5
|
-
|
|
5
|
+
// src/hooks/usePktStrings.ts
|
|
6
6
|
function s(s, c) {
|
|
7
7
|
let l = o(t, e, e), u = i(r), d = s.join("|");
|
|
8
8
|
return a(() => n(s, u, c), [
|
|
@@ -12,5 +12,4 @@ function s(s, c) {
|
|
|
12
12
|
c
|
|
13
13
|
]);
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { s as usePktStrings };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createScrollLockToken as e, setScrollLock as t } from "../shared-utils/scroll-lock/index.js";
|
|
2
2
|
import { useEffect as n, useRef as r } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useScrollLock.ts
|
|
4
4
|
function i(i) {
|
|
5
5
|
let a = r(e());
|
|
6
6
|
n(() => {
|
|
@@ -8,5 +8,4 @@ function i(i) {
|
|
|
8
8
|
return t(e, i), () => t(e, !1);
|
|
9
9
|
}, [i]);
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { i as useScrollLock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tzName as e } from "../tzName/index.js";
|
|
2
2
|
import { TZDateMini as t } from "./mini.js";
|
|
3
|
-
|
|
3
|
+
// ../../node_modules/@date-fns/tz/date/index.js
|
|
4
4
|
var n = class n extends t {
|
|
5
5
|
static tz(e, ...t) {
|
|
6
6
|
return t.length ? new n(...t, e) : new n(Date.now(), e);
|
|
@@ -53,5 +53,4 @@ var n = class n extends t {
|
|
|
53
53
|
return new n(+new Date(e), this.timeZone);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
//#endregion
|
|
57
56
|
export { n as TZDate };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tzOffset as e } from "../tzOffset/index.js";
|
|
2
|
-
|
|
2
|
+
// ../../node_modules/@date-fns/tz/date/mini.js
|
|
3
3
|
var t = class t extends Date {
|
|
4
4
|
constructor(...t) {
|
|
5
5
|
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(e(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), a(this, t)) : this.setTime(Date.now());
|
|
@@ -71,5 +71,4 @@ function s(t, n) {
|
|
|
71
71
|
let r = new Date(n ?? +t);
|
|
72
72
|
return r.setUTCSeconds(r.getUTCSeconds() - Math.round(-e(t.timeZone, r) * 60)), +r;
|
|
73
73
|
}
|
|
74
|
-
//#endregion
|
|
75
74
|
export { t as TZDateMini };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tzName as e } from "./tzName/index.js";
|
|
2
2
|
import { tzOffset as t } from "./tzOffset/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { TZDate as n } from "./date/index.js";
|
|
4
|
+
import { TZDateMini as r } from "./date/mini.js";
|
|
5
5
|
import "./tz/index.js";
|
|
6
|
-
export {
|
|
6
|
+
export { n as TZDate, r as TZDateMini, e as tzName, t as tzOffset };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/@date-fns/tz/tzName/index.js
|
|
2
2
|
function e(e, t, n = "long") {
|
|
3
3
|
return new Intl.DateTimeFormat("en-US", {
|
|
4
4
|
hour: "numeric",
|
|
@@ -6,5 +6,4 @@ function e(e, t, n = "long") {
|
|
|
6
6
|
timeZoneName: n
|
|
7
7
|
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { e as tzName };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/@date-fns/tz/tzOffset/index.js
|
|
2
2
|
var e = {}, t = {};
|
|
3
3
|
function n(n, a) {
|
|
4
4
|
try {
|
|
@@ -18,5 +18,4 @@ function i(e, n) {
|
|
|
18
18
|
let r = +(n[0] || 0), i = +(n[1] || 0), a = (n[2] || 0) / 60;
|
|
19
19
|
return t[e] = r * 60 + i > 0 ? r * 60 + i + a : r * 60 - i - a;
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { n as tzOffset };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __commonJSMin as e } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
|
|
2
|
+
// ../../node_modules/classnames/index.js
|
|
3
3
|
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
4
|
(function() {
|
|
5
5
|
var e = {}.hasOwnProperty;
|
|
@@ -27,6 +27,5 @@ var t = /* @__PURE__ */ e(((e, t) => {
|
|
|
27
27
|
}) : window.classNames = n;
|
|
28
28
|
})();
|
|
29
29
|
}));
|
|
30
|
-
//#endregion
|
|
31
30
|
export default t();
|
|
32
31
|
export { t as require_classnames };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import t from "../../
|
|
3
|
-
import n from "../../
|
|
4
|
-
import r from "../../
|
|
5
|
-
import i from "../../
|
|
1
|
+
import e from "../../getDayOfYear.js";
|
|
2
|
+
import t from "../../getISOWeek.js";
|
|
3
|
+
import n from "../../getISOWeekYear.js";
|
|
4
|
+
import r from "../../getWeek.js";
|
|
5
|
+
import i from "../../getWeekYear.js";
|
|
6
6
|
import { addLeadingZeros as a } from "../addLeadingZeros.js";
|
|
7
7
|
import { lightFormatters as o } from "./lightFormatters.js";
|
|
8
|
-
|
|
8
|
+
// ../../node_modules/date-fns/_lib/format/formatters.js
|
|
9
9
|
var s = {
|
|
10
10
|
am: "am",
|
|
11
11
|
pm: "pm",
|
|
@@ -33,17 +33,17 @@ var s = {
|
|
|
33
33
|
}
|
|
34
34
|
return o.y(e, t);
|
|
35
35
|
},
|
|
36
|
-
Y: function(e, t, n,
|
|
37
|
-
let o =
|
|
36
|
+
Y: function(e, t, n, r) {
|
|
37
|
+
let o = i(e, r), s = o > 0 ? o : 1 - o;
|
|
38
38
|
if (t === "YY") {
|
|
39
39
|
let e = s % 100;
|
|
40
40
|
return a(e, 2);
|
|
41
41
|
}
|
|
42
42
|
return t === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : a(s, t.length);
|
|
43
43
|
},
|
|
44
|
-
R: function(
|
|
45
|
-
let r = e
|
|
46
|
-
return a(r,
|
|
44
|
+
R: function(e, t) {
|
|
45
|
+
let r = n(e);
|
|
46
|
+
return a(r, t.length);
|
|
47
47
|
},
|
|
48
48
|
u: function(e, t) {
|
|
49
49
|
let n = e.getFullYear();
|
|
@@ -129,19 +129,19 @@ var s = {
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
|
-
w: function(e, t, n,
|
|
133
|
-
let o =
|
|
132
|
+
w: function(e, t, n, i) {
|
|
133
|
+
let o = r(e, i);
|
|
134
134
|
return t === "wo" ? n.ordinalNumber(o, { unit: "week" }) : a(o, t.length);
|
|
135
135
|
},
|
|
136
|
-
I: function(e,
|
|
137
|
-
let i =
|
|
138
|
-
return
|
|
136
|
+
I: function(e, n, r) {
|
|
137
|
+
let i = t(e);
|
|
138
|
+
return n === "Io" ? r.ordinalNumber(i, { unit: "week" }) : a(i, n.length);
|
|
139
139
|
},
|
|
140
140
|
d: function(e, t, n) {
|
|
141
141
|
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : o.d(e, t);
|
|
142
142
|
},
|
|
143
|
-
D: function(
|
|
144
|
-
let i = t
|
|
143
|
+
D: function(t, n, r) {
|
|
144
|
+
let i = e(t);
|
|
145
145
|
return n === "Do" ? r.ordinalNumber(i, { unit: "dayOfYear" }) : a(i, n.length);
|
|
146
146
|
},
|
|
147
147
|
E: function(e, t, n) {
|
|
@@ -385,5 +385,4 @@ function d(e, t = "") {
|
|
|
385
385
|
let n = e > 0 ? "-" : "+", r = Math.abs(e), i = a(Math.trunc(r / 60), 2), o = a(r % 60, 2);
|
|
386
386
|
return n + i + t + o;
|
|
387
387
|
}
|
|
388
|
-
//#endregion
|
|
389
388
|
export { c as formatters };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { addLeadingZeros as e } from "../addLeadingZeros.js";
|
|
2
|
-
|
|
2
|
+
// ../../node_modules/date-fns/_lib/format/lightFormatters.js
|
|
3
3
|
var t = {
|
|
4
4
|
y(t, n) {
|
|
5
5
|
let r = t.getFullYear(), i = r > 0 ? r : 1 - r;
|
|
@@ -39,5 +39,4 @@ var t = {
|
|
|
39
39
|
return e(a, n.length);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
//#endregion
|
|
43
42
|
export { t as lightFormatters };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/date-fns/_lib/format/longFormatters.js
|
|
2
2
|
var e = (e, t) => {
|
|
3
3
|
switch (e) {
|
|
4
4
|
case "P": return t.date({ width: "short" });
|
|
@@ -34,5 +34,4 @@ var e = (e, t) => {
|
|
|
34
34
|
return s.replace("{{date}}", e(a, r)).replace("{{time}}", t(o, r));
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { n as longFormatters };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import e from "../toDate.js";
|
|
2
|
-
|
|
2
|
+
// ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
|
3
3
|
function t(t) {
|
|
4
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
5
|
return r.setUTCFullYear(n.getFullYear()), +t - r;
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { t as getTimezoneOffsetInMilliseconds };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { constructFrom as e } from "../constructFrom.js";
|
|
2
|
-
|
|
2
|
+
// ../../node_modules/date-fns/_lib/normalizeDates.js
|
|
3
3
|
function t(t, ...n) {
|
|
4
4
|
let r = e.bind(null, t || n.find((e) => typeof e == "object"));
|
|
5
5
|
return n.map(r);
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { t as normalizeDates };
|