@sme.up/ketchup 11.0.0-SNAPSHOT-20241205170214 → 11.0.0-SNAPSHOT-20241206110923
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-51f1f4f6.js → f-cell-93f153b8.js} +4 -4
- package/dist/cjs/{f-chip-be8ff574.js → f-chip-87a0b4a6.js} +1 -1
- package/dist/cjs/{f-object-field-11977a37.js → f-object-field-861969e1.js} +2 -2
- package/dist/cjs/{f-paginator-utils-b010d637.js → f-paginator-utils-f79d716d.js} +1 -1
- package/dist/cjs/{f-text-field-7cbc9b46.js → f-text-field-891583b5.js} +2 -2
- package/dist/cjs/index.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_28.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-60724cb8.js → kup-data-table-helper-f9eb53cb.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 +11 -11
- 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-7f91b6a7.js → kup-manager-c2c076e9.js} +1 -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-photo-frame.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/collection/components/kup-input-panel/kup-input-panel.css +5 -0
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +5 -5
- package/dist/collection/f-components/f-text-field/f-text-field.js +1 -1
- 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-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 +9 -9
- 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-photo-frame.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-6924f9e4.js → p-41855af5.js} +2 -2
- package/dist/components/{p-ffd59ef9.js → p-609aed22.js} +2 -2
- package/dist/components/{p-ed854bb5.js → p-8c36110d.js} +2 -2
- package/dist/components/{p-77742415.js → p-ad3dc87c.js} +2 -2
- package/dist/components/{p-03548a18.js → p-eb03391c.js} +2 -2
- package/dist/components/{p-aeb81a51.js → p-ed8eafdc.js} +1 -1
- package/dist/esm/{f-cell-34aa8884.js → f-cell-205e11d7.js} +4 -4
- package/dist/esm/{f-chip-1512f776.js → f-chip-b6ce9d23.js} +1 -1
- package/dist/esm/{f-object-field-e3373bf4.js → f-object-field-9aedb15c.js} +2 -2
- package/dist/esm/{f-paginator-utils-72a7f5a8.js → f-paginator-utils-58d431d0.js} +1 -1
- package/dist/esm/{f-text-field-beb282f8.js → f-text-field-6f591b7b.js} +2 -2
- package/dist/esm/index.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_28.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-abafe38a.js → kup-data-table-helper-cbb97117.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 +11 -11
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +1 -1
- package/dist/esm/{kup-manager-defc4f8a.js → kup-manager-127fb2fb.js} +1 -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-photo-frame.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/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-0db77371.entry.js → p-005a8c68.entry.js} +1 -1
- package/dist/ketchup/{p-835b0e39.entry.js → p-055c4315.entry.js} +1 -1
- package/dist/ketchup/{p-c9d0e401.entry.js → p-06389a63.entry.js} +1 -1
- package/dist/ketchup/{p-405cacdf.entry.js → p-074ccc28.entry.js} +1 -1
- package/dist/ketchup/{p-c727e5ba.entry.js → p-14f94f98.entry.js} +1 -1
- package/dist/ketchup/{p-11812221.entry.js → p-2573e4b8.entry.js} +1 -1
- package/dist/ketchup/{p-8eea1380.js → p-27d6b90f.js} +1 -1
- package/dist/ketchup/{p-6b6d1ed2.js → p-391f53b3.js} +1 -1
- package/dist/ketchup/{p-92aaffc7.entry.js → p-3921a0a8.entry.js} +1 -1
- package/dist/ketchup/{p-f18fa415.entry.js → p-45df9a0b.entry.js} +1 -1
- package/dist/ketchup/{p-3782d150.entry.js → p-4d756c13.entry.js} +1 -1
- package/dist/ketchup/{p-8367e4cb.entry.js → p-4de1ab66.entry.js} +1 -1
- package/dist/ketchup/{p-24d6b060.entry.js → p-4e145062.entry.js} +1 -1
- package/dist/ketchup/{p-2ed6d906.entry.js → p-5a3503f8.entry.js} +1 -1
- package/dist/ketchup/{p-b0df4749.entry.js → p-5c36597d.entry.js} +1 -1
- package/dist/ketchup/{p-0d732c00.entry.js → p-62e0c101.entry.js} +1 -1
- package/dist/ketchup/{p-e0330a3b.entry.js → p-65f3da2f.entry.js} +1 -1
- package/dist/ketchup/{p-dad912dc.js → p-6680546a.js} +1 -1
- package/dist/ketchup/{p-09533900.entry.js → p-6c957751.entry.js} +1 -1
- package/dist/ketchup/{p-37c6896c.entry.js → p-6d4ad1d2.entry.js} +1 -1
- package/dist/ketchup/{p-ed124792.js → p-6fc2bc44.js} +1 -1
- package/dist/ketchup/{p-4344fe98.entry.js → p-797902ed.entry.js} +1 -1
- package/dist/ketchup/{p-3856da47.js → p-8cf46021.js} +1 -1
- package/dist/ketchup/{p-70edcd0a.entry.js → p-8eae0436.entry.js} +1 -1
- package/dist/ketchup/{p-41c6a6d7.entry.js → p-a9643593.entry.js} +1 -1
- package/dist/ketchup/{p-e143bb85.entry.js → p-aefa6b82.entry.js} +1 -1
- package/dist/ketchup/{p-140c3756.entry.js → p-b58199aa.entry.js} +1 -1
- package/dist/ketchup/{p-3cac28c8.entry.js → p-c3e55f0c.entry.js} +1 -1
- package/dist/ketchup/{p-4e730e39.entry.js → p-c7b33eec.entry.js} +1 -1
- package/dist/ketchup/{p-73d13a41.entry.js → p-ca15c303.entry.js} +1 -1
- package/dist/ketchup/{p-c344a80b.entry.js → p-cba873a6.entry.js} +1 -1
- package/dist/ketchup/{p-888dc55b.js → p-d4dd6b27.js} +1 -1
- package/dist/ketchup/p-d558fd20.js +1 -0
- package/dist/ketchup/p-df07c714.entry.js +1 -0
- package/dist/ketchup/{p-28f090d8.entry.js → p-e5bd0d63.entry.js} +1 -1
- package/dist/ketchup/p-e6a51a05.entry.js +1 -0
- package/dist/ketchup/{p-31c590b4.entry.js → p-e6b31aca.entry.js} +1 -1
- package/dist/ketchup/{p-de922cc0.entry.js → p-f72bdfba.entry.js} +1 -1
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ketchup/p-02209dd8.js +0 -1
- package/dist/ketchup/p-6b940d68.entry.js +0 -1
- package/dist/ketchup/p-8feec27f.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as e,h as o,H as s,d as n}from"./p-b32ed503.js";import{k as r,y as a,g as h,s as l,a1 as c,v as p,h as d,b,e as u,N as x,R as f,aw as g,V as m,E as k}from"./p-6b6d1ed2.js";import{f as w,p as v,s as y}from"./p-8eea1380.js";import{F as _}from"./p-74da6bf3.js";import{c as j}from"./p-3856da47.js";import{c as C}from"./p-635bb4b3.js";import{F as z}from"./p-888dc55b.js";import{p as P,r as M,F as R}from"./p-ed124792.js";import{F as A}from"./p-7db300e0.js";import"./p-5ba08261.js";import"./p-88c3ed8e.js";import"./p-02209dd8.js";import"./p-9e3b99ff.js";import"./p-e3062c19.js";import"./p-dad912dc.js";import"./p-c56195a0.js";var I,E;!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"}(E||(E={}));class S{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 S,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=E.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=this.state.sortBy,this.globalFilterValue=this.state.globalFilterValue,this.selectedRowsState=this.state.selectedRowsState,this.pageSelected=this.state.pageSelected,this.rowsPerPage=this.state.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.flex=`0 0 ${t.dim}`,l.overflow="hidden",i.horizontal?l.maxWidth=t.dim:l.maxHeight=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(z,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.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++)A(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(R,{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:C},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 E.CONSTANT:i=this.loadMoreStep;break;case E.CONSTANT_INCREMENT:i=this.loadMoreStep*(N(this,T,"f")+1);break;case E.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: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:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);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-b32ed503.js";import{k as r,y as a,g as h,s as l,a1 as c,v as p,h as d,b,e as u,N as x,R as f,aw as g,V as m,E as k}from"./p-391f53b3.js";import{f as w,p as v,s as y}from"./p-27d6b90f.js";import{F as _}from"./p-74da6bf3.js";import{c as j}from"./p-8cf46021.js";import{c as C}from"./p-635bb4b3.js";import{F as z}from"./p-d4dd6b27.js";import{p as P,r as M,F as R}from"./p-6fc2bc44.js";import{F as A}from"./p-7db300e0.js";import"./p-5ba08261.js";import"./p-88c3ed8e.js";import"./p-d558fd20.js";import"./p-9e3b99ff.js";import"./p-e3062c19.js";import"./p-6680546a.js";import"./p-c56195a0.js";var I,E;!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"}(E||(E={}));class S{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 S,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=E.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=this.state.sortBy,this.globalFilterValue=this.state.globalFilterValue,this.selectedRowsState=this.state.selectedRowsState,this.pageSelected=this.state.pageSelected,this.rowsPerPage=this.state.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.flex=`0 0 ${t.dim}`,l.overflow="hidden",i.horizontal?l.maxWidth=t.dim:l.maxHeight=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(z,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.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++)A(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(R,{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:C},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 E.CONSTANT:i=this.loadMoreStep;break;case E.CONSTANT_INCREMENT:i=this.loadMoreStep*(N(this,T,"f")+1);break;case E.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: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:14px;line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);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{C as e,H as t,D as l,B as n,ag as r,v as i,x as s,ak as o,al as a,J as u,e as c,F as f,ac as h,ab as d,am as b,an as p,ao as m,a1 as v}from"./p-6b6d1ed2.js";import{K as F}from"./p-5ba08261.js";class x extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),s=this.getIntervalTextFieldFilterValues(e,r),o=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=s[t.FROM]&&(u+=a+"(>= "+l(s[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=s[t.TO]&&(u+=a+"(<= "+l(s[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return o.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var w;!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."}(w||(w={}));const T="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,y=k.ketchup?k.ketchup.objects:new s,j=k.ketchup?k.ketchup.data:new o;class O extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,s=[],o){if(n){let t=!0;if(s&&null!=s&&s.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<s.length;i++){if(0==s[i].visible)continue;const o=e[s[i].name];if(null==o)continue;t=this.isFilterCompliantForValue(o.value,l);let a=r(s[i],o);if(a!=o.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==o&&(o=new x),!this.hasFilters(t,s,o))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=o.getTextFilterValue(t,n),c=o.getIntervalTextFieldFilterValues(t,i(s,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(y.isNumber(r.obj)||y.isDate(r.obj)||y.isTime(r.obj)||y.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let b=o.getCheckBoxFilterValues(t,n);if(0==b.length)continue;let p=!1;for(let e=0;e<b.length;e++){let t=b[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){p=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){p=!0;break}}}if(!p)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new x);for(let r=0;r<n.length;r++){let s=n[r],o=null;if(o=s===T?{name:T,title:""}:i(t,s),l.hasFiltersForColumn(e,o))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const s=!(!l||!n);if(this.hasFilters(t,n,r)||s)for(let o=0;o<e.length;o++){let a=e[o];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,s,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let s=new Array;null==i&&(i=new x);let o=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==o||i.isFilterCompliantForSimpleValue(r,n.obj,o,a))&&s.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),s;let c=Object.assign({},t.filters);c[n.name]={textField:o,textFieldTmp:o,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)s.push(u[e]);return j.cell.getUnivocalValue({rows:f},n,!0)}}const V=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:v.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=I(e,n,t[l]);if(0!==r)return r}return 0}return I(e,n,t[0])}))}function I(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function B(e=[],t={},l="",n=[],r,i){return null==i&&(i=new O),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const s={},o=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return s[l]=n,!0;return!1}));if(0===o.length)return t;const a=[];let c={};return t.forEach((t=>{const l=o[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),b=f.value;let p=null;for(let e of a)if(e.group.label===d){p=e;break}null===p&&(p={group:{id:b,parent:null,column:l,columnLabel:s[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(p));for(let l=1;l<o.length;l++){const n=o[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),o=a.value;let u=null;for(let e=0;e<p.group.children.length;e++){const t=p.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:o,parent:p,column:n.column,columnLabel:s[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},W(u),p.group.children.push(u)),p=u}}p.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=l.cells[r];if(i){const l=V.ketchup.objects.isNumber(i.obj),s=t[r];switch(s){case u.COUNT:let t=e.group.totals[r]||0;e.group.totals[r]=++t;let o=e.group.parent;for(;null!=o;){let e=o.group.totals[r]||0;o.group.totals[r]=++e,o=o.group.parent}break;case u.DISTINCT:let a;if(a=l?V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value)):i.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l&&i.value){const t=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t+(e.group.totals[r]||0);let l=e.group.parent;for(;null!=l;){const e=V.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l&&i.value){const t=e.group.totals[r],l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(i.value&&V.ketchup.objects.isDate(i.obj)&&V.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(V.ketchup.dates.toDayjs(t)),e.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.min(l),F.ISO_DATE)}else e.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);let l=e.group.parent;for(;null!=l;){const e=l.group.totals[r];if(e){let t=[];t.push(a),t.push(V.ketchup.dates.toDayjs(e)),l.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else l.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);l=l.group.parent}}break;case u.MAX:if(l&&i.value){const t=e.group.totals[r],l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(i.value&&V.ketchup.objects.isDate(i.obj)&&V.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(V.ketchup.dates.toDayjs(t)),e.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.max(l),F.ISO_DATE)}else e.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);let l=e.group.parent;for(;null!=l;){const e=l.group.totals[r];if(e){let t=[];t.push(a),t.push(V.ketchup.dates.toDayjs(e)),l.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else l.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);l=l.group.parent}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(p,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>_(e,r,l)))}(a,n,c),N(a,u.AVERAGE,n),N(a,u.MATH,n),a}function N(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>A(e,t,r,l)))}function _(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{_(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function A(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=A(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=e.group.totals[l]/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=V.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function D(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function S(e=[],t={}){if(V.ketchup.objects.isEmptyJsObject(e)||V.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,s,o)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=V.ketchup.objects.isNumber(a.obj)?V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(V.ketchup.objects.isNumber(a.obj)){const e=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+V.ketchup.math.numberify(r)}}else if(V.ketchup.objects.isDate(a.obj)&&(-1==r.indexOf(l)&&r.push(l),V.ketchup.dates.isValidFormattedStringDate(a.value))){const e=V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(a.value)),r=n[l]?V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(r){let t=[];t.push(e),t.push(r),n[l]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else n[l]=V.ketchup.dates.format(e,F.ISO_DATE);break;case t[l]===u.MAX:if(r){let t=[];t.push(e),t.push(r),n[l]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else n[l]=V.ketchup.dates.format(e,F.ISO_DATE)}}s===o.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=V.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=V.ketchup.dates.format(n[i]):V.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function W(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function E(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let s=[];return L(e,s,r,Number(l),0),s}function L(e,t,l,n,r){let i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=$(e[s]);if(null!=o.group&&null!=o.group.children&&o.group.children.length>0){a.group.children=[];let e=L(o.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function $(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:q(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function R(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=$(e[l]);return t}function q(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:R(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function z(e,t,l=!1){const n={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const r of t.rows){const t={cells:{},id:r.id};for(const l of n.columns){const n=l.name,i=r.cells[n],s=e.rows.find((e=>e.id===r.id)),o=s?s.cells[n]:null;(!o&&i.value||o&&i.value!==o.value)&&(t.cells[n]=i)}(Object.keys(t.cells).length>0||l)&&n.rows.push(t)}return n}function J(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var l;let n=e.cells[t];const r=n.value,i=n.options;n.isEditable=null!==(l=n.isEditable)&&void 0!==l?l:n.editable;const s={[f.AUTOCOMPLETE]:()=>h(r,"",i),[f.COMBOBOX]:()=>h(r,"",i),[f.RADIO]:()=>d(r,i),[f.CHECKBOX]:()=>b(r,""),[f.CHIP]:()=>p(r),[f.SWITCH]:()=>m(r,"")}[n.shape];s?n.data=s():n.shape&&V.ketchup.debug.logMessage("kup-data",`Shape specified ${n.shape} in cell ${JSON.stringify(n)} unsupported`,c.WARNING)}))}))}export{x as F,g as K,O as a,M as b,S as c,J as d,w as e,B as f,z as g,D as n,E as p,C as s,T as t}
|
|
1
|
+
import{C as e,H as t,D as l,B as n,ag as r,v as i,x as s,ak as o,al as a,J as u,e as c,F as f,ac as h,ab as d,am as b,an as p,ao as m,a1 as v}from"./p-391f53b3.js";import{K as F}from"./p-5ba08261.js";class x extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),s=this.getIntervalTextFieldFilterValues(e,r),o=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=s[t.FROM]&&(u+=a+"(>= "+l(s[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=s[t.TO]&&(u+=a+"(<= "+l(s[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return o.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var w;!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."}(w||(w={}));const T="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,y=k.ketchup?k.ketchup.objects:new s,j=k.ketchup?k.ketchup.data:new o;class O extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,s=[],o){if(n){let t=!0;if(s&&null!=s&&s.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<s.length;i++){if(0==s[i].visible)continue;const o=e[s[i].name];if(null==o)continue;t=this.isFilterCompliantForValue(o.value,l);let a=r(s[i],o);if(a!=o.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==o&&(o=new x),!this.hasFilters(t,s,o))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=o.getTextFilterValue(t,n),c=o.getIntervalTextFieldFilterValues(t,i(s,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(y.isNumber(r.obj)||y.isDate(r.obj)||y.isTime(r.obj)||y.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let b=o.getCheckBoxFilterValues(t,n);if(0==b.length)continue;let p=!1;for(let e=0;e<b.length;e++){let t=b[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){p=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){p=!0;break}}}if(!p)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new x);for(let r=0;r<n.length;r++){let s=n[r],o=null;if(o=s===T?{name:T,title:""}:i(t,s),l.hasFiltersForColumn(e,o))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const s=!(!l||!n);if(this.hasFilters(t,n,r)||s)for(let o=0;o<e.length;o++){let a=e[o];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,s,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let s=new Array;null==i&&(i=new x);let o=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==o||i.isFilterCompliantForSimpleValue(r,n.obj,o,a))&&s.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),s;let c=Object.assign({},t.filters);c[n.name]={textField:o,textFieldTmp:o,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)s.push(u[e]);return j.cell.getUnivocalValue({rows:f},n,!0)}}const V=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:v.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=I(e,n,t[l]);if(0!==r)return r}return 0}return I(e,n,t[0])}))}function I(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function B(e=[],t={},l="",n=[],r,i){return null==i&&(i=new O),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const s={},o=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return s[l]=n,!0;return!1}));if(0===o.length)return t;const a=[];let c={};return t.forEach((t=>{const l=o[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),b=f.value;let p=null;for(let e of a)if(e.group.label===d){p=e;break}null===p&&(p={group:{id:b,parent:null,column:l,columnLabel:s[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(p));for(let l=1;l<o.length;l++){const n=o[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),o=a.value;let u=null;for(let e=0;e<p.group.children.length;e++){const t=p.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:o,parent:p,column:n.column,columnLabel:s[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},W(u),p.group.children.push(u)),p=u}}p.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=l.cells[r];if(i){const l=V.ketchup.objects.isNumber(i.obj),s=t[r];switch(s){case u.COUNT:let t=e.group.totals[r]||0;e.group.totals[r]=++t;let o=e.group.parent;for(;null!=o;){let e=o.group.totals[r]||0;o.group.totals[r]=++e,o=o.group.parent}break;case u.DISTINCT:let a;if(a=l?V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value)):i.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l&&i.value){const t=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t+(e.group.totals[r]||0);let l=e.group.parent;for(;null!=l;){const e=V.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l&&i.value){const t=e.group.totals[r],l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(i.value&&V.ketchup.objects.isDate(i.obj)&&V.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(V.ketchup.dates.toDayjs(t)),e.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.min(l),F.ISO_DATE)}else e.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);let l=e.group.parent;for(;null!=l;){const e=l.group.totals[r];if(e){let t=[];t.push(a),t.push(V.ketchup.dates.toDayjs(e)),l.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else l.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);l=l.group.parent}}break;case u.MAX:if(l&&i.value){const t=e.group.totals[r],l=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(i.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(i.value&&V.ketchup.objects.isDate(i.obj)&&V.ketchup.dates.isValidFormattedStringDate(i.value)){const t=e.group.totals[r];if(t){let l=[];l.push(a),l.push(V.ketchup.dates.toDayjs(t)),e.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.max(l),F.ISO_DATE)}else e.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);let l=e.group.parent;for(;null!=l;){const e=l.group.totals[r];if(e){let t=[];t.push(a),t.push(V.ketchup.dates.toDayjs(e)),l.group.totals[r]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else l.group.totals[r]=V.ketchup.dates.format(a,F.ISO_DATE);l=l.group.parent}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(p,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>_(e,r,l)))}(a,n,c),N(a,u.AVERAGE,n),N(a,u.MATH,n),a}function N(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>A(e,t,r,l)))}function _(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{_(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function A(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=A(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=e.group.totals[l]/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=V.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function D(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function S(e=[],t={}){if(V.ketchup.objects.isEmptyJsObject(e)||V.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,s,o)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=V.ketchup.objects.isNumber(a.obj)?V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(V.ketchup.objects.isNumber(a.obj)){const e=V.ketchup.math.numberify(V.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+V.ketchup.math.numberify(r)}}else if(V.ketchup.objects.isDate(a.obj)&&(-1==r.indexOf(l)&&r.push(l),V.ketchup.dates.isValidFormattedStringDate(a.value))){const e=V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(a.value)),r=n[l]?V.ketchup.dates.toDate(V.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(r){let t=[];t.push(e),t.push(r),n[l]=V.ketchup.dates.format(V.ketchup.dates.min(t),F.ISO_DATE)}else n[l]=V.ketchup.dates.format(e,F.ISO_DATE);break;case t[l]===u.MAX:if(r){let t=[];t.push(e),t.push(r),n[l]=V.ketchup.dates.format(V.ketchup.dates.max(t),F.ISO_DATE)}else n[l]=V.ketchup.dates.format(e,F.ISO_DATE)}}s===o.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=V.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=V.ketchup.dates.format(n[i]):V.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function W(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function E(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let s=[];return L(e,s,r,Number(l),0),s}function L(e,t,l,n,r){let i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=$(e[s]);if(null!=o.group&&null!=o.group.children&&o.group.children.length>0){a.group.children=[];let e=L(o.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function $(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:q(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function R(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=$(e[l]);return t}function q(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:R(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function z(e,t,l=!1){const n={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const r of t.rows){const t={cells:{},id:r.id};for(const l of n.columns){const n=l.name,i=r.cells[n],s=e.rows.find((e=>e.id===r.id)),o=s?s.cells[n]:null;(!o&&i.value||o&&i.value!==o.value)&&(t.cells[n]=i)}(Object.keys(t.cells).length>0||l)&&n.rows.push(t)}return n}function J(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var l;let n=e.cells[t];const r=n.value,i=n.options;n.isEditable=null!==(l=n.isEditable)&&void 0!==l?l:n.editable;const s={[f.AUTOCOMPLETE]:()=>h(r,"",i),[f.COMBOBOX]:()=>h(r,"",i),[f.RADIO]:()=>d(r,i),[f.CHECKBOX]:()=>b(r,""),[f.CHIP]:()=>p(r),[f.SWITCH]:()=>m(r,"")}[n.shape];s?n.data=s():n.shape&&V.ketchup.debug.logMessage("kup-data",`Shape specified ${n.shape} in cell ${JSON.stringify(n)} unsupported`,c.WARNING)}))}))}export{x as F,g as K,O as a,M as b,S as c,J as d,w as e,B as f,z as g,D as n,E as p,C as s,T as t}
|