@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,465 @@
|
|
|
1
|
+
const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs"),n=require("./element-with-slot-BY7Jc-q8.cjs");require("./icon-B8PVq2O6.cjs");const r=require("./if-defined-DrwbxQOj.cjs");require("./button-gvDXtBMC.cjs");const i=require("./ref-DO7TzO4O.cjs"),a=require("./booleanish-B9Kf0nES.cjs"),o=require("./fetch-header-footer-data-xohWFmYC.cjs"),s=require("./focus-trap-DSv4Ifqm.cjs"),c=require("./scroll-lock-BN8lOhV5.cjs");require("./link-Geze7498.cjs"),require("./textinput-DqJbTglM.cjs"),require("./searchinput-DGjeN1YI.cjs"),require("./header-menu-BHqK4QA6.cjs");var l=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},u=e=>l(e),d=e=>{if(!e)return;let t=typeof e==`string`?new Date(e):e;if(!isNaN(t.getTime()))return t.toLocaleDateString(`nb-NO`,{day:`numeric`,month:`long`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})},f=class{constructor(e,t){this.isMobile=!1,this.isTablet=!1,this.isHidden=!1,this.pauseScrollHide=!1,this.componentWidth=typeof window<`u`?window.innerWidth:0,this.lastScrollPosition=0,this.scrollLockToken=c.t(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(this.getOptions().scrollBehavior!==`hide`||this.pauseScrollHide)return;let e=window.pageYOffset||document.documentElement.scrollTop;if(e<0||Math.abs(e-this.lastScrollPosition)<60)return;let t=e>this.lastScrollPosition;this.lastScrollPosition=e,t!==this.isHidden&&(this.isHidden=t,this.host.requestUpdate())},this.host=e,this.getOptions=t,e.addController(this)}hostConnected(){window.addEventListener(`scroll`,this.handleScroll)}hostDisconnected(){this.resizeObserver?.disconnect(),window.removeEventListener(`scroll`,this.handleScroll),c.n(this.scrollLockToken,!1)}observe(e){e&&(this.componentWidth=e.offsetWidth,this.refreshBreakpoints(),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)this.componentWidth=t.borderBoxSize&&t.borderBoxSize.length>0?t.borderBoxSize[0].inlineSize:t.contentRect.width,this.refreshBreakpoints()}),this.resizeObserver.observe(e))}refreshBreakpoints(){let{mobileBreakpoint:e,tabletBreakpoint:t}=this.getOptions(),n=this.componentWidth<e,r=this.componentWidth<t;(n!==this.isMobile||r!==this.isTablet)&&(this.isMobile=n,this.isTablet=r,this.host.requestUpdate())}setScrollLock(e){c.n(this.scrollLockToken,e)}captureFocus(){this.lastFocusedElement=document.activeElement}flagRestoreFocus(){this.shouldRestoreFocus=!0}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}},p=class extends e.t{constructor(...e){super(...e),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent(`change-representation`,{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleMenuItemClick(e){`onClick`in e&&typeof e.onClick==`function`&&e.onClick()}renderLinkOrButton(n,r){let i=`href`in n,a=t.t({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[r||``]:!!r});return i?e.p`
|
|
2
|
+
<pkt-link
|
|
3
|
+
icon-name=${n.iconName||e.d}
|
|
4
|
+
href=${n.href}
|
|
5
|
+
class="pkt-user-menu__link ${r||``}"
|
|
6
|
+
>
|
|
7
|
+
${n.title}
|
|
8
|
+
</pkt-link>
|
|
9
|
+
`:e.p`
|
|
10
|
+
<button class=${a} type="button" @click=${()=>this.handleMenuItemClick(n)}>
|
|
11
|
+
${n.iconName?e.p`<pkt-icon
|
|
12
|
+
name=${n.iconName}
|
|
13
|
+
class="pkt-link__icon"
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
></pkt-icon>`:e.d}
|
|
16
|
+
${n.title}
|
|
17
|
+
</button>
|
|
18
|
+
`}renderLinkSection(t){return e.p`
|
|
19
|
+
<ul class="pkt-user-menu__sublist">
|
|
20
|
+
${t.map(t=>e.p`
|
|
21
|
+
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(t)}</li>
|
|
22
|
+
`)}
|
|
23
|
+
</ul>
|
|
24
|
+
`}render(){let t=this.userMenu?.map(u);return e.p`
|
|
25
|
+
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
26
|
+
<ul class="pkt-user-menu__list">
|
|
27
|
+
<!-- User section -->
|
|
28
|
+
${this.user?e.p`
|
|
29
|
+
<li class="pkt-user-menu__item">
|
|
30
|
+
<div class="pkt-user-menu__label">Pålogget som</div>
|
|
31
|
+
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
32
|
+
${this.formattedLastLoggedIn?e.p`
|
|
33
|
+
<div class="pkt-user-menu__last-logged-in">
|
|
34
|
+
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
35
|
+
</div>
|
|
36
|
+
`:e.d}
|
|
37
|
+
</li>
|
|
38
|
+
`:e.d}
|
|
39
|
+
|
|
40
|
+
<!-- User menu items -->
|
|
41
|
+
${t&&t.length>0?e.p`
|
|
42
|
+
<li class="pkt-user-menu__item">${this.renderLinkSection(t)}</li>
|
|
43
|
+
`:e.d}
|
|
44
|
+
|
|
45
|
+
<!-- Representing section -->
|
|
46
|
+
${this.representing?e.p`
|
|
47
|
+
<li class="pkt-user-menu__item">
|
|
48
|
+
<div class="pkt-user-menu__label">Representerer</div>
|
|
49
|
+
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
50
|
+
${this.representing.orgNumber?e.p`<div class="pkt-user-menu__org-number">
|
|
51
|
+
Org.nr. ${this.representing.orgNumber}
|
|
52
|
+
</div>`:e.d}
|
|
53
|
+
${this.canChangeRepresentation?e.p`
|
|
54
|
+
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
55
|
+
<li class="pkt-user-menu__subitem">
|
|
56
|
+
${this.renderLinkOrButton({title:`Endre organisasjon`,iconName:`cogwheel`,onClick:()=>this.handleChangeRepresentation()})}
|
|
57
|
+
</li>
|
|
58
|
+
</ul>
|
|
59
|
+
`:e.d}
|
|
60
|
+
</li>
|
|
61
|
+
`:e.d}
|
|
62
|
+
|
|
63
|
+
<!-- Change representation without representing object -->
|
|
64
|
+
${!this.representing&&this.canChangeRepresentation?e.p`
|
|
65
|
+
<li class="pkt-user-menu__item">
|
|
66
|
+
<ul class="pkt-user-menu__sublist">
|
|
67
|
+
<li class="pkt-user-menu__subitem">
|
|
68
|
+
${this.renderLinkOrButton({title:`Endre organisasjon`,iconName:`cogwheel`,onClick:()=>this.handleChangeRepresentation()})}
|
|
69
|
+
</li>
|
|
70
|
+
</ul>
|
|
71
|
+
</li>
|
|
72
|
+
`:e.d}
|
|
73
|
+
|
|
74
|
+
<!-- Logout -->
|
|
75
|
+
${this.logoutOnClick?e.p`
|
|
76
|
+
<li class="pkt-user-menu__item">
|
|
77
|
+
${this.renderLinkOrButton({title:`Logg ut`,iconName:`exit`,onClick:()=>this.handleLogout()})}
|
|
78
|
+
</li>
|
|
79
|
+
`:e.d}
|
|
80
|
+
</ul>
|
|
81
|
+
</nav>
|
|
82
|
+
`}};e.n([e.o({type:Object})],p.prototype,`user`,void 0),e.n([e.o({type:String,attribute:`formatted-last-logged-in`})],p.prototype,`formattedLastLoggedIn`,void 0),e.n([e.o({type:Object})],p.prototype,`representing`,void 0),e.n([e.o({type:Array,attribute:`user-menu`})],p.prototype,`userMenu`,void 0),e.n([e.o({type:Boolean,attribute:`can-change-representation`,converter:a.t})],p.prototype,`canChangeRepresentation`,void 0),e.n([e.o({type:Boolean,attribute:`logout-on-click`,converter:a.t})],p.prototype,`logoutOnClick`,void 0);try{e.s(`pkt-header-user-menu`)(p)}catch{console.warn(`Forsøker å definere <pkt-header-user-menu>, men den er allerede definert`)}var m=`https://punkt-cdn.oslo.kommune.no/latest/logos/`;typeof window<`u`&&(window.pktLogoPath=window.pktLogoPath||m);var h=class extends n.t{constructor(...e){super(...e),this.logoLink=o.o,this.logoPath=typeof window<`u`?window.pktLogoPath:m,this.searchPlaceholder=`Søk`,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=i.t(),this.userContainerRef=i.t(),this.slotContainerRef=i.t(),this.searchContainerRef=i.t(),this.slotContentRef=i.t(),this.searchMenuRef=i.t(),this.chrome=new f(this,()=>({mobileBreakpoint:this.mobileBreakpoint,tabletBreakpoint:this.tabletBreakpoint,position:this.position,scrollBehavior:this.scrollBehavior})),this.handleClickOutside=e=>{let t=e.target;this.user&&this.openMenu===`user`&&!t.closest(`.pkt-header-service__user-container`)&&(this.openMenu=`none`),this.openMenu===`slot`&&!t.closest(`.pkt-header-service__slot-container`)&&(this.openMenu=`none`),this.openMenu===`search`&&!t.closest(`.pkt-header-service__search-container`)&&!t.closest(`.pkt-header-service__search-input`)&&(this.openMenu=`none`)},this.handleSlotContentClick=e=>{if(!this.isTablet||this.openMenu!==`slot`)return;let t=e.target.closest(`a[href], button, [role="link"], [role="button"], [role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]`);!t||!this.slotContentRef.value?.contains(t)||t.closest(`[data-pkt-header-keep-open]`)||t.disabled||t.getAttribute(`aria-disabled`)===`true`||(this.openMenu=`none`)},this.handleFocusOut=(e,t)=>{let n=e.relatedTarget,r;switch(t){case`user`:r=this.userContainerRef;break;case`slot`:r=this.slotContainerRef;break;case`search`:r=this.searchContainerRef;break;default:return}let i=r.value;i&&(!n||!i.contains(n))&&(this.openMenu=`none`)},this.handleEscapeKey=e=>{e.key===`Escape`&&this.openMenu!==`none`&&(e.preventDefault(),this.chrome.flagRestoreFocus(),this.openMenu=`none`)}}get isMobile(){return this.chrome.isMobile}get isTablet(){return this.chrome.isTablet}get isHidden(){return this.chrome.isHidden}firstUpdated(){this.chrome.observe(this.headerRef.value)}updated(e){if(super.updated(e),e.has(`openedMenu`)&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(e.has(`mobileBreakpoint`)||e.has(`tabletBreakpoint`))&&this.chrome.refreshBreakpoints(),e.has(`openMenu`)){let t=e.get(`openMenu`);this.openMenu!==`none`&&(t===`none`||t===void 0)?(document.addEventListener(`mousedown`,this.handleClickOutside),document.addEventListener(`keydown`,this.handleEscapeKey),(this.openMenu===`slot`||this.openMenu===`search`)&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu===`none`&&t!==`none`&&(document.removeEventListener(`mousedown`,this.handleClickOutside),document.removeEventListener(`keydown`,this.handleEscapeKey),this.chrome.restoreFocus())}this.chrome.setScrollLock((this.isFixed||this.isSticky)&&this.isMobile&&this.openMenu!==`none`)}checkDropdownAlignment(e){let t=e===`slot`?this.slotContainerRef:this.searchContainerRef,n=e===`slot`?this.slotContentRef:this.searchMenuRef;if(!t.value||!n.value||!this.isTablet||this.isMobile)return;let r=t.value.getBoundingClientRect(),i=n.value.offsetWidth,a=r.left+i>window.innerWidth;e===`slot`?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu===`none`?(this.chrome.captureFocus(),this.openMenu=e):this.openMenu=`none`}handleLogoClick(e){this.dispatchEvent(new CustomEvent(`logo-click`,{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent(`service-click`,{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent(`search`,{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent(`search-change`,{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){let t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key===`Enter`&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){return d(this.user?.lastLoggedIn)}get isFixed(){return this.position===`fixed`}get isSticky(){return this.position===`sticky`}get shouldHideOnScroll(){return this.scrollBehavior===`hide`}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement===`header`||this.logOutButtonPlacement===`both`)}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement===`userMenu`||this.logOutButtonPlacement===`both`)}renderLogo(){if(this.hideLogo)return e.d;let t=e.p`
|
|
83
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${this.logoPath}></pkt-icon>
|
|
84
|
+
`;return e.p`
|
|
85
|
+
<span class="pkt-header-service__logo">
|
|
86
|
+
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
87
|
+
${t}
|
|
88
|
+
</a>
|
|
89
|
+
</span>
|
|
90
|
+
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink==`string`?e.p`
|
|
91
|
+
<span class="pkt-header-service__service-name" translate="no">
|
|
92
|
+
<pkt-link
|
|
93
|
+
href=${this.serviceLink}
|
|
94
|
+
class="pkt-header-service__service-link"
|
|
95
|
+
@click=${this.handleServiceClick}
|
|
96
|
+
>
|
|
97
|
+
${this.serviceName}
|
|
98
|
+
</pkt-link>
|
|
99
|
+
</span>
|
|
100
|
+
`:this.hasAttribute(`service-link`)?e.p`
|
|
101
|
+
<span class="pkt-header-service__service-name" translate="no">
|
|
102
|
+
<button
|
|
103
|
+
class="pkt-link-button pkt-link pkt-header-service__service-link"
|
|
104
|
+
@click=${this.handleServiceClick}
|
|
105
|
+
>
|
|
106
|
+
${this.serviceName}
|
|
107
|
+
</button>
|
|
108
|
+
</span>
|
|
109
|
+
`:e.p`
|
|
110
|
+
<span
|
|
111
|
+
class="pkt-header-service__service-name"
|
|
112
|
+
translate="no"
|
|
113
|
+
@click=${this.handleServiceClick}
|
|
114
|
+
>
|
|
115
|
+
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
116
|
+
</span>
|
|
117
|
+
`:e.d}renderSlotContainer(){if(!this.hasSlotContent())return e.d;let r=t.t({"pkt-header-service__slot-container":!0,"is-open":this.openMenu===`slot`}),a=t.t({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return e.p`
|
|
118
|
+
<div
|
|
119
|
+
class=${r}
|
|
120
|
+
@focusout=${e=>this.handleFocusOut(e,`slot`)}
|
|
121
|
+
${i.n(this.slotContainerRef)}
|
|
122
|
+
>
|
|
123
|
+
${this.isTablet&&this.hasSlotContent()?e.p`
|
|
124
|
+
<pkt-button
|
|
125
|
+
skin="secondary"
|
|
126
|
+
variant=${this.slotMenuVariant}
|
|
127
|
+
iconName="menu"
|
|
128
|
+
size=${this.isMobile?`small`:`medium`}
|
|
129
|
+
state=${this.openMenu===`slot`?`active`:`normal`}
|
|
130
|
+
@click=${()=>this.handleMenuToggle(`slot`)}
|
|
131
|
+
aria-expanded=${this.openMenu===`slot`}
|
|
132
|
+
aria-controls="mobile-slot-menu"
|
|
133
|
+
aria-label="Åpne meny"
|
|
134
|
+
>
|
|
135
|
+
${this.slotMenuText}
|
|
136
|
+
</pkt-button>
|
|
137
|
+
`:e.d}
|
|
138
|
+
<div
|
|
139
|
+
class=${a}
|
|
140
|
+
id="mobile-slot-menu"
|
|
141
|
+
role=${this.isTablet?`group`:e.d}
|
|
142
|
+
aria-label=${this.isTablet?`Meny`:e.d}
|
|
143
|
+
@click=${this.handleSlotContentClick}
|
|
144
|
+
${i.n(this.slotContentRef)}
|
|
145
|
+
>
|
|
146
|
+
${n.n(this)}
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
`}renderSearch(){if(!this.showSearch)return e.d;if(this.isTablet){let n=t.t({"pkt-header-service__search-container":!0,"is-open":this.openMenu===`search`}),r=t.t({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu===`search`,"align-right":this.alignSearchRight});return e.p`
|
|
150
|
+
<div
|
|
151
|
+
class=${n}
|
|
152
|
+
@focusout=${e=>this.handleFocusOut(e,`search`)}
|
|
153
|
+
${i.n(this.searchContainerRef)}
|
|
154
|
+
>
|
|
155
|
+
<pkt-button
|
|
156
|
+
skin="secondary"
|
|
157
|
+
variant="icon-only"
|
|
158
|
+
iconName="magnifying-glass-big"
|
|
159
|
+
size=${this.isMobile?`small`:`medium`}
|
|
160
|
+
@click=${()=>this.handleMenuToggle(`search`)}
|
|
161
|
+
state=${this.openMenu===`search`?`active`:`normal`}
|
|
162
|
+
aria-expanded=${this.openMenu===`search`}
|
|
163
|
+
aria-controls="mobile-search-menu"
|
|
164
|
+
aria-label="Åpne søkefelt"
|
|
165
|
+
>
|
|
166
|
+
Søk
|
|
167
|
+
</pkt-button>
|
|
168
|
+
<div class=${r} ${i.n(this.searchMenuRef)}>
|
|
169
|
+
${this.openMenu===`search`?e.p`
|
|
170
|
+
<pkt-textinput
|
|
171
|
+
id="mobile-search-menu"
|
|
172
|
+
class="pkt-header-service__search-input"
|
|
173
|
+
type="search"
|
|
174
|
+
label="Søk"
|
|
175
|
+
useWrapper="false"
|
|
176
|
+
placeholder=${this.searchPlaceholder}
|
|
177
|
+
value=${this.searchValue}
|
|
178
|
+
autofocus
|
|
179
|
+
fullwidth
|
|
180
|
+
@input=${this.handleSearchInputChange}
|
|
181
|
+
@keydown=${e=>{e.key===`Enter`&&this.handleSearch(e.target.value)}}
|
|
182
|
+
></pkt-textinput>
|
|
183
|
+
`:e.d}
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
`}return e.p`
|
|
187
|
+
<pkt-textinput
|
|
188
|
+
id="header-service-search"
|
|
189
|
+
class="pkt-header-service__search-input"
|
|
190
|
+
type="search"
|
|
191
|
+
label="Søk"
|
|
192
|
+
useWrapper="false"
|
|
193
|
+
placeholder=${this.searchPlaceholder}
|
|
194
|
+
value=${this.searchValue}
|
|
195
|
+
@input=${this.handleSearchInputChange}
|
|
196
|
+
@keydown=${this.handleSearchKeyDown}
|
|
197
|
+
></pkt-textinput>
|
|
198
|
+
`}renderUserButton(){if(!this.user)return e.d;let n=t.t({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu===`user`});return e.p`
|
|
199
|
+
<div
|
|
200
|
+
class="pkt-header-service__user-container"
|
|
201
|
+
@focusout=${e=>this.handleFocusOut(e,`user`)}
|
|
202
|
+
${i.n(this.userContainerRef)}
|
|
203
|
+
>
|
|
204
|
+
<pkt-button
|
|
205
|
+
class=${t.t({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
|
|
206
|
+
skin="secondary"
|
|
207
|
+
size=${this.isMobile?`small`:`medium`}
|
|
208
|
+
state=${this.openMenu===`user`?`active`:`normal`}
|
|
209
|
+
variant="icons-right-and-left"
|
|
210
|
+
iconName="user"
|
|
211
|
+
secondIconName=${this.openMenu===`user`?`chevron-thin-up`:`chevron-thin-down`}
|
|
212
|
+
@click=${()=>this.handleMenuToggle(`user`)}
|
|
213
|
+
>
|
|
214
|
+
<span class="pkt-sr-only">Brukermeny: </span>
|
|
215
|
+
<span translate="no">${this.representing?.name||this.user.name}</span>
|
|
216
|
+
</pkt-button>
|
|
217
|
+
${this.openMenu===`user`&&this.user?e.p`
|
|
218
|
+
<div class=${n}>
|
|
219
|
+
<pkt-header-user-menu
|
|
220
|
+
.user=${this.user}
|
|
221
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||e.d}
|
|
222
|
+
.representing=${this.representing}
|
|
223
|
+
.userMenu=${this.userMenu}
|
|
224
|
+
?can-change-representation=${this.canChangeRepresentation}
|
|
225
|
+
?logout-on-click=${this.showLogoutInUserMenu}
|
|
226
|
+
@change-representation=${()=>this.dispatchEvent(new CustomEvent(`change-representation`,{bubbles:!0,composed:!0}))}
|
|
227
|
+
@log-out=${this.handleLogout}
|
|
228
|
+
></pkt-header-user-menu>
|
|
229
|
+
</div>
|
|
230
|
+
`:e.d}
|
|
231
|
+
</div>
|
|
232
|
+
`}renderHeader(){let n=t.t({"pkt-header-service":!0,"pkt-header-service--compact":this.compact,"pkt-header-service--mobile":this.isMobile,"pkt-header-service--tablet":this.isTablet,"pkt-header-service--fixed":this.isFixed,"pkt-header-service--sticky":this.isSticky,"pkt-header-service--scroll-to-hide":this.shouldHideOnScroll,"pkt-header-service--hidden":this.isHidden}),r=t.t({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return e.p`
|
|
233
|
+
<header class=${n} ${i.n(this.headerRef)}>
|
|
234
|
+
<div class=${r}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
235
|
+
|
|
236
|
+
${this.hasSlotContent()||this.showSearch||this.showLogoutInHeader?e.p`<div class="pkt-header-service__content">
|
|
237
|
+
${this.renderSlotContainer()} ${this.renderSearch()}
|
|
238
|
+
${this.isTablet&&this.showLogoutInHeader?e.p`
|
|
239
|
+
<pkt-button
|
|
240
|
+
skin="secondary"
|
|
241
|
+
size=${this.isMobile?`small`:`medium`}
|
|
242
|
+
variant="icon-only"
|
|
243
|
+
iconName="exit"
|
|
244
|
+
@click=${this.handleLogout}
|
|
245
|
+
>
|
|
246
|
+
Logg ut
|
|
247
|
+
</pkt-button>
|
|
248
|
+
`:e.d}
|
|
249
|
+
</div>`:e.d}
|
|
250
|
+
${this.user||!this.isTablet&&this.showLogoutInHeader?e.p`<div class="pkt-header-service__user">
|
|
251
|
+
${this.renderUserButton()}
|
|
252
|
+
${!this.isTablet&&this.showLogoutInHeader?e.p`
|
|
253
|
+
<pkt-button
|
|
254
|
+
skin="tertiary"
|
|
255
|
+
size="medium"
|
|
256
|
+
variant="icon-right"
|
|
257
|
+
iconName="exit"
|
|
258
|
+
@click=${this.handleLogout}
|
|
259
|
+
>
|
|
260
|
+
Logg ut
|
|
261
|
+
</pkt-button>
|
|
262
|
+
`:e.d}
|
|
263
|
+
</div>`:e.d}
|
|
264
|
+
</header>
|
|
265
|
+
`}render(){let n=this.renderHeader();return this.isFixed?e.p`
|
|
266
|
+
<div class="pkt-header-service-wrapper">
|
|
267
|
+
${n}
|
|
268
|
+
<div class=${t.t({"pkt-header-service-spacer":!0,"pkt-header-service-spacer--compact":this.compact,"pkt-header-service-spacer--has-user":!!this.user,"pkt-header-service-spacer--mobile":this.isMobile,"pkt-header-service-spacer--tablet":this.isTablet})}></div>
|
|
269
|
+
</div>
|
|
270
|
+
`:n}};e.n([e.o({type:String,attribute:`service-name`})],h.prototype,`serviceName`,void 0),e.n([e.o({type:String,attribute:`service-link`})],h.prototype,`serviceLink`,void 0),e.n([e.o({type:String,attribute:`logo-link`})],h.prototype,`logoLink`,void 0),e.n([e.o({type:String,attribute:`logo-path`})],h.prototype,`logoPath`,void 0),e.n([e.o({type:String,attribute:`search-placeholder`})],h.prototype,`searchPlaceholder`,void 0),e.n([e.o({type:String,attribute:`search-value`})],h.prototype,`searchValue`,void 0),e.n([e.o({type:Number,attribute:`mobile-breakpoint`})],h.prototype,`mobileBreakpoint`,void 0),e.n([e.o({type:Number,attribute:`tablet-breakpoint`})],h.prototype,`tabletBreakpoint`,void 0),e.n([e.o({type:String,attribute:`opened-menu`})],h.prototype,`openedMenu`,void 0),e.n([e.o({type:String,attribute:`log-out-button-placement`})],h.prototype,`logOutButtonPlacement`,void 0),e.n([e.o({type:String})],h.prototype,`position`,void 0),e.n([e.o({type:String,attribute:`scroll-behavior`})],h.prototype,`scrollBehavior`,void 0),e.n([e.o({type:String,attribute:`slot-menu-variant`})],h.prototype,`slotMenuVariant`,void 0),e.n([e.o({type:String,attribute:`slot-menu-text`})],h.prototype,`slotMenuText`,void 0),e.n([e.o({type:Boolean,attribute:`hide-logo`,converter:a.t})],h.prototype,`hideLogo`,void 0),e.n([e.o({type:Boolean,converter:a.t})],h.prototype,`compact`,void 0),e.n([e.o({type:Boolean,attribute:`show-search`,converter:a.t})],h.prototype,`showSearch`,void 0),e.n([e.o({type:Boolean,attribute:`can-change-representation`,converter:a.t})],h.prototype,`canChangeRepresentation`,void 0),e.n([e.o({type:Boolean,attribute:`has-log-out`,converter:a.t})],h.prototype,`hasLogOut`,void 0),e.n([e.o({type:Object})],h.prototype,`user`,void 0),e.n([e.o({type:Array,attribute:`user-menu`})],h.prototype,`userMenu`,void 0),e.n([e.o({type:Object})],h.prototype,`representing`,void 0),e.n([e.a()],h.prototype,`openMenu`,void 0),e.n([e.a()],h.prototype,`alignSlotRight`,void 0),e.n([e.a()],h.prototype,`alignSearchRight`,void 0);try{e.s(`pkt-header-service`)(h)}catch{console.warn(`Forsøker å definere <pkt-header-service>, men den er allerede definert`)}var g=`https://punkt-cdn.oslo.kommune.no/latest/logos/`;typeof window<`u`&&(window.pktLogoPath=window.pktLogoPath||g);var _=`pkt-header-global-menu`,v=`pkt-header-global-menu-toggle`,y=`pkt-header-global-search-panel`,b=`pkt-header-global-search-toggle`,x=class extends e.t{constructor(...e){super(...e),this.locale=`nb-NO`,this.logoLink=o.o,this.logoPath=typeof window<`u`?window.pktLogoPath:g,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={top:0,left:0,width:0},this.headerRef=i.t(),this.menuContainerRef=i.t(),this.userContainerRef=i.t(),this.chrome=new f(this,()=>({mobileBreakpoint:this.mobileBreakpoint,tabletBreakpoint:this.tabletBreakpoint,position:this.position,scrollBehavior:this.scrollBehavior})),this.handleClickOutside=e=>{let t=e.target;this.openMenu===`user`&&!t.closest(`.pkt-header-global__user-container`)&&!t.closest(`.pkt-header-global__user-menu`)&&(this.openMenu=`none`),this.openMenu===`menu`&&!t.closest(`.pkt-header-menu`)&&!t.closest(`#${v}`)&&(this.openMenu=`none`),this.openMenu===`search`&&!t.closest(`.pkt-header-global__search-panel-inner`)&&!t.closest(`#${b}`)&&(this.openMenu=`none`)},this.handleEscapeKey=e=>{e.key===`Escape`&&this.openMenu!==`none`&&(e.preventDefault(),this.chrome.flagRestoreFocus(),this.openMenu=`none`)},this.handleOverlayKeydown=e=>{if(e.key!==`Tab`)return;let t=this.activeOverlay;if(!t||!t.panel||!t.toggle)return;let{panel:n,toggle:r}=t,i=s.n(n),a=s.t();if(a&&r.contains(a)){!e.shiftKey&&i.length>0&&(e.preventDefault(),i[0].focus());return}if(i.length===0)return;let o=i[0],c=i[i.length-1],l=!e.shiftKey&&a===c,u=e.shiftKey&&a===o;(l||u)&&(e.preventDefault(),this.openMenu=`none`,this.focusToggle(r))},this.handleOverlayFocusIn=e=>{let t=this.activeOverlay;if(!t||!t.panel)return;let n=e.target;n&&(t.panel.contains(n)||t.toggle?.contains(n)||(this.openMenu=`none`))}}get isMobile(){return this.chrome.isMobile}get isTablet(){return this.chrome.isTablet}get isHidden(){return this.chrome.isHidden}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-header-global-host`),this.data?this.emitDataLoaded(this.data):this.loadData()}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort(),document.removeEventListener(`mousedown`,this.handleClickOutside),document.removeEventListener(`keydown`,this.handleEscapeKey),document.removeEventListener(`keydown`,this.handleOverlayKeydown),document.removeEventListener(`focusin`,this.handleOverlayFocusIn)}firstUpdated(){this.chrome.observe(this.headerRef.value)}willUpdate(e){if(super.willUpdate(e),this.openMenu===`menu`||this.openMenu===`search`){let e=this.headerRef.value?.getBoundingClientRect();e&&(this.headerAnchor={top:e.top,left:e.left,width:e.width})}}get overlayAnchorStyle(){let{top:e,left:t,width:n}=this.headerAnchor;return`--pkt-header-global-top: ${e}px; --pkt-header-global-left: ${t}px; --pkt-header-global-width: ${n}px`}updated(e){if(super.updated(e),(e.has(`mobileBreakpoint`)||e.has(`tabletBreakpoint`))&&this.chrome.refreshBreakpoints(),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData(),e.has(`data`)&&this.data&&this.emitDataLoaded(this.data),e.has(`openMenu`)){let t=e.get(`openMenu`);this.openMenu!==`none`&&(t===`none`||t===void 0)?(document.addEventListener(`mousedown`,this.handleClickOutside),document.addEventListener(`keydown`,this.handleEscapeKey)):this.openMenu===`none`&&t&&t!==`none`&&(document.removeEventListener(`mousedown`,this.handleClickOutside),document.removeEventListener(`keydown`,this.handleEscapeKey),this.chrome.restoreFocus());let n=t===`menu`||t===`search`,r=this.openMenu===`menu`||this.openMenu===`search`;r&&!n?(document.addEventListener(`keydown`,this.handleOverlayKeydown),document.addEventListener(`focusin`,this.handleOverlayFocusIn)):!r&&n&&(document.removeEventListener(`keydown`,this.handleOverlayKeydown),document.removeEventListener(`focusin`,this.handleOverlayFocusIn)),this.openMenu===`search`&&t!==`search`&&requestAnimationFrame(()=>{this.querySelector(`#${y} input`)?.focus()}),this.chrome.pauseScrollHide=this.openMenu!==`none`,this.chrome.setScrollLock(this.openMenu===`menu`||this.openMenu===`search`)}}async loadData(){this.abortController?.abort(),this.abortController=new AbortController,this.loadError=!1;try{let e=await o.t(this.dataUrl,this.abortController.signal);this.fetchedData=e,this.emitDataLoaded(e)}catch(e){if(e.name===`AbortError`)return;this.loadError=!0,this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}emitDataLoaded(e){this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:e},bubbles:!0,composed:!0}))}get effectiveData(){return this.data??this.fetchedData}get localeData(){return o.n(this.effectiveData,this.locale)}get shouldHideOnScroll(){return this.scrollBehavior===`hide`}get isFixed(){return this.position===`fixed`}get isSticky(){return this.position===`sticky`}toggleMenu(e){this.openMenu===e?this.openMenu=`none`:(this.chrome.captureFocus(),this.openMenu=e)}get activeOverlay(){return this.openMenu===`menu`?{panel:this.menuContainerRef.value??null,toggle:this.querySelector(`#${v}`)}:this.openMenu===`search`?{panel:this.querySelector(`#${y}`),toggle:this.querySelector(`#${b}`)}:null}focusToggle(e){(e?.querySelector(`button`)??e)?.focus()}handleSearch(e){this.dispatchEvent(new CustomEvent(`search`,{detail:{query:e},bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent(`change-representation`,{bubbles:!0,composed:!0}))}get formattedLastLoggedIn(){return d(this.user?.lastLoggedIn)}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement===`userMenu`||this.logOutButtonPlacement===`both`)}handleLogoClick(e){this.dispatchEvent(new CustomEvent(`logo-click`,{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}renderLogo(){let t=e.p`
|
|
271
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${r.t(this.logoPath)}></pkt-icon>
|
|
272
|
+
`;return e.p`
|
|
273
|
+
<span class="pkt-header-global__logo">
|
|
274
|
+
<a href=${this.logoLink} aria-label="Til hovedsiden" @click=${this.handleLogoClick}>
|
|
275
|
+
${t}
|
|
276
|
+
</a>
|
|
277
|
+
</span>
|
|
278
|
+
`}renderSearch(t){if(!this.showSearch)return e.d;let n=t.search;if(!n)return e.d;let i=this.searchPlaceholder??n.input.placeholder;return e.p`
|
|
279
|
+
<div class="pkt-header-global__search">
|
|
280
|
+
<pkt-searchinput
|
|
281
|
+
appearance="global"
|
|
282
|
+
input-size=${this.isTablet?`small`:`medium`}
|
|
283
|
+
fullwidth
|
|
284
|
+
id=${n.input.id||`pkt-header-global-search`}
|
|
285
|
+
name=${r.t(n.input.name)}
|
|
286
|
+
placeholder=${r.t(i)}
|
|
287
|
+
aria-label=${r.t(t.i18n?.search)}
|
|
288
|
+
action=${n.endpoint}
|
|
289
|
+
method="get"
|
|
290
|
+
@pkt-search=${e=>this.handleSearch(e.detail.value)}
|
|
291
|
+
></pkt-searchinput>
|
|
292
|
+
</div>
|
|
293
|
+
`}renderContact(n){if(!this.showContact||this.user)return e.d;let r=n.header?.contact,i=t.t({"pkt-header-global__contact":!0,"pkt-btn":!0,"pkt-btn--secondary":!0,"pkt-btn--label-only":!0,"pkt-btn--small":this.isMobile||this.isTablet,"pkt-btn--medium":!this.isMobile&&!this.isTablet});return r?e.p`
|
|
294
|
+
<a class=${i} href=${r.url}>
|
|
295
|
+
<span class="pkt-btn__text">${r.text}</span>
|
|
296
|
+
</a>
|
|
297
|
+
`:e.d}get isLoading(){return!this.localeData&&!this.loadError}renderMenuToggle(t){let n=t?.i18n?.menu||`Meny`,r=this.openMenu===`menu`;return e.p`
|
|
298
|
+
<pkt-button
|
|
299
|
+
id=${v}
|
|
300
|
+
class="pkt-header-global__menu-toggle"
|
|
301
|
+
skin=${this.isMobile?`tertiary`:`secondary`}
|
|
302
|
+
variant=${this.isMobile?`icon-only`:`icon-right`}
|
|
303
|
+
iconName=${r?`close`:`menu`}
|
|
304
|
+
size=${this.isTablet?`small`:`medium`}
|
|
305
|
+
state=${r?`active`:`normal`}
|
|
306
|
+
aria-expanded=${r}
|
|
307
|
+
aria-controls=${_}
|
|
308
|
+
?disabled=${this.isLoading}
|
|
309
|
+
@click=${()=>this.toggleMenu(`menu`)}
|
|
310
|
+
>
|
|
311
|
+
${n}
|
|
312
|
+
</pkt-button>
|
|
313
|
+
`}renderSearchToggle(t){if(!this.showSearch||!t.search)return e.d;let n=this.openMenu===`search`;return e.p`
|
|
314
|
+
<pkt-button
|
|
315
|
+
id=${b}
|
|
316
|
+
class="pkt-header-global__search-toggle"
|
|
317
|
+
skin="primary"
|
|
318
|
+
color=${r.t(n?void 0:`yellow`)}
|
|
319
|
+
variant="icon-only"
|
|
320
|
+
iconName=${n?`close`:`magnifying-glass-big`}
|
|
321
|
+
size=${this.isMobile?`small`:`medium`}
|
|
322
|
+
state=${n?`active`:`normal`}
|
|
323
|
+
aria-expanded=${n}
|
|
324
|
+
aria-controls=${y}
|
|
325
|
+
@click=${()=>this.toggleMenu(`search`)}
|
|
326
|
+
>
|
|
327
|
+
${t.i18n?.search||`Søk`}
|
|
328
|
+
</pkt-button>
|
|
329
|
+
`}renderSearchPanel(n){let i=n.search;if(this.openMenu!==`search`||!this.showSearch||!i)return e.d;let a=this.searchPlaceholder??i.input.placeholder;return e.p`
|
|
330
|
+
<div class=${t.t({"pkt-header-global__search-panel":!0,[`pkt-header-global__search-panel--${this.overlayBreakpointClass}`]:!!this.overlayBreakpointClass})} id=${y} style=${this.overlayAnchorStyle}>
|
|
331
|
+
<div class="pkt-header-global__search-panel-inner">
|
|
332
|
+
<pkt-searchinput
|
|
333
|
+
appearance="global"
|
|
334
|
+
fullwidth
|
|
335
|
+
id=${i.input.id||`pkt-header-global-search`}
|
|
336
|
+
name=${r.t(i.input.name)}
|
|
337
|
+
placeholder=${r.t(a)}
|
|
338
|
+
aria-label=${r.t(n.i18n?.search||`Søk`)}
|
|
339
|
+
action=${i.endpoint}
|
|
340
|
+
method="get"
|
|
341
|
+
@pkt-search=${e=>this.handleSearch(e.detail.value)}
|
|
342
|
+
></pkt-searchinput>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
`}renderUser(){if(!this.user)return e.d;let n=this.openMenu===`user`,r=t.t({"pkt-header-global__user-menu":!0,"is-open":n});return e.p`
|
|
346
|
+
<div class="pkt-header-global__user">
|
|
347
|
+
<div
|
|
348
|
+
class="pkt-header-global__user-container ${n?`is-open`:``}"
|
|
349
|
+
${i.n(this.userContainerRef)}
|
|
350
|
+
>
|
|
351
|
+
<pkt-button
|
|
352
|
+
class="pkt-header-global__user-button"
|
|
353
|
+
skin="secondary"
|
|
354
|
+
size=${this.isTablet?`small`:`medium`}
|
|
355
|
+
state=${n?`active`:`normal`}
|
|
356
|
+
variant="icons-right-and-left"
|
|
357
|
+
iconName="user"
|
|
358
|
+
secondIconName=${n?`chevron-thin-up`:`chevron-thin-down`}
|
|
359
|
+
@click=${()=>this.toggleMenu(`user`)}
|
|
360
|
+
>
|
|
361
|
+
<span class="pkt-sr-only">Brukermeny: </span>
|
|
362
|
+
<span translate="no">${this.representing?.name||this.user.name}</span>
|
|
363
|
+
</pkt-button>
|
|
364
|
+
${n?e.p`
|
|
365
|
+
<div class=${r}>
|
|
366
|
+
<pkt-header-user-menu
|
|
367
|
+
.user=${this.user}
|
|
368
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||e.d}
|
|
369
|
+
.representing=${this.representing}
|
|
370
|
+
.userMenu=${this.userMenu}
|
|
371
|
+
?can-change-representation=${this.canChangeRepresentation}
|
|
372
|
+
?logout-on-click=${this.showLogoutInUserMenu}
|
|
373
|
+
@change-representation=${()=>this.handleChangeRepresentation()}
|
|
374
|
+
@log-out=${()=>this.handleLogout()}
|
|
375
|
+
></pkt-header-user-menu>
|
|
376
|
+
</div>
|
|
377
|
+
`:e.d}
|
|
378
|
+
</div>
|
|
379
|
+
</div>
|
|
380
|
+
`}get overlayBreakpointClass(){return this.isMobile?`mobile`:this.isTablet?`tablet`:``}renderMenu(){return this.openMenu===`menu`?e.p`
|
|
381
|
+
<div
|
|
382
|
+
class=${t.t({"pkt-header-global__menu":!0,[`pkt-header-global__menu--${this.overlayBreakpointClass}`]:!!this.overlayBreakpointClass})}
|
|
383
|
+
id=${_}
|
|
384
|
+
style=${this.overlayAnchorStyle}
|
|
385
|
+
${i.n(this.menuContainerRef)}
|
|
386
|
+
>
|
|
387
|
+
${this.localeData?e.p`
|
|
388
|
+
<pkt-header-menu
|
|
389
|
+
.data=${this.effectiveData}
|
|
390
|
+
locale=${this.locale}
|
|
391
|
+
open
|
|
392
|
+
mobile-breakpoint=${this.mobileBreakpoint}
|
|
393
|
+
></pkt-header-menu>
|
|
394
|
+
`:e.p`
|
|
395
|
+
<nav class="pkt-header-menu pkt-header-menu--open">
|
|
396
|
+
<p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
|
|
397
|
+
</nav>
|
|
398
|
+
`}
|
|
399
|
+
</div>
|
|
400
|
+
`:e.d}renderHeader(){let n=t.t({"pkt-header-global":!0,"pkt-header-global--mobile":this.isMobile,"pkt-header-global--tablet":this.isTablet,"pkt-header-global--fixed":this.isFixed,"pkt-header-global--sticky":this.isSticky,"pkt-header-global--scroll-to-hide":this.shouldHideOnScroll,"pkt-header-global--hidden":this.isHidden}),r=this.localeData,a=this.isMobile;return e.p`
|
|
401
|
+
<header class=${n} ${i.n(this.headerRef)}>
|
|
402
|
+
<div class="pkt-header-global__logo-area">${this.renderLogo()}</div>
|
|
403
|
+
<div class="pkt-header-global__content">
|
|
404
|
+
${!a&&r?this.renderSearch(r):e.d}
|
|
405
|
+
${a&&r?this.renderSearchToggle(r):e.d}
|
|
406
|
+
${this.renderMenuToggle(r)}
|
|
407
|
+
${!a&&r?this.renderContact(r):e.d}
|
|
408
|
+
</div>
|
|
409
|
+
${this.renderUser()}
|
|
410
|
+
</header>
|
|
411
|
+
`}render(){let n=this.renderHeader(),r=this.localeData,i=this.renderMenu(),a=r?this.renderSearchPanel(r):e.d;return this.isFixed?e.p`
|
|
412
|
+
<div class="pkt-header-global-wrapper">
|
|
413
|
+
${n}
|
|
414
|
+
<div class=${t.t({"pkt-header-global-spacer":!0,"pkt-header-global-spacer--mobile":this.isMobile,"pkt-header-global-spacer--tablet":this.isTablet&&!this.isMobile,"pkt-header-global-spacer--has-user":!!this.user})}></div>
|
|
415
|
+
${a}${i}
|
|
416
|
+
</div>
|
|
417
|
+
`:e.p`${n}${a}${i}`}};e.n([e.o({type:String,attribute:`data-url`})],x.prototype,`dataUrl`,void 0),e.n([e.o({type:Object,attribute:!1})],x.prototype,`data`,void 0),e.n([e.o({type:String})],x.prototype,`locale`,void 0),e.n([e.o({type:String,attribute:`logo-link`})],x.prototype,`logoLink`,void 0),e.n([e.o({type:String,attribute:`logo-path`})],x.prototype,`logoPath`,void 0),e.n([e.o({type:String,attribute:`search-placeholder`})],x.prototype,`searchPlaceholder`,void 0),e.n([e.o({type:String})],x.prototype,`position`,void 0),e.n([e.o({type:String,attribute:`scroll-behavior`})],x.prototype,`scrollBehavior`,void 0),e.n([e.o({type:Number,attribute:`mobile-breakpoint`})],x.prototype,`mobileBreakpoint`,void 0),e.n([e.o({type:Number,attribute:`tablet-breakpoint`})],x.prototype,`tabletBreakpoint`,void 0),e.n([e.o({type:String,attribute:`log-out-button-placement`})],x.prototype,`logOutButtonPlacement`,void 0),e.n([e.o({type:Boolean,attribute:`show-search`,converter:a.t})],x.prototype,`showSearch`,void 0),e.n([e.o({type:Boolean,attribute:`show-contact`,converter:a.t})],x.prototype,`showContact`,void 0),e.n([e.o({type:Boolean,attribute:`can-change-representation`,converter:a.t})],x.prototype,`canChangeRepresentation`,void 0),e.n([e.o({type:Boolean,attribute:`has-log-out`,converter:a.t})],x.prototype,`hasLogOut`,void 0),e.n([e.o({type:Object})],x.prototype,`user`,void 0),e.n([e.o({type:Array,attribute:`user-menu`})],x.prototype,`userMenu`,void 0),e.n([e.o({type:Object})],x.prototype,`representing`,void 0),e.n([e.a()],x.prototype,`openMenu`,void 0),e.n([e.a()],x.prototype,`fetchedData`,void 0),e.n([e.a()],x.prototype,`loadError`,void 0),e.n([e.a()],x.prototype,`headerAnchor`,void 0);try{e.s(`pkt-header-global`)(x)}catch{console.warn(`Forsøker å definere <pkt-header-global>, men den er allerede definert`)}var S=class extends n.t{constructor(...e){super(...e),this.type=`service`,this.searchPlaceholder=`Søk`,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}firstUpdated(e){super.firstUpdated(e),this.emitDeprecationWarnings()}emitDeprecationWarnings(){this.userMenuFooter!==void 0&&console.warn(`[PktHeader] userMenuFooter is deprecated. Use userMenu instead.`),this.userOptions!==void 0&&console.warn(`[PktHeader] userOptions is deprecated. Use userMenu instead.`)}get effectiveUserMenu(){let e=this.userMenu||[],t=this.userMenuFooter||[],n=this.userOptions||[];return t.length||n.length?[...e,...n,...t]:this.userMenu}renderGlobal(){return e.p`
|
|
418
|
+
<pkt-header-global
|
|
419
|
+
data-url=${r.t(this.dataUrl)}
|
|
420
|
+
locale=${r.t(this.locale)}
|
|
421
|
+
logo-link=${r.t(this.logoLink)}
|
|
422
|
+
logo-path=${r.t(this.logoPath)}
|
|
423
|
+
search-placeholder=${r.t(this.hasAttribute(`search-placeholder`)?this.searchPlaceholder:void 0)}
|
|
424
|
+
mobile-breakpoint=${r.t(this.hasAttribute(`mobile-breakpoint`)?this.mobileBreakpoint:void 0)}
|
|
425
|
+
tablet-breakpoint=${r.t(this.hasAttribute(`tablet-breakpoint`)?this.tabletBreakpoint:void 0)}
|
|
426
|
+
log-out-button-placement=${this.logOutButtonPlacement}
|
|
427
|
+
position=${this.position}
|
|
428
|
+
scroll-behavior=${this.scrollBehavior}
|
|
429
|
+
.data=${this.data}
|
|
430
|
+
.showSearch=${this.showSearch??!0}
|
|
431
|
+
.showContact=${this.showContact}
|
|
432
|
+
.canChangeRepresentation=${this.canChangeRepresentation}
|
|
433
|
+
.hasLogOut=${this.hasLogOut}
|
|
434
|
+
.user=${this.user}
|
|
435
|
+
.userMenu=${this.effectiveUserMenu}
|
|
436
|
+
.representing=${this.representing}
|
|
437
|
+
></pkt-header-global>
|
|
438
|
+
`}render(){return this.type===`global`?this.renderGlobal():e.p`
|
|
439
|
+
<pkt-header-service
|
|
440
|
+
service-name=${r.t(this.serviceName)}
|
|
441
|
+
service-link=${r.t(this.serviceLink)}
|
|
442
|
+
logo-link=${r.t(this.logoLink)}
|
|
443
|
+
logo-path=${r.t(this.logoPath)}
|
|
444
|
+
search-placeholder=${this.searchPlaceholder}
|
|
445
|
+
search-value=${this.searchValue}
|
|
446
|
+
mobile-breakpoint=${this.mobileBreakpoint}
|
|
447
|
+
tablet-breakpoint=${this.tabletBreakpoint}
|
|
448
|
+
opened-menu=${this.openedMenu}
|
|
449
|
+
log-out-button-placement=${this.logOutButtonPlacement}
|
|
450
|
+
position=${this.position}
|
|
451
|
+
scroll-behavior=${this.scrollBehavior}
|
|
452
|
+
slot-menu-variant=${this.slotMenuVariant}
|
|
453
|
+
slot-menu-text=${this.slotMenuText}
|
|
454
|
+
.hideLogo=${this.hideLogo}
|
|
455
|
+
.compact=${this.compact}
|
|
456
|
+
.showSearch=${this.showSearch??!1}
|
|
457
|
+
.canChangeRepresentation=${this.canChangeRepresentation}
|
|
458
|
+
.hasLogOut=${this.hasLogOut}
|
|
459
|
+
.user=${this.user}
|
|
460
|
+
.userMenu=${this.effectiveUserMenu}
|
|
461
|
+
.representing=${this.representing}
|
|
462
|
+
>
|
|
463
|
+
${this.hasSlotContent()?e.p`<div class="pkt-contents">${n.n(this)}</div>`:e.d}
|
|
464
|
+
</pkt-header-service>
|
|
465
|
+
`}};e.n([e.o({type:String})],S.prototype,`type`,void 0),e.n([e.o({type:String,attribute:`service-name`})],S.prototype,`serviceName`,void 0),e.n([e.o({type:String,attribute:`service-link`})],S.prototype,`serviceLink`,void 0),e.n([e.o({type:String,attribute:`logo-link`})],S.prototype,`logoLink`,void 0),e.n([e.o({type:String,attribute:`logo-path`})],S.prototype,`logoPath`,void 0),e.n([e.o({type:String,attribute:`search-placeholder`})],S.prototype,`searchPlaceholder`,void 0),e.n([e.o({type:String,attribute:`search-value`})],S.prototype,`searchValue`,void 0),e.n([e.o({type:Number,attribute:`mobile-breakpoint`})],S.prototype,`mobileBreakpoint`,void 0),e.n([e.o({type:Number,attribute:`tablet-breakpoint`})],S.prototype,`tabletBreakpoint`,void 0),e.n([e.o({type:String,attribute:`opened-menu`})],S.prototype,`openedMenu`,void 0),e.n([e.o({type:String,attribute:`log-out-button-placement`})],S.prototype,`logOutButtonPlacement`,void 0),e.n([e.o({type:String})],S.prototype,`position`,void 0),e.n([e.o({type:String,attribute:`scroll-behavior`})],S.prototype,`scrollBehavior`,void 0),e.n([e.o({type:String,attribute:`slot-menu-variant`})],S.prototype,`slotMenuVariant`,void 0),e.n([e.o({type:String,attribute:`slot-menu-text`})],S.prototype,`slotMenuText`,void 0),e.n([e.o({type:Boolean,attribute:`hide-logo`,converter:a.t})],S.prototype,`hideLogo`,void 0),e.n([e.o({type:Boolean,converter:a.t})],S.prototype,`compact`,void 0),e.n([e.o({type:Boolean,attribute:`show-search`,converter:a.t})],S.prototype,`showSearch`,void 0),e.n([e.o({type:Boolean,attribute:`can-change-representation`,converter:a.t})],S.prototype,`canChangeRepresentation`,void 0),e.n([e.o({type:Boolean,attribute:`has-log-out`,converter:a.t})],S.prototype,`hasLogOut`,void 0),e.n([e.o({type:Object})],S.prototype,`user`,void 0),e.n([e.o({type:Array,attribute:`user-menu`})],S.prototype,`userMenu`,void 0),e.n([e.o({type:Object})],S.prototype,`representing`,void 0),e.n([e.o({type:String,attribute:`data-url`})],S.prototype,`dataUrl`,void 0),e.n([e.o({type:Object,attribute:!1})],S.prototype,`data`,void 0),e.n([e.o({type:String})],S.prototype,`locale`,void 0),e.n([e.o({type:Boolean,attribute:`show-contact`,converter:a.t})],S.prototype,`showContact`,void 0),e.n([e.o({type:Array,attribute:`user-menu-footer`})],S.prototype,`userMenuFooter`,void 0),e.n([e.o({type:Array,attribute:`user-options`})],S.prototype,`userOptions`,void 0);try{e.s(`pkt-header`)(S)}catch{console.warn(`Forsøker å definere <pkt-header>, men den er allerede definert`)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return S}});
|