@oslokommune/punkt-elements 17.1.3 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/{accordion-BeLvLPrB.js → accordion-1_pdxTgJ.js} +27 -27
- package/dist/{accordion-B3GBlvUC.cjs → accordion-DobbH-Sv.cjs} +5 -5
- package/dist/{alert-Cs4Rmq_J.cjs → alert-COeHz6o2.cjs} +6 -6
- package/dist/{alert-DKK_Tb9J.js → alert-xspFetQ8.js} +26 -26
- package/dist/{async-directive-Da7TJpnq.cjs → async-directive-B5pcIMfO.cjs} +1 -1
- package/dist/{async-directive-BPf6K-V2.js → async-directive-D2Sht790.js} +5 -5
- package/dist/{backlink-D1y26pj3.js → backlink-C0jZFnZ2.js} +8 -8
- package/dist/{backlink-CMmrKTe4.cjs → backlink-ZMhqHaVs.cjs} +3 -3
- package/dist/base-elements/element.d.ts +13 -1
- package/dist/base-elements/input-element.d.ts +4 -2
- package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-BS64xd1s.cjs} +7 -7
- package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-BvMownZN.js} +16 -16
- package/dist/{button-2-OSPJkj.js → button-C44vNLFC.js} +28 -28
- package/dist/{button-CE97NQIk.cjs → button-CR4CXtnj.cjs} +7 -7
- package/dist/{calendar-kn4SrtJy.cjs → calendar-DQ4byeom.cjs} +28 -27
- package/dist/{calendar-pOW3R5Pw.js → calendar-DgjCKMMV.js} +82 -68
- package/dist/{card-zQ0eKRMV.js → card-DhHqC265.js} +44 -44
- package/dist/{card-CETDFkxR.cjs → card-Dpqi6HVt.cjs} +26 -26
- package/dist/{checkbox-CH7NpINF.js → checkbox-BQ1K57AB.js} +23 -23
- package/dist/{checkbox-CQNr_sEg.cjs → checkbox-CXQxbiaX.cjs} +11 -11
- package/dist/{class-map-BeimMvPv.cjs → class-map-CzCE5pqG.cjs} +1 -1
- package/dist/{class-map-CnWCnBSX.js → class-map-F1DJHyb7.js} +3 -3
- package/dist/{combobox-Bvg0UO9w.cjs → combobox-BV4oDiII.cjs} +19 -18
- package/dist/{combobox-CRdYYlxu.js → combobox-DPck39I2.js} +55 -54
- package/dist/components/calendar/calendar.d.ts +21 -6
- package/dist/components/checkbox/checkbox.d.ts +4 -2
- package/dist/components/combobox/combobox-base.d.ts +2 -1
- package/dist/components/consent/strings.d.ts +1 -85
- package/dist/components/datepicker/datepicker-base.d.ts +0 -3
- package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
- package/dist/components/datepicker/datepicker-range.d.ts +0 -2
- package/dist/components/datepicker/datepicker-single.d.ts +0 -2
- package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
- package/dist/components/fileupload/fileupload-base.d.ts +3 -2
- package/dist/components/header/header-service.d.ts +3 -1
- package/dist/components/header/header.d.ts +2 -1
- package/dist/components/helptext/helptext.d.ts +2 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
- package/dist/components/radiobutton/radiobutton.d.ts +4 -2
- package/dist/components/searchinput/searchinput.d.ts +2 -1
- package/dist/{consent-DZEkhgJ1.js → consent-BneInZov.js} +10 -10
- package/dist/{consent-CyY3RyoC.cjs → consent-_N9foluG.cjs} +5 -5
- package/dist/controllers/strings-controller.d.ts +27 -0
- package/dist/{datepicker-VTqSDQk5.cjs → datepicker-9NX5qt2z.cjs} +38 -37
- package/dist/{datepicker-ButIas85.js → datepicker-nSSSr1U7.js} +104 -104
- package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BARw3nEZ.js} +1 -1
- package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-D6AAMFKs.cjs} +1 -1
- package/dist/docs/components/fileupload.d.ts +1 -0
- package/dist/element-B8OGznK0.cjs +2 -0
- package/dist/{element-ChsFgr_B.js → element-BKSPVgs2.js} +240 -100
- package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-DTxILHVv.cjs} +1 -1
- package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-YUAUFRqw.js} +4 -4
- package/dist/fileupload-D05VSbEP.cjs +402 -0
- package/dist/{fileupload-D5IQ9HDe.js → fileupload-E0LGGNgj.js} +370 -380
- package/dist/{footer-DbYQUYNR.cjs → footer-DBApIdGh.cjs} +32 -32
- package/dist/{footer-DrR64HiK.js → footer-DYilVBMC.js} +91 -91
- package/dist/format-B8meU8Tm.cjs +1 -0
- package/dist/format-BTeSVkED.js +18 -0
- package/dist/{header-ClgIac6n.cjs → header-B7tbX-Ok.cjs} +84 -84
- package/dist/{header-menu-BAsUNKSx.cjs → header-menu-1FFWhvNc.cjs} +24 -24
- package/dist/{header-menu-hVPXsb8g.js → header-menu-D522-VTV.js} +75 -75
- package/dist/{header-KvJ1mGwA.js → header-v3GWAzOK.js} +267 -264
- package/dist/{heading-CFmiSuCQ.cjs → heading-CvytvcL7.cjs} +1 -1
- package/dist/{heading-g-_IUB5T.js → heading-rx_oSCqe.js} +16 -16
- package/dist/helptext-DYFdcylX.cjs +27 -0
- package/dist/{helptext-DZng1D5i.js → helptext-LShGPm-b.js} +18 -19
- package/dist/{icon-9iwd2F2l.cjs → icon-BmMC09mi.cjs} +1 -1
- package/dist/{icon-D-LA22xD.js → icon-HYU1f54x.js} +17 -17
- package/dist/{if-defined-CGzIlZ9-.js → if-defined-BF8XcDi5.js} +1 -1
- package/dist/if-defined-CVYApOgK.cjs +1 -0
- package/dist/{input-element-DBMNBplu.js → input-element-D07DmR34.js} +121 -120
- package/dist/input-element-DumGj_oJ.cjs +1 -0
- package/dist/input-wrapper-Cci_wTvD.js +308 -0
- package/dist/input-wrapper-DDfapoRX.cjs +58 -0
- package/dist/{link-DK7gvmnj.cjs → link-11g2ZNin.cjs} +4 -4
- package/dist/{link-D-Eqm5KH.js → link-CQK0SH4H.js} +13 -13
- package/dist/{linkcard-zqbg7Oqm.js → linkcard-B4GlmjJ6.js} +16 -16
- package/dist/linkcard-DNYsVlV6.cjs +13 -0
- package/dist/{listbox-Dc4rGdPi.cjs → listbox-BlFRhyI7.cjs} +15 -15
- package/dist/{listbox-va_E8afs.js → listbox-wd_OofyF.js} +100 -99
- package/dist/{loader-D_RDICnw.js → loader-0C3qVk16.js} +14 -14
- package/dist/{loader-CMUkVJmE.cjs → loader-B9u2qUlR.cjs} +5 -5
- package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-BD5tGmT-.cjs} +5 -5
- package/dist/{messagebox-Cw-OWDya.js → messagebox-C-y1ICmr.js} +15 -15
- package/dist/{modal-BtInv031.cjs → modal-BzPGQYCs.cjs} +8 -8
- package/dist/{modal-D0t_X2dX.js → modal-Cghs3w-d.js} +20 -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-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 -34
- 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-C5EBX2T0.cjs → pkt-options-controller-CEEAqXaB.cjs} +1 -1
- package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-PtjhmTGk.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-CbcfLerF.js → progressbar-BexQQw1o.js} +21 -21
- package/dist/{progressbar-D5MmnQId.cjs → progressbar-X9mSvpjw.cjs} +5 -5
- package/dist/{radiobutton-BUnf3EPi.js → radiobutton-CkhTasn4.js} +24 -24
- package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-ln29Ad3U.cjs} +8 -8
- package/dist/{ref-CQoEIIp0.cjs → ref-CHbJYtKE.cjs} +1 -1
- package/dist/{ref-CWD6PjVd.js → ref-Chc_DZAb.js} +2 -2
- package/dist/{repeat-sY6B7fAT.cjs → repeat-CHDs__rN.cjs} +1 -1
- package/dist/{repeat-C02g7d5S.js → repeat-P9SMlKd5.js} +4 -4
- package/dist/searchinput-CPgMEAZZ.cjs +60 -0
- package/dist/{searchinput-DwnjsvJ1.js → searchinput-Da7dKHBH.js} +43 -43
- package/dist/{select-BOJi6H6T.cjs → select-DCuvdAuK.cjs} +4 -3
- package/dist/{select-DMre80qs.js → select-jabMSjft.js} +21 -20
- package/dist/shared-strings/consent.d.ts +71 -0
- package/dist/shared-strings/format.d.ts +21 -0
- package/dist/shared-strings/index.d.ts +14 -0
- package/dist/shared-strings/nb.d.ts +118 -0
- package/dist/shared-strings/resolve.d.ts +12 -0
- package/dist/shared-strings/store.d.ts +27 -0
- package/dist/shared-strings/types.d.ts +29 -0
- package/dist/shared-types/fileupload.d.ts +0 -27
- package/dist/shared-types/index.d.ts +1 -2
- package/dist/shared-utils/combobox/index.d.ts +1 -0
- package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/messages.d.ts +7 -0
- package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
- package/dist/{tabs-Cf9ai0FD.cjs → tabs-DV5CQNDL.cjs} +7 -7
- package/dist/{tabs-TvxgbrCF.js → tabs-D_hoi1zu.js} +32 -32
- package/dist/tag-BxYulmZn.cjs +27 -0
- package/dist/{tag-Ds6n1LIs.js → tag-DK5SgKry.js} +33 -32
- package/dist/tests/strings-override.test.d.ts +0 -0
- package/dist/{textarea-vfzIcXhX.js → textarea-BR7Riace.js} +30 -29
- package/dist/{textarea-BydiLM9Z.cjs → textarea-ffBD_VHq.cjs} +3 -2
- package/dist/{textinput-CMP2jPP_.js → textinput-CRNrsRNV.js} +28 -27
- package/dist/{textinput-DGdicNSx.cjs → textinput-CtHFzAux.cjs} +13 -12
- package/dist/timepicker-AfgJipo6.cjs +196 -0
- package/dist/{timepicker-ClwgYywH.js → timepicker-ixs_E5RY.js} +67 -64
- package/package.json +3 -3
- package/src/components/backlink/backlink.ts +1 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +1 -1
- package/src/components/calendar/calendar.ts +56 -26
- package/src/components/checkbox/checkbox.test.ts +0 -2
- package/src/components/checkbox/checkbox.ts +8 -4
- package/src/components/combobox/combobox-base.ts +2 -1
- package/src/components/combobox/combobox-value.ts +10 -9
- package/src/components/combobox/combobox.selection.test.ts +5 -1
- package/src/components/combobox/combobox.ts +4 -1
- package/src/components/consent/strings.ts +1 -125
- package/src/components/datepicker/date-tags.ts +4 -1
- package/src/components/datepicker/datepicker-base.ts +2 -6
- package/src/components/datepicker/datepicker-multiple.ts +0 -3
- package/src/components/datepicker/datepicker-range.ts +4 -7
- package/src/components/datepicker/datepicker-single.ts +0 -3
- package/src/components/datepicker/datepicker-utils.test.ts +5 -5
- package/src/components/datepicker/datepicker-utils.ts +6 -11
- package/src/components/datepicker/datepicker.ts +8 -1
- package/src/components/fileupload/fileupload-base.ts +25 -16
- package/src/components/fileupload/fileupload-renderers.ts +2 -1
- package/src/components/fileupload/fileupload.test.ts +16 -0
- package/src/components/fileupload/fileupload.ts +19 -15
- package/src/components/header/header-global.ts +3 -3
- package/src/components/header/header-service.ts +13 -8
- package/src/components/header/header.ts +2 -1
- package/src/components/helptext/helptext.test.ts +1 -1
- package/src/components/helptext/helptext.ts +3 -3
- package/src/components/index.ts +9 -0
- package/src/components/input-wrapper/input-wrapper.ts +18 -10
- package/src/components/listbox/listbox.ts +3 -3
- package/src/components/radiobutton/radiobutton.ts +8 -4
- package/src/components/searchinput/searchinput.ts +5 -3
- package/src/components/select/select.ts +1 -0
- package/src/components/tag/tag.ts +2 -1
- package/src/components/textarea/textarea.ts +1 -0
- package/src/components/textinput/textinput.ts +1 -0
- package/src/components/timepicker/timepicker.ts +23 -21
- package/dist/element-BA8v6S7z.cjs +0 -2
- package/dist/fileupload-BeWiTAoW.cjs +0 -401
- package/dist/helptext-CTtKJcML.cjs +0 -27
- package/dist/if-defined-B89_ZeCj.cjs +0 -1
- package/dist/input-element-DYmQw-fH.cjs +0 -1
- package/dist/input-wrapper-BmxNvznr.js +0 -128
- package/dist/input-wrapper-D-fPaTbY.js +0 -176
- package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
- package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
- package/dist/linkcard-B29cmZqh.cjs +0 -13
- package/dist/searchinput-Bh975rjX.cjs +0 -60
- package/dist/tag-CzojNU7z.cjs +0 -27
- package/dist/timepicker-DYrnLHqN.cjs +0 -195
- package/dist/translations/no.json.d.ts +0 -94
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import { n as c, t as l } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as u } from "./if-defined-
|
|
6
|
-
import "./button-
|
|
7
|
-
import { n as d, t as f } from "./ref-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-BKSPVgs2.js";
|
|
2
|
+
import { t as s } from "./class-map-F1DJHyb7.js";
|
|
3
|
+
import { n as c, t as l } from "./element-with-slot-YUAUFRqw.js";
|
|
4
|
+
import "./icon-HYU1f54x.js";
|
|
5
|
+
import { t as u } from "./if-defined-BF8XcDi5.js";
|
|
6
|
+
import "./button-C44vNLFC.js";
|
|
7
|
+
import { n as d, t as f } from "./ref-Chc_DZAb.js";
|
|
8
8
|
import { t as p } from "./booleanish-OQJTYSrw.js";
|
|
9
9
|
import { n as m, o as h, t as g } from "./fetch-header-footer-data-Pc32etrk.js";
|
|
10
10
|
import { n as _, t as v } from "./focus-trap-DG3pEuyJ.js";
|
|
11
11
|
import { n as y, t as b } from "./scroll-lock-DAbNKAUy.js";
|
|
12
|
-
import "./link-
|
|
13
|
-
import "./textinput-
|
|
14
|
-
import "./searchinput-
|
|
15
|
-
import "./header-menu-
|
|
12
|
+
import "./link-CQK0SH4H.js";
|
|
13
|
+
import "./textinput-CRNrsRNV.js";
|
|
14
|
+
import "./searchinput-Da7dKHBH.js";
|
|
15
|
+
import "./header-menu-D522-VTV.js";
|
|
16
16
|
//#region ../../shared-types/header.ts
|
|
17
17
|
var x = (e) => typeof e.target == "string" ? {
|
|
18
18
|
title: e.title,
|
|
@@ -69,7 +69,7 @@ var x = (e) => typeof e.target == "string" ? {
|
|
|
69
69
|
restoreFocus() {
|
|
70
70
|
this.shouldRestoreFocus && this.lastFocusedElement && document.contains(this.lastFocusedElement) && this.lastFocusedElement.focus(), this.lastFocusedElement = null, this.shouldRestoreFocus = !1;
|
|
71
71
|
}
|
|
72
|
-
}, T = class extends
|
|
72
|
+
}, T = class extends a {
|
|
73
73
|
constructor(...e) {
|
|
74
74
|
super(...e), this.canChangeRepresentation = !1, this.logoutOnClick = !1;
|
|
75
75
|
}
|
|
@@ -88,74 +88,74 @@ var x = (e) => typeof e.target == "string" ? {
|
|
|
88
88
|
handleMenuItemClick(e) {
|
|
89
89
|
"onClick" in e && typeof e.onClick == "function" && e.onClick();
|
|
90
90
|
}
|
|
91
|
-
renderLinkOrButton(
|
|
92
|
-
let
|
|
91
|
+
renderLinkOrButton(t, r) {
|
|
92
|
+
let i = "href" in t, a = s({
|
|
93
93
|
"pkt-user-menu__link": !0,
|
|
94
|
-
"pkt-link-button": !
|
|
95
|
-
"pkt-link": !
|
|
96
|
-
"pkt-link--icon-left": !
|
|
97
|
-
[
|
|
94
|
+
"pkt-link-button": !i,
|
|
95
|
+
"pkt-link": !i,
|
|
96
|
+
"pkt-link--icon-left": !i,
|
|
97
|
+
[r || ""]: !!r
|
|
98
98
|
});
|
|
99
|
-
return
|
|
99
|
+
return i ? e`
|
|
100
100
|
<pkt-link
|
|
101
|
-
icon-name=${
|
|
102
|
-
href=${
|
|
103
|
-
class="pkt-user-menu__link ${
|
|
101
|
+
icon-name=${t.iconName || n}
|
|
102
|
+
href=${t.href}
|
|
103
|
+
class="pkt-user-menu__link ${r || ""}"
|
|
104
104
|
>
|
|
105
|
-
${
|
|
105
|
+
${t.title}
|
|
106
106
|
</pkt-link>
|
|
107
|
-
` :
|
|
108
|
-
<button class=${a} type="button" @click=${() => this.handleMenuItemClick(
|
|
109
|
-
${
|
|
110
|
-
name=${
|
|
107
|
+
` : e`
|
|
108
|
+
<button class=${a} type="button" @click=${() => this.handleMenuItemClick(t)}>
|
|
109
|
+
${t.iconName ? e`<pkt-icon
|
|
110
|
+
name=${t.iconName}
|
|
111
111
|
class="pkt-link__icon"
|
|
112
112
|
aria-hidden="true"
|
|
113
|
-
></pkt-icon>` :
|
|
114
|
-
${
|
|
113
|
+
></pkt-icon>` : n}
|
|
114
|
+
${t.title}
|
|
115
115
|
</button>
|
|
116
116
|
`;
|
|
117
117
|
}
|
|
118
|
-
renderLinkSection(
|
|
119
|
-
return
|
|
118
|
+
renderLinkSection(t) {
|
|
119
|
+
return e`
|
|
120
120
|
<ul class="pkt-user-menu__sublist">
|
|
121
|
-
${
|
|
122
|
-
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(
|
|
121
|
+
${t.map((t) => e`
|
|
122
|
+
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(t)}</li>
|
|
123
123
|
`)}
|
|
124
124
|
</ul>
|
|
125
125
|
`;
|
|
126
126
|
}
|
|
127
127
|
render() {
|
|
128
|
-
let
|
|
129
|
-
return
|
|
128
|
+
let t = this.userMenu?.map(S);
|
|
129
|
+
return e`
|
|
130
130
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
131
131
|
<ul class="pkt-user-menu__list">
|
|
132
132
|
<!-- User section -->
|
|
133
|
-
${this.user ?
|
|
133
|
+
${this.user ? e`
|
|
134
134
|
<li class="pkt-user-menu__item">
|
|
135
135
|
<div class="pkt-user-menu__label">Pålogget som</div>
|
|
136
136
|
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
137
|
-
${this.formattedLastLoggedIn ?
|
|
137
|
+
${this.formattedLastLoggedIn ? e`
|
|
138
138
|
<div class="pkt-user-menu__last-logged-in">
|
|
139
139
|
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
140
140
|
</div>
|
|
141
|
-
` :
|
|
141
|
+
` : n}
|
|
142
142
|
</li>
|
|
143
|
-
` :
|
|
143
|
+
` : n}
|
|
144
144
|
|
|
145
145
|
<!-- User menu items -->
|
|
146
|
-
${
|
|
147
|
-
<li class="pkt-user-menu__item">${this.renderLinkSection(
|
|
148
|
-
` :
|
|
146
|
+
${t && t.length > 0 ? e`
|
|
147
|
+
<li class="pkt-user-menu__item">${this.renderLinkSection(t)}</li>
|
|
148
|
+
` : n}
|
|
149
149
|
|
|
150
150
|
<!-- Representing section -->
|
|
151
|
-
${this.representing ?
|
|
151
|
+
${this.representing ? e`
|
|
152
152
|
<li class="pkt-user-menu__item">
|
|
153
153
|
<div class="pkt-user-menu__label">Representerer</div>
|
|
154
154
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
155
|
-
${this.representing.orgNumber ?
|
|
155
|
+
${this.representing.orgNumber ? e`<div class="pkt-user-menu__org-number">
|
|
156
156
|
Org.nr. ${this.representing.orgNumber}
|
|
157
|
-
</div>` :
|
|
158
|
-
${this.canChangeRepresentation ?
|
|
157
|
+
</div>` : n}
|
|
158
|
+
${this.canChangeRepresentation ? e`
|
|
159
159
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
160
160
|
<li class="pkt-user-menu__subitem">
|
|
161
161
|
${this.renderLinkOrButton({
|
|
@@ -165,12 +165,12 @@ var x = (e) => typeof e.target == "string" ? {
|
|
|
165
165
|
})}
|
|
166
166
|
</li>
|
|
167
167
|
</ul>
|
|
168
|
-
` :
|
|
168
|
+
` : n}
|
|
169
169
|
</li>
|
|
170
|
-
` :
|
|
170
|
+
` : n}
|
|
171
171
|
|
|
172
172
|
<!-- Change representation without representing object -->
|
|
173
|
-
${!this.representing && this.canChangeRepresentation ?
|
|
173
|
+
${!this.representing && this.canChangeRepresentation ? e`
|
|
174
174
|
<li class="pkt-user-menu__item">
|
|
175
175
|
<ul class="pkt-user-menu__sublist">
|
|
176
176
|
<li class="pkt-user-menu__subitem">
|
|
@@ -182,10 +182,10 @@ var x = (e) => typeof e.target == "string" ? {
|
|
|
182
182
|
</li>
|
|
183
183
|
</ul>
|
|
184
184
|
</li>
|
|
185
|
-
` :
|
|
185
|
+
` : n}
|
|
186
186
|
|
|
187
187
|
<!-- Logout -->
|
|
188
|
-
${this.logoutOnClick ?
|
|
188
|
+
${this.logoutOnClick ? e`
|
|
189
189
|
<li class="pkt-user-menu__item">
|
|
190
190
|
${this.renderLinkOrButton({
|
|
191
191
|
title: "Logg ut",
|
|
@@ -193,29 +193,29 @@ var x = (e) => typeof e.target == "string" ? {
|
|
|
193
193
|
onClick: () => this.handleLogout()
|
|
194
194
|
})}
|
|
195
195
|
</li>
|
|
196
|
-
` :
|
|
196
|
+
` : n}
|
|
197
197
|
</ul>
|
|
198
198
|
</nav>
|
|
199
199
|
`;
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
|
-
|
|
202
|
+
i([o({ type: Object })], T.prototype, "user", void 0), i([o({
|
|
203
203
|
type: String,
|
|
204
204
|
attribute: "formatted-last-logged-in"
|
|
205
|
-
})], T.prototype, "formattedLastLoggedIn", void 0),
|
|
205
|
+
})], T.prototype, "formattedLastLoggedIn", void 0), i([o({ type: Object })], T.prototype, "representing", void 0), i([o({
|
|
206
206
|
type: Array,
|
|
207
207
|
attribute: "user-menu"
|
|
208
|
-
})], T.prototype, "userMenu", void 0),
|
|
208
|
+
})], T.prototype, "userMenu", void 0), i([o({
|
|
209
209
|
type: Boolean,
|
|
210
210
|
attribute: "can-change-representation",
|
|
211
211
|
converter: p
|
|
212
|
-
})], T.prototype, "canChangeRepresentation", void 0),
|
|
212
|
+
})], T.prototype, "canChangeRepresentation", void 0), i([o({
|
|
213
213
|
type: Boolean,
|
|
214
214
|
attribute: "logout-on-click",
|
|
215
215
|
converter: p
|
|
216
216
|
})], T.prototype, "logoutOnClick", void 0);
|
|
217
217
|
try {
|
|
218
|
-
|
|
218
|
+
t("pkt-header-user-menu")(T);
|
|
219
219
|
} catch {
|
|
220
220
|
console.warn("Forsøker å definere <pkt-header-user-menu>, men den er allerede definert");
|
|
221
221
|
}
|
|
@@ -225,7 +225,7 @@ var E = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
|
225
225
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || E);
|
|
226
226
|
var D = class extends l {
|
|
227
227
|
constructor(...e) {
|
|
228
|
-
super(...e), this.logoLink = h, this.logoPath = typeof window < "u" ? window.pktLogoPath : E, this.
|
|
228
|
+
super(...e), this.logoLink = h, this.logoPath = typeof window < "u" ? window.pktLogoPath : E, this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.openMenu = "none", this.alignSlotRight = !1, this.alignSearchRight = !1, this.headerRef = f(), this.userContainerRef = f(), this.slotContainerRef = f(), this.searchContainerRef = f(), this.slotContentRef = f(), this.searchMenuRef = f(), this.chrome = new w(this, () => ({
|
|
229
229
|
mobileBreakpoint: this.mobileBreakpoint,
|
|
230
230
|
tabletBreakpoint: this.tabletBreakpoint,
|
|
231
231
|
position: this.position,
|
|
@@ -346,21 +346,24 @@ var D = class extends l {
|
|
|
346
346
|
get showLogoutInUserMenu() {
|
|
347
347
|
return this.hasLogOut && (this.logOutButtonPlacement === "userMenu" || this.logOutButtonPlacement === "both");
|
|
348
348
|
}
|
|
349
|
+
get headerStrings() {
|
|
350
|
+
return this.pktStrings.get("header");
|
|
351
|
+
}
|
|
349
352
|
renderLogo() {
|
|
350
|
-
if (this.hideLogo) return
|
|
351
|
-
let
|
|
353
|
+
if (this.hideLogo) return n;
|
|
354
|
+
let t = e`
|
|
352
355
|
<pkt-icon name="oslologo" aria-hidden="true" path=${this.logoPath}></pkt-icon>
|
|
353
356
|
`;
|
|
354
|
-
return
|
|
357
|
+
return e`
|
|
355
358
|
<span class="pkt-header-service__logo">
|
|
356
359
|
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
357
|
-
${
|
|
360
|
+
${t}
|
|
358
361
|
</a>
|
|
359
362
|
</span>
|
|
360
363
|
`;
|
|
361
364
|
}
|
|
362
365
|
renderServiceName() {
|
|
363
|
-
return this.serviceName ? this.serviceLink && typeof this.serviceLink == "string" ?
|
|
366
|
+
return this.serviceName ? this.serviceLink && typeof this.serviceLink == "string" ? e`
|
|
364
367
|
<span class="pkt-header-service__service-name" translate="no">
|
|
365
368
|
<pkt-link
|
|
366
369
|
href=${this.serviceLink}
|
|
@@ -370,7 +373,7 @@ var D = class extends l {
|
|
|
370
373
|
${this.serviceName}
|
|
371
374
|
</pkt-link>
|
|
372
375
|
</span>
|
|
373
|
-
` : this.hasAttribute("service-link") ?
|
|
376
|
+
` : this.hasAttribute("service-link") ? e`
|
|
374
377
|
<span class="pkt-header-service__service-name" translate="no">
|
|
375
378
|
<button
|
|
376
379
|
class="pkt-link-button pkt-link pkt-header-service__service-link"
|
|
@@ -379,7 +382,7 @@ var D = class extends l {
|
|
|
379
382
|
${this.serviceName}
|
|
380
383
|
</button>
|
|
381
384
|
</span>
|
|
382
|
-
` :
|
|
385
|
+
` : e`
|
|
383
386
|
<span
|
|
384
387
|
class="pkt-header-service__service-name"
|
|
385
388
|
translate="no"
|
|
@@ -387,24 +390,24 @@ var D = class extends l {
|
|
|
387
390
|
>
|
|
388
391
|
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
389
392
|
</span>
|
|
390
|
-
` :
|
|
393
|
+
` : n;
|
|
391
394
|
}
|
|
392
395
|
renderSlotContainer() {
|
|
393
|
-
if (!this.hasSlotContent()) return
|
|
394
|
-
let
|
|
396
|
+
if (!this.hasSlotContent()) return n;
|
|
397
|
+
let t = s({
|
|
395
398
|
"pkt-header-service__slot-container": !0,
|
|
396
399
|
"is-open": this.openMenu === "slot"
|
|
397
|
-
}),
|
|
400
|
+
}), r = s({
|
|
398
401
|
"pkt-header-service__slot-content": !0,
|
|
399
402
|
"align-right": this.alignSlotRight
|
|
400
403
|
});
|
|
401
|
-
return
|
|
404
|
+
return e`
|
|
402
405
|
<div
|
|
403
|
-
class=${
|
|
406
|
+
class=${t}
|
|
404
407
|
@focusout=${(e) => this.handleFocusOut(e, "slot")}
|
|
405
408
|
${d(this.slotContainerRef)}
|
|
406
409
|
>
|
|
407
|
-
${this.isTablet && this.hasSlotContent() ?
|
|
410
|
+
${this.isTablet && this.hasSlotContent() ? e`
|
|
408
411
|
<pkt-button
|
|
409
412
|
skin="secondary"
|
|
410
413
|
variant=${this.slotMenuVariant}
|
|
@@ -414,16 +417,16 @@ var D = class extends l {
|
|
|
414
417
|
@click=${() => this.handleMenuToggle("slot")}
|
|
415
418
|
aria-expanded=${this.openMenu === "slot"}
|
|
416
419
|
aria-controls="mobile-slot-menu"
|
|
417
|
-
aria-label
|
|
420
|
+
aria-label=${this.headerStrings.openMenu}
|
|
418
421
|
>
|
|
419
422
|
${this.slotMenuText}
|
|
420
423
|
</pkt-button>
|
|
421
|
-
` :
|
|
424
|
+
` : n}
|
|
422
425
|
<div
|
|
423
|
-
class=${
|
|
426
|
+
class=${r}
|
|
424
427
|
id="mobile-slot-menu"
|
|
425
|
-
role=${this.isTablet ? "group" :
|
|
426
|
-
aria-label=${this.isTablet ? "Meny" :
|
|
428
|
+
role=${this.isTablet ? "group" : n}
|
|
429
|
+
aria-label=${this.isTablet ? "Meny" : n}
|
|
427
430
|
@click=${this.handleSlotContentClick}
|
|
428
431
|
${d(this.slotContentRef)}
|
|
429
432
|
>
|
|
@@ -433,19 +436,19 @@ var D = class extends l {
|
|
|
433
436
|
`;
|
|
434
437
|
}
|
|
435
438
|
renderSearch() {
|
|
436
|
-
if (!this.showSearch) return
|
|
439
|
+
if (!this.showSearch) return n;
|
|
437
440
|
if (this.isTablet) {
|
|
438
|
-
let
|
|
441
|
+
let t = s({
|
|
439
442
|
"pkt-header-service__search-container": !0,
|
|
440
443
|
"is-open": this.openMenu === "search"
|
|
441
|
-
}),
|
|
444
|
+
}), r = s({
|
|
442
445
|
"pkt-header-service__mobile-menu": !0,
|
|
443
446
|
"is-open": this.openMenu === "search",
|
|
444
447
|
"align-right": this.alignSearchRight
|
|
445
448
|
});
|
|
446
|
-
return
|
|
449
|
+
return e`
|
|
447
450
|
<div
|
|
448
|
-
class=${
|
|
451
|
+
class=${t}
|
|
449
452
|
@focusout=${(e) => this.handleFocusOut(e, "search")}
|
|
450
453
|
${d(this.searchContainerRef)}
|
|
451
454
|
>
|
|
@@ -458,19 +461,19 @@ var D = class extends l {
|
|
|
458
461
|
state=${this.openMenu === "search" ? "active" : "normal"}
|
|
459
462
|
aria-expanded=${this.openMenu === "search"}
|
|
460
463
|
aria-controls="mobile-search-menu"
|
|
461
|
-
aria-label
|
|
464
|
+
aria-label=${this.headerStrings.openSearch}
|
|
462
465
|
>
|
|
463
|
-
|
|
466
|
+
${this.headerStrings.search}
|
|
464
467
|
</pkt-button>
|
|
465
|
-
<div class=${
|
|
466
|
-
${this.openMenu === "search" ?
|
|
468
|
+
<div class=${r} ${d(this.searchMenuRef)}>
|
|
469
|
+
${this.openMenu === "search" ? e`
|
|
467
470
|
<pkt-textinput
|
|
468
471
|
id="mobile-search-menu"
|
|
469
472
|
class="pkt-header-service__search-input"
|
|
470
473
|
type="search"
|
|
471
|
-
label
|
|
474
|
+
label=${this.headerStrings.search}
|
|
472
475
|
useWrapper="false"
|
|
473
|
-
placeholder=${this.searchPlaceholder}
|
|
476
|
+
placeholder=${this.searchPlaceholder ?? this.headerStrings.search}
|
|
474
477
|
value=${this.searchValue}
|
|
475
478
|
autofocus
|
|
476
479
|
fullwidth
|
|
@@ -479,19 +482,19 @@ var D = class extends l {
|
|
|
479
482
|
e.key === "Enter" && this.handleSearch(e.target.value);
|
|
480
483
|
}}
|
|
481
484
|
></pkt-textinput>
|
|
482
|
-
` :
|
|
485
|
+
` : n}
|
|
483
486
|
</div>
|
|
484
487
|
</div>
|
|
485
488
|
`;
|
|
486
489
|
}
|
|
487
|
-
return
|
|
490
|
+
return e`
|
|
488
491
|
<pkt-textinput
|
|
489
492
|
id="header-service-search"
|
|
490
493
|
class="pkt-header-service__search-input"
|
|
491
494
|
type="search"
|
|
492
|
-
label
|
|
495
|
+
label=${this.headerStrings.search}
|
|
493
496
|
useWrapper="false"
|
|
494
|
-
placeholder=${this.searchPlaceholder}
|
|
497
|
+
placeholder=${this.searchPlaceholder ?? this.headerStrings.search}
|
|
495
498
|
value=${this.searchValue}
|
|
496
499
|
@input=${this.handleSearchInputChange}
|
|
497
500
|
@keydown=${this.handleSearchKeyDown}
|
|
@@ -499,13 +502,13 @@ var D = class extends l {
|
|
|
499
502
|
`;
|
|
500
503
|
}
|
|
501
504
|
renderUserButton() {
|
|
502
|
-
if (!this.user) return
|
|
503
|
-
let
|
|
505
|
+
if (!this.user) return n;
|
|
506
|
+
let t = s({
|
|
504
507
|
"pkt-header-service__user-menu": this.isMobile === !1,
|
|
505
508
|
"pkt-header-service__mobile-menu": this.isMobile === !0,
|
|
506
509
|
"is-open": this.openMenu === "user"
|
|
507
510
|
});
|
|
508
|
-
return
|
|
511
|
+
return e`
|
|
509
512
|
<div
|
|
510
513
|
class="pkt-header-service__user-container"
|
|
511
514
|
@focusout=${(e) => this.handleFocusOut(e, "user")}
|
|
@@ -527,11 +530,11 @@ var D = class extends l {
|
|
|
527
530
|
<span class="pkt-sr-only">Brukermeny: </span>
|
|
528
531
|
<span translate="no">${this.representing?.name || this.user.name}</span>
|
|
529
532
|
</pkt-button>
|
|
530
|
-
${this.openMenu === "user" && this.user ?
|
|
531
|
-
<div class=${
|
|
533
|
+
${this.openMenu === "user" && this.user ? e`
|
|
534
|
+
<div class=${t}>
|
|
532
535
|
<pkt-header-user-menu
|
|
533
536
|
.user=${this.user}
|
|
534
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn ||
|
|
537
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn || n}
|
|
535
538
|
.representing=${this.representing}
|
|
536
539
|
.userMenu=${this.userMenu}
|
|
537
540
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -543,12 +546,12 @@ var D = class extends l {
|
|
|
543
546
|
@log-out=${this.handleLogout}
|
|
544
547
|
></pkt-header-user-menu>
|
|
545
548
|
</div>
|
|
546
|
-
` :
|
|
549
|
+
` : n}
|
|
547
550
|
</div>
|
|
548
551
|
`;
|
|
549
552
|
}
|
|
550
553
|
renderHeader() {
|
|
551
|
-
let
|
|
554
|
+
let t = s({
|
|
552
555
|
"pkt-header-service": !0,
|
|
553
556
|
"pkt-header-service--compact": this.compact,
|
|
554
557
|
"pkt-header-service--mobile": this.isMobile,
|
|
@@ -557,17 +560,17 @@ var D = class extends l {
|
|
|
557
560
|
"pkt-header-service--sticky": this.isSticky,
|
|
558
561
|
"pkt-header-service--scroll-to-hide": this.shouldHideOnScroll,
|
|
559
562
|
"pkt-header-service--hidden": this.isHidden
|
|
560
|
-
}),
|
|
563
|
+
}), r = s({
|
|
561
564
|
"pkt-header-service__logo-area": !0,
|
|
562
565
|
"pkt-header-service__logo-area--without-service": !this.serviceName
|
|
563
566
|
});
|
|
564
|
-
return
|
|
565
|
-
<header class=${
|
|
566
|
-
<div class=${
|
|
567
|
+
return e`
|
|
568
|
+
<header class=${t} ${d(this.headerRef)}>
|
|
569
|
+
<div class=${r}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
567
570
|
|
|
568
|
-
${this.hasSlotContent() || this.showSearch || this.showLogoutInHeader ?
|
|
571
|
+
${this.hasSlotContent() || this.showSearch || this.showLogoutInHeader ? e`<div class="pkt-header-service__content">
|
|
569
572
|
${this.renderSlotContainer()} ${this.renderSearch()}
|
|
570
|
-
${this.isTablet && this.showLogoutInHeader ?
|
|
573
|
+
${this.isTablet && this.showLogoutInHeader ? e`
|
|
571
574
|
<pkt-button
|
|
572
575
|
skin="secondary"
|
|
573
576
|
size=${this.isMobile ? "small" : "medium"}
|
|
@@ -577,11 +580,11 @@ var D = class extends l {
|
|
|
577
580
|
>
|
|
578
581
|
Logg ut
|
|
579
582
|
</pkt-button>
|
|
580
|
-
` :
|
|
581
|
-
</div>` :
|
|
582
|
-
${this.user || !this.isTablet && this.showLogoutInHeader ?
|
|
583
|
+
` : n}
|
|
584
|
+
</div>` : n}
|
|
585
|
+
${this.user || !this.isTablet && this.showLogoutInHeader ? e`<div class="pkt-header-service__user">
|
|
583
586
|
${this.renderUserButton()}
|
|
584
|
-
${!this.isTablet && this.showLogoutInHeader ?
|
|
587
|
+
${!this.isTablet && this.showLogoutInHeader ? e`
|
|
585
588
|
<pkt-button
|
|
586
589
|
skin="tertiary"
|
|
587
590
|
size="medium"
|
|
@@ -591,95 +594,95 @@ var D = class extends l {
|
|
|
591
594
|
>
|
|
592
595
|
Logg ut
|
|
593
596
|
</pkt-button>
|
|
594
|
-
` :
|
|
595
|
-
</div>` :
|
|
597
|
+
` : n}
|
|
598
|
+
</div>` : n}
|
|
596
599
|
</header>
|
|
597
600
|
`;
|
|
598
601
|
}
|
|
599
602
|
render() {
|
|
600
|
-
let
|
|
603
|
+
let t = this.renderHeader();
|
|
601
604
|
if (this.isFixed) {
|
|
602
|
-
let
|
|
605
|
+
let n = s({
|
|
603
606
|
"pkt-header-service-spacer": !0,
|
|
604
607
|
"pkt-header-service-spacer--compact": this.compact,
|
|
605
608
|
"pkt-header-service-spacer--has-user": !!this.user,
|
|
606
609
|
"pkt-header-service-spacer--mobile": this.isMobile,
|
|
607
610
|
"pkt-header-service-spacer--tablet": this.isTablet
|
|
608
611
|
});
|
|
609
|
-
return
|
|
612
|
+
return e`
|
|
610
613
|
<div class="pkt-header-service-wrapper">
|
|
611
|
-
${
|
|
612
|
-
<div class=${
|
|
614
|
+
${t}
|
|
615
|
+
<div class=${n}></div>
|
|
613
616
|
</div>
|
|
614
617
|
`;
|
|
615
618
|
}
|
|
616
|
-
return
|
|
619
|
+
return t;
|
|
617
620
|
}
|
|
618
621
|
};
|
|
619
|
-
|
|
622
|
+
i([o({
|
|
620
623
|
type: String,
|
|
621
624
|
attribute: "service-name"
|
|
622
|
-
})], D.prototype, "serviceName", void 0),
|
|
625
|
+
})], D.prototype, "serviceName", void 0), i([o({
|
|
623
626
|
type: String,
|
|
624
627
|
attribute: "service-link"
|
|
625
|
-
})], D.prototype, "serviceLink", void 0),
|
|
628
|
+
})], D.prototype, "serviceLink", void 0), i([o({
|
|
626
629
|
type: String,
|
|
627
630
|
attribute: "logo-link"
|
|
628
|
-
})], D.prototype, "logoLink", void 0),
|
|
631
|
+
})], D.prototype, "logoLink", void 0), i([o({
|
|
629
632
|
type: String,
|
|
630
633
|
attribute: "logo-path"
|
|
631
|
-
})], D.prototype, "logoPath", void 0),
|
|
634
|
+
})], D.prototype, "logoPath", void 0), i([o({
|
|
632
635
|
type: String,
|
|
633
636
|
attribute: "search-placeholder"
|
|
634
|
-
})], D.prototype, "searchPlaceholder", void 0),
|
|
637
|
+
})], D.prototype, "searchPlaceholder", void 0), i([o({
|
|
635
638
|
type: String,
|
|
636
639
|
attribute: "search-value"
|
|
637
|
-
})], D.prototype, "searchValue", void 0),
|
|
640
|
+
})], D.prototype, "searchValue", void 0), i([o({
|
|
638
641
|
type: Number,
|
|
639
642
|
attribute: "mobile-breakpoint"
|
|
640
|
-
})], D.prototype, "mobileBreakpoint", void 0),
|
|
643
|
+
})], D.prototype, "mobileBreakpoint", void 0), i([o({
|
|
641
644
|
type: Number,
|
|
642
645
|
attribute: "tablet-breakpoint"
|
|
643
|
-
})], D.prototype, "tabletBreakpoint", void 0),
|
|
646
|
+
})], D.prototype, "tabletBreakpoint", void 0), i([o({
|
|
644
647
|
type: String,
|
|
645
648
|
attribute: "opened-menu"
|
|
646
|
-
})], D.prototype, "openedMenu", void 0),
|
|
649
|
+
})], D.prototype, "openedMenu", void 0), i([o({
|
|
647
650
|
type: String,
|
|
648
651
|
attribute: "log-out-button-placement"
|
|
649
|
-
})], D.prototype, "logOutButtonPlacement", void 0),
|
|
652
|
+
})], D.prototype, "logOutButtonPlacement", void 0), i([o({ type: String })], D.prototype, "position", void 0), i([o({
|
|
650
653
|
type: String,
|
|
651
654
|
attribute: "scroll-behavior"
|
|
652
|
-
})], D.prototype, "scrollBehavior", void 0),
|
|
655
|
+
})], D.prototype, "scrollBehavior", void 0), i([o({
|
|
653
656
|
type: String,
|
|
654
657
|
attribute: "slot-menu-variant"
|
|
655
|
-
})], D.prototype, "slotMenuVariant", void 0),
|
|
658
|
+
})], D.prototype, "slotMenuVariant", void 0), i([o({
|
|
656
659
|
type: String,
|
|
657
660
|
attribute: "slot-menu-text"
|
|
658
|
-
})], D.prototype, "slotMenuText", void 0),
|
|
661
|
+
})], D.prototype, "slotMenuText", void 0), i([o({
|
|
659
662
|
type: Boolean,
|
|
660
663
|
attribute: "hide-logo",
|
|
661
664
|
converter: p
|
|
662
|
-
})], D.prototype, "hideLogo", void 0),
|
|
665
|
+
})], D.prototype, "hideLogo", void 0), i([o({
|
|
663
666
|
type: Boolean,
|
|
664
667
|
converter: p
|
|
665
|
-
})], D.prototype, "compact", void 0),
|
|
668
|
+
})], D.prototype, "compact", void 0), i([o({
|
|
666
669
|
type: Boolean,
|
|
667
670
|
attribute: "show-search",
|
|
668
671
|
converter: p
|
|
669
|
-
})], D.prototype, "showSearch", void 0),
|
|
672
|
+
})], D.prototype, "showSearch", void 0), i([o({
|
|
670
673
|
type: Boolean,
|
|
671
674
|
attribute: "can-change-representation",
|
|
672
675
|
converter: p
|
|
673
|
-
})], D.prototype, "canChangeRepresentation", void 0),
|
|
676
|
+
})], D.prototype, "canChangeRepresentation", void 0), i([o({
|
|
674
677
|
type: Boolean,
|
|
675
678
|
attribute: "has-log-out",
|
|
676
679
|
converter: p
|
|
677
|
-
})], D.prototype, "hasLogOut", void 0),
|
|
680
|
+
})], D.prototype, "hasLogOut", void 0), i([o({ type: Object })], D.prototype, "user", void 0), i([o({
|
|
678
681
|
type: Array,
|
|
679
682
|
attribute: "user-menu"
|
|
680
|
-
})], D.prototype, "userMenu", void 0),
|
|
683
|
+
})], D.prototype, "userMenu", void 0), i([o({ type: Object })], D.prototype, "representing", void 0), i([r()], D.prototype, "openMenu", void 0), i([r()], D.prototype, "alignSlotRight", void 0), i([r()], D.prototype, "alignSearchRight", void 0);
|
|
681
684
|
try {
|
|
682
|
-
|
|
685
|
+
t("pkt-header-service")(D);
|
|
683
686
|
} catch {
|
|
684
687
|
console.warn("Forsøker å definere <pkt-header-service>, men den er allerede definert");
|
|
685
688
|
}
|
|
@@ -687,7 +690,7 @@ try {
|
|
|
687
690
|
//#region src/components/header/header-global.ts
|
|
688
691
|
var O = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
689
692
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || O);
|
|
690
|
-
var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-header-global-search-panel", M = "pkt-header-global-search-toggle", N = class extends
|
|
693
|
+
var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-header-global-search-panel", M = "pkt-header-global-search-toggle", N = class extends a {
|
|
691
694
|
constructor(...e) {
|
|
692
695
|
super(...e), this.locale = "nb-NO", this.logoLink = h, this.logoPath = typeof window < "u" ? window.pktLogoPath : O, this.position = "fixed", this.scrollBehavior = "hide", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1024, this.logOutButtonPlacement = "none", this.showSearch = !0, this.showContact = !0, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.openMenu = "none", this.loadError = !1, this.headerAnchor = {
|
|
693
696
|
top: 0,
|
|
@@ -848,42 +851,42 @@ var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-
|
|
|
848
851
|
}));
|
|
849
852
|
}
|
|
850
853
|
renderLogo() {
|
|
851
|
-
let
|
|
854
|
+
let t = e`
|
|
852
855
|
<pkt-icon name="oslologo" aria-hidden="true" path=${u(this.logoPath)}></pkt-icon>
|
|
853
856
|
`;
|
|
854
|
-
return
|
|
857
|
+
return e`
|
|
855
858
|
<span class="pkt-header-global__logo">
|
|
856
859
|
<a href=${this.logoLink} aria-label="Til hovedsiden" @click=${this.handleLogoClick}>
|
|
857
|
-
${
|
|
860
|
+
${t}
|
|
858
861
|
</a>
|
|
859
862
|
</span>
|
|
860
863
|
`;
|
|
861
864
|
}
|
|
862
|
-
renderSearch(
|
|
863
|
-
if (!this.showSearch) return
|
|
864
|
-
let
|
|
865
|
-
if (!
|
|
866
|
-
let
|
|
867
|
-
return
|
|
865
|
+
renderSearch(t) {
|
|
866
|
+
if (!this.showSearch) return n;
|
|
867
|
+
let r = t.search;
|
|
868
|
+
if (!r) return n;
|
|
869
|
+
let i = this.searchPlaceholder ?? r.input.placeholder;
|
|
870
|
+
return e`
|
|
868
871
|
<div class="pkt-header-global__search">
|
|
869
872
|
<pkt-searchinput
|
|
870
873
|
appearance="global"
|
|
871
874
|
input-size=${this.isTablet ? "small" : "medium"}
|
|
872
875
|
fullwidth
|
|
873
|
-
id=${
|
|
874
|
-
name=${u(
|
|
875
|
-
placeholder=${u(
|
|
876
|
-
aria-label=${u(
|
|
877
|
-
action=${
|
|
876
|
+
id=${r.input.id || "pkt-header-global-search"}
|
|
877
|
+
name=${u(r.input.name)}
|
|
878
|
+
placeholder=${u(i)}
|
|
879
|
+
aria-label=${u(t.i18n?.search)}
|
|
880
|
+
action=${r.endpoint}
|
|
878
881
|
method="get"
|
|
879
882
|
@pkt-search=${(e) => this.handleSearch(e.detail.value)}
|
|
880
883
|
></pkt-searchinput>
|
|
881
884
|
</div>
|
|
882
885
|
`;
|
|
883
886
|
}
|
|
884
|
-
renderContact(
|
|
885
|
-
if (!this.showContact || this.user) return
|
|
886
|
-
let
|
|
887
|
+
renderContact(t) {
|
|
888
|
+
if (!this.showContact || this.user) return n;
|
|
889
|
+
let r = t.header?.contact, i = s({
|
|
887
890
|
"pkt-header-global__contact": !0,
|
|
888
891
|
"pkt-btn": !0,
|
|
889
892
|
"pkt-btn--secondary": !0,
|
|
@@ -891,74 +894,74 @@ var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-
|
|
|
891
894
|
"pkt-btn--small": this.isMobile || this.isTablet,
|
|
892
895
|
"pkt-btn--medium": !this.isMobile && !this.isTablet
|
|
893
896
|
});
|
|
894
|
-
return
|
|
895
|
-
<a class=${
|
|
896
|
-
<span class="pkt-btn__text">${
|
|
897
|
+
return r ? e`
|
|
898
|
+
<a class=${i} href=${r.url}>
|
|
899
|
+
<span class="pkt-btn__text">${r.text}</span>
|
|
897
900
|
</a>
|
|
898
|
-
` :
|
|
901
|
+
` : n;
|
|
899
902
|
}
|
|
900
903
|
get isLoading() {
|
|
901
904
|
return !this.localeData && !this.loadError;
|
|
902
905
|
}
|
|
903
|
-
renderMenuToggle(
|
|
904
|
-
let
|
|
905
|
-
return
|
|
906
|
+
renderMenuToggle(t) {
|
|
907
|
+
let n = t?.i18n?.menu || this.pktStrings.get("header").menu, r = this.openMenu === "menu";
|
|
908
|
+
return e`
|
|
906
909
|
<pkt-button
|
|
907
910
|
id=${A}
|
|
908
911
|
class="pkt-header-global__menu-toggle"
|
|
909
912
|
skin=${this.isMobile ? "tertiary" : "secondary"}
|
|
910
913
|
variant=${this.isMobile ? "icon-only" : "icon-right"}
|
|
911
|
-
iconName=${
|
|
914
|
+
iconName=${r ? "close" : "menu"}
|
|
912
915
|
size=${this.isTablet ? "small" : "medium"}
|
|
913
|
-
state=${
|
|
914
|
-
aria-expanded=${
|
|
916
|
+
state=${r ? "active" : "normal"}
|
|
917
|
+
aria-expanded=${r}
|
|
915
918
|
aria-controls=${k}
|
|
916
919
|
?disabled=${this.isLoading}
|
|
917
920
|
@click=${() => this.toggleMenu("menu")}
|
|
918
921
|
>
|
|
919
|
-
${
|
|
922
|
+
${n}
|
|
920
923
|
</pkt-button>
|
|
921
924
|
`;
|
|
922
925
|
}
|
|
923
|
-
renderSearchToggle(
|
|
924
|
-
if (!this.showSearch || !
|
|
925
|
-
let
|
|
926
|
-
return
|
|
926
|
+
renderSearchToggle(t) {
|
|
927
|
+
if (!this.showSearch || !t.search) return n;
|
|
928
|
+
let r = this.openMenu === "search";
|
|
929
|
+
return e`
|
|
927
930
|
<pkt-button
|
|
928
931
|
id=${M}
|
|
929
932
|
class="pkt-header-global__search-toggle"
|
|
930
933
|
skin="primary"
|
|
931
|
-
color=${u(
|
|
934
|
+
color=${u(r ? void 0 : "yellow")}
|
|
932
935
|
variant="icon-only"
|
|
933
|
-
iconName=${
|
|
936
|
+
iconName=${r ? "close" : "magnifying-glass-big"}
|
|
934
937
|
size=${this.isMobile ? "small" : "medium"}
|
|
935
|
-
state=${
|
|
936
|
-
aria-expanded=${
|
|
938
|
+
state=${r ? "active" : "normal"}
|
|
939
|
+
aria-expanded=${r}
|
|
937
940
|
aria-controls=${j}
|
|
938
941
|
@click=${() => this.toggleMenu("search")}
|
|
939
942
|
>
|
|
940
|
-
${
|
|
943
|
+
${t.i18n?.search || this.pktStrings.get("header").search}
|
|
941
944
|
</pkt-button>
|
|
942
945
|
`;
|
|
943
946
|
}
|
|
944
|
-
renderSearchPanel(
|
|
945
|
-
let
|
|
946
|
-
if (this.openMenu !== "search" || !this.showSearch || !
|
|
947
|
-
let
|
|
947
|
+
renderSearchPanel(t) {
|
|
948
|
+
let r = t.search;
|
|
949
|
+
if (this.openMenu !== "search" || !this.showSearch || !r) return n;
|
|
950
|
+
let i = this.searchPlaceholder ?? r.input.placeholder, a = s({
|
|
948
951
|
"pkt-header-global__search-panel": !0,
|
|
949
952
|
[`pkt-header-global__search-panel--${this.overlayBreakpointClass}`]: !!this.overlayBreakpointClass
|
|
950
953
|
});
|
|
951
|
-
return
|
|
954
|
+
return e`
|
|
952
955
|
<div class=${a} id=${j} style=${this.overlayAnchorStyle}>
|
|
953
956
|
<div class="pkt-header-global__search-panel-inner">
|
|
954
957
|
<pkt-searchinput
|
|
955
958
|
appearance="global"
|
|
956
959
|
fullwidth
|
|
957
|
-
id=${
|
|
958
|
-
name=${u(
|
|
959
|
-
placeholder=${u(
|
|
960
|
-
aria-label=${u(
|
|
961
|
-
action=${
|
|
960
|
+
id=${r.input.id || "pkt-header-global-search"}
|
|
961
|
+
name=${u(r.input.name)}
|
|
962
|
+
placeholder=${u(i)}
|
|
963
|
+
aria-label=${u(t.i18n?.search || this.pktStrings.get("header").search)}
|
|
964
|
+
action=${r.endpoint}
|
|
962
965
|
method="get"
|
|
963
966
|
@pkt-search=${(e) => this.handleSearch(e.detail.value)}
|
|
964
967
|
></pkt-searchinput>
|
|
@@ -967,35 +970,35 @@ var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-
|
|
|
967
970
|
`;
|
|
968
971
|
}
|
|
969
972
|
renderUser() {
|
|
970
|
-
if (!this.user) return
|
|
971
|
-
let
|
|
973
|
+
if (!this.user) return n;
|
|
974
|
+
let t = this.openMenu === "user", r = s({
|
|
972
975
|
"pkt-header-global__user-menu": !0,
|
|
973
|
-
"is-open":
|
|
976
|
+
"is-open": t
|
|
974
977
|
});
|
|
975
|
-
return
|
|
978
|
+
return e`
|
|
976
979
|
<div class="pkt-header-global__user">
|
|
977
980
|
<div
|
|
978
|
-
class="pkt-header-global__user-container ${
|
|
981
|
+
class="pkt-header-global__user-container ${t ? "is-open" : ""}"
|
|
979
982
|
${d(this.userContainerRef)}
|
|
980
983
|
>
|
|
981
984
|
<pkt-button
|
|
982
985
|
class="pkt-header-global__user-button"
|
|
983
986
|
skin="secondary"
|
|
984
987
|
size=${this.isTablet ? "small" : "medium"}
|
|
985
|
-
state=${
|
|
988
|
+
state=${t ? "active" : "normal"}
|
|
986
989
|
variant="icons-right-and-left"
|
|
987
990
|
iconName="user"
|
|
988
|
-
secondIconName=${
|
|
991
|
+
secondIconName=${t ? "chevron-thin-up" : "chevron-thin-down"}
|
|
989
992
|
@click=${() => this.toggleMenu("user")}
|
|
990
993
|
>
|
|
991
994
|
<span class="pkt-sr-only">Brukermeny: </span>
|
|
992
995
|
<span translate="no">${this.representing?.name || this.user.name}</span>
|
|
993
996
|
</pkt-button>
|
|
994
|
-
${
|
|
995
|
-
<div class=${
|
|
997
|
+
${t ? e`
|
|
998
|
+
<div class=${r}>
|
|
996
999
|
<pkt-header-user-menu
|
|
997
1000
|
.user=${this.user}
|
|
998
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn ||
|
|
1001
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn || n}
|
|
999
1002
|
.representing=${this.representing}
|
|
1000
1003
|
.userMenu=${this.userMenu}
|
|
1001
1004
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -1004,7 +1007,7 @@ var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-
|
|
|
1004
1007
|
@log-out=${() => this.handleLogout()}
|
|
1005
1008
|
></pkt-header-user-menu>
|
|
1006
1009
|
</div>
|
|
1007
|
-
` :
|
|
1010
|
+
` : n}
|
|
1008
1011
|
</div>
|
|
1009
1012
|
</div>
|
|
1010
1013
|
`;
|
|
@@ -1013,26 +1016,26 @@ var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-
|
|
|
1013
1016
|
return this.isMobile ? "mobile" : this.isTablet ? "tablet" : "";
|
|
1014
1017
|
}
|
|
1015
1018
|
renderMenu() {
|
|
1016
|
-
if (this.openMenu !== "menu") return
|
|
1017
|
-
let
|
|
1019
|
+
if (this.openMenu !== "menu") return n;
|
|
1020
|
+
let t = s({
|
|
1018
1021
|
"pkt-header-global__menu": !0,
|
|
1019
1022
|
[`pkt-header-global__menu--${this.overlayBreakpointClass}`]: !!this.overlayBreakpointClass
|
|
1020
1023
|
});
|
|
1021
|
-
return
|
|
1024
|
+
return e`
|
|
1022
1025
|
<div
|
|
1023
|
-
class=${
|
|
1026
|
+
class=${t}
|
|
1024
1027
|
id=${k}
|
|
1025
1028
|
style=${this.overlayAnchorStyle}
|
|
1026
1029
|
${d(this.menuContainerRef)}
|
|
1027
1030
|
>
|
|
1028
|
-
${this.localeData ?
|
|
1031
|
+
${this.localeData ? e`
|
|
1029
1032
|
<pkt-header-menu
|
|
1030
1033
|
.data=${this.effectiveData}
|
|
1031
1034
|
locale=${this.locale}
|
|
1032
1035
|
open
|
|
1033
1036
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
1034
1037
|
></pkt-header-menu>
|
|
1035
|
-
` :
|
|
1038
|
+
` : e`
|
|
1036
1039
|
<nav class="pkt-header-menu pkt-header-menu--open">
|
|
1037
1040
|
<p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
|
|
1038
1041
|
</nav>
|
|
@@ -1041,7 +1044,7 @@ var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-
|
|
|
1041
1044
|
`;
|
|
1042
1045
|
}
|
|
1043
1046
|
renderHeader() {
|
|
1044
|
-
let
|
|
1047
|
+
let t = s({
|
|
1045
1048
|
"pkt-header-global": !0,
|
|
1046
1049
|
"pkt-header-global--mobile": this.isMobile,
|
|
1047
1050
|
"pkt-header-global--tablet": this.isTablet,
|
|
@@ -1049,89 +1052,89 @@ var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-
|
|
|
1049
1052
|
"pkt-header-global--sticky": this.isSticky,
|
|
1050
1053
|
"pkt-header-global--scroll-to-hide": this.shouldHideOnScroll,
|
|
1051
1054
|
"pkt-header-global--hidden": this.isHidden
|
|
1052
|
-
}),
|
|
1053
|
-
return
|
|
1054
|
-
<header class=${
|
|
1055
|
+
}), r = this.localeData, i = this.isMobile;
|
|
1056
|
+
return e`
|
|
1057
|
+
<header class=${t} ${d(this.headerRef)}>
|
|
1055
1058
|
<div class="pkt-header-global__logo-area">${this.renderLogo()}</div>
|
|
1056
1059
|
<div class="pkt-header-global__content">
|
|
1057
|
-
${!
|
|
1058
|
-
${
|
|
1059
|
-
${this.renderMenuToggle(
|
|
1060
|
-
${!
|
|
1060
|
+
${!i && r ? this.renderSearch(r) : n}
|
|
1061
|
+
${i && r ? this.renderSearchToggle(r) : n}
|
|
1062
|
+
${this.renderMenuToggle(r)}
|
|
1063
|
+
${!i && r ? this.renderContact(r) : n}
|
|
1061
1064
|
</div>
|
|
1062
1065
|
${this.renderUser()}
|
|
1063
1066
|
</header>
|
|
1064
1067
|
`;
|
|
1065
1068
|
}
|
|
1066
1069
|
render() {
|
|
1067
|
-
let
|
|
1070
|
+
let t = this.renderHeader(), r = this.localeData, i = this.renderMenu(), a = r ? this.renderSearchPanel(r) : n;
|
|
1068
1071
|
if (this.isFixed) {
|
|
1069
|
-
let
|
|
1072
|
+
let n = s({
|
|
1070
1073
|
"pkt-header-global-spacer": !0,
|
|
1071
1074
|
"pkt-header-global-spacer--mobile": this.isMobile,
|
|
1072
1075
|
"pkt-header-global-spacer--tablet": this.isTablet && !this.isMobile,
|
|
1073
1076
|
"pkt-header-global-spacer--has-user": !!this.user
|
|
1074
1077
|
});
|
|
1075
|
-
return
|
|
1078
|
+
return e`
|
|
1076
1079
|
<div class="pkt-header-global-wrapper">
|
|
1077
|
-
${
|
|
1078
|
-
<div class=${
|
|
1079
|
-
${a}${
|
|
1080
|
+
${t}
|
|
1081
|
+
<div class=${n}></div>
|
|
1082
|
+
${a}${i}
|
|
1080
1083
|
</div>
|
|
1081
1084
|
`;
|
|
1082
1085
|
}
|
|
1083
|
-
return
|
|
1086
|
+
return e`${t}${a}${i}`;
|
|
1084
1087
|
}
|
|
1085
1088
|
};
|
|
1086
|
-
|
|
1089
|
+
i([o({
|
|
1087
1090
|
type: String,
|
|
1088
1091
|
attribute: "data-url"
|
|
1089
|
-
})], N.prototype, "dataUrl", void 0),
|
|
1092
|
+
})], N.prototype, "dataUrl", void 0), i([o({
|
|
1090
1093
|
type: Object,
|
|
1091
1094
|
attribute: !1
|
|
1092
|
-
})], N.prototype, "data", void 0),
|
|
1095
|
+
})], N.prototype, "data", void 0), i([o({ type: String })], N.prototype, "locale", void 0), i([o({
|
|
1093
1096
|
type: String,
|
|
1094
1097
|
attribute: "logo-link"
|
|
1095
|
-
})], N.prototype, "logoLink", void 0),
|
|
1098
|
+
})], N.prototype, "logoLink", void 0), i([o({
|
|
1096
1099
|
type: String,
|
|
1097
1100
|
attribute: "logo-path"
|
|
1098
|
-
})], N.prototype, "logoPath", void 0),
|
|
1101
|
+
})], N.prototype, "logoPath", void 0), i([o({
|
|
1099
1102
|
type: String,
|
|
1100
1103
|
attribute: "search-placeholder"
|
|
1101
|
-
})], N.prototype, "searchPlaceholder", void 0),
|
|
1104
|
+
})], N.prototype, "searchPlaceholder", void 0), i([o({ type: String })], N.prototype, "position", void 0), i([o({
|
|
1102
1105
|
type: String,
|
|
1103
1106
|
attribute: "scroll-behavior"
|
|
1104
|
-
})], N.prototype, "scrollBehavior", void 0),
|
|
1107
|
+
})], N.prototype, "scrollBehavior", void 0), i([o({
|
|
1105
1108
|
type: Number,
|
|
1106
1109
|
attribute: "mobile-breakpoint"
|
|
1107
|
-
})], N.prototype, "mobileBreakpoint", void 0),
|
|
1110
|
+
})], N.prototype, "mobileBreakpoint", void 0), i([o({
|
|
1108
1111
|
type: Number,
|
|
1109
1112
|
attribute: "tablet-breakpoint"
|
|
1110
|
-
})], N.prototype, "tabletBreakpoint", void 0),
|
|
1113
|
+
})], N.prototype, "tabletBreakpoint", void 0), i([o({
|
|
1111
1114
|
type: String,
|
|
1112
1115
|
attribute: "log-out-button-placement"
|
|
1113
|
-
})], N.prototype, "logOutButtonPlacement", void 0),
|
|
1116
|
+
})], N.prototype, "logOutButtonPlacement", void 0), i([o({
|
|
1114
1117
|
type: Boolean,
|
|
1115
1118
|
attribute: "show-search",
|
|
1116
1119
|
converter: p
|
|
1117
|
-
})], N.prototype, "showSearch", void 0),
|
|
1120
|
+
})], N.prototype, "showSearch", void 0), i([o({
|
|
1118
1121
|
type: Boolean,
|
|
1119
1122
|
attribute: "show-contact",
|
|
1120
1123
|
converter: p
|
|
1121
|
-
})], N.prototype, "showContact", void 0),
|
|
1124
|
+
})], N.prototype, "showContact", void 0), i([o({
|
|
1122
1125
|
type: Boolean,
|
|
1123
1126
|
attribute: "can-change-representation",
|
|
1124
1127
|
converter: p
|
|
1125
|
-
})], N.prototype, "canChangeRepresentation", void 0),
|
|
1128
|
+
})], N.prototype, "canChangeRepresentation", void 0), i([o({
|
|
1126
1129
|
type: Boolean,
|
|
1127
1130
|
attribute: "has-log-out",
|
|
1128
1131
|
converter: p
|
|
1129
|
-
})], N.prototype, "hasLogOut", void 0),
|
|
1132
|
+
})], N.prototype, "hasLogOut", void 0), i([o({ type: Object })], N.prototype, "user", void 0), i([o({
|
|
1130
1133
|
type: Array,
|
|
1131
1134
|
attribute: "user-menu"
|
|
1132
|
-
})], N.prototype, "userMenu", void 0),
|
|
1135
|
+
})], N.prototype, "userMenu", void 0), i([o({ type: Object })], N.prototype, "representing", void 0), i([r()], N.prototype, "openMenu", void 0), i([r()], N.prototype, "fetchedData", void 0), i([r()], N.prototype, "loadError", void 0), i([r()], N.prototype, "headerAnchor", void 0);
|
|
1133
1136
|
try {
|
|
1134
|
-
|
|
1137
|
+
t("pkt-header-global")(N);
|
|
1135
1138
|
} catch {
|
|
1136
1139
|
console.warn("Forsøker å definere <pkt-header-global>, men den er allerede definert");
|
|
1137
1140
|
}
|
|
@@ -1139,7 +1142,7 @@ try {
|
|
|
1139
1142
|
//#region src/components/header/header.ts
|
|
1140
1143
|
var P = class extends l {
|
|
1141
1144
|
constructor(...e) {
|
|
1142
|
-
super(...e), this.type = "service", this.
|
|
1145
|
+
super(...e), this.type = "service", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.showContact = !0;
|
|
1143
1146
|
}
|
|
1144
1147
|
firstUpdated(e) {
|
|
1145
1148
|
super.firstUpdated(e), this.emitDeprecationWarnings();
|
|
@@ -1156,7 +1159,7 @@ var P = class extends l {
|
|
|
1156
1159
|
] : this.userMenu;
|
|
1157
1160
|
}
|
|
1158
1161
|
renderGlobal() {
|
|
1159
|
-
return
|
|
1162
|
+
return e`
|
|
1160
1163
|
<pkt-header-global
|
|
1161
1164
|
data-url=${u(this.dataUrl)}
|
|
1162
1165
|
locale=${u(this.locale)}
|
|
@@ -1180,7 +1183,7 @@ var P = class extends l {
|
|
|
1180
1183
|
`;
|
|
1181
1184
|
}
|
|
1182
1185
|
render() {
|
|
1183
|
-
return this.type === "global" ? this.renderGlobal() :
|
|
1186
|
+
return this.type === "global" ? this.renderGlobal() : e`
|
|
1184
1187
|
<pkt-header-service
|
|
1185
1188
|
service-name=${u(this.serviceName)}
|
|
1186
1189
|
service-link=${u(this.serviceLink)}
|
|
@@ -1205,91 +1208,91 @@ var P = class extends l {
|
|
|
1205
1208
|
.userMenu=${this.effectiveUserMenu}
|
|
1206
1209
|
.representing=${this.representing}
|
|
1207
1210
|
>
|
|
1208
|
-
${this.hasSlotContent() ?
|
|
1211
|
+
${this.hasSlotContent() ? e`<div class="pkt-contents">${c(this)}</div>` : n}
|
|
1209
1212
|
</pkt-header-service>
|
|
1210
1213
|
`;
|
|
1211
1214
|
}
|
|
1212
1215
|
};
|
|
1213
|
-
|
|
1216
|
+
i([o({ type: String })], P.prototype, "type", void 0), i([o({
|
|
1214
1217
|
type: String,
|
|
1215
1218
|
attribute: "service-name"
|
|
1216
|
-
})], P.prototype, "serviceName", void 0),
|
|
1219
|
+
})], P.prototype, "serviceName", void 0), i([o({
|
|
1217
1220
|
type: String,
|
|
1218
1221
|
attribute: "service-link"
|
|
1219
|
-
})], P.prototype, "serviceLink", void 0),
|
|
1222
|
+
})], P.prototype, "serviceLink", void 0), i([o({
|
|
1220
1223
|
type: String,
|
|
1221
1224
|
attribute: "logo-link"
|
|
1222
|
-
})], P.prototype, "logoLink", void 0),
|
|
1225
|
+
})], P.prototype, "logoLink", void 0), i([o({
|
|
1223
1226
|
type: String,
|
|
1224
1227
|
attribute: "logo-path"
|
|
1225
|
-
})], P.prototype, "logoPath", void 0),
|
|
1228
|
+
})], P.prototype, "logoPath", void 0), i([o({
|
|
1226
1229
|
type: String,
|
|
1227
1230
|
attribute: "search-placeholder"
|
|
1228
|
-
})], P.prototype, "searchPlaceholder", void 0),
|
|
1231
|
+
})], P.prototype, "searchPlaceholder", void 0), i([o({
|
|
1229
1232
|
type: String,
|
|
1230
1233
|
attribute: "search-value"
|
|
1231
|
-
})], P.prototype, "searchValue", void 0),
|
|
1234
|
+
})], P.prototype, "searchValue", void 0), i([o({
|
|
1232
1235
|
type: Number,
|
|
1233
1236
|
attribute: "mobile-breakpoint"
|
|
1234
|
-
})], P.prototype, "mobileBreakpoint", void 0),
|
|
1237
|
+
})], P.prototype, "mobileBreakpoint", void 0), i([o({
|
|
1235
1238
|
type: Number,
|
|
1236
1239
|
attribute: "tablet-breakpoint"
|
|
1237
|
-
})], P.prototype, "tabletBreakpoint", void 0),
|
|
1240
|
+
})], P.prototype, "tabletBreakpoint", void 0), i([o({
|
|
1238
1241
|
type: String,
|
|
1239
1242
|
attribute: "opened-menu"
|
|
1240
|
-
})], P.prototype, "openedMenu", void 0),
|
|
1243
|
+
})], P.prototype, "openedMenu", void 0), i([o({
|
|
1241
1244
|
type: String,
|
|
1242
1245
|
attribute: "log-out-button-placement"
|
|
1243
|
-
})], P.prototype, "logOutButtonPlacement", void 0),
|
|
1246
|
+
})], P.prototype, "logOutButtonPlacement", void 0), i([o({ type: String })], P.prototype, "position", void 0), i([o({
|
|
1244
1247
|
type: String,
|
|
1245
1248
|
attribute: "scroll-behavior"
|
|
1246
|
-
})], P.prototype, "scrollBehavior", void 0),
|
|
1249
|
+
})], P.prototype, "scrollBehavior", void 0), i([o({
|
|
1247
1250
|
type: String,
|
|
1248
1251
|
attribute: "slot-menu-variant"
|
|
1249
|
-
})], P.prototype, "slotMenuVariant", void 0),
|
|
1252
|
+
})], P.prototype, "slotMenuVariant", void 0), i([o({
|
|
1250
1253
|
type: String,
|
|
1251
1254
|
attribute: "slot-menu-text"
|
|
1252
|
-
})], P.prototype, "slotMenuText", void 0),
|
|
1255
|
+
})], P.prototype, "slotMenuText", void 0), i([o({
|
|
1253
1256
|
type: Boolean,
|
|
1254
1257
|
attribute: "hide-logo",
|
|
1255
1258
|
converter: p
|
|
1256
|
-
})], P.prototype, "hideLogo", void 0),
|
|
1259
|
+
})], P.prototype, "hideLogo", void 0), i([o({
|
|
1257
1260
|
type: Boolean,
|
|
1258
1261
|
converter: p
|
|
1259
|
-
})], P.prototype, "compact", void 0),
|
|
1262
|
+
})], P.prototype, "compact", void 0), i([o({
|
|
1260
1263
|
type: Boolean,
|
|
1261
1264
|
attribute: "show-search",
|
|
1262
1265
|
converter: p
|
|
1263
|
-
})], P.prototype, "showSearch", void 0),
|
|
1266
|
+
})], P.prototype, "showSearch", void 0), i([o({
|
|
1264
1267
|
type: Boolean,
|
|
1265
1268
|
attribute: "can-change-representation",
|
|
1266
1269
|
converter: p
|
|
1267
|
-
})], P.prototype, "canChangeRepresentation", void 0),
|
|
1270
|
+
})], P.prototype, "canChangeRepresentation", void 0), i([o({
|
|
1268
1271
|
type: Boolean,
|
|
1269
1272
|
attribute: "has-log-out",
|
|
1270
1273
|
converter: p
|
|
1271
|
-
})], P.prototype, "hasLogOut", void 0),
|
|
1274
|
+
})], P.prototype, "hasLogOut", void 0), i([o({ type: Object })], P.prototype, "user", void 0), i([o({
|
|
1272
1275
|
type: Array,
|
|
1273
1276
|
attribute: "user-menu"
|
|
1274
|
-
})], P.prototype, "userMenu", void 0),
|
|
1277
|
+
})], P.prototype, "userMenu", void 0), i([o({ type: Object })], P.prototype, "representing", void 0), i([o({
|
|
1275
1278
|
type: String,
|
|
1276
1279
|
attribute: "data-url"
|
|
1277
|
-
})], P.prototype, "dataUrl", void 0),
|
|
1280
|
+
})], P.prototype, "dataUrl", void 0), i([o({
|
|
1278
1281
|
type: Object,
|
|
1279
1282
|
attribute: !1
|
|
1280
|
-
})], P.prototype, "data", void 0),
|
|
1283
|
+
})], P.prototype, "data", void 0), i([o({ type: String })], P.prototype, "locale", void 0), i([o({
|
|
1281
1284
|
type: Boolean,
|
|
1282
1285
|
attribute: "show-contact",
|
|
1283
1286
|
converter: p
|
|
1284
|
-
})], P.prototype, "showContact", void 0),
|
|
1287
|
+
})], P.prototype, "showContact", void 0), i([o({
|
|
1285
1288
|
type: Array,
|
|
1286
1289
|
attribute: "user-menu-footer"
|
|
1287
|
-
})], P.prototype, "userMenuFooter", void 0),
|
|
1290
|
+
})], P.prototype, "userMenuFooter", void 0), i([o({
|
|
1288
1291
|
type: Array,
|
|
1289
1292
|
attribute: "user-options"
|
|
1290
1293
|
})], P.prototype, "userOptions", void 0);
|
|
1291
1294
|
try {
|
|
1292
|
-
|
|
1295
|
+
t("pkt-header")(P);
|
|
1293
1296
|
} catch {
|
|
1294
1297
|
console.warn("Forsøker å definere <pkt-header>, men den er allerede definert");
|
|
1295
1298
|
}
|