@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,7 +8,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/,{is:l,defineProperty:n,getOwnPropertyDescriptor:d,getOwnPropertyNames:h,getOwnPropertySymbols:c,getPrototypeOf:p}=Object,u=globalThis,f=u.trustedTypes,g=f?f.emptyScript:"",
|
|
11
|
+
*/,{is:l,defineProperty:n,getOwnPropertyDescriptor:d,getOwnPropertyNames:h,getOwnPropertySymbols:c,getPrototypeOf:p}=Object,u=globalThis,f=u.trustedTypes,g=f?f.emptyScript:"",b=u.reactiveElementPolyfillSupport,v=(e,t)=>e,_={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},y=(e,t)=>!l(e,t),m={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;let x=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=m){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(),s=this.getPropertyDescriptor(e,i,t);void 0!==s&&n(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){const r=s?.call(this);o?.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??m}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=p(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...h(e),...c(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((i,s)=>{if(t)i.adoptedStyleSheets=s.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of s){const s=document.createElement("style"),o=e.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=t.cssText,i.appendChild(s)}})(i,this.constructor.elementStyles),i}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),s=this.constructor._$Eu(e,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:_).toAttribute(t,i.type);this._$Em=e,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){const i=this.constructor,s=i._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=i.getPropertyOptions(s),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:_;this._$Em=s;const r=o.fromAttribute(t,e.type);this[s]=r??this._$Ej?.get(s)??r,this._$Em=null}}requestUpdate(e,t,i,s=!1,o){if(void 0!==e){const r=this.constructor;if(!1===s&&(o=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??y)(o,t)||i.useDefault&&i.reflect&&o===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:s,wrapped:o},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==o||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===s&&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,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,i,s)}}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){}};x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[v("elementProperties")]=new Map,x[v("finalized")]=new Map,b?.({ReactiveElement:x}),(u.reactiveElementVersions??=[]).push("2.1.2");
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
@@ -72,7 +72,7 @@ const k=globalThis,w=k.trustedTypes,$=w?w.createPolicy("lit-html",{createHTML:e=
|
|
|
72
72
|
* Copyright 2017 Google LLC
|
|
73
73
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
74
|
*/
|
|
75
|
-
function fe(e,t){return(t,i,s)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}var ge=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let
|
|
75
|
+
function fe(e,t){return(t,i,s)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}var ge=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let be=class extends ae{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return j`
|
|
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">
|
|
@@ -86,7 +86,7 @@ function fe(e,t){return(t,i,s)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
|
-
`}};
|
|
89
|
+
`}};be.styles=r`
|
|
90
90
|
:host {
|
|
91
91
|
display: block;
|
|
92
92
|
margin-bottom: 16px;
|
|
@@ -138,18 +138,18 @@ function fe(e,t){return(t,i,s)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
|
|
|
138
138
|
.content__body {
|
|
139
139
|
padding: 16px 16px 8px 16px;
|
|
140
140
|
}
|
|
141
|
-
`,ge([pe({type:String})],
|
|
141
|
+
`,ge([pe({type:String})],be.prototype,"header",void 0),ge([pe({type:Boolean,reflect:!0})],be.prototype,"expanded",void 0),be=ge([de("kr-accordion")],be);
|
|
142
142
|
/**
|
|
143
143
|
* @license
|
|
144
144
|
* Copyright 2017 Google LLC
|
|
145
145
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
146
146
|
*/
|
|
147
|
-
const
|
|
147
|
+
const ve=1,_e=2,ye=3,me=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};
|
|
148
148
|
/**
|
|
149
149
|
* @license
|
|
150
150
|
* Copyright 2018 Google LLC
|
|
151
151
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
152
|
-
*/const we=xe(class extends ke{constructor(e){if(super(e),e.type!==
|
|
152
|
+
*/const we=xe(class extends ke{constructor(e){if(super(e),e.type!==ve||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const s=!!t[e];s===this.st.has(e)||this.nt?.has(e)||(s?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return B}});var $e=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Ce=class extends ae{constructor(){super(...arguments),this.type="info",this.title="",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}render(){const e={info:j`<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:j`<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:j`<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:j`<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 j`
|
|
153
153
|
<div
|
|
154
154
|
class=${we({alert:!0,["alert--"+this.type]:!0,"alert--has-header":!!this.title,"alert--hidden":!this.visible})}
|
|
155
155
|
role="alert"
|
|
@@ -290,7 +290,29 @@ const be=1,_e=2,ye=3,me=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([pe({type:String})],Ce.prototype,"type",void 0),$e([pe({type:String})],Ce.prototype,"title",void 0),$e([pe({type:Boolean})],Ce.prototype,"dismissible",void 0),$e([pe({type:Boolean})],Ce.prototype,"visible",void 0),Ce=$e([de("kr-alert")],Ce);var Se=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Ee=class extends ae{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([pe({type:String})],Ce.prototype,"type",void 0),$e([pe({type:String})],Ce.prototype,"title",void 0),$e([pe({type:Boolean})],Ce.prototype,"dismissible",void 0),$e([pe({type:Boolean})],Ce.prototype,"visible",void 0),Ce=$e([de("kr-alert")],Ce);var Se=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Ee=class extends ae{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 j`
|
|
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?j`<span class="state-overlay">
|
|
300
|
+
${"loading"===this._state?j`<span class="spinner"></span>`:this._stateText}
|
|
301
|
+
</span>`:U}
|
|
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=>j`
|
|
309
|
+
<button
|
|
310
|
+
class="dropdown-item"
|
|
311
|
+
@click=${t=>this._handleOptionClick(e,t)}
|
|
312
|
+
>${e.label}</button>
|
|
313
|
+
`))}
|
|
314
|
+
</div>
|
|
315
|
+
`;const e=j`
|
|
294
316
|
<span class="content">
|
|
295
317
|
<slot name="icon"></slot>
|
|
296
318
|
<slot></slot>
|
|
@@ -579,7 +601,155 @@ const be=1,_e=2,ye=3,me=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
|
+
`,Se([pe({type:String,reflect:!0})],Ee.prototype,"variant",void 0),Se([pe({type:String,reflect:!0})],Ee.prototype,"color",void 0),Se([pe({type:String,reflect:!0})],Ee.prototype,"size",void 0),Se([pe({type:Boolean,reflect:!0})],Ee.prototype,"disabled",void 0),Se([pe({type:String})],Ee.prototype,"href",void 0),Se([pe({type:String})],Ee.prototype,"target",void 0),Se([pe({type:Array})],Ee.prototype,"options",void 0),Se([pe({type:String,reflect:!0,attribute:"icon-position"})],Ee.prototype,"iconPosition",void 0),Se([pe({type:Boolean,reflect:!0})],Ee.prototype,"split",void 0),Se([ue()],Ee.prototype,"_state",void 0),Se([ue()],Ee.prototype,"_stateText",void 0),Se([ue()],Ee.prototype,"_dropdownOpened",void 0),Ee=Se([de("kr-button")],Ee);
|
|
583
753
|
/**
|
|
584
754
|
* @license
|
|
585
755
|
* Copyright 2017 Google LLC
|
|
@@ -812,7 +982,7 @@ class ze extends ke{constructor(e){if(super(e),this.it=U,e.type!==_e)throw Error
|
|
|
812
982
|
* Copyright 2018 Google LLC
|
|
813
983
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
814
984
|
*/
|
|
815
|
-
const Ie="important",qe=" !"+Ie,Re=xe(class extends ke{constructor(e){if(super(e),e.type!==
|
|
985
|
+
const Ie="important",qe=" !"+Ie,Re=xe(class extends ke{constructor(e){if(super(e),e.type!==ve||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const s=e[i];return null==s?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}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 s=t[e];if(null!=s){this.ft.add(e);const t="string"==typeof s&&s.endsWith(qe);e.includes("-")||t?i.setProperty(e,t?s.slice(0,-11):s,t?Ie:""):i[e]=s}}return B}});var Le=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Me=class extends ae{render(){return j`<slot></slot>`}};Me.styles=r`
|
|
816
986
|
:host {
|
|
817
987
|
display: flex;
|
|
818
988
|
padding: 0 24px;
|
|
@@ -845,7 +1015,7 @@ const Ie="important",qe=" !"+Ie,Re=xe(class extends ke{constructor(e){if(super(e
|
|
|
845
1015
|
gap: 12px;
|
|
846
1016
|
justify-content: flex-end;
|
|
847
1017
|
}
|
|
848
|
-
`,He=Le([de("kr-dialog-footer")],He);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}}let Be=class extends ae{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
|
+
`,He=Le([de("kr-dialog-footer")],He);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}}let Be=class extends ae{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,s=document.createElement("kr-dialog");i.setDialogElement(s),s._dialogRef=i;const o=new e;return o.dialogRef=i,t?.data&&(o.data=t.data),t?.label&&(s.label=t.label),t?.width&&(s.width=t.width),s._contentElement=o,s.opened=!0,document.body.appendChild(s),i}_handleBackdropClick(e){e.target.classList.contains("backdrop")&&this.close()}render(){return j`
|
|
849
1019
|
<div class="backdrop" @click=${this._handleBackdropClick}></div>
|
|
850
1020
|
<div class="dialog" style=${Re({width:this.width})}>
|
|
851
1021
|
${this.label?j`<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>`:""}
|
|
@@ -3018,7 +3188,7 @@ const Ie="important",qe=" !"+Ie,Re=xe(class extends ke{constructor(e){if(super(e
|
|
|
3018
3188
|
height: auto;
|
|
3019
3189
|
}
|
|
3020
3190
|
|
|
3021
|
-
`],pt([ue()],ft.prototype,"_data",void 0),pt([ue()],ft.prototype,"_dataState",void 0),pt([ue()],ft.prototype,"_page",void 0),pt([ue()],ft.prototype,"_pageSize",void 0),pt([ue()],ft.prototype,"_totalItems",void 0),pt([ue()],ft.prototype,"_totalPages",void 0),pt([ue()],ft.prototype,"_searchQuery",void 0),pt([ue()],ft.prototype,"_canScrollLeft",void 0),pt([ue()],ft.prototype,"_canScrollRight",void 0),pt([ue()],ft.prototype,"_canScrollHorizontal",void 0),pt([ue()],ft.prototype,"_columnPickerOpen",void 0),pt([ue()],ft.prototype,"_filterPanelOpened",void 0),pt([ue()],ft.prototype,"_filterPanelTab",void 0),pt([ue()],ft.prototype,"_buckets",void 0),pt([ue()],ft.prototype,"_sorts",void 0),pt([pe({type:Object})],ft.prototype,"def",void 0),pt([pe({type:String,reflect:!0})],ft.prototype,"variant",void 0),ft=pt([de("kr-table")],ft);var gt=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let
|
|
3191
|
+
`],pt([ue()],ft.prototype,"_data",void 0),pt([ue()],ft.prototype,"_dataState",void 0),pt([ue()],ft.prototype,"_page",void 0),pt([ue()],ft.prototype,"_pageSize",void 0),pt([ue()],ft.prototype,"_totalItems",void 0),pt([ue()],ft.prototype,"_totalPages",void 0),pt([ue()],ft.prototype,"_searchQuery",void 0),pt([ue()],ft.prototype,"_canScrollLeft",void 0),pt([ue()],ft.prototype,"_canScrollRight",void 0),pt([ue()],ft.prototype,"_canScrollHorizontal",void 0),pt([ue()],ft.prototype,"_columnPickerOpen",void 0),pt([ue()],ft.prototype,"_filterPanelOpened",void 0),pt([ue()],ft.prototype,"_filterPanelTab",void 0),pt([ue()],ft.prototype,"_buckets",void 0),pt([ue()],ft.prototype,"_sorts",void 0),pt([pe({type:Object})],ft.prototype,"def",void 0),pt([pe({type:String,reflect:!0})],ft.prototype,"variant",void 0),ft=pt([de("kr-table")],ft);var gt=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let bt=class extends ae{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,j`
|
|
3022
3192
|
<svg
|
|
3023
3193
|
class="spinner"
|
|
3024
3194
|
style=${`width: ${e}; height: ${e}; color: ${t}`}
|
|
@@ -3035,7 +3205,7 @@ const Ie="important",qe=" !"+Ie,Re=xe(class extends ke{constructor(e){if(super(e
|
|
|
3035
3205
|
stroke-width="4"
|
|
3036
3206
|
/>
|
|
3037
3207
|
</svg>
|
|
3038
|
-
`}};
|
|
3208
|
+
`}};bt.styles=r`
|
|
3039
3209
|
:host {
|
|
3040
3210
|
display: inline-flex;
|
|
3041
3211
|
align-items: center;
|
|
@@ -3078,7 +3248,7 @@ const Ie="important",qe=" !"+Ie,Re=xe(class extends ke{constructor(e){if(super(e
|
|
|
3078
3248
|
stroke: currentColor;
|
|
3079
3249
|
stroke-linecap: round;
|
|
3080
3250
|
}
|
|
3081
|
-
`,gt([pe({type:String,reflect:!0})],
|
|
3251
|
+
`,gt([pe({type:String,reflect:!0})],bt.prototype,"size",void 0),gt([pe({type:String,reflect:!0})],bt.prototype,"color",void 0),bt=gt([de("kr-spinner")],bt);var vt=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let _t=class extends ae{constructor(){super(...arguments),this.color="dark"}render(){let e="",t="";return e="dark"===this.color?"#163052":"light"===this.color?"#ffffff":this.color,t=this.trackColor?this.trackColor:"light"===this.color?"#ffffff4d":"#0000001a",j`
|
|
3082
3252
|
<div
|
|
3083
3253
|
class="progress-bar"
|
|
3084
3254
|
style=${`background: ${t}`}
|
|
@@ -3119,7 +3289,7 @@ const Ie="important",qe=" !"+Ie,Re=xe(class extends ke{constructor(e){if(super(e
|
|
|
3119
3289
|
left: 100%;
|
|
3120
3290
|
}
|
|
3121
3291
|
}
|
|
3122
|
-
`,
|
|
3292
|
+
`,vt([pe({type:String,reflect:!0})],_t.prototype,"color",void 0),vt([pe({type:String,reflect:!0})],_t.prototype,"trackColor",void 0),_t=vt([de("kr-progress-bar")],_t);var yt,mt=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let xt=yt=class extends ae{constructor(){super(...arguments),this._zoom=100,this._panX=0,this._panY=0,this._dragging=!1,this._dragStartX=0,this._dragStartY=0,this._panStartX=0,this._panStartY=0,this.src="",this.name="",this._zoomLevel=100,this._textContent=null,this._handleKeydown=e=>{"Escape"===e.key&&this._close()},this._handleDragMove=e=>{this._dragging&&(this._panX=this._panStartX+(e.clientX-this._dragStartX),this._panY=this._panStartY+(e.clientY-this._dragStartY),this.requestUpdate())},this._handleDragEnd=()=>{this._dragging=!1,document.removeEventListener("mousemove",this._handleDragMove),document.removeEventListener("mouseup",this._handleDragEnd)}}static open(e){this._activePreview&&this._activePreview._close();const t=document.createElement("kr-file-preview");return t.src=e.src,t.name=e.name,document.body.appendChild(t),this._activePreview=t,t}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._handleKeydown),this._isText()&&this._loadTextContent()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleKeydown)}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),yt._activePreview===this&&(yt._activePreview=null),this.remove()}_handleDownload(){this.dispatchEvent(new CustomEvent("download",{bubbles:!0,composed:!0,detail:{src:this.src,name:this.name}}))}_handleZoomIn(){this._zoomLevel=Math.min(this._zoomLevel+25,300),this._zoomLevel<=100&&(this._panX=0,this._panY=0)}_handleZoomOut(){this._zoomLevel=Math.max(this._zoomLevel-25,25),this._zoomLevel<=100&&(this._panX=0,this._panY=0)}_handleZoomReset(){this._zoomLevel=100,this._panX=0,this._panY=0}_handleDragStart(e){this._zoomLevel<=100||(e.preventDefault(),this._dragging=!0,this._dragStartX=e.clientX,this._dragStartY=e.clientY,this._panStartX=this._panX,this._panStartY=this._panY,document.addEventListener("mousemove",this._handleDragMove),document.addEventListener("mouseup",this._handleDragEnd))}_handleBackdropClick(e){e.target===e.currentTarget&&this._close()}_getExtension(){return(this.name||"").split(".").pop()?.toLowerCase()||""}_isImage(){return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(this._getExtension())}_isPdf(){return"pdf"===this._getExtension()}_isText(){return["csv","txt","json","xml","log","md","yml","yaml","ini","cfg","conf","env","sh","bat"].includes(this._getExtension())}_isCsv(){return"csv"===this._getExtension()}_loadTextContent(){fetch(this.src).then((e=>e.text())).then((e=>{this._isCsv()?this._textContent=this._formatCsv(e):this._textContent=e})).catch((()=>{this._textContent="Failed to load file content."}))}_formatCsv(e){const t=e.trim().split("\n");if(!t.length)return e;const i=t.map((e=>e.split(",").map((e=>e.trim())))),s=Math.max(...i.map((e=>e.length))),o=[];for(let e=0;e<s;e++){let t=0;for(const s of i){const i=(s[e]||"").length;i>t&&(t=i)}o.push(t)}return i.map((e=>e.map(((e,t)=>e.padEnd(o[t]||0))).join(" "))).join("\n")}_getFallbackIconClass(e){return["doc","docx","rtf","txt"].includes(e)?"fallback__icon--doc":["xls","xlsx","csv"].includes(e)?"fallback__icon--xls":["zip","rar","7z","gz","tar"].includes(e)?"fallback__icon--zip":"fallback__icon--default"}_getFallbackIcon(e){return["doc","docx","rtf","txt"].includes(e)?j`<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)?j`<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)?j`<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>`:j`<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(){let e;if(this._isImage()){const t=this._zoomLevel/100,i=this._panX/t,s=this._panY/t,o=this._zoomLevel>100?"grab":"default";e=j`<img
|
|
3123
3293
|
class="body__image"
|
|
3124
3294
|
src="${this.src}"
|
|
3125
3295
|
alt="${this.name}"
|
|
@@ -3483,7 +3653,7 @@ const $t=e=>e??U
|
|
|
3483
3653
|
* @license
|
|
3484
3654
|
* Copyright 2020 Google LLC
|
|
3485
3655
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3486
|
-
*/,Ct={},St=xe(class extends ke{constructor(e){if(super(e),e.type!==ye&&e.type!==
|
|
3656
|
+
*/,Ct={},St=xe(class extends ke{constructor(e){if(super(e),e.type!==ye&&e.type!==ve&&e.type!==me)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===B||t===U)return t;const i=e.element,s=e.name;if(e.type===ye){if(t===i[s])return B}else if(e.type===me){if(!!t===i.hasAttribute(s))return B}else if(e.type===ve&&i.getAttribute(s)===t+"")return B;return((e,t=Ct)=>{e._$AH=t;
|
|
3487
3657
|
/**
|
|
3488
3658
|
* @license
|
|
3489
3659
|
* Copyright 2020 Google LLC
|
|
@@ -4479,5 +4649,5 @@ const $t=e=>e??U
|
|
|
4479
4649
|
color: var(--kr-checkbox-error-color, #ef4444);
|
|
4480
4650
|
margin-left: 26px;
|
|
4481
4651
|
}
|
|
4482
|
-
`],Ht.formAssociated=!0,Vt([pe({type:String})],Ht.prototype,"label",void 0),Vt([pe({type:String})],Ht.prototype,"name",void 0),Vt([pe({type:String})],Ht.prototype,"value",void 0),Vt([pe({type:Boolean})],Ht.prototype,"checked",void 0),Vt([pe({type:Boolean})],Ht.prototype,"disabled",void 0),Vt([pe({type:Boolean})],Ht.prototype,"required",void 0),Vt([pe({type:String})],Ht.prototype,"hint",void 0),Vt([ue()],Ht.prototype,"_touched",void 0),Ht=Vt([de("kr-checkbox")],Ht);export{
|
|
4652
|
+
`],Ht.formAssociated=!0,Vt([pe({type:String})],Ht.prototype,"label",void 0),Vt([pe({type:String})],Ht.prototype,"name",void 0),Vt([pe({type:String})],Ht.prototype,"value",void 0),Vt([pe({type:Boolean})],Ht.prototype,"checked",void 0),Vt([pe({type:Boolean})],Ht.prototype,"disabled",void 0),Vt([pe({type:Boolean})],Ht.prototype,"required",void 0),Vt([pe({type:String})],Ht.prototype,"hint",void 0),Vt([ue()],Ht.prototype,"_touched",void 0),Ht=Vt([de("kr-checkbox")],Ht);export{be as KRAccordion,Ce as KRAlert,It as KRAutoSuggest,Ee as KRButton,Ht as KRCheckbox,De as KRCodeDemo,Rt as KRComboBox,Pe as KRContextMenu,Ne as KRDateRangePicker,Be as KRDialog,je as KRDialogRef,wt as KRFileList,xt as KRFilePreview,_t as KRProgressBar,ct as KRQuery,Mt as KRRadioCards,Je as KRSelectField,tt as KRSelectOption,Ke as KRSnackbar,bt as KRSpinner,Qe as KRTab,Ye as KRTabGroup,ft as KRTable,zt as KRTextField,Tt as KRTextareaField,it as KR_OPERATORS,st as getOperatorsForType,ne as krBaseCSS};
|
|
4483
4653
|
//# sourceMappingURL=krubble-components.bundled.min.js.map
|