@kartverket/geonorge-web-components
Advanced tools
Comparing version 2.12.4 to 2.12.5
{ | ||
"name": "@kartverket/geonorge-web-components", | ||
"version": "2.12.4", | ||
"version": "2.12.5", | ||
"description": "Geonorge Web Components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
!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.SearchTypeSelector=t())}(self,(()=>(()=>{"use strict";var e={727:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var n=r(4663),o=r.n(n),a=r(7638),s=r.n(a)()(o());s.push([e.id,'div.search-type-selector{width:180px}div.search-type-selector label{font-size:14px;display:block;cursor:pointer;height:18px;font-weight:normal}div.search-type-selector label .search-type-counter{font-size:.9em}div.search-type-selector label .search-type-counter::before{content:"("}div.search-type-selector label .search-type-counter::after{content:")"}div.search-type-selector input[type=radio]{-webkit-border-radius:50%;border-radius:50%;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;font:inherit;color:currentColor;width:1.2em;height:1.2em;border:.15em solid #7d746d;transform:translateY(-0.075em);display:inline-grid;place-content:center}div.search-type-selector input[type=radio]::before{-webkit-border-radius:50%;border-radius:50%;content:"";width:.6em;height:.6em;transform:scale(0);transition:120ms transform ease-in-out}div.search-type-selector input[type=radio]:checked{border-color:#3767c7}div.search-type-selector input[type=radio]:checked::before{transform:scale(1);background-color:#3767c7}div.search-type-selector input[type=radio]:focus-visible{outline:max(2px,.1em) solid #3767c7;outline-offset:max(2px,.1em)}',"",{version:3,sources:["webpack://./stories/main-navigation/search-type-selector/search-type-selector.scss","webpack://./style/mixins/_border-radius.scss","webpack://./style/mixins/_appearance.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAEA,yBACI,WAAA,CACA,+BACI,cAAA,CACA,aAAA,CACA,cAAA,CACA,WAAA,CACA,kBAAA,CACA,oDACI,cAAA,CACA,4DACI,WAAA,CAEJ,2DACI,WAAA,CAIZ,2CCnBF,yBDoB6B,CCnB7B,iBDmB6B,CEpB3B,uBFqBwB,CEpBxB,oBFoBwB,CEnBxB,eFmBwB,CACpB,QAAA,CACA,YAAA,CACA,kBAAA,CACA,WAAA,CACA,YAAA,CACA,0BAAA,CACA,8BAAA,CACA,mBAAA,CACA,oBAAA,CAGJ,mDCjCF,yBDkC6B,CCjC7B,iBDiC6B,CACvB,UAAA,CACA,UAAA,CACA,WAAA,CACA,kBAAA,CACA,sCAAA,CAGJ,mDACI,oBG7BO,CH8BP,2DACI,kBAAA,CACA,wBGhCG,CHoCX,yDACI,mCAAA,CACA,4BAAA",sourcesContent:['@import "../../../style/all";\n\ndiv.search-type-selector {\n width: 180px;\n label {\n font-size: 14px;\n display: block;\n cursor: pointer;\n height: 18px;\n font-weight: normal;\n .search-type-counter {\n font-size: 0.9em;\n &::before {\n content: "(";\n }\n &::after {\n content: ")";\n }\n }\n }\n input[type="radio"] {\n @include border-radius(50%);\n @include appearance(none);\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 1.2em;\n height: 1.2em;\n border: 0.15em solid rgb(125, 116, 109);\n transform: translateY(-0.075em);\n display: inline-grid;\n place-content: center;\n }\n\n input[type="radio"]::before {\n @include border-radius(50%);\n content: "";\n width: 0.6em;\n height: 0.6em;\n transform: scale(0);\n transition: 120ms transform ease-in-out;\n }\n\n input[type="radio"]:checked {\n border-color: $primary-text;\n &::before {\n transform: scale(1);\n background-color: $primary-text;\n }\n }\n\n input[type="radio"]:focus-visible {\n outline: max(2px, 0.1em) solid $primary-text;\n outline-offset: max(2px, 0.1em);\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 appearance ($value) {\n -webkit-appearance: $value;\n -moz-appearance: $value;\n appearance: $value;\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$light-gray: #f6f5f4;\n\n$primary-brand: #FE5000;\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: #f4f4f4;\n$disabled-border: #dedede;\n$disabled-text: #707070;\n"],sourceRoot:""}]);const i=s},8771:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});const n='<template>\n <div id="search-type-selector" class="search-type-selector">\n <label for="search-type-metadata">\n <input name="search-type" type="radio" id="search-type-metadata" value="metadata" />\n <span id="search-type-metadata-name">Kartkatalogen</span>\n <span id="search-type-metadata-counter" class="search-type-counter"></span>\n </label>\n <label for="search-type-article">\n <input name="search-type" type="radio" id="search-type-article" value="articles" />\n <span id="search-type-article-name">Artikler</span>\n <span id="search-type-article-counter" class="search-type-counter"></span>\n </label>\n </div>\n</template>'},7638:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var d=0;d<e.length;d++){var l=[].concat(e[d]);n&&s[l[0]]||(void 0!==a&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=a),r&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=r):l[2]=r),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=>{e.exports=function(e){var t=e[1],r=e[3];if(!r)return t;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),a="/*# ".concat(o," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},1397:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,i)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const o=r(5969),a=r(5773),s=r(3804);t.Component=e=>t=>{var r;const i=e.tag||s.toKebabCase(t.prototype.constructor.name),c=((r=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,r){this.onAttributeChange(e,t,r)}onAttributeChange(e,t,r,n=!0){if(t!=r){n&&(this[s.toCamelCase(e)]=r);const o=this.constructor.watchAttributes;if(o&&o[e]){const n=o[e];this.__connected&&"function"==typeof this[n]&&this[n]({old:t,new:r})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,o.addEventListeners(this),a.initializeProps(this)}))}render(){return n(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 n(this,void 0,void 0,(function*(){const t=(yield e.template).default.toString(),r=document.createRange().createContextualFragment(t);return 1===r.children.length&&"TEMPLATE"===r.children[0].nodeName?r.firstChild.content:r}))}getStyle(){return n(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,r.ready=new Promise(((e,t)=>e(!0))),r);return customElements.get(i)||customElements.define(i,c),c}},985:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CustomElement=void 0;class r extends HTMLElement{constructor(){super()}connect(e){this.isConnected||document.querySelector(e).appendChild(this)}}t.CustomElement=r},265:(e,t)=>{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,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(1397),t),o(r(985),t),o(r(265),t),o(r(5969),t),o(r(5773),t),o(r(4271),t),o(r(9766),t),o(r(4938),t)},5969:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const n=r(3804);t.Listen=(e,t)=>(r,n)=>{r.constructor.listeners||(r.constructor.listeners=[]),r.constructor.listeners.push({selector:t,eventName:e,handler:r[n]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const r of e.constructor.listeners){const n=r.selector?t.querySelector(r.selector)?t.querySelector(r.selector):null:e;n&&n.addEventListener(r.eventName,(t=>{r.handler.call(e,t)}))}}},t.Dispatch=e=>(t,r)=>{Object.defineProperty(t,r,{get:function(){const t=this;return{emit(o){const a=e||n.toDotCase(r);t.dispatchEvent(new CustomEvent(a,o))}}}})}},5773:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const n=r(3804);t.Prop=()=>(e,t)=>{const r=n.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(r)},set:function(e){if(this.__connected){const o=this.props[t];this.props[t]=n.tryParseInt(e),"object"!=typeof e?this.setAttribute(r,e):this.onAttributeChange(r,o,e,!1)}else this.hasAttribute(n.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})},t.initializeProps=e=>{const t=e.constructor.watchAttributes;for(let r of(e=>{const t=e.constructor.watchAttributes,r=Object.assign({},t);Object.keys(r).forEach((e=>r[e]=""));const n=Object.assign(Object.assign({},r),e.constructor.propsInit);return Object.keys(n)})(e)){if(t)if(null==t[n.toKebabCase(r)])t[n.toKebabCase(r)]="";else{const o=e.props[r]||e.getAttribute(n.toKebabCase(r));"function"==typeof e[t[r]]&&e[t[r]]({new:o})}e.constructor.propsInit[r]&&(e.hasAttribute(n.toKebabCase(r))||(e[r]=e.constructor.propsInit[r]))}}},4271:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const n=r(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 r=e;if(null!=e)switch(typeof e){case"boolean":break;case"string":/^(true|false|^$)$/.test(e)?e="true"==r||""==r:(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,""!==r&&null!==r?this.setAttribute(t,e):e?this.setAttribute(t,""):this.removeAttribute(t)):this.hasAttribute(n.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},9766:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3804:(e,t)=>{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,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const n=r(3804);t.Watch=e=>(t,r)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[n.toKebabCase(e)]=r,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},249:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(s=(a<3?o(s):a>3?o(t,r,s):o(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SearchTypeSelector=void 0;const i=r(406);let c=class extends i.CustomElement{constructor(){super(),this.handleSearchTypeOnChange=this.handleSearchTypeOnChange.bind(this)}setup(e){this.connect(e.container),e.id&&(this.id=e.id)}connectedCallback(){this.searchTypeSelector=(0,i.getShadowRootElement)(this,"#search-type-selector"),this.metadataNameElement=(0,i.getShadowRootElement)(this,"#search-type-metadata-name"),this.metadataCounterElement=(0,i.getShadowRootElement)(this,"#search-type-metadata-counter"),this.articleNameElement=(0,i.getShadowRootElement)(this,"#search-type-article-name"),this.articleCounterElement=(0,i.getShadowRootElement)(this,"#search-type-article-counter"),this.searchTypeSelector.querySelectorAll("input[name=search-type]").forEach((e=>{e.onchange=this.handleSearchTypeOnChange})),this.searchTypeSelector.querySelector(`input[value=${this.searchtype}]`)}disconnectedCallback(){}updateNameElements(e){this.metadataNameElement.innerHTML="en"===e?"Map catalog":"Kartkatalogen",this.articleNameElement.innerHTML="en"===e?"Articles":"Artikler"}handleSearchTypeOnChange(e){if(this.onSearchTypeChange){const t=e.composedPath()[0];this.onSearchTypeChange.emit({detail:{value:t.value}})}}languageChanged(){this.updateNameElements(this.language)}metadataResultsFoundChanged(){this.metadataCounterElement.innerHTML=this.metadataresultsfound}articlesResultsFoundChanged(){this.articleCounterElement.innerHTML=this.articlesresultsfound}searchTypeChanged(){const e=this.searchTypeSelector.querySelector(`input[value=${this.searchtype}]`);e&&(e.checked=!0)}static setup(e,t){(0,i.getElement)(e)}};c.elementSelector="search-type-selector",a([(0,i.Prop)()],c.prototype,"id",void 0),a([(0,i.Prop)()],c.prototype,"metadataresultsfound",void 0),a([(0,i.Prop)()],c.prototype,"articlesresultsfound",void 0),a([(0,i.Prop)()],c.prototype,"language",void 0),a([(0,i.Prop)()],c.prototype,"searchtype",void 0),a([(0,i.Dispatch)("onSearchTypeChange")],c.prototype,"onSearchTypeChange",void 0),a([(0,i.Watch)("language")],c.prototype,"languageChanged",null),a([(0,i.Watch)("metadataresultsfound")],c.prototype,"metadataResultsFoundChanged",null),a([(0,i.Watch)("articlesresultsfound")],c.prototype,"articlesResultsFoundChanged",null),a([(0,i.Watch)("searchtype")],c.prototype,"searchTypeChanged",null),c=a([(0,i.Component)({tag:"search-type-selector",template:Promise.resolve().then((()=>s(r(8771)))),style:Promise.resolve().then((()=>s(r(727))))})],c),t.SearchTypeSelector=c}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(249)})())); | ||
!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.SearchTypeSelector=t())}(self,(()=>(()=>{"use strict";var e={727:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var n=r(4663),o=r.n(n),a=r(7638),s=r.n(a)()(o());s.push([e.id,'div.search-type-selector{width:180px}div.search-type-selector label{font-size:14px;display:block;cursor:pointer;height:18px;font-weight:normal}div.search-type-selector label .search-type-counter{font-size:.9em}div.search-type-selector label .search-type-counter::before{content:"("}div.search-type-selector label .search-type-counter::after{content:")"}div.search-type-selector input[type=radio]{-webkit-border-radius:50%;border-radius:50%;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;font:inherit;color:currentColor;width:16px;height:16px;border:2px solid #7d746d;transform:translateY(-0.075em);display:inline-grid;place-content:center}div.search-type-selector input[type=radio]::before{-webkit-border-radius:50%;border-radius:50%;content:"";width:8px;height:8px;transform:scale(0);transition:120ms transform ease-in-out}div.search-type-selector input[type=radio]:checked{border-color:#3767c7}div.search-type-selector input[type=radio]:checked::before{transform:scale(1);background-color:#3767c7}div.search-type-selector input[type=radio]:focus-visible{outline:max(2px,.1em) solid #3767c7;outline-offset:max(2px,.1em)}',"",{version:3,sources:["webpack://./stories/main-navigation/search-type-selector/search-type-selector.scss","webpack://./style/mixins/_border-radius.scss","webpack://./style/mixins/_appearance.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAEA,yBACI,WAAA,CACA,+BACI,cAAA,CACA,aAAA,CACA,cAAA,CACA,WAAA,CACA,kBAAA,CACA,oDACI,cAAA,CACA,4DACI,WAAA,CAEJ,2DACI,WAAA,CAIZ,2CCnBF,yBDoB6B,CCnB7B,iBDmB6B,CEpB3B,uBFqBwB,CEpBxB,oBFoBwB,CEnBxB,eFmBwB,CACpB,QAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CACA,WAAA,CACA,wBAAA,CACA,8BAAA,CACA,mBAAA,CACA,oBAAA,CAGJ,mDCjCF,yBDkC6B,CCjC7B,iBDiC6B,CACvB,UAAA,CACA,SAAA,CACA,UAAA,CACA,kBAAA,CACA,sCAAA,CAGJ,mDACI,oBG7BO,CH8BP,2DACI,kBAAA,CACA,wBGhCG,CHoCX,yDACI,mCAAA,CACA,4BAAA",sourcesContent:['@import "../../../style/all";\n\ndiv.search-type-selector {\n width: 180px;\n label {\n font-size: 14px;\n display: block;\n cursor: pointer;\n height: 18px;\n font-weight: normal;\n .search-type-counter {\n font-size: 0.9em;\n &::before {\n content: "(";\n }\n &::after {\n content: ")";\n }\n }\n }\n input[type="radio"] {\n @include border-radius(50%);\n @include appearance(none);\n margin: 0;\n font: inherit;\n color: currentColor;\n width: 16px;\n height: 16px;\n border: 2px solid rgb(125, 116, 109);\n transform: translateY(-0.075em);\n display: inline-grid;\n place-content: center;\n }\n\n input[type="radio"]::before {\n @include border-radius(50%);\n content: "";\n width: 8px;\n height: 8px;\n transform: scale(0);\n transition: 120ms transform ease-in-out;\n }\n\n input[type="radio"]:checked {\n border-color: $primary-text;\n &::before {\n transform: scale(1);\n background-color: $primary-text;\n }\n }\n\n input[type="radio"]:focus-visible {\n outline: max(2px, 0.1em) solid $primary-text;\n outline-offset: max(2px, 0.1em);\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 appearance ($value) {\n -webkit-appearance: $value;\n -moz-appearance: $value;\n appearance: $value;\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$light-gray: #f6f5f4;\n\n$primary-brand: #FE5000;\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: #f4f4f4;\n$disabled-border: #dedede;\n$disabled-text: #707070;\n"],sourceRoot:""}]);const i=s},8771:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});const n='<template>\n <div id="search-type-selector" class="search-type-selector">\n <label for="search-type-metadata">\n <input name="search-type" type="radio" id="search-type-metadata" value="metadata" />\n <span id="search-type-metadata-name">Kartkatalogen</span>\n <span id="search-type-metadata-counter" class="search-type-counter"></span>\n </label>\n <label for="search-type-article">\n <input name="search-type" type="radio" id="search-type-article" value="articles" />\n <span id="search-type-article-name">Artikler</span>\n <span id="search-type-article-counter" class="search-type-counter"></span>\n </label>\n </div>\n</template>'},7638:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var d=0;d<e.length;d++){var l=[].concat(e[d]);n&&s[l[0]]||(void 0!==a&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=a),r&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=r):l[2]=r),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=>{e.exports=function(e){var t=e[1],r=e[3];if(!r)return t;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),a="/*# ".concat(o," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},1397:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function s(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,i)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const o=r(5969),a=r(5773),s=r(3804);t.Component=e=>t=>{var r;const i=e.tag||s.toKebabCase(t.prototype.constructor.name),c=((r=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,r){this.onAttributeChange(e,t,r)}onAttributeChange(e,t,r,n=!0){if(t!=r){n&&(this[s.toCamelCase(e)]=r);const o=this.constructor.watchAttributes;if(o&&o[e]){const n=o[e];this.__connected&&"function"==typeof this[n]&&this[n]({old:t,new:r})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return n(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,o.addEventListeners(this),a.initializeProps(this)}))}render(){return n(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 n(this,void 0,void 0,(function*(){const t=(yield e.template).default.toString(),r=document.createRange().createContextualFragment(t);return 1===r.children.length&&"TEMPLATE"===r.children[0].nodeName?r.firstChild.content:r}))}getStyle(){return n(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,r.ready=new Promise(((e,t)=>e(!0))),r);return customElements.get(i)||customElements.define(i,c),c}},985:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CustomElement=void 0;class r extends HTMLElement{constructor(){super()}connect(e){this.isConnected||document.querySelector(e).appendChild(this)}}t.CustomElement=r},265:(e,t)=>{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,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(1397),t),o(r(985),t),o(r(265),t),o(r(5969),t),o(r(5773),t),o(r(4271),t),o(r(9766),t),o(r(4938),t)},5969:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const n=r(3804);t.Listen=(e,t)=>(r,n)=>{r.constructor.listeners||(r.constructor.listeners=[]),r.constructor.listeners.push({selector:t,eventName:e,handler:r[n]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const r of e.constructor.listeners){const n=r.selector?t.querySelector(r.selector)?t.querySelector(r.selector):null:e;n&&n.addEventListener(r.eventName,(t=>{r.handler.call(e,t)}))}}},t.Dispatch=e=>(t,r)=>{Object.defineProperty(t,r,{get:function(){const t=this;return{emit(o){const a=e||n.toDotCase(r);t.dispatchEvent(new CustomEvent(a,o))}}}})}},5773:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const n=r(3804);t.Prop=()=>(e,t)=>{const r=n.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(r)},set:function(e){if(this.__connected){const o=this.props[t];this.props[t]=n.tryParseInt(e),"object"!=typeof e?this.setAttribute(r,e):this.onAttributeChange(r,o,e,!1)}else this.hasAttribute(n.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})},t.initializeProps=e=>{const t=e.constructor.watchAttributes;for(let r of(e=>{const t=e.constructor.watchAttributes,r=Object.assign({},t);Object.keys(r).forEach((e=>r[e]=""));const n=Object.assign(Object.assign({},r),e.constructor.propsInit);return Object.keys(n)})(e)){if(t)if(null==t[n.toKebabCase(r)])t[n.toKebabCase(r)]="";else{const o=e.props[r]||e.getAttribute(n.toKebabCase(r));"function"==typeof e[t[r]]&&e[t[r]]({new:o})}e.constructor.propsInit[r]&&(e.hasAttribute(n.toKebabCase(r))||(e[r]=e.constructor.propsInit[r]))}}},4271:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const n=r(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 r=e;if(null!=e)switch(typeof e){case"boolean":break;case"string":/^(true|false|^$)$/.test(e)?e="true"==r||""==r:(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,""!==r&&null!==r?this.setAttribute(t,e):e?this.setAttribute(t,""):this.removeAttribute(t)):this.hasAttribute(n.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},9766:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3804:(e,t)=>{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,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const n=r(3804);t.Watch=e=>(t,r)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[n.toKebabCase(e)]=r,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},249:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(s=(a<3?o(s):a>3?o(t,r,s):o(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SearchTypeSelector=void 0;const i=r(406);let c=class extends i.CustomElement{constructor(){super(),this.handleSearchTypeOnChange=this.handleSearchTypeOnChange.bind(this)}setup(e){this.connect(e.container),e.id&&(this.id=e.id)}connectedCallback(){this.searchTypeSelector=(0,i.getShadowRootElement)(this,"#search-type-selector"),this.metadataNameElement=(0,i.getShadowRootElement)(this,"#search-type-metadata-name"),this.metadataCounterElement=(0,i.getShadowRootElement)(this,"#search-type-metadata-counter"),this.articleNameElement=(0,i.getShadowRootElement)(this,"#search-type-article-name"),this.articleCounterElement=(0,i.getShadowRootElement)(this,"#search-type-article-counter"),this.searchTypeSelector.querySelectorAll("input[name=search-type]").forEach((e=>{e.onchange=this.handleSearchTypeOnChange})),this.searchTypeSelector.querySelector(`input[value=${this.searchtype}]`)}disconnectedCallback(){}updateNameElements(e){this.metadataNameElement.innerHTML="en"===e?"Map catalog":"Kartkatalogen",this.articleNameElement.innerHTML="en"===e?"Articles":"Artikler"}handleSearchTypeOnChange(e){if(this.onSearchTypeChange){const t=e.composedPath()[0];this.onSearchTypeChange.emit({detail:{value:t.value}})}}languageChanged(){this.updateNameElements(this.language)}metadataResultsFoundChanged(){this.metadataCounterElement.innerHTML=this.metadataresultsfound}articlesResultsFoundChanged(){this.articleCounterElement.innerHTML=this.articlesresultsfound}searchTypeChanged(){const e=this.searchTypeSelector.querySelector(`input[value=${this.searchtype}]`);e&&(e.checked=!0)}static setup(e,t){(0,i.getElement)(e)}};c.elementSelector="search-type-selector",a([(0,i.Prop)()],c.prototype,"id",void 0),a([(0,i.Prop)()],c.prototype,"metadataresultsfound",void 0),a([(0,i.Prop)()],c.prototype,"articlesresultsfound",void 0),a([(0,i.Prop)()],c.prototype,"language",void 0),a([(0,i.Prop)()],c.prototype,"searchtype",void 0),a([(0,i.Dispatch)("onSearchTypeChange")],c.prototype,"onSearchTypeChange",void 0),a([(0,i.Watch)("language")],c.prototype,"languageChanged",null),a([(0,i.Watch)("metadataresultsfound")],c.prototype,"metadataResultsFoundChanged",null),a([(0,i.Watch)("articlesresultsfound")],c.prototype,"articlesResultsFoundChanged",null),a([(0,i.Watch)("searchtype")],c.prototype,"searchTypeChanged",null),c=a([(0,i.Component)({tag:"search-type-selector",template:Promise.resolve().then((()=>s(r(8771)))),style:Promise.resolve().then((()=>s(r(727))))})],c),t.SearchTypeSelector=c}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(249)})())); | ||
//# sourceMappingURL=SearchTypeSelector.js.map |
Sorry, the diff of this file is too big to display
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
Sorry, the diff of this file is too big to display
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
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
1
61168772
80
117798