@oslokommune/punkt-elements 19.4.0 → 19.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/{accordion-CZ0O4c0_.cjs → accordion-5lSFQToJ.cjs} +6 -6
- package/dist/{accordion-DFcdonl-.js → accordion-BJh6X1Ek.js} +6 -6
- package/dist/{alert-BhvjSA5X.js → alert-C0PiYnot.js} +29 -36
- package/dist/alert-IaZzEgyI.cjs +39 -0
- package/dist/{backlink-Bw6IcRIo.cjs → backlink-BRqhwUr2.cjs} +1 -1
- package/dist/{backlink-DIdgvE2j.js → backlink-BslFewn-.js} +1 -1
- package/dist/{breadcrumbs-BfgCx3Xj.js → breadcrumbs-Cr3GugPv.js} +1 -1
- package/dist/{breadcrumbs-C10K1XLP.cjs → breadcrumbs-DG4i5UCh.cjs} +1 -1
- package/dist/{button-B5rWxfei.js → button-B78im4wB.js} +16 -16
- package/dist/button-BNVTj7nB.cjs +32 -0
- package/dist/{calendar-U8xkRdgF.js → calendar-BLaRXUBl.js} +1 -1
- package/dist/{calendar-D-Ow5DAp.cjs → calendar-TcxvS-1_.cjs} +1 -1
- package/dist/{card-D2YYPZr5.js → card-CYKhPUNI.js} +12 -12
- package/dist/{card-DW1uklP6.cjs → card-CaLEuumN.cjs} +10 -10
- package/dist/{checkbox-C0zLtnCI.cjs → checkbox-DIyi1Cya.cjs} +1 -1
- package/dist/{checkbox-B2O0fkh9.js → checkbox-DKeErDb5.js} +1 -1
- package/dist/{combobox-DpXTwNr4.js → combobox-BKnHg_-E.js} +30 -30
- package/dist/{combobox-BgduqUpf.cjs → combobox-C7FUvv5T.cjs} +22 -22
- package/dist/components/alert/alert.d.ts +0 -2
- package/dist/{consent-CbJG04C1.js → consent-CleJMbVH.js} +1 -1
- package/dist/{consent-DxpJLExu.cjs → consent-Dl-R0iC3.cjs} +1 -1
- package/dist/{datepicker-BLBimRTT.js → datepicker-COFEJpB4.js} +10 -10
- package/dist/{datepicker-53rj_Qqx.cjs → datepicker-CeUpoQuG.cjs} +27 -27
- package/dist/directives/slot-content.d.ts +36 -1
- package/dist/element-with-slot-D7sTqOr3.cjs +1 -0
- package/dist/{element-with-slot-FD826ooP.js → element-with-slot-DQv0cbbD.js} +80 -21
- package/dist/{fileupload-BxfBFhFt.js → fileupload-CUPl41uN.js} +32 -32
- package/dist/{fileupload-4wgr4iAi.cjs → fileupload-CaZGBvZr.cjs} +21 -21
- package/dist/{footer-CBkKAuvh.js → footer-DdLls3F-.js} +14 -14
- package/dist/{footer-DOp_9VdY.cjs → footer-vy9NqT65.cjs} +9 -9
- package/dist/{header-Cs4t2XMM.cjs → header-CgP3-6-b.cjs} +50 -50
- package/dist/{header-CF-Re0nT.js → header-Cq6INZmI.js} +56 -56
- package/dist/{header-menu-C9k9xG9V.js → header-menu-ANj5nL2M.js} +2 -2
- package/dist/{header-menu-BnqZagI6.cjs → header-menu-BfkCp8jw.cjs} +1 -1
- package/dist/{heading-BRHCV_5J.js → heading-CUrZvkrM.js} +1 -1
- package/dist/{heading-u9Arof4p.cjs → heading-zoz-QZJ9.cjs} +1 -1
- package/dist/{helptext-DYgeTMtA.cjs → helptext-BCkwSz1m.cjs} +2 -2
- package/dist/{helptext-sRC8EJqL.js → helptext-DCT_9dw1.js} +2 -2
- package/dist/icon-Dnv6LtPC.cjs +1 -0
- package/dist/{icon-DmRyYNlY.js → icon-JigbxxF7.js} +16 -12
- package/dist/{input-element-B1BntJeJ.js → input-element-5hsxasU3.js} +1 -1
- package/dist/{input-element-W6Gklt2E.cjs → input-element-Ctkz5fQk.cjs} +1 -1
- package/dist/{input-wrapper-CSPPa4uc.cjs → input-wrapper-Cf__-4E-.cjs} +28 -28
- package/dist/{input-wrapper-C1zXIKBU.js → input-wrapper-DACDx6Ie.js} +45 -45
- package/dist/{link-DcxVUj8s.js → link-CmZwAw5u.js} +2 -2
- package/dist/link-LO_5_La8.cjs +7 -0
- package/dist/{linkcard-MJFR7FLT.js → linkcard-CQluSyJJ.js} +8 -8
- package/dist/{linkcard-CWeR6t2a.cjs → linkcard-UKsxADrP.cjs} +3 -3
- package/dist/{listbox-DEzd-dxF.js → listbox-Ct9jIV_5.js} +8 -8
- package/dist/{listbox-BoBwzL4p.cjs → listbox-g-vHHLkD.cjs} +20 -20
- package/dist/{loader-SJ6NauNT.cjs → loader-C_PH05aw.cjs} +2 -2
- package/dist/{loader-CqFQoJlM.js → loader-DzctJ9jW.js} +2 -2
- package/dist/{messagebox-DsKi_rKn.js → messagebox-DPFBuisE.js} +2 -2
- package/dist/messagebox-JWKMJEFc.cjs +13 -0
- package/dist/{modal-DaerHpVi.cjs → modal-BymjMIJi.cjs} +2 -2
- package/dist/{modal-CJqe6y-V.js → modal-CELmA0-8.js} +2 -2
- 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 +34 -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-Dz-rYCG1.cjs → pkt-options-controller-CpEZcomb.cjs} +1 -1
- package/dist/{pkt-options-controller-sUzxHa5A.js → pkt-options-controller-D7l18Iw0.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-BrVlAcQI.cjs → progressbar-CIXNSwTy.cjs} +2 -3
- package/dist/{progressbar-Bd0DjiAb.js → progressbar-DH5lIBpx.js} +6 -4
- package/dist/{radiobutton-B0V-jSEX.js → radiobutton-DP791tUe.js} +1 -1
- package/dist/{radiobutton-Cv1BlwLV.cjs → radiobutton-oEYrBiT6.cjs} +1 -1
- package/dist/{searchinput-7-VVdkss.cjs → searchinput-CbClDE-d.cjs} +1 -1
- package/dist/{searchinput-CgzigmiI.js → searchinput-Co8tcq-l.js} +1 -1
- package/dist/{select-BbcGPmPs.js → select-B97S4g1v.js} +18 -18
- package/dist/{select---PCiwmy.cjs → select-QobXCtIL.cjs} +13 -13
- package/dist/shared-types/icon.d.ts +39 -0
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/{tabs-B134M9k2.js → tabs-B8blHQrL.js} +18 -18
- package/dist/{tabs-Dw9E06fL.cjs → tabs-CjX-GWvM.cjs} +15 -15
- package/dist/tag-B5dUg7AD.cjs +27 -0
- package/dist/{tag-wYnHhHLK.js → tag-Bns7Xj1O.js} +11 -11
- package/dist/{textarea-BcgVLLTt.js → textarea-DgW0hRV5.js} +17 -17
- package/dist/{textarea-pA_xv8lI.cjs → textarea-ZMbtZNp3.cjs} +10 -10
- package/dist/{textinput-Czz2affL.cjs → textinput-DfT_1aGb.cjs} +10 -10
- package/dist/{textinput-Dpj1X5yr.js → textinput-s-qz2xSC.js} +15 -15
- package/dist/{timepicker-BwDZkSpo.cjs → timepicker-BAa_VEnf.cjs} +10 -10
- package/dist/{timepicker-CfQMZlaP.js → timepicker-Crj4isb9.js} +16 -16
- package/package.json +2 -2
- package/src/components/alert/alert.test.ts +15 -0
- package/src/components/alert/alert.ts +0 -12
- package/src/components/combobox/combobox.ts +3 -3
- package/src/components/datepicker/datepicker.ts +5 -5
- package/src/components/helptext/helptext-association.test.ts +79 -0
- package/src/components/icon/icon.ts +6 -6
- package/src/components/input-wrapper/input-wrapper.test.ts +49 -0
- package/src/components/input-wrapper/input-wrapper.ts +6 -4
- package/src/components/progressbar/progressbar.test.ts +19 -0
- package/src/components/progressbar/progressbar.ts +2 -6
- package/src/components/select/select.ts +3 -3
- package/src/components/textarea/textarea.ts +3 -3
- package/src/components/textinput/textinput.ts +3 -3
- package/src/components/timepicker/timepicker.ts +3 -3
- package/dist/alert-D1bQjZ7C.cjs +0 -40
- package/dist/button-CmNrMH-c.cjs +0 -32
- package/dist/element-with-slot-2PHu2w7O.cjs +0 -1
- package/dist/icon-CoBsgGUR.cjs +0 -1
- package/dist/link-EMsHusF7.cjs +0 -7
- package/dist/messagebox-D5GYIdjE.cjs +0 -13
- package/dist/tag-HTYKd-iG.cjs +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./
|
|
1
|
+
const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-D7sTqOr3.cjs"),i=require("./booleanish-BF8l4scU.cjs"),a=require("./fetch-header-footer-data-CUKV0biS.cjs");require("./icon-Dnv6LtPC.cjs");const o=require("./if-defined-2mkIDgOm.cjs");require("./button-BNVTj7nB.cjs");const s=require("./ref-Emu5PNxk.cjs"),c=require("./focus-trap-DSv4Ifqm.cjs"),l=require("./scroll-lock-BN8lOhV5.cjs");require("./link-LO_5_La8.cjs"),require("./textinput-DfT_1aGb.cjs"),require("./searchinput-CbClDE-d.cjs"),require("./header-menu-BfkCp8jw.cjs");var u=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},d=e=>u(e),f=e=>{if(!e)return;let t=typeof e==`string`?new Date(e):e;if(!isNaN(t.getTime()))return t.toLocaleDateString(`nb-NO`,{day:`numeric`,month:`long`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})},p=class{constructor(e,t){this.isMobile=!1,this.isTablet=!1,this.isHidden=!1,this.pauseScrollHide=!1,this.componentWidth=typeof window<`u`?window.innerWidth:0,this.lastScrollPosition=0,this.scrollLockToken=l.t(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(this.getOptions().scrollBehavior!==`hide`||this.pauseScrollHide)return;let e=window.pageYOffset||document.documentElement.scrollTop;if(e<0||Math.abs(e-this.lastScrollPosition)<60)return;let t=e>this.lastScrollPosition;this.lastScrollPosition=e,t!==this.isHidden&&(this.isHidden=t,this.host.requestUpdate())},this.host=e,this.getOptions=t,e.addController(this)}hostConnected(){window.addEventListener(`scroll`,this.handleScroll)}hostDisconnected(){this.resizeObserver?.disconnect(),window.removeEventListener(`scroll`,this.handleScroll),l.n(this.scrollLockToken,!1)}observe(e){e&&(this.componentWidth=e.offsetWidth,this.refreshBreakpoints(),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)this.componentWidth=t.borderBoxSize&&t.borderBoxSize.length>0?t.borderBoxSize[0].inlineSize:t.contentRect.width,this.refreshBreakpoints()}),this.resizeObserver.observe(e))}refreshBreakpoints(){let{mobileBreakpoint:e,tabletBreakpoint:t}=this.getOptions(),n=this.componentWidth<e,r=this.componentWidth<t;(n!==this.isMobile||r!==this.isTablet)&&(this.isMobile=n,this.isTablet=r,this.host.requestUpdate())}setScrollLock(e){l.n(this.scrollLockToken,e)}captureFocus(){this.lastFocusedElement=document.activeElement}flagRestoreFocus(){this.shouldRestoreFocus=!0}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}},m=class extends e.t{constructor(...e){super(...e),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent(`change-representation`,{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleMenuItemClick(e){`onClick`in e&&typeof e.onClick==`function`&&e.onClick()}renderLinkOrButton(n,r){let i=`href`in n,a=t.t({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[r||``]:!!r});return i?e._`
|
|
2
2
|
<pkt-link
|
|
3
3
|
iconName=${n.iconName||e.h}
|
|
4
4
|
href=${n.href}
|
|
@@ -21,17 +21,17 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
21
21
|
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(t)}</li>
|
|
22
22
|
`)}
|
|
23
23
|
</ul>
|
|
24
|
-
`}render(){let t=this.userMenu?.map(d),
|
|
25
|
-
<nav class="pkt-user-menu" aria-label=${
|
|
24
|
+
`}render(){let t=this.userMenu?.map(d),r=this.pktStrings.get(`header`);return e._`
|
|
25
|
+
<nav class="pkt-user-menu" aria-label=${r.userMenuLabel}>
|
|
26
26
|
<ul class="pkt-user-menu__list">
|
|
27
27
|
<!-- User section -->
|
|
28
28
|
${this.user?e._`
|
|
29
29
|
<li class="pkt-user-menu__item">
|
|
30
|
-
<div class="pkt-user-menu__label">${
|
|
30
|
+
<div class="pkt-user-menu__label">${r.loggedInAs}</div>
|
|
31
31
|
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
32
32
|
${this.formattedLastLoggedIn?e._`
|
|
33
33
|
<div class="pkt-user-menu__last-logged-in">
|
|
34
|
-
${
|
|
34
|
+
${r.lastLoggedIn} <time>${this.formattedLastLoggedIn}</time>
|
|
35
35
|
</div>
|
|
36
36
|
`:e.h}
|
|
37
37
|
</li>
|
|
@@ -45,15 +45,15 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
45
45
|
<!-- Representing section -->
|
|
46
46
|
${this.representing?e._`
|
|
47
47
|
<li class="pkt-user-menu__item">
|
|
48
|
-
<div class="pkt-user-menu__label">${
|
|
48
|
+
<div class="pkt-user-menu__label">${r.representing}</div>
|
|
49
49
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
50
50
|
${this.representing.orgNumber?e._`<div class="pkt-user-menu__org-number">
|
|
51
|
-
${
|
|
51
|
+
${n.t(r.orgNumber,{number:this.representing.orgNumber})}
|
|
52
52
|
</div>`:e.h}
|
|
53
53
|
${this.canChangeRepresentation?e._`
|
|
54
54
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
55
55
|
<li class="pkt-user-menu__subitem">
|
|
56
|
-
${this.renderLinkOrButton({title:
|
|
56
|
+
${this.renderLinkOrButton({title:r.changeRepresentation,iconName:`cogwheel`,onClick:()=>this.handleChangeRepresentation()})}
|
|
57
57
|
</li>
|
|
58
58
|
</ul>
|
|
59
59
|
`:e.h}
|
|
@@ -65,7 +65,7 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
65
65
|
<li class="pkt-user-menu__item">
|
|
66
66
|
<ul class="pkt-user-menu__sublist">
|
|
67
67
|
<li class="pkt-user-menu__subitem">
|
|
68
|
-
${this.renderLinkOrButton({title:
|
|
68
|
+
${this.renderLinkOrButton({title:r.changeRepresentation,iconName:`cogwheel`,onClick:()=>this.handleChangeRepresentation()})}
|
|
69
69
|
</li>
|
|
70
70
|
</ul>
|
|
71
71
|
</li>
|
|
@@ -74,12 +74,12 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
74
74
|
<!-- Logout -->
|
|
75
75
|
${this.logoutOnClick?e._`
|
|
76
76
|
<li class="pkt-user-menu__item">
|
|
77
|
-
${this.renderLinkOrButton({title:
|
|
77
|
+
${this.renderLinkOrButton({title:r.logOut,iconName:`exit`,onClick:()=>this.handleLogout()})}
|
|
78
78
|
</li>
|
|
79
79
|
`:e.h}
|
|
80
80
|
</ul>
|
|
81
81
|
</nav>
|
|
82
|
-
`}};e.n([e.u({type:Object})],m.prototype,`user`,void 0),e.n([e.u({type:String,attribute:`formatted-last-logged-in`})],m.prototype,`formattedLastLoggedIn`,void 0),e.n([e.u({type:Object})],m.prototype,`representing`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],m.prototype,`userMenu`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:
|
|
82
|
+
`}};e.n([e.u({type:Object})],m.prototype,`user`,void 0),e.n([e.u({type:String,attribute:`formatted-last-logged-in`})],m.prototype,`formattedLastLoggedIn`,void 0),e.n([e.u({type:Object})],m.prototype,`representing`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],m.prototype,`userMenu`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:i.t})],m.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`logout-on-click`,converter:i.t})],m.prototype,`logoutOnClick`,void 0);try{e.d(`pkt-header-user-menu`)(m)}catch{console.warn(`Forsøker å definere <pkt-header-user-menu>, men den er allerede definert`)}var h=`https://punkt-cdn.oslo.kommune.no/latest/logos/`;typeof window<`u`&&(window.pktLogoPath=window.pktLogoPath||h);var g=class extends r.t{constructor(...e){super(...e),this.logoLink=a.o,this.logoPath=typeof window<`u`?window.pktLogoPath:h,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.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=s.t(),this.userContainerRef=s.t(),this.slotContainerRef=s.t(),this.searchContainerRef=s.t(),this.slotContentRef=s.t(),this.searchMenuRef=s.t(),this.chrome=new p(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 f(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`)}get headerStrings(){return this.pktStrings.get(`header`)}renderLogo(){if(this.hideLogo)return e.h;let t=e._`
|
|
83
83
|
<pkt-icon name="oslologo" aria-hidden="true" path=${this.logoPath}></pkt-icon>
|
|
84
84
|
`;return this.logoLink?e._`
|
|
85
85
|
<span class="pkt-header-service__logo">
|
|
@@ -122,7 +122,7 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
122
122
|
>
|
|
123
123
|
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
124
124
|
</span>
|
|
125
|
-
`:e.h}renderSlotContainer(){if(!this.hasSlotContent())return e.h;let n=t.t({"pkt-header-service__slot-container":!0,"is-open":this.openMenu===`slot`}),
|
|
125
|
+
`:e.h}renderSlotContainer(){if(!this.hasSlotContent())return e.h;let n=t.t({"pkt-header-service__slot-container":!0,"is-open":this.openMenu===`slot`}),i=t.t({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return e._`
|
|
126
126
|
<div
|
|
127
127
|
class=${n}
|
|
128
128
|
@focusout=${e=>this.handleFocusOut(e,`slot`)}
|
|
@@ -144,14 +144,14 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
144
144
|
</pkt-button>
|
|
145
145
|
`:e.h}
|
|
146
146
|
<div
|
|
147
|
-
class=${
|
|
147
|
+
class=${i}
|
|
148
148
|
id="mobile-slot-menu"
|
|
149
149
|
role=${this.isTablet?`group`:e.h}
|
|
150
150
|
aria-label=${this.isTablet?this.headerStrings.menu:e.h}
|
|
151
151
|
@click=${this.handleSlotContentClick}
|
|
152
152
|
${s.n(this.slotContentRef)}
|
|
153
153
|
>
|
|
154
|
-
${i
|
|
154
|
+
${r.i(this)}
|
|
155
155
|
</div>
|
|
156
156
|
</div>
|
|
157
157
|
`}renderSearch(){if(!this.showSearch)return e.h;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._`
|
|
@@ -276,29 +276,29 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
276
276
|
${n}
|
|
277
277
|
<div class=${r}></div>
|
|
278
278
|
</div>
|
|
279
|
-
`}return n}};e.n([e.u({type:String,attribute:`service-name`})],g.prototype,`serviceName`,void 0),e.n([e.u({type:String,attribute:`service-link`})],g.prototype,`serviceLink`,void 0),e.n([e.u({type:String,attribute:`logo-link`})],g.prototype,`logoLink`,void 0),e.n([e.u({type:String,attribute:`logo-path`})],g.prototype,`logoPath`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],g.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:String,attribute:`search-value`})],g.prototype,`searchValue`,void 0),e.n([e.u({type:Number,attribute:`mobile-breakpoint`})],g.prototype,`mobileBreakpoint`,void 0),e.n([e.u({type:Number,attribute:`tablet-breakpoint`})],g.prototype,`tabletBreakpoint`,void 0),e.n([e.u({type:String,attribute:`opened-menu`})],g.prototype,`openedMenu`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],g.prototype,`logOutButtonPlacement`,void 0),e.n([e.u({type:String})],g.prototype,`position`,void 0),e.n([e.u({type:String,attribute:`scroll-behavior`})],g.prototype,`scrollBehavior`,void 0),e.n([e.u({type:String,attribute:`slot-menu-variant`})],g.prototype,`slotMenuVariant`,void 0),e.n([e.u({type:String,attribute:`slot-menu-text`})],g.prototype,`slotMenuText`,void 0),e.n([e.u({type:Boolean,attribute:`hide-logo`,converter:
|
|
280
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
279
|
+
`}return n}};e.n([e.u({type:String,attribute:`service-name`})],g.prototype,`serviceName`,void 0),e.n([e.u({type:String,attribute:`service-link`})],g.prototype,`serviceLink`,void 0),e.n([e.u({type:String,attribute:`logo-link`})],g.prototype,`logoLink`,void 0),e.n([e.u({type:String,attribute:`logo-path`})],g.prototype,`logoPath`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],g.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:String,attribute:`search-value`})],g.prototype,`searchValue`,void 0),e.n([e.u({type:Number,attribute:`mobile-breakpoint`})],g.prototype,`mobileBreakpoint`,void 0),e.n([e.u({type:Number,attribute:`tablet-breakpoint`})],g.prototype,`tabletBreakpoint`,void 0),e.n([e.u({type:String,attribute:`opened-menu`})],g.prototype,`openedMenu`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],g.prototype,`logOutButtonPlacement`,void 0),e.n([e.u({type:String})],g.prototype,`position`,void 0),e.n([e.u({type:String,attribute:`scroll-behavior`})],g.prototype,`scrollBehavior`,void 0),e.n([e.u({type:String,attribute:`slot-menu-variant`})],g.prototype,`slotMenuVariant`,void 0),e.n([e.u({type:String,attribute:`slot-menu-text`})],g.prototype,`slotMenuText`,void 0),e.n([e.u({type:Boolean,attribute:`hide-logo`,converter:i.t})],g.prototype,`hideLogo`,void 0),e.n([e.u({type:Boolean,converter:i.t})],g.prototype,`compact`,void 0),e.n([e.u({type:Boolean,attribute:`show-search`,converter:i.t})],g.prototype,`showSearch`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:i.t})],g.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`has-log-out`,converter:i.t})],g.prototype,`hasLogOut`,void 0),e.n([e.u({type:Object})],g.prototype,`user`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],g.prototype,`userMenu`,void 0),e.n([e.u({type:Object})],g.prototype,`representing`,void 0),e.n([e.l()],g.prototype,`openMenu`,void 0),e.n([e.l()],g.prototype,`alignSlotRight`,void 0),e.n([e.l()],g.prototype,`alignSearchRight`,void 0);try{e.d(`pkt-header-service`)(g)}catch{console.warn(`Forsøker å definere <pkt-header-service>, men den er allerede definert`)}var _=`https://punkt-cdn.oslo.kommune.no/latest/logos/`;typeof window<`u`&&(window.pktLogoPath=window.pktLogoPath||_);var v=`pkt-header-global-menu`,y=`pkt-header-global-menu-toggle`,b=`pkt-header-global-search-panel`,x=`pkt-header-global-search-toggle`,S=class extends e.t{constructor(...e){super(...e),this.locale=`nb-NO`,this.logoLink=a.o,this.logoPath=typeof window<`u`?window.pktLogoPath:_,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=s.t(),this.menuContainerRef=s.t(),this.userContainerRef=s.t(),this.chrome=new p(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(`#${y}`)&&(this.openMenu=`none`),this.openMenu===`search`&&!t.closest(`.pkt-header-global__search-panel-inner`)&&!t.closest(`#${x}`)&&(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=c.n(n),a=c.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],s=i[i.length-1],l=!e.shiftKey&&a===s,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(`#${b} 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 a.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 a.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(`#${y}`)}:this.openMenu===`search`?{panel:this.querySelector(`#${b}`),toggle:this.querySelector(`#${x}`)}: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 f(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=this.pktStrings.get(`header`),n=e._`
|
|
280
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${o.t(this.logoPath)}></pkt-icon>
|
|
281
281
|
`;return this.logoLink?e._`
|
|
282
282
|
<span class="pkt-header-global__logo">
|
|
283
283
|
<a href=${this.logoLink} aria-label=${t.logoLabel} @click=${this.handleLogoClick}>
|
|
284
|
-
${
|
|
284
|
+
${n}
|
|
285
285
|
</a>
|
|
286
286
|
</span>
|
|
287
287
|
`:e._`
|
|
288
288
|
<span class="pkt-header-global__logo" role="img" aria-label=${t.logoAlt}>
|
|
289
|
-
${
|
|
289
|
+
${n}
|
|
290
290
|
</span>
|
|
291
|
-
`}renderSearch(t){if(!this.showSearch)return e.h;let
|
|
291
|
+
`}renderSearch(t){if(!this.showSearch)return e.h;let n=t.search;if(!n)return e.h;let r=this.searchPlaceholder??n.input.placeholder;return e._`
|
|
292
292
|
<div class="pkt-header-global__search">
|
|
293
293
|
<pkt-searchinput
|
|
294
294
|
appearance="global"
|
|
295
295
|
input-size=${this.isTablet?`small`:`medium`}
|
|
296
296
|
fullwidth
|
|
297
|
-
id=${
|
|
298
|
-
name=${
|
|
299
|
-
placeholder=${
|
|
300
|
-
aria-label=${
|
|
301
|
-
action=${
|
|
297
|
+
id=${n.input.id||`pkt-header-global-search`}
|
|
298
|
+
name=${o.t(n.input.name)}
|
|
299
|
+
placeholder=${o.t(r)}
|
|
300
|
+
aria-label=${o.t(t.i18n?.search)}
|
|
301
|
+
action=${n.endpoint}
|
|
302
302
|
method="get"
|
|
303
303
|
@pkt-search=${e=>this.handleSearch(e.detail.value)}
|
|
304
304
|
></pkt-searchinput>
|
|
@@ -323,33 +323,33 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
323
323
|
>
|
|
324
324
|
${n}
|
|
325
325
|
</pkt-button>
|
|
326
|
-
`}renderSearchToggle(t){if(!this.showSearch||!t.search)return e.h;let
|
|
326
|
+
`}renderSearchToggle(t){if(!this.showSearch||!t.search)return e.h;let n=this.openMenu===`search`;return e._`
|
|
327
327
|
<pkt-button
|
|
328
328
|
id=${x}
|
|
329
329
|
class="pkt-header-global__search-toggle"
|
|
330
330
|
skin="primary"
|
|
331
|
-
color=${
|
|
331
|
+
color=${o.t(n?void 0:`yellow`)}
|
|
332
332
|
variant="icon-only"
|
|
333
|
-
iconName=${
|
|
333
|
+
iconName=${n?`close`:`magnifying-glass-big`}
|
|
334
334
|
size=${this.isMobile?`small`:`medium`}
|
|
335
|
-
state=${
|
|
336
|
-
aria-expanded=${
|
|
335
|
+
state=${n?`active`:`normal`}
|
|
336
|
+
aria-expanded=${n}
|
|
337
337
|
aria-controls=${b}
|
|
338
338
|
@click=${()=>this.toggleMenu(`search`)}
|
|
339
339
|
>
|
|
340
340
|
${t.i18n?.search||this.pktStrings.get(`header`).search}
|
|
341
341
|
</pkt-button>
|
|
342
|
-
`}renderSearchPanel(
|
|
343
|
-
<div class=${
|
|
342
|
+
`}renderSearchPanel(n){let r=n.search;if(this.openMenu!==`search`||!this.showSearch||!r)return e.h;let i=this.searchPlaceholder??r.input.placeholder,a=t.t({"pkt-header-global__search-panel":!0,[`pkt-header-global__search-panel--${this.overlayBreakpointClass}`]:!!this.overlayBreakpointClass});return e._`
|
|
343
|
+
<div class=${a} id=${b} style=${this.overlayAnchorStyle}>
|
|
344
344
|
<div class="pkt-header-global__search-panel-inner">
|
|
345
345
|
<pkt-searchinput
|
|
346
346
|
appearance="global"
|
|
347
347
|
fullwidth
|
|
348
|
-
id=${
|
|
349
|
-
name=${
|
|
350
|
-
placeholder=${
|
|
351
|
-
aria-label=${
|
|
352
|
-
action=${
|
|
348
|
+
id=${r.input.id||`pkt-header-global-search`}
|
|
349
|
+
name=${o.t(r.input.name)}
|
|
350
|
+
placeholder=${o.t(i)}
|
|
351
|
+
aria-label=${o.t(n.i18n?.search||this.pktStrings.get(`header`).search)}
|
|
352
|
+
action=${r.endpoint}
|
|
353
353
|
method="get"
|
|
354
354
|
@pkt-search=${e=>this.handleSearch(e.detail.value)}
|
|
355
355
|
></pkt-searchinput>
|
|
@@ -429,15 +429,15 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
429
429
|
<div class=${r}></div>
|
|
430
430
|
${a}${i}
|
|
431
431
|
</div>
|
|
432
|
-
`}return e._`${n}${a}${i}`}};e.n([e.u({type:String,attribute:`data-url`})],S.prototype,`dataUrl`,void 0),e.n([e.u({type:Object,attribute:!1})],S.prototype,`data`,void 0),e.n([e.u({type:String})],S.prototype,`locale`,void 0),e.n([e.u({type:String,attribute:`logo-link`})],S.prototype,`logoLink`,void 0),e.n([e.u({type:String,attribute:`logo-path`})],S.prototype,`logoPath`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],S.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:String})],S.prototype,`position`,void 0),e.n([e.u({type:String,attribute:`scroll-behavior`})],S.prototype,`scrollBehavior`,void 0),e.n([e.u({type:Number,attribute:`mobile-breakpoint`})],S.prototype,`mobileBreakpoint`,void 0),e.n([e.u({type:Number,attribute:`tablet-breakpoint`})],S.prototype,`tabletBreakpoint`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],S.prototype,`logOutButtonPlacement`,void 0),e.n([e.u({type:Boolean,attribute:`show-search`,converter:
|
|
432
|
+
`}return e._`${n}${a}${i}`}};e.n([e.u({type:String,attribute:`data-url`})],S.prototype,`dataUrl`,void 0),e.n([e.u({type:Object,attribute:!1})],S.prototype,`data`,void 0),e.n([e.u({type:String})],S.prototype,`locale`,void 0),e.n([e.u({type:String,attribute:`logo-link`})],S.prototype,`logoLink`,void 0),e.n([e.u({type:String,attribute:`logo-path`})],S.prototype,`logoPath`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],S.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:String})],S.prototype,`position`,void 0),e.n([e.u({type:String,attribute:`scroll-behavior`})],S.prototype,`scrollBehavior`,void 0),e.n([e.u({type:Number,attribute:`mobile-breakpoint`})],S.prototype,`mobileBreakpoint`,void 0),e.n([e.u({type:Number,attribute:`tablet-breakpoint`})],S.prototype,`tabletBreakpoint`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],S.prototype,`logOutButtonPlacement`,void 0),e.n([e.u({type:Boolean,attribute:`show-search`,converter:i.t})],S.prototype,`showSearch`,void 0),e.n([e.u({type:Boolean,attribute:`show-contact`,converter:i.t})],S.prototype,`showContact`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:i.t})],S.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`has-log-out`,converter:i.t})],S.prototype,`hasLogOut`,void 0),e.n([e.u({type:Object})],S.prototype,`user`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],S.prototype,`userMenu`,void 0),e.n([e.u({type:Object})],S.prototype,`representing`,void 0),e.n([e.l()],S.prototype,`openMenu`,void 0),e.n([e.l()],S.prototype,`fetchedData`,void 0),e.n([e.l()],S.prototype,`loadError`,void 0),e.n([e.l()],S.prototype,`headerAnchor`,void 0);try{e.d(`pkt-header-global`)(S)}catch{console.warn(`Forsøker å definere <pkt-header-global>, men den er allerede definert`)}var C=class extends r.t{constructor(...e){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}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._`
|
|
433
433
|
<pkt-header-global
|
|
434
|
-
data-url=${
|
|
435
|
-
locale=${
|
|
436
|
-
logo-link=${
|
|
437
|
-
logo-path=${
|
|
438
|
-
search-placeholder=${
|
|
439
|
-
mobile-breakpoint=${
|
|
440
|
-
tablet-breakpoint=${
|
|
434
|
+
data-url=${o.t(this.dataUrl)}
|
|
435
|
+
locale=${o.t(this.locale)}
|
|
436
|
+
logo-link=${o.t(this.logoLink)}
|
|
437
|
+
logo-path=${o.t(this.logoPath)}
|
|
438
|
+
search-placeholder=${o.t(this.hasAttribute(`search-placeholder`)?this.searchPlaceholder:void 0)}
|
|
439
|
+
mobile-breakpoint=${o.t(this.hasAttribute(`mobile-breakpoint`)?this.mobileBreakpoint:void 0)}
|
|
440
|
+
tablet-breakpoint=${o.t(this.hasAttribute(`tablet-breakpoint`)?this.tabletBreakpoint:void 0)}
|
|
441
441
|
log-out-button-placement=${this.logOutButtonPlacement}
|
|
442
442
|
position=${this.position}
|
|
443
443
|
scroll-behavior=${this.scrollBehavior}
|
|
@@ -452,10 +452,10 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
452
452
|
></pkt-header-global>
|
|
453
453
|
`}render(){return this.type===`global`?this.renderGlobal():e._`
|
|
454
454
|
<pkt-header-service
|
|
455
|
-
service-name=${
|
|
456
|
-
service-link=${
|
|
457
|
-
logo-link=${
|
|
458
|
-
logo-path=${
|
|
455
|
+
service-name=${o.t(this.serviceName)}
|
|
456
|
+
service-link=${o.t(this.serviceLink)}
|
|
457
|
+
logo-link=${o.t(this.logoLink)}
|
|
458
|
+
logo-path=${o.t(this.logoPath)}
|
|
459
459
|
search-placeholder=${this.searchPlaceholder}
|
|
460
460
|
search-value=${this.searchValue}
|
|
461
461
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
@@ -475,6 +475,6 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
|
|
|
475
475
|
.userMenu=${this.effectiveUserMenu}
|
|
476
476
|
.representing=${this.representing}
|
|
477
477
|
>
|
|
478
|
-
${this.hasSlotContent()?e._`<div class="pkt-contents">${i
|
|
478
|
+
${this.hasSlotContent()?e._`<div class="pkt-contents">${r.i(this)}</div>`:e.h}
|
|
479
479
|
</pkt-header-service>
|
|
480
|
-
`}};e.n([e.u({type:String})],C.prototype,`type`,void 0),e.n([e.u({type:String,attribute:`service-name`})],C.prototype,`serviceName`,void 0),e.n([e.u({type:String,attribute:`service-link`})],C.prototype,`serviceLink`,void 0),e.n([e.u({type:String,attribute:`logo-link`})],C.prototype,`logoLink`,void 0),e.n([e.u({type:String,attribute:`logo-path`})],C.prototype,`logoPath`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],C.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:String,attribute:`search-value`})],C.prototype,`searchValue`,void 0),e.n([e.u({type:Number,attribute:`mobile-breakpoint`})],C.prototype,`mobileBreakpoint`,void 0),e.n([e.u({type:Number,attribute:`tablet-breakpoint`})],C.prototype,`tabletBreakpoint`,void 0),e.n([e.u({type:String,attribute:`opened-menu`})],C.prototype,`openedMenu`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],C.prototype,`logOutButtonPlacement`,void 0),e.n([e.u({type:String})],C.prototype,`position`,void 0),e.n([e.u({type:String,attribute:`scroll-behavior`})],C.prototype,`scrollBehavior`,void 0),e.n([e.u({type:String,attribute:`slot-menu-variant`})],C.prototype,`slotMenuVariant`,void 0),e.n([e.u({type:String,attribute:`slot-menu-text`})],C.prototype,`slotMenuText`,void 0),e.n([e.u({type:Boolean,attribute:`hide-logo`,converter:
|
|
480
|
+
`}};e.n([e.u({type:String})],C.prototype,`type`,void 0),e.n([e.u({type:String,attribute:`service-name`})],C.prototype,`serviceName`,void 0),e.n([e.u({type:String,attribute:`service-link`})],C.prototype,`serviceLink`,void 0),e.n([e.u({type:String,attribute:`logo-link`})],C.prototype,`logoLink`,void 0),e.n([e.u({type:String,attribute:`logo-path`})],C.prototype,`logoPath`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],C.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:String,attribute:`search-value`})],C.prototype,`searchValue`,void 0),e.n([e.u({type:Number,attribute:`mobile-breakpoint`})],C.prototype,`mobileBreakpoint`,void 0),e.n([e.u({type:Number,attribute:`tablet-breakpoint`})],C.prototype,`tabletBreakpoint`,void 0),e.n([e.u({type:String,attribute:`opened-menu`})],C.prototype,`openedMenu`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],C.prototype,`logOutButtonPlacement`,void 0),e.n([e.u({type:String})],C.prototype,`position`,void 0),e.n([e.u({type:String,attribute:`scroll-behavior`})],C.prototype,`scrollBehavior`,void 0),e.n([e.u({type:String,attribute:`slot-menu-variant`})],C.prototype,`slotMenuVariant`,void 0),e.n([e.u({type:String,attribute:`slot-menu-text`})],C.prototype,`slotMenuText`,void 0),e.n([e.u({type:Boolean,attribute:`hide-logo`,converter:i.t})],C.prototype,`hideLogo`,void 0),e.n([e.u({type:Boolean,converter:i.t})],C.prototype,`compact`,void 0),e.n([e.u({type:Boolean,attribute:`show-search`,converter:i.t})],C.prototype,`showSearch`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:i.t})],C.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`has-log-out`,converter:i.t})],C.prototype,`hasLogOut`,void 0),e.n([e.u({type:Object})],C.prototype,`user`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],C.prototype,`userMenu`,void 0),e.n([e.u({type:Object})],C.prototype,`representing`,void 0),e.n([e.u({type:String,attribute:`data-url`})],C.prototype,`dataUrl`,void 0),e.n([e.u({type:Object,attribute:!1})],C.prototype,`data`,void 0),e.n([e.u({type:String})],C.prototype,`locale`,void 0),e.n([e.u({type:Boolean,attribute:`show-contact`,converter:i.t})],C.prototype,`showContact`,void 0),e.n([e.u({type:Array,attribute:`user-menu-footer`})],C.prototype,`userMenuFooter`,void 0),e.n([e.u({type:Array,attribute:`user-options`})],C.prototype,`userOptions`,void 0);try{e.d(`pkt-header`)(C)}catch{console.warn(`Forsøker å definere <pkt-header>, men den er allerede definert`)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return C}});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-mwwC2Rra.js";
|
|
2
2
|
import { t as s } from "./class-map-C4hdfSfY.js";
|
|
3
|
-
import { t as c } from "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "./
|
|
9
|
-
import "./button-
|
|
3
|
+
import { t as c } from "./format-BTeSVkED.js";
|
|
4
|
+
import { i as l, t as u } from "./element-with-slot-DQv0cbbD.js";
|
|
5
|
+
import { t as d } from "./booleanish-OQJTYSrw.js";
|
|
6
|
+
import { n as f, o as p, t as m } from "./fetch-header-footer-data-Pc32etrk.js";
|
|
7
|
+
import "./icon-JigbxxF7.js";
|
|
8
|
+
import { t as h } from "./if-defined-Bebu3LXY.js";
|
|
9
|
+
import "./button-B78im4wB.js";
|
|
10
10
|
import { n as g, t as _ } from "./ref-CCSGk4MP.js";
|
|
11
11
|
import { n as v, t as y } from "./focus-trap-DG3pEuyJ.js";
|
|
12
12
|
import { n as b, t as x } from "./scroll-lock-DAbNKAUy.js";
|
|
13
|
-
import "./link-
|
|
14
|
-
import "./textinput-
|
|
15
|
-
import "./searchinput-
|
|
16
|
-
import "./header-menu-
|
|
13
|
+
import "./link-CmZwAw5u.js";
|
|
14
|
+
import "./textinput-s-qz2xSC.js";
|
|
15
|
+
import "./searchinput-Co8tcq-l.js";
|
|
16
|
+
import "./header-menu-ANj5nL2M.js";
|
|
17
17
|
//#region ../../shared-types/header.ts
|
|
18
18
|
var S = (e) => typeof e.target == "string" ? {
|
|
19
19
|
title: e.title,
|
|
@@ -154,7 +154,7 @@ var S = (e) => typeof e.target == "string" ? {
|
|
|
154
154
|
<div class="pkt-user-menu__label">${r.representing}</div>
|
|
155
155
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
156
156
|
${this.representing.orgNumber ? e`<div class="pkt-user-menu__org-number">
|
|
157
|
-
${
|
|
157
|
+
${c(r.orgNumber, { number: this.representing.orgNumber })}
|
|
158
158
|
</div>` : n}
|
|
159
159
|
${this.canChangeRepresentation ? e`
|
|
160
160
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
@@ -209,11 +209,11 @@ i([o({ type: Object })], E.prototype, "user", void 0), i([o({
|
|
|
209
209
|
})], E.prototype, "userMenu", void 0), i([o({
|
|
210
210
|
type: Boolean,
|
|
211
211
|
attribute: "can-change-representation",
|
|
212
|
-
converter:
|
|
212
|
+
converter: d
|
|
213
213
|
})], E.prototype, "canChangeRepresentation", void 0), i([o({
|
|
214
214
|
type: Boolean,
|
|
215
215
|
attribute: "logout-on-click",
|
|
216
|
-
converter:
|
|
216
|
+
converter: d
|
|
217
217
|
})], E.prototype, "logoutOnClick", void 0);
|
|
218
218
|
try {
|
|
219
219
|
t("pkt-header-user-menu")(E);
|
|
@@ -224,9 +224,9 @@ try {
|
|
|
224
224
|
//#region src/components/header/header-service.ts
|
|
225
225
|
var D = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
226
226
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || D);
|
|
227
|
-
var O = class extends
|
|
227
|
+
var O = class extends u {
|
|
228
228
|
constructor(...e) {
|
|
229
|
-
super(...e), this.logoLink =
|
|
229
|
+
super(...e), this.logoLink = p, this.logoPath = typeof window < "u" ? window.pktLogoPath : D, 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.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 = _(), this.userContainerRef = _(), this.slotContainerRef = _(), this.searchContainerRef = _(), this.slotContentRef = _(), this.searchMenuRef = _(), this.chrome = new T(this, () => ({
|
|
230
230
|
mobileBreakpoint: this.mobileBreakpoint,
|
|
231
231
|
tabletBreakpoint: this.tabletBreakpoint,
|
|
232
232
|
position: this.position,
|
|
@@ -439,7 +439,7 @@ var O = class extends d {
|
|
|
439
439
|
@click=${this.handleSlotContentClick}
|
|
440
440
|
${g(this.slotContentRef)}
|
|
441
441
|
>
|
|
442
|
-
${
|
|
442
|
+
${l(this)}
|
|
443
443
|
</div>
|
|
444
444
|
</div>
|
|
445
445
|
`;
|
|
@@ -671,22 +671,22 @@ i([o({
|
|
|
671
671
|
})], O.prototype, "slotMenuText", void 0), i([o({
|
|
672
672
|
type: Boolean,
|
|
673
673
|
attribute: "hide-logo",
|
|
674
|
-
converter:
|
|
674
|
+
converter: d
|
|
675
675
|
})], O.prototype, "hideLogo", void 0), i([o({
|
|
676
676
|
type: Boolean,
|
|
677
|
-
converter:
|
|
677
|
+
converter: d
|
|
678
678
|
})], O.prototype, "compact", void 0), i([o({
|
|
679
679
|
type: Boolean,
|
|
680
680
|
attribute: "show-search",
|
|
681
|
-
converter:
|
|
681
|
+
converter: d
|
|
682
682
|
})], O.prototype, "showSearch", void 0), i([o({
|
|
683
683
|
type: Boolean,
|
|
684
684
|
attribute: "can-change-representation",
|
|
685
|
-
converter:
|
|
685
|
+
converter: d
|
|
686
686
|
})], O.prototype, "canChangeRepresentation", void 0), i([o({
|
|
687
687
|
type: Boolean,
|
|
688
688
|
attribute: "has-log-out",
|
|
689
|
-
converter:
|
|
689
|
+
converter: d
|
|
690
690
|
})], O.prototype, "hasLogOut", void 0), i([o({ type: Object })], O.prototype, "user", void 0), i([o({
|
|
691
691
|
type: Array,
|
|
692
692
|
attribute: "user-menu"
|
|
@@ -702,7 +702,7 @@ var k = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
|
702
702
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || k);
|
|
703
703
|
var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-header-global-search-panel", N = "pkt-header-global-search-toggle", P = class extends a {
|
|
704
704
|
constructor(...e) {
|
|
705
|
-
super(...e), this.locale = "nb-NO", this.logoLink =
|
|
705
|
+
super(...e), this.locale = "nb-NO", this.logoLink = p, this.logoPath = typeof window < "u" ? window.pktLogoPath : k, 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 = {
|
|
706
706
|
top: 0,
|
|
707
707
|
left: 0,
|
|
708
708
|
width: 0
|
|
@@ -780,7 +780,7 @@ var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-
|
|
|
780
780
|
async loadData() {
|
|
781
781
|
this.abortController?.abort(), this.abortController = new AbortController(), this.loadError = !1;
|
|
782
782
|
try {
|
|
783
|
-
let e = await
|
|
783
|
+
let e = await m(this.dataUrl, this.abortController.signal);
|
|
784
784
|
this.fetchedData = e, this.emitDataLoaded(e);
|
|
785
785
|
} catch (e) {
|
|
786
786
|
if (e.name === "AbortError") return;
|
|
@@ -802,7 +802,7 @@ var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-
|
|
|
802
802
|
return this.data ?? this.fetchedData;
|
|
803
803
|
}
|
|
804
804
|
get localeData() {
|
|
805
|
-
return
|
|
805
|
+
return f(this.effectiveData, this.locale);
|
|
806
806
|
}
|
|
807
807
|
get shouldHideOnScroll() {
|
|
808
808
|
return this.scrollBehavior === "hide";
|
|
@@ -862,7 +862,7 @@ var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-
|
|
|
862
862
|
}
|
|
863
863
|
renderLogo() {
|
|
864
864
|
let t = this.pktStrings.get("header"), n = e`
|
|
865
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
865
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${h(this.logoPath)}></pkt-icon>
|
|
866
866
|
`;
|
|
867
867
|
return this.logoLink ? e`
|
|
868
868
|
<span class="pkt-header-global__logo">
|
|
@@ -888,9 +888,9 @@ var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-
|
|
|
888
888
|
input-size=${this.isTablet ? "small" : "medium"}
|
|
889
889
|
fullwidth
|
|
890
890
|
id=${r.input.id || "pkt-header-global-search"}
|
|
891
|
-
name=${
|
|
892
|
-
placeholder=${
|
|
893
|
-
aria-label=${
|
|
891
|
+
name=${h(r.input.name)}
|
|
892
|
+
placeholder=${h(i)}
|
|
893
|
+
aria-label=${h(t.i18n?.search)}
|
|
894
894
|
action=${r.endpoint}
|
|
895
895
|
method="get"
|
|
896
896
|
@pkt-search=${(e) => this.handleSearch(e.detail.value)}
|
|
@@ -945,7 +945,7 @@ var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-
|
|
|
945
945
|
id=${N}
|
|
946
946
|
class="pkt-header-global__search-toggle"
|
|
947
947
|
skin="primary"
|
|
948
|
-
color=${
|
|
948
|
+
color=${h(r ? void 0 : "yellow")}
|
|
949
949
|
variant="icon-only"
|
|
950
950
|
iconName=${r ? "close" : "magnifying-glass-big"}
|
|
951
951
|
size=${this.isMobile ? "small" : "medium"}
|
|
@@ -972,9 +972,9 @@ var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-
|
|
|
972
972
|
appearance="global"
|
|
973
973
|
fullwidth
|
|
974
974
|
id=${r.input.id || "pkt-header-global-search"}
|
|
975
|
-
name=${
|
|
976
|
-
placeholder=${
|
|
977
|
-
aria-label=${
|
|
975
|
+
name=${h(r.input.name)}
|
|
976
|
+
placeholder=${h(i)}
|
|
977
|
+
aria-label=${h(t.i18n?.search || this.pktStrings.get("header").search)}
|
|
978
978
|
action=${r.endpoint}
|
|
979
979
|
method="get"
|
|
980
980
|
@pkt-search=${(e) => this.handleSearch(e.detail.value)}
|
|
@@ -1132,19 +1132,19 @@ i([o({
|
|
|
1132
1132
|
})], P.prototype, "logOutButtonPlacement", void 0), i([o({
|
|
1133
1133
|
type: Boolean,
|
|
1134
1134
|
attribute: "show-search",
|
|
1135
|
-
converter:
|
|
1135
|
+
converter: d
|
|
1136
1136
|
})], P.prototype, "showSearch", void 0), i([o({
|
|
1137
1137
|
type: Boolean,
|
|
1138
1138
|
attribute: "show-contact",
|
|
1139
|
-
converter:
|
|
1139
|
+
converter: d
|
|
1140
1140
|
})], P.prototype, "showContact", void 0), i([o({
|
|
1141
1141
|
type: Boolean,
|
|
1142
1142
|
attribute: "can-change-representation",
|
|
1143
|
-
converter:
|
|
1143
|
+
converter: d
|
|
1144
1144
|
})], P.prototype, "canChangeRepresentation", void 0), i([o({
|
|
1145
1145
|
type: Boolean,
|
|
1146
1146
|
attribute: "has-log-out",
|
|
1147
|
-
converter:
|
|
1147
|
+
converter: d
|
|
1148
1148
|
})], P.prototype, "hasLogOut", void 0), i([o({ type: Object })], P.prototype, "user", void 0), i([o({
|
|
1149
1149
|
type: Array,
|
|
1150
1150
|
attribute: "user-menu"
|
|
@@ -1156,7 +1156,7 @@ try {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
//#endregion
|
|
1158
1158
|
//#region src/components/header/header.ts
|
|
1159
|
-
var F = class extends
|
|
1159
|
+
var F = class extends u {
|
|
1160
1160
|
constructor(...e) {
|
|
1161
1161
|
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;
|
|
1162
1162
|
}
|
|
@@ -1177,13 +1177,13 @@ var F = class extends d {
|
|
|
1177
1177
|
renderGlobal() {
|
|
1178
1178
|
return e`
|
|
1179
1179
|
<pkt-header-global
|
|
1180
|
-
data-url=${
|
|
1181
|
-
locale=${
|
|
1182
|
-
logo-link=${
|
|
1183
|
-
logo-path=${
|
|
1184
|
-
search-placeholder=${
|
|
1185
|
-
mobile-breakpoint=${
|
|
1186
|
-
tablet-breakpoint=${
|
|
1180
|
+
data-url=${h(this.dataUrl)}
|
|
1181
|
+
locale=${h(this.locale)}
|
|
1182
|
+
logo-link=${h(this.logoLink)}
|
|
1183
|
+
logo-path=${h(this.logoPath)}
|
|
1184
|
+
search-placeholder=${h(this.hasAttribute("search-placeholder") ? this.searchPlaceholder : void 0)}
|
|
1185
|
+
mobile-breakpoint=${h(this.hasAttribute("mobile-breakpoint") ? this.mobileBreakpoint : void 0)}
|
|
1186
|
+
tablet-breakpoint=${h(this.hasAttribute("tablet-breakpoint") ? this.tabletBreakpoint : void 0)}
|
|
1187
1187
|
log-out-button-placement=${this.logOutButtonPlacement}
|
|
1188
1188
|
position=${this.position}
|
|
1189
1189
|
scroll-behavior=${this.scrollBehavior}
|
|
@@ -1201,10 +1201,10 @@ var F = class extends d {
|
|
|
1201
1201
|
render() {
|
|
1202
1202
|
return this.type === "global" ? this.renderGlobal() : e`
|
|
1203
1203
|
<pkt-header-service
|
|
1204
|
-
service-name=${
|
|
1205
|
-
service-link=${
|
|
1206
|
-
logo-link=${
|
|
1207
|
-
logo-path=${
|
|
1204
|
+
service-name=${h(this.serviceName)}
|
|
1205
|
+
service-link=${h(this.serviceLink)}
|
|
1206
|
+
logo-link=${h(this.logoLink)}
|
|
1207
|
+
logo-path=${h(this.logoPath)}
|
|
1208
1208
|
search-placeholder=${this.searchPlaceholder}
|
|
1209
1209
|
search-value=${this.searchValue}
|
|
1210
1210
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
@@ -1224,7 +1224,7 @@ var F = class extends d {
|
|
|
1224
1224
|
.userMenu=${this.effectiveUserMenu}
|
|
1225
1225
|
.representing=${this.representing}
|
|
1226
1226
|
>
|
|
1227
|
-
${this.hasSlotContent() ? e`<div class="pkt-contents">${
|
|
1227
|
+
${this.hasSlotContent() ? e`<div class="pkt-contents">${l(this)}</div>` : n}
|
|
1228
1228
|
</pkt-header-service>
|
|
1229
1229
|
`;
|
|
1230
1230
|
}
|
|
@@ -1271,22 +1271,22 @@ i([o({ type: String })], F.prototype, "type", void 0), i([o({
|
|
|
1271
1271
|
})], F.prototype, "slotMenuText", void 0), i([o({
|
|
1272
1272
|
type: Boolean,
|
|
1273
1273
|
attribute: "hide-logo",
|
|
1274
|
-
converter:
|
|
1274
|
+
converter: d
|
|
1275
1275
|
})], F.prototype, "hideLogo", void 0), i([o({
|
|
1276
1276
|
type: Boolean,
|
|
1277
|
-
converter:
|
|
1277
|
+
converter: d
|
|
1278
1278
|
})], F.prototype, "compact", void 0), i([o({
|
|
1279
1279
|
type: Boolean,
|
|
1280
1280
|
attribute: "show-search",
|
|
1281
|
-
converter:
|
|
1281
|
+
converter: d
|
|
1282
1282
|
})], F.prototype, "showSearch", void 0), i([o({
|
|
1283
1283
|
type: Boolean,
|
|
1284
1284
|
attribute: "can-change-representation",
|
|
1285
|
-
converter:
|
|
1285
|
+
converter: d
|
|
1286
1286
|
})], F.prototype, "canChangeRepresentation", void 0), i([o({
|
|
1287
1287
|
type: Boolean,
|
|
1288
1288
|
attribute: "has-log-out",
|
|
1289
|
-
converter:
|
|
1289
|
+
converter: d
|
|
1290
1290
|
})], F.prototype, "hasLogOut", void 0), i([o({ type: Object })], F.prototype, "user", void 0), i([o({
|
|
1291
1291
|
type: Array,
|
|
1292
1292
|
attribute: "user-menu"
|
|
@@ -1299,7 +1299,7 @@ i([o({ type: String })], F.prototype, "type", void 0), i([o({
|
|
|
1299
1299
|
})], F.prototype, "data", void 0), i([o({ type: String })], F.prototype, "locale", void 0), i([o({
|
|
1300
1300
|
type: Boolean,
|
|
1301
1301
|
attribute: "show-contact",
|
|
1302
|
-
converter:
|
|
1302
|
+
converter: d
|
|
1303
1303
|
})], F.prototype, "showContact", void 0), i([o({
|
|
1304
1304
|
type: Array,
|
|
1305
1305
|
attribute: "user-menu-footer"
|
|
@@ -2,8 +2,8 @@ import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./elemen
|
|
|
2
2
|
import { t as s } from "./class-map-C4hdfSfY.js";
|
|
3
3
|
import { t as c } from "./booleanish-OQJTYSrw.js";
|
|
4
4
|
import { a as l, i as u, n as d, r as f, t as p } from "./fetch-header-footer-data-Pc32etrk.js";
|
|
5
|
-
import "./icon-
|
|
6
|
-
import "./accordion-
|
|
5
|
+
import "./icon-JigbxxF7.js";
|
|
6
|
+
import "./accordion-BJh6X1Ek.js";
|
|
7
7
|
//#region src/components/header-menu/header-menu.ts
|
|
8
8
|
var m = class extends a {
|
|
9
9
|
constructor(...e) {
|