@sme.up/ketchup 8.2.0 → 8.2.1
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/dist/cjs/{f-button-797c8e7f.js → f-button-76a75669.js} +2 -2
- package/dist/cjs/{f-cell-9c8ed48b.js → f-cell-a440d744.js} +7 -7
- package/dist/cjs/{f-checkbox-cff77b2c.js → f-checkbox-aa34efd5.js} +1 -1
- package/dist/cjs/{f-chip-318863df.js → f-chip-fe9cffed.js} +3 -3
- package/dist/cjs/{f-image-f10144e9.js → f-image-47976ad7.js} +2 -2
- package/dist/cjs/{f-paginator-utils-8c44a37b.js → f-paginator-utils-f13f036f.js} +3 -3
- package/dist/cjs/{f-text-field-9610c198.js → f-text-field-3868b623.js} +3 -3
- package/dist/cjs/{index-a9a3b467.js → index-dd9f2b9b.js} +0 -3
- package/dist/cjs/ketchup.cjs.js +2 -2
- package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +13 -10
- package/dist/cjs/kup-box.cjs.entry.js +10 -10
- package/dist/cjs/kup-calendar.cjs.entry.js +5 -5
- package/dist/cjs/kup-cell.cjs.entry.js +7 -7
- package/dist/cjs/kup-dash-list.cjs.entry.js +2 -2
- package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
- package/dist/cjs/kup-dashboard.cjs.entry.js +6 -6
- package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
- package/dist/cjs/kup-echart.cjs.entry.js +57 -17
- package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
- package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
- package/dist/cjs/kup-image-list.cjs.entry.js +8 -8
- package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
- package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
- package/dist/cjs/{kup-manager-7747decd.js → kup-manager-695bbbe3.js} +1 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
- package/dist/cjs/kup-photo-frame.cjs.entry.js +2 -2
- package/dist/cjs/kup-planner.cjs.entry.js +3 -3
- package/dist/cjs/kup-probe.cjs.entry.js +2 -2
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/data-table.js +0 -44
- package/dist/collection/assets/echart.js +146 -4
- package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
- package/dist/collection/components/kup-echart/kup-echart-declarations.js +1 -0
- package/dist/collection/components/kup-echart/kup-echart.js +54 -15
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
- package/dist/collection/components/kup-text-field/kup-text-field.js +23 -0
- package/dist/collection/f-components/f-cell/f-cell.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field.js +1 -1
- package/dist/components/kup-autocomplete2.js +7 -3
- package/dist/components/kup-echart2.js +55 -15
- package/dist/esm/{f-button-e0e6f65f.js → f-button-c5b36ae1.js} +2 -2
- package/dist/esm/{f-cell-359dfe28.js → f-cell-d48502f1.js} +7 -7
- package/dist/esm/{f-checkbox-91358c27.js → f-checkbox-11b32f83.js} +1 -1
- package/dist/esm/{f-chip-0fd043b4.js → f-chip-038e9404.js} +3 -3
- package/dist/esm/{f-image-b853b0cc.js → f-image-c356f4c5.js} +2 -2
- package/dist/esm/{f-paginator-utils-124c146a.js → f-paginator-utils-58466d55.js} +3 -3
- package/dist/esm/{f-text-field-92bb3a1f.js → f-text-field-7e2b397b.js} +3 -3
- package/dist/esm/{index-bb15ce14.js → index-b45996ce.js} +1 -3
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +3 -3
- package/dist/esm/kup-autocomplete_27.entry.js +13 -10
- package/dist/esm/kup-box.entry.js +10 -10
- package/dist/esm/kup-calendar.entry.js +5 -5
- package/dist/esm/kup-cell.entry.js +7 -7
- package/dist/esm/kup-dash-list.entry.js +2 -2
- package/dist/esm/kup-dash_2.entry.js +2 -2
- package/dist/esm/kup-dashboard.entry.js +6 -6
- package/dist/esm/kup-drawer.entry.js +2 -2
- package/dist/esm/kup-echart.entry.js +57 -17
- package/dist/esm/kup-family-tree.entry.js +4 -4
- package/dist/esm/kup-iframe.entry.js +2 -2
- package/dist/esm/kup-image-list.entry.js +8 -8
- package/dist/esm/kup-lazy.entry.js +2 -2
- package/dist/esm/kup-magic-box.entry.js +3 -3
- package/dist/esm/{kup-manager-1e6ea451.js → kup-manager-74e46edc.js} +1 -1
- package/dist/esm/kup-nav-bar.entry.js +2 -2
- package/dist/esm/kup-numeric-picker.entry.js +3 -3
- package/dist/esm/kup-photo-frame.entry.js +2 -2
- package/dist/esm/kup-planner.entry.js +3 -3
- package/dist/esm/kup-probe.entry.js +2 -2
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +4 -4
- package/dist/esm/loader.js +3 -3
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-b73b3b52.entry.js → p-008cde2a.entry.js} +1 -1
- package/dist/ketchup/{p-c1b10c9c.entry.js → p-0d533d24.entry.js} +1 -1
- package/dist/ketchup/{p-adad6804.entry.js → p-1f5eb8e6.entry.js} +1 -1
- package/dist/ketchup/{p-cf24193b.entry.js → p-26765429.entry.js} +1 -1
- package/dist/ketchup/{p-e646523d.js → p-279eab92.js} +1 -1
- package/dist/ketchup/{p-41c00681.entry.js → p-2ac7d95a.entry.js} +1 -1
- package/dist/ketchup/{p-b5deb573.js → p-3da7e4c6.js} +2 -2
- package/dist/ketchup/{p-6d46cbb0.js → p-46daf529.js} +1 -1
- package/dist/ketchup/{p-6837f725.entry.js → p-59919641.entry.js} +1 -1
- package/dist/ketchup/{p-c28be862.entry.js → p-70a6ab77.entry.js} +1 -1
- package/dist/ketchup/p-71f202aa.entry.js +1 -0
- package/dist/ketchup/{p-ad919f87.entry.js → p-73ab15cd.entry.js} +1 -1
- package/dist/ketchup/{p-fb29ba2a.js → p-78eaa526.js} +1 -1
- package/dist/ketchup/{p-6e79b764.entry.js → p-8d992de0.entry.js} +1 -1
- package/dist/ketchup/{p-fd1323da.js → p-90576709.js} +1 -1
- package/dist/ketchup/p-9c7b9ff2.js +1 -0
- package/dist/ketchup/p-9cc4dd44.js +1 -0
- package/dist/ketchup/{p-ba0c4019.entry.js → p-a015c95b.entry.js} +1 -1
- package/dist/ketchup/{p-1cd5785e.entry.js → p-ad9b5c06.entry.js} +2 -2
- package/dist/ketchup/{p-81e20baa.entry.js → p-afbd769b.entry.js} +1 -1
- package/dist/ketchup/{p-818a4a09.entry.js → p-b813af24.entry.js} +1 -1
- package/dist/ketchup/{p-85d6bb1f.entry.js → p-bb93aa7e.entry.js} +1 -1
- package/dist/ketchup/{p-8c1804d7.entry.js → p-c1c49123.entry.js} +1 -1
- package/dist/ketchup/{p-adebe276.entry.js → p-cd1f9e76.entry.js} +1 -1
- package/dist/ketchup/{p-349d4715.js → p-d5491e4f.js} +1 -1
- package/dist/ketchup/{p-5dbd4402.entry.js → p-da0db0a5.entry.js} +1 -1
- package/dist/ketchup/{p-620faa59.entry.js → p-dfab37a3.entry.js} +1 -1
- package/dist/ketchup/{p-c010483d.entry.js → p-e28a3dfb.entry.js} +1 -1
- package/dist/ketchup/{p-c6088459.entry.js → p-e9d2a964.entry.js} +2 -2
- package/dist/ketchup/{p-374f867e.entry.js → p-f023195c.entry.js} +1 -1
- package/dist/ketchup/{p-1ca9aece.js → p-ffbd77d5.js} +1 -1
- package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
- package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +2 -1
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
- package/dist/types/components.d.ts +10 -0
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/dist/types/managers/kup-data/kup-data-declarations.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ketchup/p-0143e942.js +0 -1
- package/dist/ketchup/p-2ac2c05e.js +0 -1
- package/dist/ketchup/p-e8977116.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h,H as s,g as a}from"./p-
|
|
1
|
+
import{r as t,c as e,f as i,h,H as s,g as a}from"./p-3da7e4c6.js";import{k as o,g as n,s as l}from"./p-46daf529.js";import{c as p}from"./p-ad2e21d2.js";var r,c;!function(t){t.componentName="Sets the tag name of the component to be lazy loaded.",t.customStyle="Custom style of the component.",t.data="Sets the data of the component to be lazy loaded.",t.showPlaceholder="Displays an animated SVG placeholder until the component is loaded."}(r||(r={})),function(t){t.VIEWPORT="viewport",t.PROPS="props",t.BOTH="both"}(c||(c={}));const d=class{constructor(i){t(this,i),this.kupLazyLoaded=e(this,"kup-lazy-loaded",6),this.intObserver=null,this.kupManager=o(),this.lazyComponent=null,this.lazyComponentLoaded=!1,this.isInViewport=!1,this.componentName=null,this.customStyle="",this.data=null,this.renderMode=c.BOTH,this.showPlaceholder=!0}async getProps(t){return n(this,r,t)}async getComponent(){return this.lazyComponent}async refresh(){i(this)}async setProps(t){l(this,r,t)}setObserver(){this.intObserver=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.kupManager.debug.logMessage(this,"kup-lazy entering the viewport, rendering "+this.componentName+"."),this.isInViewport=!0,this.intObserver.unobserve(this.rootElement))}))}),{threshold:.25})}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.setObserver()}componentDidLoad(){this.intObserver.observe(this.rootElement),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.lazyComponent&&!this.lazyComponentLoaded&&(this.lazyComponentLoaded=!0,this.kupLazyLoaded.emit({comp:this,id:this.rootElement.id})),this.kupManager.debug.logRender(this,!0)}render(){let t,e,i=this.componentName;switch(this.componentName){case"kup-button":e=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},h("path",{d:"M42 6H6c-2.2 0-4 1.8-4 4v28c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4V10c0-2.2-1.8-4-4-4zm0 32H6v-6h36v6z"}));break;case"kup-card":default:e=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},h("path",{d:"M44 26H28v-4h16v4zm0-12H28v4h16v-4zM28 34h16v-4H28v4zm-4-16v12c0 2.2-1.8 4-4 4H8c-2.2 0-4-1.8-4-4V18c0-2.2 1.8-4 4-4h12c2.2 0 4 1.8 4 4zm-3 12l-4.5-6-3.5 4.51-2.5-3.01L7 30h14z"}));break;case"kup-checkbox":e=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},h("path",{d:"M38 10v28H10V10h28m0-4H10c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4z"}));break;case"kup-chart":e=h("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},h("path",{d:"M22,21H2V3H4V19H6V10H10V19H12V6H16V19H18V14H22V21Z"}));break;case"kup-data-table":e=h("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},h("path",{d:"M4,3H20A2,2 0 0,1 22,5V20A2,2 0 0,1 20,22H4A2,2 0 0,1 2,20V5A2,2 0 0,1 4,3M4,7V10H8V7H4M10,7V10H14V7H10M20,10V7H16V10H20M4,12V15H8V12H4M4,20H8V17H4V20M10,12V15H14V12H10M10,20H14V17H10V20M20,20V17H16V20H20M20,12H16V15H20V12Z"}));break;case"kup-image":e=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},h("path",{d:"M42 38V10c0-2.21-1.79-4-4-4H10c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4zM17 27l5 6.01L29 24l9 12H10l7-9z"}));break;case"kup-progress-bar":e=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},h("path",{d:"M39 19c-2.05 0-3.81 1.23-4.58 3h-5.84c-.77-1.77-2.53-3-4.58-3s-3.81 1.23-4.58 3h-5.84c-.77-1.77-2.53-3-4.58-3-2.77 0-5 2.23-5 5s2.23 5 5 5c2.05 0 3.81-1.23 4.58-3h5.84c.77 1.77 2.53 3 4.58 3s3.81-1.23 4.58-3h5.84c.77 1.77 2.53 3 4.58 3 2.77 0 5-2.23 5-5s-2.23-5-5-5z"}));break;case"kup-radio":e=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},h("path",{d:"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16z"}))}return this.renderMode===c.VIEWPORT&&this.isInViewport||this.renderMode===c.PROPS&&this.data||this.renderMode===c.BOTH&&this.data&&this.isInViewport?(t=h(this.componentName,Object.assign({},this.data,{ref:t=>this.lazyComponent=t})),i+=" kup-loaded"):this.showPlaceholder&&(t=e,i+=" kup-to-be-loaded"),h(s,{class:i},h("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),h("div",{id:p},t))}disconnectedCallback(){var t;this.kupManager.theme.unregister(this),null===(t=this.intObserver)||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return a(this)}};d.style=":host{--kup_lazy_animation_time:var(--kup-lazy-animation-time, 2s);--kup_lazy_hor_alignment:var(--kup-lazy-hor-alignment, center);--kup_lazy_placeholder_color:var(\n --kup-lazy-placeholder-color,\n var(--kup-icon-color)\n );--kup_lazy_height:var(--kup-lazy-height, 100%);--kup_lazy_ver_alignment:var(--kup-lazy-ver-alignment, center);--kup_lazy_width:var(--kup-lazy-width, 100%);display:block;height:var(--kup_lazy_height);width:var(--kup_lazy_width);position:relative}#kup-component{align-items:var(--kup_lazy_ver_alignment);display:flex;justify-content:var(--kup_lazy_hor_alignment);height:var(--kup_lazy_height);width:var(--kup_lazy_width)}#kup-component>*{height:var(--kup_lazy_height)}#kup-component kup-data-table{min-width:100%}.kup-loaded,.kup-to-be-loaded{height:var(--kup_lazy_height);width:var(--kup_lazy_width)}svg{fill:var(--kup_lazy_placeholder_color);animation:shine ease var(--kup_lazy_animation_time) infinite}@keyframes shine{0%{opacity:0.4}50%{opacity:0.8}100%{opacity:0.4}}:host(.kup-bottom-aligned){--kup-lazy-ver-alignment:flex-end}:host(.kup-left-aligned){--kup-lazy-hor-alignment:flex-start}:host(.kup-right-aligned){--kup-lazy-hor-alignment:flex-end}:host(.kup-top-aligned){--kup-lazy-ver-alignment:flex-start}:host(.kup-to-be-loaded) #kup-component{position:absolute}:host(.kup-to-be-loaded) #kup-component>*{margin:auto}";export{d as kup_lazy}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as n}from"./p-
|
|
1
|
+
import{h as n}from"./p-3da7e4c6.js";import{F as t}from"./p-0fd98ab4.js";import{F as o}from"./p-9c7b9ff2.js";const e=(e,u)=>{if(e.styling||(e.styling=t.RAISED),!e.label&&!e.icon)return;const i=!!(e.styling.toLowerCase()===t.ICON||e.styling.toLowerCase()===t.RAISED&&e.icon&&null==e.label);return n("div",Object.assign({class:`f-button ${e.danger?"kup-danger":""} ${e.fullHeight?"kup-full-height":""} ${e.fullWidth?"kup-full-width":""} ${e.info?"kup-info":""} ${e.large?"kup-large":""} ${e.pulsating?"kup-pulsating":""} ${e.shaped?"kup-shaped":""} ${e.secondary?"kup-secondary":""} ${e.slim?"kup-slim":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),i?function(t){const e={color:t.disabled?"var(--kup_button_disabled_color)":"var(--kup_button_primary_color)",sizeX:t.large?"calc(1.75em * 1.5)":"1.75em",sizeY:t.large?"calc(1.75em * 1.5)":"1.75em"};return n("button",{type:t.buttonType?t.buttonType:"button",class:{"icon-button":!0,"button--disabled":!!t.disabled,"icon-button--on":!(!t.toggable||!t.checked),toggable:!!t.toggable,"button--with-spinner":!(!t.showSpinner||t.disabled)},disabled:t.disabled,onClick:t.onClick,style:{"--kup_button_spinner_height":e.sizeY,"--kup_button_spinner_width":e.sizeX},value:t.checked?"on":"off","aria-label":t.title},!t.showSpinner||t.disabled?n(o,Object.assign({},e,{resource:t.toggable&&!t.checked?t.iconOff?t.iconOff:t.icon+"_border":t.icon,wrapperClass:"icon-button__icon kup-icon"})):null,t.toggable&&!t.showSpinner?n(o,Object.assign({},e,{resource:t.icon,wrapperClass:"icon-button__icon icon-button__icon--on kup-icon"})):null,t.showSpinner&&!t.disabled?n("div",{class:"icon-button__spinner-container"},n("slot",{name:"spinner"})):void 0)}(e):function(e){const u=e.styling.toLowerCase()===t.FLAT,i=e.styling.toLowerCase()===t.FLOATING,s=e.styling.toLowerCase()===t.ICON,r=e.styling.toLowerCase()===t.OUTLINED,a=!(u||i||r||s),c={color:e.disabled?"var(--kup_button_disabled_color)":r||u?"var(--kup_button_primary_color)":"var(--kup_button_text_on_primary_color)",resource:e.icon,sizeX:i?"1.75em":"1.475em",sizeY:i?"1.75em":"1.475em",wrapperClass:"button__icon kup-icon"};e.showSpinner&&(c.wrapperClass+=" content--hidden");const l={button__label:!0,"content--hidden":!(!e.showSpinner||e.disabled)};return n("button",{type:e.buttonType?e.buttonType:"button",class:{button:!0,"button--disabled":!!e.disabled,"button--floating":!!i,"button--outlined":!!r,"button--raised":!!a,"button--no-label":!e.label||" "===e.label,"button--with-spinner":!(!e.showSpinner||e.disabled)},disabled:e.disabled,onBlur:e.onBlur,onClick:e.onClick,onFocus:e.onFocus,style:{"--kup_button_spinner_height":c.sizeY},"aria-label":e.title},e.trailingIcon?[n("span",{class:l},e.label),e.icon?n(o,Object.assign({},c)):void 0]:[e.icon?n(o,Object.assign({},c)):void 0,n("span",{class:l},e.label)],e.showSpinner&&!e.disabled?n("div",{class:"button__spinner-container"},n("slot",{name:"spinner"})):void 0)}(e),u)};export{e as F}
|
|
@@ -6,8 +6,8 @@ export declare class KupDataTableState implements KupState {
|
|
|
6
6
|
expandGroups: boolean;
|
|
7
7
|
groupLabelDisplay: GroupLabelDisplayMode;
|
|
8
8
|
density: string;
|
|
9
|
-
enableExtraColumns: boolean;
|
|
10
9
|
enableSortableColumns: boolean;
|
|
10
|
+
enableExtraColumns: boolean;
|
|
11
11
|
forceOneLine: boolean;
|
|
12
12
|
globalFilter: boolean;
|
|
13
13
|
globalFilterValue: string;
|
|
@@ -53,7 +53,8 @@ export declare enum KupEchartTypes {
|
|
|
53
53
|
SCATTER = "Scatter",
|
|
54
54
|
FUNNEL = "Funnel",
|
|
55
55
|
RADAR = "Radar",
|
|
56
|
-
BUBBLE = "Bubble"
|
|
56
|
+
BUBBLE = "Bubble",
|
|
57
|
+
SANKEY = "Sankey"
|
|
57
58
|
}
|
|
58
59
|
export interface KupEchartClickEventPayload extends KupEventPayload {
|
|
59
60
|
column: KupDataColumn;
|
|
@@ -28,6 +28,7 @@ export declare enum KupTextFieldProps {
|
|
|
28
28
|
name = "The HTML name attribute used for form autocomplete.",
|
|
29
29
|
outlined = "When set to true, the component will be rendered as an outlined field.",
|
|
30
30
|
readOnly = "Sets the component to read only state, making it not editable, but interactable. Used in combobox component when it behaves as a select.",
|
|
31
|
+
size = "The HTML attribute size of the input element.",
|
|
31
32
|
step = "The HTML step of the input element. It has effect only with number input type.",
|
|
32
33
|
textArea = "When set to true, the component will be rendered as a textarea.",
|
|
33
34
|
trailingIcon = "When set, the icon will be shown after the text.",
|
|
@@ -135,6 +135,11 @@ export declare class KupTextField {
|
|
|
135
135
|
* @default false
|
|
136
136
|
*/
|
|
137
137
|
readOnly: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* The HTML attribute size of the input element.
|
|
140
|
+
* @default null
|
|
141
|
+
*/
|
|
142
|
+
size: number;
|
|
138
143
|
/**
|
|
139
144
|
* The HTML step of the input element. It has effect only with number input type.
|
|
140
145
|
* @default null
|
|
@@ -3196,6 +3196,11 @@ export namespace Components {
|
|
|
3196
3196
|
* Sets the internal value of the component.
|
|
3197
3197
|
*/
|
|
3198
3198
|
"setValue": (value: string) => Promise<void>;
|
|
3199
|
+
/**
|
|
3200
|
+
* The HTML attribute size of the input element.
|
|
3201
|
+
* @default null
|
|
3202
|
+
*/
|
|
3203
|
+
"size": number;
|
|
3199
3204
|
/**
|
|
3200
3205
|
* The HTML step of the input element. It has effect only with number input type.
|
|
3201
3206
|
* @default null
|
|
@@ -6504,6 +6509,11 @@ declare namespace LocalJSX {
|
|
|
6504
6509
|
* @default false
|
|
6505
6510
|
*/
|
|
6506
6511
|
"readOnly"?: boolean;
|
|
6512
|
+
/**
|
|
6513
|
+
* The HTML attribute size of the input element.
|
|
6514
|
+
* @default null
|
|
6515
|
+
*/
|
|
6516
|
+
"size"?: number;
|
|
6507
6517
|
/**
|
|
6508
6518
|
* The HTML step of the input element. It has effect only with number input type.
|
|
6509
6519
|
* @default null
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,a as t}from"./p-b5deb573.js";import{K as l}from"./p-6d46cbb0.js";const i=document.documentElement,d=(t,l)=>e("div",Object.assign({class:`f-text-field ${t.danger?"kup-danger":""} ${t.fullHeight?"kup-full-height":""} ${t.fullWidth?"kup-full-width":""} ${t.info?"kup-info":""} ${t.secondary?"kup-secondary":""} ${t.shaped?"kup-shaped":""} ${t.success?"kup-success":""} ${t.warning?"kup-warning":""} ${t.wrapperClass?t.wrapperClass:""}`},t.dataSet,{id:t.id,title:t.title}),t.leadingLabel||t.trailingLabel?e("div",{class:"mdc-form-field "+(t.leadingLabel?"mdc-form-field--align-end":"")},[n(t),c(t),e("label",null,t.label)]):[n(t),c(t)],l);function n(d){var n,c;const o=d.textArea||d.outlined;let s,r;if(!d.label||d.leadingLabel||d.trailingLabel||(s=e("label",{class:"mdc-floating-label",htmlFor:"kup-input"},d.label)),d.icon){let i,n="";if(Object.values(l).indexOf(d.icon)>-1)n=d.icon.replace("--","");else{let e=`url('${t(`./assets/svg/${d.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}r=e("span",{style:i,onClick:d.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}const u={"is-clearable":d.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":d.disabled,"mdc-text-field--filled":!d.fullWidth&&!o,"mdc-text-field--no-label":!d.label,"mdc-text-field--fullwidth":d.fullWidth,"mdc-text-field--outlined":o,"mdc-text-field--textarea":d.textArea,"mdc-text-field--with-leading-icon":d.icon&&!d.trailingIcon,"mdc-text-field--with-trailing-icon":d.icon&&d.trailingIcon};let m=d.value,f=null!==(n=d.inputType)&&void 0!==n?n:"text",p=!1;if("number"===d.inputType&&d.decimals&&d.decimals>0&&(f="text",p=!0),"number"===d.inputType){const e={allowNegative:null===(c=d.allowNegative)||void 0===c||c,decimal:d.decimals,group:d.group,integer:d.integers};m=a(m,e,!1)}return e("div",{class:u},d.textArea&&d.maxLength?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",d.maxLength):void 0,d.trailingIcon?void 0:r,d.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,maxlength:d.maxLength,value:m,onBlur:d.onBlur,onClick:d.onClick,onChange:d.onChange,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown})):e("input",{inputmode:d.inputMode?d.inputMode:void 0,type:f,step:d.step,min:d.min,max:d.max,name:d.name,class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,placeholder:d.fullWidth&&!d.outlined?d.label:void 0,maxlength:d.maxLength,value:m,onBlur:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onBlur&&d.onBlur(e)},onChange:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onChange&&d.onChange(e)},onClick:d.onClick,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown,onKeyPress:e=>{var t;if(!p)return;if(e.ctrlKey)return;if(e.key.length>1)return;const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};let n=e.target,c=n.value,a=c.substring(0,n.selectionStart),o=c.substring(n.selectionEnd,n.selectionEnd+c.length-1);i.ketchup.math.matchNumericValueWithOptions(a+e.key+o,l)||e.preventDefault()}}),d.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:d.onClearIconClick}):void 0,d.trailingIcon?r:void 0,d.fullWidth||o?void 0:s,o?e("div",{class:"mdc-notched-outline"},e("div",{class:"mdc-notched-outline__leading"}),e("div",{class:"mdc-notched-outline__notch"},s),e("div",{class:"mdc-notched-outline__trailing"})):e("span",{class:"mdc-line-ripple"}))}function c(t){if(!1!==t.helperEnabled){if(t.helper)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!t.helperWhenFocused}},t.helper),t.maxLength&&!t.textArea?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength.toString()):void 0);if(t.maxLength&&!t.textArea)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength))}}const a=function(e,t,l){let d=e;return d?"-"==d?"":i.ketchup.math.format(d,i.ketchup.math.createFormatPattern(t.group,t.decimal),l):d};export{d as F}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,a as e}from"./p-b5deb573.js";import{b as s}from"./p-6d46cbb0.js";var i;!function(t){t.BAR="bar"}(i||(i={}));const a=a=>{let n,o;a.resource?a.resource.indexOf(".")>-1||a.resource.indexOf("/")>-1||a.resource.indexOf("\\")>-1?(o={"--kup_image_height":a.sizeY?a.sizeY:"auto","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(e){return t("img",{onLoad:e.onLoad,src:e.resource})}(a)):(o={"--kup_image_height":a.sizeY?a.sizeY:"100%","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(i){const a={"f-image__icon":!0},n={background:i.color?i.color:`var(${s.ICON})`};if(i.resource.indexOf("--kup")>-1){let t=i.resource.replace("--","");a["kup-icon"]=!0,a[t]=!0}else{const t=e(`./assets/svg/${i.resource}.svg`);n.mask=`url('${t}') no-repeat center`,n.webkitMask=`url('${t}') no-repeat center`}return t("div",{class:a,style:n})}(a)):a.data&&(o={"--kup_image_height":a.sizeY?a.sizeY:"100%","--kup_image_width":a.sizeX?a.sizeX:"100%"},n=function(e){const s=[];let a=0;for(let n=0;n<e.length;n++){let o;e[n].shape||(e[n].shape=i.BAR),e[n].color||(e[n].color="transparent"),e[n].height||(e[n].height="100%"),e[n].width||(e[n].width="100%");const r="step-"+n,c="css-step bottom-aligned",l={backgroundColor:e[n].color,left:a+"%",height:e[n].height,width:e[n].width};a+=parseFloat(e[n].width),o=t("span",{id:r,class:c,style:l}),s.push(o)}return t("div",{class:"f-image__css"},s)}(a.data));const r=[];if(a.badgeData)for(let e=0;e<a.badgeData.length;e++)r.push(t("kup-badge",Object.assign({},a.badgeData[e])));return t("div",Object.assign({class:`f-image ${a.wrapperClass?a.wrapperClass:""} ${a.fit?"kup-fit":""}`},a.dataSet,{id:a.id,style:o,title:a.title,onClick:a.onClick}),n,...r)};export{a as F}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as o,f as i,e,h as s,H as r,g as n}from"./p-b5deb573.js";import{k as a,A as l,g as h,s as c,v as p,m as b,K as d,c as u,Q as x,V as f,W as g,X as w,I as m,a2 as k}from"./p-6d46cbb0.js";import{f as v,p as y,s as _,d as j,r as C,h as P,b as A}from"./p-fb29ba2a.js";import{F as R}from"./p-2ac2c05e.js";import{a as z}from"./p-349d4715.js";import{c as I}from"./p-ad2e21d2.js";import{F as E}from"./p-e646523d.js";import{F as M}from"./p-fb03f2f5.js";import"./p-1ca9aece.js";import"./p-0fd98ab4.js";import"./p-fd1323da.js";import"./p-0143e942.js";import"./p-6507e9eb.js";var O;!function(t){t.cardData="Data of the card linked to the box when the latter's layout must be a premade template.",t.columns="Number of columns.",t.customStyle="Custom style of the component.",t.data="Actual data of the box.",t.dragEnabled="Enable dragging.",t.dropEnabled="Enable dropping.",t.dropOnSection="Drop can be done in section.",t.enableRowActions="If enabled, a button to load / display the row actions will be displayed on the right of every box.",t.globalFilter="When set to true it activates the global filter.",t.globalFilterValue="The value of the global filter.",t.kanban="Displays the boxlist as a Kanban.",t.layout="How the field will be displayed. If not present, a default one will be created.",t.lazyLoadRows="When set to true, extra rows will be automatically loaded once the last row enters the viewport.",t.multiSelection="Enable multi selection.",t.pageSelected="Current page number.",t.pagination="Enables pagination.",t.rowsPerPage="Number of current rows per page.",t.scrollOnHover="Activates the scroll on hover function.",t.selectBox="Automatically selects the box at the specified index.",t.selectedRowsState="Multiple selection.",t.showSelection="If enabled, highlights the selected box/boxes.",t.sortBy="If sorting is enabled, specifies which column to sort.",t.sortEnabled="Enable sorting.",t.stateId="",t.store="",t.swipeDisabled="Disable swipe."}(O||(O={}));class S{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1}toDebugString(){return"box state"}}var B,D,W,$,T,F,L=function(t,o,i,e){if("a"===i&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof o?t!==o||!e:!o.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?e:"a"===i?e.call(t):e?e.value:o.get(t)},H=function(t,o,i,e,s){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof o?t!==o||!s:!o.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?s.call(t,i):s?s.value=i:o.set(t,i),i};const G=class{constructor(i){t(this,i),this.kupBoxClick=o(this,"kup-box-click",6),this.kupBoxSelected=o(this,"kup-box-selected",6),this.kupAutoBoxSelect=o(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=o(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=o(this,"kup-box-rowactionclick",6),this.kupDidLoad=o(this,"kup-box-didload",6),this.kupDidUnload=o(this,"kup-box-didunload",6),this.kupBoxContextMenu=o(this,"kup-box-contextmenu",6),B.add(this),this.state=new S,this.kupManager=a(),this.visibleColumns=[],this.rows=[],this.filteredRows=[],this.sectionRef=null,this.rowsRefs=[],this.hold=!1,this.interactableDrag=[],this.interactableDrop=[],this.interactableTouch=[],D.set(this,void 0),W.set(this,[]),$.set(this,0),this.collapsedSection={},this.selectedRows=[],this.rowActionMenuOpened=void 0,this.currentPage=1,this.currentRowsPerPage=10,this.cardData=null,this.columns=1,this.customStyle="",this.data=null,this.dragEnabled=!1,this.dropEnabled=!1,this.dropOnSection=!1,this.editableData=!1,this.enableRowActions=!1,this.globalFilter=!1,this.globalFilterValue="",this.kanban=null,this.layout=void 0,this.lazyLoadRows=!1,this.multiSelection=!1,this.pageSelected=1,this.pagination=!1,this.rowsPerPage=void 0,this.scrollOnHover=!1,this.selectBox=void 0,this.selectedRowsState=void 0,this.showSelection=!0,this.sortBy=void 0,this.sortEnabled=!1,this.stateId="",this.store=void 0,this.swipeDisabled=!1}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(this.kupManager.debug.logMessage(this,"Initialize with state for stateId "+this.stateId+": "+t),this.sortBy=this.state.sortBy,this.globalFilterValue=this.state.globalFilterValue,this.selectedRowsState=this.state.selectedRowsState,this.pageSelected=this.state.pageSelected,this.rowsPerPage=this.state.rowsPerPage)}}persistState(){if(this.store&&this.stateId){let t=!1;this.kupManager.objects.deepEqual(this.state.sortBy,this.sortBy)||(this.state.sortBy=this.sortBy,t=!0),this.kupManager.objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)||(this.state.globalFilterValue=this.globalFilterValue,t=!0),this.kupManager.objects.deepEqual(this.state.pageSelected,this.currentPage)||(this.state.pageSelected=this.currentPage,t=!0),this.kupManager.objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)||(this.state.rowsPerPage=this.currentRowsPerPage,t=!0);const o=this.selectedRows.reduce(((t,o,i)=>t+(i>0?";":"")+o.id),"");if(this.kupManager.objects.deepEqual(this.state.selectedRowsState,o)||(this.state.selectedRowsState=o,t=!0),!this.state.load)return void(this.state.load=!0);t&&(this.kupManager.debug.logMessage(this,"Persisting state for stateId "+this.stateId+": "+this.state),this.store.persistState(this.stateId,this.state))}}rowsPerPageHandler(t){this.currentRowsPerPage=t}recalculateRows(){this.initRows()}onDataChanged(){l(this.getRows()),this.initVisibleColumns(),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return h(this,O,t)}async loadRowActions(t,o){t.actions=o,this.rowActionMenuOpened=t}async refresh(){i(this)}async setProps(t){c(this,O,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:void 0}]}initVisibleColumns(){this.visibleColumns=this.getColumns().filter((t=>!t.hasOwnProperty("visible")||t.visible))}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows(),this.globalFilter&&this.globalFilterValue&&(this.filteredRows=v(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=y(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let o=t;return this.sortBy&&(o=_(o,[{column:this.sortBy,sortMode:k.A}])),o}checkScrollOnHover(){this.kupManager.scrollOnHover.isRegistered(this.boxContainer)?this.scrollOnHover||this.kupManager.scrollOnHover.unregister(this.boxContainer):this.scrollOnHover&&this.kupManager.scrollOnHover.register(this.boxContainer)}checkLayout(){if(this.layout)return void(this.boxLayout=this.layout);const t={horizontal:!1,sections:[]},o=this.visibleColumns;let i=o.length,e=[],s=0;for(;i-- >0;)e.push({column:o[s++].name});t.content=e,this.boxLayout={sections:[t]}}onSortChange(t){let o=p(this.visibleColumns,t.detail.value);this.sortBy=o.name}onGlobalFilterChange({detail:t}){let o="";t&&t.value&&(o=t.value),this.globalFilterValue=o}isSectionExpanded(t,o){return!(!t.id||!o.id)&&this.collapsedSection[o.id]&&this.collapsedSection[o.id][t.id]}handleAutomaticBoxSelection(){if(this.selectBox&&this.selectBox>0&&this.selectBox<=this.data.rows.length){this.selectedRows=[];for(let t of this.data.rows)if(t.id===(this.selectBox-1).toString()){this.selectedRows.push(t);break}this.kupAutoBoxSelect.emit({comp:this,id:this.rootElement.id,row:this.selectedRows[0]})}}getEventDetails(t,o){let i=null,e=null,s=null,r=null;if(t&&(i=t.closest(".box-object")||t.querySelector(".box-object")||t.closest(".f-cell")),i)if(i.classList.contains("f-cell")){const t=i["kup-get-cell-props"]();e=t.cell,r=t.column,s=t.row}else e=i["data-cell"],s=i["data-row"],r=p(this.visibleColumns,i.dataset.column);return{boxObject:i||null,column:r||null,cell:e||null,originalEvent:o,row:s||null}}contextMenuHandler(t){return this.getEventDetails(t.target,t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onBoxClick({target:t},o){if(!(t instanceof e))return;let i=t,s=i.classList;for(;!s.contains("box-object")&&!s.contains("box-section")&&!s.contains("box")&&(i=i.parentElement,null!==i);)s=i.classList;let r=null;s.contains("box-object")&&(r=i.dataset.column),this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o,column:r}),this.multiSelection?this.onSelectionCheckChange(o):this.selectedRows=[o]}onSelectionCheckChange(t){var o=-1;for(let i=0;i<this.selectedRows.length;i++)if(this.selectedRows[i].id===t.id){o=i;break}o>=0?(this.selectedRows.splice(o,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,o){if(o.id)if(t.id){if(this.collapsedSection[o.id]){const i=this.collapsedSection[o.id];i[t.id]=!i[t.id]||!i[t.id]}else this.collapsedSection[o.id]={},this.collapsedSection[o.id][t.id]=!0;this.collapsedSection=Object.assign({},this.collapsedSection)}else console.error("cannot expand / collapse a section of a row without ad id");else console.error("cannot expand / collapse a section withoun an ID")}onRowAction(t){t&&(t!==this.rowActionMenuOpened?t.actions?this.rowActionMenuOpened=t:this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t}):this.rowActionMenuOpened=null)}onRowActionClick(t,o,i){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:o,index:i})}clickFunction(t){try{const o=t.composedPath();for(let t of o)if(this.checkIfElementIsActionMenuIcon(t))return}catch(o){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const o=j(t,this.filteredRows.length,this.currentRowsPerPage);o&&(this.currentPage=o)}handleRowsPerPageChange(t){const o=C(t,this.filteredRows.length);o&&(this.currentRowsPerPage=o,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let o=!1;const i={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let o=0;o<this.data.columns.length;o++){const e=this.data.columns[o];!1!==e.visible&&(i.cell.push(t.cells[e.name]),i.columns.push(e))}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const e=t.cells[o];if(void 0!==e.cardID&&e.obj)switch(e.obj.p){case"BTN":do{i.button.push({})}while(i.button.length<e.cardID);i.button[e.cardID]={label:e.value};break;case"IMG":do{i.image.push({})}while(i.image.length<e.cardID);i.image[e.cardID]={resource:e.value};break;case"PGB":do{i.progressbar.push({})}while(i.progressbar.length<e.cardID);i.progressbar[e.cardID]={value:e.value};break;default:do{i.text.push("")}while(i.text.length<e.cardID);i.text[e.cardID]=e.value}}for(const e in t.cells)if(t.cells.hasOwnProperty(e)){const s=t.cells[e];if(void 0===s.cardID&&s.obj)switch(o=!1,s.obj.p){case"BTN":for(let t=0;t<i.button.length;t++)if(!Object.keys(i.button[t]).length){i.button[t]={label:s.value},o=!0;break}o||i.button.push({label:s.value});break;case"IMG":for(let t=0;t<i.image.length;t++)if(!Object.keys(i.image[t]).length){i.image[t]={resource:s.value},o=!0;break}o||i.image.push({resource:s.value});break;case"PGB":for(let t=0;t<i.progressbar.length;t++)if(!Object.keys(i.progressbar[t]).length){i.progressbar[t]={value:s.value},o=!0;break}o||i.progressbar.push({value:s.value});break;default:for(let t=0;t<i.text.length;t++)if(""===i.text[t]){i.text[t]=s.value,o=!0;break}o||i.text.push(s.value)}}return s("kup-card",Object.assign({data:i},this.cardData))}renderRow(t){const o=[...this.visibleColumns];let i=null,e=t.layout;e||(e=this.boxLayout);let r=!1;if(e){e.horizontal&&(r=!0);const s=e.sections;let n=s.length,a=0;n>0&&(i=[]);const l={horizontal:r};for(;n-- >0;)i.push(null!=this.cardData&&"object"==typeof this.cardData?this.renderSectionAsCard(t):this.renderSection(s[a++],l,t,o))}var n=!1;for(let o of this.selectedRows)o.id===t.id&&(n=!0);let a=null;this.multiSelection&&(a=s("div",{class:"box-selection"},s("kup-checkbox",{checked:n})));let l=null;if(this.enableRowActions&&!this.swipeDisabled){const o={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let i=null;if(t.actions){const o=t.actions.map(((o,i)=>s("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,o,i)},s("div",{class:`icon ${o.icon}`}),s("div",{class:"text"},o.text))));i=s("ul",null,o)}l=s("div",{class:"row-actions-wrapper"},s("div",{class:"row-actions-toggler"},s("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},s("path",{d:"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"})),s("div",{class:o},i)))}let h=null;return t.badgeData&&t.badgeData.length>0&&(h=t.badgeData.map((t=>s("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),s("div",{class:"box-wrapper",style:t.style||{},ref:t=>L(this,W,"f").push(t)},s("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&n,column:!r},onClick:o=>this.onBoxClick(o,t),ref:t=>this.rowsRefs.push(t)},a,i,h),l)}renderSection(t,o,i,e){let r=null;if(t.sections&&t.sections.length>0){const o=t.sections;let s=o.length,n=0;for(s>0&&(r=[]);s-- >0;)r.push(this.renderSection(o[n++],t,i,e))}else if(t.content){const o=t.content;let s=o.length,n=0;for(s>0&&(r=[]);s-- >0;)r.push(this.renderBoxObject({boxObject:o[n++],row:i,visibleColumns:e},!0))}else e.length>0&&(r=this.renderBoxObject({boxObject:{column:e[0].name},row:i,visibleColumns:e}));const n=this.isSectionExpanded(i,t),a=!!t.columns,l={"box-section":!0,open:n,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},h=t.style||{};t.dim&&o&&(h.flex=`0 0 ${t.dim}`,h.overflow="hidden",o.horizontal?h.maxWidth=t.dim:h.maxHeight=t.dim),a&&(h["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){l["collapse-section"]=!0;const o={content:!0};let e="";e=t.title?t.title:this.kupManager.language.translate(n?b.COLLAPSE:b.EXPAND),c=s("div",{class:l,style:h},s("div",{class:o},r),s("div",{class:"header",role:"button",onClick:o=>{o.stopPropagation(),this.toggleSectionExpand(i,t)}},s("div",{class:"header-content"},s("span",null,e),s(R,{resource:`${d.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:n?"toggled":""}))))}else{const o=t.title?s("h3",null,t.title):null;c=s("div",{class:l,style:h},o,r)}return c}renderBoxObject({boxObject:t,row:o,visibleColumns:i},e){const r={"box-object":!0};let n=null,a=-1;for(let o=0;o<i.length;o++)if(i[o].name===t.column){a=o;break}a>=0?(n=i[a],i.splice(a,1)):e&&(n=this.data.columns.find((o=>o.name===t.column)));const l=o.cells[t.column];let h;return l&&!this.kupManager.objects.isEmptyKupObj(l.obj)&&(r["is-obj"]=!0,this.kupManager.debug.isDebug()&&(h=l.obj.t+"; "+l.obj.p+"; "+l.obj.k+";")),s("div",{"data-cell":l,"data-row":o,"data-column":t.column,class:r,style:{},title:h},l&&n?s(E,Object.assign({},{cell:l,column:n,component:this,editable:this.editableData,renderKup:!0,row:o,setSizes:!0,shape:t.shape})):s("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||0===this.kanban.columns.length)return this.kupManager.debug.logMessage(this,"No columns to group by detected.",u.ERROR),{jsx:s("div",{id:"empty-data-message",class:"box-wrapper"},s("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(b.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let o=0;o<this.kanban.labels.length;o++)t.push({labels:this.kanban.labels[o],nodes:[]});for(let o=0;o<this.rows.length;o++){let i=[];for(let t=0;t<this.kanban.columns.length;t++)try{i.push(this.rows[o].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,u.WARNING)}const e={found:!1,index:null};for(let o=0;o<t.length;o++){let s=t[o].labels,r=!0;for(let t=0;t<s.length;t++)if(i[t]!==s[t]){r=!1;break}if(r){e.found=!0,e.index=o;break}}e.found?t[e.index].nodes.push(this.renderRow(this.rows[o])):t.push({labels:i,nodes:[this.renderRow(this.rows[o])]})}const o=[];for(let i=0;i<t.length;i++){const e=t[i].labels,r={data:[]};for(let t=0;t<e.length;t++)r.data.push({value:e[t],id:e[t]});o.push(s("div",{class:"kanban-section"},s(z,Object.assign({},r)),t[i].nodes))}return{jsx:o,style:{"grid-template-columns":this.kanban.isStacked?"repeat(1fr)":this.kanban.size?`repeat(${Object.keys(t).length}, ${this.kanban.size})`:`repeat(${Object.keys(t).length}, 1fr)`}}}didLoadInteractables(){this.interactableTouch.push(this.boxContainer),this.kupManager.interact.on(this.boxContainer,x.TAP,(t=>{this.hold?this.hold=!1:2===t.button&&this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})})),this.kupManager.interact.on(this.boxContainer,x.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(this.hold=!0,this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)}))}))}didRenderInteractables(){if(this.dragEnabled)for(let t=0;t<this.rowsRefs.length;t++){const o=this.rowsRefs[t],i=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:p(this.visibleColumns,t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};o&&!this.interactableDrag.includes(o)&&(this.interactableDrag.push(o),this.kupManager.interact.draggable(o,{allowFrom:".box-object",cursorChecker:()=>null},{callback:i},f.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.getEventDetails(this.rootElement.shadowRoot.querySelector(".box:hover"));return{cell:t.cell,column:t.column,id:this.rootElement.id,row:t.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),this.kupManager.interact.dropzone(this.sectionRef,{accept:`[${g}]`},{dispatcher:this.rootElement,type:w.BOX}));for(let o=0;o<this.rowsRefs.length;o++){const i=this.rowsRefs[o];i&&!this.interactableDrop.includes(i)&&(this.interactableDrop.push(i),this.kupManager.interact.dropzone(i,{accept:`[${g}]`},{callback:t,dispatcher:this.rootElement,type:w.BOX}))}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.rowsPerPage&&(this.currentRowsPerPage=this.rowsPerPage),this.data&&this.data.rows&&this.currentRowsPerPage>this.data.rows.length&&(this.currentRowsPerPage=this.data.rows.length),this.kupManager.language.register(this),this.kupManager.theme.register(this),this.onDataChanged(),this.adjustPaginator(),document.querySelector(".header")?H(this,$,document.querySelector(".header").clientHeight,"f"):H(this,$,0,"f"),document.querySelector(".topbar")&&H(this,$,L(this,$,"f")+document.querySelector(".topbar").clientHeight,"f"),L(this,B,"m",F).call(this)}componentDidLoad(){if(this.handleAutomaticBoxSelection(),document.addEventListener("click",this.clickFunction.bind(this)),this.currentPage=this.pageSelected,this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((o=>t.indexOf(o.id)>=0))}this.didLoadInteractables(),this.kupDidLoad.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const o=t.querySelectorAll(".f-text-field");for(let t=0;t<o.length;t++)M(o[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),L(this,B,"m",T).call(this),this.kupManager.debug.logRender(this,!0)}render(){const t=!("object"!=typeof this.kanban||null===this.kanban);let o=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.visibleColumns.map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let i={label:this.kupManager.language.translate(b.SORT_BY),trailingIcon:!0};o=s("div",{id:"sort-panel"},s("kup-combobox",{data:{"kup-text-field":i,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let i=null;this.globalFilter&&(i=s("div",{id:"global-filter"},s("kup-text-field",{fullWidth:!0,label:this.kupManager.language.translate(m.SEARCH),icon:d.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout),this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}})));let e=null;this.pagination&&(e=s(A,{id:top?"top-paginator":"bottom-paginator",currentPage:this.currentPage,max:this.filteredRows.length,mode:P.SIMPLE,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.rowsPerPage,onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let n=null,a={};if(0===this.rows.length)n=s("div",{id:"empty-data-message",class:"box-wrapper"},s("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(b.EMPTY_DATA))),a={"grid-template-columns":"repeat(1, 1fr)"};else if(t){const t=this.kanbanMode();n=t.jsx,a=t.style}else{a={"grid-template-columns":`repeat(${this.columns}, 1fr)`};const t=this.rows;let o=t.length,i=0;for(n=[];o-- >0;)n.push(this.renderRow(t[i++]))}return s(r,null,s("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),s("div",{id:I},s("div",{class:"box-component",ref:t=>this.sectionRef=t},o,i,e,s("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},n))))}disconnectedCallback(){this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop)),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this),this.scrollOnHover&&this.kupManager.scrollOnHover.unregister(this.boxContainer),document.removeEventListener("click",this.clickFunction.bind(this)),this.kupDidUnload.emit({comp:this,id:this.rootElement.id})}get rootElement(){return n(this)}static get watchers(){return{rowsPerPage:["rowsPerPageHandler","recalculateRows"],globalFilterValue:["recalculateRows"],sortBy:["recalculateRows"],pagination:["recalculateRows"],currentPage:["recalculateRows"],currentRowsPerPage:["recalculateRows"],data:["onDataChanged"],layout:["onLayoutChanged"],selectBox:["onSelectBoxChanged"]}}};D=new WeakMap,W=new WeakMap,$=new WeakMap,B=new WeakSet,T=function(){this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length&&L(this,D,"f").observe(L(this,W,"f")[L(this,W,"f").length-1])},F=function(){const t={threshold:0,rootMargin:"-"+L(this,$,"f")+"px 0px 0px 0px"};H(this,D,new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){this.kupManager.debug.logMessage(this,"Last row entering the viewport, loading more elements.");const o=this.data.rows.length-this.currentRowsPerPage;this.currentRowsPerPage+=o<10?o:10,t.target.classList.remove("last-row"),L(this,D,"f").unobserve(t.target)}}))}),t),"f")},G.style=":host{--kup_box_background_color:var(\n --kup-box-background-color,\n var(--kup-background-color)\n );--kup_box_color:var(--kup-box-color, var(--kup-text-color));--kup_box_font_family:var(--kup-box-font-family, var(--kup-font-family));--kup_box_font_size:var(--kup-box-font-size, var(--kup-font-size));--kup_box_grid_gap:var(--kup-box-grid-gap, 1em);--kup_box_hover_box_shadow:var(\n --kup-box-hover-box-shadow,\n 0px 0px 7.5px 0px rgba(128, 128, 128, 0.5)\n );--kup_box_primary_color_rgb:var(\n --kup-box-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_box_transition:var(--kup-box-transition, 0.25s);display:block;font-family:var(--kup_box_font_family);font-size:var(--kup_box_font_size)}.box-component{background:var(--kup_box_background_color);transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup-border-color)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_color);overflow:auto}#box-container.is-kanban .kanban-section{overflow:auto}#box-container.is-kanban .box-wrapper{padding-top:1em}#box-container.is-kanban .box-wrapper .box{overflow:auto}#box-container *{box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;transition:background-color var(--kup_box_transition) ease, box-shadow var(--kup_box_transition) ease, border var(--kup_box_transition) ease}#box-container .box-wrapper .box.draggable{touch-action:none;user-select:none}#box-container .box-wrapper .box.column{flex-direction:column}#box-container .box-wrapper .box:hover{box-shadow:var(--kup_box_hover_box_shadow)}#box-container .box-wrapper .box.selected{background-color:rgba(var(--kup_box_primary_color_rgb), 0.175)}#box-container .box-wrapper .box.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup-border-color);position:relative;z-index:2}#box-container .box-wrapper .box .box-section{display:flex;flex-direction:row;flex:1 1 1%;flex-wrap:wrap}#box-container .box-wrapper .box .box-section.column{flex-direction:column;justify-content:center;flex-wrap:unset}#box-container .box-wrapper .box .box-section.column>.box-section{flex:0 0 auto}#box-container .box-wrapper .box .box-section.grid{display:grid}#box-container .box-wrapper .box .box-section .box-object{min-height:16px}#box-container .box-wrapper .box .box-section .box-object img{height:auto}#box-container .box-wrapper .box .box-section.collapse-section .header{border-top:1px solid var(--kup-border-color);color:rgba(var(--kup-text-color-rgb), 0.75);display:flex;justify-content:space-around;width:100%}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content{margin:0.5em;display:flex;align-items:center}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image{transition:transform 0.15s}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image.toggled{transform:rotate(-180deg)}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .kup-icon.kup-dropdown-icon{margin:0;-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}#box-container .box-wrapper .box .box-section.collapse-section .content{display:none;width:100%}#box-container .box-wrapper .box .box-section.collapse-section.open .content{display:block}#box-container .box-wrapper .box .box-section.titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}#box-container .box-wrapper .box .box-section.titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}#box-container .box-wrapper .box .box-selection{position:absolute;top:0.5em;right:0.5em;z-index:1}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler{position:relative;width:24px;height:24px;margin-left:3px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler svg{cursor:pointer;opacity:0;fill:var(--kup-text-color);transition:opacity 500ms ease-out}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu{background:var(--kup-background-color);border:1px solid var(--kup-border-color);box-shadow:0px 0px 7.5px 0px rgba(128, 128, 128, 0.5);position:absolute;top:0;right:24px;display:none;z-index:10}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul{list-style-type:none;margin:0;padding:0}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li{cursor:pointer;white-space:nowrap;padding:0 12px;display:flex;align-items:center;line-height:30px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li:not(:last-child){border-bottom:1px solid var(--kup-border-color)}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu.open{display:block}#box-container .box-wrapper:hover .row-actions-wrapper .row-actions-toggler svg{opacity:1}#sort-panel,#global-filter{margin-bottom:1em}:host(.kup-center-aligned) #kup-component .box-section{text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell img{margin:auto}:host(.kup-right-aligned) #kup-component .box-section{text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell img{margin-left:auto;margin-right:0}:host(.kup-top-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-start}:host(.kup-bottom-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-end}:host(:not(.kup-borderless)) .box{border:1px solid var(--kup-border-color)}:host(.kup-flat-on-hover) #box-container .box-wrapper .box:hover{box-shadow:none}:host(.kup-shaped) .box{border-radius:10px}:host(.kup-round) .box{border-radius:25px}:host(.kup-dashed-sections) .box-section{border:2px dashed var(--kup-text-color)}:host(:not(.kup-paddingless)) #box-container .box{padding:3px}:host(:not(.kup-paddingless)) #box-container .box .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{margin:3px 4px}:host(.kup-danger){--kup-box-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-box-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-box-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-box-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-box-primary-color-rgb:var(--kup-warning-color-rgb)}";export{G as kup_box}
|