@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,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-strings/format.ts
|
|
2
2
|
var e = /\{(\w+)\}/g;
|
|
3
3
|
function t(t, n) {
|
|
4
4
|
return n ? t.replace(e, (e, r) => {
|
|
@@ -14,5 +14,4 @@ function i(e, t) {
|
|
|
14
14
|
let n = `${e}::${t}`;
|
|
15
15
|
r.has(n) || (r.add(n), console.warn(`[punkt] Mangler verdi for plassholderen {${e}} i teksten «${t}»`));
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { t as formatString, n as plural };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nb as e } from "./nb.js";
|
|
2
2
|
import { getPktStrings as t } from "./store.js";
|
|
3
|
-
|
|
3
|
+
// ../../shared-strings/resolve.ts
|
|
4
4
|
var n = /* @__PURE__ */ new Map();
|
|
5
5
|
function r(e, t) {
|
|
6
6
|
if (t) for (let n of Object.keys(t)) {
|
|
@@ -36,5 +36,4 @@ function s(e, ...t) {
|
|
|
36
36
|
for (let r of e) n[r] = o(r, ...t);
|
|
37
37
|
return n;
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { o as resolveNamespace, s as resolveStrings };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-strings/store.ts
|
|
2
2
|
var e = Symbol.for("@oslokommune/punkt-strings");
|
|
3
3
|
function t() {
|
|
4
4
|
let t = globalThis;
|
|
@@ -31,5 +31,4 @@ function a(e) {
|
|
|
31
31
|
n.listeners.delete(e);
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { r as getPktStrings, i as resetPktStrings, n as setPktStrings, a as subscribePktStrings };
|
|
@@ -43,3 +43,16 @@ export interface IPktButtonBase {
|
|
|
43
43
|
* Used for typed component specs in documentation.
|
|
44
44
|
*/
|
|
45
45
|
export type IButtonSpecProps = Pick<IPktButtonBase, 'size' | 'fullWidth' | 'fullWidthOnMobile' | 'skin' | 'type' | 'color' | 'state' | 'variant' | 'iconName' | 'secondIconName' | 'iconPath' | 'secondIconPath' | 'isLoading' | 'disabled'>;
|
|
46
|
+
/** Default values for pkt-button. Single source of truth for both frameworks */
|
|
47
|
+
export declare const BUTTON_DEFAULTS: {
|
|
48
|
+
readonly iconName: 'user';
|
|
49
|
+
readonly secondIconName: 'user';
|
|
50
|
+
readonly size: 'medium';
|
|
51
|
+
readonly fullWidth: false;
|
|
52
|
+
readonly fullWidthOnMobile: false;
|
|
53
|
+
readonly skin: 'primary';
|
|
54
|
+
readonly type: 'button';
|
|
55
|
+
readonly variant: 'label-only';
|
|
56
|
+
readonly isLoading: false;
|
|
57
|
+
readonly disabled: false;
|
|
58
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// ../../shared-types/button.ts
|
|
2
|
+
var e = {
|
|
3
|
+
iconName: "user",
|
|
4
|
+
secondIconName: "user",
|
|
5
|
+
size: "medium",
|
|
6
|
+
fullWidth: !1,
|
|
7
|
+
fullWidthOnMobile: !1,
|
|
8
|
+
skin: "primary",
|
|
9
|
+
type: "button",
|
|
10
|
+
variant: "label-only",
|
|
11
|
+
isLoading: !1,
|
|
12
|
+
disabled: !1
|
|
13
|
+
};
|
|
14
|
+
export { e as BUTTON_DEFAULTS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/checkbox.ts
|
|
2
2
|
var e = {
|
|
3
3
|
defaultChecked: !1,
|
|
4
4
|
indeterminate: !1,
|
|
@@ -11,5 +11,4 @@ var e = {
|
|
|
11
11
|
requiredTag: !1,
|
|
12
12
|
optionalTag: !1
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { e as CHECKBOX_DEFAULTS };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/footer.ts
|
|
2
2
|
var e = "https://www.oslo.kommune.no/personvern-og-informasjonskapsler/", t = "https://www.oslo.kommune.no/tilgjengelighet/";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as DEFAULT_FOOTER_PERSONVERN_URL, t as DEFAULT_FOOTER_TILGJENGELIGHET_URL };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/header-footer.ts
|
|
2
2
|
var e = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", t = "https://www.oslo.kommune.no";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as DEFAULT_HEADER_FOOTER_URL, t as DEFAULT_HEADER_LOGO_LINK };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/icon.ts
|
|
2
2
|
var e = "https://cdn.ikoner.oslo.kommune.no/icons/", t = "https://punkt-cdn.oslo.kommune.no/latest/animations/", n = {
|
|
3
3
|
name: "",
|
|
4
4
|
path: e
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { t as ANIMATION_DEFAULT_PATH, n as ICON_DEFAULTS, e as ICON_DEFAULT_PATH };
|
|
@@ -30,7 +30,7 @@ export type { TLayout, TVerticalPosition, THorizontalPosition, TPosition, TPosit
|
|
|
30
30
|
export type { THTMLButtonType, TSelectionMode } from './form';
|
|
31
31
|
export { ACCORDION_LIGHT_ONLY_SKINS, ACCORDION_SKINS } from './accordion';
|
|
32
32
|
export type { TAccordionSkin, IPktAccordionBase, IPktAccordionItemBase, IAccordionSpecProps, IAccordionItemSpecProps, IAccordionVisualProps, } from './accordion';
|
|
33
|
-
export { BUTTON_SIZES, BUTTON_SKINS, BUTTON_COLORS, BUTTON_VARIANTS, BUTTON_STATES } from './button';
|
|
33
|
+
export { BUTTON_SIZES, BUTTON_SKINS, BUTTON_COLORS, BUTTON_VARIANTS, BUTTON_STATES, BUTTON_DEFAULTS, } from './button';
|
|
34
34
|
export type { TPktButtonSize, TPktButtonSkin, TPktButtonColor, TPktButtonVariant, TPktButtonState, IPktButtonBase, IButtonSpecProps, } from './button';
|
|
35
35
|
export type { IPktBackLinkBase, IBacklinkSpecProps } from './backlink';
|
|
36
36
|
export { LINKCARD_SKINS, LINKCARD_LIGHT_ONLY_SKINS } from './linkcard';
|
|
@@ -9,15 +9,16 @@ import { CONSENT_DEFAULTS as l } from "./consent.js";
|
|
|
9
9
|
import { ANIMATION_DEFAULT_PATH as u, ICON_DEFAULTS as d } from "./icon.js";
|
|
10
10
|
import { LOADER_DEFAULTS as f } from "./loader.js";
|
|
11
11
|
import { ACCORDION_LIGHT_ONLY_SKINS as p } from "./accordion.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
12
|
+
import { BUTTON_DEFAULTS as m } from "./button.js";
|
|
13
|
+
import { LINKCARD_LIGHT_ONLY_SKINS as h } from "./linkcard.js";
|
|
14
|
+
import { INPUT_WRAPPER_DEFAULTS as g } from "./input-wrapper.js";
|
|
15
|
+
import { TEXTAREA_DEFAULTS as _ } from "./textarea.js";
|
|
16
|
+
import { TEXTINPUT_DEFAULTS as v } from "./textinput.js";
|
|
17
|
+
import { TAG_DEFAULTS as y } from "./tag.js";
|
|
18
|
+
import { MESSAGEBOX_DEFAULTS as b, MESSAGEBOX_LIGHT_ONLY_SKINS as x } from "./messagebox.js";
|
|
18
19
|
import "./calendar.js";
|
|
19
|
-
import { PROGRESSBAR_DEFAULTS as
|
|
20
|
+
import { PROGRESSBAR_DEFAULTS as S } from "./progressbar.js";
|
|
20
21
|
import "./combobox.js";
|
|
21
|
-
import { SELECT_DEFAULTS as
|
|
22
|
-
import { TABLE_DEFAULTS as
|
|
23
|
-
export { p as ACCORDION_LIGHT_ONLY_SKINS, u as ANIMATION_DEFAULT_PATH, i as CARD_DEFAULTS, a as CARD_LIGHT_ONLY_SKINS, o as CHECKBOX_DEFAULTS, l as CONSENT_DEFAULTS, n as DEFAULT_FOOTER_PERSONVERN_URL, r as DEFAULT_FOOTER_TILGJENGELIGHET_URL, e as DEFAULT_HEADER_FOOTER_URL, t as DEFAULT_HEADER_LOGO_LINK, d as ICON_DEFAULTS,
|
|
22
|
+
import { SELECT_DEFAULTS as C } from "./select.js";
|
|
23
|
+
import { TABLE_DEFAULTS as w } from "./table.js";
|
|
24
|
+
export { p as ACCORDION_LIGHT_ONLY_SKINS, u as ANIMATION_DEFAULT_PATH, m as BUTTON_DEFAULTS, i as CARD_DEFAULTS, a as CARD_LIGHT_ONLY_SKINS, o as CHECKBOX_DEFAULTS, l as CONSENT_DEFAULTS, n as DEFAULT_FOOTER_PERSONVERN_URL, r as DEFAULT_FOOTER_TILGJENGELIGHET_URL, e as DEFAULT_HEADER_FOOTER_URL, t as DEFAULT_HEADER_LOGO_LINK, d as ICON_DEFAULTS, g as INPUT_WRAPPER_DEFAULTS, h as LINKCARD_LIGHT_ONLY_SKINS, f as LOADER_DEFAULTS, b as MESSAGEBOX_DEFAULTS, x as MESSAGEBOX_LIGHT_ONLY_SKINS, c as OPTION_GROUP_DEFAULTS, S as PROGRESSBAR_DEFAULTS, s as RADIOBUTTON_DEFAULTS, C as SELECT_DEFAULTS, w as TABLE_DEFAULTS, y as TAG_DEFAULTS, _ as TEXTAREA_DEFAULTS, v as TEXTINPUT_DEFAULTS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/input-wrapper.ts
|
|
2
2
|
var e = {
|
|
3
3
|
counter: !1,
|
|
4
4
|
counterCurrent: 0,
|
|
@@ -13,5 +13,4 @@ var e = {
|
|
|
13
13
|
useWrapper: !0,
|
|
14
14
|
size: "medium"
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { e as INPUT_WRAPPER_DEFAULTS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/messagebox.ts
|
|
2
2
|
var e = [
|
|
3
3
|
"beige",
|
|
4
4
|
"blue",
|
|
@@ -9,5 +9,4 @@ var e = [
|
|
|
9
9
|
compact: !1,
|
|
10
10
|
closable: !1
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { t as MESSAGEBOX_DEFAULTS, e as MESSAGEBOX_LIGHT_ONLY_SKINS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/option-group.ts
|
|
2
2
|
var e = {
|
|
3
3
|
layout: "vertical",
|
|
4
4
|
inputSize: "medium",
|
|
@@ -10,5 +10,4 @@ var e = {
|
|
|
10
10
|
requiredTag: !1,
|
|
11
11
|
optionalTag: !1
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { e as OPTION_GROUP_DEFAULTS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/progressbar.ts
|
|
2
2
|
var e = {
|
|
3
3
|
ariaLive: "polite",
|
|
4
4
|
role: "progressbar",
|
|
@@ -10,5 +10,4 @@ var e = {
|
|
|
10
10
|
valueMax: 100,
|
|
11
11
|
valueMin: 0
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { e as PROGRESSBAR_DEFAULTS };
|
package/dist/shared-types/tag.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-types/textinput.ts
|
|
2
2
|
var e = {
|
|
3
3
|
type: "text",
|
|
4
4
|
autoComplete: "off",
|
|
@@ -14,5 +14,4 @@ var e = {
|
|
|
14
14
|
useWrapper: !0,
|
|
15
15
|
inputSize: "medium"
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { e as TEXTINPUT_DEFAULTS };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
1
|
+
import { newDateYMD as e } from "../date-utils.js";
|
|
2
|
+
import t from "../../node_modules/date-fns/getWeek.js";
|
|
3
3
|
function n(n, r) {
|
|
4
|
-
let i =
|
|
4
|
+
let i = e(n, r, 1), a = e(n, r + 1, 0), o = (i.getDay() + 6) % 7, s = a.getDate();
|
|
5
5
|
return {
|
|
6
6
|
firstDayOfMonth: i,
|
|
7
7
|
lastDayOfMonth: a,
|
|
8
8
|
startingDay: o,
|
|
9
9
|
numDays: s,
|
|
10
10
|
numRows: Math.ceil((s + o) / 7),
|
|
11
|
-
initialWeek:
|
|
11
|
+
initialWeek: t(i)
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
function r(e, t, n, r) {
|
|
15
15
|
let { startingDay: i, numDays: a } = r;
|
|
16
16
|
return e === 0 && t < i ? "prev-month" : n > a ? "next-month" : "current-month";
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { n as calculateCalendarDimensions, r as getCellType };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { formatISODate as e, isDateSelectable as t, newDate as n, newDateYMD as r } from "../date-utils.js";
|
|
2
|
-
|
|
2
|
+
// ../../shared-utils/calendar/date-validation.ts
|
|
3
3
|
function i(n, r) {
|
|
4
4
|
let i = (r.excludedates ?? []).map((t) => typeof t == "string" ? t : e(t));
|
|
5
5
|
return !t(n, r.earliest, r.latest, i, r.excludeweekdays ?? []);
|
|
@@ -15,5 +15,4 @@ function s(e, t, i) {
|
|
|
15
15
|
let a = r(t === 11 ? e + 1 : e, t === 11 ? 0 : t + 1, 1);
|
|
16
16
|
return !(i && n(i) < a);
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { i as isDateExcluded, a as isDayDisabled, s as isNextMonthAllowed, o as isPrevMonthAllowed };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addDays as e } from "../../node_modules/date-fns/addDays.js";
|
|
2
2
|
import { formatISODate as t } from "../date-utils.js";
|
|
3
3
|
import "./calendar-grid.js";
|
|
4
|
-
|
|
4
|
+
// ../../shared-utils/calendar/keyboard-navigation.ts
|
|
5
5
|
var n = {
|
|
6
6
|
ArrowLeft: -1,
|
|
7
7
|
ArrowRight: 1,
|
|
@@ -22,5 +22,4 @@ function i(n, r, i) {
|
|
|
22
22
|
function a(e) {
|
|
23
23
|
return n[e] ?? null;
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { n as KEY_DIRECTION_MAP, i as findNextSelectableDate, a as getKeyDirection, r as shouldIgnoreKeyboardEvent };
|
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { formatISODate as e, parseISODateString as t } from "../date-utils.js";
|
|
2
|
+
import n from "../../node_modules/date-fns/eachDayOfInterval.js";
|
|
3
|
+
import r from "../../node_modules/date-fns/getISODay.js";
|
|
4
|
+
// ../../shared-utils/calendar/selection-manager.ts
|
|
5
5
|
function i(e) {
|
|
6
|
-
return typeof e == "string" && (e = e.split(",")), e.length === 1 && e[0] === "" ? [] : e.map((e) =>
|
|
6
|
+
return typeof e == "string" && (e = e.split(",")), e.length === 1 && e[0] === "" ? [] : e.map((e) => t(e));
|
|
7
7
|
}
|
|
8
8
|
function a(t, r) {
|
|
9
|
-
let i =
|
|
9
|
+
let i = n({
|
|
10
10
|
start: t,
|
|
11
11
|
end: r
|
|
12
12
|
}), a = {};
|
|
13
|
-
if (Array.isArray(i) && i.length) for (let
|
|
14
|
-
let o = i[
|
|
15
|
-
a[
|
|
13
|
+
if (Array.isArray(i) && i.length) for (let n = 0; n < i.length; n++) {
|
|
14
|
+
let o = i[n], s = o > t && o < r;
|
|
15
|
+
a[e(o)] = s;
|
|
16
16
|
}
|
|
17
17
|
return a;
|
|
18
18
|
}
|
|
19
|
-
function o(
|
|
20
|
-
if (
|
|
21
|
-
let o =
|
|
22
|
-
start:
|
|
23
|
-
end:
|
|
19
|
+
function o(e, t, i, a) {
|
|
20
|
+
if (t.length !== 1) return !0;
|
|
21
|
+
let o = n({
|
|
22
|
+
start: t[0],
|
|
23
|
+
end: e
|
|
24
24
|
});
|
|
25
25
|
if (!Array.isArray(o) || !o.length) return !0;
|
|
26
|
-
for (let
|
|
27
|
-
for (let
|
|
28
|
-
if ((a ?? []).includes(
|
|
26
|
+
for (let n = 0; n < o.length; n++) {
|
|
27
|
+
for (let n of i ?? []) if (n > t[0] && n < e) return !1;
|
|
28
|
+
if ((a ?? []).includes(r(o[n]).toString())) return !1;
|
|
29
29
|
}
|
|
30
30
|
return !0;
|
|
31
31
|
}
|
|
32
|
-
function s(
|
|
33
|
-
let r =
|
|
34
|
-
return
|
|
32
|
+
function s(t, n) {
|
|
33
|
+
let r = e(t);
|
|
34
|
+
return n.includes(r) ? n : [...n, r];
|
|
35
35
|
}
|
|
36
|
-
function c(
|
|
37
|
-
let r =
|
|
38
|
-
if (i === -1) return
|
|
39
|
-
if (
|
|
40
|
-
let a = [...
|
|
36
|
+
function c(t, n) {
|
|
37
|
+
let r = e(t), i = n.indexOf(r);
|
|
38
|
+
if (i === -1) return n;
|
|
39
|
+
if (n.length === 1) return [];
|
|
40
|
+
let a = [...n];
|
|
41
41
|
return a.splice(i, 1), a;
|
|
42
42
|
}
|
|
43
|
-
function l(
|
|
44
|
-
let i =
|
|
45
|
-
return
|
|
43
|
+
function l(t, n, r) {
|
|
44
|
+
let i = e(t);
|
|
45
|
+
return n.includes(i) ? c(t, n) : r > 0 && n.length >= r ? n : s(t, n);
|
|
46
46
|
}
|
|
47
|
-
function u(
|
|
48
|
-
let a =
|
|
49
|
-
return
|
|
47
|
+
function u(t, n, r) {
|
|
48
|
+
let a = e(t), l = i(n);
|
|
49
|
+
return n.includes(a) ? n.indexOf(a) === 0 ? [] : c(t, n) : n.length > 1 || n.length === 1 && (!o(t, l, r.excludedates, r.excludeweekdays) || l[0] > t) ? [a] : s(t, n);
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
export { s as addToSelection, i as convertSelectedToDates, u as handleRangeSelection, o as isRangeAllowed, c as removeFromSelection, l as toggleSelection, a as updateRangeMap };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findOptionByValue as e } from "./option-utils.js";
|
|
2
|
-
|
|
2
|
+
// ../../shared-utils/combobox/input-utils.ts
|
|
3
3
|
var t = (e, t, n) => {
|
|
4
4
|
switch (e) {
|
|
5
5
|
case ",": return n ? "addValue" : null;
|
|
@@ -35,5 +35,4 @@ var t = (e, t, n) => {
|
|
|
35
35
|
let i = e(n, t);
|
|
36
36
|
return r === "label" && i?.label ? i.label : t;
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
export { t as getInputKeyAction, n as getInputValueAction, r as getSingleValueForInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-utils/combobox/keyboard-navigation.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
e.scrollIntoView({ block: "nearest" }), window.setTimeout(() => e.focus(), 0);
|
|
4
4
|
}, t = (e) => Array.from(e.querySelectorAll("[role=\"option\"]:not([data-disabled])") || []), n = (t) => {
|
|
@@ -36,5 +36,4 @@ var e = (e) => {
|
|
|
36
36
|
i[0] && e(i[0]);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
//#endregion
|
|
40
39
|
export { e as focusAndScrollIntoView, i as focusFirstOption, a as focusFirstOrSelectedOption, n as focusNextOption, r as focusPreviousOption, t as getOptionElements };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../shared-utils/combobox/option-utils.ts
|
|
2
2
|
var e = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label === t)) || null, t = (e, t) => {
|
|
3
3
|
if (!t) return -1;
|
|
4
4
|
let n = e.findIndex((e) => e.value === t);
|
|
@@ -44,5 +44,4 @@ var e = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label ==
|
|
|
44
44
|
userInfoMessage: ""
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
export { n as buildFulltext, i as filterOptionsBySearch, e as findOptionByValue, t as findOptionIndex, c as findTypeaheadMatches, o as getOptionDisplayText, l as getSearchInfoMessage, a as isMaxSelectionReached, s as parseValueToArray };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import e from "../node_modules/date-fns/
|
|
1
|
+
import e from "../node_modules/date-fns/format.js";
|
|
2
2
|
import t from "../node_modules/date-fns/endOfDay.js";
|
|
3
|
-
import n from "../node_modules/date-fns/
|
|
3
|
+
import n from "../node_modules/date-fns/startOfDay.js";
|
|
4
4
|
import { TZDate as r } from "../node_modules/@date-fns/tz/date/index.js";
|
|
5
5
|
import "../node_modules/@date-fns/tz/index.js";
|
|
6
|
-
|
|
6
|
+
// ../../shared-utils/date-utils.ts
|
|
7
7
|
typeof window < "u" && (window.pktTz = window.pktTz === void 0 ? "Europe/Oslo" : window.pktTz);
|
|
8
8
|
var i = () => typeof window < "u" && window.pktTz || "Europe/Oslo", a = (e = i()) => {
|
|
9
9
|
let t = new r((/* @__PURE__ */ new Date()).toISOString(), e);
|
|
@@ -25,12 +25,12 @@ var s = (e) => !e || isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.ge
|
|
|
25
25
|
if (!e) return null;
|
|
26
26
|
let t = o(e);
|
|
27
27
|
return isNaN(t.getTime()) ? null : t;
|
|
28
|
-
}, l = (
|
|
29
|
-
let r = u(
|
|
30
|
-
return isNaN(r.getTime()) ? "" :
|
|
31
|
-
}, u = (
|
|
32
|
-
let i = typeof
|
|
33
|
-
return !i || isNaN(i.getTime()) ? /* @__PURE__ */ new Date() : r ? r === "end" ? t(i) :
|
|
28
|
+
}, l = (t, n) => {
|
|
29
|
+
let r = u(t);
|
|
30
|
+
return isNaN(r.getTime()) ? "" : e(r, n);
|
|
31
|
+
}, u = (e = "", r) => {
|
|
32
|
+
let i = typeof e == "string" ? o(e) : e;
|
|
33
|
+
return !i || isNaN(i.getTime()) ? /* @__PURE__ */ new Date() : r ? r === "end" ? t(i) : n(i) : i;
|
|
34
34
|
}, d = (e, t, n = 1) => {
|
|
35
35
|
if (typeof e != "number" || typeof t != "number" || typeof n != "number" || isNaN(e) || isNaN(t) || isNaN(n)) return /* @__PURE__ */ new Date();
|
|
36
36
|
let r = new Date(e, t, n);
|
|
@@ -41,7 +41,7 @@ var s = (e) => !e || isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.ge
|
|
|
41
41
|
}, p = null, m = void 0, h = (e) => {
|
|
42
42
|
if (!e || isNaN(e.getTime())) return "";
|
|
43
43
|
let t = i();
|
|
44
|
-
return
|
|
44
|
+
return p && m === t || (p = new Intl.DateTimeFormat("no", {
|
|
45
45
|
dateStyle: "full",
|
|
46
46
|
timeZone: t
|
|
47
47
|
}), m = t), p.format(e);
|
|
@@ -67,5 +67,4 @@ var s = (e) => !e || isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.ge
|
|
|
67
67
|
let n = c(e), r = c(t);
|
|
68
68
|
return !n || !r ? !1 : n <= r;
|
|
69
69
|
};
|
|
70
|
-
//#endregion
|
|
71
70
|
export { b as filterSelectableDates, s as formatISODate, h as formatReadableDate, c as fromISOToDate, l as fromISOtoLocal, _ as isDateExcluded, g as isDateInRange, y as isDateSelectable, S as isValidDateRange, v as isWeekdayExcluded, u as newDate, f as newDateFromDate, d as newDateYMD, o as parseISODateString, x as sortDateStrings, a as todayInTz };
|