@sme.up/ketchup 8.2.2 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/cjs/{f-button-76a75669.js → f-button-d073c79d.js} +1 -1
  2. package/dist/cjs/{f-cell-6f902849.js → f-cell-b7ddd6b3.js} +6 -4
  3. package/dist/cjs/{f-chip-fe9cffed.js → f-chip-e51596be.js} +2 -2
  4. package/dist/cjs/{f-image-47976ad7.js → f-image-fb2721a7.js} +1 -1
  5. package/dist/cjs/{f-paginator-utils-f13f036f.js → f-paginator-utils-5bce6819.js} +2 -2
  6. package/dist/cjs/{f-text-field-865a6386.js → f-text-field-acb225f3.js} +1 -1
  7. package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
  8. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +10 -8
  9. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  10. package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
  11. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  12. package/dist/cjs/kup-dash-list.cjs.entry.js +1 -1
  13. package/dist/cjs/kup-dash_2.cjs.entry.js +1 -1
  14. package/dist/cjs/kup-dashboard.cjs.entry.js +4 -4
  15. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  16. package/dist/cjs/kup-echart.cjs.entry.js +128 -2
  17. package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
  18. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
  20. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
  22. package/dist/cjs/{kup-manager-695bbbe3.js → kup-manager-39f99670.js} +2 -0
  23. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  24. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  25. package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
  26. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  27. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  28. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  29. package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
  30. package/dist/collection/assets/echart.js +248 -0
  31. package/dist/collection/components/kup-data-table/kup-data-table.js +2 -0
  32. package/dist/collection/components/kup-echart/kup-echart-declarations.js +2 -0
  33. package/dist/collection/components/kup-echart/kup-echart.js +125 -1
  34. package/dist/collection/components/kup-form/kup-form.css +3 -1
  35. package/dist/collection/f-components/f-cell/f-cell-declarations.js +2 -0
  36. package/dist/collection/f-components/f-cell/f-cell.js +2 -0
  37. package/dist/components/kup-autocomplete2.js +7 -1
  38. package/dist/components/kup-echart2.js +127 -1
  39. package/dist/esm/{f-button-c5b36ae1.js → f-button-38ee97e6.js} +1 -1
  40. package/dist/esm/{f-cell-fbfe9fe0.js → f-cell-763793f8.js} +6 -4
  41. package/dist/esm/{f-chip-038e9404.js → f-chip-010179a2.js} +2 -2
  42. package/dist/esm/{f-image-c356f4c5.js → f-image-77ac3ca0.js} +1 -1
  43. package/dist/esm/{f-paginator-utils-58466d55.js → f-paginator-utils-32b2c046.js} +2 -2
  44. package/dist/esm/{f-text-field-98905f74.js → f-text-field-8a683258.js} +1 -1
  45. package/dist/esm/kup-accordion.entry.js +2 -2
  46. package/dist/esm/kup-autocomplete_27.entry.js +10 -8
  47. package/dist/esm/kup-box.entry.js +7 -7
  48. package/dist/esm/kup-calendar.entry.js +4 -4
  49. package/dist/esm/kup-cell.entry.js +5 -5
  50. package/dist/esm/kup-dash-list.entry.js +1 -1
  51. package/dist/esm/kup-dash_2.entry.js +1 -1
  52. package/dist/esm/kup-dashboard.entry.js +4 -4
  53. package/dist/esm/kup-drawer.entry.js +1 -1
  54. package/dist/esm/kup-echart.entry.js +128 -2
  55. package/dist/esm/kup-family-tree.entry.js +3 -3
  56. package/dist/esm/kup-iframe.entry.js +1 -1
  57. package/dist/esm/kup-image-list.entry.js +6 -6
  58. package/dist/esm/kup-lazy.entry.js +1 -1
  59. package/dist/esm/kup-magic-box.entry.js +2 -2
  60. package/dist/esm/{kup-manager-74e46edc.js → kup-manager-e2f7edf1.js} +2 -0
  61. package/dist/esm/kup-nav-bar.entry.js +1 -1
  62. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  63. package/dist/esm/kup-photo-frame.entry.js +1 -1
  64. package/dist/esm/kup-planner.entry.js +2 -2
  65. package/dist/esm/kup-probe.entry.js +1 -1
  66. package/dist/esm/kup-qlik.entry.js +1 -1
  67. package/dist/esm/kup-snackbar.entry.js +3 -3
  68. package/dist/ketchup/ketchup.esm.js +1 -1
  69. package/dist/ketchup/{p-b813af24.entry.js → p-07e56ef4.entry.js} +1 -1
  70. package/dist/ketchup/{p-9c7b9ff2.js → p-0e961148.js} +1 -1
  71. package/dist/ketchup/{p-f1da8b9c.entry.js → p-166356dc.entry.js} +1 -1
  72. package/dist/ketchup/{p-46daf529.js → p-2751c4ba.js} +1 -1
  73. package/dist/ketchup/p-2866e08c.entry.js +1 -0
  74. package/dist/ketchup/{p-0d533d24.entry.js → p-3a64fbe0.entry.js} +1 -1
  75. package/dist/ketchup/{p-487f4a33.entry.js → p-3fe1eada.entry.js} +2 -2
  76. package/dist/ketchup/{p-1f5eb8e6.entry.js → p-40312367.entry.js} +1 -1
  77. package/dist/ketchup/{p-2cc57793.entry.js → p-46ad61d1.entry.js} +1 -1
  78. package/dist/ketchup/{p-008cde2a.entry.js → p-4cb43c62.entry.js} +1 -1
  79. package/dist/ketchup/{p-e16c04d8.js → p-5443df89.js} +1 -1
  80. package/dist/ketchup/{p-78eaa526.js → p-5b1ae769.js} +1 -1
  81. package/dist/ketchup/{p-73ab15cd.entry.js → p-5d7b542c.entry.js} +1 -1
  82. package/dist/ketchup/{p-6efda31f.entry.js → p-6814b44c.entry.js} +1 -1
  83. package/dist/ketchup/{p-c20c4f66.js → p-79f78bdc.js} +1 -1
  84. package/dist/ketchup/{p-a9151ee8.entry.js → p-7c9ca424.entry.js} +1 -1
  85. package/dist/ketchup/{p-cd1f9e76.entry.js → p-86a3a9ef.entry.js} +1 -1
  86. package/dist/ketchup/{p-efd07a7f.entry.js → p-9fe8bcf4.entry.js} +1 -1
  87. package/dist/ketchup/{p-c3e84081.entry.js → p-bab43d3f.entry.js} +1 -1
  88. package/dist/ketchup/{p-8d992de0.entry.js → p-be933dfa.entry.js} +1 -1
  89. package/dist/ketchup/{p-d5491e4f.js → p-d938d1cd.js} +1 -1
  90. package/dist/ketchup/{p-2ac7d95a.entry.js → p-d942bfd3.entry.js} +1 -1
  91. package/dist/ketchup/{p-26765429.entry.js → p-dd183d2f.entry.js} +1 -1
  92. package/dist/ketchup/{p-a015c95b.entry.js → p-e0e4e3e2.entry.js} +1 -1
  93. package/dist/ketchup/{p-bb93aa7e.entry.js → p-e96d0d28.entry.js} +1 -1
  94. package/dist/ketchup/{p-f023195c.entry.js → p-eb42d212.entry.js} +1 -1
  95. package/dist/ketchup/{p-e9d2a964.entry.js → p-f3c25aae.entry.js} +4 -4
  96. package/dist/ketchup/{p-dfab37a3.entry.js → p-f520b898.entry.js} +1 -1
  97. package/dist/ketchup/{p-ffbd77d5.js → p-fe8c8e11.js} +1 -1
  98. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +3 -1
  99. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +2 -0
  100. package/package.json +1 -1
  101. package/dist/ketchup/p-59919641.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as s,c as t,h as i}from"./p-3da7e4c6.js";import{k as l,af as h}from"./p-46daf529.js";const e=class{constructor(i){s(this,i),this.dashClick=t(this,"kup-dash-click",7),this.kupManager=l(),this.layout="1",this.fontsize="",this.active=!1,this.columnsNumber=1,this.fullWidth=!0,this.horizontal=!1,this.iconColor=[],this.valueColor=[],this.textColor=[],this.data=void 0}render(){let s=[];var t=0;return this.data.rows.forEach((l=>{let e="",o="",d="",n="",a="",c="",r={color:this.iconColor[t]?this.kupManager.theme.colorCheck(this.iconColor[t]).hexColor:null},v={color:this.textColor[t]?this.kupManager.theme.colorCheck(this.textColor[t]).hexColor:null},u={color:this.valueColor[t]?this.kupManager.theme.colorCheck(this.valueColor[t]).hexColor:null};if(e=this.data.columns[0]?i("div",{slot:"icon"},i("icon",{class:l.cells[this.data.columns[0].name].obj.k,style:r})):i("div",{slot:"icon"}),o=this.data.columns[1]?i("div",{slot:"unit",style:u},l.cells[this.data.columns[1].name].obj.k," "):i("div",{slot:"unit"}),d=this.data.columns[2]?i("div",{slot:"descr",style:v},l.cells[this.data.columns[2].name].obj.k):i("div",{slot:"descr"}),this.data.columns[3]){let s=this.data.columns[3];s.obj=l.cells[this.data.columns[3].name].obj;let t=h(s,l.cells[this.data.columns[3].name]);n=i("div",{slot:"value",style:u},t)}else n=i("div",{slot:"value"});if(this.data.columns[5]){let s=this.data.columns[5];s.obj=l.cells[this.data.columns[5].name].obj;let t=h(s,l.cells[this.data.columns[5].name]);this.data.columns[6]&&l.cells[this.data.columns[6].name].obj.k&&(t+=this.kupManager.math.decimalSeparator()),a=i("div",{slot:"value-int",style:u},t)}else a=i("div",{slot:"value-int"});c=this.data.columns[6]?i("div",{slot:"value-dec",style:u},l.cells[this.data.columns[6].name].obj.k):i("div",{slot:"value-dec"});const p=i("kup-dash",{layout:this.layout,fontsize:this.fontsize,index:t,active:this.active,slot:String(t)},e,o,d,n,a,c);s.push(p),t++})),i("div",null,i("link",{href:"https://cdn.materialdesignicons.com/4.5.95/css/materialdesignicons.min.css",rel:"stylesheet",type:"text/css"}),i("kup-grid",{columns:this.columnsNumber,singleLine:this.horizontal,class:this.fullWidth?"kup-full-width":""},s))}};e.style=".horizontal{display:inline-block;min-width:300px;max-width:100%;overflow:visible;white-space:nowrap;border:solid;border-width:1px;margin:2px}";export{e as kup_dash_list}
