@oslokommune/punkt-elements 16.26.7 → 17.0.2
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 +110 -0
- package/dist/accordion-CbXDxOho.cjs +47 -0
- package/dist/{accordion-CBdIk9gw.js → accordion-DEUHQ4JD.js} +45 -35
- package/dist/{alert-HHTGY0sp.js → alert-CbtVGrHD.js} +31 -17
- package/dist/{alert-B8dLsiTz.cjs → alert-CkUnbPdA.cjs} +5 -5
- package/dist/base-elements/input-element.d.ts +1 -0
- package/dist/button-Cod17rKo.js +115 -0
- package/dist/{button-B5tQpKeG.cjs → button-gvDXtBMC.cjs} +5 -2
- package/dist/{calendar-DIzGBdbh.cjs → calendar-BVXW8DqC.cjs} +1 -1
- package/dist/{calendar-CjlUA-Lb.js → calendar-CjC4qlh6.js} +1 -1
- package/dist/{checkbox-Bt_sC_90.cjs → checkbox-8uxbeU30.cjs} +1 -1
- package/dist/{checkbox-D03BC2Va.js → checkbox-DJDphhqz.js} +1 -1
- package/dist/{combobox-CoQBTWqL.js → combobox-Du5yr-xM.js} +16 -2
- package/dist/combobox-hKrbYLUe.cjs +136 -0
- package/dist/components/accordion/accordion-context.d.ts +7 -0
- package/dist/components/accordion/accordion.d.ts +2 -0
- package/dist/components/accordion/accordionitem.d.ts +1 -0
- package/dist/components/alert/alert.d.ts +5 -0
- package/dist/components/alert/alert.test.d.ts +1 -0
- package/dist/components/button/button.d.ts +4 -1
- package/dist/components/datepicker/datepicker-base.d.ts +2 -0
- package/dist/components/datepicker/datepicker-utils.d.ts +2 -2
- package/dist/components/footer/footer-base.d.ts +44 -0
- package/dist/components/footer/footer-simple.d.ts +20 -0
- package/dist/components/footer/footer.accessibility.test.d.ts +0 -0
- package/dist/components/footer/footer.d.ts +22 -0
- package/dist/components/footer/footer.test.d.ts +0 -0
- package/dist/components/footer/index.d.ts +3 -0
- package/dist/components/footer/types.d.ts +16 -0
- package/dist/components/header/header-chrome-controller.d.ts +44 -0
- package/dist/components/header/header-global.accessibility.test.d.ts +0 -0
- package/dist/components/header/header-global.d.ts +78 -0
- package/dist/components/header/header-global.test.d.ts +0 -0
- package/dist/components/header/header-service.accessibility.test.d.ts +0 -0
- package/dist/components/header/header-service.d.ts +6 -21
- package/dist/components/header/header-service.test.d.ts +1 -1
- package/dist/components/header/header.d.ts +11 -3
- package/dist/components/header/header.test.d.ts +0 -0
- package/dist/components/header/index.d.ts +2 -1
- package/dist/components/header/types.d.ts +28 -2
- package/dist/components/header-menu/header-menu.d.ts +4 -5
- package/dist/components/header-menu/types.d.ts +1 -1
- package/dist/components/index.d.ts +5 -3
- package/dist/components/input-wrapper/input-wrapper.d.ts +2 -0
- package/dist/components/input-wrapper/input-wrapper.test.d.ts +1 -0
- package/dist/components/searchinput/searchinput.d.ts +5 -0
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.test.d.ts +1 -0
- package/dist/components/textarea/textarea.test.d.ts +2 -0
- package/dist/components/textinput/textinput.test.d.ts +1 -0
- package/dist/components/timepicker/timepicker.d.ts +2 -0
- package/dist/components/timepicker/timepicker.test.d.ts +3 -0
- package/dist/consent--Nw43WFU.cjs +18 -0
- package/dist/{consent-D5sY6JK3.js → consent-B2hSTCGC.js} +14 -7
- package/dist/consume-BiOhrhEy.js +167 -0
- package/dist/consume-DKf5SmP9.cjs +1 -0
- package/dist/{converters-BKGBRBpS.js → converters-BBfsEJV5.js} +25 -25
- package/dist/{converters-9jHlXDyy.cjs → converters-Cd0fPEly.cjs} +1 -1
- package/dist/{datepicker-BE5Ll0W4.js → datepicker--Fq8q-J3.js} +30 -12
- package/dist/{datepicker-x4xM3KQz.cjs → datepicker-CEoBYTBU.cjs} +11 -7
- package/dist/docs/components/alert.d.ts +3 -0
- package/dist/docs/components/footer.d.ts +9 -0
- package/dist/docs/components/form-sizes.d.ts +10 -0
- package/dist/docs/components/header-global-full.d.ts +20 -0
- package/dist/docs/components/header-global.d.ts +14 -0
- package/dist/docs/components/searchinput.d.ts +6 -3
- package/dist/fetch-header-footer-data-Pc32etrk.js +88 -0
- package/dist/fetch-header-footer-data-xohWFmYC.cjs +1 -0
- package/dist/fileupload-CGKUJrlj.cjs +401 -0
- package/dist/{fileupload-2hf8YNhO.js → fileupload-D4gQN64T.js} +156 -176
- package/dist/focus-trap-DG3pEuyJ.js +60 -0
- package/dist/focus-trap-DSv4Ifqm.cjs +1 -0
- package/dist/footer-BIrJeRuZ.js +303 -0
- package/dist/footer-Ber-jqM1.cjs +114 -0
- package/dist/footer.d.ts +1 -0
- package/dist/header-BFk1an4z.cjs +465 -0
- package/dist/header-Deg_LGJo.js +1287 -0
- package/dist/header-menu-BHqK4QA6.cjs +126 -0
- package/dist/{header-menu-C8b5vd3n.js → header-menu-GFtJKM4j.js} +25 -97
- package/dist/{helptext-OfqH5npD.js → helptext-C_brWCIT.js} +1 -1
- package/dist/{helptext-eckq4JEX.cjs → helptext-Cq5rNaAC.cjs} +1 -1
- package/dist/{input-element-ZGOWsvKM.cjs → input-element-B0qLbEdF.cjs} +1 -1
- package/dist/{input-element-BFHpeoV8.js → input-element-C0RnXi-J.js} +5 -2
- package/dist/{input-wrapper-DwwE0JcO.js → input-wrapper-BweP6t3O.js} +12 -0
- package/dist/{input-wrapper-BRjQB4zM.cjs → input-wrapper-DPkkiG7S.cjs} +13 -11
- package/dist/{input-wrapper-DaA98B5l.js → input-wrapper-fWV5P4MN.js} +22 -15
- package/dist/{input-wrapper-LcZjpt0L.cjs → input-wrapper-wh3fWIhk.cjs} +1 -1
- package/dist/modal-CPnFteYS.cjs +35 -0
- package/dist/{modal-C6pScpdG.js → modal-xNK_wpHk.js} +11 -20
- 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-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-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 -0
- package/dist/pkt-footer.js +2 -0
- 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 +2 -2
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +27 -26
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.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-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/{radiobutton-DGO6H2Ki.js → radiobutton-C6htwDrT.js} +1 -1
- package/dist/{radiobutton-DY1WWepJ.cjs → radiobutton-DjWBoSHv.cjs} +1 -1
- package/dist/scroll-lock-BN8lOhV5.cjs +1 -0
- package/dist/scroll-lock-DAbNKAUy.js +18 -0
- package/dist/searchinput-CfUVfpqL.js +156 -0
- package/dist/searchinput-DGjeN1YI.cjs +60 -0
- package/dist/{select-D4_HQFkh.cjs → select-CZvAW7W2.cjs} +2 -1
- package/dist/{select-BwHUIlwQ.js → select-CsBXXbLP.js} +4 -3
- package/dist/setupTests.d.ts +0 -0
- package/dist/shared-types/footer.d.ts +95 -0
- package/dist/shared-types/{header-menu.d.ts → header-footer.d.ts} +51 -4
- package/dist/shared-types/header.d.ts +1 -1
- package/dist/shared-types/index.d.ts +6 -4
- package/dist/shared-types/searchinput.d.ts +2 -0
- package/dist/shared-types/select.d.ts +3 -2
- package/dist/shared-types/size.d.ts +4 -0
- package/dist/shared-types/timepicker.d.ts +0 -6
- package/dist/shared-utils/datepicker-utils.d.ts +5 -4
- package/dist/shared-utils/fileupload/focus-trap.d.ts +4 -10
- package/dist/shared-utils/focus-trap/index.d.ts +22 -0
- package/dist/shared-utils/{header-menu → header-footer}/example-data.d.ts +5 -4
- package/dist/shared-utils/header-footer/external-domain.d.ts +26 -0
- package/dist/shared-utils/{header-menu → header-footer}/fetch-header-footer-data.d.ts +6 -2
- package/dist/shared-utils/{header-menu → header-footer}/index.d.ts +2 -1
- package/dist/shared-utils/{header-menu → header-footer}/select-megamenu.d.ts +1 -1
- package/dist/shared-utils/scroll-lock/index.d.ts +24 -0
- package/dist/tabs-BqrKLCjd.js +214 -0
- package/dist/tabs-q62MK_-r.cjs +40 -0
- package/dist/{textarea-D6M7ZhtA.js → textarea-Cm392CEI.js} +5 -3
- package/dist/{textarea-Bt_Zs8gq.cjs → textarea-sTcZxOIB.cjs} +3 -2
- package/dist/{textinput-EDKjcUdg.cjs → textinput-DqJbTglM.cjs} +3 -2
- package/dist/{textinput-oU2EvFsi.js → textinput-TSPcBcih.js} +5 -3
- package/dist/{timepicker-CgOL2sd9.cjs → timepicker-CqFYMV8q.cjs} +8 -7
- package/dist/{timepicker-_G0V_HV3.js → timepicker-DWbgTDKq.js} +10 -9
- package/package.json +3 -3
- package/src/components/accordion/accordion-context.ts +8 -0
- package/src/components/accordion/accordion.test.ts +44 -0
- package/src/components/accordion/accordion.ts +13 -3
- package/src/components/accordion/accordionitem.ts +9 -1
- package/src/components/alert/alert.test.ts +51 -2
- package/src/components/alert/alert.ts +11 -5
- package/src/components/breadcrumbs/breadcrumbs.test.ts +11 -3
- package/src/components/button/button.test.ts +23 -0
- package/src/components/button/button.ts +28 -3
- package/src/components/combobox/combobox.core.test.ts +20 -0
- package/src/components/combobox/combobox.ts +2 -0
- package/src/components/consent/consent.test.ts +6 -3
- package/src/components/consent/consent.ts +15 -7
- package/src/components/datepicker/datepicker-base.ts +5 -1
- package/src/components/datepicker/datepicker-utils.test.ts +10 -0
- package/src/components/datepicker/datepicker.core.test.ts +17 -0
- package/src/components/datepicker/datepicker.ts +8 -0
- package/src/components/footer/footer-base.ts +238 -0
- package/src/components/footer/footer-simple.ts +71 -0
- package/src/components/footer/footer.accessibility.test.ts +66 -0
- package/src/components/footer/footer.test.ts +238 -0
- package/src/components/footer/footer.ts +81 -0
- package/src/components/footer/index.ts +4 -0
- package/src/components/footer/types.ts +21 -0
- package/src/components/header/header-chrome-controller.ts +123 -0
- package/src/components/header/header-global.accessibility.test.ts +110 -0
- package/src/components/header/header-global.test.ts +329 -0
- package/src/components/header/header-global.ts +648 -0
- package/src/components/header/header-service.accessibility.test.ts +79 -0
- package/src/components/header/header-service.test.ts +32 -12
- package/src/components/header/header-service.ts +38 -162
- package/src/components/header/header-user-menu.ts +0 -1
- package/src/components/header/header.test.ts +84 -0
- package/src/components/header/header.ts +52 -5
- package/src/components/header/index.ts +6 -0
- package/src/components/header/types.ts +38 -0
- package/src/components/header-menu/header-menu.test.ts +131 -10
- package/src/components/header-menu/header-menu.ts +23 -24
- package/src/components/header-menu/types.ts +1 -1
- package/src/components/index.ts +18 -2
- package/src/components/input-wrapper/input-wrapper.test.ts +45 -0
- package/src/components/input-wrapper/input-wrapper.ts +17 -9
- package/src/components/modal/modal.ts +8 -9
- package/src/components/searchinput/searchinput.test.ts +43 -0
- package/src/components/searchinput/searchinput.ts +29 -12
- package/src/components/select/index.ts +1 -1
- package/src/components/select/select.test.ts +28 -0
- package/src/components/select/select.ts +4 -3
- package/src/components/textarea/textarea.test.ts +16 -0
- package/src/components/textarea/textarea.ts +3 -1
- package/src/components/textinput/textinput.test.ts +28 -0
- package/src/components/textinput/textinput.ts +3 -1
- package/src/components/timepicker/timepicker.test.ts +26 -0
- package/src/components/timepicker/timepicker.ts +12 -6
- package/dist/accordion-FISAiAbX.cjs +0 -47
- package/dist/button-C_YzTSuU.js +0 -96
- package/dist/combobox-D6H9rWPV.cjs +0 -135
- package/dist/consent-X3wvhteO.cjs +0 -10
- package/dist/fileupload-BLVrslUX.cjs +0 -401
- package/dist/header-CFrsaq0c.cjs +0 -310
- package/dist/header-D_xvPR4R.js +0 -801
- package/dist/header-menu-DMdP_c6X.cjs +0 -126
- package/dist/modal-DKU7PnjJ.cjs +0 -35
- package/dist/searchinput-CyO5k4Q4.js +0 -148
- package/dist/searchinput-DG6YetL1.cjs +0 -60
- package/dist/shared-utils/modal-scroll-lock.d.ts +0 -10
- package/dist/tabs-CGo0ODPa.cjs +0 -40
- package/dist/tabs-ChdR0D1C.js +0 -379
- /package/dist/shared-utils/{header-menu → header-footer}/icon-map.d.ts +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//#region ../../shared-utils/focus-trap/index.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (!e) return [];
|
|
4
|
+
let t = [
|
|
5
|
+
"a[href]:not([tabindex=\"-1\"])",
|
|
6
|
+
"button:not([disabled]):not([tabindex=\"-1\"])",
|
|
7
|
+
"input:not([disabled]):not([type=\"hidden\"]):not([tabindex=\"-1\"])",
|
|
8
|
+
"select:not([disabled]):not([tabindex=\"-1\"])",
|
|
9
|
+
"textarea:not([disabled]):not([tabindex=\"-1\"])",
|
|
10
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
11
|
+
].join(", ");
|
|
12
|
+
return Array.from(e.querySelectorAll(t)).filter((e) => !e.hasAttribute("inert"));
|
|
13
|
+
}
|
|
14
|
+
var t = [
|
|
15
|
+
"a[href]",
|
|
16
|
+
"button:not([disabled])",
|
|
17
|
+
"input:not([disabled]):not([type=\"hidden\"])",
|
|
18
|
+
"select:not([disabled])",
|
|
19
|
+
"textarea:not([disabled])",
|
|
20
|
+
"summary",
|
|
21
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
22
|
+
].join(", "), n = (e) => {
|
|
23
|
+
if (e.hasAttribute("inert") || e.closest("[inert]") || e.hidden || e.closest("[hidden]")) return !0;
|
|
24
|
+
let t = e;
|
|
25
|
+
for (; t;) {
|
|
26
|
+
let n = t.closest("details");
|
|
27
|
+
if (!n) break;
|
|
28
|
+
if (!n.hasAttribute("open")) {
|
|
29
|
+
let t = n.querySelector(":scope > summary");
|
|
30
|
+
if (!t || !t.contains(e)) return !0;
|
|
31
|
+
}
|
|
32
|
+
t = n.parentElement;
|
|
33
|
+
}
|
|
34
|
+
return !1;
|
|
35
|
+
}, r = (e, i) => {
|
|
36
|
+
e.matches(t) && !n(e) && i.push(e);
|
|
37
|
+
let a = e.shadowRoot;
|
|
38
|
+
if (a) for (let e of Array.from(a.children)) r(e, i);
|
|
39
|
+
for (let t of Array.from(e.children)) r(t, i);
|
|
40
|
+
};
|
|
41
|
+
function i(e) {
|
|
42
|
+
if (!e) return [];
|
|
43
|
+
let t = [];
|
|
44
|
+
for (let n of Array.from(e.children)) r(n, t);
|
|
45
|
+
return t;
|
|
46
|
+
}
|
|
47
|
+
function a(e = document) {
|
|
48
|
+
let t = e.activeElement;
|
|
49
|
+
for (; t?.shadowRoot?.activeElement;) t = t.shadowRoot.activeElement;
|
|
50
|
+
return t;
|
|
51
|
+
}
|
|
52
|
+
function o(t, n) {
|
|
53
|
+
if (t.key !== "Tab") return !1;
|
|
54
|
+
let r = e(n);
|
|
55
|
+
if (r.length === 0) return t.preventDefault(), !0;
|
|
56
|
+
let i = r[0], a = r[r.length - 1], o = (n?.ownerDocument ?? document).activeElement, s = !!o && r.includes(o);
|
|
57
|
+
return t.shiftKey ? !s || o === i ? (t.preventDefault(), a.focus(), !0) : !1 : !s || o === a ? (t.preventDefault(), i.focus(), !0) : !1;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { i as n, o as r, a as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if(!e)return[];let t=[`a[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);return Array.from(e.querySelectorAll(t)).filter(e=>!e.hasAttribute(`inert`))}var t=[`a[href]`,`button:not([disabled])`,`input:not([disabled]):not([type="hidden"])`,`select:not([disabled])`,`textarea:not([disabled])`,`summary`,`[tabindex]:not([tabindex="-1"])`].join(`, `),n=e=>{if(e.hasAttribute(`inert`)||e.closest(`[inert]`)||e.hidden||e.closest(`[hidden]`))return!0;let t=e;for(;t;){let n=t.closest(`details`);if(!n)break;if(!n.hasAttribute(`open`)){let t=n.querySelector(`:scope > summary`);if(!t||!t.contains(e))return!0}t=n.parentElement}return!1},r=(e,i)=>{e.matches(t)&&!n(e)&&i.push(e);let a=e.shadowRoot;if(a)for(let e of Array.from(a.children))r(e,i);for(let t of Array.from(e.children))r(t,i)};function i(e){if(!e)return[];let t=[];for(let n of Array.from(e.children))r(n,t);return t}function a(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function o(t,n){if(t.key!==`Tab`)return!1;let r=e(n);if(r.length===0)return t.preventDefault(),!0;let i=r[0],a=r[r.length-1],o=(n?.ownerDocument??document).activeElement,s=!!o&&r.includes(o);return t.shiftKey?!s||o===i?(t.preventDefault(),a.focus(),!0):!1:!s||o===a?(t.preventDefault(),i.focus(),!0):!1}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-BoJrqauR.js";
|
|
2
|
+
import "./icon-DGFEIlco.js";
|
|
3
|
+
import { t as s } from "./if-defined-D0bnetLJ.js";
|
|
4
|
+
import { t as c } from "./booleanish-MfutDT_4.js";
|
|
5
|
+
import { n as l, r as u, t as d } from "./fetch-header-footer-data-Pc32etrk.js";
|
|
6
|
+
import "./consent-B2hSTCGC.js";
|
|
7
|
+
//#region ../../shared-utils/header-footer/external-domain.ts
|
|
8
|
+
var f = "oslo.kommune.no", p = /\.(?:co|com|org|net|gov|edu|ac|kommune)\.[a-z]{2}$/i;
|
|
9
|
+
function m(e) {
|
|
10
|
+
let t = e.toLowerCase().replace(/\.$/, ""), n = t.split(".");
|
|
11
|
+
return n.length <= 2 ? t : n.slice(p.test(t) ? -3 : -2).join(".");
|
|
12
|
+
}
|
|
13
|
+
function h(e) {
|
|
14
|
+
if (!e) return;
|
|
15
|
+
let t;
|
|
16
|
+
try {
|
|
17
|
+
t = new URL(e);
|
|
18
|
+
} catch {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!(t.protocol !== "http:" && t.protocol !== "https:")) return m(t.hostname.toLowerCase().replace(/\.$/, ""));
|
|
22
|
+
}
|
|
23
|
+
function g(e, t = f) {
|
|
24
|
+
if (!e) return;
|
|
25
|
+
let n;
|
|
26
|
+
try {
|
|
27
|
+
n = new URL(e);
|
|
28
|
+
} catch {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (n.protocol !== "http:" && n.protocol !== "https:") return;
|
|
32
|
+
let r = n.hostname.toLowerCase().replace(/\.$/, ""), i = t.toLowerCase();
|
|
33
|
+
if (!(r === i || r.endsWith(`.${i}`))) return m(r);
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/footer/footer-base.ts
|
|
37
|
+
var _ = "#cb-trigger", v = class extends o {
|
|
38
|
+
constructor(...e) {
|
|
39
|
+
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;
|
|
40
|
+
}
|
|
41
|
+
connectedCallback() {
|
|
42
|
+
super.connectedCallback(), !this.data && !this.skipGlobal && this.loadData();
|
|
43
|
+
}
|
|
44
|
+
disconnectedCallback() {
|
|
45
|
+
super.disconnectedCallback(), this.abortController?.abort();
|
|
46
|
+
}
|
|
47
|
+
updated(e) {
|
|
48
|
+
super.updated(e), e.has("dataUrl") && e.get("dataUrl") !== void 0 && !this.data && this.loadData();
|
|
49
|
+
}
|
|
50
|
+
async loadData() {
|
|
51
|
+
this.abortController?.abort(), this.abortController = new AbortController();
|
|
52
|
+
try {
|
|
53
|
+
this.fetchedData = await d(this.dataUrl, this.abortController.signal);
|
|
54
|
+
} catch (e) {
|
|
55
|
+
if (e.name === "AbortError") return;
|
|
56
|
+
console.warn("Failed to fetch header/footer data:", e), this.dispatchEvent(new CustomEvent("data-error", {
|
|
57
|
+
detail: { error: e },
|
|
58
|
+
bubbles: !0,
|
|
59
|
+
composed: !0
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
get globalFooterData() {
|
|
64
|
+
return l(this.data ?? this.fetchedData, this.locale)?.footer;
|
|
65
|
+
}
|
|
66
|
+
linkTarget(e) {
|
|
67
|
+
return e.openInNewTab || this.openLinksInNewTab ? {
|
|
68
|
+
target: "_blank",
|
|
69
|
+
rel: "noopener noreferrer"
|
|
70
|
+
} : { target: "_self" };
|
|
71
|
+
}
|
|
72
|
+
renderLinkDomain(e, n = "pkt-footer__link-domain") {
|
|
73
|
+
if (!e.external) return t;
|
|
74
|
+
let r = h(e.href);
|
|
75
|
+
return r ? i` <span class=${n}>(${r})</span>` : t;
|
|
76
|
+
}
|
|
77
|
+
renderCustomLink(e) {
|
|
78
|
+
let { target: t, rel: n } = this.linkTarget(e);
|
|
79
|
+
return i`
|
|
80
|
+
<a href=${e.href} target=${t} rel=${s(n)}
|
|
81
|
+
>${e.text}${this.renderLinkDomain(e)}</a
|
|
82
|
+
>
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
renderConsent() {
|
|
86
|
+
return this.includeConsent ? i`
|
|
87
|
+
<pkt-consent
|
|
88
|
+
.triggerType=${"footerlink"}
|
|
89
|
+
.hotjarId=${this.hotjarId}
|
|
90
|
+
.googleAnalyticsId=${this.googleAnalyticsId}
|
|
91
|
+
.devMode=${!!this.devMode}
|
|
92
|
+
.cookieDomain=${this.cookieDomain}
|
|
93
|
+
.cookieSecure=${this.cookieSecure}
|
|
94
|
+
.cookieExpiryDays=${this.cookieExpiryDays}
|
|
95
|
+
></pkt-consent>
|
|
96
|
+
` : t;
|
|
97
|
+
}
|
|
98
|
+
renderGlobalSectionLink(e) {
|
|
99
|
+
if (e.url === _) return this.includeConsent ? i`
|
|
100
|
+
<li>
|
|
101
|
+
<pkt-consent
|
|
102
|
+
.triggerType=${"footerlink"}
|
|
103
|
+
.triggerText=${e.text}
|
|
104
|
+
.hotjarId=${this.hotjarId}
|
|
105
|
+
.googleAnalyticsId=${this.googleAnalyticsId}
|
|
106
|
+
.devMode=${!!this.devMode}
|
|
107
|
+
.cookieDomain=${this.cookieDomain}
|
|
108
|
+
.cookieSecure=${this.cookieSecure}
|
|
109
|
+
.cookieExpiryDays=${this.cookieExpiryDays}
|
|
110
|
+
></pkt-consent>
|
|
111
|
+
</li>
|
|
112
|
+
` : t;
|
|
113
|
+
let n = g(e.url);
|
|
114
|
+
return i`
|
|
115
|
+
<li>
|
|
116
|
+
<a href=${e.url}
|
|
117
|
+
>${e.text}${n ? i` <span class="pkt-footer__link-domain">(${n})</span>` : t}</a
|
|
118
|
+
>
|
|
119
|
+
</li>
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
renderGlobalSection(e) {
|
|
123
|
+
return i`
|
|
124
|
+
<section>
|
|
125
|
+
<h2>${e.title}</h2>
|
|
126
|
+
<ul class="pkt-footer__link-list">
|
|
127
|
+
${e.links.map((e) => this.renderGlobalSectionLink(e))}
|
|
128
|
+
</ul>
|
|
129
|
+
</section>
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
renderSomeLink(e) {
|
|
133
|
+
let t = u(e.url, e.text);
|
|
134
|
+
return t ? i`
|
|
135
|
+
<li>
|
|
136
|
+
<a class="pkt-footer__some-link" href=${e.url} aria-label=${e.text}>
|
|
137
|
+
<pkt-icon class="pkt-footer__some-icon" name=${t}></pkt-icon>
|
|
138
|
+
</a>
|
|
139
|
+
</li>
|
|
140
|
+
` : i`<li><a href=${e.url}>${e.text}</a></li>`;
|
|
141
|
+
}
|
|
142
|
+
renderGlobalBottom(e) {
|
|
143
|
+
let n = e.links?.length > 0, r = e.some?.length > 0;
|
|
144
|
+
return !n && !r ? t : i`
|
|
145
|
+
<div class="pkt-footer__bottom">
|
|
146
|
+
${n ? i`
|
|
147
|
+
<ul class="pkt-footer__bottom-links">
|
|
148
|
+
${e.links.map((e) => i`<li><a href=${e.url}>${e.text}</a></li>`)}
|
|
149
|
+
</ul>
|
|
150
|
+
` : t}
|
|
151
|
+
${r ? i`
|
|
152
|
+
<ul class="pkt-footer__some">
|
|
153
|
+
${e.some.map((e) => this.renderSomeLink(e))}
|
|
154
|
+
</ul>
|
|
155
|
+
` : t}
|
|
156
|
+
</div>
|
|
157
|
+
`;
|
|
158
|
+
}
|
|
159
|
+
renderGlobalFooter() {
|
|
160
|
+
if (this.skipGlobal) return t;
|
|
161
|
+
let e = this.globalFooterData;
|
|
162
|
+
return e ? i`
|
|
163
|
+
<div class="pkt-footer__band pkt-footer__band--global">
|
|
164
|
+
<div class="pkt-footer__inner">
|
|
165
|
+
<div class="pkt-footer__sections">
|
|
166
|
+
${e.sections.map((e) => this.renderGlobalSection(e))}
|
|
167
|
+
${this.renderGlobalBottom(e)}
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
` : t;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
n([r({
|
|
175
|
+
type: String,
|
|
176
|
+
attribute: "data-url"
|
|
177
|
+
})], v.prototype, "dataUrl", void 0), n([r({
|
|
178
|
+
type: Object,
|
|
179
|
+
attribute: !1
|
|
180
|
+
})], v.prototype, "data", void 0), n([r({ type: String })], v.prototype, "locale", void 0), n([r({
|
|
181
|
+
type: Boolean,
|
|
182
|
+
attribute: "skip-global",
|
|
183
|
+
converter: c
|
|
184
|
+
})], v.prototype, "skipGlobal", void 0), n([r({
|
|
185
|
+
type: Boolean,
|
|
186
|
+
attribute: "open-links-in-new-tab",
|
|
187
|
+
converter: c
|
|
188
|
+
})], v.prototype, "openLinksInNewTab", void 0), n([r({
|
|
189
|
+
type: Boolean,
|
|
190
|
+
attribute: "include-consent",
|
|
191
|
+
converter: c
|
|
192
|
+
})], v.prototype, "includeConsent", void 0), n([r({
|
|
193
|
+
type: String,
|
|
194
|
+
attribute: "hotjar-id"
|
|
195
|
+
})], v.prototype, "hotjarId", void 0), n([r({
|
|
196
|
+
type: String,
|
|
197
|
+
attribute: "google-analytics-id"
|
|
198
|
+
})], v.prototype, "googleAnalyticsId", void 0), n([r({
|
|
199
|
+
type: Boolean,
|
|
200
|
+
attribute: "dev-mode",
|
|
201
|
+
converter: c
|
|
202
|
+
})], v.prototype, "devMode", void 0), n([r({
|
|
203
|
+
type: String,
|
|
204
|
+
attribute: "cookie-domain"
|
|
205
|
+
})], v.prototype, "cookieDomain", void 0), n([r({
|
|
206
|
+
type: String,
|
|
207
|
+
attribute: "cookie-secure"
|
|
208
|
+
})], v.prototype, "cookieSecure", void 0), n([r({
|
|
209
|
+
type: String,
|
|
210
|
+
attribute: "cookie-expiry-days"
|
|
211
|
+
})], v.prototype, "cookieExpiryDays", void 0), n([e()], v.prototype, "fetchedData", void 0);
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/components/footer/footer.ts
|
|
214
|
+
var y = class extends v {
|
|
215
|
+
connectedCallback() {
|
|
216
|
+
super.connectedCallback(), this.classList.add("pkt-footer-host");
|
|
217
|
+
}
|
|
218
|
+
renderColumn(e) {
|
|
219
|
+
return i`
|
|
220
|
+
<section>
|
|
221
|
+
<h2>${e.title}</h2>
|
|
222
|
+
${e.text ? i`<p>${e.text}</p>` : t}
|
|
223
|
+
${e.links?.length ? i`
|
|
224
|
+
<ul class="pkt-footer__link-list">
|
|
225
|
+
${e.links.map((e) => i`<li>${this.renderCustomLink(e)}</li>`)}
|
|
226
|
+
</ul>
|
|
227
|
+
` : t}
|
|
228
|
+
</section>
|
|
229
|
+
`;
|
|
230
|
+
}
|
|
231
|
+
renderSecondary() {
|
|
232
|
+
let e = this.skipGlobal && this.includeConsent;
|
|
233
|
+
return i`
|
|
234
|
+
<div class="pkt-footer__band pkt-footer__band--secondary">
|
|
235
|
+
<div class="pkt-footer__inner">
|
|
236
|
+
${this.columns?.length ? i`
|
|
237
|
+
<div class="pkt-footer__sections">
|
|
238
|
+
${this.columns.map((e) => this.renderColumn(e))}
|
|
239
|
+
</div>
|
|
240
|
+
` : t}
|
|
241
|
+
${e ? i`<div class="pkt-footer__consent">${this.renderConsent()}</div>` : t}
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
`;
|
|
245
|
+
}
|
|
246
|
+
render() {
|
|
247
|
+
let e = !!this.columns?.length, n = this.skipGlobal && this.includeConsent;
|
|
248
|
+
return i`
|
|
249
|
+
<footer class="pkt-footer">
|
|
250
|
+
${e || n ? this.renderSecondary() : t}
|
|
251
|
+
${this.renderGlobalFooter()}
|
|
252
|
+
</footer>
|
|
253
|
+
`;
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
n([r({ type: Array })], y.prototype, "columns", void 0);
|
|
257
|
+
try {
|
|
258
|
+
a("pkt-footer")(y);
|
|
259
|
+
} catch {
|
|
260
|
+
console.warn("Forsøker å definere <pkt-footer>, men den er allerede definert");
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/components/footer/footer-simple.ts
|
|
264
|
+
var b = class extends v {
|
|
265
|
+
connectedCallback() {
|
|
266
|
+
super.connectedCallback(), this.classList.add("pkt-footer-simple-host");
|
|
267
|
+
}
|
|
268
|
+
renderLink(e) {
|
|
269
|
+
let { target: t, rel: n } = this.linkTarget(e);
|
|
270
|
+
return i`
|
|
271
|
+
<a class="pkt-footer-simple__link" href=${e.href} target=${t} rel=${s(n)}>
|
|
272
|
+
<pkt-icon class="pkt-footer-simple__link-icon" name="arrow-link"></pkt-icon>
|
|
273
|
+
<span>${e.text}${this.renderLinkDomain(e, "pkt-footer-simple__link-domain")}</span>
|
|
274
|
+
</a>
|
|
275
|
+
`;
|
|
276
|
+
}
|
|
277
|
+
render() {
|
|
278
|
+
let e = !!this.links?.length, n = this.skipGlobal && this.includeConsent;
|
|
279
|
+
return i`
|
|
280
|
+
<footer class="pkt-footer-simple">
|
|
281
|
+
${e || n ? i`
|
|
282
|
+
<div class="pkt-footer__band pkt-footer__band--secondary">
|
|
283
|
+
<div class="pkt-footer__inner pkt-footer__inner--compact">
|
|
284
|
+
<ul class="pkt-footer-simple__list">
|
|
285
|
+
${this.links?.map((e) => i`<li>${this.renderLink(e)}</li>`)}
|
|
286
|
+
${n ? i`<li>${this.renderConsent()}</li>` : t}
|
|
287
|
+
</ul>
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
` : t}
|
|
291
|
+
${this.renderGlobalFooter()}
|
|
292
|
+
</footer>
|
|
293
|
+
`;
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
n([r({ type: Array })], b.prototype, "links", void 0);
|
|
297
|
+
try {
|
|
298
|
+
a("pkt-footer-simple")(b);
|
|
299
|
+
} catch {
|
|
300
|
+
console.warn("Forsøker å definere <pkt-footer-simple>, men den er allerede definert");
|
|
301
|
+
}
|
|
302
|
+
//#endregion
|
|
303
|
+
export { y as n, b as t };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
const e=require("./element-DJzurxgt.cjs");require("./icon-B8PVq2O6.cjs");const t=require("./if-defined-DrwbxQOj.cjs"),n=require("./booleanish-B9Kf0nES.cjs"),r=require("./fetch-header-footer-data-xohWFmYC.cjs");require("./consent--Nw43WFU.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.d;let r=s(t.href);return r?e.p` <span class=${n}>(${r})</span>`:e.d}renderCustomLink(n){let{target:r,rel:i}=this.linkTarget(n);return e.p`
|
|
2
|
+
<a href=${n.href} target=${r} rel=${t.t(i)}
|
|
3
|
+
>${n.text}${this.renderLinkDomain(n)}</a
|
|
4
|
+
>
|
|
5
|
+
`}renderConsent(){return this.includeConsent?e.p`
|
|
6
|
+
<pkt-consent
|
|
7
|
+
.triggerType=${`footerlink`}
|
|
8
|
+
.hotjarId=${this.hotjarId}
|
|
9
|
+
.googleAnalyticsId=${this.googleAnalyticsId}
|
|
10
|
+
.devMode=${!!this.devMode}
|
|
11
|
+
.cookieDomain=${this.cookieDomain}
|
|
12
|
+
.cookieSecure=${this.cookieSecure}
|
|
13
|
+
.cookieExpiryDays=${this.cookieExpiryDays}
|
|
14
|
+
></pkt-consent>
|
|
15
|
+
`:e.d}renderGlobalSectionLink(t){if(t.url===l)return this.includeConsent?e.p`
|
|
16
|
+
<li>
|
|
17
|
+
<pkt-consent
|
|
18
|
+
.triggerType=${`footerlink`}
|
|
19
|
+
.triggerText=${t.text}
|
|
20
|
+
.hotjarId=${this.hotjarId}
|
|
21
|
+
.googleAnalyticsId=${this.googleAnalyticsId}
|
|
22
|
+
.devMode=${!!this.devMode}
|
|
23
|
+
.cookieDomain=${this.cookieDomain}
|
|
24
|
+
.cookieSecure=${this.cookieSecure}
|
|
25
|
+
.cookieExpiryDays=${this.cookieExpiryDays}
|
|
26
|
+
></pkt-consent>
|
|
27
|
+
</li>
|
|
28
|
+
`:e.d;let n=c(t.url);return e.p`
|
|
29
|
+
<li>
|
|
30
|
+
<a href=${t.url}
|
|
31
|
+
>${t.text}${n?e.p` <span class="pkt-footer__link-domain">(${n})</span>`:e.d}</a
|
|
32
|
+
>
|
|
33
|
+
</li>
|
|
34
|
+
`}renderGlobalSection(t){return e.p`
|
|
35
|
+
<section>
|
|
36
|
+
<h2>${t.title}</h2>
|
|
37
|
+
<ul class="pkt-footer__link-list">
|
|
38
|
+
${t.links.map(e=>this.renderGlobalSectionLink(e))}
|
|
39
|
+
</ul>
|
|
40
|
+
</section>
|
|
41
|
+
`}renderSomeLink(t){let n=r.r(t.url,t.text);return n?e.p`
|
|
42
|
+
<li>
|
|
43
|
+
<a class="pkt-footer__some-link" href=${t.url} aria-label=${t.text}>
|
|
44
|
+
<pkt-icon class="pkt-footer__some-icon" name=${n}></pkt-icon>
|
|
45
|
+
</a>
|
|
46
|
+
</li>
|
|
47
|
+
`:e.p`<li><a href=${t.url}>${t.text}</a></li>`}renderGlobalBottom(t){let n=t.links?.length>0,r=t.some?.length>0;return!n&&!r?e.d:e.p`
|
|
48
|
+
<div class="pkt-footer__bottom">
|
|
49
|
+
${n?e.p`
|
|
50
|
+
<ul class="pkt-footer__bottom-links">
|
|
51
|
+
${t.links.map(t=>e.p`<li><a href=${t.url}>${t.text}</a></li>`)}
|
|
52
|
+
</ul>
|
|
53
|
+
`:e.d}
|
|
54
|
+
${r?e.p`
|
|
55
|
+
<ul class="pkt-footer__some">
|
|
56
|
+
${t.some.map(e=>this.renderSomeLink(e))}
|
|
57
|
+
</ul>
|
|
58
|
+
`:e.d}
|
|
59
|
+
</div>
|
|
60
|
+
`}renderGlobalFooter(){if(this.skipGlobal)return e.d;let t=this.globalFooterData;return t?e.p`
|
|
61
|
+
<div class="pkt-footer__band pkt-footer__band--global">
|
|
62
|
+
<div class="pkt-footer__inner">
|
|
63
|
+
<div class="pkt-footer__sections">
|
|
64
|
+
${t.sections.map(e=>this.renderGlobalSection(e))}
|
|
65
|
+
${this.renderGlobalBottom(t)}
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
`:e.d}};e.n([e.o({type:String,attribute:`data-url`})],u.prototype,`dataUrl`,void 0),e.n([e.o({type:Object,attribute:!1})],u.prototype,`data`,void 0),e.n([e.o({type:String})],u.prototype,`locale`,void 0),e.n([e.o({type:Boolean,attribute:`skip-global`,converter:n.t})],u.prototype,`skipGlobal`,void 0),e.n([e.o({type:Boolean,attribute:`open-links-in-new-tab`,converter:n.t})],u.prototype,`openLinksInNewTab`,void 0),e.n([e.o({type:Boolean,attribute:`include-consent`,converter:n.t})],u.prototype,`includeConsent`,void 0),e.n([e.o({type:String,attribute:`hotjar-id`})],u.prototype,`hotjarId`,void 0),e.n([e.o({type:String,attribute:`google-analytics-id`})],u.prototype,`googleAnalyticsId`,void 0),e.n([e.o({type:Boolean,attribute:`dev-mode`,converter:n.t})],u.prototype,`devMode`,void 0),e.n([e.o({type:String,attribute:`cookie-domain`})],u.prototype,`cookieDomain`,void 0),e.n([e.o({type:String,attribute:`cookie-secure`})],u.prototype,`cookieSecure`,void 0),e.n([e.o({type:String,attribute:`cookie-expiry-days`})],u.prototype,`cookieExpiryDays`,void 0),e.n([e.a()],u.prototype,`fetchedData`,void 0);var d=class extends u{connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-footer-host`)}renderColumn(t){return e.p`
|
|
70
|
+
<section>
|
|
71
|
+
<h2>${t.title}</h2>
|
|
72
|
+
${t.text?e.p`<p>${t.text}</p>`:e.d}
|
|
73
|
+
${t.links?.length?e.p`
|
|
74
|
+
<ul class="pkt-footer__link-list">
|
|
75
|
+
${t.links.map(t=>e.p`<li>${this.renderCustomLink(t)}</li>`)}
|
|
76
|
+
</ul>
|
|
77
|
+
`:e.d}
|
|
78
|
+
</section>
|
|
79
|
+
`}renderSecondary(){let t=this.skipGlobal&&this.includeConsent;return e.p`
|
|
80
|
+
<div class="pkt-footer__band pkt-footer__band--secondary">
|
|
81
|
+
<div class="pkt-footer__inner">
|
|
82
|
+
${this.columns?.length?e.p`
|
|
83
|
+
<div class="pkt-footer__sections">
|
|
84
|
+
${this.columns.map(e=>this.renderColumn(e))}
|
|
85
|
+
</div>
|
|
86
|
+
`:e.d}
|
|
87
|
+
${t?e.p`<div class="pkt-footer__consent">${this.renderConsent()}</div>`:e.d}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
`}render(){let t=!!this.columns?.length,n=this.skipGlobal&&this.includeConsent;return e.p`
|
|
91
|
+
<footer class="pkt-footer">
|
|
92
|
+
${t||n?this.renderSecondary():e.d}
|
|
93
|
+
${this.renderGlobalFooter()}
|
|
94
|
+
</footer>
|
|
95
|
+
`}};e.n([e.o({type:Array})],d.prototype,`columns`,void 0);try{e.s(`pkt-footer`)(d)}catch{console.warn(`Forsøker å definere <pkt-footer>, men den er allerede definert`)}var f=class extends u{connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-footer-simple-host`)}renderLink(n){let{target:r,rel:i}=this.linkTarget(n);return e.p`
|
|
96
|
+
<a class="pkt-footer-simple__link" href=${n.href} target=${r} rel=${t.t(i)}>
|
|
97
|
+
<pkt-icon class="pkt-footer-simple__link-icon" name="arrow-link"></pkt-icon>
|
|
98
|
+
<span>${n.text}${this.renderLinkDomain(n,`pkt-footer-simple__link-domain`)}</span>
|
|
99
|
+
</a>
|
|
100
|
+
`}render(){let t=!!this.links?.length,n=this.skipGlobal&&this.includeConsent;return e.p`
|
|
101
|
+
<footer class="pkt-footer-simple">
|
|
102
|
+
${t||n?e.p`
|
|
103
|
+
<div class="pkt-footer__band pkt-footer__band--secondary">
|
|
104
|
+
<div class="pkt-footer__inner pkt-footer__inner--compact">
|
|
105
|
+
<ul class="pkt-footer-simple__list">
|
|
106
|
+
${this.links?.map(t=>e.p`<li>${this.renderLink(t)}</li>`)}
|
|
107
|
+
${n?e.p`<li>${this.renderConsent()}</li>`:e.d}
|
|
108
|
+
</ul>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
`:e.d}
|
|
112
|
+
${this.renderGlobalFooter()}
|
|
113
|
+
</footer>
|
|
114
|
+
`}};e.n([e.o({type:Array})],f.prototype,`links`,void 0);try{e.s(`pkt-footer-simple`)(f)}catch{console.warn(`Forsøker å definere <pkt-footer-simple>, men den er allerede definert`)}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
package/dist/footer.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|