@sme.up/ketchup 11.0.0-SNAPSHOT-20250219112818 → 11.0.0-SNAPSHOT-20250220114417
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-cell-5fdd52cb.js → f-cell-d7058ec1.js} +6 -6
- package/dist/cjs/{f-chip-f2bec977.js → f-chip-cfd0b1b2.js} +1 -1
- package/dist/cjs/{f-object-field-2f9ba724.js → f-object-field-89cb03cd.js} +2 -2
- package/dist/cjs/{f-paginator-utils-a11b4c78.js → f-paginator-utils-fe9ed69e.js} +1 -1
- package/dist/cjs/{f-text-field-3ffbbf83.js → f-text-field-9082374a.js} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ketchup.cjs.js +1 -1
- package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
- package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_29.cjs.entry.js +7 -7
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
- package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-cell.cjs.entry.js +5 -5
- package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
- package/dist/cjs/{kup-data-table-helper-50e353fa.js → kup-data-table-helper-11aa3199.js} +1 -1
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-editor.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
- package/dist/cjs/kup-grid.cjs.entry.js +1 -1
- package/dist/cjs/kup-htm.cjs.entry.js +1 -1
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +5 -5
- package/dist/cjs/kup-input-panel.cjs.entry.js +32 -8
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
- package/dist/cjs/{kup-manager-68f3f101.js → kup-manager-ab7fb414.js} +0 -1
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
- package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
- package/dist/cjs/kup-planner.cjs.entry.js +2 -2
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
- package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/kup-txt.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-typography.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +37 -4
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +0 -1
- package/dist/collection/f-components/f-cell/f-cell.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/kup-accordion.js +2 -2
- package/dist/components/kup-activity-timeline.js +2 -2
- package/dist/components/kup-autocomplete.js +1 -1
- package/dist/components/kup-badge.js +1 -1
- package/dist/components/kup-box.js +1 -1
- package/dist/components/kup-button-list.js +1 -1
- package/dist/components/kup-button.js +1 -1
- package/dist/components/kup-calendar.js +2 -2
- package/dist/components/kup-card-list.js +3 -3
- package/dist/components/kup-card.js +1 -1
- package/dist/components/kup-cell.js +2 -2
- package/dist/components/kup-chart.js +1 -1
- package/dist/components/kup-checkbox.js +1 -1
- package/dist/components/kup-chip.js +1 -1
- package/dist/components/kup-color-picker.js +1 -1
- package/dist/components/kup-combobox.js +1 -1
- package/dist/components/kup-dashboard.js +2 -2
- package/dist/components/kup-data-table.js +1 -1
- package/dist/components/kup-date-picker.js +1 -1
- package/dist/components/kup-dialog.js +1 -1
- package/dist/components/kup-drawer.js +2 -2
- package/dist/components/kup-dropdown-button.js +1 -1
- package/dist/components/kup-echart.js +1 -1
- package/dist/components/kup-editor.js +1 -1
- package/dist/components/kup-family-tree.js +3 -3
- package/dist/components/kup-file-upload.js +1 -1
- package/dist/components/kup-form.js +1 -1
- package/dist/components/kup-gauge.js +1 -1
- package/dist/components/kup-grid.js +1 -1
- package/dist/components/kup-htm.js +2 -2
- package/dist/components/kup-iframe.js +2 -2
- package/dist/components/kup-image-list.js +2 -2
- package/dist/components/kup-image.js +1 -1
- package/dist/components/kup-input-panel.js +31 -7
- package/dist/components/kup-lazy.js +2 -2
- package/dist/components/kup-list.js +1 -1
- package/dist/components/kup-magic-box.js +4 -4
- package/dist/components/kup-nav-bar.js +2 -2
- package/dist/components/kup-numeric-picker.js +2 -2
- package/dist/components/kup-object-field.js +2 -2
- package/dist/components/kup-pdf.js +2 -2
- package/dist/components/kup-planner.js +2 -2
- package/dist/components/kup-probe.js +2 -2
- package/dist/components/kup-progress-bar.js +1 -1
- package/dist/components/kup-qlik.js +2 -2
- package/dist/components/kup-radio.js +1 -1
- package/dist/components/kup-rating.js +1 -1
- package/dist/components/kup-snackbar.js +2 -2
- package/dist/components/kup-spinner.js +1 -1
- package/dist/components/kup-switch.js +1 -1
- package/dist/components/kup-tab-bar.js +1 -1
- package/dist/components/kup-text-field.js +1 -1
- package/dist/components/kup-time-picker.js +1 -1
- package/dist/components/kup-toolbar.js +1 -1
- package/dist/components/kup-tree.js +1 -1
- package/dist/components/kup-txt.js +2 -2
- package/dist/components/kup-typography-list.js +2 -2
- package/dist/components/kup-typography.js +2 -2
- package/dist/components/{p-969548b3.js → p-50994df9.js} +2 -2
- package/dist/components/{p-b2169ee4.js → p-5b6197ba.js} +2 -2
- package/dist/components/{p-86d0cbd3.js → p-5f0cd326.js} +0 -1
- package/dist/components/{p-1044a2d6.js → p-68a2cf5e.js} +3 -3
- package/dist/components/{p-5a4d1e0c.js → p-a58dc6c8.js} +2 -2
- package/dist/components/{p-c82eaf97.js → p-b3508db4.js} +2 -2
- package/dist/esm/{f-cell-c815fe2a.js → f-cell-72a8cfbf.js} +6 -6
- package/dist/esm/{f-chip-b3884c7c.js → f-chip-aa77cca6.js} +1 -1
- package/dist/esm/{f-object-field-8d3a160d.js → f-object-field-b6027e42.js} +2 -2
- package/dist/esm/{f-paginator-utils-1e59140c.js → f-paginator-utils-a67b74b9.js} +1 -1
- package/dist/esm/{f-text-field-f8e01a01.js → f-text-field-8d53cc29.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ketchup.js +1 -1
- package/dist/esm/kup-accordion.entry.js +1 -1
- package/dist/esm/kup-activity-timeline.entry.js +2 -2
- package/dist/esm/kup-autocomplete_29.entry.js +7 -7
- package/dist/esm/kup-box.entry.js +7 -7
- package/dist/esm/kup-calendar.entry.js +2 -2
- package/dist/esm/kup-card-list.entry.js +1 -1
- package/dist/esm/kup-cell.entry.js +5 -5
- package/dist/esm/kup-dashboard.entry.js +2 -2
- package/dist/esm/{kup-data-table-helper-7a0f16b4.js → kup-data-table-helper-b8582302.js} +1 -1
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-editor.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +1 -1
- package/dist/esm/kup-grid.entry.js +1 -1
- package/dist/esm/kup-htm.entry.js +1 -1
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +5 -5
- package/dist/esm/kup-input-panel.entry.js +32 -8
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +1 -1
- package/dist/esm/{kup-manager-d87ed6ea.js → kup-manager-7d814ce8.js} +0 -1
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-object-field.entry.js +3 -3
- package/dist/esm/kup-pdf.entry.js +1 -1
- package/dist/esm/kup-planner.entry.js +2 -2
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +1 -1
- package/dist/esm/kup-snackbar.entry.js +1 -1
- package/dist/esm/kup-txt.entry.js +1 -1
- package/dist/esm/kup-typography-list.entry.js +1 -1
- package/dist/esm/kup-typography.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-17dfdc11.entry.js → p-18d364d2.entry.js} +1 -1
- package/dist/ketchup/{p-bebe9ddd.entry.js → p-1f96ef03.entry.js} +1 -1
- package/dist/ketchup/{p-8451a074.entry.js → p-2d47b7ec.entry.js} +1 -1
- package/dist/ketchup/{p-4b6975be.js → p-3a360c58.js} +1 -1
- package/dist/ketchup/{p-ffd4baa6.entry.js → p-4aa50b62.entry.js} +1 -1
- package/dist/ketchup/{p-5803d1e9.entry.js → p-4d77759f.entry.js} +1 -1
- package/dist/ketchup/{p-0ee14a78.js → p-5e978559.js} +1 -1
- package/dist/ketchup/{p-3dd4267c.entry.js → p-6165ead2.entry.js} +1 -1
- package/dist/ketchup/{p-fd47bc3c.js → p-621f1a80.js} +1 -1
- package/dist/ketchup/{p-7332618c.entry.js → p-6de2276e.entry.js} +1 -1
- package/dist/ketchup/{p-5275d58c.entry.js → p-77c864fe.entry.js} +1 -1
- package/dist/ketchup/{p-a9f8ee94.entry.js → p-838034ed.entry.js} +1 -1
- package/dist/ketchup/{p-6e8de426.entry.js → p-83f5d17f.entry.js} +1 -1
- package/dist/ketchup/{p-6cc40ee6.entry.js → p-87d5c150.entry.js} +1 -1
- package/dist/ketchup/{p-918eb9b9.entry.js → p-882d0e27.entry.js} +1 -1
- package/dist/ketchup/{p-4964dae4.entry.js → p-92b140bb.entry.js} +1 -1
- package/dist/ketchup/{p-826c7a82.entry.js → p-959d7fc6.entry.js} +1 -1
- package/dist/ketchup/{p-1f292129.entry.js → p-98c50968.entry.js} +1 -1
- package/dist/ketchup/{p-e12fc82d.entry.js → p-a01acc03.entry.js} +1 -1
- package/dist/ketchup/{p-91d1cbbf.js → p-a117ca68.js} +1 -1
- package/dist/ketchup/{p-b82834c7.entry.js → p-a40a6061.entry.js} +1 -1
- package/dist/ketchup/{p-2393f2ec.entry.js → p-a83ec33b.entry.js} +1 -1
- package/dist/ketchup/{p-f38646b8.entry.js → p-aa6e6484.entry.js} +1 -1
- package/dist/ketchup/{p-907dabb4.js → p-ad63c9ec.js} +1 -1
- package/dist/ketchup/{p-5a5770ef.js → p-bb14f5e9.js} +1 -1
- package/dist/ketchup/p-c2b6c005.entry.js +1 -0
- package/dist/ketchup/{p-b7bc47a3.entry.js → p-c48a3e6e.entry.js} +1 -1
- package/dist/ketchup/{p-a2cd8762.entry.js → p-d2992ca6.entry.js} +1 -1
- package/dist/ketchup/{p-a32c9926.entry.js → p-d357f74d.entry.js} +1 -1
- package/dist/ketchup/{p-8d1f4c18.js → p-d5e0e93b.js} +1 -1
- package/dist/ketchup/{p-61332b3a.entry.js → p-dbb5cc50.entry.js} +1 -1
- package/dist/ketchup/{p-af90b7b8.entry.js → p-ddd537a3.entry.js} +1 -1
- package/dist/ketchup/{p-7e106cfa.entry.js → p-e08a64e1.entry.js} +1 -1
- package/dist/ketchup/{p-217cf4da.entry.js → p-e10a3519.entry.js} +1 -1
- package/dist/ketchup/{p-4d9db8e6.entry.js → p-e52779a2.entry.js} +1 -1
- package/dist/ketchup/{p-fac8581e.entry.js → p-f1023c6c.entry.js} +1 -1
- package/dist/ketchup/{p-508cd767.entry.js → p-f176c9b0.entry.js} +1 -1
- package/dist/types/components/kup-input-panel/kup-input-panel.d.ts +2 -1
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/ketchup/p-f321a3fa.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as a,h as i,H as h,d as n}from"./p-b0368f88.js";import{k as o,g as p,s}from"./p-
|
|
1
|
+
import{r as t,c as e,f as a,h as i,H as h,d as n}from"./p-b0368f88.js";import{k as o,g as p,s}from"./p-d5e0e93b.js";import{c as l}from"./p-635bb4b3.js";import"./p-1ee561ba.js";var f,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."}(f||(f={})),function(t){t.VIEWPORT="viewport",t.PROPS="props",t.BOTH="both"}(c||(c={}));const d=class{constructor(a){t(this,a),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 p(this,f,t)}async getComponent(){return this.lazyComponent}async refresh(){a(this)}async setProps(t){s(this,f,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,a=this.componentName;switch(this.componentName){case"kup-button":e=i("svg",{key:"8802574ba1d79ac1e274790bdf8686015476b2ad",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"c3d51c252fdf77cecf888da91a901c48d08fd69c",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":e=i("svg",{key:"4a1d1532c15748b95b0584f5d004bf5804417bc2",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"20e5ab4bd0690a0599a28e05b355a405e07f7cad",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=i("svg",{key:"99d255a35e9890c805abb2994b6174223184cfd0",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"513cf3606dfd9bde023162e079dee3cf54304084",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=i("svg",{key:"842f850f0b3532fd388a8e1ebf48c11161d95561",xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},i("path",{key:"b2e747170adf5dbe81a80a7a4ccc4df71abe776d",d:"M22,21H2V3H4V19H6V10H10V19H12V6H16V19H18V14H22V21Z"}));break;case"kup-data-table":e=i("svg",{key:"252aee5d61964d1580283ae5edb5fb8064f3d668",xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",viewBox:"0 0 24 24"},i("path",{key:"876b7590622878f40fe3ee89aa880d187a69cb91",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=i("svg",{key:"a43007f243ee6855d8ae9b7ff517d471e37164d8",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"7f6654a6ddabef4701471ddd4c49c4eef87cc20f",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=i("svg",{key:"23dfbe528bbea80630394aaa91f09dd687cecb9d",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"0615b03884b85a2e1215d3a25bfe225f43f0c84e",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=i("svg",{key:"9614fc7450e6a432fb6645911a0ee3739c3bdba1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"d3d77ee72693ca34d75bb90a020c0904d8345897",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"}));break;default:e=i("svg",{key:"7e9e25c82c6a968df1e34d6404a5b6a26208a1d2",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 48 48"},i("path",{key:"3355655ef7a1bd635fd287bd72124fc409acdb90",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"}))}return this.renderMode===c.VIEWPORT&&this.isInViewport||this.renderMode===c.PROPS&&this.data||this.renderMode===c.BOTH&&this.data&&this.isInViewport?(t=i(this.componentName,Object.assign({key:"598ae9bb03885be0e6f25ca73b9ee2cf52a6ab8e"},this.data,{ref:t=>this.lazyComponent=t})),a+=" kup-loaded"):this.showPlaceholder&&(t=e,a+=" kup-to-be-loaded"),i(h,{key:"fdc3a6a971b8c6b74129d1d8c561fce5e52c3b44",class:a},i("style",{key:"b8d687d0af73cc123bc465d481c4c37b0ba6c552"},this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{key:"9c9f61bc50d5badca2f000fe40817eba70e6a4c5",id:l},t))}disconnectedCallback(){var t;this.kupManager.theme.unregister(this),null===(t=this.intObserver)||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return n(this)}};d.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}: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{r as t,c as i,f as e,h as o,H as s,d as n}from"./p-b0368f88.js";import{k as r,z as a,g as h,s as l,a5 as c,w as p,h as d,b,e as u,U as x,X as f,aD as g,Z as m,t as k}from"./p-8d1f4c18.js";import{f as w,p as v,s as y}from"./p-5a5770ef.js";import{F as _}from"./p-b120abd7.js";import{c as j}from"./p-907dabb4.js";import{c as z}from"./p-635bb4b3.js";import{F as C}from"./p-91d1cbbf.js";import{p as P,r as M,F as A}from"./p-0ee14a78.js";import{F as R}from"./p-7db300e0.js";import"./p-1ee561ba.js";import"./p-d39c3267.js";import"./p-e3062c19.js";import"./p-4d9381ce.js";import"./p-4b6975be.js";import"./p-fd47bc3c.js";import"./p-c56195a0.js";var I,S;!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.loadMoreLimit="Sets a maximum limit of new records which can be required by the load more functionality.",t.loadMoreMode="Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.",t.loadMoreStep="The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.",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.showLoadMore="If set to true, displays the button to load more records.",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."}(I||(I={})),function(t){t.CONSTANT="constant",t.CONSTANT_INCREMENT="constant_increment",t.PROGRESSIVE_THRESHOLD="progressive_threshold"}(S||(S={}));class E{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1,this.loadMoreLimit=1e3,this.showLoadMore=!1}toDebugString(){return"box state"}}var O,D,W,B,T,$,L,F,H,N=function(t,i,e,o){if("a"===e&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!o:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?o:"a"===e?o.call(t):o?o.value:i.get(t)},G=function(t,i,e,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,e):s?s.value=e:i.set(t,e),e};const V=class{constructor(e){t(this,e),this.kupBoxClick=i(this,"kup-box-click",6),this.kupBoxSelected=i(this,"kup-box-selected",6),this.kupAutoBoxSelect=i(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=i(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=i(this,"kup-box-rowactionclick",6),this.kupDidLoad=i(this,"kup-box-didload",6),this.kupDidUnload=i(this,"kup-box-didunload",6),this.kupBoxContextMenu=i(this,"kup-box-contextmenu",6),this.kupLoadMoreClick=i(this,"kup-box-loadmoreclick",6),O.add(this),this.state=new E,this.kupManager=r(),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,[]),B.set(this,0),T.set(this,0),$.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.loadMoreLimit=1e3,this.loadMoreMode=S.PROGRESSIVE_THRESHOLD,this.loadMoreStep=60,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.showLoadMore=!1,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=t.sortBy,this.globalFilterValue=t.globalFilterValue,this.selectedRowsState=t.selectedRowsState,this.pageSelected=t.pageSelected,this.rowsPerPage=t.rowsPerPage,this.loadMoreLimit=t.loadMoreLimit,this.showLoadMore=t.showLoadMore)}}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 i=this.selectedRows.reduce(((t,i,e)=>t+(e>0?";":"")+i.id),"");if(this.kupManager.objects.deepEqual(this.state.selectedRowsState,i)||(this.state.selectedRowsState=i,t=!0),this.kupManager.objects.deepEqual(this.state.loadMoreLimit,this.loadMoreLimit)||(this.state.loadMoreLimit=this.loadMoreLimit,t=!0),this.kupManager.objects.deepEqual(this.state.showLoadMore,this.showLoadMore)||(this.state.showLoadMore=this.showLoadMore,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(){a(this.getRows()),this.initVisibleColumns(),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return h(this,I,t)}async loadRowActions(t,i){t.actions=i,this.rowActionMenuOpened=t}async refresh(){e(this)}async setProps(t){l(this,I,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=w(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let i=t;return this.sortBy&&(i=y(i,this.toSortObjectList())),i}toSortObjectList(){return this.sortBy.split("|").map((t=>{const i=t.split(",");return{column:i[0],sortMode:i.length>1?c[i[1]]:c.A}}))}checkScrollOnHover(){this.boxContainer&&(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:[]},i=this.visibleColumns;let e=i.length,o=[],s=0;for(;e-- >0;)o.push({column:i[s++].name});t.content=o,this.boxLayout={sections:[t]}}onSortChange(t){let i=p(this.visibleColumns,t.detail.value);this.sortBy=i.name}onGlobalFilterChange({detail:t}){let i="";t&&t.value&&(i=t.value),this.globalFilterValue=i}isSectionExpanded(t,i){return!(!t.id||!i.id)&&this.collapsedSection[i.id]&&this.collapsedSection[i.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,i){let e=null,o=null,s=null,n=null;if(t)for(let i=t.length-1;i>=0;i--){let o=t[i];o.tagName&&(o.tagName.toUpperCase(),o.classList.contains("box-object")&&(e=o),!s&&o["data-row"]&&(s=o["data-row"]))}if(e)if(e.classList.contains("f-cell")){const t=e["kup-get-cell-props"]();o=t.cell,n=t.column,s=t.row}else o=e["data-cell"],s=e["data-row"],n=p(this.visibleColumns,e.dataset.column);return{boxObject:e||null,column:n||null,cell:o||null,originalEvent:i,row:s||null}}clickHandler(t){const i=this.getEventDetails(this.kupManager.getEventPath(t.target,this.rootElement),t);return i.row&&(this.multiSelection?this.onSelectionCheckChange(i.row):this.selectedRows=[i.row]),i}contextMenuHandler(t){return this.getEventDetails(this.kupManager.getEventPath(t.target,this.rootElement),t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onSelectionCheckChange(t){var i=-1;for(let e=0;e<this.selectedRows.length;e++)if(this.selectedRows[e].id===t.id){i=e;break}i>=0?(this.selectedRows.splice(i,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,i){if(i.id)if(t.id){if(this.collapsedSection[i.id]){const e=this.collapsedSection[i.id];e[t.id]=!e[t.id]||!e[t.id]}else this.collapsedSection[i.id]={},this.collapsedSection[i.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,i,e){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:i,index:e})}clickFunction(t){try{const i=t.composedPath();for(let t of i)if(this.checkIfElementIsActionMenuIcon(t))return}catch(i){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const i=P(t,this.filteredRows.length,this.currentRowsPerPage);i&&(this.currentPage=i)}handleRowsPerPageChange(t){const i=M(t,this.filteredRows.length);i&&(this.currentRowsPerPage=i,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let i=!1;const e={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let i=0;i<this.data.columns.length;i++){const o=this.data.columns[i];!1!==o.visible&&(e.cell.push(t.cells[o.name]),e.columns.push(o))}for(const i in t.cells)if(t.cells.hasOwnProperty(i)){const o=t.cells[i];if(void 0!==o.cardID&&o.obj)switch(o.obj.p){case"BTN":do{e.button.push({})}while(e.button.length<o.cardID);e.button[o.cardID]={label:o.value};break;case"IMG":do{e.image.push({})}while(e.image.length<o.cardID);e.image[o.cardID]={resource:o.value};break;case"PGB":do{e.progressbar.push({})}while(e.progressbar.length<o.cardID);e.progressbar[o.cardID]={value:o.value};break;default:do{e.text.push("")}while(e.text.length<o.cardID);e.text[o.cardID]=o.value}}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const s=t.cells[o];if(void 0===s.cardID&&s.obj)switch(i=!1,s.obj.p){case"BTN":for(let t=0;t<e.button.length;t++)if(!Object.keys(e.button[t]).length){e.button[t]={label:s.value},i=!0;break}i||e.button.push({label:s.value});break;case"IMG":for(let t=0;t<e.image.length;t++)if(!Object.keys(e.image[t]).length){e.image[t]={resource:s.value},i=!0;break}i||e.image.push({resource:s.value});break;case"PGB":for(let t=0;t<e.progressbar.length;t++)if(!Object.keys(e.progressbar[t]).length){e.progressbar[t]={value:s.value},i=!0;break}i||e.progressbar.push({value:s.value});break;default:for(let t=0;t<e.text.length;t++)if(""===e.text[t]){e.text[t]=s.value,i=!0;break}i||e.text.push(s.value)}}return o("kup-card",Object.assign({data:e},this.cardData))}renderRow(t){const i=[...this.visibleColumns];let e=null,s=t.layout;s||(s=this.boxLayout);let n=!1;if(s){s.horizontal&&(n=!0);const o=s.sections;let r=o.length,a=0;r>0&&(e=[]);const h={horizontal:n};for(;r-- >0;)e.push(null!=this.cardData&&"object"==typeof this.cardData?this.renderSectionAsCard(t):this.renderSection(o[a++],h,t,i))}var r=!1;for(let i of this.selectedRows)i.id===t.id&&(r=!0);let a=null;this.multiSelection&&(a=o("div",{class:"box-selection"},o("kup-checkbox",{checked:r})));let h=null;if(this.enableRowActions&&!this.swipeDisabled){const i={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let e=null;if(t.actions){const i=t.actions.map(((i,e)=>o("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,i,e)},o("div",{class:`icon ${i.icon}`}),o("div",{class:"text"},i.text))));e=o("ul",null,i)}h=o("div",{class:"row-actions-wrapper"},o("div",{class:"row-actions-toggler"},o("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},o("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"})),o("div",{class:i},e)))}let l=null;return t.badgeData&&t.badgeData.length>0&&(l=t.badgeData.map((t=>o("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),o("div",{class:"box-wrapper",style:t.style||{},ref:t=>{t&&N(this,W,"f").push(t)}},o("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&r,column:!n},"data-row":t,ref:t=>this.rowsRefs.push(t)},a,e,l),h)}renderSection(t,i,e,s){let n=null;if(t.sections&&t.sections.length>0){const i=t.sections;let o=i.length,r=0;for(o>0&&(n=[]);o-- >0;)n.push(this.renderSection(i[r++],t,e,s))}else if(t.content){const i=t.content;let o=i.length,r=0;for(o>0&&(n=[]);o-- >0;)n.push(this.renderBoxObject({boxObject:i[r++],row:e,visibleColumns:s},!0))}else s.length>0&&(n=this.renderBoxObject({boxObject:{column:s[0].name},row:e,visibleColumns:s}));const r=this.isSectionExpanded(e,t),a=!!t.columns,h={"box-section":!0,open:r,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},l=t.style||{};t.dim&&i&&(l.overflow="hidden",i.horizontal&&(l.flex=`0 0 ${t.dim}`,l.maxWidth=t.dim)),a&&(l["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){h["collapse-section"]=!0;const i={content:!0};let s="";s=t.title?t.title:this.kupManager.language.translate(r?d.COLLAPSE:d.EXPAND),c=o("div",{class:h,style:l},o("div",{class:i},n),o("div",{class:"header",role:"button",onClick:i=>{i.stopPropagation(),this.toggleSectionExpand(e,t)}},o("div",{class:"header-content"},o("span",null,s),o(_,{resource:`${b.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:r?"toggled":""}))))}else{const i=t.title?o("h3",null,t.title):null;c=o("div",{class:h,style:l},i,n)}return c}renderBoxObject({boxObject:t,row:i,visibleColumns:e},s){const n={"box-object":!0};let r=null,a=-1;for(let i=0;i<e.length;i++)if(e[i].name===t.column){a=i;break}a>=0?(r=e[a],e.splice(a,1)):s&&(r=this.data.columns.find((i=>i.name===t.column)));const h=i.cells[t.column];let l;return h&&!this.kupManager.objects.isEmptyKupObj(h.obj)&&(n["is-obj"]=!0,this.kupManager.debug.isDebug()&&(l=h.obj.t+"; "+h.obj.p+"; "+h.obj.k+";")),o("div",{"data-cell":h,"data-row":i,"data-column":t.column,class:n,style:{},title:l},h&&r?o(C,Object.assign({},{cell:h,column:r,component:this,editable:this.editableData,renderKup:!0,row:i,setSizes:!0,shape:t.shape})):o("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:o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(d.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let i=0;i<this.kanban.labels.length;i++)t.push({labels:this.kanban.labels[i],nodes:[]});for(let i=0;i<this.rows.length;i++){let e=[];for(let t=0;t<this.kanban.columns.length;t++)try{e.push(this.rows[i].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,u.WARNING)}const o={found:!1,index:null};for(let i=0;i<t.length;i++){let s=t[i].labels,n=!0;for(let t=0;t<s.length;t++)if(e[t]!==s[t]){n=!1;break}if(n){o.found=!0,o.index=i;break}}o.found?t[o.index].nodes.push(this.renderRow(this.rows[i])):t.push({labels:e,nodes:[this.renderRow(this.rows[i])]})}const i=[];for(let e=0;e<t.length;e++){const s=t[e].labels,n={data:[]};for(let t=0;t<s.length;t++)n.data.push({value:s[t],id:s[t]});i.push(o("div",{class:"kanban-section"},o(j,Object.assign({},n)),t[e].nodes))}return{jsx:i,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=>{var i;if(this.hold)this.hold=!1;else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];const o=this.clickHandler(e);this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o.row,column:null===(i=o.column)||void 0===i?void 0:i.name});break;case 2: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 i=this.rowsRefs[t],e=()=>{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}};i&&!this.interactableDrag.includes(i)&&(this.interactableDrag.push(i),this.kupManager.interact.draggable(i,{allowFrom:".box-object",cursorChecker:()=>null},{callback:e},f.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.rootElement.shadowRoot.querySelector(".box:hover");if(!t)return void this.kupManager.debug.logMessage(this,"Couldn't find cell hovered to retrieve dropzone informations!",u.WARNING);const i=this.kupManager.getEventPath(t,this.rootElement),e=this.getEventDetails(i);return{cell:e.cell,column:e.column,id:this.rootElement.id,row:e.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),this.kupManager.interact.dropzone(this.sectionRef,{accept:`[${g}]`},{dispatcher:this.rootElement,type:m.BOX}));for(let i=0;i<this.rowsRefs.length;i++){const e=this.rowsRefs[i];e&&!this.interactableDrop.includes(e)&&(this.interactableDrop.push(e),this.kupManager.interact.dropzone(e,{accept:`[${g}]`},{callback:t,dispatcher:this.rootElement,type:m.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.initWithPersistedState(),this.onDataChanged(),this.adjustPaginator(),document.querySelector(".header")?G(this,B,document.querySelector(".header").clientHeight,"f"):G(this,B,0,"f"),document.querySelector(".topbar")&&G(this,B,N(this,B,"f")+document.querySelector(".topbar").clientHeight,"f"),N(this,O,"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((i=>t.indexOf(i.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 i=t.querySelectorAll(".f-text-field");for(let t=0;t<i.length;t++)R(i[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),N(this,O,"m",L).call(this),this.kupManager.debug.logRender(this,!0)}render(){G(this,W,[],"f");const t=!("object"!=typeof this.kanban||null===this.kanban);let i=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.visibleColumns.map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let e={label:this.kupManager.language.translate(d.SORT_BY),trailingIcon:!0};i=o("div",{id:"sort-panel"},o("kup-combobox",{data:{"kup-text-field":e,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let e=null;this.globalFilter&&(e=o("div",{id:"global-filter"},o("kup-text-field",{fullWidth:!0,label:this.kupManager.language.translate(k.SEARCH),icon:b.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout),this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}})));let n=null;(this.showLoadMore||!this.lazyLoadRows&&this.pagination)&&(n=o(A,{id:"top-paginator",currentPage:this.currentPage,max:this.filteredRows.length,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.rowsPerPage,onLoadMore:this.showLoadMore?()=>{N(this,O,"m",H).call(this)}:null,onNextPage:()=>this.handlePageChange(this.currentPage+1),onPrevPage:()=>this.handlePageChange(this.currentPage-1),onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let r=null,a={};if(0===this.rows.length)r=o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(d.EMPTY_DATA))),a={"grid-template-columns":"repeat(1, 1fr)"};else if(t){const t=this.kanbanMode();r=t.jsx,a=t.style}else{a={"grid-template-columns":`repeat(${this.columns}, 1fr)`};const t=this.rows;let i=t.length,e=0;for(r=[];i-- >0;)r.push(this.renderRow(t[e++]))}return o(s,null,o("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{id:z},o("div",{class:"box-component",ref:t=>this.sectionRef=t},i,e,n,o("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},r))))}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,B=new WeakMap,T=new WeakMap,$=new WeakMap,O=new WeakSet,L=function(){this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length&&N(this,D,"f").observe(N(this,W,"f")[N(this,W,"f").length-1])},F=function(){const t={threshold:0,rootMargin:"-"+N(this,B,"f")+"px 0px 0px 0px"};G(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 i=this.data.rows.length-this.currentRowsPerPage;this.currentRowsPerPage+=i<this.loadMoreStep?i:this.loadMoreStep,t.target.classList.remove("last-row"),N(this,D,"f").unobserve(t.target)}}))}),t),"f")},H=function(){var t;let i=0;switch(this.loadMoreMode){case S.CONSTANT:i=this.loadMoreStep;break;case S.CONSTANT_INCREMENT:i=this.loadMoreStep*(N(this,T,"f")+1);break;case S.PROGRESSIVE_THRESHOLD:i=Math.max(N(this,$,"f"),this.loadMoreStep)*Math.min(N(this,T,"f")+1,2)}i>this.loadMoreLimit&&(i=this.loadMoreLimit),this.kupLoadMoreClick.emit({comp:this,id:this.rootElement.id,loadItems:i}),G(this,$,i,"f"),G(this,T,(t=N(this,T,"f"),++t),"f")},V.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_box_background_color:var(--kup-box-background-color, var(--kup-layer-1));--kup_box_background_color_hover:var(\n --kup-box-background-color-hover,\n var(--kup-layer-1-hover)\n );--kup_box_background_color_selected:var(\n --kup-box-background-color-selected,\n var(--kup-layer-1-selected)\n );--kup_box_text_color:var(--kup-box-text-color, var(--kup-text-secondary));--kup_box_grid_gap:var(--kup-box-grid-gap, var(--kup-space-03));--kup_box_transition:var(--kup-box-transition, 0.25s);--kup_box_border_color_drag:var(--kup-box-border-color-drag, var(--kup-border-interactive))\n display: block;--kup_box_padding:var(--kup-box-padding, var(--kup-space-05))}.box-component{transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup_box_border_color_drag)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_text_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 *:not(.progress-bar-percentage){box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center;background-color:var(--kup_box_background_color);border-radius:var(--kup-radius-00)}#box-container .box-wrapper:hover{background-color:var(--kup_box_background_color_hover)}#box-container .box-wrapper.selected{background-color:var(--kup_box_background_color_selected)}#box-container .box-wrapper.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;padding:var(--kup_box_padding);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[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup_box_border_color_drag);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-subtle);color:rgba(var(--kup-text-secondary-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-subtle);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 300ms 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-subtle);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-subtle)}#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(.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 .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{padding: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{V as kup_box}
|
|
1
|
+
import{r as t,c as i,f as e,h as o,H as s,d as n}from"./p-b0368f88.js";import{k as r,z as a,g as h,s as l,a5 as c,w as p,h as d,b,e as u,U as x,X as f,aD as g,Z as m,t as k}from"./p-d5e0e93b.js";import{f as w,p as v,s as y}from"./p-bb14f5e9.js";import{F as _}from"./p-b120abd7.js";import{c as j}from"./p-ad63c9ec.js";import{c as z}from"./p-635bb4b3.js";import{F as C}from"./p-a117ca68.js";import{p as P,r as M,F as A}from"./p-5e978559.js";import{F as R}from"./p-7db300e0.js";import"./p-1ee561ba.js";import"./p-d39c3267.js";import"./p-e3062c19.js";import"./p-4d9381ce.js";import"./p-3a360c58.js";import"./p-621f1a80.js";import"./p-c56195a0.js";var I,S;!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.loadMoreLimit="Sets a maximum limit of new records which can be required by the load more functionality.",t.loadMoreMode="Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.",t.loadMoreStep="The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.",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.showLoadMore="If set to true, displays the button to load more records.",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."}(I||(I={})),function(t){t.CONSTANT="constant",t.CONSTANT_INCREMENT="constant_increment",t.PROGRESSIVE_THRESHOLD="progressive_threshold"}(S||(S={}));class E{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1,this.loadMoreLimit=1e3,this.showLoadMore=!1}toDebugString(){return"box state"}}var O,D,W,B,T,$,L,F,H,N=function(t,i,e,o){if("a"===e&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!o:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?o:"a"===e?o.call(t):o?o.value:i.get(t)},G=function(t,i,e,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,e):s?s.value=e:i.set(t,e),e};const V=class{constructor(e){t(this,e),this.kupBoxClick=i(this,"kup-box-click",6),this.kupBoxSelected=i(this,"kup-box-selected",6),this.kupAutoBoxSelect=i(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=i(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=i(this,"kup-box-rowactionclick",6),this.kupDidLoad=i(this,"kup-box-didload",6),this.kupDidUnload=i(this,"kup-box-didunload",6),this.kupBoxContextMenu=i(this,"kup-box-contextmenu",6),this.kupLoadMoreClick=i(this,"kup-box-loadmoreclick",6),O.add(this),this.state=new E,this.kupManager=r(),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,[]),B.set(this,0),T.set(this,0),$.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.loadMoreLimit=1e3,this.loadMoreMode=S.PROGRESSIVE_THRESHOLD,this.loadMoreStep=60,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.showLoadMore=!1,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=t.sortBy,this.globalFilterValue=t.globalFilterValue,this.selectedRowsState=t.selectedRowsState,this.pageSelected=t.pageSelected,this.rowsPerPage=t.rowsPerPage,this.loadMoreLimit=t.loadMoreLimit,this.showLoadMore=t.showLoadMore)}}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 i=this.selectedRows.reduce(((t,i,e)=>t+(e>0?";":"")+i.id),"");if(this.kupManager.objects.deepEqual(this.state.selectedRowsState,i)||(this.state.selectedRowsState=i,t=!0),this.kupManager.objects.deepEqual(this.state.loadMoreLimit,this.loadMoreLimit)||(this.state.loadMoreLimit=this.loadMoreLimit,t=!0),this.kupManager.objects.deepEqual(this.state.showLoadMore,this.showLoadMore)||(this.state.showLoadMore=this.showLoadMore,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(){a(this.getRows()),this.initVisibleColumns(),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return h(this,I,t)}async loadRowActions(t,i){t.actions=i,this.rowActionMenuOpened=t}async refresh(){e(this)}async setProps(t){l(this,I,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=w(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let i=t;return this.sortBy&&(i=y(i,this.toSortObjectList())),i}toSortObjectList(){return this.sortBy.split("|").map((t=>{const i=t.split(",");return{column:i[0],sortMode:i.length>1?c[i[1]]:c.A}}))}checkScrollOnHover(){this.boxContainer&&(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:[]},i=this.visibleColumns;let e=i.length,o=[],s=0;for(;e-- >0;)o.push({column:i[s++].name});t.content=o,this.boxLayout={sections:[t]}}onSortChange(t){let i=p(this.visibleColumns,t.detail.value);this.sortBy=i.name}onGlobalFilterChange({detail:t}){let i="";t&&t.value&&(i=t.value),this.globalFilterValue=i}isSectionExpanded(t,i){return!(!t.id||!i.id)&&this.collapsedSection[i.id]&&this.collapsedSection[i.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,i){let e=null,o=null,s=null,n=null;if(t)for(let i=t.length-1;i>=0;i--){let o=t[i];o.tagName&&(o.tagName.toUpperCase(),o.classList.contains("box-object")&&(e=o),!s&&o["data-row"]&&(s=o["data-row"]))}if(e)if(e.classList.contains("f-cell")){const t=e["kup-get-cell-props"]();o=t.cell,n=t.column,s=t.row}else o=e["data-cell"],s=e["data-row"],n=p(this.visibleColumns,e.dataset.column);return{boxObject:e||null,column:n||null,cell:o||null,originalEvent:i,row:s||null}}clickHandler(t){const i=this.getEventDetails(this.kupManager.getEventPath(t.target,this.rootElement),t);return i.row&&(this.multiSelection?this.onSelectionCheckChange(i.row):this.selectedRows=[i.row]),i}contextMenuHandler(t){return this.getEventDetails(this.kupManager.getEventPath(t.target,this.rootElement),t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onSelectionCheckChange(t){var i=-1;for(let e=0;e<this.selectedRows.length;e++)if(this.selectedRows[e].id===t.id){i=e;break}i>=0?(this.selectedRows.splice(i,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,i){if(i.id)if(t.id){if(this.collapsedSection[i.id]){const e=this.collapsedSection[i.id];e[t.id]=!e[t.id]||!e[t.id]}else this.collapsedSection[i.id]={},this.collapsedSection[i.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,i,e){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:i,index:e})}clickFunction(t){try{const i=t.composedPath();for(let t of i)if(this.checkIfElementIsActionMenuIcon(t))return}catch(i){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const i=P(t,this.filteredRows.length,this.currentRowsPerPage);i&&(this.currentPage=i)}handleRowsPerPageChange(t){const i=M(t,this.filteredRows.length);i&&(this.currentRowsPerPage=i,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let i=!1;const e={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let i=0;i<this.data.columns.length;i++){const o=this.data.columns[i];!1!==o.visible&&(e.cell.push(t.cells[o.name]),e.columns.push(o))}for(const i in t.cells)if(t.cells.hasOwnProperty(i)){const o=t.cells[i];if(void 0!==o.cardID&&o.obj)switch(o.obj.p){case"BTN":do{e.button.push({})}while(e.button.length<o.cardID);e.button[o.cardID]={label:o.value};break;case"IMG":do{e.image.push({})}while(e.image.length<o.cardID);e.image[o.cardID]={resource:o.value};break;case"PGB":do{e.progressbar.push({})}while(e.progressbar.length<o.cardID);e.progressbar[o.cardID]={value:o.value};break;default:do{e.text.push("")}while(e.text.length<o.cardID);e.text[o.cardID]=o.value}}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const s=t.cells[o];if(void 0===s.cardID&&s.obj)switch(i=!1,s.obj.p){case"BTN":for(let t=0;t<e.button.length;t++)if(!Object.keys(e.button[t]).length){e.button[t]={label:s.value},i=!0;break}i||e.button.push({label:s.value});break;case"IMG":for(let t=0;t<e.image.length;t++)if(!Object.keys(e.image[t]).length){e.image[t]={resource:s.value},i=!0;break}i||e.image.push({resource:s.value});break;case"PGB":for(let t=0;t<e.progressbar.length;t++)if(!Object.keys(e.progressbar[t]).length){e.progressbar[t]={value:s.value},i=!0;break}i||e.progressbar.push({value:s.value});break;default:for(let t=0;t<e.text.length;t++)if(""===e.text[t]){e.text[t]=s.value,i=!0;break}i||e.text.push(s.value)}}return o("kup-card",Object.assign({data:e},this.cardData))}renderRow(t){const i=[...this.visibleColumns];let e=null,s=t.layout;s||(s=this.boxLayout);let n=!1;if(s){s.horizontal&&(n=!0);const o=s.sections;let r=o.length,a=0;r>0&&(e=[]);const h={horizontal:n};for(;r-- >0;)e.push(null!=this.cardData&&"object"==typeof this.cardData?this.renderSectionAsCard(t):this.renderSection(o[a++],h,t,i))}var r=!1;for(let i of this.selectedRows)i.id===t.id&&(r=!0);let a=null;this.multiSelection&&(a=o("div",{class:"box-selection"},o("kup-checkbox",{checked:r})));let h=null;if(this.enableRowActions&&!this.swipeDisabled){const i={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let e=null;if(t.actions){const i=t.actions.map(((i,e)=>o("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,i,e)},o("div",{class:`icon ${i.icon}`}),o("div",{class:"text"},i.text))));e=o("ul",null,i)}h=o("div",{class:"row-actions-wrapper"},o("div",{class:"row-actions-toggler"},o("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},o("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"})),o("div",{class:i},e)))}let l=null;return t.badgeData&&t.badgeData.length>0&&(l=t.badgeData.map((t=>o("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),o("div",{class:"box-wrapper",style:t.style||{},ref:t=>{t&&N(this,W,"f").push(t)}},o("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&r,column:!n},"data-row":t,ref:t=>this.rowsRefs.push(t)},a,e,l),h)}renderSection(t,i,e,s){let n=null;if(t.sections&&t.sections.length>0){const i=t.sections;let o=i.length,r=0;for(o>0&&(n=[]);o-- >0;)n.push(this.renderSection(i[r++],t,e,s))}else if(t.content){const i=t.content;let o=i.length,r=0;for(o>0&&(n=[]);o-- >0;)n.push(this.renderBoxObject({boxObject:i[r++],row:e,visibleColumns:s},!0))}else s.length>0&&(n=this.renderBoxObject({boxObject:{column:s[0].name},row:e,visibleColumns:s}));const r=this.isSectionExpanded(e,t),a=!!t.columns,h={"box-section":!0,open:r,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},l=t.style||{};t.dim&&i&&(l.overflow="hidden",i.horizontal&&(l.flex=`0 0 ${t.dim}`,l.maxWidth=t.dim)),a&&(l["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){h["collapse-section"]=!0;const i={content:!0};let s="";s=t.title?t.title:this.kupManager.language.translate(r?d.COLLAPSE:d.EXPAND),c=o("div",{class:h,style:l},o("div",{class:i},n),o("div",{class:"header",role:"button",onClick:i=>{i.stopPropagation(),this.toggleSectionExpand(e,t)}},o("div",{class:"header-content"},o("span",null,s),o(_,{resource:`${b.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:r?"toggled":""}))))}else{const i=t.title?o("h3",null,t.title):null;c=o("div",{class:h,style:l},i,n)}return c}renderBoxObject({boxObject:t,row:i,visibleColumns:e},s){const n={"box-object":!0};let r=null,a=-1;for(let i=0;i<e.length;i++)if(e[i].name===t.column){a=i;break}a>=0?(r=e[a],e.splice(a,1)):s&&(r=this.data.columns.find((i=>i.name===t.column)));const h=i.cells[t.column];let l;return h&&!this.kupManager.objects.isEmptyKupObj(h.obj)&&(n["is-obj"]=!0,this.kupManager.debug.isDebug()&&(l=h.obj.t+"; "+h.obj.p+"; "+h.obj.k+";")),o("div",{"data-cell":h,"data-row":i,"data-column":t.column,class:n,style:{},title:l},h&&r?o(C,Object.assign({},{cell:h,column:r,component:this,editable:this.editableData,renderKup:!0,row:i,setSizes:!0,shape:t.shape})):o("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:o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(d.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let i=0;i<this.kanban.labels.length;i++)t.push({labels:this.kanban.labels[i],nodes:[]});for(let i=0;i<this.rows.length;i++){let e=[];for(let t=0;t<this.kanban.columns.length;t++)try{e.push(this.rows[i].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,u.WARNING)}const o={found:!1,index:null};for(let i=0;i<t.length;i++){let s=t[i].labels,n=!0;for(let t=0;t<s.length;t++)if(e[t]!==s[t]){n=!1;break}if(n){o.found=!0,o.index=i;break}}o.found?t[o.index].nodes.push(this.renderRow(this.rows[i])):t.push({labels:e,nodes:[this.renderRow(this.rows[i])]})}const i=[];for(let e=0;e<t.length;e++){const s=t[e].labels,n={data:[]};for(let t=0;t<s.length;t++)n.data.push({value:s[t],id:s[t]});i.push(o("div",{class:"kanban-section"},o(j,Object.assign({},n)),t[e].nodes))}return{jsx:i,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=>{var i;if(this.hold)this.hold=!1;else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];const o=this.clickHandler(e);this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o.row,column:null===(i=o.column)||void 0===i?void 0:i.name});break;case 2: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 i=this.rowsRefs[t],e=()=>{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}};i&&!this.interactableDrag.includes(i)&&(this.interactableDrag.push(i),this.kupManager.interact.draggable(i,{allowFrom:".box-object",cursorChecker:()=>null},{callback:e},f.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.rootElement.shadowRoot.querySelector(".box:hover");if(!t)return void this.kupManager.debug.logMessage(this,"Couldn't find cell hovered to retrieve dropzone informations!",u.WARNING);const i=this.kupManager.getEventPath(t,this.rootElement),e=this.getEventDetails(i);return{cell:e.cell,column:e.column,id:this.rootElement.id,row:e.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),this.kupManager.interact.dropzone(this.sectionRef,{accept:`[${g}]`},{dispatcher:this.rootElement,type:m.BOX}));for(let i=0;i<this.rowsRefs.length;i++){const e=this.rowsRefs[i];e&&!this.interactableDrop.includes(e)&&(this.interactableDrop.push(e),this.kupManager.interact.dropzone(e,{accept:`[${g}]`},{callback:t,dispatcher:this.rootElement,type:m.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.initWithPersistedState(),this.onDataChanged(),this.adjustPaginator(),document.querySelector(".header")?G(this,B,document.querySelector(".header").clientHeight,"f"):G(this,B,0,"f"),document.querySelector(".topbar")&&G(this,B,N(this,B,"f")+document.querySelector(".topbar").clientHeight,"f"),N(this,O,"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((i=>t.indexOf(i.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 i=t.querySelectorAll(".f-text-field");for(let t=0;t<i.length;t++)R(i[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),N(this,O,"m",L).call(this),this.kupManager.debug.logRender(this,!0)}render(){G(this,W,[],"f");const t=!("object"!=typeof this.kanban||null===this.kanban);let i=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.visibleColumns.map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let e={label:this.kupManager.language.translate(d.SORT_BY),trailingIcon:!0};i=o("div",{id:"sort-panel"},o("kup-combobox",{data:{"kup-text-field":e,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let e=null;this.globalFilter&&(e=o("div",{id:"global-filter"},o("kup-text-field",{fullWidth:!0,label:this.kupManager.language.translate(k.SEARCH),icon:b.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout),this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}})));let n=null;(this.showLoadMore||!this.lazyLoadRows&&this.pagination)&&(n=o(A,{id:"top-paginator",currentPage:this.currentPage,max:this.filteredRows.length,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.rowsPerPage,onLoadMore:this.showLoadMore?()=>{N(this,O,"m",H).call(this)}:null,onNextPage:()=>this.handlePageChange(this.currentPage+1),onPrevPage:()=>this.handlePageChange(this.currentPage-1),onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let r=null,a={};if(0===this.rows.length)r=o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(d.EMPTY_DATA))),a={"grid-template-columns":"repeat(1, 1fr)"};else if(t){const t=this.kanbanMode();r=t.jsx,a=t.style}else{a={"grid-template-columns":`repeat(${this.columns}, 1fr)`};const t=this.rows;let i=t.length,e=0;for(r=[];i-- >0;)r.push(this.renderRow(t[e++]))}return o(s,null,o("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),o("div",{id:z},o("div",{class:"box-component",ref:t=>this.sectionRef=t},i,e,n,o("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},r))))}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,B=new WeakMap,T=new WeakMap,$=new WeakMap,O=new WeakSet,L=function(){this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length&&N(this,D,"f").observe(N(this,W,"f")[N(this,W,"f").length-1])},F=function(){const t={threshold:0,rootMargin:"-"+N(this,B,"f")+"px 0px 0px 0px"};G(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 i=this.data.rows.length-this.currentRowsPerPage;this.currentRowsPerPage+=i<this.loadMoreStep?i:this.loadMoreStep,t.target.classList.remove("last-row"),N(this,D,"f").unobserve(t.target)}}))}),t),"f")},H=function(){var t;let i=0;switch(this.loadMoreMode){case S.CONSTANT:i=this.loadMoreStep;break;case S.CONSTANT_INCREMENT:i=this.loadMoreStep*(N(this,T,"f")+1);break;case S.PROGRESSIVE_THRESHOLD:i=Math.max(N(this,$,"f"),this.loadMoreStep)*Math.min(N(this,T,"f")+1,2)}i>this.loadMoreLimit&&(i=this.loadMoreLimit),this.kupLoadMoreClick.emit({comp:this,id:this.rootElement.id,loadItems:i}),G(this,$,i,"f"),G(this,T,(t=N(this,T,"f"),++t),"f")},V.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_box_background_color:var(--kup-box-background-color, var(--kup-layer-1));--kup_box_background_color_hover:var(\n --kup-box-background-color-hover,\n var(--kup-layer-1-hover)\n );--kup_box_background_color_selected:var(\n --kup-box-background-color-selected,\n var(--kup-layer-1-selected)\n );--kup_box_text_color:var(--kup-box-text-color, var(--kup-text-secondary));--kup_box_grid_gap:var(--kup-box-grid-gap, var(--kup-space-03));--kup_box_transition:var(--kup-box-transition, 0.25s);--kup_box_border_color_drag:var(--kup-box-border-color-drag, var(--kup-border-interactive))\n display: block;--kup_box_padding:var(--kup-box-padding, var(--kup-space-05))}.box-component{transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup_box_border_color_drag)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_text_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 *:not(.progress-bar-percentage){box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center;background-color:var(--kup_box_background_color);border-radius:var(--kup-radius-00)}#box-container .box-wrapper:hover{background-color:var(--kup_box_background_color_hover)}#box-container .box-wrapper.selected{background-color:var(--kup_box_background_color_selected)}#box-container .box-wrapper.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;padding:var(--kup_box_padding);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[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup_box_border_color_drag);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-subtle);color:rgba(var(--kup-text-secondary-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-subtle);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 300ms 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-subtle);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-subtle)}#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(.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 .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{padding: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{V as kup_box}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as e,h as s,H as n,d as a}from"./p-b0368f88.js";import{k as o,f as p,ax as
|
|
1
|
+
import{r as t,c as i,f as e,h as s,H as n,d as a}from"./p-b0368f88.js";import{k as o,f as p,ax as h,g as f,s as l,X as r,ay as c,h as m,az as g}from"./p-d5e0e93b.js";import{c as d}from"./p-635bb4b3.js";import{F as u}from"./p-d39c3267.js";import{F as y}from"./p-a117ca68.js";import"./p-1ee561ba.js";import"./p-e3062c19.js";import"./p-b120abd7.js";import"./p-4d9381ce.js";import"./p-ad63c9ec.js";import"./p-3a360c58.js";import"./p-621f1a80.js";var k,x=function(t,i,e,s){if("a"===e&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?s:"a"===e?s.call(t):s?s.value:i.get(t)};const b=class{constructor(e){t(this,e),this.kupCellSubmitClick=i(this,"kup-cell-submit-click",6),this.kupCellUpload=i(this,"kup-cell-upload",6),k.set(this,o()),this.customStyle="",this.data=null,this.density=p.NONE,this.dragEnabled=!1,this.showSubmit=!1,this.submitPosition=h.right}async addCssClasses(t){if(this.data.cssClass||(this.data.cssClass=""),t)for(let i=0;i<t.length;i++){const e=t[i];this.data.cssClass.indexOf(e)<0&&(this.data.cssClass+=` ${e}`)}this.refresh()}async getProps(t){return f(this,g,t)}async refresh(){e(this)}async removeCssClasses(t){if(this.data.cssClass){if(t)for(let i=0;i<t.length;i++){const e=t[i];this.data.cssClass.indexOf(e)>0&&(this.data.cssClass=this.data.cssClass.replace(new RegExp(e,"g"),""))}this.refresh()}}async setProps(t){l(this,g,t)}didRenderInteractables(){if(this.dragEnabled){const t=()=>({cell:this.data,column:this.generateColumn(),id:this.rootElement.id,multiple:!1,row:this.generateRow()});x(this,k,"f").interact.draggable(this.rootElement.shadowRoot.querySelector("#"+d),{cursorChecker:()=>null},{callback:t},r.BADGE)}}generateColumn(){return{name:"KUPCELL",title:void 0}}generateRow(){const t=this.generateColumn(),i={cells:{}};return i.cells[t.name]=this.data,i}submitClick(t){t.stopPropagation(),this.kupCellSubmitClick.emit({comp:this,id:this.rootElement.id,cell:this.data})}upload(t){t.stopPropagation(),this.kupCellUpload.emit(t.detail)}componentWillLoad(){x(this,k,"f").dates.register(this),x(this,k,"f").debug.logLoad(this,!1),x(this,k,"f").language.register(this),x(this,k,"f").theme.register(this)}componentDidLoad(){x(this,k,"f").debug.logLoad(this,!0)}componentWillRender(){x(this,k,"f").debug.logRender(this,!1)}componentDidRender(){this.didRenderInteractables(),x(this,k,"f").debug.logRender(this,!0)}render(){const t={cell:this.data,column:this.generateColumn(),component:this,density:this.density,editable:this.data.isEditable,renderKup:!0,row:this.generateRow()};return s(n,{key:"b450035080d728f4a9e1b192b14e630b36bf879e","onKup-file-upload-upload":this.upload.bind(this)},s("style",{key:"1e895664baa2c86e300be091908403873b96e7f6"},x(this,k,"f").theme.setKupStyle(this.rootElement)),s("div",{key:"75ada02dbdd167998835d443242285d7253a6316",id:d,style:this.showSubmit?{display:"flex","flex-direction":c(this.submitPosition),"align-items":"center",gap:"0.5rem"}:{}},s(y,Object.assign({key:"12365188d85255679404e8e399dfda9f89d8ac51"},t)),this.showSubmit?s(u,{buttonType:"submit",label:x(this,k,"f").language.translate(m.CONFIRM),wrapperClass:"form__submit",onClick:t=>{this.submitClick(t)}}):null))}disconnectedCallback(){x(this,k,"f").dates.unregister(this),x(this,k,"f").language.unregister(this),x(this,k,"f").theme.unregister(this)}get rootElement(){return a(this)}};k=new WeakMap,b.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{display:block;height:fit-content;width:100%}#kup-component{height:fit-content;width:100%}";export{b as kup_cell}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as
|
|
1
|
+
import{h as i}from"./p-b0368f88.js";import{F as c}from"./p-b120abd7.js";import{b as e,h as s}from"./p-d5e0e93b.js";var n,p,l;!function(i){i.CHOICE="choice",i.FILTER="filter",i.INPUT="input",i.STANDARD="standard"}(n||(n={})),function(i){i.OUTLINED="outlined",i.RAISED="raised"}(p||(p={})),function(i){i.SMALL="small",i.MEDIUM="medium"}(l||(l={}));const r=document.documentElement,a=l=>{l.styling||(l.styling=p.RAISED),l.type||(l.type=n.STANDARD);const a=l.type.toLowerCase()===n.CHOICE,o=l.type.toLowerCase()===n.FILTER,t=l.type.toLowerCase()===n.INPUT,d=l.styling.toLowerCase()===p.OUTLINED,u={"chip-set":!0,"chip-set--choice":!!a,"chip-set--filter":!!o,"chip-set--input":!!t,"chip--outlined":!!d,"chip--raised":!d,[`chip--${l.sizing||"extra-small"}`]:!0};return i("div",Object.assign({class:`f-chip ${l.danger?"kup-danger":""} ${l.info?"kup-info":""} ${l.secondary?"kup-secondary":""} ${l.success?"kup-success":""} ${l.warning?"kup-warning":""} ${l.wrapperClass?l.wrapperClass:""} ${l.primary?"kup-primary":""}`},l.dataSet,{id:l.id,title:l.title}),i("div",{class:u,role:"grid"},function(n,p,l,a){const o=[];for(let t=0;n.data&&t<n.data.length;t++){const d=[];function u(p,l){const a=!!(p.children&&p.children.length>0),o=!(!a||!p.isExpanded),_={"--kup_chip_indent_offset":l.toString()};if(d.push(i("div",{class:"chip-set__wrapper "+(a&&!o?"chip-set__wrapper--hidden-children":"")},i("div",{class:"chip-set__indent",style:_}),a?i(c,{onClick:n.onExpansionClick&&n.onExpansionClick[t]?n.onExpansionClick[t].bind(n.onExpansionClick[t],p):null,resource:`${e.DROPDOWN}`,sizeX:"16px",sizeY:"16px",title:r.ketchup.language.translate(s.EXPAND)+"/"+r.ketchup.language.translate(s.COLLAPSE)+" (CTRL + Click)",wrapperClass:"dropdown-icon"}):l?i(c,{resource:"blank",sizeX:"16px",sizeY:"16px",wrapperClass:"dropdown-icon"}):null,h(p))),o)for(let i=0;i<p.children.length;i++)p.children[i]&&u(p.children[i],l+1)}function h(s){let r="chip "+(s.icon&&!s.value?"chip--only-icon":""),o=[],d="chip__icon chip__icon--leading";(l||p)&&s.checked&&(r+=" chip--selected",l&&(d+=" chip__icon--leading-hidden")),s.icon&&o.push(i(c,Object.assign({},{color:p&&s.checked?"var(--kup_chip_primary_color)":"var(--kup_chip_text_color)",resource:s.icon,placeholderResource:s.placeholderIcon,sizeX:"16px",sizeY:"16px",wrapperClass:d}))),l&&o.push(i("span",{class:"chip__checkmark"},i("svg",{class:"chip__checkmark-svg",viewBox:"-2 -3 30 30"},i("path",{class:"chip__checkmark-path",fill:"none",stroke:"black",d:"M1.73,12.91 8.1,19.28 22.79,4.59"}))));let u="";return u=n.displayId?s.value?s.id+" - "+s.value:s.id:s.value,i("div",{class:r,"data-value":s.id,onClick:n.onClick&&n.onClick[t]?n.onClick[t].bind(n.onClick[t],s):null,role:"row",title:s.title?s.title:""},i("span",{class:"chip-set__indent"}),o,i("span",{role:"gridcell"},i("span",{role:"button",tabindex:t,class:"chip__primary-action",value:s.id,checked:s.checked,onBlur:n.onBlur&&n.onBlur[t]?n.onBlur[t].bind(n.onBlur[t],s):null,onFocus:n.onFocus&&n.onFocus[t]?n.onFocus[t].bind(n.onFocus[t],s):null},i("span",{class:"chip__text"},u))),a?i("span",{role:"gridcell"},i("span",{tabindex:"-1",class:`kup-icon chip__icon ${e.CLEAR.replace("--","")}`,onClick:n.onIconClick&&n.onIconClick[t]?n.onIconClick[t].bind(n.onIconClick[t],s):null})):null)}u(n.data[t],0),o.push(i("div",{class:"chip-set__item"},...d))}return o}(l,a,o,t)))};export{n as F,l as a,p as b,a as c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,E as t,C as n,af as l,w as o,y as r,ag as i,ah as s,M as a,N as u,F as c,ai as f,aj as h,ak as d,al as b,am as m,a5 as p}from"./p-8d1f4c18.js";import{K as v}from"./p-1ee561ba.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;const o=e[t];o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length&&delete e[t]}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const g="TREE_COLUMN";var x;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(x||(x={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t)}isFilterCompliantForCellObj(e,t){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t)}isRowCompliant(e,t={},n="",l=!1,o=[],r){return this.areCellsCompliant(e.cells,t,n,l,o,r)}areCellsCompliant(e,t={},n="",r=!1,i=[],s){if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let r=0;r<i.length;r++){if(0==i[r].visible)continue;const s=e[i[r].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,n);let a=l(i[r],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,n)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),h=c;return k.isNumber(l.obj)||k.isDate(l.obj)||k.isTime(l.obj)||k.isTimestamp(l.obj)||(h=""!==a&&this.isFilterCompliantForCellObj(l,a)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&h:f||h}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===g?{name:g,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o){if(!e||null==e)return[];let r=[];const i=!(!n||!l);if(this.hasFilters(t,l,o)||i)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,n,i,l,o))&&(r[r.length]=a)}else r=[...e];return r}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const C=document.documentElement;function T(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=T(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r){return null==r&&(r=new y),r.filterRows(e,t,n,l,o)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const h=o(e,n),d=l(h,f),b=f.value;let m=null;for(let e of u)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=C.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=C.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&C.ketchup.objects.isDate(r.obj)&&C.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(C.ketchup.dates.toDayjs(t)),e.group.totals[o]=C.ketchup.dates.format(C.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=C.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(C.ketchup.dates.toDayjs(e)),n.group.totals[o]=C.ketchup.dates.format(C.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=C.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&C.ketchup.objects.isDate(r.obj)&&C.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(C.ketchup.dates.toDayjs(t)),e.group.totals[o]=C.ketchup.dates.format(C.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=C.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(C.ketchup.dates.toDayjs(e)),n.group.totals[o]=C.ketchup.dates.format(C.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=C.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,o,n)))}function D(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{D(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function E(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=E(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=C.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function B(e,t,n){if(C.ketchup.objects.isEmptyJsObject(n)||C.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(C.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+C.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+C.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>C.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>C.ketchup.math.numberifySafe(e)))).toString())}if(C.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>C.ketchup.dates.isIsoDate(e))).map((e=>C.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=C.ketchup.dates.format(C.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=C.ketchup.dates.format(C.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=C.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(C.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:$(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function I(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function $(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:I(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function q(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function z(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i),[c.COMBOBOX]:()=>f(o,"",i),[c.RADIO]:()=>h(o,i),[c.CHECKBOX]:()=>d(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,x as K,y as a,N as b,B as c,z as d,F as e,M as f,q as g,A as n,S as p,T as s,g as t}
|
|
1
|
+
import{D as e,E as t,C as n,af as l,w as o,y as r,ag as i,ah as s,M as a,N as u,F as c,ai as f,aj as h,ak as d,al as b,am as m,a5 as p}from"./p-d5e0e93b.js";import{K as v}from"./p-1ee561ba.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;const o=e[t];o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length&&delete e[t]}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const g="TREE_COLUMN";var x;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(x||(x={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t)}isFilterCompliantForCellObj(e,t){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t)}isRowCompliant(e,t={},n="",l=!1,o=[],r){return this.areCellsCompliant(e.cells,t,n,l,o,r)}areCellsCompliant(e,t={},n="",r=!1,i=[],s){if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let r=0;r<i.length;r++){if(0==i[r].visible)continue;const s=e[i[r].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,n);let a=l(i[r],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,n)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),h=c;return k.isNumber(l.obj)||k.isDate(l.obj)||k.isTime(l.obj)||k.isTimestamp(l.obj)||(h=""!==a&&this.isFilterCompliantForCellObj(l,a)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&h:f||h}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===g?{name:g,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o){if(!e||null==e)return[];let r=[];const i=!(!n||!l);if(this.hasFilters(t,l,o)||i)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,n,i,l,o))&&(r[r.length]=a)}else r=[...e];return r}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const C=document.documentElement;function T(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=T(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r){return null==r&&(r=new y),r.filterRows(e,t,n,l,o)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const h=o(e,n),d=l(h,f),b=f.value;let m=null;for(let e of u)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=C.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=C.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&C.ketchup.objects.isDate(r.obj)&&C.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(C.ketchup.dates.toDayjs(t)),e.group.totals[o]=C.ketchup.dates.format(C.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=C.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(C.ketchup.dates.toDayjs(e)),n.group.totals[o]=C.ketchup.dates.format(C.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=C.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&C.ketchup.objects.isDate(r.obj)&&C.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(C.ketchup.dates.toDayjs(t)),e.group.totals[o]=C.ketchup.dates.format(C.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=C.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(C.ketchup.dates.toDayjs(e)),n.group.totals[o]=C.ketchup.dates.format(C.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=C.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,o,n)))}function D(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{D(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function E(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=E(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=C.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function B(e,t,n){if(C.ketchup.objects.isEmptyJsObject(n)||C.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(C.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+C.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+C.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>C.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>C.ketchup.math.numberifySafe(e)))).toString())}if(C.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>C.ketchup.dates.isIsoDate(e))).map((e=>C.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=C.ketchup.dates.format(C.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=C.ketchup.dates.format(C.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=C.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(C.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:$(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function I(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function $(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:I(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function q(e,t,n=!1){const l={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const o of t.rows){const t={cells:{},id:o.id};for(const n of l.columns){const l=n.name,r=o.cells[l],i=e.rows.find((e=>e.id===o.id)),s=i?i.cells[l]:null;(!s&&r.value||s&&r.value!==s.value)&&(t.cells[l]=r)}(Object.keys(t.cells).length>0||n)&&l.rows.push(t)}return l}function z(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i),[c.COMBOBOX]:()=>f(o,"",i),[c.RADIO]:()=>h(o,i),[c.CHECKBOX]:()=>d(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,x as K,y as a,N as b,B as c,z as d,F as e,M as f,q as g,A as n,S as p,T as s,g as t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,f as n,h as e,H as l,d as s}from"./p-b0368f88.js";import{F as o}from"./p-d39c3267.js";import{F as a,f as u}from"./p-a117ca68.js";import{F as h,k as r,aa as p,g as c,s as f,h as d,af as m,al as v,ai as b,ak as _,aj as k,am as g,e as x,U as y}from"./p-d5e0e93b.js";import{F as w}from"./p-7db300e0.js";import{F as j,a as O}from"./p-60cfddce.js";import{c as F}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-b120abd7.js";import"./p-4d9381ce.js";import"./p-ad63c9ec.js";import"./p-3a360c58.js";import"./p-621f1a80.js";import"./p-1ee561ba.js";import"./p-c56195a0.js";var $,z,T,M;!function(t){t.TAB="tab"}($||($={})),function(t){t.customStyle="Custom style of the component.",t.data="Actual data of the input panel.",t.hiddenSubmitButton="Creates a hidden submit button in order to submit the form with enter.",t.submitCb="Sets the callback function on submit form",t.optionsHandler="Sets the callback function to recieve options",t.buttonPosition="Manage the position of the buttons related to the input panel content. It is an enumeration",t.inputPanelPosition="Manage the global layout of the input panel fields. The default is COLUMNS.",t.autoSkip="Sets the auto skip between input text fields when the value reaches the max length.",t.autoFocus="Sets whether the first input should receive focus."}(z||(z={})),function(t){t.COLUMNS="COLUMNS",t.INLINE="INLINE",t.STRETCHED="STRETCHED",t.UPINLINE="UPINLINE",t.UPCOLUMNS="UPCOLUMNS",t.PLACEHOLDER="PLACEHOLDER"}(T||(T={})),function(t){t.CENTER="CENTER",t.LEFT="LEFT",t.BOTTOM="BOTTOM",t.RIGHT="RIGHT",t.TOP="TOP"}(M||(M={}));const E={"*F01":"F1","*F02":"F2","*F03":"F3","*F04":"F4","*F05":"F5","*F06":"F6","*F07":"F7","*F08":"F8","*F09":"F9","*F10":"F10","*F11":"F11","*F12":"F12","*F13":"shift+F1","*F14":"shift+F2","*F15":"shift+F3","*F16":"shift+F4","*F17":"shift+F5","*F18":"shift+F6","*F19":"shift+F7","*F20":"shift+F8","*F21":"shift+F9","*F22":"shift+F10","*F23":"shift+F11","*F24":"shift+F12","*ENT":"Enter","*PDN":"PageDown","*PUP":"PageUp"};var S;!function(t){t.BLUR="blur",t.ITEMCLICK="itemclick"}(S||(S={}));const C={blur:t=>t===h.CHECKBOX||t===h.SWITCH||t===h.COMBOBOX||t===h.AUTOCOMPLETE,itemclick:t=>t!==h.COMBOBOX&&t!==h.AUTOCOMPLETE},P=t=>0==t?5:t?1===t?15:10*t:null,D=t=>t?22*t:null,W=t=>t?22*(t-1):null,L=t=>t?10*t:null;var I,N,K,R,A,H,U,B,G,V,J,q,X,Y,Q,Z,tt,it,nt,et,lt,st,ot,at,ut,ht,rt,pt,ct,ft,dt,mt,vt,bt,_t,kt,gt,xt,yt,wt,jt,Ot,Ft,$t,zt,Tt,Mt,Et,St,Ct,Pt,Dt,Wt,Lt,It,Nt,Kt,Rt,At,Ht,Ut,Bt,Gt,Vt,Jt,qt,Xt,Yt,Qt,Zt,ti=function(t,i,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(t):e?e.value:i.get(t)},ii=function(t,i,n,e,l){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!l:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?l.call(t,n):l?l.value=n:i.set(t,n),n};const ni=document.documentElement,ei=class{constructor(n){t(this,n),this.kupReady=i(this,"kup-input-panel-ready",6),this.kupDataTableContextMenu=i(this,"kup-inputpanel-contextmenu",6),this.kupInputPanelObjectFieldSearchPayload=i(this,"kup-inputpanel-objectfield-searchpayload",6),this.kupInputPanelObjectFieldOpenSearchMenu=i(this,"kup-inputpanel-objectfield-opensearchmenu",6),this.kupInputPanelObjectFieldSelectedMenuItem=i(this,"kup-inputpanel-objectfield-selectedmenuitem",6),I.add(this),N.set(this,r()),K.set(this,void 0),R.set(this,new Map([["SmeupDataTree",ti(this,I,"m",Nt).bind(this)],["SmeupDataTable",ti(this,I,"m",Kt).bind(this)],["SmeupTreeNode",ti(this,I,"m",It).bind(this)],["SmeupTable",ti(this,I,"m",Kt).bind(this)]])),A.set(this,null),H.set(this,[]),U.set(this,new Map([[p.DATE,"kup-date-picker"],[p.TIME,"kup-time-picker"]])),B.set(this,new Map([[p.COMBOBOX,"kup-combobox"],[p.AUTOCOMPLETE,"kup-autocomplete"]])),G.set(this,new Map([[h.BUTTON_LIST,ti(this,I,"m",tt).bind(this)],[h.LABEL,ti(this,I,"m",et).bind(this)],[h.TABLE,ti(this,I,"m",nt).bind(this)]])),V.set(this,new Map([[$.TAB,ti(this,I,"m",rt).bind(this)]])),J.set(this,[]),q.set(this,void 0),X.set(this,void 0),this.buttonPosition=M.BOTTOM,this.customStyle="",this.dashboardMode=!1,this.data=null,this.hiddenSubmitButton=!1,this.inputPanelPosition=T.COLUMNS,this.submitCb=null,this.optionsHandler=null,this.customButtonClickHandler=null,this.checkValidObjCallback=null,this.checkValidValueCallback=null,this.autoFocus=!1,this.autoSkip=!1,this.updateOnClick=!1,this.inputPanelCells=[],this.inputPanelCommands=[],this.tabSelected=null}onDataChanged(){ii(this,A,structuredClone(this.data),"f"),ti(this,H,"f").length&&(ti(this,H,"f").map((({event:t,handler:i})=>{this.rootElement.removeEventListener(t,i)})),ii(this,H,[],"f")),ti(this,J,"f").length&&(ti(this,J,"f").map((t=>{ti(this,N,"f").keysBinding.unregister(t)})),ii(this,J,[],"f")),this.data&&ti(this,I,"m",dt).call(this,this.data)}listenKeydown(t){if("Enter"===t.key){t.preventDefault(),t.stopPropagation();const i=this.rootElement.shadowRoot.activeElement;"enter"===t.key.toLowerCase()&&i&&(null==i||i.blur(),this.submitCb({value:{before:Object.assign({},ti(this,A,"f")),after:ti(this,I,"m",bt).call(this)}}))}}async waitForReady(){return ti(this,q,"f")}async getProps(t){return c(this,z,t)}async refresh(){n(this)}async setProps(t){f(this,z,t)}connectedCallback(){ii(this,q,new Promise((t=>{ii(this,X,t,"f")})),"f")}componentWillLoad(){ti(this,N,"f").debug.logLoad(this,!1),ti(this,N,"f").language.register(this),ti(this,N,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){ti(this,I,"m",Xt).call(this),this.kupReady.emit({comp:this,id:this.rootElement.id}),ti(this,I,"m",Yt).call(this),ti(this,N,"f").debug.logLoad(this,!0)}componentWillRender(){ti(this,N,"f").debug.logRender(this,!1)}componentDidRender(){if(ti(this,K,"f")){const t=ti(this,K,"f").querySelectorAll(".f-text-field");for(let i=0;i<t.length;i++)w(t[i])}requestAnimationFrame((async()=>{ti(this,K,"f")&&ti(this,X,"f")&&(ti(this,X,"f").call(this),ii(this,X,null,"f"))})),ti(this,N,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[e("p",null,ti(this,N,"f").language.translate(d.EMPTY_DATA))]:this.inputPanelCells.map((t=>ti(this,I,"m",Q).call(this,t)));return e(l,{key:"6828a1548fa7dea4d1409090e2551fc822f6caf0","onKup-cell-blur":t=>ti(this,I,"m",Ht).call(this,t,S.BLUR),"onKup-cell-update":ti(this,I,"m",Ut).bind(this),"onKup-tabbar-click":t=>{this.tabSelected=t.detail.node.id},"onKup-autocomplete-input":ti(this,I,"m",jt).bind(this),"onKup-autocomplete-iconclick":ti(this,I,"m",jt).bind(this),"onKup-combobox-iconclick":t=>ti(this,I,"m",jt).call(this,t,!0),"onKup-cell-itemclick":t=>ti(this,I,"m",Ht).call(this,t,S.ITEMCLICK),"onKup-objectfield-searchpayload":t=>{this.kupInputPanelObjectFieldSearchPayload.emit(t.detail)},"onKup-objectfield-opensearchmenu":t=>{this.kupInputPanelObjectFieldOpenSearchMenu.emit(t.detail)},"onKup-objectfield-selectedmenuitem":t=>{this.kupInputPanelObjectFieldSelectedMenuItem.emit(t.detail)}},e("style",{key:"0970d7d18d08c3f498e1071f1b149d801820a3d0"},ti(this,N,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"f2ce5f3304600d37fa08932e2f757acd6f1bd3e7",id:F},t))}disconnectedCallback(){ti(this,N,"f").language.unregister(this),ti(this,N,"f").theme.unregister(this),ti(this,J,"f").forEach((t=>{ti(this,N,"f").keysBinding.unregister(t)}))}get rootElement(){return s(this)}static get watchers(){return{data:["onDataChanged"]}}};N=new WeakMap,K=new WeakMap,R=new WeakMap,A=new WeakMap,H=new WeakMap,U=new WeakMap,B=new WeakMap,G=new WeakMap,V=new WeakMap,J=new WeakMap,q=new WeakMap,X=new WeakMap,I=new WeakSet,Y=function(t){return this.inputPanelCells.reduce(((i,{cells:n})=>{if(!i){const i=n.find((({column:i})=>i.name===t));return i?i.cell:null}return i}),null)},Q=function(t){var i,n;const l=t.row.layout,s=(null==l?void 0:l.horizontal)||!1,a={};let u;if(null===(i=null==l?void 0:l.sections)||void 0===i?void 0:i.length)if(l.absolute)u=ti(this,I,"m",ot).call(this,t,l),a.height=22*(t=>{let i=0;return t.sections.forEach((t=>{t.content.forEach((t=>{t.absoluteRow>i&&(i=t.absoluteRow+(t.absoluteHeight>1?t.absoluteHeight:0))}))})),i})(l)+12+"px";else{if(!l.sectionsType){const i=l.sections.some((t=>t.dim));a.display="grid",this.inputPanelPosition!==T.INLINE&&this.inputPanelPosition!==T.UPINLINE||(a.display=""),l.horizontal?a.gridTemplateColumns=i?l.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${t.cells.length}, 1fr)`:this.dashboardMode&&(a.gridTemplateRows=i?l.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${l.sections.length}, 1fr)`)}u=ti(this,I,"m",st).call(this,t,l)}else u=t.cells.filter((({column:t})=>t.visible)).map((i=>ti(this,I,"m",Z).call(this,i.cell,t.row,i.column)));const h={"input-panel-form":!0,"input-panel-form--inline":this.buttonPosition==M.RIGHT},r={"input-panel":!0,"input-panel--column":!s,"input-panel--absolute":null==l?void 0:l.absolute,"input-panel--inline":this.inputPanelPosition===T.INLINE||this.inputPanelPosition===T.UPINLINE},p={"input-panel__commands":!0,[`input-panel__commands--${this.buttonPosition}`]:!0},c={value:null===(n=null==l?void 0:l.sections[0])||void 0===n?void 0:n.title,type:O.HEADING1};return e("div",null,e("form",{name:this.rootElement.id,id:this.rootElement.id,class:h,ref:t=>ii(this,K,t,"f"),onSubmit:t=>{t.preventDefault(),this.submitCb({value:{before:Object.assign({},ti(this,A,"f")),after:ti(this,I,"m",bt).call(this)}})},onContextMenu:t=>{null!=ti(this,I,"m",Jt).call(this,t)&&t.preventDefault()}},e("div",{class:"input-panel__typography"},e(j,Object.assign({},c))),e("div",{class:r,style:a},u),e("div",{class:p},e(o,{buttonType:"submit",label:ti(this,N,"f").language.translate(d.CONFIRM),wrapperClass:"form__submit",invisible:this.hiddenSubmitButton}),this.inputPanelCommands)))},Z=function(t,i,n){var l;if(!t)return;const s=ti(this,G,"f").get(t.shape);if(void 0!==s)return s(t,n,null===(l=i.layout)||void 0===l?void 0:l.absolute);t.data=Object.assign(Object.assign({},t.data),{sizing:"extra-small"});const o={cell:t,column:n,row:i,component:this,editable:!0,renderKup:!0,setSizes:!0},u=ti(this,I,"m",lt).call(this,t,n.title);return u?e("div",{class:{"input-panel__label_container":!0}},u,e(a,Object.assign({},o))):e(a,Object.assign({},o))},tt=function(t,{name:i}){return e(o,Object.assign({icon:t.icon,id:i},t.data,{wrapperClass:"form__submit"}))},it=function(t,i){return e("kup-dropdown-button",Object.assign({},t.data,{label:t.value,data:i,"onkup-dropdownbutton-itemclick":t=>{ti(this,I,"m",Vt).call(this,t.detail.node,t.detail.node.id)}}))},nt=function(t,{name:i}){return e("kup-data-table",Object.assign({id:i,editableData:!0,showGroups:!0,showFilters:!0},t.data))},et=function(t,i,n){const l=ni.ketchup.data.cell.getType(t,t.shape),s="input-panel-label",o=n?" input-panel-label--legacy-look":"";return l===p.NUMBER?e("span",{class:`${s}${o}${l===p.NUMBER?" input-panel-label-number":""}`,id:i.name},m(i,t)):e("span",{class:`${s}${o}`,id:i.name},e(u,{text:t.value}))},lt=function(t,i){return i&&ni.ketchup.data.cell.getType(t,t.shape)===p.RADIO?e("span",null,i):null},st=function(t,i){const n=ti(this,V,"f").get(i.sectionsType);return n?n(t,i.sections):i.sections.map((i=>ti(this,I,"m",at).call(this,t,i,!1)))},ot=function(t,i){return i.sections.map((i=>ti(this,I,"m",ut).call(this,t,i)))},at=function t(i,n,l=!1,s={}){var o,a;const u={"input-panel__section":!n.horizontal,"input-panel__horizontal-section":n.horizontal,"input-panel__section-inline":this.inputPanelPosition===T.INLINE||this.inputPanelPosition===T.UPINLINE};s.gap=+n.gap>0?`${n.gap}rem`:"1rem";let h=[];if(null===(o=n.sections)||void 0===o?void 0:o.length){h=n.sections.map((n=>ti(this,I,"m",t).call(this,i,n))).filter(Boolean);const e=n.sections.some((t=>t.dim));!n.gridCols&&n.horizontal&&(s.gridTemplateColumns=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`),n.gridRows||n.horizontal||!this.dashboardMode||(s.gridTemplateRows=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`)}else(null===(a=n.content)||void 0===a?void 0:a.length)&&(h=n.content.map((t=>ti(this,I,"m",pt).call(this,i,t))).filter(Boolean),s.gridTemplateColumns=+n.gridCols>0?`repeat(${n.gridCols}, 1fr)`:"",this.dashboardMode&&(s.gridTemplateRows=+n.gridRows>0?`repeat(${n.gridRows}, 1fr)`:""));const r=h.length?e("div",{class:u,style:s},h):void 0;return n.title&&!l?e("div",{class:{"input-panel__section_label_container":!0}},e(j,{type:O.HEADING1,value:n.title}),r):r},ut=function t(i,n){var l,s;let o=[];if((null===(l=n.sections)||void 0===l?void 0:l.length)?o=n.sections.map((n=>ti(this,I,"m",t).call(this,i,n))):(null===(s=n.content)||void 0===s?void 0:s.length)&&(o=n.content.map((t=>ti(this,I,"m",ct).call(this,i,t)))),null==P(n.absoluteWidth))return o;const a=null!=P(n.absoluteWidth)?`${P(n.absoluteWidth)}px`:"100%",u=null!=D(n.absoluteHeight)?`${D(n.absoluteHeight)}px`:"100%",h=`${W(n.absoluteRow)}px`,r=`${L(n.absoluteColumn)}px`;return e("div",{style:{position:"relative",width:a,"min-width":a,"max-width":a,height:u,"min-height":u,"max-height":u,top:h,left:r,overflow:"auto"}},o)},ht=function t(i){var n,e;let l=[];return(null===(n=i.content)||void 0===n?void 0:n.length)&&i.content.forEach((t=>{t.id&&l.push(t.id)})),(null===(e=i.sections)||void 0===e?void 0:e.length)&&i.sections.forEach((i=>{l=l.concat(ti(this,I,"m",t).call(this,i))})),l},rt=function(t,i){this.tabSelected||(this.tabSelected=i[0].id||"0");const n=i.map(((i,n)=>{const e=ti(this,I,"m",ht).call(this,i),l=t.cells.some((t=>{var i;const n=t.cell;return e.includes(t.column.name)&&!!(null===(i=n.data)||void 0===i?void 0:i.error)}));return{active:(i.id||`${n}`)===this.tabSelected,value:i.title,icon:l?"error":i.icon,id:i.id||`${n}`,danger:l}})),l=i.map(((i,n)=>{const e=i.id||`${n}`;return ti(this,I,"m",at).call(this,t,i,!0,{display:this.tabSelected!==e?"none":"grid"})}));return e("div",{class:{"input-panel__tabs_container":!0}},e("kup-tab-bar",{data:n,customStyle:".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }"}),l)},pt=function(t,i){const n=t.cells.find((t=>t.column.name===i.id));if(!n||!n.cell||!n.column.visible)return;const l=+i.colSpan>0?i.colSpan:+i.colSpan>0||+i.colStart>0?null:1,s=+i.rowSpan>0?i.rowSpan:+i.rowSpan>0||+i.rowStart>0?null:1;return e("div",{style:{"min-width":"0","grid-column-start":l?`span ${l}`:`${i.colStart}`,"grid-column-end":+i.colEnd>0?`${i.colEnd}`:"","grid-row-start":s?`span ${s}`:`${i.rowStart}`,"grid-row-end":+i.rowEnd>0?`${i.rowEnd}`:""}},ti(this,I,"m",Z).call(this,n.cell,t.row,n.column))},ct=function(t,i){const n=t.cells.find((t=>t.column.name===i.id));if(!n||!n.cell||!n.column.visible)return;let l;l=n.cell.shape==h.DATE?i.absoluteLength>8?i.absoluteLength:8:i.absoluteLength,i.absoluteHeight||(i.absoluteHeight=1);const s=n.cell.shape===h.LABEL?(t=>0==t?3.599999999999999:t?1===t?10.799999999999997:7.199999999999998*t:null)(l):P(l),o=D(i.absoluteHeight),a=W(i.absoluteRow),u=L(i.absoluteColumn),r={position:"absolute",width:null!==s?`${s}px`:null,"min-width":null!==s?`${s}px`:null,"max-width":null!==s?`${s}px`:null,height:null!==o?`${o}px`:null,"min-height":null!==o?`${o}px`:null,"max-height":null!==o?`${o}px`:null,top:null!==a?`${W(i.absoluteRow)}px`:null,left:null!==u?`${L(i.absoluteColumn)}px`:null,overflow:"auto"};return n.cell.data=Object.assign(Object.assign(Object.assign({},n.cell.data),{customStyle:(n.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}",legacyLook:!0,helperEnabled:!1}),n.cell.shape===h.TABLE&&{rowsPerPage:n.cell.data.data.rows.length,showPaginator:!1,showFooter:!1,tableHeight:`${o}px`}),e("div",{style:r},ti(this,I,"m",Z).call(this,n.cell,t.row,n.column))},ft=function(){this.inputPanelCommands=this.data.setup.commands.map((t=>{if((null==t?void 0:t.children)&&(null==t?void 0:t.children.length)>0){const i={"kup-list":{showIcons:!0,data:t.children.map((t=>ti(this,I,"m",Rt).call(this,t)))}};return ti(this,I,"m",it).call(this,t,i)}{const i=ti(this,I,"m",Rt).call(this,t);return ti(this,I,"m",tt).call(this,i,{name:t.value,title:t.value})}})).flat()},dt=function(t){var i,n,e,l;(null===(n=null===(i=t.setup)||void 0===i?void 0:i.commands)||void 0===n?void 0:n.length)&&ti(this,I,"m",ft).call(this);const s=null===(e=null==t?void 0:t.rows[0])||void 0===e?void 0:e.layout,o=(null===(l=null==t?void 0:t.rows)||void 0===l?void 0:l.length)?t.rows.reduce(((i,n)=>[...i,{cells:t.columns.map((t=>{const i=structuredClone(n.cells[t.name]);return{column:t,cell:i?Object.assign(Object.assign({},i),{data:ti(this,I,"m",mt).call(this,i,t,s),slotData:ti(this,I,"m",kt).call(this,i,t),isEditable:!0}):null}})),row:n}]),[]):[];o.map((({cells:t})=>t.map((({cell:t,column:i})=>{var n;const e=ni.ketchup.data.cell.getType(t,t.shape),l=ti(this,U,"f").get(e),s=ti(this,B,"f").get(e);if(!l&&!s)return;const o=(null!=l?l:s)+`[id='${i.name.replace(/\//g,"\\$1")}']`,a=this.rootElement.shadowRoot.querySelector(o);s?null==a||a.reset():null===(n=null==a?void 0:a.setValue)||void 0===n||n.call(a,t.value)})))),this.inputPanelCells=o},mt=function(t,i,n){const e=Object.assign(Object.assign({},ti(this,I,"m",_t).call(this,t,i,n)),{disabled:!t.isEditable,id:i.name}),l=ni.ketchup.data.cell.getType(t,t.shape),s=function(t,i){var n={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(n[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(e=Object.getOwnPropertySymbols(t);l<e.length;l++)i.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(n[e[l]]=t[e[l]])}return n}(t.data||{},["data"]);return l!==p.MULTI_AUTOCOMPLETE&&l!==p.MULTI_COMBOBOX?ti(this,I,"m",vt).call(this,e,Object.assign({},t.data)):Object.assign(Object.assign({},e),s)},vt=function t(i,n){for(const e in n)i[e]=n[e]instanceof Object&&!Array.isArray(n[e])&&e in i?ti(this,I,"m",t).call(this,i[e],n[e]):n[e];return i},bt=function(){return this.inputPanelCells.reduce(((t,i)=>{const n=Object.keys(i.row.cells).reduce(((t,n)=>{var e;const l=null===(e=i.cells.find((t=>t.column.name===n)))||void 0===e?void 0:e.cell;let s=null==l?void 0:l.value;return(null==l?void 0:l.shape)===h.TABLE&&(s=JSON.stringify(ti(this,I,"m",Wt).call(this,l.data.data,n))),Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},i.row.cells[n]),{value:s,obj:null==l?void 0:l.obj})})}),{});return{columns:[...t.columns,...i.cells.map((t=>t.column))],rows:[...t.rows,{cells:n,layout:i.row.layout}]}}),{columns:[],rows:[]})},_t=function(t,i,n){if(!t)return null;const e=t.options;let l;l=(null==n?void 0:n.absolute)?null:i.title;const s=t.value,o=ni.ketchup.data.cell.getType(t,t.shape),a=new Map([[p.AUTOCOMPLETE,ti(this,I,"m",wt).bind(this)],[p.BUTTON_LIST,ti(this,I,"m",yt).bind(this)],[p.CHART,ti(this,I,"m",xt).bind(this)],[p.CHIP,ti(this,I,"m",gt).bind(this)],[p.CHECKBOX,ti(this,I,"m",Ot).bind(this)],[p.COLOR_PICKER,ti(this,I,"m",Ft).bind(this)],[p.COMBOBOX,ti(this,I,"m",wt).bind(this)],[p.EDITOR,ti(this,I,"m",$t).bind(this)],[p.MULTI_AUTOCOMPLETE,ti(this,I,"m",gt).bind(this)],[p.MULTI_COMBOBOX,ti(this,I,"m",gt).bind(this)],[p.NUMBER,ti(this,I,"m",Pt).bind(this)],[p.DATE,ti(this,I,"m",Et).bind(this)],[p.OBJECT,ti(this,I,"m",St).bind(this)],[p.RADIO,ti(this,I,"m",Tt).bind(this)],[p.STRING,ti(this,I,"m",zt).bind(this)],[p.SWITCH,ti(this,I,"m",Mt).bind(this)],[p.TABLE,ti(this,I,"m",Dt).bind(this)],[p.TIME,ti(this,I,"m",Ct).bind(this)]]).get(o);return a?a(e,l,s,t,i.name,n):null},kt=function(t,i){const n=ni.ketchup.data.cell.getType(t,t.shape);return t.isEditable?n===p.CHIP?{trailingIcon:!0,label:i.title,disabled:!t.isEditable,id:i.name,fullWidth:!1}:n===p.MULTI_AUTOCOMPLETE||n===p.MULTI_COMBOBOX?Object.assign(Object.assign({},ti(this,I,"m",wt).call(this,t.options,i.title,null)),{showDropDownIcon:!0,class:"",style:{width:"100%"},disabled:!t.isEditable,id:i.name}):null:null},gt=function(t,i,n,e){return v(n,e.decode)},xt=function(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},yt=function(t,i,n,e,l){var s,o,a,u;return e.data=e.data||{},e.data.onClick=()=>{ti(this,I,"m",Vt).call(this,e,l)},(null===(s=e.data)||void 0===s?void 0:s.keyShortcut)&&!(null===(o=e.data)||void 0===o?void 0:o.disabled)&&(ti(this,J,"f").push(null===(a=e.data)||void 0===a?void 0:a.keyShortcut),ti(this,N,"f").keysBinding.register(null===(u=e.data)||void 0===u?void 0:u.keyShortcut,e.data.onClick.bind(this))),Object.assign({label:e.value,fun:e.fun},e.data)},wt=function(t,i,n){const e=b(n,i,[]);return t&&(e.data["kup-list"].data=ti(this,I,"m",Lt).call(this,t,n)),e},jt=function({detail:t},i=!1){const n=ti(this,I,"m",Y).call(this,t.id);let e=!0;i&&(e=!t.comp.data["kup-list"].data.length),n.fun&&e&&ti(this,I,"m",At).call(this,t,n)},Ot=function(t,i,n){return _(n,i)},Ft=function(t,i){return{data:{"kup-text-field":{label:i}}}},$t=function(t,i,n){return{initialValue:n}},zt=function(t,i,n,e,l){var s;const o=Object.assign({label:i},e.data);return this.autoSkip&&e.isEditable&&(null===(s=e.data)||void 0===s?void 0:s.maxLength)&&(o.onInput=t=>{ti(this,I,"m",Zt).call(this,l,t)}),o},Tt=function(t,i,n){return k(n,t)},Mt=function(t,i,n){return g(n,i)},Et=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:null!=n?n:""}},St=function(t,i,n){return{initialValue:n||"",label:i||" ",value:n||""}},Ct=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:n}},Pt=function(t,i){return{label:i}},Dt=function(t,i,n,e,l,s){try{let t=JSON.parse(e.value);return t?"SmeupDataTable"!==t.type?(ti(this,N,"f").debug.logMessage(this,`Wrong data table type for ${l} cell. Type \`SmeupDataTable\` in value expected`,x.ERROR),null):{data:{columns:t.columns.map((i=>{var n;if(t.rows.length>0){const e=null===(n=t.rows[0].cells[i.name])||void 0===n?void 0:n.obj;return!i.obj&&e?Object.assign(Object.assign({},i),{obj:{t:e.t,p:e.p}}):i}return i})),rows:t.rows.map((i=>Object.assign(Object.assign({},i),{cells:Object.keys(i.cells).reduce(((n,e)=>{const l=t.columns.find((t=>t.name===e));return Object.assign(Object.assign({},n),{[e]:Object.assign(Object.assign({},i.cells[e]),{data:Object.assign(Object.assign({},ti(this,I,"m",_t).call(this,i.cells[e],l,s)),{disabled:!1===i.cells[e].editable,id:l.id})})})}),{})})))}}:(ti(this,N,"f").debug.logMessage(this,`Empty value for ${l} cell.`,x.WARNING),null)}catch(t){return ti(this,N,"f").debug.logMessage(this,`Invalid value for ${l} cell. Type \`SmeupDataTable\` expected`,x.ERROR),null}},Wt=function(t,i){const n=Object.assign(Object.assign({},t),{rows:t.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))}),e=t.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!e.length)return n;try{const l=JSON.parse(ti(this,A,"f").rows[0].cells[i].value);return n.rows=t.rows.map(((t,i)=>e.reduce(((n,e)=>{const s=l.rows[i].cells[e]&&t.cells[e].value!==l.rows[i].cells[e].value;return Object.assign(Object.assign({},l.rows[i]),s?{cells:Object.assign(Object.assign({},n.cells),{[e]:Object.assign(Object.assign({},l.rows[i].cells[e]),{value:t.cells[e].value})})}:{cells:n.cells})}),Object.assign(Object.assign({},l.rows[i]),{cells:{}})))),n}catch(t){return n}},Lt=function(t,i){const n=ti(this,R,"f").get(t.type);return n?n(t,i):t.map((t=>({value:t.label,id:t.id,selected:i===t.id})))},It=function t(i,n){return i.children.map((i=>{var e;return{id:i.content.codice,value:i.content.testo,selected:n===i.content.codice,children:(null===(e=i.children)||void 0===e?void 0:e.length)?ti(this,I,"m",t).call(this,i,n):[]}}))},Nt=function t(i,n){return i.children.map((i=>{var e;return{id:i.obj.k,value:i.value,selected:n===i.obj.k,children:(null===(e=i.children)||void 0===e?void 0:e.length)?ti(this,I,"m",t).call(this,i,n):[]}}))},Kt=function(t,i){return t.rows.map((t=>{const n=t.fields||t.cells,[e,l]=Object.keys(n);return{id:n[e].value,value:n[l].value||n[e].value,selected:i===n[e].value}}))},Rt=function(t){return t.data&&!t.data.keyShortcut&&ti(this,N,"f").objects.isJ1Key(t.obj?t.obj:{})&&(t.data.keyShortcut=E[t.obj.k]),Object.assign(Object.assign({},t),{data:ti(this,I,"m",yt).call(this,null,null,t.value,t,t.obj.k),id:t.obj.k})},At=function(t,i){this.optionsHandler(i.fun,t.inputValue,ti(this,I,"m",bt).call(this),t.id).then((n=>{var e,l,s,o,a;const u=(null===(e=null==n?void 0:n.columns)||void 0===e?void 0:e.filter((t=>(null==t?void 0:t.visible)||!("visible"in t))).map((t=>t.name)))||[],r=null===(l=null==n?void 0:n.rows)||void 0===l?void 0:l.map((t=>{const{cells:i}=t,n=u.reduce(((n,e)=>(t.cells.hasOwnProperty(e)&&(n[e]=i[e]),n)),{});return Object.assign(Object.assign({},t),{cells:n})})),p=Object.assign(Object.assign({},n),{rows:r}),c=i.shape===h.MULTI_AUTOCOMPLETE?i.slotData.data["kup-list"]:null===(o=null===(s=i.data)||void 0===s?void 0:s.data)||void 0===o?void 0:o["kup-list"];c?c.data=(null==r?void 0:r.length)&&null!==(a=ti(this,I,"m",Lt).call(this,p,i.value))&&void 0!==a?a:[]:ti(this,N,"f").debug.logMessage(this,'getAutocompleteEventCallback() - "kup-list" not found in cell.data.data',x.WARNING),t.comp.refresh()}))},Ht=async function(t,i){var n,e,l,s,o;const{detail:{column:a,cell:u}}=t;if(C[i](null==u?void 0:u.shape))return;const h=ti(this,I,"m",Y).call(this,a.name),r=ti(this,A,"f").rows[0].cells[a.name];if(h){if(u.mandatory){if(ti(this,I,"m",Bt).call(this,a.name,h.value?(null===(n=r.data)||void 0===n?void 0:n.error)||null:ti(this,N,"f").language.translate(d.REQUIRED_VALUE)),!u.value)return}else ti(this,I,"m",Bt).call(this,a.name,(null===(e=r.data)||void 0===e?void 0:e.error)||null);if(null===(l=u.inputSettings)||void 0===l?void 0:l.checkObject){const{valid:t}=await this.checkValidObjCallback({obj:u.obj,currentState:ti(this,I,"m",bt).call(this),fun:u.fun});if(!t)return void ti(this,I,"m",Bt).call(this,a.name,ti(this,N,"f").language.translate(d.INVALID_VALUE));ti(this,I,"m",Bt).call(this,a.name,(null===(s=r.data)||void 0===s?void 0:s.error)||null)}(null===(o=u.inputSettings)||void 0===o?void 0:o.checkValueOnExit)&&ti(this,I,"m",Gt).call(this)&&this.checkValidValueCallback({before:Object.assign({},ti(this,A,"f")),after:ti(this,I,"m",bt).call(this)},a.name)}},Ut=function({detail:{cell:t,column:i}}){var n;t.shape!==h.CHECKBOX&&t.shape!==h.SWITCH||(this.updateOnClick?this.submitCb({value:{before:Object.assign({},ti(this,A,"f")),after:ti(this,I,"m",bt).call(this)},cell:i.name}):(null===(n=t.inputSettings)||void 0===n?void 0:n.checkValueOnExit)&&this.checkValidValueCallback({before:Object.assign({},ti(this,A,"f")),after:ti(this,I,"m",bt).call(this)},i.name))},Bt=function(t,i){this.inputPanelCells=this.inputPanelCells.map((n=>Object.assign(Object.assign({},n),{cells:n.cells.map((({cell:n,column:e})=>{const l=e.name===t?Object.assign(Object.assign({},n.data),{error:i}):n.data;return{column:e,cell:Object.assign(Object.assign({},n),{data:l})}}))})))},Gt=function(){return this.inputPanelCells.some((({cells:t,row:i})=>t.some((({cell:t,column:{name:n}})=>t.value!==i.cells[n].value))))},Vt=function(t,i){t.fun?this.customButtonClickHandler({fun:t.fun,cellId:i,currentState:ti(this,I,"m",bt).call(this)}):this.submitCb({value:{before:Object.assign({},ti(this,A,"f")),after:ti(this,I,"m",bt).call(this)},cell:i})},Jt=function(t){return ti(this,N,"f").getEventPath(t.target,this.rootElement).find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains("f-cell")}))},qt=function(t){const i=ti(this,I,"m",Jt).call(this,t);if(null==i)return;const n=ti(this,I,"m",bt).call(this),e=i["kup-get-cell-props"]().column.name;return{anchor:i,cell:n.rows[0].cells[e],column:n.columns.find((t=>t.name==e)),row:n.rows[0],originalEvent:t}},Xt=function(){ti(this,N,"f").interact.managedElements.add(ti(this,K,"f")),ti(this,N,"f").interact.on(ti(this,K,"f"),y.TAP,(t=>{if(2==t.button){const i=ti(this,I,"m",qt).call(this,t);i&&this.kupDataTableContextMenu.emit({comp:this,id:this.rootElement.id,details:i})}}))},Yt=function(){if(!ti(this,K,"f"))return;const t=Array.from(ti(this,K,"f").querySelectorAll(".f-cell__content"));for(const i of t){const t=ti(this,I,"m",Qt).call(this,i,!0);if(t)return void setTimeout((()=>t.focus()),300)}if(!this.autoFocus||0===t.length)return;const i=ti(this,I,"m",Qt).call(this,t[0]);i&&setTimeout((()=>i.focus()),300)},Qt=function(t,i=!1){if(!(t&&t instanceof HTMLElement))return;const n=".mdc-text-field__input",e=i?`.mdc-text-field--error ${n}`:n,l=t.querySelector(e);if(l)return l;const s=Array.from(t.querySelectorAll("*")).filter((t=>t.shadowRoot));for(const t of s){const i=t.shadowRoot.querySelector(e);if(i)return i}},Zt=function(t,i){var n,e;const l=null==i?void 0:i.target;if(!(l&&l instanceof HTMLInputElement))return;const{maxLength:s,value:o}=l;if(!s||s<0||(null==o?void 0:o.length)<s)return;const a=Array.from(null===(n=ti(this,K,"f"))||void 0===n?void 0:n.querySelectorAll(".f-text-field")).reduce(((t,i)=>{const n=i.querySelector("input");return n?(t.push({id:(null==i?void 0:i.id)||"",HTMLInputElement:n}),t):t}),[]);if(!a.length)return;const u=a.findIndex((i=>i.id===t));u<0||u===a.length-1||null===(e=a[u+1].HTMLInputElement)||void 0===e||e.focus()},ei.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup-fcell-width:fit-content;--kup_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_textfield_textarea_height_input_panel:var(\n --kup-textfield-textarea-height-input_panel,\n 200px\n );--kup_textfield_textarea_width_input_panel:var(\n --kup-textfield-textarea-width-input_panel,\n 300px\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0);--kup_input_panel_padding--inline:var(\n --kup-input-panel-padding--inline,\n 1em 0\n );--kup_input_panel_absolute_max_height:var(\n --kup-input-panel-absolute-max-height,\n \n 716px\n )}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:8px}:host .input-panel__commands{display:flex;gap:1rem}:host .input-panel__commands.input-panel__commands--right{flex-shrink:0;overflow:hidden}:host .input-panel--inline{flex:1;overflow-x:auto;white-space:nowrap;padding:var(--kup_input_panel_padding--inline);display:inline-flex;align-items:flex-end}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid;min-width:0}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel .f-text-field .mdc-text-field.mdc-text-field--textarea{min-height:var(--kup_textfield_textarea_height_input_panel) !important;min-width:var(--kup_textfield_textarea_width_input_panel) !important}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel__section-inline{display:inline-block;width:max-content}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel .input-panel-label--legacy-look{font-size:12px;font-family:var(--kup-font-family-monospace);white-space:pre}:host .input-panel--absolute{justify-content:flex-end;padding:var(--kup-space-02);max-height:var(--kup_input_panel_absolute_max_height);--kup-textfield-extrasmall-height:20px;--kup-textfield-extrasmall-padding:0 var(--kup-space-01)}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .input-panel-label.input-panel-label-number{justify-content:end}:host .input-panel--absolute .mdc-text-field{height:unset !important}:host .input-panel-form--inline{display:flex;align-items:end;gap:1rem}";export{ei as kup_input_panel}
|