@oslokommune/punkt-react 20.0.3 → 20.0.5
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 +5 -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 +1 -2
- 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/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/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/tag/Tag.tsx +0 -1
|
@@ -2,7 +2,7 @@ import { splitFilenameForTruncation as e } from "../../shared-utils/fileupload/t
|
|
|
2
2
|
import "../../shared-utils/fileupload/index.js";
|
|
3
3
|
import { createContext as t, useContext as n } from "react";
|
|
4
4
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/fileupload/Truncate.tsx
|
|
6
6
|
var o = t({ tail: 5 }), s = ({ children: t, tail: s }) => {
|
|
7
7
|
let c = n(o), l = s === void 0 ? c.tail : s, u = e(t, l);
|
|
8
8
|
return u ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
|
|
@@ -18,5 +18,4 @@ var o = t({ tail: 5 }), s = ({ children: t, tail: s }) => {
|
|
|
18
18
|
children: t
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { s as Truncate, o as TruncateContext };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { formatString as e } from "../../../shared-strings/format.js";
|
|
2
|
+
import { PktButton as t } from "../../button/Button.js";
|
|
3
|
+
import { PktIcon as n } from "../../icon/Icon.js";
|
|
4
4
|
import { PktTextarea as r } from "../../textarea/Textarea.js";
|
|
5
5
|
import { PktFileUploadContext as i } from "../FileUploadContext.js";
|
|
6
6
|
import { useContext as a, useLayoutEffect as o, useRef as s } from "react";
|
|
7
7
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
|
-
var d = "comments", f = (
|
|
10
|
-
let r = new Date(
|
|
11
|
-
if (Number.isNaN(r.getTime())) return
|
|
8
|
+
// src/components/fileupload/extensions/Comments.tsx
|
|
9
|
+
var d = "comments", f = (t, n) => {
|
|
10
|
+
let r = new Date(t);
|
|
11
|
+
if (Number.isNaN(r.getTime())) return t;
|
|
12
12
|
let i = String(r.getDate()).padStart(2, "0"), a = String(r.getMonth() + 1).padStart(2, "0"), o = r.getFullYear(), s = String(r.getHours()).padStart(2, "0"), c = String(r.getMinutes()).padStart(2, "0");
|
|
13
|
-
return
|
|
13
|
+
return e(n.commentTimestamp, {
|
|
14
14
|
date: `${i}.${a}.${o}`,
|
|
15
15
|
time: `${s}:${c}`
|
|
16
16
|
});
|
|
17
|
-
}, p = ({ fileItem: e, disabled:
|
|
17
|
+
}, p = ({ fileItem: e, disabled: n, closeOperationUi: d, onAddComment: f, existingComment: p }) => {
|
|
18
18
|
let { strings: m } = a(i), h = s(null), g = !!p;
|
|
19
19
|
return o(() => {
|
|
20
20
|
let e = setTimeout(() => h.current?.focus({ preventScroll: !0 }), 0);
|
|
@@ -29,13 +29,13 @@ var d = "comments", f = (e, n) => {
|
|
|
29
29
|
rows: 2,
|
|
30
30
|
id: `comment-${e.fileId}`,
|
|
31
31
|
ref: h,
|
|
32
|
-
disabled:
|
|
32
|
+
disabled: n,
|
|
33
33
|
defaultValue: p?.text
|
|
34
34
|
}),
|
|
35
|
-
/* @__PURE__ */ l(
|
|
35
|
+
/* @__PURE__ */ l(t, {
|
|
36
36
|
skin: "secondary",
|
|
37
37
|
size: "small",
|
|
38
|
-
disabled:
|
|
38
|
+
disabled: n,
|
|
39
39
|
onClick: () => {
|
|
40
40
|
let e = h.current?.value?.trim();
|
|
41
41
|
e && f({
|
|
@@ -45,15 +45,15 @@ var d = "comments", f = (e, n) => {
|
|
|
45
45
|
},
|
|
46
46
|
children: g ? m.saveComment : m.addComment
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */ l(
|
|
48
|
+
/* @__PURE__ */ l(t, {
|
|
49
49
|
skin: "tertiary",
|
|
50
50
|
size: "small",
|
|
51
|
-
disabled:
|
|
51
|
+
disabled: n,
|
|
52
52
|
onClick: d,
|
|
53
53
|
children: m.cancel
|
|
54
54
|
})
|
|
55
55
|
] });
|
|
56
|
-
}, m = ({ comment:
|
|
56
|
+
}, m = ({ comment: e, disabled: t, onDeleteComment: r, onEditComment: o }) => {
|
|
57
57
|
let { strings: s } = a(i);
|
|
58
58
|
return /* @__PURE__ */ l("div", {
|
|
59
59
|
className: "pkt-fileupload__queue-display__item__comments",
|
|
@@ -64,10 +64,10 @@ var d = "comments", f = (e, n) => {
|
|
|
64
64
|
children: [/* @__PURE__ */ l("span", {
|
|
65
65
|
className: "pkt-fileupload__queue-display__item__comment__text",
|
|
66
66
|
"aria-label": s.commentText,
|
|
67
|
-
children:
|
|
67
|
+
children: e.text
|
|
68
68
|
}), /* @__PURE__ */ l("time", {
|
|
69
69
|
className: "pkt-fileupload__queue-display__item__comment__time",
|
|
70
|
-
children: f(
|
|
70
|
+
children: f(e.timestamp, s)
|
|
71
71
|
})]
|
|
72
72
|
}), /* @__PURE__ */ u("div", {
|
|
73
73
|
className: "pkt-fileupload__queue-display__item__comment__actions",
|
|
@@ -75,16 +75,16 @@ var d = "comments", f = (e, n) => {
|
|
|
75
75
|
type: "button",
|
|
76
76
|
className: "pkt-fileupload__queue-display__item__comment__action",
|
|
77
77
|
onClick: o,
|
|
78
|
-
disabled:
|
|
78
|
+
disabled: t,
|
|
79
79
|
"aria-label": s.editComment,
|
|
80
|
-
children: /* @__PURE__ */ l(
|
|
80
|
+
children: /* @__PURE__ */ l(n, { name: "edit" })
|
|
81
81
|
}), /* @__PURE__ */ l("button", {
|
|
82
82
|
type: "button",
|
|
83
83
|
className: "pkt-fileupload__queue-display__item__comment__action",
|
|
84
84
|
onClick: r,
|
|
85
|
-
disabled:
|
|
85
|
+
disabled: t,
|
|
86
86
|
"aria-label": s.deleteComment,
|
|
87
|
-
children: /* @__PURE__ */ l(
|
|
87
|
+
children: /* @__PURE__ */ l(n, { name: "trash-can" })
|
|
88
88
|
})]
|
|
89
89
|
})]
|
|
90
90
|
})
|
|
@@ -124,5 +124,4 @@ var d = "comments", f = (e, n) => {
|
|
|
124
124
|
},
|
|
125
125
|
renderHidden: (e) => /* @__PURE__ */ l(h, { comments: e.getAttribute(d) }, `comments${e.file.fileId}`)
|
|
126
126
|
});
|
|
127
|
-
//#endregion
|
|
128
127
|
export { _ as addCommentOperation };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/fileupload/extensions/Remove.tsx
|
|
2
2
|
var e = (e, t) => ({
|
|
3
3
|
id: "remove",
|
|
4
4
|
title: t.remove,
|
|
5
5
|
ariaLabel: t.removeFile,
|
|
6
6
|
onClick: ({ file: t }) => e(t.fileId)
|
|
7
7
|
});
|
|
8
|
-
//#endregion
|
|
9
8
|
export { e as removeFileOperation };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { PktButton as e } from "../../button/Button.js";
|
|
2
|
-
import { getDisplayFilename as t } from "../../../shared-utils/fileupload/filename.js";
|
|
3
1
|
import "../../../shared-utils/fileupload/index.js";
|
|
2
|
+
import { getDisplayFilename as e } from "../../../shared-utils/fileupload/filename.js";
|
|
3
|
+
import { PktButton as t } from "../../button/Button.js";
|
|
4
4
|
import { PktFileUploadContext as n } from "../FileUploadContext.js";
|
|
5
5
|
import { useContext as r, useId as i, useRef as a } from "react";
|
|
6
6
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
var l = ({ initialValue:
|
|
7
|
+
// src/components/fileupload/extensions/Rename.tsx
|
|
8
|
+
var l = ({ initialValue: e, disabled: l, onSave: u, onCancel: d }) => {
|
|
9
9
|
let { strings: f } = r(n), p = a(null), m = i(), h = () => u(p.current?.value ?? "");
|
|
10
10
|
return /* @__PURE__ */ c(o, { children: [
|
|
11
11
|
/* @__PURE__ */ s("label", {
|
|
@@ -19,20 +19,20 @@ var l = ({ initialValue: t, disabled: l, onSave: u, onCancel: d }) => {
|
|
|
19
19
|
type: "text",
|
|
20
20
|
autoFocus: !0,
|
|
21
21
|
disabled: l,
|
|
22
|
-
defaultValue:
|
|
22
|
+
defaultValue: e,
|
|
23
23
|
className: "pkt-fileupload__queue-display__item__rename-input",
|
|
24
24
|
onKeyDown: (e) => {
|
|
25
25
|
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), h()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), d());
|
|
26
26
|
}
|
|
27
27
|
}),
|
|
28
|
-
/* @__PURE__ */ s(
|
|
28
|
+
/* @__PURE__ */ s(t, {
|
|
29
29
|
skin: "secondary",
|
|
30
30
|
size: "small",
|
|
31
31
|
disabled: l,
|
|
32
32
|
onClick: h,
|
|
33
33
|
children: f.save
|
|
34
34
|
}),
|
|
35
|
-
/* @__PURE__ */ s(
|
|
35
|
+
/* @__PURE__ */ s(t, {
|
|
36
36
|
skin: "tertiary",
|
|
37
37
|
size: "small",
|
|
38
38
|
disabled: l,
|
|
@@ -47,7 +47,7 @@ var l = ({ initialValue: t, disabled: l, onSave: u, onCancel: d }) => {
|
|
|
47
47
|
name: `${t.name}-targetFilename`,
|
|
48
48
|
value: e
|
|
49
49
|
});
|
|
50
|
-
}, d = (
|
|
50
|
+
}, d = (t) => t.getAttribute("targetFilename") || e(t.file, ""), f = (e) => ({
|
|
51
51
|
id: "rename",
|
|
52
52
|
title: e.rename,
|
|
53
53
|
ariaLabel: e.renameFile,
|
|
@@ -62,5 +62,4 @@ var l = ({ initialValue: t, disabled: l, onSave: u, onCancel: d }) => {
|
|
|
62
62
|
}),
|
|
63
63
|
renderHidden: (e) => /* @__PURE__ */ s(u, { targetFilename: d(e) }, `rename${e.file.fileId}`)
|
|
64
64
|
});
|
|
65
|
-
//#endregion
|
|
66
65
|
export { f as renameFileOperation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as e, useMemo as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/fileupload/hooks/useFileAttributes.ts
|
|
3
3
|
var n = (n, r) => {
|
|
4
4
|
let i = e((e, t) => n.find((t) => t.fileId === e)?.attributes?.[t], [n]), a = e((e, t, i) => {
|
|
5
5
|
let a = n.find((t) => t.fileId === e);
|
|
@@ -21,5 +21,4 @@ var n = (n, r) => {
|
|
|
21
21
|
}), [i, a])
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { n as useFileAttributes };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as e, useState as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/fileupload/hooks/useImageObjectUrl.ts
|
|
3
3
|
var n = (n) => {
|
|
4
4
|
let [r, i] = t(null);
|
|
5
5
|
return e(() => {
|
|
@@ -11,5 +11,4 @@ var n = (n) => {
|
|
|
11
11
|
}), () => URL.revokeObjectURL(e);
|
|
12
12
|
}, [n]), r && r.file === n ? r.url : null;
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { n as useImageObjectUrl };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { navigateCyclic as e } from "../../../shared-utils/fileupload/navigation.js";
|
|
2
2
|
import "../../../shared-utils/fileupload/index.js";
|
|
3
3
|
import { useCallback as t, useRef as n, useState as r } from "react";
|
|
4
|
-
|
|
4
|
+
// src/components/fileupload/hooks/useImagePreview.ts
|
|
5
5
|
var i = (i) => {
|
|
6
6
|
let [a, o] = r(!1), [s, c] = r(0), l = n(null);
|
|
7
7
|
return {
|
|
@@ -20,5 +20,4 @@ var i = (i) => {
|
|
|
20
20
|
}, [i.length])
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { i as useImagePreview };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as e, useState as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/fileupload/hooks/useOperationState.ts
|
|
3
3
|
var n = (n) => {
|
|
4
4
|
let [r, i] = t({}), [a, o] = t(n);
|
|
5
5
|
if (n !== a) {
|
|
@@ -27,5 +27,4 @@ var n = (n) => {
|
|
|
27
27
|
}, [])
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { n as useOperationState };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as e } from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/fileupload/hooks/useRequiredFormValidation.ts
|
|
3
3
|
var t = (t, { uploadStrategy: n, required: r, currentFileCount: i, onMissingFiles: a }) => {
|
|
4
4
|
e(() => {
|
|
5
5
|
if (n !== "custom" || !r) return;
|
|
@@ -19,5 +19,4 @@ var t = (t, { uploadStrategy: n, required: r, currentFileCount: i, onMissingFile
|
|
|
19
19
|
a
|
|
20
20
|
]);
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { t as useRequiredFormValidation };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { uuidish as e } from "../../utils/stringutils.js";
|
|
2
|
+
import t from "../../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/defineProperty.js";
|
|
3
|
+
// src/components/fileupload/types.ts
|
|
4
4
|
var n = class {
|
|
5
5
|
constructor(n, r) {
|
|
6
|
-
|
|
6
|
+
t(this, "fileId", void 0), t(this, "file", void 0), t(this, "attributes", void 0), this.fileId = r || e(), this.file = n, this.attributes = { targetFilename: n.name };
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n as FileItem };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../shared-types/footer.js";
|
|
3
3
|
import "../../shared-types/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getLinkDomainLabel as e } from "../../shared-utils/header-footer/external-domain.js";
|
|
5
5
|
import { PktConsent as t } from "../consent/Consent.js";
|
|
6
|
-
import {
|
|
6
|
+
import { PktIcon as n } from "../icon/Icon.js";
|
|
7
7
|
import { FooterGlobal as r, useGlobalFooterData as i } from "./FooterGlobal.js";
|
|
8
8
|
import { useEffect as a, useMemo as o } from "react";
|
|
9
9
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
|
-
var l = ({ link:
|
|
12
|
-
let r =
|
|
10
|
+
// src/components/footer/Footer.tsx
|
|
11
|
+
var l = ({ link: t, openLinksInNewTab: n }) => {
|
|
12
|
+
let r = t.openInNewTab || n, i = t.external ? e(t.href) : void 0;
|
|
13
13
|
return /* @__PURE__ */ s("li", { children: /* @__PURE__ */ c("a", {
|
|
14
|
-
href:
|
|
14
|
+
href: t.href,
|
|
15
15
|
target: r ? "_blank" : "_self",
|
|
16
16
|
rel: r ? "noopener noreferrer" : void 0,
|
|
17
|
-
children: [
|
|
17
|
+
children: [t.text, i && /* @__PURE__ */ c("span", {
|
|
18
18
|
className: "pkt-footer__link-domain",
|
|
19
19
|
children: [
|
|
20
20
|
" (",
|
|
@@ -33,7 +33,7 @@ var l = ({ link: e, openLinksInNewTab: t }) => {
|
|
|
33
33
|
openLinksInNewTab: t
|
|
34
34
|
}, `${e.href}|${e.text}`))
|
|
35
35
|
})
|
|
36
|
-
] }), d = ({ columns:
|
|
36
|
+
] }), d = ({ columns: e, columnOne: l, columnTwo: d, personvernOgInfoLink: f, tilgjengelighetLink: p, socialLinks: m, skipGlobal: h = !1, data: g, dataUrl: _, locale: v = "nb-NO", openLinksInNewTab: y = !1, includeConsent: b = !1, hotjarId: x = null, googleAnalyticsId: S = null, devMode: C = !1, cookieDomain: w = null, cookieSecure: T = null, cookieExpiryDays: E = null, onToggleConsent: D, onDataError: O, className: k, ...A }) => {
|
|
37
37
|
a(() => {
|
|
38
38
|
(l || d) && console.warn("PktFooter: The \"columnOne\"/\"columnTwo\" props are deprecated and will be removed in a future version. Please use \"columns\" instead.");
|
|
39
39
|
}, [l, d]), a(() => {
|
|
@@ -48,19 +48,19 @@ var l = ({ link: e, openLinksInNewTab: t }) => {
|
|
|
48
48
|
skipGlobal: h,
|
|
49
49
|
onDataError: O
|
|
50
50
|
}), M = o(() => {
|
|
51
|
-
let
|
|
52
|
-
return f && f !== "https://www.oslo.kommune.no/personvern-og-informasjonskapsler/" &&
|
|
51
|
+
let t = e?.length ? e : [l, d].filter(Boolean), n = [];
|
|
52
|
+
return f && f !== "https://www.oslo.kommune.no/personvern-og-informasjonskapsler/" && n.push({
|
|
53
53
|
text: "Personvern og informasjonskapsler",
|
|
54
54
|
href: f
|
|
55
|
-
}), p && p !== "https://www.oslo.kommune.no/tilgjengelighet/" &&
|
|
55
|
+
}), p && p !== "https://www.oslo.kommune.no/tilgjengelighet/" && n.push({
|
|
56
56
|
text: "Tilgjengelighet",
|
|
57
57
|
href: p
|
|
58
|
-
}),
|
|
58
|
+
}), n.length ? [...t, {
|
|
59
59
|
title: "Om nettstedet",
|
|
60
|
-
links:
|
|
61
|
-
}] :
|
|
60
|
+
links: n
|
|
61
|
+
}] : t;
|
|
62
62
|
}, [
|
|
63
|
-
|
|
63
|
+
e,
|
|
64
64
|
l,
|
|
65
65
|
d,
|
|
66
66
|
f,
|
|
@@ -109,17 +109,17 @@ var l = ({ link: e, openLinksInNewTab: t }) => {
|
|
|
109
109
|
}) }, `${e.href}|${e.language}`))
|
|
110
110
|
}), /* @__PURE__ */ s("ul", {
|
|
111
111
|
className: "pkt-footer__some",
|
|
112
|
-
children: I.map((
|
|
112
|
+
children: I.map((e) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s("a", {
|
|
113
113
|
className: "pkt-footer__some-link",
|
|
114
|
-
href:
|
|
115
|
-
"aria-label": `til ${
|
|
116
|
-
target:
|
|
117
|
-
rel:
|
|
118
|
-
children: /* @__PURE__ */ s(
|
|
114
|
+
href: e.href,
|
|
115
|
+
"aria-label": `til ${e.iconName}`,
|
|
116
|
+
target: e.openInNewTab || y ? "_blank" : "_self",
|
|
117
|
+
rel: e.openInNewTab || y ? "noopener noreferrer" : void 0,
|
|
118
|
+
children: /* @__PURE__ */ s(n, {
|
|
119
119
|
className: "pkt-footer__some-icon",
|
|
120
|
-
name:
|
|
120
|
+
name: e.iconName
|
|
121
121
|
})
|
|
122
|
-
}) }, `${
|
|
122
|
+
}) }, `${e.href}|${e.iconName}`))
|
|
123
123
|
})]
|
|
124
124
|
})
|
|
125
125
|
]
|
|
@@ -131,5 +131,4 @@ var l = ({ link: e, openLinksInNewTab: t }) => {
|
|
|
131
131
|
})]
|
|
132
132
|
});
|
|
133
133
|
};
|
|
134
|
-
//#endregion
|
|
135
134
|
export { d as PktFooter };
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { deriveSocialIcon as e } from "../../shared-utils/header-footer/icon-map.js";
|
|
3
|
+
import { fetchHeaderFooterData as t } from "../../shared-utils/header-footer/fetch-header-footer-data.js";
|
|
4
|
+
import { getExternalDomainLabel as n } from "../../shared-utils/header-footer/external-domain.js";
|
|
5
5
|
import { selectLocaleData as r } from "../../shared-utils/header-footer/select-megamenu.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { PktConsent as i } from "../consent/Consent.js";
|
|
7
|
+
import { PktIcon as a } from "../icon/Icon.js";
|
|
8
8
|
import { useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
9
9
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
-
|
|
10
|
+
// src/components/footer/FooterGlobal.tsx
|
|
11
11
|
var f = "#cb-trigger";
|
|
12
|
-
function p({ data: e, dataUrl:
|
|
12
|
+
function p({ data: e, dataUrl: n, locale: i = "nb-NO", skipGlobal: a = !1, onDataError: u }) {
|
|
13
13
|
let [d, f] = l(), p = c(u);
|
|
14
14
|
p.current = u, o(() => {
|
|
15
|
-
if (e ||
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
|
|
15
|
+
if (e || a) return;
|
|
16
|
+
let r = new AbortController();
|
|
17
|
+
return t(n, r.signal).then((e) => {
|
|
18
|
+
r.signal.aborted || f(e);
|
|
19
19
|
}).catch((e) => {
|
|
20
20
|
e.name !== "AbortError" && (console.warn("Failed to fetch header/footer data:", e), p.current?.(e));
|
|
21
|
-
}), () =>
|
|
21
|
+
}), () => r.abort();
|
|
22
22
|
}, [
|
|
23
23
|
e,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
n,
|
|
25
|
+
a
|
|
26
26
|
]);
|
|
27
27
|
let m = e ?? d;
|
|
28
28
|
return s(() => {
|
|
29
|
-
if (!
|
|
29
|
+
if (!a) return r(m, i)?.footer;
|
|
30
30
|
}, [
|
|
31
31
|
m,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
i,
|
|
33
|
+
a
|
|
34
34
|
]);
|
|
35
35
|
}
|
|
36
|
-
var m = ({ link: e, includeConsent:
|
|
37
|
-
if (e.url === f) return
|
|
36
|
+
var m = ({ link: e, includeConsent: t, consent: r }) => {
|
|
37
|
+
if (e.url === f) return t ? /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u(i, {
|
|
38
38
|
triggerType: "footerlink",
|
|
39
39
|
triggerText: e.text,
|
|
40
40
|
...r
|
|
41
41
|
}) }) : null;
|
|
42
|
-
let a =
|
|
42
|
+
let a = n(e.url);
|
|
43
43
|
return /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("a", {
|
|
44
44
|
href: e.url,
|
|
45
45
|
children: [e.text, a && /* @__PURE__ */ d("span", {
|
|
@@ -59,14 +59,14 @@ var m = ({ link: e, includeConsent: n, consent: r }) => {
|
|
|
59
59
|
consent: n
|
|
60
60
|
}, `${e.url}|${e.text}`))
|
|
61
61
|
})] }), g = ({ entry: t }) => {
|
|
62
|
-
let
|
|
63
|
-
return
|
|
62
|
+
let n = e(t.url, t.text);
|
|
63
|
+
return n ? /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("a", {
|
|
64
64
|
className: "pkt-footer__some-link",
|
|
65
65
|
href: t.url,
|
|
66
66
|
"aria-label": t.text,
|
|
67
|
-
children: /* @__PURE__ */ u(
|
|
67
|
+
children: /* @__PURE__ */ u(a, {
|
|
68
68
|
className: "pkt-footer__some-icon",
|
|
69
|
-
name:
|
|
69
|
+
name: n
|
|
70
70
|
})
|
|
71
71
|
}) }) : /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("a", {
|
|
72
72
|
href: t.url,
|
|
@@ -101,5 +101,4 @@ var m = ({ link: e, includeConsent: n, consent: r }) => {
|
|
|
101
101
|
})
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
|
-
//#endregion
|
|
105
104
|
export { _ as FooterGlobal, p as useGlobalFooterData };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../shared-types/footer.js";
|
|
3
3
|
import "../../shared-types/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getLinkDomainLabel as e } from "../../shared-utils/header-footer/external-domain.js";
|
|
5
5
|
import { PktConsent as t } from "../consent/Consent.js";
|
|
6
|
-
import {
|
|
6
|
+
import { PktIcon as n } from "../icon/Icon.js";
|
|
7
7
|
import { FooterGlobal as r, useGlobalFooterData as i } from "../footer/FooterGlobal.js";
|
|
8
8
|
import { useEffect as a, useMemo as o } from "react";
|
|
9
9
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
|
-
|
|
10
|
+
// src/components/footerSimple/FooterSimple.tsx
|
|
11
11
|
var l = ({ link: t, openLinksInNewTab: r }) => {
|
|
12
|
-
let i = t.openInNewTab || r, a = t.external ?
|
|
12
|
+
let i = t.openInNewTab || r, a = t.external ? e(t.href) : void 0;
|
|
13
13
|
return /* @__PURE__ */ c("a", {
|
|
14
14
|
className: "pkt-footer-simple__link",
|
|
15
15
|
href: t.href,
|
|
16
16
|
target: i ? "_blank" : "_self",
|
|
17
17
|
rel: i ? "noopener noreferrer" : void 0,
|
|
18
|
-
children: [/* @__PURE__ */ s(
|
|
18
|
+
children: [/* @__PURE__ */ s(n, {
|
|
19
19
|
className: "pkt-footer-simple__link-icon",
|
|
20
20
|
name: "arrow-link"
|
|
21
21
|
}), /* @__PURE__ */ c("span", { children: [t.text, a && /* @__PURE__ */ c("span", {
|
|
@@ -84,5 +84,4 @@ var l = ({ link: t, openLinksInNewTab: r }) => {
|
|
|
84
84
|
})]
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
|
-
//#endregion
|
|
88
87
|
export { u as PktFooterSimple };
|
|
@@ -2,7 +2,7 @@ import { PktHeaderGlobal as e } from "./HeaderGlobal.js";
|
|
|
2
2
|
import { PktHeaderService as t } from "./HeaderService.js";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/header/Header.tsx
|
|
6
6
|
var i = n((n, i) => n.type === "global" ? /* @__PURE__ */ r(e, {
|
|
7
7
|
...n,
|
|
8
8
|
ref: i
|
|
@@ -11,5 +11,4 @@ var i = n((n, i) => n.type === "global" ? /* @__PURE__ */ r(e, {
|
|
|
11
11
|
ref: i
|
|
12
12
|
}));
|
|
13
13
|
i.displayName = "PktHeader";
|
|
14
|
-
//#endregion
|
|
15
14
|
export { i as PktHeader };
|