@kodaris/krubble-components 1.0.39 → 1.0.41
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 +763 -9
- package/dist/form/auto-suggest/auto-suggest.d.ts +100 -0
- package/dist/form/auto-suggest/auto-suggest.d.ts.map +1 -0
- package/dist/form/auto-suggest/auto-suggest.js +779 -0
- package/dist/form/auto-suggest/auto-suggest.js.map +1 -0
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +1 -0
- package/dist/form/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/krubble-components.bundled.js +918 -145
- package/dist/krubble-components.bundled.js.map +1 -1
- package/dist/krubble-components.bundled.min.js +392 -20
- package/dist/krubble-components.bundled.min.js.map +1 -1
- package/dist/krubble-components.umd.js +917 -144
- package/dist/krubble-components.umd.js.map +1 -1
- package/dist/krubble-components.umd.min.js +389 -17
- package/dist/krubble-components.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/,{is:a,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,
|
|
11
|
+
*/,{is:a,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,g=globalThis,f=g.trustedTypes,b=f?f.emptyScript:"",v=g.reactiveElementPolyfillSupport,y=(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}},x=(e,t)=>!a(e,t),_={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:x};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=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(e,i,t);void 0!==o&&d(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){const{get:o,set:s}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const r=o?.call(this);s?.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(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(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??x)(s,t)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:s},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==s||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===o&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,o=this[t];!0!==e||this._$AL.has(t)||void 0===o||this.C(t,void 0,i,o)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[y("elementProperties")]=new Map,k[y("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,R=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,S="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+C,
|
|
17
|
+
const w=globalThis,$=w.trustedTypes,R=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,S="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+C,A=`<${T}>`,K=document,E=()=>K.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,z=Array.isArray,P="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,D=/>/g,M=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,I=/"/g,F=/^(?:script|style|textarea|title)$/i,q=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),H=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),U=new WeakMap,N=K.createTreeWalker(K,129);function W(e,t){if(!z(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(t):t}const Z=(e,t)=>{const i=e.length-1,o=[];let s,r=2===t?"<svg>":3===t?"<math>":"",n=L;for(let t=0;t<i;t++){const i=e[t];let l,a,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,a=n.exec(i),null!==a);)c=n.lastIndex,n===L?"!--"===a[1]?n=j:void 0!==a[1]?n=D:void 0!==a[2]?(F.test(a[2])&&(s=RegExp("</"+a[2],"g")),n=M):void 0!==a[3]&&(n=M):n===M?">"===a[0]?(n=s??L,d=-1):void 0===a[1]?d=-2:(d=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?M:'"'===a[3]?I:B):n===I||n===B?n=M:n===j||n===D?n=L:(n=M,s=void 0);const h=n===M&&e[t+1].startsWith("/>")?" ":"";r+=n===L?i+A:d>=0?(o.push(l),i.slice(0,d)+S+i.slice(d)+C+h):i+C+(-2===d?t:h)}return[W(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class G{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let s=0,r=0;const n=e.length-1,l=this.parts,[a,d]=Z(e,t);if(this.el=G.createElement(a,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<n;){if(1===o.nodeType){if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(S)){const t=d[r++],i=o.getAttribute(e).split(C),n=/([.?@])?(.*)/.exec(t);l.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?ee:"?"===n[1]?te:"@"===n[1]?ie:J}),o.removeAttribute(e)}else e.startsWith(C)&&(l.push({type:6,index:s}),o.removeAttribute(e));if(F.test(o.tagName)){const e=o.textContent.split(C),t=e.length-1;if(t>0){o.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],E()),N.nextNode(),l.push({type:2,index:++s});o.append(e[t],E())}}}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(C,e+1));)l.push({type:7,index:s}),e+=C.length-1}s++}}static createElement(e,t){const i=K.createElement("template");return i.innerHTML=e,i}}function Q(e,t,i=e,o){if(t===H)return t;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=O(t)?void 0:t._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(e),s._$AT(e,i,o)),void 0!==o?(i._$Co??=[])[o]=s:i._$Cl=s),void 0!==s&&(t=Q(e,s._$AS(e,t.values),s,o)),t}class X{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);N.currentNode=o;let s=N.nextNode(),r=0,n=0,l=i[0];for(;void 0!==l;){if(r===l.index){let t;2===l.type?t=new Y(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[++n]}r!==l?.index&&(s=N.nextNode(),r++)}return N.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=V,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=Q(this,e,t),O(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==H&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>z(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!==V&&O(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=G.createElement(W(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(t);else{const e=new X(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 G(e)),t}k(e){z(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const s of e)o===t.length?t.push(i=new Y(this.O(E()),this.O(E()),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=V,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=V}_$AI(e,t=this,i,o){const s=this.strings;let r=!1;if(void 0===s)e=Q(this,e,t,0),r=!O(e)||e!==this._$AH&&e!==H,r&&(this._$AH=e);else{const o=e;let n,l;for(e=s[0],n=0;n<s.length-1;n++)l=Q(this,o[i+n],t,n),l===H&&(l=this._$AH[n]),r||=!O(l)||l!==this._$AH[n],l===V?e=V:e!==V&&(e+=(l??"")+s[n+1]),this._$AH[n]=l}r&&!o&&this.j(e)}j(e){e===V?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===V?void 0:e}}class te extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}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=Q(this,e,t,0)??V)===H)return;const i=this._$AH,o=e===V&&i!==V||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==V&&(i===V||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){Q(this,e)}}const se=w.litHtmlPolyfillSupport;se?.(G,Y),(w.litHtmlVersions??=[]).push("3.3.2");const re=globalThis;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/let ne=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const o=i?.renderBefore??t;let s=o._$litPart$;if(void 0===s){const e=i?.renderBefore??null;o._$litPart$=s=new Y(t.insertBefore(
|
|
22
|
+
*/let ne=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const o=i?.renderBefore??t;let s=o._$litPart$;if(void 0===s){const e=i?.renderBefore??null;o._$litPart$=s=new Y(t.insertBefore(E(),e),e,void 0,i??{})}return s._$AI(e),s})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};ne._$litElement$=!0,ne.finalized=!0,re.litElementHydrateSupport?.({LitElement:ne});const le=re.litElementPolyfillSupport;le?.({LitElement:ne}),(re.litElementVersions??=[]).push("4.2.2");const ae=n`
|
|
23
23
|
:host,
|
|
24
24
|
*,
|
|
25
25
|
*::before,
|
|
@@ -72,7 +72,7 @@ const w=globalThis,$=w.trustedTypes,R=$?$.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 ge(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 fe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRAccordion=class extends ne{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return q`
|
|
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">
|
|
@@ -138,7 +138,7 @@ function fe(e,t){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
138
138
|
.content__body {
|
|
139
139
|
padding: 16px 16px 8px 16px;
|
|
140
140
|
}
|
|
141
|
-
`,
|
|
141
|
+
`,fe([pe({type:String})],e.KRAccordion.prototype,"header",void 0),fe([pe({type:Boolean,reflect:!0})],e.KRAccordion.prototype,"expanded",void 0),e.KRAccordion=fe([de("kr-accordion")],e.KRAccordion);
|
|
142
142
|
/**
|
|
143
143
|
* @license
|
|
144
144
|
* Copyright 2017 Google LLC
|
|
@@ -797,7 +797,7 @@ class Re extends _e{constructor(e){if(super(e),this.it=V,e.type!==ve)throw Error
|
|
|
797
797
|
* Copyright 2018 Google LLC
|
|
798
798
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
799
799
|
*/
|
|
800
|
-
const
|
|
800
|
+
const Ae="important",Ke=" !"+Ae,Ee=xe(class extends _e{constructor(e){if(super(e),e.type!==be||"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(Ke);e.includes("-")||t?i.setProperty(e,t?o.slice(0,-11):o,t?Ae:""):i[e]=o}}return H}});var Oe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ze=class extends ne{render(){return q`<slot></slot>`}};ze.styles=n`
|
|
801
801
|
:host {
|
|
802
802
|
display: flex;
|
|
803
803
|
padding: 0 24px;
|
|
@@ -832,7 +832,7 @@ const Ee="important",Ae=" !"+Ee,Ke=xe(class extends _e{constructor(e){if(super(e
|
|
|
832
832
|
}
|
|
833
833
|
`,Le=Oe([de("kr-dialog-footer")],Le);class je{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 ne{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 je,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 q`
|
|
834
834
|
<div class="backdrop" @click=${this._handleBackdropClick}></div>
|
|
835
|
-
<div class="dialog" style=${
|
|
835
|
+
<div class="dialog" style=${Ee({width:this.width})}>
|
|
836
836
|
${this.label?q`<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>`:""}
|
|
837
837
|
${this._contentElement?this._contentElement:q`<slot></slot>`}
|
|
838
838
|
</div>
|
|
@@ -1073,7 +1073,7 @@ const Ee="important",Ae=" !"+Ee,Ke=xe(class extends _e{constructor(e){if(super(e
|
|
|
1073
1073
|
>
|
|
1074
1074
|
${this._renderTabIcon(e)}
|
|
1075
1075
|
<span>${e.label}</span>
|
|
1076
|
-
${e.badge?q`<span class="label-badge" style=${
|
|
1076
|
+
${e.badge?q`<span class="label-badge" style=${Ee({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:V}
|
|
1077
1077
|
${e.dismissible?q`
|
|
1078
1078
|
<button
|
|
1079
1079
|
class="label-dismiss"
|
|
@@ -1223,7 +1223,7 @@ const Ee="important",Ae=" !"+Ee,Ke=xe(class extends _e{constructor(e){if(super(e
|
|
|
1223
1223
|
::slotted(kr-tab[active]) {
|
|
1224
1224
|
display: block;
|
|
1225
1225
|
}
|
|
1226
|
-
`],Be([pe({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),Be([pe({type:Boolean})],e.KRTabGroup.prototype,"justified",void 0),Be([pe({type:String,reflect:!0})],e.KRTabGroup.prototype,"size",void 0),e.KRTabGroup=Be([de("kr-tab-group")],e.KRTabGroup);var
|
|
1226
|
+
`],Be([pe({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),Be([pe({type:Boolean})],e.KRTabGroup.prototype,"justified",void 0),Be([pe({type:String,reflect:!0})],e.KRTabGroup.prototype,"size",void 0),e.KRTabGroup=Be([de("kr-tab-group")],e.KRTabGroup);var Ie=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRTab=class extends ne{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"]')}render(){return console.log("tab render"),q`<slot></slot>`}},e.KRTab.styles=[ae,n`
|
|
1227
1227
|
:host {
|
|
1228
1228
|
display: none;
|
|
1229
1229
|
}
|
|
@@ -1233,7 +1233,7 @@ const Ee="important",Ae=" !"+Ee,Ke=xe(class extends _e{constructor(e){if(super(e
|
|
|
1233
1233
|
width: 100%;
|
|
1234
1234
|
height: 100%;
|
|
1235
1235
|
}
|
|
1236
|
-
`],
|
|
1236
|
+
`],Ie([pe({type:String,reflect:!0})],e.KRTab.prototype,"id",void 0),Ie([pe({type:String})],e.KRTab.prototype,"label",void 0),Ie([pe({type:String})],e.KRTab.prototype,"badge",void 0),Ie([pe({type:String,attribute:"badge-background"})],e.KRTab.prototype,"badgeBackground",void 0),Ie([pe({type:String,attribute:"badge-color"})],e.KRTab.prototype,"badgeColor",void 0),Ie([pe({type:Boolean})],e.KRTab.prototype,"disabled",void 0),Ie([pe({type:Boolean})],e.KRTab.prototype,"dismissible",void 0),Ie([pe({type:Boolean,reflect:!0})],e.KRTab.prototype,"active",void 0),e.KRTab=Ie([de("kr-tab")],e.KRTab);var Fe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const qe=['"',"+","-","&&","||","!","(",")","{","}","[","]","^","~","*","?",":"],He=['\\"',"\\+","\\-","\\&\\&","\\|\\|","\\!","\\(","\\)","\\{","\\}","\\[","\\]","\\^","\\~","\\*","\\?","\\:"];function Ve(e){let t=e;for(let e=0;e<qe.length;e++)t=t.split(qe[e]).join(He[e]);return t}e.KRTable=class extends ne{constructor(){super(...arguments),this._scrollStyle="overlay",this._data=[],this._dataState="idle",this._page=1,this._pageSize=50,this._totalItems=0,this._totalPages=0,this._searchQuery="",this._canScrollLeft=!1,this._canScrollRight=!1,this._canScrollHorizontal=!1,this._columnPickerOpen=!1,this._displayedColumns=[],this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._def={columns:[]},this.def={columns:[]},this._handleClickOutsideColumnPicker=e=>{if(!this._columnPickerOpen)return;const t=e.composedPath(),i=this.shadowRoot?.querySelector(".column-picker-wrapper");i&&!t.includes(i)&&(this._columnPickerOpen=!1)},this._handleResizeMove=e=>{if(!this._resizing)return;const t=this._def.columns.find((e=>e.id===this._resizing.columnId));if(t){const i=this._resizing.startWidth+(e.clientX-this._resizing.startX);t.width=`${Math.min(900,Math.max(50,i))}px`,this.requestUpdate()}},this._handleResizeEnd=()=>{this._resizing=null,document.removeEventListener("mousemove",this._handleResizeMove),document.removeEventListener("mouseup",this._handleResizeEnd)}}connectedCallback(){super.connectedCallback(),this.classList.toggle("kr-table--scroll-overlay","overlay"===this._scrollStyle),this.classList.toggle("kr-table--scroll-edge","edge"===this._scrollStyle),this._fetch(),this._initRefresh(),document.addEventListener("click",this._handleClickOutsideColumnPicker),this._resizeObserver=new ResizeObserver((()=>{this._searchPositionLocked=!1,this._updateSearchPosition()})),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this._refreshTimer),document.removeEventListener("click",this._handleClickOutsideColumnPicker),this._resizeObserver?.disconnect()}willUpdate(e){e.has("def")&&(this._def={...this.def,columns:this.def.columns.map((e=>"actions"===e.type?{...e,label:e.label??"",sticky:"right",resizable:!1}:{...e}))},this._displayedColumns=this._def.displayedColumns||this._def.columns.map((e=>e.id)),this._fetch(),this._initRefresh())}updated(e){this._updateScrollFlags(),this._syncSlottedContent()}_syncSlottedContent(){const e=this.getDisplayedColumns().filter((e=>e.render));e.length&&(this.querySelectorAll('[slot^="cell-"]').forEach((e=>e.remove())),this._data.forEach(((t,i)=>{e.forEach((e=>{const o=e.render(t),s="string"==typeof o?o:"";if(s){const t=document.createElement("span");t.slot=`cell-${i}-${e.id}`,"actions"===e.type&&(t.style.display="flex",t.style.gap="8px"),t.innerHTML=s,this.appendChild(t)}}))})))}refresh(){this._fetch()}goToPrevPage(){this._page>1&&(this._page--,this._fetch())}goToNextPage(){this._page<this._totalPages&&(this._page++,this._fetch())}goToPage(e){e>=1&&e<=this._totalPages&&(this._page=e,this._fetch())}_fetch(){if(!this._def.dataSource)return;let t;switch(this._dataState="loading",this._def.dataSource.mode){case"opensearch":throw Error("Opensearch not supported yet");case"db":t={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]},this._searchQuery?.trim().length&&this._def.columns.filter((e=>e.searchable)).forEach((e=>{t.queryFields.push({name:e.id,operation:"CONTAINS",value:this._searchQuery,and:!1})}));break;default:t={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]},this._searchQuery?.trim().length&&t.queryFields.push({name:"_text_",operation:"IS",value:Ve(this._searchQuery)})}this._def.dataSource.fetch(t).then((e=>{switch(this._def.dataSource?.mode){case"opensearch":throw Error("Opensearch not supported yet");case"db":{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size;break}default:{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size}}this._dataState="success",this._updateSearchPosition()})).catch((t=>{this._dataState="error",e.KRSnackbar.show({message:t instanceof Error?t.message:"Failed to load data",type:"error"})}))}_initRefresh(){clearInterval(this._refreshTimer),this._def.refreshInterval&&this._def.refreshInterval>0&&(this._refreshTimer=window.setInterval((()=>{this._fetch()}),this._def.refreshInterval))}_handleSearch(e){const t=e.target;this._searchQuery=t.value,this._page=1,this._fetch()}_getGridTemplateColumns(){return this.getDisplayedColumns().map((e=>e.width?e.width:"actions"===e.type?"max-content":"minmax(80px, auto)")).join(" ")}_updateSearchPosition(){if(this._searchPositionLocked)return;const e=this.shadowRoot?.querySelector(".search"),t=e?.querySelector(".search-field");e&&t&&(e.style.justifyContent="center",t.style.marginLeft="",requestAnimationFrame((()=>{const i=e.getBoundingClientRect(),o=t.getBoundingClientRect().left-i.left;e.style.justifyContent="flex-start",t.style.marginLeft=`${o}px`,this._searchPositionLocked=!0})))}_toggleColumnPicker(){this._columnPickerOpen=!this._columnPickerOpen}_toggleColumn(e){this._displayedColumns.includes(e)?this._displayedColumns=this._displayedColumns.filter((t=>t!==e)):this._displayedColumns=[...this._displayedColumns,e]}getDisplayedColumns(){return this._displayedColumns.map((e=>this._def.columns.find((t=>t.id===e)))).sort(((e,t)=>"actions"===e.type&&"actions"!==t.type?1:"actions"!==e.type&&"actions"===t.type?-1:0))}_handleScroll(e){const t=e.target;this._canScrollLeft=t.scrollLeft>0,this._canScrollRight=t.scrollLeft<t.scrollWidth-t.clientWidth-1}_updateScrollFlags(){const e=this.shadowRoot?.querySelector(".content");e&&(this._canScrollLeft=e.scrollLeft>0,this._canScrollRight=e.scrollWidth>e.clientWidth&&e.scrollLeft<e.scrollWidth-e.clientWidth-1,this._canScrollHorizontal=e.scrollWidth>e.clientWidth),this.classList.toggle("kr-table--scroll-left-available",this._canScrollLeft),this.classList.toggle("kr-table--scroll-right-available",this._canScrollRight),this.classList.toggle("kr-table--scroll-horizontal-available",this._canScrollHorizontal),this.classList.toggle("kr-table--sticky-left",this.getDisplayedColumns().some((e=>"left"===e.sticky))),this.classList.toggle("kr-table--sticky-right",this.getDisplayedColumns().some((e=>"right"===e.sticky)))}_handleResizeStart(e,t){e.preventDefault();const i=this.shadowRoot?.querySelector(`.header-cell[data-column-id="${t}"]`);this._resizing={columnId:t,startX:e.clientX,startWidth:i?.offsetWidth||200},document.addEventListener("mousemove",this._handleResizeMove),document.addEventListener("mouseup",this._handleResizeEnd)}_handleAction(e){e.href||this.dispatchEvent(new CustomEvent("action",{detail:{action:e.id},bubbles:!0,composed:!0}))}_renderCellContent(e,t,i){const o=t[e.id];if(e.render)return q`<slot name="cell-${i}-${e.id}"></slot>`;if(null==o)return"";switch(e.type){case"number":return"number"==typeof o?o.toLocaleString():String(o);case"currency":return"number"==typeof o?o.toLocaleString("en-US",{style:"currency",currency:"USD"}):String(o);case"date":{let e;if(o instanceof Date)e=o;else if("string"==typeof o&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(o)){const t=o.replace(/(\d{2}:\d{2}:\d{2}):(\d+)$/,"$1.$2").replace(" ","T")+"Z";e=new Date(t)}else e=new Date(o);return e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}case"boolean":return!0===o?"Yes":!1===o?"No":"";default:return String(o)}}_getHeaderCellClasses(e,t){return{"header-cell":!0,"header-cell--align-center":"center"===e.align,"header-cell--align-right":"right"===e.align,"header-cell--sticky-left":"left"===e.sticky,"header-cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"header-cell--sticky-right":"right"===e.sticky,"header-cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellClasses(e,t){return{cell:!0,"cell--actions":"actions"===e.type,"cell--align-center":"center"===e.align,"cell--align-right":"right"===e.align,"cell--sticky-left":"left"===e.sticky,"cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"cell--sticky-right":"right"===e.sticky,"cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellStyle(e,t){const i={};if("left"===e.sticky){let e=0;for(let i=0;i<t;i++){const t=this.getDisplayedColumns()[i];"left"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.left=`${e}px`}if("right"===e.sticky){let e=0;for(let i=t+1;i<this.getDisplayedColumns().length;i++){const t=this.getDisplayedColumns()[i];"right"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.right=`${e}px`}return i}_renderPagination(){const e=(this._page-1)*this._pageSize+1,t=Math.min(this._page*this._pageSize,this._totalItems);return q`
|
|
1237
1237
|
<div class="pagination">
|
|
1238
1238
|
<span
|
|
1239
1239
|
class="pagination-icon ${1===this._page?"pagination-icon--disabled":""}"
|
|
@@ -1323,7 +1323,7 @@ const Ee="important",Ae=" !"+Ee,Ke=xe(class extends _e{constructor(e){if(super(e
|
|
|
1323
1323
|
${this.getDisplayedColumns().map(((e,t)=>q`
|
|
1324
1324
|
<div
|
|
1325
1325
|
class=${ke(this._getHeaderCellClasses(e,t))}
|
|
1326
|
-
style=${
|
|
1326
|
+
style=${Ee(this._getCellStyle(e,t))}
|
|
1327
1327
|
data-column-id=${e.id}
|
|
1328
1328
|
>${e.label??e.id}${!1!==e.resizable?q`<div
|
|
1329
1329
|
class="header-cell__resize"
|
|
@@ -1336,7 +1336,7 @@ const Ee="important",Ae=" !"+Ee,Ke=xe(class extends _e{constructor(e){if(super(e
|
|
|
1336
1336
|
${this.getDisplayedColumns().map(((i,o)=>q`
|
|
1337
1337
|
<div
|
|
1338
1338
|
class=${ke(this._getCellClasses(i,o))}
|
|
1339
|
-
style=${
|
|
1339
|
+
style=${Ee(this._getCellStyle(i,o))}
|
|
1340
1340
|
data-column-id=${i.id}
|
|
1341
1341
|
>
|
|
1342
1342
|
${this._renderCellContent(i,e,t)}
|
|
@@ -1859,7 +1859,7 @@ const Ee="important",Ae=" !"+Ee,Ke=xe(class extends _e{constructor(e){if(super(e
|
|
|
1859
1859
|
.status--error {
|
|
1860
1860
|
color: #dc2626;
|
|
1861
1861
|
}
|
|
1862
|
-
`],
|
|
1862
|
+
`],Fe([ue()],e.KRTable.prototype,"_data",void 0),Fe([ue()],e.KRTable.prototype,"_dataState",void 0),Fe([ue()],e.KRTable.prototype,"_page",void 0),Fe([ue()],e.KRTable.prototype,"_pageSize",void 0),Fe([ue()],e.KRTable.prototype,"_totalItems",void 0),Fe([ue()],e.KRTable.prototype,"_totalPages",void 0),Fe([ue()],e.KRTable.prototype,"_searchQuery",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollLeft",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollRight",void 0),Fe([ue()],e.KRTable.prototype,"_canScrollHorizontal",void 0),Fe([ue()],e.KRTable.prototype,"_columnPickerOpen",void 0),Fe([ue()],e.KRTable.prototype,"_displayedColumns",void 0),Fe([pe({type:Object})],e.KRTable.prototype,"def",void 0),e.KRTable=Fe([de("kr-table")],e.KRTable);var Ue=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRSpinner=class extends ne{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,q`
|
|
1863
1863
|
<svg
|
|
1864
1864
|
class="spinner"
|
|
1865
1865
|
style=${`width: ${e}; height: ${e}; color: ${t}`}
|
|
@@ -2071,7 +2071,7 @@ const We=e=>e??V
|
|
|
2071
2071
|
font-size: 0.75rem;
|
|
2072
2072
|
color: var(--kr-text-field-helper-color, #6b7280);
|
|
2073
2073
|
}
|
|
2074
|
-
`,e.KRTextField.formAssociated=!0,Qe([pe({type:String})],e.KRTextField.prototype,"label",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"name",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"value",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"placeholder",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"type",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"required",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),Qe([pe({type:Number})],e.KRTextField.prototype,"minlength",void 0),Qe([pe({type:Number})],e.KRTextField.prototype,"maxlength",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"pattern",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"autocomplete",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"hint",void 0),Qe([
|
|
2074
|
+
`,e.KRTextField.formAssociated=!0,Qe([pe({type:String})],e.KRTextField.prototype,"label",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"name",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"value",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"placeholder",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"type",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"required",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),Qe([pe({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),Qe([pe({type:Number})],e.KRTextField.prototype,"minlength",void 0),Qe([pe({type:Number})],e.KRTextField.prototype,"maxlength",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"pattern",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"autocomplete",void 0),Qe([pe({type:String})],e.KRTextField.prototype,"hint",void 0),Qe([ge("input")],e.KRTextField.prototype,"_input",void 0),Qe([ue()],e.KRTextField.prototype,"_touched",void 0),Qe([ue()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=Qe([de("kr-text-field")],e.KRTextField);var Xe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRSelectField=class extends ne{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=>{e.composedPath().includes(this)||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)),requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".select-dropdown");if(e){const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8;e.style.top=t.bottom+4+"px",e.style.left=t.left+"px",e.style.width=t.width+"px",e.style.maxHeight=i+"px"}}))}}_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 q`
|
|
2075
2075
|
<div class="wrapper">
|
|
2076
2076
|
${this.label?q`
|
|
2077
2077
|
<label>
|
|
@@ -2298,7 +2298,7 @@ const We=e=>e??V
|
|
|
2298
2298
|
.options-slot {
|
|
2299
2299
|
display: none;
|
|
2300
2300
|
}
|
|
2301
|
-
`],e.KRSelectField.formAssociated=!0,Xe([pe({type:String})],e.KRSelectField.prototype,"label",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"name",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"value",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"placeholder",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"required",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"hint",void 0),Xe([ue()],e.KRSelectField.prototype,"_isOpen",void 0),Xe([ue()],e.KRSelectField.prototype,"_highlightedIndex",void 0),Xe([ue()],e.KRSelectField.prototype,"_touched",void 0),Xe([
|
|
2301
|
+
`],e.KRSelectField.formAssociated=!0,Xe([pe({type:String})],e.KRSelectField.prototype,"label",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"name",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"value",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"placeholder",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"required",void 0),Xe([pe({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),Xe([pe({type:String})],e.KRSelectField.prototype,"hint",void 0),Xe([ue()],e.KRSelectField.prototype,"_isOpen",void 0),Xe([ue()],e.KRSelectField.prototype,"_highlightedIndex",void 0),Xe([ue()],e.KRSelectField.prototype,"_touched",void 0),Xe([ge(".select-trigger")],e.KRSelectField.prototype,"_triggerElement",void 0),e.KRSelectField=Xe([de("kr-select-field")],e.KRSelectField);var Ye=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRSelectOption=class extends ne{constructor(){super(...arguments),this.value="",this.disabled=!1}get label(){return this.textContent?.trim()||""}render(){return q`<slot></slot>`}},e.KRSelectOption.styles=n`
|
|
2302
2302
|
:host {
|
|
2303
2303
|
display: none;
|
|
2304
2304
|
}
|
|
@@ -2400,7 +2400,7 @@ const We=e=>e??V
|
|
|
2400
2400
|
font-size: 0.75rem;
|
|
2401
2401
|
color: var(--kr-textarea-field-helper-color, #6b7280);
|
|
2402
2402
|
}
|
|
2403
|
-
`,e.KRTextareaField.formAssociated=!0,Je([pe({type:String})],e.KRTextareaField.prototype,"label",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"name",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"value",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"rows",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"cols",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"hint",void 0),Je([
|
|
2403
|
+
`,e.KRTextareaField.formAssociated=!0,Je([pe({type:String})],e.KRTextareaField.prototype,"label",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"name",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"value",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),Je([pe({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"rows",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"cols",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),Je([pe({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),Je([pe({type:String})],e.KRTextareaField.prototype,"hint",void 0),Je([ge("textarea")],e.KRTextareaField.prototype,"_textarea",void 0),Je([ue()],e.KRTextareaField.prototype,"_touched",void 0),Je([ue()],e.KRTextareaField.prototype,"_dirty",void 0),e.KRTextareaField=Je([de("kr-textarea-field")],e.KRTextareaField);var et=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tt=class extends ne{constructor(){super(...arguments),this.label="",this.value=""}render(){return q`
|
|
2404
2404
|
<div class="wrapper">
|
|
2405
2405
|
${this.label?q`<label>${this.label}</label>`:V}
|
|
2406
2406
|
<div class="value">${this.value}</div>
|
|
@@ -2427,5 +2427,377 @@ const We=e=>e??V
|
|
|
2427
2427
|
font-size: 14px;
|
|
2428
2428
|
color: black;
|
|
2429
2429
|
}
|
|
2430
|
-
`,et([pe({type:String})],tt.prototype,"label",void 0),et([pe({type:String})],tt.prototype,"value",void 0),tt=et([de("kr-detail-field")],tt),
|
|
2430
|
+
`,et([pe({type:String})],tt.prototype,"label",void 0),et([pe({type:String})],tt.prototype,"value",void 0),tt=et([de("kr-detail-field")],tt);var it=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};function ot(e){return"options"in e}e.KRAutoSuggest=class extends ne{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint="",this.options=[],this.statusType="finished",this.loadingText="Loading...",this.errorText="Error loading options",this.emptyText="No matches found",this.filteringType="auto",this.highlightMatches=!0,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._dirty=!1,this._handleDocumentClick=this._onDocumentClick.bind(this),this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick)}firstUpdated(){this._updateFormValue()}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._dirty=!1,this._isOpen=!1,this._highlightedIndex=-1,this._updateFormValue()}formStateRestoreCallback(e){this.value=e}get _filteredOptions(){if("manual"===this.filteringType||!this.value)return this.options;const e=this.value.toLowerCase(),t=[];for(const i of this.options)if(ot(i)){const o=i.options.filter((t=>{const i=(t.label||t.value).toLowerCase(),o=t.filteringTags?.join(" ").toLowerCase()||"";return i.includes(e)||o.includes(e)}));o.length>0&&t.push({...i,options:o})}else{const o=(i.label||i.value).toLowerCase(),s=i.filteringTags?.join(" ").toLowerCase()||"";(o.includes(e)||s.includes(e))&&t.push(i)}return t}get _flatOptions(){const e=[];for(const t of this._filteredOptions)ot(t)?e.push(...t.options):e.push(t);return e}_updateFormValue(){this._internals.setFormValue(this.value),this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"This field is required",this._input):this._internals.setValidity({})}_onInput(e){const t=e.target;this.value=t.value,this._dirty=!0,this._isOpen=!0,this._highlightedIndex=-1,this._updateFormValue(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),"manual"===this.filteringType&&this.dispatchEvent(new CustomEvent("load-items",{detail:{filteringText:this.value},bubbles:!0,composed:!0}))}_onFocus(){this._isOpen=!0,"manual"===this.filteringType&&this.dispatchEvent(new CustomEvent("load-items",{detail:{filteringText:this.value},bubbles:!0,composed:!0}))}_onBlur(){this._touched=!0,setTimeout((()=>{this._isOpen=!1,this._highlightedIndex=-1}),200),this._updateFormValue()}_onKeyDown(e){const t=this._flatOptions;switch(e.key){case"ArrowDown":e.preventDefault(),this._isOpen=!0,this._highlightedIndex=Math.min(this._highlightedIndex+1,t.length-1),this._scrollToHighlighted();break;case"ArrowUp":e.preventDefault(),this._highlightedIndex=Math.max(this._highlightedIndex-1,-1),this._scrollToHighlighted();break;case"Enter":this._highlightedIndex>=0&&t[this._highlightedIndex]&&(e.preventDefault(),this._selectOption(t[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.is-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.label||e.value,this._isOpen=!1,this._highlightedIndex=-1,this._dirty=!0,this._updateFormValue(),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,selectedOption:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_handleClear(){this.value="",this._updateFormValue(),this.dispatchEvent(new CustomEvent("change",{detail:{value:""},bubbles:!0,composed:!0})),this._input?.focus()}_onDocumentClick(e){e.composedPath().includes(this)||(this._isOpen=!1)}_highlightMatch(e){if(!this.value||"manual"===this.filteringType||!this.highlightMatches)return q`${e}`;const t=this.value.toLowerCase(),i=e.toLowerCase().indexOf(t);if(-1===i)return q`${e}`;const o=e.slice(0,i),s=e.slice(i,i+this.value.length),r=e.slice(i+this.value.length);return q`${o}<span class="highlight">${s}</span>${r}`}_renderOption(e,t){const i=t===this._highlightedIndex;return q`
|
|
2431
|
+
<button
|
|
2432
|
+
class=${ke({option:!0,"is-highlighted":i})}
|
|
2433
|
+
type="button"
|
|
2434
|
+
role="option"
|
|
2435
|
+
aria-selected=${i}
|
|
2436
|
+
?disabled=${e.disabled}
|
|
2437
|
+
@click=${()=>this._selectOption(e)}
|
|
2438
|
+
@mouseenter=${()=>{this._highlightedIndex=t}}
|
|
2439
|
+
>
|
|
2440
|
+
<div class="option-content">
|
|
2441
|
+
<div class="option-label">
|
|
2442
|
+
${this._highlightMatch(e.label||e.value)}
|
|
2443
|
+
${e.labelTag?q`<span class="option-tag">${e.labelTag}</span>`:V}
|
|
2444
|
+
</div>
|
|
2445
|
+
${e.description?q`<div class="option-description">${e.description}</div>`:V}
|
|
2446
|
+
${e.tags&&e.tags.length>0?q`
|
|
2447
|
+
<div class="option-tags">
|
|
2448
|
+
${e.tags.map((e=>q`<span class="option-tag">${e}</span>`))}
|
|
2449
|
+
</div>
|
|
2450
|
+
`:V}
|
|
2451
|
+
</div>
|
|
2452
|
+
</button>
|
|
2453
|
+
`}_renderDropdownContent(){if("loading"===this.statusType)return q`
|
|
2454
|
+
<div class="status">
|
|
2455
|
+
<div class="spinner"></div>
|
|
2456
|
+
${this.loadingText}
|
|
2457
|
+
</div>
|
|
2458
|
+
`;if("error"===this.statusType)return q`
|
|
2459
|
+
<div class="status is-error">
|
|
2460
|
+
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
|
2461
|
+
<path
|
|
2462
|
+
d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"
|
|
2463
|
+
/>
|
|
2464
|
+
</svg>
|
|
2465
|
+
${this.errorText}
|
|
2466
|
+
</div>
|
|
2467
|
+
`;const e=this._filteredOptions;if(0===e.length)return q`<div class="empty">${this.emptyText}</div>`;let t=0;return q`
|
|
2468
|
+
${e.map((e=>{if(ot(e)){const i=e.options.map((e=>{const i=this._renderOption(e,t);return t++,i}));return q`
|
|
2469
|
+
<div class="group-label">${e.label}</div>
|
|
2470
|
+
${i}
|
|
2471
|
+
`}const i=this._renderOption(e,t);return t++,i}))}
|
|
2472
|
+
`}render(){const e=this._touched&&!this.validity.valid;return q`
|
|
2473
|
+
<div class="field-wrapper">
|
|
2474
|
+
${this.label?q`
|
|
2475
|
+
<label>
|
|
2476
|
+
${this.label}
|
|
2477
|
+
${this.required?q`<span class="required">*</span>`:V}
|
|
2478
|
+
</label>
|
|
2479
|
+
`:V}
|
|
2480
|
+
|
|
2481
|
+
<div class="input-container">
|
|
2482
|
+
<div class="input-wrapper">
|
|
2483
|
+
<input
|
|
2484
|
+
type="text"
|
|
2485
|
+
.value=${Ge(this.value)}
|
|
2486
|
+
placeholder=${We(this.placeholder||void 0)}
|
|
2487
|
+
?disabled=${this.disabled}
|
|
2488
|
+
?readonly=${this.readonly}
|
|
2489
|
+
?required=${this.required}
|
|
2490
|
+
name=${We(this.name||void 0)}
|
|
2491
|
+
autocomplete="off"
|
|
2492
|
+
role="combobox"
|
|
2493
|
+
aria-autocomplete="list"
|
|
2494
|
+
aria-expanded=${this._isOpen}
|
|
2495
|
+
aria-controls="dropdown"
|
|
2496
|
+
class=${ke({"input--invalid":e})}
|
|
2497
|
+
@input=${this._onInput}
|
|
2498
|
+
@blur=${this._onBlur}
|
|
2499
|
+
@focus=${this._onFocus}
|
|
2500
|
+
@keydown=${this._onKeyDown}
|
|
2501
|
+
/>
|
|
2502
|
+
<div class="icon-container">
|
|
2503
|
+
${!this.value||this.disabled||this.readonly?"":q`
|
|
2504
|
+
<button
|
|
2505
|
+
class="clear-button"
|
|
2506
|
+
type="button"
|
|
2507
|
+
aria-label="Clear"
|
|
2508
|
+
@click=${this._handleClear}
|
|
2509
|
+
>
|
|
2510
|
+
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
|
2511
|
+
<path
|
|
2512
|
+
d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"
|
|
2513
|
+
/>
|
|
2514
|
+
</svg>
|
|
2515
|
+
</button>
|
|
2516
|
+
`}
|
|
2517
|
+
${this.value||this.disabled||this.readonly?"":q`
|
|
2518
|
+
<svg class="search-icon" fill="currentColor" viewBox="0 0 16 16">
|
|
2519
|
+
<path
|
|
2520
|
+
d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
|
|
2521
|
+
/>
|
|
2522
|
+
</svg>
|
|
2523
|
+
`}
|
|
2524
|
+
</div>
|
|
2525
|
+
</div>
|
|
2526
|
+
|
|
2527
|
+
<div
|
|
2528
|
+
id="dropdown"
|
|
2529
|
+
role="listbox"
|
|
2530
|
+
class=${ke({dropdown:!0,"is-open":this._isOpen})}
|
|
2531
|
+
>
|
|
2532
|
+
${this._renderDropdownContent()}
|
|
2533
|
+
</div>
|
|
2534
|
+
</div>
|
|
2535
|
+
|
|
2536
|
+
${e?q`<div class="validation-message">${this.validationMessage}</div>`:this.hint?q`<div class="hint">${this.hint}</div>`:V}
|
|
2537
|
+
</div>
|
|
2538
|
+
`}},e.KRAutoSuggest.styles=n`
|
|
2539
|
+
:host {
|
|
2540
|
+
display: block;
|
|
2541
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
2542
|
+
'Helvetica Neue', sans-serif;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
.field-wrapper {
|
|
2546
|
+
display: flex;
|
|
2547
|
+
flex-direction: column;
|
|
2548
|
+
gap: 4px;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
label {
|
|
2552
|
+
font-size: 14px;
|
|
2553
|
+
font-weight: 500;
|
|
2554
|
+
color: var(--kr-text-field-label-color, #374151);
|
|
2555
|
+
display: block;
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
.required {
|
|
2559
|
+
color: var(--kr-text-field-required-color, #ef4444);
|
|
2560
|
+
margin-left: 2px;
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
.input-container {
|
|
2564
|
+
position: relative;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
.input-wrapper {
|
|
2568
|
+
position: relative;
|
|
2569
|
+
display: flex;
|
|
2570
|
+
align-items: center;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
input {
|
|
2574
|
+
flex: 1;
|
|
2575
|
+
width: 100%;
|
|
2576
|
+
padding: 8px 32px 8px 12px;
|
|
2577
|
+
font-size: 14px;
|
|
2578
|
+
border: 1px solid var(--kr-text-field-border-color, #d1d5db);
|
|
2579
|
+
border-radius: 6px;
|
|
2580
|
+
background: var(--kr-text-field-bg, #ffffff);
|
|
2581
|
+
color: var(--kr-text-field-color, #000000);
|
|
2582
|
+
transition: all 0.2s ease;
|
|
2583
|
+
box-sizing: border-box;
|
|
2584
|
+
font-family: inherit;
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
input:focus {
|
|
2588
|
+
outline: none;
|
|
2589
|
+
border-color: var(--kr-text-field-focus-border-color, #163052);
|
|
2590
|
+
box-shadow: 0 0 0 3px var(--kr-text-field-focus-ring-color, rgba(22, 48, 82, 0.1));
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
input:disabled {
|
|
2594
|
+
background: var(--kr-text-field-disabled-bg, #f3f4f6);
|
|
2595
|
+
cursor: not-allowed;
|
|
2596
|
+
opacity: 0.6;
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
input:read-only {
|
|
2600
|
+
background: var(--kr-text-field-disabled-bg, #f3f4f6);
|
|
2601
|
+
cursor: default;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
input.input--invalid {
|
|
2605
|
+
border-color: var(--kr-text-field-error-border-color, #ef4444);
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
input.input--invalid:focus {
|
|
2609
|
+
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
input::placeholder {
|
|
2613
|
+
color: var(--kr-text-field-placeholder-color, #9ca3af);
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
.icon-container {
|
|
2617
|
+
position: absolute;
|
|
2618
|
+
right: 8px;
|
|
2619
|
+
display: flex;
|
|
2620
|
+
align-items: center;
|
|
2621
|
+
gap: 4px;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
.clear-button {
|
|
2625
|
+
display: flex;
|
|
2626
|
+
align-items: center;
|
|
2627
|
+
justify-content: center;
|
|
2628
|
+
width: 20px;
|
|
2629
|
+
height: 20px;
|
|
2630
|
+
padding: 0;
|
|
2631
|
+
background: none;
|
|
2632
|
+
border: none;
|
|
2633
|
+
border-radius: 50%;
|
|
2634
|
+
color: var(--kr-text-muted, #6b7280);
|
|
2635
|
+
cursor: pointer;
|
|
2636
|
+
transition: all 0.15s ease;
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
.clear-button:hover {
|
|
2640
|
+
background-color: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
2641
|
+
color: var(--kr-text, #000000);
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
.search-icon {
|
|
2645
|
+
width: 16px;
|
|
2646
|
+
height: 16px;
|
|
2647
|
+
color: var(--kr-text-muted, #6b7280);
|
|
2648
|
+
pointer-events: none;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
/* Dropdown */
|
|
2652
|
+
.dropdown {
|
|
2653
|
+
position: absolute;
|
|
2654
|
+
top: 100%;
|
|
2655
|
+
left: 0;
|
|
2656
|
+
right: 0;
|
|
2657
|
+
z-index: 50;
|
|
2658
|
+
margin-top: 4px;
|
|
2659
|
+
max-height: 300px;
|
|
2660
|
+
overflow-y: auto;
|
|
2661
|
+
background: white;
|
|
2662
|
+
border: 1px solid var(--kr-text-field-border-color, #d1d5db);
|
|
2663
|
+
border-radius: 6px;
|
|
2664
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
2665
|
+
display: none;
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
.dropdown.is-open {
|
|
2669
|
+
display: block;
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
/* Options */
|
|
2673
|
+
.option {
|
|
2674
|
+
display: flex;
|
|
2675
|
+
align-items: flex-start;
|
|
2676
|
+
gap: 8px;
|
|
2677
|
+
width: 100%;
|
|
2678
|
+
padding: 8px 12px;
|
|
2679
|
+
background: none;
|
|
2680
|
+
border: none;
|
|
2681
|
+
font-size: 14px;
|
|
2682
|
+
font-family: inherit;
|
|
2683
|
+
color: var(--kr-text, #000000);
|
|
2684
|
+
text-align: left;
|
|
2685
|
+
cursor: pointer;
|
|
2686
|
+
transition: background 0.15s ease;
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
.option:hover:not(:disabled) {
|
|
2690
|
+
background: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
.option.is-highlighted {
|
|
2694
|
+
background: var(--kr-select-option-highlight-bg, #e5e7eb);
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
.option:disabled {
|
|
2698
|
+
opacity: 0.5;
|
|
2699
|
+
cursor: not-allowed;
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
.option-content {
|
|
2703
|
+
flex: 1;
|
|
2704
|
+
min-width: 0;
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
.option-label {
|
|
2708
|
+
display: flex;
|
|
2709
|
+
align-items: center;
|
|
2710
|
+
gap: 6px;
|
|
2711
|
+
flex-wrap: wrap;
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
.option-tag {
|
|
2715
|
+
flex-shrink: 0;
|
|
2716
|
+
padding: 2px 6px;
|
|
2717
|
+
font-size: 11px;
|
|
2718
|
+
color: var(--kr-text-muted, #6b7280);
|
|
2719
|
+
background: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
2720
|
+
border-radius: 3px;
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
.option-description {
|
|
2724
|
+
font-size: 12px;
|
|
2725
|
+
color: var(--kr-text-muted, #6b7280);
|
|
2726
|
+
margin-top: 2px;
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
.option-tags {
|
|
2730
|
+
display: flex;
|
|
2731
|
+
flex-wrap: wrap;
|
|
2732
|
+
gap: 4px;
|
|
2733
|
+
margin-top: 4px;
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
/* Highlight */
|
|
2737
|
+
.highlight {
|
|
2738
|
+
font-weight: 600;
|
|
2739
|
+
background-color: #fef3c7;
|
|
2740
|
+
color: #92400e;
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
/* Group */
|
|
2744
|
+
.group-label {
|
|
2745
|
+
padding: 8px 12px;
|
|
2746
|
+
font-size: 11px;
|
|
2747
|
+
font-weight: 600;
|
|
2748
|
+
color: var(--kr-text-muted, #6b7280);
|
|
2749
|
+
text-transform: uppercase;
|
|
2750
|
+
letter-spacing: 0.05em;
|
|
2751
|
+
background: var(--kr-select-option-hover-bg, #f9fafb);
|
|
2752
|
+
border-bottom: 1px solid var(--kr-text-field-border-color, #e5e7eb);
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
/* Status */
|
|
2756
|
+
.status {
|
|
2757
|
+
display: flex;
|
|
2758
|
+
align-items: center;
|
|
2759
|
+
justify-content: center;
|
|
2760
|
+
gap: 8px;
|
|
2761
|
+
padding: 16px;
|
|
2762
|
+
font-size: 14px;
|
|
2763
|
+
color: var(--kr-text-muted, #6b7280);
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
.status.is-error {
|
|
2767
|
+
color: var(--kr-text-field-error-border-color, #ef4444);
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
.spinner {
|
|
2771
|
+
width: 16px;
|
|
2772
|
+
height: 16px;
|
|
2773
|
+
border: 2px solid var(--kr-text-field-border-color, #e5e7eb);
|
|
2774
|
+
border-top-color: var(--kr-text-field-focus-border-color, #163052);
|
|
2775
|
+
border-radius: 50%;
|
|
2776
|
+
animation: spin 0.6s linear infinite;
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
@keyframes spin {
|
|
2780
|
+
to {
|
|
2781
|
+
transform: rotate(360deg);
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
.empty {
|
|
2786
|
+
padding: 16px;
|
|
2787
|
+
text-align: center;
|
|
2788
|
+
font-size: 14px;
|
|
2789
|
+
color: var(--kr-text-muted, #6b7280);
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
.hint {
|
|
2793
|
+
font-size: 12px;
|
|
2794
|
+
color: var(--kr-text-field-hint-color, #6b7280);
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
.validation-message {
|
|
2798
|
+
font-size: 12px;
|
|
2799
|
+
color: var(--kr-text-field-error-border-color, #ef4444);
|
|
2800
|
+
margin-top: 2px;
|
|
2801
|
+
}
|
|
2802
|
+
`,e.KRAutoSuggest.formAssociated=!0,it([pe({type:String})],e.KRAutoSuggest.prototype,"label",void 0),it([pe({type:String})],e.KRAutoSuggest.prototype,"name",void 0),it([pe({type:String})],e.KRAutoSuggest.prototype,"value",void 0),it([pe({type:String})],e.KRAutoSuggest.prototype,"placeholder",void 0),it([pe({type:Boolean})],e.KRAutoSuggest.prototype,"disabled",void 0),it([pe({type:Boolean})],e.KRAutoSuggest.prototype,"readonly",void 0),it([pe({type:Boolean})],e.KRAutoSuggest.prototype,"required",void 0),it([pe({type:String})],e.KRAutoSuggest.prototype,"hint",void 0),it([pe({type:Array})],e.KRAutoSuggest.prototype,"options",void 0),it([pe({type:String,attribute:"status-type"})],e.KRAutoSuggest.prototype,"statusType",void 0),it([pe({type:String,attribute:"loading-text"})],e.KRAutoSuggest.prototype,"loadingText",void 0),it([pe({type:String,attribute:"error-text"})],e.KRAutoSuggest.prototype,"errorText",void 0),it([pe({type:String,attribute:"empty-text"})],e.KRAutoSuggest.prototype,"emptyText",void 0),it([pe({type:String,attribute:"filtering-type"})],e.KRAutoSuggest.prototype,"filteringType",void 0),it([pe({type:Boolean,attribute:"highlight-matches"})],e.KRAutoSuggest.prototype,"highlightMatches",void 0),it([ue()],e.KRAutoSuggest.prototype,"_isOpen",void 0),it([ue()],e.KRAutoSuggest.prototype,"_highlightedIndex",void 0),it([ue()],e.KRAutoSuggest.prototype,"_touched",void 0),it([ue()],e.KRAutoSuggest.prototype,"_dirty",void 0),it([ge("input")],e.KRAutoSuggest.prototype,"_input",void 0),e.KRAutoSuggest=it([de("kr-auto-suggest")],e.KRAutoSuggest),e.KRDialogRef=je,e.krBaseCSS=ae})),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);
|
|
2431
2803
|
//# sourceMappingURL=krubble-components.umd.min.js.map
|