@oslokommune/punkt-elements 17.1.3 → 18.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/{accordion-BeLvLPrB.js → accordion-CcUosZjL.js} +27 -27
- package/dist/{accordion-B3GBlvUC.cjs → accordion-k0pWTG1X.cjs} +5 -5
- package/dist/alert-BD8YVKia.cjs +35 -0
- package/dist/{alert-DKK_Tb9J.js → alert-Bmaly2Yo.js} +57 -52
- package/dist/{async-directive-BPf6K-V2.js → async-directive-COqx0IYj.js} +5 -5
- package/dist/{async-directive-Da7TJpnq.cjs → async-directive-DN2eg9gA.cjs} +1 -1
- package/dist/{backlink-D1y26pj3.js → backlink-C_ZO-ZbR.js} +9 -9
- package/dist/{backlink-CMmrKTe4.cjs → backlink-Ch64Pivx.cjs} +3 -3
- package/dist/base-elements/element.d.ts +13 -1
- package/dist/base-elements/input-element.d.ts +4 -2
- package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-CF_gAbUk.js} +16 -16
- package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-CzzbardP.cjs} +7 -7
- package/dist/{button-2-OSPJkj.js → button-C1CQSASU.js} +28 -28
- package/dist/{button-CE97NQIk.cjs → button-CF3dNKeI.cjs} +7 -7
- package/dist/{calendar-kn4SrtJy.cjs → calendar-BxF81kB9.cjs} +28 -27
- package/dist/{calendar-pOW3R5Pw.js → calendar-DRmxORMc.js} +82 -68
- package/dist/{card-CETDFkxR.cjs → card-Cg1daj05.cjs} +26 -26
- package/dist/{card-zQ0eKRMV.js → card-W_Jb0Tlo.js} +44 -44
- package/dist/{checkbox-CQNr_sEg.cjs → checkbox-BHQv8lHq.cjs} +11 -11
- package/dist/{checkbox-CH7NpINF.js → checkbox-BQw2dMSX.js} +23 -23
- package/dist/{class-map-BeimMvPv.cjs → class-map-C33ixq7O.cjs} +1 -1
- package/dist/{class-map-CnWCnBSX.js → class-map-wh4Yi3oj.js} +3 -3
- package/dist/{combobox-Bvg0UO9w.cjs → combobox-BpZow9OU.cjs} +19 -18
- package/dist/{combobox-CRdYYlxu.js → combobox-C9wwnUfM.js} +55 -54
- package/dist/components/accordion/accordion.d.ts +2 -6
- package/dist/components/accordion/accordionitem.d.ts +2 -8
- package/dist/components/alert/alert.d.ts +2 -2
- package/dist/components/backlink/backlink.d.ts +4 -5
- package/dist/components/backlink/backlink.test.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +6 -7
- package/dist/components/breadcrumbs/index.d.ts +1 -1
- package/dist/components/calendar/calendar.d.ts +21 -6
- package/dist/components/checkbox/checkbox.d.ts +4 -2
- package/dist/components/combobox/combobox-base.d.ts +2 -1
- package/dist/components/consent/strings.d.ts +1 -85
- package/dist/components/datepicker/datepicker-base.d.ts +0 -3
- package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
- package/dist/components/datepicker/datepicker-range.d.ts +0 -2
- package/dist/components/datepicker/datepicker-single.d.ts +0 -2
- package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
- package/dist/components/fileupload/fileupload-base.d.ts +7 -4
- package/dist/components/fileupload/fileupload-types.d.ts +5 -43
- package/dist/components/header/header-service.d.ts +3 -1
- package/dist/components/header/header.d.ts +2 -1
- package/dist/components/helptext/helptext.d.ts +2 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
- package/dist/components/radiobutton/radiobutton.d.ts +4 -2
- package/dist/components/searchinput/searchinput.d.ts +2 -1
- package/dist/{consent-CyY3RyoC.cjs → consent-CPtr7cBw.cjs} +5 -5
- package/dist/{consent-DZEkhgJ1.js → consent-D8MrqGKk.js} +10 -10
- package/dist/controllers/strings-controller.d.ts +27 -0
- package/dist/{datepicker-ButIas85.js → datepicker-D4YnAtWG.js} +104 -104
- package/dist/{datepicker-VTqSDQk5.cjs → datepicker-DaoumZT9.cjs} +38 -37
- package/dist/define-component-spec-BYOSeplU.js +6 -0
- package/dist/define-component-spec-DBNd2FJY.cjs +1 -0
- package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BWSAVe00.js} +1 -1
- package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-C6J4AkFk.cjs} +1 -1
- package/dist/docs/components/alert.d.ts +2 -3
- package/dist/docs/components/fileupload.d.ts +1 -0
- package/dist/element-DiFhBcIl.cjs +2 -0
- package/dist/{element-ChsFgr_B.js → element-WEzISABa.js} +241 -100
- package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-BKYUx4gb.js} +4 -4
- package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-CBK4zrdN.cjs} +1 -1
- package/dist/{fileupload-D5IQ9HDe.js → fileupload-DEHSETw0.js} +340 -652
- package/dist/fileupload-DWu6FIMv.cjs +402 -0
- package/dist/{footer-DrR64HiK.js → footer-BJLEw6Ab.js} +91 -91
- package/dist/{footer-DbYQUYNR.cjs → footer-D_yYWkQ6.cjs} +32 -32
- package/dist/format-B8meU8Tm.cjs +1 -0
- package/dist/format-BTeSVkED.js +18 -0
- package/dist/{header-ClgIac6n.cjs → header-B7_4Cwaq.cjs} +84 -84
- package/dist/{header-KvJ1mGwA.js → header-DLVq7-dM.js} +267 -264
- package/dist/{header-menu-hVPXsb8g.js → header-menu-BsrrTjpT.js} +75 -75
- package/dist/{header-menu-BAsUNKSx.cjs → header-menu-m7nOOC1g.cjs} +24 -24
- package/dist/{heading-g-_IUB5T.js → heading-DSArgrDK.js} +16 -16
- package/dist/{heading-CFmiSuCQ.cjs → heading-_RPw2UW9.cjs} +1 -1
- package/dist/helptext-QMVsW5g6.cjs +27 -0
- package/dist/{helptext-DZng1D5i.js → helptext-dtVVufNH.js} +18 -19
- package/dist/{icon-D-LA22xD.js → icon-DEtOSWRK.js} +17 -17
- package/dist/{icon-9iwd2F2l.cjs → icon-DIavy2cB.cjs} +1 -1
- package/dist/{if-defined-CGzIlZ9-.js → if-defined-BmnvvxtR.js} +1 -1
- package/dist/if-defined-Dc3xFDaM.cjs +1 -0
- package/dist/input-element-DQY1Rpbp.cjs +1 -0
- package/dist/{input-element-DBMNBplu.js → input-element-IBypGOaV.js} +121 -120
- package/dist/input-wrapper-CQgAL1Br.js +308 -0
- package/dist/input-wrapper-mJZLVXy_.cjs +58 -0
- package/dist/link-DwLeY37f.js +131 -0
- package/dist/link-yk4IXDWm.cjs +7 -0
- package/dist/linkcard-BinKnxQF.cjs +13 -0
- package/dist/{linkcard-zqbg7Oqm.js → linkcard-D5DXpmXI.js} +16 -16
- package/dist/{listbox-Dc4rGdPi.cjs → listbox-C5zTRNAO.cjs} +15 -15
- package/dist/{listbox-va_E8afs.js → listbox-C8ooO8qZ.js} +100 -99
- package/dist/{loader-D_RDICnw.js → loader-C3HyayzL.js} +14 -14
- package/dist/{loader-CMUkVJmE.cjs → loader-DHF7M5Vn.cjs} +5 -5
- package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-DqYf6VmQ.cjs} +5 -5
- package/dist/{messagebox-Cw-OWDya.js → messagebox-u8i3R5QA.js} +15 -15
- package/dist/{modal-BtInv031.cjs → modal-CnJ9y2TQ.cjs} +8 -8
- package/dist/{modal-D0t_X2dX.js → modal-V-jEe0aY.js} +20 -20
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.cjs +1 -1
- package/dist/pkt-breadcrumbs.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +35 -34
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-C5EBX2T0.cjs → pkt-options-controller-BhMNCWcc.cjs} +1 -1
- package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-CuQ6SClv.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{progressbar-CbcfLerF.js → progressbar-DS4i8IWq.js} +21 -21
- package/dist/{progressbar-D5MmnQId.cjs → progressbar-DY5hxImR.cjs} +5 -5
- package/dist/{radiobutton-BUnf3EPi.js → radiobutton-BhvZztMZ.js} +24 -24
- package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-BswqwRnA.cjs} +8 -8
- package/dist/{ref-CQoEIIp0.cjs → ref-DZmN5Qgj.cjs} +1 -1
- package/dist/{ref-CWD6PjVd.js → ref-OU8ryfP6.js} +2 -2
- package/dist/{repeat-sY6B7fAT.cjs → repeat-DIa_g6WL.cjs} +1 -1
- package/dist/{repeat-C02g7d5S.js → repeat-Dx2H127b.js} +4 -4
- package/dist/{searchinput-DwnjsvJ1.js → searchinput-CJo1PpM7.js} +43 -43
- package/dist/searchinput-Cl46nW0r.cjs +60 -0
- package/dist/{select-DMre80qs.js → select-CBrjauXT.js} +21 -20
- package/dist/{select-BOJi6H6T.cjs → select-Dman8Skr.cjs} +4 -3
- package/dist/shared-strings/consent.d.ts +71 -0
- package/dist/shared-strings/format.d.ts +21 -0
- package/dist/shared-strings/index.d.ts +14 -0
- package/dist/shared-strings/nb.d.ts +121 -0
- package/dist/shared-strings/resolve.d.ts +12 -0
- package/dist/shared-strings/store.d.ts +27 -0
- package/dist/shared-strings/types.d.ts +40 -0
- package/dist/shared-types/accordion.d.ts +58 -0
- package/dist/shared-types/alert.d.ts +20 -0
- package/dist/shared-types/aria.d.ts +2 -1
- package/dist/shared-types/backlink.d.ts +23 -0
- package/dist/shared-types/breadcrumbs.d.ts +33 -0
- package/dist/shared-types/fileupload.d.ts +55 -28
- package/dist/shared-types/footer.d.ts +10 -0
- package/dist/shared-types/form-field.d.ts +45 -0
- package/dist/shared-types/header-footer.d.ts +2 -0
- package/dist/shared-types/index.d.ts +15 -6
- package/dist/shared-types/render-link.d.ts +22 -0
- package/dist/shared-types/skin.d.ts +2 -9
- package/dist/shared-utils/combobox/index.d.ts +1 -0
- package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/messages.d.ts +7 -0
- package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
- package/dist/{tabs-Cf9ai0FD.cjs → tabs-C1m5rSrR.cjs} +7 -7
- package/dist/{tabs-TvxgbrCF.js → tabs-Xu3mIedh.js} +32 -32
- package/dist/{tag-Ds6n1LIs.js → tag-Azkjhkeu.js} +33 -32
- package/dist/tag-BS6dDPxY.cjs +27 -0
- package/dist/tests/strings-override.test.d.ts +0 -0
- package/dist/{textarea-vfzIcXhX.js → textarea-D4qXcVGD.js} +30 -29
- package/dist/{textarea-BydiLM9Z.cjs → textarea-DftUkR6w.cjs} +3 -2
- package/dist/{textinput-DGdicNSx.cjs → textinput-Ar-1Sbqy.cjs} +13 -12
- package/dist/{textinput-CMP2jPP_.js → textinput-iCgwwNPU.js} +28 -27
- package/dist/{timepicker-ClwgYywH.js → timepicker-W6HVWtmA.js} +67 -64
- package/dist/timepicker-dpAF7h49.cjs +196 -0
- package/package.json +3 -3
- package/src/components/accordion/accordion.ts +2 -10
- package/src/components/accordion/accordionitem.ts +2 -9
- package/src/components/alert/alert.ts +19 -10
- package/src/components/backlink/backlink.test.ts +3 -3
- package/src/components/backlink/backlink.ts +5 -7
- package/src/components/breadcrumbs/breadcrumbs.ts +9 -10
- package/src/components/breadcrumbs/index.ts +1 -1
- package/src/components/calendar/calendar.ts +56 -26
- package/src/components/checkbox/checkbox.test.ts +0 -2
- package/src/components/checkbox/checkbox.ts +8 -4
- package/src/components/combobox/combobox-base.ts +2 -1
- package/src/components/combobox/combobox-value.ts +10 -9
- package/src/components/combobox/combobox.selection.test.ts +5 -1
- package/src/components/combobox/combobox.ts +4 -1
- package/src/components/consent/strings.ts +1 -125
- package/src/components/datepicker/date-tags.ts +4 -1
- package/src/components/datepicker/datepicker-base.ts +2 -6
- package/src/components/datepicker/datepicker-multiple.ts +0 -3
- package/src/components/datepicker/datepicker-range.ts +4 -7
- package/src/components/datepicker/datepicker-single.ts +0 -3
- package/src/components/datepicker/datepicker-utils.test.ts +5 -5
- package/src/components/datepicker/datepicker-utils.ts +6 -11
- package/src/components/datepicker/datepicker.ts +8 -1
- package/src/components/fileupload/fileupload-base.ts +29 -19
- package/src/components/fileupload/fileupload-renderers.ts +2 -1
- package/src/components/fileupload/fileupload-types.ts +5 -42
- package/src/components/fileupload/fileupload.test.ts +16 -0
- package/src/components/fileupload/fileupload.ts +19 -15
- package/src/components/header/header-global.ts +3 -3
- package/src/components/header/header-service.ts +13 -8
- package/src/components/header/header.ts +2 -1
- package/src/components/helptext/helptext.test.ts +1 -1
- package/src/components/helptext/helptext.ts +3 -3
- package/src/components/index.ts +10 -1
- package/src/components/input-wrapper/input-wrapper.ts +18 -10
- package/src/components/link/link.ts +8 -3
- package/src/components/listbox/listbox.ts +3 -3
- package/src/components/radiobutton/radiobutton.ts +8 -4
- package/src/components/searchinput/searchinput.ts +5 -3
- package/src/components/select/select.ts +1 -0
- package/src/components/tag/tag.ts +2 -1
- package/src/components/textarea/textarea.ts +1 -0
- package/src/components/textinput/textinput.ts +1 -0
- package/src/components/timepicker/timepicker.ts +23 -21
- package/dist/alert-Cs4Rmq_J.cjs +0 -33
- package/dist/element-BA8v6S7z.cjs +0 -2
- package/dist/fileupload-BeWiTAoW.cjs +0 -401
- package/dist/helptext-CTtKJcML.cjs +0 -27
- package/dist/if-defined-B89_ZeCj.cjs +0 -1
- package/dist/input-element-DYmQw-fH.cjs +0 -1
- package/dist/input-wrapper-BmxNvznr.js +0 -128
- package/dist/input-wrapper-D-fPaTbY.js +0 -176
- package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
- package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
- package/dist/link-D-Eqm5KH.js +0 -98
- package/dist/link-DK7gvmnj.cjs +0 -7
- package/dist/linkcard-B29cmZqh.cjs +0 -13
- package/dist/searchinput-Bh975rjX.cjs +0 -60
- package/dist/tag-CzojNU7z.cjs +0 -27
- package/dist/timepicker-DYrnLHqN.cjs +0 -195
- package/dist/translations/no.json.d.ts +0 -94
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-DiFhBcIl.cjs"),t=require("./class-map-C33ixq7O.cjs"),n=require("./element-with-slot-CBK4zrdN.cjs");require("./icon-DIavy2cB.cjs");const r=require("./if-defined-Dc3xFDaM.cjs");require("./button-CF3dNKeI.cjs");const i=require("./ref-DZmN5Qgj.cjs"),a=require("./booleanish-BF8l4scU.cjs"),o=require("./fetch-header-footer-data-CUKV0biS.cjs"),s=require("./focus-trap-DSv4Ifqm.cjs"),c=require("./scroll-lock-BN8lOhV5.cjs");require("./link-yk4IXDWm.cjs"),require("./textinput-Ar-1Sbqy.cjs"),require("./searchinput-Cl46nW0r.cjs"),require("./header-menu-m7nOOC1g.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._`
|
|
2
2
|
<pkt-link
|
|
3
|
-
icon-name=${n.iconName||e.
|
|
3
|
+
icon-name=${n.iconName||e.h}
|
|
4
4
|
href=${n.href}
|
|
5
5
|
class="pkt-user-menu__link ${r||``}"
|
|
6
6
|
>
|
|
7
7
|
${n.title}
|
|
8
8
|
</pkt-link>
|
|
9
|
-
`:e.
|
|
9
|
+
`:e._`
|
|
10
10
|
<button class=${a} type="button" @click=${()=>this.handleMenuItemClick(n)}>
|
|
11
|
-
${n.iconName?e.
|
|
11
|
+
${n.iconName?e._`<pkt-icon
|
|
12
12
|
name=${n.iconName}
|
|
13
13
|
class="pkt-link__icon"
|
|
14
14
|
aria-hidden="true"
|
|
15
|
-
></pkt-icon>`:e.
|
|
15
|
+
></pkt-icon>`:e.h}
|
|
16
16
|
${n.title}
|
|
17
17
|
</button>
|
|
18
|
-
`}renderLinkSection(t){return e.
|
|
18
|
+
`}renderLinkSection(t){return e._`
|
|
19
19
|
<ul class="pkt-user-menu__sublist">
|
|
20
|
-
${t.map(t=>e.
|
|
20
|
+
${t.map(t=>e._`
|
|
21
21
|
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(t)}</li>
|
|
22
22
|
`)}
|
|
23
23
|
</ul>
|
|
24
|
-
`}render(){let t=this.userMenu?.map(u);return e.
|
|
24
|
+
`}render(){let t=this.userMenu?.map(u);return e._`
|
|
25
25
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
26
26
|
<ul class="pkt-user-menu__list">
|
|
27
27
|
<!-- User section -->
|
|
28
|
-
${this.user?e.
|
|
28
|
+
${this.user?e._`
|
|
29
29
|
<li class="pkt-user-menu__item">
|
|
30
30
|
<div class="pkt-user-menu__label">Pålogget som</div>
|
|
31
31
|
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
32
|
-
${this.formattedLastLoggedIn?e.
|
|
32
|
+
${this.formattedLastLoggedIn?e._`
|
|
33
33
|
<div class="pkt-user-menu__last-logged-in">
|
|
34
34
|
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
35
35
|
</div>
|
|
36
|
-
`:e.
|
|
36
|
+
`:e.h}
|
|
37
37
|
</li>
|
|
38
|
-
`:e.
|
|
38
|
+
`:e.h}
|
|
39
39
|
|
|
40
40
|
<!-- User menu items -->
|
|
41
|
-
${t&&t.length>0?e.
|
|
41
|
+
${t&&t.length>0?e._`
|
|
42
42
|
<li class="pkt-user-menu__item">${this.renderLinkSection(t)}</li>
|
|
43
|
-
`:e.
|
|
43
|
+
`:e.h}
|
|
44
44
|
|
|
45
45
|
<!-- Representing section -->
|
|
46
|
-
${this.representing?e.
|
|
46
|
+
${this.representing?e._`
|
|
47
47
|
<li class="pkt-user-menu__item">
|
|
48
48
|
<div class="pkt-user-menu__label">Representerer</div>
|
|
49
49
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
50
|
-
${this.representing.orgNumber?e.
|
|
50
|
+
${this.representing.orgNumber?e._`<div class="pkt-user-menu__org-number">
|
|
51
51
|
Org.nr. ${this.representing.orgNumber}
|
|
52
|
-
</div>`:e.
|
|
53
|
-
${this.canChangeRepresentation?e.
|
|
52
|
+
</div>`:e.h}
|
|
53
|
+
${this.canChangeRepresentation?e._`
|
|
54
54
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
55
55
|
<li class="pkt-user-menu__subitem">
|
|
56
56
|
${this.renderLinkOrButton({title:`Endre organisasjon`,iconName:`cogwheel`,onClick:()=>this.handleChangeRepresentation()})}
|
|
57
57
|
</li>
|
|
58
58
|
</ul>
|
|
59
|
-
`:e.
|
|
59
|
+
`:e.h}
|
|
60
60
|
</li>
|
|
61
|
-
`:e.
|
|
61
|
+
`:e.h}
|
|
62
62
|
|
|
63
63
|
<!-- Change representation without representing object -->
|
|
64
|
-
${!this.representing&&this.canChangeRepresentation?e.
|
|
64
|
+
${!this.representing&&this.canChangeRepresentation?e._`
|
|
65
65
|
<li class="pkt-user-menu__item">
|
|
66
66
|
<ul class="pkt-user-menu__sublist">
|
|
67
67
|
<li class="pkt-user-menu__subitem">
|
|
@@ -69,25 +69,25 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
69
69
|
</li>
|
|
70
70
|
</ul>
|
|
71
71
|
</li>
|
|
72
|
-
`:e.
|
|
72
|
+
`:e.h}
|
|
73
73
|
|
|
74
74
|
<!-- Logout -->
|
|
75
|
-
${this.logoutOnClick?e.
|
|
75
|
+
${this.logoutOnClick?e._`
|
|
76
76
|
<li class="pkt-user-menu__item">
|
|
77
77
|
${this.renderLinkOrButton({title:`Logg ut`,iconName:`exit`,onClick:()=>this.handleLogout()})}
|
|
78
78
|
</li>
|
|
79
|
-
`:e.
|
|
79
|
+
`:e.h}
|
|
80
80
|
</ul>
|
|
81
81
|
</nav>
|
|
82
|
-
`}};e.n([e.
|
|
82
|
+
`}};e.n([e.u({type:Object})],p.prototype,`user`,void 0),e.n([e.u({type:String,attribute:`formatted-last-logged-in`})],p.prototype,`formattedLastLoggedIn`,void 0),e.n([e.u({type:Object})],p.prototype,`representing`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],p.prototype,`userMenu`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:a.t})],p.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`logout-on-click`,converter:a.t})],p.prototype,`logoutOnClick`,void 0);try{e.d(`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.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`)}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
|
-
`;return e.
|
|
84
|
+
`;return e._`
|
|
85
85
|
<span class="pkt-header-service__logo">
|
|
86
86
|
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
87
87
|
${t}
|
|
88
88
|
</a>
|
|
89
89
|
</span>
|
|
90
|
-
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink==`string`?e.
|
|
90
|
+
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink==`string`?e._`
|
|
91
91
|
<span class="pkt-header-service__service-name" translate="no">
|
|
92
92
|
<pkt-link
|
|
93
93
|
href=${this.serviceLink}
|
|
@@ -97,7 +97,7 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
97
97
|
${this.serviceName}
|
|
98
98
|
</pkt-link>
|
|
99
99
|
</span>
|
|
100
|
-
`:this.hasAttribute(`service-link`)?e.
|
|
100
|
+
`:this.hasAttribute(`service-link`)?e._`
|
|
101
101
|
<span class="pkt-header-service__service-name" translate="no">
|
|
102
102
|
<button
|
|
103
103
|
class="pkt-link-button pkt-link pkt-header-service__service-link"
|
|
@@ -106,7 +106,7 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
106
106
|
${this.serviceName}
|
|
107
107
|
</button>
|
|
108
108
|
</span>
|
|
109
|
-
`:e.
|
|
109
|
+
`:e._`
|
|
110
110
|
<span
|
|
111
111
|
class="pkt-header-service__service-name"
|
|
112
112
|
translate="no"
|
|
@@ -114,13 +114,13 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
114
114
|
>
|
|
115
115
|
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
116
116
|
</span>
|
|
117
|
-
`:e.
|
|
117
|
+
`:e.h}renderSlotContainer(){if(!this.hasSlotContent())return e.h;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._`
|
|
118
118
|
<div
|
|
119
119
|
class=${r}
|
|
120
120
|
@focusout=${e=>this.handleFocusOut(e,`slot`)}
|
|
121
121
|
${i.n(this.slotContainerRef)}
|
|
122
122
|
>
|
|
123
|
-
${this.isTablet&&this.hasSlotContent()?e.
|
|
123
|
+
${this.isTablet&&this.hasSlotContent()?e._`
|
|
124
124
|
<pkt-button
|
|
125
125
|
skin="secondary"
|
|
126
126
|
variant=${this.slotMenuVariant}
|
|
@@ -130,23 +130,23 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
130
130
|
@click=${()=>this.handleMenuToggle(`slot`)}
|
|
131
131
|
aria-expanded=${this.openMenu===`slot`}
|
|
132
132
|
aria-controls="mobile-slot-menu"
|
|
133
|
-
aria-label
|
|
133
|
+
aria-label=${this.headerStrings.openMenu}
|
|
134
134
|
>
|
|
135
135
|
${this.slotMenuText}
|
|
136
136
|
</pkt-button>
|
|
137
|
-
`:e.
|
|
137
|
+
`:e.h}
|
|
138
138
|
<div
|
|
139
139
|
class=${a}
|
|
140
140
|
id="mobile-slot-menu"
|
|
141
|
-
role=${this.isTablet?`group`:e.
|
|
142
|
-
aria-label=${this.isTablet?`Meny`:e.
|
|
141
|
+
role=${this.isTablet?`group`:e.h}
|
|
142
|
+
aria-label=${this.isTablet?`Meny`:e.h}
|
|
143
143
|
@click=${this.handleSlotContentClick}
|
|
144
144
|
${i.n(this.slotContentRef)}
|
|
145
145
|
>
|
|
146
146
|
${n.n(this)}
|
|
147
147
|
</div>
|
|
148
148
|
</div>
|
|
149
|
-
`}renderSearch(){if(!this.showSearch)return e.
|
|
149
|
+
`}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._`
|
|
150
150
|
<div
|
|
151
151
|
class=${n}
|
|
152
152
|
@focusout=${e=>this.handleFocusOut(e,`search`)}
|
|
@@ -161,41 +161,41 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
161
161
|
state=${this.openMenu===`search`?`active`:`normal`}
|
|
162
162
|
aria-expanded=${this.openMenu===`search`}
|
|
163
163
|
aria-controls="mobile-search-menu"
|
|
164
|
-
aria-label
|
|
164
|
+
aria-label=${this.headerStrings.openSearch}
|
|
165
165
|
>
|
|
166
|
-
|
|
166
|
+
${this.headerStrings.search}
|
|
167
167
|
</pkt-button>
|
|
168
168
|
<div class=${r} ${i.n(this.searchMenuRef)}>
|
|
169
|
-
${this.openMenu===`search`?e.
|
|
169
|
+
${this.openMenu===`search`?e._`
|
|
170
170
|
<pkt-textinput
|
|
171
171
|
id="mobile-search-menu"
|
|
172
172
|
class="pkt-header-service__search-input"
|
|
173
173
|
type="search"
|
|
174
|
-
label
|
|
174
|
+
label=${this.headerStrings.search}
|
|
175
175
|
useWrapper="false"
|
|
176
|
-
placeholder=${this.searchPlaceholder}
|
|
176
|
+
placeholder=${this.searchPlaceholder??this.headerStrings.search}
|
|
177
177
|
value=${this.searchValue}
|
|
178
178
|
autofocus
|
|
179
179
|
fullwidth
|
|
180
180
|
@input=${this.handleSearchInputChange}
|
|
181
181
|
@keydown=${e=>{e.key===`Enter`&&this.handleSearch(e.target.value)}}
|
|
182
182
|
></pkt-textinput>
|
|
183
|
-
`:e.
|
|
183
|
+
`:e.h}
|
|
184
184
|
</div>
|
|
185
185
|
</div>
|
|
186
|
-
`}return e.
|
|
186
|
+
`}return e._`
|
|
187
187
|
<pkt-textinput
|
|
188
188
|
id="header-service-search"
|
|
189
189
|
class="pkt-header-service__search-input"
|
|
190
190
|
type="search"
|
|
191
|
-
label
|
|
191
|
+
label=${this.headerStrings.search}
|
|
192
192
|
useWrapper="false"
|
|
193
|
-
placeholder=${this.searchPlaceholder}
|
|
193
|
+
placeholder=${this.searchPlaceholder??this.headerStrings.search}
|
|
194
194
|
value=${this.searchValue}
|
|
195
195
|
@input=${this.handleSearchInputChange}
|
|
196
196
|
@keydown=${this.handleSearchKeyDown}
|
|
197
197
|
></pkt-textinput>
|
|
198
|
-
`}renderUserButton(){if(!this.user)return e.
|
|
198
|
+
`}renderUserButton(){if(!this.user)return e.h;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._`
|
|
199
199
|
<div
|
|
200
200
|
class="pkt-header-service__user-container"
|
|
201
201
|
@focusout=${e=>this.handleFocusOut(e,`user`)}
|
|
@@ -214,11 +214,11 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
214
214
|
<span class="pkt-sr-only">Brukermeny: </span>
|
|
215
215
|
<span translate="no">${this.representing?.name||this.user.name}</span>
|
|
216
216
|
</pkt-button>
|
|
217
|
-
${this.openMenu===`user`&&this.user?e.
|
|
217
|
+
${this.openMenu===`user`&&this.user?e._`
|
|
218
218
|
<div class=${n}>
|
|
219
219
|
<pkt-header-user-menu
|
|
220
220
|
.user=${this.user}
|
|
221
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn||e.
|
|
221
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||e.h}
|
|
222
222
|
.representing=${this.representing}
|
|
223
223
|
.userMenu=${this.userMenu}
|
|
224
224
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -227,15 +227,15 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
227
227
|
@log-out=${this.handleLogout}
|
|
228
228
|
></pkt-header-user-menu>
|
|
229
229
|
</div>
|
|
230
|
-
`:e.
|
|
230
|
+
`:e.h}
|
|
231
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.
|
|
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._`
|
|
233
233
|
<header class=${n} ${i.n(this.headerRef)}>
|
|
234
234
|
<div class=${r}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
235
235
|
|
|
236
|
-
${this.hasSlotContent()||this.showSearch||this.showLogoutInHeader?e.
|
|
236
|
+
${this.hasSlotContent()||this.showSearch||this.showLogoutInHeader?e._`<div class="pkt-header-service__content">
|
|
237
237
|
${this.renderSlotContainer()} ${this.renderSearch()}
|
|
238
|
-
${this.isTablet&&this.showLogoutInHeader?e.
|
|
238
|
+
${this.isTablet&&this.showLogoutInHeader?e._`
|
|
239
239
|
<pkt-button
|
|
240
240
|
skin="secondary"
|
|
241
241
|
size=${this.isMobile?`small`:`medium`}
|
|
@@ -245,11 +245,11 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
245
245
|
>
|
|
246
246
|
Logg ut
|
|
247
247
|
</pkt-button>
|
|
248
|
-
`:e.
|
|
249
|
-
</div>`:e.
|
|
250
|
-
${this.user||!this.isTablet&&this.showLogoutInHeader?e.
|
|
248
|
+
`:e.h}
|
|
249
|
+
</div>`:e.h}
|
|
250
|
+
${this.user||!this.isTablet&&this.showLogoutInHeader?e._`<div class="pkt-header-service__user">
|
|
251
251
|
${this.renderUserButton()}
|
|
252
|
-
${!this.isTablet&&this.showLogoutInHeader?e.
|
|
252
|
+
${!this.isTablet&&this.showLogoutInHeader?e._`
|
|
253
253
|
<pkt-button
|
|
254
254
|
skin="tertiary"
|
|
255
255
|
size="medium"
|
|
@@ -259,23 +259,23 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
259
259
|
>
|
|
260
260
|
Logg ut
|
|
261
261
|
</pkt-button>
|
|
262
|
-
`:e.
|
|
263
|
-
</div>`:e.
|
|
262
|
+
`:e.h}
|
|
263
|
+
</div>`:e.h}
|
|
264
264
|
</header>
|
|
265
|
-
`}render(){let n=this.renderHeader();if(this.isFixed){let r=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});return e.
|
|
265
|
+
`}render(){let n=this.renderHeader();if(this.isFixed){let r=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});return e._`
|
|
266
266
|
<div class="pkt-header-service-wrapper">
|
|
267
267
|
${n}
|
|
268
268
|
<div class=${r}></div>
|
|
269
269
|
</div>
|
|
270
|
-
`}return n}};e.n([e.
|
|
270
|
+
`}return n}};e.n([e.u({type:String,attribute:`service-name`})],h.prototype,`serviceName`,void 0),e.n([e.u({type:String,attribute:`service-link`})],h.prototype,`serviceLink`,void 0),e.n([e.u({type:String,attribute:`logo-link`})],h.prototype,`logoLink`,void 0),e.n([e.u({type:String,attribute:`logo-path`})],h.prototype,`logoPath`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],h.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:String,attribute:`search-value`})],h.prototype,`searchValue`,void 0),e.n([e.u({type:Number,attribute:`mobile-breakpoint`})],h.prototype,`mobileBreakpoint`,void 0),e.n([e.u({type:Number,attribute:`tablet-breakpoint`})],h.prototype,`tabletBreakpoint`,void 0),e.n([e.u({type:String,attribute:`opened-menu`})],h.prototype,`openedMenu`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],h.prototype,`logOutButtonPlacement`,void 0),e.n([e.u({type:String})],h.prototype,`position`,void 0),e.n([e.u({type:String,attribute:`scroll-behavior`})],h.prototype,`scrollBehavior`,void 0),e.n([e.u({type:String,attribute:`slot-menu-variant`})],h.prototype,`slotMenuVariant`,void 0),e.n([e.u({type:String,attribute:`slot-menu-text`})],h.prototype,`slotMenuText`,void 0),e.n([e.u({type:Boolean,attribute:`hide-logo`,converter:a.t})],h.prototype,`hideLogo`,void 0),e.n([e.u({type:Boolean,converter:a.t})],h.prototype,`compact`,void 0),e.n([e.u({type:Boolean,attribute:`show-search`,converter:a.t})],h.prototype,`showSearch`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:a.t})],h.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`has-log-out`,converter:a.t})],h.prototype,`hasLogOut`,void 0),e.n([e.u({type:Object})],h.prototype,`user`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],h.prototype,`userMenu`,void 0),e.n([e.u({type:Object})],h.prototype,`representing`,void 0),e.n([e.l()],h.prototype,`openMenu`,void 0),e.n([e.l()],h.prototype,`alignSlotRight`,void 0),e.n([e.l()],h.prototype,`alignSearchRight`,void 0);try{e.d(`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._`
|
|
271
271
|
<pkt-icon name="oslologo" aria-hidden="true" path=${r.t(this.logoPath)}></pkt-icon>
|
|
272
|
-
`;return e.
|
|
272
|
+
`;return e._`
|
|
273
273
|
<span class="pkt-header-global__logo">
|
|
274
274
|
<a href=${this.logoLink} aria-label="Til hovedsiden" @click=${this.handleLogoClick}>
|
|
275
275
|
${t}
|
|
276
276
|
</a>
|
|
277
277
|
</span>
|
|
278
|
-
`}renderSearch(t){if(!this.showSearch)return e.
|
|
278
|
+
`}renderSearch(t){if(!this.showSearch)return e.h;let n=t.search;if(!n)return e.h;let i=this.searchPlaceholder??n.input.placeholder;return e._`
|
|
279
279
|
<div class="pkt-header-global__search">
|
|
280
280
|
<pkt-searchinput
|
|
281
281
|
appearance="global"
|
|
@@ -290,11 +290,11 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
290
290
|
@pkt-search=${e=>this.handleSearch(e.detail.value)}
|
|
291
291
|
></pkt-searchinput>
|
|
292
292
|
</div>
|
|
293
|
-
`}renderContact(n){if(!this.showContact||this.user)return e.
|
|
293
|
+
`}renderContact(n){if(!this.showContact||this.user)return e.h;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._`
|
|
294
294
|
<a class=${i} href=${r.url}>
|
|
295
295
|
<span class="pkt-btn__text">${r.text}</span>
|
|
296
296
|
</a>
|
|
297
|
-
`:e.
|
|
297
|
+
`:e.h}get isLoading(){return!this.localeData&&!this.loadError}renderMenuToggle(t){let n=t?.i18n?.menu||this.pktStrings.get(`header`).menu,r=this.openMenu===`menu`;return e._`
|
|
298
298
|
<pkt-button
|
|
299
299
|
id=${v}
|
|
300
300
|
class="pkt-header-global__menu-toggle"
|
|
@@ -310,7 +310,7 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
310
310
|
>
|
|
311
311
|
${n}
|
|
312
312
|
</pkt-button>
|
|
313
|
-
`}renderSearchToggle(t){if(!this.showSearch||!t.search)return e.
|
|
313
|
+
`}renderSearchToggle(t){if(!this.showSearch||!t.search)return e.h;let n=this.openMenu===`search`;return e._`
|
|
314
314
|
<pkt-button
|
|
315
315
|
id=${b}
|
|
316
316
|
class="pkt-header-global__search-toggle"
|
|
@@ -324,9 +324,9 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
324
324
|
aria-controls=${y}
|
|
325
325
|
@click=${()=>this.toggleMenu(`search`)}
|
|
326
326
|
>
|
|
327
|
-
${t.i18n?.search
|
|
327
|
+
${t.i18n?.search||this.pktStrings.get(`header`).search}
|
|
328
328
|
</pkt-button>
|
|
329
|
-
`}renderSearchPanel(n){let i=n.search;if(this.openMenu!==`search`||!this.showSearch||!i)return e.
|
|
329
|
+
`}renderSearchPanel(n){let i=n.search;if(this.openMenu!==`search`||!this.showSearch||!i)return e.h;let a=this.searchPlaceholder??i.input.placeholder,o=t.t({"pkt-header-global__search-panel":!0,[`pkt-header-global__search-panel--${this.overlayBreakpointClass}`]:!!this.overlayBreakpointClass});return e._`
|
|
330
330
|
<div class=${o} id=${y} style=${this.overlayAnchorStyle}>
|
|
331
331
|
<div class="pkt-header-global__search-panel-inner">
|
|
332
332
|
<pkt-searchinput
|
|
@@ -335,14 +335,14 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
335
335
|
id=${i.input.id||`pkt-header-global-search`}
|
|
336
336
|
name=${r.t(i.input.name)}
|
|
337
337
|
placeholder=${r.t(a)}
|
|
338
|
-
aria-label=${r.t(n.i18n?.search
|
|
338
|
+
aria-label=${r.t(n.i18n?.search||this.pktStrings.get(`header`).search)}
|
|
339
339
|
action=${i.endpoint}
|
|
340
340
|
method="get"
|
|
341
341
|
@pkt-search=${e=>this.handleSearch(e.detail.value)}
|
|
342
342
|
></pkt-searchinput>
|
|
343
343
|
</div>
|
|
344
344
|
</div>
|
|
345
|
-
`}renderUser(){if(!this.user)return e.
|
|
345
|
+
`}renderUser(){if(!this.user)return e.h;let n=this.openMenu===`user`,r=t.t({"pkt-header-global__user-menu":!0,"is-open":n});return e._`
|
|
346
346
|
<div class="pkt-header-global__user">
|
|
347
347
|
<div
|
|
348
348
|
class="pkt-header-global__user-container ${n?`is-open`:``}"
|
|
@@ -361,11 +361,11 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
361
361
|
<span class="pkt-sr-only">Brukermeny: </span>
|
|
362
362
|
<span translate="no">${this.representing?.name||this.user.name}</span>
|
|
363
363
|
</pkt-button>
|
|
364
|
-
${n?e.
|
|
364
|
+
${n?e._`
|
|
365
365
|
<div class=${r}>
|
|
366
366
|
<pkt-header-user-menu
|
|
367
367
|
.user=${this.user}
|
|
368
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn||e.
|
|
368
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||e.h}
|
|
369
369
|
.representing=${this.representing}
|
|
370
370
|
.userMenu=${this.userMenu}
|
|
371
371
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -374,47 +374,47 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
374
374
|
@log-out=${()=>this.handleLogout()}
|
|
375
375
|
></pkt-header-user-menu>
|
|
376
376
|
</div>
|
|
377
|
-
`:e.
|
|
377
|
+
`:e.h}
|
|
378
378
|
</div>
|
|
379
379
|
</div>
|
|
380
|
-
`}get overlayBreakpointClass(){return this.isMobile?`mobile`:this.isTablet?`tablet`:``}renderMenu(){if(this.openMenu!==`menu`)return e.
|
|
380
|
+
`}get overlayBreakpointClass(){return this.isMobile?`mobile`:this.isTablet?`tablet`:``}renderMenu(){if(this.openMenu!==`menu`)return e.h;let n=t.t({"pkt-header-global__menu":!0,[`pkt-header-global__menu--${this.overlayBreakpointClass}`]:!!this.overlayBreakpointClass});return e._`
|
|
381
381
|
<div
|
|
382
382
|
class=${n}
|
|
383
383
|
id=${_}
|
|
384
384
|
style=${this.overlayAnchorStyle}
|
|
385
385
|
${i.n(this.menuContainerRef)}
|
|
386
386
|
>
|
|
387
|
-
${this.localeData?e.
|
|
387
|
+
${this.localeData?e._`
|
|
388
388
|
<pkt-header-menu
|
|
389
389
|
.data=${this.effectiveData}
|
|
390
390
|
locale=${this.locale}
|
|
391
391
|
open
|
|
392
392
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
393
393
|
></pkt-header-menu>
|
|
394
|
-
`:e.
|
|
394
|
+
`:e._`
|
|
395
395
|
<nav class="pkt-header-menu pkt-header-menu--open">
|
|
396
396
|
<p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
|
|
397
397
|
</nav>
|
|
398
398
|
`}
|
|
399
399
|
</div>
|
|
400
|
-
`}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.
|
|
400
|
+
`}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._`
|
|
401
401
|
<header class=${n} ${i.n(this.headerRef)}>
|
|
402
402
|
<div class="pkt-header-global__logo-area">${this.renderLogo()}</div>
|
|
403
403
|
<div class="pkt-header-global__content">
|
|
404
|
-
${!a&&r?this.renderSearch(r):e.
|
|
405
|
-
${a&&r?this.renderSearchToggle(r):e.
|
|
404
|
+
${!a&&r?this.renderSearch(r):e.h}
|
|
405
|
+
${a&&r?this.renderSearchToggle(r):e.h}
|
|
406
406
|
${this.renderMenuToggle(r)}
|
|
407
|
-
${!a&&r?this.renderContact(r):e.
|
|
407
|
+
${!a&&r?this.renderContact(r):e.h}
|
|
408
408
|
</div>
|
|
409
409
|
${this.renderUser()}
|
|
410
410
|
</header>
|
|
411
|
-
`}render(){let n=this.renderHeader(),r=this.localeData,i=this.renderMenu(),a=r?this.renderSearchPanel(r):e.
|
|
411
|
+
`}render(){let n=this.renderHeader(),r=this.localeData,i=this.renderMenu(),a=r?this.renderSearchPanel(r):e.h;if(this.isFixed){let r=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});return e._`
|
|
412
412
|
<div class="pkt-header-global-wrapper">
|
|
413
413
|
${n}
|
|
414
414
|
<div class=${r}></div>
|
|
415
415
|
${a}${i}
|
|
416
416
|
</div>
|
|
417
|
-
`}return e.
|
|
417
|
+
`}return e._`${n}${a}${i}`}};e.n([e.u({type:String,attribute:`data-url`})],x.prototype,`dataUrl`,void 0),e.n([e.u({type:Object,attribute:!1})],x.prototype,`data`,void 0),e.n([e.u({type:String})],x.prototype,`locale`,void 0),e.n([e.u({type:String,attribute:`logo-link`})],x.prototype,`logoLink`,void 0),e.n([e.u({type:String,attribute:`logo-path`})],x.prototype,`logoPath`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],x.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:String})],x.prototype,`position`,void 0),e.n([e.u({type:String,attribute:`scroll-behavior`})],x.prototype,`scrollBehavior`,void 0),e.n([e.u({type:Number,attribute:`mobile-breakpoint`})],x.prototype,`mobileBreakpoint`,void 0),e.n([e.u({type:Number,attribute:`tablet-breakpoint`})],x.prototype,`tabletBreakpoint`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],x.prototype,`logOutButtonPlacement`,void 0),e.n([e.u({type:Boolean,attribute:`show-search`,converter:a.t})],x.prototype,`showSearch`,void 0),e.n([e.u({type:Boolean,attribute:`show-contact`,converter:a.t})],x.prototype,`showContact`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:a.t})],x.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`has-log-out`,converter:a.t})],x.prototype,`hasLogOut`,void 0),e.n([e.u({type:Object})],x.prototype,`user`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],x.prototype,`userMenu`,void 0),e.n([e.u({type:Object})],x.prototype,`representing`,void 0),e.n([e.l()],x.prototype,`openMenu`,void 0),e.n([e.l()],x.prototype,`fetchedData`,void 0),e.n([e.l()],x.prototype,`loadError`,void 0),e.n([e.l()],x.prototype,`headerAnchor`,void 0);try{e.d(`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.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._`
|
|
418
418
|
<pkt-header-global
|
|
419
419
|
data-url=${r.t(this.dataUrl)}
|
|
420
420
|
locale=${r.t(this.locale)}
|
|
@@ -435,7 +435,7 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
435
435
|
.userMenu=${this.effectiveUserMenu}
|
|
436
436
|
.representing=${this.representing}
|
|
437
437
|
></pkt-header-global>
|
|
438
|
-
`}render(){return this.type===`global`?this.renderGlobal():e.
|
|
438
|
+
`}render(){return this.type===`global`?this.renderGlobal():e._`
|
|
439
439
|
<pkt-header-service
|
|
440
440
|
service-name=${r.t(this.serviceName)}
|
|
441
441
|
service-link=${r.t(this.serviceLink)}
|
|
@@ -460,6 +460,6 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
460
460
|
.userMenu=${this.effectiveUserMenu}
|
|
461
461
|
.representing=${this.representing}
|
|
462
462
|
>
|
|
463
|
-
${this.hasSlotContent()?e.
|
|
463
|
+
${this.hasSlotContent()?e._`<div class="pkt-contents">${n.n(this)}</div>`:e.h}
|
|
464
464
|
</pkt-header-service>
|
|
465
|
-
`}};e.n([e.
|
|
465
|
+
`}};e.n([e.u({type:String})],S.prototype,`type`,void 0),e.n([e.u({type:String,attribute:`service-name`})],S.prototype,`serviceName`,void 0),e.n([e.u({type:String,attribute:`service-link`})],S.prototype,`serviceLink`,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,attribute:`search-value`})],S.prototype,`searchValue`,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:`opened-menu`})],S.prototype,`openedMenu`,void 0),e.n([e.u({type:String,attribute:`log-out-button-placement`})],S.prototype,`logOutButtonPlacement`,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:String,attribute:`slot-menu-variant`})],S.prototype,`slotMenuVariant`,void 0),e.n([e.u({type:String,attribute:`slot-menu-text`})],S.prototype,`slotMenuText`,void 0),e.n([e.u({type:Boolean,attribute:`hide-logo`,converter:a.t})],S.prototype,`hideLogo`,void 0),e.n([e.u({type:Boolean,converter:a.t})],S.prototype,`compact`,void 0),e.n([e.u({type:Boolean,attribute:`show-search`,converter:a.t})],S.prototype,`showSearch`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:a.t})],S.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`has-log-out`,converter:a.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.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:Boolean,attribute:`show-contact`,converter:a.t})],S.prototype,`showContact`,void 0),e.n([e.u({type:Array,attribute:`user-menu-footer`})],S.prototype,`userMenuFooter`,void 0),e.n([e.u({type:Array,attribute:`user-options`})],S.prototype,`userOptions`,void 0);try{e.d(`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}});
|