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