@kartverket/geonorge-web-components 1.0.21 → 1.0.23
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/BreadcrumbList.js +1 -1
- package/BreadcrumbList.js.map +1 -1
- package/MainMenu.js +1 -1
- package/MainMenu.js.map +1 -1
- package/MainNavigation.js +1 -1
- package/MainNavigation.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/main-navigation.d.ts +1 -0
- package/main-navigation.stories.d.ts +2 -0
- package/package.json +1 -1
package/BreadcrumbList.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.geonorge=e():(t.geonorge=t.geonorge||{},t.geonorge.BreadcrumbList=e())}(self,(()=>(()=>{var t={8306:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>a});var n=o(4663),r=o.n(n),s=o(7638),i=o.n(s)()(r());i.push([t.id,'ul{display:flex;margin-top:20px;padding:0}ul li{list-style-type:none;padding:0 10px 0 0}ul li:first-of-type{padding-left:10px}ul li a{font-family:"Open Sans",sans-serif;color:#3767c7;text-decoration:none;font-weight:400}ul li span{font-family:"Open Sans",sans-serif;font-weight:400}ul li svg{height:1em;overflow:visible;vertical-align:-0.125em;margin-left:10px}',"",{version:3,sources:["webpack://./stories/breadcrumb-list/breadcrumb-list.scss","webpack://./style/variables/_typography.scss"],names:[],mappings:"AAEA,GACI,YAAA,CACA,eAAA,CACA,SAAA,CACA,MACI,oBAAA,CACA,kBAAA,CACA,oBACI,iBAAA,CAEJ,QACI,kCCbG,CDcH,aAAA,CACA,oBAAA,CACA,eAAA,CAEJ,WACI,kCCnBG,CDoBH,eAAA,CAEJ,UACI,UAAA,CACA,gBAAA,CACA,uBAAA,CACA,gBAAA",sourcesContent:['@import "../../style/all";\n\nul {\n display: flex;\n margin-top: 20px;\n padding: 0;\n li {\n list-style-type: none;\n padding: 0 10px 0 0;\n &:first-of-type {\n padding-left: 10px;\n }\n a {\n font-family: $default-font;\n color: $primary-text;\n text-decoration: none;\n font-weight: 400;\n }\n span {\n font-family: $default-font;\n font-weight: 400;\n }\n svg {\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n margin-left: 10px;\n }\n }\n}\n','$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;'],sourceRoot:""}]);const a=i},2874:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});const n='<template>\n <ul id="breadcrumb-list"></ul>\n</template>'},7638:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,r,s){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);n&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),o&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=o):u[2]=o),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},4663:t=>{"use strict";t.exports=function(t){var e=t[1],o=t[3];if(!o)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),s="/*# ".concat(r," */");return[e].concat([s]).join("\n")}return[e].join("\n")}},1397:function(t,e,o){"use strict";var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const r=o(5969),s=o(5773),i=o(3804);e.Component=t=>e=>{var o;const a=t.tag||i.toKebabCase(e.prototype.constructor.name),c=((o=class extends e{constructor(){super(),this.props={},this.showShadowRoot=null==t.shadow||t.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((t=>i.toKebabCase(t)))}attributeChangedCallback(t,e,o){this.onAttributeChange(t,e,o)}onAttributeChange(t,e,o,n=!0){if(e!=o){n&&(this[i.toCamelCase(t)]=o);const r=this.constructor.watchAttributes;if(r&&r[t]){const n=r[t];this.__connected&&"function"==typeof this[n]&&this[n]({old:e,new:o})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,r.addEventListeners(this),s.initializeProps(this)}))}render(){return n(this,void 0,void 0,(function*(){if(this.__connected)return;const e=document.createElement("template");e.innerHTML=yield this.getStyle(),t.template instanceof Promise?e.content.appendChild(yield this.getExternalTemplate()):"string"==typeof t.template&&(e.innerHTML+=t.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(e.content.cloneNode(!0))}))}getExternalTemplate(){return n(this,void 0,void 0,(function*(){const e=(yield t.template).default.toString(),o=document.createRange().createContextualFragment(e);return 1===o.children.length&&"TEMPLATE"===o.children[0].nodeName?o.firstChild.content:o}))}getStyle(){return n(this,void 0,void 0,(function*(){let e;return t.style instanceof Promise?e=(yield t.style).default.toString():"string"==typeof t.style&&(e=t.style),e?`<style>${e}</style>`:""}))}}).__connected=!1,o.ready=new Promise(((t,e)=>t(!0))),o);return customElements.get(a)||customElements.define(a,c),c}},985:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomElement=void 0;class o extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}e.CustomElement=o},265:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getShadowRootElement=e.getElement=void 0,e.getElement=t=>document.querySelector(t),e.getShadowRootElement=(t,e)=>t.shadowRoot.querySelector(e)},406:function(t,e,o){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[o]}})}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),r=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||n(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(o(1397),e),r(o(985),e),r(o(265),e),r(o(5969),e),r(o(5773),e),r(o(4271),e),r(o(9766),e),r(o(4938),e)},5969:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const n=o(3804);e.Listen=(t,e)=>(o,n)=>{o.constructor.listeners||(o.constructor.listeners=[]),o.constructor.listeners.push({selector:e,eventName:t,handler:o[n]})},e.addEventListeners=t=>{if(t.constructor.listeners){const e=t.shadowRoot||t;for(const o of t.constructor.listeners){const n=o.selector?e.querySelector(o.selector)?e.querySelector(o.selector):null:t;n&&n.addEventListener(o.eventName,(e=>{o.handler.call(t,e)}))}}},e.Dispatch=t=>(e,o)=>{Object.defineProperty(e,o,{get:function(){const e=this;return{emit(r){const s=t||n.toDotCase(o);e.dispatchEvent(new CustomEvent(s,r))}}}})}},5773:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const n=o(3804);e.Prop=()=>(t,e)=>{const o=n.toKebabCase(e);t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return this.props[e]?this.props[e]:this.getAttribute(o)},set:function(t){if(this.__connected){const r=this.props[e];this.props[e]=n.tryParseInt(t),"object"!=typeof t?this.setAttribute(o,t):this.onAttributeChange(o,r,t,!1)}else this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})},e.initializeProps=t=>{const e=t.constructor.watchAttributes;for(let o of(t=>{const e=t.constructor.watchAttributes,o=Object.assign({},e);Object.keys(o).forEach((t=>o[t]=""));const n=Object.assign(Object.assign({},o),t.constructor.propsInit);return Object.keys(n)})(t)){if(e)if(null==e[n.toKebabCase(o)])e[n.toKebabCase(o)]="";else{const r=t.props[o]||t.getAttribute(n.toKebabCase(o));"function"==typeof t[e[o]]&&t[e[o]]({new:r})}t.constructor.propsInit[o]&&(t.hasAttribute(n.toKebabCase(o))||(t[o]=t.constructor.propsInit[o]))}}},4271:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const n=o(3804);e.Toggle=()=>(t,e)=>{t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return(t=>{if(this.hasAttribute(t)){const e=this.getAttribute(t);return!!/^(true|false|^$)$/.test(e)&&("true"==e||""==e)}return!1})(e)},set:function(t){const o=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==o||""==o:(console.warn(`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`),t=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`}this.__connected?(this.props[e]=t||!1,""!==o&&null!==o?this.setAttribute(e,t):t?this.setAttribute(e,""):this.removeAttribute(e)):this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})}},9766:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3804:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tryParseInt=e.toDotCase=e.toCamelCase=e.toKebabCase=void 0,e.toKebabCase=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),e.toCamelCase=t=>t.toLowerCase().replace(/(\-\w)/g,(t=>t[1].toUpperCase())),e.toDotCase=t=>t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),e.tryParseInt=t=>parseInt(t)==t&&NaN!==parseFloat(t)?parseInt(t):t},4938:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const n=o(3804);e.Watch=t=>(e,o)=>{e.constructor.watchAttributes||(e.constructor.watchAttributes={}),e.constructor.watchAttributes[n.toKebabCase(t)]=o,e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null}},316:t=>{t.exports='<svg aria-labelledby="svg-inline--fa-title-s83c8hdkLb90" data-prefix="fas" data-icon="angle-right" class="__1uROMIU__svg-inline--fa __1uROMIU__fa-angle-right __1uROMIU__ " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><title id="svg-inline--fa-title-s83c8hdkLb90">Til Geonorge</title><path fill="currentColor" d="M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z"></path></svg>'},8574:function(t,e,o){"use strict";var n,r=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(e,o);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,r)}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__decorate||function(t,e,o,n){var r,s=arguments.length,i=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(i=(s<3?r(i):s>3?r(e,o,i):r(e,o))||i);return s>3&&i&&Object.defineProperty(e,o,i),i},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&r(e,t,o);return s(e,t),e},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BreadcrumbList=void 0;const l=o(406),u=c(o(316));let d=n=class extends l.CustomElement{constructor(){super(),this.renderBreadcrumbsFromAttribute=t=>{const e=JSON.parse(t);n.renderBreadcrumbs(e)}}setup(t){this.connect(t.container),t.id&&(this.id=t.id)}connectedCallback(){this.renderBreadcrumbsFromAttribute(this.breadcrumbs)}breadcrumbsChanged(){var t;(null===(t=this.breadcrumbs)||void 0===t?void 0:t.length)&&this.renderBreadcrumbsFromAttribute(this.breadcrumbs)}static setup(t,e){const o=(0,l.getElement)(t);(0,l.getShadowRootElement)(o,"#breadcrumb-list").innerHTML=this.getBreadCrumbListElement(e.breadcrumbs)}};d.elementSelector="breadcrumb-list",d.getBreadCrumbListElement=t=>(null==t?void 0:t.length)?t.map(((e,o)=>{var n;const r=`${window.location.hash}`,s=`${window.location.pathname}${window.location.hash}${window.location.search}`,i=window.location.href,a=r.toLowerCase()===e.url.toLowerCase(),c=s.toLowerCase()===e.url.toLowerCase(),l=i.toLowerCase()===e.url.toLowerCase();return`<li>${!(null===(n=null==e?void 0:e.url)||void 0===n?void 0:n.length)||a||c||l?`<span>${e.name}</span>`:`<a href="${e.url}">${e.name}</a>`}${o<t.length-1?u.default:""}</li>`})).join(""):"",d.renderBreadcrumbs=t=>{const e=(0,l.getElement)("#breadcrumb-list");(0,l.getShadowRootElement)(e,"#breadcrumb-list").innerHTML=n.getBreadCrumbListElement(t)},i([(0,l.Prop)()],d.prototype,"id",void 0),i([(0,l.Prop)()],d.prototype,"breadcrumbs",void 0),i([(0,l.Watch)("breadcrumbs")],d.prototype,"breadcrumbsChanged",null),d=n=i([(0,l.Component)({tag:"breadcrumb-list",template:Promise.resolve().then((()=>a(o(2874)))),style:Promise.resolve().then((()=>a(o(8306))))})],d),e.BreadcrumbList=d}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={id:n,exports:{}};return t[n].call(s.exports,s,s.exports,o),s.exports}return o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(8574)})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.geonorge=e():(t.geonorge=t.geonorge||{},t.geonorge.BreadcrumbList=e())}(self,(()=>(()=>{var t={8306:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>a});var n=o(4663),r=o.n(n),s=o(7638),i=o.n(s)()(r());i.push([t.id,'ul{display:flex;margin-top:20px;padding:0}ul li{list-style-type:none;padding:0 10px 0 0}ul li:first-of-type{padding-left:10px}ul li a{font-family:"Open Sans",sans-serif;color:#3767c7;text-decoration:none;font-weight:400}ul li span{font-family:"Open Sans",sans-serif;font-weight:400}ul li svg{height:1em;overflow:visible;vertical-align:-0.125em;margin-left:10px}',"",{version:3,sources:["webpack://./stories/breadcrumb-list/breadcrumb-list.scss","webpack://./style/variables/_typography.scss"],names:[],mappings:"AAEA,GACI,YAAA,CACA,eAAA,CACA,SAAA,CACA,MACI,oBAAA,CACA,kBAAA,CACA,oBACI,iBAAA,CAEJ,QACI,kCCbG,CDcH,aAAA,CACA,oBAAA,CACA,eAAA,CAEJ,WACI,kCCnBG,CDoBH,eAAA,CAEJ,UACI,UAAA,CACA,gBAAA,CACA,uBAAA,CACA,gBAAA",sourcesContent:['@import "../../style/all";\n\nul {\n display: flex;\n margin-top: 20px;\n padding: 0;\n li {\n list-style-type: none;\n padding: 0 10px 0 0;\n &:first-of-type {\n padding-left: 10px;\n }\n a {\n font-family: $default-font;\n color: $primary-text;\n text-decoration: none;\n font-weight: 400;\n }\n span {\n font-family: $default-font;\n font-weight: 400;\n }\n svg {\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n margin-left: 10px;\n }\n }\n}\n','$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;'],sourceRoot:""}]);const a=i},2874:(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>n});const n='<template>\n <ul id="breadcrumb-list"></ul>\n</template>'},7638:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,r,s){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);n&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),o&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=o):u[2]=o),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},4663:t=>{"use strict";t.exports=function(t){var e=t[1],o=t[3];if(!o)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),s="/*# ".concat(r," */");return[e].concat([s]).join("\n")}return[e].join("\n")}},1397:function(t,e,o){"use strict";var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const r=o(5969),s=o(5773),i=o(3804);e.Component=t=>e=>{var o;const a=t.tag||i.toKebabCase(e.prototype.constructor.name),c=((o=class extends e{constructor(){super(),this.props={},this.showShadowRoot=null==t.shadow||t.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((t=>i.toKebabCase(t)))}attributeChangedCallback(t,e,o){this.onAttributeChange(t,e,o)}onAttributeChange(t,e,o,n=!0){if(e!=o){n&&(this[i.toCamelCase(t)]=o);const r=this.constructor.watchAttributes;if(r&&r[t]){const n=r[t];this.__connected&&"function"==typeof this[n]&&this[n]({old:e,new:o})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,r.addEventListeners(this),s.initializeProps(this)}))}render(){return n(this,void 0,void 0,(function*(){if(this.__connected)return;const e=document.createElement("template");e.innerHTML=yield this.getStyle(),t.template instanceof Promise?e.content.appendChild(yield this.getExternalTemplate()):"string"==typeof t.template&&(e.innerHTML+=t.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(e.content.cloneNode(!0))}))}getExternalTemplate(){return n(this,void 0,void 0,(function*(){const e=(yield t.template).default.toString(),o=document.createRange().createContextualFragment(e);return 1===o.children.length&&"TEMPLATE"===o.children[0].nodeName?o.firstChild.content:o}))}getStyle(){return n(this,void 0,void 0,(function*(){let e;return t.style instanceof Promise?e=(yield t.style).default.toString():"string"==typeof t.style&&(e=t.style),e?`<style>${e}</style>`:""}))}}).__connected=!1,o.ready=new Promise(((t,e)=>t(!0))),o);return customElements.get(a)||customElements.define(a,c),c}},985:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomElement=void 0;class o extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}e.CustomElement=o},265:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getShadowRootElement=e.getElement=void 0,e.getElement=t=>document.querySelector(t),e.getShadowRootElement=(t,e)=>t.shadowRoot.querySelector(e)},406:function(t,e,o){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[o]}})}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),r=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||n(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(o(1397),e),r(o(985),e),r(o(265),e),r(o(5969),e),r(o(5773),e),r(o(4271),e),r(o(9766),e),r(o(4938),e)},5969:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const n=o(3804);e.Listen=(t,e)=>(o,n)=>{o.constructor.listeners||(o.constructor.listeners=[]),o.constructor.listeners.push({selector:e,eventName:t,handler:o[n]})},e.addEventListeners=t=>{if(t.constructor.listeners){const e=t.shadowRoot||t;for(const o of t.constructor.listeners){const n=o.selector?e.querySelector(o.selector)?e.querySelector(o.selector):null:t;n&&n.addEventListener(o.eventName,(e=>{o.handler.call(t,e)}))}}},e.Dispatch=t=>(e,o)=>{Object.defineProperty(e,o,{get:function(){const e=this;return{emit(r){const s=t||n.toDotCase(o);e.dispatchEvent(new CustomEvent(s,r))}}}})}},5773:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const n=o(3804);e.Prop=()=>(t,e)=>{const o=n.toKebabCase(e);t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return this.props[e]?this.props[e]:this.getAttribute(o)},set:function(t){if(this.__connected){const r=this.props[e];this.props[e]=n.tryParseInt(t),"object"!=typeof t?this.setAttribute(o,t):this.onAttributeChange(o,r,t,!1)}else this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})},e.initializeProps=t=>{const e=t.constructor.watchAttributes;for(let o of(t=>{const e=t.constructor.watchAttributes,o=Object.assign({},e);Object.keys(o).forEach((t=>o[t]=""));const n=Object.assign(Object.assign({},o),t.constructor.propsInit);return Object.keys(n)})(t)){if(e)if(null==e[n.toKebabCase(o)])e[n.toKebabCase(o)]="";else{const r=t.props[o]||t.getAttribute(n.toKebabCase(o));"function"==typeof t[e[o]]&&t[e[o]]({new:r})}t.constructor.propsInit[o]&&(t.hasAttribute(n.toKebabCase(o))||(t[o]=t.constructor.propsInit[o]))}}},4271:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const n=o(3804);e.Toggle=()=>(t,e)=>{t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null,Object.defineProperty(t,e,{get:function(){return(t=>{if(this.hasAttribute(t)){const e=this.getAttribute(t);return!!/^(true|false|^$)$/.test(e)&&("true"==e||""==e)}return!1})(e)},set:function(t){const o=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==o||""==o:(console.warn(`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`),t=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${e}' to '${t}'`}this.__connected?(this.props[e]=t||!1,""!==o&&null!==o?this.setAttribute(e,t):t?this.setAttribute(e,""):this.removeAttribute(e)):this.hasAttribute(n.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})}},9766:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3804:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tryParseInt=e.toDotCase=e.toCamelCase=e.toKebabCase=void 0,e.toKebabCase=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),e.toCamelCase=t=>t.toLowerCase().replace(/(\-\w)/g,(t=>t[1].toUpperCase())),e.toDotCase=t=>t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),e.tryParseInt=t=>parseInt(t)==t&&NaN!==parseFloat(t)?parseInt(t):t},4938:(t,e,o)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const n=o(3804);e.Watch=t=>(e,o)=>{e.constructor.watchAttributes||(e.constructor.watchAttributes={}),e.constructor.watchAttributes[n.toKebabCase(t)]=o,e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null}},316:t=>{t.exports='<svg aria-labelledby="svg-inline--fa-title-s83c8hdkLb90" data-prefix="fas" data-icon="angle-right" class="__1OI33kj__svg-inline--fa __1OI33kj__fa-angle-right __1OI33kj__ " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="currentColor" d="M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z"></path></svg>'},8574:function(t,e,o){"use strict";var n,r=this&&this.__createBinding||(Object.create?function(t,e,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(e,o);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,r)}:function(t,e,o,n){void 0===n&&(n=o),t[n]=e[o]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__decorate||function(t,e,o,n){var r,s=arguments.length,i=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(i=(s<3?r(i):s>3?r(e,o,i):r(e,o))||i);return s>3&&i&&Object.defineProperty(e,o,i),i},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&r(e,t,o);return s(e,t),e},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BreadcrumbList=void 0;const l=o(406),u=c(o(316));let d=n=class extends l.CustomElement{constructor(){super(),this.renderBreadcrumbsFromAttribute=t=>{const e=JSON.parse(t);n.renderBreadcrumbs(e)}}setup(t){this.connect(t.container),t.id&&(this.id=t.id)}connectedCallback(){this.renderBreadcrumbsFromAttribute(this.breadcrumbs)}breadcrumbsChanged(){var t;(null===(t=this.breadcrumbs)||void 0===t?void 0:t.length)&&this.renderBreadcrumbsFromAttribute(this.breadcrumbs)}static setup(t,e){const o=(0,l.getElement)(t);(0,l.getShadowRootElement)(o,"#breadcrumb-list").innerHTML=this.getBreadCrumbListElement(e.breadcrumbs)}};d.elementSelector="breadcrumb-list",d.getBreadCrumbListElement=t=>(null==t?void 0:t.length)?t.map(((e,o)=>{var n;const r=`${window.location.hash}`,s=`${window.location.pathname}${window.location.hash}${window.location.search}`,i=window.location.href,a=r.toLowerCase()===e.url.toLowerCase(),c=s.toLowerCase()===e.url.toLowerCase(),l=i.toLowerCase()===e.url.toLowerCase();return`<li>${!(null===(n=null==e?void 0:e.url)||void 0===n?void 0:n.length)||a||c||l?`<span>${e.name}</span>`:`<a href="${e.url}">${e.name}</a>`}${o<t.length-1?u.default:""}</li>`})).join(""):"",d.renderBreadcrumbs=t=>{const e=(0,l.getElement)("#breadcrumb-list");(0,l.getShadowRootElement)(e,"#breadcrumb-list").innerHTML=n.getBreadCrumbListElement(t)},i([(0,l.Prop)()],d.prototype,"id",void 0),i([(0,l.Prop)()],d.prototype,"breadcrumbs",void 0),i([(0,l.Watch)("breadcrumbs")],d.prototype,"breadcrumbsChanged",null),d=n=i([(0,l.Component)({tag:"breadcrumb-list",template:Promise.resolve().then((()=>a(o(2874)))),style:Promise.resolve().then((()=>a(o(8306))))})],d),e.BreadcrumbList=d}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={id:n,exports:{}};return t[n].call(s.exports,s,s.exports,o),s.exports}return o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(8574)})()));
|
|
2
2
|
//# sourceMappingURL=BreadcrumbList.js.map
|
package/BreadcrumbList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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ASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBjK,IAAjBkK,EACH,OAAOA,EAAa3L,QAGrB,IAAIC,EAASuL,EAAyBE,GAAY,CACjDnL,GAAImL,EAEJ1L,QAAS,CAAC,GAOX,OAHA4L,EAAoBF,GAAUtE,KAAKnH,EAAOD,QAASC,EAAQA,EAAOD,QAASyL,GAGpExL,EAAOD,OACf,C,OCrBAyL,EAAoBI,EAAK5L,IACxB,IAAI6L,EAAS7L,GAAUA,EAAO8L,WAC7B,IAAO9L,EAAiB,QACxB,IAAM,EAEP,OADAwL,EAAoBO,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdL,EAAoBO,EAAI,CAAChM,EAASkM,KACjC,IAAI,IAAIC,KAAOD,EACXT,EAAoBW,EAAEF,EAAYC,KAASV,EAAoBW,EAAEpM,EAASmM,IAC5E5I,OAAOgE,eAAevH,EAASmM,EAAK,CAAEE,YAAY,EAAMpG,IAAKiG,EAAWC,IAE1E,ECNDV,EAAoBW,EAAI,CAACE,EAAKhE,IAAU/E,OAAOZ,UAAU4J,eAAenF,KAAKkF,EAAKhE,GCClFmD,EAAoBe,EAAKxM,IACH,oBAAXyM,QAA0BA,OAAOC,aAC1CnJ,OAAOgE,eAAevH,EAASyM,OAAOC,YAAa,CAAExE,MAAO,WAE7D3E,OAAOgE,eAAevH,EAAS,aAAc,CAAEkI,OAAO,GAAO,ECFpCuD,EAAoB,K","sources":["webpack://geonorge/webpack/universalModuleDefinition","webpack://geonorge/./stories/breadcrumb-list/breadcrumb-list.scss","webpack://geonorge/./stories/breadcrumb-list/breadcrumb-list.html","webpack://geonorge/../node_modules/css-loader/dist/runtime/api.js","webpack://geonorge/../node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://geonorge/../node_modules/super-custom-elements/src/component.ts","webpack://geonorge/../node_modules/super-custom-elements/src/custom-element.ts","webpack://geonorge/../node_modules/super-custom-elements/src/helpers.ts","webpack://geonorge/../node_modules/super-custom-elements/src/index.ts","webpack://geonorge/../node_modules/super-custom-elements/src/listen.ts","webpack://geonorge/../node_modules/super-custom-elements/src/prop.ts","webpack://geonorge/../node_modules/super-custom-elements/src/toggle.ts","webpack://geonorge/../node_modules/super-custom-elements/src/util.ts","webpack://geonorge/../node_modules/super-custom-elements/src/watch.ts","webpack://geonorge/./assets/svg/angle-right.svg","webpack://geonorge/./stories/breadcrumb-list/breadcrumb-list.ts","webpack://geonorge/webpack/bootstrap","webpack://geonorge/webpack/runtime/compat get default export","webpack://geonorge/webpack/runtime/define property getters","webpack://geonorge/webpack/runtime/hasOwnProperty shorthand","webpack://geonorge/webpack/runtime/make namespace object","webpack://geonorge/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"geonorge\"] = factory();\n\telse\n\t\troot[\"geonorge\"] = root[\"geonorge\"] || {}, root[\"geonorge\"][\"BreadcrumbList\"] = factory();\n})(self, () => {\nreturn ","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"ul{display:flex;margin-top:20px;padding:0}ul li{list-style-type:none;padding:0 10px 0 0}ul li:first-of-type{padding-left:10px}ul li a{font-family:\\\"Open Sans\\\",sans-serif;color:#3767c7;text-decoration:none;font-weight:400}ul li span{font-family:\\\"Open Sans\\\",sans-serif;font-weight:400}ul li svg{height:1em;overflow:visible;vertical-align:-0.125em;margin-left:10px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./stories/breadcrumb-list/breadcrumb-list.scss\",\"webpack://./style/variables/_typography.scss\"],\"names\":[],\"mappings\":\"AAEA,GACI,YAAA,CACA,eAAA,CACA,SAAA,CACA,MACI,oBAAA,CACA,kBAAA,CACA,oBACI,iBAAA,CAEJ,QACI,kCCbG,CDcH,aAAA,CACA,oBAAA,CACA,eAAA,CAEJ,WACI,kCCnBG,CDoBH,eAAA,CAEJ,UACI,UAAA,CACA,gBAAA,CACA,uBAAA,CACA,gBAAA\",\"sourcesContent\":[\"@import \\\"../../style/all\\\";\\n\\nul {\\n display: flex;\\n margin-top: 20px;\\n padding: 0;\\n li {\\n list-style-type: none;\\n padding: 0 10px 0 0;\\n &:first-of-type {\\n padding-left: 10px;\\n }\\n a {\\n font-family: $default-font;\\n color: $primary-text;\\n text-decoration: none;\\n font-weight: 400;\\n }\\n span {\\n font-family: $default-font;\\n font-weight: 400;\\n }\\n svg {\\n height: 1em;\\n overflow: visible;\\n vertical-align: -0.125em;\\n margin-left: 10px;\\n }\\n }\\n}\\n\",\"$default-font: \\\"Open Sans\\\", sans-serif;\\n$header-font: \\\"Raleway\\\", sans-serif;\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","export default \"<template>\\n <ul id=\\\"breadcrumb-list\\\"></ul>\\n</template>\";","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","import { addEventListeners, ListenerMetadata } from './listen';\r\nimport { initializeProps } from './prop';\r\nimport { ComponentMetadata, KeyValue } from './types';\r\nimport { toKebabCase, toCamelCase } from './util';\r\n\r\nexport const Component = (args: ComponentMetadata) => {\r\n return (target: any) => {\r\n const tag: string = args.tag || toKebabCase(target.prototype.constructor.name);\r\n const customElement: any = class extends (target as { new(): any }) {\r\n protected static __connected: boolean = false;\r\n protected static propsInit: KeyValue;\r\n protected static watchAttributes: KeyValue;\r\n protected static listeners: ListenerMetadata[];\r\n protected static ready: Promise<boolean> = new Promise((resolve, _) => resolve(true));\r\n public props: KeyValue = {};\r\n private showShadowRoot: boolean;\r\n\r\n public static get observedAttributes(): string[] {\r\n return Object.keys(this.propsInit || {}).map(x => toKebabCase(x));\r\n }\r\n\r\n constructor() {\r\n super();\r\n\r\n this.showShadowRoot = args.shadow == null ? true : args.shadow;\r\n\r\n if (!this.shadowRoot && this.showShadowRoot) {\r\n this.attachShadow({ mode: 'open' });\r\n }\r\n }\r\n\r\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\r\n this.onAttributeChange(name, oldValue, newValue);\r\n }\r\n\r\n public onAttributeChange(name: string, oldValue: string, newValue: string, set: boolean = true): void {\r\n if (oldValue != newValue) {\r\n if (set) { this[toCamelCase(name)] = newValue; }\r\n const watchAttributes: KeyValue = (this.constructor as any).watchAttributes;\r\n if (watchAttributes && watchAttributes[name]) {\r\n const methodToCall: string = watchAttributes[name];\r\n if (this.__connected) {\r\n if (typeof this[methodToCall] == 'function') {\r\n this[methodToCall]({ old: oldValue, new: newValue });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public async connectedCallback(): Promise<void> {\r\n await this.render();\r\n super.connectedCallback && super.connectedCallback();\r\n this.__connected = true;\r\n\r\n addEventListeners(this);\r\n initializeProps(this);\r\n }\r\n\r\n private async render(): Promise<void> {\r\n if (this.__connected) {\r\n return;\r\n }\r\n\r\n const template = document.createElement('template');\r\n template.innerHTML = await this.getStyle();\r\n\r\n if (args.template instanceof Promise) {\r\n template.content.appendChild(await this.getExternalTemplate());\r\n } else if (typeof args.template === 'string') {\r\n template.innerHTML += args.template;\r\n }\r\n\r\n (this.showShadowRoot ? this.shadowRoot : this).appendChild(template.content.cloneNode(true));\r\n }\r\n\r\n private async getExternalTemplate(): Promise<DocumentFragment> {\r\n const templateModule = await (args.template as Promise<typeof import('*.html')>);\r\n const markup = templateModule.default.toString();\r\n const fragment = document.createRange().createContextualFragment(markup);\r\n\r\n if (fragment.children.length === 1 && fragment.children[0].nodeName === 'TEMPLATE') {\r\n return (fragment.firstChild as HTMLTemplateElement).content;\r\n }\r\n return fragment;\r\n }\r\n\r\n private async getStyle(): Promise<string> {\r\n let css: string;\r\n\r\n if (args.style instanceof Promise) {\r\n const styleModule = await args.style;\r\n css = styleModule.default.toString();\r\n } else if (typeof args.style === 'string') {\r\n css = args.style;\r\n }\r\n\r\n return `${css ? `<style>${css}</style>` : ''}`\r\n }\r\n };\r\n\r\n if (!customElements.get(tag)) {\r\n customElements.define(tag, customElement);\r\n }\r\n\r\n return customElement;\r\n };\r\n};\r\n\r\n\r\n","import { CustomElementOptions } from \"./types\";\r\n\r\nexport abstract class CustomElement extends HTMLElement {\r\n constructor() {\r\n super();\r\n }\r\n\r\n protected abstract setup(options?: CustomElementOptions): void;\r\n\r\n protected connect(selector: string): void {\r\n if (!this.isConnected) {\r\n document.querySelector(selector).appendChild(this);\r\n }\r\n }\r\n}\r\n","export const getElement = <T extends HTMLElement>(selector: string): T => {\r\n return document.querySelector(selector);\r\n};\r\n\r\nexport const getShadowRootElement = <T extends HTMLElement>(customElement: HTMLElement, selector: string): T => {\r\n return customElement.shadowRoot.querySelector(selector);\r\n};","export * from './component';\r\nexport * from './custom-element';\r\nexport * from './helpers';\r\nexport * from './listen';\r\nexport * from './prop';\r\nexport * from './toggle';\r\nexport * from './types';\r\nexport * from './watch';","import { toDotCase } from './util';\r\n\r\ninterface ListenerMetadata {\r\n eventName: string;\r\n handler: Function;\r\n selector?: string;\r\n}\r\n\r\ninterface CustomEventOptions {\r\n bubbles?: boolean;\r\n composed?: boolean;\r\n detail?: any;\r\n}\r\n\r\ninterface DispatchEmitter {\r\n emit(options?: CustomEventOptions): void;\r\n}\r\n\r\nconst Listen = (eventName: string, selector?: string) => {\r\n return (target: any, methodName: string) => {\r\n if (!target.constructor.listeners) {\r\n target.constructor.listeners = [];\r\n }\r\n target.constructor.listeners.push({ selector: selector, eventName: eventName, handler: target[methodName] });\r\n };\r\n};\r\n\r\nconst addEventListeners = (target: any) => {\r\n if (target.constructor.listeners) {\r\n const targetRoot: any = target.shadowRoot || target;\r\n for (const listener of target.constructor.listeners as Array<ListenerMetadata>) {\r\n const eventTarget = (listener.selector)\r\n ? targetRoot.querySelector(listener.selector)\r\n ? targetRoot.querySelector(listener.selector) : null\r\n : target;\r\n if (eventTarget) {\r\n eventTarget.addEventListener(listener.eventName, (e: CustomEvent) => {\r\n listener.handler.call(target, e);\r\n });\r\n }\r\n }\r\n }\r\n};\r\n\r\nconst Dispatch = (eventName?: string) => {\r\n return (target: HTMLElement, propertyName: string) => {\r\n function get() {\r\n const self: EventTarget = this as EventTarget;\r\n return {\r\n emit(options?: CustomEventOptions) {\r\n const evtName = (eventName) ? eventName : toDotCase(propertyName);\r\n self.dispatchEvent(new CustomEvent(evtName, options));\r\n }\r\n };\r\n }\r\n Object.defineProperty(target, propertyName, { get });\r\n };\r\n};\r\n\r\nexport { Listen, addEventListeners, DispatchEmitter, Dispatch, CustomEventOptions, ListenerMetadata };","import { toKebabCase, tryParseInt } from './util';\r\n\r\nexport const Prop = (): any => {\r\n return (target: any, propName: any) => {\r\n const attrName = toKebabCase(propName);\r\n function get() {\r\n if (this.props[propName]) {\r\n return this.props[propName];\r\n }\r\n return this.getAttribute(attrName);\r\n }\r\n function set(value: any) {\r\n if (this.__connected) {\r\n const oldValue = this.props[propName];\r\n this.props[propName] = tryParseInt(value);\r\n if (typeof value != 'object') {\r\n this.setAttribute(attrName, value);\r\n } else {\r\n this.onAttributeChange(attrName, oldValue, value, false);\r\n }\r\n } else {\r\n if (!this.hasAttribute(toKebabCase(propName))) {\r\n this.constructor.propsInit[propName] = value;\r\n }\r\n }\r\n }\r\n if (!target.constructor.propsInit) {\r\n target.constructor.propsInit = {};\r\n }\r\n target.constructor.propsInit[propName] = null;\r\n Object.defineProperty(target, propName, { get, set });\r\n };\r\n};\r\n\r\nconst getProps = (target: any) => {\r\n const watchAttributes = target.constructor.watchAttributes;\r\n const plainAttributes = { ...watchAttributes };\r\n Object.keys(plainAttributes).forEach(v => plainAttributes[v] = '');\r\n const cycleProps = { ...plainAttributes, ...target.constructor.propsInit };\r\n return Object.keys(cycleProps);\r\n};\r\n\r\nexport const initializeProps = (target: any) => {\r\n const watchAttributes = target.constructor.watchAttributes;\r\n for (let prop of getProps(target)) {\r\n if (watchAttributes) {\r\n if (watchAttributes[toKebabCase(prop)] == null) {\r\n watchAttributes[toKebabCase(prop)] = '';\r\n } else {\r\n const attribValue = target.props[prop] || target.getAttribute(toKebabCase(prop));\r\n if (typeof target[watchAttributes[prop]] == 'function') {\r\n target[watchAttributes[prop]]({ new: attribValue });\r\n }\r\n }\r\n }\r\n if (target.constructor.propsInit[prop]) {\r\n if (!target.hasAttribute(toKebabCase(prop))) {\r\n target[prop] = target.constructor.propsInit[prop];\r\n }\r\n }\r\n }\r\n};","import { toKebabCase } from './util';\r\n\r\nexport const Toggle = (): any => {\r\n return (target: any, propName: any) => {\r\n function get() {\r\n const getAttribute = (propName: string) => {\r\n if (this.hasAttribute(propName)) {\r\n const attrValue = this.getAttribute(propName);\r\n if (/^(true|false|^$)$/.test(attrValue)) {\r\n return attrValue == 'true' || attrValue == '';\r\n } else {\r\n return false;\r\n }\r\n }\r\n return false;\r\n };\r\n return getAttribute(propName);\r\n }\r\n function set(value: any) {\r\n const oldValue = value;\r\n if (value != undefined) {\r\n switch (typeof value) {\r\n case 'boolean':\r\n break;\r\n case 'string':\r\n if (/^(true|false|^$)$/.test(value)) {\r\n value = oldValue == 'true' || oldValue == '';\r\n } else {\r\n console.warn(`TypeError: Cannot set boolean toggle property '${propName}' to '${value}'`);\r\n value = false;\r\n }\r\n break;\r\n default:\r\n throw (`TypeError: Cannot set boolean toggle property '${propName}' to '${value}'`);\r\n }\r\n }\r\n if (this.__connected) {\r\n this.props[propName] = value || false;\r\n if (oldValue !== '' && oldValue !== null) {\r\n this.setAttribute(propName, value);\r\n } else {\r\n if (value) {\r\n this.setAttribute(propName, '');\r\n } else {\r\n this.removeAttribute(propName);\r\n }\r\n }\r\n } else {\r\n if (!this.hasAttribute(toKebabCase(propName))) {\r\n this.constructor.propsInit[propName] = value;\r\n }\r\n }\r\n }\r\n if (!target.constructor.propsInit) {\r\n target.constructor.propsInit = {};\r\n }\r\n target.constructor.propsInit[propName] = null;\r\n Object.defineProperty(target, propName, { get, set });\r\n };\r\n};\r\n","export const toKebabCase = (str: string) => {\r\n return str\r\n .replace(/([a-z])([A-Z])/g, '$1-$2')\r\n .replace(/[\\s_]+/g, '-')\r\n .toLowerCase();\r\n};\r\n\r\nexport const toCamelCase = (str: string) => {\r\n return str\r\n .toLowerCase()\r\n .replace(/(\\-\\w)/g, (m) => m[1].toUpperCase());\r\n};\r\n\r\nexport const toDotCase = (str: string) => {\r\n return str.replace(/(?!^)([A-Z])/g, ' $1')\r\n .replace(/[_\\s]+(?=[a-zA-Z])/g, '.')\r\n .toLowerCase();\r\n};\r\n\r\nexport const tryParseInt = (value: any) => {\r\n return (parseInt(value) == value && parseFloat(value) !== NaN) ? parseInt(value) : value;\r\n};\r\n","import { toKebabCase } from './util';\r\n\r\nexport const Watch = (attrName: string) => {\r\n return (target: any, propertyName: string) => {\r\n if (!target.constructor.watchAttributes) {\r\n target.constructor.watchAttributes = {};\r\n }\r\n target.constructor.watchAttributes[toKebabCase(attrName)] = propertyName;\r\n if (!target.constructor.propsInit) {\r\n target.constructor.propsInit = {};\r\n }\r\n target.constructor.propsInit[attrName] = null;\r\n };\r\n};","module.exports = \"<svg aria-labelledby=\\\"svg-inline--fa-title-s83c8hdkLb90\\\" data-prefix=\\\"fas\\\" data-icon=\\\"angle-right\\\" class=\\\"__1uROMIU__svg-inline--fa __1uROMIU__fa-angle-right __1uROMIU__ \\\" role=\\\"img\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 256 512\\\"><title id=\\\"svg-inline--fa-title-s83c8hdkLb90\\\">Til Geonorge</title><path fill=\\\"currentColor\\\" d=\\\"M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z\\\"></path></svg>\"","// Dependencies\nimport {\n Component,\n CustomElement,\n CustomElementOptions,\n Prop,\n Watch,\n getElement,\n getShadowRootElement\n} from \"super-custom-elements\";\n\n// Assets\nimport AngleRight from \"../../assets/svg/angle-right.svg\";\n\ninterface BreadcrumbListOptions extends CustomElementOptions {\n breadcrumbs: Array<BreadcrumbListItem>;\n}\n\ninterface BreadcrumbListItem extends Object {\n name: string;\n url: string;\n}\n\n@Component({\n tag: \"breadcrumb-list\",\n template: import(\"./breadcrumb-list.html\"),\n style: import(\"./breadcrumb-list.scss\")\n})\nexport class BreadcrumbList extends CustomElement {\n private static readonly elementSelector = \"breadcrumb-list\";\n private breadcrumbListElement: HTMLUListElement;\n\n @Prop() id: string;\n @Prop() breadcrumbs: any; // Array<BreadcrumbListItem>;\n\n constructor() {\n super();\n }\n\n setup(options?: BreadcrumbListOptions): void {\n this.connect(options.container);\n if (options.id) {\n this.id = options.id;\n }\n }\n\n connectedCallback() {\n this.renderBreadcrumbsFromAttribute(this.breadcrumbs);\n }\n\n public static getBreadCrumbListElement = (breadcrumbs: Array<BreadcrumbListItem>) => {\n const breadcrumbsListElement = breadcrumbs?.length\n ? breadcrumbs\n .map((breadcrumbListItem: BreadcrumbListItem, index) => {\n const activeHash = `${window.location.hash}`;\n const activePath = `${window.location.pathname}${window.location.hash}${window.location.search}`;\n const activeHref = window.location.href;\n const isActiveHash = activeHash.toLowerCase() === breadcrumbListItem.url.toLowerCase();\n const isActivePath = activePath.toLowerCase() === breadcrumbListItem.url.toLowerCase();\n const isActiveHref = activeHref.toLowerCase() === breadcrumbListItem.url.toLowerCase();\n\n const menuItemElement =\n breadcrumbListItem?.url?.length && !isActiveHash && !isActivePath && !isActiveHref\n ? `<a href=\"${breadcrumbListItem.url}\">${breadcrumbListItem.name}</a>`\n : `<span>${breadcrumbListItem.name}</span>`;\n\n return `<li>${menuItemElement}${index < breadcrumbs.length - 1 ? AngleRight : \"\"}</li>`;\n })\n .join(\"\")\n : \"\";\n return breadcrumbsListElement;\n }\n\n public static renderBreadcrumbs = (breadcrumbs: Array<BreadcrumbListItem>) => {\n const element = getElement<BreadcrumbList>(\"#breadcrumb-list\");\n const breadCrumbListShadow = getShadowRootElement(element, \"#breadcrumb-list\");\n breadCrumbListShadow.innerHTML = BreadcrumbList.getBreadCrumbListElement(breadcrumbs);\n };\n\n renderBreadcrumbsFromAttribute = (breadcrumbs: string) => {\n const breadcrumbListItems = JSON.parse(breadcrumbs);\n BreadcrumbList.renderBreadcrumbs(breadcrumbListItems);\n };\n\n @Watch(\"breadcrumbs\")\n breadcrumbsChanged() {\n if (this.breadcrumbs?.length) {\n this.renderBreadcrumbsFromAttribute(this.breadcrumbs);\n }\n }\n\n public static setup(selector: string, options: BreadcrumbListOptions) {\n const element = getElement<BreadcrumbList>(selector);\n getShadowRootElement(element, \"#breadcrumb-list\").innerHTML = this.getBreadCrumbListElement(options.breadcrumbs);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(8574);\n"],"names":["root","factory","exports","module","define","amd","self","___CSS_LOADER_EXPORT___","push","id","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","alreadyImportedModules","k","_k","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","Component","args","target","tag","toKebabCase","prototype","constructor","name","customElement","super","props","showShadowRoot","shadow","shadowRoot","attachShadow","mode","observedAttributes","Object","keys","propsInit","x","attributeChangedCallback","oldValue","newValue","onAttributeChange","set","toCamelCase","watchAttributes","methodToCall","__connected","old","new","connectedCallback","render","addEventListeners","initializeProps","template","document","createElement","innerHTML","getStyle","Promise","appendChild","getExternalTemplate","cloneNode","markup","default","fragment","createRange","createContextualFragment","children","nodeName","firstChild","css","style","ready","resolve","_","customElements","get","CustomElement","HTMLElement","connect","selector","isConnected","querySelector","getElement","getShadowRootElement","Listen","eventName","methodName","listeners","handler","targetRoot","listener","eventTarget","addEventListener","e","call","Dispatch","propertyName","defineProperty","emit","options","evtName","toDotCase","dispatchEvent","CustomEvent","Prop","propName","attrName","getAttribute","value","tryParseInt","setAttribute","hasAttribute","prop","plainAttributes","forEach","v","cycleProps","getProps","attribValue","Toggle","attrValue","test","console","warn","removeAttribute","str","replace","toLowerCase","m","toUpperCase","parseInt","NaN","parseFloat","Watch","BreadcrumbList","renderBreadcrumbsFromAttribute","breadcrumbs","breadcrumbListItems","parse","renderBreadcrumbs","setup","container","breadcrumbsChanged","static","element","getBreadCrumbListElement","elementSelector","breadcrumbListItem","index","activeHash","window","location","hash","activePath","pathname","search","activeHref","href","isActiveHash","url","isActivePath","isActiveHref","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","enumerable","obj","hasOwnProperty","r","Symbol","toStringTag"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"BreadcrumbList.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAkB,SAAID,KAEtBD,EAAe,SAAIA,EAAe,UAAK,CAAC,EAAGA,EAAe,SAAkB,eAAIC,IACjF,CATD,CASGK,MAAM,I,wGCNLC,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACL,EAAOM,GAAI,4WAAiX,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,2DAA2D,gDAAgD,MAAQ,GAAG,SAAW,4MAA4M,eAAiB,CAAC,iqBAAmqB,iFAAqF,WAAa,MAEzhD,S,4DCPA,qE,wBCMAN,EAAOD,QAAU,SAAUQ,GACzB,IAAIC,EAAO,GA4EX,OAzEAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAAU,GACVC,OAA+B,IAAZF,EAAK,GAoB5B,OAnBIA,EAAK,KACPC,GAAW,cAA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AenF,KAAKkF,EAAKhE,GCClFmD,EAAoBe,EAAKxM,IACH,oBAAXyM,QAA0BA,OAAOC,aAC1CnJ,OAAOgE,eAAevH,EAASyM,OAAOC,YAAa,CAAExE,MAAO,WAE7D3E,OAAOgE,eAAevH,EAAS,aAAc,CAAEkI,OAAO,GAAO,ECFpCuD,EAAoB,K","sources":["webpack://geonorge/webpack/universalModuleDefinition","webpack://geonorge/./stories/breadcrumb-list/breadcrumb-list.scss","webpack://geonorge/./stories/breadcrumb-list/breadcrumb-list.html","webpack://geonorge/../node_modules/css-loader/dist/runtime/api.js","webpack://geonorge/../node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://geonorge/../node_modules/super-custom-elements/src/component.ts","webpack://geonorge/../node_modules/super-custom-elements/src/custom-element.ts","webpack://geonorge/../node_modules/super-custom-elements/src/helpers.ts","webpack://geonorge/../node_modules/super-custom-elements/src/index.ts","webpack://geonorge/../node_modules/super-custom-elements/src/listen.ts","webpack://geonorge/../node_modules/super-custom-elements/src/prop.ts","webpack://geonorge/../node_modules/super-custom-elements/src/toggle.ts","webpack://geonorge/../node_modules/super-custom-elements/src/util.ts","webpack://geonorge/../node_modules/super-custom-elements/src/watch.ts","webpack://geonorge/./assets/svg/angle-right.svg","webpack://geonorge/./stories/breadcrumb-list/breadcrumb-list.ts","webpack://geonorge/webpack/bootstrap","webpack://geonorge/webpack/runtime/compat get default export","webpack://geonorge/webpack/runtime/define property getters","webpack://geonorge/webpack/runtime/hasOwnProperty shorthand","webpack://geonorge/webpack/runtime/make namespace object","webpack://geonorge/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"geonorge\"] = factory();\n\telse\n\t\troot[\"geonorge\"] = root[\"geonorge\"] || {}, root[\"geonorge\"][\"BreadcrumbList\"] = factory();\n})(self, () => {\nreturn ","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"ul{display:flex;margin-top:20px;padding:0}ul li{list-style-type:none;padding:0 10px 0 0}ul li:first-of-type{padding-left:10px}ul li a{font-family:\\\"Open Sans\\\",sans-serif;color:#3767c7;text-decoration:none;font-weight:400}ul li span{font-family:\\\"Open Sans\\\",sans-serif;font-weight:400}ul li svg{height:1em;overflow:visible;vertical-align:-0.125em;margin-left:10px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./stories/breadcrumb-list/breadcrumb-list.scss\",\"webpack://./style/variables/_typography.scss\"],\"names\":[],\"mappings\":\"AAEA,GACI,YAAA,CACA,eAAA,CACA,SAAA,CACA,MACI,oBAAA,CACA,kBAAA,CACA,oBACI,iBAAA,CAEJ,QACI,kCCbG,CDcH,aAAA,CACA,oBAAA,CACA,eAAA,CAEJ,WACI,kCCnBG,CDoBH,eAAA,CAEJ,UACI,UAAA,CACA,gBAAA,CACA,uBAAA,CACA,gBAAA\",\"sourcesContent\":[\"@import \\\"../../style/all\\\";\\n\\nul {\\n display: flex;\\n margin-top: 20px;\\n padding: 0;\\n li {\\n list-style-type: none;\\n padding: 0 10px 0 0;\\n &:first-of-type {\\n padding-left: 10px;\\n }\\n a {\\n font-family: $default-font;\\n color: $primary-text;\\n text-decoration: none;\\n font-weight: 400;\\n }\\n span {\\n font-family: $default-font;\\n font-weight: 400;\\n }\\n svg {\\n height: 1em;\\n overflow: visible;\\n vertical-align: -0.125em;\\n margin-left: 10px;\\n }\\n }\\n}\\n\",\"$default-font: \\\"Open Sans\\\", sans-serif;\\n$header-font: \\\"Raleway\\\", sans-serif;\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","export default \"<template>\\n <ul id=\\\"breadcrumb-list\\\"></ul>\\n</template>\";","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","import { addEventListeners, ListenerMetadata } from './listen';\r\nimport { initializeProps } from './prop';\r\nimport { ComponentMetadata, KeyValue } from './types';\r\nimport { toKebabCase, toCamelCase } from './util';\r\n\r\nexport const Component = (args: ComponentMetadata) => {\r\n return (target: any) => {\r\n const tag: string = args.tag || toKebabCase(target.prototype.constructor.name);\r\n const customElement: any = class extends (target as { new(): any }) {\r\n protected static __connected: boolean = false;\r\n protected static propsInit: KeyValue;\r\n protected static watchAttributes: KeyValue;\r\n protected static listeners: ListenerMetadata[];\r\n protected static ready: Promise<boolean> = new Promise((resolve, _) => resolve(true));\r\n public props: KeyValue = {};\r\n private showShadowRoot: boolean;\r\n\r\n public static get observedAttributes(): string[] {\r\n return Object.keys(this.propsInit || {}).map(x => toKebabCase(x));\r\n }\r\n\r\n constructor() {\r\n super();\r\n\r\n this.showShadowRoot = args.shadow == null ? true : args.shadow;\r\n\r\n if (!this.shadowRoot && this.showShadowRoot) {\r\n this.attachShadow({ mode: 'open' });\r\n }\r\n }\r\n\r\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\r\n this.onAttributeChange(name, oldValue, newValue);\r\n }\r\n\r\n public onAttributeChange(name: string, oldValue: string, newValue: string, set: boolean = true): void {\r\n if (oldValue != newValue) {\r\n if (set) { this[toCamelCase(name)] = newValue; }\r\n const watchAttributes: KeyValue = (this.constructor as any).watchAttributes;\r\n if (watchAttributes && watchAttributes[name]) {\r\n const methodToCall: string = watchAttributes[name];\r\n if (this.__connected) {\r\n if (typeof this[methodToCall] == 'function') {\r\n this[methodToCall]({ old: oldValue, new: newValue });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public async connectedCallback(): Promise<void> {\r\n await this.render();\r\n super.connectedCallback && super.connectedCallback();\r\n this.__connected = true;\r\n\r\n addEventListeners(this);\r\n initializeProps(this);\r\n }\r\n\r\n private async render(): Promise<void> {\r\n if (this.__connected) {\r\n return;\r\n }\r\n\r\n const template = document.createElement('template');\r\n template.innerHTML = await this.getStyle();\r\n\r\n if (args.template instanceof Promise) {\r\n template.content.appendChild(await this.getExternalTemplate());\r\n } else if (typeof args.template === 'string') {\r\n template.innerHTML += args.template;\r\n }\r\n\r\n (this.showShadowRoot ? this.shadowRoot : this).appendChild(template.content.cloneNode(true));\r\n }\r\n\r\n private async getExternalTemplate(): Promise<DocumentFragment> {\r\n const templateModule = await (args.template as Promise<typeof import('*.html')>);\r\n const markup = templateModule.default.toString();\r\n const fragment = document.createRange().createContextualFragment(markup);\r\n\r\n if (fragment.children.length === 1 && fragment.children[0].nodeName === 'TEMPLATE') {\r\n return (fragment.firstChild as HTMLTemplateElement).content;\r\n }\r\n return fragment;\r\n }\r\n\r\n private async getStyle(): Promise<string> {\r\n let css: string;\r\n\r\n if (args.style instanceof Promise) {\r\n const styleModule = await args.style;\r\n css = styleModule.default.toString();\r\n } else if (typeof args.style === 'string') {\r\n css = args.style;\r\n }\r\n\r\n return `${css ? `<style>${css}</style>` : ''}`\r\n }\r\n };\r\n\r\n if (!customElements.get(tag)) {\r\n customElements.define(tag, customElement);\r\n }\r\n\r\n return customElement;\r\n };\r\n};\r\n\r\n\r\n","import { CustomElementOptions } from \"./types\";\r\n\r\nexport abstract class CustomElement extends HTMLElement {\r\n constructor() {\r\n super();\r\n }\r\n\r\n protected abstract setup(options?: CustomElementOptions): void;\r\n\r\n protected connect(selector: string): void {\r\n if (!this.isConnected) {\r\n document.querySelector(selector).appendChild(this);\r\n }\r\n }\r\n}\r\n","export const getElement = <T extends HTMLElement>(selector: string): T => {\r\n return document.querySelector(selector);\r\n};\r\n\r\nexport const getShadowRootElement = <T extends HTMLElement>(customElement: HTMLElement, selector: string): T => {\r\n return customElement.shadowRoot.querySelector(selector);\r\n};","export * from './component';\r\nexport * from './custom-element';\r\nexport * from './helpers';\r\nexport * from './listen';\r\nexport * from './prop';\r\nexport * from './toggle';\r\nexport * from './types';\r\nexport * from './watch';","import { toDotCase } from './util';\r\n\r\ninterface ListenerMetadata {\r\n eventName: string;\r\n handler: Function;\r\n selector?: string;\r\n}\r\n\r\ninterface CustomEventOptions {\r\n bubbles?: boolean;\r\n composed?: boolean;\r\n detail?: any;\r\n}\r\n\r\ninterface DispatchEmitter {\r\n emit(options?: CustomEventOptions): void;\r\n}\r\n\r\nconst Listen = (eventName: string, selector?: string) => {\r\n return (target: any, methodName: string) => {\r\n if (!target.constructor.listeners) {\r\n target.constructor.listeners = [];\r\n }\r\n target.constructor.listeners.push({ selector: selector, eventName: eventName, handler: target[methodName] });\r\n };\r\n};\r\n\r\nconst addEventListeners = (target: any) => {\r\n if (target.constructor.listeners) {\r\n const targetRoot: any = target.shadowRoot || target;\r\n for (const listener of target.constructor.listeners as Array<ListenerMetadata>) {\r\n const eventTarget = (listener.selector)\r\n ? targetRoot.querySelector(listener.selector)\r\n ? targetRoot.querySelector(listener.selector) : null\r\n : target;\r\n if (eventTarget) {\r\n eventTarget.addEventListener(listener.eventName, (e: CustomEvent) => {\r\n listener.handler.call(target, e);\r\n });\r\n }\r\n }\r\n }\r\n};\r\n\r\nconst Dispatch = (eventName?: string) => {\r\n return (target: HTMLElement, propertyName: string) => {\r\n function get() {\r\n const self: EventTarget = this as EventTarget;\r\n return {\r\n emit(options?: CustomEventOptions) {\r\n const evtName = (eventName) ? eventName : toDotCase(propertyName);\r\n self.dispatchEvent(new CustomEvent(evtName, options));\r\n }\r\n };\r\n }\r\n Object.defineProperty(target, propertyName, { get });\r\n };\r\n};\r\n\r\nexport { Listen, addEventListeners, DispatchEmitter, Dispatch, CustomEventOptions, ListenerMetadata };","import { toKebabCase, tryParseInt } from './util';\r\n\r\nexport const Prop = (): any => {\r\n return (target: any, propName: any) => {\r\n const attrName = toKebabCase(propName);\r\n function get() {\r\n if (this.props[propName]) {\r\n return this.props[propName];\r\n }\r\n return this.getAttribute(attrName);\r\n }\r\n function set(value: any) {\r\n if (this.__connected) {\r\n const oldValue = this.props[propName];\r\n this.props[propName] = tryParseInt(value);\r\n if (typeof value != 'object') {\r\n this.setAttribute(attrName, value);\r\n } else {\r\n this.onAttributeChange(attrName, oldValue, value, false);\r\n }\r\n } else {\r\n if (!this.hasAttribute(toKebabCase(propName))) {\r\n this.constructor.propsInit[propName] = value;\r\n }\r\n }\r\n }\r\n if (!target.constructor.propsInit) {\r\n target.constructor.propsInit = {};\r\n }\r\n target.constructor.propsInit[propName] = null;\r\n Object.defineProperty(target, propName, { get, set });\r\n };\r\n};\r\n\r\nconst getProps = (target: any) => {\r\n const watchAttributes = target.constructor.watchAttributes;\r\n const plainAttributes = { ...watchAttributes };\r\n Object.keys(plainAttributes).forEach(v => plainAttributes[v] = '');\r\n const cycleProps = { ...plainAttributes, ...target.constructor.propsInit };\r\n return Object.keys(cycleProps);\r\n};\r\n\r\nexport const initializeProps = (target: any) => {\r\n const watchAttributes = target.constructor.watchAttributes;\r\n for (let prop of getProps(target)) {\r\n if (watchAttributes) {\r\n if (watchAttributes[toKebabCase(prop)] == null) {\r\n watchAttributes[toKebabCase(prop)] = '';\r\n } else {\r\n const attribValue = target.props[prop] || target.getAttribute(toKebabCase(prop));\r\n if (typeof target[watchAttributes[prop]] == 'function') {\r\n target[watchAttributes[prop]]({ new: attribValue });\r\n }\r\n }\r\n }\r\n if (target.constructor.propsInit[prop]) {\r\n if (!target.hasAttribute(toKebabCase(prop))) {\r\n target[prop] = target.constructor.propsInit[prop];\r\n }\r\n }\r\n }\r\n};","import { toKebabCase } from './util';\r\n\r\nexport const Toggle = (): any => {\r\n return (target: any, propName: any) => {\r\n function get() {\r\n const getAttribute = (propName: string) => {\r\n if (this.hasAttribute(propName)) {\r\n const attrValue = this.getAttribute(propName);\r\n if (/^(true|false|^$)$/.test(attrValue)) {\r\n return attrValue == 'true' || attrValue == '';\r\n } else {\r\n return false;\r\n }\r\n }\r\n return false;\r\n };\r\n return getAttribute(propName);\r\n }\r\n function set(value: any) {\r\n const oldValue = value;\r\n if (value != undefined) {\r\n switch (typeof value) {\r\n case 'boolean':\r\n break;\r\n case 'string':\r\n if (/^(true|false|^$)$/.test(value)) {\r\n value = oldValue == 'true' || oldValue == '';\r\n } else {\r\n console.warn(`TypeError: Cannot set boolean toggle property '${propName}' to '${value}'`);\r\n value = false;\r\n }\r\n break;\r\n default:\r\n throw (`TypeError: Cannot set boolean toggle property '${propName}' to '${value}'`);\r\n }\r\n }\r\n if (this.__connected) {\r\n this.props[propName] = value || false;\r\n if (oldValue !== '' && oldValue !== null) {\r\n this.setAttribute(propName, value);\r\n } else {\r\n if (value) {\r\n this.setAttribute(propName, '');\r\n } else {\r\n this.removeAttribute(propName);\r\n }\r\n }\r\n } else {\r\n if (!this.hasAttribute(toKebabCase(propName))) {\r\n this.constructor.propsInit[propName] = value;\r\n }\r\n }\r\n }\r\n if (!target.constructor.propsInit) {\r\n target.constructor.propsInit = {};\r\n }\r\n target.constructor.propsInit[propName] = null;\r\n Object.defineProperty(target, propName, { get, set });\r\n };\r\n};\r\n","export const toKebabCase = (str: string) => {\r\n return str\r\n .replace(/([a-z])([A-Z])/g, '$1-$2')\r\n .replace(/[\\s_]+/g, '-')\r\n .toLowerCase();\r\n};\r\n\r\nexport const toCamelCase = (str: string) => {\r\n return str\r\n .toLowerCase()\r\n .replace(/(\\-\\w)/g, (m) => m[1].toUpperCase());\r\n};\r\n\r\nexport const toDotCase = (str: string) => {\r\n return str.replace(/(?!^)([A-Z])/g, ' $1')\r\n .replace(/[_\\s]+(?=[a-zA-Z])/g, '.')\r\n .toLowerCase();\r\n};\r\n\r\nexport const tryParseInt = (value: any) => {\r\n return (parseInt(value) == value && parseFloat(value) !== NaN) ? parseInt(value) : value;\r\n};\r\n","import { toKebabCase } from './util';\r\n\r\nexport const Watch = (attrName: string) => {\r\n return (target: any, propertyName: string) => {\r\n if (!target.constructor.watchAttributes) {\r\n target.constructor.watchAttributes = {};\r\n }\r\n target.constructor.watchAttributes[toKebabCase(attrName)] = propertyName;\r\n if (!target.constructor.propsInit) {\r\n target.constructor.propsInit = {};\r\n }\r\n target.constructor.propsInit[attrName] = null;\r\n };\r\n};","module.exports = \"<svg aria-labelledby=\\\"svg-inline--fa-title-s83c8hdkLb90\\\" data-prefix=\\\"fas\\\" data-icon=\\\"angle-right\\\" class=\\\"__1OI33kj__svg-inline--fa __1OI33kj__fa-angle-right __1OI33kj__ \\\" role=\\\"img\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 256 512\\\"><path fill=\\\"currentColor\\\" d=\\\"M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z\\\"></path></svg>\"","// Dependencies\nimport {\n Component,\n CustomElement,\n CustomElementOptions,\n Prop,\n Watch,\n getElement,\n getShadowRootElement\n} from \"super-custom-elements\";\n\n// Assets\nimport AngleRight from \"../../assets/svg/angle-right.svg\";\n\ninterface BreadcrumbListOptions extends CustomElementOptions {\n breadcrumbs: Array<BreadcrumbListItem>;\n}\n\ninterface BreadcrumbListItem extends Object {\n name: string;\n url: string;\n}\n\n@Component({\n tag: \"breadcrumb-list\",\n template: import(\"./breadcrumb-list.html\"),\n style: import(\"./breadcrumb-list.scss\")\n})\nexport class BreadcrumbList extends CustomElement {\n private static readonly elementSelector = \"breadcrumb-list\";\n private breadcrumbListElement: HTMLUListElement;\n\n @Prop() id: string;\n @Prop() breadcrumbs: any; // Array<BreadcrumbListItem>;\n\n constructor() {\n super();\n }\n\n setup(options?: BreadcrumbListOptions): void {\n this.connect(options.container);\n if (options.id) {\n this.id = options.id;\n }\n }\n\n connectedCallback() {\n this.renderBreadcrumbsFromAttribute(this.breadcrumbs);\n }\n\n public static getBreadCrumbListElement = (breadcrumbs: Array<BreadcrumbListItem>) => {\n const breadcrumbsListElement = breadcrumbs?.length\n ? breadcrumbs\n .map((breadcrumbListItem: BreadcrumbListItem, index) => {\n const activeHash = `${window.location.hash}`;\n const activePath = `${window.location.pathname}${window.location.hash}${window.location.search}`;\n const activeHref = window.location.href;\n const isActiveHash = activeHash.toLowerCase() === breadcrumbListItem.url.toLowerCase();\n const isActivePath = activePath.toLowerCase() === breadcrumbListItem.url.toLowerCase();\n const isActiveHref = activeHref.toLowerCase() === breadcrumbListItem.url.toLowerCase();\n\n const menuItemElement =\n breadcrumbListItem?.url?.length && !isActiveHash && !isActivePath && !isActiveHref\n ? `<a href=\"${breadcrumbListItem.url}\">${breadcrumbListItem.name}</a>`\n : `<span>${breadcrumbListItem.name}</span>`;\n\n return `<li>${menuItemElement}${index < breadcrumbs.length - 1 ? AngleRight : \"\"}</li>`;\n })\n .join(\"\")\n : \"\";\n return breadcrumbsListElement;\n }\n\n public static renderBreadcrumbs = (breadcrumbs: Array<BreadcrumbListItem>) => {\n const element = getElement<BreadcrumbList>(\"#breadcrumb-list\");\n const breadCrumbListShadow = getShadowRootElement(element, \"#breadcrumb-list\");\n breadCrumbListShadow.innerHTML = BreadcrumbList.getBreadCrumbListElement(breadcrumbs);\n };\n\n renderBreadcrumbsFromAttribute = (breadcrumbs: string) => {\n const breadcrumbListItems = JSON.parse(breadcrumbs);\n BreadcrumbList.renderBreadcrumbs(breadcrumbListItems);\n };\n\n @Watch(\"breadcrumbs\")\n breadcrumbsChanged() {\n if (this.breadcrumbs?.length) {\n this.renderBreadcrumbsFromAttribute(this.breadcrumbs);\n }\n }\n\n public static setup(selector: string, options: BreadcrumbListOptions) {\n const element = getElement<BreadcrumbList>(selector);\n getShadowRootElement(element, \"#breadcrumb-list\").innerHTML = this.getBreadCrumbListElement(options.breadcrumbs);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(8574);\n"],"names":["root","factory","exports","module","define","amd","self","___CSS_LOADER_EXPORT___","push","id","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","alreadyImportedModules","k","_k","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","Component","args","target","tag","toKebabCase","prototype","constructor","name","customElement","super","props","showShadowRoot","shadow","shadowRoot","attachShadow","mode","observedAttributes","Object","keys","propsInit","x","attributeChangedCallback","oldValue","newValue","onAttributeChange","set","toCamelCase","watchAttributes","methodToCall","__connected","old","new","connectedCallback","render","addEventListeners","initializeProps","template","document","createElement","innerHTML","getStyle","Promise","appendChild","getExternalTemplate","cloneNode","markup","default","fragment","createRange","createContextualFragment","children","nodeName","firstChild","css","style","ready","resolve","_","customElements","get","CustomElement","HTMLElement","connect","selector","isConnected","querySelector","getElement","getShadowRootElement","Listen","eventName","methodName","listeners","handler","targetRoot","listener","eventTarget","addEventListener","e","call","Dispatch","propertyName","defineProperty","emit","options","evtName","toDotCase","dispatchEvent","CustomEvent","Prop","propName","attrName","getAttribute","value","tryParseInt","setAttribute","hasAttribute","prop","plainAttributes","forEach","v","cycleProps","getProps","attribValue","Toggle","attrValue","test","console","warn","removeAttribute","str","replace","toLowerCase","m","toUpperCase","parseInt","NaN","parseFloat","Watch","BreadcrumbList","renderBreadcrumbsFromAttribute","breadcrumbs","breadcrumbListItems","parse","renderBreadcrumbs","setup","container","breadcrumbsChanged","static","element","getBreadCrumbListElement","elementSelector","breadcrumbListItem","index","activeHash","window","location","hash","activePath","pathname","search","activeHref","href","isActiveHash","url","isActivePath","isActiveHref","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","enumerable","obj","hasOwnProperty","r","Symbol","toStringTag"],"sourceRoot":""}
|
package/MainMenu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.geonorge=t():(e.geonorge=e.geonorge||{},e.geonorge.MainMenu=t())}(self,(()=>(()=>{var e={2248:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var i=n(4663),o=n.n(i),r=n(7638),s=n.n(r)()(o());s.push([e.id,'*{box-sizing:border-box}button.menu-toggle-button{border:none;background:rgba(0,0,0,0);background-color:#7d746d;border-radius:2px;color:#fff;cursor:pointer;width:40px;height:32px;margin-left:4px}@media(min-width: 37.5em){button.menu-toggle-button{width:45px;height:37px}}@media(min-width: 992px){button.menu-toggle-button{width:98px;background-color:#7d746d;color:#fff}}button.menu-toggle-button.open{background-color:#414042}button.menu-toggle-button span{font-size:1.2em;font-weight:700;padding:2px 1px;vertical-align:middle}button.menu-toggle-button span.menu-title{display:none}@media(min-width: 992px){button.menu-toggle-button span.menu-title{display:inline-block}}button.menu-toggle-button span.hidden{display:none}button.menu-toggle-button svg{height:24px;width:24px;padding:2px;vertical-align:middle}@media(min-width: 37.5em){button.menu-toggle-button svg{height:29px;width:29px}}.menu-wrapper{position:absolute;left:0;width:100%}.menu-wrapper .menu-container{-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;box-sizing:border-box;width:100%;background-color:#dfdcda;margin:auto;position:relative;top:56px}@media(min-width: 37.5em){.menu-wrapper .menu-container{top:15px}}@media(min-width: 768px){.menu-wrapper .menu-container{width:750px}}@media(min-width: 992px){.menu-wrapper .menu-container{width:970px}}@media(min-width: 1200px){.menu-wrapper .menu-container{width:1170px}}@media print{.menu-wrapper .menu-container{display:none}}.menu-wrapper .menu-container.open{-webkit-box-shadow:0 5px 5px -2px rgba(0,0,0,.26);-moz-box-shadow:0 5px 5px -2px rgba(0,0,0,.26);box-shadow:0 5px 5px -2px rgba(0,0,0,.26);height:auto}.menu-wrapper .menu-container .menu-item-list-container{-moz-transition:max-height .3s ease-in-out;-o-transition:max-height .3s ease-in-out;-webkit-transition:max-height .3s ease-in-out;transition:max-height .3s ease-in-out;overflow:hidden;max-height:0}.menu-wrapper .menu-container .menu-item-list-container.open{max-height:300px;overflow:auto}@media(min-width: 37.5em){.menu-wrapper .menu-container .menu-item-list-container.open{max-height:450px}}@media(min-width: 992px){.menu-wrapper .menu-container .menu-item-list-container.open{max-height:300px}}.menu-wrapper .menu-container .menu-item-list-container .menuItemList{list-style:none;margin:15px;color:#414042}.menu-wrapper .menu-container .menu-item-list-container .menuItemList:first-child{padding:15px 0 0}.menu-wrapper .menu-container .menu-item-list-container .menuItemList a{color:#414042;text-decoration:none}.menu-wrapper .menu-container .menu-item-list-container .menuItemList a:hover{text-decoration:underline}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0{display:flex;flex-wrap:wrap}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li{flex:1 0 100%}@media(min-width: 37.5em){.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li{flex:1 0 50%}}@media(min-width: 992px){.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li{flex:1}}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li>a{border-bottom:1px solid #b6afa8;font-weight:700;padding-bottom:.75em;margin-bottom:.75em;display:block}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li>ul{padding:0}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li>ul li{margin-bottom:12px}.menu-wrapper .menu-container .menu-actions-row{-moz-transition:max-height .3s ease-in-out;-o-transition:max-height .3s ease-in-out;-webkit-transition:max-height .3s ease-in-out;transition:max-height .3s ease-in-out;text-align:right;background-color:#d2cecb;max-height:0;overflow:hidden}.menu-wrapper .menu-container .menu-actions-row.open{max-height:56px}.menu-wrapper .menu-container .menu-actions-row a,.menu-wrapper .menu-container .menu-actions-row button{display:inline-block;padding:.25em 1em .25em 1.1em;margin:15px 0;text-decoration:none;color:#414042;cursor:pointer;border:none;font-size:16px;font-weight:300;font-family:"Open Sans",sans-serif;background:none}.menu-wrapper .menu-container .menu-actions-row a:hover,.menu-wrapper .menu-container .menu-actions-row button:hover{text-decoration:underline}.menu-wrapper .menu-container .menu-actions-row a:not(:first-child),.menu-wrapper .menu-container .menu-actions-row button:not(:first-child){border-left:1px solid #b6afa8}',"",{version:3,sources:["webpack://./stories/main-navigation/main-menu/main-menu.scss","webpack://./style/mixins/_breakpoints.scss","webpack://./style/mixins/_border-radius.scss","webpack://./style/mixins/_box-shadow.scss","webpack://./style/mixins/_transition.scss","webpack://./style/variables/_typography.scss"],names:[],mappings:"AAEA,EACI,qBAAA,CAGJ,0BACI,WAAA,CACA,wBAAA,CACA,wBAAA,CACA,iBAAA,CACA,UAAA,CACA,cAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CCDI,0BDRR,0BAWQ,UAAA,CACA,WAAA,CAAA,CCZA,yBAAA,0BDeA,UAAA,CACA,wBAAA,CACA,UAAA,CAAA,CAEJ,+BACI,wBAAA,CAEJ,+BACI,eAAA,CACA,eAAA,CACA,eAAA,CACA,qBAAA,CACA,0CACI,YAAA,CC5BJ,yBD2BA,0CAGQ,oBAAA,CAAA,CAGR,sCACI,YAAA,CAGR,8BACI,WAAA,CACA,UAAA,CACA,WAAA,CACA,qBAAA,CCjCA,0BD6BJ,8BAMQ,WAAA,CACA,UAAA,CAAA,CAIZ,cACI,iBAAA,CACA,MAAA,CACA,UAAA,CAEA,8BE1DF,iCF2D6B,CE1D7B,yBF0D6B,CACvB,qBAAA,CACA,UAAA,CACA,wBAAA,CACA,WAAA,CACA,iBAAA,CACA,QAAA,CCpDA,0BD6CJ,8BASQ,QAAA,CAAA,CC1DJ,yBDiDJ,8BAaQ,WAAA,CAAA,CClEJ,yBDqDJ,8BAgBQ,WAAA,CAAA,CCzEJ,0BDyDJ,8BAmBQ,YAAA,CAAA,CAEJ,aArBJ,8BAsBQ,YAAA,CAAA,CAGJ,mCGnFJ,iDHoFQ,CGnFR,8CHmFQ,CGlFR,yCHkFQ,CACA,WAAA,CAEJ,wDIvFJ,0CJwFQ,CIvFR,wCJuFQ,CItFR,6CJsFQ,CIrFR,qCJqFQ,CACA,eAAA,CACA,YAAA,CACA,6DACI,gBAAA,CACA,aAAA,CChFR,0BD8EI,6DAIQ,gBAAA,CAAA,CC1FZ,yBDsFI,6DAOQ,gBAAA,CAAA,CAIR,sEACI,eAAA,CACA,WAAA,CACA,aAAA,CACA,kFACI,gBAAA,CAEJ,wEACI,aAAA,CACA,oBAAA,CACA,8EACI,yBAAA,CAGR,wFACI,YAAA,CACA,cAAA,CACA,2FACI,aAAA,CC3GhB,0BD0GY,2FAGQ,YAAA,CAAA,CCrHpB,yBDkHY,2FAMQ,MAAA,CAAA,CAEJ,6FACI,+BAAA,CACA,eAAA,CACA,oBAAA,CACA,mBAAA,CACA,aAAA,CAEJ,8FACI,SAAA,CACA,iGACI,kBAAA,CAOxB,gDIhJJ,0CJiJQ,CIhJR,wCJgJQ,CI/IR,6CJ+IQ,CI9IR,qCJ8IQ,CACA,gBAAA,CACA,wBAAA,CACA,YAAA,CACA,eAAA,CACA,qDACI,eAAA,CAEJ,yGACI,oBAAA,CACA,6BAAA,CACA,aAAA,CACA,oBAAA,CACA,aAAA,CACA,cAAA,CACA,WAAA,CACA,cAAA,CACA,eAAA,CACA,kCKpKD,CLqKC,eAAA,CACA,qHACI,yBAAA,CAEJ,6IACI,6BAAA",sourcesContent:['@import "../../../style/all";\n\n* {\n box-sizing: border-box;\n}\n\nbutton.menu-toggle-button {\n border: none;\n background: transparent;\n background-color: rgb(125, 116, 109);\n border-radius: 2px;\n color: rgb(255, 255, 255);\n cursor: pointer;\n width: 40px;\n height: 32px;\n margin-left: 4px;\n @include breakpoint(phablet) {\n width: 45px;\n height: 37px;\n }\n @include breakpoint(laptop) {\n width: 98px;\n background-color: rgb(125, 116, 109);\n color: #fff;\n }\n &.open {\n background-color: #414042;\n }\n span {\n font-size: 1.2em;\n font-weight: 700;\n padding: 2px 1px;\n vertical-align: middle;\n &.menu-title {\n display: none;\n @include breakpoint(laptop) {\n display: inline-block;\n }\n }\n &.hidden {\n display: none;\n }\n }\n svg {\n height: 24px;\n width: 24px;\n padding: 2px;\n vertical-align: middle;\n @include breakpoint(phablet) {\n height: 29px;\n width: 29px;\n }\n }\n}\n.menu-wrapper {\n position: absolute;\n left: 0;\n width: 100%;\n\n .menu-container {\n @include border-radius(0 0 3px 3px);\n box-sizing: border-box;\n width: 100%;\n background-color: #dfdcda;\n margin: auto;\n position: relative;\n top: 56px;\n @include breakpoint(phablet) {\n top: 15px;\n }\n\n @include breakpoint(tablet) {\n width: 750px;\n }\n @include breakpoint(laptop) {\n width: 970px;\n }\n @include breakpoint(desktop) {\n width: 1170px;\n }\n @media print {\n display: none;\n }\n\n &.open {\n @include box-shadow(0 5px 5px -2px rgba(0, 0, 0, 0.26));\n height: auto;\n }\n .menu-item-list-container {\n @include transition(max-height 0.3s ease-in-out);\n overflow: hidden;\n max-height: 0;\n &.open {\n max-height: 300px;\n overflow: auto;\n @include breakpoint(phablet) {\n max-height: 450px;\n }\n @include breakpoint(laptop) {\n max-height: 300px;\n }\n }\n\n .menuItemList {\n list-style: none;\n margin: 15px;\n color: #414042;\n &:first-child {\n padding: 15px 0 0;\n }\n a {\n color: #414042;\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n }\n &.hierarchy-level-0 {\n display: flex;\n flex-wrap: wrap;\n > li {\n flex: 1 0 100%;\n @include breakpoint(phablet) {\n flex: 1 0 50%;\n }\n @include breakpoint(laptop) {\n flex: 1;\n }\n > a {\n border-bottom: 1px solid #b6afa8;\n font-weight: 700;\n padding-bottom: 0.75em;\n margin-bottom: 0.75em;\n display: block;\n }\n > ul {\n padding: 0;\n li {\n margin-bottom: 12px;\n }\n }\n }\n }\n }\n }\n .menu-actions-row {\n @include transition(max-height 0.3s ease-in-out);\n text-align: right;\n background-color: #d2cecb;\n max-height: 0;\n overflow: hidden;\n &.open {\n max-height: 56px;\n }\n a, button {\n display: inline-block;\n padding: 0.25em 1em 0.25em 1.1em;\n margin: 15px 0;\n text-decoration: none;\n color: #414042;\n cursor: pointer;\n border: none;\n font-size: 16px;\n font-weight: 300;\n font-family: $default-font;\n background: none;\n &:hover {\n text-decoration: underline;\n }\n &:not(:first-child) {\n border-left: 1px solid #b6afa8;\n }\n }\n }\n }\n}\n',"@mixin breakpoint($point) {\n @if $point == desktop {\n @media (min-width: $screen-desktop) {\n @content;\n }\n } @else if $point == laptop {\n @media (min-width: $screen-laptop) {\n @content;\n }\n } @else if $point == tablet {\n @media (min-width: $screen-tablet) {\n @content;\n }\n } @else if $point == phablet {\n @media (min-width: $screen-phablet) {\n @content;\n }\n }\n}\n","@mixin border-radius($radius) {\n -webkit-border-radius: $radius;\n border-radius: $radius;\n}\n\n// Single side border-radius\n\n@mixin border-top-radius($radius) {\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}\n@mixin border-right-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n}\n@mixin border-bottom-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n}\n@mixin border-left-radius($radius) {\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}","\ufeff@mixin box-shadow($shadows...) {\n -webkit-box-shadow: $shadows;\n -moz-box-shadow: $shadows;\n box-shadow: $shadows;\n}\n","\ufeff@mixin transition($transition...) {\n -moz-transition: $transition;\n -o-transition: $transition;\n -webkit-transition: $transition;\n transition: $transition;\n}\n\n@mixin transition-property($property...) {\n -moz-transition-property: $property;\n -o-transition-property: $property;\n -webkit-transition-property: $property;\n transition-property: $property;\n}\n\n@mixin transition-duration($duration...) {\n -moz-transition-property: $duration;\n -o-transition-property: $duration;\n -webkit-transition-property: $duration;\n transition-property: $duration;\n}\n\n@mixin transition-timing-function($timing...) {\n -moz-transition-timing-function: $timing;\n -o-transition-timing-function: $timing;\n -webkit-transition-timing-function: $timing;\n transition-timing-function: $timing;\n}\n\n@mixin transition-delay($delay...) {\n -moz-transition-delay: $delay;\n -o-transition-delay: $delay;\n -webkit-transition-delay: $delay;\n transition-delay: $delay;\n}\n",'$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;'],sourceRoot:""}]);const a=s},5149:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});const i='<template>\n <button id="menu-toggle-button" class="menu-toggle-button">\n <span id="menu-title" class="menu-title">\n Meny\n </span>\n <span id="menu-icon"></span>\n <span id="close-icon"></span>\n </button>\n <div id="menu-wrapper" class="menu-wrapper">\n <div id="menu-container" class="menu-container open">\n <div id="menu-item-list-container" class="menu-item-list-container"></div>\n <div id="menu-actions-row" class="menu-actions-row"></div>\n </div>\n </div>\n</template>'},7638:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,o,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(i)for(var a=0;a<this.length;a++){var u=this[a][0];null!=u&&(s[u]=!0)}for(var c=0;c<e.length;c++){var l=[].concat(e[c]);i&&s[l[0]]||(void 0!==r&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),t.push(l))}},t}},4663:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var i=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),r="/*# ".concat(o," */");return[t].concat([r]).join("\n")}return[t].join("\n")}},1397:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const o=n(5969),r=n(5773),s=n(3804);t.Component=e=>t=>{var n;const a=e.tag||s.toKebabCase(t.prototype.constructor.name),u=((n=class extends t{constructor(){super(),this.props={},this.showShadowRoot=null==e.shadow||e.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((e=>s.toKebabCase(e)))}attributeChangedCallback(e,t,n){this.onAttributeChange(e,t,n)}onAttributeChange(e,t,n,i=!0){if(t!=n){i&&(this[s.toCamelCase(e)]=n);const o=this.constructor.watchAttributes;if(o&&o[e]){const i=o[e];this.__connected&&"function"==typeof this[i]&&this[i]({old:t,new:n})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return i(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,o.addEventListeners(this),r.initializeProps(this)}))}render(){return i(this,void 0,void 0,(function*(){if(this.__connected)return;const t=document.createElement("template");t.innerHTML=yield this.getStyle(),e.template instanceof Promise?t.content.appendChild(yield this.getExternalTemplate()):"string"==typeof e.template&&(t.innerHTML+=e.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(t.content.cloneNode(!0))}))}getExternalTemplate(){return i(this,void 0,void 0,(function*(){const t=(yield e.template).default.toString(),n=document.createRange().createContextualFragment(t);return 1===n.children.length&&"TEMPLATE"===n.children[0].nodeName?n.firstChild.content:n}))}getStyle(){return i(this,void 0,void 0,(function*(){let t;return e.style instanceof Promise?t=(yield e.style).default.toString():"string"==typeof e.style&&(t=e.style),t?`<style>${t}</style>`:""}))}}).__connected=!1,n.ready=new Promise(((e,t)=>e(!0))),n);return customElements.get(a)||customElements.define(a,u),u}},985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomElement=void 0;class n extends HTMLElement{constructor(){super()}connect(e){this.isConnected||document.querySelector(e).appendChild(this)}}t.CustomElement=n},265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShadowRootElement=t.getElement=void 0,t.getElement=e=>document.querySelector(e),t.getShadowRootElement=(e,t)=>e.shadowRoot.querySelector(t)},406:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(1397),t),o(n(985),t),o(n(265),t),o(n(5969),t),o(n(5773),t),o(n(4271),t),o(n(9766),t),o(n(4938),t)},5969:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const i=n(3804);t.Listen=(e,t)=>(n,i)=>{n.constructor.listeners||(n.constructor.listeners=[]),n.constructor.listeners.push({selector:t,eventName:e,handler:n[i]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const n of e.constructor.listeners){const i=n.selector?t.querySelector(n.selector)?t.querySelector(n.selector):null:e;i&&i.addEventListener(n.eventName,(t=>{n.handler.call(e,t)}))}}},t.Dispatch=e=>(t,n)=>{Object.defineProperty(t,n,{get:function(){const t=this;return{emit(o){const r=e||i.toDotCase(n);t.dispatchEvent(new CustomEvent(r,o))}}}})}},5773:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const i=n(3804);t.Prop=()=>(e,t)=>{const n=i.toKebabCase(t);e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return this.props[t]?this.props[t]:this.getAttribute(n)},set:function(e){if(this.__connected){const o=this.props[t];this.props[t]=i.tryParseInt(e),"object"!=typeof e?this.setAttribute(n,e):this.onAttributeChange(n,o,e,!1)}else this.hasAttribute(i.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})},t.initializeProps=e=>{const t=e.constructor.watchAttributes;for(let n of(e=>{const t=e.constructor.watchAttributes,n=Object.assign({},t);Object.keys(n).forEach((e=>n[e]=""));const i=Object.assign(Object.assign({},n),e.constructor.propsInit);return Object.keys(i)})(e)){if(t)if(null==t[i.toKebabCase(n)])t[i.toKebabCase(n)]="";else{const o=e.props[n]||e.getAttribute(i.toKebabCase(n));"function"==typeof e[t[n]]&&e[t[n]]({new:o})}e.constructor.propsInit[n]&&(e.hasAttribute(i.toKebabCase(n))||(e[n]=e.constructor.propsInit[n]))}}},4271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const i=n(3804);t.Toggle=()=>(e,t)=>{e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return(e=>{if(this.hasAttribute(e)){const t=this.getAttribute(e);return!!/^(true|false|^$)$/.test(t)&&("true"==t||""==t)}return!1})(t)},set:function(e){const n=e;if(null!=e)switch(typeof e){case"boolean":break;case"string":/^(true|false|^$)$/.test(e)?e="true"==n||""==n:(console.warn(`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`),e=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`}this.__connected?(this.props[t]=e||!1,""!==n&&null!==n?this.setAttribute(t,e):e?this.setAttribute(t,""):this.removeAttribute(t)):this.hasAttribute(i.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},9766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3804:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryParseInt=t.toDotCase=t.toCamelCase=t.toKebabCase=void 0,t.toKebabCase=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),t.toCamelCase=e=>e.toLowerCase().replace(/(\-\w)/g,(e=>e[1].toUpperCase())),t.toDotCase=e=>e.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),t.tryParseInt=e=>parseInt(e)==e&&NaN!==parseFloat(e)?parseInt(e):e},4938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const i=n(3804);t.Watch=e=>(t,n)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[i.toKebabCase(e)]=n,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},5854:e=>{e.exports='<svg aria-labelledby="svg-inline--fa-title-DQErafiATQyz" data-prefix="fas" data-icon="times" class="__2_2taji__svg-inline--fa __2_2taji__fa-times __2_2taji__fa-w-11 __2_2taji__ " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><title id="svg-inline--fa-title-DQErafiATQyz">Vis meny</title><path fill="#fff" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>'},7291:e=>{e.exports='<svg aria-labelledby="svg-inline--fa-title-rqezCtUcjPlp" data-prefix="fas" data-icon="bars" class="__1-Ii6EJ__svg-inline--fa __1-Ii6EJ__fa-bars __1-Ii6EJ__fa-w-14 __1-Ii6EJ__ " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><title id="svg-inline--fa-title-rqezCtUcjPlp">Vis meny</title><path fill="#fff" d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"></path></svg>'},9480:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchDropdownSearchResults=t.fetchMenuItems=t.getGeonorgeMenuUrl=t.getKartkatalogApiUrl=void 0,t.getKartkatalogApiUrl=e=>`https://kartkatalog.${"dev"===e||"test"===e?e+".":""}geonorge.no/api`,t.getGeonorgeMenuUrl=(e,t)=>`https://www.${"dev"===t||"test"===t?"test.":""}geonorge.no/${"en"===e?"en/":""}api/menu/get?omitLinks=1`,t.fetchMenuItems=(e="no",n="")=>{const i=(0,t.getGeonorgeMenuUrl)(e,n);return fetch(i).then((e=>e.json())).then((e=>e))},t.fetchDropdownSearchResults=(e="",i="no",o="")=>n(void 0,void 0,void 0,(function*(){const r={dataset:`search?text=${e=e.toString()}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=dataset`,series:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=series`,service:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=service`,servicelayer:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=servicelayer`,software:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=software`,articles:`articles?text=${e}`},s={headers:new Headers({"Accept-Language":i})};return e&&e.length?yield Promise.all(Object.keys(r).map((e=>n(void 0,void 0,void 0,(function*(){const n=(0,t.getKartkatalogApiUrl)(o);return fetch(`${n}/${r[e]}&limit=5`,s).then((e=>e.json())).then((t=>Object.assign(Object.assign({},t),{searchResultsType:e})))}))))):null}))},5527:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addGlobalStylesheet=t.getFocusableElementsInsideElement=void 0,t.getFocusableElementsInsideElement=e=>e.querySelectorAll('button, [href], input, [tabindex="0"]'),t.addGlobalStylesheet=(e,t)=>{const n=document.createElement("style");n.setAttribute("id",e),n.textContent=t,document.getElementById(e)||document.head.appendChild(n)}},8641:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MainMenu=void 0;const u=n(406),c=a(n(7291)),l=a(n(5854)),d=n(9480),p=n(5527);let h=class extends u.CustomElement{constructor(){super(),this.hideMenuContainer=()=>{this.showmenu=!1},this.renderMenuItems=(e,t=0,n=1)=>{const i=e.map((e=>{const i=e.SubMenuItem&&e.SubMenuItem.length?e.SubMenuItem:null;return`<li><a href="${e.Url}" tabindex="${this.showmenu?null:"-1"}">${e.Name}</a>${i&&t+1<=n?this.renderMenuItems(i,t+1,n):""}</li>`})).join("");return`<ul class="menuItemList hierarchy-level-${t}">${i}</ul>`},this.clickOutsideMenuContainer=this.clickOutsideMenuContainer.bind(this)}setup(e){this.connect(e.container),e.id&&(this.id=e.id)}connectedCallback(){this.menuButton=(0,u.getShadowRootElement)(this,"#menu-toggle-button"),this.menuTitle=(0,u.getShadowRootElement)(this,"#menu-title"),this.menuIcon=(0,u.getShadowRootElement)(this,"#menu-icon"),this.closeIcon=(0,u.getShadowRootElement)(this,"#close-icon"),this.menuContainer=(0,u.getShadowRootElement)(this,"#menu-container"),this.menuItemListContainer=(0,u.getShadowRootElement)(this,"#menu-item-list-container"),this.menuActionsRow=(0,u.getShadowRootElement)(this,"#menu-actions-row"),this.menuIcon.innerHTML=c.default,this.closeIcon.innerHTML=l.default,this.showmenu?this.menuIcon.classList.add("hidden"):this.closeIcon.classList.add("hidden"),(0,d.fetchMenuItems)(this.language,this.environment).then((e=>{this.menuitems=e})),this.menuButton.setAttribute("aria-label","en"===this.language?"Show menu":"Vis meny"),this.menuTitle&&(this.menuTitle.innerText="en"===this.language?"Menu":"Meny"),this.signinurl&&this.signouturl&&this.addAuthenticationLinks(),this.englishurl&&this.norwegianurl&&this.addLanguageSelectLinks(),document.addEventListener("click",this.clickOutsideMenuContainer)}disconnectedCallback(){document.removeEventListener("click",this.clickOutsideMenuContainer)}clickOutsideMenuContainer(e){const t=e.composedPath()[0];t.closest("#menu-container"),t.closest("#menu-container")||t.closest("#menu-toggle-button")||this.hideMenuContainer()}addAuthenticationLinks(e=!1){let t;if(!(this.signouturl&&this.signinurl||e))return"";e?(t=document.createElement("button"),t.addEventListener("click",(()=>{this.isloggedin?this.onSignOutClick.emit():this.onSignInClick.emit()}))):(t=document.createElement("a"),t.href=this.isloggedin?this.signouturl:this.signinurl);const n="en"===this.language?"Log in":"Logg inn",i="en"===this.language?"Log out":"Logg ut";t.innerText=this.isloggedin?i:n,t.id="authentication-toggle-element";for(const e of this.menuActionsRow.children)e.getAttribute("id")===t.id&&e.remove();this.showmenu||t.setAttribute("tabindex","-1"),this.menuActionsRow.appendChild(t)}addLanguageSelectLinks(e=!1){let t;if(!(this.norwegianurl&&this.englishurl||e))return"";e?(t=document.createElement("button"),t.addEventListener("click",(()=>{"en"===this.language?this.onNorwegianLanguageSelect.emit():this.onEnglishLanguageSelect.emit()}))):(t=document.createElement("a"),t.href="en"===this.language?this.norwegianurl:this.englishurl),t.innerText="en"===this.language?"Norsk":"English",t.id="language-toggle-element";for(const e of this.menuActionsRow.children)e.getAttribute("id")===t.id&&e.remove();this.showmenu||t.setAttribute("tabindex","-1"),this.menuActionsRow.appendChild(t)}buttonClicked(e){this.showmenu=!this.showmenu}hasAuthenticationFunctionChanged(){this.hasAuthenticationFunction&&this.addAuthenticationLinks(!0)}isLoggedInChanged(){this.addAuthenticationLinks(this.hasAuthenticationFunction)}hasLanguageSelectFunctionsChanged(){this.hasLanguageSelectFunctions&&this.addLanguageSelectLinks(!0)}languageChanged(){this.addAuthenticationLinks(this.hasAuthenticationFunction),this.addLanguageSelectLinks(this.hasLanguageSelectFunctions),(0,d.fetchMenuItems)(this.language,this.environment).then((e=>{this.menuitems=e})),this.menuTitle&&(this.menuTitle.innerText="en"===this.language?"Menu":"Meny"),this.menuButton.setAttribute("aria-label","en"===this.language?"Show menu":"Vis meny")}showMenuChanged(){this.showmenu?this.menuContainer.classList.add("open"):this.menuContainer.classList.remove("open"),this.showmenu?this.menuButton.classList.add("open"):this.menuButton.classList.remove("open"),this.showmenu?this.menuItemListContainer.classList.add("open"):this.menuItemListContainer.classList.remove("open"),this.showmenu?this.menuActionsRow.classList.add("open"):this.menuActionsRow.classList.remove("open"),this.showmenu?this.menuIcon.classList.add("hidden"):this.menuIcon.classList.remove("hidden"),this.showmenu?this.closeIcon.classList.remove("hidden"):this.closeIcon.classList.add("hidden"),(0,p.getFocusableElementsInsideElement)(this.menuContainer).forEach((e=>{this.showmenu?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1")}))}menuItemsChanged(){this.menuitems&&this.menuitems.length&&(this.menuItemListContainer.innerHTML=this.renderMenuItems(this.menuitems))}static setup(e,t){const n=(0,u.getElement)(e);t.onClick&&n.addEventListener("menuButtonClick",t.onClick),t.active&&(n.showmenu=t.active)}};h.elementSelector="main-menu",r([(0,u.Prop)()],h.prototype,"id",void 0),r([(0,u.Prop)()],h.prototype,"language",void 0),r([(0,u.Prop)()],h.prototype,"environment",void 0),r([(0,u.Prop)()],h.prototype,"signinurl",void 0),r([(0,u.Prop)()],h.prototype,"signouturl",void 0),r([(0,u.Prop)()],h.prototype,"norwegianurl",void 0),r([(0,u.Prop)()],h.prototype,"englishurl",void 0),r([(0,u.Toggle)()],h.prototype,"isloggedin",void 0),r([(0,u.Toggle)()],h.prototype,"showmenu",void 0),r([(0,u.Toggle)()],h.prototype,"hasAuthenticationFunction",void 0),r([(0,u.Toggle)()],h.prototype,"hasLanguageSelectFunctions",void 0),r([(0,u.Prop)()],h.prototype,"menuitems",void 0),r([(0,u.Dispatch)("onSignInClick")],h.prototype,"onSignInClick",void 0),r([(0,u.Dispatch)("onSignOutClick")],h.prototype,"onSignOutClick",void 0),r([(0,u.Dispatch)("onNorwegianLanguageSelect")],h.prototype,"onNorwegianLanguageSelect",void 0),r([(0,u.Dispatch)("onEnglishLanguageSelect")],h.prototype,"onEnglishLanguageSelect",void 0),r([(0,u.Listen)("click","#menu-toggle-button")],h.prototype,"buttonClicked",null),r([(0,u.Watch)("hasauthenticationfunction")],h.prototype,"hasAuthenticationFunctionChanged",null),r([(0,u.Watch)("isloggedin")],h.prototype,"isLoggedInChanged",null),r([(0,u.Watch)("haslanguageselectfunctions")],h.prototype,"hasLanguageSelectFunctionsChanged",null),r([(0,u.Watch)("language")],h.prototype,"languageChanged",null),r([(0,u.Watch)("showmenu")],h.prototype,"showMenuChanged",null),r([(0,u.Watch)("menuitems")],h.prototype,"menuItemsChanged",null),h=r([(0,u.Component)({tag:"main-menu",template:Promise.resolve().then((()=>s(n(5149)))),style:Promise.resolve().then((()=>s(n(2248))))})],h),t.MainMenu=h}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={id:i,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(8641)})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.geonorge=t():(e.geonorge=e.geonorge||{},e.geonorge.MainMenu=t())}(self,(()=>(()=>{var e={2248:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var i=n(4663),o=n.n(i),r=n(7638),s=n.n(r)()(o());s.push([e.id,'*{box-sizing:border-box}button.menu-toggle-button{border:none;background:rgba(0,0,0,0);background-color:#7d746d;border-radius:2px;color:#fff;cursor:pointer;width:40px;height:32px;margin-left:4px}@media(min-width: 37.5em){button.menu-toggle-button{width:45px;height:37px}}@media(min-width: 992px){button.menu-toggle-button{width:98px;background-color:#7d746d;color:#fff}}button.menu-toggle-button.open{background-color:#414042}button.menu-toggle-button span{font-size:1.2em;font-weight:700;padding:2px 1px;vertical-align:middle}button.menu-toggle-button span.menu-title{display:none}@media(min-width: 992px){button.menu-toggle-button span.menu-title{display:inline-block}}button.menu-toggle-button span.hidden{display:none}button.menu-toggle-button svg{height:24px;width:24px;padding:2px;vertical-align:middle}@media(min-width: 37.5em){button.menu-toggle-button svg{height:29px;width:29px}}.menu-wrapper{position:absolute;left:0;width:100%}.menu-wrapper .menu-container{-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;box-sizing:border-box;width:100%;background-color:#dfdcda;margin:auto;position:relative;top:56px}@media(min-width: 37.5em){.menu-wrapper .menu-container{top:15px}}@media(min-width: 768px){.menu-wrapper .menu-container{width:750px}}@media(min-width: 992px){.menu-wrapper .menu-container{width:970px}}@media(min-width: 1200px){.menu-wrapper .menu-container{width:1170px}}@media print{.menu-wrapper .menu-container{display:none}}.menu-wrapper .menu-container.open{-webkit-box-shadow:0 5px 5px -2px rgba(0,0,0,.26);-moz-box-shadow:0 5px 5px -2px rgba(0,0,0,.26);box-shadow:0 5px 5px -2px rgba(0,0,0,.26);height:auto}.menu-wrapper .menu-container .menu-item-list-container{-moz-transition:max-height .3s ease-in-out;-o-transition:max-height .3s ease-in-out;-webkit-transition:max-height .3s ease-in-out;transition:max-height .3s ease-in-out;overflow:hidden;max-height:0}.menu-wrapper .menu-container .menu-item-list-container.open{max-height:300px;overflow:auto}@media(min-width: 37.5em){.menu-wrapper .menu-container .menu-item-list-container.open{max-height:450px}}@media(min-width: 992px){.menu-wrapper .menu-container .menu-item-list-container.open{max-height:300px}}.menu-wrapper .menu-container .menu-item-list-container .menuItemList{list-style:none;margin:15px;color:#414042}.menu-wrapper .menu-container .menu-item-list-container .menuItemList:first-child{padding:15px 0 0}.menu-wrapper .menu-container .menu-item-list-container .menuItemList a{color:#414042;text-decoration:none}.menu-wrapper .menu-container .menu-item-list-container .menuItemList a:hover{text-decoration:underline}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0{display:flex;flex-wrap:wrap}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li{flex:1 0 100%}@media(min-width: 37.5em){.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li{flex:1 0 50%}}@media(min-width: 992px){.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li{flex:1}}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li>a{border-bottom:1px solid #b6afa8;font-weight:700;padding-bottom:.75em;margin-bottom:.75em;display:block}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li>ul{padding:0}.menu-wrapper .menu-container .menu-item-list-container .menuItemList.hierarchy-level-0>li>ul li{margin-bottom:12px}.menu-wrapper .menu-container .menu-actions-row{-moz-transition:max-height .3s ease-in-out;-o-transition:max-height .3s ease-in-out;-webkit-transition:max-height .3s ease-in-out;transition:max-height .3s ease-in-out;text-align:right;background-color:#d2cecb;max-height:0;overflow:hidden}.menu-wrapper .menu-container .menu-actions-row.open{max-height:56px}.menu-wrapper .menu-container .menu-actions-row a,.menu-wrapper .menu-container .menu-actions-row button{display:inline-block;padding:.25em 1em .25em 1.1em;margin:15px 0;text-decoration:none;color:#414042;cursor:pointer;border:none;font-size:16px;font-weight:300;font-family:"Open Sans",sans-serif;background:none}.menu-wrapper .menu-container .menu-actions-row a:hover,.menu-wrapper .menu-container .menu-actions-row button:hover{text-decoration:underline}.menu-wrapper .menu-container .menu-actions-row a:not(:first-child),.menu-wrapper .menu-container .menu-actions-row button:not(:first-child){border-left:1px solid #b6afa8}',"",{version:3,sources:["webpack://./stories/main-navigation/main-menu/main-menu.scss","webpack://./style/mixins/_breakpoints.scss","webpack://./style/mixins/_border-radius.scss","webpack://./style/mixins/_box-shadow.scss","webpack://./style/mixins/_transition.scss","webpack://./style/variables/_typography.scss"],names:[],mappings:"AAEA,EACI,qBAAA,CAGJ,0BACI,WAAA,CACA,wBAAA,CACA,wBAAA,CACA,iBAAA,CACA,UAAA,CACA,cAAA,CACA,UAAA,CACA,WAAA,CACA,eAAA,CCDI,0BDRR,0BAWQ,UAAA,CACA,WAAA,CAAA,CCZA,yBAAA,0BDeA,UAAA,CACA,wBAAA,CACA,UAAA,CAAA,CAEJ,+BACI,wBAAA,CAEJ,+BACI,eAAA,CACA,eAAA,CACA,eAAA,CACA,qBAAA,CACA,0CACI,YAAA,CC5BJ,yBD2BA,0CAGQ,oBAAA,CAAA,CAGR,sCACI,YAAA,CAGR,8BACI,WAAA,CACA,UAAA,CACA,WAAA,CACA,qBAAA,CCjCA,0BD6BJ,8BAMQ,WAAA,CACA,UAAA,CAAA,CAIZ,cACI,iBAAA,CACA,MAAA,CACA,UAAA,CAEA,8BE1DF,iCF2D6B,CE1D7B,yBF0D6B,CACvB,qBAAA,CACA,UAAA,CACA,wBAAA,CACA,WAAA,CACA,iBAAA,CACA,QAAA,CCpDA,0BD6CJ,8BASQ,QAAA,CAAA,CC1DJ,yBDiDJ,8BAaQ,WAAA,CAAA,CClEJ,yBDqDJ,8BAgBQ,WAAA,CAAA,CCzEJ,0BDyDJ,8BAmBQ,YAAA,CAAA,CAEJ,aArBJ,8BAsBQ,YAAA,CAAA,CAGJ,mCGnFJ,iDHoFQ,CGnFR,8CHmFQ,CGlFR,yCHkFQ,CACA,WAAA,CAEJ,wDIvFJ,0CJwFQ,CIvFR,wCJuFQ,CItFR,6CJsFQ,CIrFR,qCJqFQ,CACA,eAAA,CACA,YAAA,CACA,6DACI,gBAAA,CACA,aAAA,CChFR,0BD8EI,6DAIQ,gBAAA,CAAA,CC1FZ,yBDsFI,6DAOQ,gBAAA,CAAA,CAIR,sEACI,eAAA,CACA,WAAA,CACA,aAAA,CACA,kFACI,gBAAA,CAEJ,wEACI,aAAA,CACA,oBAAA,CACA,8EACI,yBAAA,CAGR,wFACI,YAAA,CACA,cAAA,CACA,2FACI,aAAA,CC3GhB,0BD0GY,2FAGQ,YAAA,CAAA,CCrHpB,yBDkHY,2FAMQ,MAAA,CAAA,CAEJ,6FACI,+BAAA,CACA,eAAA,CACA,oBAAA,CACA,mBAAA,CACA,aAAA,CAEJ,8FACI,SAAA,CACA,iGACI,kBAAA,CAOxB,gDIhJJ,0CJiJQ,CIhJR,wCJgJQ,CI/IR,6CJ+IQ,CI9IR,qCJ8IQ,CACA,gBAAA,CACA,wBAAA,CACA,YAAA,CACA,eAAA,CACA,qDACI,eAAA,CAEJ,yGACI,oBAAA,CACA,6BAAA,CACA,aAAA,CACA,oBAAA,CACA,aAAA,CACA,cAAA,CACA,WAAA,CACA,cAAA,CACA,eAAA,CACA,kCKpKD,CLqKC,eAAA,CACA,qHACI,yBAAA,CAEJ,6IACI,6BAAA",sourcesContent:['@import "../../../style/all";\n\n* {\n box-sizing: border-box;\n}\n\nbutton.menu-toggle-button {\n border: none;\n background: transparent;\n background-color: rgb(125, 116, 109);\n border-radius: 2px;\n color: rgb(255, 255, 255);\n cursor: pointer;\n width: 40px;\n height: 32px;\n margin-left: 4px;\n @include breakpoint(phablet) {\n width: 45px;\n height: 37px;\n }\n @include breakpoint(laptop) {\n width: 98px;\n background-color: rgb(125, 116, 109);\n color: #fff;\n }\n &.open {\n background-color: #414042;\n }\n span {\n font-size: 1.2em;\n font-weight: 700;\n padding: 2px 1px;\n vertical-align: middle;\n &.menu-title {\n display: none;\n @include breakpoint(laptop) {\n display: inline-block;\n }\n }\n &.hidden {\n display: none;\n }\n }\n svg {\n height: 24px;\n width: 24px;\n padding: 2px;\n vertical-align: middle;\n @include breakpoint(phablet) {\n height: 29px;\n width: 29px;\n }\n }\n}\n.menu-wrapper {\n position: absolute;\n left: 0;\n width: 100%;\n\n .menu-container {\n @include border-radius(0 0 3px 3px);\n box-sizing: border-box;\n width: 100%;\n background-color: #dfdcda;\n margin: auto;\n position: relative;\n top: 56px;\n @include breakpoint(phablet) {\n top: 15px;\n }\n\n @include breakpoint(tablet) {\n width: 750px;\n }\n @include breakpoint(laptop) {\n width: 970px;\n }\n @include breakpoint(desktop) {\n width: 1170px;\n }\n @media print {\n display: none;\n }\n\n &.open {\n @include box-shadow(0 5px 5px -2px rgba(0, 0, 0, 0.26));\n height: auto;\n }\n .menu-item-list-container {\n @include transition(max-height 0.3s ease-in-out);\n overflow: hidden;\n max-height: 0;\n &.open {\n max-height: 300px;\n overflow: auto;\n @include breakpoint(phablet) {\n max-height: 450px;\n }\n @include breakpoint(laptop) {\n max-height: 300px;\n }\n }\n\n .menuItemList {\n list-style: none;\n margin: 15px;\n color: #414042;\n &:first-child {\n padding: 15px 0 0;\n }\n a {\n color: #414042;\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n }\n &.hierarchy-level-0 {\n display: flex;\n flex-wrap: wrap;\n > li {\n flex: 1 0 100%;\n @include breakpoint(phablet) {\n flex: 1 0 50%;\n }\n @include breakpoint(laptop) {\n flex: 1;\n }\n > a {\n border-bottom: 1px solid #b6afa8;\n font-weight: 700;\n padding-bottom: 0.75em;\n margin-bottom: 0.75em;\n display: block;\n }\n > ul {\n padding: 0;\n li {\n margin-bottom: 12px;\n }\n }\n }\n }\n }\n }\n .menu-actions-row {\n @include transition(max-height 0.3s ease-in-out);\n text-align: right;\n background-color: #d2cecb;\n max-height: 0;\n overflow: hidden;\n &.open {\n max-height: 56px;\n }\n a, button {\n display: inline-block;\n padding: 0.25em 1em 0.25em 1.1em;\n margin: 15px 0;\n text-decoration: none;\n color: #414042;\n cursor: pointer;\n border: none;\n font-size: 16px;\n font-weight: 300;\n font-family: $default-font;\n background: none;\n &:hover {\n text-decoration: underline;\n }\n &:not(:first-child) {\n border-left: 1px solid #b6afa8;\n }\n }\n }\n }\n}\n',"@mixin breakpoint($point) {\n @if $point == desktop {\n @media (min-width: $screen-desktop) {\n @content;\n }\n } @else if $point == laptop {\n @media (min-width: $screen-laptop) {\n @content;\n }\n } @else if $point == tablet {\n @media (min-width: $screen-tablet) {\n @content;\n }\n } @else if $point == phablet {\n @media (min-width: $screen-phablet) {\n @content;\n }\n }\n}\n","@mixin border-radius($radius) {\n -webkit-border-radius: $radius;\n border-radius: $radius;\n}\n\n// Single side border-radius\n\n@mixin border-top-radius($radius) {\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}\n@mixin border-right-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-top-right-radius: $radius;\n border-top-right-radius: $radius;\n}\n@mixin border-bottom-radius($radius) {\n -webkit-border-bottom-right-radius: $radius;\n border-bottom-right-radius: $radius;\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n}\n@mixin border-left-radius($radius) {\n -webkit-border-bottom-left-radius: $radius;\n border-bottom-left-radius: $radius;\n -webkit-border-top-left-radius: $radius;\n border-top-left-radius: $radius;\n}","\ufeff@mixin box-shadow($shadows...) {\n -webkit-box-shadow: $shadows;\n -moz-box-shadow: $shadows;\n box-shadow: $shadows;\n}\n","\ufeff@mixin transition($transition...) {\n -moz-transition: $transition;\n -o-transition: $transition;\n -webkit-transition: $transition;\n transition: $transition;\n}\n\n@mixin transition-property($property...) {\n -moz-transition-property: $property;\n -o-transition-property: $property;\n -webkit-transition-property: $property;\n transition-property: $property;\n}\n\n@mixin transition-duration($duration...) {\n -moz-transition-property: $duration;\n -o-transition-property: $duration;\n -webkit-transition-property: $duration;\n transition-property: $duration;\n}\n\n@mixin transition-timing-function($timing...) {\n -moz-transition-timing-function: $timing;\n -o-transition-timing-function: $timing;\n -webkit-transition-timing-function: $timing;\n transition-timing-function: $timing;\n}\n\n@mixin transition-delay($delay...) {\n -moz-transition-delay: $delay;\n -o-transition-delay: $delay;\n -webkit-transition-delay: $delay;\n transition-delay: $delay;\n}\n",'$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;'],sourceRoot:""}]);const a=s},5149:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});const i='<template>\n <button id="menu-toggle-button" class="menu-toggle-button">\n <span id="menu-title" class="menu-title">\n Meny\n </span>\n <span id="menu-icon"></span>\n <span id="close-icon"></span>\n </button>\n <div id="menu-wrapper" class="menu-wrapper">\n <div id="menu-container" class="menu-container open">\n <div id="menu-item-list-container" class="menu-item-list-container"></div>\n <div id="menu-actions-row" class="menu-actions-row"></div>\n </div>\n </div>\n</template>'},7638:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,o,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(i)for(var a=0;a<this.length;a++){var u=this[a][0];null!=u&&(s[u]=!0)}for(var c=0;c<e.length;c++){var l=[].concat(e[c]);i&&s[l[0]]||(void 0!==r&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),t.push(l))}},t}},4663:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var i=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),r="/*# ".concat(o," */");return[t].concat([r]).join("\n")}return[t].join("\n")}},1397:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const o=n(5969),r=n(5773),s=n(3804);t.Component=e=>t=>{var n;const a=e.tag||s.toKebabCase(t.prototype.constructor.name),u=((n=class extends t{constructor(){super(),this.props={},this.showShadowRoot=null==e.shadow||e.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((e=>s.toKebabCase(e)))}attributeChangedCallback(e,t,n){this.onAttributeChange(e,t,n)}onAttributeChange(e,t,n,i=!0){if(t!=n){i&&(this[s.toCamelCase(e)]=n);const o=this.constructor.watchAttributes;if(o&&o[e]){const i=o[e];this.__connected&&"function"==typeof this[i]&&this[i]({old:t,new:n})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return i(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,o.addEventListeners(this),r.initializeProps(this)}))}render(){return i(this,void 0,void 0,(function*(){if(this.__connected)return;const t=document.createElement("template");t.innerHTML=yield this.getStyle(),e.template instanceof Promise?t.content.appendChild(yield this.getExternalTemplate()):"string"==typeof e.template&&(t.innerHTML+=e.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(t.content.cloneNode(!0))}))}getExternalTemplate(){return i(this,void 0,void 0,(function*(){const t=(yield e.template).default.toString(),n=document.createRange().createContextualFragment(t);return 1===n.children.length&&"TEMPLATE"===n.children[0].nodeName?n.firstChild.content:n}))}getStyle(){return i(this,void 0,void 0,(function*(){let t;return e.style instanceof Promise?t=(yield e.style).default.toString():"string"==typeof e.style&&(t=e.style),t?`<style>${t}</style>`:""}))}}).__connected=!1,n.ready=new Promise(((e,t)=>e(!0))),n);return customElements.get(a)||customElements.define(a,u),u}},985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomElement=void 0;class n extends HTMLElement{constructor(){super()}connect(e){this.isConnected||document.querySelector(e).appendChild(this)}}t.CustomElement=n},265:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShadowRootElement=t.getElement=void 0,t.getElement=e=>document.querySelector(e),t.getShadowRootElement=(e,t)=>e.shadowRoot.querySelector(t)},406:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(1397),t),o(n(985),t),o(n(265),t),o(n(5969),t),o(n(5773),t),o(n(4271),t),o(n(9766),t),o(n(4938),t)},5969:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const i=n(3804);t.Listen=(e,t)=>(n,i)=>{n.constructor.listeners||(n.constructor.listeners=[]),n.constructor.listeners.push({selector:t,eventName:e,handler:n[i]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const n of e.constructor.listeners){const i=n.selector?t.querySelector(n.selector)?t.querySelector(n.selector):null:e;i&&i.addEventListener(n.eventName,(t=>{n.handler.call(e,t)}))}}},t.Dispatch=e=>(t,n)=>{Object.defineProperty(t,n,{get:function(){const t=this;return{emit(o){const r=e||i.toDotCase(n);t.dispatchEvent(new CustomEvent(r,o))}}}})}},5773:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const i=n(3804);t.Prop=()=>(e,t)=>{const n=i.toKebabCase(t);e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return this.props[t]?this.props[t]:this.getAttribute(n)},set:function(e){if(this.__connected){const o=this.props[t];this.props[t]=i.tryParseInt(e),"object"!=typeof e?this.setAttribute(n,e):this.onAttributeChange(n,o,e,!1)}else this.hasAttribute(i.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})},t.initializeProps=e=>{const t=e.constructor.watchAttributes;for(let n of(e=>{const t=e.constructor.watchAttributes,n=Object.assign({},t);Object.keys(n).forEach((e=>n[e]=""));const i=Object.assign(Object.assign({},n),e.constructor.propsInit);return Object.keys(i)})(e)){if(t)if(null==t[i.toKebabCase(n)])t[i.toKebabCase(n)]="";else{const o=e.props[n]||e.getAttribute(i.toKebabCase(n));"function"==typeof e[t[n]]&&e[t[n]]({new:o})}e.constructor.propsInit[n]&&(e.hasAttribute(i.toKebabCase(n))||(e[n]=e.constructor.propsInit[n]))}}},4271:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const i=n(3804);t.Toggle=()=>(e,t)=>{e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null,Object.defineProperty(e,t,{get:function(){return(e=>{if(this.hasAttribute(e)){const t=this.getAttribute(e);return!!/^(true|false|^$)$/.test(t)&&("true"==t||""==t)}return!1})(t)},set:function(e){const n=e;if(null!=e)switch(typeof e){case"boolean":break;case"string":/^(true|false|^$)$/.test(e)?e="true"==n||""==n:(console.warn(`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`),e=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${t}' to '${e}'`}this.__connected?(this.props[t]=e||!1,""!==n&&null!==n?this.setAttribute(t,e):e?this.setAttribute(t,""):this.removeAttribute(t)):this.hasAttribute(i.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},9766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3804:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryParseInt=t.toDotCase=t.toCamelCase=t.toKebabCase=void 0,t.toKebabCase=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),t.toCamelCase=e=>e.toLowerCase().replace(/(\-\w)/g,(e=>e[1].toUpperCase())),t.toDotCase=e=>e.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),t.tryParseInt=e=>parseInt(e)==e&&NaN!==parseFloat(e)?parseInt(e):e},4938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const i=n(3804);t.Watch=e=>(t,n)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[i.toKebabCase(e)]=n,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},5854:e=>{e.exports='<svg aria-labelledby="svg-inline--fa-title-DQErafiATQyz" data-prefix="fas" data-icon="times" class="__3dDEvIw__svg-inline--fa __3dDEvIw__fa-times __3dDEvIw__fa-w-11 __3dDEvIw__ " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="#fff" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>'},7291:e=>{e.exports='<svg aria-labelledby="svg-inline--fa-title-rqezCtUcjPlp" data-prefix="fas" data-icon="bars" class="__1BMtyT8__svg-inline--fa __1BMtyT8__fa-bars __1BMtyT8__fa-w-14 __1BMtyT8__ " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="#fff" d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"></path></svg>'},9480:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchDropdownSearchResults=t.fetchMenuItems=t.getGeonorgeMenuUrl=t.getKartkatalogApiUrl=void 0,t.getKartkatalogApiUrl=e=>`https://kartkatalog.${"dev"===e||"test"===e?e+".":""}geonorge.no/api`,t.getGeonorgeMenuUrl=(e,t)=>`https://www.${"dev"===t||"test"===t?"test.":""}geonorge.no/${"en"===e?"en/":""}api/menu/get?omitLinks=1`,t.fetchMenuItems=(e="no",n="")=>{const i=(0,t.getGeonorgeMenuUrl)(e,n);return fetch(i).then((e=>e.json())).then((e=>e))},t.fetchDropdownSearchResults=(e="",i="no",o="")=>n(void 0,void 0,void 0,(function*(){const r={dataset:`search?text=${e=e.toString()}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=dataset`,series:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=series`,service:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=service`,servicelayer:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=servicelayer`,software:`search?text=${e}&facets%5B1%5Dname=type&facets%5B1%5Dvalue=software`,articles:`articles?text=${e}`},s={headers:new Headers({"Accept-Language":i})};return e&&e.length?yield Promise.all(Object.keys(r).map((e=>n(void 0,void 0,void 0,(function*(){const n=(0,t.getKartkatalogApiUrl)(o);return fetch(`${n}/${r[e]}&limit=5`,s).then((e=>e.json())).then((t=>Object.assign(Object.assign({},t),{searchResultsType:e})))}))))):null}))},5527:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addGlobalStylesheet=t.getFocusableElementsInsideElement=void 0,t.getFocusableElementsInsideElement=e=>e.querySelectorAll('button, [href], input, [tabindex="0"]'),t.addGlobalStylesheet=(e,t)=>{const n=document.createElement("style");n.setAttribute("id",e),n.textContent=t,document.getElementById(e)||document.head.appendChild(n)}},8641:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MainMenu=void 0;const u=n(406),c=a(n(7291)),l=a(n(5854)),d=n(9480),p=n(5527);let h=class extends u.CustomElement{constructor(){super(),this.hideMenuContainer=()=>{this.showmenu=!1},this.renderMenuItems=(e,t=0,n=1)=>{const i=e.map((e=>{const i=e.SubMenuItem&&e.SubMenuItem.length?e.SubMenuItem:null;return`<li><a href="${e.Url}" tabindex="${this.showmenu?null:"-1"}">${e.Name}</a>${i&&t+1<=n?this.renderMenuItems(i,t+1,n):""}</li>`})).join("");return`<ul class="menuItemList hierarchy-level-${t}">${i}</ul>`},this.clickOutsideMenuContainer=this.clickOutsideMenuContainer.bind(this)}setup(e){this.connect(e.container),e.id&&(this.id=e.id)}connectedCallback(){this.menuButton=(0,u.getShadowRootElement)(this,"#menu-toggle-button"),this.menuTitle=(0,u.getShadowRootElement)(this,"#menu-title"),this.menuIcon=(0,u.getShadowRootElement)(this,"#menu-icon"),this.closeIcon=(0,u.getShadowRootElement)(this,"#close-icon"),this.menuContainer=(0,u.getShadowRootElement)(this,"#menu-container"),this.menuItemListContainer=(0,u.getShadowRootElement)(this,"#menu-item-list-container"),this.menuActionsRow=(0,u.getShadowRootElement)(this,"#menu-actions-row"),this.menuIcon.innerHTML=c.default,this.closeIcon.innerHTML=l.default,this.showmenu?this.menuIcon.classList.add("hidden"):this.closeIcon.classList.add("hidden"),(0,d.fetchMenuItems)(this.language,this.environment).then((e=>{this.menuitems=e})),this.menuButton.setAttribute("aria-label","en"===this.language?"Show menu":"Vis meny"),this.menuTitle&&(this.menuTitle.innerText="en"===this.language?"Menu":"Meny"),this.signinurl&&this.signouturl&&this.addAuthenticationLinks(),this.englishurl&&this.norwegianurl&&this.addLanguageSelectLinks(),document.addEventListener("click",this.clickOutsideMenuContainer)}disconnectedCallback(){document.removeEventListener("click",this.clickOutsideMenuContainer)}clickOutsideMenuContainer(e){const t=e.composedPath()[0];t.closest("#menu-container"),t.closest("#menu-container")||t.closest("#menu-toggle-button")||this.hideMenuContainer()}addAuthenticationLinks(e=!1){let t;if(!(this.signouturl&&this.signinurl||e))return"";e?(t=document.createElement("button"),t.addEventListener("click",(()=>{this.isloggedin?this.onSignOutClick.emit():this.onSignInClick.emit()}))):(t=document.createElement("a"),t.href=this.isloggedin?this.signouturl:this.signinurl);const n="en"===this.language?"Log in":"Logg inn",i="en"===this.language?"Log out":"Logg ut";t.innerText=this.isloggedin?i:n,t.id="authentication-toggle-element";for(const e of this.menuActionsRow.children)e.getAttribute("id")===t.id&&e.remove();this.showmenu||t.setAttribute("tabindex","-1"),this.menuActionsRow.appendChild(t)}addLanguageSelectLinks(e=!1){let t;if(!(this.norwegianurl&&this.englishurl||e))return"";e?(t=document.createElement("button"),t.addEventListener("click",(()=>{"en"===this.language?this.onNorwegianLanguageSelect.emit():this.onEnglishLanguageSelect.emit()}))):(t=document.createElement("a"),t.href="en"===this.language?this.norwegianurl:this.englishurl),t.innerText="en"===this.language?"Norsk":"English",t.id="language-toggle-element";for(const e of this.menuActionsRow.children)e.getAttribute("id")===t.id&&e.remove();this.showmenu||t.setAttribute("tabindex","-1"),this.menuActionsRow.appendChild(t)}buttonClicked(e){this.showmenu=!this.showmenu}hasAuthenticationFunctionChanged(){this.hasAuthenticationFunction&&this.addAuthenticationLinks(!0)}isLoggedInChanged(){this.addAuthenticationLinks(this.hasAuthenticationFunction)}hasLanguageSelectFunctionsChanged(){this.hasLanguageSelectFunctions&&this.addLanguageSelectLinks(!0)}languageChanged(){this.addAuthenticationLinks(this.hasAuthenticationFunction),this.addLanguageSelectLinks(this.hasLanguageSelectFunctions),(0,d.fetchMenuItems)(this.language,this.environment).then((e=>{this.menuitems=e})),this.menuTitle&&(this.menuTitle.innerText="en"===this.language?"Menu":"Meny"),this.menuButton.setAttribute("aria-label","en"===this.language?"Show menu":"Vis meny")}showMenuChanged(){this.showmenu?this.menuContainer.classList.add("open"):this.menuContainer.classList.remove("open"),this.showmenu?this.menuButton.classList.add("open"):this.menuButton.classList.remove("open"),this.showmenu?this.menuItemListContainer.classList.add("open"):this.menuItemListContainer.classList.remove("open"),this.showmenu?this.menuActionsRow.classList.add("open"):this.menuActionsRow.classList.remove("open"),this.showmenu?this.menuIcon.classList.add("hidden"):this.menuIcon.classList.remove("hidden"),this.showmenu?this.closeIcon.classList.remove("hidden"):this.closeIcon.classList.add("hidden"),(0,p.getFocusableElementsInsideElement)(this.menuContainer).forEach((e=>{this.showmenu?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1")}))}menuItemsChanged(){this.menuitems&&this.menuitems.length&&(this.menuItemListContainer.innerHTML=this.renderMenuItems(this.menuitems))}static setup(e,t){const n=(0,u.getElement)(e);t.onClick&&n.addEventListener("menuButtonClick",t.onClick),t.active&&(n.showmenu=t.active)}};h.elementSelector="main-menu",r([(0,u.Prop)()],h.prototype,"id",void 0),r([(0,u.Prop)()],h.prototype,"language",void 0),r([(0,u.Prop)()],h.prototype,"environment",void 0),r([(0,u.Prop)()],h.prototype,"signinurl",void 0),r([(0,u.Prop)()],h.prototype,"signouturl",void 0),r([(0,u.Prop)()],h.prototype,"norwegianurl",void 0),r([(0,u.Prop)()],h.prototype,"englishurl",void 0),r([(0,u.Toggle)()],h.prototype,"isloggedin",void 0),r([(0,u.Toggle)()],h.prototype,"showmenu",void 0),r([(0,u.Toggle)()],h.prototype,"hasAuthenticationFunction",void 0),r([(0,u.Toggle)()],h.prototype,"hasLanguageSelectFunctions",void 0),r([(0,u.Prop)()],h.prototype,"menuitems",void 0),r([(0,u.Dispatch)("onSignInClick")],h.prototype,"onSignInClick",void 0),r([(0,u.Dispatch)("onSignOutClick")],h.prototype,"onSignOutClick",void 0),r([(0,u.Dispatch)("onNorwegianLanguageSelect")],h.prototype,"onNorwegianLanguageSelect",void 0),r([(0,u.Dispatch)("onEnglishLanguageSelect")],h.prototype,"onEnglishLanguageSelect",void 0),r([(0,u.Listen)("click","#menu-toggle-button")],h.prototype,"buttonClicked",null),r([(0,u.Watch)("hasauthenticationfunction")],h.prototype,"hasAuthenticationFunctionChanged",null),r([(0,u.Watch)("isloggedin")],h.prototype,"isLoggedInChanged",null),r([(0,u.Watch)("haslanguageselectfunctions")],h.prototype,"hasLanguageSelectFunctionsChanged",null),r([(0,u.Watch)("language")],h.prototype,"languageChanged",null),r([(0,u.Watch)("showmenu")],h.prototype,"showMenuChanged",null),r([(0,u.Watch)("menuitems")],h.prototype,"menuItemsChanged",null),h=r([(0,u.Component)({tag:"main-menu",template:Promise.resolve().then((()=>s(n(5149)))),style:Promise.resolve().then((()=>s(n(2248))))})],h),t.MainMenu=h}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={id:i,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(8641)})()));
|
|
2
2
|
//# sourceMappingURL=MainMenu.js.map
|