@sme.up/ketchup 11.0.0-SNAPSHOT-20260115104056 → 11.0.0-SNAPSHOT-20260121081918

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 (201) hide show
  1. package/dist/cjs/{f-cell-5c9fed73.js → f-cell-d66c4be4.js} +4 -4
  2. package/dist/cjs/{f-chip-8160bfaa.js → f-chip-b2b2de76.js} +1 -1
  3. package/dist/cjs/{f-object-field-b7914a75.js → f-object-field-508fe712.js} +2 -2
  4. package/dist/cjs/{f-paginator-utils-b8255f5e.js → f-paginator-utils-40479dab.js} +1 -1
  5. package/dist/cjs/{f-text-field-8e987ba6.js → f-text-field-5634b79e.js} +1 -1
  6. package/dist/cjs/index.cjs.js +2 -2
  7. package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
  8. package/dist/cjs/kup-activity-timeline.cjs.entry.js +3 -3
  9. package/dist/cjs/kup-autocomplete_30.cjs.entry.js +8 -8
  10. package/dist/cjs/kup-box.cjs.entry.js +8 -8
  11. package/dist/cjs/kup-calendar.cjs.entry.js +3 -3
  12. package/dist/cjs/kup-card-list.cjs.entry.js +2 -2
  13. package/dist/cjs/kup-cell.cjs.entry.js +6 -6
  14. package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +1 -1
  15. package/dist/cjs/kup-dashboard.cjs.entry.js +3 -3
  16. package/dist/cjs/{kup-data-table-helper-85813cb3.js → kup-data-table-helper-262a013d.js} +2 -2
  17. package/dist/cjs/{kup-dates-1d88c05d.js → kup-dates-2ff08e4f.js} +91 -0
  18. package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-echart.cjs.entry.js +2 -2
  20. package/dist/cjs/kup-editor.cjs.entry.js +2 -2
  21. package/dist/cjs/kup-family-tree.cjs.entry.js +2 -2
  22. package/dist/cjs/kup-gantt_10.cjs.entry.js +2 -2
  23. package/dist/cjs/kup-grid.cjs.entry.js +2 -2
  24. package/dist/cjs/kup-htm.cjs.entry.js +2 -2
  25. package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
  26. package/dist/cjs/kup-input-panel.cjs.entry.js +6 -6
  27. package/dist/cjs/kup-lazy.cjs.entry.js +2 -2
  28. package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
  29. package/dist/cjs/{kup-manager-088948ee.js → kup-manager-57f5a949.js} +1 -1
  30. package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  32. package/dist/cjs/kup-object-field.cjs.entry.js +4 -4
  33. package/dist/cjs/{kup-planner-renderer-helper-c13561ca.js → kup-planner-renderer-helper-7dfe474d.js} +1 -1
  34. package/dist/cjs/kup-planner-renderer.cjs.entry.js +2 -2
  35. package/dist/cjs/kup-planner.cjs.entry.js +3 -3
  36. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  37. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  38. package/dist/cjs/kup-snackbar.cjs.entry.js +2 -2
  39. package/dist/cjs/kup-txt.cjs.entry.js +2 -2
  40. package/dist/cjs/kup-typography-list.cjs.entry.js +2 -2
  41. package/dist/cjs/kup-typography.cjs.entry.js +2 -2
  42. package/dist/collection/managers/kup-dates/kup-dates.js +91 -0
  43. package/dist/components/index.js +1 -1
  44. package/dist/components/kup-accordion.js +2 -2
  45. package/dist/components/kup-activity-timeline.js +2 -2
  46. package/dist/components/kup-autocomplete.js +1 -1
  47. package/dist/components/kup-badge.js +1 -1
  48. package/dist/components/kup-box.js +1 -1
  49. package/dist/components/kup-button-list.js +1 -1
  50. package/dist/components/kup-button.js +1 -1
  51. package/dist/components/kup-calendar.js +3 -3
  52. package/dist/components/kup-card-list.js +3 -3
  53. package/dist/components/kup-card.js +1 -1
  54. package/dist/components/kup-cell.js +2 -2
  55. package/dist/components/kup-chart.js +1 -1
  56. package/dist/components/kup-checkbox.js +1 -1
  57. package/dist/components/kup-chip.js +1 -1
  58. package/dist/components/kup-color-picker.js +1 -1
  59. package/dist/components/kup-combobox.js +1 -1
  60. package/dist/components/kup-custom-task-list-table.js +1 -1
  61. package/dist/components/kup-dashboard.js +2 -2
  62. package/dist/components/kup-data-table.js +1 -1
  63. package/dist/components/kup-date-picker.js +1 -1
  64. package/dist/components/kup-dialog.js +1 -1
  65. package/dist/components/kup-drawer.js +2 -2
  66. package/dist/components/kup-dropdown-button.js +1 -1
  67. package/dist/components/kup-echart.js +1 -1
  68. package/dist/components/kup-editor.js +1 -1
  69. package/dist/components/kup-family-tree.js +3 -3
  70. package/dist/components/kup-file-upload.js +1 -1
  71. package/dist/components/kup-form.js +1 -1
  72. package/dist/components/kup-gantt.js +1 -1
  73. package/dist/components/kup-gauge.js +1 -1
  74. package/dist/components/kup-grid.js +1 -1
  75. package/dist/components/kup-htm.js +2 -2
  76. package/dist/components/kup-iframe.js +2 -2
  77. package/dist/components/kup-image-list.js +1 -1
  78. package/dist/components/kup-image.js +1 -1
  79. package/dist/components/kup-input-panel.js +3 -3
  80. package/dist/components/kup-lazy.js +2 -2
  81. package/dist/components/kup-list.js +1 -1
  82. package/dist/components/kup-magic-box.js +4 -4
  83. package/dist/components/kup-nav-bar.js +2 -2
  84. package/dist/components/kup-numeric-picker.js +2 -2
  85. package/dist/components/kup-object-field.js +2 -2
  86. package/dist/components/kup-planner-renderer.js +1 -1
  87. package/dist/components/kup-planner.js +6 -6
  88. package/dist/components/kup-probe.js +2 -2
  89. package/dist/components/kup-progress-bar.js +1 -1
  90. package/dist/components/kup-qlik.js +2 -2
  91. package/dist/components/kup-radio.js +1 -1
  92. package/dist/components/kup-rating.js +1 -1
  93. package/dist/components/kup-snackbar.js +2 -2
  94. package/dist/components/kup-spinner.js +1 -1
  95. package/dist/components/kup-switch.js +1 -1
  96. package/dist/components/kup-tab-bar.js +1 -1
  97. package/dist/components/kup-task-list.js +1 -1
  98. package/dist/components/kup-text-field.js +1 -1
  99. package/dist/components/kup-time-picker.js +1 -1
  100. package/dist/components/kup-toolbar.js +1 -1
  101. package/dist/components/kup-tree.js +1 -1
  102. package/dist/components/kup-txt.js +2 -2
  103. package/dist/components/kup-typography-list.js +2 -2
  104. package/dist/components/kup-typography.js +2 -2
  105. package/dist/components/{p-849825eb.js → p-02a2e37f.js} +2 -2
  106. package/dist/components/{p-0137a3aa.js → p-0fe8f807.js} +2 -2
  107. package/dist/components/{p-61a69626.js → p-25602d9a.js} +1 -1
  108. package/dist/components/{p-ab3892c9.js → p-522261de.js} +2 -2
  109. package/dist/components/{p-a430076c.js → p-6f824383.js} +4 -4
  110. package/dist/components/{p-511f2a65.js → p-873d5549.js} +1 -1
  111. package/dist/components/{p-9a6a0764.js → p-8f4e5405.js} +2 -2
  112. package/dist/components/{p-951f7ecb.js → p-a815e954.js} +2 -2
  113. package/dist/components/{p-24d21e02.js → p-afa464c2.js} +2 -2
  114. package/dist/components/{p-460b5715.js → p-b0d4659d.js} +2 -2
  115. package/dist/components/{p-5dcc763f.js → p-d7365aa4.js} +91 -0
  116. package/dist/esm/{f-cell-91993b82.js → f-cell-ebde9645.js} +4 -4
  117. package/dist/esm/{f-chip-e44754c0.js → f-chip-876f5447.js} +1 -1
  118. package/dist/esm/{f-object-field-973503a4.js → f-object-field-4382c70d.js} +2 -2
  119. package/dist/esm/{f-paginator-utils-29c1ba4a.js → f-paginator-utils-95d00f42.js} +1 -1
  120. package/dist/esm/{f-text-field-a0a6f8ca.js → f-text-field-a13130d7.js} +1 -1
  121. package/dist/esm/index.js +2 -2
  122. package/dist/esm/kup-accordion.entry.js +2 -2
  123. package/dist/esm/kup-activity-timeline.entry.js +3 -3
  124. package/dist/esm/kup-autocomplete_30.entry.js +8 -8
  125. package/dist/esm/kup-box.entry.js +8 -8
  126. package/dist/esm/kup-calendar.entry.js +3 -3
  127. package/dist/esm/kup-card-list.entry.js +2 -2
  128. package/dist/esm/kup-cell.entry.js +6 -6
  129. package/dist/esm/kup-custom-task-list-header_4.entry.js +1 -1
  130. package/dist/esm/kup-dashboard.entry.js +3 -3
  131. package/dist/esm/{kup-data-table-helper-acee1f33.js → kup-data-table-helper-4ab72247.js} +2 -2
  132. package/dist/esm/{kup-dates-ad66e957.js → kup-dates-bf500166.js} +91 -0
  133. package/dist/esm/kup-drawer.entry.js +2 -2
  134. package/dist/esm/kup-echart.entry.js +2 -2
  135. package/dist/esm/kup-editor.entry.js +2 -2
  136. package/dist/esm/kup-family-tree.entry.js +2 -2
  137. package/dist/esm/kup-gantt_10.entry.js +2 -2
  138. package/dist/esm/kup-grid.entry.js +2 -2
  139. package/dist/esm/kup-htm.entry.js +2 -2
  140. package/dist/esm/kup-iframe.entry.js +2 -2
  141. package/dist/esm/kup-input-panel.entry.js +6 -6
  142. package/dist/esm/kup-lazy.entry.js +2 -2
  143. package/dist/esm/kup-magic-box.entry.js +2 -2
  144. package/dist/esm/{kup-manager-b62b2fe2.js → kup-manager-150e2ada.js} +1 -1
  145. package/dist/esm/kup-nav-bar.entry.js +2 -2
  146. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  147. package/dist/esm/kup-object-field.entry.js +4 -4
  148. package/dist/esm/{kup-planner-renderer-helper-c5a632c2.js → kup-planner-renderer-helper-b328ea3f.js} +1 -1
  149. package/dist/esm/kup-planner-renderer.entry.js +2 -2
  150. package/dist/esm/kup-planner.entry.js +3 -3
  151. package/dist/esm/kup-probe.entry.js +2 -2
  152. package/dist/esm/kup-qlik.entry.js +2 -2
  153. package/dist/esm/kup-snackbar.entry.js +2 -2
  154. package/dist/esm/kup-txt.entry.js +2 -2
  155. package/dist/esm/kup-typography-list.entry.js +2 -2
  156. package/dist/esm/kup-typography.entry.js +2 -2
  157. package/dist/ketchup/index.esm.js +1 -1
  158. package/dist/ketchup/ketchup.esm.js +1 -1
  159. package/dist/ketchup/{p-ea7cf385.entry.js → p-0a3c7a5c.entry.js} +1 -1
  160. package/dist/ketchup/{p-839cd69a.entry.js → p-0bede0f7.entry.js} +1 -1
  161. package/dist/ketchup/{p-f6698159.entry.js → p-0f7e65a4.entry.js} +1 -1
  162. package/dist/ketchup/{p-e616cff3.entry.js → p-1b4275ff.entry.js} +1 -1
  163. package/dist/ketchup/{p-63651da4.entry.js → p-1c9888fb.entry.js} +1 -1
  164. package/dist/ketchup/{p-06949f50.entry.js → p-2d28ee89.entry.js} +1 -1
  165. package/dist/ketchup/{p-e5977d1f.js → p-30aea3cc.js} +1 -1
  166. package/dist/ketchup/{p-c8460147.entry.js → p-391fd32a.entry.js} +1 -1
  167. package/dist/ketchup/{p-e994f9ac.entry.js → p-48ab4c41.entry.js} +1 -1
  168. package/dist/ketchup/{p-18905f34.entry.js → p-4fed1f62.entry.js} +1 -1
  169. package/dist/ketchup/{p-906d57d4.js → p-5154c3cd.js} +1 -1
  170. package/dist/ketchup/{p-cac72951.entry.js → p-548251c8.entry.js} +1 -1
  171. package/dist/ketchup/{p-5f48df2e.js → p-65509faf.js} +1 -1
  172. package/dist/ketchup/{p-eb8cfb19.entry.js → p-6757c6a1.entry.js} +1 -1
  173. package/dist/ketchup/p-6e751ce8.entry.js +1 -0
  174. package/dist/ketchup/{p-db865fc1.js → p-8721b809.js} +1 -1
  175. package/dist/ketchup/{p-6f7227a0.entry.js → p-90dfeca0.entry.js} +1 -1
  176. package/dist/ketchup/{p-a5598705.entry.js → p-9979848c.entry.js} +1 -1
  177. package/dist/ketchup/{p-39cc840c.entry.js → p-9bd25afa.entry.js} +1 -1
  178. package/dist/ketchup/{p-11809d52.entry.js → p-a238216d.entry.js} +1 -1
  179. package/dist/ketchup/{p-d9c4ed07.entry.js → p-a370f44c.entry.js} +1 -1
  180. package/dist/ketchup/{p-a7e842f3.entry.js → p-a5b011bb.entry.js} +1 -1
  181. package/dist/ketchup/{p-5c04c239.js → p-ad52ea4a.js} +1 -1
  182. package/dist/ketchup/{p-76f49ffa.js → p-adadf8b5.js} +1 -1
  183. package/dist/ketchup/{p-b00be8d8.entry.js → p-af26718c.entry.js} +1 -1
  184. package/dist/ketchup/{p-0dea7743.entry.js → p-b149cfcd.entry.js} +1 -1
  185. package/dist/ketchup/{p-f3f32f05.entry.js → p-b1bff090.entry.js} +1 -1
  186. package/dist/ketchup/{p-e8565843.entry.js → p-b36c37af.entry.js} +1 -1
  187. package/dist/ketchup/{p-3f0cffa0.js → p-b669cdca.js} +1 -1
  188. package/dist/ketchup/{p-7360895e.entry.js → p-c957ae40.entry.js} +1 -1
  189. package/dist/ketchup/{p-0f7a32ec.entry.js → p-cdf59420.entry.js} +1 -1
  190. package/dist/ketchup/{p-baa6c40c.entry.js → p-cfdb98f8.entry.js} +1 -1
  191. package/dist/ketchup/p-d04f5f4a.entry.js +1 -0
  192. package/dist/ketchup/{p-66c469fb.js → p-d3e2500c.js} +1 -1
  193. package/dist/ketchup/{p-c9b228ed.entry.js → p-df030135.entry.js} +1 -1
  194. package/dist/ketchup/{p-66b068ee.entry.js → p-e9c66132.entry.js} +1 -1
  195. package/dist/ketchup/{p-241cabfb.js → p-f2edb49f.js} +1 -1
  196. package/dist/ketchup/{p-9cd05895.entry.js → p-fa9cf6f7.entry.js} +1 -1
  197. package/dist/ketchup/{p-db65565a.entry.js → p-fc3adf55.entry.js} +1 -1
  198. package/dist/ketchup/{p-580c55a3.entry.js → p-fcd114a5.entry.js} +1 -1
  199. package/package.json +1 -1
  200. package/dist/ketchup/p-2b5b8f6f.entry.js +0 -1
  201. package/dist/ketchup/p-a9bb4120.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as i,f as e,h as o,H as s,d as 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-db865fc1.js";import{f as w,p as v,s as y}from"./p-66c469fb.js";import{F as _}from"./p-cc9db65d.js";import{d as j}from"./p-3f0cffa0.js";import{c as z}from"./p-635bb4b3.js";import{F as C}from"./p-e5977d1f.js";import{p as P,r as M,F as A}from"./p-906d57d4.js";import{F as R}from"./p-7db300e0.js";import"./p-76f49ffa.js";import"./p-ff735e62.js";import"./p-e3062c19.js";import"./p-ef3112d4.js";import"./p-5c04c239.js";import"./p-241cabfb.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-8721b809.js";import{f as w,p as v,s as y}from"./p-d3e2500c.js";import{F as _}from"./p-cc9db65d.js";import{d as j}from"./p-b669cdca.js";import{c as z}from"./p-635bb4b3.js";import{F as C}from"./p-30aea3cc.js";import{p as P,r as M,F as A}from"./p-5154c3cd.js";import{F as R}from"./p-7db300e0.js";import"./p-adadf8b5.js";import"./p-ff735e62.js";import"./p-e3062c19.js";import"./p-ef3112d4.js";import"./p-ad52ea4a.js";import"./p-f2edb49f.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 +1 @@
