@sme.up/ketchup 11.0.0-SNAPSHOT-20250904101037 → 11.0.0-SNAPSHOT-20250904134211

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 (182) hide show
  1. package/dist/cjs/{f-cell-fcecd005.js → f-cell-f7a99b74.js} +4 -4
  2. package/dist/cjs/{f-chip-20805d3e.js → f-chip-b0b4b0d9.js} +1 -1
  3. package/dist/cjs/{f-object-field-d75bad52.js → f-object-field-db5613ef.js} +2 -2
  4. package/dist/cjs/{f-paginator-utils-a39ddb97.js → f-paginator-utils-2fcf4642.js} +1 -1
  5. package/dist/cjs/{f-text-field-7e03c8d4.js → f-text-field-ee6120c5.js} +1 -1
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/cjs/kup-accordion.cjs.entry.js +1 -1
  8. package/dist/cjs/kup-activity-timeline.cjs.entry.js +2 -2
  9. package/dist/cjs/kup-autocomplete_30.cjs.entry.js +7 -7
  10. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  11. package/dist/cjs/kup-calendar.cjs.entry.js +2 -2
  12. package/dist/cjs/kup-card-list.cjs.entry.js +1 -1
  13. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  14. package/dist/cjs/kup-dashboard.cjs.entry.js +2 -2
  15. package/dist/cjs/{kup-data-table-helper-364a9e29.js → kup-data-table-helper-0705294e.js} +1 -1
  16. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-editor.cjs.entry.js +1 -1
  19. package/dist/cjs/kup-family-tree.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-grid.cjs.entry.js +1 -1
  21. package/dist/cjs/kup-htm.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  23. package/dist/cjs/kup-input-panel.cjs.entry.js +5 -5
  24. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +1 -1
  26. package/dist/cjs/{kup-manager-4065b7d8.js → kup-manager-0ce9fd30.js} +4 -3
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  29. package/dist/cjs/kup-object-field.cjs.entry.js +3 -3
  30. package/dist/cjs/kup-pdf.cjs.entry.js +1 -1
  31. package/dist/cjs/kup-planner.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  33. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  34. package/dist/cjs/kup-snackbar.cjs.entry.js +1 -1
  35. package/dist/cjs/kup-txt.cjs.entry.js +1 -1
  36. package/dist/cjs/kup-typography-list.cjs.entry.js +1 -1
  37. package/dist/cjs/kup-typography.cjs.entry.js +1 -1
  38. package/dist/collection/managers/kup-data/kup-data.js +4 -3
  39. package/dist/components/index.js +1 -1
  40. package/dist/components/kup-accordion.js +2 -2
  41. package/dist/components/kup-activity-timeline.js +2 -2
  42. package/dist/components/kup-autocomplete.js +1 -1
  43. package/dist/components/kup-badge.js +1 -1
  44. package/dist/components/kup-box.js +1 -1
  45. package/dist/components/kup-button-list.js +1 -1
  46. package/dist/components/kup-button.js +1 -1
  47. package/dist/components/kup-calendar.js +2 -2
  48. package/dist/components/kup-card-list.js +3 -3
  49. package/dist/components/kup-card.js +1 -1
  50. package/dist/components/kup-cell.js +2 -2
  51. package/dist/components/kup-chart.js +1 -1
  52. package/dist/components/kup-checkbox.js +1 -1
  53. package/dist/components/kup-chip.js +1 -1
  54. package/dist/components/kup-color-picker.js +1 -1
  55. package/dist/components/kup-combobox.js +1 -1
  56. package/dist/components/kup-dashboard.js +2 -2
  57. package/dist/components/kup-data-table.js +1 -1
  58. package/dist/components/kup-date-picker.js +1 -1
  59. package/dist/components/kup-dialog.js +1 -1
  60. package/dist/components/kup-drawer.js +2 -2
  61. package/dist/components/kup-dropdown-button.js +1 -1
  62. package/dist/components/kup-echart.js +1 -1
  63. package/dist/components/kup-editor.js +1 -1
  64. package/dist/components/kup-family-tree.js +3 -3
  65. package/dist/components/kup-file-upload.js +1 -1
  66. package/dist/components/kup-form.js +1 -1
  67. package/dist/components/kup-gauge.js +1 -1
  68. package/dist/components/kup-grid.js +1 -1
  69. package/dist/components/kup-htm.js +2 -2
  70. package/dist/components/kup-iframe.js +2 -2
  71. package/dist/components/kup-image-list.js +1 -1
  72. package/dist/components/kup-image.js +1 -1
  73. package/dist/components/kup-input-panel.js +3 -3
  74. package/dist/components/kup-lazy.js +2 -2
  75. package/dist/components/kup-list.js +1 -1
  76. package/dist/components/kup-magic-box.js +4 -4
  77. package/dist/components/kup-nav-bar.js +2 -2
  78. package/dist/components/kup-numeric-picker.js +2 -2
  79. package/dist/components/kup-object-field.js +2 -2
  80. package/dist/components/kup-pdf.js +2 -2
  81. package/dist/components/kup-planner.js +2 -2
  82. package/dist/components/kup-probe.js +2 -2
  83. package/dist/components/kup-progress-bar.js +1 -1
  84. package/dist/components/kup-qlik.js +2 -2
  85. package/dist/components/kup-radio.js +1 -1
  86. package/dist/components/kup-rating.js +1 -1
  87. package/dist/components/kup-snackbar.js +2 -2
  88. package/dist/components/kup-spinner.js +1 -1
  89. package/dist/components/kup-switch.js +1 -1
  90. package/dist/components/kup-tab-bar.js +1 -1
  91. package/dist/components/kup-text-field.js +1 -1
  92. package/dist/components/kup-time-picker.js +1 -1
  93. package/dist/components/kup-toolbar.js +1 -1
  94. package/dist/components/kup-tree.js +1 -1
  95. package/dist/components/kup-txt.js +2 -2
  96. package/dist/components/kup-typography-list.js +2 -2
  97. package/dist/components/kup-typography.js +2 -2
  98. package/dist/components/{p-744b30e1.js → p-101cc8d4.js} +2 -2
  99. package/dist/components/{p-63ba2b6a.js → p-35c61003.js} +2 -2
  100. package/dist/components/{p-ecd8d195.js → p-80721e02.js} +2 -2
  101. package/dist/components/{p-37e3fbdc.js → p-844a00fe.js} +1 -1
  102. package/dist/components/{p-f559942f.js → p-85852162.js} +4 -3
  103. package/dist/components/{p-e082b4ed.js → p-eb198bcf.js} +2 -2
  104. package/dist/esm/{f-cell-8f5413f6.js → f-cell-3a3c8d87.js} +4 -4
  105. package/dist/esm/{f-chip-a3b62710.js → f-chip-3ed440ef.js} +1 -1
  106. package/dist/esm/{f-object-field-5c76ed6d.js → f-object-field-23935da4.js} +2 -2
  107. package/dist/esm/{f-paginator-utils-125385d2.js → f-paginator-utils-a9d5c2d3.js} +1 -1
  108. package/dist/esm/{f-text-field-b6a1d581.js → f-text-field-4934ff74.js} +1 -1
  109. package/dist/esm/index.js +1 -1
  110. package/dist/esm/kup-accordion.entry.js +1 -1
  111. package/dist/esm/kup-activity-timeline.entry.js +2 -2
  112. package/dist/esm/kup-autocomplete_30.entry.js +7 -7
  113. package/dist/esm/kup-box.entry.js +7 -7
  114. package/dist/esm/kup-calendar.entry.js +2 -2
  115. package/dist/esm/kup-card-list.entry.js +1 -1
  116. package/dist/esm/kup-cell.entry.js +5 -5
  117. package/dist/esm/kup-dashboard.entry.js +2 -2
  118. package/dist/esm/{kup-data-table-helper-09c41da3.js → kup-data-table-helper-de9421a0.js} +1 -1
  119. package/dist/esm/kup-drawer.entry.js +1 -1
  120. package/dist/esm/kup-echart.entry.js +1 -1
  121. package/dist/esm/kup-editor.entry.js +1 -1
  122. package/dist/esm/kup-family-tree.entry.js +1 -1
  123. package/dist/esm/kup-grid.entry.js +1 -1
  124. package/dist/esm/kup-htm.entry.js +1 -1
  125. package/dist/esm/kup-iframe.entry.js +1 -1
  126. package/dist/esm/kup-input-panel.entry.js +5 -5
  127. package/dist/esm/kup-lazy.entry.js +1 -1
  128. package/dist/esm/kup-magic-box.entry.js +1 -1
  129. package/dist/esm/{kup-manager-2dd61a79.js → kup-manager-5c23bae7.js} +4 -3
  130. package/dist/esm/kup-nav-bar.entry.js +1 -1
  131. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  132. package/dist/esm/kup-object-field.entry.js +3 -3
  133. package/dist/esm/kup-pdf.entry.js +1 -1
  134. package/dist/esm/kup-planner.entry.js +2 -2
  135. package/dist/esm/kup-probe.entry.js +1 -1
  136. package/dist/esm/kup-qlik.entry.js +1 -1
  137. package/dist/esm/kup-snackbar.entry.js +1 -1
  138. package/dist/esm/kup-txt.entry.js +1 -1
  139. package/dist/esm/kup-typography-list.entry.js +1 -1
  140. package/dist/esm/kup-typography.entry.js +1 -1
  141. package/dist/ketchup/index.esm.js +1 -1
  142. package/dist/ketchup/ketchup.esm.js +1 -1
  143. package/dist/ketchup/{p-f52b5f2e.js → p-02e22635.js} +1 -1
  144. package/dist/ketchup/{p-54b56ca6.js → p-03d049e3.js} +1 -1
  145. package/dist/ketchup/{p-56bde8f4.entry.js → p-057f9d22.entry.js} +1 -1
  146. package/dist/ketchup/{p-f229e1e0.entry.js → p-0db73b81.entry.js} +1 -1
  147. package/dist/ketchup/{p-4e7eab95.entry.js → p-143617b6.entry.js} +1 -1
  148. package/dist/ketchup/{p-4ed3c4e2.entry.js → p-180bf54f.entry.js} +1 -1
  149. package/dist/ketchup/{p-8a8991a9.entry.js → p-1b2bf662.entry.js} +1 -1
  150. package/dist/ketchup/{p-4ae35776.entry.js → p-34f54cc8.entry.js} +1 -1
  151. package/dist/ketchup/{p-039fa9b0.entry.js → p-59027fa3.entry.js} +1 -1
  152. package/dist/ketchup/{p-ae6f69ff.entry.js → p-596fb5b6.entry.js} +1 -1
  153. package/dist/ketchup/{p-10bb6f44.entry.js → p-5b4733d8.entry.js} +1 -1
  154. package/dist/ketchup/{p-d15086dd.entry.js → p-610e1045.entry.js} +1 -1
  155. package/dist/ketchup/{p-8063ee78.entry.js → p-6d667386.entry.js} +1 -1
  156. package/dist/ketchup/{p-77731ab8.entry.js → p-758617e7.entry.js} +1 -1
  157. package/dist/ketchup/{p-20706373.entry.js → p-7960c9e8.entry.js} +1 -1
  158. package/dist/ketchup/{p-aba69d8b.js → p-87559acf.js} +1 -1
  159. package/dist/ketchup/p-8cc6c355.entry.js +1 -0
  160. package/dist/ketchup/p-95346c81.js +1 -0
  161. package/dist/ketchup/{p-de4b91af.entry.js → p-97ea417e.entry.js} +1 -1
  162. package/dist/ketchup/{p-df7e1a01.entry.js → p-99f6dd77.entry.js} +1 -1
  163. package/dist/ketchup/{p-968c44f6.entry.js → p-a993d05a.entry.js} +1 -1
  164. package/dist/ketchup/{p-8a7a6dac.entry.js → p-b509455c.entry.js} +1 -1
  165. package/dist/ketchup/{p-75a39d24.entry.js → p-b780b291.entry.js} +1 -1
  166. package/dist/ketchup/{p-0d6aedff.entry.js → p-b7d29946.entry.js} +1 -1
  167. package/dist/ketchup/{p-69078872.entry.js → p-c825af35.entry.js} +1 -1
  168. package/dist/ketchup/{p-cb9af9b7.entry.js → p-cc09bd1d.entry.js} +1 -1
  169. package/dist/ketchup/p-cf5e1d07.js +1 -0
  170. package/dist/ketchup/{p-36e6e318.js → p-da273b4d.js} +1 -1
  171. package/dist/ketchup/{p-c00bf8cb.js → p-da5d5eea.js} +1 -1
  172. package/dist/ketchup/{p-a4b50a4d.entry.js → p-db19cc91.entry.js} +1 -1
  173. package/dist/ketchup/{p-faa860b2.entry.js → p-dc425c68.entry.js} +1 -1
  174. package/dist/ketchup/{p-d46c0c0d.entry.js → p-e45b8338.entry.js} +1 -1
  175. package/dist/ketchup/{p-2a133777.entry.js → p-eac0e5f0.entry.js} +1 -1
  176. package/dist/ketchup/{p-90337670.entry.js → p-ece991ba.entry.js} +1 -1
  177. package/dist/ketchup/{p-33f647c4.entry.js → p-fcae71f2.entry.js} +1 -1
  178. package/dist/ketchup/{p-97d46b08.entry.js → p-fcbf4e40.entry.js} +1 -1
  179. package/package.json +1 -1
  180. package/dist/ketchup/p-20d5e4b1.js +0 -1
  181. package/dist/ketchup/p-b2de1a15.entry.js +0 -1
  182. package/dist/ketchup/p-fb74c97e.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as o,H as s,d as r}from"./p-710d0a7d.js";import{k as n,A as a,g as h,s as l,a8 as c,x as p,b as d,d as b,h as u,V as f,Y as x,aG as g,_ as k,u as m}from"./p-54b56ca6.js";import{f as w,p as v,s as y}from"./p-36e6e318.js";import{F as _}from"./p-cc9db65d.js";import{d as j}from"./p-20d5e4b1.js";import{c as z}from"./p-635bb4b3.js";import{F as C}from"./p-aba69d8b.js";import{p as P,r as M,F as A}from"./p-f52b5f2e.js";import{F as R}from"./p-7db300e0.js";import"./p-cabebabc.js";import"./p-ff735e62.js";import"./p-e3062c19.js";import"./p-ef3112d4.js";import"./p-fb74c97e.js";import"./p-c00bf8cb.js";import"./p-c56195a0.js";var I,S;!function(t){t.cardData="Data of the card linked to the box when the latter's layout must be a premade template.",t.columns="Number of columns.",t.customStyle="Custom style of the component.",t.data="Actual data of the box.",t.dragEnabled="Enable dragging.",t.dropEnabled="Enable dropping.",t.dropOnSection="Drop can be done in section.",t.enableRowActions="If enabled, a button to load / display the row actions will be displayed on the right of every box.",t.globalFilter="When set to true it activates the global filter.",t.globalFilterValue="The value of the global filter.",t.kanban="Displays the boxlist as a Kanban.",t.layout="How the field will be displayed. If not present, a default one will be created.",t.lazyLoadRows="When set to true, extra rows will be automatically loaded once the last row enters the viewport.",t.loadMoreLimit="Sets a maximum limit of new records which can be required by the load more functionality.",t.loadMoreMode="Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.",t.loadMoreStep="The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.",t.multiSelection="Enable multi selection.",t.pageSelected="Current page number.",t.pagination="Enables pagination.",t.rowsPerPage="Number of current rows per page.",t.scrollOnHover="Activates the scroll on hover function.",t.selectBox="Automatically selects the box at the specified index.",t.selectedRowsState="Multiple selection.",t.showLoadMore="If set to true, displays the button to load more records.",t.showSelection="If enabled, highlights the selected box/boxes.",t.sortBy="If sorting is enabled, specifies which column to sort.",t.sortEnabled="Enable sorting.",t.stateId="",t.store="",t.swipeDisabled="Disable swipe."}(I||(I={})),function(t){t.CONSTANT="constant",t.CONSTANT_INCREMENT="constant_increment",t.PROGRESSIVE_THRESHOLD="progressive_threshold"}(S||(S={}));class E{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1,this.loadMoreLimit=1e3,this.showLoadMore=!1}toDebugString(){return"box state"}}var O,W,D,B,T,$,L,F,H,N,G,V=function(t,i,e,o){if("a"===e&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!o:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?o:"a"===e?o.call(t):o?o.value:i.get(t)},K=function(t,i,e,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,e):s?s.value=e:i.set(t,e),e};const q=class{constructor(e){t(this,e),this.kupBoxClick=i(this,"kup-box-click",6),this.kupBoxSelected=i(this,"kup-box-selected",6),this.kupAutoBoxSelect=i(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=i(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=i(this,"kup-box-rowactionclick",6),this.kupDidLoad=i(this,"kup-box-didload",6),this.kupDidUnload=i(this,"kup-box-didunload",6),this.kupBoxContextMenu=i(this,"kup-box-contextmenu",6),this.kupLoadMoreClick=i(this,"kup-box-loadmoreclick",6),this.kupBoxCellClick=i(this,"kup-box-cell-click",6),O.add(this),this.state=new E,D.set(this,n()),this.rows=[],this.filteredRows=[],this.sectionRef=null,this.rowsRefs=[],this.hold=!1,this.interactableDrag=[],this.interactableDrop=[],this.interactableTouch=[],B.set(this,void 0),T.set(this,[]),$.set(this,0),L.set(this,0),F.set(this,0),this.collapsedSection={},this.selectedRows=[],this.rowActionMenuOpened=void 0,this.currentPage=1,this.currentRowsPerPage=10,this.cardData=null,this.columns=1,this.customStyle="",this.data=null,this.dragEnabled=!1,this.dropEnabled=!1,this.dropOnSection=!1,this.editableData=!1,this.enableRowActions=!1,this.globalFilter=!1,this.globalFilterValue="",this.kanban=null,this.layout=void 0,this.lazyLoadRows=!1,this.loadMoreLimit=1e3,this.loadMoreMode=S.PROGRESSIVE_THRESHOLD,this.loadMoreStep=60,this.multiSelection=!1,this.pageSelected=1,this.pagination=!1,this.rowsPerPage=void 0,this.scrollOnHover=!1,this.selectBox=void 0,this.selectedRowsState=void 0,this.showLoadMore=!1,this.showSelection=!0,this.sortBy=void 0,this.sortEnabled=!1,this.stateId="",this.store=void 0,this.swipeDisabled=!1,this.visibleColumns=void 0}initWithPersistedState(){if(this.store&&this.stateId){this.state.load=!0;const t=this.store.getState(this.stateId);null!=t&&(V(this,D,"f").debug.logMessage(this,"Initialize with state for stateId "+this.stateId+": "+t),this.sortBy=t.sortBy,this.globalFilterValue=t.globalFilterValue,this.selectedRowsState=t.selectedRowsState,this.pageSelected=t.pageSelected,this.rowsPerPage=t.rowsPerPage,this.loadMoreLimit=t.loadMoreLimit,this.showLoadMore=t.showLoadMore)}}persistState(){if(this.store&&this.stateId){let t=V(this,O,"m",W).call(this);if(!this.state.load)return void(this.state.load=!0);t&&(V(this,D,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}rowsPerPageHandler(t){this.currentRowsPerPage=t}recalculateRows(){this.initRows()}onDataChanged(){a(this.getRows()),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return h(this,I,t)}async loadRowActions(t,i){t.actions=i,this.rowActionMenuOpened=t}async refresh(){e(this)}async setProps(t){l(this,I,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:void 0}]}getVisibleColumns(){let t=this.getColumns().filter((t=>{const i=!V(this,D,"f").data.column.isCodVer(t);return this.visibleColumns?i&&this.visibleColumns.includes(t.name):i&&(!("visible"in t)||t.visible)}));return this.visibleColumns&&(t=t.sort(((t,i)=>this.visibleColumns.indexOf(t.name)-this.visibleColumns.indexOf(i.name)))),t}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows(),this.globalFilter&&this.globalFilterValue&&(this.filteredRows=w(this.filteredRows,null,this.globalFilterValue,this.getColumns(),void 0,void 0,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let i=t;return this.sortBy&&(i=y(i,this.toSortObjectList())),i}toSortObjectList(){return this.sortBy.split("|").map((t=>{const i=t.split(",");return{column:i[0],sortMode:i.length>1?c[i[1]]:c.A}}))}checkScrollOnHover(){this.boxContainer&&(V(this,D,"f").scrollOnHover.isRegistered(this.boxContainer)?this.scrollOnHover||V(this,D,"f").scrollOnHover.unregister(this.boxContainer):this.scrollOnHover&&V(this,D,"f").scrollOnHover.register(this.boxContainer))}checkLayout(){if(this.layout)return void(this.boxLayout=this.layout);const t={horizontal:!1,sections:[]},i=this.getVisibleColumns();let e=i.length,o=[],s=0;for(;e-- >0;)o.push({column:i[s++].name});t.content=o,this.boxLayout={sections:[t]}}onSortChange(t){let i=p(this.getVisibleColumns(),t.detail.value);this.sortBy=i.name}onGlobalFilterChange({detail:t}){let i="";t&&t.value&&(i=t.value),this.globalFilterValue=i}isSectionExpanded(t,i){return!(!t.id||!i.id)&&this.collapsedSection[i.id]&&this.collapsedSection[i.id][t.id]}handleAutomaticBoxSelection(){if(this.selectBox&&this.selectBox>0&&this.selectBox<=this.data.rows.length){this.selectedRows=[];for(let t of this.data.rows)if(t.id===(this.selectBox-1).toString()){this.selectedRows.push(t);break}this.kupAutoBoxSelect.emit({comp:this,id:this.rootElement.id,row:this.selectedRows[0]})}}getEventDetails(t,i){let e=null,o=null,s=null,r=null;if(t)for(let i=t.length-1;i>=0;i--){let o=t[i];o.tagName&&(o.tagName.toUpperCase(),o.classList.contains("box-object")&&(e=o),!s&&o["data-row"]&&(s=o["data-row"]))}if(e)if(e.classList.contains("f-cell")){const t=e["kup-get-cell-props"]();o=t.cell,r=t.column,s=t.row}else o=e["data-cell"],s=e["data-row"],r=p(this.getVisibleColumns(),e.dataset.column);return{boxObject:e||null,column:r||null,cell:o||null,originalEvent:i,row:s||null}}clickHandler(t){const i=this.getEventDetails(V(this,D,"f").getEventPath(t.target,this.rootElement),t);return i.row&&(this.multiSelection?this.onSelectionCheckChange(i.row):this.selectedRows=[i.row]),i}contextMenuHandler(t){return this.getEventDetails(V(this,D,"f").getEventPath(t.target,this.rootElement),t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onSelectionCheckChange(t){var i=-1;for(let e=0;e<this.selectedRows.length;e++)if(this.selectedRows[e].id===t.id){i=e;break}i>=0?(this.selectedRows.splice(i,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,i){if(i.id)if(t.id){if(this.collapsedSection[i.id]){const e=this.collapsedSection[i.id];e[t.id]=!e[t.id]||!e[t.id]}else this.collapsedSection[i.id]={},this.collapsedSection[i.id][t.id]=!0;this.collapsedSection=Object.assign({},this.collapsedSection)}else console.error("cannot expand / collapse a section of a row without ad id");else console.error("cannot expand / collapse a section withoun an ID")}onRowAction(t){t&&(t!==this.rowActionMenuOpened?t.actions?this.rowActionMenuOpened=t:this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t}):this.rowActionMenuOpened=null)}onRowActionClick(t,i,e){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:i,index:e})}clickFunction(t){try{const i=t.composedPath();for(let t of i)if(this.checkIfElementIsActionMenuIcon(t))return}catch(i){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const i=P(t,this.filteredRows.length,this.currentRowsPerPage);i&&(this.currentPage=i)}handleRowsPerPageChange(t){const i=M(t,this.filteredRows.length);i&&(this.currentRowsPerPage=i,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let i=!1;const e={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]},s=this.getVisibleColumns();for(let i=0;i<s.length;i++){const o=s[i];!1!==o.visible&&(e.cell.push(t.cells[o.name]),e.columns.push(o))}for(const i in t.cells)if(t.cells.hasOwnProperty(i)){const o=t.cells[i];if(void 0!==o.cardID&&o.obj)switch(o.obj.p){case"BTN":do{e.button.push({})}while(e.button.length<o.cardID);e.button[o.cardID]={label:o.value};break;case"IMG":do{e.image.push({})}while(e.image.length<o.cardID);e.image[o.cardID]={resource:o.value};break;case"PGB":do{e.progressbar.push({})}while(e.progressbar.length<o.cardID);e.progressbar[o.cardID]={value:o.value};break;default:do{e.text.push("")}while(e.text.length<o.cardID);e.text[o.cardID]=o.value}}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const s=t.cells[o];if(void 0===s.cardID&&s.obj)switch(i=!1,s.obj.p){case"BTN":for(let t=0;t<e.button.length;t++)if(!Object.keys(e.button[t]).length){e.button[t]={label:s.value},i=!0;break}i||e.button.push({label:s.value});break;case"IMG":for(let t=0;t<e.image.length;t++)if(!Object.keys(e.image[t]).length){e.image[t]={resource:s.value},i=!0;break}i||e.image.push({resource:s.value});break;case"PGB":for(let t=0;t<e.progressbar.length;t++)if(!Object.keys(e.progressbar[t]).length){e.progressbar[t]={value:s.value},i=!0;break}i||e.progressbar.push({value:s.value});break;default:for(let t=0;t<e.text.length;t++)if(""===e.text[t]){e.text[t]=s.value,i=!0;break}i||e.text.push(s.value)}}return o("kup-card",Object.assign({data:e},this.cardData))}renderRow(t){const i=[...this.getVisibleColumns()];let e=null,s=t.layout;s||(s=this.boxLayout);let r=!1;if(s){s.horizontal&&(r=!0);const o=s.sections;let n=o.length,a=0;n>0&&(e=[]);const h={horizontal:r};if(null!=this.cardData&&"object"==typeof this.cardData)e.push(this.renderSectionAsCard(t));else for(;n-- >0;)e.push(this.renderSection(o[a++],h,t,i))}var n=!1;for(let i of this.selectedRows)i.id===t.id&&(n=!0);let a=null;this.multiSelection&&(a=o("div",{class:"box-selection"},o("kup-checkbox",{checked:n})));let h=null;if(this.enableRowActions&&!this.swipeDisabled){const i={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let e=null;if(t.actions){const i=t.actions.map(((i,e)=>o("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,i,e)},o("div",{class:`icon ${i.icon}`}),o("div",{class:"text"},i.text))));e=o("ul",null,i)}h=o("div",{class:"row-actions-wrapper"},o("div",{class:"row-actions-toggler"},o("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},o("path",{d:"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"})),o("div",{class:i},e)))}let l=null;return t.badgeData&&t.badgeData.length>0&&(l=t.badgeData.map((t=>o("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),o("div",{class:"box-wrapper",style:t.style||{},ref:t=>{t&&V(this,T,"f").push(t)}},o("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&n,column:!r},"data-row":t,ref:t=>this.rowsRefs.push(t)},a,e,l),h)}renderSection(t,i,e,s){let r=null;if(t.sections&&t.sections.length>0){const i=t.sections;let o=i.length,n=0;for(o>0&&(r=[]);o-- >0;)r.push(this.renderSection(i[n++],t,e,s))}else if(t.content){const i=t.content;let o=i.length,n=0;for(o>0&&(r=[]);o-- >0;)r.push(this.renderBoxObject({boxObject:i[n++],row:e,visibleColumns:s},!0))}else s.length>0&&(r=this.renderBoxObject({boxObject:{column:s[0].name},row:e,visibleColumns:s}));const n=this.isSectionExpanded(e,t),a=!!t.columns,h={"box-section":!0,open:n,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},l=t.style||{};t.dim&&i&&(l.overflow="hidden",i.horizontal&&(l.flex=`0 0 ${t.dim}`,l.maxWidth=t.dim)),a&&(l["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){h["collapse-section"]=!0;const i={content:!0};let s="";s=t.title?t.title:n?V(this,D,"f").language.translate(d.COLLAPSE):V(this,D,"f").language.translate(d.EXPAND),c=o("div",{class:h,style:l},o("div",{class:i},r),o("div",{class:"header",role:"button",onClick:i=>{i.stopPropagation(),this.toggleSectionExpand(e,t)}},o("div",{class:"header-content"},o("span",null,s),o(_,{resource:`${b.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:n?"toggled":""}))))}else{const i=t.title?o("h3",null,t.title):null;c=o("div",{class:h,style:l},i,r)}return c}renderBoxObject({boxObject:t,row:i,visibleColumns:e},s){const r={"box-object":!0};let n=null,a=-1;for(let i=0;i<e.length;i++)if(e[i].name===t.column){a=i;break}a>=0?(n=e[a],e.splice(a,1)):s&&(n=this.data.columns.find((i=>i.name===t.column)));const h=i.cells[t.column];let l;return h&&!V(this,D,"f").objects.isEmptyKupObj(h.obj)&&(r["is-obj"]=!0,V(this,D,"f").debug.isDebug()&&(l=h.obj.t+"; "+h.obj.p+"; "+h.obj.k+";"),h.isEditable||(h.cssClass=V(this,D,"f").data.cell.getObjectRelatedStyleClasses(h.obj,h.cssClass))),o("div",{"data-cell":h,"data-row":i,"data-column":t.column,class:r,style:{},title:l},h&&n?o(C,Object.assign({},{cell:h,column:n,component:this,editable:this.editableData,renderKup:!0,row:i,setSizes:!0,shape:t.shape})):o("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||0===this.kanban.columns.length)return V(this,D,"f").debug.logMessage(this,"No columns to group by detected.",u.ERROR),{jsx:o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{ref:t=>this.rowsRefs.push(t)}),V(this,D,"f").language.translate(d.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let i=0;i<this.kanban.labels.length;i++)t.push({labels:this.kanban.labels[i],nodes:[]});for(let i=0;i<this.rows.length;i++){let e=[];for(let t=0;t<this.kanban.columns.length;t++)try{e.push(this.rows[i].cells[this.kanban.columns[t]].value)}catch(t){V(this,D,"f").debug.logMessage(this,t,u.WARNING)}const o={found:!1,index:null};for(let i=0;i<t.length;i++){let s=t[i].labels,r=!0;for(let t=0;t<s.length;t++)if(e[t]!==s[t]){r=!1;break}if(r){o.found=!0,o.index=i;break}}o.found?t[o.index].nodes.push(this.renderRow(this.rows[i])):t.push({labels:e,nodes:[this.renderRow(this.rows[i])]})}const i=[];for(let e=0;e<t.length;e++){const s=t[e].labels,r={data:[]};for(let t=0;t<s.length;t++)r.data.push({value:s[t],id:s[t]});i.push(o("div",{class:"kanban-section"},o(j,Object.assign({},r)),t[e].nodes))}return{jsx:i,style:{"grid-template-columns":this.kanban.isStacked?"repeat(1fr)":this.kanban.size?`repeat(${Object.keys(t).length}, ${this.kanban.size})`:`repeat(${Object.keys(t).length}, 1fr)`}}}didLoadInteractables(){this.interactableTouch.push(this.boxContainer),V(this,D,"f").interact.on(this.boxContainer,f.TAP,(t=>{var i;if(this.hold)this.hold=!1;else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];const o=this.clickHandler(e);this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o.row,column:null===(i=o.column)||void 0===i?void 0:i.name});break;case 2:this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})}})),V(this,D,"f").interact.on(this.boxContainer,f.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(this.hold=!0,this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)}))}))}didRenderInteractables(){if(this.dragEnabled)for(let t=0;t<this.rowsRefs.length;t++){const i=this.rowsRefs[t],e=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:p(this.getVisibleColumns(),t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};i&&!this.interactableDrag.includes(i)&&(this.interactableDrag.push(i),V(this,D,"f").interact.draggable(i,{allowFrom:".box-object",cursorChecker:()=>null},{callback:e},x.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.rootElement.shadowRoot.querySelector(".box:hover");if(!t)return void V(this,D,"f").debug.logMessage(this,"Couldn't find cell hovered to retrieve dropzone informations!",u.WARNING);const i=V(this,D,"f").getEventPath(t,this.rootElement),e=this.getEventDetails(i);return{cell:e.cell,column:e.column,id:this.rootElement.id,row:e.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),V(this,D,"f").interact.dropzone(this.sectionRef,{accept:`[${g}]`},{dispatcher:this.rootElement,type:k.BOX}));for(let i=0;i<this.rowsRefs.length;i++){const e=this.rowsRefs[i];e&&!this.interactableDrop.includes(e)&&(this.interactableDrop.push(e),V(this,D,"f").interact.dropzone(e,{accept:`[${g}]`},{callback:t,dispatcher:this.rootElement,type:k.BOX}))}}}componentWillLoad(){V(this,D,"f").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),V(this,D,"f").language.register(this),V(this,D,"f").theme.register(this),this.initWithPersistedState(),this.onDataChanged(),this.adjustPaginator(),document.querySelector(".header")?K(this,$,document.querySelector(".header").clientHeight,"f"):K(this,$,0,"f"),document.querySelector(".topbar")&&K(this,$,V(this,$,"f")+document.querySelector(".topbar").clientHeight,"f"),V(this,O,"m",N).call(this)}componentDidLoad(){if(this.handleAutomaticBoxSelection(),document.addEventListener("click",this.clickFunction.bind(this)),this.currentPage=this.pageSelected,this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((i=>t.indexOf(i.id)>=0))}this.didLoadInteractables(),this.kupDidLoad.emit({comp:this,id:this.rootElement.id}),V(this,D,"f").debug.logLoad(this,!0)}componentWillRender(){V(this,D,"f").debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");for(let t=0;t<i.length;t++)R(i[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),V(this,O,"m",H).call(this),V(this,D,"f").debug.logRender(this,!0)}render(){K(this,T,[],"f");const t=!("object"!=typeof this.kanban||null===this.kanban);let i=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.getVisibleColumns().map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let e={label:V(this,D,"f").language.translate(d.SORT_BY),trailingIcon:!0};i=o("div",{id:"sort-panel"},o("kup-combobox",{data:{"kup-text-field":e,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let e=null;this.globalFilter&&(e=o("div",{id:"global-filter"},o("kup-text-field",{fullWidth:!0,label:V(this,D,"f").language.translate(m.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.showLoadMore||!this.lazyLoadRows&&this.pagination)&&(r=o(A,{id:"top-paginator",currentPage:this.currentPage,max:this.filteredRows.length,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.rowsPerPage,maxRowsPerPage:Number.MAX_VALUE,onLoadMore:this.showLoadMore?()=>{V(this,O,"m",G).call(this)}:null,onNextPage:()=>this.handlePageChange(this.currentPage+1),onPrevPage:()=>this.handlePageChange(this.currentPage-1),onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let n=null,a={};if(0===this.rows.length)n=o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{class:"box",ref:t=>this.rowsRefs.push(t)},V(this,D,"f").language.translate(d.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 i=t.length,e=0;for(n=[];i-- >0;)n.push(this.renderRow(t[e++]))}return o(s,{"onKup-cell-click":t=>{this.kupBoxCellClick.emit(t.detail)}},o("style",null,V(this,D,"f").theme.setKupStyle(this.rootElement)),o("div",{id:z},o("div",{class:"box-component",ref:t=>this.sectionRef=t},i,e,r,o("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},n))))}disconnectedCallback(){V(this,D,"f").interact.unregister(this.interactableDrag.concat(this.interactableDrop)),V(this,D,"f").language.unregister(this),V(this,D,"f").theme.unregister(this),this.scrollOnHover&&V(this,D,"f").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"]}}};D=new WeakMap,B=new WeakMap,T=new WeakMap,$=new WeakMap,L=new WeakMap,F=new WeakMap,O=new WeakSet,W=function(){let t=!1;V(this,D,"f").objects.deepEqual(this.state.sortBy,this.sortBy)||(this.state.sortBy=this.sortBy,t=!0),V(this,D,"f").objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)||(this.state.globalFilterValue=this.globalFilterValue,t=!0),V(this,D,"f").objects.deepEqual(this.state.pageSelected,this.currentPage)||(this.state.pageSelected=this.currentPage,t=!0),V(this,D,"f").objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)||(this.state.rowsPerPage=this.currentRowsPerPage,t=!0);const i=this.selectedRows.reduce(((t,i,e)=>t+(e>0?";":"")+i.id),"");return V(this,D,"f").objects.deepEqual(this.state.selectedRowsState,i)||(this.state.selectedRowsState=i,t=!0),V(this,D,"f").objects.deepEqual(this.state.loadMoreLimit,this.loadMoreLimit)||(this.state.loadMoreLimit=this.loadMoreLimit,t=!0),V(this,D,"f").objects.deepEqual(this.state.showLoadMore,this.showLoadMore)||(this.state.showLoadMore=this.showLoadMore,t=!0),t},H=function(){this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length&&V(this,B,"f").observe(V(this,T,"f")[V(this,T,"f").length-1])},N=function(){const t={threshold:0,rootMargin:"-"+V(this,$,"f")+"px 0px 0px 0px"};K(this,B,new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){V(this,D,"f").debug.logMessage(this,"Last row entering the viewport, loading more elements.");const i=this.data.rows.length-this.currentRowsPerPage;this.currentRowsPerPage+=i<this.loadMoreStep?i:this.loadMoreStep,t.target.classList.remove("last-row"),V(this,B,"f").unobserve(t.target)}}))}),t),"f")},G=function(){var t;let i=0;switch(this.loadMoreMode){case S.CONSTANT:i=this.loadMoreStep;break;case S.CONSTANT_INCREMENT:i=this.loadMoreStep*(V(this,L,"f")+1);break;case S.PROGRESSIVE_THRESHOLD:i=Math.max(V(this,F,"f"),this.loadMoreStep)*Math.min(V(this,L,"f")+1,2)}i>this.loadMoreLimit&&(i=this.loadMoreLimit),this.kupLoadMoreClick.emit({comp:this,id:this.rootElement.id,loadItems:i}),K(this,F,i,"f"),K(this,L,(t=V(this,L,"f"),++t),"f")},q.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_box_background_color:var(\n --kup-box-background-color,\n var(--kup-layer-1)\n );--kup_box_background_color_hover:var(\n --kup-box-background-color-hover,\n var(--kup-layer-1-hover)\n );--kup_box_background_color_selected:var(\n --kup-box-background-color-selected,\n var(--kup-layer-1-selected)\n );--kup_box_text_color:var(--kup-box-text-color, var(--kup-text-secondary));--kup_box_grid_gap:var(--kup-box-grid-gap, var(--kup-space-03));--kup_box_transition:var(--kup-box-transition, 0.25s);--kup_box_border_color_drag:var(\n --kup-box-border-color-drag,\n var(--kup-border-interactive)\n );display:block;--kup_box_padding:var(--kup-box-padding, var(--kup-space-05));--kup_box_border_radius:var(--kup-box-border-radius, var(--kup-radius-00));--kup_box_border_color:var(\n --kup-box-border-color,\n var(--kup-primary-color-60)\n );--kup_box_border_width:var(--kup-box-border-width, 0);--kup_box_border_style:var(--kup-box-border-style, none)}.box-component{transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup_box_border_color_drag)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_text_color);overflow:auto}#box-container.is-kanban .kanban-section{overflow:auto}#box-container.is-kanban .box-wrapper{padding-top:1em}#box-container.is-kanban .box-wrapper .box{overflow:auto}#box-container *:not(.progress-bar-percentage){box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center;background-color:var(--kup_box_background_color);border-radius:var(--kup_box_border_radius);border-color:var(--kup_box_border_color);border-width:var(--kup_box_border_width);border-style:var(--kup_box_border_style)}#box-container .box-wrapper:hover{background-color:var(--kup_box_background_color_hover)}#box-container .box-wrapper.selected{background-color:var(--kup_box_background_color_selected)}#box-container .box-wrapper.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;padding:var(--kup_box_padding);transition:background-color var(--kup_box_transition) ease, box-shadow var(--kup_box_transition) ease, border var(--kup_box_transition) ease}#box-container .box-wrapper .box.draggable{touch-action:none;user-select:none}#box-container .box-wrapper .box.column{flex-direction:column}#box-container .box-wrapper .box[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup_box_border_color_drag);position:relative;z-index:2}#box-container .box-wrapper .box .box-section{display:flex;flex-direction:row;flex:1 1 1%;flex-wrap:wrap}#box-container .box-wrapper .box .box-section.column{flex-direction:column;justify-content:center;flex-wrap:unset}#box-container .box-wrapper .box .box-section.column>.box-section{flex:0 0 auto}#box-container .box-wrapper .box .box-section.grid{display:grid}#box-container .box-wrapper .box .box-section .box-object{min-height:16px}#box-container .box-wrapper .box .box-section .box-object img{height:auto}#box-container .box-wrapper .box .box-section.collapse-section .header{border-top:1px solid var(--kup-border-subtle);color:rgba(var(--kup-text-secondary-rgb), 0.75);display:flex;justify-content:space-around;width:100%}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content{margin:0.5em;display:flex;align-items:center}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image{transition:transform 0.15s}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image.toggled{transform:rotate(-180deg)}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .kup-icon.kup-dropdown-icon{margin:0;-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}#box-container .box-wrapper .box .box-section.collapse-section .content{display:none;width:100%}#box-container .box-wrapper .box .box-section.collapse-section.open .content{display:block}#box-container .box-wrapper .box .box-section.titled{border:1px solid var(--kup-border-subtle);padding-top:5px;position:relative;margin:10px}#box-container .box-wrapper .box .box-section.titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}#box-container .box-wrapper .box .box-selection{position:absolute;top:0.5em;right:0.5em;z-index:1}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler{position:relative;width:24px;height:24px;margin-left:3px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler svg{cursor:pointer;opacity:0;fill:var(--kup-text-color);transition:opacity 300ms ease-out}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu{background:var(--kup-background-color);border:1px solid var(--kup-border-subtle);box-shadow:0px 0px 7.5px 0px rgba(128, 128, 128, 0.5);position:absolute;top:0;right:24px;display:none;z-index:10}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul{list-style-type:none;margin:0;padding:0}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li{cursor:pointer;white-space:nowrap;padding:0 12px;display:flex;align-items:center;line-height:30px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li:not(:last-child){border-bottom:1px solid var(--kup-border-subtle)}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu.open{display:block}#box-container .box-wrapper:hover .row-actions-wrapper .row-actions-toggler svg{opacity:1}#sort-panel,#global-filter{margin-bottom:1em}:host(.kup-center-aligned) #kup-component .box-section{text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell img{margin:auto}:host(.kup-right-aligned) #kup-component .box-section{text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell img{margin-left:auto;margin-right:0}:host(.kup-top-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-start}:host(.kup-bottom-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-end}:host(.kup-flat-on-hover) #box-container .box-wrapper .box:hover{box-shadow:none}:host(.kup-shaped) .box{border-radius:10px}:host(.kup-round) .box{border-radius:25px}:host(.kup-dashed-sections) .box-section{border:2px dashed var(--kup-text-color)}:host(:not(.kup-paddingless)) #box-container .box .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{padding:3px 4px}:host(.kup-danger){--kup-box-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-box-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-box-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-box-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-box-primary-color-rgb:var(--kup-warning-color-rgb)}";export{q as kup_box}
1
+ import{r as t,c as i,f as e,h as o,H as s,d as r}from"./p-710d0a7d.js";import{k as n,A as a,g as h,s as l,a8 as c,x as p,b as d,d as b,h as u,V as f,Y as x,aG as g,_ as k,u as m}from"./p-03d049e3.js";import{f as w,p as v,s as y}from"./p-da273b4d.js";import{F as _}from"./p-cc9db65d.js";import{d as j}from"./p-95346c81.js";import{c as z}from"./p-635bb4b3.js";import{F as C}from"./p-87559acf.js";import{p as P,r as M,F as A}from"./p-02e22635.js";import{F as R}from"./p-7db300e0.js";import"./p-cabebabc.js";import"./p-ff735e62.js";import"./p-e3062c19.js";import"./p-ef3112d4.js";import"./p-cf5e1d07.js";import"./p-da5d5eea.js";import"./p-c56195a0.js";var I,S;!function(t){t.cardData="Data of the card linked to the box when the latter's layout must be a premade template.",t.columns="Number of columns.",t.customStyle="Custom style of the component.",t.data="Actual data of the box.",t.dragEnabled="Enable dragging.",t.dropEnabled="Enable dropping.",t.dropOnSection="Drop can be done in section.",t.enableRowActions="If enabled, a button to load / display the row actions will be displayed on the right of every box.",t.globalFilter="When set to true it activates the global filter.",t.globalFilterValue="The value of the global filter.",t.kanban="Displays the boxlist as a Kanban.",t.layout="How the field will be displayed. If not present, a default one will be created.",t.lazyLoadRows="When set to true, extra rows will be automatically loaded once the last row enters the viewport.",t.loadMoreLimit="Sets a maximum limit of new records which can be required by the load more functionality.",t.loadMoreMode="Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.",t.loadMoreStep="The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.",t.multiSelection="Enable multi selection.",t.pageSelected="Current page number.",t.pagination="Enables pagination.",t.rowsPerPage="Number of current rows per page.",t.scrollOnHover="Activates the scroll on hover function.",t.selectBox="Automatically selects the box at the specified index.",t.selectedRowsState="Multiple selection.",t.showLoadMore="If set to true, displays the button to load more records.",t.showSelection="If enabled, highlights the selected box/boxes.",t.sortBy="If sorting is enabled, specifies which column to sort.",t.sortEnabled="Enable sorting.",t.stateId="",t.store="",t.swipeDisabled="Disable swipe."}(I||(I={})),function(t){t.CONSTANT="constant",t.CONSTANT_INCREMENT="constant_increment",t.PROGRESSIVE_THRESHOLD="progressive_threshold"}(S||(S={}));class E{constructor(){this.globalFilterValue="",this.sortBy="",this.selectedRowsState="",this.pageSelected=1,this.rowsPerPage=0,this.load=!1,this.loadMoreLimit=1e3,this.showLoadMore=!1}toDebugString(){return"box state"}}var O,W,D,B,T,$,L,F,H,N,G,V=function(t,i,e,o){if("a"===e&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!o:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?o:"a"===e?o.call(t):o?o.value:i.get(t)},K=function(t,i,e,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!s:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(t,e):s?s.value=e:i.set(t,e),e};const q=class{constructor(e){t(this,e),this.kupBoxClick=i(this,"kup-box-click",6),this.kupBoxSelected=i(this,"kup-box-selected",6),this.kupAutoBoxSelect=i(this,"kup-box-autoselect",6),this.kupRowActionMenuClick=i(this,"kup-box-rowactionmenuclick",6),this.kupRowActionClick=i(this,"kup-box-rowactionclick",6),this.kupDidLoad=i(this,"kup-box-didload",6),this.kupDidUnload=i(this,"kup-box-didunload",6),this.kupBoxContextMenu=i(this,"kup-box-contextmenu",6),this.kupLoadMoreClick=i(this,"kup-box-loadmoreclick",6),this.kupBoxCellClick=i(this,"kup-box-cell-click",6),O.add(this),this.state=new E,D.set(this,n()),this.rows=[],this.filteredRows=[],this.sectionRef=null,this.rowsRefs=[],this.hold=!1,this.interactableDrag=[],this.interactableDrop=[],this.interactableTouch=[],B.set(this,void 0),T.set(this,[]),$.set(this,0),L.set(this,0),F.set(this,0),this.collapsedSection={},this.selectedRows=[],this.rowActionMenuOpened=void 0,this.currentPage=1,this.currentRowsPerPage=10,this.cardData=null,this.columns=1,this.customStyle="",this.data=null,this.dragEnabled=!1,this.dropEnabled=!1,this.dropOnSection=!1,this.editableData=!1,this.enableRowActions=!1,this.globalFilter=!1,this.globalFilterValue="",this.kanban=null,this.layout=void 0,this.lazyLoadRows=!1,this.loadMoreLimit=1e3,this.loadMoreMode=S.PROGRESSIVE_THRESHOLD,this.loadMoreStep=60,this.multiSelection=!1,this.pageSelected=1,this.pagination=!1,this.rowsPerPage=void 0,this.scrollOnHover=!1,this.selectBox=void 0,this.selectedRowsState=void 0,this.showLoadMore=!1,this.showSelection=!0,this.sortBy=void 0,this.sortEnabled=!1,this.stateId="",this.store=void 0,this.swipeDisabled=!1,this.visibleColumns=void 0}initWithPersistedState(){if(this.store&&this.stateId){this.state.load=!0;const t=this.store.getState(this.stateId);null!=t&&(V(this,D,"f").debug.logMessage(this,"Initialize with state for stateId "+this.stateId+": "+t),this.sortBy=t.sortBy,this.globalFilterValue=t.globalFilterValue,this.selectedRowsState=t.selectedRowsState,this.pageSelected=t.pageSelected,this.rowsPerPage=t.rowsPerPage,this.loadMoreLimit=t.loadMoreLimit,this.showLoadMore=t.showLoadMore)}}persistState(){if(this.store&&this.stateId){let t=V(this,O,"m",W).call(this);if(!this.state.load)return void(this.state.load=!0);t&&(V(this,D,"f").debug.logMessage(this,"Persisting stateId "+this.stateId),this.store.persistState(this.stateId,this.state))}}rowsPerPageHandler(t){this.currentRowsPerPage=t}recalculateRows(){this.initRows()}onDataChanged(){a(this.getRows()),this.initRows(),this.checkLayout()}onLayoutChanged(){this.checkLayout()}onSelectBoxChanged(){this.handleAutomaticBoxSelection()}async getProps(t){return h(this,I,t)}async loadRowActions(t,i){t.actions=i,this.rowActionMenuOpened=t}async refresh(){e(this)}async setProps(t){l(this,I,t)}getColumns(){return this.data&&this.data.columns?this.data.columns:[{title:"",name:"",size:void 0}]}getVisibleColumns(){let t=this.getColumns().filter((t=>{const i=!V(this,D,"f").data.column.isCodVer(t);return this.visibleColumns?i&&this.visibleColumns.includes(t.name):i&&(!("visible"in t)||t.visible)}));return this.visibleColumns&&(t=t.sort(((t,i)=>this.visibleColumns.indexOf(t.name)-this.visibleColumns.indexOf(i.name)))),t}getRows(){return this.data&&this.data.rows?this.data.rows:[]}initRows(){this.filteredRows=this.getRows(),this.globalFilter&&this.globalFilterValue&&(this.filteredRows=w(this.filteredRows,null,this.globalFilterValue,this.getColumns(),void 0,void 0,this.visibleColumns)),this.rows=this.sortRows(this.filteredRows),this.pagination&&(this.rows=v(this.rows,this.currentPage,this.currentRowsPerPage,!1))}sortRows(t){let i=t;return this.sortBy&&(i=y(i,this.toSortObjectList())),i}toSortObjectList(){return this.sortBy.split("|").map((t=>{const i=t.split(",");return{column:i[0],sortMode:i.length>1?c[i[1]]:c.A}}))}checkScrollOnHover(){this.boxContainer&&(V(this,D,"f").scrollOnHover.isRegistered(this.boxContainer)?this.scrollOnHover||V(this,D,"f").scrollOnHover.unregister(this.boxContainer):this.scrollOnHover&&V(this,D,"f").scrollOnHover.register(this.boxContainer))}checkLayout(){if(this.layout)return void(this.boxLayout=this.layout);const t={horizontal:!1,sections:[]},i=this.getVisibleColumns();let e=i.length,o=[],s=0;for(;e-- >0;)o.push({column:i[s++].name});t.content=o,this.boxLayout={sections:[t]}}onSortChange(t){let i=p(this.getVisibleColumns(),t.detail.value);this.sortBy=i.name}onGlobalFilterChange({detail:t}){let i="";t&&t.value&&(i=t.value),this.globalFilterValue=i}isSectionExpanded(t,i){return!(!t.id||!i.id)&&this.collapsedSection[i.id]&&this.collapsedSection[i.id][t.id]}handleAutomaticBoxSelection(){if(this.selectBox&&this.selectBox>0&&this.selectBox<=this.data.rows.length){this.selectedRows=[];for(let t of this.data.rows)if(t.id===(this.selectBox-1).toString()){this.selectedRows.push(t);break}this.kupAutoBoxSelect.emit({comp:this,id:this.rootElement.id,row:this.selectedRows[0]})}}getEventDetails(t,i){let e=null,o=null,s=null,r=null;if(t)for(let i=t.length-1;i>=0;i--){let o=t[i];o.tagName&&(o.tagName.toUpperCase(),o.classList.contains("box-object")&&(e=o),!s&&o["data-row"]&&(s=o["data-row"]))}if(e)if(e.classList.contains("f-cell")){const t=e["kup-get-cell-props"]();o=t.cell,r=t.column,s=t.row}else o=e["data-cell"],s=e["data-row"],r=p(this.getVisibleColumns(),e.dataset.column);return{boxObject:e||null,column:r||null,cell:o||null,originalEvent:i,row:s||null}}clickHandler(t){const i=this.getEventDetails(V(this,D,"f").getEventPath(t.target,this.rootElement),t);return i.row&&(this.multiSelection?this.onSelectionCheckChange(i.row):this.selectedRows=[i.row]),i}contextMenuHandler(t){return this.getEventDetails(V(this,D,"f").getEventPath(t.target,this.rootElement),t)}checkIfElementIsActionMenuIcon(t){return!(!t.tagName||!t.parentElement)&&"svg"===t.tagName&&t.parentElement.classList.contains("row-actions-toggler")}onSelectionCheckChange(t){var i=-1;for(let e=0;e<this.selectedRows.length;e++)if(this.selectedRows[e].id===t.id){i=e;break}i>=0?(this.selectedRows.splice(i,1),this.selectedRows=[...this.selectedRows]):this.selectedRows=[...this.selectedRows,t],this.kupBoxSelected.emit({comp:this,id:this.rootElement.id,rows:this.selectedRows})}toggleSectionExpand(t,i){if(i.id)if(t.id){if(this.collapsedSection[i.id]){const e=this.collapsedSection[i.id];e[t.id]=!e[t.id]||!e[t.id]}else this.collapsedSection[i.id]={},this.collapsedSection[i.id][t.id]=!0;this.collapsedSection=Object.assign({},this.collapsedSection)}else console.error("cannot expand / collapse a section of a row without ad id");else console.error("cannot expand / collapse a section withoun an ID")}onRowAction(t){t&&(t!==this.rowActionMenuOpened?t.actions?this.rowActionMenuOpened=t:this.kupRowActionMenuClick.emit({comp:this,id:this.rootElement.id,row:t}):this.rowActionMenuOpened=null)}onRowActionClick(t,i,e){this.kupRowActionClick.emit({comp:this,id:this.rootElement.id,row:t,action:i,index:e})}clickFunction(t){try{const i=t.composedPath();for(let t of i)if(this.checkIfElementIsActionMenuIcon(t))return}catch(i){if(this.checkIfElementIsActionMenuIcon(t.target))return}this.rowActionMenuOpened=null}handlePageChange(t){const i=P(t,this.filteredRows.length,this.currentRowsPerPage);i&&(this.currentPage=i)}handleRowsPerPageChange(t){const i=M(t,this.filteredRows.length);i&&(this.currentRowsPerPage=i,this.adjustPaginator())}adjustPaginator(){const t=Math.ceil(this.rows.length/this.currentRowsPerPage);this.currentPage>t&&(this.currentPage=1)}renderSectionAsCard(t){let i=!1;const e={button:[],cell:[],columns:[],image:[],progressbar:[],text:[]},s=this.getVisibleColumns();for(let i=0;i<s.length;i++){const o=s[i];!1!==o.visible&&(e.cell.push(t.cells[o.name]),e.columns.push(o))}for(const i in t.cells)if(t.cells.hasOwnProperty(i)){const o=t.cells[i];if(void 0!==o.cardID&&o.obj)switch(o.obj.p){case"BTN":do{e.button.push({})}while(e.button.length<o.cardID);e.button[o.cardID]={label:o.value};break;case"IMG":do{e.image.push({})}while(e.image.length<o.cardID);e.image[o.cardID]={resource:o.value};break;case"PGB":do{e.progressbar.push({})}while(e.progressbar.length<o.cardID);e.progressbar[o.cardID]={value:o.value};break;default:do{e.text.push("")}while(e.text.length<o.cardID);e.text[o.cardID]=o.value}}for(const o in t.cells)if(t.cells.hasOwnProperty(o)){const s=t.cells[o];if(void 0===s.cardID&&s.obj)switch(i=!1,s.obj.p){case"BTN":for(let t=0;t<e.button.length;t++)if(!Object.keys(e.button[t]).length){e.button[t]={label:s.value},i=!0;break}i||e.button.push({label:s.value});break;case"IMG":for(let t=0;t<e.image.length;t++)if(!Object.keys(e.image[t]).length){e.image[t]={resource:s.value},i=!0;break}i||e.image.push({resource:s.value});break;case"PGB":for(let t=0;t<e.progressbar.length;t++)if(!Object.keys(e.progressbar[t]).length){e.progressbar[t]={value:s.value},i=!0;break}i||e.progressbar.push({value:s.value});break;default:for(let t=0;t<e.text.length;t++)if(""===e.text[t]){e.text[t]=s.value,i=!0;break}i||e.text.push(s.value)}}return o("kup-card",Object.assign({data:e},this.cardData))}renderRow(t){const i=[...this.getVisibleColumns()];let e=null,s=t.layout;s||(s=this.boxLayout);let r=!1;if(s){s.horizontal&&(r=!0);const o=s.sections;let n=o.length,a=0;n>0&&(e=[]);const h={horizontal:r};if(null!=this.cardData&&"object"==typeof this.cardData)e.push(this.renderSectionAsCard(t));else for(;n-- >0;)e.push(this.renderSection(o[a++],h,t,i))}var n=!1;for(let i of this.selectedRows)i.id===t.id&&(n=!0);let a=null;this.multiSelection&&(a=o("div",{class:"box-selection"},o("kup-checkbox",{checked:n})));let h=null;if(this.enableRowActions&&!this.swipeDisabled){const i={"row-action-menu":!0,open:t===this.rowActionMenuOpened};let e=null;if(t.actions){const i=t.actions.map(((i,e)=>o("li",{tabindex:"0",onClick:()=>this.onRowActionClick(t,i,e)},o("div",{class:`icon ${i.icon}`}),o("div",{class:"text"},i.text))));e=o("ul",null,i)}h=o("div",{class:"row-actions-wrapper"},o("div",{class:"row-actions-toggler"},o("svg",{version:"1.1",width:"24",height:"24",viewBox:"0 0 24 24",onClick:()=>this.onRowAction(t)},o("path",{d:"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"})),o("div",{class:i},e)))}let l=null;return t.badgeData&&t.badgeData.length>0&&(l=t.badgeData.map((t=>o("kup-badge",{text:t.text,class:t.className?`centered ${t.className}`:"centered",imageData:t.imageData})))),o("div",{class:"box-wrapper",style:t.style||{},ref:t=>{t&&V(this,T,"f").push(t)}},o("div",{class:{box:!0,draggable:this.dragEnabled,selected:this.showSelection&&n,column:!r},"data-row":t,ref:t=>this.rowsRefs.push(t)},a,e,l),h)}renderSection(t,i,e,s){let r=null;if(t.sections&&t.sections.length>0){const i=t.sections;let o=i.length,n=0;for(o>0&&(r=[]);o-- >0;)r.push(this.renderSection(i[n++],t,e,s))}else if(t.content){const i=t.content;let o=i.length,n=0;for(o>0&&(r=[]);o-- >0;)r.push(this.renderBoxObject({boxObject:i[n++],row:e,visibleColumns:s},!0))}else s.length>0&&(r=this.renderBoxObject({boxObject:{column:s[0].name},row:e,visibleColumns:s}));const n=this.isSectionExpanded(e,t),a=!!t.columns,h={"box-section":!0,open:n,column:!a&&!t.horizontal,grid:a,titled:!!t.title,"last-child":!t.sections||0===t.sections.length},l=t.style||{};t.dim&&i&&(l.overflow="hidden",i.horizontal&&(l.flex=`0 0 ${t.dim}`,l.maxWidth=t.dim)),a&&(l["grid-template-columns"]=`repeat(${t.columns}, 1fr)`);let c=null;if(t.collapsible){h["collapse-section"]=!0;const i={content:!0};let s="";s=t.title?t.title:n?V(this,D,"f").language.translate(d.COLLAPSE):V(this,D,"f").language.translate(d.EXPAND),c=o("div",{class:h,style:l},o("div",{class:i},r),o("div",{class:"header",role:"button",onClick:i=>{i.stopPropagation(),this.toggleSectionExpand(e,t)}},o("div",{class:"header-content"},o("span",null,s),o(_,{resource:`${b.DROPDOWN}`,sizeX:"1.25em",sizeY:"1.25em",wrapperClass:n?"toggled":""}))))}else{const i=t.title?o("h3",null,t.title):null;c=o("div",{class:h,style:l},i,r)}return c}renderBoxObject({boxObject:t,row:i,visibleColumns:e},s){const r={"box-object":!0};let n=null,a=-1;for(let i=0;i<e.length;i++)if(e[i].name===t.column){a=i;break}a>=0?(n=e[a],e.splice(a,1)):s&&(n=this.data.columns.find((i=>i.name===t.column)));const h=i.cells[t.column];let l;return h&&!V(this,D,"f").objects.isEmptyKupObj(h.obj)&&(r["is-obj"]=!0,V(this,D,"f").debug.isDebug()&&(l=h.obj.t+"; "+h.obj.p+"; "+h.obj.k+";"),h.isEditable||(h.cssClass=V(this,D,"f").data.cell.getObjectRelatedStyleClasses(h.obj,h.cssClass))),o("div",{"data-cell":h,"data-row":i,"data-column":t.column,class:r,style:{},title:l},h&&n?o(C,Object.assign({},{cell:h,column:n,component:this,editable:this.editableData,renderKup:!0,row:i,setSizes:!0,shape:t.shape})):o("span",null,t.value))}kanbanMode(){if(!this.kanban.columns||0===this.kanban.columns.length)return V(this,D,"f").debug.logMessage(this,"No columns to group by detected.",u.ERROR),{jsx:o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{ref:t=>this.rowsRefs.push(t)}),V(this,D,"f").language.translate(d.EMPTY_DATA)),style:{"grid-template-columns":"repeat(1, 1fr)"}};const t=[];if(this.kanban.labels)for(let i=0;i<this.kanban.labels.length;i++)t.push({labels:this.kanban.labels[i],nodes:[]});for(let i=0;i<this.rows.length;i++){let e=[];for(let t=0;t<this.kanban.columns.length;t++)try{e.push(this.rows[i].cells[this.kanban.columns[t]].value)}catch(t){V(this,D,"f").debug.logMessage(this,t,u.WARNING)}const o={found:!1,index:null};for(let i=0;i<t.length;i++){let s=t[i].labels,r=!0;for(let t=0;t<s.length;t++)if(e[t]!==s[t]){r=!1;break}if(r){o.found=!0,o.index=i;break}}o.found?t[o.index].nodes.push(this.renderRow(this.rows[i])):t.push({labels:e,nodes:[this.renderRow(this.rows[i])]})}const i=[];for(let e=0;e<t.length;e++){const s=t[e].labels,r={data:[]};for(let t=0;t<s.length;t++)r.data.push({value:s[t],id:s[t]});i.push(o("div",{class:"kanban-section"},o(j,Object.assign({},r)),t[e].nodes))}return{jsx:i,style:{"grid-template-columns":this.kanban.isStacked?"repeat(1fr)":this.kanban.size?`repeat(${Object.keys(t).length}, ${this.kanban.size})`:`repeat(${Object.keys(t).length}, 1fr)`}}}didLoadInteractables(){this.interactableTouch.push(this.boxContainer),V(this,D,"f").interact.on(this.boxContainer,f.TAP,(t=>{var i;if(this.hold)this.hold=!1;else switch(t.button){case 0:const e={};for(const i in t)e[i]=t[i];const o=this.clickHandler(e);this.kupBoxClick.emit({comp:this,id:this.rootElement.id,row:o.row,column:null===(i=o.column)||void 0===i?void 0:i.name});break;case 2:this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)})}})),V(this,D,"f").interact.on(this.boxContainer,f.HOLD,(t=>{"pen"!==t.pointerType&&"touch"!==t.pointerType||(this.hold=!0,this.kupBoxContextMenu.emit({comp:this,id:this.rootElement.id,details:this.contextMenuHandler(t)}))}))}didRenderInteractables(){if(this.dragEnabled)for(let t=0;t<this.rowsRefs.length;t++){const i=this.rowsRefs[t],e=()=>{const t=this.rootElement.shadowRoot.querySelector(".box-object:hover");return{cell:t["data-cell"],column:p(this.getVisibleColumns(),t.dataset.column),id:this.rootElement.id,multiple:this.multiSelection,row:t["data-row"],selectedRows:this.selectedRows}};i&&!this.interactableDrag.includes(i)&&(this.interactableDrag.push(i),V(this,D,"f").interact.draggable(i,{allowFrom:".box-object",cursorChecker:()=>null},{callback:e},x.BADGE))}if(this.dropEnabled){const t=()=>{const t=this.rootElement.shadowRoot.querySelector(".box:hover");if(!t)return void V(this,D,"f").debug.logMessage(this,"Couldn't find cell hovered to retrieve dropzone informations!",u.WARNING);const i=V(this,D,"f").getEventPath(t,this.rootElement),e=this.getEventDetails(i);return{cell:e.cell,column:e.column,id:this.rootElement.id,row:e.row}};this.interactableDrop.includes(this.sectionRef)||(this.interactableDrop.push(this.sectionRef),V(this,D,"f").interact.dropzone(this.sectionRef,{accept:`[${g}]`},{dispatcher:this.rootElement,type:k.BOX}));for(let i=0;i<this.rowsRefs.length;i++){const e=this.rowsRefs[i];e&&!this.interactableDrop.includes(e)&&(this.interactableDrop.push(e),V(this,D,"f").interact.dropzone(e,{accept:`[${g}]`},{callback:t,dispatcher:this.rootElement,type:k.BOX}))}}}componentWillLoad(){V(this,D,"f").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),V(this,D,"f").language.register(this),V(this,D,"f").theme.register(this),this.initWithPersistedState(),this.onDataChanged(),this.adjustPaginator(),document.querySelector(".header")?K(this,$,document.querySelector(".header").clientHeight,"f"):K(this,$,0,"f"),document.querySelector(".topbar")&&K(this,$,V(this,$,"f")+document.querySelector(".topbar").clientHeight,"f"),V(this,O,"m",N).call(this)}componentDidLoad(){if(this.handleAutomaticBoxSelection(),document.addEventListener("click",this.clickFunction.bind(this)),this.currentPage=this.pageSelected,this.multiSelection&&this.selectedRowsState){this.selectedRows=[];let t=this.selectedRowsState.split(";");this.selectedRows=this.data.rows.filter((i=>t.indexOf(i.id)>=0))}this.didLoadInteractables(),this.kupDidLoad.emit({comp:this,id:this.rootElement.id}),V(this,D,"f").debug.logLoad(this,!0)}componentWillRender(){V(this,D,"f").debug.logRender(this,!1)}componentDidRender(){const t=this.rootElement.shadowRoot;if(t){const i=t.querySelectorAll(".f-text-field");for(let t=0;t<i.length;t++)R(i[t])}this.checkScrollOnHover(),this.persistState(),this.didRenderInteractables(),V(this,O,"m",H).call(this),V(this,D,"f").debug.logRender(this,!0)}render(){K(this,T,[],"f");const t=!("object"!=typeof this.kanban||null===this.kanban);let i=null;if(this.sortEnabled){const t=[{value:"",id:""},...this.getVisibleColumns().map((t=>({value:t.title,id:t.name,selected:t.name===this.sortBy})))];let e={label:V(this,D,"f").language.translate(d.SORT_BY),trailingIcon:!0};i=o("div",{id:"sort-panel"},o("kup-combobox",{data:{"kup-text-field":e,"kup-list":{data:t,selectable:!0}},initialValue:this.sortBy,"onkup-combobox-itemclick":t=>this.onSortChange(t)}))}let e=null;this.globalFilter&&(e=o("div",{id:"global-filter"},o("kup-text-field",{fullWidth:!0,label:V(this,D,"f").language.translate(m.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.showLoadMore||!this.lazyLoadRows&&this.pagination)&&(r=o(A,{id:"top-paginator",currentPage:this.currentPage,max:this.filteredRows.length,perPage:this.currentRowsPerPage?this.currentRowsPerPage:this.rowsPerPage,maxRowsPerPage:Number.MAX_VALUE,onLoadMore:this.showLoadMore?()=>{V(this,O,"m",G).call(this)}:null,onNextPage:()=>this.handlePageChange(this.currentPage+1),onPrevPage:()=>this.handlePageChange(this.currentPage-1),onPageChange:t=>this.handlePageChange(t.detail.value),onRowsChange:t=>this.handleRowsPerPageChange(t.detail.value)}));let n=null,a={};if(0===this.rows.length)n=o("div",{id:"empty-data-message",class:"box-wrapper"},o("div",{class:"box",ref:t=>this.rowsRefs.push(t)},V(this,D,"f").language.translate(d.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 i=t.length,e=0;for(n=[];i-- >0;)n.push(this.renderRow(t[e++]))}return o(s,{"onKup-cell-click":t=>{this.kupBoxCellClick.emit(t.detail)}},o("style",null,V(this,D,"f").theme.setKupStyle(this.rootElement)),o("div",{id:z},o("div",{class:"box-component",ref:t=>this.sectionRef=t},i,e,r,o("div",{class:t?"is-kanban":"",id:"box-container",style:a,onContextMenu:t=>{t.preventDefault()},ref:t=>this.boxContainer=t},n))))}disconnectedCallback(){V(this,D,"f").interact.unregister(this.interactableDrag.concat(this.interactableDrop)),V(this,D,"f").language.unregister(this),V(this,D,"f").theme.unregister(this),this.scrollOnHover&&V(this,D,"f").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"]}}};D=new WeakMap,B=new WeakMap,T=new WeakMap,$=new WeakMap,L=new WeakMap,F=new WeakMap,O=new WeakSet,W=function(){let t=!1;V(this,D,"f").objects.deepEqual(this.state.sortBy,this.sortBy)||(this.state.sortBy=this.sortBy,t=!0),V(this,D,"f").objects.deepEqual(this.state.globalFilterValue,this.globalFilterValue)||(this.state.globalFilterValue=this.globalFilterValue,t=!0),V(this,D,"f").objects.deepEqual(this.state.pageSelected,this.currentPage)||(this.state.pageSelected=this.currentPage,t=!0),V(this,D,"f").objects.deepEqual(this.state.rowsPerPage,this.currentRowsPerPage)||(this.state.rowsPerPage=this.currentRowsPerPage,t=!0);const i=this.selectedRows.reduce(((t,i,e)=>t+(e>0?";":"")+i.id),"");return V(this,D,"f").objects.deepEqual(this.state.selectedRowsState,i)||(this.state.selectedRowsState=i,t=!0),V(this,D,"f").objects.deepEqual(this.state.loadMoreLimit,this.loadMoreLimit)||(this.state.loadMoreLimit=this.loadMoreLimit,t=!0),V(this,D,"f").objects.deepEqual(this.state.showLoadMore,this.showLoadMore)||(this.state.showLoadMore=this.showLoadMore,t=!0),t},H=function(){this.lazyLoadRows&&this.currentRowsPerPage<this.data.rows.length&&V(this,B,"f").observe(V(this,T,"f")[V(this,T,"f").length-1])},N=function(){const t={threshold:0,rootMargin:"-"+V(this,$,"f")+"px 0px 0px 0px"};K(this,B,new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){V(this,D,"f").debug.logMessage(this,"Last row entering the viewport, loading more elements.");const i=this.data.rows.length-this.currentRowsPerPage;this.currentRowsPerPage+=i<this.loadMoreStep?i:this.loadMoreStep,t.target.classList.remove("last-row"),V(this,B,"f").unobserve(t.target)}}))}),t),"f")},G=function(){var t;let i=0;switch(this.loadMoreMode){case S.CONSTANT:i=this.loadMoreStep;break;case S.CONSTANT_INCREMENT:i=this.loadMoreStep*(V(this,L,"f")+1);break;case S.PROGRESSIVE_THRESHOLD:i=Math.max(V(this,F,"f"),this.loadMoreStep)*Math.min(V(this,L,"f")+1,2)}i>this.loadMoreLimit&&(i=this.loadMoreLimit),this.kupLoadMoreClick.emit({comp:this,id:this.rootElement.id,loadItems:i}),K(this,F,i,"f"),K(this,L,(t=V(this,L,"f"),++t),"f")},q.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup_box_background_color:var(\n --kup-box-background-color,\n var(--kup-layer-1)\n );--kup_box_background_color_hover:var(\n --kup-box-background-color-hover,\n var(--kup-layer-1-hover)\n );--kup_box_background_color_selected:var(\n --kup-box-background-color-selected,\n var(--kup-layer-1-selected)\n );--kup_box_text_color:var(--kup-box-text-color, var(--kup-text-secondary));--kup_box_grid_gap:var(--kup-box-grid-gap, var(--kup-space-03));--kup_box_transition:var(--kup-box-transition, 0.25s);--kup_box_border_color_drag:var(\n --kup-box-border-color-drag,\n var(--kup-border-interactive)\n );display:block;--kup_box_padding:var(--kup-box-padding, var(--kup-space-05));--kup_box_border_radius:var(--kup-box-border-radius, var(--kup-radius-00));--kup_box_border_color:var(\n --kup-box-border-color,\n var(--kup-primary-color-60)\n );--kup_box_border_width:var(--kup-box-border-width, 0);--kup_box_border_style:var(--kup-box-border-style, none)}.box-component{transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup_box_border_color_drag)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_text_color);overflow:auto}#box-container.is-kanban .kanban-section{overflow:auto}#box-container.is-kanban .box-wrapper{padding-top:1em}#box-container.is-kanban .box-wrapper .box{overflow:auto}#box-container *:not(.progress-bar-percentage){box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center;background-color:var(--kup_box_background_color);border-radius:var(--kup_box_border_radius);border-color:var(--kup_box_border_color);border-width:var(--kup_box_border_width);border-style:var(--kup_box_border_style)}#box-container .box-wrapper:hover{background-color:var(--kup_box_background_color_hover)}#box-container .box-wrapper.selected{background-color:var(--kup_box_background_color_selected)}#box-container .box-wrapper.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;padding:var(--kup_box_padding);transition:background-color var(--kup_box_transition) ease, box-shadow var(--kup_box_transition) ease, border var(--kup_box_transition) ease}#box-container .box-wrapper .box.draggable{touch-action:none;user-select:none}#box-container .box-wrapper .box.column{flex-direction:column}#box-container .box-wrapper .box[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup_box_border_color_drag);position:relative;z-index:2}#box-container .box-wrapper .box .box-section{display:flex;flex-direction:row;flex:1 1 1%;flex-wrap:wrap}#box-container .box-wrapper .box .box-section.column{flex-direction:column;justify-content:center;flex-wrap:unset}#box-container .box-wrapper .box .box-section.column>.box-section{flex:0 0 auto}#box-container .box-wrapper .box .box-section.grid{display:grid}#box-container .box-wrapper .box .box-section .box-object{min-height:16px}#box-container .box-wrapper .box .box-section .box-object img{height:auto}#box-container .box-wrapper .box .box-section.collapse-section .header{border-top:1px solid var(--kup-border-subtle);color:rgba(var(--kup-text-secondary-rgb), 0.75);display:flex;justify-content:space-around;width:100%}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content{margin:0.5em;display:flex;align-items:center}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image{transition:transform 0.15s}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image.toggled{transform:rotate(-180deg)}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .kup-icon.kup-dropdown-icon{margin:0;-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}#box-container .box-wrapper .box .box-section.collapse-section .content{display:none;width:100%}#box-container .box-wrapper .box .box-section.collapse-section.open .content{display:block}#box-container .box-wrapper .box .box-section.titled{border:1px solid var(--kup-border-subtle);padding-top:5px;position:relative;margin:10px}#box-container .box-wrapper .box .box-section.titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}#box-container .box-wrapper .box .box-selection{position:absolute;top:0.5em;right:0.5em;z-index:1}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler{position:relative;width:24px;height:24px;margin-left:3px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler svg{cursor:pointer;opacity:0;fill:var(--kup-text-color);transition:opacity 300ms ease-out}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu{background:var(--kup-background-color);border:1px solid var(--kup-border-subtle);box-shadow:0px 0px 7.5px 0px rgba(128, 128, 128, 0.5);position:absolute;top:0;right:24px;display:none;z-index:10}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul{list-style-type:none;margin:0;padding:0}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li{cursor:pointer;white-space:nowrap;padding:0 12px;display:flex;align-items:center;line-height:30px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li:not(:last-child){border-bottom:1px solid var(--kup-border-subtle)}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu.open{display:block}#box-container .box-wrapper:hover .row-actions-wrapper .row-actions-toggler svg{opacity:1}#sort-panel,#global-filter{margin-bottom:1em}:host(.kup-center-aligned) #kup-component .box-section{text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell img{margin:auto}:host(.kup-right-aligned) #kup-component .box-section{text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell img{margin-left:auto;margin-right:0}:host(.kup-top-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-start}:host(.kup-bottom-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-end}:host(.kup-flat-on-hover) #box-container .box-wrapper .box:hover{box-shadow:none}:host(.kup-shaped) .box{border-radius:10px}:host(.kup-round) .box{border-radius:25px}:host(.kup-dashed-sections) .box-section{border:2px dashed var(--kup-text-color)}:host(:not(.kup-paddingless)) #box-container .box .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{padding:3px 4px}:host(.kup-danger){--kup-box-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-box-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-box-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-box-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-box-primary-color-rgb:var(--kup-warning-color-rgb)}";export{q as kup_box}
@@ -0,0 +1 @@
1
+ import{h as o}from"./p-710d0a7d.js";import{a as e,k as t,e as n}from"./p-03d049e3.js";import{F as c}from"./p-ff735e62.js";import{a as i}from"./p-e3062c19.js";import{F as l}from"./p-da5d5eea.js";const s=new WeakMap,a=t=>{var n;let s;return o("div",{class:`f-object-field ${t.wrapperClass?t.wrapperClass:""}`,ref:async o=>{o&&(t.root=o,p(t))}},o("div",{class:"fields-wrapper"},o(l,Object.assign({icon:"search",trailingIcon:!0,disabled:!1},null===(n=t.cell)||void 0===n?void 0:n.data,{attachHelperSection:o=>(s=o,!1),value:t.inputValue,onChange:t.onChange,onIconClick:b.icon.bind(t),onInput:b.input.bind(t),onKeyDown:b.keydown.bind(t)})),o(c,{icon:"menu",onClick:b.button.bind(t),sizing:e.SMALL,styling:i.FLAT,wrapperClass:"obj-field-extra-btn"})),s,o("kup-toolbar",{"onKup-toolbar-click":b.toolbar.bind(t)}))};function r(o){const{cell:e}=o,n=s.get(e),{clickCb:c}=n,{toolbar:i}=u(n),l=t();l.dynamicPosition.stop(i),l.removeClickCallback(c),i.style.display="none",n.isListOpened=!1}const u=o=>{const{children:e,clickCb:t,root:n}=o;return Object.keys(o.children).length||(e.button=n.querySelector(".f-button"),e.textfield=n.querySelector(".f-text-field"),e.toolbar=n.querySelector("kup-toolbar"),t.el=e.toolbar),e},p=o=>{const{cell:e,root:t}=o,n=s.get(e);s.set(e,n?Object.assign(Object.assign({},n),{root:t,children:u(n)}):{children:{},clickCb:{cb:r.bind(r,o)},inputValue:o.inputValue,isListOpened:!1,root:t})},d=(o,e,t)=>{const{cell:n,column:c,row:i,root:l}=o,{children:a,inputValue:r}=s.get(n),u=new CustomEvent(e,{bubbles:!0,cancelable:!0,composed:!0,detail:{cell:n,children:a,column:c,inputValue:r,originalEvent:t,row:i}});l.dispatchEvent(u)},b={button:function(o){(function(o){const{cell:e}=o,c=s.get(e),{isListOpened:i}=c;i?r(o):function(o){const{cell:e}=o,c=s.get(e),{isListOpened:i,clickCb:l}=c,{button:a,toolbar:r}=u(c);if(i)return;const p=t();p.dynamicPosition.isRegistered(r)?p.dynamicPosition.changeAnchor(r,a):p.dynamicPosition.register(r,a,0,n.AUTO,!1),p.dynamicPosition.start(r),p.addClickCallback(l,!0),r.style.display="block",c.isListOpened=!0}(o)})(this),d(this,"kup-objectfield-opensearchmenu",o)},icon:function(o){d(this,"kup-objectfield-searchpayload",o)},input:function(o){const{cell:e}=this;s.get(e).inputValue=o.target.value},keydown:function(o){"F4"===o.code&&(o.preventDefault(),o.stopPropagation(),d(this,"kup-objectfield-searchpayload",o))},toolbar:function(o){r(this),d(this,"kup-objectfield-selectedmenuitem",o)}};export{a as F}
@@ -1 +1 @@
1
- import{E as e,H as t,D as n,ai as l,x as o,z as r,aj as i,ak as s,N as a,O as u,F as c,al as f,am as h,an as d,ao as b,ap as m,a8 as p}from"./p-54b56ca6.js";import{K as v}from"./p-cabebabc.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;const o=e[t];o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length&&delete e[t]}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t,n){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,n)}isFilterCompliantForCellObj(e,t,n){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,n)}isRowCompliant(e,t={},n="",l=!1,o=[],r,i){return this.areCellsCompliant(e.cells,t,n,l,o,r,i)}areCellsCompliant(e,t={},n="",r=!1,i=[],s,a){if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let s=0;s<i.length;s++){if(!1===i[s].visible&&!a||(null==a?void 0:a.length)>0&&!a.includes(i[s].name))continue;const u=e[i[s].name];if(null==u)continue;t=this.isFilterCompliantForValue(u.value,n,r);let c=l(i[s],u);if(c!=u.value&&(t=t||this.isFilterCompliantForValue(c,n,r)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a,!0)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),h=c;return k.isNumber(l.obj)||k.isDate(l.obj)||k.isTime(l.obj)||k.isTimestamp(l.obj)||(h=""!==a&&this.isFilterCompliantForCellObj(l,a,!0)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&h:f||h}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o,r){if(!e||null==e)return[];let i=[];const s=!(!n||!l);if(this.hasFilters(t,l,o)||s)for(let a=0;a<e.length;a++){let u=e[a];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,s,l,o,r))&&(i[i.length]=u)}else i=[...e];return i}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r,i){return null==r&&(r=new y),r.filterRows(e,t,n,l,o,i)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const h=o(e,n),d=l(h,f),b=f.value;let m=null;for(let e of u)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,o,n)))}function D(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{D(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function E(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=E(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function B(e,t,n){if(T.ketchup.objects.isEmptyJsObject(n)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(T.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if(T.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:I(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function z(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function I(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:z(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function $(e,t,n=!1,l=[]){const o={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const r of t.rows){if(l.includes(r.id)){o.rows.push(r);continue}const t={cells:{},id:r.id};for(const n of o.columns){const l=n.name,o=r.cells[l],i=e.rows.find((e=>e.id===r.id)),s=i?i.cells[l]:null;(!s&&o.value||s&&o.value!==s.value)&&(t.cells[l]=o)}(Object.keys(t.cells).length>0||n)&&o.rows.push(t)}return o}function q(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i,l.data),[c.COMBOBOX]:()=>f(o,"",i,l.data),[c.RADIO]:()=>h(o,i),[c.CHECKBOX]:()=>d(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,g as K,y as a,N as b,B as c,q as d,F as e,M as f,$ as g,A as n,S as p,C as s,x as t}
1
+ import{E as e,H as t,D as n,ai as l,x as o,z as r,aj as i,ak as s,N as a,O as u,F as c,al as f,am as h,an as d,ao as b,ap as m,a8 as p}from"./p-03d049e3.js";import{K as v}from"./p-cabebabc.js";class w extends e{getTextFilterValue(e={},t){return this._getTextFilterValue(e,t,!1)}getTextFilterValueTmp(e={},t){return this._getTextFilterValue(e,t,!0)}_getTextFilterValue(e={},t,n){let l="";if(null==e)return l;let o=e[t];return null==o||(l=n?o.textFieldTmp:o.textField),l}hasFiltersForColumn(e={},t){return this._hasFiltersForColumn(e,t,!1)}hasFiltersForColumnTmp(e={},t){return this._hasFiltersForColumn(e,t,!0)}_hasFiltersForColumn(e={},t,n){if(!t)return!1;let l=this._getTextFilterValue(e,t.name,n);if(null!=l&&""!=l.trim())return!0;let o=this.getCheckBoxFilterValues(e,t.name);return!(null==o||o.length<1)}getCheckBoxFilterValues(e={},t){let n=[];if(null==e)return n;let l=e[t];return null==l||null==l.checkBoxes||(n=l.checkBoxes),n}addCheckboxFilter(t={},n,l){if(null==t)return;let o=t[n];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},t[n]=o),null==o.checkBoxes&&(o.checkBoxes=[]),null==l||null==l.value?o.checkBoxes=[]:e.valuesArrayContainsValue(o.checkBoxes,l.value)||(o.checkBoxes[o.checkBoxes.length]=l)}removeCheckboxFilter(e={},t,n){var l;if(!e||null==n||!e[t])return;const o=e[t];o.checkBoxes=null!==(l=o.checkBoxes)&&void 0!==l?l:[],o.checkBoxes=o.checkBoxes.filter((e=>e.value!==n)),0===o.checkBoxes.length&&delete e[t]}isColumnNumeric(e){return this.isObjNumeric(e.obj)}setTextFieldFilterValue(e={},t,n){this._setTextFieldFilterValue(e,t,n,!0)}_setTextFieldFilterValue(e={},t,n,l){if(null==e)return;let o=e[t];null==o&&(o={textField:"",textFieldTmp:"",checkBoxes:[]},e[t]=o),l?o.textFieldTmp=null!=n?n.trim():n:o.textField=null!=n?n.trim():n}saveTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValueTmp(e,t),!1)}resetTextualFilters(e={},t){this._setTextFieldFilterValue(e,t,this.getTextFilterValue(e,t),!0)}getFilterValueForTooltip(e={},l){let o=this.getTextFilterValue(e,l.name),r=this.getCheckBoxFilterValues(e,l.name),i="",s=t(o,l.obj,l.decimals);""!=o&&(i=" AND "),i="";let a="";return r.forEach((e=>{a+=i+n(e,l),i=" OR "})),""!=a&&(a="("+a+")",""!=s&&(a=" AND "+a)),a=s+a,a}removeFilter(e={},t){delete e[t]}}var F;!function(e){e.asAccordion="When enabled, the first level of depth will give an accordion look to nodes.",e.columns="The columns of the tree when tree visualization is active.",e.customStyle="Custom style of the component.",e.data="The json data used to populate the tree view: the basic, always visible tree nodes.",e.density="The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.",e.dynamicExpansionCallback="Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.",e.enableExtraColumns="Enables adding extra columns.",e.expanded="Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.",e.expansionMode="Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.",e.filters="List of filters set by the user.",e.globalFilter="When set to true it activates the global filter.",e.globalFilterValue="The value of the global filter.",e.globalFilterMode="The mode of the global filter.",e.preventXScroll="Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.",e.removableColumns="Sets the possibility to remove the selected column.",e.ripple="When enabled displays Material's ripple effect on nodes (only when no columns are displayed).",e.scrollOnHover="Activates the scroll on hover function.",e.showColumns="Shows the tree data as a table.",e.showFilters="When set to true enables the column filters.",e.showFooter="When set to true shows the footer.",e.showHeader="Flag: shows the header of the tree when the tree is displayed as a table.",e.showIcons="Shows the icons of the nodes.",e.stateId="",e.store="",e.totals="Defines the current totals options.",e.useDynamicExpansion="When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server."}(F||(F={}));const x="TREE_COLUMN";var g;!function(e){e.DROPDOWN="dropdown",e.NODE="node"}(g||(g={}));const j=document.documentElement,k=j.ketchup?j.ketchup.objects:new r,O=j.ketchup?j.ketchup.data:new i;class y extends e{isFilterCompliantForCell(e,t,n){return!!e&&this.isFilterCompliantForSimpleValue(e.value,e.obj,t,n)}isFilterCompliantForCellObj(e,t,n){return!!e&&!!e.obj&&this.isFilterCompliantForSimpleValue(e.obj.k,e.obj,t,n)}isRowCompliant(e,t={},n="",l=!1,o=[],r,i){return this.areCellsCompliant(e.cells,t,n,l,o,r,i)}areCellsCompliant(e,t={},n="",r=!1,i=[],s,a){if(r){let t=!0;if(i&&null!=i&&i.length>0){t=!1;let o=this.filterIsNegative(n);for(let s=0;s<i.length;s++){if(!1===i[s].visible&&!a||(null==a?void 0:a.length)>0&&!a.includes(i[s].name))continue;const u=e[i[s].name];if(null==u)continue;t=this.isFilterCompliantForValue(u.value,n,r);let c=l(i[s],u);if(c!=u.value&&(t=t||this.isFilterCompliantForValue(c,n,r)),1==t&&!o)break;if(0==t&&o)break}}if(!t)return!1}return null==s&&(s=new w),!this.hasFilters(t,i,s)||Object.keys(t).every((n=>{const l=e[n],r=o(i,n);if(!l)return!1;let a=s.getTextFilterValue(t,n),u=s.getCheckBoxFilterValues(t,n);const c=this.filterIsNegative(a);let f=""!==a&&this.isFilterCompliantForCell(l,a,!0)||u.some((e=>this.isFilterCompliantForCell(l,e.value)))||u.some((e=>this.isFilterCompliantForCell(l,e.displayedValue)))||!s.hasFiltersForColumn(t,r),h=c;return k.isNumber(l.obj)||k.isDate(l.obj)||k.isTime(l.obj)||k.isTimestamp(l.obj)||(h=""!==a&&this.isFilterCompliantForCellObj(l,a,!0)||u.some((e=>this.isFilterCompliantForCellObj(l,e.value)))||!s.hasFiltersForColumn(t,r)),c?f&&h:f||h}))}hasFilters(e={},t,n){if(null==e)return!1;let l=Object.keys(e);if(null==l||l.length<1)return!1;null==n&&(n=new w);for(let r=0;r<l.length;r++){let i=l[r],s=null;if(s=i===x?{name:x,title:""}:o(t,i),n.hasFiltersForColumn(e,s))return!0}return!1}filterRows(e=[],t={},n="",l=[],o,r){if(!e||null==e)return[];let i=[];const s=!(!n||!l);if(this.hasFilters(t,l,o)||s)for(let a=0;a<e.length;a++){let u=e[a];(u.id&&u.id.indexOf("insert_")>-1||this.isRowCompliant(u,t,n,s,l,o,r))&&(i[i.length]=u)}else i=[...e];return i}getColumnValues(n,l,o,r){let i=new Array;null==r&&(r=new w);let s=r.getTextFilterValueTmp(n.filters,l.name),a=r.getCheckBoxFilterValues(n.filters,l.name);if(null!=l.valuesForFilter&&l.valuesForFilter.length>0)return l.valuesForFilter.forEach((n=>{let o=n;(e.valuesArrayContainsValue(a,o)||""==s||r.isFilterCompliantForSimpleValue(o,l.obj,s))&&i.push({value:o,displayedValue:t(o,l.obj,l.decimals)})})),i;let u=Object.assign({},n.filters);u[l.name]={textField:s,textFieldTmp:s,checkBoxes:[]};let c=this.filterRows(n.getRows(),u,o,n.getVisibleColumns(),r);for(let e=0;e<a.length;e++)i.push(a[e]);return O.cell.getUnivocalValue({rows:c},l,!0)}}const T=document.documentElement;function C(e=[],t=[]){if(!e||0===e.length)return[];if(e[0].group)return function(e=[],t=[]){if(!e||0===e.length)return[];const n=e[0].group.column;let l=function(e="",t=[]){if(!e||!t||0===t.length)return null;for(let n of t)if(n.column===e)return n;return null}(n,t);return l||(l={column:n,sortMode:p.A}),e.sort(((e,t)=>s({obj:e.group.obj,value:e.group.id},{obj:t.group.obj,value:t.group.id},l.sortMode))),e.forEach((e=>{e.group.children=C(e.group.children,t)})),e}(e,t);if(!t||0===t.length)return e;const n=t.length>1;return e.slice(0).sort(((e,l)=>{if(n){for(let n=0;n<t.length;n++){const o=V(e,l,t[n]);if(0!==o)return o}return 0}return V(e,l,t[0])}))}function V(e,t,n){const l=e.cells[n.column],o=t.cells[n.column];return l||o?l?o?s(l,o,n.sortMode):-1:1:0}function M(e=[],t={},n="",l=[],o,r,i){return null==r&&(r=new y),r.filterRows(e,t,n,l,o,i)}function N(e=[],t=[],n=[],r={}){if(!t)return[];if(!n||0===n.length||!e||0===e.length)return t;const i={},s=n.filter((({column:t})=>{for(let{name:n,title:l}of e)if(n===t)return i[n]=l,!0;return!1}));if(0===s.length)return t;const u=[];let c={};return t.forEach((t=>{const n=s[0].column,f=t.cells[n];if(f){const h=o(e,n),d=l(h,f),b=f.value;let m=null;for(let e of u)if(e.group.label===d){m=e;break}null===m&&(m={group:{id:b,parent:null,column:n,columnLabel:i[n],expanded:!1,label:d,children:[],obj:f.obj,totals:{}},cells:{}},u.push(m));for(let n=1;n<s.length;n++){const r=s[n],a=t.cells[r.column];if(a){const t=o(e,r.column),n=l(t,a),s=a.value;let u=null;for(let e=0;e<m.group.children.length;e++){const t=m.group.children[e];if(t.group.label===n){u=t;break}}u||(u={cells:{},group:{id:s,parent:m,column:r.column,columnLabel:i[r.column],children:[],expanded:!1,label:n,totals:{},obj:a.obj}},L(u),m.group.children.push(u)),m=u}}m.group.children.push(t),function(e,t,n,l){if(!e||!t)return;const o=Object.keys(t);0!==o.length&&o.forEach((o=>{const r=n.cells[o];if(r){const n=T.ketchup.objects.isNumber(r.obj),i=t[o];switch(i){case a.COUNT:let t=e.group.totals[o]||0;e.group.totals[o]=++t;let s=e.group.parent;for(;null!=s;){let e=s.group.totals[o]||0;s.group.totals[o]=++e,s=s.group.parent}break;case a.DISTINCT:let u;if(u=n?T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value)):r.value,l[e.group.id]){let t=l[e.group.id][o];t?t.push(u):(l[e.group.id][o]=[],l[e.group.id][o].push(u))}else l[e.group.id]={},l[e.group.id][o]=[],l[e.group.id][o].push(u);let c=e.group.parent;for(;null!=c;){if(l[c.group.id]){let e=l[c.group.id][o];e?e.push(u):(l[c.group.id][o]=[],l[c.group.id][o].push(u))}else l[c.group.id]={},l[c.group.id][o]=[],l[c.group.id][o].push(u);c=c.group.parent}break;case a.SUM:case a.AVERAGE:if(n&&r.value){const t=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t+(e.group.totals[o]||0);let n=e.group.parent;for(;null!=n;){const e=T.ketchup.math.numberify(n.group.totals[o]||0);n.group.totals[o]=t+e,n=n.group.parent}}break;case a.MIN:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.min(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.min(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.min(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;case a.MAX:if(n&&r.value){const t=e.group.totals[o],n=T.ketchup.math.numberify(T.ketchup.math.numberifySafe(r.value));e.group.totals[o]=t?Math.max(t,n):n;let l=e.group.parent;for(;null!=l;){const e=l.group.totals[o];l.group.totals[o]=e?Math.max(e,n):n,l=l.group.parent}}else if(r.value&&T.ketchup.objects.isDate(r.obj)&&T.ketchup.dates.isValidFormattedStringDate(r.value)){const t=e.group.totals[o];if(t){let n=[];n.push(u),n.push(T.ketchup.dates.toDayjs(t)),e.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE)}else e.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);let n=e.group.parent;for(;null!=n;){const e=n.group.totals[o];if(e){let t=[];t.push(u),t.push(T.ketchup.dates.toDayjs(e)),n.group.totals[o]=T.ketchup.dates.format(T.ketchup.dates.max(t),v.ISO_DATE)}else n.group.totals[o]=T.ketchup.dates.format(u,v.ISO_DATE);n=n.group.parent}}break;default:0!=i.indexOf(a.MATH)&&console.warn(`invalid total mode: ${i}`)}}}))}(m,r,t,c)}})),function(e,t,n){if(!e||!t)return;const l=Object.keys(t);if(0===e.length||!e[0].group||0===l.length)return;let o=l.filter((e=>a.DISTINCT===t[e]));o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>D(e,o,n)))}(u,r,c),W(u,a.AVERAGE,r),W(u,a.MATH,r),u}function W(e,t,n){if(!e||!n)return;const l=Object.keys(n);if(0===e.length||!e[0].group||0===l.length)return;let o;t==a.AVERAGE&&(o=l.filter((e=>a.AVERAGE===n[e]))),t==a.MATH&&(o=l.filter((e=>0==n[e].indexOf(a.MATH)))),o.length>0&&e.filter((e=>e.group.children.length>0)).forEach((e=>E(e,t,o,n)))}function D(e,t,n){const l=e.group.children;0!==l.length&&(l[0].group&&l.forEach((e=>{D(e,t,n)})),t.forEach((t=>{e.group.totals[t]=new Set(n[e.group.id][t]).size})))}function E(e,t,n,l){const o=e.group.children;if(0===o.length)return 0;let r=0;return o[0].group?o.forEach((e=>{r+=E(e,t,n,l)})):r=o.length,n.forEach((n=>{if(t==a.AVERAGE&&(e.group.totals[n]=e.group.totals[n]/r),t==a.MATH){let t=l[n].substring(a.MATH.length);e.group.totals[n]=T.ketchup.math.formulas.custom(t,e.group.totals)}})),r}function A(e,t){if(t){const n=Object.assign(t);return t.forEach((t=>{e.forEach((e=>{if(t.cells){const n=t.cells[e.name];n&&e.obj&&!n.obj&&(n.obj={t:e.obj.t,p:e.obj.p,k:n.value})}}))})),n}}function B(e,t,n){if(T.ketchup.objects.isEmptyJsObject(n)||T.ketchup.objects.isEmptyJsObject(e))return{};const l={},o=[],r=t.reduce(((t,r)=>{if(!e[r.name])return t;const i=e[r.name];return i===a.COUNT?(l[r.name]=n.length.toString(),t):0===i.indexOf(a.MATH)?(o.push([r.name,i]),t):(t.push({totalOperation:i,totalColumn:r,columnValues:n.map((e=>e.cells[r.name].value))}),t)}),[]);return r||o?(null==r||r.forEach((({totalOperation:e,totalColumn:t,columnValues:o})=>{if(T.ketchup.objects.isNumber(t.obj)){if(e===a.SUM)return void(l[t.name]=o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0).toString());if(e===a.AVERAGE)return void(l[t.name]=(o.reduce(((e,t)=>e+T.ketchup.math.numberifySafe(t)),0)/n.length).toString());if(e===a.MIN)return void(l[t.name]=Math.min(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString());if(e===a.MAX)return void(l[t.name]=Math.max(...o.map((e=>T.ketchup.math.numberifySafe(e)))).toString())}if(T.ketchup.objects.isDate(t.obj)){const n=o.filter((e=>T.ketchup.dates.isIsoDate(e))).map((e=>T.ketchup.dates.toDate(e,v.ISO_DATE)));if(!n)return;if(e===a.MIN)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.min(n),v.ISO_DATE));if(e===a.MAX)return void(l[t.name]=T.ketchup.dates.format(T.ketchup.dates.max(n),v.ISO_DATE))}e===a.DISTINCT&&(l[t.name]=new Set(o).size.toString())})),null==o||o.forEach((([e,t])=>{const n=null==t?void 0:t.replace(u(a.MATH,"g"),"");l[e]=T.ketchup.math.formulas.custom(n,function(e){var t;return Object.fromEntries(null===(t=Object.entries(e))||void 0===t?void 0:t.reduce(((e,[t,n])=>(T.ketchup.math.isNumber(n)&&e.push([t,Number(n)]),e)),[]))}(l)).toString()})),l):l}function L(e){if(!e.group)return;let t=e.group.id,n=e.group.parent;for(;null!==n;)t=`${n.group.id};${t}`,n=n.group.parent;e.group.id=t}function S(e,t,n,l){const o=t*n-n,r=o+Number(n);if(0==l)return e.slice(o,r);let i=[];return _(e,i,o,Number(n),0),i}function _(e,t,n,l,o){let r=!1;for(let i=0;i<e.length;i++){let s=e[i],a=R(e[i]);if(null!=s.group&&null!=s.group.children&&s.group.children.length>0){a.group.children=[];let e=_(s.group.children,a.group.children,n,l,o);o=e.ci,r=e.added,1==r&&(t[t.length]=a)}else o>=n&&(t[t.length]=a,r=!0),o++;if(o>=n+l)break}return{ci:o,added:r}}function R(e){return null==e?null:{id:e.id,cells:Object.assign({},e.cells),actions:e.actions?[...e.actions]:null,group:I(e.group),clonedFrom:e,readOnly:e.readOnly,cssClass:e.cssClass}}function z(e){if(null==e)return null;let t=[];for(let n=0;n<e.length;n++)t[t.length]=R(e[n]);return t}function I(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:z(e.children),obj:Object.assign({},e.obj),totals:Object.assign({},e.totals)}}function $(e,t,n=!1,l=[]){const o={columns:t.columns.filter((e=>e.visible)),rows:[]};for(const r of t.rows){if(l.includes(r.id)){o.rows.push(r);continue}const t={cells:{},id:r.id};for(const n of o.columns){const l=n.name,o=r.cells[l],i=e.rows.find((e=>e.id===r.id)),s=i?i.cells[l]:null;(!s&&o.value||s&&o.value!==s.value)&&(t.cells[l]=o)}(Object.keys(t.cells).length>0||n)&&o.rows.push(t)}return o}function q(e){var t;null===(t=e.rows)||void 0===t||t.forEach((e=>{Object.keys(e.cells).forEach((t=>{var n;let l=e.cells[t];const o=l.value,r=l.decode,i=l.options;l.isEditable=null!==(n=l.isEditable)&&void 0!==n?n:l.editable;const s={[c.AUTOCOMPLETE]:()=>f(o,"",i,l.data),[c.COMBOBOX]:()=>f(o,"",i,l.data),[c.RADIO]:()=>h(o,i),[c.CHECKBOX]:()=>d(o,""),[c.CHIP]:()=>b(o,r),[c.SWITCH]:()=>m(o,""),[c.MULTI_AUTOCOMPLETE]:()=>b(o,r),[c.MULTI_COMBOBOX]:()=>b(o,r)}[l.shape];s&&(l.data=Object.assign(Object.assign({},s()),l.data))}))}))}export{w as F,g as K,y as a,N as b,B as c,q as d,F as e,M as f,$ as g,A as n,S as p,C as s,x as t}
@@ -1 +1 @@
1
- import{h as e,g as l}from"./p-710d0a7d.js";import{d as t}from"./p-54b56ca6.js";import{F as i}from"./p-cc9db65d.js";const n=document.documentElement;let o=null;const d=(l,t)=>{var i,n;const o={"f-text-field":!0,"kup-danger":l.danger,"kup-full-height":l.fullHeight,"kup-full-width":l.fullWidth,"kup-info":l.info,"kup-light-mode":l.lightMode,"kup-secondary":l.secondary,"kup-shaped":l.shaped,"kup-success":l.success,"kup-warning":l.warning,[`f-text-field--${l.sizing||"small"}`]:!0,[l.wrapperClass]:!!l.wrapperClass},d=function(l){if(!1!==l.helperEnabled&&(l.error||l.alert)&&!l.legacyLook)return e("div",{class:"mdc-text-field-helper-line"},l.helper?e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!l.helperWhenFocused}},l.helper):l.error?e("span",{class:"mdc-error-message"},l.error):l.alert?e("span",{class:"mdc-alert-message"},l.alert):void 0)}(l),c=null===(n=null===(i=l.attachHelperSection)||void 0===i?void 0:i.call(l,d))||void 0===n||n;return e("div",Object.assign({class:o},l.dataSet,{id:l.id,title:l.title}),l.leadingLabel||l.trailingLabel?e("div",{class:"mdc-form-field "+(l.leadingLabel?"mdc-form-field--align-end":"")},[a(l),c?d:null,e("label",null,l.label)]):[a(l),c?d:null],t)};function a(o){var d,a,u,m,p,f,v;const x=o.textArea||o.outlined;let g,k,b,h;if(!o.label||o.leadingLabel||o.trailingLabel||o.legacyLook||(g=e("div",{class:"mdc-text-field__label-container"},e("label",{class:"mdc-label",htmlFor:"kup-input"},o.label,o.labelHelper&&e("span",{onPointerMove:e=>r(e,o.labelHelper),onPointerDown:e=>r(e,o.labelHelper),onPointerOut:()=>s()},e(i,{resource:"info_outline",wrapperClass:"helper-icon"}))),o.maxLength&&o.showCounter?e("div",{class:"mdc-text-field__label-character-counter"},o.value.length," / ",o.maxLength):void 0)),o.icon){let i,n="";if(Object.values(t).indexOf(o.icon)>-1)n=o.icon.replace("--","");else{let e=`url('${l(`./assets/svg/${o.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}k=e("span",{style:i,onClick:o.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}if(o.quantityButtons){const t=`url('${l("./assets/svg/minus.svg")}') no-repeat center`,i=`url('${l("./assets/svg/plus.svg")}') no-repeat center`,n={mask:i,webkitMask:i};b=e("span",{style:{mask:t,webkitMask:t},class:"mdc-text-field__icon kup-icon action"}),h=e("span",{style:n,class:"mdc-text-field__icon kup-icon action"})}const w={color:o.error?"var(--kup-danger-color-60)":"var(--kup-warning-color-50)",resource:o.error?"error":"warning",sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"kup-icon"},_={"mdc-text-field-container":!0,"mdc-text-field-container--disabled":o.disabled},y={"is-clearable":o.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":o.disabled,"mdc-text-field--read-only":o.readOnly,"mdc-text-field--read-only-is-select":o.isSelect,"mdc-text-field--filled":!o.fullWidth&&!x,"mdc-text-field--no-label":!o.label,"mdc-text-field--fullwidth":o.fullWidth,"mdc-text-field--lightmode":o.lightMode,"mdc-text-field--outlined":x,"mdc-text-field--textarea":o.textArea,"mdc-text-field--with-leading-icon":o.icon&&!o.trailingIcon,"mdc-text-field--with-trailing-icon":o.icon&&o.trailingIcon,"mdc-text-field--with-quantity-buttons":o.quantityButtons,"mdc-text-field--error":Boolean(o.error),"mdc-text-field--alert":Boolean(o.alert),"mdc-text-field--legacy-look mdc-text-field--extra-small":o.legacyLook,[`mdc-text-field--${o.sizing||"small"}`]:!o.textArea&&!o.legacyLook,[`mdc-text-field--textarea--${o.sizing||"small"}`]:o.textArea,"top-right-indicator":o.showMarker};let C=o.value,$=o.quantityButtons?"number":null!==(d=o.inputType)&&void 0!==d?d:"text",F=!1;if("number"===o.inputType&&($="text",o.inputMode="numeric",F=!0),"number"===o.inputType){const e={allowNegative:null===(a=o.allowNegative)||void 0===a||a,decimal:o.decimals,group:null===(u=o.group)||void 0===u||u,integer:(null!==(m=o.integers)&&void 0!==m?m:0)-(null!==(p=o.decimals)&&void 0!==p?p:0)};C=c(C,e,!1)}return e("div",{class:_},o.fullWidth?void 0:g,e("div",{class:y},o.trailingIcon?void 0:k,o.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:o.disabled,maxlength:o.maxLength,value:C,autoComplete:null!==(f=o.autocomplete)&&void 0!==f?f:"off",onBlur:o.onBlur,onClick:o.onClick,onChange:o.onChange,onFocus:o.onFocus,onInput:o.onInput,onKeyDown:o.onKeyDown})):e("input",{type:$,inputmode:o.inputMode?o.inputMode:void 0,step:o.step,min:o.min,max:o.max,name:o.name,class:"mdc-text-field__input",disabled:o.disabled,placeholder:o.placeholder,maxlength:o.maxLength,size:o.size,value:C,readOnly:o.isSelect,autoComplete:null!==(v=o.autocomplete)&&void 0!==v?v:"off",onBlur:e=>{var l,t,i,n;if(F){const d={allowNegative:null===(l=o.allowNegative)||void 0===l||l,decimal:o.decimals,group:null===(t=o.group)||void 0===t||t,integer:(null!==(i=o.integers)&&void 0!==i?i:0)-(null!==(n=o.decimals)&&void 0!==n?n:0)};e.target.value=c(e.target.value,d,!0)}o.onBlur&&o.onBlur(e)},onChange:e=>{var l,t,i,n;if(F){const d={allowNegative:null===(l=o.allowNegative)||void 0===l||l,decimal:o.decimals,group:null===(t=o.group)||void 0===t||t,integer:(null!==(i=o.integers)&&void 0!==i?i:0)-(null!==(n=o.decimals)&&void 0!==n?n:0)};e.target.value=null!=o.min&&o.min>parseFloat(e.target.value)?c(o.min.toString(),d,!0):null!=o.max&&o.max<parseFloat(e.target.value)?c(o.max.toString(),d,!0):c(e.target.value,d,!0)}else null!=o.min&&o.min>parseFloat(e.target.value)?e.target.value=o.min.toString():null!=o.max&&o.max<parseFloat(e.target.value)&&(e.target.value=o.max.toString());o.onChange&&o.onChange(e)},onClick:o.onClick,onFocus:o.onFocus,onInput:o.onInput,onKeyDown:o.onKeyDown,onKeyPress:e=>{var l,t,i,d,a;if(!F)return;if(e.ctrlKey)return;if(e.key.length>1)return;if(("."===e.key||","===e.key)&&"NumpadDecimal"===e.code){const t=e.target,i=null!==(l=t.selectionStart)&&void 0!==l?l:0,o=n.ketchup.math.decimalSeparator();return t.value.includes(o)||(t.value=t.value.slice(0,i)+o+t.value.slice(i),t.setSelectionRange(i+1,i+1)),void e.preventDefault()}const c={allowNegative:null===(t=o.allowNegative)||void 0===t||t,decimal:o.decimals,group:null===(i=o.group)||void 0===i||i,integer:(null!==(d=o.integers)&&void 0!==d?d:0)-(null!==(a=o.decimals)&&void 0!==a?a:0)};let s=e.target,r=s.value,u=r.substring(0,s.selectionStart),m=r.substring(s.selectionEnd,s.selectionEnd+r.length-1);n.ketchup.math.matchNumericValueWithOptions(u+e.key+m,c)||e.preventDefault()}}),o.trailingIcon?k:void 0,o.helperIcon&&o.error?e("div",{class:"mdc-error-icon"},e(i,Object.assign({},w))):o.helperIcon&&o.alert?e("div",{class:"mdc-alert-icon"},e(i,Object.assign({},w))):void 0,o.quantityButtons&&e("div",{class:"mdc-quantity-buttons"},e("button",{onClick:o.onMinusClick},b),e("button",{onClick:o.onPlusClick},h)),o.isClearable&&o.value?e("span",{class:`mdc-text-field__icon kup-icon ${t.CLEAR.replace("--","")}`,onClick:o.onClearIconClick}):void 0))}const c=function(e,l,t){let i=e;return i?"-"==i?"":n.ketchup.math.format(i,n.ketchup.math.createFormatPattern(l.group,l.decimal),t):i},s=()=>{o&&(o.remove(),o=null)},r=(e,l)=>{l&&0!==l.length&&(o?(o.innerText=l,u(o,e)):(o=document.createElement("div"),o.className="kup-helper-tooltip",o.innerText=l,document.body.appendChild(o),u(o,e)))},u=(e,l)=>{const t=10,i=window.innerWidth,n=window.innerHeight,o=e.getBoundingClientRect(),d=o.width,a=o.height;let c=l.clientX+t,s=l.clientY+t;c+d>i&&(c=l.clientX-d-t,c<0&&(c=i-d-t)),s+a>n&&(s=l.clientY-a-t,s<0&&(s=n-a-t)),c=Math.max(t,Math.min(c,i-d-t)),s=Math.max(t,Math.min(s,n-a-t)),e.style.left=`${c}px`,e.style.top=`${s}px`};export{d as F}
1
+ import{h as e,g as l}from"./p-710d0a7d.js";import{d as t}from"./p-03d049e3.js";import{F as i}from"./p-cc9db65d.js";const n=document.documentElement;let o=null;const d=(l,t)=>{var i,n;const o={"f-text-field":!0,"kup-danger":l.danger,"kup-full-height":l.fullHeight,"kup-full-width":l.fullWidth,"kup-info":l.info,"kup-light-mode":l.lightMode,"kup-secondary":l.secondary,"kup-shaped":l.shaped,"kup-success":l.success,"kup-warning":l.warning,[`f-text-field--${l.sizing||"small"}`]:!0,[l.wrapperClass]:!!l.wrapperClass},d=function(l){if(!1!==l.helperEnabled&&(l.error||l.alert)&&!l.legacyLook)return e("div",{class:"mdc-text-field-helper-line"},l.helper?e("div",{class:{"mdc-text-field-helper-text":!0,"mdc-text-field-helper-text--persistent":!l.helperWhenFocused}},l.helper):l.error?e("span",{class:"mdc-error-message"},l.error):l.alert?e("span",{class:"mdc-alert-message"},l.alert):void 0)}(l),s=null===(n=null===(i=l.attachHelperSection)||void 0===i?void 0:i.call(l,d))||void 0===n||n;return e("div",Object.assign({class:o},l.dataSet,{id:l.id,title:l.title}),l.leadingLabel||l.trailingLabel?e("div",{class:"mdc-form-field "+(l.leadingLabel?"mdc-form-field--align-end":"")},[a(l),s?d:null,e("label",null,l.label)]):[a(l),s?d:null],t)};function a(o){var d,a,u,m,p,f,v;const x=o.textArea||o.outlined;let g,k,h,b;if(!o.label||o.leadingLabel||o.trailingLabel||o.legacyLook||(g=e("div",{class:"mdc-text-field__label-container"},e("label",{class:"mdc-label",htmlFor:"kup-input"},o.label,o.labelHelper&&e("span",{onPointerMove:e=>r(e,o.labelHelper),onPointerDown:e=>r(e,o.labelHelper),onPointerOut:()=>c()},e(i,{resource:"info_outline",wrapperClass:"helper-icon"}))),o.maxLength&&o.showCounter?e("div",{class:"mdc-text-field__label-character-counter"},o.value.length," / ",o.maxLength):void 0)),o.icon){let i,n="";if(Object.values(t).indexOf(o.icon)>-1)n=o.icon.replace("--","");else{let e=`url('${l(`./assets/svg/${o.icon}.svg`)}') no-repeat center`;i={mask:e,webkitMask:e}}k=e("span",{style:i,onClick:o.onIconClick,class:`mdc-text-field__icon kup-icon action ${n}`})}if(o.quantityButtons){const t=`url('${l("./assets/svg/minus.svg")}') no-repeat center`,i=`url('${l("./assets/svg/plus.svg")}') no-repeat center`,n={mask:i,webkitMask:i};h=e("span",{style:{mask:t,webkitMask:t},class:"mdc-text-field__icon kup-icon action"}),b=e("span",{style:n,class:"mdc-text-field__icon kup-icon action"})}const w={color:o.error?"var(--kup-danger-color-60)":"var(--kup-warning-color-50)",resource:o.error?"error":"warning",sizeX:"1.25em",sizeY:"1.25em",wrapperClass:"kup-icon"},_={"mdc-text-field-container":!0,"mdc-text-field-container--disabled":o.disabled},y={"is-clearable":o.isClearable,"mdc-text-field":!0,"mdc-text-field--disabled":o.disabled,"mdc-text-field--read-only":o.readOnly,"mdc-text-field--read-only-is-select":o.isSelect,"mdc-text-field--filled":!o.fullWidth&&!x,"mdc-text-field--no-label":!o.label,"mdc-text-field--fullwidth":o.fullWidth,"mdc-text-field--lightmode":o.lightMode,"mdc-text-field--outlined":x,"mdc-text-field--textarea":o.textArea,"mdc-text-field--with-leading-icon":o.icon&&!o.trailingIcon,"mdc-text-field--with-trailing-icon":o.icon&&o.trailingIcon,"mdc-text-field--with-quantity-buttons":o.quantityButtons,"mdc-text-field--error":Boolean(o.error),"mdc-text-field--alert":Boolean(o.alert),"mdc-text-field--legacy-look mdc-text-field--extra-small":o.legacyLook,[`mdc-text-field--${o.sizing||"small"}`]:!o.textArea&&!o.legacyLook,[`mdc-text-field--textarea--${o.sizing||"small"}`]:o.textArea,"top-right-indicator":o.showMarker};let C=o.value,$=o.quantityButtons?"number":null!==(d=o.inputType)&&void 0!==d?d:"text",F=!1;if("number"===o.inputType&&($="text",o.inputMode="numeric",F=!0),"number"===o.inputType){const e={allowNegative:null===(a=o.allowNegative)||void 0===a||a,decimal:o.decimals,group:null===(u=o.group)||void 0===u||u,integer:(null!==(m=o.integers)&&void 0!==m?m:0)-(null!==(p=o.decimals)&&void 0!==p?p:0)};C=s(C,e,!1)}return e("div",{class:_},o.fullWidth?void 0:g,e("div",{class:y},o.trailingIcon?void 0:k,o.textArea?e("span",{class:"mdc-text-field__resizer"},e("textarea",{class:"mdc-text-field__input",disabled:o.disabled,maxlength:o.maxLength,value:C,autoComplete:null!==(f=o.autocomplete)&&void 0!==f?f:"off",onBlur:o.onBlur,onClick:o.onClick,onChange:o.onChange,onFocus:o.onFocus,onInput:o.onInput,onKeyDown:o.onKeyDown})):e("input",{type:$,inputmode:o.inputMode?o.inputMode:void 0,step:o.step,min:o.min,max:o.max,name:o.name,class:"mdc-text-field__input",disabled:o.disabled,placeholder:o.placeholder,maxlength:o.maxLength,size:o.size,value:C,readOnly:o.isSelect,autoComplete:null!==(v=o.autocomplete)&&void 0!==v?v:"off",onBlur:e=>{var l,t,i,n;if(F){const d={allowNegative:null===(l=o.allowNegative)||void 0===l||l,decimal:o.decimals,group:null===(t=o.group)||void 0===t||t,integer:(null!==(i=o.integers)&&void 0!==i?i:0)-(null!==(n=o.decimals)&&void 0!==n?n:0)};e.target.value=s(e.target.value,d,!0)}o.onBlur&&o.onBlur(e)},onChange:e=>{var l,t,i,n;if(F){const d={allowNegative:null===(l=o.allowNegative)||void 0===l||l,decimal:o.decimals,group:null===(t=o.group)||void 0===t||t,integer:(null!==(i=o.integers)&&void 0!==i?i:0)-(null!==(n=o.decimals)&&void 0!==n?n:0)};e.target.value=null!=o.min&&o.min>parseFloat(e.target.value)?s(o.min.toString(),d,!0):null!=o.max&&o.max<parseFloat(e.target.value)?s(o.max.toString(),d,!0):s(e.target.value,d,!0)}else null!=o.min&&o.min>parseFloat(e.target.value)?e.target.value=o.min.toString():null!=o.max&&o.max<parseFloat(e.target.value)&&(e.target.value=o.max.toString());o.onChange&&o.onChange(e)},onClick:o.onClick,onFocus:o.onFocus,onInput:o.onInput,onKeyDown:o.onKeyDown,onKeyPress:e=>{var l,t,i,d,a;if(!F)return;if(e.ctrlKey)return;if(e.key.length>1)return;if(("."===e.key||","===e.key)&&"NumpadDecimal"===e.code){const t=e.target,i=null!==(l=t.selectionStart)&&void 0!==l?l:0,o=n.ketchup.math.decimalSeparator();return t.value.includes(o)||(t.value=t.value.slice(0,i)+o+t.value.slice(i),t.setSelectionRange(i+1,i+1)),void e.preventDefault()}const s={allowNegative:null===(t=o.allowNegative)||void 0===t||t,decimal:o.decimals,group:null===(i=o.group)||void 0===i||i,integer:(null!==(d=o.integers)&&void 0!==d?d:0)-(null!==(a=o.decimals)&&void 0!==a?a:0)};let c=e.target,r=c.value,u=r.substring(0,c.selectionStart),m=r.substring(c.selectionEnd,c.selectionEnd+r.length-1);n.ketchup.math.matchNumericValueWithOptions(u+e.key+m,s)||e.preventDefault()}}),o.trailingIcon?k:void 0,o.helperIcon&&o.error?e("div",{class:"mdc-error-icon"},e(i,Object.assign({},w))):o.helperIcon&&o.alert?e("div",{class:"mdc-alert-icon"},e(i,Object.assign({},w))):void 0,o.quantityButtons&&e("div",{class:"mdc-quantity-buttons"},e("button",{onClick:o.onMinusClick},h),e("button",{onClick:o.onPlusClick},b)),o.isClearable&&o.value?e("span",{class:`mdc-text-field__icon kup-icon ${t.CLEAR.replace("--","")}`,onClick:o.onClearIconClick}):void 0))}const s=function(e,l,t){let i=e;return i?"-"==i?"":n.ketchup.math.format(i,n.ketchup.math.createFormatPattern(l.group,l.decimal),t):i},c=()=>{o&&(o.remove(),o=null)},r=(e,l)=>{l&&0!==l.length&&(o?(o.innerText=l,u(o,e)):(o=document.createElement("div"),o.className="kup-helper-tooltip",o.innerText=l,document.body.appendChild(o),u(o,e)))},u=(e,l)=>{const t=10,i=window.innerWidth,n=window.innerHeight,o=e.getBoundingClientRect(),d=o.width,a=o.height;let s=l.clientX+t,c=l.clientY+t;s+d>i&&(s=l.clientX-d-t,s<0&&(s=i-d-t)),c+a>n&&(c=l.clientY-a-t,c<0&&(c=n-a-t)),s=Math.max(t,Math.min(s,i-d-t)),c=Math.max(t,Math.min(c,n-a-t)),e.style.left=`${s}px`,e.style.top=`${c}px`};export{d as F}
@@ -1 +1 @@
1
- import{r as t,c as i,f as n,h as e,H as l,d as s}from"./p-710d0a7d.js";import{F as o}from"./p-ff735e62.js";import{F as a,e as u}from"./p-aba69d8b.js";import{F as h,k as r,ad as c,g as p,s as f,b as d,ai as m,a7 as v,ao as b,al as _,an as k,am as x,ap as g,h as y,V as w}from"./p-54b56ca6.js";import{F as j}from"./p-7db300e0.js";import{F as O,a as $}from"./p-cec0955d.js";import{c as M}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-cc9db65d.js";import"./p-ef3112d4.js";import"./p-20d5e4b1.js";import"./p-fb74c97e.js";import"./p-c00bf8cb.js";import"./p-cabebabc.js";import"./p-c56195a0.js";var z,T,E,S,C;!function(t){t.TAB="tab"}(z||(z={})),function(t){t.customStyle="Custom style of the component.",t.data="Actual data of the input panel.",t.hiddenSubmitButton="Creates a hidden submit button in order to submit the form with enter.",t.submitCb="Sets the callback function on submit form",t.optionsHandler="Sets the callback function to recieve options",t.buttonPosition="Manage the position of the buttons related to the input panel content. It is an enumeration",t.inputPanelPosition="Manage the global layout of the input panel fields. The default is COLUMNS.",t.autoSkip="Sets the auto skip between input text fields when the value reaches the max length.",t.autoFocus="Sets whether the first input should receive focus.",t.fieldReset="Create e Reset button for the form"}(T||(T={})),function(t){t.COLUMNS="COLUMNS",t.INLINE="INLINE",t.STRETCHED="STRETCHED",t.UPINLINE="UPINLINE",t.UPCOLUMNS="UPCOLUMNS",t.PLACEHOLDER="PLACEHOLDER"}(E||(E={})),function(t){t.CENTER="CENTER",t.LEFT="LEFT",t.BOTTOM="BOTTOM",t.RIGHT="RIGHT",t.TOP="TOP"}(S||(S={})),function(t){t.BLUR="blur",t.ITEMCLICK="itemclick"}(C||(C={}));const W={blur:t=>t===h.CHECKBOX||t===h.SWITCH||t===h.COMBOBOX||t===h.AUTOCOMPLETE,itemclick:t=>t!==h.COMBOBOX&&t!==h.AUTOCOMPLETE},K=(t,i)=>0==t?3.75:t?1===t?11.25:7.5*t+(i?18:0)+4:null,L=t=>t?20*t:null,D=(t,i)=>t?t>(null==i?void 0:i.absoluteRow)?20*((null==i?void 0:i.absoluteRow)-1)+2*((null==i?void 0:i.absoluteRow)-1)+L(i.absoluteHeight)+20*(t-((null==i?void 0:i.absoluteRow)+(null==i?void 0:i.absoluteHeight)-1)-1):20*(t-1)+2*(t-1):null,I=t=>t?10*(t-1)*1.15:null;var N,R,F,P,H,A,V,J,U,B,G,q,X,Y,Q,Z,tt,it,nt,et,lt,st,ot,at,ut,ht,rt,ct,pt,ft,dt,mt,vt,bt,_t,kt,xt,gt,yt,wt,jt,Ot,$t,Mt,zt,Tt,Et,St,Ct,Wt,Kt,Lt,Dt,It,Nt,Rt,Ft,Pt,Ht,At,Vt,Jt,Ut,Bt,Gt,qt,Xt,Yt,Qt,Zt,ti,ii,ni,ei,li,si,oi,ai,ui=function(t,i,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(t):e?e.value:i.get(t)},hi=function(t,i,n,e,l){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!l:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?l.call(t,n):l?l.value=n:i.set(t,n),n};const ri=document.documentElement,ci=class{constructor(n){t(this,n),this.kupReady=i(this,"kup-input-panel-ready",6),this.kupDataTableContextMenu=i(this,"kup-inputpanel-contextmenu",6),this.kupInputPanelObjectFieldSearchPayload=i(this,"kup-inputpanel-objectfield-searchpayload",6),this.kupInputPanelObjectFieldOpenSearchMenu=i(this,"kup-inputpanel-objectfield-opensearchmenu",6),this.kupInputPanelObjectFieldSelectedMenuItem=i(this,"kup-inputpanel-objectfield-selectedmenuitem",6),this.kupCellUpload=i(this,"kup-inputpanel-upload",6),N.add(this),R.set(this,r()),F.set(this,void 0),P.set(this,new Map([["SmeupDataTree",ui(this,N,"m",Vt).bind(this)],["SmeupDataTable",ui(this,N,"m",Jt).bind(this)],["SmeupTreeNode",ui(this,N,"m",At).bind(this)],["SmeupTable",ui(this,N,"m",Jt).bind(this)]])),H.set(this,null),A.set(this,[]),V.set(this,new Map([[c.DATE,"kup-date-picker"],[c.TIME,"kup-time-picker"]])),J.set(this,new Map([[c.COMBOBOX,"kup-combobox"],[c.AUTOCOMPLETE,"kup-autocomplete"]])),U.set(this,new Map([[h.BUTTON_LIST,ui(this,N,"m",nt).bind(this)],[h.LABEL,ui(this,N,"m",st).bind(this)],[h.TABLE,ui(this,N,"m",lt).bind(this)]])),B.set(this,new Map([[z.TAB,ui(this,N,"m",pt).bind(this)]])),G.set(this,void 0),q.set(this,void 0),X.set(this,null),tt.set(this,(()=>{ui(this,X,"f")&&(ui(this,X,"f").remove(),hi(this,X,null,"f"))})),it.set(this,((t,i)=>{ui(this,X,"f")?(ui(this,X,"f").style.left=`${t.clientX+10}px`,ui(this,X,"f").style.top=`${t.clientY+10}px`,ui(this,X,"f").innerText=i):(hi(this,X,document.createElement("div"),"f"),ui(this,X,"f").className="input-panel__helper-tooltip",ui(this,X,"f").innerText=i,ui(this,X,"f").style.left=`${t.clientX+10}px`,ui(this,X,"f").style.top=`${t.clientY+10}px`,document.body.appendChild(ui(this,X,"f")))})),this.buttonPosition=S.BOTTOM,this.customStyle="",this.dashboardMode=!1,this.data=null,this.hiddenSubmitButton=!1,this.inputPanelPosition=E.COLUMNS,this.submitCb=null,this.optionsHandler=null,this.customButtonClickHandler=null,this.checkValidObjCallback=null,this.checkValidValueCallback=null,this.autoFocus=!1,this.autoSkip=!1,this.updateOnClick=!1,this.fieldReset=!1,this.inputPanelCells=[],this.inputPanelCommands=[],this.tabSelected=null}onDataChanged(){hi(this,H,structuredClone(this.data),"f"),ui(this,A,"f").length&&(ui(this,A,"f").map((({event:t,handler:i})=>{this.rootElement.removeEventListener(t,i)})),hi(this,A,[],"f")),this.data&&this.data.columns&&this.data.rows&&ui(this,N,"m",bt).call(this,this.data)}listenKeydown(t){if("Enter"===t.key){t.preventDefault(),t.stopPropagation();const i=this.rootElement.shadowRoot.activeElement;"enter"===t.key.toLowerCase()&&i&&(null==i||i.blur(),this.submitCb({value:{before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)}}))}}async waitForReady(){return ui(this,G,"f")}async getProps(t){return p(this,T,t)}async refresh(){n(this)}async setProps(t){f(this,T,t)}async update(t){ui(this,N,"m",ti).call(this,ui(this,N,"m",Y).call(this,t),t)}onFormReset(){var t;for(const i of this.data.columns){const n=ui(this,N,"m",Y).call(this,i.name);n.shape!==h.MULTI_AUTOCOMPLETE&&n.shape!==h.MULTI_COMBOBOX||!(null===(t=n.data)||void 0===t?void 0:t.data)||(n.data.data=[]),n.value="",n.obj.k="",n.decode="",n.data.initialValue&&(n.data.initialValue="")}this.refresh()}connectedCallback(){hi(this,G,new Promise((t=>{hi(this,q,t,"f")})),"f")}componentWillLoad(){ui(this,R,"f").debug.logLoad(this,!1),ui(this,R,"f").language.register(this),ui(this,R,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){ui(this,N,"m",ei).call(this),this.kupReady.emit({comp:this,id:this.rootElement.id}),ui(this,N,"m",li).call(this),ui(this,R,"f").debug.logLoad(this,!0)}componentWillRender(){ui(this,R,"f").debug.logRender(this,!1)}componentDidRender(){if(ui(this,F,"f")){const t=ui(this,F,"f").querySelectorAll(".f-text-field");for(let i=0;i<t.length;i++)j(t[i])}requestAnimationFrame((async()=>{ui(this,F,"f")&&ui(this,q,"f")&&(ui(this,q,"f").call(this),hi(this,q,null,"f"))})),ui(this,R,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[e("p",null,ui(this,R,"f").language.translate(d.EMPTY_DATA))]:this.inputPanelCells.map((t=>ui(this,N,"m",Q).call(this,t)));return e(l,{key:"ec7943a85421ff0ccc00a18050b9f5894c2d84c3","onKup-cell-blur":t=>ui(this,N,"m",Xt).call(this,t,C.BLUR),"onKup-cell-update":ui(this,N,"m",Yt).bind(this),"onKup-tabbar-click":t=>{this.tabSelected=t.detail.node.id},"onKup-autocomplete-input":ui(this,N,"m",Mt).bind(this),"onKup-autocomplete-iconclick":ui(this,N,"m",Mt).bind(this),"onKup-combobox-iconclick":t=>ui(this,N,"m",Mt).call(this,t,!0),"onKup-cell-itemclick":t=>{ui(this,N,"m",Xt).call(this,t,C.ITEMCLICK)},"onKup-objectfield-searchpayload":t=>{this.kupInputPanelObjectFieldSearchPayload.emit(t.detail)},"onKup-objectfield-opensearchmenu":t=>{this.kupInputPanelObjectFieldOpenSearchMenu.emit(t.detail)},"onKup-objectfield-selectedmenuitem":t=>{this.kupInputPanelObjectFieldSelectedMenuItem.emit(t.detail)},"onKup-file-upload-upload":ui(this,N,"m",ai).bind(this)},e("style",{key:"ee8521d828b20155522e8fb5a7180dcf3f64fd5d"},ui(this,R,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"32d128596494c44caa30665463ebe959128e2ce9",id:M},t))}disconnectedCallback(){ui(this,R,"f").language.unregister(this),ui(this,R,"f").theme.unregister(this)}get rootElement(){return s(this)}static get watchers(){return{data:["onDataChanged"]}}};R=new WeakMap,F=new WeakMap,P=new WeakMap,H=new WeakMap,A=new WeakMap,V=new WeakMap,J=new WeakMap,U=new WeakMap,B=new WeakMap,G=new WeakMap,q=new WeakMap,X=new WeakMap,tt=new WeakMap,it=new WeakMap,N=new WeakSet,Y=function(t){return t?this.inputPanelCells.reduce(((i,{cells:n})=>{if(!i){const i=n.find((({column:i})=>i.name===t));return i?i.cell:null}return i}),null):null},Q=function(t){var i,n,l;const s=t.row.layout,a=(null==s?void 0:s.horizontal)||!1,u={};let r;if(null===(i=null==s?void 0:s.sections)||void 0===i?void 0:i.length)if(s.absolute)r=ui(this,N,"m",ut).call(this,t,s),u.height=`${(t=>{var i,n;if(!t)return 0;const e=null!==(n=null===(i=t.sections.flatMap((t=>t.content)).find((t=>t.shape===h.TABLE)))||void 0===i?void 0:i.absoluteHeight)&&void 0!==n?n:null,l=Math.max(0,...t.sections.flatMap((t=>t.content.map((t=>t.absoluteRow+(t.absoluteHeight-1))))));return e?22*(l-e)+20*e:22*l})(s)}px`;else{if(!s.sectionsType){const i=s.sections.some((t=>t.dim));u.display="grid",this.inputPanelPosition!==E.INLINE&&this.inputPanelPosition!==E.UPINLINE||(u.display=""),s.horizontal?u.gridTemplateColumns=i?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${t.cells.length}, 1fr)`:this.dashboardMode&&(u.gridTemplateRows=i?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${s.sections.length}, 1fr)`)}r=ui(this,N,"m",at).call(this,t,s)}else r=t.cells.filter((({column:t})=>!1!==t.visible)).map((i=>ui(this,N,"m",Z).call(this,i.cell,t.row,i.column)));const c={"input-panel-form":!0,"input-panel-form--inline":this.buttonPosition==S.RIGHT},p={"input-panel":!0,"input-panel--column":!a,"input-panel--absolute":null==s?void 0:s.absolute,"input-panel--inline":this.inputPanelPosition===E.INLINE||this.inputPanelPosition===E.UPINLINE},f={"input-panel__commands":!0,[`input-panel__commands--${this.buttonPosition}`]:!0};return e("div",null,e("form",{name:this.rootElement.id,id:this.rootElement.id,class:c,ref:t=>hi(this,F,t,"f"),onSubmit:t=>{t.preventDefault(),this.submitCb({value:{before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)}})},onReset:t=>{t.preventDefault(),this.onFormReset()},onContextMenu:t=>{null!=ui(this,N,"m",ii).call(this,t)&&t.preventDefault()}},1==(null===(n=null==s?void 0:s.sections)||void 0===n?void 0:n.length)&&(null===(l=null==s?void 0:s.sections[0])||void 0===l?void 0:l.title)&&e("div",{class:"input-panel__typography"},e(O,{value:s.sections[0].title,type:$.HEADING1})),e("div",{class:p,style:u},r),e("div",{class:f},e(o,{buttonType:"submit",label:ui(this,R,"f").language.translate(d.CONFIRM),wrapperClass:"form__submit",invisible:this.hiddenSubmitButton}),this.fieldReset&&e(o,{buttonType:"reset",label:"Reset",wrapperClass:"form__submit",icon:"broom"}),this.inputPanelCommands)))},Z=function(t,i,n){var l,s;if(!t)return;const o=ui(this,U,"f").get(t.shape);if(void 0!==o)return o(t,n,null===(l=i.layout)||void 0===l?void 0:l.absolute);t.data=Object.assign(Object.assign({},t.data),{sizing:"extra-small",labelHelper:n.helper});const u=null===(s=t.data)||void 0===s?void 0:s.data;u&&(Object.keys(u).includes("kup-text-field")?u["kup-text-field"].labelHelper=n.helper:u["kup-text-field"]={labelHelper:n.helper});const h={cell:t,column:n,row:i,editable:!0,component:this,renderKup:!0,setSizes:!0},r=ui(this,N,"m",ot).call(this,t,n.title),c=e(a,Object.assign({},h));return r?e("div",{class:{"input-panel__label_container":!0}},r,c):c},nt=function(t,{name:i}){return e(o,Object.assign({icon:t.icon,placeholderIcon:t.placeholderIcon,id:i},t.data,{wrapperClass:"form__submit"}))},et=function(t,i){return e("kup-dropdown-button",Object.assign({},t.data,{label:t.value,data:i,"onkup-dropdownbutton-itemclick":t=>{ui(this,N,"m",ti).call(this,t.detail.node,t.detail.node.id)}}))},lt=function(t,{name:i}){for(const i of t.data.data.rows)for(const t of Object.keys(i.cells)){const n=i.cells[t];n.shape===h.AUTOCOMPLETE&&(n.data.displayMode="CodeOnly",n.data.selectMode="CodeOnly")}return e("kup-data-table",Object.assign({id:i,editableData:!0,showGroups:!0,showFilters:!0},t.data,{"onKup-autocomplete-iconclick":t=>{t.preventDefault(),t.stopPropagation()},"onKup-autocomplete-input":t=>{t.preventDefault(),t.stopPropagation()},"onKup-datatable-cell-iconclick":t=>{ui(this,N,"m",Mt).call(this,t),t.preventDefault(),t.stopPropagation()},"onKup-datatable-cell-input":t=>{"autocomplete"===t.detail.type&&ui(this,N,"m",Mt).call(this,t),t.preventDefault(),t.stopPropagation()},"onKup-cell-itemclick":t=>{ui(this,N,"m",qt).call(this,t),t.preventDefault(),t.stopPropagation()}}))},st=function(t,i,n){const l=ri.ketchup.objects.isNumber(t.obj),s=l||ri.ketchup.objects.isDate(t.obj)||ri.ketchup.objects.isTime(t.obj)||ri.ketchup.objects.isTimestamp(t.obj),o=["input-panel-label"];n&&o.push("input-panel-label--legacy-look"),l&&o.push("input-panel-label-number");const a=s?m(i,t):t.value;return e("span",{class:o.join(" "),id:i.name},e(u,{text:a}))},ot=function(t,i){return i&&ri.ketchup.data.cell.getType(t,t.shape)===c.RADIO?e("span",null,i):null},at=function(t,i){const n=ui(this,B,"f").get(i.sectionsType);return n?n(t,i.sections):i.sections.map((i=>ui(this,N,"m",ht).call(this,t,i,!1)))},ut=function(t,i){return i.sections.map((i=>ui(this,N,"m",rt).call(this,t,i)))},ht=function t(i,n,l=!1,s={}){var o,a;const u={"input-panel__section":!n.horizontal,"input-panel__horizontal-section":n.horizontal,"input-panel__section-inline":this.inputPanelPosition===E.INLINE||this.inputPanelPosition===E.UPINLINE};s.gap=+n.gap>0?`${n.gap}rem`:"1rem";let h=[];if(null===(o=n.sections)||void 0===o?void 0:o.length){h=n.sections.map((n=>ui(this,N,"m",t).call(this,i,n))).filter(Boolean);const e=n.sections.some((t=>t.dim));!n.gridCols&&n.horizontal&&(s.gridTemplateColumns=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`),n.gridRows||n.horizontal||!this.dashboardMode||(s.gridTemplateRows=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`)}else(null===(a=n.content)||void 0===a?void 0:a.length)&&(h=n.content.map((t=>ui(this,N,"m",dt).call(this,i,t))).filter(Boolean),s.gridTemplateColumns=+n.gridCols>0?`repeat(${n.gridCols}, 1fr)`:"",this.dashboardMode&&(s.gridTemplateRows=+n.gridRows>0?`repeat(${n.gridRows}, 1fr)`:""));const r=h.length?e("div",{class:u,style:s},h):void 0;return n.title&&!l?e("div",{class:{"input-panel__section_label_container":!0}},e(O,{type:$.HEADING1,value:n.title}),r):r},rt=function t(i,n){var l,s;let o=[];if(null===(l=n.sections)||void 0===l?void 0:l.length)o=n.sections.map((n=>ui(this,N,"m",t).call(this,i,n)));else if(null===(s=n.content)||void 0===s?void 0:s.length){const t=n.content.find((t=>t.shape===h.TABLE)),e=t?{absoluteRow:t.absoluteRow,absoluteHeight:t.absoluteHeight}:{};o=n.content.map((t=>ui(this,N,"m",mt).call(this,i,t,e)))}if(null==K(n.absoluteWidth))return o;const a=null!=K(n.absoluteWidth)?`${K(n.absoluteWidth)}px`:"100%",u=null!=L(n.absoluteHeight)?`${L(n.absoluteHeight)}px`:"100%",r=`${D(n.absoluteRow)}px`,c=`${I(n.absoluteColumn)}px`;return e("div",{style:{position:"relative",width:a,"min-width":a,"max-width":a,height:u,"min-height":u,"max-height":u,top:r,left:c,overflow:"auto"}},o)},ct=function t(i){var n,e;let l=[];return(null===(n=i.content)||void 0===n?void 0:n.length)&&i.content.forEach((t=>{t.id&&l.push(t.id)})),(null===(e=i.sections)||void 0===e?void 0:e.length)&&i.sections.forEach((i=>{l=l.concat(ui(this,N,"m",t).call(this,i))})),l},pt=function(t,i){this.tabSelected||(this.tabSelected=i[0].id||"0");const n=i.map(((i,n)=>{const e=ui(this,N,"m",ct).call(this,i),l=t.cells.some((t=>{var i;const n=t.cell;return e.includes(t.column.name)&&!!(null===(i=n.data)||void 0===i?void 0:i.error)}));return{active:(i.id||`${n}`)===this.tabSelected,value:i.title,icon:l?"error":i.icon,id:i.id||`${n}`,danger:l}})),l=i.map(((i,n)=>{const e=i.id||`${n}`;return ui(this,N,"m",ht).call(this,t,i,!0,{display:this.tabSelected!==e?"none":"grid"})}));return e("div",{class:{"input-panel__tabs_container":!0}},e("kup-tab-bar",{data:n,customStyle:".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }"}),l)},ft=function(t){return!t||!t.cell||!1===t.column.visible},dt=function(t,i){const n=t.cells.find((t=>t.column.name===i.id));if(ui(this,N,"m",ft).call(this,n))return;const l=+i.colSpan>0?i.colSpan:+i.colSpan>0||+i.colStart>0?null:1,s=+i.rowSpan>0?i.rowSpan:+i.rowSpan>0||+i.rowStart>0?null:1;return e("div",{style:{"min-width":"0","grid-column-start":l?`span ${l}`:`${i.colStart}`,"grid-column-end":+i.colEnd>0?`${i.colEnd}`:"","grid-row-start":s?`span ${s}`:`${i.rowStart}`,"grid-row-end":+i.rowEnd>0?`${i.rowEnd}`:""}},ui(this,N,"m",Z).call(this,n.cell,t.row,n.column))},mt=function(t,i,n){const l=t.cells.find((t=>t.column.name===i.id));if(ui(this,N,"m",ft).call(this,l))return;let s;s=l.cell.shape==h.DATE?i.absoluteLength>8?i.absoluteLength:8:i.absoluteLength,i.absoluteHeight||(i.absoluteHeight=1);const o=l.cell.shape===h.LABEL?(t=>0==t?3.75:t?1===t?11.25:7.5*t:null)(s):K(s,(a=l.cell.shape)===h.AUTOCOMPLETE||a===h.COMBOBOX||a===h.DATE);var a;const u=L(i.absoluteHeight),r=D(i.absoluteRow,n),c=I(i.absoluteColumn),p={position:"absolute",width:null!=o?`${o}px`:null,"min-width":null!=o?`${o}px`:null,"max-width":null!=o?`${o}px`:null,height:null!=u?`${u}px`:null,"min-height":null!=u?`${u}px`:null,"max-height":null!=u?`${u}px`:null,top:null!=r?`${r}px`:null,left:null!=c?`${c}px`:null,overflow:"hidden"};return l.cell.data=Object.assign(Object.assign(Object.assign({},l.cell.data),{customStyle:(l.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}",legacyLook:!0,helperEnabled:!1}),l.cell.shape===h.TABLE&&{rowsPerPage:l.cell.data.data.rows.length,showPaginator:!1,showFooter:!1,tableHeight:`${u}px`}),e("div",{style:p},ui(this,N,"m",Z).call(this,l.cell,t.row,l.column))},vt=function(){this.inputPanelCommands=this.data.setup.commands.map((t=>{if((null==t?void 0:t.children)&&(null==t?void 0:t.children.length)>0){const i={"kup-list":{showIcons:!0,data:t.children.map((t=>ui(this,N,"m",Ut).call(this,t)))}};return ui(this,N,"m",et).call(this,t,i)}{const i=ui(this,N,"m",Ut).call(this,t);return ui(this,N,"m",nt).call(this,i,{name:t.value,title:t.value})}})).flat()},bt=function(t){var i,n,e,l;const s=null===(i=null==t?void 0:t.rows[0])||void 0===i?void 0:i.layout,o=(null===(n=null==t?void 0:t.rows)||void 0===n?void 0:n.length)?t.rows.reduce(((i,n)=>[...i,{cells:t.columns.map((t=>{const i=structuredClone(n.cells[t.name]);return{column:t,cell:i?Object.assign(Object.assign({},i),{data:ui(this,N,"m",_t).call(this,i,t,s),slotData:ui(this,N,"m",yt).call(this,i,t),isEditable:!0}):null}})),row:n}]),[]):[];o.map((({cells:t})=>t.map((({cell:t,column:i})=>{var n;const e=ri.ketchup.data.cell.getType(t,t.shape),l=ui(this,V,"f").get(e),s=ui(this,J,"f").get(e);if(!l&&!s)return;const o=(null!=l?l:s)+`[id='${i.name.replace(/\//g,"\\$1")}']`,a=this.rootElement.shadowRoot.querySelector(o);s?null==a||a.reset():null===(n=null==a?void 0:a.setValue)||void 0===n||n.call(a,t.value)})))),this.inputPanelCells=o,(null===(l=null===(e=t.setup)||void 0===e?void 0:e.commands)||void 0===l?void 0:l.length)&&ui(this,N,"m",vt).call(this)},_t=function(t,i,n){const e=Object.assign(Object.assign({},ui(this,N,"m",gt).call(this,t,i,n)),{disabled:!t.isEditable||i.useAs===v.KEY,id:i.name}),l=ri.ketchup.data.cell.getType(t,t.shape),s=function(t,i){var n={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(n[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(e=Object.getOwnPropertySymbols(t);l<e.length;l++)i.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(n[e[l]]=t[e[l]])}return n}(t.data||{},["data"]);return l!==c.MULTI_AUTOCOMPLETE&&l!==c.MULTI_COMBOBOX?ui(this,N,"m",kt).call(this,e,Object.assign({},t.data)):Object.assign(Object.assign({},e),s)},kt=function t(i,n){for(const e in n)i[e]=n[e]instanceof Object&&!Array.isArray(n[e])&&e in i?ui(this,N,"m",t).call(this,i[e],n[e]):n[e];return i},xt=function(){return this.inputPanelCells.reduce(((t,i)=>{const n=Object.keys(i.row.cells).reduce(((t,n)=>{var e;const l=null===(e=i.cells.find((t=>t.column.name===n)))||void 0===e?void 0:e.cell;let s=null==l?void 0:l.value;return(null==l?void 0:l.shape)===h.TABLE&&(s=JSON.stringify(ui(this,N,"m",Pt).call(this,l.data.data,n))),Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},i.row.cells[n]),{value:s,obj:null==l?void 0:l.obj})})}),{});return{columns:[...t.columns,...i.cells.map((t=>t.column))],rows:[...t.rows,{cells:n,layout:i.row.layout}]}}),{columns:[],rows:[]})},gt=function(t,i,n){if(!t)return null;const e=t.options;let l;l=(null==n?void 0:n.absolute)?null:i.title;const s=t.value,o=ri.ketchup.data.cell.getType(t,t.shape),a=new Map([[c.AUTOCOMPLETE,ui(this,N,"m",$t).bind(this)],[c.BUTTON_LIST,ui(this,N,"m",Ot).bind(this)],[c.CHART,ui(this,N,"m",jt).bind(this)],[c.CHIP,ui(this,N,"m",wt).bind(this)],[c.CHECKBOX,ui(this,N,"m",Tt).bind(this)],[c.COLOR_PICKER,ui(this,N,"m",Et).bind(this)],[c.COMBOBOX,ui(this,N,"m",$t).bind(this)],[c.EDITOR,ui(this,N,"m",St).bind(this)],[c.MULTI_AUTOCOMPLETE,ui(this,N,"m",wt).bind(this)],[c.MULTI_COMBOBOX,ui(this,N,"m",wt).bind(this)],[c.NUMBER,ui(this,N,"m",Rt).bind(this)],[c.DATE,ui(this,N,"m",Lt).bind(this)],[c.OBJECT,ui(this,N,"m",Dt).bind(this)],[c.RADIO,ui(this,N,"m",Wt).bind(this)],[c.STRING,ui(this,N,"m",Ct).bind(this)],[c.SWITCH,ui(this,N,"m",Kt).bind(this)],[c.TABLE,ui(this,N,"m",Ft).bind(this)],[c.TIME,ui(this,N,"m",Nt).bind(this)],[c.IMAGE_LIST,ui(this,N,"m",It).bind(this)]]).get(o);return a?a(e,l,s,t,i.name,n):null},yt=function(t,i){var n;const e=ri.ketchup.data.cell.getType(t,t.shape);if(e===c.CHIP)return{trailingIcon:!0,label:i.title,disabled:!t.isEditable,id:i.name,fullWidth:!1};if(e===c.MULTI_AUTOCOMPLETE||e===c.MULTI_COMBOBOX){const e=Object.assign(Object.assign({},ui(this,N,"m",$t).call(this,t.options,i.title,null,t)),{showDropDownIcon:!0,class:"",style:{width:"100%"},disabled:!t.isEditable,id:i.name});return(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n["kup-text-field"])&&(e.data["kup-text-field"].labelHelper=i.helper),e}return null},wt=function(t,i,n,e){return b(n,e.decode)},jt=function(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},Ot=function(t,i,n,e,l){var s,o;if(e.data=e.data||{},e.data.onClick=()=>{ui(this,N,"m",ti).call(this,e,l)},e.data.BtnMap){const t=null===(o=null===(s=this.data.setup)||void 0===s?void 0:s.commands)||void 0===o?void 0:o.find((t=>t.obj.k===e.data.BtnMap));t&&(e.isEditable=!0,e.data.onClick=()=>{ui(this,N,"m",ti).call(this,e,t.obj.k)},this.data.setup.commands=this.data.setup.commands.filter((i=>i.obj.k!==t.obj.k)))}return Object.assign({label:e.value,fun:e.fun},e.data)},$t=function(t,i,n,e){const l=_(n,i,[],e.data);return t&&(l.data["kup-list"].data=ui(this,N,"m",Ht).call(this,t,n)),l},Mt=function({detail:t},i=!1){if(ui(this,N,"m",zt).call(this,t))ui(this,N,"m",Gt).call(this,t);else{const n=ui(this,N,"m",Y).call(this,t.id);let e=!0;i&&(e=!t.comp.data["kup-list"].data.length),n.fun&&e&&ui(this,N,"m",Bt).call(this,t,n)}},zt=function(t){return!!t.cell},Tt=function(t,i,n){return k(n,i)},Et=function(t,i){return{data:{"kup-text-field":{label:i}}}},St=function(t,i,n){return{initialValue:n}},Ct=function(t,i,n,e,l){var s;const o=Object.assign({label:i},e.data);return this.autoSkip&&e.isEditable&&(null===(s=e.data)||void 0===s?void 0:s.maxLength)&&(o.onInput=t=>{ui(this,N,"m",oi).call(this,l,t)}),o},Wt=function(t,i,n,e){const l=(()=>{var t;if(e.data.data)return null===(t=e.data.data.rows)||void 0===t?void 0:t.map((t=>{const i=t.fields||t.cells,[e,l]=Object.keys(i);return{id:i[e].value,label:l?i[l].value:i[e].value,selected:n===i[e].value}}))})(),s=x(n,l);return l?s:e.data},Kt=function(t,i,n){return g(n,i)},Lt=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:null!=n?n:""}},Dt=function(t,i,n){return{initialValue:n||"",label:i||" ",value:n||""}},It=function(t,i,n){return{initialValue:n||"",leadingLabel:i||"",value:n||""}},Nt=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:n}},Rt=function(t,i){return{label:i}},Ft=function(t,i,n,e,l,s){try{let t=JSON.parse(e.value);return t?"SmeupDataTable"!==t.type?(ui(this,R,"f").debug.logMessage(this,`Wrong data table type for ${l} cell. Type \`SmeupDataTable\` in value expected`,y.ERROR),null):{data:{columns:t.columns.map((i=>{var n;if(t.rows.length>0){const e=null===(n=t.rows[0].cells[i.name])||void 0===n?void 0:n.obj;return!i.obj&&e?Object.assign(Object.assign({},i),{obj:{t:e.t,p:e.p}}):i}return i})),rows:t.rows.map((i=>Object.assign(Object.assign({},i),{cells:Object.keys(i.cells).reduce(((n,e)=>{const l=t.columns.find((t=>t.name===e));return Object.assign(Object.assign({},n),{[e]:Object.assign(Object.assign({},i.cells[e]),{data:Object.assign(Object.assign(Object.assign({},ui(this,N,"m",gt).call(this,i.cells[e],l,s)),{disabled:!1===i.cells[e].editable,id:l.id}),i.cells[e].data)})})}),{})})))}}:(ui(this,R,"f").debug.logMessage(this,`Empty value for ${l} cell.`,y.WARNING),null)}catch(t){return ui(this,R,"f").debug.logMessage(this,`Invalid value for ${l} cell. Type \`SmeupDataTable\` expected`,y.ERROR),null}},Pt=function(t,i){const n=Object.assign(Object.assign({},t),{rows:t.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))}),e=t.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!e.length)return n;try{const l=JSON.parse(ui(this,H,"f").rows[0].cells[i].value);return n.rows=t.rows.map(((t,i)=>e.reduce(((n,e)=>{const s=l.rows[i].cells[e]&&t.cells[e].value!==l.rows[i].cells[e].value;return Object.assign(Object.assign({},l.rows[i]),s?{cells:Object.assign(Object.assign({},n.cells),{[e]:Object.assign(Object.assign({},l.rows[i].cells[e]),{value:t.cells[e].value})})}:{cells:n.cells})}),Object.assign(Object.assign({},l.rows[i]),{cells:{}})))),n}catch(t){return n}},Ht=function(t,i){const n=ui(this,P,"f").get(t.type);return n?n(t,i):t.map((t=>({value:t.label,id:t.id,selected:i===t.id})))},At=function t(i,n){return i.children.map((i=>{var e;return{id:i.content.codice,value:i.content.testo,selected:n===i.content.codice,children:(null===(e=i.children)||void 0===e?void 0:e.length)?ui(this,N,"m",t).call(this,i,n):[]}}))},Vt=function t(i,n){return i.children.map((i=>{var e;return{id:i.obj.k,value:i.value,selected:n===i.obj.k,children:(null===(e=i.children)||void 0===e?void 0:e.length)?ui(this,N,"m",t).call(this,i,n):[]}}))},Jt=function(t,i){return t.rows.map((t=>{const n=t.fields||t.cells,[e,l]=Object.keys(n);return{id:n[e].value,value:l?n[l].value:n[e].value,selected:i===n[e].value}}))},Ut=function(t){return Object.assign(Object.assign({},t),{data:ui(this,N,"m",Ot).call(this,null,null,t.value,t,t.obj.k),id:t.obj.k})},Bt=function(t,i){this.optionsHandler(i.fun,t.inputValue,ui(this,N,"m",xt).call(this),t.id).then((n=>{var e,l,s,o,a,u;const r=(null===(e=null==n?void 0:n.columns)||void 0===e?void 0:e.filter((t=>!1!==(null==t?void 0:t.visible))).map((t=>t.name)))||[],c=null===(l=null==n?void 0:n.rows)||void 0===l?void 0:l.map((t=>{const{cells:i}=t,n=r.reduce(((n,e)=>(t.cells.hasOwnProperty(e)&&(n[e]=i[e]),n)),{});return Object.assign(Object.assign({},t),{cells:n})})),p=Object.assign(Object.assign({},n),{rows:c}),f=i.shape===h.MULTI_AUTOCOMPLETE?i.slotData.data["kup-list"]:null===(o=null===(s=i.data)||void 0===s?void 0:s.data)||void 0===o?void 0:o["kup-list"];f?(f.data=(null==c?void 0:c.length)&&null!==(a=ui(this,N,"m",Ht).call(this,p,i.value))&&void 0!==a?a:[],f.options=null!==(u=n.columns)&&void 0!==u?u:[]):ui(this,R,"f").debug.logMessage(this,'getAutocompleteEventCallback() - "kup-list" not found in cell.data.data',y.WARNING),t.comp.refresh()}))},Gt=function(t){const{cell:i,row:n,column:e,comp:l,id:s,event:o}=t,a=null==i?void 0:i.value,u=t.event.detail;try{this.optionsHandler(i.fun,u.inputValue,{columns:l.data.columns,rows:[n]},e.name).then((t=>{var i,u,h,r,c,p,f;if(t){const d=(null!==(i=null==t?void 0:t.columns)&&void 0!==i?i:[]).filter((t=>!1!==(null==t?void 0:t.visible))).map((t=>t.name)),m=null!==(h=null===(u=null==t?void 0:t.rows)||void 0===u?void 0:u.map((t=>{const i=d.reduce(((i,n)=>(t.cells[n]&&(i[n]=t.cells[n]),i)),{});return Object.assign(Object.assign({},t),{cells:i})})))&&void 0!==h?h:[],v=Object.assign(Object.assign({},t),{rows:m}),b=l.data,_=b.rows[n.id].cells[e.name];(null===(c=null===(r=_.data)||void 0===r?void 0:r.data)||void 0===c?void 0:c["kup-list"])||(_.data={data:{"kup-list":{},"kup-text-field":Object.assign({},_.data)}});const k=_.data.data["kup-list"];k.data=m.length&&null!==(p=ui(this,N,"m",Ht).call(this,v,a))&&void 0!==p?p:[],k.options=null!==(f=t.columns)&&void 0!==f?f:[],l.data=b,this.data.rows[0].cells[s].value=JSON.stringify(b),o.detail.comp.refresh(),l.refresh()}}))}catch(t){console.error("Error in autocomplete callback:",t)}},qt=function(t){const{cell:i,row:n,column:e,id:l,comp:s}=t.detail,o=s.data;o.rows[n.id].cells[e.name]=i,s.data=o,this.data.rows[0].cells[l].value=JSON.stringify(o),t.detail.event.detail.comp.refresh(),s.refresh()},Xt=async function(t,i){var n,e,l,s,o;const{detail:{column:a,cell:u}}=t;if(W[i](null==u?void 0:u.shape))return;const h=ui(this,N,"m",Y).call(this,a.name),r=ui(this,H,"f").rows[0].cells[a.name];if(h){if(u.mandatory){if(ui(this,N,"m",Qt).call(this,a.name,h.value?(null===(n=r.data)||void 0===n?void 0:n.error)||null:ui(this,R,"f").language.translate(d.REQUIRED_VALUE)),!u.value)return}else ui(this,N,"m",Qt).call(this,a.name,(null===(e=r.data)||void 0===e?void 0:e.error)||null);if(null===(l=u.inputSettings)||void 0===l?void 0:l.checkObject){const{valid:t}=await this.checkValidObjCallback({obj:u.obj,currentState:ui(this,N,"m",xt).call(this),fun:u.fun});if(!t)return void ui(this,N,"m",Qt).call(this,a.name,ui(this,R,"f").language.translate(d.INVALID_VALUE));ui(this,N,"m",Qt).call(this,a.name,(null===(s=r.data)||void 0===s?void 0:s.error)||null)}(null===(o=u.inputSettings)||void 0===o?void 0:o.checkValueOnExit)&&ui(this,N,"m",Zt).call(this)&&this.checkValidValueCallback({before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)},a.name)}},Yt=function({detail:{cell:t,column:i}}){var n;t.shape!==h.CHECKBOX&&t.shape!==h.SWITCH||(this.updateOnClick?this.submitCb({value:{before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)},cell:i.name}):(null===(n=t.inputSettings)||void 0===n?void 0:n.checkValueOnExit)&&this.checkValidValueCallback({before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)},i.name))},Qt=function(t,i){this.inputPanelCells=this.inputPanelCells.map((n=>Object.assign(Object.assign({},n),{cells:n.cells.map((({cell:n,column:e})=>{const l=e.name===t?Object.assign(Object.assign({},n.data),{error:i}):n.data;return{column:e,cell:Object.assign(Object.assign({},n),{data:l})}}))})))},Zt=function(){return this.inputPanelCells.some((({cells:t,row:i})=>t.some((({cell:t,column:{name:n}})=>t.value!==i.cells[n].value))))},ti=function(t,i){(null==t?void 0:t.fun)?this.customButtonClickHandler({fun:t.fun,cellId:i,currentState:ui(this,N,"m",xt).call(this)}):this.submitCb({value:{before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)},cell:i})},ii=function(t){return ui(this,R,"f").getEventPath(t.target,this.rootElement).find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains("f-cell")}))},ni=function(t){const i=ui(this,N,"m",ii).call(this,t);if(null==i)return;const n=ui(this,N,"m",xt).call(this),e=i["kup-get-cell-props"]().column.name;return{anchor:i,cell:n.rows[0].cells[e],column:n.columns.find((t=>t.name==e)),row:n.rows[0],originalEvent:t}},ei=function(){ui(this,R,"f").interact.managedElements.add(ui(this,F,"f")),ui(this,R,"f").interact.on(ui(this,F,"f"),w.TAP,(t=>{if(2==t.button){const i=ui(this,N,"m",ni).call(this,t);i&&this.kupDataTableContextMenu.emit({comp:this,id:this.rootElement.id,details:i})}}))},li=function(){if(!ui(this,F,"f"))return;const t=Array.from(ui(this,F,"f").querySelectorAll(".f-cell__content"));for(const i of t){const t=ui(this,N,"m",si).call(this,i,!0);if(t)return void setTimeout((()=>t.focus()),300)}if(!this.autoFocus||0===t.length)return;const i=ui(this,N,"m",si).call(this,t[0]);i&&setTimeout((()=>i.focus()),300)},si=function(t,i=!1){if(!(t&&t instanceof HTMLElement))return;const n=".mdc-text-field__input",e=i?`.mdc-text-field--error ${n}`:n,l=t.querySelector(e);if(l)return l;const s=Array.from(t.querySelectorAll("*")).filter((t=>t.shadowRoot));for(const t of s){const i=t.shadowRoot.querySelector(e);if(i)return i}},oi=function(t,i){var n,e;const l=null==i?void 0:i.target;if(!(l&&l instanceof HTMLInputElement))return;const{maxLength:s,value:o}=l;if(!s||s<0||(null==o?void 0:o.length)<s)return;const a=Array.from(null===(n=ui(this,F,"f"))||void 0===n?void 0:n.querySelectorAll(".f-text-field")).reduce(((t,i)=>{const n=i.querySelector("input");return n?(t.push({id:(null==i?void 0:i.id)||"",HTMLInputElement:n}),t):t}),[]);if(!a.length)return;const u=a.findIndex((i=>i.id===t));u<0||u===a.length-1||null===(e=a[u+1].HTMLInputElement)||void 0===e||e.focus()},ai=function(t){t.stopPropagation(),this.kupCellUpload.emit(t.detail)},ci.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup-fcell-width:fit-content;--kup_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_textfield_textarea_height_input_panel:var(\n --kup-textfield-textarea-height-input_panel,\n 200px\n );--kup_textfield_textarea_width_input_panel:var(\n --kup-textfield-textarea-width-input_panel,\n 300px\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0);--kup_input_panel_padding--inline:var(\n --kup-input-panel-padding--inline,\n 1em 0\n );--kup_input_panel_absolute_max_height:var(\n --kup-input-panel-absolute-max-height,\n \n 716px\n )}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:8px}:host .input-panel__commands{display:flex;gap:1rem}:host .input-panel__commands.input-panel__commands--right{flex-shrink:0;overflow:hidden}:host .input-panel--inline{flex:1;overflow-x:auto;white-space:nowrap;padding:var(--kup_input_panel_padding--inline);display:inline-flex;align-items:flex-end}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid;min-width:0}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel .f-text-field .mdc-text-field.mdc-text-field--textarea{min-height:var(--kup_textfield_textarea_height_input_panel) !important;min-width:var(--kup_textfield_textarea_width_input_panel) !important}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel__section-inline{display:inline-block;width:max-content}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel .input-panel-label--legacy-look{font-size:12px;font-family:var(--kup-font-family-monospace);white-space:pre;overflow:hidden}:host .input-panel--absolute{justify-content:flex-end;padding:var(--kup-space-02);max-height:var(--kup_input_panel_absolute_max_height);--kup-textfield-extrasmall-height:20px;--kup-textfield-extrasmall-padding:0 var(--kup-space-01)}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .input-panel-label.input-panel-label-number{justify-content:end}:host .input-panel--absolute .mdc-text-field{height:unset !important}:host .input-panel-form--inline{display:flex;align-items:end;gap:1rem}:host .input-panel__helper-icon{cursor:help;height:16px;opacity:0.375;position:absolute;right:-18px;top:-2px;width:16px}";export{ci as kup_input_panel}
1
+ import{r as t,c as i,f as n,h as e,H as l,d as s}from"./p-710d0a7d.js";import{F as o}from"./p-ff735e62.js";import{F as a,e as u}from"./p-87559acf.js";import{F as h,k as r,ad as c,g as p,s as f,b as d,ai as m,a7 as v,ao as b,al as _,an as k,am as x,ap as g,h as y,V as w}from"./p-03d049e3.js";import{F as j}from"./p-7db300e0.js";import{F as O,a as $}from"./p-cec0955d.js";import{c as M}from"./p-635bb4b3.js";import"./p-e3062c19.js";import"./p-cc9db65d.js";import"./p-ef3112d4.js";import"./p-95346c81.js";import"./p-cf5e1d07.js";import"./p-da5d5eea.js";import"./p-cabebabc.js";import"./p-c56195a0.js";var z,T,E,S,C;!function(t){t.TAB="tab"}(z||(z={})),function(t){t.customStyle="Custom style of the component.",t.data="Actual data of the input panel.",t.hiddenSubmitButton="Creates a hidden submit button in order to submit the form with enter.",t.submitCb="Sets the callback function on submit form",t.optionsHandler="Sets the callback function to recieve options",t.buttonPosition="Manage the position of the buttons related to the input panel content. It is an enumeration",t.inputPanelPosition="Manage the global layout of the input panel fields. The default is COLUMNS.",t.autoSkip="Sets the auto skip between input text fields when the value reaches the max length.",t.autoFocus="Sets whether the first input should receive focus.",t.fieldReset="Create e Reset button for the form"}(T||(T={})),function(t){t.COLUMNS="COLUMNS",t.INLINE="INLINE",t.STRETCHED="STRETCHED",t.UPINLINE="UPINLINE",t.UPCOLUMNS="UPCOLUMNS",t.PLACEHOLDER="PLACEHOLDER"}(E||(E={})),function(t){t.CENTER="CENTER",t.LEFT="LEFT",t.BOTTOM="BOTTOM",t.RIGHT="RIGHT",t.TOP="TOP"}(S||(S={})),function(t){t.BLUR="blur",t.ITEMCLICK="itemclick"}(C||(C={}));const W={blur:t=>t===h.CHECKBOX||t===h.SWITCH||t===h.COMBOBOX||t===h.AUTOCOMPLETE,itemclick:t=>t!==h.COMBOBOX&&t!==h.AUTOCOMPLETE},K=(t,i)=>0==t?3.75:t?1===t?11.25:7.5*t+(i?18:0)+4:null,L=t=>t?20*t:null,D=(t,i)=>t?t>(null==i?void 0:i.absoluteRow)?20*((null==i?void 0:i.absoluteRow)-1)+2*((null==i?void 0:i.absoluteRow)-1)+L(i.absoluteHeight)+20*(t-((null==i?void 0:i.absoluteRow)+(null==i?void 0:i.absoluteHeight)-1)-1):20*(t-1)+2*(t-1):null,I=t=>t?10*(t-1)*1.15:null;var N,R,F,P,H,A,V,J,U,B,G,q,X,Y,Q,Z,tt,it,nt,et,lt,st,ot,at,ut,ht,rt,ct,pt,ft,dt,mt,vt,bt,_t,kt,xt,gt,yt,wt,jt,Ot,$t,Mt,zt,Tt,Et,St,Ct,Wt,Kt,Lt,Dt,It,Nt,Rt,Ft,Pt,Ht,At,Vt,Jt,Ut,Bt,Gt,qt,Xt,Yt,Qt,Zt,ti,ii,ni,ei,li,si,oi,ai,ui=function(t,i,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(t):e?e.value:i.get(t)},hi=function(t,i,n,e,l){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?t!==i||!l:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?l.call(t,n):l?l.value=n:i.set(t,n),n};const ri=document.documentElement,ci=class{constructor(n){t(this,n),this.kupReady=i(this,"kup-input-panel-ready",6),this.kupDataTableContextMenu=i(this,"kup-inputpanel-contextmenu",6),this.kupInputPanelObjectFieldSearchPayload=i(this,"kup-inputpanel-objectfield-searchpayload",6),this.kupInputPanelObjectFieldOpenSearchMenu=i(this,"kup-inputpanel-objectfield-opensearchmenu",6),this.kupInputPanelObjectFieldSelectedMenuItem=i(this,"kup-inputpanel-objectfield-selectedmenuitem",6),this.kupCellUpload=i(this,"kup-inputpanel-upload",6),N.add(this),R.set(this,r()),F.set(this,void 0),P.set(this,new Map([["SmeupDataTree",ui(this,N,"m",Vt).bind(this)],["SmeupDataTable",ui(this,N,"m",Jt).bind(this)],["SmeupTreeNode",ui(this,N,"m",At).bind(this)],["SmeupTable",ui(this,N,"m",Jt).bind(this)]])),H.set(this,null),A.set(this,[]),V.set(this,new Map([[c.DATE,"kup-date-picker"],[c.TIME,"kup-time-picker"]])),J.set(this,new Map([[c.COMBOBOX,"kup-combobox"],[c.AUTOCOMPLETE,"kup-autocomplete"]])),U.set(this,new Map([[h.BUTTON_LIST,ui(this,N,"m",nt).bind(this)],[h.LABEL,ui(this,N,"m",st).bind(this)],[h.TABLE,ui(this,N,"m",lt).bind(this)]])),B.set(this,new Map([[z.TAB,ui(this,N,"m",pt).bind(this)]])),G.set(this,void 0),q.set(this,void 0),X.set(this,null),tt.set(this,(()=>{ui(this,X,"f")&&(ui(this,X,"f").remove(),hi(this,X,null,"f"))})),it.set(this,((t,i)=>{ui(this,X,"f")?(ui(this,X,"f").style.left=`${t.clientX+10}px`,ui(this,X,"f").style.top=`${t.clientY+10}px`,ui(this,X,"f").innerText=i):(hi(this,X,document.createElement("div"),"f"),ui(this,X,"f").className="input-panel__helper-tooltip",ui(this,X,"f").innerText=i,ui(this,X,"f").style.left=`${t.clientX+10}px`,ui(this,X,"f").style.top=`${t.clientY+10}px`,document.body.appendChild(ui(this,X,"f")))})),this.buttonPosition=S.BOTTOM,this.customStyle="",this.dashboardMode=!1,this.data=null,this.hiddenSubmitButton=!1,this.inputPanelPosition=E.COLUMNS,this.submitCb=null,this.optionsHandler=null,this.customButtonClickHandler=null,this.checkValidObjCallback=null,this.checkValidValueCallback=null,this.autoFocus=!1,this.autoSkip=!1,this.updateOnClick=!1,this.fieldReset=!1,this.inputPanelCells=[],this.inputPanelCommands=[],this.tabSelected=null}onDataChanged(){hi(this,H,structuredClone(this.data),"f"),ui(this,A,"f").length&&(ui(this,A,"f").map((({event:t,handler:i})=>{this.rootElement.removeEventListener(t,i)})),hi(this,A,[],"f")),this.data&&this.data.columns&&this.data.rows&&ui(this,N,"m",bt).call(this,this.data)}listenKeydown(t){if("Enter"===t.key){t.preventDefault(),t.stopPropagation();const i=this.rootElement.shadowRoot.activeElement;"enter"===t.key.toLowerCase()&&i&&(null==i||i.blur(),this.submitCb({value:{before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)}}))}}async waitForReady(){return ui(this,G,"f")}async getProps(t){return p(this,T,t)}async refresh(){n(this)}async setProps(t){f(this,T,t)}async update(t){ui(this,N,"m",ti).call(this,ui(this,N,"m",Y).call(this,t),t)}onFormReset(){var t;for(const i of this.data.columns){const n=ui(this,N,"m",Y).call(this,i.name);n.shape!==h.MULTI_AUTOCOMPLETE&&n.shape!==h.MULTI_COMBOBOX||!(null===(t=n.data)||void 0===t?void 0:t.data)||(n.data.data=[]),n.value="",n.obj.k="",n.decode="",n.data.initialValue&&(n.data.initialValue="")}this.refresh()}connectedCallback(){hi(this,G,new Promise((t=>{hi(this,q,t,"f")})),"f")}componentWillLoad(){ui(this,R,"f").debug.logLoad(this,!1),ui(this,R,"f").language.register(this),ui(this,R,"f").theme.register(this),this.onDataChanged()}componentDidLoad(){ui(this,N,"m",ei).call(this),this.kupReady.emit({comp:this,id:this.rootElement.id}),ui(this,N,"m",li).call(this),ui(this,R,"f").debug.logLoad(this,!0)}componentWillRender(){ui(this,R,"f").debug.logRender(this,!1)}componentDidRender(){if(ui(this,F,"f")){const t=ui(this,F,"f").querySelectorAll(".f-text-field");for(let i=0;i<t.length;i++)j(t[i])}requestAnimationFrame((async()=>{ui(this,F,"f")&&ui(this,q,"f")&&(ui(this,q,"f").call(this),hi(this,q,null,"f"))})),ui(this,R,"f").debug.logRender(this,!0)}render(){const t=Boolean(!this.inputPanelCells.length)?[e("p",null,ui(this,R,"f").language.translate(d.EMPTY_DATA))]:this.inputPanelCells.map((t=>ui(this,N,"m",Q).call(this,t)));return e(l,{key:"ec7943a85421ff0ccc00a18050b9f5894c2d84c3","onKup-cell-blur":t=>ui(this,N,"m",Xt).call(this,t,C.BLUR),"onKup-cell-update":ui(this,N,"m",Yt).bind(this),"onKup-tabbar-click":t=>{this.tabSelected=t.detail.node.id},"onKup-autocomplete-input":ui(this,N,"m",Mt).bind(this),"onKup-autocomplete-iconclick":ui(this,N,"m",Mt).bind(this),"onKup-combobox-iconclick":t=>ui(this,N,"m",Mt).call(this,t,!0),"onKup-cell-itemclick":t=>{ui(this,N,"m",Xt).call(this,t,C.ITEMCLICK)},"onKup-objectfield-searchpayload":t=>{this.kupInputPanelObjectFieldSearchPayload.emit(t.detail)},"onKup-objectfield-opensearchmenu":t=>{this.kupInputPanelObjectFieldOpenSearchMenu.emit(t.detail)},"onKup-objectfield-selectedmenuitem":t=>{this.kupInputPanelObjectFieldSelectedMenuItem.emit(t.detail)},"onKup-file-upload-upload":ui(this,N,"m",ai).bind(this)},e("style",{key:"ee8521d828b20155522e8fb5a7180dcf3f64fd5d"},ui(this,R,"f").theme.setKupStyle(this.rootElement)),e("div",{key:"32d128596494c44caa30665463ebe959128e2ce9",id:M},t))}disconnectedCallback(){ui(this,R,"f").language.unregister(this),ui(this,R,"f").theme.unregister(this)}get rootElement(){return s(this)}static get watchers(){return{data:["onDataChanged"]}}};R=new WeakMap,F=new WeakMap,P=new WeakMap,H=new WeakMap,A=new WeakMap,V=new WeakMap,J=new WeakMap,U=new WeakMap,B=new WeakMap,G=new WeakMap,q=new WeakMap,X=new WeakMap,tt=new WeakMap,it=new WeakMap,N=new WeakSet,Y=function(t){return t?this.inputPanelCells.reduce(((i,{cells:n})=>{if(!i){const i=n.find((({column:i})=>i.name===t));return i?i.cell:null}return i}),null):null},Q=function(t){var i,n,l;const s=t.row.layout,a=(null==s?void 0:s.horizontal)||!1,u={};let r;if(null===(i=null==s?void 0:s.sections)||void 0===i?void 0:i.length)if(s.absolute)r=ui(this,N,"m",ut).call(this,t,s),u.height=`${(t=>{var i,n;if(!t)return 0;const e=null!==(n=null===(i=t.sections.flatMap((t=>t.content)).find((t=>t.shape===h.TABLE)))||void 0===i?void 0:i.absoluteHeight)&&void 0!==n?n:null,l=Math.max(0,...t.sections.flatMap((t=>t.content.map((t=>t.absoluteRow+(t.absoluteHeight-1))))));return e?22*(l-e)+20*e:22*l})(s)}px`;else{if(!s.sectionsType){const i=s.sections.some((t=>t.dim));u.display="grid",this.inputPanelPosition!==E.INLINE&&this.inputPanelPosition!==E.UPINLINE||(u.display=""),s.horizontal?u.gridTemplateColumns=i?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${t.cells.length}, 1fr)`:this.dashboardMode&&(u.gridTemplateRows=i?s.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${s.sections.length}, 1fr)`)}r=ui(this,N,"m",at).call(this,t,s)}else r=t.cells.filter((({column:t})=>!1!==t.visible)).map((i=>ui(this,N,"m",Z).call(this,i.cell,t.row,i.column)));const c={"input-panel-form":!0,"input-panel-form--inline":this.buttonPosition==S.RIGHT},p={"input-panel":!0,"input-panel--column":!a,"input-panel--absolute":null==s?void 0:s.absolute,"input-panel--inline":this.inputPanelPosition===E.INLINE||this.inputPanelPosition===E.UPINLINE},f={"input-panel__commands":!0,[`input-panel__commands--${this.buttonPosition}`]:!0};return e("div",null,e("form",{name:this.rootElement.id,id:this.rootElement.id,class:c,ref:t=>hi(this,F,t,"f"),onSubmit:t=>{t.preventDefault(),this.submitCb({value:{before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)}})},onReset:t=>{t.preventDefault(),this.onFormReset()},onContextMenu:t=>{null!=ui(this,N,"m",ii).call(this,t)&&t.preventDefault()}},1==(null===(n=null==s?void 0:s.sections)||void 0===n?void 0:n.length)&&(null===(l=null==s?void 0:s.sections[0])||void 0===l?void 0:l.title)&&e("div",{class:"input-panel__typography"},e(O,{value:s.sections[0].title,type:$.HEADING1})),e("div",{class:p,style:u},r),e("div",{class:f},e(o,{buttonType:"submit",label:ui(this,R,"f").language.translate(d.CONFIRM),wrapperClass:"form__submit",invisible:this.hiddenSubmitButton}),this.fieldReset&&e(o,{buttonType:"reset",label:"Reset",wrapperClass:"form__submit",icon:"broom"}),this.inputPanelCommands)))},Z=function(t,i,n){var l,s;if(!t)return;const o=ui(this,U,"f").get(t.shape);if(void 0!==o)return o(t,n,null===(l=i.layout)||void 0===l?void 0:l.absolute);t.data=Object.assign(Object.assign({},t.data),{sizing:"extra-small",labelHelper:n.helper});const u=null===(s=t.data)||void 0===s?void 0:s.data;u&&(Object.keys(u).includes("kup-text-field")?u["kup-text-field"].labelHelper=n.helper:u["kup-text-field"]={labelHelper:n.helper});const h={cell:t,column:n,row:i,editable:!0,component:this,renderKup:!0,setSizes:!0},r=ui(this,N,"m",ot).call(this,t,n.title),c=e(a,Object.assign({},h));return r?e("div",{class:{"input-panel__label_container":!0}},r,c):c},nt=function(t,{name:i}){return e(o,Object.assign({icon:t.icon,placeholderIcon:t.placeholderIcon,id:i},t.data,{wrapperClass:"form__submit"}))},et=function(t,i){return e("kup-dropdown-button",Object.assign({},t.data,{label:t.value,data:i,"onkup-dropdownbutton-itemclick":t=>{ui(this,N,"m",ti).call(this,t.detail.node,t.detail.node.id)}}))},lt=function(t,{name:i}){for(const i of t.data.data.rows)for(const t of Object.keys(i.cells)){const n=i.cells[t];n.shape===h.AUTOCOMPLETE&&(n.data.displayMode="CodeOnly",n.data.selectMode="CodeOnly")}return e("kup-data-table",Object.assign({id:i,editableData:!0,showGroups:!0,showFilters:!0},t.data,{"onKup-autocomplete-iconclick":t=>{t.preventDefault(),t.stopPropagation()},"onKup-autocomplete-input":t=>{t.preventDefault(),t.stopPropagation()},"onKup-datatable-cell-iconclick":t=>{ui(this,N,"m",Mt).call(this,t),t.preventDefault(),t.stopPropagation()},"onKup-datatable-cell-input":t=>{"autocomplete"===t.detail.type&&ui(this,N,"m",Mt).call(this,t),t.preventDefault(),t.stopPropagation()},"onKup-cell-itemclick":t=>{ui(this,N,"m",qt).call(this,t),t.preventDefault(),t.stopPropagation()}}))},st=function(t,i,n){const l=ri.ketchup.objects.isNumber(t.obj),s=l||ri.ketchup.objects.isDate(t.obj)||ri.ketchup.objects.isTime(t.obj)||ri.ketchup.objects.isTimestamp(t.obj),o=["input-panel-label"];n&&o.push("input-panel-label--legacy-look"),l&&o.push("input-panel-label-number");const a=s?m(i,t):t.value;return e("span",{class:o.join(" "),id:i.name},e(u,{text:a}))},ot=function(t,i){return i&&ri.ketchup.data.cell.getType(t,t.shape)===c.RADIO?e("span",null,i):null},at=function(t,i){const n=ui(this,B,"f").get(i.sectionsType);return n?n(t,i.sections):i.sections.map((i=>ui(this,N,"m",ht).call(this,t,i,!1)))},ut=function(t,i){return i.sections.map((i=>ui(this,N,"m",rt).call(this,t,i)))},ht=function t(i,n,l=!1,s={}){var o,a;const u={"input-panel__section":!n.horizontal,"input-panel__horizontal-section":n.horizontal,"input-panel__section-inline":this.inputPanelPosition===E.INLINE||this.inputPanelPosition===E.UPINLINE};s.gap=+n.gap>0?`${n.gap}rem`:"1rem";let h=[];if(null===(o=n.sections)||void 0===o?void 0:o.length){h=n.sections.map((n=>ui(this,N,"m",t).call(this,i,n))).filter(Boolean);const e=n.sections.some((t=>t.dim));!n.gridCols&&n.horizontal&&(s.gridTemplateColumns=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`),n.gridRows||n.horizontal||!this.dashboardMode||(s.gridTemplateRows=e?n.sections.map((t=>t.dim||"auto")).join(" "):`repeat(${n.sections.length}, 1fr)`)}else(null===(a=n.content)||void 0===a?void 0:a.length)&&(h=n.content.map((t=>ui(this,N,"m",dt).call(this,i,t))).filter(Boolean),s.gridTemplateColumns=+n.gridCols>0?`repeat(${n.gridCols}, 1fr)`:"",this.dashboardMode&&(s.gridTemplateRows=+n.gridRows>0?`repeat(${n.gridRows}, 1fr)`:""));const r=h.length?e("div",{class:u,style:s},h):void 0;return n.title&&!l?e("div",{class:{"input-panel__section_label_container":!0}},e(O,{type:$.HEADING1,value:n.title}),r):r},rt=function t(i,n){var l,s;let o=[];if(null===(l=n.sections)||void 0===l?void 0:l.length)o=n.sections.map((n=>ui(this,N,"m",t).call(this,i,n)));else if(null===(s=n.content)||void 0===s?void 0:s.length){const t=n.content.find((t=>t.shape===h.TABLE)),e=t?{absoluteRow:t.absoluteRow,absoluteHeight:t.absoluteHeight}:{};o=n.content.map((t=>ui(this,N,"m",mt).call(this,i,t,e)))}if(null==K(n.absoluteWidth))return o;const a=null!=K(n.absoluteWidth)?`${K(n.absoluteWidth)}px`:"100%",u=null!=L(n.absoluteHeight)?`${L(n.absoluteHeight)}px`:"100%",r=`${D(n.absoluteRow)}px`,c=`${I(n.absoluteColumn)}px`;return e("div",{style:{position:"relative",width:a,"min-width":a,"max-width":a,height:u,"min-height":u,"max-height":u,top:r,left:c,overflow:"auto"}},o)},ct=function t(i){var n,e;let l=[];return(null===(n=i.content)||void 0===n?void 0:n.length)&&i.content.forEach((t=>{t.id&&l.push(t.id)})),(null===(e=i.sections)||void 0===e?void 0:e.length)&&i.sections.forEach((i=>{l=l.concat(ui(this,N,"m",t).call(this,i))})),l},pt=function(t,i){this.tabSelected||(this.tabSelected=i[0].id||"0");const n=i.map(((i,n)=>{const e=ui(this,N,"m",ct).call(this,i),l=t.cells.some((t=>{var i;const n=t.cell;return e.includes(t.column.name)&&!!(null===(i=n.data)||void 0===i?void 0:i.error)}));return{active:(i.id||`${n}`)===this.tabSelected,value:i.title,icon:l?"error":i.icon,id:i.id||`${n}`,danger:l}})),l=i.map(((i,n)=>{const e=i.id||`${n}`;return ui(this,N,"m",ht).call(this,t,i,!0,{display:this.tabSelected!==e?"none":"grid"})}));return e("div",{class:{"input-panel__tabs_container":!0}},e("kup-tab-bar",{data:n,customStyle:".tab-bar .tab-scroller .tab .tab__content { justify-content: flex-start; }"}),l)},ft=function(t){return!t||!t.cell||!1===t.column.visible},dt=function(t,i){const n=t.cells.find((t=>t.column.name===i.id));if(ui(this,N,"m",ft).call(this,n))return;const l=+i.colSpan>0?i.colSpan:+i.colSpan>0||+i.colStart>0?null:1,s=+i.rowSpan>0?i.rowSpan:+i.rowSpan>0||+i.rowStart>0?null:1;return e("div",{style:{"min-width":"0","grid-column-start":l?`span ${l}`:`${i.colStart}`,"grid-column-end":+i.colEnd>0?`${i.colEnd}`:"","grid-row-start":s?`span ${s}`:`${i.rowStart}`,"grid-row-end":+i.rowEnd>0?`${i.rowEnd}`:""}},ui(this,N,"m",Z).call(this,n.cell,t.row,n.column))},mt=function(t,i,n){const l=t.cells.find((t=>t.column.name===i.id));if(ui(this,N,"m",ft).call(this,l))return;let s;s=l.cell.shape==h.DATE?i.absoluteLength>8?i.absoluteLength:8:i.absoluteLength,i.absoluteHeight||(i.absoluteHeight=1);const o=l.cell.shape===h.LABEL?(t=>0==t?3.75:t?1===t?11.25:7.5*t:null)(s):K(s,(a=l.cell.shape)===h.AUTOCOMPLETE||a===h.COMBOBOX||a===h.DATE);var a;const u=L(i.absoluteHeight),r=D(i.absoluteRow,n),c=I(i.absoluteColumn),p={position:"absolute",width:null!=o?`${o}px`:null,"min-width":null!=o?`${o}px`:null,"max-width":null!=o?`${o}px`:null,height:null!=u?`${u}px`:null,"min-height":null!=u?`${u}px`:null,"max-height":null!=u?`${u}px`:null,top:null!=r?`${r}px`:null,left:null!=c?`${c}px`:null,overflow:"hidden"};return l.cell.data=Object.assign(Object.assign(Object.assign({},l.cell.data),{customStyle:(l.cell.data.customStyle||"")+".mdc-text-field {height: unset !important;}",legacyLook:!0,helperEnabled:!1}),l.cell.shape===h.TABLE&&{rowsPerPage:l.cell.data.data.rows.length,showPaginator:!1,showFooter:!1,tableHeight:`${u}px`}),e("div",{style:p},ui(this,N,"m",Z).call(this,l.cell,t.row,l.column))},vt=function(){this.inputPanelCommands=this.data.setup.commands.map((t=>{if((null==t?void 0:t.children)&&(null==t?void 0:t.children.length)>0){const i={"kup-list":{showIcons:!0,data:t.children.map((t=>ui(this,N,"m",Ut).call(this,t)))}};return ui(this,N,"m",et).call(this,t,i)}{const i=ui(this,N,"m",Ut).call(this,t);return ui(this,N,"m",nt).call(this,i,{name:t.value,title:t.value})}})).flat()},bt=function(t){var i,n,e,l;const s=null===(i=null==t?void 0:t.rows[0])||void 0===i?void 0:i.layout,o=(null===(n=null==t?void 0:t.rows)||void 0===n?void 0:n.length)?t.rows.reduce(((i,n)=>[...i,{cells:t.columns.map((t=>{const i=structuredClone(n.cells[t.name]);return{column:t,cell:i?Object.assign(Object.assign({},i),{data:ui(this,N,"m",_t).call(this,i,t,s),slotData:ui(this,N,"m",yt).call(this,i,t),isEditable:!0}):null}})),row:n}]),[]):[];o.map((({cells:t})=>t.map((({cell:t,column:i})=>{var n;const e=ri.ketchup.data.cell.getType(t,t.shape),l=ui(this,V,"f").get(e),s=ui(this,J,"f").get(e);if(!l&&!s)return;const o=(null!=l?l:s)+`[id='${i.name.replace(/\//g,"\\$1")}']`,a=this.rootElement.shadowRoot.querySelector(o);s?null==a||a.reset():null===(n=null==a?void 0:a.setValue)||void 0===n||n.call(a,t.value)})))),this.inputPanelCells=o,(null===(l=null===(e=t.setup)||void 0===e?void 0:e.commands)||void 0===l?void 0:l.length)&&ui(this,N,"m",vt).call(this)},_t=function(t,i,n){const e=Object.assign(Object.assign({},ui(this,N,"m",gt).call(this,t,i,n)),{disabled:!t.isEditable||i.useAs===v.KEY,id:i.name}),l=ri.ketchup.data.cell.getType(t,t.shape),s=function(t,i){var n={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(n[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(e=Object.getOwnPropertySymbols(t);l<e.length;l++)i.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(n[e[l]]=t[e[l]])}return n}(t.data||{},["data"]);return l!==c.MULTI_AUTOCOMPLETE&&l!==c.MULTI_COMBOBOX?ui(this,N,"m",kt).call(this,e,Object.assign({},t.data)):Object.assign(Object.assign({},e),s)},kt=function t(i,n){for(const e in n)i[e]=n[e]instanceof Object&&!Array.isArray(n[e])&&e in i?ui(this,N,"m",t).call(this,i[e],n[e]):n[e];return i},xt=function(){return this.inputPanelCells.reduce(((t,i)=>{const n=Object.keys(i.row.cells).reduce(((t,n)=>{var e;const l=null===(e=i.cells.find((t=>t.column.name===n)))||void 0===e?void 0:e.cell;let s=null==l?void 0:l.value;return(null==l?void 0:l.shape)===h.TABLE&&(s=JSON.stringify(ui(this,N,"m",Pt).call(this,l.data.data,n))),Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},i.row.cells[n]),{value:s,obj:null==l?void 0:l.obj})})}),{});return{columns:[...t.columns,...i.cells.map((t=>t.column))],rows:[...t.rows,{cells:n,layout:i.row.layout}]}}),{columns:[],rows:[]})},gt=function(t,i,n){if(!t)return null;const e=t.options;let l;l=(null==n?void 0:n.absolute)?null:i.title;const s=t.value,o=ri.ketchup.data.cell.getType(t,t.shape),a=new Map([[c.AUTOCOMPLETE,ui(this,N,"m",$t).bind(this)],[c.BUTTON_LIST,ui(this,N,"m",Ot).bind(this)],[c.CHART,ui(this,N,"m",jt).bind(this)],[c.CHIP,ui(this,N,"m",wt).bind(this)],[c.CHECKBOX,ui(this,N,"m",Tt).bind(this)],[c.COLOR_PICKER,ui(this,N,"m",Et).bind(this)],[c.COMBOBOX,ui(this,N,"m",$t).bind(this)],[c.EDITOR,ui(this,N,"m",St).bind(this)],[c.MULTI_AUTOCOMPLETE,ui(this,N,"m",wt).bind(this)],[c.MULTI_COMBOBOX,ui(this,N,"m",wt).bind(this)],[c.NUMBER,ui(this,N,"m",Rt).bind(this)],[c.DATE,ui(this,N,"m",Lt).bind(this)],[c.OBJECT,ui(this,N,"m",Dt).bind(this)],[c.RADIO,ui(this,N,"m",Wt).bind(this)],[c.STRING,ui(this,N,"m",Ct).bind(this)],[c.SWITCH,ui(this,N,"m",Kt).bind(this)],[c.TABLE,ui(this,N,"m",Ft).bind(this)],[c.TIME,ui(this,N,"m",Nt).bind(this)],[c.IMAGE_LIST,ui(this,N,"m",It).bind(this)]]).get(o);return a?a(e,l,s,t,i.name,n):null},yt=function(t,i){var n;const e=ri.ketchup.data.cell.getType(t,t.shape);if(e===c.CHIP)return{trailingIcon:!0,label:i.title,disabled:!t.isEditable,id:i.name,fullWidth:!1};if(e===c.MULTI_AUTOCOMPLETE||e===c.MULTI_COMBOBOX){const e=Object.assign(Object.assign({},ui(this,N,"m",$t).call(this,t.options,i.title,null,t)),{showDropDownIcon:!0,class:"",style:{width:"100%"},disabled:!t.isEditable,id:i.name});return(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n["kup-text-field"])&&(e.data["kup-text-field"].labelHelper=i.helper),e}return null},wt=function(t,i,n,e){return b(n,e.decode)},jt=function(){return{data:{sizeX:"50px",offlineMode:{value:"8;4;5"},id:"i1012_GREF_0",cellId:"i1012_GREF_0",sizeY:"50px"}}},Ot=function(t,i,n,e,l){var s,o;if(e.data=e.data||{},e.data.onClick=()=>{ui(this,N,"m",ti).call(this,e,l)},e.data.BtnMap){const t=null===(o=null===(s=this.data.setup)||void 0===s?void 0:s.commands)||void 0===o?void 0:o.find((t=>t.obj.k===e.data.BtnMap));t&&(e.isEditable=!0,e.data.onClick=()=>{ui(this,N,"m",ti).call(this,e,t.obj.k)},this.data.setup.commands=this.data.setup.commands.filter((i=>i.obj.k!==t.obj.k)))}return Object.assign({label:e.value,fun:e.fun},e.data)},$t=function(t,i,n,e){const l=_(n,i,[],e.data);return t&&(l.data["kup-list"].data=ui(this,N,"m",Ht).call(this,t,n)),l},Mt=function({detail:t},i=!1){if(ui(this,N,"m",zt).call(this,t))ui(this,N,"m",Gt).call(this,t);else{const n=ui(this,N,"m",Y).call(this,t.id);let e=!0;i&&(e=!t.comp.data["kup-list"].data.length),n.fun&&e&&ui(this,N,"m",Bt).call(this,t,n)}},zt=function(t){return!!t.cell},Tt=function(t,i,n){return k(n,i)},Et=function(t,i){return{data:{"kup-text-field":{label:i}}}},St=function(t,i,n){return{initialValue:n}},Ct=function(t,i,n,e,l){var s;const o=Object.assign({label:i},e.data);return this.autoSkip&&e.isEditable&&(null===(s=e.data)||void 0===s?void 0:s.maxLength)&&(o.onInput=t=>{ui(this,N,"m",oi).call(this,l,t)}),o},Wt=function(t,i,n,e){const l=(()=>{var t;if(e.data.data)return null===(t=e.data.data.rows)||void 0===t?void 0:t.map((t=>{const i=t.fields||t.cells,[e,l]=Object.keys(i);return{id:i[e].value,label:l?i[l].value:i[e].value,selected:n===i[e].value}}))})(),s=x(n,l);return l?s:e.data},Kt=function(t,i,n){return g(n,i)},Lt=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:null!=n?n:""}},Dt=function(t,i,n){return{initialValue:n||"",label:i||" ",value:n||""}},It=function(t,i,n){return{initialValue:n||"",leadingLabel:i||"",value:n||""}},Nt=function(t,i,n){return{data:{"kup-text-field":{label:i}},initialValue:n}},Rt=function(t,i){return{label:i}},Ft=function(t,i,n,e,l,s){try{let t=JSON.parse(e.value);return t?"SmeupDataTable"!==t.type?(ui(this,R,"f").debug.logMessage(this,`Wrong data table type for ${l} cell. Type \`SmeupDataTable\` in value expected`,y.ERROR),null):{data:{columns:t.columns.map((i=>{var n;if(t.rows.length>0){const e=null===(n=t.rows[0].cells[i.name])||void 0===n?void 0:n.obj;return!i.obj&&e?Object.assign(Object.assign({},i),{obj:{t:e.t,p:e.p}}):i}return i})),rows:t.rows.map((i=>Object.assign(Object.assign({},i),{cells:Object.keys(i.cells).reduce(((n,e)=>{const l=t.columns.find((t=>t.name===e));return Object.assign(Object.assign({},n),{[e]:Object.assign(Object.assign({},i.cells[e]),{data:Object.assign(Object.assign(Object.assign({},ui(this,N,"m",gt).call(this,i.cells[e],l,s)),{disabled:!1===i.cells[e].editable,id:l.id}),i.cells[e].data)})})}),{})})))}}:(ui(this,R,"f").debug.logMessage(this,`Empty value for ${l} cell.`,y.WARNING),null)}catch(t){return ui(this,R,"f").debug.logMessage(this,`Invalid value for ${l} cell. Type \`SmeupDataTable\` expected`,y.ERROR),null}},Pt=function(t,i){const n=Object.assign(Object.assign({},t),{rows:t.rows.map((t=>Object.assign(Object.assign({},t),{cells:{}})))}),e=t.columns.filter((t=>t.isEditable)).map((t=>t.name));if(!e.length)return n;try{const l=JSON.parse(ui(this,H,"f").rows[0].cells[i].value);return n.rows=t.rows.map(((t,i)=>e.reduce(((n,e)=>{const s=l.rows[i].cells[e]&&t.cells[e].value!==l.rows[i].cells[e].value;return Object.assign(Object.assign({},l.rows[i]),s?{cells:Object.assign(Object.assign({},n.cells),{[e]:Object.assign(Object.assign({},l.rows[i].cells[e]),{value:t.cells[e].value})})}:{cells:n.cells})}),Object.assign(Object.assign({},l.rows[i]),{cells:{}})))),n}catch(t){return n}},Ht=function(t,i){const n=ui(this,P,"f").get(t.type);return n?n(t,i):t.map((t=>({value:t.label,id:t.id,selected:i===t.id})))},At=function t(i,n){return i.children.map((i=>{var e;return{id:i.content.codice,value:i.content.testo,selected:n===i.content.codice,children:(null===(e=i.children)||void 0===e?void 0:e.length)?ui(this,N,"m",t).call(this,i,n):[]}}))},Vt=function t(i,n){return i.children.map((i=>{var e;return{id:i.obj.k,value:i.value,selected:n===i.obj.k,children:(null===(e=i.children)||void 0===e?void 0:e.length)?ui(this,N,"m",t).call(this,i,n):[]}}))},Jt=function(t,i){return t.rows.map((t=>{const n=t.fields||t.cells,[e,l]=Object.keys(n);return{id:n[e].value,value:l?n[l].value:n[e].value,selected:i===n[e].value}}))},Ut=function(t){return Object.assign(Object.assign({},t),{data:ui(this,N,"m",Ot).call(this,null,null,t.value,t,t.obj.k),id:t.obj.k})},Bt=function(t,i){this.optionsHandler(i.fun,t.inputValue,ui(this,N,"m",xt).call(this),t.id).then((n=>{var e,l,s,o,a,u;const r=(null===(e=null==n?void 0:n.columns)||void 0===e?void 0:e.filter((t=>!1!==(null==t?void 0:t.visible))).map((t=>t.name)))||[],c=null===(l=null==n?void 0:n.rows)||void 0===l?void 0:l.map((t=>{const{cells:i}=t,n=r.reduce(((n,e)=>(t.cells.hasOwnProperty(e)&&(n[e]=i[e]),n)),{});return Object.assign(Object.assign({},t),{cells:n})})),p=Object.assign(Object.assign({},n),{rows:c}),f=i.shape===h.MULTI_AUTOCOMPLETE?i.slotData.data["kup-list"]:null===(o=null===(s=i.data)||void 0===s?void 0:s.data)||void 0===o?void 0:o["kup-list"];f?(f.data=(null==c?void 0:c.length)&&null!==(a=ui(this,N,"m",Ht).call(this,p,i.value))&&void 0!==a?a:[],f.options=null!==(u=n.columns)&&void 0!==u?u:[]):ui(this,R,"f").debug.logMessage(this,'getAutocompleteEventCallback() - "kup-list" not found in cell.data.data',y.WARNING),t.comp.refresh()}))},Gt=function(t){const{cell:i,row:n,column:e,comp:l,id:s,event:o}=t,a=null==i?void 0:i.value,u=t.event.detail;try{this.optionsHandler(i.fun,u.inputValue,{columns:l.data.columns,rows:[n]},e.name).then((t=>{var i,u,h,r,c,p,f;if(t){const d=(null!==(i=null==t?void 0:t.columns)&&void 0!==i?i:[]).filter((t=>!1!==(null==t?void 0:t.visible))).map((t=>t.name)),m=null!==(h=null===(u=null==t?void 0:t.rows)||void 0===u?void 0:u.map((t=>{const i=d.reduce(((i,n)=>(t.cells[n]&&(i[n]=t.cells[n]),i)),{});return Object.assign(Object.assign({},t),{cells:i})})))&&void 0!==h?h:[],v=Object.assign(Object.assign({},t),{rows:m}),b=l.data,_=b.rows[n.id].cells[e.name];(null===(c=null===(r=_.data)||void 0===r?void 0:r.data)||void 0===c?void 0:c["kup-list"])||(_.data={data:{"kup-list":{},"kup-text-field":Object.assign({},_.data)}});const k=_.data.data["kup-list"];k.data=m.length&&null!==(p=ui(this,N,"m",Ht).call(this,v,a))&&void 0!==p?p:[],k.options=null!==(f=t.columns)&&void 0!==f?f:[],l.data=b,this.data.rows[0].cells[s].value=JSON.stringify(b),o.detail.comp.refresh(),l.refresh()}}))}catch(t){console.error("Error in autocomplete callback:",t)}},qt=function(t){const{cell:i,row:n,column:e,id:l,comp:s}=t.detail,o=s.data;o.rows[n.id].cells[e.name]=i,s.data=o,this.data.rows[0].cells[l].value=JSON.stringify(o),t.detail.event.detail.comp.refresh(),s.refresh()},Xt=async function(t,i){var n,e,l,s,o;const{detail:{column:a,cell:u}}=t;if(W[i](null==u?void 0:u.shape))return;const h=ui(this,N,"m",Y).call(this,a.name),r=ui(this,H,"f").rows[0].cells[a.name];if(h){if(u.mandatory){if(ui(this,N,"m",Qt).call(this,a.name,h.value?(null===(n=r.data)||void 0===n?void 0:n.error)||null:ui(this,R,"f").language.translate(d.REQUIRED_VALUE)),!u.value)return}else ui(this,N,"m",Qt).call(this,a.name,(null===(e=r.data)||void 0===e?void 0:e.error)||null);if(null===(l=u.inputSettings)||void 0===l?void 0:l.checkObject){const{valid:t}=await this.checkValidObjCallback({obj:u.obj,currentState:ui(this,N,"m",xt).call(this),fun:u.fun});if(!t)return void ui(this,N,"m",Qt).call(this,a.name,ui(this,R,"f").language.translate(d.INVALID_VALUE));ui(this,N,"m",Qt).call(this,a.name,(null===(s=r.data)||void 0===s?void 0:s.error)||null)}(null===(o=u.inputSettings)||void 0===o?void 0:o.checkValueOnExit)&&ui(this,N,"m",Zt).call(this)&&this.checkValidValueCallback({before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)},a.name)}},Yt=function({detail:{cell:t,column:i}}){var n;t.shape!==h.CHECKBOX&&t.shape!==h.SWITCH||(this.updateOnClick?this.submitCb({value:{before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)},cell:i.name}):(null===(n=t.inputSettings)||void 0===n?void 0:n.checkValueOnExit)&&this.checkValidValueCallback({before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)},i.name))},Qt=function(t,i){this.inputPanelCells=this.inputPanelCells.map((n=>Object.assign(Object.assign({},n),{cells:n.cells.map((({cell:n,column:e})=>{const l=e.name===t?Object.assign(Object.assign({},n.data),{error:i}):n.data;return{column:e,cell:Object.assign(Object.assign({},n),{data:l})}}))})))},Zt=function(){return this.inputPanelCells.some((({cells:t,row:i})=>t.some((({cell:t,column:{name:n}})=>t.value!==i.cells[n].value))))},ti=function(t,i){(null==t?void 0:t.fun)?this.customButtonClickHandler({fun:t.fun,cellId:i,currentState:ui(this,N,"m",xt).call(this)}):this.submitCb({value:{before:Object.assign({},ui(this,H,"f")),after:ui(this,N,"m",xt).call(this)},cell:i})},ii=function(t){return ui(this,R,"f").getEventPath(t.target,this.rootElement).find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains("f-cell")}))},ni=function(t){const i=ui(this,N,"m",ii).call(this,t);if(null==i)return;const n=ui(this,N,"m",xt).call(this),e=i["kup-get-cell-props"]().column.name;return{anchor:i,cell:n.rows[0].cells[e],column:n.columns.find((t=>t.name==e)),row:n.rows[0],originalEvent:t}},ei=function(){ui(this,R,"f").interact.managedElements.add(ui(this,F,"f")),ui(this,R,"f").interact.on(ui(this,F,"f"),w.TAP,(t=>{if(2==t.button){const i=ui(this,N,"m",ni).call(this,t);i&&this.kupDataTableContextMenu.emit({comp:this,id:this.rootElement.id,details:i})}}))},li=function(){if(!ui(this,F,"f"))return;const t=Array.from(ui(this,F,"f").querySelectorAll(".f-cell__content"));for(const i of t){const t=ui(this,N,"m",si).call(this,i,!0);if(t)return void setTimeout((()=>t.focus()),300)}if(!this.autoFocus||0===t.length)return;const i=ui(this,N,"m",si).call(this,t[0]);i&&setTimeout((()=>i.focus()),300)},si=function(t,i=!1){if(!(t&&t instanceof HTMLElement))return;const n=".mdc-text-field__input",e=i?`.mdc-text-field--error ${n}`:n,l=t.querySelector(e);if(l)return l;const s=Array.from(t.querySelectorAll("*")).filter((t=>t.shadowRoot));for(const t of s){const i=t.shadowRoot.querySelector(e);if(i)return i}},oi=function(t,i){var n,e;const l=null==i?void 0:i.target;if(!(l&&l instanceof HTMLInputElement))return;const{maxLength:s,value:o}=l;if(!s||s<0||(null==o?void 0:o.length)<s)return;const a=Array.from(null===(n=ui(this,F,"f"))||void 0===n?void 0:n.querySelectorAll(".f-text-field")).reduce(((t,i)=>{const n=i.querySelector("input");return n?(t.push({id:(null==i?void 0:i.id)||"",HTMLInputElement:n}),t):t}),[]);if(!a.length)return;const u=a.findIndex((i=>i.id===t));u<0||u===a.length-1||null===(e=a[u+1].HTMLInputElement)||void 0===e||e.focus()},ai=function(t){t.stopPropagation(),this.kupCellUpload.emit(t.detail)},ci.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}:host{--kup-fcell-width:fit-content;--kup_input_panel_background_color:var(\n --kup-input-panel-background-color,\n var(--kup-layer-0)\n );--kup_input_panel_color:var(\n --kup-input-panel-color,\n var(--kup-text-secondary)\n );--kup_input_panel_font_family:var(\n --kup-input-panel-font-family,\n var(--kup-font-family)\n );--kup_input_panel_font_size:var(\n --kup-input-panel-font-size,\n var(--kup-font-size)\n );--kup_textfield_textarea_height_input_panel:var(\n --kup-textfield-textarea-height-input_panel,\n 200px\n );--kup_textfield_textarea_width_input_panel:var(\n --kup-textfield-textarea-width-input_panel,\n 300px\n );--kup_input_panel_label_alignment:var(--kup-input-panel-label-alignment);--kup_input_panel_label_width:var(--kup-input-panel-label-width);--kup_input_panel_padding:var(--kup-input-panel-padding, 1em 0);--kup_input_panel_padding--inline:var(\n --kup-input-panel-padding--inline,\n 1em 0\n );--kup_input_panel_absolute_max_height:var(\n --kup-input-panel-absolute-max-height,\n \n 716px\n )}:host .input-panel{background:var(--kup_input_panel_background_color);color:var(--kup_input_panel_color);display:flex;flex-grow:1;overflow:auto;padding:var(--kup_input_panel_padding);position:relative;gap:8px}:host .input-panel__commands{display:flex;gap:1rem}:host .input-panel__commands.input-panel__commands--right{flex-shrink:0;overflow:hidden}:host .input-panel--inline{flex:1;overflow-x:auto;white-space:nowrap;padding:var(--kup_input_panel_padding--inline);display:inline-flex;align-items:flex-end}:host .input-panel--column{flex-direction:column}:host .input-panel__section_label_container{display:flex;flex-direction:column;gap:1rem}:host .input-panel__section{display:grid;min-width:0}:host .input-panel__section .f-cell__content>*{width:100%}:host .input-panel .f-text-field .mdc-text-field.mdc-text-field--textarea{min-height:var(--kup_textfield_textarea_height_input_panel) !important;min-width:var(--kup_textfield_textarea_width_input_panel) !important}:host .input-panel__horizontal-section{display:inline-grid}:host .input-panel__section-inline{display:inline-block;width:max-content}:host .input-panel__label_container{display:flex;flex-direction:column;justify-content:center}:host .input-panel__label_container>.f-cell{flex:1}:host .input-panel__tabs_container{display:flex;flex-direction:column;justify-content:center;gap:2rem}:host .input-panel .f-cell.number-cell .f-cell__content{--kup-textfield-font-family:var(--kup_cell_font_family);font-family:var(--kup_cell_font_family)}:host .input-panel .input-panel-label{display:flex;width:100%;height:100%;align-items:center;justify-content:center}:host .input-panel .input-panel-label--legacy-look{font-size:12px;font-family:var(--kup-font-family-monospace);white-space:pre;overflow:hidden}:host .input-panel--absolute{justify-content:flex-end;padding:var(--kup-space-02);max-height:var(--kup_input_panel_absolute_max_height);--kup-textfield-extrasmall-height:20px;--kup-textfield-extrasmall-padding:0 var(--kup-space-01)}:host .input-panel--absolute .input-panel-label{justify-content:start}:host .input-panel--absolute .input-panel-label.input-panel-label-number{justify-content:end}:host .input-panel--absolute .mdc-text-field{height:unset !important}:host .input-panel-form--inline{display:flex;align-items:end;gap:1rem}:host .input-panel__helper-icon{cursor:help;height:16px;opacity:0.375;position:absolute;right:-18px;top:-2px;width:16px}";export{ci as kup_input_panel}
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as n,H as o,d as a}from"./p-710d0a7d.js";import{k as p,g as s,s as h,h as f}from"./p-54b56ca6.js";import"./p-cabebabc.js";var r;!function(t){t.buttonData="Props of the button (when isButton is set to true).",t.isButton="The component will be rendered as a button, which opens the link associated to the iframe in another tab when clicked.",t.src="The address the iframe should be referencing to."}(r||(r={}));const l=class{constructor(e){t(this,e),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=p(),this.buttonData={},this.isButton=!1,this.src=void 0}onKupIframeError(){this.kupIframeError.emit({comp:this,id:this.rootElement.id})}onKupIframeLoad(){this.kupIframeLoad.emit({comp:this,id:this.rootElement.id})}async getProps(t){return s(this,r,t)}async refresh(){e(this)}async setProps(t){h(this,r,t)}openInNew(){window.open(this.src,"_blank")}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){if(null!=this.src&&""!==this.src)return this.buttonData.icon||(this.buttonData.icon="open_in_new"),this.buttonData.label||(this.buttonData.label="Open in new tab"),this.isButton?n(o,{"is-button":!0},n("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):n(o,{"is-iframe":!0},n("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",f.WARNING)}get rootElement(){return a(this)}};l.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{l as kup_iframe}
1
+ import{r as t,c as i,f as e,h as n,H as o,d as a}from"./p-710d0a7d.js";import{k as p,g as s,s as h,h as f}from"./p-03d049e3.js";import"./p-cabebabc.js";var r;!function(t){t.buttonData="Props of the button (when isButton is set to true).",t.isButton="The component will be rendered as a button, which opens the link associated to the iframe in another tab when clicked.",t.src="The address the iframe should be referencing to."}(r||(r={}));const l=class{constructor(e){t(this,e),this.kupIframeError=i(this,"kup-iframe-error",6),this.kupIframeLoad=i(this,"kup-iframe-load",6),this.kupManager=p(),this.buttonData={},this.isButton=!1,this.src=void 0}onKupIframeError(){this.kupIframeError.emit({comp:this,id:this.rootElement.id})}onKupIframeLoad(){this.kupIframeLoad.emit({comp:this,id:this.rootElement.id})}async getProps(t){return s(this,r,t)}async refresh(){e(this)}async setProps(t){h(this,r,t)}openInNew(){window.open(this.src,"_blank")}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1)}componentDidRender(){this.kupManager.debug.logRender(this,!0)}render(){if(null!=this.src&&""!==this.src)return this.buttonData.icon||(this.buttonData.icon="open_in_new"),this.buttonData.label||(this.buttonData.label="Open in new tab"),this.isButton?n(o,{"is-button":!0},n("kup-button",Object.assign({},this.buttonData,{"onkup-button-click":()=>this.openInNew()}))):n(o,{"is-iframe":!0},n("iframe",{onError:this.onKupIframeError.bind(this),onLoad:this.onKupIframeLoad.bind(this),src:this.src}));this.kupManager.debug.logMessage(this,"Resource undefined, not rendering!",f.WARNING)}get rootElement(){return a(this)}};l.style=".kup-body-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-body-compact-01-font-size, 14px);line-height:18px;font-weight:400;letter-spacing:0.16px}.kup-body-01{font-family:var(--kup-font-family);font-size:var(--kup-body-01-font-size, 14px);line-height:20px;font-weight:400;letter-spacing:0.16px}.kup-code-01{font-family:var(--kup-font-family-monospace);font-size:12px;line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-label-01{font-family:var(--kup-font-family);font-size:var(--kup-label-01-font-size, 12px);line-height:16px;font-weight:400;letter-spacing:0.32px}.kup-caption-02{font-family:var(--kup-font-family);font-size:12px;line-height:15px;font-weight:500;letter-spacing:1px}.kup-caption-01{font-family:var(--kup-font-family);font-size:10px;line-height:13px;font-weight:400;letter-spacing:1px}.kup-small-label-01{font-family:var(--kup-font-family);font-size:6px;line-height:9px;font-weight:400;letter-spacing:1px}.kup-heading-compact-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-compact-01-font-size, 14px);line-height:18px;font-weight:600;letter-spacing:0.16px}.kup-heading-01{font-family:var(--kup-font-family);font-size:var(--kup-heading-01-font-size, 14px);line-height:20px;font-weight:600;letter-spacing:0.16px}.kup-heading-02{font-family:var(--kup-font-family);font-size:16px;line-height:24px;font-weight:500;letter-spacing:0}.kup-heading-03{font-family:var(--kup-font-family);font-size:20px;line-height:28px;font-weight:400;letter-spacing:0}.kup-heading-04{font-family:var(--kup-font-family);font-size:28px;line-height:36px;font-weight:400;letter-spacing:0}.kup-heading-05{font-family:var(--kup-font-family);font-size:32px;line-height:40px;font-weight:300;letter-spacing:0}.kup-heading-06{font-family:var(--kup-font-family);font-size:42px;line-height:50px;font-weight:300;letter-spacing:0}.kup-heading-07{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:300;letter-spacing:0}.kup-heading-08{font-family:var(--kup-font-family);font-size:54px;line-height:64px;font-weight:600;letter-spacing:0}iframe{box-sizing:border-box;height:100%;width:100%}:host([is-iframe]){box-sizing:border-box;display:block;height:100%;width:100%}";export{l as kup_iframe}