@sme.up/ketchup 11.0.0-SNAPSHOT-20241023092659 → 11.0.0-SNAPSHOT-20241023100903

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.
Files changed (44) hide show
  1. package/dist/cjs/{f-cell-c5a85032.js → f-cell-c069517c.js} +2 -1
  2. package/dist/cjs/f-cell-c069517c.js.map +1 -0
  3. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +1 -1
  4. package/dist/cjs/kup-box.cjs.entry.js +1 -1
  5. package/dist/cjs/kup-cell.cjs.entry.js +1 -64
  6. package/dist/cjs/kup-cell.cjs.entry.js.map +1 -1
  7. package/dist/cjs/kup-image-list.cjs.entry.js +1 -1
  8. package/dist/cjs/kup-input-panel.cjs.entry.js +1 -1
  9. package/dist/collection/f-components/f-cell/f-cell.js +1 -0
  10. package/dist/collection/f-components/f-cell/f-cell.js.map +1 -1
  11. package/dist/collection/f-components/f-cell-options.tsx/f-cell-options.js +0 -37
  12. package/dist/collection/f-components/f-cell-options.tsx/f-cell-options.js.map +1 -1
  13. package/dist/components/kup-autocomplete2.js +1 -0
  14. package/dist/components/kup-autocomplete2.js.map +1 -1
  15. package/dist/components/kup-cell.js +0 -63
  16. package/dist/components/kup-cell.js.map +1 -1
  17. package/dist/esm/{f-cell-aea93e3a.js → f-cell-5c7183a7.js} +2 -1
  18. package/dist/esm/f-cell-5c7183a7.js.map +1 -0
  19. package/dist/esm/kup-autocomplete_27.entry.js +1 -1
  20. package/dist/esm/kup-box.entry.js +1 -1
  21. package/dist/esm/kup-cell.entry.js +1 -64
  22. package/dist/esm/kup-cell.entry.js.map +1 -1
  23. package/dist/esm/kup-image-list.entry.js +1 -1
  24. package/dist/esm/kup-input-panel.entry.js +1 -1
  25. package/dist/ketchup/ketchup.esm.js +1 -1
  26. package/dist/ketchup/{p-e01cb12b.entry.js → p-3c321e45.entry.js} +2 -2
  27. package/dist/ketchup/{p-44b6390c.entry.js → p-4be79a7c.entry.js} +2 -2
  28. package/dist/ketchup/{p-3edff8e7.entry.js → p-6f0164d2.entry.js} +2 -2
  29. package/dist/ketchup/p-721b6a3c.js +2 -0
  30. package/dist/ketchup/p-721b6a3c.js.map +1 -0
  31. package/dist/ketchup/{p-c7dfed3a.entry.js → p-cfaab419.entry.js} +2 -2
  32. package/dist/ketchup/p-d5ab3ae8.entry.js +2 -0
  33. package/dist/ketchup/p-d5ab3ae8.entry.js.map +1 -0
  34. package/package.json +1 -1
  35. package/dist/cjs/f-cell-c5a85032.js.map +0 -1
  36. package/dist/esm/f-cell-aea93e3a.js.map +0 -1
  37. package/dist/ketchup/p-9394a966.entry.js +0 -2
  38. package/dist/ketchup/p-9394a966.entry.js.map +0 -1
  39. package/dist/ketchup/p-bbdf4a8f.js +0 -2
  40. package/dist/ketchup/p-bbdf4a8f.js.map +0 -1
  41. /package/dist/ketchup/{p-e01cb12b.entry.js.map → p-3c321e45.entry.js.map} +0 -0
  42. /package/dist/ketchup/{p-44b6390c.entry.js.map → p-4be79a7c.entry.js.map} +0 -0
  43. /package/dist/ketchup/{p-3edff8e7.entry.js.map → p-6f0164d2.entry.js.map} +0 -0
  44. /package/dist/ketchup/{p-c7dfed3a.entry.js.map → p-cfaab419.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,f as i,h as o,H as s,d as n}from"./p-d7c15b0e.js";import{k as r,y as a,g as l,s as h,a1 as c,v as p,h as u,b as d,e as f,N as b,R as x,ar as g,V as m,E as k}from"./p-8c07fd42.js";import{f as w,p as v,s as y}from"./p-802a4e44.js";import{F as _}from"./p-2b519589.js";import{c as j}from"./p-df06309a.js";import{c as C}from"./p-635bb4b3.js";import{F as z}from"./p-bbdf4a8f.js";import{p as P,r as M,F as R}from"./p-544eca9d.js";import{F as A}from"./p-c4054aba.js";import"./p-029c7cbe.js";import"./p-5d03c077.js";import"./p-1754ee9b.js";import"./p-cc32b7a2.js";import"./p-e3062c19.js";import"./p-d4a879fc.js";var I;(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={}));var E;(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=false;this.loadMoreLimit=1e3;this.showLoadMore=false}toDebugString(){return"box state"}}const O=".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)}";const D=O;var W=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:e.get(t)};var B=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,o,s){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i};var T,$,L,F,H,N,G,V,q;const K=class{constructor(i){t(this,i);this.kupBoxClick=e(this,"kup-box-click",6);this.kupBoxSelected=e(this,"kup-box-selected",6);this.kupAutoBoxSelect=e(this,"kup-box-autoselect",6);this.kupRowActionMenuClick=e(this,"kup-box-rowactionmenuclick",6);this.kupRowActionClick=e(this,"kup-box-rowactionclick",6);this.kupDidLoad=e(this,"kup-box-didload",6);this.kupDidUnload=e(this,"kup-box-didunload",6);this.kupBoxContextMenu=e(this,"kup-box-contextmenu",6);this.kupLoadMoreClick=e(this,"kup-box-loadmoreclick",6);T.add(this);this.state=new S;this.kupManager=r();this.visibleColumns=[];this.rows=[];this.filteredRows=[];this.sectionRef=null;this.rowsRefs=[];this.hold=false;this.interactableDrag=[];this.interactableDrop=[];this.interactableTouch=[];$.set(this,undefined);L.set(this,[]);F.set(this,0);H.set(this,0);N.set(this,0);this.collapsedSection={};this.selectedRows=[];this.rowActionMenuOpened=undefined;this.currentPage=1;this.currentRowsPerPage=10;this.cardData=null;this.columns=1;this.customStyle="";this.data=null;this.dragEnabled=false;this.dropEnabled=false;this.dropOnSection=false;this.editableData=false;this.enableRowActions=false;this.globalFilter=false;this.globalFilterValue="";this.kanban=null;this.layout=undefined;this.lazyLoadRows=false;this.loadMoreLimit=1e3;this.loadMoreMode=E.PROGRESSIVE_THRESHOLD;this.loadMoreStep=60;this.multiSelection=false;this.pageSelected=1;this.pagination=false;this.rowsPerPage=undefined;this.scrollOnHover=false;this.selectBox=undefined;this.selectedRowsState=undefined;this.showLoadMore=false;this.showSelection=true;this.sortBy=undefined;this.sortEnabled=false;this.stateId="";this.store=undefined;this.swipeDisabled=false}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);if(t!=null){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=false;if(!this.kupManager.objects.deepEqual(this.state.sortBy,this.sortBy)){this.state.sortBy=this.sortBy;t=true}if(!this.kupManager.objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)){this.state.globalFilterValue=this.globalFilterValue;t=true}if(!this.kupManager.objects.deepEqual(this.state.pageSelected,this.currentPage)){this.state.pageSelected=this.currentPage;t=true}if(!this.kupManager.objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)){this.state.rowsPerPage=this.currentRowsPerPage;t=true}const e=this.selectedRows.reduce(((t,e,i)=>{const o=i>0?";":"";return t+o+e.id}),"");if(!this.kupManager.objects.deepEqual(this.state.selectedRowsState,e)){this.state.selectedRowsState=e;t=true}if(!this.kupManager.objects.deepEqual(this.state.loadMoreLimit,this.loadMoreLimit)){this.state.loadMoreLimit=this.loadMoreLimit;t=true}if(!this.kupManager.objects.deepEqual(this.state.showLoadMore,this.showLoadMore)){this.state.showLoadMore=this.showLoadMore;t=true}if(!this.state.load){this.state.load=true;return}if(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 l(this,I,t)}async loadRowActions(t,e){t.actions=e;this.rowActionMenuOpened=t}async refresh(){i(this)}async setProps(t){h(this,I,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:undefined}]}initVisibleColumns(){this.visibleColumns=this.getColumns().filter((t=>{if(t.hasOwnProperty("visible")){return t.visible}return true}))}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows();if(this.globalFilter&&this.globalFilterValue){this.filteredRows=w(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)}this.rows=this.sortRows(this.filteredRows);if(this.pagination){this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,false)}}sortRows(t){let e=t;if(this.sortBy){e=y(e,this.toSortObjectList())}return e}toSortObjectList(){const t=this.sortBy.split("|").map((t=>{const e=t.split(",");const i={column:e[0],sortMode:e.length>1?c[e[1]]:c.A};return i}));return t}checkScrollOnHover(){if(this.boxContainer){if(!this.kupManager.scrollOnHover.isRegistered(this.boxContainer)){if(this.scrollOnHover){this.kupManager.scrollOnHover.register(this.boxContainer)}}else{if(!this.scrollOnHover){this.kupManager.scrollOnHover.unregister(this.boxContainer)}}}}checkLayout(){if(this.layout){this.boxLayout=this.layout;return}const t={horizontal:false,sections:[]};const e=this.visibleColumns;let i=e.length;let o=[];let s=0;while(i-- >0){o.push({column:e[s++].name})}t.content=o;this.boxLayout={sections:[t]}}onSortChange(t){let e=p(this.visibleColumns,t.detail.value);this.sortBy=e.name}onGlobalFilterChange({detail:t}){let e="";if(t&&t.value){e=t.value}this.globalFilterValue=e}isSectionExpanded(t,e){if(!t.id||!e.id){return false}return this.collapsedSection[e.id]&&this.collapsedSection[e.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,e){let i=null;let o=null;let s=null;let n=null;if(t){for(let e=t.length-1;e>=0;e--){let o=t[e];if(!o.tagName){continue}switch(o.tagName.toUpperCase()){default:{if(o.classList.contains("box-object")){i=o}if(!s&&o["data-row"]){s=o["data-row"]}break}}}}if(i){if(i.classList.contains("f-cell")){const t=i["kup-get-cell-props"]();o=t.cell;n=t.column;s=t.row}else{o=i["data-cell"];s=i["data-row"];n=p(this.visibleColumns,i.dataset.column)}}return{boxObject:i?i:null,column:n?n:null,cell:o?o:null,originalEvent:e,row:s?s:null}}clickHandler(t){const e=this.getEventDetails(this.kupManager.getEventPath(t.target,this.rootElement),t);if(e.row){if(this.multiSelection){this.onSelectionCheckChange(e.row)}else{this.selectedRows=[e.row]}}return e}contextMenuHandler(t){const e=this.getEventDetails(this.kupManager.getEventPath(t.target,this.rootElement),t);return e}checkIfElementIsActionMenuIcon(t){if(t.tagName&&t.parentElement){return t.tagName==="svg"&&t.parentElement.classList.contains("row-actions-toggler")}return false}onSelectionCheckChange(t){var e=-1;for(let i=0;i<this.selectedRows.length;i++){const o=this.selectedRows[i];if(o.id===t.id){e=i;break}}if(e>=0){this.selectedRows.splice(e,1);this.selectedRows=[...this.selectedRows]}else{this.selectedRows=[...this.selectedRows,t]}this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,e){if(!e.id){console.error("cannot expand / collapse a section withoun an ID");return}if(!t.id){console.error("cannot expand / collapse a section of a row without ad id");return}if(!this.collapsedSection[e.id]){this.collapsedSection[e.id]={};this.collapsedSection[e.id][t.id]=true}else{const i=this.collapsedSection[e.id];if(!i[t.id]){i[t.id]=true}else{i[t.id]=!i[t.id]}}this.collapsedSection=Object.assign({},this.collapsedSection)}onRowAction(t){if(!t){return}if(t===this.rowActionMenuOpened){this.rowActionMenuOpened=null;return}if(t.actions){this.rowActionMenuOpened=t}else{this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t})}}onRowActionClick(t,e,i){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:e,index:i})}clickFunction(t){try{const e=t.composedPath();for(let t of e){if(this.checkIfElementIsActionMenuIcon(t)){return}}}catch(e){if(this.checkIfElementIsActionMenuIcon(t.target)){return}}this.rowActionMenuOpened=null}handlePageChange(t){const e=P(t,this.filteredRows.length,this.currentRowsPerPage);if(e){this.currentPage=e}}handleRowsPerPageChange(t){const e=M(t,this.filteredRows.length);if(e){this.currentRowsPerPage=e;this.adjustPaginator()}}adjustPaginator(){const t=this.rows.length;const e=Math.ceil(t/this.currentRowsPerPage);if(this.currentPage>e){this.currentPage=1}}renderSectionAsCard(t){let e=false;const i={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let e=0;e<this.data.columns.length;e++){const o=this.data.columns[e];if(o.visible!==false){i.cell.push(t.cells[o.name]);i.columns.push(o)}}for(const e in t.cells){if(t.cells.hasOwnProperty(e)){const o=t.cells[e];if(o.cardID!==undefined&&o.obj){switch(o.obj.p){case"BTN":do{i.button.push({})}while(i.button.length<o.cardID);i.button[o.cardID]={label:o.value};break;case"IMG":do{i.image.push({})}while(i.image.length<o.cardID);i.image[o.cardID]={resource:o.value};break;case"PGB":do{i.progressbar.push({})}while(i.progressbar.length<o.cardID);i.progressbar[o.cardID]={value:o.value};break;default:do{i.text.push("")}while(i.text.length<o.cardID);i.text[o.cardID]=o.value;break}}}}for(const o in t.cells){if(t.cells.hasOwnProperty(o)){const s=t.cells[o];if(s.cardID===undefined&&s.obj){e=false;switch(s.obj.p){case"BTN":for(let t=0;t<i.button.length;t++){if(!Object.keys(i.button[t]).length){i.button[t]={label:s.value};e=true;break}}if(!e){i.button.push({label:s.value})}break;case"IMG":for(let t=0;t<i.image.length;t++){if(!Object.keys(i.image[t]).length){i.image[t]={resource:s.value};e=true;break}}if(!e){i.image.push({resource:s.value})}break;case"PGB":for(let t=0;t<i.progressbar.length;t++){if(!Object.keys(i.progressbar[t]).length){i.progressbar[t]={value:s.value};e=true;break}}if(!e){i.progressbar.push({value:s.value})}break;default:for(let t=0;t<i.text.length;t++){if(i.text[t]===""){i.text[t]=s.value;e=true;break}}if(!e){i.text.push(s.value)}break}}}}return o("kup-card",Object.assign({data:i},this.cardData))}renderRow(t){const e=[...this.visibleColumns];let i=null;let s=t.layout;if(!s){s=this.boxLayout}let n=false;if(s){if(s.horizontal){n=true}const o=s.sections;let r=o.length;let a=0;if(r>0){i=[]}const l={horizontal:n};while(r-- >0){if(this.cardData!==null&&this.cardData!==undefined&&typeof this.cardData==="object"){i.push(this.renderSectionAsCard(t))}else{i.push(this.renderSection(o[a++],l,t,e))}}}var r=false;for(let e of this.selectedRows){if(e.id===t.id){r=true}}let a=null;if(this.multiSelection){a=o("div",{class:"box-selection"},o("kup-checkbox",{checked:r}))}let l=null;if(this.enableRowActions&&!this.swipeDisabled){const e={"row-action-menu":true,open:t===this.rowActionMenuOpened};let i=null;if(t.actions){const e=t.actions.map(((e,i)=>{const s=`icon ${e.icon}`;return o("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,e,i)},o("div",{class:s}),o("div",{class:"text"},e.text))}));i=o("ul",null,e)}l=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:e},i)))}let h=null;if(t.badgeData&&t.badgeData.length>0){h=t.badgeData.map((t=>o("kup-badge",{text:t.text,class:t["className"]?`centered ${t["className"]}`:"centered",imageData:t.imageData})))}const c={box:true,draggable:this.dragEnabled,selected:this.showSelection&&r,column:!n};const p=t.style||{};return o("div",{class:"box-wrapper",style:p,ref:t=>{if(t){W(this,L,"f").push(t)}}},o("div",{class:c,"data-row":t,ref:t=>this.rowsRefs.push(t)},a,i,h),l)}renderSection(t,e,i,s){let n=null;if(t.sections&&t.sections.length>0){const e=t.sections;let o=e.length;let r=0;if(o>0){n=[]}while(o-- >0){n.push(this.renderSection(e[r++],t,i,s))}}else if(t.content){const e=t.content;let o=e.length;let r=0;if(o>0){n=[]}while(o-- >0){n.push(this.renderBoxObject({boxObject:e[r++],row:i,visibleColumns:s},true))}}else if(s.length>0){const t=s[0];n=this.renderBoxObject({boxObject:{column:t.name},row:i,visibleColumns:s})}const r=this.isSectionExpanded(i,t);const a=!!t.columns;const l={"box-section":true,open:r,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||t.sections.length===0};const h=t.style||{};if(t.dim&&e){h.flex=`0 0 ${t.dim}`;h.overflow="hidden";if(e.horizontal){h.maxWidth=t.dim}else{h.maxHeight=t.dim}}if(a){h["grid-template-columns"]=`repeat(${t.columns}, 1fr)`}let c=null;if(t.collapsible){l["collapse-section"]=true;const e={content:true};let s="";if(t.title){s=t.title}else if(r){s=this.kupManager.language.translate(u.COLLAPSE)}else{s=this.kupManager.language.translate(u.EXPAND)}c=o("div",{class:l,style:h},o("div",{class:e},n),o("div",{class:"header",role:"button",onClick:e=>{e.stopPropagation();this.toggleSectionExpand(i,t)}},o("div",{class:"header-content"},o("span",null,s),o(_,{resource:`${d.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:r?"toggled":""}))))}else{const e=t.title?o("h3",null,t.title):null;c=o("div",{class:l,style:h},e,n)}return c}renderBoxObject({boxObject:t,row:e,visibleColumns:i},s){const n={"box-object":true};const r={};let a=null;let l=-1;for(let e=0;e<i.length;e++){const o=i[e];if(o.name===t.column){l=e;break}}if(l>=0){a=i[l];i.splice(l,1)}else if(s){a=this.data.columns.find((e=>e.name===t.column))}const h=e.cells[t.column];let c=undefined;if(h&&!this.kupManager.objects.isEmptyKupObj(h.obj)){n["is-obj"]=true;if(this.kupManager.debug.isDebug()){c=h.obj.t+"; "+h.obj.p+"; "+h.obj.k+";"}}const p={cell:h,column:a,component:this,editable:this.editableData,renderKup:true,row:e,setSizes:true,shape:t.shape};return o("div",{"data-cell":h,"data-row":e,"data-column":t.column,class:n,style:r,title:c},h&&a?o(z,Object.assign({},p)):o("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||this.kanban.columns.length===0){this.kupManager.debug.logMessage(this,"No columns to group by detected.",f.ERROR);return{jsx:o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(u.EMPTY_DATA)),style:{"grid-template-columns":`repeat(1, 1fr)`}}}const t=[];if(this.kanban.labels){for(let e=0;e<this.kanban.labels.length;e++){const i=this.kanban.labels[e];t.push({labels:i,nodes:[]})}}for(let e=0;e<this.rows.length;e++){let i=[];for(let t=0;t<this.kanban.columns.length;t++){try{i.push(this.rows[e].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,f.WARNING)}}const o={found:false,index:null};for(let e=0;e<t.length;e++){let s=t[e].labels;let n=true;for(let t=0;t<s.length;t++){if(i[t]!==s[t]){n=false;break}}if(n){o.found=true;o.index=e;break}}if(o.found){t[o.index].nodes.push(this.renderRow(this.rows[e]))}else{t.push({labels:i,nodes:[this.renderRow(this.rows[e])]})}}const e=[];for(let i=0;i<t.length;i++){const s=t[i].labels;const n={data:[]};for(let t=0;t<s.length;t++){n.data.push({value:s[t],id:s[t]})}e.push(o("div",{class:"kanban-section"},o(j,Object.assign({},n)),t[i].nodes))}return{jsx:e,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);const t=t=>{var e;if(this.hold){this.hold=false;return}switch(t.button){case 0:const i={};for(const e in t){i[e]=t[e]}const o=this.clickHandler(i);this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o.row,column:(e=o.column)===null||e===void 0?void 0:e.name});break;case 2:this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)});break}};const e=t=>{if(t.pointerType==="pen"||t.pointerType==="touch"){this.hold=true;this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})}};this.kupManager.interact.on(this.boxContainer,b.TAP,t);this.kupManager.interact.on(this.boxContainer,b.HOLD,e)}didRenderInteractables(){if(this.dragEnabled){for(let t=0;t<this.rowsRefs.length;t++){const e=this.rowsRefs[t];const i=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:p(this.visibleColumns,t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};if(e&&!this.interactableDrag.includes(e)){this.interactableDrag.push(e);this.kupManager.interact.draggable(e,{allowFrom:".box-object",cursorChecker(){return null}},{callback:i},x.BADGE)}}}if(this.dropEnabled){const t=()=>{const t=this.rootElement.shadowRoot.querySelector(".box:hover");if(!t){this.kupManager.debug.logMessage(this,"Couldn't find cell hovered to retrieve dropzone informations!",f.WARNING);return}const e=this.kupManager.getEventPath(t,this.rootElement);const i=this.getEventDetails(e);return{cell:i.cell,column:i.column,id:this.rootElement.id,row:i.row}};if(!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 e=0;e<this.rowsRefs.length;e++){const i=this.rowsRefs[e];if(i&&!this.interactableDrop.includes(i)){this.interactableDrop.push(i);this.kupManager.interact.dropzone(i,{accept:`[${g}]`},{callback:t,dispatcher:this.rootElement,type:m.BOX})}}}}componentWillLoad(){this.kupManager.debug.logLoad(this,false);if(this.rowsPerPage){this.currentRowsPerPage=this.rowsPerPage}if(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();if(document.querySelector(".header")){B(this,F,document.querySelector(".header").clientHeight,"f")}else{B(this,F,0,"f")}if(document.querySelector(".topbar")){B(this,F,W(this,F,"f")+document.querySelector(".topbar").clientHeight,"f")}W(this,T,"m",V).call(this)}componentDidLoad(){this.handleAutomaticBoxSelection();document.addEventListener("click",this.clickFunction.bind(this));this.currentPage=this.pageSelected;if(this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((e=>t.indexOf(e.id)>=0))}this.didLoadInteractables();this.kupDidLoad.emit({comp:this,id:this.rootElement.id});this.kupManager.debug.logLoad(this,true)}componentWillRender(){this.kupManager.debug.logRender(this,false)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const e=t.querySelectorAll(".f-text-field");for(let t=0;t<e.length;t++){A(e[t])}}this.checkScrollOnHover();this.persistState();this.didRenderInteractables();W(this,T,"m",G).call(this);this.kupManager.debug.logRender(this,true)}render(){B(this,L,[],"f");const t=!!(typeof this.kanban==="object"&&this.kanban!==null);let e=null;if(this.sortEnabled){const t=this.visibleColumns.map((t=>{const e={value:t.title,id:t.name,selected:t.name===this.sortBy};return e}));const i=[{value:"",id:""},...t];let s={label:this.kupManager.language.translate(u.SORT_BY),trailingIcon:true};let n={data:i,selectable:true};let r={"kup-text-field":s,"kup-list":n};e=o("div",{id:"sort-panel"},o("kup-combobox",{data:r,initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let i=null;if(this.globalFilter){i=o("div",{id:"global-filter"},o("kup-text-field",{fullWidth:true,label:this.kupManager.language.translate(k.SEARCH),icon:d.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout);this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}}))}let n=null;if(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?()=>{W(this,T,"m",q).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;let a={};if(this.rows.length===0){r=o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(u.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 e=t.length;let i=0;r=[];while(e-- >0){r.push(this.renderRow(t[i++]))}}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},e,i,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);if(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"]}}};$=new WeakMap,L=new WeakMap,F=new WeakMap,H=new WeakMap,N=new WeakMap,T=new WeakSet,G=function t(){if(this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length){W(this,$,"f").observe(W(this,L,"f")[W(this,L,"f").length-1])}},V=function t(){const e=t=>{t.forEach((t=>{if(t.isIntersecting){this.kupManager.debug.logMessage(this,"Last row entering the viewport, loading more elements.");const e=this.data.rows.length-this.currentRowsPerPage;if(e<this.loadMoreStep){this.currentRowsPerPage+=e}else{this.currentRowsPerPage+=this.loadMoreStep}t.target.classList.remove("last-row");W(this,$,"f").unobserve(t.target)}}))};const i={threshold:0,rootMargin:"-"+W(this,F,"f")+"px 0px 0px 0px"};B(this,$,new IntersectionObserver(e,i),"f")},q=function t(){var e;let i=0;switch(this.loadMoreMode){case E.CONSTANT:i=this.loadMoreStep;break;case E.CONSTANT_INCREMENT:i=this.loadMoreStep*(W(this,H,"f")+1);break;case E.PROGRESSIVE_THRESHOLD:i=Math.max(W(this,N,"f"),this.loadMoreStep)*Math.min(W(this,H,"f")+1,2);break}if(i>this.loadMoreLimit){i=this.loadMoreLimit}this.kupLoadMoreClick.emit({comp:this,id:this.rootElement.id,loadItems:i});B(this,N,i,"f");B(this,H,(e=W(this,H,"f"),e++,e),"f")};K.style=D;export{K as kup_box};
2
- //# sourceMappingURL=p-e01cb12b.entry.js.map
1
+ import{r as t,c as e,f as i,h as o,H as s,d as n}from"./p-d7c15b0e.js";import{k as r,y as a,g as l,s as h,a1 as c,v as p,h as u,b as d,e as f,N as b,R as x,ar as g,V as m,E as k}from"./p-8c07fd42.js";import{f as w,p as v,s as y}from"./p-802a4e44.js";import{F as _}from"./p-2b519589.js";import{c as j}from"./p-df06309a.js";import{c as C}from"./p-635bb4b3.js";import{F as z}from"./p-721b6a3c.js";import{p as P,r as M,F as R}from"./p-544eca9d.js";import{F as A}from"./p-c4054aba.js";import"./p-029c7cbe.js";import"./p-5d03c077.js";import"./p-1754ee9b.js";import"./p-cc32b7a2.js";import"./p-e3062c19.js";import"./p-d4a879fc.js";var I;(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={}));var E;(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=false;this.loadMoreLimit=1e3;this.showLoadMore=false}toDebugString(){return"box state"}}const O=".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)}";const D=O;var W=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:e.get(t)};var B=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,o,s){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i};var T,$,L,F,H,N,G,V,q;const K=class{constructor(i){t(this,i);this.kupBoxClick=e(this,"kup-box-click",6);this.kupBoxSelected=e(this,"kup-box-selected",6);this.kupAutoBoxSelect=e(this,"kup-box-autoselect",6);this.kupRowActionMenuClick=e(this,"kup-box-rowactionmenuclick",6);this.kupRowActionClick=e(this,"kup-box-rowactionclick",6);this.kupDidLoad=e(this,"kup-box-didload",6);this.kupDidUnload=e(this,"kup-box-didunload",6);this.kupBoxContextMenu=e(this,"kup-box-contextmenu",6);this.kupLoadMoreClick=e(this,"kup-box-loadmoreclick",6);T.add(this);this.state=new S;this.kupManager=r();this.visibleColumns=[];this.rows=[];this.filteredRows=[];this.sectionRef=null;this.rowsRefs=[];this.hold=false;this.interactableDrag=[];this.interactableDrop=[];this.interactableTouch=[];$.set(this,undefined);L.set(this,[]);F.set(this,0);H.set(this,0);N.set(this,0);this.collapsedSection={};this.selectedRows=[];this.rowActionMenuOpened=undefined;this.currentPage=1;this.currentRowsPerPage=10;this.cardData=null;this.columns=1;this.customStyle="";this.data=null;this.dragEnabled=false;this.dropEnabled=false;this.dropOnSection=false;this.editableData=false;this.enableRowActions=false;this.globalFilter=false;this.globalFilterValue="";this.kanban=null;this.layout=undefined;this.lazyLoadRows=false;this.loadMoreLimit=1e3;this.loadMoreMode=E.PROGRESSIVE_THRESHOLD;this.loadMoreStep=60;this.multiSelection=false;this.pageSelected=1;this.pagination=false;this.rowsPerPage=undefined;this.scrollOnHover=false;this.selectBox=undefined;this.selectedRowsState=undefined;this.showLoadMore=false;this.showSelection=true;this.sortBy=undefined;this.sortEnabled=false;this.stateId="";this.store=undefined;this.swipeDisabled=false}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);if(t!=null){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=false;if(!this.kupManager.objects.deepEqual(this.state.sortBy,this.sortBy)){this.state.sortBy=this.sortBy;t=true}if(!this.kupManager.objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)){this.state.globalFilterValue=this.globalFilterValue;t=true}if(!this.kupManager.objects.deepEqual(this.state.pageSelected,this.currentPage)){this.state.pageSelected=this.currentPage;t=true}if(!this.kupManager.objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)){this.state.rowsPerPage=this.currentRowsPerPage;t=true}const e=this.selectedRows.reduce(((t,e,i)=>{const o=i>0?";":"";return t+o+e.id}),"");if(!this.kupManager.objects.deepEqual(this.state.selectedRowsState,e)){this.state.selectedRowsState=e;t=true}if(!this.kupManager.objects.deepEqual(this.state.loadMoreLimit,this.loadMoreLimit)){this.state.loadMoreLimit=this.loadMoreLimit;t=true}if(!this.kupManager.objects.deepEqual(this.state.showLoadMore,this.showLoadMore)){this.state.showLoadMore=this.showLoadMore;t=true}if(!this.state.load){this.state.load=true;return}if(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 l(this,I,t)}async loadRowActions(t,e){t.actions=e;this.rowActionMenuOpened=t}async refresh(){i(this)}async setProps(t){h(this,I,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:undefined}]}initVisibleColumns(){this.visibleColumns=this.getColumns().filter((t=>{if(t.hasOwnProperty("visible")){return t.visible}return true}))}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows();if(this.globalFilter&&this.globalFilterValue){this.filteredRows=w(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)}this.rows=this.sortRows(this.filteredRows);if(this.pagination){this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,false)}}sortRows(t){let e=t;if(this.sortBy){e=y(e,this.toSortObjectList())}return e}toSortObjectList(){const t=this.sortBy.split("|").map((t=>{const e=t.split(",");const i={column:e[0],sortMode:e.length>1?c[e[1]]:c.A};return i}));return t}checkScrollOnHover(){if(this.boxContainer){if(!this.kupManager.scrollOnHover.isRegistered(this.boxContainer)){if(this.scrollOnHover){this.kupManager.scrollOnHover.register(this.boxContainer)}}else{if(!this.scrollOnHover){this.kupManager.scrollOnHover.unregister(this.boxContainer)}}}}checkLayout(){if(this.layout){this.boxLayout=this.layout;return}const t={horizontal:false,sections:[]};const e=this.visibleColumns;let i=e.length;let o=[];let s=0;while(i-- >0){o.push({column:e[s++].name})}t.content=o;this.boxLayout={sections:[t]}}onSortChange(t){let e=p(this.visibleColumns,t.detail.value);this.sortBy=e.name}onGlobalFilterChange({detail:t}){let e="";if(t&&t.value){e=t.value}this.globalFilterValue=e}isSectionExpanded(t,e){if(!t.id||!e.id){return false}return this.collapsedSection[e.id]&&this.collapsedSection[e.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,e){let i=null;let o=null;let s=null;let n=null;if(t){for(let e=t.length-1;e>=0;e--){let o=t[e];if(!o.tagName){continue}switch(o.tagName.toUpperCase()){default:{if(o.classList.contains("box-object")){i=o}if(!s&&o["data-row"]){s=o["data-row"]}break}}}}if(i){if(i.classList.contains("f-cell")){const t=i["kup-get-cell-props"]();o=t.cell;n=t.column;s=t.row}else{o=i["data-cell"];s=i["data-row"];n=p(this.visibleColumns,i.dataset.column)}}return{boxObject:i?i:null,column:n?n:null,cell:o?o:null,originalEvent:e,row:s?s:null}}clickHandler(t){const e=this.getEventDetails(this.kupManager.getEventPath(t.target,this.rootElement),t);if(e.row){if(this.multiSelection){this.onSelectionCheckChange(e.row)}else{this.selectedRows=[e.row]}}return e}contextMenuHandler(t){const e=this.getEventDetails(this.kupManager.getEventPath(t.target,this.rootElement),t);return e}checkIfElementIsActionMenuIcon(t){if(t.tagName&&t.parentElement){return t.tagName==="svg"&&t.parentElement.classList.contains("row-actions-toggler")}return false}onSelectionCheckChange(t){var e=-1;for(let i=0;i<this.selectedRows.length;i++){const o=this.selectedRows[i];if(o.id===t.id){e=i;break}}if(e>=0){this.selectedRows.splice(e,1);this.selectedRows=[...this.selectedRows]}else{this.selectedRows=[...this.selectedRows,t]}this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,e){if(!e.id){console.error("cannot expand / collapse a section withoun an ID");return}if(!t.id){console.error("cannot expand / collapse a section of a row without ad id");return}if(!this.collapsedSection[e.id]){this.collapsedSection[e.id]={};this.collapsedSection[e.id][t.id]=true}else{const i=this.collapsedSection[e.id];if(!i[t.id]){i[t.id]=true}else{i[t.id]=!i[t.id]}}this.collapsedSection=Object.assign({},this.collapsedSection)}onRowAction(t){if(!t){return}if(t===this.rowActionMenuOpened){this.rowActionMenuOpened=null;return}if(t.actions){this.rowActionMenuOpened=t}else{this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t})}}onRowActionClick(t,e,i){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:e,index:i})}clickFunction(t){try{const e=t.composedPath();for(let t of e){if(this.checkIfElementIsActionMenuIcon(t)){return}}}catch(e){if(this.checkIfElementIsActionMenuIcon(t.target)){return}}this.rowActionMenuOpened=null}handlePageChange(t){const e=P(t,this.filteredRows.length,this.currentRowsPerPage);if(e){this.currentPage=e}}handleRowsPerPageChange(t){const e=M(t,this.filteredRows.length);if(e){this.currentRowsPerPage=e;this.adjustPaginator()}}adjustPaginator(){const t=this.rows.length;const e=Math.ceil(t/this.currentRowsPerPage);if(this.currentPage>e){this.currentPage=1}}renderSectionAsCard(t){let e=false;const i={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let e=0;e<this.data.columns.length;e++){const o=this.data.columns[e];if(o.visible!==false){i.cell.push(t.cells[o.name]);i.columns.push(o)}}for(const e in t.cells){if(t.cells.hasOwnProperty(e)){const o=t.cells[e];if(o.cardID!==undefined&&o.obj){switch(o.obj.p){case"BTN":do{i.button.push({})}while(i.button.length<o.cardID);i.button[o.cardID]={label:o.value};break;case"IMG":do{i.image.push({})}while(i.image.length<o.cardID);i.image[o.cardID]={resource:o.value};break;case"PGB":do{i.progressbar.push({})}while(i.progressbar.length<o.cardID);i.progressbar[o.cardID]={value:o.value};break;default:do{i.text.push("")}while(i.text.length<o.cardID);i.text[o.cardID]=o.value;break}}}}for(const o in t.cells){if(t.cells.hasOwnProperty(o)){const s=t.cells[o];if(s.cardID===undefined&&s.obj){e=false;switch(s.obj.p){case"BTN":for(let t=0;t<i.button.length;t++){if(!Object.keys(i.button[t]).length){i.button[t]={label:s.value};e=true;break}}if(!e){i.button.push({label:s.value})}break;case"IMG":for(let t=0;t<i.image.length;t++){if(!Object.keys(i.image[t]).length){i.image[t]={resource:s.value};e=true;break}}if(!e){i.image.push({resource:s.value})}break;case"PGB":for(let t=0;t<i.progressbar.length;t++){if(!Object.keys(i.progressbar[t]).length){i.progressbar[t]={value:s.value};e=true;break}}if(!e){i.progressbar.push({value:s.value})}break;default:for(let t=0;t<i.text.length;t++){if(i.text[t]===""){i.text[t]=s.value;e=true;break}}if(!e){i.text.push(s.value)}break}}}}return o("kup-card",Object.assign({data:i},this.cardData))}renderRow(t){const e=[...this.visibleColumns];let i=null;let s=t.layout;if(!s){s=this.boxLayout}let n=false;if(s){if(s.horizontal){n=true}const o=s.sections;let r=o.length;let a=0;if(r>0){i=[]}const l={horizontal:n};while(r-- >0){if(this.cardData!==null&&this.cardData!==undefined&&typeof this.cardData==="object"){i.push(this.renderSectionAsCard(t))}else{i.push(this.renderSection(o[a++],l,t,e))}}}var r=false;for(let e of this.selectedRows){if(e.id===t.id){r=true}}let a=null;if(this.multiSelection){a=o("div",{class:"box-selection"},o("kup-checkbox",{checked:r}))}let l=null;if(this.enableRowActions&&!this.swipeDisabled){const e={"row-action-menu":true,open:t===this.rowActionMenuOpened};let i=null;if(t.actions){const e=t.actions.map(((e,i)=>{const s=`icon ${e.icon}`;return o("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,e,i)},o("div",{class:s}),o("div",{class:"text"},e.text))}));i=o("ul",null,e)}l=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:e},i)))}let h=null;if(t.badgeData&&t.badgeData.length>0){h=t.badgeData.map((t=>o("kup-badge",{text:t.text,class:t["className"]?`centered ${t["className"]}`:"centered",imageData:t.imageData})))}const c={box:true,draggable:this.dragEnabled,selected:this.showSelection&&r,column:!n};const p=t.style||{};return o("div",{class:"box-wrapper",style:p,ref:t=>{if(t){W(this,L,"f").push(t)}}},o("div",{class:c,"data-row":t,ref:t=>this.rowsRefs.push(t)},a,i,h),l)}renderSection(t,e,i,s){let n=null;if(t.sections&&t.sections.length>0){const e=t.sections;let o=e.length;let r=0;if(o>0){n=[]}while(o-- >0){n.push(this.renderSection(e[r++],t,i,s))}}else if(t.content){const e=t.content;let o=e.length;let r=0;if(o>0){n=[]}while(o-- >0){n.push(this.renderBoxObject({boxObject:e[r++],row:i,visibleColumns:s},true))}}else if(s.length>0){const t=s[0];n=this.renderBoxObject({boxObject:{column:t.name},row:i,visibleColumns:s})}const r=this.isSectionExpanded(i,t);const a=!!t.columns;const l={"box-section":true,open:r,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||t.sections.length===0};const h=t.style||{};if(t.dim&&e){h.flex=`0 0 ${t.dim}`;h.overflow="hidden";if(e.horizontal){h.maxWidth=t.dim}else{h.maxHeight=t.dim}}if(a){h["grid-template-columns"]=`repeat(${t.columns}, 1fr)`}let c=null;if(t.collapsible){l["collapse-section"]=true;const e={content:true};let s="";if(t.title){s=t.title}else if(r){s=this.kupManager.language.translate(u.COLLAPSE)}else{s=this.kupManager.language.translate(u.EXPAND)}c=o("div",{class:l,style:h},o("div",{class:e},n),o("div",{class:"header",role:"button",onClick:e=>{e.stopPropagation();this.toggleSectionExpand(i,t)}},o("div",{class:"header-content"},o("span",null,s),o(_,{resource:`${d.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:r?"toggled":""}))))}else{const e=t.title?o("h3",null,t.title):null;c=o("div",{class:l,style:h},e,n)}return c}renderBoxObject({boxObject:t,row:e,visibleColumns:i},s){const n={"box-object":true};const r={};let a=null;let l=-1;for(let e=0;e<i.length;e++){const o=i[e];if(o.name===t.column){l=e;break}}if(l>=0){a=i[l];i.splice(l,1)}else if(s){a=this.data.columns.find((e=>e.name===t.column))}const h=e.cells[t.column];let c=undefined;if(h&&!this.kupManager.objects.isEmptyKupObj(h.obj)){n["is-obj"]=true;if(this.kupManager.debug.isDebug()){c=h.obj.t+"; "+h.obj.p+"; "+h.obj.k+";"}}const p={cell:h,column:a,component:this,editable:this.editableData,renderKup:true,row:e,setSizes:true,shape:t.shape};return o("div",{"data-cell":h,"data-row":e,"data-column":t.column,class:n,style:r,title:c},h&&a?o(z,Object.assign({},p)):o("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||this.kanban.columns.length===0){this.kupManager.debug.logMessage(this,"No columns to group by detected.",f.ERROR);return{jsx:o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(u.EMPTY_DATA)),style:{"grid-template-columns":`repeat(1, 1fr)`}}}const t=[];if(this.kanban.labels){for(let e=0;e<this.kanban.labels.length;e++){const i=this.kanban.labels[e];t.push({labels:i,nodes:[]})}}for(let e=0;e<this.rows.length;e++){let i=[];for(let t=0;t<this.kanban.columns.length;t++){try{i.push(this.rows[e].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,f.WARNING)}}const o={found:false,index:null};for(let e=0;e<t.length;e++){let s=t[e].labels;let n=true;for(let t=0;t<s.length;t++){if(i[t]!==s[t]){n=false;break}}if(n){o.found=true;o.index=e;break}}if(o.found){t[o.index].nodes.push(this.renderRow(this.rows[e]))}else{t.push({labels:i,nodes:[this.renderRow(this.rows[e])]})}}const e=[];for(let i=0;i<t.length;i++){const s=t[i].labels;const n={data:[]};for(let t=0;t<s.length;t++){n.data.push({value:s[t],id:s[t]})}e.push(o("div",{class:"kanban-section"},o(j,Object.assign({},n)),t[i].nodes))}return{jsx:e,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);const t=t=>{var e;if(this.hold){this.hold=false;return}switch(t.button){case 0:const i={};for(const e in t){i[e]=t[e]}const o=this.clickHandler(i);this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o.row,column:(e=o.column)===null||e===void 0?void 0:e.name});break;case 2:this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)});break}};const e=t=>{if(t.pointerType==="pen"||t.pointerType==="touch"){this.hold=true;this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})}};this.kupManager.interact.on(this.boxContainer,b.TAP,t);this.kupManager.interact.on(this.boxContainer,b.HOLD,e)}didRenderInteractables(){if(this.dragEnabled){for(let t=0;t<this.rowsRefs.length;t++){const e=this.rowsRefs[t];const i=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:p(this.visibleColumns,t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};if(e&&!this.interactableDrag.includes(e)){this.interactableDrag.push(e);this.kupManager.interact.draggable(e,{allowFrom:".box-object",cursorChecker(){return null}},{callback:i},x.BADGE)}}}if(this.dropEnabled){const t=()=>{const t=this.rootElement.shadowRoot.querySelector(".box:hover");if(!t){this.kupManager.debug.logMessage(this,"Couldn't find cell hovered to retrieve dropzone informations!",f.WARNING);return}const e=this.kupManager.getEventPath(t,this.rootElement);const i=this.getEventDetails(e);return{cell:i.cell,column:i.column,id:this.rootElement.id,row:i.row}};if(!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 e=0;e<this.rowsRefs.length;e++){const i=this.rowsRefs[e];if(i&&!this.interactableDrop.includes(i)){this.interactableDrop.push(i);this.kupManager.interact.dropzone(i,{accept:`[${g}]`},{callback:t,dispatcher:this.rootElement,type:m.BOX})}}}}componentWillLoad(){this.kupManager.debug.logLoad(this,false);if(this.rowsPerPage){this.currentRowsPerPage=this.rowsPerPage}if(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();if(document.querySelector(".header")){B(this,F,document.querySelector(".header").clientHeight,"f")}else{B(this,F,0,"f")}if(document.querySelector(".topbar")){B(this,F,W(this,F,"f")+document.querySelector(".topbar").clientHeight,"f")}W(this,T,"m",V).call(this)}componentDidLoad(){this.handleAutomaticBoxSelection();document.addEventListener("click",this.clickFunction.bind(this));this.currentPage=this.pageSelected;if(this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((e=>t.indexOf(e.id)>=0))}this.didLoadInteractables();this.kupDidLoad.emit({comp:this,id:this.rootElement.id});this.kupManager.debug.logLoad(this,true)}componentWillRender(){this.kupManager.debug.logRender(this,false)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const e=t.querySelectorAll(".f-text-field");for(let t=0;t<e.length;t++){A(e[t])}}this.checkScrollOnHover();this.persistState();this.didRenderInteractables();W(this,T,"m",G).call(this);this.kupManager.debug.logRender(this,true)}render(){B(this,L,[],"f");const t=!!(typeof this.kanban==="object"&&this.kanban!==null);let e=null;if(this.sortEnabled){const t=this.visibleColumns.map((t=>{const e={value:t.title,id:t.name,selected:t.name===this.sortBy};return e}));const i=[{value:"",id:""},...t];let s={label:this.kupManager.language.translate(u.SORT_BY),trailingIcon:true};let n={data:i,selectable:true};let r={"kup-text-field":s,"kup-list":n};e=o("div",{id:"sort-panel"},o("kup-combobox",{data:r,initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let i=null;if(this.globalFilter){i=o("div",{id:"global-filter"},o("kup-text-field",{fullWidth:true,label:this.kupManager.language.translate(k.SEARCH),icon:d.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout);this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}}))}let n=null;if(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?()=>{W(this,T,"m",q).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;let a={};if(this.rows.length===0){r=o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(u.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 e=t.length;let i=0;r=[];while(e-- >0){r.push(this.renderRow(t[i++]))}}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},e,i,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);if(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"]}}};$=new WeakMap,L=new WeakMap,F=new WeakMap,H=new WeakMap,N=new WeakMap,T=new WeakSet,G=function t(){if(this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length){W(this,$,"f").observe(W(this,L,"f")[W(this,L,"f").length-1])}},V=function t(){const e=t=>{t.forEach((t=>{if(t.isIntersecting){this.kupManager.debug.logMessage(this,"Last row entering the viewport, loading more elements.");const e=this.data.rows.length-this.currentRowsPerPage;if(e<this.loadMoreStep){this.currentRowsPerPage+=e}else{this.currentRowsPerPage+=this.loadMoreStep}t.target.classList.remove("last-row");W(this,$,"f").unobserve(t.target)}}))};const i={threshold:0,rootMargin:"-"+W(this,F,"f")+"px 0px 0px 0px"};B(this,$,new IntersectionObserver(e,i),"f")},q=function t(){var e;let i=0;switch(this.loadMoreMode){case E.CONSTANT:i=this.loadMoreStep;break;case E.CONSTANT_INCREMENT:i=this.loadMoreStep*(W(this,H,"f")+1);break;case E.PROGRESSIVE_THRESHOLD:i=Math.max(W(this,N,"f"),this.loadMoreStep)*Math.min(W(this,H,"f")+1,2);break}if(i>this.loadMoreLimit){i=this.loadMoreLimit}this.kupLoadMoreClick.emit({comp:this,id:this.rootElement.id,loadItems:i});B(this,N,i,"f");B(this,H,(e=W(this,H,"f"),e++,e),"f")};K.style=D;export{K as kup_box};
2
+ //# sourceMappingURL=p-3c321e45.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,f as i,h as n,H as s,d as o}from"./p-d7c15b0e.js";import{F as l}from"./p-cc32b7a2.js";import{F as a}from"./p-bbdf4a8f.js";import{k as r,a5 as u,F as c,g as h,s as p,h as f,al as d,ab as m,ak as b,aa as v,am as k,e as g}from"./p-8c07fd42.js";import{F as y}from"./p-c4054aba.js";import{c as _}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-2b519589.js";import"./p-5d03c077.js";import"./p-1754ee9b.js";import"./p-df06309a.js";import"./p-029c7cbe.js";import"./p-d4a879fc.js";var x;(function(t){t["TAB"]="tab"})(x||(x={}));var w;(function(t){t["customStyle"]="Custom style of the component.";t["data"]="Actual data of the input panel.";t["hiddenSubmitButton"]="Creates a hidden submit button in order to submit the form with enter.";t["submitCb"]="Sets the callback function on submit form";t["optionsHandler"]="Sets the callback function to recieve options"})(w||(w={}));const j=12;const O=22;const $=t=>{if(t==0){return j/2}if(!t){return null}if(t===1){return 1.5*j}return t*j};const z=t=>{if(!t){return null}return t*O};const S=t=>{if(!t){return null}return(t-1)*O};const M=t=>{if(!t){return null}return t*j};const T=".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_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0)}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:2rem}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel .f-cell .f-checkbox .checkbox .checkbox__native-control{height:40px;width:40px}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel--absolute{height:87ch;justify-content:flex-end}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .mdc-text-field{height:unset !important}";const W=T;var D=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,n){if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(t):n?n.value:e.get(t)};var C=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i};var E=undefined&&undefined.__rest||function(t,e){var i={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0)i[n]=t[n];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++){if(e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s]))i[n[s]]=t[n[s]]}return i};var F,I,P,R,N,G,J,V,A,L,B,H,K,X,Y,q,Q,U,Z,tt,et,it,nt,st,ot,lt,at,rt,ut,ct,ht,pt,ft,dt,mt,bt,vt,kt,gt,yt,_t,xt,wt,jt,Ot,$t,zt,St,Mt,Tt,Wt;const Dt=document.documentElement;const Ct=class{constructor(i){t(this,i);this.kupReady=e(this,"kup-input-panel-ready",6);F.add(this);I.set(this,r());P.set(this,new Map([["SmeupTreeNode",D(this,F,"m",St).bind(this)],["SmeupDataTree",D(this,F,"m",Mt).bind(this)],["SmeupTable",D(this,F,"m",Tt).bind(this)],["SmeupDataTable",D(this,F,"m",Tt).bind(this)]]));R.set(this,null);N.set(this,new Map([[u.AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[u.MULTI_AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[u.COMBOBOX,["kup-combobox-iconclick"]],[u.MULTI_COMBOBOX,["kup-combobox-iconclick"]]]));G.set(this,[]);J.set(this,new Map([[u.DATE,"kup-date-picker"],[u.TIME,"kup-time-picker"]]));V.set(this,new Map([[c.BUTTON_LIST,D(this,F,"m",K).bind(this)],[c.EDITOR,D(this,F,"m",X).bind(this)],[c.LABEL,D(this,F,"m",q).bind(this)],[c.TABLE,D(this,F,"m",Y).bind(this)]]));A.set(this,new Map([[x.TAB,D(this,F,"m",it).bind(this)]]));L.set(this,[]);this.customStyle="";this.data=null;this.hiddenSubmitButton=false;this.submitCb=null;this.optionsHandler=null;this.customButtonClickHandler=null;this.inputPanelCells=[];this.tabSelected=null}onDataChanged(){C(this,R,structuredClone(this.data),"f");if(D(this,G,"f").length){D(this,G,"f").map((({event:t,handler:e})=>{this.rootElement.removeEventListener(t,e)}));C(this,G,[],"f")}if(D(this,L,"f").length){D(this,L,"f").map((t=>{D(this,I,"f").keysBinding.unregister(t)}));C(this,L,[],"f")}D(this,F,"m",ot).call(this,this.data)}async getProps(t){return h(this,w,t)}async refresh(){i(this)}async setProps(t){p(this,w,t)}componentWillLoad(){D(this,I,"f").debug.logLoad(this,false);D(this,I,"f").language.register(this);D(this,I,"f").theme.register(this);this.onDataChanged()}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id});D(this,I,"f").debug.logLoad(this,true)}componentWillRender(){D(this,I,"f").debug.logRender(this,false)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const e=t.querySelectorAll(".f-text-field");for(let t=0;t<e.length;t++){y(e[t])}}D(this,I,"f").debug.logRender(this,true)}render(){const t=Boolean(!this.inputPanelCells.length);const e=t?[n("p",null,D(this,I,"f").language.translate(f.EMPTY_DATA))]:this.inputPanelCells.map((t=>D(this,F,"m",B).call(this,t)));return n(s,{key:"62cdea4b11e55aaf3a71231851f798bee78bf60e"},n("style",{key:"de02343d1c662d98d2fb9acce6222072cf61e4fb"},D(this,I,"f").theme.setKupStyle(this.rootElement)),n("div",{key:"76c0582d6e71eff483aa177d252eea61b7804f1b",id:_},e))}disconnectedCallback(){D(this,I,"f").language.unregister(this);D(this,I,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{data:["onDataChanged"]}}};I=new WeakMap,P=new WeakMap,R=new WeakMap,N=new WeakMap,G=new WeakMap,J=new WeakMap,V=new WeakMap,A=new WeakMap,L=new WeakMap,F=new WeakSet,B=function t(e){var i;const s=e.row.layout;const o=(s===null||s===void 0?void 0:s.horizontal)||false;let a;if(!((i=s===null||s===void 0?void 0:s.sections)===null||i===void 0?void 0:i.length)){a=e.cells.map((t=>D(this,F,"m",H).call(this,t.cell,e.row,t.column)))}else{a=s.absolute?D(this,F,"m",Z).call(this,e,s):D(this,F,"m",U).call(this,e,s)}const r={"input-panel":true,"input-panel--column":!o,"input-panel--absolute":s===null||s===void 0?void 0:s.absolute};return n("form",{class:r,name:this.rootElement.id,onSubmit:t=>{t.preventDefault();this.submitCb({value:{before:Object.assign({},D(this,R,"f")),after:D(this,F,"m",rt).call(this)}})}},a,!this.hiddenSubmitButton?n(l,{buttonType:"submit",label:D(this,I,"f").language.translate(f.CONFIRM),wrapperClass:"form__submit"}):null)},H=function t(e,i,s){if(!e){return}const o=D(this,V,"f").get(e.shape);if(o!==undefined){return o(e,s.name)}const l={cell:e,column:s,row:i,component:this,editable:true,renderKup:true,setSizes:true};const r=D(this,F,"m",Q).call(this,e,s.title);if(r){return n("div",{class:{"input-panel__label_container":true}},r,n(a,Object.assign({},l)))}return n(a,Object.assign({},l))},K=function t(e,i){return n(l,Object.assign({icon:e.icon,id:i},e.data,{wrapperClass:"form__submit"}))},X=function t(e,i){const s="kup-editor-save";const o=t=>{const e=this.inputPanelCells.reduce(((t,{cells:e})=>{if(!t){return e.find((({column:t})=>t.name===i)).cell}return t}),null);e.value=t.detail.htmlValue.replace(/\n/g,"<br>")};this.rootElement.addEventListener(s,o);D(this,G,"f").push({event:s,handler:o});return n("kup-editor",Object.assign({},e.data,{id:i,isReadOnly:!e.isEditable,showToolbar:true}))},Y=function t(e,i){return n("kup-data-table",Object.assign({id:i,editableData:true,showGroups:true,showFilters:true,showFooter:true},e.data))},q=function t(e,i){return n("span",{class:"input-panel-label",id:i},e.value)},Q=function t(e,i){if(!i){return null}const s=Dt.ketchup.data.cell.getType(e,e.shape);if(s===u.RADIO){return n("span",null,i)}return null},U=function t(e,i){const n=D(this,A,"f").get(i.sectionsType);return n?n(e,i.sections):i.sections.map((t=>D(this,F,"m",tt).call(this,e,t)))},Z=function t(e,i){return i.sections.map((t=>D(this,F,"m",et).call(this,e,t)))},tt=function t(e,i,s=false,o={}){var l,a;const r={"input-panel__section":!i.horizontal,"input-panel__horizontal-section":i.horizontal};o.gap=+i.gap>0?`${i.gap}rem`:"1rem";let u=[];if((l=i.sections)===null||l===void 0?void 0:l.length){u=i.sections.map((i=>D(this,F,"m",t).call(this,e,i)));const n=i.sections.some((t=>t.dim));if(!i.gridCols&&i.horizontal){o.gridTemplateColumns=n?i.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${i.sections.length}, 1fr)`}if(!i.gridRows&&!i.horizontal){o.gridTemplateRows=n?i.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${i.sections.length}, 1fr)`}}else if((a=i.content)===null||a===void 0?void 0:a.length){u=i.content.map((t=>D(this,F,"m",nt).call(this,e,t)));o.gridTemplateColumns=+i.gridCols>0?`repeat(${i.gridCols}, 1fr)`:"";o.gridTemplateRows=+i.gridRows>0?`repeat(${i.gridRows}, 1fr)`:""}const c=n("div",{class:r,style:o},u);return i.title&&!s?n("div",{class:{"input-panel__section_label_container":true}},n("h3",null,i.title),c):c},et=function t(e,i){var s,o;let l=[];if((s=i.sections)===null||s===void 0?void 0:s.length){l=i.sections.map((i=>D(this,F,"m",t).call(this,e,i)))}else if((o=i.content)===null||o===void 0?void 0:o.length){l=i.content.map((t=>D(this,F,"m",st).call(this,e,t)))}const a=`${$(i.absoluteWidth)}px`;const r=`${z(i.absoluteHeight)}px`;const u=`${S(i.absoluteRow)}px`;const c=`${M(i.absoluteColumn)}px`;const h={position:"absolute",width:a,"min-width":a,"max-width":a,height:r,"min-height":r,"max-height":r,top:u,left:c,overflow:"auto"};return n("div",{style:h},l)},it=function t(e,i){if(!this.tabSelected){this.tabSelected=i[0].id||"0"}const s=i.map(((t,e)=>({active:(t.id||`${e}`)===this.tabSelected,value:t.title,icon:t.icon,id:t.id||`${e}`})));const o=i.map(((t,i)=>{const n=t.id||`${i}`;return D(this,F,"m",tt).call(this,e,t,true,{display:this.tabSelected!==n?"none":"grid"})}));const l=".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }";if(!D(this,G,"f").map((t=>t.event)).includes("kup-tabbar-click")){const t="kup-tabbar-click";const e=t=>{this.tabSelected=t.detail.node.id};this.rootElement.addEventListener(t,e);D(this,G,"f").push({event:t,handler:e})}return n("div",{class:{"input-panel__tabs_container":true}},n("kup-tab-bar",{data:s,customStyle:l}),o)},nt=function t(e,i){const s=e.cells.find((t=>t.column.name===i.id));const o=+i.colSpan>0?i.colSpan:!(+i.colSpan>0)&&!(+i.colStart>0)?1:null;const l=o?`span ${o}`:`${i.colStart}`;const a=+i.colEnd>0?`${i.colEnd}`:"";const r=+i.rowSpan>0?i.rowSpan:!(+i.rowSpan>0)&&!(+i.rowStart>0)?1:null;const u=r?`span ${r}`:`${i.rowStart}`;const c=+i.rowEnd>0?`${i.rowEnd}`:"";const h={"grid-column-start":l,"grid-column-end":a,"grid-row-start":u,"grid-row-end":c};if(!s||!s.cell){return}return n("div",{style:h},D(this,F,"m",H).call(this,s.cell,e.row,s.column))},st=function t(e,i){const s=e.cells.find((t=>t.column.name===i.id));if(!s||!s.cell){return}let o;if(s.cell.shape==c.DATE){o=i.absoluteLength>8?i.absoluteLength:8}else{o=i.absoluteLength}const l=`${$(o)}px`;const a=`${z(1)}px`;const r=`${S(i.absoluteRow)}px`;const u=`${M(i.absoluteColumn)}px`;const h={position:"absolute",width:l,"min-width":l,"max-width":l,height:a,"min-height":a,"max-height":a,top:r,left:u,overflow:"auto"};s.cell.data=Object.assign(Object.assign({},s.cell.data),{customStyle:(s.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}"});return n("div",{style:h},D(this,F,"m",H).call(this,s.cell,e.row,s.column))},ot=function t(e){var i;const n=((i=e===null||e===void 0?void 0:e.rows)===null||i===void 0?void 0:i.length)?e.rows.reduce(((t,i)=>{const n=e.columns.filter((t=>t.visible)).map((t=>{const e=structuredClone(i.cells[t.name]);const n=e?Object.assign(Object.assign({},e),{data:D(this,F,"m",lt).call(this,e,t),slotData:D(this,F,"m",ct).call(this,e,t),isEditable:true}):null;return{column:t,cell:n}}));return[...t,{cells:n,row:i}]}),[]):[];n.map((({cells:t})=>t.map((({cell:t,column:e})=>{const i=Dt.ketchup.data.cell.getType(t,t.shape);const n=D(this,J,"f").get(i);if(!n){return}const s=this.rootElement.shadowRoot.querySelector(`${n}[id=${e.name}]`);s===null||s===void 0?void 0:s.setValue(t.value)}))));this.inputPanelCells=n},lt=function t(e,i){const n=Object.assign(Object.assign({},D(this,F,"m",ut).call(this,e,i)),{disabled:!e.editable,id:i.name});const s=Dt.ketchup.data.cell.getType(e,e.shape);const o=e.data||{},l=E(o,["data"]);return s!==u.MULTI_AUTOCOMPLETE&&s!==u.MULTI_COMBOBOX?D(this,F,"m",at).call(this,n,Object.assign({},e.data)):Object.assign(Object.assign({},n),l)},at=function t(e,i){for(const n in i){if(i[n]instanceof Object&&!Array.isArray(i[n])&&n in e){e[n]=D(this,F,"m",t).call(this,e[n],i[n])}else{e[n]=i[n]}}return e},rt=function t(){return this.inputPanelCells.reduce(((t,e)=>{const i=Object.keys(e.row.cells).reduce(((t,i)=>{var n;const s=(n=e.cells.find((t=>t.column.name===i)))===null||n===void 0?void 0:n.cell;let o=s===null||s===void 0?void 0:s.value;if((s===null||s===void 0?void 0:s.shape)===c.TABLE){o=JSON.stringify(D(this,F,"m",$t).call(this,s.data.data,i))}return Object.assign(Object.assign({},t),{[i]:Object.assign(Object.assign({},e.row.cells[i]),{value:o,obj:s===null||s===void 0?void 0:s.obj})})}),{});return{columns:[...t.columns,...e.cells.map((t=>t.column))],rows:[...t.rows,{cells:i,layout:e.row.layout}]}}),{columns:[],rows:[]})},ut=function t(e,i){if(!e){return null}const n=e.options;const s=i.title;const o=e.value;const l=Dt.ketchup.data.cell.getType(e,e.shape);const a=new Map([[u.AUTOCOMPLETE,D(this,F,"m",dt).bind(this)],[u.BUTTON_LIST,D(this,F,"m",ft).bind(this)],[u.CHART,D(this,F,"m",pt).bind(this)],[u.CHIP,D(this,F,"m",ht).bind(this)],[u.CHECKBOX,D(this,F,"m",mt).bind(this)],[u.COLOR_PICKER,D(this,F,"m",bt).bind(this)],[u.COMBOBOX,D(this,F,"m",dt).bind(this)],[u.EDITOR,D(this,F,"m",vt).bind(this)],[u.MULTI_AUTOCOMPLETE,D(this,F,"m",ht).bind(this)],[u.MULTI_COMBOBOX,D(this,F,"m",ht).bind(this)],[u.NUMBER,D(this,F,"m",jt).bind(this)],[u.DATE,D(this,F,"m",_t).bind(this)],[u.OBJECT,D(this,F,"m",xt).bind(this)],[u.RADIO,D(this,F,"m",gt).bind(this)],[u.STRING,D(this,F,"m",kt).bind(this)],[u.SWITCH,D(this,F,"m",yt).bind(this)],[u.TABLE,D(this,F,"m",Ot).bind(this)],[u.TIME,D(this,F,"m",wt).bind(this)]]);const r=a.get(l);return r?r(n,s,o,e,i.name):null},ct=function t(e,i){const n=Dt.ketchup.data.cell.getType(e,e.shape);if(!e.editable){return null}if(n===u.CHIP){return{trailingIcon:true,label:i.title,disabled:!e.editable,id:i.name,fullWidth:false}}if(n===u.MULTI_AUTOCOMPLETE||n===u.MULTI_COMBOBOX){return Object.assign(Object.assign({},D(this,F,"m",dt).call(this,e.options,i.title,null,e,i.name)),{showDropDownIcon:true,class:"",style:{width:"100%"},disabled:!e.editable,id:i.name})}return null},ht=function t(e,i,n){return d(n)},pt=function t(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},ft=function t(e,i,n,s,o){var l,a,r,u;s.data=s.data||{};s.data.onClick=()=>{s.fun?this.customButtonClickHandler({fun:s.fun,cellId:o,currentState:D(this,F,"m",rt).call(this)}):this.submitCb({value:{before:Object.assign({},D(this,R,"f")),after:D(this,F,"m",rt).call(this)},cell:o})};if(((l=s.data)===null||l===void 0?void 0:l.keyShortcut)&&!((a=s.data)===null||a===void 0?void 0:a.disabled)){D(this,L,"f").push((r=s.data)===null||r===void 0?void 0:r.keyShortcut);D(this,I,"f").keysBinding.register((u=s.data)===null||u===void 0?void 0:u.keyShortcut,s.data.onClick.bind(this))}return Object.assign({label:s.value,fun:s.fun},s.data)},dt=function t(e,i,n,s,o){const l=m(n,i,[]);if(s.fun){const t=Dt.ketchup.data.cell.getType(s,s.shape);const e=D(this,N,"f").get(t);if(!e){return}e.map((t=>{const e=t=>{D(this,F,"m",Wt).call(this,t.detail,s.fun,l,o,n)};this.rootElement.addEventListener(t,e);D(this,G,"f").push({event:t,handler:e})}))}else if(e){l.data["kup-list"].data=D(this,F,"m",zt).call(this,e,n)}return l},mt=function t(e,i,n){return b(n,i)},bt=function t(e,i,n){return{data:{"kup-text-field":{label:i}}}},vt=function t(e,i,n){return{initialValue:n}},kt=function t(e,i,n){return{label:i}},gt=function t(e,i,n){return v(n,e)},yt=function t(e,i,n){return k(n,i)},_t=function t(e,i,n){return{data:{"kup-text-field":{label:i}},initialValue:n}},xt=function t(e,i,n,s,o){return{initialValue:n||"",label:i||" ",value:n||""}},wt=function t(e,i,n){return{data:{"kup-text-field":{label:i}}}},jt=function t(e,i,n){return{label:i}},Ot=function t(e,i,n,s,o){try{let t=JSON.parse(s.value);if(!t){D(this,I,"f").debug.logMessage(this,`Empty value for ${o} cell.`,g.WARNING);return null}if(t.type!=="SmeupDataTable"){D(this,I,"f").debug.logMessage(this,`Wrong data table type for ${o} cell. Type \`SmeupDataTable\` in value expected`,g.ERROR);return null}return{data:{columns:t.columns.map((e=>Object.assign(Object.assign({},e),{obj:t.rows[0].cells[e.name].obj}))),rows:t.rows.map((e=>Object.assign(Object.assign({},e),{cells:Object.keys(e.cells).reduce(((i,n)=>{const s=t.columns.find((t=>t.name===n));return Object.assign(Object.assign({},i),{[n]:Object.assign(Object.assign({},e.cells[n]),{data:Object.assign(Object.assign({},D(this,F,"m",ut).call(this,e.cells[n],s)),{disabled:e.cells[n].editable===false,id:s.id})})})}),{})})))}}}catch(t){D(this,I,"f").debug.logMessage(this,`Invalid value for ${o} cell. Type \`SmeupDataTable\` expected`,g.ERROR);return null}},$t=function t(e,i){const n=Object.assign(Object.assign({},e),{rows:e.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))});const s=e.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!s.length){return n}try{const t=JSON.parse(D(this,R,"f").rows[0].cells[i].value);n.rows=e.rows.map(((e,i)=>s.reduce(((n,s)=>{const o=t.rows[i].cells[s]&&e.cells[s].value!==t.rows[i].cells[s].value;if(o){return Object.assign(Object.assign({},t.rows[i]),{cells:Object.assign(Object.assign({},n.cells),{[s]:Object.assign(Object.assign({},t.rows[i].cells[s]),{value:e.cells[s].value})})})}return Object.assign(Object.assign({},t.rows[i]),{cells:n.cells})}),Object.assign(Object.assign({},t.rows[i]),{cells:{}}))));return n}catch(t){return n}},zt=function t(e,i){const n=D(this,P,"f").get(e.type);if(n){return n(e,i)}else{return e.map((t=>({value:t.label,id:t.id,selected:i===t.id})))}},St=function t(e,i){return e.children.map((e=>{var n;return{id:e.content.codice,value:e.content.testo,selected:i===e.content.codice,children:((n=e.children)===null||n===void 0?void 0:n.length)?D(this,F,"m",t).call(this,e,i):[]}}))},Mt=function t(e,i){return e.children.map((e=>{var n;return{id:e.obj.k,value:e.value,selected:i===e.obj.k,children:((n=e.children)===null||n===void 0?void 0:n.length)?D(this,F,"m",t).call(this,e,i):[]}}))},Tt=function t(e,i){return e.rows.map((t=>{var e;const n=t.fields||t.cells;const[s,o]=Object.keys(n);return{id:n[s].value,value:((e=n[o])===null||e===void 0?void 0:e.value)||n[s].value,selected:i===n[s].value}}))},Wt=function t(e,i,n,s,o){if(e.id!==s||e.open===false){return}this.optionsHandler(i,e.inputValue,D(this,F,"m",rt).call(this),e.id).then((t=>{var i;n.data["kup-list"].data=(i=D(this,F,"m",zt).call(this,t,o))!==null&&i!==void 0?i:[];e.comp.refresh()}))};Ct.style=W;export{Ct as kup_input_panel};
2
- //# sourceMappingURL=p-44b6390c.entry.js.map
1
+ import{r as t,c as e,f as i,h as n,H as s,d as o}from"./p-d7c15b0e.js";import{F as l}from"./p-cc32b7a2.js";import{F as a}from"./p-721b6a3c.js";import{k as r,a5 as u,F as c,g as h,s as p,h as f,al as d,ab as m,ak as b,aa as v,am as k,e as g}from"./p-8c07fd42.js";import{F as y}from"./p-c4054aba.js";import{c as _}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-2b519589.js";import"./p-5d03c077.js";import"./p-1754ee9b.js";import"./p-df06309a.js";import"./p-029c7cbe.js";import"./p-d4a879fc.js";var x;(function(t){t["TAB"]="tab"})(x||(x={}));var w;(function(t){t["customStyle"]="Custom style of the component.";t["data"]="Actual data of the input panel.";t["hiddenSubmitButton"]="Creates a hidden submit button in order to submit the form with enter.";t["submitCb"]="Sets the callback function on submit form";t["optionsHandler"]="Sets the callback function to recieve options"})(w||(w={}));const j=12;const O=22;const $=t=>{if(t==0){return j/2}if(!t){return null}if(t===1){return 1.5*j}return t*j};const z=t=>{if(!t){return null}return t*O};const S=t=>{if(!t){return null}return(t-1)*O};const M=t=>{if(!t){return null}return t*j};const T=".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_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0)}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:2rem}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel .f-cell .f-checkbox .checkbox .checkbox__native-control{height:40px;width:40px}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel--absolute{height:87ch;justify-content:flex-end}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .mdc-text-field{height:unset !important}";const W=T;var D=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,n){if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(t):n?n.value:e.get(t)};var C=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i};var E=undefined&&undefined.__rest||function(t,e){var i={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0)i[n]=t[n];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++){if(e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s]))i[n[s]]=t[n[s]]}return i};var F,I,P,R,N,G,J,V,A,L,B,H,K,X,Y,q,Q,U,Z,tt,et,it,nt,st,ot,lt,at,rt,ut,ct,ht,pt,ft,dt,mt,bt,vt,kt,gt,yt,_t,xt,wt,jt,Ot,$t,zt,St,Mt,Tt,Wt;const Dt=document.documentElement;const Ct=class{constructor(i){t(this,i);this.kupReady=e(this,"kup-input-panel-ready",6);F.add(this);I.set(this,r());P.set(this,new Map([["SmeupTreeNode",D(this,F,"m",St).bind(this)],["SmeupDataTree",D(this,F,"m",Mt).bind(this)],["SmeupTable",D(this,F,"m",Tt).bind(this)],["SmeupDataTable",D(this,F,"m",Tt).bind(this)]]));R.set(this,null);N.set(this,new Map([[u.AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[u.MULTI_AUTOCOMPLETE,["kup-autocomplete-input","kup-autocomplete-iconclick"]],[u.COMBOBOX,["kup-combobox-iconclick"]],[u.MULTI_COMBOBOX,["kup-combobox-iconclick"]]]));G.set(this,[]);J.set(this,new Map([[u.DATE,"kup-date-picker"],[u.TIME,"kup-time-picker"]]));V.set(this,new Map([[c.BUTTON_LIST,D(this,F,"m",K).bind(this)],[c.EDITOR,D(this,F,"m",X).bind(this)],[c.LABEL,D(this,F,"m",q).bind(this)],[c.TABLE,D(this,F,"m",Y).bind(this)]]));A.set(this,new Map([[x.TAB,D(this,F,"m",it).bind(this)]]));L.set(this,[]);this.customStyle="";this.data=null;this.hiddenSubmitButton=false;this.submitCb=null;this.optionsHandler=null;this.customButtonClickHandler=null;this.inputPanelCells=[];this.tabSelected=null}onDataChanged(){C(this,R,structuredClone(this.data),"f");if(D(this,G,"f").length){D(this,G,"f").map((({event:t,handler:e})=>{this.rootElement.removeEventListener(t,e)}));C(this,G,[],"f")}if(D(this,L,"f").length){D(this,L,"f").map((t=>{D(this,I,"f").keysBinding.unregister(t)}));C(this,L,[],"f")}D(this,F,"m",ot).call(this,this.data)}async getProps(t){return h(this,w,t)}async refresh(){i(this)}async setProps(t){p(this,w,t)}componentWillLoad(){D(this,I,"f").debug.logLoad(this,false);D(this,I,"f").language.register(this);D(this,I,"f").theme.register(this);this.onDataChanged()}componentDidLoad(){this.kupReady.emit({comp:this,id:this.rootElement.id});D(this,I,"f").debug.logLoad(this,true)}componentWillRender(){D(this,I,"f").debug.logRender(this,false)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const e=t.querySelectorAll(".f-text-field");for(let t=0;t<e.length;t++){y(e[t])}}D(this,I,"f").debug.logRender(this,true)}render(){const t=Boolean(!this.inputPanelCells.length);const e=t?[n("p",null,D(this,I,"f").language.translate(f.EMPTY_DATA))]:this.inputPanelCells.map((t=>D(this,F,"m",B).call(this,t)));return n(s,{key:"62cdea4b11e55aaf3a71231851f798bee78bf60e"},n("style",{key:"de02343d1c662d98d2fb9acce6222072cf61e4fb"},D(this,I,"f").theme.setKupStyle(this.rootElement)),n("div",{key:"76c0582d6e71eff483aa177d252eea61b7804f1b",id:_},e))}disconnectedCallback(){D(this,I,"f").language.unregister(this);D(this,I,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{data:["onDataChanged"]}}};I=new WeakMap,P=new WeakMap,R=new WeakMap,N=new WeakMap,G=new WeakMap,J=new WeakMap,V=new WeakMap,A=new WeakMap,L=new WeakMap,F=new WeakSet,B=function t(e){var i;const s=e.row.layout;const o=(s===null||s===void 0?void 0:s.horizontal)||false;let a;if(!((i=s===null||s===void 0?void 0:s.sections)===null||i===void 0?void 0:i.length)){a=e.cells.map((t=>D(this,F,"m",H).call(this,t.cell,e.row,t.column)))}else{a=s.absolute?D(this,F,"m",Z).call(this,e,s):D(this,F,"m",U).call(this,e,s)}const r={"input-panel":true,"input-panel--column":!o,"input-panel--absolute":s===null||s===void 0?void 0:s.absolute};return n("form",{class:r,name:this.rootElement.id,onSubmit:t=>{t.preventDefault();this.submitCb({value:{before:Object.assign({},D(this,R,"f")),after:D(this,F,"m",rt).call(this)}})}},a,!this.hiddenSubmitButton?n(l,{buttonType:"submit",label:D(this,I,"f").language.translate(f.CONFIRM),wrapperClass:"form__submit"}):null)},H=function t(e,i,s){if(!e){return}const o=D(this,V,"f").get(e.shape);if(o!==undefined){return o(e,s.name)}const l={cell:e,column:s,row:i,component:this,editable:true,renderKup:true,setSizes:true};const r=D(this,F,"m",Q).call(this,e,s.title);if(r){return n("div",{class:{"input-panel__label_container":true}},r,n(a,Object.assign({},l)))}return n(a,Object.assign({},l))},K=function t(e,i){return n(l,Object.assign({icon:e.icon,id:i},e.data,{wrapperClass:"form__submit"}))},X=function t(e,i){const s="kup-editor-save";const o=t=>{const e=this.inputPanelCells.reduce(((t,{cells:e})=>{if(!t){return e.find((({column:t})=>t.name===i)).cell}return t}),null);e.value=t.detail.htmlValue.replace(/\n/g,"<br>")};this.rootElement.addEventListener(s,o);D(this,G,"f").push({event:s,handler:o});return n("kup-editor",Object.assign({},e.data,{id:i,isReadOnly:!e.isEditable,showToolbar:true}))},Y=function t(e,i){return n("kup-data-table",Object.assign({id:i,editableData:true,showGroups:true,showFilters:true,showFooter:true},e.data))},q=function t(e,i){return n("span",{class:"input-panel-label",id:i},e.value)},Q=function t(e,i){if(!i){return null}const s=Dt.ketchup.data.cell.getType(e,e.shape);if(s===u.RADIO){return n("span",null,i)}return null},U=function t(e,i){const n=D(this,A,"f").get(i.sectionsType);return n?n(e,i.sections):i.sections.map((t=>D(this,F,"m",tt).call(this,e,t)))},Z=function t(e,i){return i.sections.map((t=>D(this,F,"m",et).call(this,e,t)))},tt=function t(e,i,s=false,o={}){var l,a;const r={"input-panel__section":!i.horizontal,"input-panel__horizontal-section":i.horizontal};o.gap=+i.gap>0?`${i.gap}rem`:"1rem";let u=[];if((l=i.sections)===null||l===void 0?void 0:l.length){u=i.sections.map((i=>D(this,F,"m",t).call(this,e,i)));const n=i.sections.some((t=>t.dim));if(!i.gridCols&&i.horizontal){o.gridTemplateColumns=n?i.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${i.sections.length}, 1fr)`}if(!i.gridRows&&!i.horizontal){o.gridTemplateRows=n?i.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${i.sections.length}, 1fr)`}}else if((a=i.content)===null||a===void 0?void 0:a.length){u=i.content.map((t=>D(this,F,"m",nt).call(this,e,t)));o.gridTemplateColumns=+i.gridCols>0?`repeat(${i.gridCols}, 1fr)`:"";o.gridTemplateRows=+i.gridRows>0?`repeat(${i.gridRows}, 1fr)`:""}const c=n("div",{class:r,style:o},u);return i.title&&!s?n("div",{class:{"input-panel__section_label_container":true}},n("h3",null,i.title),c):c},et=function t(e,i){var s,o;let l=[];if((s=i.sections)===null||s===void 0?void 0:s.length){l=i.sections.map((i=>D(this,F,"m",t).call(this,e,i)))}else if((o=i.content)===null||o===void 0?void 0:o.length){l=i.content.map((t=>D(this,F,"m",st).call(this,e,t)))}const a=`${$(i.absoluteWidth)}px`;const r=`${z(i.absoluteHeight)}px`;const u=`${S(i.absoluteRow)}px`;const c=`${M(i.absoluteColumn)}px`;const h={position:"absolute",width:a,"min-width":a,"max-width":a,height:r,"min-height":r,"max-height":r,top:u,left:c,overflow:"auto"};return n("div",{style:h},l)},it=function t(e,i){if(!this.tabSelected){this.tabSelected=i[0].id||"0"}const s=i.map(((t,e)=>({active:(t.id||`${e}`)===this.tabSelected,value:t.title,icon:t.icon,id:t.id||`${e}`})));const o=i.map(((t,i)=>{const n=t.id||`${i}`;return D(this,F,"m",tt).call(this,e,t,true,{display:this.tabSelected!==n?"none":"grid"})}));const l=".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }";if(!D(this,G,"f").map((t=>t.event)).includes("kup-tabbar-click")){const t="kup-tabbar-click";const e=t=>{this.tabSelected=t.detail.node.id};this.rootElement.addEventListener(t,e);D(this,G,"f").push({event:t,handler:e})}return n("div",{class:{"input-panel__tabs_container":true}},n("kup-tab-bar",{data:s,customStyle:l}),o)},nt=function t(e,i){const s=e.cells.find((t=>t.column.name===i.id));const o=+i.colSpan>0?i.colSpan:!(+i.colSpan>0)&&!(+i.colStart>0)?1:null;const l=o?`span ${o}`:`${i.colStart}`;const a=+i.colEnd>0?`${i.colEnd}`:"";const r=+i.rowSpan>0?i.rowSpan:!(+i.rowSpan>0)&&!(+i.rowStart>0)?1:null;const u=r?`span ${r}`:`${i.rowStart}`;const c=+i.rowEnd>0?`${i.rowEnd}`:"";const h={"grid-column-start":l,"grid-column-end":a,"grid-row-start":u,"grid-row-end":c};if(!s||!s.cell){return}return n("div",{style:h},D(this,F,"m",H).call(this,s.cell,e.row,s.column))},st=function t(e,i){const s=e.cells.find((t=>t.column.name===i.id));if(!s||!s.cell){return}let o;if(s.cell.shape==c.DATE){o=i.absoluteLength>8?i.absoluteLength:8}else{o=i.absoluteLength}const l=`${$(o)}px`;const a=`${z(1)}px`;const r=`${S(i.absoluteRow)}px`;const u=`${M(i.absoluteColumn)}px`;const h={position:"absolute",width:l,"min-width":l,"max-width":l,height:a,"min-height":a,"max-height":a,top:r,left:u,overflow:"auto"};s.cell.data=Object.assign(Object.assign({},s.cell.data),{customStyle:(s.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}"});return n("div",{style:h},D(this,F,"m",H).call(this,s.cell,e.row,s.column))},ot=function t(e){var i;const n=((i=e===null||e===void 0?void 0:e.rows)===null||i===void 0?void 0:i.length)?e.rows.reduce(((t,i)=>{const n=e.columns.filter((t=>t.visible)).map((t=>{const e=structuredClone(i.cells[t.name]);const n=e?Object.assign(Object.assign({},e),{data:D(this,F,"m",lt).call(this,e,t),slotData:D(this,F,"m",ct).call(this,e,t),isEditable:true}):null;return{column:t,cell:n}}));return[...t,{cells:n,row:i}]}),[]):[];n.map((({cells:t})=>t.map((({cell:t,column:e})=>{const i=Dt.ketchup.data.cell.getType(t,t.shape);const n=D(this,J,"f").get(i);if(!n){return}const s=this.rootElement.shadowRoot.querySelector(`${n}[id=${e.name}]`);s===null||s===void 0?void 0:s.setValue(t.value)}))));this.inputPanelCells=n},lt=function t(e,i){const n=Object.assign(Object.assign({},D(this,F,"m",ut).call(this,e,i)),{disabled:!e.editable,id:i.name});const s=Dt.ketchup.data.cell.getType(e,e.shape);const o=e.data||{},l=E(o,["data"]);return s!==u.MULTI_AUTOCOMPLETE&&s!==u.MULTI_COMBOBOX?D(this,F,"m",at).call(this,n,Object.assign({},e.data)):Object.assign(Object.assign({},n),l)},at=function t(e,i){for(const n in i){if(i[n]instanceof Object&&!Array.isArray(i[n])&&n in e){e[n]=D(this,F,"m",t).call(this,e[n],i[n])}else{e[n]=i[n]}}return e},rt=function t(){return this.inputPanelCells.reduce(((t,e)=>{const i=Object.keys(e.row.cells).reduce(((t,i)=>{var n;const s=(n=e.cells.find((t=>t.column.name===i)))===null||n===void 0?void 0:n.cell;let o=s===null||s===void 0?void 0:s.value;if((s===null||s===void 0?void 0:s.shape)===c.TABLE){o=JSON.stringify(D(this,F,"m",$t).call(this,s.data.data,i))}return Object.assign(Object.assign({},t),{[i]:Object.assign(Object.assign({},e.row.cells[i]),{value:o,obj:s===null||s===void 0?void 0:s.obj})})}),{});return{columns:[...t.columns,...e.cells.map((t=>t.column))],rows:[...t.rows,{cells:i,layout:e.row.layout}]}}),{columns:[],rows:[]})},ut=function t(e,i){if(!e){return null}const n=e.options;const s=i.title;const o=e.value;const l=Dt.ketchup.data.cell.getType(e,e.shape);const a=new Map([[u.AUTOCOMPLETE,D(this,F,"m",dt).bind(this)],[u.BUTTON_LIST,D(this,F,"m",ft).bind(this)],[u.CHART,D(this,F,"m",pt).bind(this)],[u.CHIP,D(this,F,"m",ht).bind(this)],[u.CHECKBOX,D(this,F,"m",mt).bind(this)],[u.COLOR_PICKER,D(this,F,"m",bt).bind(this)],[u.COMBOBOX,D(this,F,"m",dt).bind(this)],[u.EDITOR,D(this,F,"m",vt).bind(this)],[u.MULTI_AUTOCOMPLETE,D(this,F,"m",ht).bind(this)],[u.MULTI_COMBOBOX,D(this,F,"m",ht).bind(this)],[u.NUMBER,D(this,F,"m",jt).bind(this)],[u.DATE,D(this,F,"m",_t).bind(this)],[u.OBJECT,D(this,F,"m",xt).bind(this)],[u.RADIO,D(this,F,"m",gt).bind(this)],[u.STRING,D(this,F,"m",kt).bind(this)],[u.SWITCH,D(this,F,"m",yt).bind(this)],[u.TABLE,D(this,F,"m",Ot).bind(this)],[u.TIME,D(this,F,"m",wt).bind(this)]]);const r=a.get(l);return r?r(n,s,o,e,i.name):null},ct=function t(e,i){const n=Dt.ketchup.data.cell.getType(e,e.shape);if(!e.editable){return null}if(n===u.CHIP){return{trailingIcon:true,label:i.title,disabled:!e.editable,id:i.name,fullWidth:false}}if(n===u.MULTI_AUTOCOMPLETE||n===u.MULTI_COMBOBOX){return Object.assign(Object.assign({},D(this,F,"m",dt).call(this,e.options,i.title,null,e,i.name)),{showDropDownIcon:true,class:"",style:{width:"100%"},disabled:!e.editable,id:i.name})}return null},ht=function t(e,i,n){return d(n)},pt=function t(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},ft=function t(e,i,n,s,o){var l,a,r,u;s.data=s.data||{};s.data.onClick=()=>{s.fun?this.customButtonClickHandler({fun:s.fun,cellId:o,currentState:D(this,F,"m",rt).call(this)}):this.submitCb({value:{before:Object.assign({},D(this,R,"f")),after:D(this,F,"m",rt).call(this)},cell:o})};if(((l=s.data)===null||l===void 0?void 0:l.keyShortcut)&&!((a=s.data)===null||a===void 0?void 0:a.disabled)){D(this,L,"f").push((r=s.data)===null||r===void 0?void 0:r.keyShortcut);D(this,I,"f").keysBinding.register((u=s.data)===null||u===void 0?void 0:u.keyShortcut,s.data.onClick.bind(this))}return Object.assign({label:s.value,fun:s.fun},s.data)},dt=function t(e,i,n,s,o){const l=m(n,i,[]);if(s.fun){const t=Dt.ketchup.data.cell.getType(s,s.shape);const e=D(this,N,"f").get(t);if(!e){return}e.map((t=>{const e=t=>{D(this,F,"m",Wt).call(this,t.detail,s.fun,l,o,n)};this.rootElement.addEventListener(t,e);D(this,G,"f").push({event:t,handler:e})}))}else if(e){l.data["kup-list"].data=D(this,F,"m",zt).call(this,e,n)}return l},mt=function t(e,i,n){return b(n,i)},bt=function t(e,i,n){return{data:{"kup-text-field":{label:i}}}},vt=function t(e,i,n){return{initialValue:n}},kt=function t(e,i,n){return{label:i}},gt=function t(e,i,n){return v(n,e)},yt=function t(e,i,n){return k(n,i)},_t=function t(e,i,n){return{data:{"kup-text-field":{label:i}},initialValue:n}},xt=function t(e,i,n,s,o){return{initialValue:n||"",label:i||" ",value:n||""}},wt=function t(e,i,n){return{data:{"kup-text-field":{label:i}}}},jt=function t(e,i,n){return{label:i}},Ot=function t(e,i,n,s,o){try{let t=JSON.parse(s.value);if(!t){D(this,I,"f").debug.logMessage(this,`Empty value for ${o} cell.`,g.WARNING);return null}if(t.type!=="SmeupDataTable"){D(this,I,"f").debug.logMessage(this,`Wrong data table type for ${o} cell. Type \`SmeupDataTable\` in value expected`,g.ERROR);return null}return{data:{columns:t.columns.map((e=>Object.assign(Object.assign({},e),{obj:t.rows[0].cells[e.name].obj}))),rows:t.rows.map((e=>Object.assign(Object.assign({},e),{cells:Object.keys(e.cells).reduce(((i,n)=>{const s=t.columns.find((t=>t.name===n));return Object.assign(Object.assign({},i),{[n]:Object.assign(Object.assign({},e.cells[n]),{data:Object.assign(Object.assign({},D(this,F,"m",ut).call(this,e.cells[n],s)),{disabled:e.cells[n].editable===false,id:s.id})})})}),{})})))}}}catch(t){D(this,I,"f").debug.logMessage(this,`Invalid value for ${o} cell. Type \`SmeupDataTable\` expected`,g.ERROR);return null}},$t=function t(e,i){const n=Object.assign(Object.assign({},e),{rows:e.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))});const s=e.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!s.length){return n}try{const t=JSON.parse(D(this,R,"f").rows[0].cells[i].value);n.rows=e.rows.map(((e,i)=>s.reduce(((n,s)=>{const o=t.rows[i].cells[s]&&e.cells[s].value!==t.rows[i].cells[s].value;if(o){return Object.assign(Object.assign({},t.rows[i]),{cells:Object.assign(Object.assign({},n.cells),{[s]:Object.assign(Object.assign({},t.rows[i].cells[s]),{value:e.cells[s].value})})})}return Object.assign(Object.assign({},t.rows[i]),{cells:n.cells})}),Object.assign(Object.assign({},t.rows[i]),{cells:{}}))));return n}catch(t){return n}},zt=function t(e,i){const n=D(this,P,"f").get(e.type);if(n){return n(e,i)}else{return e.map((t=>({value:t.label,id:t.id,selected:i===t.id})))}},St=function t(e,i){return e.children.map((e=>{var n;return{id:e.content.codice,value:e.content.testo,selected:i===e.content.codice,children:((n=e.children)===null||n===void 0?void 0:n.length)?D(this,F,"m",t).call(this,e,i):[]}}))},Mt=function t(e,i){return e.children.map((e=>{var n;return{id:e.obj.k,value:e.value,selected:i===e.obj.k,children:((n=e.children)===null||n===void 0?void 0:n.length)?D(this,F,"m",t).call(this,e,i):[]}}))},Tt=function t(e,i){return e.rows.map((t=>{var e;const n=t.fields||t.cells;const[s,o]=Object.keys(n);return{id:n[s].value,value:((e=n[o])===null||e===void 0?void 0:e.value)||n[s].value,selected:i===n[s].value}}))},Wt=function t(e,i,n,s,o){if(e.id!==s||e.open===false){return}this.optionsHandler(i,e.inputValue,D(this,F,"m",rt).call(this),e.id).then((t=>{var i;n.data["kup-list"].data=(i=D(this,F,"m",zt).call(this,t,o))!==null&&i!==void 0?i:[];e.comp.refresh()}))};Ct.style=W;export{Ct as kup_input_panel};
2
+ //# sourceMappingURL=p-4be79a7c.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as i,c as t,f as e,h as a,H as s,d as o}from"./p-d7c15b0e.js";import{k as n,g as r,s as l,h as p,N as c,f as h}from"./p-8c07fd42.js";import{c as m}from"./p-635bb4b3.js";import{F as f}from"./p-2b519589.js";import{F as u}from"./p-cc32b7a2.js";import{a as g}from"./p-e3062c19.js";import{F as d}from"./p-bbdf4a8f.js";import{M as _}from"./p-d4a879fc.js";import"./p-029c7cbe.js";import"./p-5d03c077.js";import"./p-1754ee9b.js";import"./p-df06309a.js";var k;(function(i){i["columns"]="Can set a specific number of columns";i["customStyle"]="Custom style of the component.";i["data"]="Actual data of the component";i["ripple"]="When enabled displays Material's ripple effect on clicked items.";i["rows"]="Cam set a specific number of rows. It overwrite the columns flow into rows flow"})(k||(k={}));class b{constructor(){this.load=false}toDebugString(){return"image-list state"}}const v=".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_imagelist_columns_mobile:var(--kup-imagelist-columns-mobile, 4);--kup_imagelist_columns_tablet:var(--kup-imagelist-columns-tablet, 6);--kup_imagelist_columns_desktop:var(--kup-imagelist-columns-desktop, 8);--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, var(--kup-space-03));--kup_imagelist_image_min_height:var(\n --kup-imagelist-image-min-height,\n var(--kup-space-09)\n );--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n var(--kup-radius-00)\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-text-secondary)\n );--kup_imagelist_item_background_color:var(\n --kup-imagelist-item-background-color,\n var(--kup-layer-1)\n );--kup_imagelist_item_background_color_hover:var(\n --kup-imagelist-item-background-color-hover,\n var(--kup-layer-1-hover)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;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}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup-imagelist-columns-mobile, var(--kup_imagelist_columns_mobile)), minmax(0px, 1fr));margin-top:1em;width:100%;grid-auto-flow:row}.image-list .f-cell{height:100%;width:100%}.image-list .f-cell .f-cell__content{height:100%}.image-list .f-cell .f-cell__content .image-list__wrapper{display:flex;flex-direction:column;justify-content:space-between;box-sizing:border-box;position:relative;height:100%}.image-list .f-cell .f-cell__content .image-list__wrapper.images{height:100%;justify-content:flex-end}.image-list .f-cell .f-cell__content .image-list__wrapper.images .f-image{position:unset;overflow:auto;height:100%;display:flex}.image-list__item{background-color:var(--kup_imagelist_item_background_color);border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__item:hover{background-color:var(--kup_imagelist_item_background_color_hover)}.image-list__image.f-image{position:absolute;padding:var(--kup-space-03);padding-bottom:0px;box-sizing:border-box;width:100%;height:calc(100% - 16px - var(--kup-space-03) * 2);overflow:hidden}.image-list__image.f-image .f-image__icon{mask-size:100% !important}.image-list__label{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;padding:var(--kup-space-03);font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}@media screen and (min-width: 678px){.image-list{grid-template-columns:repeat(var(--kup-imagelist-columns-tablet, var(--kup_imagelist_columns_tablet)), minmax(0px, 1fr));grid-gap:var(--kup-space-05)}}@media screen and (min-width: 1024px){.image-list{grid-template-columns:repeat(var(--kup-imagelist-columns-desktop, var(--kup_imagelist_columns_desktop)), minmax(0px, 1fr));grid-gap:var(--kup-space-05)}}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";const w=v;var x=undefined&&undefined.__classPrivateFieldGet||function(i,t,e,a){if(e==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?i!==t||!a:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?a:e==="a"?a.call(i):a?a.value:t.get(i)};var y=undefined&&undefined.__classPrivateFieldSet||function(i,t,e,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?i!==t||!s:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(i,e):s?s.value=e:t.set(i,e),e};var j,z,C,W,$,M,E,O,T,P,D,I,N,R,S;const F=class{constructor(e){i(this,e);this.kupClick=t(this,"kup-imagelist-click",6);this.kupContextMenu=t(this,"kup-imagelist-contextmenu",6);this.kupDblClick=t(this,"kup-imagelist-dblclick",6);j.add(this);this.state=new b;z.set(this,[]);C.set(this,n());W.set(this,{icon:"arrow_back",onClick:()=>{this.currentNode=x(this,C,"f").data.node.getParent(this.data,this.currentNode);if(!this.currentNode){this.navigationBarToggled=false}},styling:g.FLAT,wrapperClass:"navigation-bar__back"});$.set(this,{icon:"arrow_upward",onClick:()=>{this.currentNode=null;this.navigationBarToggled=false},styling:g.FLAT,wrapperClass:"navigation-bar__top"});M.set(this,void 0);E.set(this,false);O.set(this,[]);this.currentNode=null;this.navigationBarToggled=false;this.columns=[];this.customStyle="";this.data=[];this.ripple=false;this.rows=null;this.selectedNode=[];this.stateId="";this.store=undefined}initWithPersistedState(){if(this.store&&this.stateId){const i=this.store.getState(this.stateId);if(i!=null){this.currentNode=x(this,C,"f").data.node.findByStrTreeNodePath(this.data,i.selectedTreeNodePath)}}}persistState(){if(this.store&&this.stateId){let i=false;let t=this.currentNode?this.currentNode.id:"";if(!x(this,C,"f").objects.deepEqual(this.state.selectedTreeNodePath,t)){this.state.selectedTreeNodePath=t;i=true}if(!this.state.load){this.state.load=true;return}if(i){this.store.persistState(this.stateId,this.state)}}}selectNode(i){if(!i||i.length==0){return}this.currentNode=x(this,C,"f").data.node.find(this.data,i)}async getProps(i){return r(this,k,i)}async refresh(){e(this)}async setProps(i){l(this,k,i)}componentWillLoad(){x(this,C,"f").debug.logLoad(this,false);x(this,C,"f").language.register(this);x(this,C,"f").theme.register(this)}componentDidLoad(){x(this,j,"m",S).call(this);x(this,C,"f").debug.logLoad(this,true)}componentWillRender(){x(this,C,"f").debug.logRender(this,false)}componentDidRender(){const i=this.rootElement.shadowRoot;if(i&&this.ripple){const t=i.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(t){for(let i=0;i<t.length;i++){_.attachTo(t[i])}}}this.persistState();x(this,C,"f").debug.logRender(this,true)}render(){const i=!!this.currentNode;let t={};if(this.columns){if(this.columns.length===1){t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[0]}`,"--kup-imagelist-columns-desktop":`${this.columns[0]}`}}else if(this.columns.length===2){t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[0]}`,"--kup-imagelist-columns-desktop":`${this.columns[1]}`}}else if(this.columns.length===3){t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[1]}`,"--kup-imagelist-columns-desktop":`${this.columns[2]}`}}}let e=Object.assign({},t);if(this.rows!=null&&this.rows>0){const i={"grid-template-rows":`repeat(${this.rows}, minmax(0px, 1fr))`,"grid-auto-flow":`column`};e=Object.assign(Object.assign({},e),i)}return a(s,{key:"81da022bca5cec8e7a25ae5854126fc8d1df1949"},a("style",{key:"e7ca04de4d67ec2bfd6b069f560c9cf5f131a235"},x(this,C,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"bb9852654bdef8112a36d4fe096a39e4b925cd0c",id:m,ref:i=>{y(this,M,i,"f")}},a("div",{key:"3547692cbbe395329b3f9ee5f6c5a9c35171e7a6",class:"navigation-bar"},i?a("div",{class:`navigation-bar__wrapper ${this.navigationBarToggled?"navigation-bar__wrapper--active":""}`},a("div",{class:`navigation-bar__title`,onClick:()=>{this.navigationBarToggled=!this.navigationBarToggled}},a(f,{fit:true,resource:this.currentNode.icon,placeholderResource:this.currentNode.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"navigation-bar__title__image"}),a("div",{class:"navigation-bar__title__label"},this.currentNode.value)),a(u,Object.assign({},x(this,W,"f"),{label:x(this,C,"f").language.translate(p.BACK)})),a(u,Object.assign({},x(this,$,"f"),{label:x(this,C,"f").language.translate(p.TOP)}))):null),a("div",{key:"60eb2ce4d81bfdaf39310d9276edfab440200ab6",class:"image-list",style:e},...x(this,j,"m",P).call(this))))}disconnectedCallback(){x(this,C,"f").interact.unregister(x(this,O,"f"));x(this,C,"f").language.unregister(this);x(this,C,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{selectedNode:["selectNode"]}}};z=new WeakMap,C=new WeakMap,W=new WeakMap,$=new WeakMap,M=new WeakMap,E=new WeakMap,O=new WeakMap,j=new WeakSet,T=function i(t){const e={fit:true,resource:t.icon,placeholderResource:t.placeholderIcon,title:t.title,wrapperClass:"image-list__image",badgeData:t.badgeData};const s=a(f,Object.assign({},e));const o=a("div",{class:"image-list__label"},t.value);const n=e.resource.indexOf(".")>-1||e.resource.indexOf("/")>-1||e.resource.indexOf("\\")>-1;return a(d,{cell:{value:t.value,icon:t.icon,placeholderIcon:t.placeholderIcon,obj:t.obj},column:{name:"IMAGE",title:"Image"},component:this,density:h.NONE,row:Object.assign({},t)},a("div",{class:`image-list__wrapper${n?" images":""}`},!n&&a("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 24 24"}),s,o))},P=function i(){const t=[];const e=this.currentNode?this.currentNode.children:this.data;for(let i=0;e&&i<e.length;i++){const s=e[i];const o={"image-list__item":true,"mdc-ripple-surface":this.ripple?true:false};const n=a("div",{onContextMenu:i=>{i.preventDefault()},class:o},x(this,j,"m",T).call(this,s));t.push(n)}return t},D=function i(t,e){let a;if(t){for(let i=t.length-1;i>=0;i--){let e=t[i];if(!e.tagName){continue}if(e.classList.contains("f-cell")){a=e["kup-get-cell-props"]()}}}return{cell:a===null||a===void 0?void 0:a.cell,column:a===null||a===void 0?void 0:a.column,originalEvent:e,row:a===null||a===void 0?void 0:a.row}},I=function i(t){const e=x(this,j,"m",D).call(this,x(this,C,"f").getEventPath(t.target,this.rootElement),t);return e},N=function i(t){const e=x(this,j,"m",D).call(this,x(this,C,"f").getEventPath(t.target,this.rootElement),t);return e},R=function i(t){const e=x(this,j,"m",D).call(this,x(this,C,"f").getEventPath(t.target,this.rootElement),t);return e},S=function i(){x(this,O,"f").push(x(this,M,"f"));const t=i=>{if(x(this,E,"f")){y(this,E,false,"f");return}switch(i.button){case 0:const t={};for(const e in i){t[e]=i[e]}x(this,z,"f").push(setTimeout((()=>{var i;const e=x(this,j,"m",I).call(this,t);const a=e.row;if(((i=a===null||a===void 0?void 0:a.children)===null||i===void 0?void 0:i.length)>0){this.currentNode=a}this.kupClick.emit({comp:this,id:this.rootElement.id,details:e})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:x(this,j,"m",N).call(this,i)});break}};const e=i=>{switch(i.button){case 0:for(let i=0;i<x(this,z,"f").length;i++){clearTimeout(x(this,z,"f")[i]);x(this,C,"f").debug.logMessage(this,"Cleared clickHandler timeout("+x(this,z,"f")[i]+").")}y(this,z,[],"f");this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:x(this,j,"m",R).call(this,i)});break}};const a=i=>{if(i.pointerType==="pen"||i.pointerType==="touch"){y(this,E,true,"f");this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:x(this,j,"m",N).call(this,i)})}};x(this,C,"f").interact.on(x(this,M,"f"),c.HOLD,a);x(this,C,"f").interact.on(x(this,M,"f"),c.TAP,t);x(this,C,"f").interact.on(x(this,M,"f"),c.DOUBLETAP,e)};F.style=w;export{F as kup_image_list};
2
- //# sourceMappingURL=p-3edff8e7.entry.js.map
1
+ import{r as i,c as t,f as e,h as a,H as s,d as o}from"./p-d7c15b0e.js";import{k as n,g as r,s as l,h as p,N as c,f as h}from"./p-8c07fd42.js";import{c as m}from"./p-635bb4b3.js";import{F as f}from"./p-2b519589.js";import{F as u}from"./p-cc32b7a2.js";import{a as g}from"./p-e3062c19.js";import{F as d}from"./p-721b6a3c.js";import{M as _}from"./p-d4a879fc.js";import"./p-029c7cbe.js";import"./p-5d03c077.js";import"./p-1754ee9b.js";import"./p-df06309a.js";var k;(function(i){i["columns"]="Can set a specific number of columns";i["customStyle"]="Custom style of the component.";i["data"]="Actual data of the component";i["ripple"]="When enabled displays Material's ripple effect on clicked items.";i["rows"]="Cam set a specific number of rows. It overwrite the columns flow into rows flow"})(k||(k={}));class b{constructor(){this.load=false}toDebugString(){return"image-list state"}}const v=".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_imagelist_columns_mobile:var(--kup-imagelist-columns-mobile, 4);--kup_imagelist_columns_tablet:var(--kup-imagelist-columns-tablet, 6);--kup_imagelist_columns_desktop:var(--kup-imagelist-columns-desktop, 8);--kup_imagelist_background_color:var(\n --kup-imagelist-background-color,\n transparent\n );--kup_imagelist_columns:var(--kup-imagelist-columns, 4);--kup_imagelist_grid_gap:var(--kup-imagelist-grid-gap, var(--kup-space-03));--kup_imagelist_image_min_height:var(\n --kup-imagelist-image-min-height,\n var(--kup-space-09)\n );--kup_imagelist_item_border_radius:var(\n --kup-imagelist-item-border-radius,\n var(--kup-radius-00)\n );--kup_imagelist_item_height:var(--kup-imagelist-item-height, auto);--kup_imagelist_item_padding:var(--kup-imagelist-item-padding, 0);--kup_imagelist_item_width:var(--kup-imagelist-item-width, auto);--kup_imagelist_label_margin:var(\n --kup-imagelist-label-margin,\n 0 auto 1em auto\n );--kup_imagelist_navbar_background_color:var(\n --kup-imagelist-navbar-background-color,\n transparent\n );--kup_imagelist_primary_color:var(\n --kup-imagelist-primary-color,\n var(--kup-primary-color)\n );--kup_imagelist_primary_color_rgb:var(\n --kup-imagelist-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_imagelist_text_color:var(\n --kup-imagelist-text-color,\n var(--kup-text-secondary)\n );--kup_imagelist_item_background_color:var(\n --kup-imagelist-item-background-color,\n var(--kup-layer-1)\n );--kup_imagelist_item_background_color_hover:var(\n --kup-imagelist-item-background-color-hover,\n var(--kup-layer-1-hover)\n );display:block}.navigation-bar{align-items:center;background-color:var(--kup_imagelist_navbar_background_color);display:flex;justify-content:center}.navigation-bar__wrapper{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;max-width:100%;position:relative}.navigation-bar__wrapper--active .navigation-bar__title{background-color:rgba(var(--kup_imagelist_primary_color_rgb), 0.15);color:var(--kup_imagelist_primary_color)}.navigation-bar__back,.navigation-bar__top{--kup-button-primary-color-rgb:0}.navigation-bar__title{border-radius:16px;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;padding:0.75em 1em;user-select:none;transition:background-color 125ms, color 125ms;width:100%}.navigation-bar__title__image.f-image{margin:0}.navigation-bar__title__label{overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;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}.image-list{background-color:var(--kup_imagelist_background_color);display:grid;grid-gap:var(--kup_imagelist_grid_gap);grid-template-columns:repeat(var(--kup-imagelist-columns-mobile, var(--kup_imagelist_columns_mobile)), minmax(0px, 1fr));margin-top:1em;width:100%;grid-auto-flow:row}.image-list .f-cell{height:100%;width:100%}.image-list .f-cell .f-cell__content{height:100%}.image-list .f-cell .f-cell__content .image-list__wrapper{display:flex;flex-direction:column;justify-content:space-between;box-sizing:border-box;position:relative;height:100%}.image-list .f-cell .f-cell__content .image-list__wrapper.images{height:100%;justify-content:flex-end}.image-list .f-cell .f-cell__content .image-list__wrapper.images .f-image{position:unset;overflow:auto;height:100%;display:flex}.image-list__item{background-color:var(--kup_imagelist_item_background_color);border-radius:var(--kup_imagelist_item_border_radius);cursor:pointer;height:var(--kup_imagelist_item_height);padding:var(--kup_imagelist_item_padding);width:var(--kup_imagelist_item_width)}.image-list__item:hover{background-color:var(--kup_imagelist_item_background_color_hover)}.image-list__image.f-image{position:absolute;padding:var(--kup-space-03);padding-bottom:0px;box-sizing:border-box;width:100%;height:calc(100% - 16px - var(--kup-space-03) * 2);overflow:hidden}.image-list__image.f-image .f-image__icon{mask-size:100% !important}.image-list__label{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;padding:var(--kup-space-03);font-family:var(--kup-font-family);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}@media screen and (min-width: 678px){.image-list{grid-template-columns:repeat(var(--kup-imagelist-columns-tablet, var(--kup_imagelist_columns_tablet)), minmax(0px, 1fr));grid-gap:var(--kup-space-05)}}@media screen and (min-width: 1024px){.image-list{grid-template-columns:repeat(var(--kup-imagelist-columns-desktop, var(--kup_imagelist_columns_desktop)), minmax(0px, 1fr));grid-gap:var(--kup-space-05)}}:host(.kup-full-height){height:100%}:host(.kup-full-width){width:100%}:host(.kup-horizontal) .image-list{display:flex}:host(.kup-auto-grid) .image-list{display:flex;flex-wrap:wrap;justify-content:center}";const w=v;var x=undefined&&undefined.__classPrivateFieldGet||function(i,t,e,a){if(e==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?i!==t||!a:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?a:e==="a"?a.call(i):a?a.value:t.get(i)};var y=undefined&&undefined.__classPrivateFieldSet||function(i,t,e,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?i!==t||!s:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(i,e):s?s.value=e:t.set(i,e),e};var j,z,C,W,$,M,E,O,T,P,D,I,N,R,S;const F=class{constructor(e){i(this,e);this.kupClick=t(this,"kup-imagelist-click",6);this.kupContextMenu=t(this,"kup-imagelist-contextmenu",6);this.kupDblClick=t(this,"kup-imagelist-dblclick",6);j.add(this);this.state=new b;z.set(this,[]);C.set(this,n());W.set(this,{icon:"arrow_back",onClick:()=>{this.currentNode=x(this,C,"f").data.node.getParent(this.data,this.currentNode);if(!this.currentNode){this.navigationBarToggled=false}},styling:g.FLAT,wrapperClass:"navigation-bar__back"});$.set(this,{icon:"arrow_upward",onClick:()=>{this.currentNode=null;this.navigationBarToggled=false},styling:g.FLAT,wrapperClass:"navigation-bar__top"});M.set(this,void 0);E.set(this,false);O.set(this,[]);this.currentNode=null;this.navigationBarToggled=false;this.columns=[];this.customStyle="";this.data=[];this.ripple=false;this.rows=null;this.selectedNode=[];this.stateId="";this.store=undefined}initWithPersistedState(){if(this.store&&this.stateId){const i=this.store.getState(this.stateId);if(i!=null){this.currentNode=x(this,C,"f").data.node.findByStrTreeNodePath(this.data,i.selectedTreeNodePath)}}}persistState(){if(this.store&&this.stateId){let i=false;let t=this.currentNode?this.currentNode.id:"";if(!x(this,C,"f").objects.deepEqual(this.state.selectedTreeNodePath,t)){this.state.selectedTreeNodePath=t;i=true}if(!this.state.load){this.state.load=true;return}if(i){this.store.persistState(this.stateId,this.state)}}}selectNode(i){if(!i||i.length==0){return}this.currentNode=x(this,C,"f").data.node.find(this.data,i)}async getProps(i){return r(this,k,i)}async refresh(){e(this)}async setProps(i){l(this,k,i)}componentWillLoad(){x(this,C,"f").debug.logLoad(this,false);x(this,C,"f").language.register(this);x(this,C,"f").theme.register(this)}componentDidLoad(){x(this,j,"m",S).call(this);x(this,C,"f").debug.logLoad(this,true)}componentWillRender(){x(this,C,"f").debug.logRender(this,false)}componentDidRender(){const i=this.rootElement.shadowRoot;if(i&&this.ripple){const t=i.querySelectorAll(".mdc-ripple-surface:not(.mdc-ripple-upgraded)");if(t){for(let i=0;i<t.length;i++){_.attachTo(t[i])}}}this.persistState();x(this,C,"f").debug.logRender(this,true)}render(){const i=!!this.currentNode;let t={};if(this.columns){if(this.columns.length===1){t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[0]}`,"--kup-imagelist-columns-desktop":`${this.columns[0]}`}}else if(this.columns.length===2){t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[0]}`,"--kup-imagelist-columns-desktop":`${this.columns[1]}`}}else if(this.columns.length===3){t={"--kup-imagelist-columns-mobile":`${this.columns[0]}`,"--kup-imagelist-columns-tablet":`${this.columns[1]}`,"--kup-imagelist-columns-desktop":`${this.columns[2]}`}}}let e=Object.assign({},t);if(this.rows!=null&&this.rows>0){const i={"grid-template-rows":`repeat(${this.rows}, minmax(0px, 1fr))`,"grid-auto-flow":`column`};e=Object.assign(Object.assign({},e),i)}return a(s,{key:"81da022bca5cec8e7a25ae5854126fc8d1df1949"},a("style",{key:"e7ca04de4d67ec2bfd6b069f560c9cf5f131a235"},x(this,C,"f").theme.setKupStyle(this.rootElement)),a("div",{key:"bb9852654bdef8112a36d4fe096a39e4b925cd0c",id:m,ref:i=>{y(this,M,i,"f")}},a("div",{key:"3547692cbbe395329b3f9ee5f6c5a9c35171e7a6",class:"navigation-bar"},i?a("div",{class:`navigation-bar__wrapper ${this.navigationBarToggled?"navigation-bar__wrapper--active":""}`},a("div",{class:`navigation-bar__title`,onClick:()=>{this.navigationBarToggled=!this.navigationBarToggled}},a(f,{fit:true,resource:this.currentNode.icon,placeholderResource:this.currentNode.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"navigation-bar__title__image"}),a("div",{class:"navigation-bar__title__label"},this.currentNode.value)),a(u,Object.assign({},x(this,W,"f"),{label:x(this,C,"f").language.translate(p.BACK)})),a(u,Object.assign({},x(this,$,"f"),{label:x(this,C,"f").language.translate(p.TOP)}))):null),a("div",{key:"60eb2ce4d81bfdaf39310d9276edfab440200ab6",class:"image-list",style:e},...x(this,j,"m",P).call(this))))}disconnectedCallback(){x(this,C,"f").interact.unregister(x(this,O,"f"));x(this,C,"f").language.unregister(this);x(this,C,"f").theme.unregister(this)}get rootElement(){return o(this)}static get watchers(){return{selectedNode:["selectNode"]}}};z=new WeakMap,C=new WeakMap,W=new WeakMap,$=new WeakMap,M=new WeakMap,E=new WeakMap,O=new WeakMap,j=new WeakSet,T=function i(t){const e={fit:true,resource:t.icon,placeholderResource:t.placeholderIcon,title:t.title,wrapperClass:"image-list__image",badgeData:t.badgeData};const s=a(f,Object.assign({},e));const o=a("div",{class:"image-list__label"},t.value);const n=e.resource.indexOf(".")>-1||e.resource.indexOf("/")>-1||e.resource.indexOf("\\")>-1;return a(d,{cell:{value:t.value,icon:t.icon,placeholderIcon:t.placeholderIcon,obj:t.obj},column:{name:"IMAGE",title:"Image"},component:this,density:h.NONE,row:Object.assign({},t)},a("div",{class:`image-list__wrapper${n?" images":""}`},!n&&a("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 24 24"}),s,o))},P=function i(){const t=[];const e=this.currentNode?this.currentNode.children:this.data;for(let i=0;e&&i<e.length;i++){const s=e[i];const o={"image-list__item":true,"mdc-ripple-surface":this.ripple?true:false};const n=a("div",{onContextMenu:i=>{i.preventDefault()},class:o},x(this,j,"m",T).call(this,s));t.push(n)}return t},D=function i(t,e){let a;if(t){for(let i=t.length-1;i>=0;i--){let e=t[i];if(!e.tagName){continue}if(e.classList.contains("f-cell")){a=e["kup-get-cell-props"]()}}}return{cell:a===null||a===void 0?void 0:a.cell,column:a===null||a===void 0?void 0:a.column,originalEvent:e,row:a===null||a===void 0?void 0:a.row}},I=function i(t){const e=x(this,j,"m",D).call(this,x(this,C,"f").getEventPath(t.target,this.rootElement),t);return e},N=function i(t){const e=x(this,j,"m",D).call(this,x(this,C,"f").getEventPath(t.target,this.rootElement),t);return e},R=function i(t){const e=x(this,j,"m",D).call(this,x(this,C,"f").getEventPath(t.target,this.rootElement),t);return e},S=function i(){x(this,O,"f").push(x(this,M,"f"));const t=i=>{if(x(this,E,"f")){y(this,E,false,"f");return}switch(i.button){case 0:const t={};for(const e in i){t[e]=i[e]}x(this,z,"f").push(setTimeout((()=>{var i;const e=x(this,j,"m",I).call(this,t);const a=e.row;if(((i=a===null||a===void 0?void 0:a.children)===null||i===void 0?void 0:i.length)>0){this.currentNode=a}this.kupClick.emit({comp:this,id:this.rootElement.id,details:e})}),300));break;case 2:this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:x(this,j,"m",N).call(this,i)});break}};const e=i=>{switch(i.button){case 0:for(let i=0;i<x(this,z,"f").length;i++){clearTimeout(x(this,z,"f")[i]);x(this,C,"f").debug.logMessage(this,"Cleared clickHandler timeout("+x(this,z,"f")[i]+").")}y(this,z,[],"f");this.kupDblClick.emit({comp:this,id:this.rootElement.id,details:x(this,j,"m",R).call(this,i)});break}};const a=i=>{if(i.pointerType==="pen"||i.pointerType==="touch"){y(this,E,true,"f");this.kupContextMenu.emit({comp:this,id:this.rootElement.id,details:x(this,j,"m",N).call(this,i)})}};x(this,C,"f").interact.on(x(this,M,"f"),c.HOLD,a);x(this,C,"f").interact.on(x(this,M,"f"),c.TAP,t);x(this,C,"f").interact.on(x(this,M,"f"),c.DOUBLETAP,e)};F.style=w;export{F as kup_image_list};
2
+ //# sourceMappingURL=p-6f0164d2.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{a8 as e,a9 as s,d as t,a5 as n,aa as i,ab as c,ac as a,F as l,ad as r,ae as o,af as u,ag as f,ah as p,e as d}from"./p-8c07fd42.js";import{h as k,g as b,F as h}from"./p-d7c15b0e.js";import{F as m}from"./p-5d03c077.js";import{F as v}from"./p-1754ee9b.js";import{F as g}from"./p-2b519589.js";import{F as w,c as y}from"./p-df06309a.js";import{F as $}from"./p-cc32b7a2.js";var j;(function(e){e["customStyle"]="Custom style of the component.";e["data"]="The data of the list.";e["displayMode"]="Selects how the items must display their label and how they can be filtered for.";e["filter"]="Keeps string for filtering elements when filter mode is active";e["hideText"]="Hides rows' text, ideally to display a list of icons only.";e["isMenu"]="Defines whether the list is a menu or not.";e["keyboardNavigation"]="When true, enables items' navigation through arrow keys.";e["menuVisible"]="Sets the status of the menu, when false it's hidden otherwise it's visible.";e["roleType"]="Defines the type of selection. Values accepted: listbox, radiogroup or group.";e["selectable"]="Defines whether items are selectable or not.";e["showIcons"]="Displays the icons associated to each row when set to true.";e["twoLine"]="The list elements descriptions will be arranged in two lines."})(j||(j={}));var x;(function(e){e["LISTBOX"]="listbox";e["RADIOGROUP"]="radiogroup";e["GROUP"]="group"})(x||(x={}));var O;(function(e){e["CODE"]="code";e["DESCRIPTION"]="description";e["DESCRIPTION_AND_CODE"]="both"})(O||(O={}));var _;(function(e){e["SMALL"]="small";e["MEDIUM"]="medium"})(_||(_={}));const I=e=>{if(!e.sizing){e.sizing=_.MEDIUM}e.sizing.toLowerCase()===_.SMALL;const s={switch:true,"switch--checked":e.checked,"switch--disabled":e.disabled,[`switch--${e.sizing}`]:e.sizing?true:false};return k("div",Object.assign({class:`f-switch ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),k("div",{class:`form-field ${e.leadingLabel?"form-field--align-end":""}`},k("div",{class:s},k("div",{class:"switch__track"}),k("div",{class:"switch__thumb-underlay"},k("div",{class:"switch__thumb"},k("input",{type:"checkbox",class:"switch__native-control",role:"switch",checked:e.checked,disabled:e.disabled,value:e.checked?"on":"off",onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus})))),k("label",{onClick:e.onChange},e.label)))};const C=e=>{if(!e.centeredLabel&&!e.centeredLabel!==false){e.centeredLabel=true}let s=`f-progress-bar ${e.danger?"kup-danger":""} ${e.animated?"kup-animated":""} ${e.padded?"kup-padded":""} ${e.info?"kup-info":""} ${e.slim?"kup-slim":""} ${e.striped?"kup-striped":""} ${e.secondary?"kup-secondary":""} ${e.slim?"kup-slim":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`;let t="pie";let n=undefined;if(e.isRadial){s+=" pie-wrapper is-radial"}else{s+=" progress-bar"}let i=undefined;const c={width:`${e.value}%`};if(!e.centeredLabel){i=c;if(e.value>2){s+=" text-color-on-primary"}}else if(e.value>49){s+=" text-color-on-primary"}let a=null;if(e.icon){a=z(e)}else{if(!e.hideLabel){if(e.isRadial){if(e.label){a=k("span",{class:"label"},e.label)}else{a=k("span",{class:"label"},e.value,k("span",{class:"smaller"},"%"))}}else{if(e.label){a=e.label}else{a=e.value+"%"}}}}if(e.value>0){t+=" has-value";if(e.value>50){t+=" is-more-than-half"}else{t+=" is-less-than-half"}}if(e.isRadial){return k("div",{class:s},a,k("div",{class:t},k("div",{style:n,class:"left-side half-circle"}),k("div",{class:"right-side half-circle"})),k("div",{class:"shadow"}))}else{return k("div",{class:s},k("div",{class:"progress-bar-percentage",style:c},k("span",{style:i},a)))}};function z(e){if(!e.icon){return undefined}if(e.icon.indexOf(".")>-1||e.icon.indexOf("/")>-1||e.icon.indexOf("\\")>-1){return k("span",{class:"label kup-icon is-image"},k("img",{src:e.icon}))}else{let s=`url('${b(`./assets/svg/${e.icon}.svg`)}') no-repeat center`;let t={mask:s,webkitMask:s};return k("span",{style:t,class:"label kup-icon"})}}var N;(function(e){e["RADIO"]="radio";e["CHEVRON"]="chevron"})(N||(N={}));const F=e=>{var s;const t=!!e.columns;const n=[];const i=e.type||N.RADIO;for(let t=0;t<((s=e.data)===null||s===void 0?void 0:s.length);t++){const s=e.data[t];const c={radio:true,"radio--checked":s.checked?true:false,"radio--disabled":e.disabled?true:false,[`radio--${e.type}`]:e.type?true:false};n.push(k("div",{class:`form-field \n ${e.leadingLabel?" form-field--align-end":""} ${e.disabled?"radio--disabled":""}`},k("div",{class:c},i===N.RADIO?k("input",{class:"radio__native-control",type:"radio",name:"radio-element",value:s.value,checked:s.checked,disabled:e.disabled,onBlur:e.onBlur,onChange:e.onChange?e.onChange.bind(e.onChange,t):null,onFocus:e.onFocus}):k(h,null,s.checked?k(g,{resource:"check",sizeX:"14px",sizeY:"14px"}):k(g,{sizeX:"14px",sizeY:"14px",onClick:e.onChange?e.onChange.bind(e.onChange,t):null})),i===N.RADIO&&k("div",{class:"radio__background"},k("div",{class:"radio__outer-circle"}),k("div",{class:"radio__inner-circle"}))),k("label",{htmlFor:"radio-element",onClick:e.onChange?e.onChange.bind(e.onChange,t):null},s.label?s.label:"")))}const c={"--kup_radio_columns":t?`repeat(${e.columns}, 1fr)`:""};return k("div",{class:`f-radio radio-wrapper\n ${t?"radio-wrapper-grid":""} ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""} ${e.horizontal?"kup-horizontal":""}`,style:c},n)};const H=e=>{if(!e.maxValue){e.maxValue=5}return k("div",{class:`f-rating ${e.disabled?"disabled":""} ${e.danger?"kup-danger":""} ${e.info?"kup-info":""} ${e.secondary?"kup-secondary":""} ${e.success?"kup-success":""} ${e.warning?"kup-warning":""} ${e.wrapperClass?e.wrapperClass:""}`},D(e))};function D(e){const s=[];for(let t=1;t<=e.maxValue;t++){if(t<=e.value){s.push(k("span",{class:"rating",onClick:e.onClick?e.onClick.bind(e.onClick,t):null},"★"))}else{s.push(k("span",{class:"rating",onClick:e.onClick?e.onClick.bind(e.onClick,t):null},"☆"))}}return s}const T=document.documentElement;const M=(i,c)=>{var a;const l=i.cell;const r=i.column;const u=i.row;const f=i.shape?i.shape:l.shape?l.shape:r.shape?r.shape:null;const d=!T.ketchup.objects.isEmptyKupObj(l.obj);let b=false;if(l.hasOwnProperty("isEditable")){b=l.isEditable}else if(r.hasOwnProperty("isEditable")){b=r.isEditable}b=b&&i.editable;if(l.options){l.data=(a=S(l,r))!==null&&a!==void 0?a:l.data}const h=i.previousValue!==l.value?l.value:"";const m=T.ketchup.data.cell.getType(l,f);const v=Object.assign({},l.data);let w=l.cssClass?l.cssClass:r.cssClass?r.cssClass:"";if(i.component.legacyLook){w+=" monospace c-pre"}const y={"f-cell":true,[o.OBJ]:d?true:false,[m+"-cell"]:true,[i.wrapperClass]:i.wrapperClass?true:false,[i.density]:i.density&&m!==n.BAR?true:false,[w]:w?true:false};let $=h;if(!l.data){U(m,l)}if(b&&e.includes(m)){$=G(m,y,l,r,i)}else if(l.data&&s.includes(m)){if(i.setSizes){B(m,v,l)}if(!i.renderKup){const e="cell-"+m+" placeholder";$=k("span",{class:e})}else{$=L(m,y,v,l,u,r,i)}}else{if(i.setSizes){A(m,v,l,i)}$=P(m,v,$,y,l,r,i)}let j=null;if(!b&&(r.icon||l.icon)&&$){const e={color:`rgba(var(${t.TEXT}-rgb), 0.375)`,resource:l.icon?l.icon:r.icon,placeholderResource:l.placeholderIcon?l.placeholderIcon:r.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"};j=k(g,Object.assign({},e))}let x=null;if(T.ketchup.debug.isDebug()&&d){x=l.obj.t+"; "+l.obj.p+"; "+l.obj.k+";"}else if(l.title!=null&&l.title.trim()!=""){x=l.title}let O=null;if(l.info){const e=Object.assign({},l.info);if(!e.color){e.color=`var(${t.INFO})`}if(!e.icon){e.icon="info"}const s={color:e.color,resource:e.icon,placeholderResource:e.placeholderIcon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"};O=k(g,Object.assign({},s))}return k("div",{onKeyUp:e=>q(e,i,m,p.KEYUP),class:y,"kup-get-cell-props":()=>i,ref:e=>l.element=e,style:l.style},k("div",{class:"f-cell__content",style:l.styleContent,title:x},i.cellActionIcon&&k(g,{resource:"more_vert",sizeX:"16px",sizeY:"16px",wrapperClass:`f-cell__iconfunction ${m===n.NUMBER?"left":"right"}`,onClick:i.cellActionIcon.onClick,tabIndex:0}),c&&c.length>0?c:[i.indents,O,j,$]))};const S=(e,s)=>{if(!e){return null}const t=e.options;const i=s.title;const c=e.value;const a=T.ketchup.data.cell.getType(e,e.shape);const l=new Map([[n.RADIO,E.bind(undefined)],[n.AUTOCOMPLETE,X.bind(undefined)],[n.COMBOBOX,X.bind(undefined)]]);const r=l.get(a);return r?r(t,i,c,e,s.name):null};const E=(e,s,t)=>i(t,e);const X=(e,s,t)=>{const n=c(t,s,[]);n.data["kup-list"].data=R(e,t);return n};const R=(e,s)=>{const t=W.get(e.type);if(t){return t(e,s)}else{return e.map((e=>({value:e.label,id:e.id,selected:s===e.id})))}};const V=(e,s)=>e.children.map((e=>{var t;return{id:e.content.codice,value:e.content.testo,selected:s===e.content.codice,children:((t=e.children)===null||t===void 0?void 0:t.length)?V(e,s):[]}}));const Y=(e,s)=>e.children.map((e=>{var t;return{id:e.obj.k,value:e.value,selected:s===e.obj.k,children:((t=e.children)===null||t===void 0?void 0:t.length)?Y(e,s):[]}}));const K=(e,s)=>e.rows.map((e=>{var t;const n=e.fields||e.cells;const[i,c]=Object.keys(n);return{id:n[i].value,value:((t=n[c])===null||t===void 0?void 0:t.value)||n[i].value,selected:s===n[i].value}}));const W=new Map([["SmeupTreeNode",V.bind(undefined)],["SmeupDataTree",Y.bind(undefined)],["SmeupTable",K.bind(undefined)],["SmeupDataTable",K.bind(undefined)]]);function A(e,s,t,i){var c;switch(e){case n.CHECKBOX:case n.ICON:if(!s.sizeX){s.sizeX="18px"}if(!s.sizeY){s.sizeY="18px"}if(t.style){if(!t.style.height){t.style["minHeight"]=s.sizeY}}else{t.style={minHeight:s.sizeY}}break;case n.IMAGE:const e=((c=i.cell)===null||c===void 0?void 0:c.value)||"";const l=e.indexOf(".")>-1||e.indexOf("/")>-1||e.indexOf("\\")>-1;if(i.component.rootElement.tagName===a.DATA_TABLE&&!l){if(!s.sizeX&&!s.sizeY){s.sizeX="100%";s.sizeY="64px";s.wrapperClass="noWidth"}else{if(!s.sizeX){s.sizeX="100%";s.wrapperClass="noWidth"}if(!s.sizeY){s.sizeY="auto"}}}if(i.component.rootElement.tagName===a.BOX){if(!s.sizeY){s.sizeY="auto"}if(s.fit===undefined){s.fit=true}}else if(!s.sizeX){s.sizeX="auto"}if(!s.sizeY){s.sizeY="64px"}break}}function B(e,s,t){switch(e){case n.BAR:if(!s.sizeY){s.sizeY="26px"}break;case n.BUTTON:let e="";if(s.label){e="36px"}if(t.style){if(!t.style.height){t.style["minHeight"]=e}}else{t.style={minHeight:e}}break;case n.CHART:if(!s.sizeX){s.sizeX="100%"}if(!s.sizeY){s.sizeY="100%"}break;case n.CHIP:if(t.style){if(!t.style.height){t.style["minHeight"]="40px"}}else{t.style={minHeight:"40px"}}break;case n.RADIO:if(t.style){if(!t.style.height){t.style["minHeight"]="40px"}}else{t.style={minHeight:"40px"}}break}}function G(e,s,t,i,c){var a,r;switch(e){case n.AUTOCOMPLETE:return k("kup-autocomplete",Object.assign({key:i.name+c.row.id,initialValue:t.value},t.data,{class:Z(c)?"kup-full-width":"","onkup-autocomplete-change":s=>q(s,c,e,p.UPDATE),"onkup-autocomplete-input":s=>q(s,c,e,p.INPUT),"onkup-autocomplete-iconclick":s=>q(s,c,e,p.ICON_CLICK)}));case n.CHECKBOX:if(Q(c)){s[o.C_CENTERED]=true}if(t.shape===l.INPUT_CHECKBOX){return k("input",{checked:t.value==="on"||t.value==="1"?true:false,class:"input-checkbox",onChange:s=>q(s,c,e,p.UPDATE),type:"checkbox"})}else{return k(m,Object.assign({},t.data,{onChange:s=>q(s,c,e,p.UPDATE)}))}case n.CHIP:return k("kup-chip",Object.assign({},t.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":s=>q(s,c,e,p.UPDATE)}),k("kup-text-field",Object.assign({fullWidth:true,slot:"field"},t.slotData)));case n.COLOR_PICKER:return k("kup-color-picker",Object.assign({key:i.name+c.row.id,initialValue:t.value},t.data,{class:Z(c)?"kup-full-width":"",disabled:false,"onkup-colorpicker-change":s=>q(s,c,e,p.UPDATE)}));case n.COMBOBOX:return k("kup-combobox",Object.assign({key:i.name+c.row.id,initialValue:t.value},t.data,{class:Z(c)?"kup-full-width":"","onkup-combobox-change":s=>q(s,c,e,p.UPDATE),"onkup-combobox-input":s=>q(s,c,e,p.INPUT),"onkup-combobox-iconclick":s=>q(s,c,e,p.ICON_CLICK)}));case n.DATE:return k("kup-date-picker",Object.assign({key:i.name+c.row.id,initialValue:t.value},t.data,{class:Z(c)?"kup-full-width":"","onkup-datepicker-change":s=>q(s,c,e,p.UPDATE),"onkup-datepicker-input":s=>q(s,c,e,p.INPUT)}));case n.MULTI_AUTOCOMPLETE:return k("kup-chip",Object.assign({displayId:true},t.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":s=>q(s,c,e,p.UPDATE)}),k("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:O.DESCRIPTION_AND_CODE,selectMode:O.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":s=>q(s,c,e,p.INPUT),"onkup-autocomplete-iconclick":s=>q(s,c,e,p.ICON_CLICK),showDropDownIcon:false},t.slotData)));case n.MULTI_COMBOBOX:return k("kup-chip",Object.assign({displayId:true},t.data,{type:w.INPUT,enableInput:true,"onKup-chip-change":s=>q(s,c,e,p.UPDATE)}),k("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:O.DESCRIPTION_AND_CODE,selectMode:O.DESCRIPTION_AND_CODE,"onkup-combobox-input":s=>q(s,c,e,p.INPUT),"onkup-combobox-iconclick":s=>q(s,c,e,p.ICON_CLICK)},t.slotData)));case n.RADIO:return k(F,Object.assign({},t.data,{disabled:false,onChange:(s,n)=>{const i=t.data.data;for(let e=0;e<i.length;e++){const t=i[e];if(e===s){t.checked=true}else{t.checked=false}}q(n,c,e,p.UPDATE)}}));case n.RATING:return k("kup-rating",Object.assign({key:i.name+c.row.id},t.data,{disabled:false,"onkup-rating-click":s=>q(s,c,e,p.UPDATE)}));case n.SWITCH:return k(I,Object.assign({},t.data,{disabled:false,onChange:s=>q(s,c,e,p.UPDATE)}));case n.TIME:return k("kup-time-picker",Object.assign({key:i.name+c.row.id,initialValue:t.value},t.data,{class:Z(c)?"kup-full-width":"","onkup-timepicker-change":s=>q(s,c,e,p.UPDATE),"onkup-timepicker-input":s=>q(s,c,e,p.INPUT)}));case n.OBJECT:return k(v,Object.assign({icon:"table"},t.data,{disabled:false,onIconClick:s=>q(s,c,e,p.ICON_CLICK)}));case n.NUMBER:s[o.C_RIGHT_ALIGNED]=true;case n.LINK:case n.STRING:const u=s=>q(s,c,e,p.UPDATE);const f=s=>q(s,c,e,p.INPUT);const d=e===n.NUMBER?"number":null;const b=e===n.NUMBER&&t.value?T.ketchup.math.numberifySafe(t.value).toString():t.value;if(t.shape===l.INPUT_FIELD){return k("input",{class:"input-field",onChange:u,onInput:f,type:d,value:b,maxLength:(r=(a=i.cellData)===null||a===void 0?void 0:a.maxLength)!==null&&r!==void 0?r:-1})}else{return k(v,Object.assign({inputType:d,fullWidth:Z(c)?true:false},t.data,{icon:t.data&&t.data.icon?t.data.icon:t.icon?t.icon:i.icon?i.icon:null,value:b,onChange:u,onInput:f,onIconClick:s=>q(s,c,e,p.ICON_CLICK)}))}}}function P(e,s,t,i,c,a,l){switch(e){case n.AUTOCOMPLETE:case n.COMBOBOX:case n.DATE:case n.DATETIME:case n.TIME:if(t&&t!=""){const e=f(a,c);return k("div",{class:"f-cell__text"},e)}return t;case n.CHECKBOX:if(Q(l)){i[o.C_CENTERED]=true}return k(g,{resource:s.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case n.EDITOR:return k("div",{innerHTML:c.value});case n.ICON:if(Q(l)){i[o.C_CENTERED]=true}if(s.badgeData){i[o.C_PADDED]=true}return k(g,Object.assign({},s));case n.IMAGE:if(Q(l)){i[o.C_CENTERED]=true}if(s.badgeData){i[o.C_PADDED]=true}return k(g,Object.assign({},s));case n.LINK:return k("a",{href:t,target:"_blank"},c.value);case n.NUMBER:if(t&&t!=""){const e=T.ketchup.math.numberifySafe(c.value);const s=f(a,c);if(e<0){i[o.TEXT_DANGER]=true}if(Q(l)){i[o.C_RIGHT_ALIGNED]=true}return k("div",{class:"f-cell__text"},s)}return k("div",{class:"f-cell__text"},t);case n.SWITCH:if(Q(l)){i[o.C_CENTERED]=true}s["disabled"]=true;return k(I,Object.assign({},s));default:return k("div",{class:"f-cell__text"},t)}}function L(e,s,t,i,c,a,l){switch(e){case n.BAR:if(!t.data){return k("kup-image",Object.assign({key:a.name+l.row.id,sizeX:"250px"},t))}else{const e={height:t.sizeY,width:"100%"};return k("div",{style:e},k(g,Object.assign({},t)))}case n.BUTTON:if(Q(l)){s[o.C_CENTERED]=true}return k($,Object.assign({},t,{onClick:s=>q(s,l,e,p.CLICK)}));case n.BUTTON_LIST:if(Q(l)){s[o.C_CENTERED]=true}t["data-storage"]={cell:i,row:c,column:a};return k("kup-button-list",Object.assign({key:a.name+l.row.id},t));case n.CHART:if(Q(l)){s[o.C_CENTERED]=true}return k("kup-chart",Object.assign({key:a.name+l.row.id},t));case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:case n.CHIP:return k(y,Object.assign({},t));case n.COLOR_PICKER:return k("kup-color-picker",Object.assign({key:a.name+l.row.id},t,{class:Z(l)?"kup-full-width":"",disabled:true}));case n.GAUGE:return k("kup-gauge",Object.assign({key:a.name+l.row.id,value:T.ketchup.math.numberifySafe(i.value),"width-component":"280px"},t));case n.KNOB:case n.PROGRESS_BAR:return t.customStyle?k("kup-progress-bar",Object.assign({key:a.name+l.row.id},t)):k(C,Object.assign({},t));case n.RADIO:if(Q(l)){s[o.C_CENTERED]=true}t["disabled"]=c.readOnly;return k(F,Object.assign({},t));case n.RATING:return k(H,Object.assign({},t,{disabled:true}));case n.OBJECT:return k(v,Object.assign({icon:"table"},t,{disabled:true}))}}function U(e,s){function t(e){return e.toUpperCase().startsWith("SHAPE;BAR")}function i(e){return e.toUpperCase().startsWith("SHAPE;")}function c(e){return e.toUpperCase().startsWith("BCOLOR;")}function a(e){return e.toUpperCase().startsWith("HEIGHT;")}function l(e){return e.toUpperCase().startsWith("SEP;")||e.toUpperCase().startsWith("DIV;")||e.toUpperCase().startsWith("ARW;")||e.toUpperCase().startsWith("GRID;")}function r(e){if(!e){return null}const s=e.split("\\\\AND\\");const t=[];for(const e of s){const s=o(e);if(s){t.push(...s)}else{return null}}return t}function o(e){const s={};const n=e.split("\\\\");const r=[];for(const e of n){if(e){if(l(e)){return null}if(i(e)){if(!t(e)){return null}else{const t=e.split(";");if(t.length===3){const e=t[2].replace(",",".");if(!isNaN(parseFloat(e))){s.width=`${e}%`}}}}else if(c(e));else if(a(e)){const t=e.substring("HEIGHT;".length).replace(",",".");if(!isNaN(parseFloat(t))){s.height=`${t}%`}}else{r.push(o(e,s))}}return r.length?r:null}function o(e,s){const t=Object.assign({},s);const n=e.split(";");if(n.length>=1){const e=/R(\d+)G(\d+)B(\d+)/;const s=e.exec(n[0]);if(s){const[,e,n,i]=s;if(!isNaN(parseInt(e,10))&&!isNaN(parseInt(n,10))&&!isNaN(parseInt(i,10))){t.color=`rgb(${parseInt(e)},${parseInt(n)},${parseInt(i)})`}}if(n.length>=2){const e=n[1].replace(",",".");if(!isNaN(parseFloat(e))){t.width=`${e}%`}}}return t}}s.data={};const u=()=>{var e;const t=(e=s.value)===null||e===void 0?void 0:e.split(";");if((t===null||t===void 0?void 0:t[t.length-1].trim())===""){t.pop()}if(t&&t.length){s.data.data=[];for(let e of t){s.data.data.push({id:e,value:e})}}};switch(e){case n.CHECKBOX:case n.SWITCH:s.data.checked=s.value==="1"?true:false;break;case n.BAR:if(i(s.value)){s.data.isCanvas=true;s.data.resource=s.value}else{s.data.data=r(s.value)}break;case n.BUTTON:s.data.label=s.value;break;case n.CHART:Object.assign(s.data,{sizeX:"100px",sizeY:"100px",offlineMode:{value:s.value,shape:"pie"}});break;case n.BUTTON_LIST:case n.CHIP:case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:case n.RADIO:u();break;case n.COLOR_PICKER:s.data.initialValue=s.value;break;case n.GAUGE:case n.KNOB:case n.PROGRESS_BAR:case n.RATING:s.data.value=parseInt(s.value);break;case n.ICON:case n.IMAGE:s.data.resource=s.value;break}}function q(e,s,t,i){const c=s.cell;const a=s.column;const l=s.component;const r=s.row;if(i===p.UPDATE){let s=J(e,t);switch(t){case n.AUTOCOMPLETE:case n.COMBOBOX:case n.DATE:case n.TIME:if(c.data){c.data["initialValue"]=s}break;case n.CHECKBOX:case n.SWITCH:s=s==="on"?"0":"1";if(c.data){c.data.checked=s==="0"?false:true}break;case n.RADIO:break;case n.CHIP:case n.MULTI_AUTOCOMPLETE:case n.MULTI_COMBOBOX:s=e.detail.stringifiedValues;if(c.data){c.data.data=e.detail.comp.data}break}if(c.obj){c.obj.k=s.toString()}c.value=s.toString();c.displayedValue=null;c.displayedValue=f(a,c)}if(l&&l.rootElement){const s=new CustomEvent(i,{bubbles:true,cancelable:true,composed:true,detail:{comp:l,id:l.rootElement.id,cell:c,column:a,event:e,row:r,type:t}});l.rootElement.dispatchEvent(s);if(i===p.UPDATE){try{l.refresh()}catch(e){T.ketchup.debug.logMessage(l,e,d.ERROR)}}}}function J(e,s){const t=!!(e.target.tagName==="INPUT");let i=t?e.target.value:e.detail.value;if(s===n.CHECKBOX&&t){i=e.target.checked?"off":"on"}if(s===n.NUMBER&&t){i=T.ketchup.math.formattedStringToNumberString(i,"")}return i}function Q(e){var s;return u.includes((s=e.component)===null||s===void 0?void 0:s.rootElement.tagName)}function Z(e){var s;return r.includes((s=e.component)===null||s===void 0?void 0:s.rootElement.tagName)}export{M as F,O as I,x as K,j as a,C as b,F as c,H as d,_ as e,I as f};
2
+ //# sourceMappingURL=p-721b6a3c.js.map