@kodaris/krubble-components 1.0.69 → 1.0.71
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 +63 -14
- package/dist/button/button.d.ts +7 -0
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +216 -2
- package/dist/button/button.js.map +1 -1
- package/dist/dialog/dialog.d.ts.map +1 -1
- package/dist/dialog/dialog.js +0 -1
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/krubble-components.bundled.js +216 -3
- package/dist/krubble-components.bundled.js.map +1 -1
- package/dist/krubble-components.bundled.min.js +186 -16
- package/dist/krubble-components.bundled.min.js.map +1 -1
- package/dist/krubble-components.umd.js +216 -3
- package/dist/krubble-components.umd.js.map +1 -1
- package/dist/krubble-components.umd.min.js +194 -24
- package/dist/krubble-components.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/,{is:n,defineProperty:d,getOwnPropertyDescriptor:h,getOwnPropertyNames:c,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,
|
|
11
|
+
*/,{is:n,defineProperty:d,getOwnPropertyDescriptor:h,getOwnPropertyNames:c,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,g=globalThis,f=g.trustedTypes,b=f?f.emptyScript:"",v=g.reactiveElementPolyfillSupport,_=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?b: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}},y=(e,t)=>!n(e,t),x={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;let k=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=x){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}=h(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)??x}static _$Ei(){if(this.hasOwnProperty(_("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(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const e=this.properties,t=[...c(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(l(e))}else void 0!==e&&t.push(l(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:m).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:m;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??y)(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){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[_("elementProperties")]=new Map,k[_("finalized")]=new Map,v?.({ReactiveElement:k}),(g.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 w=globalThis,$=w.trustedTypes,C=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,R="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+S,E=`<${T}>`,z=document,O=()=>z.createComment(""),D=e=>null===e||"object"!=typeof e&&"function"!=typeof e,K=Array.isArray,A="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,q=/>/g,L=RegExp(`>|${A}(?:([^\\s"'>=/]+)(${A}*=${A}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,
|
|
17
|
+
const w=globalThis,$=w.trustedTypes,C=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,R="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+S,E=`<${T}>`,z=document,O=()=>z.createComment(""),D=e=>null===e||"object"!=typeof e&&"function"!=typeof e,K=Array.isArray,A="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,q=/>/g,L=RegExp(`>|${A}(?:([^\\s"'>=/]+)(${A}*=${A}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,B=/"/g,V=/^(?:script|style|textarea|title)$/i,F=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),H=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),U=new WeakMap,N=z.createTreeWalker(z,129);function W(e,t){if(!K(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(t):t}const X=(e,t)=>{const i=e.length-1,o=[];let s,r=2===t?"<svg>":3===t?"<math>":"",a=P;for(let t=0;t<i;t++){const i=e[t];let l,n,d=-1,h=0;for(;h<i.length&&(a.lastIndex=h,n=a.exec(i),null!==n);)h=a.lastIndex,a===P?"!--"===n[1]?a=I:void 0!==n[1]?a=q:void 0!==n[2]?(V.test(n[2])&&(s=RegExp("</"+n[2],"g")),a=L):void 0!==n[3]&&(a=L):a===L?">"===n[0]?(a=s??P,d=-1):void 0===n[1]?d=-2:(d=a.lastIndex-n[2].length,l=n[1],a=void 0===n[3]?L:'"'===n[3]?B:M):a===B||a===M?a=L:a===I||a===q?a=P:(a=L,s=void 0);const c=a===L&&e[t+1].startsWith("/>")?" ":"";r+=a===P?i+E:d>=0?(o.push(l),i.slice(0,d)+R+i.slice(d)+S+c):i+S+(-2===d?t:c)}return[W(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class Y{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let s=0,r=0;const a=e.length-1,l=this.parts,[n,d]=X(e,t);if(this.el=Y.createElement(n,i),N.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=N.nextNode())&&l.length<a;){if(1===o.nodeType){if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(R)){const t=d[r++],i=o.getAttribute(e).split(S),a=/([.?@])?(.*)/.exec(t);l.push({type:1,index:s,name:a[2],strings:i,ctor:"."===a[1]?ee:"?"===a[1]?te:"@"===a[1]?ie:J}),o.removeAttribute(e)}else e.startsWith(S)&&(l.push({type:6,index:s}),o.removeAttribute(e));if(V.test(o.tagName)){const e=o.textContent.split(S),t=e.length-1;if(t>0){o.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],O()),N.nextNode(),l.push({type:2,index:++s});o.append(e[t],O())}}}else if(8===o.nodeType)if(o.data===T)l.push({type:2,index:s});else{let e=-1;for(;-1!==(e=o.data.indexOf(S,e+1));)l.push({type:7,index:s}),e+=S.length-1}s++}}static createElement(e,t){const i=z.createElement("template");return i.innerHTML=e,i}}function Z(e,t,i=e,o){if(t===H)return t;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=D(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=Z(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??z).importNode(t,!0);N.currentNode=o;let s=N.nextNode(),r=0,a=0,l=i[0];for(;void 0!==l;){if(r===l.index){let t;2===l.type?t=new G(s,s.nextSibling,this,e):1===l.type?t=new l.ctor(s,l.name,l.strings,this,e):6===l.type&&(t=new oe(s,this,e)),this._$AV.push(t),l=i[++a]}r!==l?.index&&(s=N.nextNode(),r++)}return N.currentNode=z,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 G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=j,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=Z(this,e,t),D(e)?e===j||null==e||""===e?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==H&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>K(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!==j&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(z.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=Y.createElement(W(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=U.get(e.strings);return void 0===t&&U.set(e.strings,t=new Y(e)),t}k(e){K(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 G(this.O(O()),this.O(O()),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=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,s){this.type=1,this._$AH=j,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=j}_$AI(e,t=this,i,o){const s=this.strings;let r=!1;if(void 0===s)e=Z(this,e,t,0),r=!D(e)||e!==this._$AH&&e!==H,r&&(this._$AH=e);else{const o=e;let a,l;for(e=s[0],a=0;a<s.length-1;a++)l=Z(this,o[i+a],t,a),l===H&&(l=this._$AH[a]),r||=!D(l)||l!==this._$AH[a],l===j?e=j:e!==j&&(e+=(l??"")+s[a+1]),this._$AH[a]=l}r&&!o&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ee extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}}class te extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}}class ie extends J{constructor(e,t,i,o,s){super(e,t,i,o,s),this.type=5}_$AI(e,t=this){if((e=Z(this,e,t,0)??j)===H)return;const i=this._$AH,o=e===j&&i!==j||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==j&&(i===j||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 oe{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){Z(this,e)}}const se=w.litHtmlPolyfillSupport;se?.(Y,G),(w.litHtmlVersions??=[]).push("3.3.2");const re=(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 G(t.insertBefore(O(),e),e,void 0,i??{})}return s._$AI(e),s
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
@@ -61,7 +61,7 @@ const w=globalThis,$=w.trustedTypes,C=$?$.createPolicy("lit-html",{createHTML:e=
|
|
|
61
61
|
* @license
|
|
62
62
|
* Copyright 2017 Google LLC
|
|
63
63
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
64
|
-
*/}function
|
|
64
|
+
*/}function ge(e){return ue({...e,state:!0,attribute:!1})}
|
|
65
65
|
/**
|
|
66
66
|
* @license
|
|
67
67
|
* Copyright 2017 Google LLC
|
|
@@ -72,7 +72,7 @@ const w=globalThis,$=w.trustedTypes,C=$?$.createPolicy("lit-html",{createHTML:e=
|
|
|
72
72
|
* Copyright 2017 Google LLC
|
|
73
73
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
74
|
*/
|
|
75
|
-
function
|
|
75
|
+
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 be=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRAccordion=class extends le{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return F`
|
|
76
76
|
<div class="header" @click=${this.toggle}>
|
|
77
77
|
<span class="header__title">${this.header}</span>
|
|
78
78
|
<svg class="header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -290,7 +290,29 @@ const ve=1,_e=2,me=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=cl
|
|
|
290
290
|
outline: 2px solid #3b82f6;
|
|
291
291
|
outline-offset: 2px;
|
|
292
292
|
}
|
|
293
|
-
`,$e([ue({type:String})],e.KRAlert.prototype,"type",void 0),$e([ue({type:String})],e.KRAlert.prototype,"title",void 0),$e([ue({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),$e([ue({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=$e([he("kr-alert")],e.KRAlert);var Ce=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRButton=class extends le{constructor(){super(...arguments),this.variant="flat",this.color="primary",this.size="medium",this.disabled=!1,this.options=[],this.iconPosition="left",this._state="idle",this._stateText="",this._dropdownOpened=!1,this._handleHostClick=e=>{this.options.length&&(e.stopPropagation(),this._toggleDropdown())},this._handleKeydown=e=>{"
|
|
293
|
+
`,$e([ue({type:String})],e.KRAlert.prototype,"type",void 0),$e([ue({type:String})],e.KRAlert.prototype,"title",void 0),$e([ue({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),$e([ue({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=$e([he("kr-alert")],e.KRAlert);var Ce=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRButton=class extends le{constructor(){super(...arguments),this.variant="flat",this.color="primary",this.size="medium",this.disabled=!1,this.options=[],this.iconPosition="left",this.split=!1,this._state="idle",this._stateText="",this._dropdownOpened=!1,this._handleHostClick=e=>{this.split&&this.options.length||this.options.length&&(e.stopPropagation(),this._toggleDropdown())},this._handleKeydown=e=>{if("Escape"===e.key&&this._dropdownOpened)this._dropdownOpened=!1;else{if("Enter"===e.key||" "===e.key){if(e.preventDefault(),this.split&&this.options.length)return void this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}));this.options.length?this._toggleDropdown():this.click()}this.split&&this.options.length&&"ArrowDown"===e.key&&(e.preventDefault(),this._dropdownOpened||this._toggleDropdown())}},this._handleClickOutside=e=>{this._dropdownOpened&&!this.contains(e.target)&&(this._dropdownOpened=!1)}}connectedCallback(){super.connectedCallback(),this.setAttribute("role",this.href?"link":"button"),this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeydown),this.addEventListener("click",this._handleHostClick),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown),this.removeEventListener("click",this._handleHostClick),document.removeEventListener("click",this._handleClickOutside)}_handleSplitPrimaryClick(e){e.stopPropagation(),this._dropdownOpened&&(this._dropdownOpened=!1),this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))}_handleSplitTriggerClick(e){e.stopPropagation(),this._toggleDropdown()}_toggleDropdown(){this._dropdownOpened=!this._dropdownOpened,this._dropdownOpened&&requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(e){const t=this.getBoundingClientRect();e.style.top=t.bottom+4+"px",e.style.bottom="",e.style.left=t.left+"px",e.style.right="",e.style.minWidth=t.width+"px",e.style.transformOrigin="top left";const i=e.getBoundingClientRect();i.bottom>window.innerHeight?(e.style.top="",e.style.bottom=window.innerHeight-t.top+4+"px",e.style.transformOrigin="bottom left",e.classList.add("dropdown--above")):e.classList.remove("dropdown--above"),i.right>window.innerWidth&&(e.style.left="",e.style.right=window.innerWidth-t.right+"px",i.bottom>window.innerHeight?e.style.transformOrigin="bottom right":e.style.transformOrigin="top right")}}))}_handleOptionClick(e,t){t.stopPropagation(),this._dropdownOpened=!1,this.dispatchEvent(new CustomEvent("option-select",{detail:{id:e.id,label:e.label},bubbles:!0,composed:!0}))}showLoading(){this._clearStateTimeout(),this._state="loading",this._stateText=""}showSuccess(e="Success",t=2e3){this._clearStateTimeout(),this._state="success",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}showError(e="Error",t=2e3){this._clearStateTimeout(),this._state="error",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}isLoading(){return"loading"===this._state}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),this.classList.toggle("kr-button--split",this.split&&!!this.options.length)}render(){if(this.split&&this.options.length)return F`
|
|
294
|
+
<div class="split-primary" @click=${e=>this._handleSplitPrimaryClick(e)}>
|
|
295
|
+
<span class="content">
|
|
296
|
+
<slot name="icon"></slot>
|
|
297
|
+
<slot></slot>
|
|
298
|
+
</span>
|
|
299
|
+
${"idle"!==this._state?F`<span class="state-overlay">
|
|
300
|
+
${"loading"===this._state?F`<span class="spinner"></span>`:this._stateText}
|
|
301
|
+
</span>`:j}
|
|
302
|
+
</div>
|
|
303
|
+
<div class="split-divider"></div>
|
|
304
|
+
<div class="split-trigger" @click=${e=>this._handleSplitTriggerClick(e)}>
|
|
305
|
+
<svg class="caret" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 24 24" fill="currentColor"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>
|
|
306
|
+
</div>
|
|
307
|
+
<div class="dropdown ${this._dropdownOpened?"dropdown--opened":""}">
|
|
308
|
+
${this.options.map((e=>F`
|
|
309
|
+
<button
|
|
310
|
+
class="dropdown-item"
|
|
311
|
+
@click=${t=>this._handleOptionClick(e,t)}
|
|
312
|
+
>${e.label}</button>
|
|
313
|
+
`))}
|
|
314
|
+
</div>
|
|
315
|
+
`;const e=F`
|
|
294
316
|
<span class="content">
|
|
295
317
|
<slot name="icon"></slot>
|
|
296
318
|
<slot></slot>
|
|
@@ -579,7 +601,155 @@ const ve=1,_e=2,me=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=cl
|
|
|
579
601
|
width: 22px;
|
|
580
602
|
height: 22px;
|
|
581
603
|
}
|
|
582
|
-
|
|
604
|
+
|
|
605
|
+
/* ========================
|
|
606
|
+
Split Button
|
|
607
|
+
======================== */
|
|
608
|
+
|
|
609
|
+
:host(.kr-button--split) {
|
|
610
|
+
padding: 0;
|
|
611
|
+
pointer-events: none;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.split-primary,
|
|
615
|
+
.split-trigger {
|
|
616
|
+
display: inline-flex;
|
|
617
|
+
align-items: center;
|
|
618
|
+
justify-content: center;
|
|
619
|
+
height: 100%;
|
|
620
|
+
cursor: pointer;
|
|
621
|
+
pointer-events: auto;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.split-primary {
|
|
625
|
+
padding: 0 16px 0 22px;
|
|
626
|
+
border-radius: 20px 0 0 20px;
|
|
627
|
+
position: relative;
|
|
628
|
+
flex: 1;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.split-trigger {
|
|
632
|
+
padding: 0 14px 0 8px;
|
|
633
|
+
border-radius: 0 20px 20px 0;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.split-trigger .caret {
|
|
637
|
+
margin: 0;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.split-divider {
|
|
641
|
+
width: 1px;
|
|
642
|
+
height: 100%;
|
|
643
|
+
flex-shrink: 0;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.dropdown {
|
|
647
|
+
pointer-events: auto;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/* Split: zone hover — flat primary */
|
|
651
|
+
:host(.kr-button--flat.kr-button--primary) .split-primary:hover,
|
|
652
|
+
:host(.kr-button--flat.kr-button--primary) .split-trigger:hover {
|
|
653
|
+
background: #0e1f35;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/* Split: zone hover — flat secondary */
|
|
657
|
+
:host(.kr-button--flat.kr-button--secondary) .split-primary:hover,
|
|
658
|
+
:host(.kr-button--flat.kr-button--secondary) .split-trigger:hover {
|
|
659
|
+
background: #e5e7eb;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/* Split: zone hover — flat danger */
|
|
663
|
+
:host(.kr-button--flat.kr-button--danger) .split-primary:hover,
|
|
664
|
+
:host(.kr-button--flat.kr-button--danger) .split-trigger:hover {
|
|
665
|
+
background: #b91c1c;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/* Split: zone hover — outline primary */
|
|
669
|
+
:host(.kr-button--outline.kr-button--primary) .split-primary:hover,
|
|
670
|
+
:host(.kr-button--outline.kr-button--primary) .split-trigger:hover {
|
|
671
|
+
background: rgba(22, 48, 82, 0.05);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/* Split: zone hover — outline secondary */
|
|
675
|
+
:host(.kr-button--outline.kr-button--secondary) .split-primary:hover,
|
|
676
|
+
:host(.kr-button--outline.kr-button--secondary) .split-trigger:hover {
|
|
677
|
+
background: #f9fafb;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/* Split: zone hover — outline danger */
|
|
681
|
+
:host(.kr-button--outline.kr-button--danger) .split-primary:hover,
|
|
682
|
+
:host(.kr-button--outline.kr-button--danger) .split-trigger:hover {
|
|
683
|
+
background: rgba(219, 38, 39, 0.05);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/* Split: divider colors — flat variants */
|
|
687
|
+
:host(.kr-button--flat.kr-button--primary) .split-divider {
|
|
688
|
+
background: rgba(255, 255, 255, 0.3);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
:host(.kr-button--flat.kr-button--secondary) .split-divider {
|
|
692
|
+
background: rgba(0, 0, 0, 0.15);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
:host(.kr-button--flat.kr-button--danger) .split-divider {
|
|
696
|
+
background: rgba(255, 255, 255, 0.3);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/* Split: divider colors — outline variants */
|
|
700
|
+
:host(.kr-button--outline.kr-button--primary) .split-divider {
|
|
701
|
+
background: #163052;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
:host(.kr-button--outline.kr-button--secondary) .split-divider {
|
|
705
|
+
background: #d1d5db;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
:host(.kr-button--outline.kr-button--danger) .split-divider {
|
|
709
|
+
background: rgb(219, 38, 39);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/* Split: size small */
|
|
713
|
+
:host(.kr-button--split.kr-button--small) .split-primary {
|
|
714
|
+
padding: 0 12px 0 16px;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
:host(.kr-button--split.kr-button--small) .split-trigger {
|
|
718
|
+
padding: 0 10px;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/* Split: size large */
|
|
722
|
+
:host(.kr-button--split.kr-button--large) .split-primary {
|
|
723
|
+
padding: 0 18px 0 24px;
|
|
724
|
+
border-radius: 30px 0 0 30px;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
:host(.kr-button--split.kr-button--large) .split-trigger {
|
|
728
|
+
padding: 0 16px;
|
|
729
|
+
border-radius: 0 30px 30px 0;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/* Split: disabled */
|
|
733
|
+
:host([disabled]) .split-primary,
|
|
734
|
+
:host([disabled]) .split-trigger {
|
|
735
|
+
cursor: not-allowed;
|
|
736
|
+
pointer-events: none;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/* Split: loading/success/error — overlay in primary zone only */
|
|
740
|
+
:host(.kr-button--split.kr-button--loading) .split-primary .content,
|
|
741
|
+
:host(.kr-button--split.kr-button--success) .split-primary .content,
|
|
742
|
+
:host(.kr-button--split.kr-button--error) .split-primary .content {
|
|
743
|
+
visibility: hidden;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
:host(.kr-button--split.kr-button--loading) .split-trigger,
|
|
747
|
+
:host(.kr-button--split.kr-button--success) .split-trigger,
|
|
748
|
+
:host(.kr-button--split.kr-button--error) .split-trigger {
|
|
749
|
+
pointer-events: none;
|
|
750
|
+
opacity: 0.6;
|
|
751
|
+
}
|
|
752
|
+
`,Ce([ue({type:String,reflect:!0})],e.KRButton.prototype,"variant",void 0),Ce([ue({type:String,reflect:!0})],e.KRButton.prototype,"color",void 0),Ce([ue({type:String,reflect:!0})],e.KRButton.prototype,"size",void 0),Ce([ue({type:Boolean,reflect:!0})],e.KRButton.prototype,"disabled",void 0),Ce([ue({type:String})],e.KRButton.prototype,"href",void 0),Ce([ue({type:String})],e.KRButton.prototype,"target",void 0),Ce([ue({type:Array})],e.KRButton.prototype,"options",void 0),Ce([ue({type:String,reflect:!0,attribute:"icon-position"})],e.KRButton.prototype,"iconPosition",void 0),Ce([ue({type:Boolean,reflect:!0})],e.KRButton.prototype,"split",void 0),Ce([ge()],e.KRButton.prototype,"_state",void 0),Ce([ge()],e.KRButton.prototype,"_stateText",void 0),Ce([ge()],e.KRButton.prototype,"_dropdownOpened",void 0),e.KRButton=Ce([he("kr-button")],e.KRButton);
|
|
583
753
|
/**
|
|
584
754
|
* @license
|
|
585
755
|
* Copyright 2017 Google LLC
|
|
@@ -738,7 +908,7 @@ class Re extends ke{constructor(e){if(super(e),this.it=j,e.type!==_e)throw Error
|
|
|
738
908
|
.hljs-attribute { color: #005cc5; }
|
|
739
909
|
.hljs-property { color: #005cc5; }
|
|
740
910
|
|
|
741
|
-
`],Te([ue({type:String})],e.KRCodeDemo.prototype,"language",void 0),Te([
|
|
911
|
+
`],Te([ue({type:String})],e.KRCodeDemo.prototype,"language",void 0),Te([ge()],e.KRCodeDemo.prototype,"code",void 0),Te([ge()],e.KRCodeDemo.prototype,"activeTab",void 0),Te([ge()],e.KRCodeDemo.prototype,"copied",void 0),Te([ge()],e.KRCodeDemo.prototype,"highlightedCode",void 0),e.KRCodeDemo=Te([he("kr-code-demo")],e.KRCodeDemo);var Ee=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRContextMenu=class extends le{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`
|
|
742
912
|
<div class="menu">
|
|
743
913
|
${this.items.map((e=>e.divider?F`<div class="menu__divider"></div>`:F`
|
|
744
914
|
<button
|
|
@@ -806,7 +976,7 @@ class Re extends ke{constructor(e){if(super(e),this.it=j,e.type!==_e)throw Error
|
|
|
806
976
|
background: rgba(255, 255, 255, 0.1);
|
|
807
977
|
margin: 4px 0;
|
|
808
978
|
}
|
|
809
|
-
`,Ee([
|
|
979
|
+
`,Ee([ge()],e.KRContextMenu.prototype,"items",void 0),e.KRContextMenu=Ee([he("kr-context-menu")],e.KRContextMenu);
|
|
810
980
|
/**
|
|
811
981
|
* @license
|
|
812
982
|
* Copyright 2018 Google LLC
|
|
@@ -845,7 +1015,7 @@ const ze="important",Oe=" !"+ze,De=xe(class extends ke{constructor(e){if(super(e
|
|
|
845
1015
|
gap: 12px;
|
|
846
1016
|
justify-content: flex-end;
|
|
847
1017
|
}
|
|
848
|
-
`,Ie=Ke([he("kr-dialog-footer")],Ie);class qe{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 le{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label="",this.width="560px",this._handleDocumentKeyDown=e=>{"Escape"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has("opened")&&(this.opened?document.addEventListener("keydown",this._handleDocumentKeyDown):document.removeEventListener("keydown",this._handleDocumentKeyDown))}open(){this.opened=!0
|
|
1018
|
+
`,Ie=Ke([he("kr-dialog-footer")],Ie);class qe{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 le{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label="",this.width="560px",this._handleDocumentKeyDown=e=>{"Escape"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has("opened")&&(this.opened?document.addEventListener("keydown",this._handleDocumentKeyDown):document.removeEventListener("keydown",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll("kr-dialog").forEach((e=>{e._dialogRef&&e.remove()}));const i=new qe,o=document.createElement("kr-dialog");i.setDialogElement(o),o._dialogRef=i;const s=new e;return s.dialogRef=i,t?.data&&(s.data=t.data),t?.label&&(o.label=t.label),t?.width&&(o.width=t.width),o._contentElement=s,o.opened=!0,document.body.appendChild(o),i}_handleBackdropClick(e){e.target.classList.contains("backdrop")&&this.close()}render(){return F`
|
|
849
1019
|
<div class="backdrop" @click=${this._handleBackdropClick}></div>
|
|
850
1020
|
<div class="dialog" style=${De({width:this.width})}>
|
|
851
1021
|
${this.label?F`<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>`:""}
|
|
@@ -917,7 +1087,7 @@ const ze="important",Oe=" !"+ze,De=xe(class extends ke{constructor(e){if(super(e
|
|
|
917
1087
|
display: flex;
|
|
918
1088
|
flex-direction: column;
|
|
919
1089
|
}
|
|
920
|
-
`,Ke([
|
|
1090
|
+
`,Ke([ge()],e.KRDialog.prototype,"_contentElement",void 0),Ke([ue({type:Boolean,reflect:!0})],e.KRDialog.prototype,"opened",void 0),Ke([ue({type:String})],e.KRDialog.prototype,"label",void 0),Ke([ue({type:String})],e.KRDialog.prototype,"width",void 0),e.KRDialog=Ke([he("kr-dialog")],e.KRDialog);var Le=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRDateRangePicker=class extends le{constructor(){super(...arguments),this.relativeOptions=[{key:"last-5-minutes",amount:5,unit:"minute",type:"relative"},{key:"last-30-minutes",amount:30,unit:"minute",type:"relative"},{key:"last-1-hour",amount:1,unit:"hour",type:"relative"},{key:"last-6-hours",amount:6,unit:"hour",type:"relative"},{key:"last-1-day",amount:1,unit:"day",type:"relative"},{key:"last-7-days",amount:7,unit:"day",type:"relative"},{key:"last-30-days",amount:30,unit:"day",type:"relative"}],this.disabled=!1,this.invalid=!1,this.placeholder="Select a date range",this.startDate="",this.endDate="",this._isOpen=!1,this._activeTab="relative",this._tempStartDate="",this._tempEndDate="",this._handleClickOutside=e=>{e.composedPath().includes(this)||(this._isOpen=!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleClickOutside),this.startDate&&(this._tempStartDate=this.startDate),this.endDate&&(this._tempEndDate=this.endDate),"relative"===this.mode?this._activeTab="relative":"absolute"===this.mode&&(this._activeTab="absolute")}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutside)}_handleTriggerClick(){this.disabled||(this._isOpen=!this._isOpen)}_handleTabClick(e){this._activeTab=e}_handleRelativeSelect(e){this.value={type:"relative",amount:e.amount,unit:e.unit},this._isOpen=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}_handleApplyAbsolute(){this._tempStartDate&&this._tempEndDate&&(this._tempStartDate>=this._tempEndDate||(this.value={type:"absolute",startDate:this._tempStartDate,endDate:this._tempEndDate},this.startDate=this._tempStartDate,this.endDate=this._tempEndDate,this._isOpen=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))))}_handleCancel(){this._isOpen=!1,this._tempStartDate=this.startDate,this._tempEndDate=this.endDate}_formatRelativeOption(e){if(0===e.amount)return"day"===e.unit?"Today":`This ${e.unit}`;const t={second:1===e.amount?"second":"seconds",minute:1===e.amount?"minute":"minutes",hour:1===e.amount?"hour":"hours",day:1===e.amount?"day":"days",week:1===e.amount?"week":"weeks",month:1===e.amount?"month":"months",year:1===e.amount?"year":"years"};return`Last ${e.amount} ${t[e.unit]}`}_getDisplayValue(){return this.value?"relative"===this.value.type&&void 0!==this.value.amount&&this.value.unit?this._formatRelativeOption({key:"",amount:this.value.amount,unit:this.value.unit,type:"relative"}):"absolute"===this.value.type&&this.value.startDate&&this.value.endDate?`${this.value.startDate} - ${this.value.endDate}`:"":""}_renderTriggerText(){const e=this._getDisplayValue();return e?F`${e}`:F`<span class="trigger-placeholder">${this.placeholder}</span>`}_renderContent(){return"relative"===this.mode?this._renderRelativeContent():"absolute"===this.mode?this._renderAbsoluteContent():"relative"===this._activeTab?this._renderRelativeContent():this._renderAbsoluteContent()}_renderRelativeContent(){return F`
|
|
921
1091
|
<div class="relative-options">
|
|
922
1092
|
${this.relativeOptions.map((e=>F`
|
|
923
1093
|
<button
|
|
@@ -1211,7 +1381,7 @@ const ze="important",Oe=" !"+ze,De=xe(class extends ke{constructor(e){if(super(e
|
|
|
1211
1381
|
padding: 0.75rem 1rem;
|
|
1212
1382
|
border-top: 1px solid #e5e7eb;
|
|
1213
1383
|
}
|
|
1214
|
-
`,Le([ue({type:Object})],e.KRDateRangePicker.prototype,"value",void 0),Le([ue({type:Array})],e.KRDateRangePicker.prototype,"relativeOptions",void 0),Le([ue({type:Boolean})],e.KRDateRangePicker.prototype,"disabled",void 0),Le([ue({type:Boolean})],e.KRDateRangePicker.prototype,"invalid",void 0),Le([ue({type:String})],e.KRDateRangePicker.prototype,"placeholder",void 0),Le([ue({type:String})],e.KRDateRangePicker.prototype,"startDate",void 0),Le([ue({type:String})],e.KRDateRangePicker.prototype,"endDate",void 0),Le([ue({type:String})],e.KRDateRangePicker.prototype,"mode",void 0),Le([
|
|
1384
|
+
`,Le([ue({type:Object})],e.KRDateRangePicker.prototype,"value",void 0),Le([ue({type:Array})],e.KRDateRangePicker.prototype,"relativeOptions",void 0),Le([ue({type:Boolean})],e.KRDateRangePicker.prototype,"disabled",void 0),Le([ue({type:Boolean})],e.KRDateRangePicker.prototype,"invalid",void 0),Le([ue({type:String})],e.KRDateRangePicker.prototype,"placeholder",void 0),Le([ue({type:String})],e.KRDateRangePicker.prototype,"startDate",void 0),Le([ue({type:String})],e.KRDateRangePicker.prototype,"endDate",void 0),Le([ue({type:String})],e.KRDateRangePicker.prototype,"mode",void 0),Le([ge()],e.KRDateRangePicker.prototype,"_isOpen",void 0),Le([ge()],e.KRDateRangePicker.prototype,"_activeTab",void 0),Le([ge()],e.KRDateRangePicker.prototype,"_tempStartDate",void 0),Le([ge()],e.KRDateRangePicker.prototype,"_tempEndDate",void 0),e.KRDateRangePicker=Le([he("kr-date-range-picker")],e.KRDateRangePicker);var Me,Be=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRSnackbar=Me=class extends le{constructor(){super(...arguments),this.dismissTimeout=null,this.type="info",this.title="",this.message="",this.duration=5e3}static show(e){for(const e of this.activeSnackbars)e.dismiss();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"),Me.activeSnackbars.push(this),this.duration>0&&(this.dismissTimeout=window.setTimeout((()=>{this.dismiss()}),this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=Me.activeSnackbars.indexOf(this);e>-1&&Me.activeSnackbars.splice(e,1),this.dismissTimeout&&clearTimeout(this.dismissTimeout)}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`
|
|
1215
1385
|
${e[this.type]}
|
|
1216
1386
|
<div class="content">
|
|
1217
1387
|
${this.title?F`<div class="title">${this.title}</div>`:""}
|
|
@@ -1375,7 +1545,7 @@ const ze="important",Oe=" !"+ze,De=xe(class extends ke{constructor(e){if(super(e
|
|
|
1375
1545
|
outline: 2px solid #3b82f6;
|
|
1376
1546
|
outline-offset: 2px;
|
|
1377
1547
|
}
|
|
1378
|
-
`,e.KRSnackbar.activeSnackbars=[],
|
|
1548
|
+
`,e.KRSnackbar.activeSnackbars=[],Be([ue({type:String})],e.KRSnackbar.prototype,"type",void 0),Be([ue({type:String})],e.KRSnackbar.prototype,"title",void 0),Be([ue({type:String})],e.KRSnackbar.prototype,"message",void 0),Be([ue({type:Number})],e.KRSnackbar.prototype,"duration",void 0),e.KRSnackbar=Me=Be([he("kr-snackbar")],e.KRSnackbar);var Ve=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRTabGroup=class extends le{constructor(){super(...arguments),this.justified=!1,this.size="medium"}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 s=this.shadowRoot?.querySelectorAll(".label"),r=Array.from(s||[]).find((e=>e.getAttribute("data-tab-id")===i.id));r?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return j;const i=t.cloneNode(!0);return i.removeAttribute("slot"),F`<span class="label-icon">${i}</span>`}render(){return F`
|
|
1379
1549
|
<div class="header" role="tablist" @keydown=${this._handleKeyDown}>
|
|
1380
1550
|
${this._getTabs().map((e=>F`
|
|
1381
1551
|
<button
|
|
@@ -1540,7 +1710,7 @@ const ze="important",Oe=" !"+ze,De=xe(class extends ke{constructor(e){if(super(e
|
|
|
1540
1710
|
::slotted(kr-tab[active]) {
|
|
1541
1711
|
display: block;
|
|
1542
1712
|
}
|
|
1543
|
-
`],
|
|
1713
|
+
`],Ve([ue({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),Ve([ue({type:Boolean})],e.KRTabGroup.prototype,"justified",void 0),Ve([ue({type:String,reflect:!0})],e.KRTabGroup.prototype,"size",void 0),e.KRTabGroup=Ve([he("kr-tab-group")],e.KRTabGroup);var Fe=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRTab=class extends le{constructor(){super(...arguments),this.id="",this.label="",this.badge="",this.badgeBackground="",this.badgeColor="",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot="icon"]')}updated(){const e=this.closest("kr-tab-group");e&&e.requestUpdate()}render(){return F`<slot></slot>`}},e.KRTab.styles=[de,a`
|
|
1544
1714
|
:host {
|
|
1545
1715
|
display: none;
|
|
1546
1716
|
}
|
|
@@ -1777,7 +1947,7 @@ const ze="important",Oe=" !"+ze,De=xe(class extends ke{constructor(e){if(super(e
|
|
|
1777
1947
|
.options-slot {
|
|
1778
1948
|
display: none;
|
|
1779
1949
|
}
|
|
1780
|
-
`],e.KRSelectField.formAssociated=!0,He([ue({type:String})],e.KRSelectField.prototype,"label",void 0),He([ue({type:String})],e.KRSelectField.prototype,"name",void 0),He([ue({type:String})],e.KRSelectField.prototype,"value",void 0),He([ue({type:String})],e.KRSelectField.prototype,"placeholder",void 0),He([ue({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),He([ue({type:Boolean})],e.KRSelectField.prototype,"required",void 0),He([ue({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),He([ue({type:String})],e.KRSelectField.prototype,"hint",void 0),He([
|
|
1950
|
+
`],e.KRSelectField.formAssociated=!0,He([ue({type:String})],e.KRSelectField.prototype,"label",void 0),He([ue({type:String})],e.KRSelectField.prototype,"name",void 0),He([ue({type:String})],e.KRSelectField.prototype,"value",void 0),He([ue({type:String})],e.KRSelectField.prototype,"placeholder",void 0),He([ue({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),He([ue({type:Boolean})],e.KRSelectField.prototype,"required",void 0),He([ue({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),He([ue({type:String})],e.KRSelectField.prototype,"hint",void 0),He([ge()],e.KRSelectField.prototype,"_isOpen",void 0),He([ge()],e.KRSelectField.prototype,"_highlightedIndex",void 0),He([ge()],e.KRSelectField.prototype,"_touched",void 0),He([fe(".select-trigger")],e.KRSelectField.prototype,"_triggerElement",void 0),e.KRSelectField=He([he("kr-select-field")],e.KRSelectField);var je=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRSelectOption=class extends le{constructor(){super(...arguments),this.value="",this.disabled=!1}get label(){return this.textContent?.trim()||""}render(){return F`<slot></slot>`}},e.KRSelectOption.styles=a`
|
|
1781
1951
|
:host {
|
|
1782
1952
|
display: none;
|
|
1783
1953
|
}
|
|
@@ -3018,7 +3188,7 @@ const ze="important",Oe=" !"+ze,De=xe(class extends ke{constructor(e){if(super(e
|
|
|
3018
3188
|
height: auto;
|
|
3019
3189
|
}
|
|
3020
3190
|
|
|
3021
|
-
`],tt([
|
|
3191
|
+
`],tt([ge()],e.KRTable.prototype,"_data",void 0),tt([ge()],e.KRTable.prototype,"_dataState",void 0),tt([ge()],e.KRTable.prototype,"_page",void 0),tt([ge()],e.KRTable.prototype,"_pageSize",void 0),tt([ge()],e.KRTable.prototype,"_totalItems",void 0),tt([ge()],e.KRTable.prototype,"_totalPages",void 0),tt([ge()],e.KRTable.prototype,"_searchQuery",void 0),tt([ge()],e.KRTable.prototype,"_canScrollLeft",void 0),tt([ge()],e.KRTable.prototype,"_canScrollRight",void 0),tt([ge()],e.KRTable.prototype,"_canScrollHorizontal",void 0),tt([ge()],e.KRTable.prototype,"_columnPickerOpen",void 0),tt([ge()],e.KRTable.prototype,"_filterPanelOpened",void 0),tt([ge()],e.KRTable.prototype,"_filterPanelTab",void 0),tt([ge()],e.KRTable.prototype,"_buckets",void 0),tt([ge()],e.KRTable.prototype,"_sorts",void 0),tt([ue({type:Object})],e.KRTable.prototype,"def",void 0),tt([ue({type:String,reflect:!0})],e.KRTable.prototype,"variant",void 0),e.KRTable=tt([he("kr-table")],e.KRTable);var ot=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRSpinner=class extends le{constructor(){super(...arguments),this.size="md",this.color="dark"}render(){var e="",t="";return e="sm"==this.size?"16px":"md"==this.size?"24px":"lg"==this.size?"32px":"xl"==this.size?"48px":this.size,t="dark"==this.color?"#163052":"light"==this.color?"#ffffff":this.color,F`
|
|
3022
3192
|
<svg
|
|
3023
3193
|
class="spinner"
|
|
3024
3194
|
style=${`width: ${e}; height: ${e}; color: ${t}`}
|
|
@@ -3342,7 +3512,7 @@ const ze="important",Oe=" !"+ze,De=xe(class extends ke{constructor(e){if(super(e
|
|
|
3342
3512
|
height: 18px;
|
|
3343
3513
|
fill: currentColor;
|
|
3344
3514
|
}
|
|
3345
|
-
`,e.KRFilePreview._activePreview=null,at([ue({type:String})],e.KRFilePreview.prototype,"src",void 0),at([ue({type:String})],e.KRFilePreview.prototype,"name",void 0),at([
|
|
3515
|
+
`,e.KRFilePreview._activePreview=null,at([ue({type:String})],e.KRFilePreview.prototype,"src",void 0),at([ue({type:String})],e.KRFilePreview.prototype,"name",void 0),at([ge()],e.KRFilePreview.prototype,"_zoomLevel",void 0),at([ge()],e.KRFilePreview.prototype,"_textContent",void 0),e.KRFilePreview=rt=at([he("kr-file-preview")],e.KRFilePreview);var lt=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRFileList=class extends le{constructor(){super(...arguments),this.files=[],this.emptyMessage="No files"}_handleFileClick(t){if(this.dispatchEvent(new CustomEvent("file-click",{bubbles:!0,composed:!0,detail:{file:t}})),t.url){e.KRFilePreview.open({src:t.url,name:t.name}).addEventListener("download",(()=>{this._handleDownload(t)}))}}_handleDownload(e){this.dispatchEvent(new CustomEvent("download",{bubbles:!0,composed:!0,detail:{file:e}}))}_handleDelete(e){this.dispatchEvent(new CustomEvent("delete",{bubbles:!0,composed:!0,detail:{file:e}}))}_getExtension(e){return e.split(".").pop()?.toLowerCase()||""}_getExtClass(e){return["pdf"].includes(e)?"file-list__ext--pdf":["doc","docx","rtf","txt"].includes(e)?"file-list__ext--doc":["xls","xlsx","csv"].includes(e)?"file-list__ext--xls":["zip","rar","7z","gz","tar"].includes(e)?"file-list__ext--zip":["jpg","jpeg","png","gif","webp","svg","bmp"].includes(e)?"file-list__ext--img":"file-list__ext--default"}_getExtIcon(e){return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(e)?F`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"/></svg>`:["pdf"].includes(e)?F`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"/></svg>`:["doc","docx","rtf","txt"].includes(e)?F`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2zm0 8h5v2H8v-2z"/></svg>`:["xls","xlsx","csv"].includes(e)?F`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h14zm0 5v4H5v-4h14zM5 19v-3h14v3H5zm2-8h4v2H7v-2zm0 5h4v2H7v-2z"/></svg>`:["zip","rar","7z","gz","tar"].includes(e)?F`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h-2v-2zm0-4h2v2h-2v-2zm-2 2h2v2h-2v-2z"/></svg>`:F`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>`}render(){return this.files.length?F`
|
|
3346
3516
|
<div class="file-list">
|
|
3347
3517
|
${this.files.map((e=>{const t=this._getExtension(e.name),i=e.meta||e.date||"";return F`
|
|
3348
3518
|
<div class="file-list__item">
|
|
@@ -3583,7 +3753,7 @@ const nt=e=>e??j
|
|
|
3583
3753
|
font-size: 0.75rem;
|
|
3584
3754
|
color: var(--kr-text-field-helper-color, #6b7280);
|
|
3585
3755
|
}
|
|
3586
|
-
`,e.KRTextField.formAssociated=!0,ct([ue({type:String})],e.KRTextField.prototype,"label",void 0),ct([ue({type:String})],e.KRTextField.prototype,"name",void 0),ct([ue({type:String})],e.KRTextField.prototype,"value",void 0),ct([ue({type:String})],e.KRTextField.prototype,"placeholder",void 0),ct([ue({type:String})],e.KRTextField.prototype,"type",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"required",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),ct([ue({type:Number})],e.KRTextField.prototype,"minlength",void 0),ct([ue({type:Number})],e.KRTextField.prototype,"maxlength",void 0),ct([ue({type:String})],e.KRTextField.prototype,"pattern",void 0),ct([ue({type:String})],e.KRTextField.prototype,"autocomplete",void 0),ct([ue({type:String})],e.KRTextField.prototype,"hint",void 0),ct([
|
|
3756
|
+
`,e.KRTextField.formAssociated=!0,ct([ue({type:String})],e.KRTextField.prototype,"label",void 0),ct([ue({type:String})],e.KRTextField.prototype,"name",void 0),ct([ue({type:String})],e.KRTextField.prototype,"value",void 0),ct([ue({type:String})],e.KRTextField.prototype,"placeholder",void 0),ct([ue({type:String})],e.KRTextField.prototype,"type",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"required",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),ct([ue({type:Number})],e.KRTextField.prototype,"minlength",void 0),ct([ue({type:Number})],e.KRTextField.prototype,"maxlength",void 0),ct([ue({type:String})],e.KRTextField.prototype,"pattern",void 0),ct([ue({type:String})],e.KRTextField.prototype,"autocomplete",void 0),ct([ue({type:String})],e.KRTextField.prototype,"hint",void 0),ct([fe("input")],e.KRTextField.prototype,"_input",void 0),ct([ge()],e.KRTextField.prototype,"_touched",void 0),ct([ge()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=ct([he("kr-text-field")],e.KRTextField);var pt=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRTextareaField=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=3,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._textarea&&this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}render(){let e="";return this._touched&&this._textarea&&!this._textarea.validity.valid&&(e=this._textarea.validationMessage),F`
|
|
3587
3757
|
<div class="wrapper">
|
|
3588
3758
|
${this.label?F`
|
|
3589
3759
|
<label for="textarea">
|
|
@@ -3681,12 +3851,12 @@ const nt=e=>e??j
|
|
|
3681
3851
|
font-size: 0.75rem;
|
|
3682
3852
|
color: var(--kr-textarea-field-helper-color, #6b7280);
|
|
3683
3853
|
}
|
|
3684
|
-
`,e.KRTextareaField.formAssociated=!0,pt([ue({type:String})],e.KRTextareaField.prototype,"label",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"name",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"value",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"rows",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"cols",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"hint",void 0),pt([
|
|
3854
|
+
`,e.KRTextareaField.formAssociated=!0,pt([ue({type:String})],e.KRTextareaField.prototype,"label",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"name",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"value",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"rows",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"cols",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"hint",void 0),pt([fe("textarea")],e.KRTextareaField.prototype,"_textarea",void 0),pt([ge()],e.KRTextareaField.prototype,"_touched",void 0),pt([ge()],e.KRTextareaField.prototype,"_dirty",void 0),e.KRTextareaField=pt([he("kr-textarea-field")],e.KRTextareaField);var ut=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let gt=class extends le{constructor(){super(...arguments),this.label="",this.value=""}render(){return F`
|
|
3685
3855
|
<div class="wrapper">
|
|
3686
3856
|
${this.label?F`<label>${this.label}</label>`:j}
|
|
3687
3857
|
<div class="value">${this.value}</div>
|
|
3688
3858
|
</div>
|
|
3689
|
-
`}};
|
|
3859
|
+
`}};gt.styles=a`
|
|
3690
3860
|
:host {
|
|
3691
3861
|
display: block;
|
|
3692
3862
|
font-family: inherit;
|
|
@@ -3708,7 +3878,7 @@ const nt=e=>e??j
|
|
|
3708
3878
|
font-size: 14px;
|
|
3709
3879
|
color: black;
|
|
3710
3880
|
}
|
|
3711
|
-
`,ut([ue({type:String})],
|
|
3881
|
+
`,ut([ue({type:String})],gt.prototype,"label",void 0),ut([ue({type:String})],gt.prototype,"value",void 0),gt=ut([he("kr-detail-field")],gt);var ft=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRAutoSuggest=class extends le{constructor(){super(),this._requestId=0,this._handleDocumentClick=e=>{e.composedPath().includes(this)||(this._isOpen=!1)},this.label="",this.name="",this.value="",this.placeholder="",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint="",this.options=[],this.fetch=null,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity(),e.has("options")&&this._isOpen&&this._positionDropdown()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._isOpen=!1,this._highlightedIndex=-1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_fetch(){if(!this.fetch)return;this._requestId++;const e=this._requestId;this.fetch(this.value).then((t=>{e===this._requestId&&(this.options=t)})).catch((e=>{console.error("kr-auto-suggest: fetch failed",e)}))}_handleInput(e){this.value=e.target.value,this._isOpen=!0,this._highlightedIndex=-1,this._positionDropdown(),this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._fetch()}_positionDropdown(){requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(!e)return;const t=this._input.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8,o=t.top-4-8;e.style.left=t.left+"px",e.style.width=t.width+"px",o>i?(e.style.top="",e.style.bottom=window.innerHeight-t.top+4+"px",e.style.maxHeight=o+"px"):(e.style.bottom="",e.style.top=t.bottom+4+"px",e.style.maxHeight=i+"px")}))}_handleFocus(){this._isOpen=!0,this._positionDropdown(),this._fetch()}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage),setTimeout((()=>{this._isOpen=!1,this._highlightedIndex=-1}),200)}_handleKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._isOpen=!0,this._highlightedIndex=Math.min(this._highlightedIndex+1,this.options.length-1),this._scrollToHighlighted();break;case"ArrowUp":e.preventDefault(),-1===this._highlightedIndex?(this._isOpen=!0,this._highlightedIndex=this.options.length-1):this._highlightedIndex=Math.max(this._highlightedIndex-1,0),this._scrollToHighlighted();break;case"Enter":this._highlightedIndex>=0&&this.options[this._highlightedIndex]&&(e.preventDefault(),this._selectOption(this.options[this._highlightedIndex]));break;case"Escape":e.preventDefault(),this._isOpen=!1,this._highlightedIndex=-1;break;case"Tab":this._isOpen=!1,this._highlightedIndex=-1}}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(".dropdown"),t=this.shadowRoot?.querySelector(".option--highlighted");if(e&&t){const i=e.getBoundingClientRect(),o=t.getBoundingClientRect();(o.bottom>i.bottom||o.top<i.top)&&t.scrollIntoView({block:"nearest"})}}))}_selectOption(e){e.disabled||(this.value=e.value,this._isOpen=!1,this._highlightedIndex=-1,this._internals.setFormValue(this.value),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_handleClear(){this.value="",this._internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._input?.focus()}_handleOptionMouseEnter(e,t){this._highlightedIndex=t}_renderOption(e,t){return F`
|
|
3712
3882
|
<button
|
|
3713
3883
|
class=${we({option:!0,"option--highlighted":t===this._highlightedIndex})}
|
|
3714
3884
|
type="button"
|
|
@@ -3930,7 +4100,7 @@ const nt=e=>e??j
|
|
|
3930
4100
|
font-size: 0.75rem;
|
|
3931
4101
|
color: var(--kr-text-field-error-color, #ef4444);
|
|
3932
4102
|
}
|
|
3933
|
-
`,e.KRAutoSuggest.formAssociated=!0,
|
|
4103
|
+
`,e.KRAutoSuggest.formAssociated=!0,ft([ue({type:String})],e.KRAutoSuggest.prototype,"label",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"name",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"value",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"placeholder",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"disabled",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"readonly",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"required",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"hint",void 0),ft([ue({type:Array})],e.KRAutoSuggest.prototype,"options",void 0),ft([ue({attribute:!1})],e.KRAutoSuggest.prototype,"fetch",void 0),ft([ge()],e.KRAutoSuggest.prototype,"_isOpen",void 0),ft([ge()],e.KRAutoSuggest.prototype,"_highlightedIndex",void 0),ft([ge()],e.KRAutoSuggest.prototype,"_touched",void 0),ft([fe("input")],e.KRAutoSuggest.prototype,"_input",void 0),e.KRAutoSuggest=ft([he("kr-auto-suggest")],e.KRAutoSuggest);var bt=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRComboBox=class extends le{constructor(){super(),this._requestId=0,this._selectedOption=null,this._handleDocumentClick=e=>{e.composedPath().includes(this)||this._close()},this.label="",this.name="",this.value="",this.placeholder="Select an option",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint="",this.optionValue="value",this.optionLabel="label",this.options=[],this.fetch=null,this.fetchSelection=null,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._searchQuery="",this._loading=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity(),this.value&&this.fetchSelection&&this._resolveSelection()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity(),e.has("value")&&(this.value?this._selectedOption&&this._getOptionValue(this._selectedOption)===this.value||this._resolveSelection():this._selectedOption=null),e.has("options")&&this._isOpen&&this._positionDropdown()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._selectedOption=null,this._touched=!1,this._isOpen=!1,this._highlightedIndex=-1,this._searchQuery="",this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}focus(){this._isOpen||this._open()}blur(){this._triggerElement?.blur()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option",this._triggerElement):this._internals.setValidity({})}_handleTriggerClick(){this.disabled||this.readonly||(this._isOpen?this._close():this._open())}_open(){this._isOpen=!0,this._searchQuery="",this._highlightedIndex=-1,this._fetch(),this.updateComplete.then((()=>{this._positionDropdown(),this._searchInput&&this._searchInput.focus()}))}_close(){this._isOpen=!1,this._highlightedIndex=-1,this._searchQuery=""}_positionDropdown(){requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(!e)return;const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8,o=t.top-4-8;e.style.left=t.left+"px",e.style.width=t.width+"px",i<200&&o>i?(e.style.top="",e.style.bottom=window.innerHeight-t.top+4+"px",e.style.maxHeight=o+"px"):(e.style.bottom="",e.style.top=t.bottom+4+"px",e.style.maxHeight=i+"px")}))}_fetch(){if(!this.fetch)return;this._loading=!0,this._requestId++;const e=this._requestId;this.fetch(this._searchQuery).then((t=>{e===this._requestId&&(this.options=t,this._loading=!1)})).catch((e=>{console.error("kr-combo-box: fetch failed",e),this._loading=!1}))}_handleSearchInput(e){this._searchQuery=e.target.value,this._highlightedIndex=-1,this._fetch()}_handleSearchKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._highlightedIndex=Math.min(this._highlightedIndex+1,this.options.length-1),this._scrollToHighlighted();break;case"ArrowUp":e.preventDefault(),-1===this._highlightedIndex?this._highlightedIndex=this.options.length-1:this._highlightedIndex=Math.max(this._highlightedIndex-1,0),this._scrollToHighlighted();break;case"Enter":e.preventDefault(),this._highlightedIndex>=0&&this.options[this._highlightedIndex]&&this._selectOption(this.options[this._highlightedIndex]);break;case"Escape":e.preventDefault(),this._close(),this._triggerElement?.focus();break;case"Tab":this._close()}}_handleTriggerKeyDown(e){"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._isOpen||this._open())}_handleTriggerBlur(){this._touched=!0,this._updateValidity()}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(".options"),t=this.shadowRoot?.querySelector(".option--highlighted");if(e&&t){const i=e.getBoundingClientRect(),o=t.getBoundingClientRect();(o.bottom>i.bottom||o.top<i.top)&&t.scrollIntoView({block:"nearest"})}}))}_getOptionValue(e){return"function"==typeof this.optionValue?this.optionValue(e):e[this.optionValue]}_getOptionLabel(e){let t;return t="function"==typeof this.optionLabel?this.optionLabel(e):e[this.optionLabel],t||this._getOptionValue(e)}_resolveSelection(){if(!this.fetchSelection)return;const e=this.value;this.fetchSelection(this.value).then((t=>{this.value===e&&t&&(this._selectedOption=t,this.requestUpdate())})).catch((e=>{console.error("kr-combo-box: fetchSelection failed",e)}))}_selectOption(e){e.disabled||(this.value=this._getOptionValue(e),this._selectedOption=e,this._close(),this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new CustomEvent("select",{detail:{option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._triggerElement?.focus())}_handleOptionMouseEnter(e,t){this._highlightedIndex=t}_renderOption(e,t){const i=this._getOptionValue(e);return F`
|
|
3934
4104
|
<button
|
|
3935
4105
|
class=${we({option:!0,"option--highlighted":t===this._highlightedIndex,"option--selected":i===this.value})}
|
|
3936
4106
|
type="button"
|
|
@@ -4212,7 +4382,7 @@ const nt=e=>e??j
|
|
|
4212
4382
|
font-size: 0.75rem;
|
|
4213
4383
|
color: var(--kr-text-field-error-color, #ef4444);
|
|
4214
4384
|
}
|
|
4215
|
-
`,e.KRComboBox.formAssociated=!0,bt([ue({type:String})],e.KRComboBox.prototype,"label",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"name",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"value",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"placeholder",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"disabled",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"readonly",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"required",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"hint",void 0),bt([ue({attribute:"option-value"})],e.KRComboBox.prototype,"optionValue",void 0),bt([ue({attribute:"option-label"})],e.KRComboBox.prototype,"optionLabel",void 0),bt([ue({type:Array})],e.KRComboBox.prototype,"options",void 0),bt([ue({attribute:!1})],e.KRComboBox.prototype,"fetch",void 0),bt([ue({attribute:!1})],e.KRComboBox.prototype,"fetchSelection",void 0),bt([
|
|
4385
|
+
`,e.KRComboBox.formAssociated=!0,bt([ue({type:String})],e.KRComboBox.prototype,"label",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"name",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"value",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"placeholder",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"disabled",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"readonly",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"required",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"hint",void 0),bt([ue({attribute:"option-value"})],e.KRComboBox.prototype,"optionValue",void 0),bt([ue({attribute:"option-label"})],e.KRComboBox.prototype,"optionLabel",void 0),bt([ue({type:Array})],e.KRComboBox.prototype,"options",void 0),bt([ue({attribute:!1})],e.KRComboBox.prototype,"fetch",void 0),bt([ue({attribute:!1})],e.KRComboBox.prototype,"fetchSelection",void 0),bt([ge()],e.KRComboBox.prototype,"_isOpen",void 0),bt([ge()],e.KRComboBox.prototype,"_highlightedIndex",void 0),bt([ge()],e.KRComboBox.prototype,"_touched",void 0),bt([ge()],e.KRComboBox.prototype,"_searchQuery",void 0),bt([ge()],e.KRComboBox.prototype,"_loading",void 0),bt([fe(".trigger")],e.KRComboBox.prototype,"_triggerElement",void 0),bt([fe(".search__input")],e.KRComboBox.prototype,"_searchInput",void 0),e.KRComboBox=bt([he("kr-combo-box")],e.KRComboBox);var vt=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRRadioCards=class extends le{constructor(){super(),this._focusedIndex=-1,this.label="",this.name="",this.value="",this.options=[],this.disabled=!1,this.required=!1,this.hint="",this.direction="row",this._touched=!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._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.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option"):this._internals.setValidity({})}_handleCardClick(e,t){this.disabled||t.disabled||(this.value=t.value,this._touched=!0,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_handleKeyDown(e,t){if(this.disabled)return;if(" "===e.key||"Enter"===e.key)return e.preventDefault(),void(this.options[t].disabled||this._handleCardClick(e,this.options[t]));let i=-1;if("row"===this.direction?"ArrowRight"===e.key?i=this._findNextEnabledIndex(t,1):"ArrowLeft"===e.key&&(i=this._findNextEnabledIndex(t,-1)):"ArrowDown"===e.key?i=this._findNextEnabledIndex(t,1):"ArrowUp"===e.key&&(i=this._findNextEnabledIndex(t,-1)),i>=0){e.preventDefault(),this._focusedIndex=i;const t=this.shadowRoot?.querySelectorAll(".card");t[i]&&t[i].focus()}}_findNextEnabledIndex(e,t){let i=e+t;for(;i>=0&&i<this.options.length;){if(!this.options[i].disabled)return i;i+=t}return-1}render(){return F`
|
|
4216
4386
|
<div class="wrapper">
|
|
4217
4387
|
${this.label?F`
|
|
4218
4388
|
<label>
|
|
@@ -4370,7 +4540,7 @@ const nt=e=>e??j
|
|
|
4370
4540
|
font-size: 0.75rem;
|
|
4371
4541
|
color: var(--kr-radio-cards-error-color, #ef4444);
|
|
4372
4542
|
}
|
|
4373
|
-
`],e.KRRadioCards.formAssociated=!0,vt([ue({type:String})],e.KRRadioCards.prototype,"label",void 0),vt([ue({type:String})],e.KRRadioCards.prototype,"name",void 0),vt([ue({type:String})],e.KRRadioCards.prototype,"value",void 0),vt([ue({attribute:!1})],e.KRRadioCards.prototype,"options",void 0),vt([ue({type:Boolean})],e.KRRadioCards.prototype,"disabled",void 0),vt([ue({type:Boolean})],e.KRRadioCards.prototype,"required",void 0),vt([ue({type:String})],e.KRRadioCards.prototype,"hint",void 0),vt([ue({type:String})],e.KRRadioCards.prototype,"direction",void 0),vt([
|
|
4543
|
+
`],e.KRRadioCards.formAssociated=!0,vt([ue({type:String})],e.KRRadioCards.prototype,"label",void 0),vt([ue({type:String})],e.KRRadioCards.prototype,"name",void 0),vt([ue({type:String})],e.KRRadioCards.prototype,"value",void 0),vt([ue({attribute:!1})],e.KRRadioCards.prototype,"options",void 0),vt([ue({type:Boolean})],e.KRRadioCards.prototype,"disabled",void 0),vt([ue({type:Boolean})],e.KRRadioCards.prototype,"required",void 0),vt([ue({type:String})],e.KRRadioCards.prototype,"hint",void 0),vt([ue({type:String})],e.KRRadioCards.prototype,"direction",void 0),vt([ge()],e.KRRadioCards.prototype,"_touched",void 0),e.KRRadioCards=vt([he("kr-radio-cards")],e.KRRadioCards);var _t=function(e,t,i,o){var s,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(a=(r<3?s(a):r>3?s(t,i,a):s(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRCheckbox=class extends le{constructor(){super(),this.label="",this.name="",this.value="on",this.checked=!1,this.disabled=!1,this.required=!1,this.hint="",this._touched=!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.checked=!1,this._touched=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.checked=e===this.value}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._syncFormValue(),this._updateValidity()}updated(e){(e.has("checked")||e.has("value"))&&this._syncFormValue(),(e.has("required")||e.has("checked"))&&this._updateValidity()}_syncFormValue(){this.checked?this._internals.setFormValue(this.value):this._internals.setFormValue("")}_updateValidity(){this.required&&!this.checked?this._internals.setValidity({valueMissing:!0},"This field is required"):this._internals.setValidity({})}_handleClick(e){this.disabled||(this.checked=!this.checked,this._touched=!0,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_handleKeyDown(e){this.disabled||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),this._handleClick(e))}render(){return F`
|
|
4374
4544
|
<div class="wrapper">
|
|
4375
4545
|
<div
|
|
4376
4546
|
class=${we({checkbox:!0,"checkbox--disabled":this.disabled})}
|
|
@@ -4479,5 +4649,5 @@ const nt=e=>e??j
|
|
|
4479
4649
|
color: var(--kr-checkbox-error-color, #ef4444);
|
|
4480
4650
|
margin-left: 26px;
|
|
4481
4651
|
}
|
|
4482
|
-
`],e.KRCheckbox.formAssociated=!0,_t([ue({type:String})],e.KRCheckbox.prototype,"label",void 0),_t([ue({type:String})],e.KRCheckbox.prototype,"name",void 0),_t([ue({type:String})],e.KRCheckbox.prototype,"value",void 0),_t([ue({type:Boolean})],e.KRCheckbox.prototype,"checked",void 0),_t([ue({type:Boolean})],e.KRCheckbox.prototype,"disabled",void 0),_t([ue({type:Boolean})],e.KRCheckbox.prototype,"required",void 0),_t([ue({type:String})],e.KRCheckbox.prototype,"hint",void 0),_t([
|
|
4652
|
+
`],e.KRCheckbox.formAssociated=!0,_t([ue({type:String})],e.KRCheckbox.prototype,"label",void 0),_t([ue({type:String})],e.KRCheckbox.prototype,"name",void 0),_t([ue({type:String})],e.KRCheckbox.prototype,"value",void 0),_t([ue({type:Boolean})],e.KRCheckbox.prototype,"checked",void 0),_t([ue({type:Boolean})],e.KRCheckbox.prototype,"disabled",void 0),_t([ue({type:Boolean})],e.KRCheckbox.prototype,"required",void 0),_t([ue({type:String})],e.KRCheckbox.prototype,"hint",void 0),_t([ge()],e.KRCheckbox.prototype,"_touched",void 0),e.KRCheckbox=_t([he("kr-checkbox")],e.KRCheckbox),e.KRDialogRef=qe,e.KRQuery=et,e.KR_OPERATORS=Ue,e.getOperatorsForType=Ne,e.krBaseCSS=de})),function(e){Object.keys(e).forEach((function(t){t.startsWith("KR")&&"function"==typeof e[t]&&(e[t.slice(2)]=e[t])}))}(kr);
|
|
4483
4653
|
//# sourceMappingURL=krubble-components.umd.min.js.map
|