@kartverket/geonorge-web-components
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -1,2 +0,2 @@ | ||
!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.GnDialog=e())}(self,(()=>(()=>{var t={8392:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var o=n(4663),i=n.n(o),r=n(7638),s=n.n(r)()(i());s.push([t.id,".dialog-container:not(.visible){display:none}.dialog-container.visible{display:flex;flex-wrap:wrap;position:fixed;width:100%;background:rgba(0,0,0,.25);height:100%;top:0;left:0;align-content:center;padding:8px 28px;z-index:2;justify-content:center}@media(min-width: 992px){.dialog-container.visible{padding:36px}}.dialog-container .dialog-content{max-height:-moz-calc(100% - 128px);max-height:-webkit-calc(100% - 128px);max-height:calc(100% - 128px);-webkit-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);-moz-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);max-width:540px;width:100%;background-color:#fff;overflow:auto;position:relative}.dialog-container .dialog-content:not(.noPadding){padding:30px 15px}@media(min-width: 768px){.dialog-container .dialog-content:not(.noPadding){padding:60px 40px}}@media(min-width: 992px){.dialog-container .dialog-content{width:-moz-calc(100% - 128px);width:-webkit-calc(100% - 128px);width:calc(100% - 128px);max-height:100%}}.dialog-container .dialog-content .close-dialog-button{background:none;border:none;color:#2f3940;display:inline-block;position:absolute;right:7px;top:4px;text-decoration:underline;font-size:19px;cursor:pointer;padding:0}@media(min-width: 768px){.dialog-container .dialog-content .close-dialog-button{right:15px;top:10px}}.dialog-container .dialog-content .close-dialog-button:hover{text-decoration:none}.dialog-container .dialog-content .close-dialog-button svg{width:17px;height:17px}","",{version:3,sources:["webpack://./stories/gn-dialog/template.scss","webpack://./style/mixins/_breakpoints.scss","webpack://./style/mixins/_calc.scss","webpack://./style/mixins/_box-shadow.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAGI,gCACI,YAAA,CAEJ,0BACI,YAAA,CACA,cAAA,CACA,cAAA,CACA,UAAA,CACA,0BAAA,CACA,WAAA,CACA,KAAA,CACA,MAAA,CACA,oBAAA,CACA,gBAAA,CACA,SAAA,CACA,sBAAA,CCZA,yBAAA,0BDcI,YAAA,CAAA,CAGR,kCEtBF,kCAAA,CACA,qCAAA,CACA,6BAAA,CCFE,iHHwBI,CGvBJ,8GHuBI,CGtBJ,yGHsBI,CAKA,eAAA,CACA,UAAA,CACA,qBAAA,CACA,aAAA,CACA,iBAAA,CACA,kDACI,iBAAA,CC1BJ,yBDyBA,kDAGQ,iBAAA,CAAA,CChCR,yBDiBJ,kCEtBF,6BAAA,CACA,gCAAA,CACA,wBAAA,CFwCU,eAAA,CAAA,CAEJ,uDACI,eAAA,CACA,WAAA,CACA,aIzCE,CJ0CF,oBAAA,CACA,iBAAA,CACA,SAAA,CACA,OAAA,CACA,yBAAA,CACA,cAAA,CACA,cAAA,CACA,SAAA,CC9CJ,yBDmCA,uDAaQ,UAAA,CACA,QAAA,CAAA,CAEJ,6DACI,oBAAA,CAEJ,2DACI,UAAA,CACA,WAAA",sourcesContent:['@import "../../style/all";\n\n.dialog-container {\n &:not(.visible) {\n display: none;\n }\n &.visible {\n display: flex;\n flex-wrap: wrap;\n position: fixed;\n width: 100%;\n background: rgba(0, 0, 0, 0.25);\n height: 100%;\n top: 0;\n left: 0;\n align-content: center;\n padding: 8px 28px;\n z-index: 2;\n justify-content: center;\n @include breakpoint(laptop) {\n padding: 36px;\n }\n }\n .dialog-content {\n @include calc("max-height", "100% - 128px");\n @include box-shadow(\n 0 11px 15px -7px rgba(0, 0, 0, 0.2),\n 0 24px 38px 3px rgba(0, 0, 0, 0.14),\n 0 9px 46px 8px rgba(0, 0, 0, 0.12)\n );\n max-width: 540px;\n width: 100%;\n background-color: #fff;\n overflow: auto;\n position: relative;\n &:not(.noPadding) {\n padding: 30px 15px;\n @include breakpoint(tablet) {\n padding: 60px 40px;\n }\n }\n @include breakpoint(laptop) {\n @include calc("width", "100% - 128px");\n max-height: 100%;\n }\n .close-dialog-button {\n background: none;\n border: none;\n color: $default-text;\n display: inline-block;\n position: absolute;\n right: 7px;\n top: 4px;\n text-decoration: underline;\n font-size: 19px;\n cursor: pointer;\n padding: 0;\n @include breakpoint(tablet) {\n right: 15px;\n top: 10px;\n }\n &:hover {\n text-decoration: none;\n }\n svg {\n width: 17px;\n height: 17px;\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","\ufeff@mixin calc($property, $expression) {\n #{$property}: -moz-calc(#{$expression});\n #{$property}: -webkit-calc(#{$expression});\n #{$property}: calc(#{$expression});\n}","\ufeff@mixin box-shadow($shadows...) {\n -webkit-box-shadow: $shadows;\n -moz-box-shadow: $shadows;\n box-shadow: $shadows;\n}\n","$body-background: #ffffff;\n$navigation-bar-background: #f7f7f7;\n$hover-background: rgba(0,0,0,.05);\n$default-border: #d8d8d8;\n\n$default-background: #eee;\n$default-background-hover: #ddd;\n$default-text:#2F3940;\n\n$primary-brand: #FE5000;\n$secondary-brand: #4C7AA9;\n\n$primary-background: #4C7AA9;\n$primary-background-hover: #FE5000;\n$primary-text: #3767C7;\n$primary-text-hover:#0056b3;\n\n\n$success-background: #06A755;\n$success-background-hover: #009745;\n$success-text: #06A755;\n\n\n$warning-background: #C38621;\n$warning-background-hover: #B37611;\n$warning-text: #C38621;\n\n$danger-background: #E00d0D;\n$danger-background-hover: #D00000;\n$danger-text: #E00d0D;\n\n$disabled-background: #eee;\n$disabled-text: #d8d8d8;\n"],sourceRoot:""}]);const a=s},2340:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o='<template>\n <div id="dialog-container" class="dialog-container">\n <div id="dialog-content" class="dialog-content">\n <button id="close-dialog-button" class="close-dialog-button"></button>\n <slot></slot>\n </div>\n </div>\n</template>\n'},7638:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,i,r){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&s[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},4663:t=>{"use strict";t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),r="/*# ".concat(i," */");return[e].concat([r]).join("\n")}return[e].join("\n")}},1397:function(t,e,n){"use strict";var o=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{c(o.next(t))}catch(t){r(t)}}function a(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((o=o.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const i=n(5969),r=n(5773),s=n(3804);e.Component=t=>e=>{var n;const a=t.tag||s.toKebabCase(e.prototype.constructor.name),c=((n=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=>s.toKebabCase(t)))}attributeChangedCallback(t,e,n){this.onAttributeChange(t,e,n)}onAttributeChange(t,e,n,o=!0){if(e!=n){o&&(this[s.toCamelCase(t)]=n);const i=this.constructor.watchAttributes;if(i&&i[t]){const o=i[t];this.__connected&&"function"==typeof this[o]&&this[o]({old:e,new:n})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return o(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,i.addEventListeners(this),r.initializeProps(this)}))}render(){return o(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 o(this,void 0,void 0,(function*(){const e=(yield t.template).default.toString(),n=document.createRange().createContextualFragment(e);return 1===n.children.length&&"TEMPLATE"===n.children[0].nodeName?n.firstChild.content:n}))}getStyle(){return o(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,n.ready=new Promise(((t,e)=>t(!0))),n);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 n extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}e.CustomElement=n},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,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(1397),e),i(n(985),e),i(n(265),e),i(n(5969),e),i(n(5773),e),i(n(4271),e),i(n(9766),e),i(n(4938),e)},5969:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const o=n(3804);e.Listen=(t,e)=>(n,o)=>{n.constructor.listeners||(n.constructor.listeners=[]),n.constructor.listeners.push({selector:e,eventName:t,handler:n[o]})},e.addEventListeners=t=>{if(t.constructor.listeners){const e=t.shadowRoot||t;for(const n of t.constructor.listeners){const o=n.selector?e.querySelector(n.selector)?e.querySelector(n.selector):null:t;o&&o.addEventListener(n.eventName,(e=>{n.handler.call(t,e)}))}}},e.Dispatch=t=>(e,n)=>{Object.defineProperty(e,n,{get:function(){const e=this;return{emit(i){const r=t||o.toDotCase(n);e.dispatchEvent(new CustomEvent(r,i))}}}})}},5773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const o=n(3804);e.Prop=()=>(t,e)=>{const n=o.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(n)},set:function(t){if(this.__connected){const i=this.props[e];this.props[e]=o.tryParseInt(t),"object"!=typeof t?this.setAttribute(n,t):this.onAttributeChange(n,i,t,!1)}else this.hasAttribute(o.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})},e.initializeProps=t=>{const e=t.constructor.watchAttributes;for(let n of(t=>{const e=t.constructor.watchAttributes,n=Object.assign({},e);Object.keys(n).forEach((t=>n[t]=""));const o=Object.assign(Object.assign({},n),t.constructor.propsInit);return Object.keys(o)})(t)){if(e)if(null==e[o.toKebabCase(n)])e[o.toKebabCase(n)]="";else{const i=t.props[n]||t.getAttribute(o.toKebabCase(n));"function"==typeof t[e[n]]&&t[e[n]]({new:i})}t.constructor.propsInit[n]&&(t.hasAttribute(o.toKebabCase(n))||(t[n]=t.constructor.propsInit[n]))}}},4271:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const o=n(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 n=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==n||""==n:(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,""!==n&&null!==n?this.setAttribute(e,t):t?this.setAttribute(e,""):this.removeAttribute(e)):this.hasAttribute(o.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,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const o=n(3804);e.Watch=t=>(e,n)=>{e.constructor.watchAttributes||(e.constructor.watchAttributes={}),e.constructor.watchAttributes[o.toKebabCase(t)]=n,e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null}},5854:t=>{t.exports='<svg data-prefix="fas" data-icon="times" class="__32qV5Cc__svg-inline--fa __32qV5Cc__fa-times __32qV5Cc__fa-w-11 __32qV5Cc__ " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><title>ikon for lukk</title><path fill="#2F3946" 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>'},5416:function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GnDialog=void 0;const c=n(406),l=a(n(5854));let d=class extends c.CustomElement{constructor(){super(),this.handleClickOutside=t=>{const e=(0,c.getShadowRootElement)(this,"#dialog-content"),n=t.target.assignedSlot,o=e.contains(t.target);!e||n||o||this.hideDialog()},this.hideDialog=()=>{this.setAttribute("show","false")},this.keyDownFunction=t=>{if(27!==t.keyCode)return null;this.hideDialog()}}connectedCallback(){const t=(0,c.getShadowRootElement)(this,"#close-dialog-button");t.innerHTML=l.default,t.addEventListener("click",this.hideDialog),(0,c.getShadowRootElement)(this,"#dialog-container").addEventListener("click",this.handleClickOutside),document.addEventListener("keydown",this.keyDownFunction,!1)}disconnectedCallback(){(0,c.getShadowRootElement)(this,"#close-dialog-button").removeEventListener("click",this.hideDialog),(0,c.getShadowRootElement)(this,"#dialog-container").removeEventListener("click",this.handleClickOutside),document.removeEventListener("keydown",this.keyDownFunction,!1)}shouldShowDialog(t){return""===(null==t?void 0:t.toString())||"true"===(null==t?void 0:t.toString())}showMenuChanged(){const t=this.shouldShowDialog(this.show),e=(0,c.getShadowRootElement)(this,"#dialog-container");t?e.classList.add("visible"):e.classList.remove("visible")}setup(t){}};r([(0,c.Toggle)()],d.prototype,"show",void 0),r([(0,c.Watch)("show")],d.prototype,"showMenuChanged",null),d=r([(0,c.Component)({tag:"gn-dialog",template:Promise.resolve().then((()=>s(n(2340)))),style:Promise.resolve().then((()=>s(n(8392))))})],d),e.GnDialog=d}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={id:o,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}return n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(5416)})())); | ||
!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.GnDialog=e())}(self,(()=>(()=>{var t={8392:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var o=n(4663),i=n.n(o),r=n(7638),s=n.n(r)()(i());s.push([t.id,".dialog-container:not(.visible){display:none}.dialog-container.visible{display:flex;flex-wrap:wrap;position:fixed;width:100%;background:rgba(0,0,0,.25);height:100%;top:0;left:0;align-content:center;padding:8px 28px;z-index:2;justify-content:center}@media(min-width: 992px){.dialog-container.visible{padding:36px}}.dialog-container .dialog-content{max-height:-moz-calc(100% - 128px);max-height:-webkit-calc(100% - 128px);max-height:calc(100% - 128px);-webkit-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);-moz-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);max-width:540px;width:100%;background-color:#fff;overflow:auto;position:relative}.dialog-container .dialog-content:not(.noPadding){padding:30px 15px}@media(min-width: 768px){.dialog-container .dialog-content:not(.noPadding){padding:60px 40px}}@media(min-width: 992px){.dialog-container .dialog-content{width:-moz-calc(100% - 128px);width:-webkit-calc(100% - 128px);width:calc(100% - 128px);max-height:100%}}.dialog-container .dialog-content .close-dialog-button{background:none;border:none;color:#2f3940;display:inline-block;position:absolute;right:7px;top:4px;text-decoration:underline;font-size:19px;cursor:pointer;padding:0}@media(min-width: 768px){.dialog-container .dialog-content .close-dialog-button{right:15px;top:10px}}.dialog-container .dialog-content .close-dialog-button:hover{text-decoration:none}.dialog-container .dialog-content .close-dialog-button svg{width:17px;height:17px}","",{version:3,sources:["webpack://./stories/gn-dialog/template.scss","webpack://./style/mixins/_breakpoints.scss","webpack://./style/mixins/_calc.scss","webpack://./style/mixins/_box-shadow.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAGI,gCACI,YAAA,CAEJ,0BACI,YAAA,CACA,cAAA,CACA,cAAA,CACA,UAAA,CACA,0BAAA,CACA,WAAA,CACA,KAAA,CACA,MAAA,CACA,oBAAA,CACA,gBAAA,CACA,SAAA,CACA,sBAAA,CCZA,yBAAA,0BDcI,YAAA,CAAA,CAGR,kCEtBF,kCAAA,CACA,qCAAA,CACA,6BAAA,CCFE,iHHwBI,CGvBJ,8GHuBI,CGtBJ,yGHsBI,CAKA,eAAA,CACA,UAAA,CACA,qBAAA,CACA,aAAA,CACA,iBAAA,CACA,kDACI,iBAAA,CC1BJ,yBDyBA,kDAGQ,iBAAA,CAAA,CChCR,yBDiBJ,kCEtBF,6BAAA,CACA,gCAAA,CACA,wBAAA,CFwCU,eAAA,CAAA,CAEJ,uDACI,eAAA,CACA,WAAA,CACA,aIzCE,CJ0CF,oBAAA,CACA,iBAAA,CACA,SAAA,CACA,OAAA,CACA,yBAAA,CACA,cAAA,CACA,cAAA,CACA,SAAA,CC9CJ,yBDmCA,uDAaQ,UAAA,CACA,QAAA,CAAA,CAEJ,6DACI,oBAAA,CAEJ,2DACI,UAAA,CACA,WAAA",sourcesContent:['@import "../../style/all";\n\n.dialog-container {\n &:not(.visible) {\n display: none;\n }\n &.visible {\n display: flex;\n flex-wrap: wrap;\n position: fixed;\n width: 100%;\n background: rgba(0, 0, 0, 0.25);\n height: 100%;\n top: 0;\n left: 0;\n align-content: center;\n padding: 8px 28px;\n z-index: 2;\n justify-content: center;\n @include breakpoint(laptop) {\n padding: 36px;\n }\n }\n .dialog-content {\n @include calc("max-height", "100% - 128px");\n @include box-shadow(\n 0 11px 15px -7px rgba(0, 0, 0, 0.2),\n 0 24px 38px 3px rgba(0, 0, 0, 0.14),\n 0 9px 46px 8px rgba(0, 0, 0, 0.12)\n );\n max-width: 540px;\n width: 100%;\n background-color: #fff;\n overflow: auto;\n position: relative;\n &:not(.noPadding) {\n padding: 30px 15px;\n @include breakpoint(tablet) {\n padding: 60px 40px;\n }\n }\n @include breakpoint(laptop) {\n @include calc("width", "100% - 128px");\n max-height: 100%;\n }\n .close-dialog-button {\n background: none;\n border: none;\n color: $default-text;\n display: inline-block;\n position: absolute;\n right: 7px;\n top: 4px;\n text-decoration: underline;\n font-size: 19px;\n cursor: pointer;\n padding: 0;\n @include breakpoint(tablet) {\n right: 15px;\n top: 10px;\n }\n &:hover {\n text-decoration: none;\n }\n svg {\n width: 17px;\n height: 17px;\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","\ufeff@mixin calc($property, $expression) {\n #{$property}: -moz-calc(#{$expression});\n #{$property}: -webkit-calc(#{$expression});\n #{$property}: calc(#{$expression});\n}","\ufeff@mixin box-shadow($shadows...) {\n -webkit-box-shadow: $shadows;\n -moz-box-shadow: $shadows;\n box-shadow: $shadows;\n}\n","$body-background: #ffffff;\n$navigation-bar-background: #f7f7f7;\n$hover-background: rgba(0,0,0,.05);\n$default-border: #d8d8d8;\n\n$default-background: #eee;\n$default-background-hover: #ddd;\n$default-text:#2F3940;\n\n$primary-brand: #FE5000;\n$secondary-brand: #4C7AA9;\n\n$primary-background: #4C7AA9;\n$primary-background-hover: #FE5000;\n$primary-text: #3767C7;\n$primary-text-hover:#0056b3;\n\n\n$success-background: #06A755;\n$success-background-hover: #009745;\n$success-text: #06A755;\n\n\n$warning-background: #C38621;\n$warning-background-hover: #B37611;\n$warning-text: #C38621;\n\n$danger-background: #E00d0D;\n$danger-background-hover: #D00000;\n$danger-text: #E00d0D;\n\n$disabled-background: #eee;\n$disabled-text: #d8d8d8;\n"],sourceRoot:""}]);const a=s},2340:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o='<template>\n <div id="dialog-container" class="dialog-container">\n <div id="dialog-content" class="dialog-content">\n <button id="close-dialog-button" class="close-dialog-button"></button>\n <slot></slot>\n </div>\n </div>\n</template>\n'},7638:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,i,r){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&s[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},4663:t=>{"use strict";t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),r="/*# ".concat(i," */");return[e].concat([r]).join("\n")}return[e].join("\n")}},1397:function(t,e,n){"use strict";var o=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{c(o.next(t))}catch(t){r(t)}}function a(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((o=o.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const i=n(5969),r=n(5773),s=n(3804);e.Component=t=>e=>{var n;const a=t.tag||s.toKebabCase(e.prototype.constructor.name),c=((n=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=>s.toKebabCase(t)))}attributeChangedCallback(t,e,n){this.onAttributeChange(t,e,n)}onAttributeChange(t,e,n,o=!0){if(e!=n){o&&(this[s.toCamelCase(t)]=n);const i=this.constructor.watchAttributes;if(i&&i[t]){const o=i[t];this.__connected&&"function"==typeof this[o]&&this[o]({old:e,new:n})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return o(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,i.addEventListeners(this),r.initializeProps(this)}))}render(){return o(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 o(this,void 0,void 0,(function*(){const e=(yield t.template).default.toString(),n=document.createRange().createContextualFragment(e);return 1===n.children.length&&"TEMPLATE"===n.children[0].nodeName?n.firstChild.content:n}))}getStyle(){return o(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,n.ready=new Promise(((t,e)=>t(!0))),n);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 n extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}e.CustomElement=n},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,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(1397),e),i(n(985),e),i(n(265),e),i(n(5969),e),i(n(5773),e),i(n(4271),e),i(n(9766),e),i(n(4938),e)},5969:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const o=n(3804);e.Listen=(t,e)=>(n,o)=>{n.constructor.listeners||(n.constructor.listeners=[]),n.constructor.listeners.push({selector:e,eventName:t,handler:n[o]})},e.addEventListeners=t=>{if(t.constructor.listeners){const e=t.shadowRoot||t;for(const n of t.constructor.listeners){const o=n.selector?e.querySelector(n.selector)?e.querySelector(n.selector):null:t;o&&o.addEventListener(n.eventName,(e=>{n.handler.call(t,e)}))}}},e.Dispatch=t=>(e,n)=>{Object.defineProperty(e,n,{get:function(){const e=this;return{emit(i){const r=t||o.toDotCase(n);e.dispatchEvent(new CustomEvent(r,i))}}}})}},5773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const o=n(3804);e.Prop=()=>(t,e)=>{const n=o.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(n)},set:function(t){if(this.__connected){const i=this.props[e];this.props[e]=o.tryParseInt(t),"object"!=typeof t?this.setAttribute(n,t):this.onAttributeChange(n,i,t,!1)}else this.hasAttribute(o.toKebabCase(e))||(this.constructor.propsInit[e]=t)}})},e.initializeProps=t=>{const e=t.constructor.watchAttributes;for(let n of(t=>{const e=t.constructor.watchAttributes,n=Object.assign({},e);Object.keys(n).forEach((t=>n[t]=""));const o=Object.assign(Object.assign({},n),t.constructor.propsInit);return Object.keys(o)})(t)){if(e)if(null==e[o.toKebabCase(n)])e[o.toKebabCase(n)]="";else{const i=t.props[n]||t.getAttribute(o.toKebabCase(n));"function"==typeof t[e[n]]&&t[e[n]]({new:i})}t.constructor.propsInit[n]&&(t.hasAttribute(o.toKebabCase(n))||(t[n]=t.constructor.propsInit[n]))}}},4271:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const o=n(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 n=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==n||""==n:(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,""!==n&&null!==n?this.setAttribute(e,t):t?this.setAttribute(e,""):this.removeAttribute(e)):this.hasAttribute(o.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,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const o=n(3804);e.Watch=t=>(e,n)=>{e.constructor.watchAttributes||(e.constructor.watchAttributes={}),e.constructor.watchAttributes[o.toKebabCase(t)]=n,e.constructor.propsInit||(e.constructor.propsInit={}),e.constructor.propsInit[t]=null}},5854:t=>{t.exports='<svg data-prefix="fas" data-icon="times" class="__32qV5Cc__svg-inline--fa __32qV5Cc__fa-times __32qV5Cc__fa-w-11 __32qV5Cc__ " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><title>ikon for lukk</title><path fill="#2F3946" 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>'},5416:function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,i)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GnDialog=void 0;const c=n(406),l=a(n(5854));let d=class extends c.CustomElement{constructor(){super(),this.handleClickOutside=t=>{const e=(0,c.getShadowRootElement)(this,"#dialog-content"),n=this.shadowRoot.querySelector("slot").assignedElements().some((e=>!!e.contains(t.target))),o=e.contains(t.target);!e||n||o||this.hideDialog()},this.hideDialog=()=>{this.setAttribute("show","false")},this.keyDownFunction=t=>{if(27!==t.keyCode)return null;this.hideDialog()}}connectedCallback(){const t=(0,c.getShadowRootElement)(this,"#close-dialog-button");t.innerHTML=l.default,t.addEventListener("click",this.hideDialog),(0,c.getShadowRootElement)(this,"#dialog-container").addEventListener("click",this.handleClickOutside),document.addEventListener("keydown",this.keyDownFunction,!1)}disconnectedCallback(){(0,c.getShadowRootElement)(this,"#close-dialog-button").removeEventListener("click",this.hideDialog),(0,c.getShadowRootElement)(this,"#dialog-container").removeEventListener("click",this.handleClickOutside),document.removeEventListener("keydown",this.keyDownFunction,!1)}shouldShowDialog(t){return""===(null==t?void 0:t.toString())||"true"===(null==t?void 0:t.toString())}showMenuChanged(){const t=this.shouldShowDialog(this.show),e=(0,c.getShadowRootElement)(this,"#dialog-container");t?e.classList.add("visible"):e.classList.remove("visible")}setup(t){}};r([(0,c.Toggle)()],d.prototype,"show",void 0),r([(0,c.Watch)("show")],d.prototype,"showMenuChanged",null),d=r([(0,c.Component)({tag:"gn-dialog",template:Promise.resolve().then((()=>s(n(2340)))),style:Promise.resolve().then((()=>s(n(8392))))})],d),e.GnDialog=d}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={id:o,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}return n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(5416)})())); | ||
//# sourceMappingURL=GnDialog.js.map |
{ | ||
"name": "@kartverket/geonorge-web-components", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Geonorge Web Components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4366983