@oslokommune/punkt-elements 19.2.0 → 19.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/{accordion-BLMbI8SQ.cjs → accordion-CZ0O4c0_.cjs} +1 -1
- package/dist/{accordion-Bwka5Mxo.js → accordion-DFcdonl-.js} +5 -5
- package/dist/{alert-vIaasUjb.js → alert-BhvjSA5X.js} +7 -7
- package/dist/{alert-DsGNGcgd.cjs → alert-D1bQjZ7C.cjs} +2 -2
- package/dist/{async-directive-U0EE5r36.cjs → async-directive-BGoo_npW.cjs} +1 -1
- package/dist/{async-directive-C8UAk8Mv.js → async-directive-DsdqP_X7.js} +2 -2
- package/dist/{backlink-DM220m4q.cjs → backlink-Bw6IcRIo.cjs} +1 -1
- package/dist/{backlink-BjJwDjuP.js → backlink-DIdgvE2j.js} +3 -3
- package/dist/{breadcrumbs-B1pDtQy8.js → breadcrumbs-BfgCx3Xj.js} +2 -2
- package/dist/{breadcrumbs-BUmbj-hP.cjs → breadcrumbs-C10K1XLP.cjs} +1 -1
- package/dist/{button-BUl8uWWh.js → button-B5rWxfei.js} +5 -5
- package/dist/{button-CCR4eyt_.cjs → button-CmNrMH-c.cjs} +1 -1
- package/dist/{calendar-CtfdBqJN.cjs → calendar-D-Ow5DAp.cjs} +1 -1
- package/dist/{calendar-DWSW_GeN.js → calendar-U8xkRdgF.js} +3 -3
- package/dist/{card-27RxxKxW.js → card-D2YYPZr5.js} +23 -22
- package/dist/{card-B-RKnu_C.cjs → card-DW1uklP6.cjs} +6 -6
- package/dist/{checkbox-CTf4GatI.js → checkbox-B2O0fkh9.js} +25 -14
- package/dist/checkbox-C0zLtnCI.cjs +40 -0
- package/dist/{class-map-D5GHsely.js → class-map-C4hdfSfY.js} +1 -1
- package/dist/{class-map-B0FX3YsK.cjs → class-map-Drv0_anQ.cjs} +1 -1
- package/dist/{combobox-nqNZDvBR.cjs → combobox-BgduqUpf.cjs} +1 -1
- package/dist/{combobox-DHL_CGYv.js → combobox-DpXTwNr4.js} +12 -12
- package/dist/components/card/card.d.ts +2 -1
- package/dist/components/checkbox/checkbox.d.ts +3 -2
- package/dist/components/fileupload/fileupload-operations.d.ts +6 -3
- package/dist/components/fileupload/fileupload-renderers.d.ts +5 -3
- package/dist/{consent-BeoP4rOa.js → consent-BBxZkgCO.js} +2 -2
- package/dist/{consent-Cle1hkPg.cjs → consent-BjYaCbef.cjs} +1 -1
- package/dist/{datepicker-DvO3w0eM.cjs → datepicker-53rj_Qqx.cjs} +1 -1
- package/dist/{datepicker-BWp2PM9S.js → datepicker-BLBimRTT.js} +11 -11
- package/dist/{directive-helpers-BushnrQQ.cjs → directive-helpers-BRrz3Bcj.cjs} +1 -1
- package/dist/{directive-helpers-DpyLJPJm.js → directive-helpers-D96YEsht.js} +1 -1
- package/dist/{element-CewjrA4g.cjs → element-BOmr9YLv.cjs} +1 -1
- package/dist/{element-CqC-sGuC.js → element-mwwC2Rra.js} +37 -3
- package/dist/{element-with-slot-MCvSBwUv.cjs → element-with-slot-2PHu2w7O.cjs} +1 -1
- package/dist/{element-with-slot-D_OKDlYo.js → element-with-slot-FD826ooP.js} +2 -2
- package/dist/{fileupload-DDLvQaSS.cjs → fileupload-4wgr4iAi.cjs} +78 -76
- package/dist/{fileupload-DbtTD1aU.js → fileupload-BxfBFhFt.js} +120 -100
- package/dist/{footer-CupUAe8d.cjs → footer-BGj1uWwC.cjs} +1 -1
- package/dist/{footer-UT8MbnCT.js → footer-D_d5kq44.js} +4 -4
- package/dist/{header-BxgtAiNM.js → header-CF-Re0nT.js} +14 -13
- package/dist/{header-wdEiBTI9.cjs → header-Cs4t2XMM.cjs} +4 -3
- package/dist/{header-menu-DGywRJCx.cjs → header-menu-BnqZagI6.cjs} +3 -3
- package/dist/{header-menu-CTEPH4St.js → header-menu-C9k9xG9V.js} +6 -6
- package/dist/{heading-ELXWxyTv.js → heading-BRHCV_5J.js} +2 -2
- package/dist/{heading-BDdX4JiM.cjs → heading-u9Arof4p.cjs} +1 -1
- package/dist/{helptext-DQe6GO75.cjs → helptext-DYgeTMtA.cjs} +1 -1
- package/dist/{helptext-BQkrYsoV.js → helptext-sRC8EJqL.js} +4 -4
- package/dist/{icon-Clz68-Kz.cjs → icon-CoBsgGUR.cjs} +1 -1
- package/dist/{icon-B2v30QUk.js → icon-DmRyYNlY.js} +1 -1
- package/dist/if-defined-2mkIDgOm.cjs +1 -0
- package/dist/{if-defined-BNXGXCwT.js → if-defined-Bebu3LXY.js} +1 -1
- package/dist/{input-element-BTzuDh4h.js → input-element-B1BntJeJ.js} +2 -2
- package/dist/{input-element-BdIWsDl-.cjs → input-element-W6Gklt2E.cjs} +1 -1
- package/dist/{input-wrapper-B5GdwzAM.js → input-wrapper-C1zXIKBU.js} +6 -6
- package/dist/{input-wrapper-BmPdpY4N.cjs → input-wrapper-CSPPa4uc.cjs} +1 -1
- package/dist/{link-BxKWhYsn.js → link-DcxVUj8s.js} +4 -4
- package/dist/{link-1JEWpEDG.cjs → link-EMsHusF7.cjs} +1 -1
- package/dist/{linkcard-DXOkeQUy.cjs → linkcard-CWeR6t2a.cjs} +1 -1
- package/dist/{linkcard-CICSZ7pK.js → linkcard-MJFR7FLT.js} +4 -4
- package/dist/{listbox-3fi7wQz4.cjs → listbox-BoBwzL4p.cjs} +6 -6
- package/dist/{listbox-7pQ0UjKV.js → listbox-DEzd-dxF.js} +65 -61
- package/dist/{loader-nIl61aTv.js → loader-CqFQoJlM.js} +4 -4
- package/dist/{loader-BA__N62k.cjs → loader-SJ6NauNT.cjs} +1 -1
- package/dist/{messagebox-D2xvSYWI.cjs → messagebox-D5GYIdjE.cjs} +2 -2
- package/dist/{messagebox-E8W7RyAJ.js → messagebox-DsKi_rKn.js} +5 -5
- package/dist/{modal-D5tGq-nN.js → modal-CJqe6y-V.js} +7 -7
- package/dist/{modal-i3Qxv38H.cjs → modal-DaerHpVi.cjs} +3 -3
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.cjs +1 -1
- package/dist/pkt-breadcrumbs.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +35 -35
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-BClk341e.cjs → pkt-options-controller-Dz-rYCG1.cjs} +1 -1
- package/dist/{pkt-options-controller-v2bPM9iU.js → pkt-options-controller-sUzxHa5A.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{progressbar-4WyR4T72.js → progressbar-Bd0DjiAb.js} +5 -5
- package/dist/{progressbar-CJFGbev-.cjs → progressbar-BrVlAcQI.cjs} +1 -1
- package/dist/{radiobutton-D7308uCY.js → radiobutton-B0V-jSEX.js} +4 -4
- package/dist/{radiobutton-BQRtv7PK.cjs → radiobutton-Cv1BlwLV.cjs} +1 -1
- package/dist/{ref-37-yxmc4.js → ref-CCSGk4MP.js} +2 -2
- package/dist/{ref-HT6KRjxp.cjs → ref-Emu5PNxk.cjs} +1 -1
- package/dist/{repeat-DntD73oB.js → repeat-CdxGS-_3.js} +2 -2
- package/dist/{repeat-Ddge5HTp.cjs → repeat-Dh9YKoeV.cjs} +1 -1
- package/dist/{searchinput-D1cJ73Ki.cjs → searchinput-7-VVdkss.cjs} +1 -1
- package/dist/{searchinput-j4IvYRzj.js → searchinput-CgzigmiI.js} +4 -4
- package/dist/{select-CDoA2rpC.cjs → select---PCiwmy.cjs} +1 -1
- package/dist/{select-BhK8veJn.js → select-BbcGPmPs.js} +7 -7
- package/dist/shared-strings/nb.d.ts +34 -0
- package/dist/shared-types/checkbox.d.ts +52 -0
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/{tabs-DexV26qJ.js → tabs-B134M9k2.js} +4 -4
- package/dist/{tabs-95BpwB6j.cjs → tabs-Dw9E06fL.cjs} +1 -1
- package/dist/{tag-CQEyjF32.cjs → tag-HTYKd-iG.cjs} +1 -1
- package/dist/{tag-DoUC99hn.js → tag-wYnHhHLK.js} +5 -5
- package/dist/{textarea-sulH-Yk7.js → textarea-BcgVLLTt.js} +9 -9
- package/dist/{textarea-BLVuKEng.cjs → textarea-pA_xv8lI.cjs} +1 -1
- package/dist/{textinput-CSrBua2N.cjs → textinput-Czz2affL.cjs} +1 -1
- package/dist/{textinput-Di2lAf2R.js → textinput-Dpj1X5yr.js} +8 -8
- package/dist/{timepicker-Iq1-vWRn.cjs → timepicker-BwDZkSpo.cjs} +1 -1
- package/dist/{timepicker-BaDGjuOR.js → timepicker-CfQMZlaP.js} +8 -8
- package/package.json +2 -2
- package/src/components/alert/alert.test.ts +1 -1
- package/src/components/alert/alert.ts +1 -1
- package/src/components/card/card.ts +7 -2
- package/src/components/checkbox/checkbox.ts +13 -8
- package/src/components/fileupload/fileupload-operations.ts +31 -22
- package/src/components/fileupload/fileupload-renderers.ts +28 -17
- package/src/components/fileupload/fileupload.ts +26 -9
- package/src/components/header/header-global.ts +2 -1
- package/src/components/header/header-service.test.ts +15 -0
- package/src/components/header/header-user-menu.ts +1 -1
- package/src/components/header-menu/header-menu.ts +2 -2
- package/src/components/listbox/listbox.ts +9 -4
- package/src/components/messagebox/messagebox.ts +1 -1
- package/src/components/modal/modal.ts +2 -2
- package/dist/checkbox-DlzVGBum.cjs +0 -40
- package/dist/if-defined-CjRKmMQs.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { _ as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./element-
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import { t as c } from "./if-defined-
|
|
1
|
+
import { _ as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./element-mwwC2Rra.js";
|
|
2
|
+
import { t as s } from "./class-map-C4hdfSfY.js";
|
|
3
|
+
import { t as c } from "./if-defined-Bebu3LXY.js";
|
|
4
4
|
import { n as l, t as u } from "./format-BTeSVkED.js";
|
|
5
|
-
import "./alert-
|
|
6
|
-
import "./icon-
|
|
5
|
+
import "./alert-BhvjSA5X.js";
|
|
6
|
+
import "./icon-DmRyYNlY.js";
|
|
7
7
|
import { t as d } from "./converters-CkjLSYpa.js";
|
|
8
8
|
import { n as f } from "./utils-BwF4QSrq.js";
|
|
9
|
-
import "./input-wrapper-
|
|
9
|
+
import "./input-wrapper-C1zXIKBU.js";
|
|
10
10
|
import { r as p } from "./focus-trap-DG3pEuyJ.js";
|
|
11
|
-
import "./modal-
|
|
12
|
-
import "./progressbar-
|
|
11
|
+
import "./modal-CJqe6y-V.js";
|
|
12
|
+
import "./progressbar-Bd0DjiAb.js";
|
|
13
13
|
//#region ../../shared-utils/fileupload/size.ts
|
|
14
14
|
function m(e) {
|
|
15
15
|
if (e == null || e === "") return;
|
|
@@ -487,52 +487,57 @@ r([o({ type: String })], j.prototype, "id", void 0), r([o({ type: String })], j.
|
|
|
487
487
|
})], j.prototype, "truncateTail", void 0), r([o({ attribute: !1 })], j.prototype, "value", void 0), r([o({ attribute: !1 })], j.prototype, "defaultValue", void 0), r([n()], j.prototype, "files", void 0), r([n()], j.prototype, "isDragActive", void 0), r([n()], j.prototype, "validationErrorMessage", void 0), r([n()], j.prototype, "addedAnnouncement", void 0), r([n()], j.prototype, "thumbnailUrls", void 0);
|
|
488
488
|
//#endregion
|
|
489
489
|
//#region src/components/fileupload/fileupload-operations.ts
|
|
490
|
-
var M = "comments", N = (e) => {
|
|
491
|
-
let
|
|
492
|
-
|
|
490
|
+
var M = "comments", N = (e, t) => {
|
|
491
|
+
let n = new Date(e);
|
|
492
|
+
if (Number.isNaN(n.getTime())) return e;
|
|
493
|
+
let r = String(n.getDate()).padStart(2, "0"), i = String(n.getMonth() + 1).padStart(2, "0"), a = n.getFullYear(), o = String(n.getHours()).padStart(2, "0"), s = String(n.getMinutes()).padStart(2, "0");
|
|
494
|
+
return u(t.commentTimestamp, {
|
|
495
|
+
date: `${r}.${i}.${a}`,
|
|
496
|
+
time: `${o}:${s}`
|
|
497
|
+
});
|
|
493
498
|
}, P = (e, t, n) => {
|
|
494
499
|
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), t()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), n());
|
|
495
500
|
}, F = (e, t, n) => {
|
|
496
501
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), n()), (e.metaKey || e.ctrlKey) && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), t());
|
|
497
|
-
}, I = (e) => ({
|
|
502
|
+
}, I = (e, t) => ({
|
|
498
503
|
id: "remove",
|
|
499
|
-
title:
|
|
500
|
-
ariaLabel:
|
|
504
|
+
title: t.remove,
|
|
505
|
+
ariaLabel: t.removeFile,
|
|
501
506
|
onClick: ({ file: t }) => e(t.fileId)
|
|
502
|
-
}), L = () => ({
|
|
507
|
+
}), L = (t) => ({
|
|
503
508
|
id: "rename",
|
|
504
|
-
title:
|
|
505
|
-
ariaLabel:
|
|
506
|
-
renderInlineUI: (
|
|
507
|
-
let
|
|
508
|
-
let e = document.getElementById(
|
|
509
|
-
e &&
|
|
509
|
+
title: t.rename,
|
|
510
|
+
ariaLabel: t.renameFile,
|
|
511
|
+
renderInlineUI: (n) => {
|
|
512
|
+
let r = n.getAttribute("targetFilename") || n.file.attributes?.targetFilename || n.file.file?.name || "", i = `pkt-fileupload-rename-${n.file.fileId}`, a = () => {
|
|
513
|
+
let e = document.getElementById(i)?.value?.trim();
|
|
514
|
+
e && n.setAttribute("targetFilename", e), n.close();
|
|
510
515
|
};
|
|
511
516
|
return e`
|
|
512
|
-
<label for=${
|
|
517
|
+
<label for=${i} class="pkt-sr-only">${t.renameInputLabel}</label>
|
|
513
518
|
<input
|
|
514
|
-
id=${
|
|
519
|
+
id=${i}
|
|
515
520
|
type="text"
|
|
516
521
|
class="pkt-fileupload__queue-display__item__rename-input"
|
|
517
|
-
?disabled=${
|
|
518
|
-
.value=${
|
|
519
|
-
@keydown=${(e) => P(e,
|
|
522
|
+
?disabled=${n.disabled}
|
|
523
|
+
.value=${r}
|
|
524
|
+
@keydown=${(e) => P(e, a, n.close)}
|
|
520
525
|
/>
|
|
521
526
|
<button
|
|
522
527
|
type="button"
|
|
523
528
|
class="pkt-btn pkt-btn--secondary pkt-btn--small"
|
|
524
|
-
?disabled=${
|
|
525
|
-
@click=${
|
|
529
|
+
?disabled=${n.disabled}
|
|
530
|
+
@click=${a}
|
|
526
531
|
>
|
|
527
|
-
|
|
532
|
+
${t.save}
|
|
528
533
|
</button>
|
|
529
534
|
<button
|
|
530
535
|
type="button"
|
|
531
536
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small"
|
|
532
|
-
?disabled=${
|
|
533
|
-
@click=${
|
|
537
|
+
?disabled=${n.disabled}
|
|
538
|
+
@click=${n.close}
|
|
534
539
|
>
|
|
535
|
-
|
|
540
|
+
${t.cancel}
|
|
536
541
|
</button>
|
|
537
542
|
`;
|
|
538
543
|
},
|
|
@@ -544,81 +549,81 @@ var M = "comments", N = (e) => {
|
|
|
544
549
|
value=${n}
|
|
545
550
|
/>`;
|
|
546
551
|
}
|
|
547
|
-
}), R = () => ({
|
|
552
|
+
}), R = (t) => ({
|
|
548
553
|
id: "comment",
|
|
549
|
-
title: (e) => (e.attributes?.[M] ?? []).length > 0 ? "" :
|
|
550
|
-
ariaLabel:
|
|
551
|
-
renderExtendedUI: (
|
|
552
|
-
let
|
|
553
|
-
let e = document.getElementById(
|
|
554
|
-
e &&
|
|
554
|
+
title: (e) => (e.attributes?.[M] ?? []).length > 0 ? "" : t.addComment,
|
|
555
|
+
ariaLabel: t.addComment,
|
|
556
|
+
renderExtendedUI: (n) => {
|
|
557
|
+
let r = (n.getAttribute(M) ?? [])[0], i = `pkt-fileupload-comment-${n.file.fileId}`, a = () => {
|
|
558
|
+
let e = document.getElementById(i)?.value?.trim();
|
|
559
|
+
e && n.setAttribute(M, [{
|
|
555
560
|
text: e,
|
|
556
561
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
557
|
-
}]),
|
|
562
|
+
}]), n.close();
|
|
558
563
|
};
|
|
559
564
|
return e`
|
|
560
|
-
<label for=${
|
|
561
|
-
${
|
|
565
|
+
<label for=${i} class="pkt-fileupload__queue-display__item__comment-label">
|
|
566
|
+
${r ? t.editComment : t.addComment}
|
|
562
567
|
</label>
|
|
563
568
|
<textarea
|
|
564
|
-
id=${
|
|
569
|
+
id=${i}
|
|
565
570
|
class="pkt-fileupload__queue-display__item__comment-input"
|
|
566
|
-
?disabled=${
|
|
567
|
-
.value=${
|
|
571
|
+
?disabled=${n.disabled}
|
|
572
|
+
.value=${r?.text ?? ""}
|
|
568
573
|
rows="2"
|
|
569
|
-
placeholder
|
|
570
|
-
@keydown=${(e) => F(e,
|
|
574
|
+
placeholder=${t.commentPlaceholder}
|
|
575
|
+
@keydown=${(e) => F(e, a, n.close)}
|
|
571
576
|
></textarea>
|
|
572
577
|
<button
|
|
573
578
|
type="button"
|
|
574
579
|
class="pkt-btn pkt-btn--secondary pkt-btn--small"
|
|
575
|
-
?disabled=${
|
|
576
|
-
@click=${
|
|
580
|
+
?disabled=${n.disabled}
|
|
581
|
+
@click=${a}
|
|
577
582
|
>
|
|
578
|
-
${
|
|
583
|
+
${r ? t.saveComment : t.addComment}
|
|
579
584
|
</button>
|
|
580
585
|
<button
|
|
581
586
|
type="button"
|
|
582
587
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small"
|
|
583
|
-
?disabled=${
|
|
584
|
-
@click=${
|
|
588
|
+
?disabled=${n.disabled}
|
|
589
|
+
@click=${n.close}
|
|
585
590
|
>
|
|
586
|
-
|
|
591
|
+
${t.cancel}
|
|
587
592
|
</button>
|
|
588
593
|
`;
|
|
589
594
|
},
|
|
590
|
-
renderContent: (
|
|
591
|
-
if (
|
|
592
|
-
let
|
|
593
|
-
if (
|
|
594
|
-
let
|
|
595
|
+
renderContent: (n) => {
|
|
596
|
+
if (n.isActive) return null;
|
|
597
|
+
let r = n.getAttribute(M) ?? [];
|
|
598
|
+
if (r.length === 0) return null;
|
|
599
|
+
let i = r[0];
|
|
595
600
|
return e`
|
|
596
601
|
<div class="pkt-fileupload__queue-display__item__comments">
|
|
597
602
|
<div class="pkt-fileupload__queue-display__item__comment">
|
|
598
603
|
<div class="pkt-fileupload__queue-display__item__comment__content">
|
|
599
|
-
<span class="pkt-fileupload__queue-display__item__comment__text" aria-label
|
|
600
|
-
${
|
|
604
|
+
<span class="pkt-fileupload__queue-display__item__comment__text" aria-label=${t.commentText}>
|
|
605
|
+
${i.text}
|
|
601
606
|
</span>
|
|
602
607
|
<time class="pkt-fileupload__queue-display__item__comment__time">
|
|
603
|
-
${N(
|
|
608
|
+
${N(i.timestamp, t)}
|
|
604
609
|
</time>
|
|
605
610
|
</div>
|
|
606
611
|
<div class="pkt-fileupload__queue-display__item__comment__actions">
|
|
607
612
|
<button
|
|
608
613
|
type="button"
|
|
609
614
|
class="pkt-fileupload__queue-display__item__comment__action"
|
|
610
|
-
aria-label
|
|
611
|
-
?disabled=${
|
|
612
|
-
@click=${
|
|
615
|
+
aria-label=${t.editComment}
|
|
616
|
+
?disabled=${n.disabled}
|
|
617
|
+
@click=${n.activate}
|
|
613
618
|
>
|
|
614
619
|
<pkt-icon name="edit"></pkt-icon>
|
|
615
620
|
</button>
|
|
616
621
|
<button
|
|
617
622
|
type="button"
|
|
618
623
|
class="pkt-fileupload__queue-display__item__comment__action"
|
|
619
|
-
aria-label
|
|
620
|
-
?disabled=${
|
|
621
|
-
@click=${() =>
|
|
624
|
+
aria-label=${t.deleteComment}
|
|
625
|
+
?disabled=${n.disabled}
|
|
626
|
+
@click=${() => n.setAttribute(M, void 0)}
|
|
622
627
|
>
|
|
623
628
|
<pkt-icon name="trash-can"></pkt-icon>
|
|
624
629
|
</button>
|
|
@@ -650,8 +655,10 @@ var M = "comments", N = (e) => {
|
|
|
650
655
|
<p class="pkt-fileupload__queue-display__item__title">
|
|
651
656
|
${z(t, r)}${n ? e`<span class="pkt-fileupload__queue-display__item__filesize"> (${n})</span>` : null}
|
|
652
657
|
</p>
|
|
653
|
-
`, V = (e) => typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle", H = (t) => e`<span
|
|
654
|
-
|
|
658
|
+
`, V = (e) => typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle", H = (t) => e`<span
|
|
659
|
+
class="pkt-fileupload__queue-display__item__loading-text"
|
|
660
|
+
aria-label=${t.uploadingFile}
|
|
661
|
+
>${t.uploading}</span
|
|
655
662
|
>`, U = ({ operationId: e, file: t, inputName: n, disabled: r, isActive: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => ({
|
|
656
663
|
file: t,
|
|
657
664
|
inputName: n,
|
|
@@ -661,7 +668,7 @@ var M = "comments", N = (e) => {
|
|
|
661
668
|
close: () => o(t.fileId),
|
|
662
669
|
getAttribute: (e) => s(t.fileId, e),
|
|
663
670
|
setAttribute: (e, n) => c(t.fileId, e, n)
|
|
664
|
-
}), W = ({ file: t, fileSize: n, disabled: r, transferProgress: i, transferShowProgress: a,
|
|
671
|
+
}), W = ({ file: t, fileSize: n, disabled: r, transferProgress: i, transferShowProgress: a, strings: o, truncateTail: s, onCancel: c, iconName: l = "document-text" }) => {
|
|
665
672
|
let u = A(t), d = a ?? i !== 0;
|
|
666
673
|
return e`
|
|
667
674
|
<pkt-icon
|
|
@@ -673,11 +680,11 @@ var M = "comments", N = (e) => {
|
|
|
673
680
|
<button
|
|
674
681
|
type="button"
|
|
675
682
|
class="pkt-fileupload__queue-display__item__cancel-button"
|
|
676
|
-
aria-label
|
|
683
|
+
aria-label=${o.cancelUpload}
|
|
677
684
|
?disabled=${r}
|
|
678
685
|
@click=${() => c(t.fileId)}
|
|
679
686
|
>
|
|
680
|
-
|
|
687
|
+
${o.cancel}
|
|
681
688
|
</button>
|
|
682
689
|
${d ? e`
|
|
683
690
|
<pkt-progressbar
|
|
@@ -692,28 +699,28 @@ var M = "comments", N = (e) => {
|
|
|
692
699
|
>
|
|
693
700
|
` : H(o)}
|
|
694
701
|
`;
|
|
695
|
-
}, G = ({ file: t, fileSize: n, disabled: r, transferShowProgress: i, transferLastProgress: a, transferErrorMessage: o,
|
|
696
|
-
let
|
|
702
|
+
}, G = ({ file: t, fileSize: n, disabled: r, transferShowProgress: i, transferLastProgress: a, transferErrorMessage: o, strings: s, truncateTail: c, onCancel: l }) => {
|
|
703
|
+
let u = A(t), d = !!i, f = Math.round((a ?? 1) * 100);
|
|
697
704
|
return e`
|
|
698
705
|
<pkt-icon
|
|
699
706
|
name="alert-error"
|
|
700
707
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
701
708
|
aria-hidden="true"
|
|
702
709
|
></pkt-icon>
|
|
703
|
-
${B(
|
|
710
|
+
${B(u, n, c)}
|
|
704
711
|
<button
|
|
705
712
|
type="button"
|
|
706
713
|
class="pkt-fileupload__queue-display__item__cancel-button"
|
|
707
|
-
aria-label
|
|
714
|
+
aria-label=${s.removeFailedFile}
|
|
708
715
|
?disabled=${r}
|
|
709
|
-
@click=${() =>
|
|
716
|
+
@click=${() => l(t.fileId)}
|
|
710
717
|
>
|
|
711
|
-
|
|
718
|
+
${s.removeFailed}
|
|
712
719
|
</button>
|
|
713
|
-
${
|
|
720
|
+
${d ? e`
|
|
714
721
|
<pkt-progressbar
|
|
715
722
|
class="pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"
|
|
716
|
-
valueCurrent=${
|
|
723
|
+
valueCurrent=${f}
|
|
717
724
|
valueMax=${100}
|
|
718
725
|
statusType="none"
|
|
719
726
|
statusPlacement="following"
|
|
@@ -811,8 +818,8 @@ var M = "comments", N = (e) => {
|
|
|
811
818
|
></pkt-icon>
|
|
812
819
|
${B(i, n, r)}
|
|
813
820
|
`;
|
|
814
|
-
}, Z = ({ file: t, thumbnailUrl: n, previewEnabled: r, canOpenPreview:
|
|
815
|
-
let f = A(t), p = !!n, m = !!r && !!
|
|
821
|
+
}, Z = ({ file: t, thumbnailUrl: n, previewEnabled: r, canOpenPreview: i, truncateTail: a, strings: o, onOpenPreview: l, onThumbnailImageError: d }) => {
|
|
822
|
+
let f = A(t), p = !!n, m = !!r && !!i, h = m && !!l;
|
|
816
823
|
return e`
|
|
817
824
|
<div
|
|
818
825
|
class=${s({
|
|
@@ -823,7 +830,7 @@ var M = "comments", N = (e) => {
|
|
|
823
830
|
<button
|
|
824
831
|
type="button"
|
|
825
832
|
class="pkt-fileupload__queue-display__item__thumbnail__image-wrapper pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--label-only"
|
|
826
|
-
aria-label=${u(
|
|
833
|
+
aria-label=${u(o.previewImage, { filename: f })}
|
|
827
834
|
?disabled=${!h}
|
|
828
835
|
@click=${() => {
|
|
829
836
|
!h || !l || l(t.fileId);
|
|
@@ -847,11 +854,11 @@ var M = "comments", N = (e) => {
|
|
|
847
854
|
</span>
|
|
848
855
|
</button>
|
|
849
856
|
<span class="pkt-fileupload__queue-display__item__thumbnail__title"
|
|
850
|
-
>${z(f,
|
|
857
|
+
>${z(f, a)}</span
|
|
851
858
|
>
|
|
852
859
|
</div>
|
|
853
860
|
`;
|
|
854
|
-
}, Q = ({ file: t, inputName: n, disabled: r, fileSize: i, operations: a, activeOperationId: o, onActivateOperation: c, onCloseOperation: l, getFileAttribute: u, setFileAttribute: d, transferProgress: f, transferErrorMessage: p, transferShowProgress: m, transferLastProgress: h,
|
|
861
|
+
}, Q = ({ file: t, inputName: n, disabled: r, fileSize: i, operations: a, activeOperationId: o, onActivateOperation: c, onCloseOperation: l, getFileAttribute: u, setFileAttribute: d, transferProgress: f, transferErrorMessage: p, transferShowProgress: m, transferLastProgress: h, strings: g, truncateTail: _, onCancel: v }) => {
|
|
855
862
|
let y = V(f), b = a.find((e) => e.id === o), x = b?.renderInlineUI ? b.renderInlineUI(U({
|
|
856
863
|
operationId: b.id,
|
|
857
864
|
file: t,
|
|
@@ -889,7 +896,7 @@ var M = "comments", N = (e) => {
|
|
|
889
896
|
disabled: r,
|
|
890
897
|
transferProgress: f,
|
|
891
898
|
transferShowProgress: m,
|
|
892
|
-
|
|
899
|
+
strings: g,
|
|
893
900
|
truncateTail: _,
|
|
894
901
|
onCancel: v
|
|
895
902
|
}) : y === "error" ? G({
|
|
@@ -899,6 +906,7 @@ var M = "comments", N = (e) => {
|
|
|
899
906
|
transferShowProgress: m,
|
|
900
907
|
transferLastProgress: h,
|
|
901
908
|
transferErrorMessage: p,
|
|
909
|
+
strings: g,
|
|
902
910
|
truncateTail: _,
|
|
903
911
|
onCancel: v
|
|
904
912
|
}) : x ? e`
|
|
@@ -946,7 +954,7 @@ var M = "comments", N = (e) => {
|
|
|
946
954
|
}) : null}
|
|
947
955
|
</li>
|
|
948
956
|
`;
|
|
949
|
-
}, te = ({ file: t, inputName: n, disabled: r, fileSize: i, thumbnailUrl: a, previewEnabled: o, canOpenPreview: c, operations: l, activeOperationId: u, onActivateOperation: d, onCloseOperation: f, getFileAttribute: p, setFileAttribute: m, transferProgress: h, transferErrorMessage: g, transferShowProgress: _, transferLastProgress: v,
|
|
957
|
+
}, te = ({ file: t, inputName: n, disabled: r, fileSize: i, thumbnailUrl: a, previewEnabled: o, canOpenPreview: c, operations: l, activeOperationId: u, onActivateOperation: d, onCloseOperation: f, getFileAttribute: p, setFileAttribute: m, transferProgress: h, transferErrorMessage: g, transferShowProgress: _, transferLastProgress: v, strings: y, truncateTail: b, onCancel: x, onOpenPreview: S, onThumbnailImageError: C }) => {
|
|
950
958
|
let w = V(h), T = l.find((e) => e.id === u), E = T?.renderInlineUI ? T.renderInlineUI(U({
|
|
951
959
|
operationId: T.id,
|
|
952
960
|
file: t,
|
|
@@ -984,7 +992,7 @@ var M = "comments", N = (e) => {
|
|
|
984
992
|
disabled: r,
|
|
985
993
|
transferProgress: h,
|
|
986
994
|
transferShowProgress: _,
|
|
987
|
-
|
|
995
|
+
strings: y,
|
|
988
996
|
truncateTail: b,
|
|
989
997
|
onCancel: x,
|
|
990
998
|
iconName: "picture"
|
|
@@ -995,6 +1003,7 @@ var M = "comments", N = (e) => {
|
|
|
995
1003
|
transferShowProgress: _,
|
|
996
1004
|
transferLastProgress: v,
|
|
997
1005
|
transferErrorMessage: g,
|
|
1006
|
+
strings: y,
|
|
998
1007
|
truncateTail: b,
|
|
999
1008
|
onCancel: x
|
|
1000
1009
|
}) : E ? e`
|
|
@@ -1012,6 +1021,7 @@ var M = "comments", N = (e) => {
|
|
|
1012
1021
|
previewEnabled: o,
|
|
1013
1022
|
canOpenPreview: c,
|
|
1014
1023
|
truncateTail: b,
|
|
1024
|
+
strings: y,
|
|
1015
1025
|
onOpenPreview: S,
|
|
1016
1026
|
onThumbnailImageError: C
|
|
1017
1027
|
})}
|
|
@@ -1156,7 +1166,7 @@ var M = "comments", N = (e) => {
|
|
|
1156
1166
|
?disabled=${this.disabled}
|
|
1157
1167
|
?required=${this.required && this.uploadStrategy === "form"}
|
|
1158
1168
|
accept=${this.getResolvedAcceptValue()}
|
|
1159
|
-
aria-label=${c(this.label ? void 0 : this.multiple ? "
|
|
1169
|
+
aria-label=${c(this.label ? void 0 : this.multiple ? this.pktStrings.get("fileupload").openFileDialogLabelMultiple : this.pktStrings.get("fileupload").openFileDialogLabelSingle)}
|
|
1160
1170
|
aria-required=${c(this.required ? "true" : void 0)}
|
|
1161
1171
|
aria-invalid=${c(this.hasEffectiveError ? "true" : void 0)}
|
|
1162
1172
|
aria-describedby=${c(a)}
|
|
@@ -1209,9 +1219,9 @@ var M = "comments", N = (e) => {
|
|
|
1209
1219
|
`;
|
|
1210
1220
|
}
|
|
1211
1221
|
renderQueueItem(e, t) {
|
|
1212
|
-
let n = typeof e.file?.size == "number" ? this.formatFileSize(e.file.size) : "", r = this.getQueueItemOperations();
|
|
1222
|
+
let n = typeof e.file?.size == "number" ? this.formatFileSize(e.file.size) : "", r = this.getQueueItemOperations(), i = this.pktStrings.get("fileupload");
|
|
1213
1223
|
if (this.itemRenderer === "thumbnail") {
|
|
1214
|
-
let
|
|
1224
|
+
let a = this.canOpenPreview(e), o = this.failedImageFileIds[e.fileId]?.thumbnail ? void 0 : this.getThumbnailUrl(e);
|
|
1215
1225
|
return te({
|
|
1216
1226
|
file: e,
|
|
1217
1227
|
inputName: this.name,
|
|
@@ -1223,14 +1233,14 @@ var M = "comments", N = (e) => {
|
|
|
1223
1233
|
onCloseOperation: (e) => this.closeOperation(e),
|
|
1224
1234
|
getFileAttribute: (e, t) => this.getFileAttribute(e, t),
|
|
1225
1235
|
setFileAttribute: (e, t, n) => this.setFileAttribute(e, t, n),
|
|
1226
|
-
thumbnailUrl:
|
|
1236
|
+
thumbnailUrl: o,
|
|
1227
1237
|
previewEnabled: this.enableImagePreview,
|
|
1228
|
-
canOpenPreview:
|
|
1238
|
+
canOpenPreview: a,
|
|
1229
1239
|
transferProgress: e.progress,
|
|
1230
1240
|
transferErrorMessage: e.errorMessage,
|
|
1231
1241
|
transferShowProgress: e.showProgress,
|
|
1232
1242
|
transferLastProgress: e.lastProgress,
|
|
1233
|
-
|
|
1243
|
+
strings: i,
|
|
1234
1244
|
truncateTail: this.truncateTail,
|
|
1235
1245
|
onCancel: (e) => this.cancelTransfer(e),
|
|
1236
1246
|
onOpenPreview: (e) => this.openPreview(e, t),
|
|
@@ -1252,7 +1262,7 @@ var M = "comments", N = (e) => {
|
|
|
1252
1262
|
transferErrorMessage: e.errorMessage,
|
|
1253
1263
|
transferShowProgress: e.showProgress,
|
|
1254
1264
|
transferLastProgress: e.lastProgress,
|
|
1255
|
-
|
|
1265
|
+
strings: i,
|
|
1256
1266
|
truncateTail: this.truncateTail,
|
|
1257
1267
|
onCancel: (e) => this.cancelTransfer(e)
|
|
1258
1268
|
});
|
|
@@ -1303,7 +1313,10 @@ var M = "comments", N = (e) => {
|
|
|
1303
1313
|
${i ? e`<button
|
|
1304
1314
|
type="button"
|
|
1305
1315
|
class="pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--icon-only"
|
|
1306
|
-
aria-label=${
|
|
1316
|
+
aria-label=${u(n.previewPrevious, {
|
|
1317
|
+
index: this.previewCurrentIndex,
|
|
1318
|
+
total: t.length
|
|
1319
|
+
})}
|
|
1307
1320
|
@click=${() => this.navigatePreview("prev", t)}
|
|
1308
1321
|
>
|
|
1309
1322
|
<pkt-icon
|
|
@@ -1317,7 +1330,11 @@ var M = "comments", N = (e) => {
|
|
|
1317
1330
|
<div class="pkt-fileupload__image-preview__content">
|
|
1318
1331
|
${o ? e`<img
|
|
1319
1332
|
src=${a}
|
|
1320
|
-
alt=${
|
|
1333
|
+
alt=${u(n.previewImageAlt, {
|
|
1334
|
+
filename: s,
|
|
1335
|
+
index: this.previewCurrentIndex + 1,
|
|
1336
|
+
total: t.length
|
|
1337
|
+
})}
|
|
1321
1338
|
class="pkt-fileupload__image-preview__image"
|
|
1322
1339
|
@error=${() => this.markImageFailed(r.fileId, "preview")}
|
|
1323
1340
|
/>` : e`<pkt-icon
|
|
@@ -1333,7 +1350,10 @@ var M = "comments", N = (e) => {
|
|
|
1333
1350
|
${i ? e`<button
|
|
1334
1351
|
type="button"
|
|
1335
1352
|
class="pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--icon-only"
|
|
1336
|
-
aria-label=${
|
|
1353
|
+
aria-label=${u(n.previewNext, {
|
|
1354
|
+
index: this.previewCurrentIndex + 2,
|
|
1355
|
+
total: t.length
|
|
1356
|
+
})}
|
|
1337
1357
|
@click=${() => this.navigatePreview("next", t)}
|
|
1338
1358
|
>
|
|
1339
1359
|
<pkt-icon
|
|
@@ -1348,8 +1368,8 @@ var M = "comments", N = (e) => {
|
|
|
1348
1368
|
`;
|
|
1349
1369
|
}
|
|
1350
1370
|
getQueueItemOperations() {
|
|
1351
|
-
let e = [];
|
|
1352
|
-
return this.renameFilesEnabled && this.itemRenderer !== "thumbnail" && e.push(L()), this.addCommentsEnabled && this.itemRenderer !== "thumbnail" && e.push(R()), e.push(...this.extraOperations), e.push(I((e) => this.removeFileItem(e))), e;
|
|
1371
|
+
let e = [], t = this.pktStrings.get("fileupload");
|
|
1372
|
+
return this.renameFilesEnabled && this.itemRenderer !== "thumbnail" && e.push(L(t)), this.addCommentsEnabled && this.itemRenderer !== "thumbnail" && e.push(R(t)), e.push(...this.extraOperations), e.push(I((e) => this.removeFileItem(e), t)), e;
|
|
1353
1373
|
}
|
|
1354
1374
|
activateOperation(e, t) {
|
|
1355
1375
|
this.activeOperationByFileId = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-BOmr9YLv.cjs"),t=require("./if-defined-2mkIDgOm.cjs");require("./consent-BjYaCbef.cjs");const n=require("./booleanish-BF8l4scU.cjs"),r=require("./fetch-header-footer-data-CUKV0biS.cjs");require("./icon-CoBsgGUR.cjs");var i=`oslo.kommune.no`,a=/\.(?:co|com|org|net|gov|edu|ac|kommune)\.[a-z]{2}$/i;function o(e){let t=e.toLowerCase().replace(/\.$/,``),n=t.split(`.`);return n.length<=2?t:n.slice(a.test(t)?-3:-2).join(`.`)}function s(e){if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.protocol===`http:`||t.protocol===`https:`)return o(t.hostname.toLowerCase().replace(/\.$/,``))}function c(e,t=i){if(!e)return;let n;try{n=new URL(e)}catch{return}if(n.protocol!==`http:`&&n.protocol!==`https:`)return;let r=n.hostname.toLowerCase().replace(/\.$/,``),a=t.toLowerCase();if(!(r===a||r.endsWith(`.${a}`)))return o(r)}var l=`#cb-trigger`,u=class extends e.t{constructor(...e){super(...e),this.locale=`nb-NO`,this.skipGlobal=!1,this.openLinksInNewTab=!1,this.includeConsent=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.devMode=!1,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null}connectedCallback(){super.connectedCallback(),!this.data&&!this.skipGlobal&&this.loadData()}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort()}updated(e){super.updated(e),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData()}async loadData(){this.abortController?.abort(),this.abortController=new AbortController;try{this.fetchedData=await r.t(this.dataUrl,this.abortController.signal)}catch(e){if(e.name===`AbortError`)return;console.warn(`Failed to fetch header/footer data:`,e),this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}get globalFooterData(){return r.n(this.data??this.fetchedData,this.locale)?.footer}linkTarget(e){return e.openInNewTab||this.openLinksInNewTab?{target:`_blank`,rel:`noopener noreferrer`}:{target:`_self`}}renderLinkDomain(t,n=`pkt-footer__link-domain`){if(!t.external)return e.h;let r=s(t.href);return r?e._` <span class=${n}>(${r})</span>`:e.h}renderCustomLink(n){let{target:r,rel:i}=this.linkTarget(n);return e._`
|
|
2
2
|
<a href=${n.href} target=${r} rel=${t.t(i)}
|
|
3
3
|
>${n.text}${this.renderLinkDomain(n)}</a
|
|
4
4
|
>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-
|
|
2
|
-
import { t as s } from "./if-defined-
|
|
3
|
-
import "./consent-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-mwwC2Rra.js";
|
|
2
|
+
import { t as s } from "./if-defined-Bebu3LXY.js";
|
|
3
|
+
import "./consent-BBxZkgCO.js";
|
|
4
4
|
import { t as c } from "./booleanish-OQJTYSrw.js";
|
|
5
5
|
import { n as l, r as u, t as d } from "./fetch-header-footer-data-Pc32etrk.js";
|
|
6
|
-
import "./icon-
|
|
6
|
+
import "./icon-DmRyYNlY.js";
|
|
7
7
|
//#region ../../shared-utils/header-footer/external-domain.ts
|
|
8
8
|
var f = "oslo.kommune.no", p = /\.(?:co|com|org|net|gov|edu|ac|kommune)\.[a-z]{2}$/i;
|
|
9
9
|
function m(e) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import { t as c } from "./if-defined-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-mwwC2Rra.js";
|
|
2
|
+
import { t as s } from "./class-map-C4hdfSfY.js";
|
|
3
|
+
import { t as c } from "./if-defined-Bebu3LXY.js";
|
|
4
4
|
import { t as l } from "./format-BTeSVkED.js";
|
|
5
|
-
import { r as u, t as d } from "./element-with-slot-
|
|
5
|
+
import { r as u, t as d } from "./element-with-slot-FD826ooP.js";
|
|
6
6
|
import { t as f } from "./booleanish-OQJTYSrw.js";
|
|
7
7
|
import { n as p, o as m, t as h } from "./fetch-header-footer-data-Pc32etrk.js";
|
|
8
|
-
import "./icon-
|
|
9
|
-
import "./button-
|
|
10
|
-
import { n as g, t as _ } from "./ref-
|
|
8
|
+
import "./icon-DmRyYNlY.js";
|
|
9
|
+
import "./button-B5rWxfei.js";
|
|
10
|
+
import { n as g, t as _ } from "./ref-CCSGk4MP.js";
|
|
11
11
|
import { n as v, t as y } from "./focus-trap-DG3pEuyJ.js";
|
|
12
12
|
import { n as b, t as x } from "./scroll-lock-DAbNKAUy.js";
|
|
13
|
-
import "./link-
|
|
14
|
-
import "./textinput-
|
|
15
|
-
import "./searchinput-
|
|
16
|
-
import "./header-menu-
|
|
13
|
+
import "./link-DcxVUj8s.js";
|
|
14
|
+
import "./textinput-Dpj1X5yr.js";
|
|
15
|
+
import "./searchinput-CgzigmiI.js";
|
|
16
|
+
import "./header-menu-C9k9xG9V.js";
|
|
17
17
|
//#region ../../shared-types/header.ts
|
|
18
18
|
var S = (e) => typeof e.target == "string" ? {
|
|
19
19
|
title: e.title,
|
|
@@ -99,7 +99,7 @@ var S = (e) => typeof e.target == "string" ? {
|
|
|
99
99
|
});
|
|
100
100
|
return i ? e`
|
|
101
101
|
<pkt-link
|
|
102
|
-
|
|
102
|
+
iconName=${t.iconName || n}
|
|
103
103
|
href=${t.href}
|
|
104
104
|
class="pkt-user-menu__link ${r || ""}"
|
|
105
105
|
>
|
|
@@ -1049,10 +1049,11 @@ var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-
|
|
|
1049
1049
|
locale=${this.locale}
|
|
1050
1050
|
open
|
|
1051
1051
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
1052
|
+
.strings=${this.strings}
|
|
1052
1053
|
></pkt-header-menu>
|
|
1053
1054
|
` : e`
|
|
1054
1055
|
<nav class="pkt-header-menu pkt-header-menu--open">
|
|
1055
|
-
<p class="pkt-header-menu__error"
|
|
1056
|
+
<p class="pkt-header-menu__error">${this.pktStrings.get("header").menuLoadError}</p>
|
|
1056
1057
|
</nav>
|
|
1057
1058
|
`}
|
|
1058
1059
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./if-defined-2mkIDgOm.cjs"),r=require("./format-B8meU8Tm.cjs"),i=require("./element-with-slot-2PHu2w7O.cjs"),a=require("./booleanish-BF8l4scU.cjs"),o=require("./fetch-header-footer-data-CUKV0biS.cjs");require("./icon-CoBsgGUR.cjs"),require("./button-CmNrMH-c.cjs");const s=require("./ref-Emu5PNxk.cjs"),c=require("./focus-trap-DSv4Ifqm.cjs"),l=require("./scroll-lock-BN8lOhV5.cjs");require("./link-EMsHusF7.cjs"),require("./textinput-Czz2affL.cjs"),require("./searchinput-7-VVdkss.cjs"),require("./header-menu-BnqZagI6.cjs");var u=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},d=e=>u(e),f=e=>{if(!e)return;let t=typeof e==`string`?new Date(e):e;if(!isNaN(t.getTime()))return t.toLocaleDateString(`nb-NO`,{day:`numeric`,month:`long`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})},p=class{constructor(e,t){this.isMobile=!1,this.isTablet=!1,this.isHidden=!1,this.pauseScrollHide=!1,this.componentWidth=typeof window<`u`?window.innerWidth:0,this.lastScrollPosition=0,this.scrollLockToken=l.t(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(this.getOptions().scrollBehavior!==`hide`||this.pauseScrollHide)return;let e=window.pageYOffset||document.documentElement.scrollTop;if(e<0||Math.abs(e-this.lastScrollPosition)<60)return;let t=e>this.lastScrollPosition;this.lastScrollPosition=e,t!==this.isHidden&&(this.isHidden=t,this.host.requestUpdate())},this.host=e,this.getOptions=t,e.addController(this)}hostConnected(){window.addEventListener(`scroll`,this.handleScroll)}hostDisconnected(){this.resizeObserver?.disconnect(),window.removeEventListener(`scroll`,this.handleScroll),l.n(this.scrollLockToken,!1)}observe(e){e&&(this.componentWidth=e.offsetWidth,this.refreshBreakpoints(),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)this.componentWidth=t.borderBoxSize&&t.borderBoxSize.length>0?t.borderBoxSize[0].inlineSize:t.contentRect.width,this.refreshBreakpoints()}),this.resizeObserver.observe(e))}refreshBreakpoints(){let{mobileBreakpoint:e,tabletBreakpoint:t}=this.getOptions(),n=this.componentWidth<e,r=this.componentWidth<t;(n!==this.isMobile||r!==this.isTablet)&&(this.isMobile=n,this.isTablet=r,this.host.requestUpdate())}setScrollLock(e){l.n(this.scrollLockToken,e)}captureFocus(){this.lastFocusedElement=document.activeElement}flagRestoreFocus(){this.shouldRestoreFocus=!0}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}},m=class extends e.t{constructor(...e){super(...e),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent(`change-representation`,{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleMenuItemClick(e){`onClick`in e&&typeof e.onClick==`function`&&e.onClick()}renderLinkOrButton(n,r){let i=`href`in n,a=t.t({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[r||``]:!!r});return i?e._`
|
|
2
2
|
<pkt-link
|
|
3
|
-
|
|
3
|
+
iconName=${n.iconName||e.h}
|
|
4
4
|
href=${n.href}
|
|
5
5
|
class="pkt-user-menu__link ${r||``}"
|
|
6
6
|
>
|
|
@@ -404,10 +404,11 @@ const e=require("./element-CewjrA4g.cjs"),t=require("./class-map-B0FX3YsK.cjs"),
|
|
|
404
404
|
locale=${this.locale}
|
|
405
405
|
open
|
|
406
406
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
407
|
+
.strings=${this.strings}
|
|
407
408
|
></pkt-header-menu>
|
|
408
409
|
`:e._`
|
|
409
410
|
<nav class="pkt-header-menu pkt-header-menu--open">
|
|
410
|
-
<p class="pkt-header-menu__error"
|
|
411
|
+
<p class="pkt-header-menu__error">${this.pktStrings.get(`header`).menuLoadError}</p>
|
|
411
412
|
</nav>
|
|
412
413
|
`}
|
|
413
414
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./booleanish-BF8l4scU.cjs"),r=require("./fetch-header-footer-data-CUKV0biS.cjs");require("./icon-CoBsgGUR.cjs"),require("./accordion-CZ0O4c0_.cjs");var i=class extends e.t{constructor(...e){super(...e),this.dataUrl=r.a,this.locale=`nb-NO`,this.open=!1,this.mobileBreakpoint=768,this.loadState=`idle`,this.isMobile=!1,this.menuWidth=0}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-header-menu`),this.updateOpenClass(),this.observeWidth(),this.data?(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0}))):this.loadData()}updateOpenClass(){this.classList.toggle(`pkt-header-menu--open`,!!this.open)}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}updated(e){super.updated(e),e.has(`open`)&&this.updateOpenClass(),e.has(`mobileBreakpoint`)&&e.get(`mobileBreakpoint`)!==void 0&&this.refreshIsMobile(),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData(),e.has(`data`)&&e.get(`data`)!==void 0&&this.data&&(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0})))}observeWidth(){typeof ResizeObserver>`u`||(this.menuWidth=this.offsetWidth,this.refreshIsMobile(),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)this.menuWidth=t.borderBoxSize&&t.borderBoxSize.length>0?t.borderBoxSize[0].inlineSize:t.contentRect.width,this.refreshIsMobile()}),this.resizeObserver.observe(this))}refreshIsMobile(){this.isMobile=this.menuWidth<this.mobileBreakpoint}async loadData(){this.abortController?.abort(),this.abortController=new AbortController,this.loadState=`loading`;try{let e=await r.t(this.dataUrl,this.abortController.signal);this.fetchedData=e,this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:e},bubbles:!0,composed:!0}))}catch(e){if(e.name===`AbortError`)return;this.loadState=`error`,this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}get effectiveData(){return this.data??this.fetchedData}get localeData(){return r.n(this.effectiveData,this.locale)}render(){if(this.loadState===`loading`)return e._`
|
|
2
2
|
<nav aria-busy="true">
|
|
3
|
-
<p class="pkt-header-menu__loading"
|
|
3
|
+
<p class="pkt-header-menu__loading">${this.pktStrings.get(`header`).menuLoading}</p>
|
|
4
4
|
</nav>
|
|
5
5
|
`;if(this.loadState===`error`||!this.localeData)return e._`
|
|
6
6
|
<nav aria-hidden=${!this.open}>
|
|
7
|
-
<p class="pkt-header-menu__error"
|
|
7
|
+
<p class="pkt-header-menu__error">${this.pktStrings.get(`header`).menuLoadError}</p>
|
|
8
8
|
</nav>
|
|
9
9
|
`;let{megamenu:t,i18n:n}=this.localeData,r=n?.navAriaLabel||`Hovedmeny`;return this.isMobile?e._`
|
|
10
10
|
<nav aria-label=${r}>
|