1
- import{h as e}from"./p-710d0a7d.js";import{I as t,az as a,t as l,a as n,b as r}from"./p-db865fc1.js";import{F as s}from"./p-ff735e62.js";import{a as o}from"./p-e3062c19.js";var i;!function(e){e.SIMPLE="simple",e.FULL="full"}(i||(i={}));const c=document.documentElement,u=u=>{u.perPage||(u.perPage=1e3),u.perPage>u.max&&(u.perPage=u.max);const f=Math.ceil(u.max/u.perPage),m=function(e,t){const a=[];for(let l=1;l<=t;l++){const t=l==e.currentPage;a.push({id:l.toString(),selected:t,value:l.toString()})}return a}(u,f),b=function(e){const t=[],a=Math.min(e.max,e.maxRowsPerPage);let l=e.perPage;if(0===l)return t;for(;l<a;){const a=l==e.perPage;t.push({id:l.toString(),selected:a,value:l.toString()}),l*=2}const n=a==e.perPage;return t.push({id:a.toString(),selected:n,value:a.toString()}),t}(u),g={"kup-list":{data:m,DescrMode:t.CODE},"kup-text-field":{label:c.ketchup.language.translate(a.PAGE),helper:c.ketchup.language.translate(a.TOTAL)+`: ${f}`,helperWhenFocused:!0,inputType:"number",max:f,min:1,size:5}},h={"kup-list":{data:b,DescrMode:t.CODE},"kup-text-field":{label:c.ketchup.language.translate(l.ROWS)+" / "+c.ketchup.language.translate(a.PAGE),helper:c.ketchup.language.translate(l.TOTAL)+`: ${u.max}`,helperWhenFocused:!0,inputType:"number",max:u.max,min:1,size:5}};return e("div",Object.assign({class:`f-paginator ${u.mode?u.mode:""} ${u.wrapperClass?u.wrapperClass:""}`},u.dataSet,{id:u.id,title:u.title}),u.onLoadMore?e(s,{icon:"plus",onClick:u.onLoadMore,label:c.ketchup.language.translate(r.LOAD_MORE),sizing:n.SMALL,styling:o.FLAT,wrapperClass:"load-more-button kup-neutral"}):null,e("kup-combobox",{class:"rows-selector",data:h,DescrMode:t.CODE,initialValue:u.perPage.toString(),initialValueDecode:u.perPage.toString(),"onkup-combobox-change":u.onRowsChange}),e("div",{class:"page-wrapper"},e("div",{class:"page-selector-wrapper"},e("kup-combobox",{class:"page-selector",data:g,DescrMode:t.CODE,initialValue:u.currentPage.toString(),initialValueDecode:u.currentPage.toString(),"onkup-combobox-change":u.onPageChange}),u.showMaxPages?e("div",{class:"max-page-wrapper"},e("label",{htmlFor:"page-selector"},"/ "+f)):null),e("div",{class:"arrow-wrapper"},u.mode!==i.SIMPLE?e(s,{icon:"chevron_left",disabled:d(u),onClick:u.onPrevPage,sizing:n.SMALL,styling:o.FLAT,wrapperClass:"kup-neutral prev-page"}):null,u.mode!==i.SIMPLE?e(s,{icon:"chevron_right",disabled:p(u),onClick:u.onNextPage,sizing:n.SMALL,styling:o.FLAT,wrapperClass:"kup-neutral next-page"}):null)))};function p(e){return e.currentPage*e.perPage>=e.max}function d(e){return 1==e.currentPage}const f=document.documentElement;function m(e,t,a){if(f.ketchup.math.isNumber(e)){const l=Math.ceil(t/a);let n=e;return n>l&&(n=l),n<1&&(n=1),n}return null}function b(e,t){if(f.ketchup.math.isNumber(e)){let a=e;return a>t&&(a=t),a<1&&(a=1),a}return null}export{u as F,m as p,b as r}
1
+ import{h as e}from"./p-710d0a7d.js";import{I as t,az as a,t as l,a as n,b as r}from"./p-8721b809.js";import{F as s}from"./p-ff735e62.js";import{a as o}from"./p-e3062c19.js";var i;!function(e){e.SIMPLE="simple",e.FULL="full"}(i||(i={}));const c=document.documentElement,u=u=>{u.perPage||(u.perPage=1e3),u.perPage>u.max&&(u.perPage=u.max);const m=Math.ceil(u.max/u.perPage),f=function(e,t){const a=[];for(let l=1;l<=t;l++){const t=l==e.currentPage;a.push({id:l.toString(),selected:t,value:l.toString()})}return a}(u,m),b=function(e){const t=[],a=Math.min(e.max,e.maxRowsPerPage);let l=e.perPage;if(0===l)return t;for(;l<a;){const a=l==e.perPage;t.push({id:l.toString(),selected:a,value:l.toString()}),l*=2}const n=a==e.perPage;return t.push({id:a.toString(),selected:n,value:a.toString()}),t}(u),g={"kup-list":{data:f,DescrMode:t.CODE},"kup-text-field":{label:c.ketchup.language.translate(a.PAGE),helper:c.ketchup.language.translate(a.TOTAL)+`: ${m}`,helperWhenFocused:!0,inputType:"number",max:m,min:1,size:5}},h={"kup-list":{data:b,DescrMode:t.CODE},"kup-text-field":{label:c.ketchup.language.translate(l.ROWS)+" / "+c.ketchup.language.translate(a.PAGE),helper:c.ketchup.language.translate(l.TOTAL)+`: ${u.max}`,helperWhenFocused:!0,inputType:"number",max:u.max,min:1,size:5}};return e("div",Object.assign({class:`f-paginator ${u.mode?u.mode:""} ${u.wrapperClass?u.wrapperClass:""}`},u.dataSet,{id:u.id,title:u.title}),u.onLoadMore?e(s,{icon:"plus",onClick:u.onLoadMore,label:c.ketchup.language.translate(r.LOAD_MORE),sizing:n.SMALL,styling:o.FLAT,wrapperClass:"load-more-button kup-neutral"}):null,e("kup-combobox",{class:"rows-selector",data:h,DescrMode:t.CODE,initialValue:u.perPage.toString(),initialValueDecode:u.perPage.toString(),"onkup-combobox-change":u.onRowsChange}),e("div",{class:"page-wrapper"},e("div",{class:"page-selector-wrapper"},e("kup-combobox",{class:"page-selector",data:g,DescrMode:t.CODE,initialValue:u.currentPage.toString(),initialValueDecode:u.currentPage.toString(),"onkup-combobox-change":u.onPageChange}),u.showMaxPages?e("div",{class:"max-page-wrapper"},e("label",{htmlFor:"page-selector"},"/ "+m)):null),e("div",{class:"arrow-wrapper"},u.mode!==i.SIMPLE?e(s,{icon:"chevron_left",disabled:d(u),onClick:u.onPrevPage,sizing:n.SMALL,styling:o.FLAT,wrapperClass:"kup-neutral prev-page"}):null,u.mode!==i.SIMPLE?e(s,{icon:"chevron_right",disabled:p(u),onClick:u.onNextPage,sizing:n.SMALL,styling:o.FLAT,wrapperClass:"kup-neutral next-page"}):null)))};function p(e){return e.currentPage*e.perPage>=e.max}function d(e){return 1==e.currentPage}const m=document.documentElement;function f(e,t,a){if(m.ketchup.math.isNumber(e)){const l=Math.ceil(t/a);let n=e;return n>l&&(n=l),n<1&&(n=1),n}return null}function b(e,t){if(m.ketchup.math.isNumber(e)){let a=e;return a>t&&(a=t),a<1&&(a=1),a}return null}export{u as F,f as p,b as r}
@@ -1 +1 @@
1
- import{r as i,h as t,d as e}from"./p-710d0a7d.js";import{k as o}from"./p-db865fc1.js";import"./p-76f49ffa.js";const n=class{constructor(t){i(this,t),this.kupManager=o(),this.config=void 0,this.qlik=void 0,this.appid="",this.app=!1,this.grid=[],this.debug=!1,this.fluid=!1,this.bordered=!1,this.defobjsize="400px",this.divlist=[]}getObjects(i){let t;return new Promise((e=>{i.rows.forEach((i=>{i.columns.forEach((i=>{t=!1,i.noSelections&&(t=i.noSelections),this.app.getObject(i.obj,i.obj,{noInteraction:!1,noSelections:t})}))})),e(!0)}))}doSelection(i){return new Promise((t=>{i.selections&&i.selections.forEach((i=>{this.app.field(i.field).selectValues(i.values,!1,!0)})),t(!0)}))}setRender(i){return new Promise((e=>{this.divlist=[],i.rows.forEach((i=>{let e=[];i.columns.forEach((i=>{let o="qvobject ";this.bordered&&(o+="bordered "),o=o+"width-"+i.colDim+" size-"+i.size,e.push(t("div",""!=i.obj?{id:i.obj,class:o}:{class:o}))})),this.divlist.push(t("div",{class:"kup-qlik-row"},e))})),e(!0)}))}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.setRender(this.grid)}render(){let i=null,e=null;return i=this.fluid?{"kup-qlik-container-fluid":!0}:{"kup-qlik-container":!0},e={"--lyo_obj-height":this.defobjsize},t("div",{key:"79d257bc81e4d1b46fbaffb670e45c5d9f6ecffb",class:i,style:e},this.divlist)}componentDidRender(){this.debug&&console.log("Grid",this.grid),this.qlik&&(""==this.appid||this.app?this.debug&&console.log("App already open:",this.app):this.app=this.qlik.openApp(this.appid,this.config),this.app&&this.getObjects(this.grid).then((()=>{this.doSelection(this.grid)}))),this.kupManager.debug.logRender(this,!0)}get rootElement(){return e(this)}};n.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}.kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-subtle, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";export{n as kup_qlik}
1
+ import{r as i,h as t,d as e}from"./p-710d0a7d.js";import{k as o}from"./p-8721b809.js";import"./p-adadf8b5.js";const n=class{constructor(t){i(this,t),this.kupManager=o(),this.config=void 0,this.qlik=void 0,this.appid="",this.app=!1,this.grid=[],this.debug=!1,this.fluid=!1,this.bordered=!1,this.defobjsize="400px",this.divlist=[]}getObjects(i){let t;return new Promise((e=>{i.rows.forEach((i=>{i.columns.forEach((i=>{t=!1,i.noSelections&&(t=i.noSelections),this.app.getObject(i.obj,i.obj,{noInteraction:!1,noSelections:t})}))})),e(!0)}))}doSelection(i){return new Promise((t=>{i.selections&&i.selections.forEach((i=>{this.app.field(i.field).selectValues(i.values,!1,!0)})),t(!0)}))}setRender(i){return new Promise((e=>{this.divlist=[],i.rows.forEach((i=>{let e=[];i.columns.forEach((i=>{let o="qvobject ";this.bordered&&(o+="bordered "),o=o+"width-"+i.colDim+" size-"+i.size,e.push(t("div",""!=i.obj?{id:i.obj,class:o}:{class:o}))})),this.divlist.push(t("div",{class:"kup-qlik-row"},e))})),e(!0)}))}componentWillLoad(){this.kupManager.debug.logLoad(this,!1)}componentDidLoad(){this.kupManager.debug.logLoad(this,!0)}componentWillRender(){this.kupManager.debug.logRender(this,!1),this.setRender(this.grid)}render(){let i=null,e=null;return i=this.fluid?{"kup-qlik-container-fluid":!0}:{"kup-qlik-container":!0},e={"--lyo_obj-height":this.defobjsize},t("div",{key:"79d257bc81e4d1b46fbaffb670e45c5d9f6ecffb",class:i,style:e},this.divlist)}componentDidRender(){this.debug&&console.log("Grid",this.grid),this.qlik&&(""==this.appid||this.app?this.debug&&console.log("App already open:",this.app):this.app=this.qlik.openApp(this.appid,this.config),this.app&&this.getObjects(this.grid).then((()=>{this.doSelection(this.grid)}))),this.kupManager.debug.logRender(this,!0)}get rootElement(){return e(this)}};n.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}.kup-qlik-container-fluid{width:100%}.kup-qlik-container{width:100%}@media (min-width: 576px){.kup-qlik-container{width:576px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 768px){.kup-qlik-container{width:768px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 992px){.kup-qlik-container{width:992px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}@media (min-width: 1200px){.kup-qlik-container{width:1200px}.kup-qlik-row>.qvobject{flex:0 0 auto;min-width:100px;margin:0px auto 5px auto}}.kup-qlik-row{display:flex;display:ms-flexbox;flex-wrap:wrap;-ms-flex-wrap:wrap;margin-bottom:5px}.kup-qlik-row .size-M{height:var(--lyo_obj-height)}.kup-qlik-row .size-S{height:calc(var(--lyo_obj-height) / 2)}.kup-qlik-row .size-XS{height:calc(var(--lyo_obj-height) / 3)}.kup-qlik-row .size-L{height:calc(var(--lyo_obj-height) * 2)}.kup-qlik-row .size-XL{height:calc(var(--lyo_obj-height) * 3)}.kup-qlik-row .bordered{border:1px solid var(--kup-border-subtle, #969696)}.kup-qlik-row .width-1{width:8.3333%}.kup-qlik-row .width-2{width:16.6666%}.kup-qlik-row .width-3{width:25%}.kup-qlik-row .width-4{width:33.3333%}.kup-qlik-row .width-5{width:41.6666%}.kup-qlik-row .width-6{width:50%}.kup-qlik-row .width-7{width:58.3333%}.kup-qlik-row .width-8{width:66.6666%}.kup-qlik-row .width-9{width:75%}.kup-qlik-row .width-10{width:83.3333%}.kup-qlik-row .width-11{width:91.6666%}.kup-qlik-row .width-12{width:100%}";export{n as kup_qlik}
@@ -1 +1 @@
1
- import{a as e}from"./p-76f49ffa.js";const r=e=>"year"===e?120:60,t=(e,r)=>{for(let t=0;t<r.length;t++)if(r[t].id===e)return r[t]},n=(e,r)=>{for(let t=0;t<r.length;t++){if(o(r[t]))continue;const n=r[t];if(n.phases)for(let r=0;r<n.phases.length;r++)if(n.phases[r].id===e)return n.phases[r]}},o=e=>e&&e.schedule&&0!==e.schedule.length,a=(e,{id:r,start:t,end:n,startHour:o,endHour:a})=>e.map((e=>e.id===r?y(e,t,n,o,a):e)),s=(e,{id:r,start:t,end:n,startHour:o,endHour:a})=>{if(e)return e.map((e=>e.id===r?y(e,t,n,o,a):e))},d=(r,t,n)=>{var a;if(o(r))return[Object.assign({},u(r,t,n))];{const t=new e,n=r,{start:o,end:s}=t.validDates(n.startDate,n.endDate,n.name),{start:d,end:u}=t.validDates(n.secondaryStartDate,n.secondaryEndDate,n.name);return[{start:o,end:s,id:n.id,name:n.name,type:n.type,valuesToShow:n.valuesToShow,secondaryStart:d,secondaryEnd:u,progress:100,isDisabled:!1,hideChildren:!1,icon:n.icon,startHour:r.startHour,endHour:r.endHour,secondaryStartHour:r.secondaryStartHour,secondaryEndHour:r.secondaryEndHour},...(null!==(a=n.phases)&&void 0!==a?a:[]).map(c)]}},c=r=>(({startDate:t,endDate:n,secondaryStartDate:o,secondaryEndDate:a,name:s,id:d,color:c,selectedColor:u,dependencies:y,icon:l,startHour:i,endHour:H,secondaryStartHour:m,secondaryEndHour:f})=>{const h=new e,{start:S,end:b}=h.validDates(t,n,s),{start:w,end:k}=h.validDates(o,a,s);return{start:S,end:b,secondaryStart:w,secondaryEnd:k,name:s,valuesToShow:r.valuesToShow,id:d,type:"task",progress:100,dependencies:y,styles:c?{backgroundColor:c,progressColor:c,backgroundSelectedColor:u,progressSelectedColor:u}:{},icon:l,startHour:i,endHour:H,secondaryStartHour:m,secondaryEndHour:f}})(r),u=(r,t,n)=>{const o=new e,{id:a,name:s,schedule:d}=r,{start:c,end:u}=(e=>{let r=null!=t?t:"",a=null!=n?n:"";for(let t=0;t<e.schedule.length;t++){const n=e.schedule[t].startDate,o=e.schedule[t].endDate;(!r||n.localeCompare(r)<0)&&(r=n),(!a||o.localeCompare(a)>0)&&(a=o)}return o.validDates(r,a,"detail item")})(r),y="#595959";return{id:a,type:"timeline",timeline:d.map((e=>{const{startDate:r,endDate:t,color:n,selectedColor:a,icon:s}=e,{start:d,end:c}=o.validDates(r,t,"time frame");return{start:d,end:c,backgroundColor:null!=n?n:"0xffffff",backgroundSelectedColor:null!=a?a:n,icon:s}})),name:s,valuesToShow:r.valuesToShow,start:c,end:u,progress:100,styles:{backgroundColor:y,progressColor:y,backgroundSelectedColor:y,progressSelectedColor:y}}},y=(r,t,n,o,a)=>{const s=new e,d={startDate:s.formatToIsoDate(t),endDate:s.formatToIsoDate(n),startHour:o,endHour:a};return Object.assign(Object.assign({},r),d)},l=(e,r,t,n,o)=>{const a=i(e,r,null!=o?o:1,t);if(n){const e=m(n,r,null!=o?o:1,t);e[0]<a[0]&&(a[0]=e[0]),e[1]>a[1]&&(a[1]=e[1])}return{displayedStartDate:a[0],displayedEndDate:a[1]}},i=(r,t,n,o)=>{const a=[],s=new e;return r.forEach((e=>{var r;a.push({start:s.parseToDayStart(e.startDate),end:s.parseToDayEnd(e.endDate),secondaryStart:s.parseToDayStart(e.secondaryStartDate),secondaryEnd:s.parseToDayEnd(e.secondaryEndDate),startHour:e.startHour,endHour:e.endHour,secondaryStartHour:e.secondaryStartHour,secondaryEndHour:e.secondaryEndHour}),null===(r=e.phases)||void 0===r||r.forEach((r=>{a.push({start:s.parseToDayStart(r.startDate),end:s.parseToDayEnd(r.endDate),secondaryStart:s.parseToDayStart(r.secondaryStartDate),secondaryEnd:s.parseToDayEnd(r.secondaryEndDate),startHour:e.startHour,endHour:e.endHour,secondaryStartHour:e.secondaryStartHour,secondaryEndHour:e.secondaryEndHour})}))})),H(a,t,n,o,!0)},H=(e,r,t,n,o)=>{let a=e.length>0?e[0].start:new Date,s=e.length>0?e[0].end:new Date;for(const r of e)r.start<a&&(a=r.start),r.end>s&&(s=r.end),n&&(r.secondaryStart&&r.secondaryStart<a&&(a=r.secondaryStart),r.secondaryEnd&&r.secondaryEnd>s&&(s=r.secondaryEnd));if(o)return[a,s];switch(r){case"year":a=f(a,-1,"year"),a=h(a,"year"),s=f(s,1,"year"),s=h(s,"year");break;case"month":a=f(a,-1*t,"month"),a=h(a,"month"),s=f(s,1,"month"),s=h(s,"month");break;case"week":a=h(a,"day"),a=f(S(a),-7*t,"day"),s=h(s,"day"),s=f(s,1.5,"month");break;case"day":a=h(a,"day"),a=f(a,-1*t,"day"),s=h(s,"day"),s=f(s,19,"day");break;case"hour":a=h(a,"hour"),a=f(a,-1*t,"hour"),s=h(s,"day"),s=f(s,1,"day")}return[a,s]},m=(r,t,n,o)=>{const a=[],s=new e;return r.forEach((e=>{const r=e.schedule;r&&r.forEach((e=>{a.push({start:s.parseToDayStart(e.startDate),end:s.parseToDayEnd(e.endDate),secondaryStart:void 0,secondaryEnd:void 0})}))})),H(a,t,n,o,!0)},f=(e,r,t)=>new Date(e.getFullYear()+("year"===t?r:0),e.getMonth()+("month"===t?r:0),e.getDate()+("day"===t?r:0),e.getHours()+("hour"===t?r:0),e.getMinutes()+("minute"===t?r:0),e.getSeconds()+("second"===t?r:0),e.getMilliseconds()+("millisecond"===t?r:0)),h=(e,r)=>{const t=["millisecond","second","minute","hour","day","month","year"],n=e=>{const n=t.indexOf(r);return t.indexOf(e)<=n};return new Date(e.getFullYear(),n("year")?0:e.getMonth(),n("month")?1:e.getDate(),n("day")?0:e.getHours(),n("hour")?0:e.getMinutes(),n("minute")?0:e.getSeconds(),n("second")?0:e.getMilliseconds())},S=e=>{const r=e.getDay(),t=e.getDate()-r+(0===r?-6:1);return new Date(e.setDate(t))},b=(e,r,t,n,o,a)=>{const s=[];return e.forEach((e=>{s.push({start:e.start,end:e.end,secondaryStart:e.secondaryStart,secondaryEnd:e.secondaryEnd,startHour:e.startHour,endHour:e.endHour,secondaryStartHour:e.secondaryStartHour,secondaryEndHour:e.secondaryEndHour})})),o&&a&&s.push({start:o,end:a,secondaryStart:void 0,secondaryEnd:void 0}),H(s,r,t,n)},w=(e,r,t)=>{let n=new Date(e);const o=[n];for(;n<r;){switch(t){case"year":n=f(n,1,"year");break;case"month":n=f(n,1,"month");break;case"week":n=f(n,7,"day");break;case"day":n=f(n,1,"day");break;case"hour":n=f(n,1,"hour")}o.push(n)}return o};export{d as a,t as b,l as c,s as d,r as e,b as f,n as g,a as m,w as s}
1
+ import{a as e}from"./p-adadf8b5.js";const r=e=>"year"===e?120:60,t=(e,r)=>{for(let t=0;t<r.length;t++)if(r[t].id===e)return r[t]},n=(e,r)=>{for(let t=0;t<r.length;t++){if(o(r[t]))continue;const n=r[t];if(n.phases)for(let r=0;r<n.phases.length;r++)if(n.phases[r].id===e)return n.phases[r]}},o=e=>e&&e.schedule&&0!==e.schedule.length,a=(e,{id:r,start:t,end:n,startHour:o,endHour:a})=>e.map((e=>e.id===r?y(e,t,n,o,a):e)),s=(e,{id:r,start:t,end:n,startHour:o,endHour:a})=>{if(e)return e.map((e=>e.id===r?y(e,t,n,o,a):e))},d=(r,t,n)=>{var a;if(o(r))return[Object.assign({},u(r,t,n))];{const t=new e,n=r,{start:o,end:s}=t.validDates(n.startDate,n.endDate,n.name),{start:d,end:u}=t.validDates(n.secondaryStartDate,n.secondaryEndDate,n.name);return[{start:o,end:s,id:n.id,name:n.name,type:n.type,valuesToShow:n.valuesToShow,secondaryStart:d,secondaryEnd:u,progress:100,isDisabled:!1,hideChildren:!1,icon:n.icon,startHour:r.startHour,endHour:r.endHour,secondaryStartHour:r.secondaryStartHour,secondaryEndHour:r.secondaryEndHour},...(null!==(a=n.phases)&&void 0!==a?a:[]).map(c)]}},c=r=>(({startDate:t,endDate:n,secondaryStartDate:o,secondaryEndDate:a,name:s,id:d,color:c,selectedColor:u,dependencies:y,icon:l,startHour:i,endHour:H,secondaryStartHour:m,secondaryEndHour:h})=>{const f=new e,{start:S,end:b}=f.validDates(t,n,s),{start:w,end:k}=f.validDates(o,a,s);return{start:S,end:b,secondaryStart:w,secondaryEnd:k,name:s,valuesToShow:r.valuesToShow,id:d,type:"task",progress:100,dependencies:y,styles:c?{backgroundColor:c,progressColor:c,backgroundSelectedColor:u,progressSelectedColor:u}:{},icon:l,startHour:i,endHour:H,secondaryStartHour:m,secondaryEndHour:h}})(r),u=(r,t,n)=>{const o=new e,{id:a,name:s,schedule:d}=r,{start:c,end:u}=(e=>{let r=null!=t?t:"",a=null!=n?n:"";for(let t=0;t<e.schedule.length;t++){const n=e.schedule[t].startDate,o=e.schedule[t].endDate;(!r||n.localeCompare(r)<0)&&(r=n),(!a||o.localeCompare(a)>0)&&(a=o)}return o.validDates(r,a,"detail item")})(r),y="#595959";return{id:a,type:"timeline",timeline:d.map((e=>{const{startDate:r,endDate:t,color:n,selectedColor:a,icon:s}=e,{start:d,end:c}=o.validDates(r,t,"time frame");return{start:d,end:c,backgroundColor:null!=n?n:"0xffffff",backgroundSelectedColor:null!=a?a:n,icon:s}})),name:s,valuesToShow:r.valuesToShow,start:c,end:u,progress:100,styles:{backgroundColor:y,progressColor:y,backgroundSelectedColor:y,progressSelectedColor:y}}},y=(r,t,n,o,a)=>{const s=new e,d={startDate:s.formatToIsoDate(t),endDate:s.formatToIsoDate(n),startHour:o,endHour:a};return Object.assign(Object.assign({},r),d)},l=(e,r,t,n,o)=>{const a=i(e,r,null!=o?o:1,t);if(n){const e=m(n,r,null!=o?o:1,t);e[0]<a[0]&&(a[0]=e[0]),e[1]>a[1]&&(a[1]=e[1])}return{displayedStartDate:a[0],displayedEndDate:a[1]}},i=(r,t,n,o)=>{const a=[],s=new e;return r.forEach((e=>{var r;a.push({start:s.parseToDayStart(e.startDate),end:s.parseToDayEnd(e.endDate),secondaryStart:s.parseToDayStart(e.secondaryStartDate),secondaryEnd:s.parseToDayEnd(e.secondaryEndDate),startHour:e.startHour,endHour:e.endHour,secondaryStartHour:e.secondaryStartHour,secondaryEndHour:e.secondaryEndHour}),null===(r=e.phases)||void 0===r||r.forEach((r=>{a.push({start:s.parseToDayStart(r.startDate),end:s.parseToDayEnd(r.endDate),secondaryStart:s.parseToDayStart(r.secondaryStartDate),secondaryEnd:s.parseToDayEnd(r.secondaryEndDate),startHour:e.startHour,endHour:e.endHour,secondaryStartHour:e.secondaryStartHour,secondaryEndHour:e.secondaryEndHour})}))})),H(a,t,n,o,!0)},H=(e,r,t,n,o)=>{let a=e.length>0?e[0].start:new Date,s=e.length>0?e[0].end:new Date;for(const r of e)r.start<a&&(a=r.start),r.end>s&&(s=r.end),n&&(r.secondaryStart&&r.secondaryStart<a&&(a=r.secondaryStart),r.secondaryEnd&&r.secondaryEnd>s&&(s=r.secondaryEnd));if(o)return[a,s];switch(r){case"year":a=h(a,-1,"year"),a=f(a,"year"),s=h(s,1,"year"),s=f(s,"year");break;case"month":a=h(a,-1*t,"month"),a=f(a,"month"),s=h(s,1,"month"),s=f(s,"month");break;case"week":a=f(a,"day"),a=h(S(a),-7*t,"day"),s=f(s,"day"),s=h(s,1.5,"month");break;case"day":a=f(a,"day"),a=h(a,-1*t,"day"),s=f(s,"day"),s=h(s,19,"day");break;case"hour":a=f(a,"hour"),a=h(a,-1*t,"hour"),s=f(s,"day"),s=h(s,1,"day")}return[a,s]},m=(r,t,n,o)=>{const a=[],s=new e;return r.forEach((e=>{const r=e.schedule;r&&r.forEach((e=>{a.push({start:s.parseToDayStart(e.startDate),end:s.parseToDayEnd(e.endDate),secondaryStart:void 0,secondaryEnd:void 0})}))})),H(a,t,n,o,!0)},h=(e,r,t)=>new Date(e.getFullYear()+("year"===t?r:0),e.getMonth()+("month"===t?r:0),e.getDate()+("day"===t?r:0),e.getHours()+("hour"===t?r:0),e.getMinutes()+("minute"===t?r:0),e.getSeconds()+("second"===t?r:0),e.getMilliseconds()+("millisecond"===t?r:0)),f=(e,r)=>{const t=["millisecond","second","minute","hour","day","month","year"],n=e=>{const n=t.indexOf(r);return t.indexOf(e)<=n};return new Date(e.getFullYear(),n("year")?0:e.getMonth(),n("month")?1:e.getDate(),n("day")?0:e.getHours(),n("hour")?0:e.getMinutes(),n("minute")?0:e.getSeconds(),n("second")?0:e.getMilliseconds())},S=e=>{const r=e.getDay(),t=e.getDate()-r+(0===r?-6:1);return new Date(e.setDate(t))},b=(e,r,t,n,o,a)=>{const s=[];return e.forEach((e=>{s.push({start:e.start,end:e.end,secondaryStart:e.secondaryStart,secondaryEnd:e.secondaryEnd,startHour:e.startHour,endHour:e.endHour,secondaryStartHour:e.secondaryStartHour,secondaryEndHour:e.secondaryEndHour})})),o&&a&&s.push({start:o,end:a,secondaryStart:void 0,secondaryEnd:void 0}),H(s,r,t,n)},w=(e,r,t)=>{let n=new Date(e);const o=[n];for(;n<r;){switch(t){case"year":n=h(n,1,"year");break;case"month":n=h(n,1,"month");break;case"week":n=h(n,7,"day");break;case"day":n=h(n,1,"day");break;case"hour":n=h(n,1,"hour")}o.push(n)}return o};export{d as a,t as b,l as c,s as d,r as e,b as f,n as g,a as m,w as s}