@kartverket/geonorge-web-components 3.0.2 → 4.0.3
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/BodyText.js +1 -1
- package/BodyText.js.map +1 -1
- package/BreadcrumbList.js +1 -1
- package/BreadcrumbList.js.map +1 -1
- package/ContentContainer.js +1 -1
- package/ContentContainer.js.map +1 -1
- package/DownloadItem.js +1 -1
- package/DownloadItem.js.map +1 -1
- package/GeonorgeFooter.js +1 -1
- package/GeonorgeFooter.js.map +1 -1
- package/GnAccordion.js +1 -1
- package/GnAccordion.js.map +1 -1
- package/GnBadgeList.js +1 -1
- package/GnBadgeList.js.map +1 -1
- package/GnBreadcrumbList.js +1 -1
- package/GnBreadcrumbList.js.map +1 -1
- package/GnButton.js +1 -1
- package/GnButton.js.map +1 -1
- package/GnDialog.js +1 -1
- package/GnDialog.js.map +1 -1
- package/GnFieldContainer.js +1 -1
- package/GnFieldContainer.js.map +1 -1
- package/GnInput.js +1 -1
- package/GnInput.js.map +1 -1
- package/GnLabel.js +1 -1
- package/GnLabel.js.map +1 -1
- package/GnList.js +1 -1
- package/GnList.js.map +1 -1
- package/GnSelect.js +1 -1
- package/GnSelect.js.map +1 -1
- package/GnShortcutButton.js +2 -0
- package/GnShortcutButton.js.map +1 -0
- package/GnSrOnly.js +1 -1
- package/GnSrOnly.js.map +1 -1
- package/GnTable.js +1 -1
- package/GnTable.js.map +1 -1
- package/GnTextarea.js +1 -1
- package/GnTextarea.js.map +1 -1
- package/HeadingText.js +1 -1
- package/HeadingText.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/MainSearchField.js +1 -1
- package/MainSearchField.js.map +1 -1
- package/MapItem.js +1 -1
- package/MapItem.js.map +1 -1
- package/NavigationTabContent.js +1 -1
- package/NavigationTabContent.js.map +1 -1
- package/NavigationTabHeading.js +1 -1
- package/NavigationTabHeading.js.map +1 -1
- package/NavigationTabs.js +1 -1
- package/NavigationTabs.js.map +1 -1
- package/SearchTypeSelector.js +1 -1
- package/SearchTypeSelector.js.map +1 -1
- package/UserAccount.js +1 -1
- package/UserAccount.js.map +1 -1
- package/apiHelpers.d.ts +10 -0
- package/gn-button.d.ts +5 -0
- package/gn-shortcut-button.d.ts +36 -0
- package/guiHelpers.d.ts +1 -0
- package/heading-text.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/navigation-tab-content.d.ts +1 -1
- package/package.json +2 -2
package/GnInput.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.GnInput=e())}(self,(()=>(()=>{"use strict";var t={164:t=>{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 a={};if(o)for(var s=0;s<this.length;s++){var p=this[s][0];null!=p&&(a[p]=!0)}for(var c=0;c<t.length;c++){var d=[].concat(t[c]);o&&a[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}},169:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const o=n(2466);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))}}}})}},1063:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const o=n(2466);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}},1534:function(t,e,n){var o,i=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]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},s=this&&this.__importStar||(o=function(t){return o=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[e.length]=n);return e},o(t)},function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n=o(t),a=0;a<n.length;a++)"default"!==n[a]&&i(e,t,n[a]);return r(e,t),e}),p=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GnInput=void 0;const c=n(3128),d=n(5979),u=p(n(3794));let l=class extends c.CustomElement{constructor(){super(),(0,d.addGlobalStylesheet)("gn-input-styles",u.default)}widthChanged(){(0,c.getShadowRootElement)(this,"#input-container").style.width=this.width}setup(t){}};e.GnInput=l,a([(0,c.Toggle)()],l.prototype,"block",void 0),a([(0,c.Toggle)()],l.prototype,"fullwidth",void 0),a([(0,c.Prop)()],l.prototype,"width",void 0),a([(0,c.Watch)("width")],l.prototype,"widthChanged",null),e.GnInput=l=a([(0,c.Component)({tag:"gn-input",template:Promise.resolve().then((()=>s(n(6496))))})],l)},2466:(t,e)=>{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},3128:function(t,e,n){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(8631),e),i(n(3704),e),i(n(3365),e),i(n(169),e),i(n(6999),e),i(n(3982),e),i(n(8861),e),i(n(1063),e)},3365:(t,e)=>{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)},3704:(t,e)=>{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},3794:(t,e,n)=>{n.r(e),n.d(e,{default:()=>s});var o=n(5052),i=n.n(o),r=n(164),a=n.n(r)()(i());a.push([t.id,'gn-input[width] input[type=text],gn-input[width] input[type=number],gn-input[width] input[type=email],gn-input[width] input[type=tel],gn-input[width] input[type=date],gn-input[width] input[type=datetime-local],gn-input[width] input[type=time],gn-input[width] input[type=url],gn-input[width] input[type=search],gn-input[width] input[type=password],gn-input[width] input:not([type]){width:100%}gn-input input[type=text],gn-input input[type=number],gn-input input[type=email],gn-input input[type=tel],gn-input input[type=date],gn-input input[type=datetime-local],gn-input input[type=time],gn-input input[type=url],gn-input input[type=search],gn-input input[type=password],gn-input input:not([type]){-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-border-radius:4px;border-radius:4px;box-sizing:border-box;font-family:"Open Sans",sans-serif;font-size:16px;font-size:12pt;padding:0 8px;height:32px;box-shadow:none;position:relative;z-index:1}gn-input input[type=text]:not(:disabled),gn-input input[type=number]:not(:disabled),gn-input input[type=email]:not(:disabled),gn-input input[type=tel]:not(:disabled),gn-input input[type=date]:not(:disabled),gn-input input[type=datetime-local]:not(:disabled),gn-input input[type=time]:not(:disabled),gn-input input[type=url]:not(:disabled),gn-input input[type=search]:not(:disabled),gn-input input[type=password]:not(:disabled),gn-input input:not([type]):not(:disabled){background-color:#fff;border:1px solid #d8d8d8;color:#2f3940}gn-input input[type=text]:disabled,gn-input input[type=number]:disabled,gn-input input[type=email]:disabled,gn-input input[type=tel]:disabled,gn-input input[type=date]:disabled,gn-input input[type=datetime-local]:disabled,gn-input input[type=time]:disabled,gn-input input[type=url]:disabled,gn-input input[type=search]:disabled,gn-input input[type=password]:disabled,gn-input input:not([type]):disabled{background-color:#f4f4f4;color:#707070;border:1px solid #dedede;cursor:not-allowed}gn-input input[type=checkbox],gn-input input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:2px solid #2f3940;font:inherit;color:currentColor;width:16px;height:16px;margin:0 6px 0 0}gn-input input[type=checkbox]:checked,gn-input input[type=radio]:checked{border-color:#3767c7}gn-input input[type=checkbox]:focus-visible,gn-input input[type=radio]:focus-visible{outline:max(2px,.1em) solid #3767c7;outline-offset:max(2px,.1em)}gn-input input[type=checkbox]{-webkit-border-radius:3px;border-radius:3px;vertical-align:text-top}gn-input input[type=checkbox]:checked::before{background-color:#3767c7;content:"✓";line-height:13px;color:#fff;display:inline-block;vertical-align:top;width:100%}gn-input input[type=checkbox]:disabled{background-color:#dedede;border-color:#dedede;cursor:not-allowed}gn-input input[type=checkbox]:disabled:checked::before{background-color:#dedede;color:#707070}gn-input input[type=radio]{-webkit-border-radius:50%;border-radius:50%;transform:translateY(-0.075em);display:inline-grid;place-content:center}gn-input 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}gn-input input[type=radio]:checked::before{background-color:#3767c7;transform:scale(1)}gn-input input[type=radio]:disabled{border-color:#dedede}gn-input input[type=radio]:disabled:checked::before{background-color:#dedede;transform:scale(1)}gn-input[block]{display:block}gn-input:not([block]){display:inline-block}gn-input[fullwidth]{display:block}gn-input[fullwidth] input{width:100%}',"",{version:3,sources:["webpack://./stories/gn-input/gn-input.scss","webpack://./style/variables/_typography.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAAA,6XAIQ,UAWI,CAAA,gTAGR,uBAWwB,CAAA,oBAAA,CAAA,eAAA,CAAA,yBACG,CAAA,iBAAA,CAAA,qBACvB,CAAA,kCC/BO,CAAA,cDiCP,CAAA,cACA,CAAA,aACA,CAAA,WACA,CAAA,eACA,CAAA,iBACA,CAAA,SACA,CAAA,qdACA,qBACI,CAAA,wBACA,CAAA,aEnCE,CAAA,mZFsCN,wBEbc,CAAA,aAEN,CAAA,wBFcJ,CAAA,kBACA,CAAA,yDAGR,uBAEwB,CAAA,oBAAA,CAAA,eAAA,CAAA,wBACpB,CAAA,YACA,CAAA,kBACA,CAAA,UACA,CAAA,WACA,CAAA,gBACA,CAAA,yEACA,oBE9CO,CAAA,qFFiDP,mCACI,CAAA,4BACA,CAAA,8BAGR,yBAC2B,CAAA,iBAAA,CAAA,uBACvB,CAAA,8CAEI,wBE1DG,CAAA,WF4DC,CAAA,gBACA,CAAA,UACA,CAAA,oBACA,CAAA,kBACA,CAAA,UACA,CAAA,uCAGR,wBElDU,CAAA,oBAAA,CAAA,kBFqDN,CAAA,uDAEI,wBEvDE,CAAA,aACF,CAAA,2BF6DZ,yBAC2B,CAAA,iBAAA,CAAA,8BACvB,CAAA,mBACA,CAAA,oBACA,CAAA,mCACA,yBAC2B,CAAA,iBAAA,CAAA,UACvB,CAAA,SACA,CAAA,UACA,CAAA,kBACA,CAAA,sCACA,CAAA,2CAGA,wBE9FG,CAAA,kBFgGC,CAAA,oCAGR,oBEjFU,CAAA,oDFoFF,wBEpFE,CAAA,kBFsFE,CAAA,gBAMhB,aACI,CAAA,sBAEJ,oBACI,CAAA,oBAEJ,aACI,CAAA,0BACA,UACI",sourcesContent:['@import "../../style/all";\n\ngn-input {\n &[width] {\n input[type="text"],\n input[type="number"],\n input[type="email"],\n input[type="tel"],\n input[type="date"],\n input[type="datetime-local"],\n input[type="time"],\n input[type="url"],\n input[type="search"],\n input[type="password"],\n input:not([type]) {\n width: 100%;\n }\n }\n input[type="text"],\n input[type="number"],\n input[type="email"],\n input[type="tel"],\n input[type="date"],\n input[type="datetime-local"],\n input[type="time"],\n input[type="url"],\n input[type="search"],\n input[type="password"],\n input:not([type]) {\n @include appearance(none);\n @include border-radius(4px);\n box-sizing: border-box;\n font-family: $default-font;\n font-size: 16px;\n font-size: 12pt;\n padding: 0 8px;\n height: 32px;\n box-shadow: none;\n position: relative;\n z-index: 1;\n &:not(:disabled) {\n background-color: #fff;\n border: 1px solid $default-border;\n color: $default-text;\n }\n &:disabled {\n background-color: $disabled-background;\n color: $disabled-text;\n border: 1px solid $disabled-border;\n cursor: not-allowed;\n }\n }\n input[type="checkbox"],\n input[type="radio"] {\n @include appearance(none);\n border: 2px solid $default-text;\n font: inherit;\n color: currentColor;\n width: 16px;\n height: 16px;\n margin: 0 6px 0 0;\n &:checked {\n border-color: $primary-text;\n }\n &:focus-visible {\n outline: max(2px, 0.1em) solid $primary-text;\n outline-offset: max(2px, 0.1em);\n }\n }\n input[type="checkbox"] {\n @include border-radius(3px);\n vertical-align: text-top;\n &:checked {\n &::before {\n background-color: $primary-text;\n content: "✓";\n line-height: 13px;\n color: #fff;\n display: inline-block;\n vertical-align: top;\n width: 100%;\n }\n }\n &:disabled {\n background-color: $disabled-border;\n border-color: $disabled-border;\n cursor: not-allowed;\n &:checked {\n &::before {\n background-color: $disabled-border;\n color: $disabled-text;\n }\n }\n }\n }\n input[type="radio"] {\n @include border-radius(50%);\n transform: translateY(-0.075em);\n display: inline-grid;\n place-content: center;\n &::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 &:checked {\n &::before {\n background-color: $primary-text;\n transform: scale(1);\n }\n }\n &:disabled {\n border-color: $disabled-border;\n &:checked {\n &::before {\n background-color: $disabled-border;\n transform: scale(1);\n }\n }\n }\n }\n\n &[block] {\n display: block;\n }\n &:not([block]) {\n display: inline-block;\n }\n &[fullwidth] {\n display: block;\n input {\n width: 100%;\n }\n }\n}\n','$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;\n$default-font-size: 15px;\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: #3767C7;\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\n\n$light-green: #8fff33;\n$light-yellow: #ffEb3b;\n$light-red: #ff4a2e;\n"],sourceRoot:""}]);const s=a},3982:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const o=n(2466);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)}})}},5052:t=>{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")}},5979:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeInnerHTML=e.addGlobalStylesheet=e.getFocusableElementsInsideElement=void 0,e.getFocusableElementsInsideElement=t=>t.querySelectorAll('button, [href], input, [tabindex="0"]'),e.addGlobalStylesheet=(t,e)=>{const n=document.createElement("style");n.setAttribute("id",t),n.textContent=e,document.getElementById(t)||document.head.appendChild(n)},e.removeInnerHTML=t=>{for(;t.firstChild;)t.removeChild(t.firstChild)}},6496:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});const o='<template>\n <div id="input-container" class="input-container">\n <slot></slot>\n </div>\n</template>\n'},6999:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const o=n(2466);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]))}}},8631:function(t,e,n){var o=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{p(o.next(t))}catch(t){r(t)}}function s(t){try{p(o.throw(t))}catch(t){r(t)}}function p(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}p((o=o.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const i=n(169),r=n(6999),a=n(2466);e.Component=t=>e=>{var n;const s=t.tag||a.toKebabCase(e.prototype.constructor.name),p=((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=>a.toKebabCase(t)))}attributeChangedCallback(t,e,n){this.onAttributeChange(t,e,n)}onAttributeChange(t,e,n,o=!0){if(e!=n){o&&(this[a.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(s)||customElements.define(s,p),p}},8861:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})}},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(1534)})()));
|
|
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.GnInput=e())}(self,(()=>(()=>{"use strict";var t={164:t=>{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 d=0;d<this.length;d++){var a=this[d][0];null!=a&&(i[a]=!0)}for(var l=0;l<t.length;l++){var c=[].concat(t[l]);n&&i[c[0]]||(void 0!==s&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),e.push(c))}},e}},169:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const n=o(2466);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))}}}})}},1040:(t,e,o)=>{o.r(e),o.d(e,{default:()=>d});var n=o(5052),r=o.n(n),s=o(164),i=o.n(s)()(r());i.push([t.id,':host([block]){display:block}:host(:not([block])){display:inline-block}:host([fullwidth]){display:block}:host([fullwidth]) ::slotted(input){width:100%}:host([width]) ::slotted(input[type=text]),:host([width]) ::slotted(input[type=number]),:host([width]) ::slotted(input[type=email]),:host([width]) ::slotted(input[type=tel]),:host([width]) ::slotted(input[type=date]),:host([width]) ::slotted(input[type=datetime-local]),:host([width]) ::slotted(input[type=time]),:host([width]) ::slotted(input[type=url]),:host([width]) ::slotted(input[type=search]),:host([width]) ::slotted(input[type=password]),:host([width]) ::slotted(input:not([type])){width:100%}::slotted(input[type=text]),::slotted(input[type=number]),::slotted(input[type=email]),::slotted(input[type=tel]),::slotted(input[type=date]),::slotted(input[type=datetime-local]),::slotted(input[type=time]),::slotted(input[type=url]),::slotted(input[type=search]),::slotted(input[type=password]),::slotted(input:not([type])){-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-border-radius:4px;border-radius:4px;box-sizing:border-box;font-family:"Open Sans",sans-serif;font-size:16px;font-size:12pt;padding:0 8px;height:32px;box-shadow:none;position:relative;z-index:1;background-color:#fff;border:1px solid #d8d8d8;color:#2f3940}::slotted(input[type=text]:disabled),::slotted(input[type=number]:disabled),::slotted(input[type=email]:disabled),::slotted(input[type=tel]:disabled),::slotted(input[type=date]:disabled),::slotted(input[type=datetime-local]:disabled),::slotted(input[type=time]:disabled),::slotted(input[type=url]:disabled),::slotted(input[type=search]:disabled),::slotted(input[type=password]:disabled),::slotted(input:not([type]):disabled){background-color:#f4f4f4;color:#707070;border:1px solid #dedede;cursor:not-allowed}::slotted(input[type=checkbox]),::slotted(input[type=radio]){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:2px solid #2f3940;font:inherit;color:currentColor;width:16px;height:16px;margin:0 6px 0 0}::slotted(input[type=checkbox]:checked),::slotted(input[type=radio]:checked){border-color:#3767c7}::slotted(input[type=checkbox]:focus-visible),::slotted(input[type=radio]:focus-visible){outline:max(2px,.1em) solid #3767c7;outline-offset:max(2px,.1em)}::slotted(input[type=checkbox]){-webkit-border-radius:3px;border-radius:3px;vertical-align:text-top}::slotted(input[type=checkbox]:checked)::before{background-color:#3767c7;content:"✓";line-height:13px;color:#fff;display:inline-block;vertical-align:top;width:100%}::slotted(input[type=checkbox]:disabled){background-color:#dedede;border-color:#dedede;cursor:not-allowed}::slotted(input[type=checkbox]:checked:disabled)::before{background-color:#dedede;color:#707070}::slotted(input[type=radio]){-webkit-border-radius:50%;border-radius:50%;transform:translateY(-0.075em);display:inline-grid;place-content:center}::slotted(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}::slotted(input[type=radio]:checked)::before{background-color:#3767c7;transform:scale(1)}::slotted(input[type=radio]:disabled){border-color:#dedede}::slotted(input[type=radio]:checked:disabled)::before{background-color:#dedede;transform:scale(1)}',"",{version:3,sources:["webpack://./stories/gn-input/template.scss","webpack://./style/variables/_typography.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAAA,eAKA,aACI,CAAA,qBAGJ,oBACI,CAAA,mBAGJ,aACI,CAAA,oCACA,UACI,CAAA,2eAKJ,UAWI,CAAA,sUAIR,uBAWmC,CAAA,oBAAA,CAAA,eAAA,CAAA,yBACM,CAAA,iBAAA,CAAA,qBACrC,CAAA,kCCjDW,CAAA,cDmDX,CAAA,cACA,CAAA,aACA,CAAA,WACA,CAAA,eACA,CAAA,iBACA,CAAA,SACA,CAAA,qBACA,CAAA,wBACA,CAAA,aEpDU,CAAA,yaFwDd,wBE/BsB,CAAA,aAEN,CAAA,wBF0CZ,CAAA,kBACA,CAAA,6DAGJ,uBAEmC,CAAA,oBAAA,CAAA,eAAA,CAAA,wBAC/B,CAAA,YACA,CAAA,kBACA,CAAA,UACA,CAAA,WACA,CAAA,gBACA,CAAA,6EAGJ,oBE5Ee,CAAA,yFFiFf,mCAEI,CAAA,4BACA,CAAA,gCAGJ,yBACyC,CAAA,iBAAA,CAAA,uBACrC,CAAA,gDAIA,wBE7FW,CAAA,WF+FP,CAAA,gBACA,CAAA,UACA,CAAA,oBACA,CAAA,kBACA,CAAA,UACA,CAAA,yCAIR,wBEtFkB,CAAA,oBAAA,CAAA,kBFyFd,CAAA,yDAIA,wBE7Fc,CAAA,aACF,CAAA,6BFkGhB,yBACyC,CAAA,iBAAA,CAAA,8BACrC,CAAA,mBACA,CAAA,oBACA,CAAA,qCACA,yBACyC,CAAA,iBAAA,CAAA,UACrC,CAAA,SACA,CAAA,UACA,CAAA,kBACA,CAAA,sCACA,CAAA,6CAKJ,wBErIW,CAAA,kBFuIP,CAAA,sCAIR,oBEzHkB,CAAA,sDF8Hd,wBE9Hc,CAAA,kBFgIV",sourcesContent:['@use "../../style/mixins/appearance";\n@use "../../style/mixins/border-radius";\n@use "../../style/variables/colors";\n@use "../../style/variables/typography";\n\n:host([block]) {\n display: block;\n}\n\n:host(:not([block])) {\n display: inline-block;\n}\n\n:host([fullwidth]) {\n display: block;\n ::slotted(input) {\n width: 100%;\n }\n}\n\n:host([width]) {\n ::slotted(input[type="text"]),\n ::slotted(input[type="number"]),\n ::slotted(input[type="email"]),\n ::slotted(input[type="tel"]),\n ::slotted(input[type="date"]),\n ::slotted(input[type="datetime-local"]),\n ::slotted(input[type="time"]),\n ::slotted(input[type="url"]),\n ::slotted(input[type="search"]),\n ::slotted(input[type="password"]),\n ::slotted(input:not([type])) {\n width: 100%;\n }\n}\n\n::slotted(input[type="text"]),\n::slotted(input[type="number"]),\n::slotted(input[type="email"]),\n::slotted(input[type="tel"]),\n::slotted(input[type="date"]),\n::slotted(input[type="datetime-local"]),\n::slotted(input[type="time"]),\n::slotted(input[type="url"]),\n::slotted(input[type="search"]),\n::slotted(input[type="password"]),\n::slotted(input:not([type])) {\n @include appearance.appearance(none);\n @include border-radius.border-radius(4px);\n box-sizing: border-box;\n font-family: typography.$default-font;\n font-size: 16px;\n font-size: 12pt;\n padding: 0 8px;\n height: 32px;\n box-shadow: none;\n position: relative;\n z-index: 1;\n background-color: #fff;\n border: 1px solid colors.$default-border;\n color: colors.$default-text;\n}\n\n::slotted(input[type="text"]:disabled),\n::slotted(input[type="number"]:disabled),\n::slotted(input[type="email"]:disabled),\n::slotted(input[type="tel"]:disabled),\n::slotted(input[type="date"]:disabled),\n::slotted(input[type="datetime-local"]:disabled),\n::slotted(input[type="time"]:disabled),\n::slotted(input[type="url"]:disabled),\n::slotted(input[type="search"]:disabled),\n::slotted(input[type="password"]:disabled),\n::slotted(input:not([type]):disabled) {\n background-color: colors.$disabled-background;\n color: colors.$disabled-text;\n border: 1px solid colors.$disabled-border;\n cursor: not-allowed;\n}\n\n::slotted(input[type="checkbox"]),\n::slotted(input[type="radio"]) {\n @include appearance.appearance(none);\n border: 2px solid colors.$default-text;\n font: inherit;\n color: currentColor;\n width: 16px;\n height: 16px;\n margin: 0 6px 0 0;\n}\n\n::slotted(input[type="checkbox"]:checked),\n::slotted(input[type="radio"]:checked) {\n border-color: colors.$primary-text;\n}\n\n::slotted(input[type="checkbox"]:focus-visible),\n::slotted(input[type="radio"]:focus-visible) {\n outline: max(2px, 0.1em) solid colors.$primary-text;\n outline-offset: max(2px, 0.1em);\n}\n\n::slotted(input[type="checkbox"]) {\n @include border-radius.border-radius(3px);\n vertical-align: text-top;\n}\n\n::slotted(input[type="checkbox"]:checked) {\n &::before {\n background-color: colors.$primary-text;\n content: "✓";\n line-height: 13px;\n color: #fff;\n display: inline-block;\n vertical-align: top;\n width: 100%;\n }\n}\n\n::slotted(input[type="checkbox"]:disabled) {\n background-color: colors.$disabled-border;\n border-color: colors.$disabled-border;\n cursor: not-allowed;\n}\n\n::slotted(input[type="checkbox"]:checked:disabled) {\n &::before {\n background-color: colors.$disabled-border;\n color: colors.$disabled-text;\n }\n}\n\n::slotted(input[type="radio"]) {\n @include border-radius.border-radius(50%);\n transform: translateY(-0.075em);\n display: inline-grid;\n place-content: center;\n &::before {\n @include border-radius.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\n::slotted(input[type="radio"]:checked) {\n &::before {\n background-color: colors.$primary-text;\n transform: scale(1);\n }\n}\n\n::slotted(input[type="radio"]:disabled) {\n border-color: colors.$disabled-border;\n}\n\n::slotted(input[type="radio"]:checked:disabled) {\n &::before {\n background-color: colors.$disabled-border;\n transform: scale(1);\n }\n}\n','$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;\n$default-font-size: 15px;\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: #3767C7;\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\n\n$light-green: #8fff33;\n$light-yellow: #ffEb3b;\n$light-red: #ff4a2e;\n"],sourceRoot:""}]);const d=i},1063:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const n=o(2466);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}},1534:function(t,e,o){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 d=t.length-1;d>=0;d--)(r=t[d])&&(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},d=this&&this.__importStar||(n=function(t){return n=Object.getOwnPropertyNames||function(t){var e=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[e.length]=o);return e},n(t)},function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o=n(t),i=0;i<o.length;i++)"default"!==o[i]&&r(e,t,o[i]);return s(e,t),e});Object.defineProperty(e,"__esModule",{value:!0}),e.GnInput=void 0;const a=o(3128);let l=class extends a.CustomElement{constructor(){super()}widthChanged(){(0,a.getShadowRootElement)(this,"#input-container").style.width=this.width}setup(t){}};e.GnInput=l,i([(0,a.Toggle)()],l.prototype,"block",void 0),i([(0,a.Toggle)()],l.prototype,"fullwidth",void 0),i([(0,a.Prop)()],l.prototype,"width",void 0),i([(0,a.Watch)("width")],l.prototype,"widthChanged",null),e.GnInput=l=i([(0,a.Component)({tag:"gn-input",template:Promise.resolve().then((()=>d(o(6496)))),style:Promise.resolve().then((()=>d(o(1040))))})],l)},2466:(t,e)=>{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},3128:function(t,e,o){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(8631),e),r(o(3704),e),r(o(3365),e),r(o(169),e),r(o(6999),e),r(o(3982),e),r(o(8861),e),r(o(1063),e)},3365:(t,e)=>{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)},3704:(t,e)=>{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},3982:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const n=o(2466);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)}})}},5052:t=>{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")}},6496:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});const n='<template>\n <div id="input-container" class="input-container">\n <slot></slot>\n </div>\n</template>\n'},6999:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const n=o(2466);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]))}}},8631:function(t,e,o){var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(r,s){function i(t){try{a(n.next(t))}catch(t){s(t)}}function d(t){try{a(n.throw(t))}catch(t){s(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,d)}a((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const r=o(169),s=o(6999),i=o(2466);e.Component=t=>e=>{var o;const d=t.tag||i.toKebabCase(e.prototype.constructor.name),a=((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(d)||customElements.define(d,a),a}},8861:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})}},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(1534)})()));
|
|
2
2
|
//# sourceMappingURL=GnInput.js.map
|
package/GnInput.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GnInput.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,SAAW,QAAIC,IAC1E,CATD,CASGK,MAAM,I,kCCHTH,EAAOD,QAAU,SAAUK,GACzB,IAAIC,EAAO,G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IX,SAAQ,CAACY,EAASC,IAAMD,GAAQ,K,GA4FjF,OAJKE,eAAezH,IAAIwB,IACtBiG,eAAexK,OAAOuE,EAAKe,GAGtBA,CAAa,C,kECxGpBmF,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBvJ,IAAjBwJ,EACH,OAAOA,EAAa9K,QAGrB,IAAIC,EAAS0K,EAAyBE,GAAY,CACjDpJ,GAAIoJ,EAEJ7K,QAAS,CAAC,GAOX,OAHA+K,EAAoBF,GAAUjI,KAAK3C,EAAOD,QAASC,EAAQA,EAAOD,QAAS4K,GAGpE3K,EAAOD,OACf,C,OCrBA4K,EAAoBI,EAAK/K,IACxB,IAAIgL,EAAShL,GAAUA,EAAOiL,WAC7B,IAAOjL,EAAiB,QACxB,IAAM,EAEP,OADA2K,EAAoBO,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdL,EAAoBO,EAAI,CAACnL,EAASqL,KACjC,IAAI,IAAIC,KAAOD,EACXT,EAAoBW,EAAEF,EAAYC,KAASV,EAAoBW,EAAEvL,EAASsL,IAC5EvI,OAAOC,eAAehD,EAASsL,EAAK,CAAEE,YAAY,EAAMvI,IAAKoI,EAAWC,IAE1E,ECNDV,EAAoBW,EAAI,CAACE,EAAKvD,IAAUnF,OAAO6F,UAAU8C,eAAe9I,KAAK6I,EAAKvD,GCClF0C,EAAoBe,EAAK3L,IACH,oBAAX4L,QAA0BA,OAAOC,aAC1C9I,OAAOC,eAAehD,EAAS4L,OAAOC,YAAa,CAAE3G,MAAO,WAE7DnC,OAAOC,eAAehD,EAAS,aAAc,CAAEkF,OAAO,GAAO,ECFpC0F,EAAoB,K","sources":["webpack://geonorge/webpack/universalModuleDefinition","webpack://geonorge/../node_modules/css-loader/dist/runtime/api.js","webpack://geonorge/../node_modules/super-custom-elements/src/listen.ts","webpack://geonorge/../node_modules/super-custom-elements/src/watch.ts","webpack://geonorge/./stories/gn-input/gn-input.ts","webpack://geonorge/../node_modules/super-custom-elements/src/util.ts","webpack://geonorge/../node_modules/super-custom-elements/src/index.ts","webpack://geonorge/../node_modules/super-custom-elements/src/helpers.ts","webpack://geonorge/../node_modules/super-custom-elements/src/custom-element.ts","webpack://geonorge/./stories/gn-input/gn-input.scss","webpack://geonorge/../node_modules/super-custom-elements/src/toggle.ts","webpack://geonorge/../node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://geonorge/./functions/guiHelpers.ts","webpack://geonorge/./stories/gn-input/gn-input.html","webpack://geonorge/../node_modules/super-custom-elements/src/prop.ts","webpack://geonorge/../node_modules/super-custom-elements/src/component.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\"][\"GnInput\"] = factory();\n})(self, () => {\nreturn ","\"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};","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 } 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};","// Dependencies\nimport {\n Component,\n CustomElement,\n CustomElementOptions,\n Prop,\n Toggle,\n Watch,\n getShadowRootElement\n} from \"super-custom-elements\";\n\n// Helpers\nimport { addGlobalStylesheet } from \"../../functions/guiHelpers\";\n\n// Stylesheets\nimport style from \"./gn-input.scss\";\n\ninterface GnInputOptions extends CustomElementOptions {}\n\n@Component({\n tag: \"gn-input\",\n template: import(\"./gn-input.html\")\n})\nexport class GnInput extends CustomElement {\n @Toggle() block: boolean;\n @Toggle() fullwidth: boolean;\n @Prop() width: string;\n\n constructor() {\n super();\n addGlobalStylesheet(\"gn-input-styles\", style);\n }\n\n @Watch(\"width\")\n widthChanged() {\n const inputContainerElement = getShadowRootElement(this, \"#input-container\");\n inputContainerElement.style.width = this.width;\n }\n\n setup(options?: GnInputOptions): void {}\n}\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","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';","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};","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","// 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, `gn-input[width] input[type=text],gn-input[width] input[type=number],gn-input[width] input[type=email],gn-input[width] input[type=tel],gn-input[width] input[type=date],gn-input[width] input[type=datetime-local],gn-input[width] input[type=time],gn-input[width] input[type=url],gn-input[width] input[type=search],gn-input[width] input[type=password],gn-input[width] input:not([type]){width:100%}gn-input input[type=text],gn-input input[type=number],gn-input input[type=email],gn-input input[type=tel],gn-input input[type=date],gn-input input[type=datetime-local],gn-input input[type=time],gn-input input[type=url],gn-input input[type=search],gn-input input[type=password],gn-input input:not([type]){-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-border-radius:4px;border-radius:4px;box-sizing:border-box;font-family:\"Open Sans\",sans-serif;font-size:16px;font-size:12pt;padding:0 8px;height:32px;box-shadow:none;position:relative;z-index:1}gn-input input[type=text]:not(:disabled),gn-input input[type=number]:not(:disabled),gn-input input[type=email]:not(:disabled),gn-input input[type=tel]:not(:disabled),gn-input input[type=date]:not(:disabled),gn-input input[type=datetime-local]:not(:disabled),gn-input input[type=time]:not(:disabled),gn-input input[type=url]:not(:disabled),gn-input input[type=search]:not(:disabled),gn-input input[type=password]:not(:disabled),gn-input input:not([type]):not(:disabled){background-color:#fff;border:1px solid #d8d8d8;color:#2f3940}gn-input input[type=text]:disabled,gn-input input[type=number]:disabled,gn-input input[type=email]:disabled,gn-input input[type=tel]:disabled,gn-input input[type=date]:disabled,gn-input input[type=datetime-local]:disabled,gn-input input[type=time]:disabled,gn-input input[type=url]:disabled,gn-input input[type=search]:disabled,gn-input input[type=password]:disabled,gn-input input:not([type]):disabled{background-color:#f4f4f4;color:#707070;border:1px solid #dedede;cursor:not-allowed}gn-input input[type=checkbox],gn-input input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:2px solid #2f3940;font:inherit;color:currentColor;width:16px;height:16px;margin:0 6px 0 0}gn-input input[type=checkbox]:checked,gn-input input[type=radio]:checked{border-color:#3767c7}gn-input input[type=checkbox]:focus-visible,gn-input input[type=radio]:focus-visible{outline:max(2px,.1em) solid #3767c7;outline-offset:max(2px,.1em)}gn-input input[type=checkbox]{-webkit-border-radius:3px;border-radius:3px;vertical-align:text-top}gn-input input[type=checkbox]:checked::before{background-color:#3767c7;content:\"✓\";line-height:13px;color:#fff;display:inline-block;vertical-align:top;width:100%}gn-input input[type=checkbox]:disabled{background-color:#dedede;border-color:#dedede;cursor:not-allowed}gn-input input[type=checkbox]:disabled:checked::before{background-color:#dedede;color:#707070}gn-input input[type=radio]{-webkit-border-radius:50%;border-radius:50%;transform:translateY(-0.075em);display:inline-grid;place-content:center}gn-input 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}gn-input input[type=radio]:checked::before{background-color:#3767c7;transform:scale(1)}gn-input input[type=radio]:disabled{border-color:#dedede}gn-input input[type=radio]:disabled:checked::before{background-color:#dedede;transform:scale(1)}gn-input[block]{display:block}gn-input:not([block]){display:inline-block}gn-input[fullwidth]{display:block}gn-input[fullwidth] input{width:100%}`, \"\",{\"version\":3,\"sources\":[\"webpack://./stories/gn-input/gn-input.scss\",\"webpack://./style/variables/_typography.scss\",\"webpack://./style/variables/_colors.scss\"],\"names\":[],\"mappings\":\"AAAA,6XAIQ,UAWI,CAAA,gTAGR,uBAWwB,CAAA,oBAAA,CAAA,eAAA,CAAA,yBACG,CAAA,iBAAA,CAAA,qBACvB,CAAA,kCC/BO,CAAA,cDiCP,CAAA,cACA,CAAA,aACA,CAAA,WACA,CAAA,eACA,CAAA,iBACA,CAAA,SACA,CAAA,qdACA,qBACI,CAAA,wBACA,CAAA,aEnCE,CAAA,mZFsCN,wBEbc,CAAA,aAEN,CAAA,wBFcJ,CAAA,kBACA,CAAA,yDAGR,uBAEwB,CAAA,oBAAA,CAAA,eAAA,CAAA,wBACpB,CAAA,YACA,CAAA,kBACA,CAAA,UACA,CAAA,WACA,CAAA,gBACA,CAAA,yEACA,oBE9CO,CAAA,qFFiDP,mCACI,CAAA,4BACA,CAAA,8BAGR,yBAC2B,CAAA,iBAAA,CAAA,uBACvB,CAAA,8CAEI,wBE1DG,CAAA,WF4DC,CAAA,gBACA,CAAA,UACA,CAAA,oBACA,CAAA,kBACA,CAAA,UACA,CAAA,uCAGR,wBElDU,CAAA,oBAAA,CAAA,kBFqDN,CAAA,uDAEI,wBEvDE,CAAA,aACF,CAAA,2BF6DZ,yBAC2B,CAAA,iBAAA,CAAA,8BACvB,CAAA,mBACA,CAAA,oBACA,CAAA,mCACA,yBAC2B,CAAA,iBAAA,CAAA,UACvB,CAAA,SACA,CAAA,UACA,CAAA,kBACA,CAAA,sCACA,CAAA,2CAGA,wBE9FG,CAAA,kBFgGC,CAAA,oCAGR,oBEjFU,CAAA,oDFoFF,wBEpFE,CAAA,kBFsFE,CAAA,gBAMhB,aACI,CAAA,sBAEJ,oBACI,CAAA,oBAEJ,aACI,CAAA,0BACA,UACI\",\"sourcesContent\":[\"@import \\\"../../style/all\\\";\\n\\ngn-input {\\n &[width] {\\n input[type=\\\"text\\\"],\\n input[type=\\\"number\\\"],\\n input[type=\\\"email\\\"],\\n input[type=\\\"tel\\\"],\\n input[type=\\\"date\\\"],\\n input[type=\\\"datetime-local\\\"],\\n input[type=\\\"time\\\"],\\n input[type=\\\"url\\\"],\\n input[type=\\\"search\\\"],\\n input[type=\\\"password\\\"],\\n input:not([type]) {\\n width: 100%;\\n }\\n }\\n input[type=\\\"text\\\"],\\n input[type=\\\"number\\\"],\\n input[type=\\\"email\\\"],\\n input[type=\\\"tel\\\"],\\n input[type=\\\"date\\\"],\\n input[type=\\\"datetime-local\\\"],\\n input[type=\\\"time\\\"],\\n input[type=\\\"url\\\"],\\n input[type=\\\"search\\\"],\\n input[type=\\\"password\\\"],\\n input:not([type]) {\\n @include appearance(none);\\n @include border-radius(4px);\\n box-sizing: border-box;\\n font-family: $default-font;\\n font-size: 16px;\\n font-size: 12pt;\\n padding: 0 8px;\\n height: 32px;\\n box-shadow: none;\\n position: relative;\\n z-index: 1;\\n &:not(:disabled) {\\n background-color: #fff;\\n border: 1px solid $default-border;\\n color: $default-text;\\n }\\n &:disabled {\\n background-color: $disabled-background;\\n color: $disabled-text;\\n border: 1px solid $disabled-border;\\n cursor: not-allowed;\\n }\\n }\\n input[type=\\\"checkbox\\\"],\\n input[type=\\\"radio\\\"] {\\n @include appearance(none);\\n border: 2px solid $default-text;\\n font: inherit;\\n color: currentColor;\\n width: 16px;\\n height: 16px;\\n margin: 0 6px 0 0;\\n &:checked {\\n border-color: $primary-text;\\n }\\n &:focus-visible {\\n outline: max(2px, 0.1em) solid $primary-text;\\n outline-offset: max(2px, 0.1em);\\n }\\n }\\n input[type=\\\"checkbox\\\"] {\\n @include border-radius(3px);\\n vertical-align: text-top;\\n &:checked {\\n &::before {\\n background-color: $primary-text;\\n content: \\\"✓\\\";\\n line-height: 13px;\\n color: #fff;\\n display: inline-block;\\n vertical-align: top;\\n width: 100%;\\n }\\n }\\n &:disabled {\\n background-color: $disabled-border;\\n border-color: $disabled-border;\\n cursor: not-allowed;\\n &:checked {\\n &::before {\\n background-color: $disabled-border;\\n color: $disabled-text;\\n }\\n }\\n }\\n }\\n input[type=\\\"radio\\\"] {\\n @include border-radius(50%);\\n transform: translateY(-0.075em);\\n display: inline-grid;\\n place-content: center;\\n &::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 &:checked {\\n &::before {\\n background-color: $primary-text;\\n transform: scale(1);\\n }\\n }\\n &:disabled {\\n border-color: $disabled-border;\\n &:checked {\\n &::before {\\n background-color: $disabled-border;\\n transform: scale(1);\\n }\\n }\\n }\\n }\\n\\n &[block] {\\n display: block;\\n }\\n &:not([block]) {\\n display: inline-block;\\n }\\n &[fullwidth] {\\n display: block;\\n input {\\n width: 100%;\\n }\\n }\\n}\\n\",\"$default-font: \\\"Open Sans\\\", sans-serif;\\n$header-font: \\\"Raleway\\\", sans-serif;\\n$default-font-size: 15px;\\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: #3767C7;\\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\\n\\n$light-green: #8fff33;\\n$light-yellow: #ffEb3b;\\n$light-red: #ff4a2e;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\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","\"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};","export const getFocusableElementsInsideElement = (element: HTMLElement) => {\n return element.querySelectorAll('button, [href], input, [tabindex=\"0\"]');\n};\n\nexport const addGlobalStylesheet = (styleElementId: string, styles: string) => {\n const style = document.createElement(\"style\");\n style.setAttribute(\"id\", styleElementId);\n style.textContent = styles;\n if (!document.getElementById(styleElementId)) {\n document.head.appendChild(style);\n }\n};\n\nexport const removeInnerHTML = (element: HTMLElement) => {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n};\n","export default \"<template>\\n <div id=\\\"input-container\\\" class=\\\"input-container\\\">\\n <slot></slot>\\n </div>\\n</template>\\n\";","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 { 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","// 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__(1534);\n"],"names":["root","factory","exports","module","define","amd","self","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","alreadyImportedModules","k","id","_k","push","Listen","eventName","selector","target","methodName","constructor","listeners","handler","addEventListeners","targetRoot","shadowRoot","listener","eventTarget","querySelector","addEventListener","e","call","Dispatch","propertyName","Object","defineProperty","get","emit","options","evtName","toDotCase","dispatchEvent","CustomEvent","Watch","attrName","watchAttributes","toKebabCase","propsInit","GnInput","CustomElement","super","addGlobalStylesheet","widthChanged","getShadowRootElement","style","width","setup","Toggle","Prop","Component","tag","template","str","replace","toLowerCase","toCamelCase","m","toUpperCase","tryParseInt","value","parseInt","NaN","parseFloat","getElement","document","customElement","HTMLElement","connect","isConnected","appendChild","___CSS_LOADER_EXPORT___","propName","hasAttribute","attrValue","getAttribute","test","set","oldValue","console","warn","__connected","props","setAttribute","removeAttribute","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","getFocusableElementsInsideElement","element","querySelectorAll","styleElementId","styles","createElement","textContent","getElementById","head","removeInnerHTML","firstChild","removeChild","onAttributeChange","initializeProps","prop","plainAttributes","keys","forEach","v","cycleProps","getProps","attribValue","new","args","prototype","name","showShadowRoot","shadow","attachShadow","mode","observedAttributes","x","attributeChangedCallback","newValue","methodToCall","old","connectedCallback","render","innerHTML","getStyle","Promise","getExternalTemplate","cloneNode","markup","default","fragment","createRange","createContextualFragment","children","nodeName","css","ready","resolve","_","customElements","__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":"GnInput.js","mappings":"CAAA,S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e9G,IAAIwB,IACtBsF,eAAe7J,OAAOuE,EAAKe,GAGtBA,CAAa,C,kECxGpBwE,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqB5I,IAAjB6I,EACH,OAAOA,EAAanK,QAGrB,IAAIC,EAAS+J,EAAyBE,GAAY,CACjDzI,GAAIyI,EAEJlK,QAAS,CAAC,GAOX,OAHAoK,EAAoBF,GAAUtH,KAAK3C,EAAOD,QAASC,EAAQA,EAAOD,QAASiK,GAGpEhK,EAAOD,OACf,C,OCrBAiK,EAAoBI,EAAKpK,IACxB,IAAIqK,EAASrK,GAAUA,EAAOsK,WAC7B,IAAOtK,EAAiB,QACxB,IAAM,EAEP,OADAgK,EAAoBO,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdL,EAAoBO,EAAI,CAACxK,EAAS0K,KACjC,IAAI,IAAIC,KAAOD,EACXT,EAAoBW,EAAEF,EAAYC,KAASV,EAAoBW,EAAE5K,EAAS2K,IAC5E5H,OAAOC,eAAehD,EAAS2K,EAAK,CAAEE,YAAY,EAAM5H,IAAKyH,EAAWC,IAE1E,ECNDV,EAAoBW,EAAI,CAACE,EAAKzD,IAAUtE,OAAOgF,UAAUgD,eAAenI,KAAKkI,EAAKzD,GCClF4C,EAAoBe,EAAKhL,IACH,oBAAXiL,QAA0BA,OAAOC,aAC1CnI,OAAOC,eAAehD,EAASiL,OAAOC,YAAa,CAAEhG,MAAO,WAE7DnC,OAAOC,eAAehD,EAAS,aAAc,CAAEkF,OAAO,GAAO,ECFpC+E,EAAoB,K","sources":["webpack://geonorge/webpack/universalModuleDefinition","webpack://geonorge/../node_modules/css-loader/dist/runtime/api.js","webpack://geonorge/../node_modules/super-custom-elements/src/listen.ts","webpack://geonorge/./stories/gn-input/template.scss","webpack://geonorge/../node_modules/super-custom-elements/src/watch.ts","webpack://geonorge/./stories/gn-input/gn-input.ts","webpack://geonorge/../node_modules/super-custom-elements/src/util.ts","webpack://geonorge/../node_modules/super-custom-elements/src/index.ts","webpack://geonorge/../node_modules/super-custom-elements/src/helpers.ts","webpack://geonorge/../node_modules/super-custom-elements/src/custom-element.ts","webpack://geonorge/../node_modules/super-custom-elements/src/toggle.ts","webpack://geonorge/../node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://geonorge/./stories/gn-input/gn-input.html","webpack://geonorge/../node_modules/super-custom-elements/src/prop.ts","webpack://geonorge/../node_modules/super-custom-elements/src/component.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\"][\"GnInput\"] = factory();\n})(self, () => {\nreturn ","\"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};","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 };","// 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, `:host([block]){display:block}:host(:not([block])){display:inline-block}:host([fullwidth]){display:block}:host([fullwidth]) ::slotted(input){width:100%}:host([width]) ::slotted(input[type=text]),:host([width]) ::slotted(input[type=number]),:host([width]) ::slotted(input[type=email]),:host([width]) ::slotted(input[type=tel]),:host([width]) ::slotted(input[type=date]),:host([width]) ::slotted(input[type=datetime-local]),:host([width]) ::slotted(input[type=time]),:host([width]) ::slotted(input[type=url]),:host([width]) ::slotted(input[type=search]),:host([width]) ::slotted(input[type=password]),:host([width]) ::slotted(input:not([type])){width:100%}::slotted(input[type=text]),::slotted(input[type=number]),::slotted(input[type=email]),::slotted(input[type=tel]),::slotted(input[type=date]),::slotted(input[type=datetime-local]),::slotted(input[type=time]),::slotted(input[type=url]),::slotted(input[type=search]),::slotted(input[type=password]),::slotted(input:not([type])){-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-border-radius:4px;border-radius:4px;box-sizing:border-box;font-family:\"Open Sans\",sans-serif;font-size:16px;font-size:12pt;padding:0 8px;height:32px;box-shadow:none;position:relative;z-index:1;background-color:#fff;border:1px solid #d8d8d8;color:#2f3940}::slotted(input[type=text]:disabled),::slotted(input[type=number]:disabled),::slotted(input[type=email]:disabled),::slotted(input[type=tel]:disabled),::slotted(input[type=date]:disabled),::slotted(input[type=datetime-local]:disabled),::slotted(input[type=time]:disabled),::slotted(input[type=url]:disabled),::slotted(input[type=search]:disabled),::slotted(input[type=password]:disabled),::slotted(input:not([type]):disabled){background-color:#f4f4f4;color:#707070;border:1px solid #dedede;cursor:not-allowed}::slotted(input[type=checkbox]),::slotted(input[type=radio]){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:2px solid #2f3940;font:inherit;color:currentColor;width:16px;height:16px;margin:0 6px 0 0}::slotted(input[type=checkbox]:checked),::slotted(input[type=radio]:checked){border-color:#3767c7}::slotted(input[type=checkbox]:focus-visible),::slotted(input[type=radio]:focus-visible){outline:max(2px,.1em) solid #3767c7;outline-offset:max(2px,.1em)}::slotted(input[type=checkbox]){-webkit-border-radius:3px;border-radius:3px;vertical-align:text-top}::slotted(input[type=checkbox]:checked)::before{background-color:#3767c7;content:\"✓\";line-height:13px;color:#fff;display:inline-block;vertical-align:top;width:100%}::slotted(input[type=checkbox]:disabled){background-color:#dedede;border-color:#dedede;cursor:not-allowed}::slotted(input[type=checkbox]:checked:disabled)::before{background-color:#dedede;color:#707070}::slotted(input[type=radio]){-webkit-border-radius:50%;border-radius:50%;transform:translateY(-0.075em);display:inline-grid;place-content:center}::slotted(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}::slotted(input[type=radio]:checked)::before{background-color:#3767c7;transform:scale(1)}::slotted(input[type=radio]:disabled){border-color:#dedede}::slotted(input[type=radio]:checked:disabled)::before{background-color:#dedede;transform:scale(1)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./stories/gn-input/template.scss\",\"webpack://./style/variables/_typography.scss\",\"webpack://./style/variables/_colors.scss\"],\"names\":[],\"mappings\":\"AAAA,eAKA,aACI,CAAA,qBAGJ,oBACI,CAAA,mBAGJ,aACI,CAAA,oCACA,UACI,CAAA,2eAKJ,UAWI,CAAA,sUAIR,uBAWmC,CAAA,oBAAA,CAAA,eAAA,CAAA,yBACM,CAAA,iBAAA,CAAA,qBACrC,CAAA,kCCjDW,CAAA,cDmDX,CAAA,cACA,CAAA,aACA,CAAA,WACA,CAAA,eACA,CAAA,iBACA,CAAA,SACA,CAAA,qBACA,CAAA,wBACA,CAAA,aEpDU,CAAA,yaFwDd,wBE/BsB,CAAA,aAEN,CAAA,wBF0CZ,CAAA,kBACA,CAAA,6DAGJ,uBAEmC,CAAA,oBAAA,CAAA,eAAA,CAAA,wBAC/B,CAAA,YACA,CAAA,kBACA,CAAA,UACA,CAAA,WACA,CAAA,gBACA,CAAA,6EAGJ,oBE5Ee,CAAA,yFFiFf,mCAEI,CAAA,4BACA,CAAA,gCAGJ,yBACyC,CAAA,iBAAA,CAAA,uBACrC,CAAA,gDAIA,wBE7FW,CAAA,WF+FP,CAAA,gBACA,CAAA,UACA,CAAA,oBACA,CAAA,kBACA,CAAA,UACA,CAAA,yCAIR,wBEtFkB,CAAA,oBAAA,CAAA,kBFyFd,CAAA,yDAIA,wBE7Fc,CAAA,aACF,CAAA,6BFkGhB,yBACyC,CAAA,iBAAA,CAAA,8BACrC,CAAA,mBACA,CAAA,oBACA,CAAA,qCACA,yBACyC,CAAA,iBAAA,CAAA,UACrC,CAAA,SACA,CAAA,UACA,CAAA,kBACA,CAAA,sCACA,CAAA,6CAKJ,wBErIW,CAAA,kBFuIP,CAAA,sCAIR,oBEzHkB,CAAA,sDF8Hd,wBE9Hc,CAAA,kBFgIV\",\"sourcesContent\":[\"@use \\\"../../style/mixins/appearance\\\";\\n@use \\\"../../style/mixins/border-radius\\\";\\n@use \\\"../../style/variables/colors\\\";\\n@use \\\"../../style/variables/typography\\\";\\n\\n:host([block]) {\\n display: block;\\n}\\n\\n:host(:not([block])) {\\n display: inline-block;\\n}\\n\\n:host([fullwidth]) {\\n display: block;\\n ::slotted(input) {\\n width: 100%;\\n }\\n}\\n\\n:host([width]) {\\n ::slotted(input[type=\\\"text\\\"]),\\n ::slotted(input[type=\\\"number\\\"]),\\n ::slotted(input[type=\\\"email\\\"]),\\n ::slotted(input[type=\\\"tel\\\"]),\\n ::slotted(input[type=\\\"date\\\"]),\\n ::slotted(input[type=\\\"datetime-local\\\"]),\\n ::slotted(input[type=\\\"time\\\"]),\\n ::slotted(input[type=\\\"url\\\"]),\\n ::slotted(input[type=\\\"search\\\"]),\\n ::slotted(input[type=\\\"password\\\"]),\\n ::slotted(input:not([type])) {\\n width: 100%;\\n }\\n}\\n\\n::slotted(input[type=\\\"text\\\"]),\\n::slotted(input[type=\\\"number\\\"]),\\n::slotted(input[type=\\\"email\\\"]),\\n::slotted(input[type=\\\"tel\\\"]),\\n::slotted(input[type=\\\"date\\\"]),\\n::slotted(input[type=\\\"datetime-local\\\"]),\\n::slotted(input[type=\\\"time\\\"]),\\n::slotted(input[type=\\\"url\\\"]),\\n::slotted(input[type=\\\"search\\\"]),\\n::slotted(input[type=\\\"password\\\"]),\\n::slotted(input:not([type])) {\\n @include appearance.appearance(none);\\n @include border-radius.border-radius(4px);\\n box-sizing: border-box;\\n font-family: typography.$default-font;\\n font-size: 16px;\\n font-size: 12pt;\\n padding: 0 8px;\\n height: 32px;\\n box-shadow: none;\\n position: relative;\\n z-index: 1;\\n background-color: #fff;\\n border: 1px solid colors.$default-border;\\n color: colors.$default-text;\\n}\\n\\n::slotted(input[type=\\\"text\\\"]:disabled),\\n::slotted(input[type=\\\"number\\\"]:disabled),\\n::slotted(input[type=\\\"email\\\"]:disabled),\\n::slotted(input[type=\\\"tel\\\"]:disabled),\\n::slotted(input[type=\\\"date\\\"]:disabled),\\n::slotted(input[type=\\\"datetime-local\\\"]:disabled),\\n::slotted(input[type=\\\"time\\\"]:disabled),\\n::slotted(input[type=\\\"url\\\"]:disabled),\\n::slotted(input[type=\\\"search\\\"]:disabled),\\n::slotted(input[type=\\\"password\\\"]:disabled),\\n::slotted(input:not([type]):disabled) {\\n background-color: colors.$disabled-background;\\n color: colors.$disabled-text;\\n border: 1px solid colors.$disabled-border;\\n cursor: not-allowed;\\n}\\n\\n::slotted(input[type=\\\"checkbox\\\"]),\\n::slotted(input[type=\\\"radio\\\"]) {\\n @include appearance.appearance(none);\\n border: 2px solid colors.$default-text;\\n font: inherit;\\n color: currentColor;\\n width: 16px;\\n height: 16px;\\n margin: 0 6px 0 0;\\n}\\n\\n::slotted(input[type=\\\"checkbox\\\"]:checked),\\n::slotted(input[type=\\\"radio\\\"]:checked) {\\n border-color: colors.$primary-text;\\n}\\n\\n::slotted(input[type=\\\"checkbox\\\"]:focus-visible),\\n::slotted(input[type=\\\"radio\\\"]:focus-visible) {\\n outline: max(2px, 0.1em) solid colors.$primary-text;\\n outline-offset: max(2px, 0.1em);\\n}\\n\\n::slotted(input[type=\\\"checkbox\\\"]) {\\n @include border-radius.border-radius(3px);\\n vertical-align: text-top;\\n}\\n\\n::slotted(input[type=\\\"checkbox\\\"]:checked) {\\n &::before {\\n background-color: colors.$primary-text;\\n content: \\\"✓\\\";\\n line-height: 13px;\\n color: #fff;\\n display: inline-block;\\n vertical-align: top;\\n width: 100%;\\n }\\n}\\n\\n::slotted(input[type=\\\"checkbox\\\"]:disabled) {\\n background-color: colors.$disabled-border;\\n border-color: colors.$disabled-border;\\n cursor: not-allowed;\\n}\\n\\n::slotted(input[type=\\\"checkbox\\\"]:checked:disabled) {\\n &::before {\\n background-color: colors.$disabled-border;\\n color: colors.$disabled-text;\\n }\\n}\\n\\n::slotted(input[type=\\\"radio\\\"]) {\\n @include border-radius.border-radius(50%);\\n transform: translateY(-0.075em);\\n display: inline-grid;\\n place-content: center;\\n &::before {\\n @include border-radius.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\\n::slotted(input[type=\\\"radio\\\"]:checked) {\\n &::before {\\n background-color: colors.$primary-text;\\n transform: scale(1);\\n }\\n}\\n\\n::slotted(input[type=\\\"radio\\\"]:disabled) {\\n border-color: colors.$disabled-border;\\n}\\n\\n::slotted(input[type=\\\"radio\\\"]:checked:disabled) {\\n &::before {\\n background-color: colors.$disabled-border;\\n transform: scale(1);\\n }\\n}\\n\",\"$default-font: \\\"Open Sans\\\", sans-serif;\\n$header-font: \\\"Raleway\\\", sans-serif;\\n$default-font-size: 15px;\\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: #3767C7;\\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\\n\\n$light-green: #8fff33;\\n$light-yellow: #ffEb3b;\\n$light-red: #ff4a2e;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\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};","// Dependencies\nimport {\n Component,\n CustomElement,\n CustomElementOptions,\n Prop,\n Toggle,\n Watch,\n getShadowRootElement\n} from \"super-custom-elements\";\n\ninterface GnInputOptions extends CustomElementOptions {}\n\n@Component({\n tag: \"gn-input\",\n template: import(\"./gn-input.html\"),\n style: import(\"./template.scss\")\n})\nexport class GnInput extends CustomElement {\n @Toggle() block: boolean;\n @Toggle() fullwidth: boolean;\n @Prop() width: string;\n\n constructor() {\n super();\n }\n\n @Watch(\"width\")\n widthChanged() {\n const inputContainerElement = getShadowRootElement(this, \"#input-container\");\n inputContainerElement.style.width = this.width;\n }\n\n setup(options?: GnInputOptions): void {}\n}\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","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';","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};","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","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","\"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};","export default \"<template>\\n <div id=\\\"input-container\\\" class=\\\"input-container\\\">\\n <slot></slot>\\n </div>\\n</template>\\n\";","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 { 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","// 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__(1534);\n"],"names":["root","factory","exports","module","define","amd","self","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","alreadyImportedModules","k","id","_k","push","Listen","eventName","selector","target","methodName","constructor","listeners","handler","addEventListeners","targetRoot","shadowRoot","listener","eventTarget","querySelector","addEventListener","e","call","Dispatch","propertyName","Object","defineProperty","get","emit","options","evtName","toDotCase","dispatchEvent","CustomEvent","___CSS_LOADER_EXPORT___","Watch","attrName","watchAttributes","toKebabCase","propsInit","GnInput","CustomElement","super","widthChanged","getShadowRootElement","style","width","setup","Toggle","Prop","Component","tag","template","str","replace","toLowerCase","toCamelCase","m","toUpperCase","tryParseInt","value","parseInt","NaN","parseFloat","getElement","document","customElement","HTMLElement","connect","isConnected","appendChild","propName","hasAttribute","attrValue","getAttribute","test","set","oldValue","console","warn","__connected","props","setAttribute","removeAttribute","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","onAttributeChange","initializeProps","prop","plainAttributes","keys","forEach","v","cycleProps","getProps","attribValue","new","args","prototype","name","showShadowRoot","shadow","attachShadow","mode","observedAttributes","x","attributeChangedCallback","newValue","methodToCall","old","connectedCallback","render","createElement","innerHTML","getStyle","Promise","getExternalTemplate","cloneNode","markup","default","fragment","createRange","createContextualFragment","children","nodeName","firstChild","css","ready","resolve","_","customElements","__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/GnLabel.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.GnLabel=t())}(self,(()=>(()=>{"use strict";var e={164:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(a[c]=!0)}for(var l=0;l<e.length;l++){var u=[].concat(e[l]);o&&a[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),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),t.push(u))}},t}},169:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dispatch=t.addEventListeners=t.Listen=void 0;const o=n(2466);t.Listen=(e,t)=>(n,o)=>{n.constructor.listeners||(n.constructor.listeners=[]),n.constructor.listeners.push({selector:t,eventName:e,handler:n[o]})},t.addEventListeners=e=>{if(e.constructor.listeners){const t=e.shadowRoot||e;for(const n of e.constructor.listeners){const o=n.selector?t.querySelector(n.selector)?t.querySelector(n.selector):null:e;o&&o.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(r){const s=e||o.toDotCase(n);t.dispatchEvent(new CustomEvent(s,r))}}}})}},1063:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;const o=n(2466);t.Watch=e=>(t,n)=>{t.constructor.watchAttributes||(t.constructor.watchAttributes={}),t.constructor.watchAttributes[o.toKebabCase(e)]=n,t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[e]=null}},1830:function(e,t,n){var o,r=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),s=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,n,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__importStar||(o=function(e){return o=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},o(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=o(e),a=0;a<n.length;a++)"default"!==n[a]&&r(t,e,n[a]);return s(t,e),t}),c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GnLabel=void 0;const l=n(3128),u=n(5979),d=c(n(4546));let p=class extends l.CustomElement{constructor(){super(),(0,u.addGlobalStylesheet)("gn-label-styles",d.default)}setup(e){}};t.GnLabel=p,a([(0,l.Toggle)()],p.prototype,"block",void 0),t.GnLabel=p=a([(0,l.Component)({tag:"gn-label",template:Promise.resolve().then((()=>i(n(4672))))})],p)},2466:(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},3128:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8631),t),r(n(3704),t),r(n(3365),t),r(n(169),t),r(n(6999),t),r(n(3982),t),r(n(8861),t),r(n(1063),t)},3365:(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)},3704:(e,t)=>{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},3982:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Toggle=void 0;const o=n(2466);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(o.toKebabCase(t))||(this.constructor.propsInit[t]=e)}})}},4546:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var o=n(5052),r=n.n(o),s=n(164),a=n.n(s)()(r());a.push([e.id,'gn-label{font-family:"Open Sans",sans-serif;color:#2f3940;font-size:1em;line-height:1.5em;min-height:21px;font-weight:bold}gn-label[block]{display:block;margin-bottom:.4em}gn-label:not([block]){display:inline-block}gn-label:not([block])+gn-input:not([block]),gn-label:not([block])+gn-select:not([block]),gn-label:not([block])+gn-textarea:not([block]){margin-left:.5em}',"",{version:3,sources:["webpack://./stories/gn-label/gn-label.scss","webpack://./style/variables/_typography.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAEA,SACI,kCCHW,CDIX,aEGU,CFFV,aAAA,CACA,iBAAA,CACA,eAAA,CACA,gBAAA,CACA,gBACI,aAAA,CACA,kBAAA,CAEJ,sBACI,oBAAA,CACA,wIAGI,gBAAA",sourcesContent:['@import "../../style/all";\n\ngn-label {\n font-family: $default-font;\n color: $default-text;\n font-size: 1em;\n line-height: 1.5em;\n min-height: 21px;\n font-weight: bold; \n &[block] {\n display: block;\n margin-bottom: 0.4em;\n }\n &:not([block]) {\n display: inline-block;\n & + gn-input:not([block]),\n & + gn-select:not([block]),\n & + gn-textarea:not([block]) {\n margin-left: 0.5em;\n }\n }\n}\n','$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;\n$default-font-size: 15px;\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: #3767C7;\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\n\n$light-green: #8fff33;\n$light-yellow: #ffEb3b;\n$light-red: #ff4a2e;\n"],sourceRoot:""}]);const i=a},4672:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});const o="<template>\n <slot></slot>\n</template>\n"},5052:e=>{e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),s="/*# ".concat(r," */");return[t].concat([s]).join("\n")}return[t].join("\n")}},5979:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeInnerHTML=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)},t.removeInnerHTML=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)}},6999:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initializeProps=t.Prop=void 0;const o=n(2466);t.Prop=()=>(e,t)=>{const n=o.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 r=this.props[t];this.props[t]=o.tryParseInt(e),"object"!=typeof e?this.setAttribute(n,e):this.onAttributeChange(n,r,e,!1)}else this.hasAttribute(o.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 o=Object.assign(Object.assign({},n),e.constructor.propsInit);return Object.keys(o)})(e)){if(t)if(null==t[o.toKebabCase(n)])t[o.toKebabCase(n)]="";else{const r=e.props[n]||e.getAttribute(o.toKebabCase(n));"function"==typeof e[t[n]]&&e[t[n]]({new:r})}e.constructor.propsInit[n]&&(e.hasAttribute(o.toKebabCase(n))||(e[n]=e.constructor.propsInit[n]))}}},8631:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,s){function a(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const r=n(169),s=n(6999),a=n(2466);t.Component=e=>t=>{var n;const i=e.tag||a.toKebabCase(t.prototype.constructor.name),c=((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=>a.toKebabCase(e)))}attributeChangedCallback(e,t,n){this.onAttributeChange(e,t,n)}onAttributeChange(e,t,n,o=!0){if(t!=n){o&&(this[a.toCamelCase(e)]=n);const r=this.constructor.watchAttributes;if(r&&r[e]){const o=r[e];this.__connected&&"function"==typeof this[o]&&this[o]({old:t,new:n})}}}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return o(this,void 0,void 0,(function*(){yield this.render(),e.connectedCallback&&e.connectedCallback.call(this),this.__connected=!0,r.addEventListeners(this),s.initializeProps(this)}))}render(){return o(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 o(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 o(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(i)||customElements.define(i,c),c}},8861:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var s=t[o]={id:o,exports:{}};return e[o].call(s.exports,s,s.exports,n),s.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 o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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(1830)})()));
|
|
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.GnLabel=e())}(self,(()=>(()=>{"use strict";var t={164:t=>{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,r,s){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(o)for(var c=0;c<this.length;c++){var i=this[c][0];null!=i&&(a[i]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);o&&a[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),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},169:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Dispatch=e.addEventListeners=e.Listen=void 0;const o=n(2466);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(r){const s=t||o.toDotCase(n);e.dispatchEvent(new CustomEvent(s,r))}}}})}},1063:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Watch=void 0;const o=n(2466);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}},1830:function(t,e,n){var o,r=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,o,r)}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__decorate||function(t,e,n,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},c=this&&this.__importStar||(o=function(t){return o=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[e.length]=n);return e},o(t)},function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n=o(t),a=0;a<n.length;a++)"default"!==n[a]&&r(e,t,n[a]);return s(e,t),e});Object.defineProperty(e,"__esModule",{value:!0}),e.GnLabel=void 0;const i=n(3128);let l=class extends i.CustomElement{constructor(){super()}setup(t){}};e.GnLabel=l,a([(0,i.Toggle)()],l.prototype,"block",void 0),e.GnLabel=l=a([(0,i.Component)({tag:"gn-label",template:Promise.resolve().then((()=>c(n(4672)))),style:Promise.resolve().then((()=>c(n(2014))))})],l)},2014:(t,e,n)=>{n.r(e),n.d(e,{default:()=>c});var o=n(5052),r=n.n(o),s=n(164),a=n.n(s)()(r());a.push([t.id,':host{font-family:"Open Sans",sans-serif;color:#2f3940;font-size:1em;line-height:1.5em;min-height:21px;font-weight:bold}:host(:not([block])){display:inline-block}:host(:not([block])) ::slotted(gn-input:not([block])),:host(:not([block])) ::slotted(gn-select:not([block])),:host(:not([block])) ::slotted(gn-textarea:not([block])){margin-left:.5em}:host([block]){display:block;margin-bottom:.4em}',"",{version:3,sources:["webpack://./stories/gn-label/template.scss","webpack://./style/variables/_typography.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAGA,MACI,kCCJW,CDKX,aEEU,CFDV,aAAA,CACA,iBAAA,CACA,eAAA,CACA,gBAAA,CAGJ,qBACI,oBAAA,CACA,sKAGI,gBAAA,CAIR,eACI,aAAA,CACA,kBAAA",sourcesContent:['@use "../../style/variables/colors";\n@use "../../style/variables/typography";\n\n:host {\n font-family: typography.$default-font;\n color: colors.$default-text;\n font-size: 1em;\n line-height: 1.5em;\n min-height: 21px;\n font-weight: bold;\n}\n\n:host(:not([block])) {\n display: inline-block;\n ::slotted(gn-input:not([block])),\n ::slotted(gn-select:not([block])),\n ::slotted(gn-textarea:not([block])) {\n margin-left: 0.5em;\n }\n}\n\n:host([block]) {\n display: block;\n margin-bottom: 0.4em;\n}\n','$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;\n$default-font-size: 15px;\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: #3767C7;\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\n\n$light-green: #8fff33;\n$light-yellow: #ffEb3b;\n$light-red: #ff4a2e;\n"],sourceRoot:""}]);const c=a},2466:(t,e)=>{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},3128:function(t,e,n){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]}),r=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}),r(n(8631),e),r(n(3704),e),r(n(3365),e),r(n(169),e),r(n(6999),e),r(n(3982),e),r(n(8861),e),r(n(1063),e)},3365:(t,e)=>{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)},3704:(t,e)=>{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},3982:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Toggle=void 0;const o=n(2466);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)}})}},4672:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});const o="<template>\n <slot></slot>\n</template>\n"},5052:t=>{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)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),s="/*# ".concat(r," */");return[e].concat([s]).join("\n")}return[e].join("\n")}},6999:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.initializeProps=e.Prop=void 0;const o=n(2466);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 r=this.props[e];this.props[e]=o.tryParseInt(t),"object"!=typeof t?this.setAttribute(n,t):this.onAttributeChange(n,r,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 r=t.props[n]||t.getAttribute(o.toKebabCase(n));"function"==typeof t[e[n]]&&t[e[n]]({new:r})}t.constructor.propsInit[n]&&(t.hasAttribute(o.toKebabCase(n))||(t[n]=t.constructor.propsInit[n]))}}},8631:function(t,e,n){var o=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(r,s){function a(t){try{i(o.next(t))}catch(t){s(t)}}function c(t){try{i(o.throw(t))}catch(t){s(t)}}function i(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}i((o=o.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const r=n(169),s=n(6999),a=n(2466);e.Component=t=>e=>{var n;const c=t.tag||a.toKebabCase(e.prototype.constructor.name),i=((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=>a.toKebabCase(t)))}attributeChangedCallback(t,e,n){this.onAttributeChange(t,e,n)}onAttributeChange(t,e,n,o=!0){if(e!=n){o&&(this[a.toCamelCase(t)]=n);const r=this.constructor.watchAttributes;if(r&&r[t]){const o=r[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,r.addEventListeners(this),s.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(c)||customElements.define(c,i),i}},8861:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var s=e[o]={id:o,exports:{}};return t[o].call(s.exports,s,s.exports,n),s.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(1830)})()));
|
|
2
2
|
//# sourceMappingURL=GnLabel.js.map
|
package/GnLabel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GnLabel.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,Q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AAMD,GAAQ,K,GA4FjF,OAJKE,eAAevH,IAAImB,IACtBoG,eAAetK,OAAOkE,EAAKgB,GAGtBA,CAAa,C,kECxGpBqF,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBrJ,IAAjBsJ,EACH,OAAOA,EAAa5K,QAGrB,IAAIC,EAASwK,EAAyBE,GAAY,CACjDlJ,GAAIkJ,EAEJ3K,QAAS,CAAC,GAOX,OAHA6K,EAAoBF,GAAU/H,KAAK3C,EAAOD,QAASC,EAAQA,EAAOD,QAAS0K,GAGpEzK,EAAOD,OACf,C,OCrBA0K,EAAoBI,EAAK7K,IACxB,IAAI8K,EAAS9K,GAAUA,EAAO+K,WAC7B,IAAO/K,EAAiB,QACxB,IAAM,EAEP,OADAyK,EAAoBO,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdL,EAAoBO,EAAI,CAACjL,EAASmL,KACjC,IAAI,IAAIC,KAAOD,EACXT,EAAoBW,EAAEF,EAAYC,KAASV,EAAoBW,EAAErL,EAASoL,IAC5ErI,OAAOC,eAAehD,EAASoL,EAAK,CAAEE,YAAY,EAAMrI,IAAKkI,EAAWC,IAE1E,ECNDV,EAAoBW,EAAI,CAACE,EAAKvD,IAAUjF,OAAO2F,UAAU8C,eAAe5I,KAAK2I,EAAKvD,GCClF0C,EAAoBe,EAAKzL,IACH,oBAAX0L,QAA0BA,OAAOC,aAC1C5I,OAAOC,eAAehD,EAAS0L,OAAOC,YAAa,CAAE9G,MAAO,WAE7D9B,OAAOC,eAAehD,EAAS,aAAc,CAAE6E,OAAO,GAAO,ECFpC6F,EAAoB,K","sources":["webpack://geonorge/webpack/universalModuleDefinition","webpack://geonorge/../node_modules/css-loader/dist/runtime/api.js","webpack://geonorge/../node_modules/super-custom-elements/src/listen.ts","webpack://geonorge/../node_modules/super-custom-elements/src/watch.ts","webpack://geonorge/./stories/gn-label/gn-label.ts","webpack://geonorge/../node_modules/super-custom-elements/src/util.ts","webpack://geonorge/../node_modules/super-custom-elements/src/index.ts","webpack://geonorge/../node_modules/super-custom-elements/src/helpers.ts","webpack://geonorge/../node_modules/super-custom-elements/src/custom-element.ts","webpack://geonorge/../node_modules/super-custom-elements/src/toggle.ts","webpack://geonorge/./stories/gn-label/gn-label.scss","webpack://geonorge/./stories/gn-label/gn-label.html","webpack://geonorge/../node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://geonorge/./functions/guiHelpers.ts","webpack://geonorge/../node_modules/super-custom-elements/src/prop.ts","webpack://geonorge/../node_modules/super-custom-elements/src/component.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\"][\"GnLabel\"] = factory();\n})(self, () => {\nreturn ","\"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};","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 } 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};","// Dependencies\nimport { Component, CustomElement, CustomElementOptions, Toggle } from \"super-custom-elements\";\n\n// Helpers\nimport { addGlobalStylesheet } from \"../../functions/guiHelpers\";\n\n// Stylesheets\nimport style from \"./gn-label.scss\";\n\ninterface GnLabelOptions extends CustomElementOptions {}\n\n@Component({\n tag: \"gn-label\",\n template: import(\"./gn-label.html\")\n})\nexport class GnLabel extends CustomElement {\n @Toggle() block: boolean;\n\n constructor() {\n super();\n addGlobalStylesheet(\"gn-label-styles\", style);\n }\n\n setup(options?: GnLabelOptions): void {}\n}\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","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';","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};","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","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","// 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, `gn-label{font-family:\"Open Sans\",sans-serif;color:#2f3940;font-size:1em;line-height:1.5em;min-height:21px;font-weight:bold}gn-label[block]{display:block;margin-bottom:.4em}gn-label:not([block]){display:inline-block}gn-label:not([block])+gn-input:not([block]),gn-label:not([block])+gn-select:not([block]),gn-label:not([block])+gn-textarea:not([block]){margin-left:.5em}`, \"\",{\"version\":3,\"sources\":[\"webpack://./stories/gn-label/gn-label.scss\",\"webpack://./style/variables/_typography.scss\",\"webpack://./style/variables/_colors.scss\"],\"names\":[],\"mappings\":\"AAEA,SACI,kCCHW,CDIX,aEGU,CFFV,aAAA,CACA,iBAAA,CACA,eAAA,CACA,gBAAA,CACA,gBACI,aAAA,CACA,kBAAA,CAEJ,sBACI,oBAAA,CACA,wIAGI,gBAAA\",\"sourcesContent\":[\"@import \\\"../../style/all\\\";\\n\\ngn-label {\\n font-family: $default-font;\\n color: $default-text;\\n font-size: 1em;\\n line-height: 1.5em;\\n min-height: 21px;\\n font-weight: bold; \\n &[block] {\\n display: block;\\n margin-bottom: 0.4em;\\n }\\n &:not([block]) {\\n display: inline-block;\\n & + gn-input:not([block]),\\n & + gn-select:not([block]),\\n & + gn-textarea:not([block]) {\\n margin-left: 0.5em;\\n }\\n }\\n}\\n\",\"$default-font: \\\"Open Sans\\\", sans-serif;\\n$header-font: \\\"Raleway\\\", sans-serif;\\n$default-font-size: 15px;\\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: #3767C7;\\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\\n\\n$light-green: #8fff33;\\n$light-yellow: #ffEb3b;\\n$light-red: #ff4a2e;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","export default \"<template>\\n <slot></slot>\\n</template>\\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};","export const getFocusableElementsInsideElement = (element: HTMLElement) => {\n return element.querySelectorAll('button, [href], input, [tabindex=\"0\"]');\n};\n\nexport const addGlobalStylesheet = (styleElementId: string, styles: string) => {\n const style = document.createElement(\"style\");\n style.setAttribute(\"id\", styleElementId);\n style.textContent = styles;\n if (!document.getElementById(styleElementId)) {\n document.head.appendChild(style);\n }\n};\n\nexport const removeInnerHTML = (element: HTMLElement) => {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n};\n","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 { 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","// 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__(1830);\n"],"names":["root","factory","exports","module","define","amd","self","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","alreadyImportedModules","k","id","_k","push","Listen","eventName","selector","target","methodName","constructor","listeners","handler","addEventListeners","targetRoot","shadowRoot","listener","eventTarget","querySelector","addEventListener","e","call","Dispatch","propertyName","Object","defineProperty","get","emit","options","evtName","toDotCase","dispatchEvent","CustomEvent","Watch","attrName","watchAttributes","toKebabCase","propsInit","GnLabel","CustomElement","super","addGlobalStylesheet","setup","Toggle","Component","tag","template","str","replace","toLowerCase","toCamelCase","m","toUpperCase","tryParseInt","value","parseInt","NaN","parseFloat","getElement","document","getShadowRootElement","customElement","HTMLElement","connect","isConnected","appendChild","propName","hasAttribute","attrValue","getAttribute","test","set","oldValue","console","warn","__connected","props","setAttribute","removeAttribute","___CSS_LOADER_EXPORT___","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","getFocusableElementsInsideElement","element","querySelectorAll","styleElementId","styles","style","createElement","textContent","getElementById","head","removeInnerHTML","firstChild","removeChild","Prop","onAttributeChange","initializeProps","prop","plainAttributes","keys","forEach","v","cycleProps","getProps","attribValue","new","args","prototype","name","showShadowRoot","shadow","attachShadow","mode","observedAttributes","x","attributeChangedCallback","newValue","methodToCall","old","connectedCallback","render","innerHTML","getStyle","Promise","getExternalTemplate","cloneNode","markup","default","fragment","createRange","createContextualFragment","children","nodeName","css","ready","resolve","_","customElements","__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":"GnLabel.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,SAAW,QAAIC,IAC1E,CATD,CASGK,MAAM,I,kCCHTH,EAAOD,QAAU,SAAUK,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,cAAcE,OAAOH,EAAK,GAAI,QAEvCA,EAAK,KACPC,GAAW,UAAUE,OAAOH,EAAK,GAAI,OAEnCE,IACFD,GAAW,SAASE,OAAOH,EAAK,GAAGI,OAAS,EAAI,IAAID,OAAOH,EAAK,IAAM,GAAI,OAE5EC,GAAW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,eAAejI,KAAKgI,EAAKzD,GCClF4C,EAAoBe,EAAK9K,IACH,oBAAX+K,QAA0BA,OAAOC,aAC1CjI,OAAOC,eAAehD,EAAS+K,OAAOC,YAAa,CAAElG,MAAO,WAE7D/B,OAAOC,eAAehD,EAAS,aAAc,CAAE8E,OAAO,GAAO,ECFpCiF,EAAoB,K","sources":["webpack://geonorge/webpack/universalModuleDefinition","webpack://geonorge/../node_modules/css-loader/dist/runtime/api.js","webpack://geonorge/../node_modules/super-custom-elements/src/listen.ts","webpack://geonorge/../node_modules/super-custom-elements/src/watch.ts","webpack://geonorge/./stories/gn-label/gn-label.ts","webpack://geonorge/./stories/gn-label/template.scss","webpack://geonorge/../node_modules/super-custom-elements/src/util.ts","webpack://geonorge/../node_modules/super-custom-elements/src/index.ts","webpack://geonorge/../node_modules/super-custom-elements/src/helpers.ts","webpack://geonorge/../node_modules/super-custom-elements/src/custom-element.ts","webpack://geonorge/../node_modules/super-custom-elements/src/toggle.ts","webpack://geonorge/./stories/gn-label/gn-label.html","webpack://geonorge/../node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://geonorge/../node_modules/super-custom-elements/src/prop.ts","webpack://geonorge/../node_modules/super-custom-elements/src/component.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\"][\"GnLabel\"] = factory();\n})(self, () => {\nreturn ","\"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};","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 } 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};","// Dependencies\nimport { Component, CustomElement, CustomElementOptions, Toggle } from \"super-custom-elements\";\n\ninterface GnLabelOptions extends CustomElementOptions {}\n\n@Component({\n tag: \"gn-label\",\n template: import(\"./gn-label.html\"),\n style: import(\"./template.scss\")\n})\nexport class GnLabel extends CustomElement {\n @Toggle() block: boolean;\n\n constructor() {\n super();\n }\n\n setup(options?: GnLabelOptions): void {}\n}\n","// 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, `:host{font-family:\"Open Sans\",sans-serif;color:#2f3940;font-size:1em;line-height:1.5em;min-height:21px;font-weight:bold}:host(:not([block])){display:inline-block}:host(:not([block])) ::slotted(gn-input:not([block])),:host(:not([block])) ::slotted(gn-select:not([block])),:host(:not([block])) ::slotted(gn-textarea:not([block])){margin-left:.5em}:host([block]){display:block;margin-bottom:.4em}`, \"\",{\"version\":3,\"sources\":[\"webpack://./stories/gn-label/template.scss\",\"webpack://./style/variables/_typography.scss\",\"webpack://./style/variables/_colors.scss\"],\"names\":[],\"mappings\":\"AAGA,MACI,kCCJW,CDKX,aEEU,CFDV,aAAA,CACA,iBAAA,CACA,eAAA,CACA,gBAAA,CAGJ,qBACI,oBAAA,CACA,sKAGI,gBAAA,CAIR,eACI,aAAA,CACA,kBAAA\",\"sourcesContent\":[\"@use \\\"../../style/variables/colors\\\";\\n@use \\\"../../style/variables/typography\\\";\\n\\n:host {\\n font-family: typography.$default-font;\\n color: colors.$default-text;\\n font-size: 1em;\\n line-height: 1.5em;\\n min-height: 21px;\\n font-weight: bold;\\n}\\n\\n:host(:not([block])) {\\n display: inline-block;\\n ::slotted(gn-input:not([block])),\\n ::slotted(gn-select:not([block])),\\n ::slotted(gn-textarea:not([block])) {\\n margin-left: 0.5em;\\n }\\n}\\n\\n:host([block]) {\\n display: block;\\n margin-bottom: 0.4em;\\n}\\n\",\"$default-font: \\\"Open Sans\\\", sans-serif;\\n$header-font: \\\"Raleway\\\", sans-serif;\\n$default-font-size: 15px;\\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: #3767C7;\\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\\n\\n$light-green: #8fff33;\\n$light-yellow: #ffEb3b;\\n$light-red: #ff4a2e;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\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","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';","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};","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","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 default \"<template>\\n <slot></slot>\\n</template>\\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 { 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 { 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","// 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__(1830);\n"],"names":["root","factory","exports","module","define","amd","self","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","alreadyImportedModules","k","id","_k","push","Listen","eventName","selector","target","methodName","constructor","listeners","handler","addEventListeners","targetRoot","shadowRoot","listener","eventTarget","querySelector","addEventListener","e","call","Dispatch","propertyName","Object","defineProperty","get","emit","options","evtName","toDotCase","dispatchEvent","CustomEvent","Watch","attrName","watchAttributes","toKebabCase","propsInit","GnLabel","CustomElement","super","setup","Toggle","Component","tag","template","style","___CSS_LOADER_EXPORT___","str","replace","toLowerCase","toCamelCase","m","toUpperCase","tryParseInt","value","parseInt","NaN","parseFloat","getElement","document","getShadowRootElement","customElement","HTMLElement","connect","isConnected","appendChild","propName","hasAttribute","attrValue","getAttribute","test","set","oldValue","console","warn","__connected","props","setAttribute","removeAttribute","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","Prop","onAttributeChange","initializeProps","prop","plainAttributes","keys","forEach","v","cycleProps","getProps","attribValue","new","args","prototype","name","showShadowRoot","shadow","attachShadow","mode","observedAttributes","x","attributeChangedCallback","newValue","methodToCall","old","connectedCallback","render","createElement","innerHTML","getStyle","Promise","getExternalTemplate","cloneNode","markup","default","fragment","createRange","createContextualFragment","children","nodeName","firstChild","css","ready","resolve","_","customElements","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","enumerable","obj","hasOwnProperty","r","Symbol","toStringTag"],"sourceRoot":""}
|