@sme.up/ketchup 8.0.2 → 8.1.0

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 (552) hide show
  1. package/dist/cjs/{GenericVariables-a9ed17ee.js → GenericVariables-9cd88034.js} +3 -3
  2. package/dist/cjs/{component-85c2bd4d.js → component-2c7ddef7.js} +91 -10
  3. package/dist/cjs/{f-button-9524bbf7.js → f-button-a5f661f2.js} +99 -99
  4. package/dist/cjs/{f-button-declarations-b611587f.js → f-button-declarations-76b4fb4c.js} +16 -16
  5. package/dist/cjs/{f-cell-bcb75ade.js → f-cell-ca9e4352.js} +472 -472
  6. package/dist/cjs/{f-checkbox-1148e791.js → f-checkbox-e2c6ecef.js} +23 -23
  7. package/dist/cjs/{f-chip-2249b386.js → f-chip-e941fa19.js} +125 -125
  8. package/dist/cjs/{f-image-47d74999.js → f-image-466b724f.js} +107 -107
  9. package/dist/cjs/{f-paginator-utils-b0a9ae5f.js → f-paginator-utils-f775ce67.js} +1548 -1548
  10. package/dist/cjs/{f-text-field-579c0fc0.js → f-text-field-ddb47dda.js} +172 -172
  11. package/dist/cjs/{f-text-field-mdc-0e22f3e3.js → f-text-field-mdc-d38d80b5.js} +59 -60
  12. package/dist/cjs/{index-1f177abc.js → index-26fb8571.js} +78 -24
  13. package/dist/cjs/ketchup.cjs.js +3 -3
  14. package/dist/cjs/kup-accordion.cjs.entry.js +199 -200
  15. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +17546 -17508
  16. package/dist/cjs/kup-box.cjs.entry.js +1294 -1232
  17. package/dist/cjs/kup-calendar.cjs.entry.js +9542 -10035
  18. package/dist/cjs/kup-cell.cjs.entry.js +172 -172
  19. package/dist/cjs/kup-dash-list.cjs.entry.js +106 -106
  20. package/dist/cjs/kup-dash_2.cjs.entry.js +162 -162
  21. package/dist/cjs/kup-dashboard.cjs.entry.js +400 -401
  22. package/dist/cjs/kup-drawer.cjs.entry.js +138 -138
  23. package/dist/cjs/kup-echart.cjs.entry.js +7145 -6598
  24. package/dist/cjs/kup-family-tree.cjs.entry.js +439 -439
  25. package/dist/cjs/kup-iframe.cjs.entry.js +94 -94
  26. package/dist/cjs/kup-image-list.cjs.entry.js +255 -256
  27. package/dist/cjs/kup-lazy.cjs.entry.js +186 -186
  28. package/dist/cjs/kup-magic-box.cjs.entry.js +298 -298
  29. package/dist/cjs/{kup-manager-85b2a756.js → kup-manager-16b684bd.js} +7286 -7287
  30. package/dist/cjs/kup-nav-bar.cjs.entry.js +130 -130
  31. package/dist/cjs/kup-numeric-picker.cjs.entry.js +367 -368
  32. package/dist/cjs/kup-photo-frame.cjs.entry.js +144 -144
  33. package/dist/cjs/kup-planner.cjs.entry.js +1151 -1009
  34. package/dist/cjs/kup-probe.cjs.entry.js +246 -246
  35. package/dist/cjs/kup-qlik.cjs.entry.js +138 -138
  36. package/dist/cjs/kup-snackbar.cjs.entry.js +116 -116
  37. package/dist/cjs/loader.cjs.js +3 -3
  38. package/dist/collection/assets/dash-list.js +466 -293
  39. package/dist/collection/assets/index.js +4 -0
  40. package/dist/collection/assets/planner.js +8189 -0
  41. package/dist/collection/collection-manifest.json +2 -2
  42. package/dist/collection/components/kup-accordion/kup-accordion-declarations.js +10 -10
  43. package/dist/collection/components/kup-accordion/kup-accordion.js +445 -445
  44. package/dist/collection/components/kup-autocomplete/kup-autocomplete-declarations.js +27 -27
  45. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +908 -908
  46. package/dist/collection/components/kup-badge/kup-badge-declarations.js +10 -10
  47. package/dist/collection/components/kup-badge/kup-badge.js +276 -276
  48. package/dist/collection/components/kup-box/kup-box-declarations.js +34 -33
  49. package/dist/collection/components/kup-box/kup-box-state.js +15 -15
  50. package/dist/collection/components/kup-box/kup-box.js +2159 -2079
  51. package/dist/collection/components/kup-button/kup-button-declarations.js +18 -18
  52. package/dist/collection/components/kup-button/kup-button.js +580 -580
  53. package/dist/collection/components/kup-button-list/kup-button-list-declarations.js +13 -13
  54. package/dist/collection/components/kup-button-list/kup-button-list.e2e.js +144 -0
  55. package/dist/collection/components/kup-button-list/kup-button-list.js +527 -527
  56. package/dist/collection/components/kup-calendar/kup-calendar-declarations.js +35 -35
  57. package/dist/collection/components/kup-calendar/kup-calendar.css +0 -4
  58. package/dist/collection/components/kup-calendar/kup-calendar.js +690 -690
  59. package/dist/collection/components/kup-card/box/kup-card-box.js +227 -227
  60. package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +56 -56
  61. package/dist/collection/components/kup-card/built-in/kup-card-calendar.js +393 -393
  62. package/dist/collection/components/kup-card/built-in/kup-card-clock.js +308 -308
  63. package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +165 -165
  64. package/dist/collection/components/kup-card/built-in/kup-card-message-box.js +10 -10
  65. package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +118 -118
  66. package/dist/collection/components/kup-card/collapsible/kup-card-collapsible.js +64 -64
  67. package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +217 -217
  68. package/dist/collection/components/kup-card/free/kup-card-free.js +22 -22
  69. package/dist/collection/components/kup-card/kup-card-declarations.js +98 -98
  70. package/dist/collection/components/kup-card/kup-card-helper.js +196 -196
  71. package/dist/collection/components/kup-card/kup-card.js +809 -809
  72. package/dist/collection/components/kup-card/scalable/kup-card-scalable.js +251 -251
  73. package/dist/collection/components/kup-card/standard/kup-card-standard.js +593 -593
  74. package/dist/collection/components/kup-cell/kup-cell-declarations.js +11 -11
  75. package/dist/collection/components/kup-cell/kup-cell.js +401 -401
  76. package/dist/collection/components/kup-chart/kup-chart-builder.js +93 -93
  77. package/dist/collection/components/kup-chart/kup-chart-declarations.js +49 -49
  78. package/dist/collection/components/kup-chart/kup-chart.js +1080 -1080
  79. package/dist/collection/components/kup-checkbox/kup-checkbox-declarations.js +13 -13
  80. package/dist/collection/components/kup-checkbox/kup-checkbox.js +433 -433
  81. package/dist/collection/components/kup-chip/kup-chip-declarations.js +12 -12
  82. package/dist/collection/components/kup-chip/kup-chip.js +558 -558
  83. package/dist/collection/components/kup-color-picker/kup-color-picker-declarations.js +12 -12
  84. package/dist/collection/components/kup-color-picker/kup-color-picker.js +546 -546
  85. package/dist/collection/components/kup-combobox/kup-combobox-declarations.js +15 -15
  86. package/dist/collection/components/kup-combobox/kup-combobox.js +821 -821
  87. package/dist/collection/components/kup-dash/kup-dash.js +171 -171
  88. package/dist/collection/components/kup-dash-list/kup-dash-list.js +327 -327
  89. package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +10 -10
  90. package/dist/collection/components/kup-dashboard/kup-dashboard.js +588 -588
  91. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +156 -156
  92. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +808 -808
  93. package/dist/collection/components/kup-data-table/kup-data-table-state.js +36 -36
  94. package/dist/collection/components/kup-data-table/kup-data-table.js +5527 -5527
  95. package/dist/collection/components/kup-date-picker/kup-date-picker-declarations.js +18 -18
  96. package/dist/collection/components/kup-date-picker/kup-date-picker.js +816 -816
  97. package/dist/collection/components/kup-dialog/kup-dialog-declarations.js +14 -14
  98. package/dist/collection/components/kup-dialog/kup-dialog.js +467 -467
  99. package/dist/collection/components/kup-drawer/kup-drawer-declarations.js +10 -10
  100. package/dist/collection/components/kup-drawer/kup-drawer.e2e.js +9 -0
  101. package/dist/collection/components/kup-drawer/kup-drawer.js +383 -383
  102. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button-declarations.js +18 -18
  103. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +800 -800
  104. package/dist/collection/components/kup-echart/kup-echart-declarations.js +52 -52
  105. package/dist/collection/components/kup-echart/kup-echart.js +1437 -1437
  106. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +15 -15
  107. package/dist/collection/components/kup-family-tree/kup-family-tree.js +829 -829
  108. package/dist/collection/components/kup-form/kup-form-declarations.js +29 -29
  109. package/dist/collection/components/kup-form/kup-form.js +731 -731
  110. package/dist/collection/components/kup-gauge/kup-gauge-declarations.js +26 -26
  111. package/dist/collection/components/kup-gauge/kup-gauge.js +764 -764
  112. package/dist/collection/components/kup-grid/kup-grid-declarations.js +10 -10
  113. package/dist/collection/components/kup-grid/kup-grid.js +253 -253
  114. package/dist/collection/components/kup-iframe/kup-iframe-declarations.js +10 -10
  115. package/dist/collection/components/kup-iframe/kup-iframe.js +281 -281
  116. package/dist/collection/components/kup-image/canvas/kup-image-canvas-declarations.js +184 -184
  117. package/dist/collection/components/kup-image/canvas/kup-image-canvas-helper.js +19 -19
  118. package/dist/collection/components/kup-image/canvas/kup-image-canvas.js +225 -225
  119. package/dist/collection/components/kup-image/kup-image-declarations.js +16 -16
  120. package/dist/collection/components/kup-image/kup-image.js +491 -491
  121. package/dist/collection/components/kup-image-list/kup-image-list-declarations.js +10 -10
  122. package/dist/collection/components/kup-image-list/kup-image-list-state.js +9 -9
  123. package/dist/collection/components/kup-image-list/kup-image-list.js +533 -533
  124. package/dist/collection/components/kup-lazy/kup-lazy-declarations.js +20 -20
  125. package/dist/collection/components/kup-lazy/kup-lazy.js +430 -430
  126. package/dist/collection/components/kup-list/kup-list-declarations.js +34 -34
  127. package/dist/collection/components/kup-list/kup-list-helper.js +121 -121
  128. package/dist/collection/components/kup-list/kup-list.js +949 -949
  129. package/dist/collection/components/kup-magic-box/kup-magic-box-declarations.js +23 -23
  130. package/dist/collection/components/kup-magic-box/kup-magic-box.js +431 -431
  131. package/dist/collection/components/kup-nav-bar/kup-nav-bar-declarations.js +21 -21
  132. package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +315 -315
  133. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -16
  134. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +864 -864
  135. package/dist/collection/components/kup-photo-frame/kup-photo-frame-declarations.js +10 -10
  136. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +372 -372
  137. package/dist/collection/components/kup-planner/kup-planner-declarations.js +83 -76
  138. package/dist/collection/components/kup-planner/kup-planner-helper.js +54 -54
  139. package/dist/collection/components/kup-planner/kup-planner-state.js +16 -0
  140. package/dist/collection/components/kup-planner/kup-planner.js +1725 -1352
  141. package/dist/collection/components/kup-probe/kup-probe.js +358 -358
  142. package/dist/collection/components/kup-progress-bar/kup-progress-bar-declarations.js +14 -14
  143. package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +405 -405
  144. package/dist/collection/components/kup-qlik/kup-qlik-declarations.js +1 -1
  145. package/dist/collection/components/kup-qlik/kup-qlik.js +326 -326
  146. package/dist/collection/components/kup-radio/kup-radio-declarations.js +12 -12
  147. package/dist/collection/components/kup-radio/kup-radio.js +398 -398
  148. package/dist/collection/components/kup-rating/kup-rating-declarations.js +11 -11
  149. package/dist/collection/components/kup-rating/kup-rating.js +332 -332
  150. package/dist/collection/components/kup-snackbar/kup-snackbar-declarations.js +13 -13
  151. package/dist/collection/components/kup-snackbar/kup-snackbar.js +389 -389
  152. package/dist/collection/components/kup-spinner/kup-spinner-declarations.js +15 -15
  153. package/dist/collection/components/kup-spinner/kup-spinner.js +468 -468
  154. package/dist/collection/components/kup-state/kup-state.js +1 -1
  155. package/dist/collection/components/kup-state/kup-store.js +1 -1
  156. package/dist/collection/components/kup-state/mock-store.js +13 -13
  157. package/dist/collection/components/kup-switch/kup-switch-declarations.js +12 -12
  158. package/dist/collection/components/kup-switch/kup-switch.js +402 -402
  159. package/dist/collection/components/kup-tab-bar/kup-tab-bar-declarations.js +10 -10
  160. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +443 -443
  161. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +35 -35
  162. package/dist/collection/components/kup-text-field/kup-text-field.js +1193 -1189
  163. package/dist/collection/components/kup-time-picker/kup-time-picker-declarations.js +14 -14
  164. package/dist/collection/components/kup-time-picker/kup-time-picker.js +921 -921
  165. package/dist/collection/components/kup-tree/kup-tree-declarations.js +43 -43
  166. package/dist/collection/components/kup-tree/kup-tree-faker.js +305 -305
  167. package/dist/collection/components/kup-tree/kup-tree-state.js +15 -15
  168. package/dist/collection/components/kup-tree/kup-tree.js +2479 -2479
  169. package/dist/collection/f-components/f-button/f-button-declarations.js +17 -17
  170. package/dist/collection/f-components/f-button/f-button.js +91 -91
  171. package/dist/collection/f-components/f-cell/f-cell-declarations.js +158 -158
  172. package/dist/collection/f-components/f-cell/f-cell.js +429 -429
  173. package/dist/collection/f-components/f-checkbox/f-checkbox-declarations.js +1 -1
  174. package/dist/collection/f-components/f-checkbox/f-checkbox.js +16 -16
  175. package/dist/collection/f-components/f-chip/f-chip-declarations.js +15 -15
  176. package/dist/collection/f-components/f-chip/f-chip.js +101 -101
  177. package/dist/collection/f-components/f-image/f-image-declarations.js +8 -8
  178. package/dist/collection/f-components/f-image/f-image.js +100 -100
  179. package/dist/collection/f-components/f-paginator/f-paginator-declarations.js +5 -5
  180. package/dist/collection/f-components/f-paginator/f-paginator-utils.js +28 -28
  181. package/dist/collection/f-components/f-paginator/f-paginator.js +86 -86
  182. package/dist/collection/f-components/f-switch/f-switch-declarations.js +1 -1
  183. package/dist/collection/f-components/f-switch/f-switch.js +12 -12
  184. package/dist/collection/f-components/f-text-field/f-text-field-declarations.js +1 -1
  185. package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +29 -29
  186. package/dist/collection/f-components/f-text-field/f-text-field.js +151 -151
  187. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +86 -86
  188. package/dist/collection/managers/kup-data/kup-data-column-helper.js +300 -300
  189. package/dist/collection/managers/kup-data/kup-data-declarations.js +10 -10
  190. package/dist/collection/managers/kup-data/kup-data-node-helper.js +165 -165
  191. package/dist/collection/managers/kup-data/kup-data-row-helper.js +28 -28
  192. package/dist/collection/managers/kup-data/kup-data.js +499 -499
  193. package/dist/collection/managers/kup-dates/kup-dates-declarations.js +43 -43
  194. package/dist/collection/managers/kup-dates/kup-dates.js +654 -654
  195. package/dist/collection/managers/kup-debug/kup-debug-declarations.js +20 -20
  196. package/dist/collection/managers/kup-debug/kup-debug.js +670 -670
  197. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position-declarations.js +27 -27
  198. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +244 -244
  199. package/dist/collection/managers/kup-interact/kup-interact-declarations.js +49 -49
  200. package/dist/collection/managers/kup-interact/kup-interact.js +397 -397
  201. package/dist/collection/managers/kup-language/kup-language-declarations.js +211 -211
  202. package/dist/collection/managers/kup-language/kup-language.js +151 -151
  203. package/dist/collection/managers/kup-manager/kup-manager-declarations.js +1 -1
  204. package/dist/collection/managers/kup-manager/kup-manager.js +303 -303
  205. package/dist/collection/managers/kup-math/kup-math-declarations.js +13 -13
  206. package/dist/collection/managers/kup-math/kup-math-helper.js +39 -39
  207. package/dist/collection/managers/kup-math/kup-math.js +413 -413
  208. package/dist/collection/managers/kup-objects/kup-objects-declarations.js +1 -1
  209. package/dist/collection/managers/kup-objects/kup-objects.js +387 -387
  210. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +10 -10
  211. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +334 -334
  212. package/dist/collection/managers/kup-search/kup-search-declarations.js +1 -1
  213. package/dist/collection/managers/kup-search/kup-search.js +75 -75
  214. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +177 -177
  215. package/dist/collection/managers/kup-theme/kup-theme.js +715 -715
  216. package/dist/collection/managers/kup-toolbar/kup-toolbar-declarations.js +9 -9
  217. package/dist/collection/managers/kup-toolbar/kup-toolbar.js +111 -111
  218. package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -1
  219. package/dist/collection/managers/kup-tooltip/kup-tooltip.js +229 -229
  220. package/dist/collection/types/GenericTypes.js +54 -54
  221. package/dist/collection/utils/cell-utils.js +156 -156
  222. package/dist/collection/utils/filters/filters-column-menu.js +360 -360
  223. package/dist/collection/utils/filters/filters-declarations.js +25 -25
  224. package/dist/collection/utils/filters/filters-rows.js +238 -238
  225. package/dist/collection/utils/filters/filters-tree-items.js +117 -117
  226. package/dist/collection/utils/filters/filters.js +287 -287
  227. package/dist/collection/utils/kup-column-menu/kup-column-menu-declarations.js +20 -20
  228. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +751 -751
  229. package/dist/collection/utils/utils.js +84 -80
  230. package/dist/collection/variables/GenericVariables.js +4 -4
  231. package/dist/components/kup-accordion.js +355 -355
  232. package/dist/components/kup-autocomplete2.js +31799 -31760
  233. package/dist/components/kup-box2.js +1469 -1405
  234. package/dist/components/kup-calendar.js +9788 -10280
  235. package/dist/components/kup-card.js +1 -1
  236. package/dist/components/kup-cell.js +325 -325
  237. package/dist/components/kup-chart.js +1 -1
  238. package/dist/components/kup-checkbox.js +1 -1
  239. package/dist/components/kup-chip.js +1 -1
  240. package/dist/components/kup-color-picker.js +1 -1
  241. package/dist/components/kup-combobox.js +1 -1
  242. package/dist/components/kup-dash-list.js +276 -276
  243. package/dist/components/kup-dash2.js +220 -220
  244. package/dist/components/kup-dashboard.js +549 -549
  245. package/dist/components/kup-data-table.js +1 -1
  246. package/dist/components/kup-date-picker.js +1 -1
  247. package/dist/components/kup-dialog.js +1 -1
  248. package/dist/components/kup-drawer.js +295 -295
  249. package/dist/components/kup-dropdown-button.js +1 -1
  250. package/dist/components/kup-echart2.js +7312 -6765
  251. package/dist/components/kup-family-tree.js +604 -604
  252. package/dist/components/kup-form.js +1 -1
  253. package/dist/components/kup-gauge.js +1 -1
  254. package/dist/components/kup-grid2.js +251 -251
  255. package/dist/components/kup-iframe.js +249 -249
  256. package/dist/components/kup-image-list.js +407 -407
  257. package/dist/components/kup-image.js +1 -1
  258. package/dist/components/kup-lazy.js +344 -344
  259. package/dist/components/kup-list.js +1 -1
  260. package/dist/components/kup-magic-box.js +461 -461
  261. package/dist/components/kup-nav-bar.js +284 -284
  262. package/dist/components/kup-numeric-picker.js +529 -529
  263. package/dist/components/kup-photo-frame.js +300 -300
  264. package/dist/components/kup-planner.js +1342 -1189
  265. package/dist/components/kup-probe.js +399 -399
  266. package/dist/components/kup-progress-bar.js +1 -1
  267. package/dist/components/kup-qlik.js +296 -296
  268. package/dist/components/kup-radio.js +1 -1
  269. package/dist/components/kup-rating.js +1 -1
  270. package/dist/components/kup-snackbar.js +273 -273
  271. package/dist/components/kup-spinner.js +1 -1
  272. package/dist/components/kup-switch.js +1 -1
  273. package/dist/components/kup-tab-bar.js +1 -1
  274. package/dist/components/kup-text-field.js +1 -1
  275. package/dist/components/kup-time-picker.js +1 -1
  276. package/dist/components/kup-tree.js +1 -1
  277. package/dist/esm/{GenericVariables-665de00a.js → GenericVariables-6dfdd433.js} +3 -3
  278. package/dist/esm/{component-120651a0.js → component-e86c51ea.js} +81 -2
  279. package/dist/esm/{f-button-024f0cfe.js → f-button-c6a69f75.js} +99 -99
  280. package/dist/esm/{f-button-declarations-b1b4cac4.js → f-button-declarations-fd4965d1.js} +16 -16
  281. package/dist/esm/{f-cell-90240a8c.js → f-cell-5822ea68.js} +472 -472
  282. package/dist/esm/{f-checkbox-9b3f5f5b.js → f-checkbox-c15911de.js} +23 -23
  283. package/dist/esm/{f-chip-2238ad43.js → f-chip-f46a03f5.js} +125 -125
  284. package/dist/esm/{f-image-f2e9bf79.js → f-image-f57832fa.js} +107 -107
  285. package/dist/esm/{f-paginator-utils-8cb3c023.js → f-paginator-utils-bafc463d.js} +1548 -1548
  286. package/dist/esm/{f-text-field-d231982c.js → f-text-field-15850e05.js} +172 -172
  287. package/dist/esm/{f-text-field-mdc-cee583ea.js → f-text-field-mdc-a1b4a919.js} +27 -28
  288. package/dist/esm/{index-8bd38435.js → index-238342f2.js} +78 -24
  289. package/dist/esm/ketchup.js +4 -4
  290. package/dist/esm/kup-accordion.entry.js +199 -200
  291. package/dist/esm/kup-autocomplete_27.entry.js +17546 -17508
  292. package/dist/esm/kup-box.entry.js +1294 -1232
  293. package/dist/esm/kup-calendar.entry.js +9557 -10050
  294. package/dist/esm/kup-cell.entry.js +172 -172
  295. package/dist/esm/kup-dash-list.entry.js +106 -106
  296. package/dist/esm/kup-dash_2.entry.js +162 -162
  297. package/dist/esm/kup-dashboard.entry.js +400 -401
  298. package/dist/esm/kup-drawer.entry.js +138 -138
  299. package/dist/esm/kup-echart.entry.js +7145 -6598
  300. package/dist/esm/kup-family-tree.entry.js +439 -439
  301. package/dist/esm/kup-iframe.entry.js +94 -94
  302. package/dist/esm/kup-image-list.entry.js +255 -256
  303. package/dist/esm/kup-lazy.entry.js +186 -186
  304. package/dist/esm/kup-magic-box.entry.js +298 -298
  305. package/dist/esm/{kup-manager-d1da769e.js → kup-manager-89dd9137.js} +7287 -7287
  306. package/dist/esm/kup-nav-bar.entry.js +130 -130
  307. package/dist/esm/kup-numeric-picker.entry.js +367 -368
  308. package/dist/esm/kup-photo-frame.entry.js +144 -144
  309. package/dist/esm/kup-planner.entry.js +1151 -1009
  310. package/dist/esm/kup-probe.entry.js +246 -246
  311. package/dist/esm/kup-qlik.entry.js +138 -138
  312. package/dist/esm/kup-snackbar.entry.js +116 -116
  313. package/dist/esm/loader.js +4 -4
  314. package/dist/ketchup/ketchup.esm.js +1 -1
  315. package/dist/ketchup/{p-83435e6c.entry.js → p-01d44efe.entry.js} +1 -1
  316. package/dist/ketchup/{p-8b46e7ce.js → p-1a8a06de.js} +1 -1
  317. package/dist/ketchup/{p-eda7f130.js → p-206245c0.js} +1 -1
  318. package/dist/ketchup/p-4bd63e97.entry.js +25 -0
  319. package/dist/ketchup/{p-651d89c8.entry.js → p-4da77173.entry.js} +1 -1
  320. package/dist/ketchup/{p-e1f1e661.entry.js → p-514dcb7d.entry.js} +1 -1
  321. package/dist/ketchup/{p-37067ee6.entry.js → p-51573263.entry.js} +1 -1
  322. package/dist/ketchup/{p-9f9b6656.js → p-54248440.js} +1 -1
  323. package/dist/ketchup/{p-1ad628fb.entry.js → p-5dfa5c49.entry.js} +1 -1
  324. package/dist/ketchup/{p-10d84b1b.js → p-6507e9eb.js} +7 -6
  325. package/dist/ketchup/{p-410c102a.js → p-673bb93e.js} +1 -1
  326. package/dist/ketchup/{p-063d4c27.entry.js → p-688478e9.entry.js} +1 -1
  327. package/dist/ketchup/p-6a5d95df.entry.js +1 -0
  328. package/dist/ketchup/p-6ec8629e.js +30 -0
  329. package/dist/ketchup/{p-a84f1d24.entry.js → p-785e8d74.entry.js} +1 -1
  330. package/dist/ketchup/{p-43b67de4.entry.js → p-78cc5a2d.entry.js} +1 -1
  331. package/dist/ketchup/{p-c42b80c1.entry.js → p-799f7f10.entry.js} +1 -1
  332. package/dist/ketchup/p-7e757c27.entry.js +1 -0
  333. package/dist/ketchup/p-843253dd.entry.js +1 -0
  334. package/dist/ketchup/{p-0d7d59c7.entry.js → p-84d3f676.entry.js} +1 -1
  335. package/dist/ketchup/p-8c1edebd.js +2 -0
  336. package/dist/ketchup/{p-5f3680f2.js → p-a5f15864.js} +1 -1
  337. package/dist/ketchup/p-af7202ff.entry.js +1 -0
  338. package/dist/ketchup/{p-89743989.entry.js → p-ba959bb5.entry.js} +1 -1
  339. package/dist/ketchup/{p-39a55c47.js → p-c1931214.js} +1 -1
  340. package/dist/ketchup/{p-3cf64473.js → p-c354c5d0.js} +1 -1
  341. package/dist/ketchup/p-cd8512d9.entry.js +39 -0
  342. package/dist/ketchup/{p-3432ebaf.entry.js → p-d4f86197.entry.js} +2 -2
  343. package/dist/ketchup/{p-163b18b9.entry.js → p-e59c2bc0.entry.js} +1 -1
  344. package/dist/ketchup/{p-f876125d.entry.js → p-f2fda43b.entry.js} +1 -1
  345. package/dist/ketchup/p-f4b6aa3f.entry.js +1 -0
  346. package/dist/ketchup/p-f4f5170c.entry.js +1 -0
  347. package/dist/ketchup/{p-27a56c87.js → p-fb03f2f5.js} +2 -2
  348. package/dist/loader/index.d.ts +1 -1
  349. package/dist/types/components/kup-accordion/kup-accordion-declarations.d.ts +20 -20
  350. package/dist/types/components/kup-accordion/kup-accordion.d.ts +80 -80
  351. package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +35 -35
  352. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +119 -119
  353. package/dist/types/components/kup-badge/kup-badge-declarations.d.ts +9 -9
  354. package/dist/types/components/kup-badge/kup-badge.d.ts +51 -51
  355. package/dist/types/components/kup-box/kup-box-declarations.d.ts +114 -113
  356. package/dist/types/components/kup-box/kup-box-state.d.ts +10 -10
  357. package/dist/types/components/kup-box/kup-box.d.ts +275 -270
  358. package/dist/types/components/kup-button/kup-button-declarations.d.ts +24 -24
  359. package/dist/types/components/kup-button/kup-button.d.ts +111 -111
  360. package/dist/types/components/kup-button-list/kup-button-list-declarations.d.ts +24 -24
  361. package/dist/types/components/kup-button-list/kup-button-list.d.ts +82 -82
  362. package/dist/types/components/kup-calendar/kup-calendar-declarations.d.ts +70 -70
  363. package/dist/types/components/kup-calendar/kup-calendar.d.ts +100 -100
  364. package/dist/types/components/kup-card/box/kup-card-box.d.ts +50 -50
  365. package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +39 -39
  366. package/dist/types/components/kup-card/built-in/kup-card-calendar.d.ts +2 -2
  367. package/dist/types/components/kup-card/built-in/kup-card-clock.d.ts +2 -2
  368. package/dist/types/components/kup-card/built-in/kup-card-column-drop-menu.d.ts +3 -3
  369. package/dist/types/components/kup-card/built-in/kup-card-message-box.d.ts +3 -3
  370. package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -2
  371. package/dist/types/components/kup-card/collapsible/kup-card-collapsible.d.ts +14 -14
  372. package/dist/types/components/kup-card/dialog/kup-card-dialog.d.ts +44 -44
  373. package/dist/types/components/kup-card/free/kup-card-free.d.ts +14 -14
  374. package/dist/types/components/kup-card/kup-card-declarations.d.ts +236 -236
  375. package/dist/types/components/kup-card/kup-card-helper.d.ts +27 -27
  376. package/dist/types/components/kup-card/kup-card.d.ts +159 -159
  377. package/dist/types/components/kup-card/scalable/kup-card-scalable.d.ts +56 -56
  378. package/dist/types/components/kup-card/standard/kup-card-standard.d.ts +92 -92
  379. package/dist/types/components/kup-cell/kup-cell-declarations.d.ts +10 -10
  380. package/dist/types/components/kup-cell/kup-cell.d.ts +67 -67
  381. package/dist/types/components/kup-chart/kup-chart-builder.d.ts +7 -7
  382. package/dist/types/components/kup-chart/kup-chart-declarations.d.ts +135 -135
  383. package/dist/types/components/kup-chart/kup-chart.d.ts +170 -170
  384. package/dist/types/components/kup-checkbox/kup-checkbox-declarations.d.ts +17 -17
  385. package/dist/types/components/kup-checkbox/kup-checkbox.d.ts +85 -85
  386. package/dist/types/components/kup-chip/kup-chip-declarations.d.ts +22 -22
  387. package/dist/types/components/kup-chip/kup-chip.d.ts +89 -89
  388. package/dist/types/components/kup-color-picker/kup-color-picker-declarations.d.ts +15 -15
  389. package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +89 -89
  390. package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +24 -24
  391. package/dist/types/components/kup-combobox/kup-combobox.d.ts +95 -95
  392. package/dist/types/components/kup-dash/kup-dash.d.ts +33 -33
  393. package/dist/types/components/kup-dash-list/kup-dash-list.d.ts +22 -22
  394. package/dist/types/components/kup-dashboard/kup-dashboard-declarations.d.ts +61 -61
  395. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +80 -80
  396. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +254 -254
  397. package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +25 -25
  398. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +36 -36
  399. package/dist/types/components/kup-data-table/kup-data-table.d.ts +444 -444
  400. package/dist/types/components/kup-date-picker/kup-date-picker-declarations.d.ts +20 -20
  401. package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +110 -110
  402. package/dist/types/components/kup-dialog/kup-dialog-declarations.d.ts +26 -26
  403. package/dist/types/components/kup-dialog/kup-dialog.d.ts +77 -77
  404. package/dist/types/components/kup-drawer/kup-drawer-declarations.d.ts +9 -9
  405. package/dist/types/components/kup-drawer/kup-drawer.d.ts +74 -74
  406. package/dist/types/components/kup-dropdown-button/kup-dropdown-button-declarations.d.ts +21 -21
  407. package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +161 -161
  408. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +62 -62
  409. package/dist/types/components/kup-echart/kup-echart.d.ts +111 -111
  410. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +38 -38
  411. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +87 -87
  412. package/dist/types/components/kup-form/kup-form-declarations.d.ts +64 -64
  413. package/dist/types/components/kup-form/kup-form.d.ts +83 -83
  414. package/dist/types/components/kup-gauge/kup-gauge-declarations.d.ts +25 -25
  415. package/dist/types/components/kup-gauge/kup-gauge.d.ts +147 -147
  416. package/dist/types/components/kup-grid/kup-grid-declarations.d.ts +9 -9
  417. package/dist/types/components/kup-grid/kup-grid.d.ts +48 -48
  418. package/dist/types/components/kup-iframe/kup-iframe-declarations.d.ts +9 -9
  419. package/dist/types/components/kup-iframe/kup-iframe.d.ts +49 -49
  420. package/dist/types/components/kup-image/canvas/kup-image-canvas-declarations.d.ts +23 -23
  421. package/dist/types/components/kup-image/canvas/kup-image-canvas-helper.d.ts +2 -2
  422. package/dist/types/components/kup-image/canvas/kup-image-canvas.d.ts +28 -28
  423. package/dist/types/components/kup-image/kup-image-declarations.d.ts +19 -19
  424. package/dist/types/components/kup-image/kup-image.d.ts +103 -103
  425. package/dist/types/components/kup-image-list/kup-image-list-declarations.d.ts +14 -14
  426. package/dist/types/components/kup-image-list/kup-image-list-state.d.ts +6 -6
  427. package/dist/types/components/kup-image-list/kup-image-list.d.ts +73 -73
  428. package/dist/types/components/kup-lazy/kup-lazy-declarations.d.ts +18 -18
  429. package/dist/types/components/kup-lazy/kup-lazy.d.ts +78 -78
  430. package/dist/types/components/kup-list/kup-list-declarations.d.ts +48 -48
  431. package/dist/types/components/kup-list/kup-list-helper.d.ts +6 -6
  432. package/dist/types/components/kup-list/kup-list.d.ts +128 -128
  433. package/dist/types/components/kup-magic-box/kup-magic-box-declarations.d.ts +21 -21
  434. package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +65 -65
  435. package/dist/types/components/kup-nav-bar/kup-nav-bar-declarations.d.ts +19 -19
  436. package/dist/types/components/kup-nav-bar/kup-nav-bar.d.ts +65 -65
  437. package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -19
  438. package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -121
  439. package/dist/types/components/kup-photo-frame/kup-photo-frame-declarations.d.ts +9 -9
  440. package/dist/types/components/kup-photo-frame/kup-photo-frame.d.ts +61 -61
  441. package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +127 -106
  442. package/dist/types/components/kup-planner/kup-planner-helper.d.ts +6 -6
  443. package/dist/types/components/kup-planner/kup-planner-state.d.ts +13 -0
  444. package/dist/types/components/kup-planner/kup-planner.d.ts +266 -212
  445. package/dist/types/components/kup-probe/kup-probe.d.ts +72 -72
  446. package/dist/types/components/kup-progress-bar/kup-progress-bar-declarations.d.ts +13 -13
  447. package/dist/types/components/kup-progress-bar/kup-progress-bar.d.ts +69 -69
  448. package/dist/types/components/kup-qlik/kup-qlik-declarations.d.ts +19 -19
  449. package/dist/types/components/kup-qlik/kup-qlik.d.ts +100 -100
  450. package/dist/types/components/kup-radio/kup-radio-declarations.d.ts +23 -23
  451. package/dist/types/components/kup-radio/kup-radio.d.ts +80 -80
  452. package/dist/types/components/kup-rating/kup-rating-declarations.d.ts +14 -14
  453. package/dist/types/components/kup-rating/kup-rating.d.ts +62 -62
  454. package/dist/types/components/kup-snackbar/kup-snackbar-declarations.d.ts +12 -12
  455. package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +84 -84
  456. package/dist/types/components/kup-spinner/kup-spinner-declarations.d.ts +14 -14
  457. package/dist/types/components/kup-spinner/kup-spinner.d.ts +79 -79
  458. package/dist/types/components/kup-state/kup-state.d.ts +3 -3
  459. package/dist/types/components/kup-state/kup-store.d.ts +4 -4
  460. package/dist/types/components/kup-state/mock-store.d.ts +8 -8
  461. package/dist/types/components/kup-switch/kup-switch-declarations.d.ts +15 -15
  462. package/dist/types/components/kup-switch/kup-switch.d.ts +80 -80
  463. package/dist/types/components/kup-tab-bar/kup-tab-bar-declarations.d.ts +21 -21
  464. package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +77 -77
  465. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +38 -38
  466. package/dist/types/components/kup-text-field/kup-text-field.d.ts +253 -253
  467. package/dist/types/components/kup-time-picker/kup-time-picker-declarations.d.ts +17 -17
  468. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +125 -125
  469. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +97 -97
  470. package/dist/types/components/kup-tree/kup-tree-faker.d.ts +54 -54
  471. package/dist/types/components/kup-tree/kup-tree-state.d.ts +14 -14
  472. package/dist/types/components/kup-tree/kup-tree.d.ts +362 -362
  473. package/dist/types/components.d.ts +98 -2
  474. package/dist/types/f-components/f-button/f-button-declarations.d.ts +41 -41
  475. package/dist/types/f-components/f-button/f-button.d.ts +3 -3
  476. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +162 -162
  477. package/dist/types/f-components/f-cell/f-cell.d.ts +3 -3
  478. package/dist/types/f-components/f-checkbox/f-checkbox-declarations.d.ts +15 -15
  479. package/dist/types/f-components/f-checkbox/f-checkbox.d.ts +3 -3
  480. package/dist/types/f-components/f-chip/f-chip-declarations.d.ts +29 -29
  481. package/dist/types/f-components/f-chip/f-chip.d.ts +3 -3
  482. package/dist/types/f-components/f-image/f-image-declarations.d.ts +36 -36
  483. package/dist/types/f-components/f-image/f-image.d.ts +3 -3
  484. package/dist/types/f-components/f-paginator/f-paginator-declarations.d.ts +22 -22
  485. package/dist/types/f-components/f-paginator/f-paginator-utils.d.ts +2 -2
  486. package/dist/types/f-components/f-paginator/f-paginator.d.ts +3 -3
  487. package/dist/types/f-components/f-switch/f-switch-declarations.d.ts +14 -14
  488. package/dist/types/f-components/f-switch/f-switch.d.ts +3 -3
  489. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +42 -42
  490. package/dist/types/f-components/f-text-field/f-text-field-mdc.d.ts +6 -6
  491. package/dist/types/f-components/f-text-field/f-text-field.d.ts +3 -3
  492. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +31 -31
  493. package/dist/types/managers/kup-data/kup-data-column-helper.d.ts +39 -39
  494. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +173 -173
  495. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +44 -44
  496. package/dist/types/managers/kup-data/kup-data-row-helper.d.ts +14 -14
  497. package/dist/types/managers/kup-data/kup-data.d.ts +86 -86
  498. package/dist/types/managers/kup-dates/kup-dates-declarations.d.ts +39 -39
  499. package/dist/types/managers/kup-dates/kup-dates.d.ts +207 -207
  500. package/dist/types/managers/kup-debug/kup-debug-declarations.d.ts +38 -38
  501. package/dist/types/managers/kup-debug/kup-debug.d.ts +95 -95
  502. package/dist/types/managers/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +50 -50
  503. package/dist/types/managers/kup-dynamic-position/kup-dynamic-position.d.ts +61 -61
  504. package/dist/types/managers/kup-interact/kup-interact-declarations.d.ts +128 -128
  505. package/dist/types/managers/kup-interact/kup-interact.d.ts +105 -105
  506. package/dist/types/managers/kup-language/kup-language-declarations.d.ts +225 -225
  507. package/dist/types/managers/kup-language/kup-language.d.ts +52 -52
  508. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +162 -162
  509. package/dist/types/managers/kup-manager/kup-manager.d.ts +95 -95
  510. package/dist/types/managers/kup-math/kup-math-declarations.d.ts +33 -33
  511. package/dist/types/managers/kup-math/kup-math-helper.d.ts +17 -17
  512. package/dist/types/managers/kup-math/kup-math.d.ts +147 -146
  513. package/dist/types/managers/kup-objects/kup-objects-declarations.d.ts +15 -15
  514. package/dist/types/managers/kup-objects/kup-objects.d.ts +210 -210
  515. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +28 -28
  516. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +62 -62
  517. package/dist/types/managers/kup-search/kup-search-declarations.d.ts +7 -7
  518. package/dist/types/managers/kup-search/kup-search.d.ts +20 -20
  519. package/dist/types/managers/kup-theme/kup-theme-declarations.d.ts +185 -185
  520. package/dist/types/managers/kup-theme/kup-theme.d.ts +127 -127
  521. package/dist/types/managers/kup-toolbar/kup-toolbar-declarations.d.ts +8 -8
  522. package/dist/types/managers/kup-toolbar/kup-toolbar.d.ts +39 -39
  523. package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -8
  524. package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +51 -51
  525. package/dist/types/stencil-public-runtime.d.ts +1 -0
  526. package/dist/types/types/GenericTypes.d.ts +110 -110
  527. package/dist/types/utils/cell-utils.d.ts +10 -10
  528. package/dist/types/utils/filters/filters-column-menu.d.ts +96 -96
  529. package/dist/types/utils/filters/filters-declarations.d.ts +39 -39
  530. package/dist/types/utils/filters/filters-rows.d.ts +30 -30
  531. package/dist/types/utils/filters/filters-tree-items.d.ts +19 -19
  532. package/dist/types/utils/filters/filters.d.ts +72 -72
  533. package/dist/types/utils/kup-column-menu/kup-column-menu-declarations.d.ts +19 -19
  534. package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +142 -142
  535. package/dist/types/utils/utils.d.ts +37 -35
  536. package/dist/types/variables/GenericVariables.d.ts +4 -4
  537. package/package.json +21 -16
  538. package/dist/cjs/tslib.es6-386654de.js +0 -87
  539. package/dist/esm/tslib.es6-8c2af864.js +0 -82
  540. package/dist/ketchup/p-0bcda0e2.entry.js +0 -1
  541. package/dist/ketchup/p-33aff1ca.entry.js +0 -25
  542. package/dist/ketchup/p-35b29b22.entry.js +0 -1
  543. package/dist/ketchup/p-36dac88e.js +0 -30
  544. package/dist/ketchup/p-489d55ff.entry.js +0 -39
  545. package/dist/ketchup/p-73c8d651.entry.js +0 -1
  546. package/dist/ketchup/p-7f59211b.js +0 -1
  547. package/dist/ketchup/p-9dcfbb1e.js +0 -2
  548. package/dist/ketchup/p-b2fd2dbf.entry.js +0 -1
  549. package/dist/ketchup/p-d1b050d0.entry.js +0 -27
  550. package/dist/ketchup/p-d6ea709e.entry.js +0 -1
  551. /package/dist/ketchup/{p-6c77a36c.js → p-0fd98ab4.js} +0 -0
  552. /package/dist/ketchup/{p-97e8ea42.js → p-ad2e21d2.js} +0 -0