1
+ import{r as s,c as t,h as i}from"./p-3da7e4c6.js";import{k as l,af as h}from"./p-2751c4ba.js";const e=class{constructor(i){s(this,i),this.dashClick=t(this,"kup-dash-click",7),this.kupManager=l(),this.layout="1",this.fontsize="",this.active=!1,this.columnsNumber=1,this.fullWidth=!0,this.horizontal=!1,this.iconColor=[],this.valueColor=[],this.textColor=[],this.data=void 0}render(){let s=[];var t=0;return this.data.rows.forEach((l=>{let e="",o="",d="",n="",a="",c="",r={color:this.iconColor[t]?this.kupManager.theme.colorCheck(this.iconColor[t]).hexColor:null},v={color:this.textColor[t]?this.kupManager.theme.colorCheck(this.textColor[t]).hexColor:null},u={color:this.valueColor[t]?this.kupManager.theme.colorCheck(this.valueColor[t]).hexColor:null};if(e=this.data.columns[0]?i("div",{slot:"icon"},i("icon",{class:l.cells[this.data.columns[0].name].obj.k,style:r})):i("div",{slot:"icon"}),o=this.data.columns[1]?i("div",{slot:"unit",style:u},l.cells[this.data.columns[1].name].obj.k," "):i("div",{slot:"unit"}),d=this.data.columns[2]?i("div",{slot:"descr",style:v},l.cells[this.data.columns[2].name].obj.k):i("div",{slot:"descr"}),this.data.columns[3]){let s=this.data.columns[3];s.obj=l.cells[this.data.columns[3].name].obj;let t=h(s,l.cells[this.data.columns[3].name]);n=i("div",{slot:"value",style:u},t)}else n=i("div",{slot:"value"});if(this.data.columns[5]){let s=this.data.columns[5];s.obj=l.cells[this.data.columns[5].name].obj;let t=h(s,l.cells[this.data.columns[5].name]);this.data.columns[6]&&l.cells[this.data.columns[6].name].obj.k&&(t+=this.kupManager.math.decimalSeparator()),a=i("div",{slot:"value-int",style:u},t)}else a=i("div",{slot:"value-int"});c=this.data.columns[6]?i("div",{slot:"value-dec",style:u},l.cells[this.data.columns[6].name].obj.k):i("div",{slot:"value-dec"});const p=i("kup-dash",{layout:this.layout,fontsize:this.fontsize,index:t,active:this.active,slot:String(t)},e,o,d,n,a,c);s.push(p),t++})),i("div",null,i("link",{href:"https://cdn.materialdesignicons.com/4.5.95/css/materialdesignicons.min.css",rel:"stylesheet",type:"text/css"}),i("kup-grid",{columns:this.columnsNumber,singleLine:this.horizontal,class:this.fullWidth?"kup-full-width":""},s))}};e.style=".horizontal{display:inline-block;min-width:300px;max-width:100%;overflow:visible;white-space:nowrap;border:solid;border-width:1px;margin:2px}";export{e as kup_dash_list}
@@ -1 +1 @@
1
- import{r as t,c as o,f as i,h as e,H as s,g as r}from"./p-3da7e4c6.js";import{k as n,A as a,g as l,s as h,v as c,m as p,K as b,c as d,Q as u,V as x,W as f,X as g,I as w,a2 as m}from"./p-46daf529.js";import{f as k,p as v,s as y,d as _,r as j,h as C,b as P}from"./p-78eaa526.js";import{F as A}from"./p-9c7b9ff2.js";import{a as R}from"./p-d5491e4f.js";import{c as z}from"./p-ad2e21d2.js";import{F as I}from"./p-e16c04d8.js";import{F as E}from"./p-fb03f2f5.js";import"./p-ffbd77d5.js";import"./p-0fd98ab4.js";import"./p-90576709.js";import"./p-c20c4f66.js";import"./p-6507e9eb.js";var M;!function(t){t.cardData="Data of the card linked to the box when the latter's layout must be a premade template.",t.columns="Number of columns.",t.customStyle="Custom style of the component.",t.data="Actual data of the box.",t.dragEnabled="Enable dragging.",t.dropEnabled="Enable dropping.",t.dropOnSection="Drop can be done in section.",t.enableRowActions="If enabled, a button to load / display the row actions will be displayed on the right of every box.",t.globalFilter="When set to true it activates the global filter.",t.globalFilterValue="The value of the global filter.",t.kanban="Displays the boxlist as a Kanban.",t.layout="How the field will be displayed. If not present, a default one will be created.",t.lazyLoadRows="When set to true, extra rows will be automatically loaded once the last row enters the viewport.",t.multiSelection="Enable multi selection.",t.pageSelected="Current page number.",t.pagination="Enables pagination.",t.rowsPerPage="Number of current rows per page.",t.scrollOnHover="Activates the scroll on hover function.",t.selectBox="Automatically selects the box at the specified index.",t.selectedRowsState="Multiple selection.",t.showSelection="If enabled, highlights the selected box/boxes.",t.sortBy="If sorting is enabled, specifies which column to sort.",t.sortEnabled="Enable sorting.",t.stateId="",t.store="",t.swipeDisabled="Disable swipe."}(M||(M={}));class O{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1}toDebugString(){return"box state"}}var S,B,D,W,$,T,L=function(t,o,i,e){if("a"===i&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof o?t!==o||!e:!o.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?e:"a"===i?e.call(t):e?e.value:o.get(t)},F=function(t,o,i,e,s){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof o?t!==o||!s:!o.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?s.call(t,i):s?s.value=i:o.set(t,i),i};const H=class{constructor(i){t(this,i),this.kupBoxClick=o(this,"kup-box-click",6),this.kupBoxSelected=o(this,"kup-box-selected",6),this.kupAutoBoxSelect=o(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=o(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=o(this,"kup-box-rowactionclick",6),this.kupDidLoad=o(this,"kup-box-didload",6),this.kupDidUnload=o(this,"kup-box-didunload",6),this.kupBoxContextMenu=o(this,"kup-box-contextmenu",6),S.add(this),this.state=new O,this.kupManager=n(),this.visibleColumns=[],this.rows=[],this.filteredRows=[],this.sectionRef=null,this.rowsRefs=[],this.hold=!1,this.interactableDrag=[],this.interactableDrop=[],this.interactableTouch=[],B.set(this,void 0),D.set(this,[]),W.set(this,0),this.collapsedSection={},this.selectedRows=[],this.rowActionMenuOpened=void 0,this.currentPage=1,this.currentRowsPerPage=10,this.cardData=null,this.columns=1,this.customStyle="",this.data=null,this.dragEnabled=!1,this.dropEnabled=!1,this.dropOnSection=!1,this.editableData=!1,this.enableRowActions=!1,this.globalFilter=!1,this.globalFilterValue="",this.kanban=null,this.layout=void 0,this.lazyLoadRows=!1,this.multiSelection=!1,this.pageSelected=1,this.pagination=!1,this.rowsPerPage=void 0,this.scrollOnHover=!1,this.selectBox=void 0,this.selectedRowsState=void 0,this.showSelection=!0,this.sortBy=void 0,this.sortEnabled=!1,this.stateId="",this.store=void 0,this.swipeDisabled=!1}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(this.kupManager.debug.logMessage(this,"Initialize with state for stateId "+this.stateId+": "+t),this.sortBy=this.state.sortBy,this.globalFilterValue=this.state.globalFilterValue,this.selectedRowsState=this.state.selectedRowsState,this.pageSelected=this.state.pageSelected,this.rowsPerPage=this.state.rowsPerPage)}}persistState(){if(this.store&&this.stateId){let t=!1;this.kupManager.objects.deepEqual(this.state.sortBy,this.sortBy)||(this.state.sortBy=this.sortBy,t=!0),this.kupManager.objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)||(this.state.globalFilterValue=this.globalFilterValue,t=!0),this.kupManager.objects.deepEqual(this.state.pageSelected,this.currentPage)||(this.state.pageSelected=this.currentPage,t=!0),this.kupManager.objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)||(this.state.rowsPerPage=this.currentRowsPerPage,t=!0);const o=this.selectedRows.reduce(((t,o,i)=>t+(i>0?";":"")+o.id),"");if(this.kupManager.objects.deepEqual(this.state.selectedRowsState,o)||(this.state.selectedRowsState=o,t=!0),!this.state.load)return void(this.state.load=!0);t&&(this.kupManager.debug.logMessage(this,"Persisting state for stateId "+this.stateId+": "+this.state),this.store.persistState(this.stateId,this.state))}}rowsPerPageHandler(t){this.currentRowsPerPage=t}recalculateRows(){this.initRows()}onDataChanged(){a(this.getRows()),this.initVisibleColumns(),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return l(this,M,t)}async loadRowActions(t,o){t.actions=o,this.rowActionMenuOpened=t}async refresh(){i(this)}async setProps(t){h(this,M,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:void 0}]}initVisibleColumns(){this.visibleColumns=this.getColumns().filter((t=>!t.hasOwnProperty("visible")||t.visible))}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows(),this.globalFilter&&this.globalFilterValue&&(this.filteredRows=k(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let o=t;return this.sortBy&&(o=y(o,[{column:this.sortBy,sortMode:m.A}])),o}checkScrollOnHover(){this.kupManager.scrollOnHover.isRegistered(this.boxContainer)?this.scrollOnHover||this.kupManager.scrollOnHover.unregister(this.boxContainer):this.scrollOnHover&&this.kupManager.scrollOnHover.register(this.boxContainer)}checkLayout(){if(this.layout)return void(this.boxLayout=this.layout);const t={horizontal:!1,sections:[]},o=this.visibleColumns;let i=o.length,e=[],s=0;for(;i-- >0;)e.push({column:o[s++].name});t.content=e,this.boxLayout={sections:[t]}}onSortChange(t){let o=c(this.visibleColumns,t.detail.value);this.sortBy=o.name}onGlobalFilterChange({detail:t}){let o="";t&&t.value&&(o=t.value),this.globalFilterValue=o}isSectionExpanded(t,o){return!(!t.id||!o.id)&&this.collapsedSection[o.id]&&this.collapsedSection[o.id][t.id]}handleAutomaticBoxSelection(){if(this.selectBox&&this.selectBox>0&&this.selectBox<=this.data.rows.length){this.selectedRows=[];for(let t of this.data.rows)if(t.id===(this.selectBox-1).toString()){this.selectedRows.push(t);break}this.kupAutoBoxSelect.emit({comp:this,id:this.rootElement.id,row:this.selectedRows[0]})}}getEventDetails(t,o){let i=null,e=null,s=null,r=null;if(t&&(i=t.closest(".box-object")||t.querySelector(".box-object")||t.closest(".f-cell")),i)if(i.classList.contains("f-cell")){const t=i["kup-get-cell-props"]();e=t.cell,r=t.column,s=t.row}else e=i["data-cell"],s=i["data-row"],r=c(this.visibleColumns,i.dataset.column);return{boxObject:i||null,column:r||null,cell:e||null,originalEvent:o,row:s||null}}contextMenuHandler(t){return this.getEventDetails(t.target,t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onBoxClick({target:t},o){if(!(t instanceof HTMLElement))return;let i=t,e=i.classList;for(;!e.contains("box-object")&&!e.contains("box-section")&&!e.contains("box")&&(i=i.parentElement,null!==i);)e=i.classList;let s=null;e.contains("box-object")&&(s=i.dataset.column),this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o,column:s}),this.multiSelection?this.onSelectionCheckChange(o):this.selectedRows=[o]}onSelectionCheckChange(t){var o=-1;for(let i=0;i<this.selectedRows.length;i++)if(this.selectedRows[i].id===t.id){o=i;break}o>=0?(this.selectedRows.splice(o,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,o){if(o.id)if(t.id){if(this.collapsedSection[o.id]){const i=this.collapsedSection[o.id];i[t.id]=!i[t.id]||!i[t.id]}else this.collapsedSection[o.id]={},this.collapsedSection[o.id][t.id]=!0;this.collapsedSection=Object.assign({},this.collapsedSection)}else console.error("cannot expand / collapse a section of a row without ad id");else console.error("cannot expand / collapse a section withoun an ID")}onRowAction(t){t&&(t!==this.rowActionMenuOpened?t.actions?this.rowActionMenuOpened=t:this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t}):this.rowActionMenuOpened=null)}onRowActionClick(t,o,i){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:o,index:i})}clickFunction(t){try{const o=t.composedPath();for(let t of o)if(this.checkIfElementIsActionMenuIcon(t))return}catch(o){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const o=_(t,this.filteredRows.length,this.currentRowsPerPage);o&&(this.currentPage=o)}handleRowsPerPageChange(t){const o=j(t,this.filteredRows.length);o&&(this.currentRowsPerPage=o,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let o=!1;const i={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let o=0;o<this.data.columns.length;o++){const e=this.data.columns[o];!1!==e.visible&&(i.cell.push(t.cells[e.name]),i.columns.push(e))}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const e=t.cells[o];if(void 0!==e.cardID&&e.obj)switch(e.obj.p){case"BTN":do{i.button.push({})}while(i.button.length<e.cardID);i.button[e.cardID]={label:e.value};break;case"IMG":do{i.image.push({})}while(i.image.length<e.cardID);i.image[e.cardID]={resource:e.value};break;case"PGB":do{i.progressbar.push({})}while(i.progressbar.length<e.cardID);i.progressbar[e.cardID]={value:e.value};break;default:do{i.text.push("")}while(i.text.length<e.cardID);i.text[e.cardID]=e.value}}for(const e in t.cells)if(t.cells.hasOwnProperty(e)){const s=t.cells[e];if(void 0===s.cardID&&s.obj)switch(o=!1,s.obj.p){case"BTN":for(let t=0;t<i.button.length;t++)if(!Object.keys(i.button[t]).length){i.button[t]={label:s.value},o=!0;break}o||i.button.push({label:s.value});break;case"IMG":for(let t=0;t<i.image.length;t++)if(!Object.keys(i.image[t]).length){i.image[t]={resource:s.value},o=!0;break}o||i.image.push({resource:s.value});break;case"PGB":for(let t=0;t<i.progressbar.length;t++)if(!Object.keys(i.progressbar[t]).length){i.progressbar[t]={value:s.value},o=!0;break}o||i.progressbar.push({value:s.value});break;default:for(let t=0;t<i.text.length;t++)if(""===i.text[t]){i.text[t]=s.value,o=!0;break}o||i.text.push(s.value)}}return e("kup-card",Object.assign({data:i},this.cardData))}renderRow(t){const o=[...this.visibleColumns];let i=null,s=t.layout;s||(s=this.boxLayout);let r=!1;if(s){s.horizontal&&(r=!0);const e=s.sections;let n=e.length,a=0;n>0&&(i=[]);const l={horizontal:r};for(;n-- >0;)i.push(null!=this.cardData&&"object"==typeof this.cardData?this.renderSectionAsCard(t):this.renderSection(e[a++],l,t,o))}var n=!1;for(let o of this.selectedRows)o.id===t.id&&(n=!0);let a=null;this.multiSelection&&(a=e("div",{class:"box-selection"},e("kup-checkbox",{checked:n})));let l=null;if(this.enableRowActions&&!this.swipeDisabled){const o={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let i=null;if(t.actions){const o=t.actions.map(((o,i)=>e("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,o,i)},e("div",{class:`icon ${o.icon}`}),e("div",{class:"text"},o.text))));i=e("ul",null,o)}l=e("div",{class:"row-actions-wrapper"},e("div",{class:"row-actions-toggler"},e("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},e("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"})),e("div",{class:o},i)))}let h=null;return t.badgeData&&t.badgeData.length>0&&(h=t.badgeData.map((t=>e("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),e("div",{class:"box-wrapper",style:t.style||{},ref:t=>L(this,D,"f").push(t)},e("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&n,column:!r},onClick:o=>this.onBoxClick(o,t),ref:t=>this.rowsRefs.push(t)},a,i,h),l)}renderSection(t,o,i,s){let r=null;if(t.sections&&t.sections.length>0){const o=t.sections;let e=o.length,n=0;for(e>0&&(r=[]);e-- >0;)r.push(this.renderSection(o[n++],t,i,s))}else if(t.content){const o=t.content;let e=o.length,n=0;for(e>0&&(r=[]);e-- >0;)r.push(this.renderBoxObject({boxObject:o[n++],row:i,visibleColumns:s},!0))}else s.length>0&&(r=this.renderBoxObject({boxObject:{column:s[0].name},row:i,visibleColumns:s}));const n=this.isSectionExpanded(i,t),a=!!t.columns,l={"box-section":!0,open:n,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},h=t.style||{};t.dim&&o&&(h.flex=`0 0 ${t.dim}`,h.overflow="hidden",o.horizontal?h.maxWidth=t.dim:h.maxHeight=t.dim),a&&(h["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){l["collapse-section"]=!0;const o={content:!0};let s="";s=t.title?t.title:this.kupManager.language.translate(n?p.COLLAPSE:p.EXPAND),c=e("div",{class:l,style:h},e("div",{class:o},r),e("div",{class:"header",role:"button",onClick:o=>{o.stopPropagation(),this.toggleSectionExpand(i,t)}},e("div",{class:"header-content"},e("span",null,s),e(A,{resource:`${b.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:n?"toggled":""}))))}else{const o=t.title?e("h3",null,t.title):null;c=e("div",{class:l,style:h},o,r)}return c}renderBoxObject({boxObject:t,row:o,visibleColumns:i},s){const r={"box-object":!0};let n=null,a=-1;for(let o=0;o<i.length;o++)if(i[o].name===t.column){a=o;break}a>=0?(n=i[a],i.splice(a,1)):s&&(n=this.data.columns.find((o=>o.name===t.column)));const l=o.cells[t.column];let h;return l&&!this.kupManager.objects.isEmptyKupObj(l.obj)&&(r["is-obj"]=!0,this.kupManager.debug.isDebug()&&(h=l.obj.t+"; "+l.obj.p+"; "+l.obj.k+";")),e("div",{"data-cell":l,"data-row":o,"data-column":t.column,class:r,style:{},title:h},l&&n?e(I,Object.assign({},{cell:l,column:n,component:this,editable:this.editableData,renderKup:!0,row:o,setSizes:!0,shape:t.shape})):e("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||0===this.kanban.columns.length)return this.kupManager.debug.logMessage(this,"No columns to group by detected.",d.ERROR),{jsx:e("div",{id:"empty-data-message",class:"box-wrapper"},e("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(p.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let o=0;o<this.kanban.labels.length;o++)t.push({labels:this.kanban.labels[o],nodes:[]});for(let o=0;o<this.rows.length;o++){let i=[];for(let t=0;t<this.kanban.columns.length;t++)try{i.push(this.rows[o].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,d.WARNING)}const e={found:!1,index:null};for(let o=0;o<t.length;o++){let s=t[o].labels,r=!0;for(let t=0;t<s.length;t++)if(i[t]!==s[t]){r=!1;break}if(r){e.found=!0,e.index=o;break}}e.found?t[e.index].nodes.push(this.renderRow(this.rows[o])):t.push({labels:i,nodes:[this.renderRow(this.rows[o])]})}const o=[];for(let i=0;i<t.length;i++){const s=t[i].labels,r={data:[]};for(let t=0;t<s.length;t++)r.data.push({value:s[t],id:s[t]});o.push(e("div",{class:"kanban-section"},e(R,Object.assign({},r)),t[i].nodes))}return{jsx:o,style:{"grid-template-columns":this.kanban.isStacked?"repeat(1fr)":this.kanban.size?`repeat(${Object.keys(t).length}, ${this.kanban.size})`:`repeat(${Object.keys(t).length}, 1fr)`}}}didLoadInteractables(){this.interactableTouch.push(this.boxContainer),this.kupManager.interact.on(this.boxContainer,u.TAP,(t=>{this.hold?this.hold=!1:2===t.button&&this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})})),this.kupManager.interact.on(this.boxContainer,u.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(this.hold=!0,this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)}))}))}didRenderInteractables(){if(this.dragEnabled)for(let t=0;t<this.rowsRefs.length;t++){const o=this.rowsRefs[t],i=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:c(this.visibleColumns,t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};o&&!this.interactableDrag.includes(o)&&(this.interactableDrag.push(o),this.kupManager.interact.draggable(o,{allowFrom:".box-object",cursorChecker:()=>null},{callback:i},x.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.getEventDetails(this.rootElement.shadowRoot.querySelector(".box:hover"));return{cell:t.cell,column:t.column,id:this.rootElement.id,row:t.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),this.kupManager.interact.dropzone(this.sectionRef,{accept:`[${f}]`},{dispatcher:this.rootElement,type:g.BOX}));for(let o=0;o<this.rowsRefs.length;o++){const i=this.rowsRefs[o];i&&!this.interactableDrop.includes(i)&&(this.interactableDrop.push(i),this.kupManager.interact.dropzone(i,{accept:`[${f}]`},{callback:t,dispatcher:this.rootElement,type:g.BOX}))}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.rowsPerPage&&(this.currentRowsPerPage=this.rowsPerPage),this.data&&this.data.rows&&this.currentRowsPerPage>this.data.rows.length&&(this.currentRowsPerPage=this.data.rows.length),this.kupManager.language.register(this),this.kupManager.theme.register(this),this.onDataChanged(),this.adjustPaginator(),document.querySelector(".header")?F(this,W,document.querySelector(".header").clientHeight,"f"):F(this,W,0,"f"),document.querySelector(".topbar")&&F(this,W,L(this,W,"f")+document.querySelector(".topbar").clientHeight,"f"),L(this,S,"m",T).call(this)}componentDidLoad(){if(this.handleAutomaticBoxSelection(),document.addEventListener("click",this.clickFunction.bind(this)),this.currentPage=this.pageSelected,this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((o=>t.indexOf(o.id)>=0))}this.didLoadInteractables(),this.kupDidLoad.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const o=t.querySelectorAll(".f-text-field");for(let t=0;t<o.length;t++)E(o[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),L(this,S,"m",$).call(this),this.kupManager.debug.logRender(this,!0)}render(){const t=!("object"!=typeof this.kanban||null===this.kanban);let o=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.visibleColumns.map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let i={label:this.kupManager.language.translate(p.SORT_BY),trailingIcon:!0};o=e("div",{id:"sort-panel"},e("kup-combobox",{data:{"kup-text-field":i,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let i=null;this.globalFilter&&(i=e("div",{id:"global-filter"},e("kup-text-field",{fullWidth:!0,label:this.kupManager.language.translate(w.SEARCH),icon:b.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout),this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}})));let r=null;!this.lazyLoadRows&&this.pagination&&(r=e(P,{id:top?"top-paginator":"bottom-paginator",currentPage:this.currentPage,max:this.filteredRows.length,mode:C.SIMPLE,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.rowsPerPage,onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let n=null,a={};if(0===this.rows.length)n=e("div",{id:"empty-data-message",class:"box-wrapper"},e("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(p.EMPTY_DATA))),a={"grid-template-columns":"repeat(1, 1fr)"};else if(t){const t=this.kanbanMode();n=t.jsx,a=t.style}else{a={"grid-template-columns":`repeat(${this.columns}, 1fr)`};const t=this.rows;let o=t.length,i=0;for(n=[];o-- >0;)n.push(this.renderRow(t[i++]))}return e(s,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:z},e("div",{class:"box-component",ref:t=>this.sectionRef=t},o,i,r,e("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},n))))}disconnectedCallback(){this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop)),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this),this.scrollOnHover&&this.kupManager.scrollOnHover.unregister(this.boxContainer),document.removeEventListener("click",this.clickFunction.bind(this)),this.kupDidUnload.emit({comp:this,id:this.rootElement.id})}get rootElement(){return r(this)}static get watchers(){return{rowsPerPage:["rowsPerPageHandler","recalculateRows"],globalFilterValue:["recalculateRows"],sortBy:["recalculateRows"],pagination:["recalculateRows"],currentPage:["recalculateRows"],currentRowsPerPage:["recalculateRows"],data:["onDataChanged"],layout:["onLayoutChanged"],selectBox:["onSelectBoxChanged"]}}};B=new WeakMap,D=new WeakMap,W=new WeakMap,S=new WeakSet,$=function(){this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length&&L(this,B,"f").observe(L(this,D,"f")[L(this,D,"f").length-1])},T=function(){const t={threshold:0,rootMargin:"-"+L(this,W,"f")+"px 0px 0px 0px"};F(this,B,new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){this.kupManager.debug.logMessage(this,"Last row entering the viewport, loading more elements.");const o=this.data.rows.length-this.currentRowsPerPage;this.currentRowsPerPage+=o<10?o:10,t.target.classList.remove("last-row"),L(this,B,"f").unobserve(t.target)}}))}),t),"f")},H.style=":host{--kup_box_background_color:var(\n --kup-box-background-color,\n var(--kup-background-color)\n );--kup_box_color:var(--kup-box-color, var(--kup-text-color));--kup_box_font_family:var(--kup-box-font-family, var(--kup-font-family));--kup_box_font_size:var(--kup-box-font-size, var(--kup-font-size));--kup_box_grid_gap:var(--kup-box-grid-gap, 1em);--kup_box_hover_box_shadow:var(\n --kup-box-hover-box-shadow,\n 0px 0px 7.5px 0px rgba(128, 128, 128, 0.5)\n );--kup_box_primary_color_rgb:var(\n --kup-box-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_box_transition:var(--kup-box-transition, 0.25s);display:block;font-family:var(--kup_box_font_family);font-size:var(--kup_box_font_size)}.box-component{background:var(--kup_box_background_color);transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup-border-color)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_color);overflow:auto}#box-container.is-kanban .kanban-section{overflow:auto}#box-container.is-kanban .box-wrapper{padding-top:1em}#box-container.is-kanban .box-wrapper .box{overflow:auto}#box-container *{box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;transition:background-color var(--kup_box_transition) ease, box-shadow var(--kup_box_transition) ease, border var(--kup_box_transition) ease}#box-container .box-wrapper .box.draggable{touch-action:none;user-select:none}#box-container .box-wrapper .box.column{flex-direction:column}#box-container .box-wrapper .box:hover{box-shadow:var(--kup_box_hover_box_shadow)}#box-container .box-wrapper .box.selected{background-color:rgba(var(--kup_box_primary_color_rgb), 0.175)}#box-container .box-wrapper .box.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup-border-color);position:relative;z-index:2}#box-container .box-wrapper .box .box-section{display:flex;flex-direction:row;flex:1 1 1%;flex-wrap:wrap}#box-container .box-wrapper .box .box-section.column{flex-direction:column;justify-content:center;flex-wrap:unset}#box-container .box-wrapper .box .box-section.column>.box-section{flex:0 0 auto}#box-container .box-wrapper .box .box-section.grid{display:grid}#box-container .box-wrapper .box .box-section .box-object{min-height:16px}#box-container .box-wrapper .box .box-section .box-object img{height:auto}#box-container .box-wrapper .box .box-section.collapse-section .header{border-top:1px solid var(--kup-border-color);color:rgba(var(--kup-text-color-rgb), 0.75);display:flex;justify-content:space-around;width:100%}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content{margin:0.5em;display:flex;align-items:center}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image{transition:transform 0.15s}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image.toggled{transform:rotate(-180deg)}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .kup-icon.kup-dropdown-icon{margin:0;-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}#box-container .box-wrapper .box .box-section.collapse-section .content{display:none;width:100%}#box-container .box-wrapper .box .box-section.collapse-section.open .content{display:block}#box-container .box-wrapper .box .box-section.titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}#box-container .box-wrapper .box .box-section.titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}#box-container .box-wrapper .box .box-selection{position:absolute;top:0.5em;right:0.5em;z-index:1}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler{position:relative;width:24px;height:24px;margin-left:3px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler svg{cursor:pointer;opacity:0;fill:var(--kup-text-color);transition:opacity 500ms ease-out}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu{background:var(--kup-background-color);border:1px solid var(--kup-border-color);box-shadow:0px 0px 7.5px 0px rgba(128, 128, 128, 0.5);position:absolute;top:0;right:24px;display:none;z-index:10}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul{list-style-type:none;margin:0;padding:0}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li{cursor:pointer;white-space:nowrap;padding:0 12px;display:flex;align-items:center;line-height:30px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li:not(:last-child){border-bottom:1px solid var(--kup-border-color)}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu.open{display:block}#box-container .box-wrapper:hover .row-actions-wrapper .row-actions-toggler svg{opacity:1}#sort-panel,#global-filter{margin-bottom:1em}:host(.kup-center-aligned) #kup-component .box-section{text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell img{margin:auto}:host(.kup-right-aligned) #kup-component .box-section{text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell img{margin-left:auto;margin-right:0}:host(.kup-top-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-start}:host(.kup-bottom-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-end}:host(:not(.kup-borderless)) .box{border:1px solid var(--kup-border-color)}:host(.kup-flat-on-hover) #box-container .box-wrapper .box:hover{box-shadow:none}:host(.kup-shaped) .box{border-radius:10px}:host(.kup-round) .box{border-radius:25px}:host(.kup-dashed-sections) .box-section{border:2px dashed var(--kup-text-color)}:host(:not(.kup-paddingless)) #box-container .box{padding:3px}:host(:not(.kup-paddingless)) #box-container .box .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{margin:3px 4px}:host(.kup-danger){--kup-box-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-box-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-box-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-box-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-box-primary-color-rgb:var(--kup-warning-color-rgb)}";export{H as kup_box}
1
+ import{r as t,c as o,f as i,h as e,H as s,g as r}from"./p-3da7e4c6.js";import{k as n,A as a,g as l,s as h,v as c,m as p,K as b,c as d,Q as u,V as x,W as f,X as g,I as w,a2 as m}from"./p-2751c4ba.js";import{f as k,p as v,s as y,d as _,r as j,h as C,b as P}from"./p-5b1ae769.js";import{F as A}from"./p-0e961148.js";import{a as R}from"./p-d938d1cd.js";import{c as z}from"./p-ad2e21d2.js";import{F as I}from"./p-5443df89.js";import{F as E}from"./p-fb03f2f5.js";import"./p-fe8c8e11.js";import"./p-0fd98ab4.js";import"./p-90576709.js";import"./p-79f78bdc.js";import"./p-6507e9eb.js";var M;!function(t){t.cardData="Data of the card linked to the box when the latter's layout must be a premade template.",t.columns="Number of columns.",t.customStyle="Custom style of the component.",t.data="Actual data of the box.",t.dragEnabled="Enable dragging.",t.dropEnabled="Enable dropping.",t.dropOnSection="Drop can be done in section.",t.enableRowActions="If enabled, a button to load / display the row actions will be displayed on the right of every box.",t.globalFilter="When set to true it activates the global filter.",t.globalFilterValue="The value of the global filter.",t.kanban="Displays the boxlist as a Kanban.",t.layout="How the field will be displayed. If not present, a default one will be created.",t.lazyLoadRows="When set to true, extra rows will be automatically loaded once the last row enters the viewport.",t.multiSelection="Enable multi selection.",t.pageSelected="Current page number.",t.pagination="Enables pagination.",t.rowsPerPage="Number of current rows per page.",t.scrollOnHover="Activates the scroll on hover function.",t.selectBox="Automatically selects the box at the specified index.",t.selectedRowsState="Multiple selection.",t.showSelection="If enabled, highlights the selected box/boxes.",t.sortBy="If sorting is enabled, specifies which column to sort.",t.sortEnabled="Enable sorting.",t.stateId="",t.store="",t.swipeDisabled="Disable swipe."}(M||(M={}));class O{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1}toDebugString(){return"box state"}}var S,B,D,W,$,T,L=function(t,o,i,e){if("a"===i&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof o?t!==o||!e:!o.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?e:"a"===i?e.call(t):e?e.value:o.get(t)},F=function(t,o,i,e,s){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof o?t!==o||!s:!o.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?s.call(t,i):s?s.value=i:o.set(t,i),i};const H=class{constructor(i){t(this,i),this.kupBoxClick=o(this,"kup-box-click",6),this.kupBoxSelected=o(this,"kup-box-selected",6),this.kupAutoBoxSelect=o(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=o(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=o(this,"kup-box-rowactionclick",6),this.kupDidLoad=o(this,"kup-box-didload",6),this.kupDidUnload=o(this,"kup-box-didunload",6),this.kupBoxContextMenu=o(this,"kup-box-contextmenu",6),S.add(this),this.state=new O,this.kupManager=n(),this.visibleColumns=[],this.rows=[],this.filteredRows=[],this.sectionRef=null,this.rowsRefs=[],this.hold=!1,this.interactableDrag=[],this.interactableDrop=[],this.interactableTouch=[],B.set(this,void 0),D.set(this,[]),W.set(this,0),this.collapsedSection={},this.selectedRows=[],this.rowActionMenuOpened=void 0,this.currentPage=1,this.currentRowsPerPage=10,this.cardData=null,this.columns=1,this.customStyle="",this.data=null,this.dragEnabled=!1,this.dropEnabled=!1,this.dropOnSection=!1,this.editableData=!1,this.enableRowActions=!1,this.globalFilter=!1,this.globalFilterValue="",this.kanban=null,this.layout=void 0,this.lazyLoadRows=!1,this.multiSelection=!1,this.pageSelected=1,this.pagination=!1,this.rowsPerPage=void 0,this.scrollOnHover=!1,this.selectBox=void 0,this.selectedRowsState=void 0,this.showSelection=!0,this.sortBy=void 0,this.sortEnabled=!1,this.stateId="",this.store=void 0,this.swipeDisabled=!1}initWithPersistedState(){if(this.store&&this.stateId){const t=this.store.getState(this.stateId);null!=t&&(this.kupManager.debug.logMessage(this,"Initialize with state for stateId "+this.stateId+": "+t),this.sortBy=this.state.sortBy,this.globalFilterValue=this.state.globalFilterValue,this.selectedRowsState=this.state.selectedRowsState,this.pageSelected=this.state.pageSelected,this.rowsPerPage=this.state.rowsPerPage)}}persistState(){if(this.store&&this.stateId){let t=!1;this.kupManager.objects.deepEqual(this.state.sortBy,this.sortBy)||(this.state.sortBy=this.sortBy,t=!0),this.kupManager.objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)||(this.state.globalFilterValue=this.globalFilterValue,t=!0),this.kupManager.objects.deepEqual(this.state.pageSelected,this.currentPage)||(this.state.pageSelected=this.currentPage,t=!0),this.kupManager.objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)||(this.state.rowsPerPage=this.currentRowsPerPage,t=!0);const o=this.selectedRows.reduce(((t,o,i)=>t+(i>0?";":"")+o.id),"");if(this.kupManager.objects.deepEqual(this.state.selectedRowsState,o)||(this.state.selectedRowsState=o,t=!0),!this.state.load)return void(this.state.load=!0);t&&(this.kupManager.debug.logMessage(this,"Persisting state for stateId "+this.stateId+": "+this.state),this.store.persistState(this.stateId,this.state))}}rowsPerPageHandler(t){this.currentRowsPerPage=t}recalculateRows(){this.initRows()}onDataChanged(){a(this.getRows()),this.initVisibleColumns(),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return l(this,M,t)}async loadRowActions(t,o){t.actions=o,this.rowActionMenuOpened=t}async refresh(){i(this)}async setProps(t){h(this,M,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:void 0}]}initVisibleColumns(){this.visibleColumns=this.getColumns().filter((t=>!t.hasOwnProperty("visible")||t.visible))}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows(),this.globalFilter&&this.globalFilterValue&&(this.filteredRows=k(this.filteredRows,null,this.globalFilterValue,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let o=t;return this.sortBy&&(o=y(o,[{column:this.sortBy,sortMode:m.A}])),o}checkScrollOnHover(){this.kupManager.scrollOnHover.isRegistered(this.boxContainer)?this.scrollOnHover||this.kupManager.scrollOnHover.unregister(this.boxContainer):this.scrollOnHover&&this.kupManager.scrollOnHover.register(this.boxContainer)}checkLayout(){if(this.layout)return void(this.boxLayout=this.layout);const t={horizontal:!1,sections:[]},o=this.visibleColumns;let i=o.length,e=[],s=0;for(;i-- >0;)e.push({column:o[s++].name});t.content=e,this.boxLayout={sections:[t]}}onSortChange(t){let o=c(this.visibleColumns,t.detail.value);this.sortBy=o.name}onGlobalFilterChange({detail:t}){let o="";t&&t.value&&(o=t.value),this.globalFilterValue=o}isSectionExpanded(t,o){return!(!t.id||!o.id)&&this.collapsedSection[o.id]&&this.collapsedSection[o.id][t.id]}handleAutomaticBoxSelection(){if(this.selectBox&&this.selectBox>0&&this.selectBox<=this.data.rows.length){this.selectedRows=[];for(let t of this.data.rows)if(t.id===(this.selectBox-1).toString()){this.selectedRows.push(t);break}this.kupAutoBoxSelect.emit({comp:this,id:this.rootElement.id,row:this.selectedRows[0]})}}getEventDetails(t,o){let i=null,e=null,s=null,r=null;if(t&&(i=t.closest(".box-object")||t.querySelector(".box-object")||t.closest(".f-cell")),i)if(i.classList.contains("f-cell")){const t=i["kup-get-cell-props"]();e=t.cell,r=t.column,s=t.row}else e=i["data-cell"],s=i["data-row"],r=c(this.visibleColumns,i.dataset.column);return{boxObject:i||null,column:r||null,cell:e||null,originalEvent:o,row:s||null}}contextMenuHandler(t){return this.getEventDetails(t.target,t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onBoxClick({target:t},o){if(!(t instanceof HTMLElement))return;let i=t,e=i.classList;for(;!e.contains("box-object")&&!e.contains("box-section")&&!e.contains("box")&&(i=i.parentElement,null!==i);)e=i.classList;let s=null;e.contains("box-object")&&(s=i.dataset.column),this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o,column:s}),this.multiSelection?this.onSelectionCheckChange(o):this.selectedRows=[o]}onSelectionCheckChange(t){var o=-1;for(let i=0;i<this.selectedRows.length;i++)if(this.selectedRows[i].id===t.id){o=i;break}o>=0?(this.selectedRows.splice(o,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,o){if(o.id)if(t.id){if(this.collapsedSection[o.id]){const i=this.collapsedSection[o.id];i[t.id]=!i[t.id]||!i[t.id]}else this.collapsedSection[o.id]={},this.collapsedSection[o.id][t.id]=!0;this.collapsedSection=Object.assign({},this.collapsedSection)}else console.error("cannot expand / collapse a section of a row without ad id");else console.error("cannot expand / collapse a section withoun an ID")}onRowAction(t){t&&(t!==this.rowActionMenuOpened?t.actions?this.rowActionMenuOpened=t:this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t}):this.rowActionMenuOpened=null)}onRowActionClick(t,o,i){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:o,index:i})}clickFunction(t){try{const o=t.composedPath();for(let t of o)if(this.checkIfElementIsActionMenuIcon(t))return}catch(o){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const o=_(t,this.filteredRows.length,this.currentRowsPerPage);o&&(this.currentPage=o)}handleRowsPerPageChange(t){const o=j(t,this.filteredRows.length);o&&(this.currentRowsPerPage=o,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let o=!1;const i={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]};for(let o=0;o<this.data.columns.length;o++){const e=this.data.columns[o];!1!==e.visible&&(i.cell.push(t.cells[e.name]),i.columns.push(e))}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const e=t.cells[o];if(void 0!==e.cardID&&e.obj)switch(e.obj.p){case"BTN":do{i.button.push({})}while(i.button.length<e.cardID);i.button[e.cardID]={label:e.value};break;case"IMG":do{i.image.push({})}while(i.image.length<e.cardID);i.image[e.cardID]={resource:e.value};break;case"PGB":do{i.progressbar.push({})}while(i.progressbar.length<e.cardID);i.progressbar[e.cardID]={value:e.value};break;default:do{i.text.push("")}while(i.text.length<e.cardID);i.text[e.cardID]=e.value}}for(const e in t.cells)if(t.cells.hasOwnProperty(e)){const s=t.cells[e];if(void 0===s.cardID&&s.obj)switch(o=!1,s.obj.p){case"BTN":for(let t=0;t<i.button.length;t++)if(!Object.keys(i.button[t]).length){i.button[t]={label:s.value},o=!0;break}o||i.button.push({label:s.value});break;case"IMG":for(let t=0;t<i.image.length;t++)if(!Object.keys(i.image[t]).length){i.image[t]={resource:s.value},o=!0;break}o||i.image.push({resource:s.value});break;case"PGB":for(let t=0;t<i.progressbar.length;t++)if(!Object.keys(i.progressbar[t]).length){i.progressbar[t]={value:s.value},o=!0;break}o||i.progressbar.push({value:s.value});break;default:for(let t=0;t<i.text.length;t++)if(""===i.text[t]){i.text[t]=s.value,o=!0;break}o||i.text.push(s.value)}}return e("kup-card",Object.assign({data:i},this.cardData))}renderRow(t){const o=[...this.visibleColumns];let i=null,s=t.layout;s||(s=this.boxLayout);let r=!1;if(s){s.horizontal&&(r=!0);const e=s.sections;let n=e.length,a=0;n>0&&(i=[]);const l={horizontal:r};for(;n-- >0;)i.push(null!=this.cardData&&"object"==typeof this.cardData?this.renderSectionAsCard(t):this.renderSection(e[a++],l,t,o))}var n=!1;for(let o of this.selectedRows)o.id===t.id&&(n=!0);let a=null;this.multiSelection&&(a=e("div",{class:"box-selection"},e("kup-checkbox",{checked:n})));let l=null;if(this.enableRowActions&&!this.swipeDisabled){const o={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let i=null;if(t.actions){const o=t.actions.map(((o,i)=>e("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,o,i)},e("div",{class:`icon ${o.icon}`}),e("div",{class:"text"},o.text))));i=e("ul",null,o)}l=e("div",{class:"row-actions-wrapper"},e("div",{class:"row-actions-toggler"},e("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},e("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"})),e("div",{class:o},i)))}let h=null;return t.badgeData&&t.badgeData.length>0&&(h=t.badgeData.map((t=>e("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),e("div",{class:"box-wrapper",style:t.style||{},ref:t=>L(this,D,"f").push(t)},e("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&n,column:!r},onClick:o=>this.onBoxClick(o,t),ref:t=>this.rowsRefs.push(t)},a,i,h),l)}renderSection(t,o,i,s){let r=null;if(t.sections&&t.sections.length>0){const o=t.sections;let e=o.length,n=0;for(e>0&&(r=[]);e-- >0;)r.push(this.renderSection(o[n++],t,i,s))}else if(t.content){const o=t.content;let e=o.length,n=0;for(e>0&&(r=[]);e-- >0;)r.push(this.renderBoxObject({boxObject:o[n++],row:i,visibleColumns:s},!0))}else s.length>0&&(r=this.renderBoxObject({boxObject:{column:s[0].name},row:i,visibleColumns:s}));const n=this.isSectionExpanded(i,t),a=!!t.columns,l={"box-section":!0,open:n,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},h=t.style||{};t.dim&&o&&(h.flex=`0 0 ${t.dim}`,h.overflow="hidden",o.horizontal?h.maxWidth=t.dim:h.maxHeight=t.dim),a&&(h["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){l["collapse-section"]=!0;const o={content:!0};let s="";s=t.title?t.title:this.kupManager.language.translate(n?p.COLLAPSE:p.EXPAND),c=e("div",{class:l,style:h},e("div",{class:o},r),e("div",{class:"header",role:"button",onClick:o=>{o.stopPropagation(),this.toggleSectionExpand(i,t)}},e("div",{class:"header-content"},e("span",null,s),e(A,{resource:`${b.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:n?"toggled":""}))))}else{const o=t.title?e("h3",null,t.title):null;c=e("div",{class:l,style:h},o,r)}return c}renderBoxObject({boxObject:t,row:o,visibleColumns:i},s){const r={"box-object":!0};let n=null,a=-1;for(let o=0;o<i.length;o++)if(i[o].name===t.column){a=o;break}a>=0?(n=i[a],i.splice(a,1)):s&&(n=this.data.columns.find((o=>o.name===t.column)));const l=o.cells[t.column];let h;return l&&!this.kupManager.objects.isEmptyKupObj(l.obj)&&(r["is-obj"]=!0,this.kupManager.debug.isDebug()&&(h=l.obj.t+"; "+l.obj.p+"; "+l.obj.k+";")),e("div",{"data-cell":l,"data-row":o,"data-column":t.column,class:r,style:{},title:h},l&&n?e(I,Object.assign({},{cell:l,column:n,component:this,editable:this.editableData,renderKup:!0,row:o,setSizes:!0,shape:t.shape})):e("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||0===this.kanban.columns.length)return this.kupManager.debug.logMessage(this,"No columns to group by detected.",d.ERROR),{jsx:e("div",{id:"empty-data-message",class:"box-wrapper"},e("div",{ref:t=>this.rowsRefs.push(t)}),this.kupManager.language.translate(p.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let o=0;o<this.kanban.labels.length;o++)t.push({labels:this.kanban.labels[o],nodes:[]});for(let o=0;o<this.rows.length;o++){let i=[];for(let t=0;t<this.kanban.columns.length;t++)try{i.push(this.rows[o].cells[this.kanban.columns[t]].value)}catch(t){this.kupManager.debug.logMessage(this,t,d.WARNING)}const e={found:!1,index:null};for(let o=0;o<t.length;o++){let s=t[o].labels,r=!0;for(let t=0;t<s.length;t++)if(i[t]!==s[t]){r=!1;break}if(r){e.found=!0,e.index=o;break}}e.found?t[e.index].nodes.push(this.renderRow(this.rows[o])):t.push({labels:i,nodes:[this.renderRow(this.rows[o])]})}const o=[];for(let i=0;i<t.length;i++){const s=t[i].labels,r={data:[]};for(let t=0;t<s.length;t++)r.data.push({value:s[t],id:s[t]});o.push(e("div",{class:"kanban-section"},e(R,Object.assign({},r)),t[i].nodes))}return{jsx:o,style:{"grid-template-columns":this.kanban.isStacked?"repeat(1fr)":this.kanban.size?`repeat(${Object.keys(t).length}, ${this.kanban.size})`:`repeat(${Object.keys(t).length}, 1fr)`}}}didLoadInteractables(){this.interactableTouch.push(this.boxContainer),this.kupManager.interact.on(this.boxContainer,u.TAP,(t=>{this.hold?this.hold=!1:2===t.button&&this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})})),this.kupManager.interact.on(this.boxContainer,u.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(this.hold=!0,this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)}))}))}didRenderInteractables(){if(this.dragEnabled)for(let t=0;t<this.rowsRefs.length;t++){const o=this.rowsRefs[t],i=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:c(this.visibleColumns,t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};o&&!this.interactableDrag.includes(o)&&(this.interactableDrag.push(o),this.kupManager.interact.draggable(o,{allowFrom:".box-object",cursorChecker:()=>null},{callback:i},x.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.getEventDetails(this.rootElement.shadowRoot.querySelector(".box:hover"));return{cell:t.cell,column:t.column,id:this.rootElement.id,row:t.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),this.kupManager.interact.dropzone(this.sectionRef,{accept:`[${f}]`},{dispatcher:this.rootElement,type:g.BOX}));for(let o=0;o<this.rowsRefs.length;o++){const i=this.rowsRefs[o];i&&!this.interactableDrop.includes(i)&&(this.interactableDrop.push(i),this.kupManager.interact.dropzone(i,{accept:`[${f}]`},{callback:t,dispatcher:this.rootElement,type:g.BOX}))}}}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.rowsPerPage&&(this.currentRowsPerPage=this.rowsPerPage),this.data&&this.data.rows&&this.currentRowsPerPage>this.data.rows.length&&(this.currentRowsPerPage=this.data.rows.length),this.kupManager.language.register(this),this.kupManager.theme.register(this),this.onDataChanged(),this.adjustPaginator(),document.querySelector(".header")?F(this,W,document.querySelector(".header").clientHeight,"f"):F(this,W,0,"f"),document.querySelector(".topbar")&&F(this,W,L(this,W,"f")+document.querySelector(".topbar").clientHeight,"f"),L(this,S,"m",T).call(this)}componentDidLoad(){if(this.handleAutomaticBoxSelection(),document.addEventListener("click",this.clickFunction.bind(this)),this.currentPage=this.pageSelected,this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((o=>t.indexOf(o.id)>=0))}this.didLoadInteractables(),this.kupDidLoad.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const o=t.querySelectorAll(".f-text-field");for(let t=0;t<o.length;t++)E(o[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),L(this,S,"m",$).call(this),this.kupManager.debug.logRender(this,!0)}render(){const t=!("object"!=typeof this.kanban||null===this.kanban);let o=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.visibleColumns.map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let i={label:this.kupManager.language.translate(p.SORT_BY),trailingIcon:!0};o=e("div",{id:"sort-panel"},e("kup-combobox",{data:{"kup-text-field":i,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let i=null;this.globalFilter&&(i=e("div",{id:"global-filter"},e("kup-text-field",{fullWidth:!0,label:this.kupManager.language.translate(w.SEARCH),icon:b.SEARCH,initialValue:this.globalFilterValue,"onkup-textfield-input":t=>{window.clearTimeout(this.globalFilterTimeout),this.globalFilterTimeout=window.setTimeout((()=>this.onGlobalFilterChange(t)),600)}})));let r=null;!this.lazyLoadRows&&this.pagination&&(r=e(P,{id:top?"top-paginator":"bottom-paginator",currentPage:this.currentPage,max:this.filteredRows.length,mode:C.SIMPLE,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.rowsPerPage,onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let n=null,a={};if(0===this.rows.length)n=e("div",{id:"empty-data-message",class:"box-wrapper"},e("div",{class:"box",ref:t=>this.rowsRefs.push(t)},this.kupManager.language.translate(p.EMPTY_DATA))),a={"grid-template-columns":"repeat(1, 1fr)"};else if(t){const t=this.kanbanMode();n=t.jsx,a=t.style}else{a={"grid-template-columns":`repeat(${this.columns}, 1fr)`};const t=this.rows;let o=t.length,i=0;for(n=[];o-- >0;)n.push(this.renderRow(t[i++]))}return e(s,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:z},e("div",{class:"box-component",ref:t=>this.sectionRef=t},o,i,r,e("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},n))))}disconnectedCallback(){this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop)),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this),this.scrollOnHover&&this.kupManager.scrollOnHover.unregister(this.boxContainer),document.removeEventListener("click",this.clickFunction.bind(this)),this.kupDidUnload.emit({comp:this,id:this.rootElement.id})}get rootElement(){return r(this)}static get watchers(){return{rowsPerPage:["rowsPerPageHandler","recalculateRows"],globalFilterValue:["recalculateRows"],sortBy:["recalculateRows"],pagination:["recalculateRows"],currentPage:["recalculateRows"],currentRowsPerPage:["recalculateRows"],data:["onDataChanged"],layout:["onLayoutChanged"],selectBox:["onSelectBoxChanged"]}}};B=new WeakMap,D=new WeakMap,W=new WeakMap,S=new WeakSet,$=function(){this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length&&L(this,B,"f").observe(L(this,D,"f")[L(this,D,"f").length-1])},T=function(){const t={threshold:0,rootMargin:"-"+L(this,W,"f")+"px 0px 0px 0px"};F(this,B,new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){this.kupManager.debug.logMessage(this,"Last row entering the viewport, loading more elements.");const o=this.data.rows.length-this.currentRowsPerPage;this.currentRowsPerPage+=o<10?o:10,t.target.classList.remove("last-row"),L(this,B,"f").unobserve(t.target)}}))}),t),"f")},H.style=":host{--kup_box_background_color:var(\n --kup-box-background-color,\n var(--kup-background-color)\n );--kup_box_color:var(--kup-box-color, var(--kup-text-color));--kup_box_font_family:var(--kup-box-font-family, var(--kup-font-family));--kup_box_font_size:var(--kup-box-font-size, var(--kup-font-size));--kup_box_grid_gap:var(--kup-box-grid-gap, 1em);--kup_box_hover_box_shadow:var(\n --kup-box-hover-box-shadow,\n 0px 0px 7.5px 0px rgba(128, 128, 128, 0.5)\n );--kup_box_primary_color_rgb:var(\n --kup-box-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_box_transition:var(--kup-box-transition, 0.25s);display:block;font-family:var(--kup_box_font_family);font-size:var(--kup_box_font_size)}.box-component{background:var(--kup_box_background_color);transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup-border-color)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_color);overflow:auto}#box-container.is-kanban .kanban-section{overflow:auto}#box-container.is-kanban .box-wrapper{padding-top:1em}#box-container.is-kanban .box-wrapper .box{overflow:auto}#box-container *{box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;transition:background-color var(--kup_box_transition) ease, box-shadow var(--kup_box_transition) ease, border var(--kup_box_transition) ease}#box-container .box-wrapper .box.draggable{touch-action:none;user-select:none}#box-container .box-wrapper .box.column{flex-direction:column}#box-container .box-wrapper .box:hover{box-shadow:var(--kup_box_hover_box_shadow)}#box-container .box-wrapper .box.selected{background-color:rgba(var(--kup_box_primary_color_rgb), 0.175)}#box-container .box-wrapper .box.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup-border-color);position:relative;z-index:2}#box-container .box-wrapper .box .box-section{display:flex;flex-direction:row;flex:1 1 1%;flex-wrap:wrap}#box-container .box-wrapper .box .box-section.column{flex-direction:column;justify-content:center;flex-wrap:unset}#box-container .box-wrapper .box .box-section.column>.box-section{flex:0 0 auto}#box-container .box-wrapper .box .box-section.grid{display:grid}#box-container .box-wrapper .box .box-section .box-object{min-height:16px}#box-container .box-wrapper .box .box-section .box-object img{height:auto}#box-container .box-wrapper .box .box-section.collapse-section .header{border-top:1px solid var(--kup-border-color);color:rgba(var(--kup-text-color-rgb), 0.75);display:flex;justify-content:space-around;width:100%}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content{margin:0.5em;display:flex;align-items:center}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image{transition:transform 0.15s}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image.toggled{transform:rotate(-180deg)}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .kup-icon.kup-dropdown-icon{margin:0;-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}#box-container .box-wrapper .box .box-section.collapse-section .content{display:none;width:100%}#box-container .box-wrapper .box .box-section.collapse-section.open .content{display:block}#box-container .box-wrapper .box .box-section.titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}#box-container .box-wrapper .box .box-section.titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}#box-container .box-wrapper .box .box-selection{position:absolute;top:0.5em;right:0.5em;z-index:1}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler{position:relative;width:24px;height:24px;margin-left:3px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler svg{cursor:pointer;opacity:0;fill:var(--kup-text-color);transition:opacity 500ms ease-out}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu{background:var(--kup-background-color);border:1px solid var(--kup-border-color);box-shadow:0px 0px 7.5px 0px rgba(128, 128, 128, 0.5);position:absolute;top:0;right:24px;display:none;z-index:10}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul{list-style-type:none;margin:0;padding:0}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li{cursor:pointer;white-space:nowrap;padding:0 12px;display:flex;align-items:center;line-height:30px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li:not(:last-child){border-bottom:1px solid var(--kup-border-color)}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu.open{display:block}#box-container .box-wrapper:hover .row-actions-wrapper .row-actions-toggler svg{opacity:1}#sort-panel,#global-filter{margin-bottom:1em}:host(.kup-center-aligned) #kup-component .box-section{text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell img{margin:auto}:host(.kup-right-aligned) #kup-component .box-section{text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell img{margin-left:auto;margin-right:0}:host(.kup-top-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-start}:host(.kup-bottom-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-end}:host(:not(.kup-borderless)) .box{border:1px solid var(--kup-border-color)}:host(.kup-flat-on-hover) #box-container .box-wrapper .box:hover{box-shadow:none}:host(.kup-shaped) .box{border-radius:10px}:host(.kup-round) .box{border-radius:25px}:host(.kup-dashed-sections) .box-section{border:2px dashed var(--kup-text-color)}:host(:not(.kup-paddingless)) #box-container .box{padding:3px}:host(:not(.kup-paddingless)) #box-container .box .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{margin:3px 4px}:host(.kup-danger){--kup-box-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-box-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-box-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-box-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-box-primary-color-rgb:var(--kup-warning-color-rgb)}";export{H as kup_box}
@@ -1 +1 @@
1
- import{r,c as o,f as t,h as e,H as a,g as i}from"./p-3da7e4c6.js";import{k as s,g as p,s as d}from"./p-46daf529.js";import{c as n}from"./p-ad2e21d2.js";const c="drawer";var u;!function(r){r.customStyle="Custom style of the component.",r.opened="Defaults at false. When set to true, the drawer appears."}(u||(u={}));const l=class{constructor(t){r(this,t),this.kupDrawerClose=o(this,"kup-drawer-close",6),this.kupDrawerOpen=o(this,"kup-drawer-open",6),this.kupDrawerReady=o(this,"kup-drawer-ready",6),this.kupManager=s(),this.opened=!1,this.customStyle=""}async close(){this.opened=!1,this.kupDrawerClose.emit({comp:this,id:this.rootElement.id})}async getProps(r){return p(this,u,r)}async isOpened(){return this.opened}async open(){this.opened=!0,this.kupDrawerOpen.emit({comp:this,id:this.rootElement.id})}async refresh(){t(this)}async setProps(r){d(this,u,r)}async toggle(){this.opened?this.close():this.open()}content(){const r=[],o=Array.prototype.slice.call(this.rootElement.children,0),t=[];for(let t=0;t<o.length;t++)r.push(e("slot",null));return t.push(e("div",{class:`${c}__content`},r)),t}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupDrawerReady.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return e(a,{"kup-opened":this.opened},e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{class:"backdrop",onClick:r=>{r.preventDefault(),r.stopPropagation()},onPointerDown:r=>{r.preventDefault(),r.stopPropagation(),this.close()},onTouchStart:r=>{r.preventDefault(),r.stopPropagation()}}),e("div",{id:n},e("div",{class:c},this.content())))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return i(this)}};l.style=":host{--kup_drawer_backdrop:var(--kup-drawer-backdrop, rgba(0, 0, 0, 0.32));--kup_drawer_box_shadow:var(\n --kup-drawer-box-shadow,\n 0 8px 10px -5px rgba(0, 0, 0, 0.2),\n 0 16px 24px 2px rgba(0, 0, 0, 0.14),\n 0 6px 30px 5px rgba(0, 0, 0, 0.12)\n );--kup_drawer_permanent_border:var(\n --kup-drawer-permanent-border,\n 1px solid var(--kup-border-color)\n );--kup_drawer_slide_transition:var(--kup-drawer-slide-transition, 750ms);--kup_drawer_transition:var(--kup-drawer-transition, 250ms);box-shadow:var(--kup_drawer_box_shadow);display:block;font-size:var(--kup-font-size);height:100vh;left:calc(var(--kup-drawer-width) * -1);position:fixed;top:0;transition:left var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1), right var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1);width:var(--kup-drawer-width);z-index:var(--kup-drawer-zindex)}#kup-component{height:100%;width:100%}.backdrop{background:var(--kup_drawer_backdrop);display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--kup-drawer-zindex)}.drawer{height:100%;position:fixed;width:var(--kup-drawer-width);z-index:calc(var(--kup-drawer-zindex) + 1)}.drawer__content{background-color:var(--kup-drawer-background-color);box-sizing:border-box;height:100%;overflow-y:auto;width:100%}.drawer ::slotted(*){--kup-button-primary-color:var(--kup-drawer-color);--kup-button-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-button-primary-color-h:var(--kup-drawer-color-h);--kup-button-primary-color-s:var(--kup-drawer-color-s);--kup-button-primary-color-l:var(--kup-drawer-color-l);--kup-switch-label-color:var(--kup-drawer-color);--kup-switch-primary-color:var(--kup-drawer-color);--kup-switch-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-color:var(--kup-drawer-color);--kup-textfield-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-primary-color:var(--kup-drawer-color);--kup-textfield-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-color:var(--kup-drawer-color);--kup-tree-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-filter-background-color:var(--kup-drawer-background-color);--kup-tree-icon-color:var(--kup-drawer-color);color:var(--kup-drawer-color);fill:var(--kup-drawer-color)}:host([kup-opened]){left:0}:host([kup-opened]) .backdrop{display:block}:host(.kup-right){left:unset;right:-100%}:host([kup-opened].kup-right){right:0}:host(.kup-permanent){box-shadow:unset;transition:all 250ms}:host(.kup-permanent) .backdrop{display:none}:host(.kup-permanent) .drawer{position:relative}:host(.kup-permanent) .drawer__content{border-right:var(--kup_drawer_permanent_border)}";export{l as kup_drawer}
1
+ import{r,c as o,f as t,h as e,H as a,g as i}from"./p-3da7e4c6.js";import{k as s,g as p,s as d}from"./p-2751c4ba.js";import{c as n}from"./p-ad2e21d2.js";const c="drawer";var u;!function(r){r.customStyle="Custom style of the component.",r.opened="Defaults at false. When set to true, the drawer appears."}(u||(u={}));const l=class{constructor(t){r(this,t),this.kupDrawerClose=o(this,"kup-drawer-close",6),this.kupDrawerOpen=o(this,"kup-drawer-open",6),this.kupDrawerReady=o(this,"kup-drawer-ready",6),this.kupManager=s(),this.opened=!1,this.customStyle=""}async close(){this.opened=!1,this.kupDrawerClose.emit({comp:this,id:this.rootElement.id})}async getProps(r){return p(this,u,r)}async isOpened(){return this.opened}async open(){this.opened=!0,this.kupDrawerOpen.emit({comp:this,id:this.rootElement.id})}async refresh(){t(this)}async setProps(r){d(this,u,r)}async toggle(){this.opened?this.close():this.open()}content(){const r=[],o=Array.prototype.slice.call(this.rootElement.children,0),t=[];for(let t=0;t<o.length;t++)r.push(e("slot",null));return t.push(e("div",{class:`${c}__content`},r)),t}componentWillLoad(){this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this)}componentDidLoad(){this.kupDrawerReady.emit({comp:this,id:this.rootElement.id}),this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){return e(a,{"kup-opened":this.opened},e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{class:"backdrop",onClick:r=>{r.preventDefault(),r.stopPropagation()},onPointerDown:r=>{r.preventDefault(),r.stopPropagation(),this.close()},onTouchStart:r=>{r.preventDefault(),r.stopPropagation()}}),e("div",{id:n},e("div",{class:c},this.content())))}disconnectedCallback(){this.kupManager.theme.unregister(this)}get rootElement(){return i(this)}};l.style=":host{--kup_drawer_backdrop:var(--kup-drawer-backdrop, rgba(0, 0, 0, 0.32));--kup_drawer_box_shadow:var(\n --kup-drawer-box-shadow,\n 0 8px 10px -5px rgba(0, 0, 0, 0.2),\n 0 16px 24px 2px rgba(0, 0, 0, 0.14),\n 0 6px 30px 5px rgba(0, 0, 0, 0.12)\n );--kup_drawer_permanent_border:var(\n --kup-drawer-permanent-border,\n 1px solid var(--kup-border-color)\n );--kup_drawer_slide_transition:var(--kup-drawer-slide-transition, 750ms);--kup_drawer_transition:var(--kup-drawer-transition, 250ms);box-shadow:var(--kup_drawer_box_shadow);display:block;font-size:var(--kup-font-size);height:100vh;left:calc(var(--kup-drawer-width) * -1);position:fixed;top:0;transition:left var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1), right var(--kup_drawer_slide_transition) cubic-bezier(0.4, 0, 0.2, 1);width:var(--kup-drawer-width);z-index:var(--kup-drawer-zindex)}#kup-component{height:100%;width:100%}.backdrop{background:var(--kup_drawer_backdrop);display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--kup-drawer-zindex)}.drawer{height:100%;position:fixed;width:var(--kup-drawer-width);z-index:calc(var(--kup-drawer-zindex) + 1)}.drawer__content{background-color:var(--kup-drawer-background-color);box-sizing:border-box;height:100%;overflow-y:auto;width:100%}.drawer ::slotted(*){--kup-button-primary-color:var(--kup-drawer-color);--kup-button-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-button-primary-color-h:var(--kup-drawer-color-h);--kup-button-primary-color-s:var(--kup-drawer-color-s);--kup-button-primary-color-l:var(--kup-drawer-color-l);--kup-switch-label-color:var(--kup-drawer-color);--kup-switch-primary-color:var(--kup-drawer-color);--kup-switch-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-color:var(--kup-drawer-color);--kup-textfield-color-rgb:var(--kup-drawer-color-rgb);--kup-textfield-primary-color:var(--kup-drawer-color);--kup-textfield-primary-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-color:var(--kup-drawer-color);--kup-tree-color-rgb:var(--kup-drawer-color-rgb);--kup-tree-filter-background-color:var(--kup-drawer-background-color);--kup-tree-icon-color:var(--kup-drawer-color);color:var(--kup-drawer-color);fill:var(--kup-drawer-color)}:host([kup-opened]){left:0}:host([kup-opened]) .backdrop{display:block}:host(.kup-right){left:unset;right:-100%}:host([kup-opened].kup-right){right:0}:host(.kup-permanent){box-shadow:unset;transition:all 250ms}:host(.kup-permanent) .backdrop{display:none}:host(.kup-permanent) .drawer{position:relative}:host(.kup-permanent) .drawer__content{border-right:var(--kup_drawer_permanent_border)}";export{l as kup_drawer}
@@ -1 +1 @@
1
- import{a9 as e,aa as t,b as c,a6 as s,ab as a,ac as n,ad as i,ae as o,af as l,ag as u}from"./p-46daf529.js";import{h as r}from"./p-3da7e4c6.js";import{F as p}from"./p-90576709.js";import{F as d}from"./p-c20c4f66.js";import{F as k}from"./p-9c7b9ff2.js";import{F as b,a as h}from"./p-d5491e4f.js";var f,m,w;!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."}(f||(f={})),function(e){e.LISTBOX="listbox",e.RADIOGROUP="radiogroup",e.GROUP="group"}(m||(m={})),function(e){e.CODE="code",e.DESCRIPTION="description",e.DESCRIPTION_AND_CODE="both"}(w||(w={}));const y=e=>r("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}),r("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},r("div",{class:`switch ${e.checked?"switch--checked":""} ${e.disabled?"switch--disabled":""}`},r("div",{class:"switch__track"}),r("div",{class:"switch__thumb-underlay"},r("div",{class:"switch__thumb"},r("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})))),r("label",{onClick:e.onChange},e.label))),g=document.documentElement,j=(n,o)=>{const f=n.cell,m=n.column,j=n.row,_=n.shape?n.shape:f.shape?f.shape:m.shape?m.shape:null,C=!g.ketchup.objects.isEmptyKupObj(f.obj),I=!(!f.isEditable&&!m.isEditable||!n.editable),$=n.previousValue!==f.value?f.value:"",z=g.ketchup.data.cell.getType(f,_),D=Object.assign({},f.data);let F=f.cssClass?f.cssClass:m.cssClass?m.cssClass:"";const K={"f-cell":!0,[i.OBJ]:!!C,[z+"-cell"]:!0,[n.wrapperClass]:!!n.wrapperClass,[n.density]:!(!n.density||z===s.BAR),[F]:!!F};let V=$;I&&e.includes(z)?V=function(e,t,c,a,n){switch(e){case s.AUTOCOMPLETE:return r("kup-autocomplete",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-autocomplete-change":t=>v(t,n,e,u.UPDATE),"onkup-autocomplete-input":t=>v(t,n,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,n,e,u.ICON_CLICK)}));case s.CHECKBOX:return O(n)&&(t[i.C_CENTERED]=!0),r(p,Object.assign({},c.data,{onChange:t=>v(t,n,e,u.UPDATE)}));case s.CHIP:return r("kup-chip",Object.assign({},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},c.slotData)));case s.COLOR_PICKER:return r("kup-color-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":t=>v(t,n,e,u.UPDATE)}));case s.COMBOBOX:return r("kup-combobox",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-combobox-change":t=>v(t,n,e,u.UPDATE),"onkup-combobox-input":t=>v(t,n,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,n,e,u.ICON_CLICK)}));case s.DATE:return r("kup-date-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-datepicker-change":t=>v(t,n,e,u.UPDATE),"onkup-datepicker-input":t=>v(t,n,e,u.INPUT)}));case s.MULTI_AUTOCOMPLETE:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:w.DESCRIPTION_AND_CODE,selectMode:w.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>v(t,n,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,n,e,u.ICON_CLICK),showDropDownIcon:!1},c.slotData)));case s.MULTI_COMBOBOX:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:w.DESCRIPTION_AND_CODE,selectMode:w.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>v(t,n,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,n,e,u.ICON_CLICK)},c.slotData)));case s.RATING:return r("kup-rating",Object.assign({key:a.name+n.row.id},c.data,{disabled:!1,"onkup-rating-click":t=>v(t,n,e,u.UPDATE)}));case s.SWITCH:return r(y,Object.assign({},c.data,{disabled:!1,onChange:t=>v(t,n,e,u.UPDATE)}));case s.TIME:return r("kup-time-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-timepicker-change":t=>v(t,n,e,u.UPDATE),"onkup-timepicker-input":t=>v(t,n,e,u.INPUT)}));case s.NUMBER:t[i.C_RIGHT_ALIGNED]=!0;case s.LINK:case s.STRING:return r(d,Object.assign({inputType:e===s.NUMBER?"number":null,fullWidth:!!x(n)},c.data,{icon:c.data&&c.data.icon?c.data.icon:c.icon?c.icon:a.icon?a.icon:null,value:e===s.NUMBER&&c.value?g.ketchup.math.numberifySafe(c.value).toString():c.value,onChange:t=>v(t,n,e,u.UPDATE),onInput:t=>v(t,n,e,u.INPUT),onIconClick:t=>v(t,n,e,u.ICON_CLICK)}))}}(z,K,f,m,n):f.data&&t.includes(z)?(n.setSizes&&function(e,t,c){switch(e){case s.BAR:t.sizeY||(t.sizeY="26px");break;case s.BUTTON:let e="";t.label&&(e="36px"),c.style?c.style.height||(c.style.minHeight=e):c.style={minHeight:e};break;case s.CHART:t.sizeX||(t.sizeX="100%"),t.sizeY||(t.sizeY="100%");break;case s.CHIP:case s.RADIO:c.style?c.style.height||(c.style.minHeight="40px"):c.style={minHeight:"40px"}}}(z,D,f),V=n.renderKup?function(e,t,c,a,n,o,l){switch(e){case s.BAR:return c.data?r("div",{style:{height:c.sizeY,width:"100%"}},r(k,Object.assign({},c))):r("kup-image",Object.assign({key:o.name+l.row.id},c));case s.BUTTON:return O(l)&&(t[i.C_CENTERED]=!0),r("kup-button",Object.assign({key:o.name+l.row.id},c,{"onkup-button-click":t=>v(t,l,e,u.CLICK)}));case s.BUTTON_LIST:return O(l)&&(t[i.C_CENTERED]=!0),c["data-storage"]={cell:a,row:n,column:o},r("kup-button-list",Object.assign({key:o.name+l.row.id},c));case s.CHART:return O(l)&&(t[i.C_CENTERED]=!0),r("kup-chart",Object.assign({key:o.name+l.row.id},c));case s.CHIP:return r(h,Object.assign({},c));case s.COLOR_PICKER:return r("kup-color-picker",Object.assign({key:o.name+l.row.id},c,{class:x(l)?"kup-full-width":"",disabled:!0}));case s.GAUGE:return r("kup-gauge",Object.assign({key:o.name+l.row.id,value:g.ketchup.math.numberifySafe(a.value),"width-component":"280px"},c));case s.KNOB:case s.PROGRESS_BAR:return r("kup-progress-bar",Object.assign({key:o.name+l.row.id},c));case s.RADIO:return O(l)&&(t[i.C_CENTERED]=!0),c.disabled=n.readOnly,r("kup-radio",Object.assign({key:o.name+l.row.id},c));case s.RATING:return r("kup-rating",Object.assign({key:o.name+l.row.id},c,{disabled:!0}))}}(z,K,D,f,j,m,n):r("span",{class:"cell-"+z+" placeholder"})):(n.setSizes&&function(e,t,c,n){switch(e){case s.CHECKBOX:case s.ICON:t.sizeX||(t.sizeX="18px"),t.sizeY||(t.sizeY="18px"),c.style?c.style.height||(c.style.minHeight=t.sizeY):c.style={minHeight:t.sizeY};break;case s.IMAGE:n.component.rootElement.tagName===a.BOX?(t.sizeY||(t.sizeY="auto"),void 0===t.fit&&(t.fit=!0)):t.sizeX||(t.sizeX="auto"),t.sizeY||(t.sizeY="64px")}}(z,D,f,n),V=function(e,t,c,a,n,o,u){switch(e){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.DATETIME:case s.TIME:if(c&&""!=c){const e=l(o,n);return r("div",{class:"f-cell__text"},e)}return c;case s.CHECKBOX:return O(u)&&(a[i.C_CENTERED]=!0),r(k,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case s.EDITOR:return r("div",{innerHTML:n.value});case s.ICON:case s.IMAGE:return O(u)&&(a[i.C_CENTERED]=!0),t.badgeData&&(a[i.C_PADDED]=!0),r(k,Object.assign({},t));case s.LINK:return r("a",{href:c,target:"_blank"},n.value);case s.NUMBER:if(c&&""!=c){const e=g.ketchup.math.numberifySafe(n.value),t=l(o,n);return e<0&&(a[i.TEXT_DANGER]=!0),O(u)&&(a[i.C_RIGHT_ALIGNED]=!0),r("div",{class:"f-cell__text"},t)}return r("div",{class:"f-cell__text"},c);case s.SWITCH:return O(u)&&(a[i.C_CENTERED]=!0),t.disabled=!0,r(y,Object.assign({},t));default:return r("div",{class:"f-cell__text"},c)}}(z,D,V,K,f,m,n));let H=null;!I&&(m.icon||f.icon)&&V&&(H=r(k,Object.assign({},{color:`rgba(var(${c.TEXT}-rgb), 0.375)`,resource:f.icon?f.icon:m.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let M=null;g.ketchup.debug.isDebug()&&C?M=f.obj.t+"; "+f.obj.p+"; "+f.obj.k+";":null!=f.title&&""!=f.title.trim()&&(M=f.title);let T=null;if(f.info){const e=Object.assign({},f.info);e.color||(e.color=`var(${c.INFO})`),e.icon||(e.icon="info"),T=r(k,Object.assign({},{color:e.color,resource:e.icon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"}))}return r("div",{onKeyUp:e=>v(e,n,z,u.KEYUP),class:K,"kup-get-cell-props":()=>n,ref:e=>f.element=e,style:f.style},r("div",{class:"f-cell__content",style:f.styleContent,title:M},o&&o.length>0?o:[n.indents,T,H,V]))};function v(e,t,c,a){const n=t.cell,i=t.column,o=t.component,r=t.row;let p=function(e,t){const c=!("INPUT"!==e.target.tagName);let a=c?e.target.value:e.detail.value;return t===s.NUMBER&&c&&(a=g.ketchup.math.formattedStringToNumberString(a,"")),a}(e,c);if(a===u.UPDATE){switch(c){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.TIME:n.data&&(n.data.initialValue=p);break;case s.CHECKBOX:case s.SWITCH:p="on"===p?"0":"1",n.data&&(n.data.checked="0"!==p);break;case s.CHIP:case s.MULTI_AUTOCOMPLETE:case s.MULTI_COMBOBOX:p=e.detail.stringifiedValues,n.data&&(n.data.data=e.detail.comp.data)}n.obj&&(n.obj.k=p.toString()),n.value=p.toString(),n.displayedValue=null,n.displayedValue=l(i,n)}if(o&&o.rootElement){const t=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:o,id:o.rootElement.id,cell:n,column:i,event:e,row:r,type:c}});if(o.rootElement.dispatchEvent(t),a===u.UPDATE)try{o.refresh()}catch(e){}}}function O(e){var t;return o.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}function x(e){var t;return n.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}export{j as F,w as I,m as K,f as a,y as b}
1
+ import{a9 as e,aa as t,b as c,a6 as s,ab as a,ac as n,ad as i,ae as o,af as l,ag as u}from"./p-2751c4ba.js";import{h as r}from"./p-3da7e4c6.js";import{F as p}from"./p-90576709.js";import{F as d}from"./p-79f78bdc.js";import{F as k}from"./p-0e961148.js";import{F as b,a as h}from"./p-d938d1cd.js";var f,m,w;!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."}(f||(f={})),function(e){e.LISTBOX="listbox",e.RADIOGROUP="radiogroup",e.GROUP="group"}(m||(m={})),function(e){e.CODE="code",e.DESCRIPTION="description",e.DESCRIPTION_AND_CODE="both"}(w||(w={}));const y=e=>r("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}),r("div",{class:"form-field "+(e.leadingLabel?"form-field--align-end":"")},r("div",{class:`switch ${e.checked?"switch--checked":""} ${e.disabled?"switch--disabled":""}`},r("div",{class:"switch__track"}),r("div",{class:"switch__thumb-underlay"},r("div",{class:"switch__thumb"},r("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})))),r("label",{onClick:e.onChange},e.label))),g=document.documentElement,j=(n,o)=>{const f=n.cell,m=n.column,j=n.row,_=n.shape?n.shape:f.shape?f.shape:m.shape?m.shape:null,C=!g.ketchup.objects.isEmptyKupObj(f.obj),I=!(!f.isEditable&&!m.isEditable||!n.editable),$=n.previousValue!==f.value?f.value:"",z=g.ketchup.data.cell.getType(f,_),D=Object.assign({},f.data);let F=f.cssClass?f.cssClass:m.cssClass?m.cssClass:"";const K={"f-cell":!0,[i.OBJ]:!!C,[z+"-cell"]:!0,[n.wrapperClass]:!!n.wrapperClass,[n.density]:!(!n.density||z===s.BAR),[F]:!!F};let V=$;I&&e.includes(z)?V=function(e,t,c,a,n){switch(e){case s.AUTOCOMPLETE:return r("kup-autocomplete",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-autocomplete-change":t=>v(t,n,e,u.UPDATE),"onkup-autocomplete-input":t=>v(t,n,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,n,e,u.ICON_CLICK)}));case s.CHECKBOX:return O(n)&&(t[i.C_CENTERED]=!0),r(p,Object.assign({},c.data,{onChange:t=>v(t,n,e,u.UPDATE)}));case s.CHIP:return r("kup-chip",Object.assign({},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-text-field",Object.assign({fullWidth:!0,slot:"field"},c.slotData)));case s.COLOR_PICKER:return r("kup-color-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"",disabled:!1,"onkup-colorpicker-change":t=>v(t,n,e,u.UPDATE)}));case s.COMBOBOX:return r("kup-combobox",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-combobox-change":t=>v(t,n,e,u.UPDATE),"onkup-combobox-input":t=>v(t,n,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,n,e,u.ICON_CLICK)}));case s.DATE:return r("kup-date-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-datepicker-change":t=>v(t,n,e,u.UPDATE),"onkup-datepicker-input":t=>v(t,n,e,u.INPUT)}));case s.MULTI_AUTOCOMPLETE:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-autocomplete",Object.assign({class:"kup-full-width",slot:"field",displayMode:w.DESCRIPTION_AND_CODE,selectMode:w.DESCRIPTION_AND_CODE,"onkup-autocomplete-input":t=>v(t,n,e,u.INPUT),"onkup-autocomplete-iconclick":t=>v(t,n,e,u.ICON_CLICK),showDropDownIcon:!1},c.slotData)));case s.MULTI_COMBOBOX:return r("kup-chip",Object.assign({displayId:!0},c.data,{type:b.INPUT,enableInput:!0,"onKup-chip-change":t=>v(t,n,e,u.UPDATE)}),r("kup-combobox",Object.assign({class:"kup-full-width",slot:"field",displayMode:w.DESCRIPTION_AND_CODE,selectMode:w.DESCRIPTION_AND_CODE,"onkup-combobox-input":t=>v(t,n,e,u.INPUT),"onkup-combobox-iconclick":t=>v(t,n,e,u.ICON_CLICK)},c.slotData)));case s.RATING:return r("kup-rating",Object.assign({key:a.name+n.row.id},c.data,{disabled:!1,"onkup-rating-click":t=>v(t,n,e,u.UPDATE)}));case s.SWITCH:return r(y,Object.assign({},c.data,{disabled:!1,onChange:t=>v(t,n,e,u.UPDATE)}));case s.TIME:return r("kup-time-picker",Object.assign({key:a.name+n.row.id,initialValue:c.value},c.data,{class:x(n)?"kup-full-width":"","onkup-timepicker-change":t=>v(t,n,e,u.UPDATE),"onkup-timepicker-input":t=>v(t,n,e,u.INPUT)}));case s.NUMBER:t[i.C_RIGHT_ALIGNED]=!0;case s.LINK:case s.STRING:return r(d,Object.assign({inputType:e===s.NUMBER?"number":null,fullWidth:!!x(n)},c.data,{icon:c.data&&c.data.icon?c.data.icon:c.icon?c.icon:a.icon?a.icon:null,value:e===s.NUMBER&&c.value?g.ketchup.math.numberifySafe(c.value).toString():c.value,onChange:t=>v(t,n,e,u.UPDATE),onInput:t=>v(t,n,e,u.INPUT),onIconClick:t=>v(t,n,e,u.ICON_CLICK)}))}}(z,K,f,m,n):f.data&&t.includes(z)?(n.setSizes&&function(e,t,c){switch(e){case s.BAR:t.sizeY||(t.sizeY="26px");break;case s.BUTTON:let e="";t.label&&(e="36px"),c.style?c.style.height||(c.style.minHeight=e):c.style={minHeight:e};break;case s.CHART:t.sizeX||(t.sizeX="100%"),t.sizeY||(t.sizeY="100%");break;case s.CHIP:case s.RADIO:c.style?c.style.height||(c.style.minHeight="40px"):c.style={minHeight:"40px"}}}(z,D,f),V=n.renderKup?function(e,t,c,a,n,o,l){switch(e){case s.BAR:return c.data?r("div",{style:{height:c.sizeY,width:"100%"}},r(k,Object.assign({},c))):r("kup-image",Object.assign({key:o.name+l.row.id},c));case s.BUTTON:return O(l)&&(t[i.C_CENTERED]=!0),r("kup-button",Object.assign({key:o.name+l.row.id},c,{"onkup-button-click":t=>v(t,l,e,u.CLICK)}));case s.BUTTON_LIST:return O(l)&&(t[i.C_CENTERED]=!0),c["data-storage"]={cell:a,row:n,column:o},r("kup-button-list",Object.assign({key:o.name+l.row.id},c));case s.CHART:return O(l)&&(t[i.C_CENTERED]=!0),r("kup-chart",Object.assign({key:o.name+l.row.id},c));case s.MULTI_AUTOCOMPLETE:case s.MULTI_COMBOBOX:case s.CHIP:return r(h,Object.assign({},c));case s.COLOR_PICKER:return r("kup-color-picker",Object.assign({key:o.name+l.row.id},c,{class:x(l)?"kup-full-width":"",disabled:!0}));case s.GAUGE:return r("kup-gauge",Object.assign({key:o.name+l.row.id,value:g.ketchup.math.numberifySafe(a.value),"width-component":"280px"},c));case s.KNOB:case s.PROGRESS_BAR:return r("kup-progress-bar",Object.assign({key:o.name+l.row.id},c));case s.RADIO:return O(l)&&(t[i.C_CENTERED]=!0),c.disabled=n.readOnly,r("kup-radio",Object.assign({key:o.name+l.row.id},c));case s.RATING:return r("kup-rating",Object.assign({key:o.name+l.row.id},c,{disabled:!0}))}}(z,K,D,f,j,m,n):r("span",{class:"cell-"+z+" placeholder"})):(n.setSizes&&function(e,t,c,n){switch(e){case s.CHECKBOX:case s.ICON:t.sizeX||(t.sizeX="18px"),t.sizeY||(t.sizeY="18px"),c.style?c.style.height||(c.style.minHeight=t.sizeY):c.style={minHeight:t.sizeY};break;case s.IMAGE:n.component.rootElement.tagName===a.BOX?(t.sizeY||(t.sizeY="auto"),void 0===t.fit&&(t.fit=!0)):t.sizeX||(t.sizeX="auto"),t.sizeY||(t.sizeY="64px")}}(z,D,f,n),V=function(e,t,c,a,n,o,u){switch(e){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.DATETIME:case s.TIME:if(c&&""!=c){const e=l(o,n);return r("div",{class:"f-cell__text"},e)}return c;case s.CHECKBOX:return O(u)&&(a[i.C_CENTERED]=!0),r(k,{resource:t.checked?"check_box":"check_box_outline_blank",sizeX:"18px",sizeY:"18px"});case s.EDITOR:return r("div",{innerHTML:n.value});case s.ICON:case s.IMAGE:return O(u)&&(a[i.C_CENTERED]=!0),t.badgeData&&(a[i.C_PADDED]=!0),r(k,Object.assign({},t));case s.LINK:return r("a",{href:c,target:"_blank"},n.value);case s.NUMBER:if(c&&""!=c){const e=g.ketchup.math.numberifySafe(n.value),t=l(o,n);return e<0&&(a[i.TEXT_DANGER]=!0),O(u)&&(a[i.C_RIGHT_ALIGNED]=!0),r("div",{class:"f-cell__text"},t)}return r("div",{class:"f-cell__text"},c);case s.SWITCH:return O(u)&&(a[i.C_CENTERED]=!0),t.disabled=!0,r(y,Object.assign({},t));default:return r("div",{class:"f-cell__text"},c)}}(z,D,V,K,f,m,n));let H=null;!I&&(m.icon||f.icon)&&V&&(H=r(k,Object.assign({},{color:`rgba(var(${c.TEXT}-rgb), 0.375)`,resource:f.icon?f.icon:m.icon,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"obj-icon"})));let M=null;g.ketchup.debug.isDebug()&&C?M=f.obj.t+"; "+f.obj.p+"; "+f.obj.k+";":null!=f.title&&""!=f.title.trim()&&(M=f.title);let T=null;if(f.info){const e=Object.assign({},f.info);e.color||(e.color=`var(${c.INFO})`),e.icon||(e.icon="info"),T=r(k,Object.assign({},{color:e.color,resource:e.icon,sizeX:"1.25em",sizeY:"1.25em",title:e.message?e.message:"",wrapperClass:"cell-info"}))}return r("div",{onKeyUp:e=>v(e,n,z,u.KEYUP),class:K,"kup-get-cell-props":()=>n,ref:e=>f.element=e,style:f.style},r("div",{class:"f-cell__content",style:f.styleContent,title:M},o&&o.length>0?o:[n.indents,T,H,V]))};function v(e,t,c,a){const n=t.cell,i=t.column,o=t.component,r=t.row;let p=function(e,t){const c=!("INPUT"!==e.target.tagName);let a=c?e.target.value:e.detail.value;return t===s.NUMBER&&c&&(a=g.ketchup.math.formattedStringToNumberString(a,"")),a}(e,c);if(a===u.UPDATE){switch(c){case s.AUTOCOMPLETE:case s.COMBOBOX:case s.DATE:case s.TIME:n.data&&(n.data.initialValue=p);break;case s.CHECKBOX:case s.SWITCH:p="on"===p?"0":"1",n.data&&(n.data.checked="0"!==p);break;case s.CHIP:case s.MULTI_AUTOCOMPLETE:case s.MULTI_COMBOBOX:p=e.detail.stringifiedValues,n.data&&(n.data.data=e.detail.comp.data)}n.obj&&(n.obj.k=p.toString()),n.value=p.toString(),n.displayedValue=null,n.displayedValue=l(i,n)}if(o&&o.rootElement){const t=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:{comp:o,id:o.rootElement.id,cell:n,column:i,event:e,row:r,type:c}});if(o.rootElement.dispatchEvent(t),a===u.UPDATE)try{o.refresh()}catch(e){}}}function O(e){var t;return o.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}function x(e){var t;return n.includes(null===(t=e.component)||void 0===t?void 0:t.rootElement.tagName)}export{j as F,w as I,m as K,f as a,y as b}
@@ -1 +1 @@
1
- import{E as e,J as t,H as l,D as n,af as r,v as i,z as o,ah as s,ai as a,N as u,h as c,a2 as f,aj as h,r as d,m as p}from"./p-46daf529.js";import{h as b}from"./p-3da7e4c6.js";import{F as m}from"./p-ffbd77d5.js";import{F as v}from"./p-0fd98ab4.js";class F extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var x;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(x||(x={}));const w="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,T=k.ketchup?k.ketchup.objects:new o,y=k.ketchup?k.ketchup.data:new s;class j extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new F),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(T.isNumber(r.obj)||T.isDate(r.obj)||T.isTime(r.obj)||T.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new F);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===w?{name:w,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new F);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return y.cell.getUnivocalValue({rows:f},n,!0)}}const C=document.documentElement;function V(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:f.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=V(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=O(e,n,t[l]);if(0!==r)return r}return 0}return O(e,n,t[0])}))}function O(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function I(e=[],t={},l="",n=[],r,i){return null==i&&(i=new j),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const l=s[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),p=f.value;let b=null;for(let e of a)if(e.group.label===d){b=e;break}null===b&&(b={group:{id:p,parent:null,column:l,columnLabel:o[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(b));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<b.group.children.length;e++){const t=b.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:b,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},D(u),b.group.children.push(u)),b=u}}b.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=C.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=C.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=C.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(b,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>N(e,r,l)))}(a,n,c),_(a,u.AVERAGE,n),_(a,u.MATH,n),a}function _(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,t,r,l)))}function N(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{N(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function W(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=W(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=C.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=C.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function A(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function B(e=[],t={}){if(C.ketchup.objects.isEmptyJsObject(e)||C.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=C.ketchup.objects.isNumber(a.obj)?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(C.ketchup.objects.isNumber(a.obj)){const e=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+C.ketchup.math.numberify(r)}}else if(C.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=C.ketchup.dates.toDayjs(a.value);if(C.ketchup.dates.isValid(e)){const r=C.ketchup.dates.toDate(e),i=n[l]?C.ketchup.dates.toDate(C.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.min(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.max(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=C.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=C.ketchup.dates.format(n[i]):C.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function D(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function $(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return E(e,o,r,Number(l),0),o}function E(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=L(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=E(s.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function L(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:R(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function S(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=L(e[l]);return t}function R(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:S(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var z;!function(e){e.SIMPLE="simple",e.FULL="full"}(z||(z={}));const q=document.documentElement,H=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(h.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:q.ketchup.language.translate(d.ROWS)+" / "+q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(d.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return b("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_left",disabled:K(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,b("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_right",disabled:J(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,b("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?b(m,{icon:"plus",onClick:e.onLoadMore,label:q.ketchup.language.translate(p.LOAD_MORE),styling:v.FLAT,wrapperClass:"load-more-button"}):null)};function J(e){return e.currentPage*e.perPage>=e.max}function K(e){return 1==e.currentPage}const U=document.documentElement;function G(e,t,l){if(U.ketchup.math.isNumber(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function P(e,t){if(U.ketchup.math.isNumber(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{F,g as K,j as a,H as b,B as c,G as d,x as e,I as f,M as g,z as h,A as n,$ as p,P as r,V as s,w as t}
1
+ import{E as e,J as t,H as l,D as n,af as r,v as i,z as o,ah as s,ai as a,N as u,h as c,a2 as f,aj as h,r as d,m as p}from"./p-2751c4ba.js";import{h as b}from"./p-3da7e4c6.js";import{F as m}from"./p-fe8c8e11.js";import{F as v}from"./p-0fd98ab4.js";class F extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,l){let n="";if(null==e)return n;let r=e[t];return null==r||(n=l?r.textFieldTmp:r.textField),n}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,l){if(!t)return!1;let n=this._getTextFilterValue(e,t.name,l);if(null!=n&&""!=n.trim())return!0;if(this._hasIntervalTextFieldFilterValues(e,t,l))return!0;let r=this.getCheckBoxFilterValues(e,t.name);return!(null==r||r.length<1)}getCheckBoxFilterValues(e={},t){let l=[];if(null==e)return l;let n=e[t];return null==n||null==n.checkBoxes||(l=n.checkBoxes),l}hasIntervalTextFieldFilterValues(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!1)}hasIntervalTextFieldFilterValuesTmp(e={},t){return this._hasIntervalTextFieldFilterValues(e,t,!0)}_hasIntervalTextFieldFilterValues(e={},l,n){if(null==l)return!1;if(!this.isColumnFiltrableByInterval(l))return!1;let r=this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n);if(null!=r&&""!=r.trim())return!0;let i=this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n);return null!=i&&""!=i.trim()}addCheckboxFilter(t={},l,n){if(null==t)return;let r=t[l];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},t[l]=r),null==r.checkBoxes&&(r.checkBoxes=[]),null==n||null==n.value?r.checkBoxes=[]:e.valuesArrayContainsValue(r.checkBoxes,n.value)||(r.checkBoxes[r.checkBoxes.length]=n)}removeCheckboxFilter(t={},l,n){if(null==t||null==n)return;let r=t[l];if(null==r)return;null==r.checkBoxes&&(r.checkBoxes=[]);let i=e.indexOfValueInValuesArray(r.checkBoxes,n);if(i>=0){let e=[];for(let t=0;t<r.checkBoxes.length;t++)t!=i&&(e[e.length]=r.checkBoxes[t]);r.checkBoxes=[...e]}}isColumnFiltrableByInterval(e){return this.isObjFiltrableByInterval(e.obj)}getIntervalTextFieldFilterValues(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!1)}getIntervalTextFieldFilterValuesTmp(e={},t){return this._getIntervalTextFieldFilterValues(e,t,!0)}_getIntervalTextFieldFilterValues(e={},l,n){return this._hasIntervalTextFieldFilterValues(e,l,n)?[this._getIntervalTextFieldFilterValue(e,l.name,t.FROM,n),this._getIntervalTextFieldFilterValue(e,l.name,t.TO,n)]:["",""]}getIntervalTextFieldFilterValue(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!1)}getIntervalTextFieldFilterValueTmp(e={},t,l){return this._getIntervalTextFieldFilterValue(e,t,l,!0)}_getIntervalTextFieldFilterValue(e={},t,l,n){let r="";if(null==e)return r;let i=e[t];return null==i||n&&null==i.intervalTmp?r:n||null!=i.interval?(r=n?i.intervalTmp[l]:i.interval[l],r):r}setTextFieldFilterValue(e={},t,l){this._setTextFieldFilterValue(e,t,l,!0)}_setTextFieldFilterValue(e={},t,l,n){if(null==e)return;let r=e[t];null==r&&(r={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=r),n?r.textFieldTmp=null!=l?l.trim():l:r.textField=null!=l?l.trim():l}setIntervalTextFieldFilterValue(e={},t,l,n){this._setIntervalTextFieldFilterValue(e,t,l,n,!0)}_setIntervalTextFieldFilterValue(e={},t,l,n,r){if(null==e)return;let i=e[t];null==i&&(i={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null},e[t]=i),null==i.interval&&(i.interval=[],i.interval.push("","")),null==i.intervalTmp&&(i.intervalTmp=[],i.intervalTmp.push("","")),r?i.intervalTmp[n]=null!=l?l.trim():l:i.interval[n]=null!=l?l.trim():l}saveTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValueTmp(e,l),!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.FROM),t.FROM,!1),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValueTmp(e,l,t.TO),t.TO,!1)}resetTextualFilters(e={},l){this._setTextFieldFilterValue(e,l,this.getTextFilterValue(e,l),!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.FROM),t.FROM,!0),this._setIntervalTextFieldFilterValue(e,l,this.getIntervalTextFieldFilterValue(e,l,t.TO),t.TO,!0)}getFilterValueForTooltip(e={},r){let i=this.getTextFilterValue(e,r.name),o=this.getIntervalTextFieldFilterValues(e,r),s=this.getCheckBoxFilterValues(e,r.name),a="",u=l(i,r.obj,r.decimals);""!=i&&(a=" AND "),""!=o[t.FROM]&&(u+=a+"(>= "+l(o[t.FROM],r.obj,r.decimals)+")",a=" AND "),""!=o[t.TO]&&(u+=a+"(<= "+l(o[t.TO],r.obj,r.decimals)+")",a=" AND "),a="";let c="";return s.forEach((e=>{c+=a+n(e,r),a=" OR "})),""!=c&&(c="("+c+")",""!=u&&(c=" AND "+c)),c=u+c,c}removeFilter(e={},t){e[t]={textField:"",textFieldTmp:"",checkBoxes:[],interval:null,intervalTmp:null}}}var x;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.removableColumns="Sets the possibility to remove the selected column.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(x||(x={}));const w="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const k=document.documentElement,T=k.ketchup?k.ketchup.objects:new o,y=k.ketchup?k.ketchup.data:new s;class j extends e{isFilterCompliantForCell(e,t,l){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,l)}isFilterCompliantForCellObj(e,t,l){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,l)}isRowCompliant(e,t={},l="",n=!1,r=[],i){return this.areCellsCompliant(e.cells,t,l,n,r,i)}areCellsCompliant(e,t={},l="",n=!1,o=[],s){if(n){let t=!0;if(o&&null!=o&&o.length>0){t=!1;let n=this.filterIsNegative(l);for(let i=0;i<o.length;i++){if(0==o[i].visible)continue;const s=e[o[i].name];if(null==s)continue;t=this.isFilterCompliantForValue(s.value,l);let a=r(o[i],s);if(a!=s.value&&(t=t||this.isFilterCompliantForValue(a,l)),1==t&&!n)break;if(0==t&&n)break}}if(!t)return!1}if(null==s&&(s=new F),!this.hasFilters(t,o,s))return!0;let a=Object.keys(t);for(let l=0;l<a.length;l++){let n=a[l];const r=e[n];if(!r)return!1;let u=s.getTextFilterValue(t,n),c=s.getIntervalTextFieldFilterValues(t,i(o,n));const f=this.filterIsNegative(u);let h=this.isFilterCompliantForCell(r,u,c),d=f;if(T.isNumber(r.obj)||T.isDate(r.obj)||T.isTime(r.obj)||T.isTimestamp(r.obj)||(d=this.isFilterCompliantForCellObj(r,u,c)),f){if(!h||!d)return!1}else if(!h&&!d)return!1;let p=s.getCheckBoxFilterValues(t,n);if(0==p.length)continue;let b=!1;for(let e=0;e<p.length;e++){let t=p[e];if(null!=t&&null!=t.value){if(null!=r.value&&r.value.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}if(null!=r.obj&&r.obj.k.toLowerCase().trim()==t.value.toLowerCase().trim()){b=!0;break}}}if(!b)return!1}return!0}hasFilters(e={},t,l){if(null==e)return!1;let n=Object.keys(e);if(null==n||n.length<1)return!1;null==l&&(l=new F);for(let r=0;r<n.length;r++){let o=n[r],s=null;if(s=o===w?{name:w,title:""}:i(t,o),l.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},l="",n=[],r){if(!e||null==e)return[];let i=[];const o=!(!l||!n);if(this.hasFilters(t,n,r)||o)for(let s=0;s<e.length;s++){let a=e[s];(a.id&&a.id.indexOf("insert_")>-1||this.isRowCompliant(a,t,l,o,n,r))&&(i[i.length]=a)}else i=[...e];return i}getColumnValues(t,n,r,i){let o=new Array;null==i&&(i=new F);let s=i.getTextFilterValueTmp(t.filters,n.name),a=i.getIntervalTextFieldFilterValuesTmp(t.filters,n),u=i.getCheckBoxFilterValues(t.filters,n.name);if(null!=n.valuesForFilter&&n.valuesForFilter.length>0)return n.valuesForFilter.forEach((t=>{let r=t;(e.valuesArrayContainsValue(u,r)||""==s||i.isFilterCompliantForSimpleValue(r,n.obj,s,a))&&o.push({value:r,displayedValue:l(r,n.obj,n.decimals)})})),o;let c=Object.assign({},t.filters);c[n.name]={textField:s,textFieldTmp:s,checkBoxes:[],interval:a,intervalTmp:a};let f=this.filterRows(t.getRows(),c,r,t.getVisibleColumns(),i);for(let e=0;e<u.length;e++)o.push(u[e]);return y.cell.getUnivocalValue({rows:f},n,!0)}}const C=document.documentElement;function V(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const l=e[0].group.column;let n=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let l of t)if(l.column===e)return l;return null}(l,t);return n||(n={column:l,sortMode:f.A}),e.sort(((e,t)=>a({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},n.sortMode))),e.forEach((e=>{e.group.children=V(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const l=t.length>1;return e.slice(0).sort(((e,n)=>{if(l){for(let l=0;l<t.length;l++){const r=O(e,n,t[l]);if(0!==r)return r}return 0}return O(e,n,t[0])}))}function O(e,t,l){const n=e.cells[l.column],r=t.cells[l.column];return n||r?n?r?a(n,r,l.sortMode):-1:1:0}function I(e=[],t={},l="",n=[],r,i){return null==i&&(i=new j),i.filterRows(e,t,l,n,r)}function M(e=[],t=[],l=[],n={}){if(!t)return[];if(!l||0===l.length||!e||0===e.length)return t;const o={},s=l.filter((({column:t})=>{for(let{name:l,title:n}of e)if(l===t)return o[l]=n,!0;return!1}));if(0===s.length)return t;const a=[];let c={};return t.forEach((t=>{const l=s[0].column,f=t.cells[l];if(f){const h=i(e,l),d=r(h,f),p=f.value;let b=null;for(let e of a)if(e.group.label===d){b=e;break}null===b&&(b={group:{id:p,parent:null,column:l,columnLabel:o[l],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},a.push(b));for(let l=1;l<s.length;l++){const n=s[l],a=t.cells[n.column];if(a){const t=i(e,n.column),l=r(t,a),s=a.value;let u=null;for(let e=0;e<b.group.children.length;e++){const t=b.group.children[e];if(t.group.label===l){u=t;break}}u||(u={cells:{},group:{id:s,parent:b,column:n.column,columnLabel:o[n.column],children:[],expanded:!1,label:l,totals:{},obj:a.obj}},D(u),b.group.children.push(u)),b=u}}b.group.children.push(t),function(e,t,l,n){if(!e||!t)return;const r=Object.keys(t);0!==r.length&&r.forEach((r=>{const i=C.ketchup.math.numberify(e.group.totals[r]||0),o=l.cells[r];if(o){let l=C.ketchup.objects.isNumber(o.obj);const s=t[r];switch(s){case u.COUNT:e.group.totals[r]=i+1;let t=e.group.parent;for(;null!=t;)t.group.totals[r]=(t.group.totals[r]||0)+1,t=t.group.parent;break;case u.DISTINCT:let a;if(a=l?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value)):o.value,n[e.group.id]){let t=n[e.group.id][r];t?t.push(a):(n[e.group.id][r]=[],n[e.group.id][r].push(a))}else n[e.group.id]={},n[e.group.id][r]=[],n[e.group.id][r].push(a);let c=e.group.parent;for(;null!=c;){if(n[c.group.id]){let e=n[c.group.id][r];e?e.push(a):(n[c.group.id][r]=[],n[c.group.id][r].push(a))}else n[c.group.id]={},n[c.group.id][r]=[],n[c.group.id][r].push(a);c=c.group.parent}break;case u.SUM:case u.AVERAGE:if(l){const t=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t+i;let l=e.group.parent;for(;null!=l;){const e=C.ketchup.math.numberify(l.group.totals[r]||0);l.group.totals[r]=t+e,l=l.group.parent}}break;case u.MIN:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.min(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.min(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.min(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;case u.MAX:if(l){const t=e.group.totals[r],l=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(o.value));e.group.totals[r]=t?Math.max(t,l):l;let n=e.group.parent;for(;null!=n;){const e=n.group.totals[r];n.group.totals[r]=e?Math.max(e,l):l,n=n.group.parent}}else if(C.ketchup.objects.isDate(o.obj)){const t=o.obj?C.ketchup.objects.parseDate(o.obj):C.ketchup.dates.toDayjs(o.value);if(C.ketchup.dates.isValid(t)){const l=C.ketchup.dates.toDate(t),n=e.group.totals[r];if(n){let t=[];t.push(l),t.push(C.ketchup.dates.format(n)),e.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else e.group.totals[r]=l;let i=e.group.parent;for(;null!=i;){const e=i.group.totals[r];if(e){let t=[];t.push(l),t.push(C.ketchup.dates.format(e)),i.group.totals[r]=C.ketchup.dates.format(C.ketchup.dates.max(t))}else i.group.totals[r]=l;i=i.group.parent}}}break;default:0!=s.indexOf(u.MATH)&&console.warn(`invalid total mode: ${s}`)}}}))}(b,n,t,c)}})),function(e,t,l){if(!e||!t)return;const n=Object.keys(t);if(0===e.length||!e[0].group||0===n.length)return;let r=n.filter((e=>u.DISTINCT===t[e]));r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>N(e,r,l)))}(a,n,c),_(a,u.AVERAGE,n),_(a,u.MATH,n),a}function _(e,t,l){if(!e||!l)return;const n=Object.keys(l);if(0===e.length||!e[0].group||0===n.length)return;let r;t==u.AVERAGE&&(r=n.filter((e=>u.AVERAGE===l[e]))),t==u.MATH&&(r=n.filter((e=>0==l[e].indexOf(u.MATH)))),r.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>W(e,t,r,l)))}function N(e,t,l){const n=e.group.children;0!==n.length&&(n[0].group&&n.forEach((e=>{N(e,t,l)})),t.forEach((t=>{e.group.totals[t]=new Set(l[e.group.id][t]).size})))}function W(e,t,l,n){const r=e.group.children;if(0===r.length)return 0;let i=0;return r[0].group?r.forEach((e=>{i+=W(e,t,l,n)})):i=r.length,l.forEach((l=>{if(t==u.AVERAGE&&(e.group.totals[l]=C.ketchup.math.numberify(e.group.totals[l])/i),t==u.MATH){let t=n[l].substring(u.MATH.length);e.group.totals[l]=C.ketchup.math.formulas.custom(t,e.group.totals)}})),i}function A(e,t){if(t){const l=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const l=t.cells[e.name];l&&e.obj&&!l.obj&&(l.obj={t:e.obj.t,p:e.obj.p,k:l.value})}}))})),l}}function B(e=[],t={}){if(C.ketchup.objects.isEmptyJsObject(e)||C.ketchup.objects.isEmptyJsObject(t))return{};const l=Object.keys(t),n={},r=new Array;if(0===l.length||l.every((e=>t[e]===u.COUNT)))l.forEach((t=>n[t]=e.length));else{let i={};e.forEach(((e,o,s)=>{l.filter((e=>u.COUNT!==t[e]&&0!=t[e].indexOf(u.MATH))).forEach((l=>{const a=e.cells[l];if(a)if(t[l]===u.DISTINCT){let e;e=C.ketchup.objects.isNumber(a.obj)?C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value)):a.value;let t=i[l];t?t.push(e):(i[l]=[],i[l].push(e))}else if(C.ketchup.objects.isNumber(a.obj)){const e=C.ketchup.math.numberify(C.ketchup.math.numberifySafe(a.value));let r=n[l];switch(!0){case t[l]===u.MIN:n[l]=r?Math.min(r,e):e;break;case t[l]===u.MAX:n[l]=r?Math.max(r,e):e;break;default:r=n[l]||0,n[l]=e+C.ketchup.math.numberify(r)}}else if(C.ketchup.objects.isDate(a.obj)){-1==r.indexOf(l)&&r.push(l);const e=C.ketchup.dates.toDayjs(a.value);if(C.ketchup.dates.isValid(e)){const r=C.ketchup.dates.toDate(e),i=n[l]?C.ketchup.dates.toDate(C.ketchup.dates.toDayjs(n[l])):null;switch(!0){case t[l]===u.MIN:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.min(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE);break;case t[l]===u.MAX:if(i){let e=[];e.push(r),e.push(i),n[l]=C.ketchup.dates.format(C.ketchup.dates.max(e),c.ISO_DATE)}else n[l]=C.ketchup.dates.format(r,c.ISO_DATE)}}}o===s.length-1&&t[l]===u.DISTINCT&&(n[l]=new Set(i[l]).size,i[l]=[])}))}))}for(let i of l){switch(!0){case t[i]===u.AVERAGE:const l=n[i];l&&e.length>0&&(n[i]=l/e.length);break;case t[i]===u.COUNT:n[i]=e.length;break;case 0==t[i].indexOf(u.MATH):n[i]=C.ketchup.math.formulas.custom(t[i].substring(u.MATH.length),n)}n[i]&&(-1!=r.indexOf(i)?n[i]=C.ketchup.dates.format(n[i]):C.ketchup.math.isNumber(n[i])&&(n[i]=+n[i].toFixed(2)))}return n}function D(e){if(!e.group)return;let t=e.group.id,l=e.group.parent;for(;null!==l;)t=`${l.group.id};${t}`,l=l.group.parent;e.group.id=t}function $(e,t,l,n){const r=t*l-l,i=r+Number(l);if(0==n)return e.slice(r,i);let o=[];return E(e,o,r,Number(l),0),o}function E(e,t,l,n,r){let i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=L(e[o]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=E(s.group.children,a.group.children,l,n,r);r=e.ci,i=e.added,1==i&&(t[t.length]=a)}else r>=l&&(t[t.length]=a,i=!0),r++;if(r>=l+n)break}return{ci:r,added:i}}function L(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:R(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function S(e){if(null==e)return null;let t=[];for(let l=0;l<e.length;l++)t[t.length]=L(e[l]);return t}function R(e){return null==e?null:{id:e.id,parent:Object.assign({},e.parent),column:e.column,columnLabel:e.columnLabel,expanded:e.expanded,label:e.label,children:S(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}var z;!function(e){e.SIMPLE="simple",e.FULL="full"}(z||(z={}));const q=document.documentElement,H=e=>{const t=Math.ceil(e.max/e.perPage),l=function(e,t){const l=[];for(let n=1;n<=t;n++){const t=n==e.currentPage;l.push({id:n.toString(),selected:t,value:n.toString()})}return l}(e,t),n=function(e){const t=[];let l=e.perPage;if(0===l)return t;for(;l<e.max;){const n=l==e.perPage;t.push({id:l.toString(),selected:n,value:l.toString()}),l*=2}const n=e.max==e.perPage;return t.push({id:e.max.toString(),selected:n,value:e.max.toString()}),t}(e),r={"kup-list":{data:l},"kup-text-field":{label:q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(h.TOTAL)+`: ${t}`,helperWhenFocused:!0,inputType:"number",max:t,min:1}},i={"kup-list":{data:n},"kup-text-field":{label:q.ketchup.language.translate(d.ROWS)+" / "+q.ketchup.language.translate(h.PAGE),helper:q.ketchup.language.translate(d.TOTAL)+`: ${e.max}`,helperWhenFocused:!0,inputType:"number",max:e.max,min:1}};return b("div",Object.assign({class:`f-paginator ${e.mode?e.mode:""} ${e.wrapperClass?e.wrapperClass:""}`},e.dataSet,{id:e.id,title:e.title}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_left",disabled:K(e),onClick:e.onPrevPage,wrapperClass:"prev-page"}):null,b("kup-combobox",{class:"page-selector",data:r,initialValue:e.currentPage.toString(),"onkup-combobox-change":e.onPageChange}),e.mode!==z.SIMPLE?b(m,{icon:"chevron_right",disabled:J(e),onClick:e.onNextPage,wrapperClass:"next-page"}):null,b("kup-combobox",{class:"rows-selector",data:i,initialValue:e.perPage.toString(),"onkup-combobox-change":e.onRowsChange}),e.onLoadMore?b(m,{icon:"plus",onClick:e.onLoadMore,label:q.ketchup.language.translate(p.LOAD_MORE),styling:v.FLAT,wrapperClass:"load-more-button"}):null)};function J(e){return e.currentPage*e.perPage>=e.max}function K(e){return 1==e.currentPage}const U=document.documentElement;function G(e,t,l){if(U.ketchup.math.isNumber(e)){const n=Math.ceil(t/l);let r=e;return r>n&&(r=n),r<1&&(r=1),r}return null}function P(e,t){if(U.ketchup.math.isNumber(e)){let l=e;return l>t&&(l=t),l<1&&(l=1),l}return null}export{F,g as K,j as a,H as b,B as c,G as d,x as e,I as f,M as g,z as h,A as n,$ as p,P as r,V as s,w as t}
@@ -1 +1 @@
1
- import{r as t,c as e,f as i,h as o,H as s,g as r}from"./p-3da7e4c6.js";import{k as a,g as h,s as n}from"./p-46daf529.js";import{c as p}from"./p-ad2e21d2.js";var l;!function(t){t.customStyle="Custom style of the component.",t.placeholderAttrs="Html attributes of the picture before the component enters the viewport.",t.resourceAttrs="Html attributes of the picture after the component enters the viewport."}(l||(l={}));var f,d,c,u,m,w,v=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},b=function(t,e,i,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,i):s?s.value=i:e.set(t,i),i};const k=class{constructor(i){t(this,i),this.kupPhotoFramePlaceholderLoad=e(this,"kup-photoframe-placeholderload",6),this.kupPhotoFrameResourceLoad=e(this,"kup-photoframe-resourceload",6),f.set(this,null),d.set(this,a()),c.set(this,null),u.set(this,null),m.set(this,!1),w.set(this,null),this.isInViewport=!1,this.customStyle="",this.placeholderAttrs={},this.resourceAttrs={},this.threshold=.25}async getProps(t){return h(this,l,t)}async refresh(){i(this)}async setProps(t){n(this,l,t)}setObserver(){b(this,f,new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.isInViewport=!0,v(this,f,"f").unobserve(this.rootElement))}))}),{threshold:this.threshold}),"f")}componentWillLoad(){v(this,d,"f").debug.logLoad(this,!1),v(this,d,"f").theme.register(this),this.setObserver()}componentDidLoad(){v(this,d,"f").debug.logLoad(this,!0)}componentWillRender(){v(this,d,"f").debug.logRender(this,!1)}componentDidRender(){v(this,d,"f").debug.logRender(this,!0)}render(){return this.isInViewport&&!v(this,m,"f")&&b(this,m,!0,"f"),o(s,null,o("style",null,v(this,d,"f").theme.setKupStyle(this.rootElement)),o("div",{id:p,ref:t=>{b(this,w,t,"f")}},o("img",Object.assign({},this.placeholderAttrs,{class:"placeholder",ref:t=>b(this,c,t,"f"),onLoad:()=>{v(this,c,"f").naturalWidth>v(this,c,"f").naturalHeight?v(this,w,"f").classList.add("horizontal"):v(this,w,"f").classList.add("vertical"),v(this,f,"f").observe(this.rootElement),v(this,c,"f").classList.add("placeholder--loaded"),this.kupPhotoFramePlaceholderLoad.emit({comp:this,id:this.rootElement.id})}})),v(this,m,"f")?o("img",Object.assign({},this.resourceAttrs,{class:"resource",ref:t=>b(this,u,t,"f"),onLoad:()=>{v(this,c,"f").classList.add("placeholder--fade-out"),v(this,u,"f").classList.add("resource--fade-in"),this.kupPhotoFrameResourceLoad.emit({comp:this,id:this.rootElement.id})}})):null))}disconnectedCallback(){var t;v(this,d,"f").theme.unregister(this),null===(t=v(this,f,"f"))||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return r(this)}};f=new WeakMap,d=new WeakMap,c=new WeakMap,u=new WeakMap,m=new WeakMap,w=new WeakMap,k.style=":host{--kup_photoframe_border:var(\n --kup-photoframe-border,\n 1px inset var(--kup-border-color)\n );--kup_photoframe_fade_out_time:var(--kup-photoframe-fade-out-time, 2000ms);border:var(--kup_photoframe_border);display:block;height:100%;position:relative;width:100%}#kup-component{position:relative;height:100%;width:100%}img{max-height:100%;max-width:100%}.horizontal img{width:100%}.vertical img{height:100%}.placeholder{display:none;transition:opacity var(--kup_photoframe_fade_out_time) ease-out;will-change:opacity;z-index:1}.placeholder--loaded{display:block}.placeholder--fade-out{opacity:0;position:absolute}.resource{display:none;left:0;position:absolute;top:0;z-index:0}.resource--fade-in{display:block;position:relative}:host(.kup-fit) img{height:100%;object-fit:cover;width:100%}";export{k as kup_photo_frame}
1
+ import{r as t,c as e,f as i,h as o,H as s,g as r}from"./p-3da7e4c6.js";import{k as a,g as h,s as n}from"./p-2751c4ba.js";import{c as p}from"./p-ad2e21d2.js";var l;!function(t){t.customStyle="Custom style of the component.",t.placeholderAttrs="Html attributes of the picture before the component enters the viewport.",t.resourceAttrs="Html attributes of the picture after the component enters the viewport."}(l||(l={}));var f,c,d,u,m,w,b=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},v=function(t,e,i,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,i):s?s.value=i:e.set(t,i),i};const k=class{constructor(i){t(this,i),this.kupPhotoFramePlaceholderLoad=e(this,"kup-photoframe-placeholderload",6),this.kupPhotoFrameResourceLoad=e(this,"kup-photoframe-resourceload",6),f.set(this,null),c.set(this,a()),d.set(this,null),u.set(this,null),m.set(this,!1),w.set(this,null),this.isInViewport=!1,this.customStyle="",this.placeholderAttrs={},this.resourceAttrs={},this.threshold=.25}async getProps(t){return h(this,l,t)}async refresh(){i(this)}async setProps(t){n(this,l,t)}setObserver(){v(this,f,new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(this.isInViewport=!0,b(this,f,"f").unobserve(this.rootElement))}))}),{threshold:this.threshold}),"f")}componentWillLoad(){b(this,c,"f").debug.logLoad(this,!1),b(this,c,"f").theme.register(this),this.setObserver()}componentDidLoad(){b(this,c,"f").debug.logLoad(this,!0)}componentWillRender(){b(this,c,"f").debug.logRender(this,!1)}componentDidRender(){b(this,c,"f").debug.logRender(this,!0)}render(){return this.isInViewport&&!b(this,m,"f")&&v(this,m,!0,"f"),o(s,null,o("style",null,b(this,c,"f").theme.setKupStyle(this.rootElement)),o("div",{id:p,ref:t=>{v(this,w,t,"f")}},o("img",Object.assign({},this.placeholderAttrs,{class:"placeholder",ref:t=>v(this,d,t,"f"),onLoad:()=>{b(this,d,"f").naturalWidth>b(this,d,"f").naturalHeight?b(this,w,"f").classList.add("horizontal"):b(this,w,"f").classList.add("vertical"),b(this,f,"f").observe(this.rootElement),b(this,d,"f").classList.add("placeholder--loaded"),this.kupPhotoFramePlaceholderLoad.emit({comp:this,id:this.rootElement.id})}})),b(this,m,"f")?o("img",Object.assign({},this.resourceAttrs,{class:"resource",ref:t=>v(this,u,t,"f"),onLoad:()=>{b(this,d,"f").classList.add("placeholder--fade-out"),b(this,u,"f").classList.add("resource--fade-in"),this.kupPhotoFrameResourceLoad.emit({comp:this,id:this.rootElement.id})}})):null))}disconnectedCallback(){var t;b(this,c,"f").theme.unregister(this),null===(t=b(this,f,"f"))||void 0===t||t.unobserve(this.rootElement)}get rootElement(){return r(this)}};f=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,m=new WeakMap,w=new WeakMap,k.style=":host{--kup_photoframe_border:var(\n --kup-photoframe-border,\n 1px inset var(--kup-border-color)\n );--kup_photoframe_fade_out_time:var(--kup-photoframe-fade-out-time, 2000ms);border:var(--kup_photoframe_border);display:block;height:100%;position:relative;width:100%}#kup-component{position:relative;height:100%;width:100%}img{max-height:100%;max-width:100%}.horizontal img{width:100%}.vertical img{height:100%}.placeholder{display:none;transition:opacity var(--kup_photoframe_fade_out_time) ease-out;will-change:opacity;z-index:1}.placeholder--loaded{display:block}.placeholder--fade-out{opacity:0;position:absolute}.resource{display:none;left:0;position:absolute;top:0;z-index:0}.resource--fade-in{display:block;position:relative}:host(.kup-fit) img{height:100%;object-fit:cover;width:100%}";export{k as kup_photo_frame}
@@ -1,4 +1,4 @@
1
- import{r as n,c as e,f as t,h as r,H as i,g as u,a as o}from"./p-3da7e4c6.js";import{ao as a,ap as l,k as s,h as c,af as f,g as h,s as d,K as v,I as y}from"./p-46daf529.js";import{c as m}from"./p-ad2e21d2.js";import{F as p}from"./p-c20c4f66.js";import{F as w}from"./p-fb03f2f5.js";import"./p-6507e9eb.js";var b,g,k;!function(n){n.customStyle="Custom style of the component.",n.data="Dataset containg the tasks list",n.detailData="Dataset containg the details list",n.detailColorCol="Column containing the detail color, in hex format",n.detailColumns="Columns containing informations displayed in the left box, near the gantt of details",n.detailDates="Columns containing detail duration, from (firstDate) to (secondDate)",n.detailFilter="Sets the detail's filter.",n.detailHeight="Height for detail gantt",n.detailIdCol="Column containing unique detail identifier",n.detailNameCol="Column containing detail name displayed",n.detailPrevDates="Columns containing forecast detail duration, from (firstDate) to (secondDate)",n.detailInitialScrollX="Sets the initial scroll X for the detail.",n.detailInitialScrollY="Sets the initial scroll Y for the detail.",n.listCellWidth="Total size of the cells inside to the left box, near the gantt",n.maxWidth="Max width for component",n.phaseColorCol="Column containing the phase color in hex format",n.phaseColumns="Columns containing informations displayed in the left box ,near the gantt of phases",n.phaseColParDep="Column containing the name of the parent phases",n.phaseDates="Columns containing phase duration, from (firstDate) to (secondDate)",n.phaseIdCol="Column containing unique phase identifier",n.phaseNameCol="Column containing phase name displayed",n.phasePrevDates="Columns containing forecast phase duration, from (firstDate) to (secondDate)",n.readOnly="When true, the two gantts are not interactable.",n.showSecondaryDates="Enable/disable display of secondary dates",n.taskColumns="Columns containing informations displayed in the left box, near the gantt",n.taskDates="Columns containing task duration, from (firstDate) to (secondDate)",n.taskFilter="Sets the task's filter.",n.taskHeight="Height for main gantt",n.taskIdCol="Column containing unique task identifier",n.taskNameCol="Column containing task name displayed",n.taskPrevDates="Columns containing forecast task duration, from (firstDate) to (secondDate)",n.taskInitialScrollX="Sets the initial scroll X for the task.",n.taskInitialScrollY="Sets the initial scroll Y for the task.",n.titleMess="Message displayed on top"}(b||(b={})),function(n){n.onTaskOpening="onTaskOpening",n.onTaskClosing="onTaskClosing",n.onClick="onClick",n.onResize="onResize",n.onRightClick="onRightClick"}(g||(g={})),function(n){n.TASK="task",n.PHASE="phase",n.DETAIL="detail"}(k||(k={}));class x{constructor(n,e=100){this.dateTime=new Date,this.event=n,this.threshold=e}isEquivalent(n){const e=(new Date).valueOf()-this.dateTime.valueOf();return JSON.stringify(this.event)===JSON.stringify(n)&&e<this.threshold}resetDateTime(){this.dateTime=new Date}}const S={listCellWidth:"300px",rowHeight:40,barFill:90,projectProgressColor:"#CBCBCB",projectProgressSelectedColor:"#CBCBCB",projectBackgroundColor:"#CBCBCB",projectBackgroundSelectedColor:"#CBCBCB",barProgressColor:"#A2A415",barProgressSelectedColor:"#A2A415",barBackgroundColor:"#A2A415",barBackgroundSelectedColor:"#A2A415"};
1
+ import{r as n,c as e,f as t,h as r,H as i,g as u,a as o}from"./p-3da7e4c6.js";import{ao as a,ap as l,k as s,h as c,af as f,g as h,s as d,K as v,I as y}from"./p-2751c4ba.js";import{c as m}from"./p-ad2e21d2.js";import{F as p}from"./p-79f78bdc.js";import{F as w}from"./p-fb03f2f5.js";import"./p-6507e9eb.js";var b,g,k;!function(n){n.customStyle="Custom style of the component.",n.data="Dataset containg the tasks list",n.detailData="Dataset containg the details list",n.detailColorCol="Column containing the detail color, in hex format",n.detailColumns="Columns containing informations displayed in the left box, near the gantt of details",n.detailDates="Columns containing detail duration, from (firstDate) to (secondDate)",n.detailFilter="Sets the detail's filter.",n.detailHeight="Height for detail gantt",n.detailIdCol="Column containing unique detail identifier",n.detailNameCol="Column containing detail name displayed",n.detailPrevDates="Columns containing forecast detail duration, from (firstDate) to (secondDate)",n.detailInitialScrollX="Sets the initial scroll X for the detail.",n.detailInitialScrollY="Sets the initial scroll Y for the detail.",n.listCellWidth="Total size of the cells inside to the left box, near the gantt",n.maxWidth="Max width for component",n.phaseColorCol="Column containing the phase color in hex format",n.phaseColumns="Columns containing informations displayed in the left box ,near the gantt of phases",n.phaseColParDep="Column containing the name of the parent phases",n.phaseDates="Columns containing phase duration, from (firstDate) to (secondDate)",n.phaseIdCol="Column containing unique phase identifier",n.phaseNameCol="Column containing phase name displayed",n.phasePrevDates="Columns containing forecast phase duration, from (firstDate) to (secondDate)",n.readOnly="When true, the two gantts are not interactable.",n.showSecondaryDates="Enable/disable display of secondary dates",n.taskColumns="Columns containing informations displayed in the left box, near the gantt",n.taskDates="Columns containing task duration, from (firstDate) to (secondDate)",n.taskFilter="Sets the task's filter.",n.taskHeight="Height for main gantt",n.taskIdCol="Column containing unique task identifier",n.taskNameCol="Column containing task name displayed",n.taskPrevDates="Columns containing forecast task duration, from (firstDate) to (secondDate)",n.taskInitialScrollX="Sets the initial scroll X for the task.",n.taskInitialScrollY="Sets the initial scroll Y for the task.",n.titleMess="Message displayed on top"}(b||(b={})),function(n){n.onTaskOpening="onTaskOpening",n.onTaskClosing="onTaskClosing",n.onClick="onClick",n.onResize="onResize",n.onRightClick="onRightClick"}(g||(g={})),function(n){n.TASK="task",n.PHASE="phase",n.DETAIL="detail"}(k||(k={}));class x{constructor(n,e=100){this.dateTime=new Date,this.event=n,this.threshold=e}isEquivalent(n){const e=(new Date).valueOf()-this.dateTime.valueOf();return JSON.stringify(this.event)===JSON.stringify(n)&&e<this.threshold}resetDateTime(){this.dateTime=new Date}}const S={listCellWidth:"300px",rowHeight:40,barFill:90,projectProgressColor:"#CBCBCB",projectProgressSelectedColor:"#CBCBCB",projectBackgroundColor:"#CBCBCB",projectBackgroundSelectedColor:"#CBCBCB",barProgressColor:"#A2A415",barProgressSelectedColor:"#A2A415",barBackgroundColor:"#A2A415",barBackgroundSelectedColor:"#A2A415"};
2
2
  /**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -1 +1 @@
1
- import{h as e,a as t}from"./p-3da7e4c6.js";import{K as l}from"./p-46daf529.js";const i=document.documentElement,d=(t,l)=>e("div",Object.assign({class:`f-text-field ${t.danger?"kup-danger":""} ${t.fullHeight?"kup-full-height":""} ${t.fullWidth?"kup-full-width":""} ${t.info?"kup-info":""} ${t.secondary?"kup-secondary":""} ${t.shaped?"kup-shaped":""} ${t.success?"kup-success":""} ${t.warning?"kup-warning":""} ${t.wrapperClass?t.wrapperClass:""}`},t.dataSet,{id:t.id,title:t.title}),t.leadingLabel||t.trailingLabel?e("div",{class:"mdc-form-field "+(t.leadingLabel?"mdc-form-field--align-end":"")},[n(t),c(t),e("label",null,t.label)]):[n(t),c(t)],l);function n(d){var n,c;const o=d.textArea||d.outlined;let s,r;if(!d.label||d.leadingLabel||d.trailingLabel||(s=e("label",{class:"mdc-floating-label",htmlFor:"kup-input"},d.label)),d.icon){let i,n="";if(Object.values(l).indexOf(d.icon)>-1)n=d.icon.replace("--","");else{let e=`url('${t(`./assets/svg/${d.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}r=e("span",{style:i,onClick:d.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}const u={"is-clearable":d.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":d.disabled,"mdc-text-field--filled":!d.fullWidth&&!o,"mdc-text-field--no-label":!d.label,"mdc-text-field--fullwidth":d.fullWidth,"mdc-text-field--outlined":o,"mdc-text-field--textarea":d.textArea,"mdc-text-field--with-leading-icon":d.icon&&!d.trailingIcon,"mdc-text-field--with-trailing-icon":d.icon&&d.trailingIcon};let f=d.value,m=null!==(n=d.inputType)&&void 0!==n?n:"text",p=!1;if("number"===d.inputType&&d.decimals&&d.decimals>0&&(m="text",p=!0),"number"===d.inputType){const e={allowNegative:null===(c=d.allowNegative)||void 0===c||c,decimal:d.decimals,group:d.group,integer:d.integers};f=a(f,e,!1)}return e("div",{class:u},d.textArea&&d.maxLength?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",d.maxLength):void 0,d.trailingIcon?void 0:r,d.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,maxlength:d.maxLength,value:f,onBlur:d.onBlur,onClick:d.onClick,onChange:d.onChange,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown})):e("input",{inputmode:d.inputMode?d.inputMode:void 0,type:m,step:d.step,min:d.min,max:d.max,name:d.name,class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,placeholder:d.fullWidth&&!d.outlined?d.label:void 0,maxlength:d.maxLength,size:d.size,value:f,onBlur:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onBlur&&d.onBlur(e)},onChange:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onChange&&d.onChange(e)},onClick:d.onClick,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown,onKeyPress:e=>{var t;if(!p)return;if(e.ctrlKey)return;if(e.key.length>1)return;const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};let n=e.target,c=n.value,a=c.substring(0,n.selectionStart),o=c.substring(n.selectionEnd,n.selectionEnd+c.length-1);i.ketchup.math.matchNumericValueWithOptions(a+e.key+o,l)||e.preventDefault()}}),d.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:d.onClearIconClick}):void 0,d.trailingIcon?r:void 0,d.fullWidth||o?void 0:s,o?e("div",{class:"mdc-notched-outline"},e("div",{class:"mdc-notched-outline__leading"}),e("div",{class:"mdc-notched-outline__notch"},s),e("div",{class:"mdc-notched-outline__trailing"})):e("span",{class:"mdc-line-ripple"}))}function c(t){if(!1!==t.helperEnabled){if(t.helper)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!t.helperWhenFocused}},t.helper),!0!==t.hiddenCounter&&t.maxLength&&!t.textArea?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength.toString()):void 0);if(!0!==t.hiddenCounter&&t.maxLength&&!t.textArea)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength))}}const a=function(e,t,l){let d=e;return d?"-"==d?"":i.ketchup.math.format(d,i.ketchup.math.createFormatPattern(t.group,t.decimal),l):d};export{d as F}
1
+ import{h as e,a as t}from"./p-3da7e4c6.js";import{K as l}from"./p-2751c4ba.js";const i=document.documentElement,d=(t,l)=>e("div",Object.assign({class:`f-text-field ${t.danger?"kup-danger":""} ${t.fullHeight?"kup-full-height":""} ${t.fullWidth?"kup-full-width":""} ${t.info?"kup-info":""} ${t.secondary?"kup-secondary":""} ${t.shaped?"kup-shaped":""} ${t.success?"kup-success":""} ${t.warning?"kup-warning":""} ${t.wrapperClass?t.wrapperClass:""}`},t.dataSet,{id:t.id,title:t.title}),t.leadingLabel||t.trailingLabel?e("div",{class:"mdc-form-field "+(t.leadingLabel?"mdc-form-field--align-end":"")},[n(t),c(t),e("label",null,t.label)]):[n(t),c(t)],l);function n(d){var n,c;const o=d.textArea||d.outlined;let s,r;if(!d.label||d.leadingLabel||d.trailingLabel||(s=e("label",{class:"mdc-floating-label",htmlFor:"kup-input"},d.label)),d.icon){let i,n="";if(Object.values(l).indexOf(d.icon)>-1)n=d.icon.replace("--","");else{let e=`url('${t(`./assets/svg/${d.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}r=e("span",{style:i,onClick:d.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}const u={"is-clearable":d.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":d.disabled,"mdc-text-field--filled":!d.fullWidth&&!o,"mdc-text-field--no-label":!d.label,"mdc-text-field--fullwidth":d.fullWidth,"mdc-text-field--outlined":o,"mdc-text-field--textarea":d.textArea,"mdc-text-field--with-leading-icon":d.icon&&!d.trailingIcon,"mdc-text-field--with-trailing-icon":d.icon&&d.trailingIcon};let m=d.value,f=null!==(n=d.inputType)&&void 0!==n?n:"text",p=!1;if("number"===d.inputType&&d.decimals&&d.decimals>0&&(f="text",p=!0),"number"===d.inputType){const e={allowNegative:null===(c=d.allowNegative)||void 0===c||c,decimal:d.decimals,group:d.group,integer:d.integers};m=a(m,e,!1)}return e("div",{class:u},d.textArea&&d.maxLength?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",d.maxLength):void 0,d.trailingIcon?void 0:r,d.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,maxlength:d.maxLength,value:m,onBlur:d.onBlur,onClick:d.onClick,onChange:d.onChange,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown})):e("input",{inputmode:d.inputMode?d.inputMode:void 0,type:f,step:d.step,min:d.min,max:d.max,name:d.name,class:"mdc-text-field__input",disabled:d.disabled,readOnly:d.readOnly,placeholder:d.fullWidth&&!d.outlined?d.label:void 0,maxlength:d.maxLength,size:d.size,value:m,onBlur:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onBlur&&d.onBlur(e)},onChange:e=>{var t;if(p){const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};e.target.value=a(e.target.value,l,!0)}d.onChange&&d.onChange(e)},onClick:d.onClick,onFocus:d.onFocus,onInput:d.onInput,onKeyDown:d.onKeyDown,onKeyPress:e=>{var t;if(!p)return;if(e.ctrlKey)return;if(e.key.length>1)return;const l={allowNegative:null===(t=d.allowNegative)||void 0===t||t,decimal:d.decimals,group:d.group,integer:d.integers};let n=e.target,c=n.value,a=c.substring(0,n.selectionStart),o=c.substring(n.selectionEnd,n.selectionEnd+c.length-1);i.ketchup.math.matchNumericValueWithOptions(a+e.key+o,l)||e.preventDefault()}}),d.isClearable?e("span",{class:`mdc-text-field__icon kup-icon ${l.CLEAR.replace("--","")}`,onClick:d.onClearIconClick}):void 0,d.trailingIcon?r:void 0,d.fullWidth||o?void 0:s,o?e("div",{class:"mdc-notched-outline"},e("div",{class:"mdc-notched-outline__leading"}),e("div",{class:"mdc-notched-outline__notch"},s),e("div",{class:"mdc-notched-outline__trailing"})):e("span",{class:"mdc-line-ripple"}))}function c(t){if(!1!==t.helperEnabled){if(t.helper)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!t.helperWhenFocused}},t.helper),!0!==t.hiddenCounter&&t.maxLength&&!t.textArea?e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength.toString()):void 0);if(!0!==t.hiddenCounter&&t.maxLength&&!t.textArea)return e("div",{class:"mdc-text-field-helper-line"},e("div",{class:"mdc-text-field-character-counter"},"'0 / ' + ",t.maxLength))}}const a=function(e,t,l){let d=e;return d?"-"==d?"":i.ketchup.math.format(d,i.ketchup.math.createFormatPattern(t.group,t.decimal),l):d};export{d as F}
@@ -1 +1 @@
1
- import{r as t,c as i,f as s,h as e,H as h,g as o}from"./p-3da7e4c6.js";import{k as r,a as l,t as n}from"./p-46daf529.js";import{c as u}from"./p-ad2e21d2.js";import{F as c}from"./p-c20c4f66.js";import{F as a}from"./p-fb03f2f5.js";import"./p-6507e9eb.js";var p;!function(t){t.customStyle="Custom style of the component.",t.data="Props of the sub-components.",t.decimals="Defaults at false. When set to true, the component has decimals.",t.disabled="Defaults at false. When set to true, the component is disabled.",t.initialValue="Sets the initial value of the component",t.maxDecimals="when set, the component allows you to enter decimals with a maximum of characters.",t.maxIntegers="When set, the component allows you to enter integer numbers with a maximum of characters.",t.maxLength="When set, the component allows you to enter numbers with a maximum of characters, including decimals.",t.negative="Defaults at false. When set to true, the component has negative number."}(p||(p={}));const m=class{constructor(s){t(this,s),this.kupBlur=i(this,"kup-numericpicker-blur",6),this.kupChange=i(this,"kup-numericpicker-change",6),this.kupClick=i(this,"kup-numericpicker-click",6),this.kupFocus=i(this,"kup-numericpicker-focus",6),this.kupInput=i(this,"kup-numericpicker-input",6),this.kupIconClick=i(this,"kup-numericpicker-iconclick",6),this.kupItemClick=i(this,"kup-numericpicker-itemclick",6),this.kupTextFieldSubmit=i(this,"kup-numericpicker-textfieldsubmit",6),this.kupClearIconClick=i(this,"kup-numericpicker-cleariconclick",6),this.kupManager=r(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){let i={};if(t)i=p;else for(const t in p)Object.prototype.hasOwnProperty.call(p,t)&&(i[t]=this[t]);return i}async refresh(){s(this)}async setFocus(){null!=this.textfieldEl&&this.textfieldEl.focus()}async setValue(t){this.value=t}refreshPickerValue(t,i,s){let e=this.kupManager.math.numberify(t,!0);if(e){let t=e.toString();const h=t.indexOf(".");let o=h>-1?t.substring(0,h):t,r=h>-1?t.substring(h+1):"";for(this.maxIntegers&&o.length>this.maxIntegers&&(o=o.substring(o.length-this.maxIntegers)),this.maxDecimals&&r.length>this.maxDecimals&&(r=r.substring(0,this.maxDecimals));this.maxLength&&o.length+r.length>this.maxLength;)r.length>1?r=r.substring(0,r.length-1):o.length>1&&(o=o.substring(1));t=h>-1?`${o}.${r}`:o,1!=s&&this.setValue(t),null!=i&&i.emit({id:this.rootElement.id,value:t})}}setPickerValueSelected(t){1!=this.disabled&&(null==t&&(t=this.getPickerValueSelected()),this.closePicker(),null!=t&&this.setValue(t))}getPickerValueSelected(){return this.pickerEl.value}getValueForPickerComponent(){return this.value}openPicker(){const t=this.textfieldEl;this.pickerContainerEl.menuVisible=!0;const i=this.pickerContainerEl.style;i.height="auto",i.minWidth=this.textfieldEl.parentElement.clientWidth+"px",null!=t&&t.classList.add("toggled"),this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)?this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl,this.textfieldEl.parentElement):this.kupManager.dynamicPosition.register(this.pickerContainerEl,this.textfieldEl.parentElement,0,l.AUTO,!0),this.kupManager.dynamicPosition.start(this.pickerContainerEl),this.clickCb||(this.clickCb={cb:()=>{this.closePicker()},el:this.pickerContainerEl}),this.kupManager.addClickCallback(this.clickCb,!0)}closePicker(){if(this.kupManager.removeClickCallback(this.clickCb),!this.isPickerOpened())return;let t=this.textfieldEl;null!=t&&t.classList.remove("toggled"),this.pickerContainerEl.menuVisible=!1,this.kupManager.dynamicPosition.stop(this.pickerContainerEl)}isPickerOpened(){return 1==this.pickerContainerEl.menuVisible}getTextFieldId(){return this.textfieldEl.id}prepTextfield(){this.decimals||this.maxIntegers||(this.maxIntegers=17),!this.decimals||this.maxIntegers||this.maxDecimals||(this.maxIntegers=15,this.maxDecimals=2);const t=this.rootElement.classList.contains("kup-full-height"),i=this.rootElement.classList.contains("kup-full-width"),s=Object.assign({},this.data["kup-text-field"]);return s.icon||(s.icon="calculator"),s.icon&&(s.trailingIcon=!0),e(c,Object.assign({},s,{disabled:this.disabled,fullHeight:t,fullWidth:i,id:this.rootElement.id+"_text-field",value:this.kupManager.math.numbers.toLocaleString(this.value),onBlur:()=>this.onKupBlur(),onChange:t=>this.onKupChange(t),onClearIconClick:()=>this.onKupClearIconClick(),onClick:()=>this.onKupClick(),onFocus:()=>this.onKupFocus(),onIconClick:()=>this.onKupIconClick(),onKeyDown:t=>this.onkupTextFieldSubmit(t),onInput:t=>this.onKupInput(t)}),this.prepPicker())}prepPicker(){return e("kup-card",{ref:t=>this.pickerContainerEl=t,data:{options:{decimals:this.decimals,initialValue:this.value,maxDecimals:this.maxDecimals,maxIntegers:this.maxIntegers,maxLength:this.maxLength,negative:this.negative,resetStatus:!0}},layoutFamily:n.BUILT_IN,layoutNumber:5,sizeX:"300px",sizeY:"auto",isMenu:!0,"onkup-card-click":t=>{null!=t.detail.value&&this.onKupPickerItemClick(t.detail.value)}})}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.value=this.initialValue,this.data||(this.data={"kup-text-field":{}})}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelector(".f-text-field");i&&(this.textfieldEl=i.querySelector("input"),a(i))}this.kupManager.debug.logRender(this,!0)}render(){return e(h,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:u},this.prepTextfield()))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.theme.unregister(this),this.pickerContainerEl&&this.pickerContainerEl.remove()}get rootElement(){return o(this)}};m.style=":host{display:block;font-size:var(--kup-font-size)}.f-text-field{position:relative}:host(.kup-full-height){height:100%}:host(.kup-full-height) #kup-component{height:100%}:host(.kup-full-width){width:100%}:host(.kup-full-width) #kup-component{width:100%}:host(.kup-danger){--kup-textfield-primary-color:var(--kup-danger-color);--kup-textfield-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-textfield-primary-color:var(--kup-info-color);--kup-textfield-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-textfield-primary-color:var(--kup-secondary-color);--kup-textfield-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-textfield-primary-color:var(--kup-success-color);--kup-textfield-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-textfield-primary-color:var(--kup-warning-color);--kup-textfield-primary-color-rgb:var(--kup-warning-color-rgb)}";export{m as kup_numeric_picker}
1
+ import{r as t,c as i,f as s,h as e,H as h,g as o}from"./p-3da7e4c6.js";import{k as r,a as l,t as n}from"./p-2751c4ba.js";import{c as u}from"./p-ad2e21d2.js";import{F as c}from"./p-79f78bdc.js";import{F as a}from"./p-fb03f2f5.js";import"./p-6507e9eb.js";var p;!function(t){t.customStyle="Custom style of the component.",t.data="Props of the sub-components.",t.decimals="Defaults at false. When set to true, the component has decimals.",t.disabled="Defaults at false. When set to true, the component is disabled.",t.initialValue="Sets the initial value of the component",t.maxDecimals="when set, the component allows you to enter decimals with a maximum of characters.",t.maxIntegers="When set, the component allows you to enter integer numbers with a maximum of characters.",t.maxLength="When set, the component allows you to enter numbers with a maximum of characters, including decimals.",t.negative="Defaults at false. When set to true, the component has negative number."}(p||(p={}));const m=class{constructor(s){t(this,s),this.kupBlur=i(this,"kup-numericpicker-blur",6),this.kupChange=i(this,"kup-numericpicker-change",6),this.kupClick=i(this,"kup-numericpicker-click",6),this.kupFocus=i(this,"kup-numericpicker-focus",6),this.kupInput=i(this,"kup-numericpicker-input",6),this.kupIconClick=i(this,"kup-numericpicker-iconclick",6),this.kupItemClick=i(this,"kup-numericpicker-itemclick",6),this.kupTextFieldSubmit=i(this,"kup-numericpicker-textfieldsubmit",6),this.kupClearIconClick=i(this,"kup-numericpicker-cleariconclick",6),this.kupManager=r(),this.textfieldEl=null,this.pickerContainerEl=null,this.pickerEl={value:(new Date).toISOString(),date:new Date},this.clickCb=null,this.stateSwitcher=!1,this.value="",this.customStyle="",this.data=null,this.decimals=!1,this.disabled=!1,this.initialValue="",this.maxDecimals=null,this.maxIntegers=null,this.maxLength=null,this.negative=!1}onKupPickerItemClick(t){this.setPickerValueSelected(t),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupItemClick.emit({comp:this,id:this.rootElement.id,value:this.value}),this.setFocus()}onKupClearIconClick(){this.setPickerValueSelected(""),this.kupChange.emit({comp:this,id:this.rootElement.id,value:this.value}),this.kupClearIconClick.emit({comp:this,id:this.rootElement.id})}onKupBlur(){this.kupBlur.emit({id:this.rootElement.id,value:this.value,comp:this})}onKupChange(t){this.refreshPickerValue(t.target.value,this.kupChange)}onKupClick(){this.kupClick.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupFocus(){this.kupFocus.emit({comp:this,id:this.rootElement.id,value:this.value})}onKupInput(t){this.refreshPickerValue(t.target.value,this.kupInput,!0)}onkupTextFieldSubmit(t){"Enter"===t.key&&this.refreshPickerValue(t.target.value,this.kupTextFieldSubmit)}onKupIconClick(){this.isPickerOpened()?this.closePicker():this.openPicker(),this.kupIconClick.emit({comp:this,id:this.rootElement.id,value:this.value})}listenKeyup(t){this.isPickerOpened()&&("Escape"===t.key&&this.closePicker(),"Enter"===t.key&&this.setPickerValueSelected())}async getValue(){return this.value}async getProps(t){let i={};if(t)i=p;else for(const t in p)Object.prototype.hasOwnProperty.call(p,t)&&(i[t]=this[t]);return i}async refresh(){s(this)}async setFocus(){null!=this.textfieldEl&&this.textfieldEl.focus()}async setValue(t){this.value=t}refreshPickerValue(t,i,s){let e=this.kupManager.math.numberify(t,!0);if(e){let t=e.toString();const h=t.indexOf(".");let o=h>-1?t.substring(0,h):t,r=h>-1?t.substring(h+1):"";for(this.maxIntegers&&o.length>this.maxIntegers&&(o=o.substring(o.length-this.maxIntegers)),this.maxDecimals&&r.length>this.maxDecimals&&(r=r.substring(0,this.maxDecimals));this.maxLength&&o.length+r.length>this.maxLength;)r.length>1?r=r.substring(0,r.length-1):o.length>1&&(o=o.substring(1));t=h>-1?`${o}.${r}`:o,1!=s&&this.setValue(t),null!=i&&i.emit({id:this.rootElement.id,value:t})}}setPickerValueSelected(t){1!=this.disabled&&(null==t&&(t=this.getPickerValueSelected()),this.closePicker(),null!=t&&this.setValue(t))}getPickerValueSelected(){return this.pickerEl.value}getValueForPickerComponent(){return this.value}openPicker(){const t=this.textfieldEl;this.pickerContainerEl.menuVisible=!0;const i=this.pickerContainerEl.style;i.height="auto",i.minWidth=this.textfieldEl.parentElement.clientWidth+"px",null!=t&&t.classList.add("toggled"),this.kupManager.dynamicPosition.isRegistered(this.pickerContainerEl)?this.kupManager.dynamicPosition.changeAnchor(this.pickerContainerEl,this.textfieldEl.parentElement):this.kupManager.dynamicPosition.register(this.pickerContainerEl,this.textfieldEl.parentElement,0,l.AUTO,!0),this.kupManager.dynamicPosition.start(this.pickerContainerEl),this.clickCb||(this.clickCb={cb:()=>{this.closePicker()},el:this.pickerContainerEl}),this.kupManager.addClickCallback(this.clickCb,!0)}closePicker(){if(this.kupManager.removeClickCallback(this.clickCb),!this.isPickerOpened())return;let t=this.textfieldEl;null!=t&&t.classList.remove("toggled"),this.pickerContainerEl.menuVisible=!1,this.kupManager.dynamicPosition.stop(this.pickerContainerEl)}isPickerOpened(){return 1==this.pickerContainerEl.menuVisible}getTextFieldId(){return this.textfieldEl.id}prepTextfield(){this.decimals||this.maxIntegers||(this.maxIntegers=17),!this.decimals||this.maxIntegers||this.maxDecimals||(this.maxIntegers=15,this.maxDecimals=2);const t=this.rootElement.classList.contains("kup-full-height"),i=this.rootElement.classList.contains("kup-full-width"),s=Object.assign({},this.data["kup-text-field"]);return s.icon||(s.icon="calculator"),s.icon&&(s.trailingIcon=!0),e(c,Object.assign({},s,{disabled:this.disabled,fullHeight:t,fullWidth:i,id:this.rootElement.id+"_text-field",value:this.kupManager.math.numbers.toLocaleString(this.value),onBlur:()=>this.onKupBlur(),onChange:t=>this.onKupChange(t),onClearIconClick:()=>this.onKupClearIconClick(),onClick:()=>this.onKupClick(),onFocus:()=>this.onKupFocus(),onIconClick:()=>this.onKupIconClick(),onKeyDown:t=>this.onkupTextFieldSubmit(t),onInput:t=>this.onKupInput(t)}),this.prepPicker())}prepPicker(){return e("kup-card",{ref:t=>this.pickerContainerEl=t,data:{options:{decimals:this.decimals,initialValue:this.value,maxDecimals:this.maxDecimals,maxIntegers:this.maxIntegers,maxLength:this.maxLength,negative:this.negative,resetStatus:!0}},layoutFamily:n.BUILT_IN,layoutNumber:5,sizeX:"300px",sizeY:"auto",isMenu:!0,"onkup-card-click":t=>{null!=t.detail.value&&this.onKupPickerItemClick(t.detail.value)}})}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.theme.register(this),this.value=this.initialValue,this.data||(this.data={"kup-text-field":{}})}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelector(".f-text-field");i&&(this.textfieldEl=i.querySelector("input"),a(i))}this.kupManager.debug.logRender(this,!0)}render(){return e(h,null,e("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),e("div",{id:u},this.prepTextfield()))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.theme.unregister(this),this.pickerContainerEl&&this.pickerContainerEl.remove()}get rootElement(){return o(this)}};m.style=":host{display:block;font-size:var(--kup-font-size)}.f-text-field{position:relative}:host(.kup-full-height){height:100%}:host(.kup-full-height) #kup-component{height:100%}:host(.kup-full-width){width:100%}:host(.kup-full-width) #kup-component{width:100%}:host(.kup-danger){--kup-textfield-primary-color:var(--kup-danger-color);--kup-textfield-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-textfield-primary-color:var(--kup-info-color);--kup-textfield-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-textfield-primary-color:var(--kup-secondary-color);--kup-textfield-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-textfield-primary-color:var(--kup-success-color);--kup-textfield-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-textfield-primary-color:var(--kup-warning-color);--kup-textfield-primary-color-rgb:var(--kup-warning-color-rgb)}";export{m as kup_numeric_picker}
@@ -1 +1 @@
1
- import{r as i,h as t,g as h}from"./p-3da7e4c6.js";import{k as o}from"./p-46daf529.js";const e=class{constructor(t){i(this,t),this.kupManager=o(),this.config=void 0,this.qlik=void 0,this.appid="",this.app=!1,this.grid=[],this.debug=!1,this.fluid=!1,this.bordered=!1,this.defobjsize="400px",this.divlist=[]}getObjects(i){let t;return new Promise((h=>{i.rows.forEach((i=>{i.columns.forEach((i=>{t=!1,i.noSelections&&(t=i.noSelections),this.app.getObject(i.obj,i.obj,{noInteraction:!1,noSelections:t})}))})),h(!0)}))}doSelection(i){return new Promise((t=>{i.selections&&i.selections.forEach((i=>{this.app.field(i.field).selectValues(i.values,!1,!0)})),t(!0)}))}setRender(i){return new Promise((h=>{this.divlist=[],i.rows.forEach((i=>{let h=[];i.columns.forEach((i=>{let o="qvobject ";this.bordered&&(o+="bordered "),o=o+"width-"+i.colDim+" size-"+i.size,h.push(t("div",""!=i.obj?{id:i.obj,class:o}:{class:o}))})),this.divlist.push(t("div",{class:"kup-qlik-row"},h))})),h(!0)}))}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.setRender(this.grid)}render(){let i=null,h=null;return i=this.fluid?{"kup-qlik-container-fluid":!0}:{"kup-qlik-container":!0},h={"--lyo_obj-height":this.defobjsize},t("div",{class:i,style:h},this.divlist)}componentDidRender(){this.debug&&console.log("Grid",this.grid),this.qlik&&(""==this.appid||this.app?this.debug&&console.log("App already open:",this.app):this.app=this.qlik.openApp(this.appid,this.config),this.app&&this.getObjects(this.grid).then((()=>{this.doSelection(this.grid)}))),this.kupManager.debug.logRender(this,!0)}get rootElement(){return h(this)}};e.style=".kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-color, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";export{e as kup_qlik}
1
+ import{r as i,h as t,g as h}from"./p-3da7e4c6.js";import{k as o}from"./p-2751c4ba.js";const e=class{constructor(t){i(this,t),this.kupManager=o(),this.config=void 0,this.qlik=void 0,this.appid="",this.app=!1,this.grid=[],this.debug=!1,this.fluid=!1,this.bordered=!1,this.defobjsize="400px",this.divlist=[]}getObjects(i){let t;return new Promise((h=>{i.rows.forEach((i=>{i.columns.forEach((i=>{t=!1,i.noSelections&&(t=i.noSelections),this.app.getObject(i.obj,i.obj,{noInteraction:!1,noSelections:t})}))})),h(!0)}))}doSelection(i){return new Promise((t=>{i.selections&&i.selections.forEach((i=>{this.app.field(i.field).selectValues(i.values,!1,!0)})),t(!0)}))}setRender(i){return new Promise((h=>{this.divlist=[],i.rows.forEach((i=>{let h=[];i.columns.forEach((i=>{let o="qvobject ";this.bordered&&(o+="bordered "),o=o+"width-"+i.colDim+" size-"+i.size,h.push(t("div",""!=i.obj?{id:i.obj,class:o}:{class:o}))})),this.divlist.push(t("div",{class:"kup-qlik-row"},h))})),h(!0)}))}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.setRender(this.grid)}render(){let i=null,h=null;return i=this.fluid?{"kup-qlik-container-fluid":!0}:{"kup-qlik-container":!0},h={"--lyo_obj-height":this.defobjsize},t("div",{class:i,style:h},this.divlist)}componentDidRender(){this.debug&&console.log("Grid",this.grid),this.qlik&&(""==this.appid||this.app?this.debug&&console.log("App already open:",this.app):this.app=this.qlik.openApp(this.appid,this.config),this.app&&this.getObjects(this.grid).then((()=>{this.doSelection(this.grid)}))),this.kupManager.debug.logRender(this,!0)}get rootElement(){return h(this)}};e.style=".kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-color, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";export{e as kup_qlik}
@@ -1 +1 @@
1
- import{r as t,f as s,h as i,H as e,g as h}from"./p-3da7e4c6.js";import{k as o,d as n,g as r,s as l,V as a,m as c}from"./p-46daf529.js";import{c as d}from"./p-ad2e21d2.js";import{F as p}from"./p-e16c04d8.js";import"./p-90576709.js";import"./p-c20c4f66.js";import"./p-9c7b9ff2.js";import"./p-d5491e4f.js";var m;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the cell.",t.density="The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.",t.dragEnabled="When set to true, the component is draggable."}(m||(m={}));const u=class{constructor(s){t(this,s),this.kupManager=o(),this.customStyle="",this.data=null,this.density=n.NONE,this.dragEnabled=!1}async addCssClasses(t){if(this.data.cssClass||(this.data.cssClass=""),t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)<0&&(this.data.cssClass+=` ${i}`)}this.refresh()}async getProps(t){return r(this,m,t)}async refresh(){s(this)}async removeCssClasses(t){if(this.data.cssClass){if(t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)>0&&(this.data.cssClass=this.data.cssClass.replace(new RegExp(i,"g"),""))}this.refresh()}}async setProps(t){l(this,m,t)}didRenderInteractables(){if(this.dragEnabled){const t=()=>({cell:this.data,column:this.generateColumn(),id:this.rootElement.id,multiple:!1,row:this.generateRow()});this.kupManager.interact.draggable(this.rootElement.shadowRoot.querySelector("#"+d),{cursorChecker:()=>null},{callback:t},a.BADGE)}}generateColumn(){return{name:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:"KUPCELL",title:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:this.kupManager.language.translate(c.EMPTY_OBJECT)}}generateRow(){const t=this.generateColumn(),s={cells:{}};return s.cells[t.name]=this.data,s}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.didRenderInteractables(),this.kupManager.debug.logRender(this,!0)}render(){const t={cell:this.data,column:this.generateColumn(),component:this,density:this.density,editable:this.data.isEditable,renderKup:!0,row:this.generateRow()};return i(e,null,i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:d},i(p,Object.assign({},t))))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return h(this)}};u.style=":host{display:block;height:100%;width:100%}#kup-component{height:100%;width:100%}";export{u as kup_cell}
1
+ import{r as t,f as s,h as i,H as e,g as h}from"./p-3da7e4c6.js";import{k as o,d as n,g as r,s as l,V as a,m as c}from"./p-2751c4ba.js";import{c as d}from"./p-ad2e21d2.js";import{F as p}from"./p-5443df89.js";import"./p-90576709.js";import"./p-79f78bdc.js";import"./p-0e961148.js";import"./p-d938d1cd.js";var m;!function(t){t.customStyle="Custom style of the component.",t.data="The data of the cell.",t.density="The density of the cell, defaults at 'dense' and can be also set to 'wide' or 'medium'.",t.dragEnabled="When set to true, the component is draggable."}(m||(m={}));const u=class{constructor(s){t(this,s),this.kupManager=o(),this.customStyle="",this.data=null,this.density=n.NONE,this.dragEnabled=!1}async addCssClasses(t){if(this.data.cssClass||(this.data.cssClass=""),t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)<0&&(this.data.cssClass+=` ${i}`)}this.refresh()}async getProps(t){return r(this,m,t)}async refresh(){s(this)}async removeCssClasses(t){if(this.data.cssClass){if(t)for(let s=0;s<t.length;s++){const i=t[s];this.data.cssClass.indexOf(i)>0&&(this.data.cssClass=this.data.cssClass.replace(new RegExp(i,"g"),""))}this.refresh()}}async setProps(t){l(this,m,t)}didRenderInteractables(){if(this.dragEnabled){const t=()=>({cell:this.data,column:this.generateColumn(),id:this.rootElement.id,multiple:!1,row:this.generateRow()});this.kupManager.interact.draggable(this.rootElement.shadowRoot.querySelector("#"+d),{cursorChecker:()=>null},{callback:t},a.BADGE)}}generateColumn(){return{name:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:"KUPCELL",title:this.data&&this.data.obj&&this.data.obj.t?this.data.obj.t+";"+this.data.obj.p:this.kupManager.language.translate(c.EMPTY_OBJECT)}}generateRow(){const t=this.generateColumn(),s={cells:{}};return s.cells[t.name]=this.data,s}componentWillLoad(){this.kupManager.dates.register(this),this.kupManager.debug.logLoad(this,!1),this.kupManager.language.register(this),this.kupManager.theme.register(this)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.didRenderInteractables(),this.kupManager.debug.logRender(this,!0)}render(){const t={cell:this.data,column:this.generateColumn(),component:this,density:this.density,editable:this.data.isEditable,renderKup:!0,row:this.generateRow()};return i(e,null,i("style",null,this.kupManager.theme.setKupStyle(this.rootElement)),i("div",{id:d},i(p,Object.assign({},t))))}disconnectedCallback(){this.kupManager.dates.unregister(this),this.kupManager.language.unregister(this),this.kupManager.theme.unregister(this)}get rootElement(){return h(this)}};u.style=":host{display:block;height:100%;width:100%}#kup-component{height:100%;width:100%}";export{u as kup_cell}