@kodaris/krubble-components 1.0.2 → 1.0.4
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/custom-elements.json +275 -31
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/krubble.bundled.js +373 -67
- package/dist/krubble.bundled.js.map +1 -1
- package/dist/krubble.bundled.min.js +203 -44
- package/dist/krubble.bundled.min.js.map +1 -1
- package/dist/krubble.umd.js +372 -66
- package/dist/krubble.umd.js.map +1 -1
- package/dist/krubble.umd.min.js +192 -33
- package/dist/krubble.umd.min.js.map +1 -1
- package/dist/snackbar/snackbar.d.ts +71 -0
- package/dist/snackbar/snackbar.d.ts.map +1 -0
- package/dist/snackbar/snackbar.js +309 -0
- package/dist/snackbar/snackbar.js.map +1 -0
- package/package.json +1 -1
package/dist/krubble.umd.min.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).kr={})}(this,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).kr={})}(this,function(e){"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;let r=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(t,e))}return e}toString(){return this.cssText}};const n=(e,...t)=>{const i=1===e.length?e[0]:t.reduce((
|
|
6
|
+
*/const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;let r=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(t,e))}return e}toString(){return this.cssText}};const n=(e,...t)=>{const i=1===e.length?e[0]:t.reduce((t,i,o)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1],e[0]);return new r(i,e,o)},a=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,o))(t)})(e):e,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,f=globalThis,b=f.trustedTypes,g=b?b.emptyScript:"",v=f.reactiveElementPolyfillSupport,m=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},x=(e,t)=>!l(e,t),_={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:x};
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
|
|
11
|
+
*/Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let $=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(e,i,t);void 0!==o&&d(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){const{get:o,set:s}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const r=o?.call(this);s?.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const e=this.properties,t=[...h(e),...p(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,o)=>{if(i)e.adoptedStyleSheets=o.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const i of o){const o=document.createElement("style"),s=t.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=i.cssText,e.appendChild(o)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:y).toAttribute(t,i.type);this._$Em=e,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(e,t){const i=this.constructor,o=i._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=i.getPropertyOptions(o),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=o;const r=s.fromAttribute(t,e.type);this[o]=r??this._$Ej?.get(o)??r,this._$Em=null}}requestUpdate(e,t,i,o=!1,s){if(void 0!==e){const r=this.constructor;if(!1===o&&(s=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??x)(s,t)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:s},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==s||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===o&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,o=this[t];!0!==e||this._$AL.has(t)||void 0===o||this.C(t,void 0,i,o)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[m("elementProperties")]=new Map,$[m("finalized")]=new Map,v?.({ReactiveElement:$}),(f.reactiveElementVersions??=[]).push("2.1.2");
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const k=globalThis,w=e=>e,A=k.trustedTypes,R=A?A.createPolicy("lit-html",{createHTML:e=>e}):void 0,E="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,S="?"+C,P=`<${S}>`,T=document,K=()=>T.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,z="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,j=/>/g,L=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),U=/'/g,B=/"/g,N=/^(?:script|style|textarea|title)$/i,F=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),V=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),q=new WeakMap,W=T.createTreeWalker(T,129);function X(e,t){if(!M(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(t):t}const J=(e,t)=>{const i=e.length-1,o=[];let s,r=2===t?"<svg>":3===t?"<math>":"",n=H;for(let t=0;t<i;t++){const i=e[t];let a,l,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===H?"!--"===l[1]?n=D:void 0!==l[1]?n=j:void 0!==l[2]?(N.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=L):void 0!==l[3]&&(n=L):n===L?">"===l[0]?(n=s??H,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?L:'"'===l[3]?B:U):n===B||n===U?n=L:n===D||n===j?n=H:(n=L,s=void 0);const h=n===L&&e[t+1].startsWith("/>")?" ":"";r+=n===H?i+P:d>=0?(o.push(a),i.slice(0,d)+E+i.slice(d)+C+h):i+C+(-2===d?t:h)}return[X(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class Z{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let s=0,r=0;const n=e.length-1,a=this.parts,[l,d]=J(e,t);if(this.el=Z.createElement(l,i),W.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=W.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(E)){const t=d[r++],i=o.getAttribute(e).split(C),n=/([.?@])?(.*)/.exec(t);a.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?te:"?"===n[1]?ie:"@"===n[1]?oe:ee}),o.removeAttribute(e)}else e.startsWith(C)&&(a.push({type:6,index:s}),o.removeAttribute(e));if(N.test(o.tagName)){const e=o.textContent.split(C),t=e.length-1;if(t>0){o.textContent=A?A.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],K()),W.nextNode(),a.push({type:2,index:++s});o.append(e[t],K())}}}else if(8===o.nodeType)if(o.data===S)a.push({type:2,index:s});else{let e=-1;for(;-1!==(e=o.data.indexOf(C,e+1));)a.push({type:7,index:s}),e+=C.length-1}s++}}static createElement(e,t){const i=T.createElement("template");return i.innerHTML=e,i}}function G(e,t,i=e,o){if(t===V)return t;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=O(t)?void 0:t._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(e),s._$AT(e,i,o)),void 0!==o?(i._$Co??=[])[o]=s:i._$Cl=s),void 0!==s&&(t=G(e,s._$AS(e,t.values),s,o)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,o=(e?.creationScope??T).importNode(t,!0);W.currentNode=o;let s=W.nextNode(),r=0,n=0,a=i[0];for(;void 0!==a;){if(r===a.index){let t;2===a.type?t=new Y(s,s.nextSibling,this,e):1===a.type?t=new a.ctor(s,a.name,a.strings,this,e):6===a.type&&(t=new se(s,this,e)),this._$AV.push(t),a=i[++n]}r!==a?.index&&(s=W.nextNode(),r++)}return W.currentNode=T,o}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Y{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=G(this,e,t),O(e)?e===I||null==e||""===e?(this._$AH!==I&&this._$AR(),this._$AH=I):e!==this._$AH&&e!==V&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>M(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==I&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,o="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Z.createElement(X(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(t);else{const e=new Q(o,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=q.get(e.strings);return void 0===t&&q.set(e.strings,t=new Z(e)),t}k(e){M(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const s of e)o===t.length?t.push(i=new Y(this.O(K()),this.O(K()),this,this.options)):i=t[o],i._$AI(s),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=w(e).nextSibling;w(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ee{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,s){this.type=1,this._$AH=I,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}_$AI(e,t=this,i,o){const s=this.strings;let r=!1;if(void 0===s)e=G(this,e,t,0),r=!O(e)||e!==this._$AH&&e!==V,r&&(this._$AH=e);else{const o=e;let n,a;for(e=s[0],n=0;n<s.length-1;n++)a=G(this,o[i+n],t,n),a===V&&(a=this._$AH[n]),r||=!O(a)||a!==this._$AH[n],a===I?e=I:e!==I&&(e+=(a??"")+s[n+1]),this._$AH[n]=a}r&&!o&&this.j(e)}j(e){e===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class te extends ee{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===I?void 0:e}}class ie extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==I)}}class oe extends ee{constructor(e,t,i,o,s){super(e,t,i,o,s),this.type=5}_$AI(e,t=this){if((e=G(this,e,t,0)??I)===V)return;const i=this._$AH,o=e===I&&i!==I||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==I&&(i===I||o);o&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){G(this,e)}}const re=k.litHtmlPolyfillSupport;re?.(Z,Y),(k.litHtmlVersions??=[]).push("3.3.2");const ne=globalThis;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/let
|
|
22
|
+
*/let ae=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const o=i?.renderBefore??t;let s=o._$litPart$;if(void 0===s){const e=i?.renderBefore??null;o._$litPart$=s=new Y(t.insertBefore(K(),e),e,void 0,i??{})}return s._$AI(e),s})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}};ae._$litElement$=!0,ae.finalized=!0,ne.litElementHydrateSupport?.({LitElement:ae});const le=ne.litElementPolyfillSupport;le?.({LitElement:ae}),(ne.litElementVersions??=[]).push("4.2.2");
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const de=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},ce={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:x},he=(e=ce,t,i)=>{const{kind:o,metadata:s}=i;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),"setter"===o&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===o){const{name:o}=i;return{set(i){const s=t.get.call(this);t.set.call(this,i),this.requestUpdate(o,s,e,!0,i)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===o){const{name:o}=i;return function(i){const s=this[o];t.call(this,i),this.requestUpdate(o,s,e,!0,i)}}throw Error("Unsupported decorator location: "+o)};
|
|
29
29
|
/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
|
|
33
|
+
*/function pe(e){return(t,i)=>"object"==typeof i?he(e,t,i):((e,t,i)=>{const o=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),o?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)}
|
|
34
34
|
/**
|
|
35
35
|
* @license
|
|
36
36
|
* Copyright 2017 Google LLC
|
|
37
37
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
|
-
*/
|
|
38
|
+
*/function ue(e){return pe({...e,state:!0,attribute:!1})}
|
|
39
39
|
/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2017 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/var
|
|
43
|
+
*/var fe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRAccordion=class extends ae{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return F`
|
|
44
44
|
<div class="header" @click=${this.toggle}>
|
|
45
45
|
<span class="header__title">${this.header}</span>
|
|
46
46
|
<svg class="header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -106,30 +106,30 @@ const ae=e=>(t,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(e,t)
|
|
|
106
106
|
.content__body {
|
|
107
107
|
padding: 16px 16px 8px 16px;
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`,fe([pe({type:String})],e.KRAccordion.prototype,"header",void 0),fe([pe({type:Boolean,reflect:!0})],e.KRAccordion.prototype,"expanded",void 0),e.KRAccordion=fe([de("kr-accordion")],e.KRAccordion);
|
|
110
110
|
/**
|
|
111
111
|
* @license
|
|
112
112
|
* Copyright 2017 Google LLC
|
|
113
113
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
114
|
*/
|
|
115
|
-
const
|
|
115
|
+
const be=1,ge=2,ve=3,me=4,ye=e=>(...t)=>({_$litDirective$:e,values:t});class xe{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}
|
|
116
116
|
/**
|
|
117
117
|
* @license
|
|
118
118
|
* Copyright 2018 Google LLC
|
|
119
119
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
120
|
-
*/const _e=ye(class extends
|
|
120
|
+
*/const _e=ye(class extends xe{constructor(e){if(super(e),e.type!==be||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e)));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const o=!!t[e];o===this.st.has(e)||this.nt?.has(e)||(o?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return V}});var $e=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRAlert=class extends ae{constructor(){super(...arguments),this.type="info",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}render(){const e={info:F`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:F`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:F`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:F`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return F`
|
|
121
121
|
<div
|
|
122
122
|
class=${_e({alert:!0,["alert--"+this.type]:!0,"alert--hidden":!this.visible})}
|
|
123
123
|
role="alert"
|
|
124
124
|
>
|
|
125
125
|
${e[this.type]}
|
|
126
126
|
<div class="content">
|
|
127
|
-
${this.header?
|
|
127
|
+
${this.header?F`<h4 class="header">${this.header}</h4>`:I}
|
|
128
128
|
<div class="message">
|
|
129
129
|
<slot></slot>
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
132
|
-
${this.dismissible?
|
|
132
|
+
${this.dismissible?F`
|
|
133
133
|
<button
|
|
134
134
|
class="dismiss"
|
|
135
135
|
type="button"
|
|
@@ -140,7 +140,7 @@ const fe=1,ge=2,be=3,ve=4,ye=e=>(...t)=>({_$litDirective$:e,values:t});class me{
|
|
|
140
140
|
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
141
141
|
</svg>
|
|
142
142
|
</button>
|
|
143
|
-
`:
|
|
143
|
+
`:I}
|
|
144
144
|
</div>
|
|
145
145
|
`}},e.KRAlert.styles=n`
|
|
146
146
|
:host {
|
|
@@ -249,7 +249,7 @@ const fe=1,ge=2,be=3,ve=4,ye=e=>(...t)=>({_$litDirective$:e,values:t});class me{
|
|
|
249
249
|
outline: 2px solid #3b82f6;
|
|
250
250
|
outline-offset: 2px;
|
|
251
251
|
}
|
|
252
|
-
`,$e([
|
|
252
|
+
`,$e([pe({type:String})],e.KRAlert.prototype,"type",void 0),$e([pe({type:String})],e.KRAlert.prototype,"header",void 0),$e([pe({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),$e([pe({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=$e([de("kr-alert")],e.KRAlert);var ke=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRButton=class extends ae{constructor(){super(...arguments),this.variant="primary",this.size="medium",this.disabled=!1}render(){const e="medium"!==this.size?this.size:"";return F`
|
|
253
253
|
<button
|
|
254
254
|
part="button"
|
|
255
255
|
class="${this.variant} ${e}"
|
|
@@ -331,13 +331,13 @@ const fe=1,ge=2,be=3,ve=4,ye=e=>(...t)=>({_$litDirective$:e,values:t});class me{
|
|
|
331
331
|
line-height: 44px;
|
|
332
332
|
padding: 0 24px;
|
|
333
333
|
}
|
|
334
|
-
`,
|
|
334
|
+
`,ke([pe({type:String})],e.KRButton.prototype,"variant",void 0),ke([pe({type:String})],e.KRButton.prototype,"size",void 0),ke([pe({type:Boolean})],e.KRButton.prototype,"disabled",void 0),e.KRButton=ke([de("kr-button")],e.KRButton);
|
|
335
335
|
/**
|
|
336
336
|
* @license
|
|
337
337
|
* Copyright 2017 Google LLC
|
|
338
338
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
339
339
|
*/
|
|
340
|
-
class we extends
|
|
340
|
+
class we extends xe{constructor(e){if(super(e),this.it=I,e.type!==ge)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===I||null==e)return this._t=void 0,this.it=e;if(e===V)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}we.directiveName="unsafeHTML",we.resultType=1;const Ae=ye(we);var Re=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRCodeDemo=class extends ae{constructor(){super(...arguments),this.language="html",this.code="",this.activeTab="preview",this.copied=!1}setTab(e){this.activeTab=e}getHighlightedCode(){return this.code?window.Prism&&window.Prism.languages[this.language]?window.Prism.highlight(this.code,window.Prism.languages[this.language],this.language):this.escapeHtml(this.code):""}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}async copyCode(){if(this.code)try{await navigator.clipboard.writeText(this.code),this.copied=!0,setTimeout(()=>{this.copied=!1},2e3)}catch(e){console.error("Failed to copy code:",e)}}render(){return F`
|
|
341
341
|
<div class="tabs">
|
|
342
342
|
<button
|
|
343
343
|
class=${_e({tab:!0,"tab--active":"preview"===this.activeTab})}
|
|
@@ -364,7 +364,7 @@ class we extends me{constructor(e){if(super(e),this.it=V,e.type!==ge)throw Error
|
|
|
364
364
|
>
|
|
365
365
|
${this.copied?"Copied!":"Copy"}
|
|
366
366
|
</button>
|
|
367
|
-
<pre class="code"><code>${
|
|
367
|
+
<pre class="code"><code>${Ae(this.getHighlightedCode())}</code></pre>
|
|
368
368
|
</div>
|
|
369
369
|
|
|
370
370
|
`}},e.KRCodeDemo.styles=n`
|
|
@@ -526,18 +526,18 @@ class we extends me{constructor(e){if(super(e),this.it=V,e.type!==ge)throw Error
|
|
|
526
526
|
.code .token.variable {
|
|
527
527
|
color: #fab387;
|
|
528
528
|
}
|
|
529
|
-
`,
|
|
529
|
+
`,Re([pe({type:String})],e.KRCodeDemo.prototype,"language",void 0),Re([pe({type:String})],e.KRCodeDemo.prototype,"code",void 0),Re([ue()],e.KRCodeDemo.prototype,"activeTab",void 0),Re([ue()],e.KRCodeDemo.prototype,"copied",void 0),e.KRCodeDemo=Re([de("kr-code-demo")],e.KRCodeDemo);var Ee=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRContextMenu=class extends ae{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(e){const t=document.querySelector("kr-context-menu");t&&t.remove();const i=document.createElement("kr-context-menu");return document.body.appendChild(i),i.show(e)}async show(e){this.items=e.items,this.style.left=`${e.x}px`,this.style.top=`${e.y}px`,await this.updateComplete;const t=this.getBoundingClientRect();return t.right>window.innerWidth&&(this.style.left=e.x-t.width+"px"),t.bottom>window.innerHeight&&(this.style.top=e.y-t.height+"px"),requestAnimationFrame(()=>{document.addEventListener("click",this.boundHandleOutsideClick),document.addEventListener("contextmenu",this.boundHandleOutsideClick),document.addEventListener("keydown",this.boundHandleKeyDown)}),new Promise(e=>{this.resolvePromise=e})}handleOutsideClick(e){this.contains(e.target)||this.close(null)}handleKeyDown(e){"Escape"===e.key&&this.close(null)}handleItemClick(e){e.disabled||e.divider||this.close(e)}close(e){document.removeEventListener("click",this.boundHandleOutsideClick),document.removeEventListener("contextmenu",this.boundHandleOutsideClick),document.removeEventListener("keydown",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.remove()}render(){return F`
|
|
530
530
|
<div class="menu">
|
|
531
|
-
${this.items.map(
|
|
531
|
+
${this.items.map(e=>e.divider?F`<div class="menu__divider"></div>`:F`
|
|
532
532
|
<button
|
|
533
533
|
class="menu__item"
|
|
534
534
|
?disabled=${e.disabled}
|
|
535
535
|
@click=${()=>this.handleItemClick(e)}
|
|
536
536
|
>
|
|
537
|
-
${e.icon?
|
|
537
|
+
${e.icon?F`<span class="menu__item-icon">${e.icon}</span>`:null}
|
|
538
538
|
${e.label}
|
|
539
539
|
</button>
|
|
540
|
-
`)
|
|
540
|
+
`)}
|
|
541
541
|
</div>
|
|
542
542
|
`}},e.KRContextMenu.styles=n`
|
|
543
543
|
:host {
|
|
@@ -594,7 +594,7 @@ class we extends me{constructor(e){if(super(e),this.it=V,e.type!==ge)throw Error
|
|
|
594
594
|
background: rgba(255, 255, 255, 0.1);
|
|
595
595
|
margin: 4px 0;
|
|
596
596
|
}
|
|
597
|
-
`,
|
|
597
|
+
`,Ee([ue()],e.KRContextMenu.prototype,"items",void 0),e.KRContextMenu=Ee([de("kr-context-menu")],e.KRContextMenu);var Ce=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Se{constructor(){this.resolvePromise=null,this.dialogElement=null,this.promise=new Promise(e=>{this.resolvePromise=e})}setDialogElement(e){this.dialogElement=e}close(e){this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.dialogElement?.remove()}afterClosed(){return this.promise}}e.KRDialog=class extends ae{constructor(){super(...arguments),this.contentElement=null,this.dialogRef=null,this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static open(e,t){const i=document.querySelector("kr-dialog");i&&i.remove();const o=new Se,s=document.createElement("kr-dialog");o.setDialogElement(s),s.dialogRef=o;const r=new e;return r.dialogRef=o,t?.data&&(r.data=t.data),s.contentElement=r,document.body.appendChild(s),document.addEventListener("keydown",s.boundHandleKeyDown),o}handleKeyDown(e){"Escape"===e.key&&this.dialogRef?.close(void 0)}handleBackdropClick(e){e.target.classList.contains("backdrop")&&this.dialogRef?.close(void 0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.boundHandleKeyDown)}render(){return F`
|
|
598
598
|
<div class="backdrop" @click=${this.handleBackdropClick}></div>
|
|
599
599
|
<div class="dialog">
|
|
600
600
|
${this.contentElement}
|
|
@@ -624,30 +624,189 @@ class we extends me{constructor(e){if(super(e),this.it=V,e.type!==ge)throw Error
|
|
|
624
624
|
max-height: 90vh;
|
|
625
625
|
overflow: auto;
|
|
626
626
|
}
|
|
627
|
-
`,
|
|
627
|
+
`,Ce([ue()],e.KRDialog.prototype,"contentElement",void 0),e.KRDialog=Ce([de("kr-dialog")],e.KRDialog);var Pe,Te=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRSnackbar=Pe=class extends ae{constructor(){super(...arguments),this.dismissTimeout=null,this.type="info",this.title="",this.message="",this.duration=5e3}static show(e){const t=document.createElement("kr-snackbar");return t.message=e.message,t.title=e.title??"",t.type=e.type??"info",void 0!==e.duration?t.duration=e.duration:"error"===t.type?t.duration=0:t.duration=5e3,document.body.appendChild(t),t}connectedCallback(){super.connectedCallback(),this.setAttribute("role","alert"),this.classList.add(`kr-snackbar--${this.type}`),Pe.activeSnackbars.push(this),this.updatePositions(),this.duration>0&&(this.dismissTimeout=window.setTimeout(()=>{this.dismiss()},this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=Pe.activeSnackbars.indexOf(this);e>-1&&Pe.activeSnackbars.splice(e,1),this.updatePositions(),this.dismissTimeout&&clearTimeout(this.dismissTimeout)}updatePositions(){let e=24;for(const t of Pe.activeSnackbars)t.style.bottom=`${e}px`,e+=t.offsetHeight+8}dismiss(){this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.classList.add("kr-snackbar--closing"),this.addEventListener("animationend",()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0})),this.remove()},{once:!0})}render(){const e={info:F`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:F`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:F`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:F`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return F`
|
|
628
|
+
${e[this.type]}
|
|
629
|
+
<div class="content">
|
|
630
|
+
${this.title?F`<div class="title">${this.title}</div>`:""}
|
|
631
|
+
<div class="message">${this.message}</div>
|
|
632
|
+
</div>
|
|
633
|
+
<button
|
|
634
|
+
class="dismiss"
|
|
635
|
+
type="button"
|
|
636
|
+
aria-label="Dismiss"
|
|
637
|
+
@click=${this.dismiss}
|
|
638
|
+
>
|
|
639
|
+
<svg viewBox="0 0 20 20" fill="currentColor" width="16" height="16">
|
|
640
|
+
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
641
|
+
</svg>
|
|
642
|
+
</button>
|
|
643
|
+
`}},e.KRSnackbar.styles=n`
|
|
644
|
+
:host,
|
|
645
|
+
*,
|
|
646
|
+
*::before,
|
|
647
|
+
*::after {
|
|
648
|
+
box-sizing: border-box;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
:host {
|
|
652
|
+
position: fixed;
|
|
653
|
+
left: 16px;
|
|
654
|
+
z-index: 10000;
|
|
655
|
+
display: flex;
|
|
656
|
+
align-items: flex-start;
|
|
657
|
+
gap: 12px;
|
|
658
|
+
padding: 14px 12px 14px 16px;
|
|
659
|
+
border-radius: 8px;
|
|
660
|
+
border: 1px solid;
|
|
661
|
+
border-left: 4px solid;
|
|
662
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
663
|
+
min-width: 280px;
|
|
664
|
+
max-width: 400px;
|
|
665
|
+
min-height: 48px;
|
|
666
|
+
animation: slideIn 0.2s ease-out;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
@keyframes slideIn {
|
|
670
|
+
from {
|
|
671
|
+
opacity: 0;
|
|
672
|
+
transform: translateX(-100%);
|
|
673
|
+
}
|
|
674
|
+
to {
|
|
675
|
+
opacity: 1;
|
|
676
|
+
transform: translateX(0);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
@keyframes slideOut {
|
|
681
|
+
from {
|
|
682
|
+
opacity: 1;
|
|
683
|
+
transform: translateX(0);
|
|
684
|
+
}
|
|
685
|
+
to {
|
|
686
|
+
opacity: 0;
|
|
687
|
+
transform: translateX(-100%);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
:host(.kr-snackbar--closing) {
|
|
692
|
+
animation: slideOut 0.15s ease-in forwards;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/* Variants */
|
|
696
|
+
:host(.kr-snackbar--info) {
|
|
697
|
+
background-color: #eff6ff;
|
|
698
|
+
border-color: #bfdbfe;
|
|
699
|
+
border-left-color: #3b82f6;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
:host(.kr-snackbar--info) .icon {
|
|
703
|
+
color: #2563eb;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
:host(.kr-snackbar--success) {
|
|
707
|
+
background-color: #f0fdf4;
|
|
708
|
+
border-color: #bbf7d0;
|
|
709
|
+
border-left-color: #22c55e;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
:host(.kr-snackbar--success) .icon {
|
|
713
|
+
color: #16a34a;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
:host(.kr-snackbar--warning) {
|
|
717
|
+
background-color: #fffbeb;
|
|
718
|
+
border-color: #fde68a;
|
|
719
|
+
border-left-color: #f59e0b;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
:host(.kr-snackbar--warning) .icon {
|
|
723
|
+
color: #d97706;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
:host(.kr-snackbar--error) {
|
|
727
|
+
background-color: #fef2f2;
|
|
728
|
+
border-color: #fecaca;
|
|
729
|
+
border-left-color: #ef4444;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
:host(.kr-snackbar--error) .icon {
|
|
733
|
+
color: #dc2626;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
.icon {
|
|
737
|
+
flex-shrink: 0;
|
|
738
|
+
width: 20px;
|
|
739
|
+
height: 20px;
|
|
740
|
+
margin-top: 1px;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.content {
|
|
744
|
+
flex: 1;
|
|
745
|
+
min-width: 0;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.title {
|
|
749
|
+
font-size: 14px;
|
|
750
|
+
font-weight: 600;
|
|
751
|
+
color: #000000;
|
|
752
|
+
margin: 0 0 2px 0;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.message {
|
|
756
|
+
font-size: 14px;
|
|
757
|
+
color: #000000;
|
|
758
|
+
margin: 0;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.dismiss {
|
|
762
|
+
flex-shrink: 0;
|
|
763
|
+
display: flex;
|
|
764
|
+
align-items: center;
|
|
765
|
+
justify-content: center;
|
|
766
|
+
width: 24px;
|
|
767
|
+
height: 24px;
|
|
768
|
+
padding: 0;
|
|
769
|
+
background: none;
|
|
770
|
+
border: none;
|
|
771
|
+
border-radius: 4px;
|
|
772
|
+
color: #6b7280;
|
|
773
|
+
cursor: pointer;
|
|
774
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
.dismiss:hover {
|
|
778
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
779
|
+
color: #374151;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
.dismiss:focus-visible {
|
|
783
|
+
outline: 2px solid #3b82f6;
|
|
784
|
+
outline-offset: 2px;
|
|
785
|
+
}
|
|
786
|
+
`,e.KRSnackbar.activeSnackbars=[],Te([pe({type:String})],e.KRSnackbar.prototype,"type",void 0),Te([pe({type:String})],e.KRSnackbar.prototype,"title",void 0),Te([pe({type:String})],e.KRSnackbar.prototype,"message",void 0),Te([pe({type:Number})],e.KRSnackbar.prototype,"duration",void 0),e.KRSnackbar=Pe=Te([de("kr-snackbar")],e.KRSnackbar);
|
|
628
787
|
/**
|
|
629
788
|
* @license
|
|
630
789
|
* Copyright 2020 Google LLC
|
|
631
790
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
632
791
|
*/
|
|
633
|
-
const
|
|
792
|
+
const Ke={},Oe=ye(class extends xe{constructor(e){if(super(e),e.type!==ve&&e.type!==be&&e.type!==me)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===V||t===I)return t;const i=e.element,o=e.name;if(e.type===ve){if(t===i[o])return V}else if(e.type===me){if(!!t===i.hasAttribute(o))return V}else if(e.type===be&&i.getAttribute(o)===t+"")return V;return((e,t=Ke)=>{e._$AH=t;
|
|
634
793
|
/**
|
|
635
794
|
* @license
|
|
636
795
|
* Copyright 2020 Google LLC
|
|
637
796
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
638
|
-
*/})(e),t}});var
|
|
797
|
+
*/})(e),t}});var Me=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRTextField=class extends ae{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage,this._input)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage,this._input)}render(){let e="";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),F`
|
|
639
798
|
<div class="wrapper">
|
|
640
|
-
${this.label?
|
|
799
|
+
${this.label?F`
|
|
641
800
|
<label for="input">
|
|
642
801
|
${this.label}
|
|
643
|
-
${this.required?
|
|
802
|
+
${this.required?F`<span class="required" aria-hidden="true">*</span>`:""}
|
|
644
803
|
</label>
|
|
645
804
|
`:""}
|
|
646
805
|
<input
|
|
647
806
|
id="input"
|
|
648
807
|
type=${this.type}
|
|
649
808
|
name=${this.name}
|
|
650
|
-
.value=${
|
|
809
|
+
.value=${Oe(this.value)}
|
|
651
810
|
placeholder=${this.placeholder}
|
|
652
811
|
?required=${this.required}
|
|
653
812
|
?disabled=${this.disabled}
|
|
@@ -660,7 +819,7 @@ const Se={},Pe=ye(class extends me{constructor(e){if(super(e),e.type!==be&&e.typ
|
|
|
660
819
|
@change=${this._handleChange}
|
|
661
820
|
@blur=${this._handleBlur}
|
|
662
821
|
/>
|
|
663
|
-
${e?
|
|
822
|
+
${e?F`<div class="validation-message">${e}</div>`:this.hint?F`<div class="hint">${this.hint}</div>`:""}
|
|
664
823
|
</div>
|
|
665
824
|
`}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=n`
|
|
666
825
|
:host {
|
|
@@ -729,11 +888,11 @@ const Se={},Pe=ye(class extends me{constructor(e){if(super(e),e.type!==be&&e.typ
|
|
|
729
888
|
font-size: 0.75rem;
|
|
730
889
|
color: var(--kr-text-field-helper-color, #6b7280);
|
|
731
890
|
}
|
|
732
|
-
`,e.KRTextField.formAssociated=!0,
|
|
891
|
+
`,e.KRTextField.formAssociated=!0,Me([pe({type:String})],e.KRTextField.prototype,"label",void 0),Me([pe({type:String})],e.KRTextField.prototype,"name",void 0),Me([pe({type:String})],e.KRTextField.prototype,"value",void 0),Me([pe({type:String})],e.KRTextField.prototype,"placeholder",void 0),Me([pe({type:String})],e.KRTextField.prototype,"type",void 0),Me([pe({type:Boolean})],e.KRTextField.prototype,"required",void 0),Me([pe({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),Me([pe({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),Me([pe({type:Number})],e.KRTextField.prototype,"minlength",void 0),Me([pe({type:Number})],e.KRTextField.prototype,"maxlength",void 0),Me([pe({type:String})],e.KRTextField.prototype,"pattern",void 0),Me([pe({type:String})],e.KRTextField.prototype,"autocomplete",void 0),Me([pe({type:String})],e.KRTextField.prototype,"hint",void 0),Me([
|
|
733
892
|
/**
|
|
734
893
|
* @license
|
|
735
894
|
* Copyright 2017 Google LLC
|
|
736
895
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
737
896
|
*/
|
|
738
|
-
function(e){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}("input")],e.KRTextField.prototype,"_input",void 0),
|
|
897
|
+
function(e){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}("input")],e.KRTextField.prototype,"_input",void 0),Me([ue()],e.KRTextField.prototype,"_touched",void 0),Me([ue()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=Me([de("kr-text-field")],e.KRTextField),e.DialogRef=Se}),function(e){Object.keys(e).forEach(function(t){t.startsWith("KR")&&"function"==typeof e[t]&&(e[t.slice(2)]=e[t],delete e[t])})}(kr);
|
|
739
898
|
//# sourceMappingURL=krubble.umd.min.js.map
|