@@ -1,2079 +1,2159 @@
1
- import { forceUpdate, h, Host, } from '@stencil/core';
2
- import { SortMode, } from '../kup-data-table/kup-data-table-declarations';
3
- import { KupBoxProps, } from './kup-box-declarations';
4
- import { getColumnByName } from '../../utils/cell-utils';
5
- import { filterRows, sortRows, paginateRows, } from '../kup-data-table/kup-data-table-helper';
6
- import { kupManagerInstance, } from '../../managers/kup-manager/kup-manager';
7
- import { KupBoxState } from './kup-box-state';
8
- import { getProps, identify, setProps } from '../../utils/utils';
9
- import { FImage } from '../../f-components/f-image/f-image';
10
- import { FChip } from '../../f-components/f-chip/f-chip';
11
- import { KupDebugCategory } from '../../managers/kup-debug/kup-debug-declarations';
12
- import { KupLanguageGeneric, KupLanguageSearch, } from '../../managers/kup-language/kup-language-declarations';
13
- import { componentWrapperId } from '../../variables/GenericVariables';
14
- import { KupThemeIconValues } from '../../managers/kup-theme/kup-theme-declarations';
15
- import { KupDragEffect, kupDraggableCellAttr, KupDropEventTypes, KupPointerEventTypes, } from '../../managers/kup-interact/kup-interact-declarations';
16
- import { FCell } from '../../f-components/f-cell/f-cell';
17
- import { FPaginator } from '../../f-components/f-paginator/f-paginator';
18
- import { FPaginatorMode } from '../../f-components/f-paginator/f-paginator-declarations';
19
- import { pageChange, rowsPerPageChange, } from '../../f-components/f-paginator/f-paginator-utils';
20
- import { FTextFieldMDC } from '../../f-components/f-text-field/f-text-field-mdc';
21
- export class KupBox {
22
- constructor() {
23
- this.state = new KupBoxState();
24
- /*-------------------------------------------------*/
25
- /* I n t e r n a l V a r i a b l e s */
26
- /*-------------------------------------------------*/
27
- /**
28
- * Instance of the KupManager class.
29
- */
30
- this.kupManager = kupManagerInstance();
31
- this.visibleColumns = [];
32
- this.rows = [];
33
- this.filteredRows = [];
34
- this.sectionRef = null;
35
- this.rowsRefs = [];
36
- this.hold = false;
37
- this.interactableDrag = [];
38
- this.interactableDrop = [];
39
- this.interactableTouch = [];
40
- this.collapsedSection = {};
41
- this.selectedRows = [];
42
- this.rowActionMenuOpened = undefined;
43
- this.currentPage = 1;
44
- this.currentRowsPerPage = 10;
45
- this.cardData = null;
46
- this.columns = 1;
47
- this.customStyle = '';
48
- this.data = null;
49
- this.dragEnabled = false;
50
- this.dropEnabled = false;
51
- this.dropOnSection = false;
52
- this.editableData = false;
53
- this.enableRowActions = false;
54
- this.globalFilter = false;
55
- this.globalFilterValue = '';
56
- this.kanban = null;
57
- this.layout = undefined;
58
- this.multiSelection = false;
59
- this.pageSelected = 1;
60
- this.pageSize = 10;
61
- this.pagination = false;
62
- this.rowsPerPage = undefined;
63
- this.scrollOnHover = false;
64
- this.selectBox = undefined;
65
- this.selectedRowsState = undefined;
66
- this.showSelection = true;
67
- this.sortBy = undefined;
68
- this.sortEnabled = false;
69
- this.stateId = '';
70
- this.store = undefined;
71
- this.swipeDisabled = false;
72
- }
73
- initWithPersistedState() {
74
- if (this.store && this.stateId) {
75
- const state = this.store.getState(this.stateId);
76
- if (state != null) {
77
- this.kupManager.debug.logMessage(this, 'Initialize with state for stateId ' +
78
- this.stateId +
79
- ': ' +
80
- state);
81
- // *** PROPS ***
82
- this.sortBy = this.state.sortBy;
83
- this.globalFilterValue = this.state.globalFilterValue;
84
- this.selectedRowsState = this.state.selectedRowsState;
85
- this.pageSelected = this.state.pageSelected;
86
- this.rowsPerPage = this.state.rowsPerPage;
87
- }
88
- }
89
- }
90
- persistState() {
91
- if (this.store && this.stateId) {
92
- let somethingChanged = false;
93
- if (!this.kupManager.objects.deepEqual(this.state.sortBy, this.sortBy)) {
94
- this.state.sortBy = this.sortBy;
95
- somethingChanged = true;
96
- }
97
- if (!this.kupManager.objects.deepEqual(this.state.globalFilterValue, this.globalFilterValue)) {
98
- this.state.globalFilterValue = this.globalFilterValue;
99
- somethingChanged = true;
100
- }
101
- if (!this.kupManager.objects.deepEqual(this.state.pageSelected, this.currentPage)) {
102
- this.state.pageSelected = this.currentPage;
103
- somethingChanged = true;
104
- }
105
- if (!this.kupManager.objects.deepEqual(this.state.rowsPerPage, this.currentRowsPerPage)) {
106
- this.state.rowsPerPage = this.currentRowsPerPage;
107
- somethingChanged = true;
108
- }
109
- const selectedRowsState = this.selectedRows.reduce((accumulator, row, currentIndex) => {
110
- const prefix = currentIndex > 0 ? ';' : '';
111
- return accumulator + prefix + row.id;
112
- }, '');
113
- if (!this.kupManager.objects.deepEqual(this.state.selectedRowsState, selectedRowsState)) {
114
- this.state.selectedRowsState = selectedRowsState;
115
- somethingChanged = true;
116
- }
117
- if (!this.state.load) {
118
- this.state.load = true;
119
- return;
120
- }
121
- if (somethingChanged) {
122
- this.kupManager.debug.logMessage(this, 'Persisting state for stateId ' +
123
- this.stateId +
124
- ': ' +
125
- this.state);
126
- this.store.persistState(this.stateId, this.state);
127
- }
128
- }
129
- }
130
- /*-------------------------------------------------*/
131
- /* W a t c h e r s */
132
- /*-------------------------------------------------*/
133
- rowsPerPageHandler(newValue) {
134
- this.currentRowsPerPage = newValue;
135
- }
136
- recalculateRows() {
137
- this.initRows();
138
- }
139
- onDataChanged() {
140
- identify(this.getRows());
141
- this.initVisibleColumns();
142
- this.initRows();
143
- this.checkLayout();
144
- }
145
- onLayoutChanged() {
146
- this.checkLayout();
147
- }
148
- onSelectBoxChanged() {
149
- this.handleAutomaticBoxSelection();
150
- }
151
- /*-------------------------------------------------*/
152
- /* P u b l i c M e t h o d s */
153
- /*-------------------------------------------------*/
154
- /**
155
- * Used to retrieve component's props values.
156
- * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
157
- * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
158
- */
159
- async getProps(descriptions) {
160
- return getProps(this, KupBoxProps, descriptions);
161
- }
162
- async loadRowActions(row, actions) {
163
- row.actions = actions;
164
- // show menu
165
- this.rowActionMenuOpened = row;
166
- }
167
- /**
168
- * This method is used to trigger a new render of the component.
169
- */
170
- async refresh() {
171
- forceUpdate(this);
172
- }
173
- /**
174
- * Sets the props to the component.
175
- * @param {GenericObject} props - Object containing props that will be set to the component.
176
- */
177
- async setProps(props) {
178
- setProps(this, KupBoxProps, props);
179
- }
180
- /*-------------------------------------------------*/
181
- /* P r i v a t e M e t h o d s */
182
- /*-------------------------------------------------*/
183
- getColumns() {
184
- return this.data && this.data.columns
185
- ? this.data.columns
186
- : [{ title: '', name: '', size: undefined }];
187
- }
188
- initVisibleColumns() {
189
- this.visibleColumns = this.getColumns().filter((column) => {
190
- if (column.hasOwnProperty('visible')) {
191
- return column.visible;
192
- }
193
- return true;
194
- });
195
- }
196
- getRows() {
197
- return this.data && this.data.rows ? this.data.rows : [];
198
- }
199
- initRows() {
200
- this.filteredRows = this.getRows();
201
- if (this.globalFilter && this.globalFilterValue) {
202
- // filtering rows
203
- this.filteredRows = filterRows(this.filteredRows, null, this.globalFilterValue, this.visibleColumns);
204
- }
205
- this.rows = this.sortRows(this.filteredRows);
206
- if (this.pagination) {
207
- this.rows = paginateRows(this.rows, this.currentPage, this.currentRowsPerPage, false);
208
- }
209
- }
210
- sortRows(rows) {
211
- let sortedRows = rows;
212
- if (this.sortBy) {
213
- // create 'fake' sortObject
214
- const sortObject = {
215
- column: this.sortBy,
216
- sortMode: SortMode.A,
217
- };
218
- sortedRows = sortRows(sortedRows, [sortObject]);
219
- }
220
- return sortedRows;
221
- }
222
- checkScrollOnHover() {
223
- if (!this.kupManager.scrollOnHover.isRegistered(this.boxContainer)) {
224
- if (this.scrollOnHover) {
225
- this.kupManager.scrollOnHover.register(this.boxContainer);
226
- }
227
- }
228
- else {
229
- if (!this.scrollOnHover) {
230
- this.kupManager.scrollOnHover.unregister(this.boxContainer);
231
- }
232
- }
233
- }
234
- checkLayout() {
235
- // check if there is a layout.
236
- // if not, create a default layout
237
- if (this.layout) {
238
- this.boxLayout = this.layout;
239
- return;
240
- }
241
- // only one section, containing all visible fields
242
- const section = {
243
- horizontal: false,
244
- sections: [],
245
- };
246
- // adding box objects to section
247
- const visibleColumns = this.visibleColumns;
248
- let size = visibleColumns.length;
249
- let content = [];
250
- let cnt = 0;
251
- while (size-- > 0) {
252
- content.push({
253
- column: visibleColumns[cnt++].name,
254
- });
255
- }
256
- section.content = content;
257
- // creating a new layout
258
- this.boxLayout = {
259
- sections: [section],
260
- };
261
- }
262
- onSortChange(e) {
263
- let column = getColumnByName(this.visibleColumns, e.detail.value);
264
- this.sortBy = column.name;
265
- }
266
- onGlobalFilterChange({ detail }) {
267
- let value = '';
268
- if (detail && detail.value) {
269
- value = detail.value;
270
- }
271
- this.globalFilterValue = value;
272
- }
273
- isSectionExpanded(row, section) {
274
- if (!row.id || !section.id) {
275
- return false;
276
- }
277
- return (this.collapsedSection[section.id] &&
278
- this.collapsedSection[section.id][row.id]);
279
- }
280
- handleAutomaticBoxSelection() {
281
- if (this.selectBox &&
282
- this.selectBox > 0 &&
283
- this.selectBox <= this.data.rows.length) {
284
- this.selectedRows = [];
285
- for (let boxRow of this.data.rows) {
286
- if (boxRow.id === (this.selectBox - 1).toString()) {
287
- this.selectedRows.push(boxRow);
288
- break;
289
- }
290
- }
291
- this.kupAutoBoxSelect.emit({
292
- comp: this,
293
- id: this.rootElement.id,
294
- row: this.selectedRows[0],
295
- });
296
- }
297
- }
298
- getEventDetails(el, e) {
299
- let boxObject = null;
300
- let cell = null;
301
- let row = null;
302
- let column = null;
303
- if (el) {
304
- boxObject =
305
- el.closest('.box-object') ||
306
- el.querySelector('.box-object') ||
307
- el.closest('.f-cell');
308
- }
309
- if (boxObject) {
310
- if (boxObject.classList.contains('f-cell')) {
311
- const props = boxObject['kup-get-cell-props']();
312
- cell = props.cell;
313
- column = props.column;
314
- row = props.row;
315
- }
316
- else {
317
- cell = boxObject['data-cell'];
318
- row = boxObject['data-row'];
319
- column = getColumnByName(this.visibleColumns, boxObject.dataset.column);
320
- }
321
- }
322
- else {
323
- }
324
- return {
325
- boxObject: boxObject ? boxObject : null,
326
- column: column ? column : null,
327
- cell: cell ? cell : null,
328
- originalEvent: e,
329
- row: row ? row : null,
330
- };
331
- }
332
- contextMenuHandler(e) {
333
- const details = this.getEventDetails(e.target, e);
334
- return details;
335
- }
336
- /**
337
- * Checks if the element is the svg that opens the "row actions menu"
338
- * @param element the element to check
339
- */
340
- checkIfElementIsActionMenuIcon(element) {
341
- if (element.tagName && element.parentElement) {
342
- return (element.tagName === 'svg' &&
343
- element.parentElement.classList.contains('row-actions-toggler'));
344
- }
345
- return false;
346
- }
347
- // event listeners
348
- onBoxClick({ target }, row) {
349
- if (!(target instanceof HTMLElement)) {
350
- return;
351
- }
352
- // searching parent
353
- let element = target;
354
- let classList = element.classList;
355
- while (!classList.contains('box-object') &&
356
- !classList.contains('box-section') &&
357
- !classList.contains('box')) {
358
- element = element.parentElement;
359
- if (element === null) {
360
- break;
361
- }
362
- classList = element.classList;
363
- }
364
- // evaluating column
365
- let column = null;
366
- if (classList.contains('box-object')) {
367
- column = element.dataset.column;
368
- }
369
- this.kupBoxClick.emit({
370
- comp: this,
371
- id: this.rootElement.id,
372
- row,
373
- column,
374
- });
375
- // selecting box
376
- if (this.multiSelection) {
377
- // triggering multi selection
378
- this.onSelectionCheckChange(row);
379
- }
380
- else {
381
- this.selectedRows = [row];
382
- }
383
- }
384
- onSelectionCheckChange(row) {
385
- var index = -1;
386
- for (let i = 0; i < this.selectedRows.length; i++) {
387
- const select = this.selectedRows[i];
388
- if (select.id === row.id) {
389
- index = i;
390
- break;
391
- }
392
- }
393
- if (index >= 0) {
394
- // remove row
395
- this.selectedRows.splice(index, 1);
396
- this.selectedRows = [...this.selectedRows];
397
- }
398
- else {
399
- // add row
400
- this.selectedRows = [...this.selectedRows, row];
401
- }
402
- this.kupBoxSelected.emit({
403
- comp: this,
404
- id: this.rootElement.id,
405
- rows: this.selectedRows,
406
- });
407
- }
408
- toggleSectionExpand(row, section) {
409
- // check if section / row has id
410
- if (!section.id) {
411
- // error
412
- console.error('cannot expand / collapse a section withoun an ID');
413
- return;
414
- }
415
- if (!row.id) {
416
- // error
417
- console.error('cannot expand / collapse a section of a row without ad id');
418
- return;
419
- }
420
- // check if section already in collapsedSection
421
- if (!this.collapsedSection[section.id]) {
422
- // adding element and row, setting it to expanded
423
- this.collapsedSection[section.id] = {};
424
- this.collapsedSection[section.id][row.id] = true;
425
- }
426
- else {
427
- const s = this.collapsedSection[section.id];
428
- if (!s[row.id]) {
429
- s[row.id] = true;
430
- }
431
- else {
432
- s[row.id] = !s[row.id];
433
- }
434
- }
435
- // triggering rendering
436
- this.collapsedSection = Object.assign({}, this.collapsedSection);
437
- }
438
- onRowAction(row) {
439
- if (!row) {
440
- return;
441
- }
442
- if (row === this.rowActionMenuOpened) {
443
- // closing menu
444
- this.rowActionMenuOpened = null;
445
- return;
446
- }
447
- if (row.actions) {
448
- // actions already loaded -> show menu
449
- this.rowActionMenuOpened = row;
450
- }
451
- else {
452
- // no actions -> triggering event
453
- this.kupRowActionMenuClick.emit({
454
- comp: this,
455
- id: this.rootElement.id,
456
- row,
457
- });
458
- }
459
- }
460
- onRowActionClick(row, action, index) {
461
- this.kupRowActionClick.emit({
462
- comp: this,
463
- id: this.rootElement.id,
464
- row,
465
- action,
466
- index,
467
- });
468
- }
469
- /**
470
- * see onDocumentClick in kup-combo
471
- */
472
- clickFunction(event) {
473
- try {
474
- const targets = event.composedPath();
475
- for (let target of targets) {
476
- if (this.checkIfElementIsActionMenuIcon(target)) {
477
- return;
478
- }
479
- }
480
- }
481
- catch (err) {
482
- if (this.checkIfElementIsActionMenuIcon(event.target)) {
483
- return;
484
- }
485
- }
486
- this.rowActionMenuOpened = null;
487
- }
488
- handlePageChange(pageNumber) {
489
- const newPage = pageChange(pageNumber, this.filteredRows.length, this.currentRowsPerPage);
490
- if (newPage) {
491
- this.currentPage = newPage;
492
- }
493
- }
494
- handleRowsPerPageChange(rowsNumber) {
495
- const newRows = rowsPerPageChange(rowsNumber, this.filteredRows.length);
496
- if (newRows) {
497
- this.currentRowsPerPage = newRows;
498
- this.adjustPaginator();
499
- }
500
- }
501
- adjustPaginator() {
502
- const numberOfRows = this.rows.length;
503
- // check if current page is valid
504
- const numberOfPages = Math.ceil(numberOfRows / this.currentRowsPerPage);
505
- if (this.currentPage > numberOfPages) {
506
- // reset page
507
- this.currentPage = 1;
508
- }
509
- }
510
- // render methods
511
- renderSectionAsCard(row) {
512
- let skipPush = false;
513
- const cardData = {
514
- button: [],
515
- cell: [],
516
- columns: [],
517
- image: [],
518
- progressbar: [],
519
- text: [],
520
- };
521
- for (let index = 0; index < this.data.columns.length; index++) {
522
- const column = this.data.columns[index];
523
- if (column.visible !== false) {
524
- cardData.cell.push(row.cells[column.name]);
525
- cardData.columns.push(column);
526
- }
527
- }
528
- //First cycle sets specific binds between cardIDs and cells
529
- for (const key in row.cells) {
530
- if (row.cells.hasOwnProperty(key)) {
531
- const cell = row.cells[key];
532
- if (cell.cardID !== undefined && cell.obj) {
533
- switch (cell.obj.p) {
534
- case 'BTN':
535
- do {
536
- cardData.button.push({});
537
- } while (cardData.button.length < cell.cardID);
538
- cardData.button[cell.cardID] = {
539
- label: cell.value,
540
- };
541
- break;
542
- case 'IMG':
543
- do {
544
- cardData.image.push({});
545
- } while (cardData.image.length < cell.cardID);
546
- cardData.image[cell.cardID] = {
547
- resource: cell.value,
548
- };
549
- break;
550
- case 'PGB':
551
- do {
552
- cardData.progressbar.push({});
553
- } while (cardData.progressbar.length < cell.cardID);
554
- cardData.progressbar[cell.cardID] = {
555
- value: cell.value,
556
- };
557
- break;
558
- default:
559
- do {
560
- cardData.text.push('');
561
- } while (cardData.text.length < cell.cardID);
562
- cardData.text[cell.cardID] = cell.value;
563
- break;
564
- }
565
- }
566
- }
567
- }
568
- //Second cycle sets leftover binds automatically
569
- for (const key in row.cells) {
570
- if (row.cells.hasOwnProperty(key)) {
571
- const cell = row.cells[key];
572
- if (cell.cardID === undefined && cell.obj) {
573
- skipPush = false;
574
- switch (cell.obj.p) {
575
- case 'BTN':
576
- for (let index = 0; index < cardData.button.length; index++) {
577
- //If there are empty elements, the first one will be used
578
- if (!Object.keys(cardData.button[index]).length) {
579
- cardData.button[index] = {
580
- label: cell.value,
581
- };
582
- skipPush = true;
583
- break;
584
- }
585
- }
586
- //Otherwise a new element will be pushed
587
- if (!skipPush) {
588
- cardData.button.push({
589
- label: cell.value,
590
- });
591
- }
592
- break;
593
- case 'IMG':
594
- for (let index = 0; index < cardData.image.length; index++) {
595
- //If there are empty elements, the first one will be used
596
- if (!Object.keys(cardData.image[index]).length) {
597
- cardData.image[index] = {
598
- resource: cell.value,
599
- };
600
- skipPush = true;
601
- break;
602
- }
603
- }
604
- //Otherwise a new element will be pushed
605
- if (!skipPush) {
606
- cardData.image.push({
607
- resource: cell.value,
608
- });
609
- }
610
- break;
611
- case 'PGB':
612
- for (let index = 0; index < cardData.progressbar.length; index++) {
613
- //If there are empty elements, the first one will be used
614
- if (!Object.keys(cardData.progressbar[index])
615
- .length) {
616
- cardData.progressbar[index] = {
617
- value: cell.value,
618
- };
619
- skipPush = true;
620
- break;
621
- }
622
- }
623
- //Otherwise a new element will be pushed
624
- if (!skipPush) {
625
- cardData.progressbar.push({
626
- value: cell.value,
627
- });
628
- }
629
- break;
630
- default:
631
- for (let index = 0; index < cardData.text.length; index++) {
632
- //If there are empty elements, the first one will be used
633
- if (cardData.text[index] === '') {
634
- cardData.text[index] = cell.value;
635
- skipPush = true;
636
- break;
637
- }
638
- }
639
- //Otherwise a new element will be pushed
640
- if (!skipPush) {
641
- cardData.text.push(cell.value);
642
- }
643
- break;
644
- }
645
- }
646
- }
647
- }
648
- return h("kup-card", Object.assign({ data: cardData }, this.cardData));
649
- }
650
- renderRow(row) {
651
- const visibleColumns = [...this.visibleColumns];
652
- let boxContent = null;
653
- // if layout in row, use that one
654
- let rowLayout = row.layout;
655
- if (!rowLayout) {
656
- // otherwise, use 'default' layout
657
- rowLayout = this.boxLayout;
658
- }
659
- let horizontal = false;
660
- if (rowLayout) {
661
- if (rowLayout.horizontal) {
662
- horizontal = true;
663
- }
664
- const sections = rowLayout.sections;
665
- let size = sections.length;
666
- let cnt = 0;
667
- if (size > 0) {
668
- boxContent = [];
669
- }
670
- // create fake parent section
671
- const parent = {
672
- horizontal: horizontal,
673
- };
674
- while (size-- > 0) {
675
- if (this.cardData !== null &&
676
- this.cardData !== undefined &&
677
- typeof this.cardData === 'object') {
678
- boxContent.push(this.renderSectionAsCard(row));
679
- }
680
- else {
681
- boxContent.push(this.renderSection(sections[cnt++], parent, row, visibleColumns));
682
- }
683
- }
684
- }
685
- var isSelected = false;
686
- for (let select of this.selectedRows) {
687
- if (select.id === row.id) {
688
- isSelected = true;
689
- }
690
- }
691
- let multiSel = null;
692
- if (this.multiSelection) {
693
- multiSel = (h("div", { class: "box-selection" }, h("kup-checkbox", { checked: isSelected })));
694
- }
695
- let rowObject = null;
696
- if (this.enableRowActions && !this.swipeDisabled) {
697
- const menuClass = {
698
- 'row-action-menu': true,
699
- open: row === this.rowActionMenuOpened,
700
- };
701
- let rowActionMenuContent = null;
702
- if (row.actions) {
703
- const actionItems = row.actions.map((item, index) => {
704
- const iconClass = `icon ${item.icon}`;
705
- return (h("li", { tabindex: "0", onClick: () => this.onRowActionClick(row, item, index) }, h("div", { class: iconClass }), h("div", { class: "text" }, item.text)));
706
- });
707
- rowActionMenuContent = h("ul", null, actionItems);
708
- }
709
- rowObject = (h("div", { class: "row-actions-wrapper" }, h("div", { class: "row-actions-toggler" }, h("svg", { version: "1.1", width: "24", height: "24", viewBox: "0 0 24 24", onClick: () => this.onRowAction(row) }, h("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" })), h("div", { class: menuClass }, rowActionMenuContent))));
710
- }
711
- let badges = null;
712
- if (row.badgeData && row.badgeData.length > 0) {
713
- badges = row.badgeData.map((badge) => (h("kup-badge", { text: badge.text, class: badge['className']
714
- ? `centered ${badge['className']}`
715
- : 'centered', imageData: badge.imageData })));
716
- }
717
- const boxClass = {
718
- box: true,
719
- draggable: this.dragEnabled,
720
- selected: this.showSelection && isSelected,
721
- column: !horizontal,
722
- };
723
- const rowStyle = row.style || {};
724
- return (h("div", { class: "box-wrapper", style: rowStyle }, h("div", { class: boxClass, onClick: (e) => this.onBoxClick(e, row), ref: (el) => this.rowsRefs.push(el) }, multiSel, boxContent, badges), rowObject));
725
- }
726
- renderSection(section, parent, row, visibleColumns) {
727
- let sectionContent = null;
728
- if (section.sections && section.sections.length > 0) {
729
- // rendering child
730
- const sections = section.sections;
731
- let size = sections.length;
732
- let cnt = 0;
733
- if (size > 0) {
734
- sectionContent = [];
735
- }
736
- while (size-- > 0) {
737
- sectionContent.push(this.renderSection(sections[cnt++], section, row, visibleColumns));
738
- }
739
- }
740
- else if (section.content) {
741
- // rendering box objects
742
- const content = section.content;
743
- let size = content.length;
744
- let cnt = 0;
745
- if (size > 0) {
746
- sectionContent = [];
747
- }
748
- while (size-- > 0) {
749
- sectionContent.push(this.renderBoxObject({
750
- boxObject: content[cnt++],
751
- row,
752
- visibleColumns,
753
- }, true));
754
- }
755
- }
756
- else if (visibleColumns.length > 0) {
757
- const column = visibleColumns[0];
758
- sectionContent = this.renderBoxObject({
759
- boxObject: { column: column.name },
760
- row,
761
- visibleColumns,
762
- });
763
- }
764
- const sectionExpanded = this.isSectionExpanded(row, section);
765
- const isGrid = !!section.columns;
766
- const sectionClass = {
767
- 'box-section': true,
768
- open: sectionExpanded,
769
- column: !isGrid && !section.horizontal,
770
- grid: isGrid,
771
- titled: !!section.title,
772
- 'last-child': !section.sections || section.sections.length === 0,
773
- };
774
- const sectionStyle = section.style || {};
775
- if (section.dim && parent) {
776
- sectionStyle.flex = `0 0 ${section.dim}`;
777
- if (parent.horizontal) {
778
- sectionStyle.maxWidth = section.dim;
779
- }
780
- else {
781
- sectionStyle.maxHeight = section.dim;
782
- }
783
- }
784
- if (isGrid) {
785
- sectionStyle['grid-template-columns'] = `repeat(${section.columns}, 1fr)`;
786
- }
787
- let sectionContainer = null;
788
- if (section.collapsible) {
789
- sectionClass['collapse-section'] = true;
790
- const contentClass = {
791
- content: true,
792
- };
793
- // TODO I18N
794
- let headerTitle = '';
795
- if (section.title) {
796
- headerTitle = section.title;
797
- }
798
- else if (sectionExpanded) {
799
- headerTitle = this.kupManager.language.translate(KupLanguageGeneric.COLLAPSE);
800
- }
801
- else {
802
- headerTitle = this.kupManager.language.translate(KupLanguageGeneric.EXPAND);
803
- }
804
- sectionContainer = (h("div", { class: sectionClass, style: sectionStyle }, h("div", { class: contentClass }, sectionContent), h("div", { class: "header", role: "button", onClick: (e) => {
805
- e.stopPropagation();
806
- this.toggleSectionExpand(row, section);
807
- } }, h("div", { class: "header-content" }, h("span", null, headerTitle), h(FImage, { resource: `${KupThemeIconValues.DROPDOWN}`, sizeX: "1.25em", sizeY: "1.25em", wrapperClass: sectionExpanded ? 'toggled' : '' })))));
808
- }
809
- else {
810
- const title = section.title ? h("h3", null, section.title) : null;
811
- sectionContainer = (h("div", { class: sectionClass, style: sectionStyle }, title, sectionContent));
812
- }
813
- return sectionContainer;
814
- }
815
- renderBoxObject({ boxObject, row, visibleColumns, }, fromSection) {
816
- const classObj = {
817
- 'box-object': true,
818
- };
819
- const boStyle = {};
820
- let column = null;
821
- let index = -1;
822
- for (let i = 0; i < visibleColumns.length; i++) {
823
- const c = visibleColumns[i];
824
- if (c.name === boxObject.column) {
825
- index = i;
826
- break;
827
- }
828
- }
829
- if (index >= 0) {
830
- column = visibleColumns[index];
831
- visibleColumns.splice(index, 1);
832
- }
833
- else if (fromSection) {
834
- column = this.data.columns.find((x) => x.name === boxObject.column);
835
- }
836
- const cell = row.cells[boxObject.column];
837
- let title = undefined;
838
- if (cell && !this.kupManager.objects.isEmptyKupObj(cell.obj)) {
839
- classObj['is-obj'] = true;
840
- if (this.kupManager.debug.isDebug()) {
841
- title =
842
- cell.obj.t + '; ' + cell.obj.p + '; ' + cell.obj.k + ';';
843
- }
844
- }
845
- const cellProps = {
846
- cell: cell,
847
- column: column,
848
- component: this,
849
- editable: this.editableData,
850
- renderKup: true,
851
- row: row,
852
- setSizes: true,
853
- shape: boxObject.shape,
854
- };
855
- return (h("div", { "data-cell": cell, "data-row": row, "data-column": boxObject.column, class: classObj, style: boStyle, title: title }, cell && column ? (h(FCell, Object.assign({}, cellProps))) : (h("span", null, boxObject.value))));
856
- }
857
- /**
858
- * Prepares the kanban sections by sorting the boxlist's data.
859
- * @returns {{jsx: VNode[], style: { [index: string]: string }}} jsx contains the virtual nodes of the Kanban sections, style contains the grid CSS settings.
860
- */
861
- kanbanMode() {
862
- // Testing whether there are columns to group by
863
- if (!this.kanban.columns || this.kanban.columns.length === 0) {
864
- this.kupManager.debug.logMessage(this, 'No columns to group by detected.', KupDebugCategory.ERROR);
865
- return {
866
- jsx: (h("div", { id: "empty-data-message", class: "box-wrapper" }, h("div", { ref: (el) => this.rowsRefs.push(el) }), this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA))),
867
- style: { 'grid-template-columns': `repeat(1, 1fr)` },
868
- };
869
- }
870
- const kanbanSections = [];
871
- // Creating empty sections from prop-defined labels
872
- if (this.kanban.labels) {
873
- for (let index = 0; index < this.kanban.labels.length; index++) {
874
- const key = this.kanban.labels[index];
875
- kanbanSections.push({ labels: key, nodes: [] });
876
- }
877
- }
878
- // Browsing all rows
879
- for (let index = 0; index < this.rows.length; index++) {
880
- let key = [];
881
- // Creating the key for the current row
882
- for (let j = 0; j < this.kanban.columns.length; j++) {
883
- try {
884
- key.push(this.rows[index].cells[this.kanban.columns[j]].value);
885
- }
886
- catch (error) {
887
- this.kupManager.debug.logMessage(this, error, KupDebugCategory.WARNING);
888
- }
889
- }
890
- const check = {
891
- found: false,
892
- index: null,
893
- };
894
- // Browsing key array to search whether the current key exists or not
895
- for (let j = 0; j < kanbanSections.length; j++) {
896
- let sortingKey = kanbanSections[j].labels;
897
- let found = true;
898
- for (let i = 0; i < sortingKey.length; i++) {
899
- if (key[i] !== sortingKey[i]) {
900
- found = false;
901
- break;
902
- }
903
- }
904
- if (found) {
905
- check.found = true;
906
- check.index = j;
907
- break;
908
- }
909
- }
910
- // If current key exists, box will be pushed into the existing array of virtual nodes
911
- if (check.found) {
912
- kanbanSections[check.index].nodes.push(this.renderRow(this.rows[index]));
913
- }
914
- else {
915
- // Otherwise, a new section will be defined starting with just the current virtal node
916
- kanbanSections.push({
917
- labels: key,
918
- nodes: [this.renderRow(this.rows[index])],
919
- });
920
- }
921
- }
922
- // Once the arrays are set, they need to be emptied into columns
923
- const kanbanJSX = [];
924
- for (let index = 0; index < kanbanSections.length; index++) {
925
- const sortingKey = kanbanSections[index].labels;
926
- const props = {
927
- data: [],
928
- };
929
- for (let index = 0; index < sortingKey.length; index++) {
930
- props.data.push({
931
- value: sortingKey[index],
932
- id: sortingKey[index],
933
- });
934
- }
935
- kanbanJSX.push(h("div", { class: "kanban-section" }, h(FChip, Object.assign({}, props)), kanbanSections[index].nodes));
936
- }
937
- return {
938
- jsx: kanbanJSX,
939
- style: {
940
- 'grid-template-columns': this.kanban.isStacked
941
- ? 'repeat(1fr)'
942
- : this.kanban.size
943
- ? `repeat(${Object.keys(kanbanSections).length}, ${this.kanban.size})`
944
- : `repeat(${Object.keys(kanbanSections).length}, 1fr)`,
945
- },
946
- };
947
- }
948
- didLoadInteractables() {
949
- this.interactableTouch.push(this.boxContainer);
950
- const tapCb = (e) => {
951
- if (this.hold) {
952
- this.hold = false;
953
- return;
954
- }
955
- switch (e.button) {
956
- case 2:
957
- this.kupBoxContextMenu.emit({
958
- comp: this,
959
- id: this.rootElement.id,
960
- details: this.contextMenuHandler(e),
961
- });
962
- break;
963
- }
964
- };
965
- const holdCb = (e) => {
966
- if (e.pointerType === 'pen' || e.pointerType === 'touch') {
967
- this.hold = true;
968
- this.kupBoxContextMenu.emit({
969
- comp: this,
970
- id: this.rootElement.id,
971
- details: this.contextMenuHandler(e),
972
- });
973
- }
974
- };
975
- this.kupManager.interact.on(this.boxContainer, KupPointerEventTypes.TAP, tapCb);
976
- this.kupManager.interact.on(this.boxContainer, KupPointerEventTypes.HOLD, holdCb);
977
- }
978
- didRenderInteractables() {
979
- if (this.dragEnabled) {
980
- for (let index = 0; index < this.rowsRefs.length; index++) {
981
- const row = this.rowsRefs[index];
982
- const dataCb = () => {
983
- const cellEl = this.rootElement.shadowRoot.querySelector('.box-object:hover');
984
- return {
985
- cell: cellEl['data-cell'],
986
- column: getColumnByName(this.visibleColumns, cellEl.dataset.column),
987
- id: this.rootElement.id,
988
- multiple: this.multiSelection,
989
- row: cellEl['data-row'],
990
- selectedRows: this.selectedRows,
991
- };
992
- };
993
- if (row && !this.interactableDrag.includes(row)) {
994
- this.interactableDrag.push(row);
995
- this.kupManager.interact.draggable(row, {
996
- allowFrom: '.box-object',
997
- cursorChecker() {
998
- return null;
999
- },
1000
- }, {
1001
- callback: dataCb,
1002
- }, KupDragEffect.BADGE);
1003
- }
1004
- }
1005
- }
1006
- if (this.dropEnabled) {
1007
- const dataCb = () => {
1008
- const receivingDetails = this.getEventDetails(this.rootElement.shadowRoot.querySelector('.box:hover'));
1009
- return {
1010
- cell: receivingDetails.cell,
1011
- column: receivingDetails.column,
1012
- id: this.rootElement.id,
1013
- row: receivingDetails.row,
1014
- };
1015
- };
1016
- if (!this.interactableDrop.includes(this.sectionRef)) {
1017
- this.interactableDrop.push(this.sectionRef);
1018
- this.kupManager.interact.dropzone(this.sectionRef, {
1019
- accept: `[${kupDraggableCellAttr}]`,
1020
- }, {
1021
- dispatcher: this.rootElement,
1022
- type: KupDropEventTypes.BOX,
1023
- });
1024
- }
1025
- for (let index = 0; index < this.rowsRefs.length; index++) {
1026
- const row = this.rowsRefs[index];
1027
- if (row && !this.interactableDrop.includes(row)) {
1028
- this.interactableDrop.push(row);
1029
- this.kupManager.interact.dropzone(row, {
1030
- accept: `[${kupDraggableCellAttr}]`,
1031
- }, {
1032
- callback: dataCb,
1033
- dispatcher: this.rootElement,
1034
- type: KupDropEventTypes.BOX,
1035
- });
1036
- }
1037
- }
1038
- }
1039
- }
1040
- /*-------------------------------------------------*/
1041
- /* L i f e c y c l e H o o k s */
1042
- /*-------------------------------------------------*/
1043
- componentWillLoad() {
1044
- this.kupManager.debug.logLoad(this, false);
1045
- if (this.rowsPerPage) {
1046
- this.currentRowsPerPage = this.rowsPerPage;
1047
- }
1048
- else if (this.pageSize) {
1049
- this.currentRowsPerPage = this.pageSize;
1050
- }
1051
- if (this.data &&
1052
- this.data.rows &&
1053
- this.currentRowsPerPage > this.data.rows.length) {
1054
- this.currentRowsPerPage = this.data.rows.length;
1055
- }
1056
- this.kupManager.language.register(this);
1057
- this.kupManager.theme.register(this);
1058
- this.onDataChanged();
1059
- this.adjustPaginator();
1060
- }
1061
- componentDidLoad() {
1062
- this.handleAutomaticBoxSelection();
1063
- // When component is created, then the listener is set. @See clickFunction for more details
1064
- document.addEventListener('click', this.clickFunction.bind(this));
1065
- this.currentPage = this.pageSelected;
1066
- if (this.multiSelection && this.selectedRowsState) {
1067
- this.selectedRows = [];
1068
- let selectedIds = this.selectedRowsState.split(';');
1069
- this.selectedRows = this.data.rows.filter((r) => {
1070
- return selectedIds.indexOf(r.id) >= 0;
1071
- });
1072
- }
1073
- this.didLoadInteractables();
1074
- this.kupDidLoad.emit({ comp: this, id: this.rootElement.id });
1075
- this.kupManager.debug.logLoad(this, true);
1076
- }
1077
- componentWillRender() {
1078
- this.kupManager.debug.logRender(this, false);
1079
- }
1080
- componentDidRender() {
1081
- const root = this.rootElement.shadowRoot;
1082
- if (root) {
1083
- const fs = root.querySelectorAll('.f-text-field');
1084
- for (let index = 0; index < fs.length; index++) {
1085
- FTextFieldMDC(fs[index]);
1086
- }
1087
- }
1088
- this.checkScrollOnHover();
1089
- this.persistState();
1090
- this.didRenderInteractables();
1091
- this.kupManager.debug.logRender(this, true);
1092
- }
1093
- render() {
1094
- const isKanban = !!(typeof this.kanban === 'object' && this.kanban !== null);
1095
- let sortPanel = null;
1096
- if (this.sortEnabled) {
1097
- // creating items
1098
- const visibleColumnsItems = this.visibleColumns.map((column) => {
1099
- const item = {
1100
- value: column.title,
1101
- id: column.name,
1102
- selected: column.name === this.sortBy,
1103
- };
1104
- return item;
1105
- });
1106
- const items = [{ value: '', id: '' }, ...visibleColumnsItems];
1107
- let textfieldData = {
1108
- label: this.kupManager.language.translate(KupLanguageGeneric.SORT_BY),
1109
- trailingIcon: true,
1110
- };
1111
- let listData = {
1112
- data: items,
1113
- selectable: true,
1114
- };
1115
- let data = {
1116
- 'kup-text-field': textfieldData,
1117
- 'kup-list': listData,
1118
- };
1119
- sortPanel = (h("div", { id: "sort-panel" }, h("kup-combobox", { data: data, initialValue: this.sortBy, "onkup-combobox-itemclick": (e) => this.onSortChange(e) })));
1120
- }
1121
- let filterPanel = null;
1122
- if (this.globalFilter) {
1123
- filterPanel = (h("div", { id: "global-filter" }, h("kup-text-field", { fullWidth: true, label: this.kupManager.language.translate(KupLanguageSearch.SEARCH), icon: KupThemeIconValues.SEARCH, initialValue: this.globalFilterValue, "onkup-textfield-input": (event) => {
1124
- window.clearTimeout(this.globalFilterTimeout);
1125
- this.globalFilterTimeout = window.setTimeout(() => this.onGlobalFilterChange(event), 600);
1126
- } })));
1127
- }
1128
- let paginator = null;
1129
- if (this.pagination) {
1130
- paginator = (h(FPaginator, { id: top ? 'top-paginator' : 'bottom-paginator', currentPage: this.currentPage, max: this.filteredRows.length, mode: FPaginatorMode.SIMPLE, perPage: this.currentRowsPerPage
1131
- ? this.currentRowsPerPage
1132
- : this.pageSize, onPageChange: (e) => this.handlePageChange(e.detail.value), onRowsChange: (e) => this.handleRowsPerPageChange(e.detail.value) }));
1133
- }
1134
- let boxContent = null;
1135
- let containerStyle = {};
1136
- if (this.rows.length === 0) {
1137
- boxContent = (h("div", { id: "empty-data-message", class: "box-wrapper" }, h("div", { class: "box", ref: (el) => this.rowsRefs.push(el) }, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA))));
1138
- containerStyle = { 'grid-template-columns': `repeat(1, 1fr)` };
1139
- }
1140
- else if (isKanban) {
1141
- const kanban = this.kanbanMode();
1142
- boxContent = kanban.jsx;
1143
- containerStyle = kanban.style;
1144
- }
1145
- else {
1146
- containerStyle = {
1147
- 'grid-template-columns': `repeat(${this.columns}, 1fr)`,
1148
- };
1149
- const rows = this.rows;
1150
- let size = rows.length;
1151
- let cnt = 0;
1152
- boxContent = [];
1153
- while (size-- > 0) {
1154
- boxContent.push(this.renderRow(rows[cnt++]));
1155
- }
1156
- }
1157
- return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h("div", { class: 'box-component', ref: (el) => (this.sectionRef = el) }, sortPanel, filterPanel, paginator, h("div", { class: isKanban ? 'is-kanban' : '', id: 'box-container', style: containerStyle, onContextMenu: (e) => {
1158
- e.preventDefault();
1159
- }, ref: (el) => (this.boxContainer =
1160
- el) }, boxContent)))));
1161
- }
1162
- disconnectedCallback() {
1163
- this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop));
1164
- this.kupManager.language.unregister(this);
1165
- this.kupManager.theme.unregister(this);
1166
- if (this.scrollOnHover) {
1167
- this.kupManager.scrollOnHover.unregister(this.boxContainer);
1168
- }
1169
- // When component is destroyed, then the listener is removed. @See clickFunction for more details
1170
- document.removeEventListener('click', this.clickFunction.bind(this));
1171
- this.kupDidUnload.emit({ comp: this, id: this.rootElement.id });
1172
- }
1173
- static get is() { return "kup-box"; }
1174
- static get encapsulation() { return "shadow"; }
1175
- static get originalStyleUrls() {
1176
- return {
1177
- "$": ["kup-box.scss"]
1178
- };
1179
- }
1180
- static get styleUrls() {
1181
- return {
1182
- "$": ["kup-box.css"]
1183
- };
1184
- }
1185
- static get properties() {
1186
- return {
1187
- "cardData": {
1188
- "type": "unknown",
1189
- "mutable": false,
1190
- "complexType": {
1191
- "original": "GenericObject",
1192
- "resolved": "GenericObject",
1193
- "references": {
1194
- "GenericObject": {
1195
- "location": "import",
1196
- "path": "../../types/GenericTypes"
1197
- }
1198
- }
1199
- },
1200
- "required": false,
1201
- "optional": false,
1202
- "docs": {
1203
- "tags": [{
1204
- "name": "default",
1205
- "text": "null"
1206
- }],
1207
- "text": "Data of the card linked to the box when the latter's layout must be a premade template."
1208
- },
1209
- "defaultValue": "null"
1210
- },
1211
- "columns": {
1212
- "type": "number",
1213
- "mutable": false,
1214
- "complexType": {
1215
- "original": "number",
1216
- "resolved": "number",
1217
- "references": {}
1218
- },
1219
- "required": false,
1220
- "optional": false,
1221
- "docs": {
1222
- "tags": [{
1223
- "name": "default",
1224
- "text": "1"
1225
- }],
1226
- "text": "Number of columns"
1227
- },
1228
- "attribute": "columns",
1229
- "reflect": false,
1230
- "defaultValue": "1"
1231
- },
1232
- "customStyle": {
1233
- "type": "string",
1234
- "mutable": false,
1235
- "complexType": {
1236
- "original": "string",
1237
- "resolved": "string",
1238
- "references": {}
1239
- },
1240
- "required": false,
1241
- "optional": false,
1242
- "docs": {
1243
- "tags": [{
1244
- "name": "default",
1245
- "text": "\"\""
1246
- }, {
1247
- "name": "see",
1248
- "text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
1249
- }],
1250
- "text": "Custom style of the component."
1251
- },
1252
- "attribute": "custom-style",
1253
- "reflect": false,
1254
- "defaultValue": "''"
1255
- },
1256
- "data": {
1257
- "type": "unknown",
1258
- "mutable": false,
1259
- "complexType": {
1260
- "original": "KupBoxData",
1261
- "resolved": "KupBoxData",
1262
- "references": {
1263
- "KupBoxData": {
1264
- "location": "import",
1265
- "path": "./kup-box-declarations"
1266
- }
1267
- }
1268
- },
1269
- "required": false,
1270
- "optional": false,
1271
- "docs": {
1272
- "tags": [{
1273
- "name": "default",
1274
- "text": "null"
1275
- }],
1276
- "text": "Actual data of the box."
1277
- },
1278
- "defaultValue": "null"
1279
- },
1280
- "dragEnabled": {
1281
- "type": "boolean",
1282
- "mutable": false,
1283
- "complexType": {
1284
- "original": "boolean",
1285
- "resolved": "boolean",
1286
- "references": {}
1287
- },
1288
- "required": false,
1289
- "optional": false,
1290
- "docs": {
1291
- "tags": [{
1292
- "name": "default",
1293
- "text": "false"
1294
- }],
1295
- "text": "Enable dragging"
1296
- },
1297
- "attribute": "drag-enabled",
1298
- "reflect": false,
1299
- "defaultValue": "false"
1300
- },
1301
- "dropEnabled": {
1302
- "type": "boolean",
1303
- "mutable": false,
1304
- "complexType": {
1305
- "original": "boolean",
1306
- "resolved": "boolean",
1307
- "references": {}
1308
- },
1309
- "required": false,
1310
- "optional": false,
1311
- "docs": {
1312
- "tags": [{
1313
- "name": "default",
1314
- "text": "false"
1315
- }],
1316
- "text": "Enable dropping"
1317
- },
1318
- "attribute": "drop-enabled",
1319
- "reflect": false,
1320
- "defaultValue": "false"
1321
- },
1322
- "dropOnSection": {
1323
- "type": "boolean",
1324
- "mutable": false,
1325
- "complexType": {
1326
- "original": "boolean",
1327
- "resolved": "boolean",
1328
- "references": {}
1329
- },
1330
- "required": false,
1331
- "optional": false,
1332
- "docs": {
1333
- "tags": [{
1334
- "name": "default",
1335
- "text": "false"
1336
- }],
1337
- "text": "Drop can be done in section"
1338
- },
1339
- "attribute": "drop-on-section",
1340
- "reflect": false,
1341
- "defaultValue": "false"
1342
- },
1343
- "editableData": {
1344
- "type": "boolean",
1345
- "mutable": false,
1346
- "complexType": {
1347
- "original": "boolean",
1348
- "resolved": "boolean",
1349
- "references": {}
1350
- },
1351
- "required": false,
1352
- "optional": false,
1353
- "docs": {
1354
- "tags": [{
1355
- "name": "default",
1356
- "text": "false"
1357
- }],
1358
- "text": "When set to true, editable cells will be rendered using input components."
1359
- },
1360
- "attribute": "editable-data",
1361
- "reflect": false,
1362
- "defaultValue": "false"
1363
- },
1364
- "enableRowActions": {
1365
- "type": "boolean",
1366
- "mutable": false,
1367
- "complexType": {
1368
- "original": "boolean",
1369
- "resolved": "boolean",
1370
- "references": {}
1371
- },
1372
- "required": false,
1373
- "optional": false,
1374
- "docs": {
1375
- "tags": [{
1376
- "name": "default",
1377
- "text": "false"
1378
- }],
1379
- "text": "If enabled, a button to load / display the row actions\r\nwill be displayed on the right of every box"
1380
- },
1381
- "attribute": "enable-row-actions",
1382
- "reflect": false,
1383
- "defaultValue": "false"
1384
- },
1385
- "globalFilter": {
1386
- "type": "boolean",
1387
- "mutable": false,
1388
- "complexType": {
1389
- "original": "boolean",
1390
- "resolved": "boolean",
1391
- "references": {}
1392
- },
1393
- "required": false,
1394
- "optional": false,
1395
- "docs": {
1396
- "tags": [{
1397
- "name": "default",
1398
- "text": "false"
1399
- }],
1400
- "text": "When set to true it activates the global filter."
1401
- },
1402
- "attribute": "global-filter",
1403
- "reflect": false,
1404
- "defaultValue": "false"
1405
- },
1406
- "globalFilterValue": {
1407
- "type": "string",
1408
- "mutable": true,
1409
- "complexType": {
1410
- "original": "string",
1411
- "resolved": "string",
1412
- "references": {}
1413
- },
1414
- "required": false,
1415
- "optional": false,
1416
- "docs": {
1417
- "tags": [{
1418
- "name": "default",
1419
- "text": "\"\""
1420
- }],
1421
- "text": "The value of the global filter."
1422
- },
1423
- "attribute": "global-filter-value",
1424
- "reflect": true,
1425
- "defaultValue": "''"
1426
- },
1427
- "kanban": {
1428
- "type": "unknown",
1429
- "mutable": false,
1430
- "complexType": {
1431
- "original": "KupBoxKanban",
1432
- "resolved": "KupBoxKanban",
1433
- "references": {
1434
- "KupBoxKanban": {
1435
- "location": "import",
1436
- "path": "./kup-box-declarations"
1437
- }
1438
- }
1439
- },
1440
- "required": false,
1441
- "optional": false,
1442
- "docs": {
1443
- "tags": [{
1444
- "name": "default",
1445
- "text": "null"
1446
- }],
1447
- "text": "Displays the boxlist as a Kanban."
1448
- },
1449
- "defaultValue": "null"
1450
- },
1451
- "layout": {
1452
- "type": "unknown",
1453
- "mutable": false,
1454
- "complexType": {
1455
- "original": "KupBoxLayout",
1456
- "resolved": "KupBoxLayout",
1457
- "references": {
1458
- "KupBoxLayout": {
1459
- "location": "import",
1460
- "path": "./kup-box-declarations"
1461
- }
1462
- }
1463
- },
1464
- "required": false,
1465
- "optional": false,
1466
- "docs": {
1467
- "tags": [{
1468
- "name": "default",
1469
- "text": "undefined"
1470
- }],
1471
- "text": "How the field will be displayed. If not present, a default one will be created."
1472
- }
1473
- },
1474
- "multiSelection": {
1475
- "type": "boolean",
1476
- "mutable": false,
1477
- "complexType": {
1478
- "original": "boolean",
1479
- "resolved": "boolean",
1480
- "references": {}
1481
- },
1482
- "required": false,
1483
- "optional": false,
1484
- "docs": {
1485
- "tags": [{
1486
- "name": "default",
1487
- "text": "false"
1488
- }],
1489
- "text": "Enable multi selection"
1490
- },
1491
- "attribute": "multi-selection",
1492
- "reflect": false,
1493
- "defaultValue": "false"
1494
- },
1495
- "pageSelected": {
1496
- "type": "number",
1497
- "mutable": false,
1498
- "complexType": {
1499
- "original": "number",
1500
- "resolved": "number",
1501
- "references": {}
1502
- },
1503
- "required": false,
1504
- "optional": false,
1505
- "docs": {
1506
- "tags": [{
1507
- "name": "default",
1508
- "text": "1"
1509
- }],
1510
- "text": "Current page number"
1511
- },
1512
- "attribute": "page-selected",
1513
- "reflect": false,
1514
- "defaultValue": "1"
1515
- },
1516
- "pageSize": {
1517
- "type": "number",
1518
- "mutable": false,
1519
- "complexType": {
1520
- "original": "number",
1521
- "resolved": "number",
1522
- "references": {}
1523
- },
1524
- "required": false,
1525
- "optional": false,
1526
- "docs": {
1527
- "tags": [{
1528
- "name": "default",
1529
- "text": "10"
1530
- }],
1531
- "text": "Number of boxes per page"
1532
- },
1533
- "attribute": "page-size",
1534
- "reflect": false,
1535
- "defaultValue": "10"
1536
- },
1537
- "pagination": {
1538
- "type": "boolean",
1539
- "mutable": false,
1540
- "complexType": {
1541
- "original": "boolean",
1542
- "resolved": "boolean",
1543
- "references": {}
1544
- },
1545
- "required": false,
1546
- "optional": false,
1547
- "docs": {
1548
- "tags": [{
1549
- "name": "default",
1550
- "text": "false"
1551
- }],
1552
- "text": "Enables pagination"
1553
- },
1554
- "attribute": "pagination",
1555
- "reflect": false,
1556
- "defaultValue": "false"
1557
- },
1558
- "rowsPerPage": {
1559
- "type": "number",
1560
- "mutable": false,
1561
- "complexType": {
1562
- "original": "number",
1563
- "resolved": "number",
1564
- "references": {}
1565
- },
1566
- "required": false,
1567
- "optional": false,
1568
- "docs": {
1569
- "tags": [{
1570
- "name": "default",
1571
- "text": "undefined"
1572
- }],
1573
- "text": "Number of current rows per page"
1574
- },
1575
- "attribute": "rows-per-page",
1576
- "reflect": false
1577
- },
1578
- "scrollOnHover": {
1579
- "type": "boolean",
1580
- "mutable": false,
1581
- "complexType": {
1582
- "original": "boolean",
1583
- "resolved": "boolean",
1584
- "references": {}
1585
- },
1586
- "required": false,
1587
- "optional": false,
1588
- "docs": {
1589
- "tags": [{
1590
- "name": "default",
1591
- "text": "false"
1592
- }],
1593
- "text": "Activates the scroll on hover function."
1594
- },
1595
- "attribute": "scroll-on-hover",
1596
- "reflect": false,
1597
- "defaultValue": "false"
1598
- },
1599
- "selectBox": {
1600
- "type": "number",
1601
- "mutable": false,
1602
- "complexType": {
1603
- "original": "number",
1604
- "resolved": "number",
1605
- "references": {}
1606
- },
1607
- "required": false,
1608
- "optional": false,
1609
- "docs": {
1610
- "tags": [{
1611
- "name": "default",
1612
- "text": "undefined"
1613
- }],
1614
- "text": "Automatically selects the box at the specified index"
1615
- },
1616
- "attribute": "select-box",
1617
- "reflect": false
1618
- },
1619
- "selectedRowsState": {
1620
- "type": "string",
1621
- "mutable": true,
1622
- "complexType": {
1623
- "original": "string",
1624
- "resolved": "string",
1625
- "references": {}
1626
- },
1627
- "required": false,
1628
- "optional": false,
1629
- "docs": {
1630
- "tags": [{
1631
- "name": "default",
1632
- "text": "undefined"
1633
- }],
1634
- "text": "Multiple selection"
1635
- },
1636
- "attribute": "selected-rows-state",
1637
- "reflect": false
1638
- },
1639
- "showSelection": {
1640
- "type": "boolean",
1641
- "mutable": false,
1642
- "complexType": {
1643
- "original": "boolean",
1644
- "resolved": "boolean",
1645
- "references": {}
1646
- },
1647
- "required": false,
1648
- "optional": false,
1649
- "docs": {
1650
- "tags": [{
1651
- "name": "default",
1652
- "text": "true"
1653
- }],
1654
- "text": "If enabled, highlights the selected box/boxes"
1655
- },
1656
- "attribute": "show-selection",
1657
- "reflect": false,
1658
- "defaultValue": "true"
1659
- },
1660
- "sortBy": {
1661
- "type": "string",
1662
- "mutable": true,
1663
- "complexType": {
1664
- "original": "string",
1665
- "resolved": "string",
1666
- "references": {}
1667
- },
1668
- "required": false,
1669
- "optional": false,
1670
- "docs": {
1671
- "tags": [{
1672
- "name": "default",
1673
- "text": "undefined"
1674
- }],
1675
- "text": "If sorting is enabled, specifies which column to sort"
1676
- },
1677
- "attribute": "sort-by",
1678
- "reflect": false
1679
- },
1680
- "sortEnabled": {
1681
- "type": "boolean",
1682
- "mutable": false,
1683
- "complexType": {
1684
- "original": "boolean",
1685
- "resolved": "boolean",
1686
- "references": {}
1687
- },
1688
- "required": false,
1689
- "optional": false,
1690
- "docs": {
1691
- "tags": [{
1692
- "name": "default",
1693
- "text": "false"
1694
- }],
1695
- "text": "Enable sorting"
1696
- },
1697
- "attribute": "sort-enabled",
1698
- "reflect": false,
1699
- "defaultValue": "false"
1700
- },
1701
- "stateId": {
1702
- "type": "string",
1703
- "mutable": false,
1704
- "complexType": {
1705
- "original": "string",
1706
- "resolved": "string",
1707
- "references": {}
1708
- },
1709
- "required": false,
1710
- "optional": false,
1711
- "docs": {
1712
- "tags": [],
1713
- "text": ""
1714
- },
1715
- "attribute": "state-id",
1716
- "reflect": false,
1717
- "defaultValue": "''"
1718
- },
1719
- "store": {
1720
- "type": "unknown",
1721
- "mutable": false,
1722
- "complexType": {
1723
- "original": "KupStore",
1724
- "resolved": "KupStore",
1725
- "references": {
1726
- "KupStore": {
1727
- "location": "import",
1728
- "path": "../kup-state/kup-store"
1729
- }
1730
- }
1731
- },
1732
- "required": false,
1733
- "optional": false,
1734
- "docs": {
1735
- "tags": [],
1736
- "text": ""
1737
- }
1738
- },
1739
- "swipeDisabled": {
1740
- "type": "boolean",
1741
- "mutable": false,
1742
- "complexType": {
1743
- "original": "boolean",
1744
- "resolved": "boolean",
1745
- "references": {}
1746
- },
1747
- "required": false,
1748
- "optional": false,
1749
- "docs": {
1750
- "tags": [{
1751
- "name": "default",
1752
- "text": "false"
1753
- }],
1754
- "text": "Disable swipe"
1755
- },
1756
- "attribute": "swipe-disabled",
1757
- "reflect": false,
1758
- "defaultValue": "false"
1759
- }
1760
- };
1761
- }
1762
- static get states() {
1763
- return {
1764
- "collapsedSection": {},
1765
- "selectedRows": {},
1766
- "rowActionMenuOpened": {},
1767
- "currentPage": {},
1768
- "currentRowsPerPage": {}
1769
- };
1770
- }
1771
- static get events() {
1772
- return [{
1773
- "method": "kupBoxClick",
1774
- "name": "kup-box-click",
1775
- "bubbles": true,
1776
- "cancelable": false,
1777
- "composed": true,
1778
- "docs": {
1779
- "tags": [],
1780
- "text": "Triggered when a box is clicked"
1781
- },
1782
- "complexType": {
1783
- "original": "KupBoxClickEventPayload",
1784
- "resolved": "KupBoxClickEventPayload",
1785
- "references": {
1786
- "KupBoxClickEventPayload": {
1787
- "location": "import",
1788
- "path": "./kup-box-declarations"
1789
- }
1790
- }
1791
- }
1792
- }, {
1793
- "method": "kupBoxSelected",
1794
- "name": "kup-box-selected",
1795
- "bubbles": true,
1796
- "cancelable": false,
1797
- "composed": true,
1798
- "docs": {
1799
- "tags": [],
1800
- "text": "Triggered when the multi selection checkbox changes value"
1801
- },
1802
- "complexType": {
1803
- "original": "KupBoxSelectedEventPayload",
1804
- "resolved": "KupBoxSelectedEventPayload",
1805
- "references": {
1806
- "KupBoxSelectedEventPayload": {
1807
- "location": "import",
1808
- "path": "./kup-box-declarations"
1809
- }
1810
- }
1811
- }
1812
- }, {
1813
- "method": "kupAutoBoxSelect",
1814
- "name": "kup-box-autoselect",
1815
- "bubbles": true,
1816
- "cancelable": false,
1817
- "composed": true,
1818
- "docs": {
1819
- "tags": [],
1820
- "text": "Triggered when a box is auto selected via selectBox prop"
1821
- },
1822
- "complexType": {
1823
- "original": "KupBoxAutoSelectEventPayload",
1824
- "resolved": "KupBoxAutoSelectEventPayload",
1825
- "references": {
1826
- "KupBoxAutoSelectEventPayload": {
1827
- "location": "import",
1828
- "path": "./kup-box-declarations"
1829
- }
1830
- }
1831
- }
1832
- }, {
1833
- "method": "kupRowActionMenuClick",
1834
- "name": "kup-box-rowactionmenuclick",
1835
- "bubbles": true,
1836
- "cancelable": false,
1837
- "composed": true,
1838
- "docs": {
1839
- "tags": [],
1840
- "text": "When the row menu action icon is click"
1841
- },
1842
- "complexType": {
1843
- "original": "KupBoxAutoSelectEventPayload",
1844
- "resolved": "KupBoxAutoSelectEventPayload",
1845
- "references": {
1846
- "KupBoxAutoSelectEventPayload": {
1847
- "location": "import",
1848
- "path": "./kup-box-declarations"
1849
- }
1850
- }
1851
- }
1852
- }, {
1853
- "method": "kupRowActionClick",
1854
- "name": "kup-box-rowactionclick",
1855
- "bubbles": true,
1856
- "cancelable": false,
1857
- "composed": true,
1858
- "docs": {
1859
- "tags": [],
1860
- "text": "When the row menu action icon is click"
1861
- },
1862
- "complexType": {
1863
- "original": "KupBoxRowActionClickEventPayload",
1864
- "resolved": "KupBoxRowActionClickEventPayload",
1865
- "references": {
1866
- "KupBoxRowActionClickEventPayload": {
1867
- "location": "import",
1868
- "path": "./kup-box-declarations"
1869
- }
1870
- }
1871
- }
1872
- }, {
1873
- "method": "kupDidLoad",
1874
- "name": "kup-box-didload",
1875
- "bubbles": true,
1876
- "cancelable": false,
1877
- "composed": true,
1878
- "docs": {
1879
- "tags": [],
1880
- "text": ""
1881
- },
1882
- "complexType": {
1883
- "original": "KupEventPayload",
1884
- "resolved": "KupEventPayload",
1885
- "references": {
1886
- "KupEventPayload": {
1887
- "location": "import",
1888
- "path": "../../types/GenericTypes"
1889
- }
1890
- }
1891
- }
1892
- }, {
1893
- "method": "kupDidUnload",
1894
- "name": "kup-box-didunload",
1895
- "bubbles": true,
1896
- "cancelable": false,
1897
- "composed": true,
1898
- "docs": {
1899
- "tags": [],
1900
- "text": "Triggered when stop propagation event"
1901
- },
1902
- "complexType": {
1903
- "original": "KupEventPayload",
1904
- "resolved": "KupEventPayload",
1905
- "references": {
1906
- "KupEventPayload": {
1907
- "location": "import",
1908
- "path": "../../types/GenericTypes"
1909
- }
1910
- }
1911
- }
1912
- }, {
1913
- "method": "kupBoxContextMenu",
1914
- "name": "kup-box-contextmenu",
1915
- "bubbles": true,
1916
- "cancelable": false,
1917
- "composed": true,
1918
- "docs": {
1919
- "tags": [],
1920
- "text": "Generic right click event on box."
1921
- },
1922
- "complexType": {
1923
- "original": "KupBoxContextMenuEventPayload",
1924
- "resolved": "KupBoxContextMenuEventPayload",
1925
- "references": {
1926
- "KupBoxContextMenuEventPayload": {
1927
- "location": "import",
1928
- "path": "./kup-box-declarations"
1929
- }
1930
- }
1931
- }
1932
- }];
1933
- }
1934
- static get methods() {
1935
- return {
1936
- "getProps": {
1937
- "complexType": {
1938
- "signature": "(descriptions?: boolean) => Promise<GenericObject>",
1939
- "parameters": [{
1940
- "tags": [{
1941
- "name": "param",
1942
- "text": "descriptions - When provided and true, the result will be the list of props with their description."
1943
- }],
1944
- "text": "- When provided and true, the result will be the list of props with their description."
1945
- }],
1946
- "references": {
1947
- "Promise": {
1948
- "location": "global"
1949
- },
1950
- "GenericObject": {
1951
- "location": "import",
1952
- "path": "../../types/GenericTypes"
1953
- }
1954
- },
1955
- "return": "Promise<GenericObject>"
1956
- },
1957
- "docs": {
1958
- "text": "Used to retrieve component's props values.",
1959
- "tags": [{
1960
- "name": "param",
1961
- "text": "descriptions - When provided and true, the result will be the list of props with their description."
1962
- }, {
1963
- "name": "returns",
1964
- "text": "List of props as object, each key will be a prop."
1965
- }]
1966
- }
1967
- },
1968
- "loadRowActions": {
1969
- "complexType": {
1970
- "signature": "(row: KupBoxRow, actions: KupDataRowAction[]) => Promise<void>",
1971
- "parameters": [{
1972
- "tags": [],
1973
- "text": ""
1974
- }, {
1975
- "tags": [],
1976
- "text": ""
1977
- }],
1978
- "references": {
1979
- "Promise": {
1980
- "location": "global"
1981
- },
1982
- "KupBoxRow": {
1983
- "location": "import",
1984
- "path": "./kup-box-declarations"
1985
- },
1986
- "KupDataRowAction": {
1987
- "location": "import",
1988
- "path": "../../managers/kup-data/kup-data-declarations"
1989
- }
1990
- },
1991
- "return": "Promise<void>"
1992
- },
1993
- "docs": {
1994
- "text": "",
1995
- "tags": []
1996
- }
1997
- },
1998
- "refresh": {
1999
- "complexType": {
2000
- "signature": "() => Promise<void>",
2001
- "parameters": [],
2002
- "references": {
2003
- "Promise": {
2004
- "location": "global"
2005
- }
2006
- },
2007
- "return": "Promise<void>"
2008
- },
2009
- "docs": {
2010
- "text": "This method is used to trigger a new render of the component.",
2011
- "tags": []
2012
- }
2013
- },
2014
- "setProps": {
2015
- "complexType": {
2016
- "signature": "(props: GenericObject) => Promise<void>",
2017
- "parameters": [{
2018
- "tags": [{
2019
- "name": "param",
2020
- "text": "props - Object containing props that will be set to the component."
2021
- }],
2022
- "text": "- Object containing props that will be set to the component."
2023
- }],
2024
- "references": {
2025
- "Promise": {
2026
- "location": "global"
2027
- },
2028
- "GenericObject": {
2029
- "location": "import",
2030
- "path": "../../types/GenericTypes"
2031
- }
2032
- },
2033
- "return": "Promise<void>"
2034
- },
2035
- "docs": {
2036
- "text": "Sets the props to the component.",
2037
- "tags": [{
2038
- "name": "param",
2039
- "text": "props - Object containing props that will be set to the component."
2040
- }]
2041
- }
2042
- }
2043
- };
2044
- }
2045
- static get elementRef() { return "rootElement"; }
2046
- static get watchers() {
2047
- return [{
2048
- "propName": "pageSize",
2049
- "methodName": "rowsPerPageHandler"
2050
- }, {
2051
- "propName": "globalFilterValue",
2052
- "methodName": "recalculateRows"
2053
- }, {
2054
- "propName": "sortBy",
2055
- "methodName": "recalculateRows"
2056
- }, {
2057
- "propName": "pagination",
2058
- "methodName": "recalculateRows"
2059
- }, {
2060
- "propName": "pageSize",
2061
- "methodName": "recalculateRows"
2062
- }, {
2063
- "propName": "currentPage",
2064
- "methodName": "recalculateRows"
2065
- }, {
2066
- "propName": "currentRowsPerPage",
2067
- "methodName": "recalculateRows"
2068
- }, {
2069
- "propName": "data",
2070
- "methodName": "onDataChanged"
2071
- }, {
2072
- "propName": "layout",
2073
- "methodName": "onLayoutChanged"
2074
- }, {
2075
- "propName": "selectBox",
2076
- "methodName": "onSelectBoxChanged"
2077
- }];
2078
- }
2079
- }
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f)
3
+ throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
5
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
6
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7
+ };
8
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
9
+ if (kind === "m")
10
+ throw new TypeError("Private method is not writable");
11
+ if (kind === "a" && !f)
12
+ throw new TypeError("Private accessor was defined without a setter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
14
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
+ };
17
+ var _KupBox_instances, _KupBox_intObserver, _KupBox_rowsRefs, _KupBox_navBarHeight, _KupBox_didRenderObservers, _KupBox_setObserver;
18
+ import { forceUpdate, h, Host, } from '@stencil/core';
19
+ import { SortMode, } from '../kup-data-table/kup-data-table-declarations';
20
+ import { KupBoxProps, } from './kup-box-declarations';
21
+ import { getColumnByName } from '../../utils/cell-utils';
22
+ import { filterRows, sortRows, paginateRows, } from '../kup-data-table/kup-data-table-helper';
23
+ import { kupManagerInstance, } from '../../managers/kup-manager/kup-manager';
24
+ import { KupBoxState } from './kup-box-state';
25
+ import { getProps, identify, setProps } from '../../utils/utils';
26
+ import { FImage } from '../../f-components/f-image/f-image';
27
+ import { FChip } from '../../f-components/f-chip/f-chip';
28
+ import { KupDebugCategory } from '../../managers/kup-debug/kup-debug-declarations';
29
+ import { KupLanguageGeneric, KupLanguageSearch, } from '../../managers/kup-language/kup-language-declarations';
30
+ import { componentWrapperId } from '../../variables/GenericVariables';
31
+ import { KupThemeIconValues } from '../../managers/kup-theme/kup-theme-declarations';
32
+ import { KupDragEffect, kupDraggableCellAttr, KupDropEventTypes, KupPointerEventTypes, } from '../../managers/kup-interact/kup-interact-declarations';
33
+ import { FCell } from '../../f-components/f-cell/f-cell';
34
+ import { FPaginator } from '../../f-components/f-paginator/f-paginator';
35
+ import { FPaginatorMode } from '../../f-components/f-paginator/f-paginator-declarations';
36
+ import { pageChange, rowsPerPageChange, } from '../../f-components/f-paginator/f-paginator-utils';
37
+ import { FTextFieldMDC } from '../../f-components/f-text-field/f-text-field-mdc';
38
+ export class KupBox {
39
+ constructor() {
40
+ _KupBox_instances.add(this);
41
+ this.state = new KupBoxState();
42
+ /*-------------------------------------------------*/
43
+ /* I n t e r n a l V a r i a b l e s */
44
+ /*-------------------------------------------------*/
45
+ /**
46
+ * Instance of the KupManager class.
47
+ */
48
+ this.kupManager = kupManagerInstance();
49
+ this.visibleColumns = [];
50
+ this.rows = [];
51
+ this.filteredRows = [];
52
+ this.sectionRef = null;
53
+ this.rowsRefs = [];
54
+ this.hold = false;
55
+ this.interactableDrag = [];
56
+ this.interactableDrop = [];
57
+ this.interactableTouch = [];
58
+ _KupBox_intObserver.set(this, undefined);
59
+ _KupBox_rowsRefs.set(this, []);
60
+ _KupBox_navBarHeight.set(this, 0);
61
+ this.collapsedSection = {};
62
+ this.selectedRows = [];
63
+ this.rowActionMenuOpened = undefined;
64
+ this.currentPage = 1;
65
+ this.currentRowsPerPage = 10;
66
+ this.cardData = null;
67
+ this.columns = 1;
68
+ this.customStyle = '';
69
+ this.data = null;
70
+ this.dragEnabled = false;
71
+ this.dropEnabled = false;
72
+ this.dropOnSection = false;
73
+ this.editableData = false;
74
+ this.enableRowActions = false;
75
+ this.globalFilter = false;
76
+ this.globalFilterValue = '';
77
+ this.kanban = null;
78
+ this.layout = undefined;
79
+ this.lazyLoadRows = false;
80
+ this.multiSelection = false;
81
+ this.pageSelected = 1;
82
+ this.pageSize = 10;
83
+ this.pagination = false;
84
+ this.rowsPerPage = undefined;
85
+ this.scrollOnHover = false;
86
+ this.selectBox = undefined;
87
+ this.selectedRowsState = undefined;
88
+ this.showSelection = true;
89
+ this.sortBy = undefined;
90
+ this.sortEnabled = false;
91
+ this.stateId = '';
92
+ this.store = undefined;
93
+ this.swipeDisabled = false;
94
+ }
95
+ initWithPersistedState() {
96
+ if (this.store && this.stateId) {
97
+ const state = this.store.getState(this.stateId);
98
+ if (state != null) {
99
+ this.kupManager.debug.logMessage(this, 'Initialize with state for stateId ' +
100
+ this.stateId +
101
+ ': ' +
102
+ state);
103
+ // *** PROPS ***
104
+ this.sortBy = this.state.sortBy;
105
+ this.globalFilterValue = this.state.globalFilterValue;
106
+ this.selectedRowsState = this.state.selectedRowsState;
107
+ this.pageSelected = this.state.pageSelected;
108
+ this.rowsPerPage = this.state.rowsPerPage;
109
+ }
110
+ }
111
+ }
112
+ persistState() {
113
+ if (this.store && this.stateId) {
114
+ let somethingChanged = false;
115
+ if (!this.kupManager.objects.deepEqual(this.state.sortBy, this.sortBy)) {
116
+ this.state.sortBy = this.sortBy;
117
+ somethingChanged = true;
118
+ }
119
+ if (!this.kupManager.objects.deepEqual(this.state.globalFilterValue, this.globalFilterValue)) {
120
+ this.state.globalFilterValue = this.globalFilterValue;
121
+ somethingChanged = true;
122
+ }
123
+ if (!this.kupManager.objects.deepEqual(this.state.pageSelected, this.currentPage)) {
124
+ this.state.pageSelected = this.currentPage;
125
+ somethingChanged = true;
126
+ }
127
+ if (!this.kupManager.objects.deepEqual(this.state.rowsPerPage, this.currentRowsPerPage)) {
128
+ this.state.rowsPerPage = this.currentRowsPerPage;
129
+ somethingChanged = true;
130
+ }
131
+ const selectedRowsState = this.selectedRows.reduce((accumulator, row, currentIndex) => {
132
+ const prefix = currentIndex > 0 ? ';' : '';
133
+ return accumulator + prefix + row.id;
134
+ }, '');
135
+ if (!this.kupManager.objects.deepEqual(this.state.selectedRowsState, selectedRowsState)) {
136
+ this.state.selectedRowsState = selectedRowsState;
137
+ somethingChanged = true;
138
+ }
139
+ if (!this.state.load) {
140
+ this.state.load = true;
141
+ return;
142
+ }
143
+ if (somethingChanged) {
144
+ this.kupManager.debug.logMessage(this, 'Persisting state for stateId ' +
145
+ this.stateId +
146
+ ': ' +
147
+ this.state);
148
+ this.store.persistState(this.stateId, this.state);
149
+ }
150
+ }
151
+ }
152
+ /*-------------------------------------------------*/
153
+ /* W a t c h e r s */
154
+ /*-------------------------------------------------*/
155
+ rowsPerPageHandler(newValue) {
156
+ this.currentRowsPerPage = newValue;
157
+ }
158
+ recalculateRows() {
159
+ this.initRows();
160
+ }
161
+ onDataChanged() {
162
+ identify(this.getRows());
163
+ this.initVisibleColumns();
164
+ this.initRows();
165
+ this.checkLayout();
166
+ }
167
+ onLayoutChanged() {
168
+ this.checkLayout();
169
+ }
170
+ onSelectBoxChanged() {
171
+ this.handleAutomaticBoxSelection();
172
+ }
173
+ /*-------------------------------------------------*/
174
+ /* P u b l i c M e t h o d s */
175
+ /*-------------------------------------------------*/
176
+ /**
177
+ * Used to retrieve component's props values.
178
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
179
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
180
+ */
181
+ async getProps(descriptions) {
182
+ return getProps(this, KupBoxProps, descriptions);
183
+ }
184
+ async loadRowActions(row, actions) {
185
+ row.actions = actions;
186
+ // show menu
187
+ this.rowActionMenuOpened = row;
188
+ }
189
+ /**
190
+ * This method is used to trigger a new render of the component.
191
+ */
192
+ async refresh() {
193
+ forceUpdate(this);
194
+ }
195
+ /**
196
+ * Sets the props to the component.
197
+ * @param {GenericObject} props - Object containing props that will be set to the component.
198
+ */
199
+ async setProps(props) {
200
+ setProps(this, KupBoxProps, props);
201
+ }
202
+ /*-------------------------------------------------*/
203
+ /* P r i v a t e M e t h o d s */
204
+ /*-------------------------------------------------*/
205
+ getColumns() {
206
+ return this.data && this.data.columns
207
+ ? this.data.columns
208
+ : [{ title: '', name: '', size: undefined }];
209
+ }
210
+ initVisibleColumns() {
211
+ this.visibleColumns = this.getColumns().filter((column) => {
212
+ if (column.hasOwnProperty('visible')) {
213
+ return column.visible;
214
+ }
215
+ return true;
216
+ });
217
+ }
218
+ getRows() {
219
+ return this.data && this.data.rows ? this.data.rows : [];
220
+ }
221
+ initRows() {
222
+ this.filteredRows = this.getRows();
223
+ if (this.globalFilter && this.globalFilterValue) {
224
+ // filtering rows
225
+ this.filteredRows = filterRows(this.filteredRows, null, this.globalFilterValue, this.visibleColumns);
226
+ }
227
+ this.rows = this.sortRows(this.filteredRows);
228
+ if (this.pagination) {
229
+ this.rows = paginateRows(this.rows, this.currentPage, this.currentRowsPerPage, false);
230
+ }
231
+ }
232
+ sortRows(rows) {
233
+ let sortedRows = rows;
234
+ if (this.sortBy) {
235
+ // create 'fake' sortObject
236
+ const sortObject = {
237
+ column: this.sortBy,
238
+ sortMode: SortMode.A,
239
+ };
240
+ sortedRows = sortRows(sortedRows, [sortObject]);
241
+ }
242
+ return sortedRows;
243
+ }
244
+ checkScrollOnHover() {
245
+ if (!this.kupManager.scrollOnHover.isRegistered(this.boxContainer)) {
246
+ if (this.scrollOnHover) {
247
+ this.kupManager.scrollOnHover.register(this.boxContainer);
248
+ }
249
+ }
250
+ else {
251
+ if (!this.scrollOnHover) {
252
+ this.kupManager.scrollOnHover.unregister(this.boxContainer);
253
+ }
254
+ }
255
+ }
256
+ checkLayout() {
257
+ // check if there is a layout.
258
+ // if not, create a default layout
259
+ if (this.layout) {
260
+ this.boxLayout = this.layout;
261
+ return;
262
+ }
263
+ // only one section, containing all visible fields
264
+ const section = {
265
+ horizontal: false,
266
+ sections: [],
267
+ };
268
+ // adding box objects to section
269
+ const visibleColumns = this.visibleColumns;
270
+ let size = visibleColumns.length;
271
+ let content = [];
272
+ let cnt = 0;
273
+ while (size-- > 0) {
274
+ content.push({
275
+ column: visibleColumns[cnt++].name,
276
+ });
277
+ }
278
+ section.content = content;
279
+ // creating a new layout
280
+ this.boxLayout = {
281
+ sections: [section],
282
+ };
283
+ }
284
+ onSortChange(e) {
285
+ let column = getColumnByName(this.visibleColumns, e.detail.value);
286
+ this.sortBy = column.name;
287
+ }
288
+ onGlobalFilterChange({ detail }) {
289
+ let value = '';
290
+ if (detail && detail.value) {
291
+ value = detail.value;
292
+ }
293
+ this.globalFilterValue = value;
294
+ }
295
+ isSectionExpanded(row, section) {
296
+ if (!row.id || !section.id) {
297
+ return false;
298
+ }
299
+ return (this.collapsedSection[section.id] &&
300
+ this.collapsedSection[section.id][row.id]);
301
+ }
302
+ handleAutomaticBoxSelection() {
303
+ if (this.selectBox &&
304
+ this.selectBox > 0 &&
305
+ this.selectBox <= this.data.rows.length) {
306
+ this.selectedRows = [];
307
+ for (let boxRow of this.data.rows) {
308
+ if (boxRow.id === (this.selectBox - 1).toString()) {
309
+ this.selectedRows.push(boxRow);
310
+ break;
311
+ }
312
+ }
313
+ this.kupAutoBoxSelect.emit({
314
+ comp: this,
315
+ id: this.rootElement.id,
316
+ row: this.selectedRows[0],
317
+ });
318
+ }
319
+ }
320
+ getEventDetails(el, e) {
321
+ let boxObject = null;
322
+ let cell = null;
323
+ let row = null;
324
+ let column = null;
325
+ if (el) {
326
+ boxObject =
327
+ el.closest('.box-object') ||
328
+ el.querySelector('.box-object') ||
329
+ el.closest('.f-cell');
330
+ }
331
+ if (boxObject) {
332
+ if (boxObject.classList.contains('f-cell')) {
333
+ const props = boxObject['kup-get-cell-props']();
334
+ cell = props.cell;
335
+ column = props.column;
336
+ row = props.row;
337
+ }
338
+ else {
339
+ cell = boxObject['data-cell'];
340
+ row = boxObject['data-row'];
341
+ column = getColumnByName(this.visibleColumns, boxObject.dataset.column);
342
+ }
343
+ }
344
+ else {
345
+ }
346
+ return {
347
+ boxObject: boxObject ? boxObject : null,
348
+ column: column ? column : null,
349
+ cell: cell ? cell : null,
350
+ originalEvent: e,
351
+ row: row ? row : null,
352
+ };
353
+ }
354
+ contextMenuHandler(e) {
355
+ const details = this.getEventDetails(e.target, e);
356
+ return details;
357
+ }
358
+ /**
359
+ * Checks if the element is the svg that opens the "row actions menu"
360
+ * @param element the element to check
361
+ */
362
+ checkIfElementIsActionMenuIcon(element) {
363
+ if (element.tagName && element.parentElement) {
364
+ return (element.tagName === 'svg' &&
365
+ element.parentElement.classList.contains('row-actions-toggler'));
366
+ }
367
+ return false;
368
+ }
369
+ // event listeners
370
+ onBoxClick({ target }, row) {
371
+ if (!(target instanceof HTMLElement)) {
372
+ return;
373
+ }
374
+ // searching parent
375
+ let element = target;
376
+ let classList = element.classList;
377
+ while (!classList.contains('box-object') &&
378
+ !classList.contains('box-section') &&
379
+ !classList.contains('box')) {
380
+ element = element.parentElement;
381
+ if (element === null) {
382
+ break;
383
+ }
384
+ classList = element.classList;
385
+ }
386
+ // evaluating column
387
+ let column = null;
388
+ if (classList.contains('box-object')) {
389
+ column = element.dataset.column;
390
+ }
391
+ this.kupBoxClick.emit({
392
+ comp: this,
393
+ id: this.rootElement.id,
394
+ row,
395
+ column,
396
+ });
397
+ // selecting box
398
+ if (this.multiSelection) {
399
+ // triggering multi selection
400
+ this.onSelectionCheckChange(row);
401
+ }
402
+ else {
403
+ this.selectedRows = [row];
404
+ }
405
+ }
406
+ onSelectionCheckChange(row) {
407
+ var index = -1;
408
+ for (let i = 0; i < this.selectedRows.length; i++) {
409
+ const select = this.selectedRows[i];
410
+ if (select.id === row.id) {
411
+ index = i;
412
+ break;
413
+ }
414
+ }
415
+ if (index >= 0) {
416
+ // remove row
417
+ this.selectedRows.splice(index, 1);
418
+ this.selectedRows = [...this.selectedRows];
419
+ }
420
+ else {
421
+ // add row
422
+ this.selectedRows = [...this.selectedRows, row];
423
+ }
424
+ this.kupBoxSelected.emit({
425
+ comp: this,
426
+ id: this.rootElement.id,
427
+ rows: this.selectedRows,
428
+ });
429
+ }
430
+ toggleSectionExpand(row, section) {
431
+ // check if section / row has id
432
+ if (!section.id) {
433
+ // error
434
+ console.error('cannot expand / collapse a section withoun an ID');
435
+ return;
436
+ }
437
+ if (!row.id) {
438
+ // error
439
+ console.error('cannot expand / collapse a section of a row without ad id');
440
+ return;
441
+ }
442
+ // check if section already in collapsedSection
443
+ if (!this.collapsedSection[section.id]) {
444
+ // adding element and row, setting it to expanded
445
+ this.collapsedSection[section.id] = {};
446
+ this.collapsedSection[section.id][row.id] = true;
447
+ }
448
+ else {
449
+ const s = this.collapsedSection[section.id];
450
+ if (!s[row.id]) {
451
+ s[row.id] = true;
452
+ }
453
+ else {
454
+ s[row.id] = !s[row.id];
455
+ }
456
+ }
457
+ // triggering rendering
458
+ this.collapsedSection = Object.assign({}, this.collapsedSection);
459
+ }
460
+ onRowAction(row) {
461
+ if (!row) {
462
+ return;
463
+ }
464
+ if (row === this.rowActionMenuOpened) {
465
+ // closing menu
466
+ this.rowActionMenuOpened = null;
467
+ return;
468
+ }
469
+ if (row.actions) {
470
+ // actions already loaded -> show menu
471
+ this.rowActionMenuOpened = row;
472
+ }
473
+ else {
474
+ // no actions -> triggering event
475
+ this.kupRowActionMenuClick.emit({
476
+ comp: this,
477
+ id: this.rootElement.id,
478
+ row,
479
+ });
480
+ }
481
+ }
482
+ onRowActionClick(row, action, index) {
483
+ this.kupRowActionClick.emit({
484
+ comp: this,
485
+ id: this.rootElement.id,
486
+ row,
487
+ action,
488
+ index,
489
+ });
490
+ }
491
+ /**
492
+ * see onDocumentClick in kup-combo
493
+ */
494
+ clickFunction(event) {
495
+ try {
496
+ const targets = event.composedPath();
497
+ for (let target of targets) {
498
+ if (this.checkIfElementIsActionMenuIcon(target)) {
499
+ return;
500
+ }
501
+ }
502
+ }
503
+ catch (err) {
504
+ if (this.checkIfElementIsActionMenuIcon(event.target)) {
505
+ return;
506
+ }
507
+ }
508
+ this.rowActionMenuOpened = null;
509
+ }
510
+ handlePageChange(pageNumber) {
511
+ const newPage = pageChange(pageNumber, this.filteredRows.length, this.currentRowsPerPage);
512
+ if (newPage) {
513
+ this.currentPage = newPage;
514
+ }
515
+ }
516
+ handleRowsPerPageChange(rowsNumber) {
517
+ const newRows = rowsPerPageChange(rowsNumber, this.filteredRows.length);
518
+ if (newRows) {
519
+ this.currentRowsPerPage = newRows;
520
+ this.adjustPaginator();
521
+ }
522
+ }
523
+ adjustPaginator() {
524
+ const numberOfRows = this.rows.length;
525
+ // check if current page is valid
526
+ const numberOfPages = Math.ceil(numberOfRows / this.currentRowsPerPage);
527
+ if (this.currentPage > numberOfPages) {
528
+ // reset page
529
+ this.currentPage = 1;
530
+ }
531
+ }
532
+ // render methods
533
+ renderSectionAsCard(row) {
534
+ let skipPush = false;
535
+ const cardData = {
536
+ button: [],
537
+ cell: [],
538
+ columns: [],
539
+ image: [],
540
+ progressbar: [],
541
+ text: [],
542
+ };
543
+ for (let index = 0; index < this.data.columns.length; index++) {
544
+ const column = this.data.columns[index];
545
+ if (column.visible !== false) {
546
+ cardData.cell.push(row.cells[column.name]);
547
+ cardData.columns.push(column);
548
+ }
549
+ }
550
+ //First cycle sets specific binds between cardIDs and cells
551
+ for (const key in row.cells) {
552
+ if (row.cells.hasOwnProperty(key)) {
553
+ const cell = row.cells[key];
554
+ if (cell.cardID !== undefined && cell.obj) {
555
+ switch (cell.obj.p) {
556
+ case 'BTN':
557
+ do {
558
+ cardData.button.push({});
559
+ } while (cardData.button.length < cell.cardID);
560
+ cardData.button[cell.cardID] = {
561
+ label: cell.value,
562
+ };
563
+ break;
564
+ case 'IMG':
565
+ do {
566
+ cardData.image.push({});
567
+ } while (cardData.image.length < cell.cardID);
568
+ cardData.image[cell.cardID] = {
569
+ resource: cell.value,
570
+ };
571
+ break;
572
+ case 'PGB':
573
+ do {
574
+ cardData.progressbar.push({});
575
+ } while (cardData.progressbar.length < cell.cardID);
576
+ cardData.progressbar[cell.cardID] = {
577
+ value: cell.value,
578
+ };
579
+ break;
580
+ default:
581
+ do {
582
+ cardData.text.push('');
583
+ } while (cardData.text.length < cell.cardID);
584
+ cardData.text[cell.cardID] = cell.value;
585
+ break;
586
+ }
587
+ }
588
+ }
589
+ }
590
+ //Second cycle sets leftover binds automatically
591
+ for (const key in row.cells) {
592
+ if (row.cells.hasOwnProperty(key)) {
593
+ const cell = row.cells[key];
594
+ if (cell.cardID === undefined && cell.obj) {
595
+ skipPush = false;
596
+ switch (cell.obj.p) {
597
+ case 'BTN':
598
+ for (let index = 0; index < cardData.button.length; index++) {
599
+ //If there are empty elements, the first one will be used
600
+ if (!Object.keys(cardData.button[index]).length) {
601
+ cardData.button[index] = {
602
+ label: cell.value,
603
+ };
604
+ skipPush = true;
605
+ break;
606
+ }
607
+ }
608
+ //Otherwise a new element will be pushed
609
+ if (!skipPush) {
610
+ cardData.button.push({
611
+ label: cell.value,
612
+ });
613
+ }
614
+ break;
615
+ case 'IMG':
616
+ for (let index = 0; index < cardData.image.length; index++) {
617
+ //If there are empty elements, the first one will be used
618
+ if (!Object.keys(cardData.image[index]).length) {
619
+ cardData.image[index] = {
620
+ resource: cell.value,
621
+ };
622
+ skipPush = true;
623
+ break;
624
+ }
625
+ }
626
+ //Otherwise a new element will be pushed
627
+ if (!skipPush) {
628
+ cardData.image.push({
629
+ resource: cell.value,
630
+ });
631
+ }
632
+ break;
633
+ case 'PGB':
634
+ for (let index = 0; index < cardData.progressbar.length; index++) {
635
+ //If there are empty elements, the first one will be used
636
+ if (!Object.keys(cardData.progressbar[index])
637
+ .length) {
638
+ cardData.progressbar[index] = {
639
+ value: cell.value,
640
+ };
641
+ skipPush = true;
642
+ break;
643
+ }
644
+ }
645
+ //Otherwise a new element will be pushed
646
+ if (!skipPush) {
647
+ cardData.progressbar.push({
648
+ value: cell.value,
649
+ });
650
+ }
651
+ break;
652
+ default:
653
+ for (let index = 0; index < cardData.text.length; index++) {
654
+ //If there are empty elements, the first one will be used
655
+ if (cardData.text[index] === '') {
656
+ cardData.text[index] = cell.value;
657
+ skipPush = true;
658
+ break;
659
+ }
660
+ }
661
+ //Otherwise a new element will be pushed
662
+ if (!skipPush) {
663
+ cardData.text.push(cell.value);
664
+ }
665
+ break;
666
+ }
667
+ }
668
+ }
669
+ }
670
+ return h("kup-card", Object.assign({ data: cardData }, this.cardData));
671
+ }
672
+ renderRow(row) {
673
+ const visibleColumns = [...this.visibleColumns];
674
+ let boxContent = null;
675
+ // if layout in row, use that one
676
+ let rowLayout = row.layout;
677
+ if (!rowLayout) {
678
+ // otherwise, use 'default' layout
679
+ rowLayout = this.boxLayout;
680
+ }
681
+ let horizontal = false;
682
+ if (rowLayout) {
683
+ if (rowLayout.horizontal) {
684
+ horizontal = true;
685
+ }
686
+ const sections = rowLayout.sections;
687
+ let size = sections.length;
688
+ let cnt = 0;
689
+ if (size > 0) {
690
+ boxContent = [];
691
+ }
692
+ // create fake parent section
693
+ const parent = {
694
+ horizontal: horizontal,
695
+ };
696
+ while (size-- > 0) {
697
+ if (this.cardData !== null &&
698
+ this.cardData !== undefined &&
699
+ typeof this.cardData === 'object') {
700
+ boxContent.push(this.renderSectionAsCard(row));
701
+ }
702
+ else {
703
+ boxContent.push(this.renderSection(sections[cnt++], parent, row, visibleColumns));
704
+ }
705
+ }
706
+ }
707
+ var isSelected = false;
708
+ for (let select of this.selectedRows) {
709
+ if (select.id === row.id) {
710
+ isSelected = true;
711
+ }
712
+ }
713
+ let multiSel = null;
714
+ if (this.multiSelection) {
715
+ multiSel = (h("div", { class: "box-selection" }, h("kup-checkbox", { checked: isSelected })));
716
+ }
717
+ let rowObject = null;
718
+ if (this.enableRowActions && !this.swipeDisabled) {
719
+ const menuClass = {
720
+ 'row-action-menu': true,
721
+ open: row === this.rowActionMenuOpened,
722
+ };
723
+ let rowActionMenuContent = null;
724
+ if (row.actions) {
725
+ const actionItems = row.actions.map((item, index) => {
726
+ const iconClass = `icon ${item.icon}`;
727
+ return (h("li", { tabindex: "0", onClick: () => this.onRowActionClick(row, item, index) }, h("div", { class: iconClass }), h("div", { class: "text" }, item.text)));
728
+ });
729
+ rowActionMenuContent = h("ul", null, actionItems);
730
+ }
731
+ rowObject = (h("div", { class: "row-actions-wrapper" }, h("div", { class: "row-actions-toggler" }, h("svg", { version: "1.1", width: "24", height: "24", viewBox: "0 0 24 24", onClick: () => this.onRowAction(row) }, h("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" })), h("div", { class: menuClass }, rowActionMenuContent))));
732
+ }
733
+ let badges = null;
734
+ if (row.badgeData && row.badgeData.length > 0) {
735
+ badges = row.badgeData.map((badge) => (h("kup-badge", { text: badge.text, class: badge['className']
736
+ ? `centered ${badge['className']}`
737
+ : 'centered', imageData: badge.imageData })));
738
+ }
739
+ const boxClass = {
740
+ box: true,
741
+ draggable: this.dragEnabled,
742
+ selected: this.showSelection && isSelected,
743
+ column: !horizontal,
744
+ };
745
+ const rowStyle = row.style || {};
746
+ return (h("div", { class: "box-wrapper", style: rowStyle, ref: (el) => __classPrivateFieldGet(this, _KupBox_rowsRefs, "f").push(el) }, h("div", { class: boxClass, onClick: (e) => this.onBoxClick(e, row), ref: (el) => this.rowsRefs.push(el) }, multiSel, boxContent, badges), rowObject));
747
+ }
748
+ renderSection(section, parent, row, visibleColumns) {
749
+ let sectionContent = null;
750
+ if (section.sections && section.sections.length > 0) {
751
+ // rendering child
752
+ const sections = section.sections;
753
+ let size = sections.length;
754
+ let cnt = 0;
755
+ if (size > 0) {
756
+ sectionContent = [];
757
+ }
758
+ while (size-- > 0) {
759
+ sectionContent.push(this.renderSection(sections[cnt++], section, row, visibleColumns));
760
+ }
761
+ }
762
+ else if (section.content) {
763
+ // rendering box objects
764
+ const content = section.content;
765
+ let size = content.length;
766
+ let cnt = 0;
767
+ if (size > 0) {
768
+ sectionContent = [];
769
+ }
770
+ while (size-- > 0) {
771
+ sectionContent.push(this.renderBoxObject({
772
+ boxObject: content[cnt++],
773
+ row,
774
+ visibleColumns,
775
+ }, true));
776
+ }
777
+ }
778
+ else if (visibleColumns.length > 0) {
779
+ const column = visibleColumns[0];
780
+ sectionContent = this.renderBoxObject({
781
+ boxObject: { column: column.name },
782
+ row,
783
+ visibleColumns,
784
+ });
785
+ }
786
+ const sectionExpanded = this.isSectionExpanded(row, section);
787
+ const isGrid = !!section.columns;
788
+ const sectionClass = {
789
+ 'box-section': true,
790
+ open: sectionExpanded,
791
+ column: !isGrid && !section.horizontal,
792
+ grid: isGrid,
793
+ titled: !!section.title,
794
+ 'last-child': !section.sections || section.sections.length === 0,
795
+ };
796
+ const sectionStyle = section.style || {};
797
+ if (section.dim && parent) {
798
+ sectionStyle.flex = `0 0 ${section.dim}`;
799
+ sectionStyle.overflow = 'hidden';
800
+ if (parent.horizontal) {
801
+ sectionStyle.maxWidth = section.dim;
802
+ }
803
+ else {
804
+ sectionStyle.maxHeight = section.dim;
805
+ }
806
+ }
807
+ if (isGrid) {
808
+ sectionStyle['grid-template-columns'] = `repeat(${section.columns}, 1fr)`;
809
+ }
810
+ let sectionContainer = null;
811
+ if (section.collapsible) {
812
+ sectionClass['collapse-section'] = true;
813
+ const contentClass = {
814
+ content: true,
815
+ };
816
+ // TODO I18N
817
+ let headerTitle = '';
818
+ if (section.title) {
819
+ headerTitle = section.title;
820
+ }
821
+ else if (sectionExpanded) {
822
+ headerTitle = this.kupManager.language.translate(KupLanguageGeneric.COLLAPSE);
823
+ }
824
+ else {
825
+ headerTitle = this.kupManager.language.translate(KupLanguageGeneric.EXPAND);
826
+ }
827
+ sectionContainer = (h("div", { class: sectionClass, style: sectionStyle }, h("div", { class: contentClass }, sectionContent), h("div", { class: "header", role: "button", onClick: (e) => {
828
+ e.stopPropagation();
829
+ this.toggleSectionExpand(row, section);
830
+ } }, h("div", { class: "header-content" }, h("span", null, headerTitle), h(FImage, { resource: `${KupThemeIconValues.DROPDOWN}`, sizeX: "1.25em", sizeY: "1.25em", wrapperClass: sectionExpanded ? 'toggled' : '' })))));
831
+ }
832
+ else {
833
+ const title = section.title ? h("h3", null, section.title) : null;
834
+ sectionContainer = (h("div", { class: sectionClass, style: sectionStyle }, title, sectionContent));
835
+ }
836
+ return sectionContainer;
837
+ }
838
+ renderBoxObject({ boxObject, row, visibleColumns, }, fromSection) {
839
+ const classObj = {
840
+ 'box-object': true,
841
+ };
842
+ const boStyle = {};
843
+ let column = null;
844
+ let index = -1;
845
+ for (let i = 0; i < visibleColumns.length; i++) {
846
+ const c = visibleColumns[i];
847
+ if (c.name === boxObject.column) {
848
+ index = i;
849
+ break;
850
+ }
851
+ }
852
+ if (index >= 0) {
853
+ column = visibleColumns[index];
854
+ visibleColumns.splice(index, 1);
855
+ }
856
+ else if (fromSection) {
857
+ column = this.data.columns.find((x) => x.name === boxObject.column);
858
+ }
859
+ const cell = row.cells[boxObject.column];
860
+ let title = undefined;
861
+ if (cell && !this.kupManager.objects.isEmptyKupObj(cell.obj)) {
862
+ classObj['is-obj'] = true;
863
+ if (this.kupManager.debug.isDebug()) {
864
+ title =
865
+ cell.obj.t + '; ' + cell.obj.p + '; ' + cell.obj.k + ';';
866
+ }
867
+ }
868
+ const cellProps = {
869
+ cell: cell,
870
+ column: column,
871
+ component: this,
872
+ editable: this.editableData,
873
+ renderKup: true,
874
+ row: row,
875
+ setSizes: true,
876
+ shape: boxObject.shape,
877
+ };
878
+ return (h("div", { "data-cell": cell, "data-row": row, "data-column": boxObject.column, class: classObj, style: boStyle, title: title }, cell && column ? (h(FCell, Object.assign({}, cellProps))) : (h("span", null, boxObject.value))));
879
+ }
880
+ /**
881
+ * Prepares the kanban sections by sorting the boxlist's data.
882
+ * @returns {{jsx: VNode[], style: { [index: string]: string }}} jsx contains the virtual nodes of the Kanban sections, style contains the grid CSS settings.
883
+ */
884
+ kanbanMode() {
885
+ // Testing whether there are columns to group by
886
+ if (!this.kanban.columns || this.kanban.columns.length === 0) {
887
+ this.kupManager.debug.logMessage(this, 'No columns to group by detected.', KupDebugCategory.ERROR);
888
+ return {
889
+ jsx: (h("div", { id: "empty-data-message", class: "box-wrapper" }, h("div", { ref: (el) => this.rowsRefs.push(el) }), this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA))),
890
+ style: { 'grid-template-columns': `repeat(1, 1fr)` },
891
+ };
892
+ }
893
+ const kanbanSections = [];
894
+ // Creating empty sections from prop-defined labels
895
+ if (this.kanban.labels) {
896
+ for (let index = 0; index < this.kanban.labels.length; index++) {
897
+ const key = this.kanban.labels[index];
898
+ kanbanSections.push({ labels: key, nodes: [] });
899
+ }
900
+ }
901
+ // Browsing all rows
902
+ for (let index = 0; index < this.rows.length; index++) {
903
+ let key = [];
904
+ // Creating the key for the current row
905
+ for (let j = 0; j < this.kanban.columns.length; j++) {
906
+ try {
907
+ key.push(this.rows[index].cells[this.kanban.columns[j]].value);
908
+ }
909
+ catch (error) {
910
+ this.kupManager.debug.logMessage(this, error, KupDebugCategory.WARNING);
911
+ }
912
+ }
913
+ const check = {
914
+ found: false,
915
+ index: null,
916
+ };
917
+ // Browsing key array to search whether the current key exists or not
918
+ for (let j = 0; j < kanbanSections.length; j++) {
919
+ let sortingKey = kanbanSections[j].labels;
920
+ let found = true;
921
+ for (let i = 0; i < sortingKey.length; i++) {
922
+ if (key[i] !== sortingKey[i]) {
923
+ found = false;
924
+ break;
925
+ }
926
+ }
927
+ if (found) {
928
+ check.found = true;
929
+ check.index = j;
930
+ break;
931
+ }
932
+ }
933
+ // If current key exists, box will be pushed into the existing array of virtual nodes
934
+ if (check.found) {
935
+ kanbanSections[check.index].nodes.push(this.renderRow(this.rows[index]));
936
+ }
937
+ else {
938
+ // Otherwise, a new section will be defined starting with just the current virtal node
939
+ kanbanSections.push({
940
+ labels: key,
941
+ nodes: [this.renderRow(this.rows[index])],
942
+ });
943
+ }
944
+ }
945
+ // Once the arrays are set, they need to be emptied into columns
946
+ const kanbanJSX = [];
947
+ for (let index = 0; index < kanbanSections.length; index++) {
948
+ const sortingKey = kanbanSections[index].labels;
949
+ const props = {
950
+ data: [],
951
+ };
952
+ for (let index = 0; index < sortingKey.length; index++) {
953
+ props.data.push({
954
+ value: sortingKey[index],
955
+ id: sortingKey[index],
956
+ });
957
+ }
958
+ kanbanJSX.push(h("div", { class: "kanban-section" }, h(FChip, Object.assign({}, props)), kanbanSections[index].nodes));
959
+ }
960
+ return {
961
+ jsx: kanbanJSX,
962
+ style: {
963
+ 'grid-template-columns': this.kanban.isStacked
964
+ ? 'repeat(1fr)'
965
+ : this.kanban.size
966
+ ? `repeat(${Object.keys(kanbanSections).length}, ${this.kanban.size})`
967
+ : `repeat(${Object.keys(kanbanSections).length}, 1fr)`,
968
+ },
969
+ };
970
+ }
971
+ didLoadInteractables() {
972
+ this.interactableTouch.push(this.boxContainer);
973
+ const tapCb = (e) => {
974
+ if (this.hold) {
975
+ this.hold = false;
976
+ return;
977
+ }
978
+ switch (e.button) {
979
+ case 2:
980
+ this.kupBoxContextMenu.emit({
981
+ comp: this,
982
+ id: this.rootElement.id,
983
+ details: this.contextMenuHandler(e),
984
+ });
985
+ break;
986
+ }
987
+ };
988
+ const holdCb = (e) => {
989
+ if (e.pointerType === 'pen' || e.pointerType === 'touch') {
990
+ this.hold = true;
991
+ this.kupBoxContextMenu.emit({
992
+ comp: this,
993
+ id: this.rootElement.id,
994
+ details: this.contextMenuHandler(e),
995
+ });
996
+ }
997
+ };
998
+ this.kupManager.interact.on(this.boxContainer, KupPointerEventTypes.TAP, tapCb);
999
+ this.kupManager.interact.on(this.boxContainer, KupPointerEventTypes.HOLD, holdCb);
1000
+ }
1001
+ didRenderInteractables() {
1002
+ if (this.dragEnabled) {
1003
+ for (let index = 0; index < this.rowsRefs.length; index++) {
1004
+ const row = this.rowsRefs[index];
1005
+ const dataCb = () => {
1006
+ const cellEl = this.rootElement.shadowRoot.querySelector('.box-object:hover');
1007
+ return {
1008
+ cell: cellEl['data-cell'],
1009
+ column: getColumnByName(this.visibleColumns, cellEl.dataset.column),
1010
+ id: this.rootElement.id,
1011
+ multiple: this.multiSelection,
1012
+ row: cellEl['data-row'],
1013
+ selectedRows: this.selectedRows,
1014
+ };
1015
+ };
1016
+ if (row && !this.interactableDrag.includes(row)) {
1017
+ this.interactableDrag.push(row);
1018
+ this.kupManager.interact.draggable(row, {
1019
+ allowFrom: '.box-object',
1020
+ cursorChecker() {
1021
+ return null;
1022
+ },
1023
+ }, {
1024
+ callback: dataCb,
1025
+ }, KupDragEffect.BADGE);
1026
+ }
1027
+ }
1028
+ }
1029
+ if (this.dropEnabled) {
1030
+ const dataCb = () => {
1031
+ const receivingDetails = this.getEventDetails(this.rootElement.shadowRoot.querySelector('.box:hover'));
1032
+ return {
1033
+ cell: receivingDetails.cell,
1034
+ column: receivingDetails.column,
1035
+ id: this.rootElement.id,
1036
+ row: receivingDetails.row,
1037
+ };
1038
+ };
1039
+ if (!this.interactableDrop.includes(this.sectionRef)) {
1040
+ this.interactableDrop.push(this.sectionRef);
1041
+ this.kupManager.interact.dropzone(this.sectionRef, {
1042
+ accept: `[${kupDraggableCellAttr}]`,
1043
+ }, {
1044
+ dispatcher: this.rootElement,
1045
+ type: KupDropEventTypes.BOX,
1046
+ });
1047
+ }
1048
+ for (let index = 0; index < this.rowsRefs.length; index++) {
1049
+ const row = this.rowsRefs[index];
1050
+ if (row && !this.interactableDrop.includes(row)) {
1051
+ this.interactableDrop.push(row);
1052
+ this.kupManager.interact.dropzone(row, {
1053
+ accept: `[${kupDraggableCellAttr}]`,
1054
+ }, {
1055
+ callback: dataCb,
1056
+ dispatcher: this.rootElement,
1057
+ type: KupDropEventTypes.BOX,
1058
+ });
1059
+ }
1060
+ }
1061
+ }
1062
+ }
1063
+ /*-------------------------------------------------*/
1064
+ /* L i f e c y c l e H o o k s */
1065
+ /*-------------------------------------------------*/
1066
+ componentWillLoad() {
1067
+ this.kupManager.debug.logLoad(this, false);
1068
+ if (this.rowsPerPage) {
1069
+ this.currentRowsPerPage = this.rowsPerPage;
1070
+ }
1071
+ else if (this.pageSize) {
1072
+ this.currentRowsPerPage = this.pageSize;
1073
+ }
1074
+ if (this.data &&
1075
+ this.data.rows &&
1076
+ this.currentRowsPerPage > this.data.rows.length) {
1077
+ this.currentRowsPerPage = this.data.rows.length;
1078
+ }
1079
+ this.kupManager.language.register(this);
1080
+ this.kupManager.theme.register(this);
1081
+ this.onDataChanged();
1082
+ this.adjustPaginator();
1083
+ if (document.querySelector('.header')) {
1084
+ __classPrivateFieldSet(this, _KupBox_navBarHeight, document.querySelector('.header').clientHeight, "f");
1085
+ }
1086
+ else {
1087
+ __classPrivateFieldSet(this, _KupBox_navBarHeight, 0, "f");
1088
+ }
1089
+ if (document.querySelector('.topbar')) {
1090
+ __classPrivateFieldSet(this, _KupBox_navBarHeight, __classPrivateFieldGet(this, _KupBox_navBarHeight, "f") + document.querySelector('.topbar').clientHeight, "f");
1091
+ }
1092
+ __classPrivateFieldGet(this, _KupBox_instances, "m", _KupBox_setObserver).call(this);
1093
+ }
1094
+ componentDidLoad() {
1095
+ this.handleAutomaticBoxSelection();
1096
+ // When component is created, then the listener is set. @See clickFunction for more details
1097
+ document.addEventListener('click', this.clickFunction.bind(this));
1098
+ this.currentPage = this.pageSelected;
1099
+ if (this.multiSelection && this.selectedRowsState) {
1100
+ this.selectedRows = [];
1101
+ let selectedIds = this.selectedRowsState.split(';');
1102
+ this.selectedRows = this.data.rows.filter((r) => {
1103
+ return selectedIds.indexOf(r.id) >= 0;
1104
+ });
1105
+ }
1106
+ this.didLoadInteractables();
1107
+ this.kupDidLoad.emit({ comp: this, id: this.rootElement.id });
1108
+ this.kupManager.debug.logLoad(this, true);
1109
+ }
1110
+ componentWillRender() {
1111
+ this.kupManager.debug.logRender(this, false);
1112
+ }
1113
+ componentDidRender() {
1114
+ const root = this.rootElement.shadowRoot;
1115
+ if (root) {
1116
+ const fs = root.querySelectorAll('.f-text-field');
1117
+ for (let index = 0; index < fs.length; index++) {
1118
+ FTextFieldMDC(fs[index]);
1119
+ }
1120
+ }
1121
+ this.checkScrollOnHover();
1122
+ this.persistState();
1123
+ this.didRenderInteractables();
1124
+ __classPrivateFieldGet(this, _KupBox_instances, "m", _KupBox_didRenderObservers).call(this);
1125
+ this.kupManager.debug.logRender(this, true);
1126
+ }
1127
+ render() {
1128
+ const isKanban = !!(typeof this.kanban === 'object' && this.kanban !== null);
1129
+ let sortPanel = null;
1130
+ if (this.sortEnabled) {
1131
+ // creating items
1132
+ const visibleColumnsItems = this.visibleColumns.map((column) => {
1133
+ const item = {
1134
+ value: column.title,
1135
+ id: column.name,
1136
+ selected: column.name === this.sortBy,
1137
+ };
1138
+ return item;
1139
+ });
1140
+ const items = [{ value: '', id: '' }, ...visibleColumnsItems];
1141
+ let textfieldData = {
1142
+ label: this.kupManager.language.translate(KupLanguageGeneric.SORT_BY),
1143
+ trailingIcon: true,
1144
+ };
1145
+ let listData = {
1146
+ data: items,
1147
+ selectable: true,
1148
+ };
1149
+ let data = {
1150
+ 'kup-text-field': textfieldData,
1151
+ 'kup-list': listData,
1152
+ };
1153
+ sortPanel = (h("div", { id: "sort-panel" }, h("kup-combobox", { data: data, initialValue: this.sortBy, "onkup-combobox-itemclick": (e) => this.onSortChange(e) })));
1154
+ }
1155
+ let filterPanel = null;
1156
+ if (this.globalFilter) {
1157
+ filterPanel = (h("div", { id: "global-filter" }, h("kup-text-field", { fullWidth: true, label: this.kupManager.language.translate(KupLanguageSearch.SEARCH), icon: KupThemeIconValues.SEARCH, initialValue: this.globalFilterValue, "onkup-textfield-input": (event) => {
1158
+ window.clearTimeout(this.globalFilterTimeout);
1159
+ this.globalFilterTimeout = window.setTimeout(() => this.onGlobalFilterChange(event), 600);
1160
+ } })));
1161
+ }
1162
+ let paginator = null;
1163
+ if (this.pagination) {
1164
+ paginator = (h(FPaginator, { id: top ? 'top-paginator' : 'bottom-paginator', currentPage: this.currentPage, max: this.filteredRows.length, mode: FPaginatorMode.SIMPLE, perPage: this.currentRowsPerPage
1165
+ ? this.currentRowsPerPage
1166
+ : this.pageSize, onPageChange: (e) => this.handlePageChange(e.detail.value), onRowsChange: (e) => this.handleRowsPerPageChange(e.detail.value) }));
1167
+ }
1168
+ let boxContent = null;
1169
+ let containerStyle = {};
1170
+ if (this.rows.length === 0) {
1171
+ boxContent = (h("div", { id: "empty-data-message", class: "box-wrapper" }, h("div", { class: "box", ref: (el) => this.rowsRefs.push(el) }, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA))));
1172
+ containerStyle = { 'grid-template-columns': `repeat(1, 1fr)` };
1173
+ }
1174
+ else if (isKanban) {
1175
+ const kanban = this.kanbanMode();
1176
+ boxContent = kanban.jsx;
1177
+ containerStyle = kanban.style;
1178
+ }
1179
+ else {
1180
+ containerStyle = {
1181
+ 'grid-template-columns': `repeat(${this.columns}, 1fr)`,
1182
+ };
1183
+ const rows = this.rows;
1184
+ let size = rows.length;
1185
+ let cnt = 0;
1186
+ boxContent = [];
1187
+ while (size-- > 0) {
1188
+ boxContent.push(this.renderRow(rows[cnt++]));
1189
+ }
1190
+ }
1191
+ return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h("div", { class: 'box-component', ref: (el) => (this.sectionRef = el) }, sortPanel, filterPanel, paginator, h("div", { class: isKanban ? 'is-kanban' : '', id: 'box-container', style: containerStyle, onContextMenu: (e) => {
1192
+ e.preventDefault();
1193
+ }, ref: (el) => (this.boxContainer =
1194
+ el) }, boxContent)))));
1195
+ }
1196
+ disconnectedCallback() {
1197
+ this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop));
1198
+ this.kupManager.language.unregister(this);
1199
+ this.kupManager.theme.unregister(this);
1200
+ if (this.scrollOnHover) {
1201
+ this.kupManager.scrollOnHover.unregister(this.boxContainer);
1202
+ }
1203
+ // When component is destroyed, then the listener is removed. @See clickFunction for more details
1204
+ document.removeEventListener('click', this.clickFunction.bind(this));
1205
+ this.kupDidUnload.emit({ comp: this, id: this.rootElement.id });
1206
+ }
1207
+ static get is() { return "kup-box"; }
1208
+ static get encapsulation() { return "shadow"; }
1209
+ static get originalStyleUrls() {
1210
+ return {
1211
+ "$": ["kup-box.scss"]
1212
+ };
1213
+ }
1214
+ static get styleUrls() {
1215
+ return {
1216
+ "$": ["kup-box.css"]
1217
+ };
1218
+ }
1219
+ static get properties() {
1220
+ return {
1221
+ "cardData": {
1222
+ "type": "unknown",
1223
+ "mutable": false,
1224
+ "complexType": {
1225
+ "original": "GenericObject",
1226
+ "resolved": "GenericObject",
1227
+ "references": {
1228
+ "GenericObject": {
1229
+ "location": "import",
1230
+ "path": "../../types/GenericTypes"
1231
+ }
1232
+ }
1233
+ },
1234
+ "required": false,
1235
+ "optional": false,
1236
+ "docs": {
1237
+ "tags": [{
1238
+ "name": "default",
1239
+ "text": "null"
1240
+ }],
1241
+ "text": "Data of the card linked to the box when the latter's layout must be a premade template."
1242
+ },
1243
+ "defaultValue": "null"
1244
+ },
1245
+ "columns": {
1246
+ "type": "number",
1247
+ "mutable": false,
1248
+ "complexType": {
1249
+ "original": "number",
1250
+ "resolved": "number",
1251
+ "references": {}
1252
+ },
1253
+ "required": false,
1254
+ "optional": false,
1255
+ "docs": {
1256
+ "tags": [{
1257
+ "name": "default",
1258
+ "text": "1"
1259
+ }],
1260
+ "text": "Number of columns"
1261
+ },
1262
+ "attribute": "columns",
1263
+ "reflect": false,
1264
+ "defaultValue": "1"
1265
+ },
1266
+ "customStyle": {
1267
+ "type": "string",
1268
+ "mutable": false,
1269
+ "complexType": {
1270
+ "original": "string",
1271
+ "resolved": "string",
1272
+ "references": {}
1273
+ },
1274
+ "required": false,
1275
+ "optional": false,
1276
+ "docs": {
1277
+ "tags": [{
1278
+ "name": "default",
1279
+ "text": "\"\""
1280
+ }, {
1281
+ "name": "see",
1282
+ "text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
1283
+ }],
1284
+ "text": "Custom style of the component."
1285
+ },
1286
+ "attribute": "custom-style",
1287
+ "reflect": false,
1288
+ "defaultValue": "''"
1289
+ },
1290
+ "data": {
1291
+ "type": "unknown",
1292
+ "mutable": false,
1293
+ "complexType": {
1294
+ "original": "KupBoxData",
1295
+ "resolved": "KupBoxData",
1296
+ "references": {
1297
+ "KupBoxData": {
1298
+ "location": "import",
1299
+ "path": "./kup-box-declarations"
1300
+ }
1301
+ }
1302
+ },
1303
+ "required": false,
1304
+ "optional": false,
1305
+ "docs": {
1306
+ "tags": [{
1307
+ "name": "default",
1308
+ "text": "null"
1309
+ }],
1310
+ "text": "Actual data of the box."
1311
+ },
1312
+ "defaultValue": "null"
1313
+ },
1314
+ "dragEnabled": {
1315
+ "type": "boolean",
1316
+ "mutable": false,
1317
+ "complexType": {
1318
+ "original": "boolean",
1319
+ "resolved": "boolean",
1320
+ "references": {}
1321
+ },
1322
+ "required": false,
1323
+ "optional": false,
1324
+ "docs": {
1325
+ "tags": [{
1326
+ "name": "default",
1327
+ "text": "false"
1328
+ }],
1329
+ "text": "Enable dragging"
1330
+ },
1331
+ "attribute": "drag-enabled",
1332
+ "reflect": false,
1333
+ "defaultValue": "false"
1334
+ },
1335
+ "dropEnabled": {
1336
+ "type": "boolean",
1337
+ "mutable": false,
1338
+ "complexType": {
1339
+ "original": "boolean",
1340
+ "resolved": "boolean",
1341
+ "references": {}
1342
+ },
1343
+ "required": false,
1344
+ "optional": false,
1345
+ "docs": {
1346
+ "tags": [{
1347
+ "name": "default",
1348
+ "text": "false"
1349
+ }],
1350
+ "text": "Enable dropping"
1351
+ },
1352
+ "attribute": "drop-enabled",
1353
+ "reflect": false,
1354
+ "defaultValue": "false"
1355
+ },
1356
+ "dropOnSection": {
1357
+ "type": "boolean",
1358
+ "mutable": false,
1359
+ "complexType": {
1360
+ "original": "boolean",
1361
+ "resolved": "boolean",
1362
+ "references": {}
1363
+ },
1364
+ "required": false,
1365
+ "optional": false,
1366
+ "docs": {
1367
+ "tags": [{
1368
+ "name": "default",
1369
+ "text": "false"
1370
+ }],
1371
+ "text": "Drop can be done in section"
1372
+ },
1373
+ "attribute": "drop-on-section",
1374
+ "reflect": false,
1375
+ "defaultValue": "false"
1376
+ },
1377
+ "editableData": {
1378
+ "type": "boolean",
1379
+ "mutable": false,
1380
+ "complexType": {
1381
+ "original": "boolean",
1382
+ "resolved": "boolean",
1383
+ "references": {}
1384
+ },
1385
+ "required": false,
1386
+ "optional": false,
1387
+ "docs": {
1388
+ "tags": [{
1389
+ "name": "default",
1390
+ "text": "false"
1391
+ }],
1392
+ "text": "When set to true, editable cells will be rendered using input components."
1393
+ },
1394
+ "attribute": "editable-data",
1395
+ "reflect": false,
1396
+ "defaultValue": "false"
1397
+ },
1398
+ "enableRowActions": {
1399
+ "type": "boolean",
1400
+ "mutable": false,
1401
+ "complexType": {
1402
+ "original": "boolean",
1403
+ "resolved": "boolean",
1404
+ "references": {}
1405
+ },
1406
+ "required": false,
1407
+ "optional": false,
1408
+ "docs": {
1409
+ "tags": [{
1410
+ "name": "default",
1411
+ "text": "false"
1412
+ }],
1413
+ "text": "If enabled, a button to load / display the row actions\r\nwill be displayed on the right of every box"
1414
+ },
1415
+ "attribute": "enable-row-actions",
1416
+ "reflect": false,
1417
+ "defaultValue": "false"
1418
+ },
1419
+ "globalFilter": {
1420
+ "type": "boolean",
1421
+ "mutable": false,
1422
+ "complexType": {
1423
+ "original": "boolean",
1424
+ "resolved": "boolean",
1425
+ "references": {}
1426
+ },
1427
+ "required": false,
1428
+ "optional": false,
1429
+ "docs": {
1430
+ "tags": [{
1431
+ "name": "default",
1432
+ "text": "false"
1433
+ }],
1434
+ "text": "When set to true it activates the global filter."
1435
+ },
1436
+ "attribute": "global-filter",
1437
+ "reflect": false,
1438
+ "defaultValue": "false"
1439
+ },
1440
+ "globalFilterValue": {
1441
+ "type": "string",
1442
+ "mutable": true,
1443
+ "complexType": {
1444
+ "original": "string",
1445
+ "resolved": "string",
1446
+ "references": {}
1447
+ },
1448
+ "required": false,
1449
+ "optional": false,
1450
+ "docs": {
1451
+ "tags": [{
1452
+ "name": "default",
1453
+ "text": "\"\""
1454
+ }],
1455
+ "text": "The value of the global filter."
1456
+ },
1457
+ "attribute": "global-filter-value",
1458
+ "reflect": true,
1459
+ "defaultValue": "''"
1460
+ },
1461
+ "kanban": {
1462
+ "type": "unknown",
1463
+ "mutable": false,
1464
+ "complexType": {
1465
+ "original": "KupBoxKanban",
1466
+ "resolved": "KupBoxKanban",
1467
+ "references": {
1468
+ "KupBoxKanban": {
1469
+ "location": "import",
1470
+ "path": "./kup-box-declarations"
1471
+ }
1472
+ }
1473
+ },
1474
+ "required": false,
1475
+ "optional": false,
1476
+ "docs": {
1477
+ "tags": [{
1478
+ "name": "default",
1479
+ "text": "null"
1480
+ }],
1481
+ "text": "Displays the boxlist as a Kanban."
1482
+ },
1483
+ "defaultValue": "null"
1484
+ },
1485
+ "layout": {
1486
+ "type": "unknown",
1487
+ "mutable": false,
1488
+ "complexType": {
1489
+ "original": "KupBoxLayout",
1490
+ "resolved": "KupBoxLayout",
1491
+ "references": {
1492
+ "KupBoxLayout": {
1493
+ "location": "import",
1494
+ "path": "./kup-box-declarations"
1495
+ }
1496
+ }
1497
+ },
1498
+ "required": false,
1499
+ "optional": false,
1500
+ "docs": {
1501
+ "tags": [{
1502
+ "name": "default",
1503
+ "text": "undefined"
1504
+ }],
1505
+ "text": "How the field will be displayed. If not present, a default one will be created."
1506
+ }
1507
+ },
1508
+ "lazyLoadRows": {
1509
+ "type": "boolean",
1510
+ "mutable": false,
1511
+ "complexType": {
1512
+ "original": "boolean",
1513
+ "resolved": "boolean",
1514
+ "references": {}
1515
+ },
1516
+ "required": false,
1517
+ "optional": false,
1518
+ "docs": {
1519
+ "tags": [],
1520
+ "text": "When set to true, extra rows will be automatically loaded once the last row enters the viewport."
1521
+ },
1522
+ "attribute": "lazy-load-rows",
1523
+ "reflect": false,
1524
+ "defaultValue": "false"
1525
+ },
1526
+ "multiSelection": {
1527
+ "type": "boolean",
1528
+ "mutable": false,
1529
+ "complexType": {
1530
+ "original": "boolean",
1531
+ "resolved": "boolean",
1532
+ "references": {}
1533
+ },
1534
+ "required": false,
1535
+ "optional": false,
1536
+ "docs": {
1537
+ "tags": [{
1538
+ "name": "default",
1539
+ "text": "false"
1540
+ }],
1541
+ "text": "Enable multi selection"
1542
+ },
1543
+ "attribute": "multi-selection",
1544
+ "reflect": false,
1545
+ "defaultValue": "false"
1546
+ },
1547
+ "pageSelected": {
1548
+ "type": "number",
1549
+ "mutable": false,
1550
+ "complexType": {
1551
+ "original": "number",
1552
+ "resolved": "number",
1553
+ "references": {}
1554
+ },
1555
+ "required": false,
1556
+ "optional": false,
1557
+ "docs": {
1558
+ "tags": [{
1559
+ "name": "default",
1560
+ "text": "1"
1561
+ }],
1562
+ "text": "Current page number"
1563
+ },
1564
+ "attribute": "page-selected",
1565
+ "reflect": false,
1566
+ "defaultValue": "1"
1567
+ },
1568
+ "pageSize": {
1569
+ "type": "number",
1570
+ "mutable": false,
1571
+ "complexType": {
1572
+ "original": "number",
1573
+ "resolved": "number",
1574
+ "references": {}
1575
+ },
1576
+ "required": false,
1577
+ "optional": false,
1578
+ "docs": {
1579
+ "tags": [{
1580
+ "name": "default",
1581
+ "text": "10"
1582
+ }],
1583
+ "text": "Number of boxes per page"
1584
+ },
1585
+ "attribute": "page-size",
1586
+ "reflect": false,
1587
+ "defaultValue": "10"
1588
+ },
1589
+ "pagination": {
1590
+ "type": "boolean",
1591
+ "mutable": false,
1592
+ "complexType": {
1593
+ "original": "boolean",
1594
+ "resolved": "boolean",
1595
+ "references": {}
1596
+ },
1597
+ "required": false,
1598
+ "optional": false,
1599
+ "docs": {
1600
+ "tags": [{
1601
+ "name": "default",
1602
+ "text": "false"
1603
+ }],
1604
+ "text": "Enables pagination"
1605
+ },
1606
+ "attribute": "pagination",
1607
+ "reflect": false,
1608
+ "defaultValue": "false"
1609
+ },
1610
+ "rowsPerPage": {
1611
+ "type": "number",
1612
+ "mutable": false,
1613
+ "complexType": {
1614
+ "original": "number",
1615
+ "resolved": "number",
1616
+ "references": {}
1617
+ },
1618
+ "required": false,
1619
+ "optional": false,
1620
+ "docs": {
1621
+ "tags": [{
1622
+ "name": "default",
1623
+ "text": "undefined"
1624
+ }],
1625
+ "text": "Number of current rows per page"
1626
+ },
1627
+ "attribute": "rows-per-page",
1628
+ "reflect": false
1629
+ },
1630
+ "scrollOnHover": {
1631
+ "type": "boolean",
1632
+ "mutable": false,
1633
+ "complexType": {
1634
+ "original": "boolean",
1635
+ "resolved": "boolean",
1636
+ "references": {}
1637
+ },
1638
+ "required": false,
1639
+ "optional": false,
1640
+ "docs": {
1641
+ "tags": [{
1642
+ "name": "default",
1643
+ "text": "false"
1644
+ }],
1645
+ "text": "Activates the scroll on hover function."
1646
+ },
1647
+ "attribute": "scroll-on-hover",
1648
+ "reflect": false,
1649
+ "defaultValue": "false"
1650
+ },
1651
+ "selectBox": {
1652
+ "type": "number",
1653
+ "mutable": false,
1654
+ "complexType": {
1655
+ "original": "number",
1656
+ "resolved": "number",
1657
+ "references": {}
1658
+ },
1659
+ "required": false,
1660
+ "optional": false,
1661
+ "docs": {
1662
+ "tags": [{
1663
+ "name": "default",
1664
+ "text": "undefined"
1665
+ }],
1666
+ "text": "Automatically selects the box at the specified index"
1667
+ },
1668
+ "attribute": "select-box",
1669
+ "reflect": false
1670
+ },
1671
+ "selectedRowsState": {
1672
+ "type": "string",
1673
+ "mutable": true,
1674
+ "complexType": {
1675
+ "original": "string",
1676
+ "resolved": "string",
1677
+ "references": {}
1678
+ },
1679
+ "required": false,
1680
+ "optional": false,
1681
+ "docs": {
1682
+ "tags": [{
1683
+ "name": "default",
1684
+ "text": "undefined"
1685
+ }],
1686
+ "text": "Multiple selection"
1687
+ },
1688
+ "attribute": "selected-rows-state",
1689
+ "reflect": false
1690
+ },
1691
+ "showSelection": {
1692
+ "type": "boolean",
1693
+ "mutable": false,
1694
+ "complexType": {
1695
+ "original": "boolean",
1696
+ "resolved": "boolean",
1697
+ "references": {}
1698
+ },
1699
+ "required": false,
1700
+ "optional": false,
1701
+ "docs": {
1702
+ "tags": [{
1703
+ "name": "default",
1704
+ "text": "true"
1705
+ }],
1706
+ "text": "If enabled, highlights the selected box/boxes"
1707
+ },
1708
+ "attribute": "show-selection",
1709
+ "reflect": false,
1710
+ "defaultValue": "true"
1711
+ },
1712
+ "sortBy": {
1713
+ "type": "string",
1714
+ "mutable": true,
1715
+ "complexType": {
1716
+ "original": "string",
1717
+ "resolved": "string",
1718
+ "references": {}
1719
+ },
1720
+ "required": false,
1721
+ "optional": false,
1722
+ "docs": {
1723
+ "tags": [{
1724
+ "name": "default",
1725
+ "text": "undefined"
1726
+ }],
1727
+ "text": "If sorting is enabled, specifies which column to sort"
1728
+ },
1729
+ "attribute": "sort-by",
1730
+ "reflect": false
1731
+ },
1732
+ "sortEnabled": {
1733
+ "type": "boolean",
1734
+ "mutable": false,
1735
+ "complexType": {
1736
+ "original": "boolean",
1737
+ "resolved": "boolean",
1738
+ "references": {}
1739
+ },
1740
+ "required": false,
1741
+ "optional": false,
1742
+ "docs": {
1743
+ "tags": [{
1744
+ "name": "default",
1745
+ "text": "false"
1746
+ }],
1747
+ "text": "Enable sorting"
1748
+ },
1749
+ "attribute": "sort-enabled",
1750
+ "reflect": false,
1751
+ "defaultValue": "false"
1752
+ },
1753
+ "stateId": {
1754
+ "type": "string",
1755
+ "mutable": false,
1756
+ "complexType": {
1757
+ "original": "string",
1758
+ "resolved": "string",
1759
+ "references": {}
1760
+ },
1761
+ "required": false,
1762
+ "optional": false,
1763
+ "docs": {
1764
+ "tags": [],
1765
+ "text": ""
1766
+ },
1767
+ "attribute": "state-id",
1768
+ "reflect": false,
1769
+ "defaultValue": "''"
1770
+ },
1771
+ "store": {
1772
+ "type": "unknown",
1773
+ "mutable": false,
1774
+ "complexType": {
1775
+ "original": "KupStore",
1776
+ "resolved": "KupStore",
1777
+ "references": {
1778
+ "KupStore": {
1779
+ "location": "import",
1780
+ "path": "../kup-state/kup-store"
1781
+ }
1782
+ }
1783
+ },
1784
+ "required": false,
1785
+ "optional": false,
1786
+ "docs": {
1787
+ "tags": [],
1788
+ "text": ""
1789
+ }
1790
+ },
1791
+ "swipeDisabled": {
1792
+ "type": "boolean",
1793
+ "mutable": false,
1794
+ "complexType": {
1795
+ "original": "boolean",
1796
+ "resolved": "boolean",
1797
+ "references": {}
1798
+ },
1799
+ "required": false,
1800
+ "optional": false,
1801
+ "docs": {
1802
+ "tags": [{
1803
+ "name": "default",
1804
+ "text": "false"
1805
+ }],
1806
+ "text": "Disable swipe"
1807
+ },
1808
+ "attribute": "swipe-disabled",
1809
+ "reflect": false,
1810
+ "defaultValue": "false"
1811
+ }
1812
+ };
1813
+ }
1814
+ static get states() {
1815
+ return {
1816
+ "collapsedSection": {},
1817
+ "selectedRows": {},
1818
+ "rowActionMenuOpened": {},
1819
+ "currentPage": {},
1820
+ "currentRowsPerPage": {}
1821
+ };
1822
+ }
1823
+ static get events() {
1824
+ return [{
1825
+ "method": "kupBoxClick",
1826
+ "name": "kup-box-click",
1827
+ "bubbles": true,
1828
+ "cancelable": false,
1829
+ "composed": true,
1830
+ "docs": {
1831
+ "tags": [],
1832
+ "text": "Triggered when a box is clicked"
1833
+ },
1834
+ "complexType": {
1835
+ "original": "KupBoxClickEventPayload",
1836
+ "resolved": "KupBoxClickEventPayload",
1837
+ "references": {
1838
+ "KupBoxClickEventPayload": {
1839
+ "location": "import",
1840
+ "path": "./kup-box-declarations"
1841
+ }
1842
+ }
1843
+ }
1844
+ }, {
1845
+ "method": "kupBoxSelected",
1846
+ "name": "kup-box-selected",
1847
+ "bubbles": true,
1848
+ "cancelable": false,
1849
+ "composed": true,
1850
+ "docs": {
1851
+ "tags": [],
1852
+ "text": "Triggered when the multi selection checkbox changes value"
1853
+ },
1854
+ "complexType": {
1855
+ "original": "KupBoxSelectedEventPayload",
1856
+ "resolved": "KupBoxSelectedEventPayload",
1857
+ "references": {
1858
+ "KupBoxSelectedEventPayload": {
1859
+ "location": "import",
1860
+ "path": "./kup-box-declarations"
1861
+ }
1862
+ }
1863
+ }
1864
+ }, {
1865
+ "method": "kupAutoBoxSelect",
1866
+ "name": "kup-box-autoselect",
1867
+ "bubbles": true,
1868
+ "cancelable": false,
1869
+ "composed": true,
1870
+ "docs": {
1871
+ "tags": [],
1872
+ "text": "Triggered when a box is auto selected via selectBox prop"
1873
+ },
1874
+ "complexType": {
1875
+ "original": "KupBoxAutoSelectEventPayload",
1876
+ "resolved": "KupBoxAutoSelectEventPayload",
1877
+ "references": {
1878
+ "KupBoxAutoSelectEventPayload": {
1879
+ "location": "import",
1880
+ "path": "./kup-box-declarations"
1881
+ }
1882
+ }
1883
+ }
1884
+ }, {
1885
+ "method": "kupRowActionMenuClick",
1886
+ "name": "kup-box-rowactionmenuclick",
1887
+ "bubbles": true,
1888
+ "cancelable": false,
1889
+ "composed": true,
1890
+ "docs": {
1891
+ "tags": [],
1892
+ "text": "When the row menu action icon is click"
1893
+ },
1894
+ "complexType": {
1895
+ "original": "KupBoxAutoSelectEventPayload",
1896
+ "resolved": "KupBoxAutoSelectEventPayload",
1897
+ "references": {
1898
+ "KupBoxAutoSelectEventPayload": {
1899
+ "location": "import",
1900
+ "path": "./kup-box-declarations"
1901
+ }
1902
+ }
1903
+ }
1904
+ }, {
1905
+ "method": "kupRowActionClick",
1906
+ "name": "kup-box-rowactionclick",
1907
+ "bubbles": true,
1908
+ "cancelable": false,
1909
+ "composed": true,
1910
+ "docs": {
1911
+ "tags": [],
1912
+ "text": "When the row menu action icon is click"
1913
+ },
1914
+ "complexType": {
1915
+ "original": "KupBoxRowActionClickEventPayload",
1916
+ "resolved": "KupBoxRowActionClickEventPayload",
1917
+ "references": {
1918
+ "KupBoxRowActionClickEventPayload": {
1919
+ "location": "import",
1920
+ "path": "./kup-box-declarations"
1921
+ }
1922
+ }
1923
+ }
1924
+ }, {
1925
+ "method": "kupDidLoad",
1926
+ "name": "kup-box-didload",
1927
+ "bubbles": true,
1928
+ "cancelable": false,
1929
+ "composed": true,
1930
+ "docs": {
1931
+ "tags": [],
1932
+ "text": ""
1933
+ },
1934
+ "complexType": {
1935
+ "original": "KupEventPayload",
1936
+ "resolved": "KupEventPayload",
1937
+ "references": {
1938
+ "KupEventPayload": {
1939
+ "location": "import",
1940
+ "path": "../../types/GenericTypes"
1941
+ }
1942
+ }
1943
+ }
1944
+ }, {
1945
+ "method": "kupDidUnload",
1946
+ "name": "kup-box-didunload",
1947
+ "bubbles": true,
1948
+ "cancelable": false,
1949
+ "composed": true,
1950
+ "docs": {
1951
+ "tags": [],
1952
+ "text": "Triggered when stop propagation event"
1953
+ },
1954
+ "complexType": {
1955
+ "original": "KupEventPayload",
1956
+ "resolved": "KupEventPayload",
1957
+ "references": {
1958
+ "KupEventPayload": {
1959
+ "location": "import",
1960
+ "path": "../../types/GenericTypes"
1961
+ }
1962
+ }
1963
+ }
1964
+ }, {
1965
+ "method": "kupBoxContextMenu",
1966
+ "name": "kup-box-contextmenu",
1967
+ "bubbles": true,
1968
+ "cancelable": false,
1969
+ "composed": true,
1970
+ "docs": {
1971
+ "tags": [],
1972
+ "text": "Generic right click event on box."
1973
+ },
1974
+ "complexType": {
1975
+ "original": "KupBoxContextMenuEventPayload",
1976
+ "resolved": "KupBoxContextMenuEventPayload",
1977
+ "references": {
1978
+ "KupBoxContextMenuEventPayload": {
1979
+ "location": "import",
1980
+ "path": "./kup-box-declarations"
1981
+ }
1982
+ }
1983
+ }
1984
+ }];
1985
+ }
1986
+ static get methods() {
1987
+ return {
1988
+ "getProps": {
1989
+ "complexType": {
1990
+ "signature": "(descriptions?: boolean) => Promise<GenericObject>",
1991
+ "parameters": [{
1992
+ "tags": [{
1993
+ "name": "param",
1994
+ "text": "descriptions - When provided and true, the result will be the list of props with their description."
1995
+ }],
1996
+ "text": "- When provided and true, the result will be the list of props with their description."
1997
+ }],
1998
+ "references": {
1999
+ "Promise": {
2000
+ "location": "global"
2001
+ },
2002
+ "GenericObject": {
2003
+ "location": "import",
2004
+ "path": "../../types/GenericTypes"
2005
+ }
2006
+ },
2007
+ "return": "Promise<GenericObject>"
2008
+ },
2009
+ "docs": {
2010
+ "text": "Used to retrieve component's props values.",
2011
+ "tags": [{
2012
+ "name": "param",
2013
+ "text": "descriptions - When provided and true, the result will be the list of props with their description."
2014
+ }, {
2015
+ "name": "returns",
2016
+ "text": "List of props as object, each key will be a prop."
2017
+ }]
2018
+ }
2019
+ },
2020
+ "loadRowActions": {
2021
+ "complexType": {
2022
+ "signature": "(row: KupBoxRow, actions: KupDataRowAction[]) => Promise<void>",
2023
+ "parameters": [{
2024
+ "tags": [],
2025
+ "text": ""
2026
+ }, {
2027
+ "tags": [],
2028
+ "text": ""
2029
+ }],
2030
+ "references": {
2031
+ "Promise": {
2032
+ "location": "global"
2033
+ },
2034
+ "KupBoxRow": {
2035
+ "location": "import",
2036
+ "path": "./kup-box-declarations"
2037
+ },
2038
+ "KupDataRowAction": {
2039
+ "location": "import",
2040
+ "path": "../../managers/kup-data/kup-data-declarations"
2041
+ }
2042
+ },
2043
+ "return": "Promise<void>"
2044
+ },
2045
+ "docs": {
2046
+ "text": "",
2047
+ "tags": []
2048
+ }
2049
+ },
2050
+ "refresh": {
2051
+ "complexType": {
2052
+ "signature": "() => Promise<void>",
2053
+ "parameters": [],
2054
+ "references": {
2055
+ "Promise": {
2056
+ "location": "global"
2057
+ }
2058
+ },
2059
+ "return": "Promise<void>"
2060
+ },
2061
+ "docs": {
2062
+ "text": "This method is used to trigger a new render of the component.",
2063
+ "tags": []
2064
+ }
2065
+ },
2066
+ "setProps": {
2067
+ "complexType": {
2068
+ "signature": "(props: GenericObject) => Promise<void>",
2069
+ "parameters": [{
2070
+ "tags": [{
2071
+ "name": "param",
2072
+ "text": "props - Object containing props that will be set to the component."
2073
+ }],
2074
+ "text": "- Object containing props that will be set to the component."
2075
+ }],
2076
+ "references": {
2077
+ "Promise": {
2078
+ "location": "global"
2079
+ },
2080
+ "GenericObject": {
2081
+ "location": "import",
2082
+ "path": "../../types/GenericTypes"
2083
+ }
2084
+ },
2085
+ "return": "Promise<void>"
2086
+ },
2087
+ "docs": {
2088
+ "text": "Sets the props to the component.",
2089
+ "tags": [{
2090
+ "name": "param",
2091
+ "text": "props - Object containing props that will be set to the component."
2092
+ }]
2093
+ }
2094
+ }
2095
+ };
2096
+ }
2097
+ static get elementRef() { return "rootElement"; }
2098
+ static get watchers() {
2099
+ return [{
2100
+ "propName": "pageSize",
2101
+ "methodName": "rowsPerPageHandler"
2102
+ }, {
2103
+ "propName": "globalFilterValue",
2104
+ "methodName": "recalculateRows"
2105
+ }, {
2106
+ "propName": "sortBy",
2107
+ "methodName": "recalculateRows"
2108
+ }, {
2109
+ "propName": "pagination",
2110
+ "methodName": "recalculateRows"
2111
+ }, {
2112
+ "propName": "pageSize",
2113
+ "methodName": "recalculateRows"
2114
+ }, {
2115
+ "propName": "currentPage",
2116
+ "methodName": "recalculateRows"
2117
+ }, {
2118
+ "propName": "currentRowsPerPage",
2119
+ "methodName": "recalculateRows"
2120
+ }, {
2121
+ "propName": "data",
2122
+ "methodName": "onDataChanged"
2123
+ }, {
2124
+ "propName": "layout",
2125
+ "methodName": "onLayoutChanged"
2126
+ }, {
2127
+ "propName": "selectBox",
2128
+ "methodName": "onSelectBoxChanged"
2129
+ }];
2130
+ }
2131
+ }
2132
+ _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_navBarHeight = new WeakMap(), _KupBox_instances = new WeakSet(), _KupBox_didRenderObservers = function _KupBox_didRenderObservers() {
2133
+ if (this.lazyLoadRows &&
2134
+ this.currentRowsPerPage < this.data.rows.length) {
2135
+ __classPrivateFieldGet(this, _KupBox_intObserver, "f").observe(__classPrivateFieldGet(this, _KupBox_rowsRefs, "f")[__classPrivateFieldGet(this, _KupBox_rowsRefs, "f").length - 1]);
2136
+ }
2137
+ }, _KupBox_setObserver = function _KupBox_setObserver() {
2138
+ const callback = (entries) => {
2139
+ entries.forEach((entry) => {
2140
+ if (entry.isIntersecting) {
2141
+ this.kupManager.debug.logMessage(this, 'Last row entering the viewport, loading more elements.');
2142
+ const delta = this.data.rows.length - this.currentRowsPerPage;
2143
+ if (delta < 10) {
2144
+ this.currentRowsPerPage += delta;
2145
+ }
2146
+ else {
2147
+ this.currentRowsPerPage += 10;
2148
+ }
2149
+ entry.target.classList.remove('last-row');
2150
+ __classPrivateFieldGet(this, _KupBox_intObserver, "f").unobserve(entry.target);
2151
+ }
2152
+ });
2153
+ };
2154
+ const options = {
2155
+ threshold: 0,
2156
+ rootMargin: '-' + __classPrivateFieldGet(this, _KupBox_navBarHeight, "f") + 'px 0px 0px 0px',
2157
+ };
2158
+ __classPrivateFieldSet(this, _KupBox_intObserver, new IntersectionObserver(callback, options), "f");
2159
+ };