@kodaris/krubble-components 1.0.5 → 1.0.6
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 +1529 -412
- package/dist/alert/alert.d.ts.map +1 -0
- package/dist/alert/alert.js.map +1 -0
- package/dist/code-demo/code-demo.d.ts.map +1 -1
- package/dist/code-demo/code-demo.js +2 -1
- package/dist/code-demo/code-demo.js.map +1 -1
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +2 -0
- package/dist/form/index.js.map +1 -1
- package/dist/form/select/select-option.d.ts +27 -0
- package/dist/form/select/select-option.d.ts.map +1 -0
- package/dist/form/select/select-option.js +50 -0
- package/dist/form/select/select-option.js.map +1 -0
- package/dist/form/select/select.d.ts +81 -0
- package/dist/form/select/select.d.ts.map +1 -0
- package/dist/form/select/select.js +519 -0
- package/dist/form/select/select.js.map +1 -0
- package/dist/form/text-field/text-field.d.ts +6 -0
- package/dist/form/text-field/text-field.d.ts.map +1 -1
- package/dist/form/text-field/text-field.js +38 -8
- package/dist/form/text-field/text-field.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/krubble.bundled.js +1131 -120
- package/dist/krubble.bundled.js.map +1 -1
- package/dist/krubble.bundled.min.js +489 -60
- package/dist/krubble.bundled.min.js.map +1 -1
- package/dist/krubble.umd.js +1131 -119
- package/dist/krubble.umd.js.map +1 -1
- package/dist/krubble.umd.min.js +498 -69
- package/dist/krubble.umd.min.js.map +1 -1
- package/dist/style/base.d.ts +6 -0
- package/dist/style/base.d.ts.map +1 -0
- package/dist/style/base.js +34 -0
- package/dist/style/base.js.map +1 -0
- package/dist/tabs/tab.d.ts +54 -0
- package/dist/tabs/tab.d.ts.map +1 -0
- package/dist/tabs/tab.js +103 -0
- package/dist/tabs/tab.js.map +1 -0
- package/dist/tabs/tabs.d.ts +47 -0
- package/dist/tabs/tabs.d.ts.map +1 -0
- package/dist/tabs/tabs.js +282 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/package.json +1 -1
- package/dist/alert.d.ts.map +0 -1
- package/dist/alert.js.map +0 -1
- /package/dist/{alert.d.ts → alert/alert.d.ts} +0 -0
- /package/dist/{alert.js → alert/alert.js} +0 -0
package/dist/krubble.umd.min.js
CHANGED
|
@@ -1,46 +1,73 @@
|
|
|
1
|
-
!function(t
|
|
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
|
|
6
|
+
*/const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),r=new WeakMap;let s=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=r.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&r.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 s(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 s("string"==typeof e?e:e+"",void 0,o))(t)})(e):e,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,b=globalThis,f=b.trustedTypes,g=f?f.emptyScript:"",v=b.reactiveElementPolyfillSupport,y=(e,t)=>e,m={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),k={attribute:!0,type:String,converter:m,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
|
-
*/Symbol.metadata??=Symbol("metadata"),
|
|
11
|
+
*/Symbol.metadata??=Symbol("metadata"),b.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=k){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:r}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const s=o?.call(this);r?.call(this,t),this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??k}static _$Ei(){if(this.hasOwnProperty(y("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(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("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"),r=t.litNonce;void 0!==r&&o.setAttribute("nonce",r),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 r=(void 0!==i.converter?.toAttribute?i.converter:m).toAttribute(t,i.type);this._$Em=e,null==r?this.removeAttribute(o):this.setAttribute(o,r),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),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:m;this._$Em=o;const s=r.fromAttribute(t,e.type);this[o]=s??this._$Ej?.get(o)??s,this._$Em=null}}requestUpdate(e,t,i,o=!1,r){if(void 0!==e){const s=this.constructor;if(!1===o&&(r=this[e]),i??=s.getPropertyOptions(e),!((i.hasChanged??x)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:r},s){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==r||void 0!==s)||(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"},_[y("elementProperties")]=new Map,_[y("finalized")]=new Map,v?.({ReactiveElement:_}),(b.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 $=globalThis,w=
|
|
17
|
+
const $=globalThis,w=e=>e,R=$.trustedTypes,A=R?R.createPolicy("lit-html",{createHTML:e=>e}):void 0,S="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+E,T=`<${C}>`,K=document,O=()=>K.createComment(""),P=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,z="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,j=/>/g,B=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,H=/"/g,U=/^(?:script|style|textarea|title)$/i,V=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),N=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),F=new WeakMap,W=K.createTreeWalker(K,129);function G(e,t){if(!M(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==A?A.createHTML(t):t}const X=(e,t)=>{const i=e.length-1,o=[];let r,s=2===t?"<svg>":3===t?"<math>":"",n=D;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===D?"!--"===l[1]?n=L:void 0!==l[1]?n=j:void 0!==l[2]?(U.test(l[2])&&(r=RegExp("</"+l[2],"g")),n=B):void 0!==l[3]&&(n=B):n===B?">"===l[0]?(n=r??D,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?B:'"'===l[3]?H:I):n===H||n===I?n=B:n===L||n===j?n=D:(n=B,r=void 0);const h=n===B&&e[t+1].startsWith("/>")?" ":"";s+=n===D?i+T:d>=0?(o.push(a),i.slice(0,d)+S+i.slice(d)+E+h):i+E+(-2===d?t:h)}return[G(e,s+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class Z{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let r=0,s=0;const n=e.length-1,a=this.parts,[l,d]=X(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(S)){const t=d[s++],i=o.getAttribute(e).split(E),n=/([.?@])?(.*)/.exec(t);a.push({type:1,index:r,name:n[2],strings:i,ctor:"."===n[1]?te:"?"===n[1]?ie:"@"===n[1]?oe:ee}),o.removeAttribute(e)}else e.startsWith(E)&&(a.push({type:6,index:r}),o.removeAttribute(e));if(U.test(o.tagName)){const e=o.textContent.split(E),t=e.length-1;if(t>0){o.textContent=R?R.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],O()),W.nextNode(),a.push({type:2,index:++r});o.append(e[t],O())}}}else if(8===o.nodeType)if(o.data===C)a.push({type:2,index:r});else{let e=-1;for(;-1!==(e=o.data.indexOf(E,e+1));)a.push({type:7,index:r}),e+=E.length-1}r++}}static createElement(e,t){const i=K.createElement("template");return i.innerHTML=e,i}}function J(e,t,i=e,o){if(t===N)return t;let r=void 0!==o?i._$Co?.[o]:i._$Cl;const s=P(t)?void 0:t._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),void 0===s?r=void 0:(r=new s(e),r._$AT(e,i,o)),void 0!==o?(i._$Co??=[])[o]=r:i._$Cl=r),void 0!==r&&(t=J(e,r._$AS(e,t.values),r,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??K).importNode(t,!0);W.currentNode=o;let r=W.nextNode(),s=0,n=0,a=i[0];for(;void 0!==a;){if(s===a.index){let t;2===a.type?t=new Y(r,r.nextSibling,this,e):1===a.type?t=new a.ctor(r,a.name,a.strings,this,e):6===a.type&&(t=new re(r,this,e)),this._$AV.push(t),a=i[++n]}s!==a?.index&&(r=W.nextNode(),s++)}return W.currentNode=K,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=q,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=J(this,e,t),P(e)?e===q||null==e||""===e?(this._$AH!==q&&this._$AR(),this._$AH=q):e!==this._$AH&&e!==N&&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!==q&&P(this._$AH)?this._$AA.nextSibling.data=e:this.T(K.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(G(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=F.get(e.strings);return void 0===t&&F.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 r of e)o===t.length?t.push(i=new Y(this.O(O()),this.O(O()),this,this.options)):i=t[o],i._$AI(r),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,r){this.type=1,this._$AH=q,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=q}_$AI(e,t=this,i,o){const r=this.strings;let s=!1;if(void 0===r)e=J(this,e,t,0),s=!P(e)||e!==this._$AH&&e!==N,s&&(this._$AH=e);else{const o=e;let n,a;for(e=r[0],n=0;n<r.length-1;n++)a=J(this,o[i+n],t,n),a===N&&(a=this._$AH[n]),s||=!P(a)||a!==this._$AH[n],a===q?e=q:e!==q&&(e+=(a??"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(e)}j(e){e===q?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===q?void 0:e}}class ie extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==q)}}class oe extends ee{constructor(e,t,i,o,r){super(e,t,i,o,r),this.type=5}_$AI(e,t=this){if((e=J(this,e,t,0)??q)===N)return;const i=this._$AH,o=e===q&&i!==q||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==q&&(i===q||o);o&&this.element.removeEventListener(this.name,this,i),r&&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 re{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){J(this,e)}}const se=$.litHtmlPolyfillSupport;se?.(Z,Y),($.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 r=o._$litPart$;if(void 0===r){const e=i?.renderBefore??null;o._$litPart$=r=new Y(t.insertBefore(O(),e),e,void 0,i??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return N}};ae._$litElement$=!0,ae.finalized=!0,ne.litElementHydrateSupport?.({LitElement:ae});const le=ne.litElementPolyfillSupport;le?.({LitElement:ae}),(ne.litElementVersions??=[]).push("4.2.2");const de=n`
|
|
23
|
+
:host,
|
|
24
|
+
*,
|
|
25
|
+
*::before,
|
|
26
|
+
*::after {
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host {
|
|
31
|
+
/* Primary */
|
|
32
|
+
--kr-primary: rgb(22, 48, 82);
|
|
33
|
+
--kr-primary-hover: rgb(16, 36, 62);
|
|
34
|
+
--kr-primary-text: #ffffff;
|
|
35
|
+
|
|
36
|
+
/* Accent */
|
|
37
|
+
--kr-accent: #BEEA4E;
|
|
38
|
+
--kr-accent-hover: #a8d43a;
|
|
39
|
+
--kr-accent-text: #000000;
|
|
40
|
+
|
|
41
|
+
/* Text */
|
|
42
|
+
--kr-text: #000000;
|
|
43
|
+
--kr-text-muted: #4b5563;
|
|
44
|
+
--kr-text-disabled: #9ca3af;
|
|
45
|
+
|
|
46
|
+
/* Borders */
|
|
47
|
+
--kr-border: #e5e7eb;
|
|
48
|
+
}
|
|
49
|
+
`
|
|
23
50
|
/**
|
|
24
51
|
* @license
|
|
25
52
|
* Copyright 2017 Google LLC
|
|
26
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
|
|
28
|
-
const dt=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},ct={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:x},ht=(t=ct,e,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&&((t=Object.create(t)).wrapped=!0),r.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,s,t,!0,i)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=i;return function(i){const s=this[o];e.call(this,i),this.requestUpdate(o,s,t,!0,i)}}throw Error("Unsupported decorator location: "+o)};
|
|
54
|
+
*/,ce=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},he={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:x},pe=(e=he,t,i)=>{const{kind:o,metadata:r}=i;let s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),"setter"===o&&((e=Object.create(e)).wrapped=!0),s.set(i.name,e),"accessor"===o){const{name:o}=i;return{set(i){const r=t.get.call(this);t.set.call(this,i),this.requestUpdate(o,r,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 r=this[o];t.call(this,i),this.requestUpdate(o,r,e,!0,i)}}throw Error("Unsupported decorator location: "+o)};function ue(e){return(t,i)=>"object"==typeof i?pe(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)}
|
|
29
55
|
/**
|
|
30
56
|
* @license
|
|
31
57
|
* Copyright 2017 Google LLC
|
|
32
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/function
|
|
59
|
+
*/function be(e){return ue({...e,state:!0,attribute:!1})}
|
|
34
60
|
/**
|
|
35
61
|
* @license
|
|
36
62
|
* Copyright 2017 Google LLC
|
|
37
63
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
|
-
*/
|
|
64
|
+
*/
|
|
39
65
|
/**
|
|
40
66
|
* @license
|
|
41
67
|
* Copyright 2017 Google LLC
|
|
42
68
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/
|
|
69
|
+
*/
|
|
70
|
+
function fe(e,t){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)}})}var ge=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>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 V`
|
|
44
71
|
<div class="header" @click=${this.toggle}>
|
|
45
72
|
<span class="header__title">${this.header}</span>
|
|
46
73
|
<svg class="header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -54,7 +81,7 @@ const dt=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}
|
|
|
54
81
|
</div>
|
|
55
82
|
</div>
|
|
56
83
|
</div>
|
|
57
|
-
`}},
|
|
84
|
+
`}},e.KRAccordion.styles=n`
|
|
58
85
|
:host {
|
|
59
86
|
display: block;
|
|
60
87
|
margin-bottom: 16px;
|
|
@@ -106,30 +133,30 @@ const dt=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}
|
|
|
106
133
|
.content__body {
|
|
107
134
|
padding: 16px 16px 8px 16px;
|
|
108
135
|
}
|
|
109
|
-
`,
|
|
136
|
+
`,ge([ue({type:String})],e.KRAccordion.prototype,"header",void 0),ge([ue({type:Boolean,reflect:!0})],e.KRAccordion.prototype,"expanded",void 0),e.KRAccordion=ge([ce("kr-accordion")],e.KRAccordion);
|
|
110
137
|
/**
|
|
111
138
|
* @license
|
|
112
139
|
* Copyright 2017 Google LLC
|
|
113
140
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
141
|
*/
|
|
115
|
-
const
|
|
142
|
+
const ve=1,ye=2,me=3,xe=4,ke=e=>(...t)=>({_$litDirective$:e,values:t});let _e=class{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
143
|
/**
|
|
117
144
|
* @license
|
|
118
145
|
* Copyright 2018 Google LLC
|
|
119
146
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
120
|
-
*/const
|
|
147
|
+
*/const $e=ke(class extends _e{constructor(e){if(super(e),e.type!==ve||"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 N}});var we=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>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:V`<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:V`<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:V`<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:V`<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 V`
|
|
121
148
|
<div
|
|
122
|
-
class=${
|
|
149
|
+
class=${$e({alert:!0,["alert--"+this.type]:!0,"alert--hidden":!this.visible})}
|
|
123
150
|
role="alert"
|
|
124
151
|
>
|
|
125
|
-
${
|
|
152
|
+
${e[this.type]}
|
|
126
153
|
<div class="content">
|
|
127
|
-
${this.header?
|
|
154
|
+
${this.header?V`<h4 class="header">${this.header}</h4>`:q}
|
|
128
155
|
<div class="message">
|
|
129
156
|
<slot></slot>
|
|
130
157
|
</div>
|
|
131
158
|
</div>
|
|
132
|
-
${this.dismissible?
|
|
159
|
+
${this.dismissible?V`
|
|
133
160
|
<button
|
|
134
161
|
class="dismiss"
|
|
135
162
|
type="button"
|
|
@@ -140,9 +167,9 @@ const bt=1,gt=2,mt=3,vt=4,yt=t=>(...e)=>({_$litDirective$:t,values:e});class xt{
|
|
|
140
167
|
<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
168
|
</svg>
|
|
142
169
|
</button>
|
|
143
|
-
`:
|
|
170
|
+
`:q}
|
|
144
171
|
</div>
|
|
145
|
-
`}},
|
|
172
|
+
`}},e.KRAlert.styles=n`
|
|
146
173
|
:host {
|
|
147
174
|
display: block;
|
|
148
175
|
}
|
|
@@ -249,12 +276,12 @@ const bt=1,gt=2,mt=3,vt=4,yt=t=>(...e)=>({_$litDirective$:t,values:e});class xt{
|
|
|
249
276
|
outline: 2px solid #3b82f6;
|
|
250
277
|
outline-offset: 2px;
|
|
251
278
|
}
|
|
252
|
-
`,
|
|
279
|
+
`,we([ue({type:String})],e.KRAlert.prototype,"type",void 0),we([ue({type:String})],e.KRAlert.prototype,"header",void 0),we([ue({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),we([ue({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=we([ce("kr-alert")],e.KRAlert);var Re=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};e.KRButton=class extends ae{constructor(){super(...arguments),this.variant="flat",this.color="primary",this.size="medium",this.disabled=!1,this._state="idle",this._stateText="",this._handleKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.click())}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown)}showLoading(){this._clearStateTimeout(),this._state="loading",this._stateText=""}showSuccess(e="Success",t=2e3){this._clearStateTimeout(),this._state="success",this._stateText=e,this._stateTimeout=window.setTimeout(()=>this.reset(),t)}showError(e="Error",t=2e3){this._clearStateTimeout(),this._state="error",this._stateText=e,this._stateTimeout=window.setTimeout(()=>this.reset(),t)}reset(){this._clearStateTimeout(),this._state="idle",this._stateText=""}_clearStateTimeout(){this._stateTimeout&&(clearTimeout(this._stateTimeout),this._stateTimeout=void 0)}updated(e){this.classList.toggle("kr-button--loading","loading"===this._state),this.classList.toggle("kr-button--success","success"===this._state),this.classList.toggle("kr-button--error","error"===this._state),this.classList.toggle(`kr-button--${this.variant}`,!0),this.classList.toggle(`kr-button--${this.color}`,!0),this.classList.toggle("kr-button--small","small"===this.size),this.classList.toggle("kr-button--large","large"===this.size)}render(){return V`
|
|
253
280
|
<slot></slot>
|
|
254
|
-
${"idle"!==this._state?
|
|
255
|
-
${"loading"===this._state?
|
|
281
|
+
${"idle"!==this._state?V`<span class="state-overlay">
|
|
282
|
+
${"loading"===this._state?V`<span class="spinner"></span>`:this._stateText}
|
|
256
283
|
</span>`:""}
|
|
257
|
-
`}},
|
|
284
|
+
`}},e.KRButton.styles=n`
|
|
258
285
|
:host {
|
|
259
286
|
display: inline-flex;
|
|
260
287
|
position: relative;
|
|
@@ -399,48 +426,47 @@ const bt=1,gt=2,mt=3,vt=4,yt=t=>(...e)=>({_$litDirective$:t,values:e});class xt{
|
|
|
399
426
|
height: 16px;
|
|
400
427
|
border-width: 3px;
|
|
401
428
|
}
|
|
402
|
-
|
|
429
|
+
`,Re([ue({type:String,reflect:!0})],e.KRButton.prototype,"variant",void 0),Re([ue({type:String,reflect:!0})],e.KRButton.prototype,"color",void 0),Re([ue({type:String,reflect:!0})],e.KRButton.prototype,"size",void 0),Re([ue({type:Boolean,reflect:!0})],e.KRButton.prototype,"disabled",void 0),Re([be()],e.KRButton.prototype,"_state",void 0),Re([be()],e.KRButton.prototype,"_stateText",void 0),e.KRButton=Re([ce("kr-button")],e.KRButton);
|
|
403
430
|
/**
|
|
404
431
|
* @license
|
|
405
432
|
* Copyright 2017 Google LLC
|
|
406
433
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
407
434
|
*/
|
|
408
|
-
class
|
|
435
|
+
class Ae extends _e{constructor(e){if(super(e),this.it=q,e.type!==ye)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===q||null==e)return this._t=void 0,this.it=e;if(e===N)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:[]}}}Ae.directiveName="unsafeHTML",Ae.resultType=1;const Se=ke(Ae);var Ee=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>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 V`
|
|
409
436
|
<div class="tabs">
|
|
410
437
|
<button
|
|
411
|
-
class=${
|
|
438
|
+
class=${$e({tab:!0,"tab--active":"preview"===this.activeTab})}
|
|
412
439
|
@click=${()=>this.setTab("preview")}
|
|
413
440
|
>
|
|
414
441
|
Preview
|
|
415
442
|
</button>
|
|
416
443
|
<button
|
|
417
|
-
class=${
|
|
444
|
+
class=${$e({tab:!0,"tab--active":"code"===this.activeTab})}
|
|
418
445
|
@click=${()=>this.setTab("code")}
|
|
419
446
|
>
|
|
420
447
|
Code
|
|
421
448
|
</button>
|
|
422
449
|
</div>
|
|
423
450
|
|
|
424
|
-
<div class=${
|
|
451
|
+
<div class=${$e({panel:!0,"panel--active":"preview"===this.activeTab,preview:!0})}>
|
|
425
452
|
<slot name="preview"></slot>
|
|
426
453
|
</div>
|
|
427
454
|
|
|
428
|
-
<div class=${
|
|
455
|
+
<div class=${$e({panel:!0,"panel--active":"code"===this.activeTab,"code-container":!0})}>
|
|
429
456
|
<button
|
|
430
|
-
class=${
|
|
457
|
+
class=${$e({"copy-btn":!0,"copy-btn--copied":this.copied})}
|
|
431
458
|
@click=${this.copyCode}
|
|
432
459
|
>
|
|
433
460
|
${this.copied?"Copied!":"Copy"}
|
|
434
461
|
</button>
|
|
435
|
-
<pre class="code"><code>${
|
|
462
|
+
<pre class="code"><code>${Se(this.getHighlightedCode())}</code></pre>
|
|
436
463
|
</div>
|
|
437
464
|
|
|
438
|
-
`}},
|
|
465
|
+
`}},e.KRCodeDemo.styles=n`
|
|
439
466
|
:host {
|
|
440
467
|
display: block;
|
|
441
468
|
border: 1px solid #e9ecef;
|
|
442
469
|
border-radius: 8px;
|
|
443
|
-
overflow: hidden;
|
|
444
470
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
445
471
|
}
|
|
446
472
|
|
|
@@ -448,6 +474,7 @@ class wt extends xt{constructor(t){if(super(t),this.it=I,t.type!==gt)throw Error
|
|
|
448
474
|
display: flex;
|
|
449
475
|
background: #f8f9fa;
|
|
450
476
|
border-bottom: 1px solid #e9ecef;
|
|
477
|
+
border-radius: 8px 8px 0 0;
|
|
451
478
|
}
|
|
452
479
|
|
|
453
480
|
.tab {
|
|
@@ -507,6 +534,7 @@ class wt extends xt{constructor(t){if(super(t),this.it=I,t.type!==gt)throw Error
|
|
|
507
534
|
font-size: 13px;
|
|
508
535
|
line-height: 1.6;
|
|
509
536
|
color: #cdd6f4;
|
|
537
|
+
border-radius: 0 0 8px 8px;
|
|
510
538
|
}
|
|
511
539
|
|
|
512
540
|
.code code {
|
|
@@ -594,20 +622,20 @@ class wt extends xt{constructor(t){if(super(t),this.it=I,t.type!==gt)throw Error
|
|
|
594
622
|
.code .token.variable {
|
|
595
623
|
color: #fab387;
|
|
596
624
|
}
|
|
597
|
-
`,
|
|
625
|
+
`,Ee([ue({type:String})],e.KRCodeDemo.prototype,"language",void 0),Ee([ue({type:String})],e.KRCodeDemo.prototype,"code",void 0),Ee([be()],e.KRCodeDemo.prototype,"activeTab",void 0),Ee([be()],e.KRCodeDemo.prototype,"copied",void 0),e.KRCodeDemo=Ee([ce("kr-code-demo")],e.KRCodeDemo);var Ce=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>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 V`
|
|
598
626
|
<div class="menu">
|
|
599
|
-
${this.items.map(
|
|
627
|
+
${this.items.map(e=>e.divider?V`<div class="menu__divider"></div>`:V`
|
|
600
628
|
<button
|
|
601
629
|
class="menu__item"
|
|
602
|
-
?disabled=${
|
|
603
|
-
@click=${()=>this.handleItemClick(
|
|
630
|
+
?disabled=${e.disabled}
|
|
631
|
+
@click=${()=>this.handleItemClick(e)}
|
|
604
632
|
>
|
|
605
|
-
${
|
|
606
|
-
${
|
|
633
|
+
${e.icon?V`<span class="menu__item-icon">${e.icon}</span>`:null}
|
|
634
|
+
${e.label}
|
|
607
635
|
</button>
|
|
608
636
|
`)}
|
|
609
637
|
</div>
|
|
610
|
-
`}},
|
|
638
|
+
`}},e.KRContextMenu.styles=n`
|
|
611
639
|
:host {
|
|
612
640
|
position: fixed;
|
|
613
641
|
z-index: 10000;
|
|
@@ -662,12 +690,12 @@ class wt extends xt{constructor(t){if(super(t),this.it=I,t.type!==gt)throw Error
|
|
|
662
690
|
background: rgba(255, 255, 255, 0.1);
|
|
663
691
|
margin: 4px 0;
|
|
664
692
|
}
|
|
665
|
-
`,
|
|
693
|
+
`,Ce([be()],e.KRContextMenu.prototype,"items",void 0),e.KRContextMenu=Ce([ce("kr-context-menu")],e.KRContextMenu);var Te=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};class Ke{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 Ke,r=document.createElement("kr-dialog");o.setDialogElement(r),r.dialogRef=o;const s=new e;return s.dialogRef=o,t?.data&&(s.data=t.data),r.contentElement=s,document.body.appendChild(r),document.addEventListener("keydown",r.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 V`
|
|
666
694
|
<div class="backdrop" @click=${this.handleBackdropClick}></div>
|
|
667
695
|
<div class="dialog">
|
|
668
696
|
${this.contentElement}
|
|
669
697
|
</div>
|
|
670
|
-
`}},
|
|
698
|
+
`}},e.KRDialog.styles=n`
|
|
671
699
|
:host {
|
|
672
700
|
position: fixed;
|
|
673
701
|
inset: 0;
|
|
@@ -692,10 +720,10 @@ class wt extends xt{constructor(t){if(super(t),this.it=I,t.type!==gt)throw Error
|
|
|
692
720
|
max-height: 90vh;
|
|
693
721
|
overflow: auto;
|
|
694
722
|
}
|
|
695
|
-
`,
|
|
696
|
-
${
|
|
723
|
+
`,Te([be()],e.KRDialog.prototype,"contentElement",void 0),e.KRDialog=Te([ce("kr-dialog")],e.KRDialog);var Oe,Pe=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};e.KRSnackbar=Oe=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}`),this.title&&this.classList.add("kr-snackbar--has-title"),Oe.activeSnackbars.push(this),this.updatePositions(),this.duration>0&&(this.dismissTimeout=window.setTimeout(()=>{this.dismiss()},this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=Oe.activeSnackbars.indexOf(this);e>-1&&Oe.activeSnackbars.splice(e,1),this.updatePositions(),this.dismissTimeout&&clearTimeout(this.dismissTimeout)}updatePositions(){let e=24;for(const t of Oe.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:V`<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:V`<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:V`<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:V`<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 V`
|
|
724
|
+
${e[this.type]}
|
|
697
725
|
<div class="content">
|
|
698
|
-
${this.title?
|
|
726
|
+
${this.title?V`<div class="title">${this.title}</div>`:""}
|
|
699
727
|
<div class="message">${this.message}</div>
|
|
700
728
|
</div>
|
|
701
729
|
<button
|
|
@@ -708,7 +736,7 @@ class wt extends xt{constructor(t){if(super(t),this.it=I,t.type!==gt)throw Error
|
|
|
708
736
|
<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"/>
|
|
709
737
|
</svg>
|
|
710
738
|
</button>
|
|
711
|
-
`}},
|
|
739
|
+
`}},e.KRSnackbar.styles=n`
|
|
712
740
|
:host,
|
|
713
741
|
*,
|
|
714
742
|
*::before,
|
|
@@ -855,45 +883,208 @@ class wt extends xt{constructor(t){if(super(t),this.it=I,t.type!==gt)throw Error
|
|
|
855
883
|
outline: 2px solid #3b82f6;
|
|
856
884
|
outline-offset: 2px;
|
|
857
885
|
}
|
|
858
|
-
`,
|
|
886
|
+
`,e.KRSnackbar.activeSnackbars=[],Pe([ue({type:String})],e.KRSnackbar.prototype,"type",void 0),Pe([ue({type:String})],e.KRSnackbar.prototype,"title",void 0),Pe([ue({type:String})],e.KRSnackbar.prototype,"message",void 0),Pe([ue({type:Number})],e.KRSnackbar.prototype,"duration",void 0),e.KRSnackbar=Oe=Pe([ce("kr-snackbar")],e.KRSnackbar);
|
|
859
887
|
/**
|
|
860
888
|
* @license
|
|
861
|
-
* Copyright
|
|
889
|
+
* Copyright 2018 Google LLC
|
|
890
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
891
|
+
*/
|
|
892
|
+
const Me="important",ze=" !"+Me,De=ke(class extends _e{constructor(e){if(super(e),e.type!==ve||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,i)=>{const o=e[i];return null==o?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const o=t[e];if(null!=o){this.ft.add(e);const t="string"==typeof o&&o.endsWith(ze);e.includes("-")||t?i.setProperty(e,t?o.slice(0,-11):o,t?Me:""):i[e]=o}}return N}});var Le=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};e.KRTabGroup=class extends ae{updated(e){e.has("activeTabId")&&this._updateActiveTab()}firstUpdated(){this._updateActiveTab()}_getTabs(){return Array.from(this.querySelectorAll("kr-tab"))}_updateActiveTab(){const e=this._getTabs();0!==e.length&&(this.activeTabId||(this.activeTabId=e[0]?.id),e.forEach(e=>{e.active=e.id===this.activeTabId}),this.requestUpdate())}_handleTabClick(e){e.disabled||(this.activeTabId=e.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:e.id},bubbles:!0,composed:!0})))}_handleTabDismiss(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("tab-dismiss",{detail:{tabId:e.id},bubbles:!0,composed:!0}))}_handleKeyDown(e){const t=this._getTabs().filter(e=>!e.disabled),i=t.findIndex(e=>e.id===this.activeTabId);let o=-1;switch(e.key){case"ArrowLeft":o=i>0?i-1:t.length-1;break;case"ArrowRight":o=i<t.length-1?i+1:0;break;case"Home":o=0;break;case"End":o=t.length-1}if(o>=0){e.preventDefault();const i=t[o];this.activeTabId=i.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:i.id},bubbles:!0,composed:!0}));const r=this.shadowRoot?.querySelectorAll(".label"),s=Array.from(r||[]).find(e=>e.getAttribute("data-tab-id")===i.id);s?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return q;const i=t.cloneNode(!0);return i.removeAttribute("slot"),V`<span class="label-icon">${i}</span>`}render(){return V`
|
|
893
|
+
<div class="header" role="tablist" @keydown=${this._handleKeyDown}>
|
|
894
|
+
${this._getTabs().map(e=>V`
|
|
895
|
+
<button
|
|
896
|
+
class=${$e({label:!0,"label--active":e.id===this.activeTabId})}
|
|
897
|
+
role="tab"
|
|
898
|
+
data-tab-id=${e.id}
|
|
899
|
+
aria-selected=${e.id===this.activeTabId}
|
|
900
|
+
aria-controls=${`panel-${e.id}`}
|
|
901
|
+
tabindex=${e.id===this.activeTabId?0:-1}
|
|
902
|
+
?disabled=${e.disabled}
|
|
903
|
+
@click=${()=>this._handleTabClick(e)}
|
|
904
|
+
>
|
|
905
|
+
${this._renderTabIcon(e)}
|
|
906
|
+
<span>${e.title}</span>
|
|
907
|
+
${e.badge?V`<span class="label-badge" style=${De({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:q}
|
|
908
|
+
${e.dismissible?V`
|
|
909
|
+
<button
|
|
910
|
+
class="label-dismiss"
|
|
911
|
+
type="button"
|
|
912
|
+
aria-label="Close tab"
|
|
913
|
+
@click=${t=>this._handleTabDismiss(e,t)}
|
|
914
|
+
>
|
|
915
|
+
<svg viewBox="0 0 20 20" fill="currentColor" width="12" height="12"><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"/></svg>
|
|
916
|
+
</button>
|
|
917
|
+
`:q}
|
|
918
|
+
</button>
|
|
919
|
+
`)}
|
|
920
|
+
</div>
|
|
921
|
+
<div class="content" role="tabpanel" aria-labelledby=${this.activeTabId||""}>
|
|
922
|
+
<slot @slotchange=${this._updateActiveTab}></slot>
|
|
923
|
+
</div>
|
|
924
|
+
`}},e.KRTabGroup.styles=[de,n`
|
|
925
|
+
:host {
|
|
926
|
+
display: flex;
|
|
927
|
+
flex-direction: column;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.header {
|
|
931
|
+
display: flex;
|
|
932
|
+
align-items: stretch;
|
|
933
|
+
border-bottom: 1px solid var(--kr-border);
|
|
934
|
+
overflow-x: auto;
|
|
935
|
+
scrollbar-width: none;
|
|
936
|
+
-ms-overflow-style: none;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.header::-webkit-scrollbar {
|
|
940
|
+
display: none;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
.label {
|
|
944
|
+
position: relative;
|
|
945
|
+
display: flex;
|
|
946
|
+
align-items: center;
|
|
947
|
+
gap: 8px;
|
|
948
|
+
padding: 12px 16px;
|
|
949
|
+
font-family: inherit;
|
|
950
|
+
font-size: 14px;
|
|
951
|
+
font-weight: 500;
|
|
952
|
+
color: var(--kr-text-muted);
|
|
953
|
+
background: none;
|
|
954
|
+
border: none;
|
|
955
|
+
border-bottom: 2px solid transparent;
|
|
956
|
+
cursor: pointer;
|
|
957
|
+
transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
|
|
958
|
+
white-space: nowrap;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.label:hover:not(:disabled) {
|
|
962
|
+
color: var(--kr-text);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.label:focus-visible {
|
|
966
|
+
outline: 2px solid var(--kr-focus);
|
|
967
|
+
outline-offset: -2px;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.label--active {
|
|
971
|
+
color: var(--kr-primary);
|
|
972
|
+
border-bottom-color: var(--kr-primary);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.label:disabled {
|
|
976
|
+
color: var(--kr-text-disabled);
|
|
977
|
+
cursor: not-allowed;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.label-icon {
|
|
981
|
+
display: flex;
|
|
982
|
+
align-items: center;
|
|
983
|
+
justify-content: center;
|
|
984
|
+
flex-shrink: 0;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
.label-badge {
|
|
988
|
+
font-size: 11px;
|
|
989
|
+
font-weight: 500;
|
|
990
|
+
color: var(--kr-primary-text);
|
|
991
|
+
background-color: var(--kr-primary);
|
|
992
|
+
padding: 2px 8px;
|
|
993
|
+
border-radius: 10px;
|
|
994
|
+
margin-left: 4px;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.label-dismiss {
|
|
998
|
+
display: flex;
|
|
999
|
+
align-items: center;
|
|
1000
|
+
justify-content: center;
|
|
1001
|
+
width: 16px;
|
|
1002
|
+
height: 16px;
|
|
1003
|
+
margin-left: 4px;
|
|
1004
|
+
padding: 0;
|
|
1005
|
+
background: none;
|
|
1006
|
+
border: none;
|
|
1007
|
+
border-radius: 2px;
|
|
1008
|
+
color: var(--kr-text-muted);
|
|
1009
|
+
cursor: pointer;
|
|
1010
|
+
transition: background-color 0.15s ease, color 0.15s ease;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.label-dismiss:hover {
|
|
1014
|
+
background-color: var(--kr-border);
|
|
1015
|
+
color: var(--kr-text);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.label-dismiss:focus-visible {
|
|
1019
|
+
outline: 2px solid var(--kr-focus);
|
|
1020
|
+
outline-offset: 2px;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
.content {
|
|
1024
|
+
padding: 16px;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/* Default slot styles - kr-tab children show/hide via their own active attribute */
|
|
1028
|
+
::slotted(kr-tab) {
|
|
1029
|
+
display: none;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
::slotted(kr-tab[active]) {
|
|
1033
|
+
display: block;
|
|
1034
|
+
}
|
|
1035
|
+
`],Le([ue({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),e.KRTabGroup=Le([ce("kr-tab-group")],e.KRTabGroup);var je=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};e.KRTab=class extends ae{constructor(){super(...arguments),this.id="",this.title="",this.badge="",this.badgeBackground="",this.badgeColor="",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot="icon"]')}render(){return V`<slot></slot>`}},e.KRTab.styles=[de,n`
|
|
1036
|
+
:host {
|
|
1037
|
+
display: none;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
:host([active]) {
|
|
1041
|
+
display: block;
|
|
1042
|
+
}
|
|
1043
|
+
`],je([ue({type:String,reflect:!0})],e.KRTab.prototype,"id",void 0),je([ue({type:String})],e.KRTab.prototype,"title",void 0),je([ue({type:String})],e.KRTab.prototype,"badge",void 0),je([ue({type:String,attribute:"badge-background"})],e.KRTab.prototype,"badgeBackground",void 0),je([ue({type:String,attribute:"badge-color"})],e.KRTab.prototype,"badgeColor",void 0),je([ue({type:Boolean})],e.KRTab.prototype,"disabled",void 0),je([ue({type:Boolean})],e.KRTab.prototype,"dismissible",void 0),je([ue({type:Boolean,reflect:!0})],e.KRTab.prototype,"active",void 0),e.KRTab=je([ce("kr-tab")],e.KRTab);
|
|
1044
|
+
/**
|
|
1045
|
+
* @license
|
|
1046
|
+
* Copyright 2018 Google LLC
|
|
862
1047
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
863
1048
|
*/
|
|
864
|
-
const
|
|
1049
|
+
const Be=e=>e??q,Ie={},He=ke(class extends _e{constructor(e){if(super(e),e.type!==me&&e.type!==ve&&e.type!==xe)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===N||t===q)return t;const i=e.element,o=e.name;if(e.type===me){if(t===i[o])return N}else if(e.type===xe){if(!!t===i.hasAttribute(o))return N}else if(e.type===ve&&i.getAttribute(o)===t+"")return N;return((e,t=Ie)=>{e._$AH=t;
|
|
1050
|
+
/**
|
|
1051
|
+
* @license
|
|
1052
|
+
* Copyright 2020 Google LLC
|
|
1053
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1054
|
+
*/})(e),t}});
|
|
865
1055
|
/**
|
|
866
1056
|
* @license
|
|
867
1057
|
* Copyright 2020 Google LLC
|
|
868
1058
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
869
|
-
*/
|
|
1059
|
+
*/var Ue=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>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._handleInvalid=e=>{e.preventDefault(),this._touched=!0},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}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage)}_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)}render(){let e="";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),V`
|
|
870
1060
|
<div class="wrapper">
|
|
871
|
-
${this.label?
|
|
1061
|
+
${this.label?V`
|
|
872
1062
|
<label for="input">
|
|
873
1063
|
${this.label}
|
|
874
|
-
${this.required?
|
|
1064
|
+
${this.required?V`<span class="required" aria-hidden="true">*</span>`:""}
|
|
875
1065
|
</label>
|
|
876
1066
|
`:""}
|
|
877
1067
|
<input
|
|
878
1068
|
id="input"
|
|
1069
|
+
class=${$e({"input--invalid":this._touched&&this._input&&!this._input.validity.valid})}
|
|
879
1070
|
type=${this.type}
|
|
880
1071
|
name=${this.name}
|
|
881
|
-
.value=${
|
|
1072
|
+
.value=${He(this.value)}
|
|
882
1073
|
placeholder=${this.placeholder}
|
|
883
1074
|
?required=${this.required}
|
|
884
1075
|
?disabled=${this.disabled}
|
|
885
1076
|
?readonly=${this.readonly}
|
|
886
|
-
minlength=${this.minlength
|
|
887
|
-
maxlength=${this.maxlength
|
|
888
|
-
pattern=${this.pattern
|
|
889
|
-
autocomplete=${this.autocomplete}
|
|
1077
|
+
minlength=${Be(this.minlength)}
|
|
1078
|
+
maxlength=${Be(this.maxlength)}
|
|
1079
|
+
pattern=${Be(this.pattern)}
|
|
1080
|
+
autocomplete=${Be(this.autocomplete||void 0)}
|
|
890
1081
|
@input=${this._handleInput}
|
|
891
1082
|
@change=${this._handleChange}
|
|
892
1083
|
@blur=${this._handleBlur}
|
|
893
1084
|
/>
|
|
894
|
-
${
|
|
1085
|
+
${e?V`<div class="validation-message">${e}</div>`:this.hint?V`<div class="hint">${this.hint}</div>`:""}
|
|
895
1086
|
</div>
|
|
896
|
-
`}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},
|
|
1087
|
+
`}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=n`
|
|
897
1088
|
:host {
|
|
898
1089
|
display: block;
|
|
899
1090
|
font-family: inherit;
|
|
@@ -943,11 +1134,11 @@ const Kt={},Ot=yt(class extends xt{constructor(t){if(super(t),t.type!==mt&&t.typ
|
|
|
943
1134
|
color: var(--kr-text-field-placeholder-color, #9ca3af);
|
|
944
1135
|
}
|
|
945
1136
|
|
|
946
|
-
|
|
1137
|
+
input.input--invalid {
|
|
947
1138
|
border-color: var(--kr-text-field-error-border-color, #ef4444);
|
|
948
1139
|
}
|
|
949
1140
|
|
|
950
|
-
|
|
1141
|
+
input.input--invalid:focus {
|
|
951
1142
|
box-shadow: 0 0 0 3px var(--kr-text-field-error-ring-color, rgba(239, 68, 68, 0.1));
|
|
952
1143
|
}
|
|
953
1144
|
|
|
@@ -960,11 +1151,249 @@ const Kt={},Ot=yt(class extends xt{constructor(t){if(super(t),t.type!==mt&&t.typ
|
|
|
960
1151
|
font-size: 0.75rem;
|
|
961
1152
|
color: var(--kr-text-field-helper-color, #6b7280);
|
|
962
1153
|
}
|
|
963
|
-
`,
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1154
|
+
`,e.KRTextField.formAssociated=!0,Ue([ue({type:String})],e.KRTextField.prototype,"label",void 0),Ue([ue({type:String})],e.KRTextField.prototype,"name",void 0),Ue([ue({type:String})],e.KRTextField.prototype,"value",void 0),Ue([ue({type:String})],e.KRTextField.prototype,"placeholder",void 0),Ue([ue({type:String})],e.KRTextField.prototype,"type",void 0),Ue([ue({type:Boolean})],e.KRTextField.prototype,"required",void 0),Ue([ue({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),Ue([ue({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),Ue([ue({type:Number})],e.KRTextField.prototype,"minlength",void 0),Ue([ue({type:Number})],e.KRTextField.prototype,"maxlength",void 0),Ue([ue({type:String})],e.KRTextField.prototype,"pattern",void 0),Ue([ue({type:String})],e.KRTextField.prototype,"autocomplete",void 0),Ue([ue({type:String})],e.KRTextField.prototype,"hint",void 0),Ue([fe("input")],e.KRTextField.prototype,"_input",void 0),Ue([be()],e.KRTextField.prototype,"_touched",void 0),Ue([be()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=Ue([ce("kr-text-field")],e.KRTextField);var Ve=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};e.KRSelect=class extends ae{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="Select an option",this.disabled=!1,this.required=!1,this.readonly=!1,this.hint="",this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._handleOutsideClick=e=>{this.contains(e.target)||this._close()},this._handleKeyDown=e=>{if(!this._isOpen)return;const t=Array.from(this.querySelectorAll("kr-select-option"));switch(e.key){case"Escape":this._close(),this._triggerElement?.focus();break;case"ArrowDown":if(e.preventDefault(),t.some(e=>!e.disabled)){let e=this._highlightedIndex+1;for(;e<t.length&&t[e]?.disabled;)e++;e<t.length&&(this._highlightedIndex=e)}break;case"ArrowUp":e.preventDefault();{let e=this._highlightedIndex-1;for(;e>=0&&t[e]?.disabled;)e--;e>=0&&(this._highlightedIndex=e)}break;case"Enter":e.preventDefault(),this._highlightedIndex>=0&&this._highlightedIndex<t.length&&this._selectOption(t[this._highlightedIndex])}},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._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick),document.addEventListener("keydown",this._handleKeyDown),this.addEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick),document.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("invalid",this._handleInvalid)}_toggle(){if(!this.disabled&&!this.readonly)if(this._isOpen)this._close();else{this._isOpen=!0;const e=Array.from(this.querySelectorAll("kr-select-option"));this._highlightedIndex=e.findIndex(e=>e.value===this.value)}}_close(){this._isOpen=!1,this._highlightedIndex=-1}_selectOption(e){e.disabled||(this.value=e.value,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._close(),this._triggerElement?.focus())}_handleBlur(){this._touched=!0,this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option",this._triggerElement):this._internals.setValidity({})}render(){const e=Array.from(this.querySelectorAll("kr-select-option")),t=e.find(e=>e.value===this.value)?.label;return V`
|
|
1155
|
+
<div class="wrapper">
|
|
1156
|
+
${this.label?V`
|
|
1157
|
+
<label>
|
|
1158
|
+
${this.label}
|
|
1159
|
+
${this.required?V`<span class="required" aria-hidden="true">*</span>`:""}
|
|
1160
|
+
</label>
|
|
1161
|
+
`:q}
|
|
1162
|
+
<div class="select-wrapper">
|
|
1163
|
+
<button
|
|
1164
|
+
class=${$e({"select-trigger":!0,"select-trigger--open":this._isOpen,"select-trigger--invalid":this._touched&&this.required&&!this.value})}
|
|
1165
|
+
type="button"
|
|
1166
|
+
?disabled=${this.disabled}
|
|
1167
|
+
aria-haspopup="listbox"
|
|
1168
|
+
aria-expanded=${this._isOpen}
|
|
1169
|
+
@click=${this._toggle}
|
|
1170
|
+
@blur=${this._handleBlur}
|
|
1171
|
+
>
|
|
1172
|
+
<span class=${$e({"select-value":!0,"select-placeholder":!t})}>
|
|
1173
|
+
${t||this.placeholder}
|
|
1174
|
+
</span>
|
|
1175
|
+
<svg
|
|
1176
|
+
class=${$e({"chevron-icon":!0,"select-icon":!0,"select-icon--open":this._isOpen})}
|
|
1177
|
+
viewBox="0 0 20 20"
|
|
1178
|
+
fill="currentColor"
|
|
1179
|
+
>
|
|
1180
|
+
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
|
|
1181
|
+
</svg>
|
|
1182
|
+
</button>
|
|
1183
|
+
|
|
1184
|
+
<div class=${$e({"select-dropdown":!0,hidden:!this._isOpen})} role="listbox">
|
|
1185
|
+
<div class="select-options">
|
|
1186
|
+
${0===e.length?V`<div class="select-empty">No options available</div>`:e.map((e,t)=>{const i=e.value===this.value;return V`
|
|
1187
|
+
<div
|
|
1188
|
+
class=${$e({"select-option":!0,"select-option--selected":i,"select-option--disabled":e.disabled,"select-option--highlighted":t===this._highlightedIndex})}
|
|
1189
|
+
role="option"
|
|
1190
|
+
aria-selected=${i}
|
|
1191
|
+
@click=${()=>this._selectOption(e)}
|
|
1192
|
+
@mouseenter=${()=>this._highlightedIndex=t}
|
|
1193
|
+
>
|
|
1194
|
+
${e.label}
|
|
1195
|
+
${i?V`<svg class="chevron-icon select-check" viewBox="0 0 20 20" fill="currentColor">
|
|
1196
|
+
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
|
|
1197
|
+
</svg>`:q}
|
|
1198
|
+
</div>
|
|
1199
|
+
`})}
|
|
1200
|
+
</div>
|
|
1201
|
+
</div>
|
|
1202
|
+
</div>
|
|
1203
|
+
${this._touched&&this.required&&!this.value?V`<div class="validation-message">Please select an option</div>`:this.hint?V`<div class="hint">${this.hint}</div>`:""}
|
|
1204
|
+
</div>
|
|
1205
|
+
<div class="options-slot">
|
|
1206
|
+
<slot @slotchange=${()=>this.requestUpdate()}></slot>
|
|
1207
|
+
</div>
|
|
1208
|
+
`}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}},e.KRSelect.styles=n`
|
|
1209
|
+
:host {
|
|
1210
|
+
display: block;
|
|
1211
|
+
font-family: inherit;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.wrapper {
|
|
1215
|
+
display: flex;
|
|
1216
|
+
flex-direction: column;
|
|
1217
|
+
gap: 0.25rem;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
label {
|
|
1221
|
+
font-size: 13px;
|
|
1222
|
+
font-weight: 500;
|
|
1223
|
+
color: var(--kr-select-label-color, #374151);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.required {
|
|
1227
|
+
color: var(--kr-select-required-color, #ef4444);
|
|
1228
|
+
margin-left: 0.125rem;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
.select-wrapper {
|
|
1232
|
+
position: relative;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.select-trigger {
|
|
1236
|
+
display: flex;
|
|
1237
|
+
align-items: center;
|
|
1238
|
+
justify-content: space-between;
|
|
1239
|
+
width: 100%;
|
|
1240
|
+
padding: 0.5rem 0.75rem;
|
|
1241
|
+
font-family: inherit;
|
|
1242
|
+
font-size: 14px;
|
|
1243
|
+
line-height: 1.5;
|
|
1244
|
+
color: var(--kr-select-color, #111827);
|
|
1245
|
+
background-color: var(--kr-select-bg, #fff);
|
|
1246
|
+
border: 1px solid var(--kr-select-border-color, #d1d5db);
|
|
1247
|
+
border-radius: 4px;
|
|
1248
|
+
cursor: pointer;
|
|
1249
|
+
transition: border-color 0.2s, box-shadow 0.2s;
|
|
1250
|
+
text-align: left;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
.select-trigger:hover:not(:disabled) {
|
|
1254
|
+
border-color: var(--kr-select-hover-border-color, #9ca3af);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
.select-trigger:focus {
|
|
1258
|
+
outline: none;
|
|
1259
|
+
border-color: var(--kr-select-focus-border-color, #2563eb);
|
|
1260
|
+
box-shadow: 0 0 0 3px var(--kr-select-focus-ring-color, rgba(37, 99, 235, 0.1));
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
.select-trigger:disabled {
|
|
1264
|
+
background-color: var(--kr-select-disabled-bg, #f3f4f6);
|
|
1265
|
+
color: var(--kr-select-disabled-color, #9ca3af);
|
|
1266
|
+
cursor: not-allowed;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
.select-trigger--invalid {
|
|
1270
|
+
border-color: var(--kr-select-error-border-color, #ef4444);
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.select-trigger--invalid:focus {
|
|
1274
|
+
border-color: var(--kr-select-error-border-color, #ef4444);
|
|
1275
|
+
box-shadow: 0 0 0 3px var(--kr-select-error-ring-color, rgba(239, 68, 68, 0.1));
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
.select-trigger--open {
|
|
1279
|
+
border-color: var(--kr-select-focus-border-color, #2563eb);
|
|
1280
|
+
box-shadow: 0 0 0 3px var(--kr-select-focus-ring-color, rgba(37, 99, 235, 0.1));
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
.select-value {
|
|
1284
|
+
flex: 1;
|
|
1285
|
+
overflow: hidden;
|
|
1286
|
+
text-overflow: ellipsis;
|
|
1287
|
+
white-space: nowrap;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
.select-placeholder {
|
|
1291
|
+
color: var(--kr-select-placeholder-color, #9ca3af);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
.select-icon {
|
|
1295
|
+
flex-shrink: 0;
|
|
1296
|
+
margin-left: 0.5rem;
|
|
1297
|
+
color: var(--kr-select-icon-color, #6b7280);
|
|
1298
|
+
transition: transform 0.2s;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
.select-icon--open {
|
|
1302
|
+
transform: rotate(180deg);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
.select-dropdown {
|
|
1306
|
+
position: absolute;
|
|
1307
|
+
top: 100%;
|
|
1308
|
+
left: 0;
|
|
1309
|
+
right: 0;
|
|
1310
|
+
z-index: 50;
|
|
1311
|
+
margin-top: 0.25rem;
|
|
1312
|
+
background-color: var(--kr-select-dropdown-bg, #fff);
|
|
1313
|
+
border: 1px solid var(--kr-select-dropdown-border-color, #e5e7eb);
|
|
1314
|
+
border-radius: 4px;
|
|
1315
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
1316
|
+
max-height: 300px;
|
|
1317
|
+
overflow-y: auto;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
.select-options {
|
|
1321
|
+
padding: 0.25rem;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
.select-option {
|
|
1325
|
+
display: flex;
|
|
1326
|
+
align-items: center;
|
|
1327
|
+
gap: 0.5rem;
|
|
1328
|
+
padding: 0.5rem 0.75rem;
|
|
1329
|
+
font-size: 14px;
|
|
1330
|
+
color: var(--kr-select-option-color, #111827);
|
|
1331
|
+
cursor: pointer;
|
|
1332
|
+
border-radius: 4px;
|
|
1333
|
+
transition: background-color 0.15s;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
.select-option:hover:not(.select-option--disabled) {
|
|
1337
|
+
background-color: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.select-option--selected {
|
|
1341
|
+
background-color: var(--kr-select-option-selected-bg, #eff6ff);
|
|
1342
|
+
color: var(--kr-select-option-selected-color, #1d4ed8);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.select-option--selected:hover {
|
|
1346
|
+
background-color: var(--kr-select-option-selected-hover-bg, #dbeafe);
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
.select-option--disabled {
|
|
1350
|
+
color: var(--kr-select-option-disabled-color, #9ca3af);
|
|
1351
|
+
cursor: not-allowed;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
.select-option--highlighted {
|
|
1355
|
+
background-color: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
.select-empty {
|
|
1359
|
+
padding: 1rem;
|
|
1360
|
+
text-align: center;
|
|
1361
|
+
color: var(--kr-select-empty-color, #6b7280);
|
|
1362
|
+
font-size: 14px;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
.select-check {
|
|
1366
|
+
color: var(--kr-select-check-color, #2563eb);
|
|
1367
|
+
flex-shrink: 0;
|
|
1368
|
+
margin-left: auto;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
.hint {
|
|
1372
|
+
font-size: 0.75rem;
|
|
1373
|
+
color: var(--kr-select-helper-color, #6b7280);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
.validation-message {
|
|
1377
|
+
font-size: 0.75rem;
|
|
1378
|
+
color: var(--kr-select-error-color, #ef4444);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.hidden {
|
|
1382
|
+
display: none;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
.chevron-icon {
|
|
1386
|
+
width: 16px;
|
|
1387
|
+
height: 16px;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
/* Hide the slot - options are rendered in dropdown */
|
|
1391
|
+
.options-slot {
|
|
1392
|
+
display: none;
|
|
1393
|
+
}
|
|
1394
|
+
`,e.KRSelect.formAssociated=!0,Ve([ue({type:String})],e.KRSelect.prototype,"label",void 0),Ve([ue({type:String})],e.KRSelect.prototype,"name",void 0),Ve([ue({type:String})],e.KRSelect.prototype,"value",void 0),Ve([ue({type:String})],e.KRSelect.prototype,"placeholder",void 0),Ve([ue({type:Boolean})],e.KRSelect.prototype,"disabled",void 0),Ve([ue({type:Boolean})],e.KRSelect.prototype,"required",void 0),Ve([ue({type:Boolean})],e.KRSelect.prototype,"readonly",void 0),Ve([ue({type:String})],e.KRSelect.prototype,"hint",void 0),Ve([be()],e.KRSelect.prototype,"_isOpen",void 0),Ve([be()],e.KRSelect.prototype,"_highlightedIndex",void 0),Ve([be()],e.KRSelect.prototype,"_touched",void 0),Ve([fe(".select-trigger")],e.KRSelect.prototype,"_triggerElement",void 0),e.KRSelect=Ve([ce("kr-select")],e.KRSelect);var Ne=function(e,t,i,o){var r,s=arguments.length,n=s<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--)(r=e[a])&&(n=(s<3?r(n):s>3?r(t,i,n):r(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};e.KRSelectOption=class extends ae{constructor(){super(...arguments),this.value="",this.disabled=!1}get label(){return this.textContent?.trim()||""}render(){return V`<slot></slot>`}},e.KRSelectOption.styles=n`
|
|
1395
|
+
:host {
|
|
1396
|
+
display: none;
|
|
1397
|
+
}
|
|
1398
|
+
`,Ne([ue({type:String})],e.KRSelectOption.prototype,"value",void 0),Ne([ue({type:Boolean})],e.KRSelectOption.prototype,"disabled",void 0),e.KRSelectOption=Ne([ce("kr-select-option")],e.KRSelectOption),e.DialogRef=Ke,e.krBaseCSS=de}),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);
|
|
970
1399
|
//# sourceMappingURL=krubble.umd.min.js.map
|