@sme.up/ketchup 4.0.0 → 4.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 (303) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/cell-utils-dc0884a3.js +168 -0
  3. package/dist/cjs/f-button-2ba74fb5.js +105 -0
  4. package/dist/cjs/f-cell-fe60a08d.js +731 -0
  5. package/dist/cjs/f-chip-90d95d22.js +141 -0
  6. package/dist/cjs/{f-image-5f4f29ca.js → f-image-d3bd4e08.js} +4 -5
  7. package/dist/cjs/{index-3c471303.js → index-0416afab.js} +73 -64
  8. package/dist/cjs/ketchup.cjs.js +3 -3
  9. package/dist/cjs/kup-accordion.cjs.entry.js +6 -8
  10. package/dist/cjs/{kup-autocomplete_29.cjs.entry.js → kup-autocomplete_28.cjs.entry.js} +2580 -3060
  11. package/dist/cjs/kup-calendar.cjs.entry.js +30 -30
  12. package/dist/cjs/kup-cell.cjs.entry.js +201 -0
  13. package/dist/cjs/kup-dash-list.cjs.entry.js +15 -7
  14. package/dist/cjs/kup-dash_2.cjs.entry.js +104 -62
  15. package/dist/cjs/kup-drawer.cjs.entry.js +4 -6
  16. package/dist/cjs/kup-field.cjs.entry.js +3 -5
  17. package/dist/cjs/kup-iframe.cjs.entry.js +3 -4
  18. package/dist/cjs/kup-lazy.cjs.entry.js +4 -6
  19. package/dist/cjs/kup-magic-box.cjs.entry.js +21 -31
  20. package/dist/cjs/kup-manager-1a2688ca.js +5813 -0
  21. package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -6
  22. package/dist/cjs/kup-probe.cjs.entry.js +3 -4
  23. package/dist/cjs/kup-qlik.cjs.entry.js +2 -3
  24. package/dist/cjs/kup-snackbar.cjs.entry.js +152 -0
  25. package/dist/cjs/loader.cjs.js +3 -3
  26. package/dist/cjs/{utils-2af73538.js → utils-0cc466b9.js} +17 -83
  27. package/dist/collection/assets/cell.js +51 -0
  28. package/dist/collection/assets/data-table.js +518 -1
  29. package/dist/collection/assets/index.js +8 -0
  30. package/dist/collection/assets/snackbar.js +32 -0
  31. package/dist/collection/collection-manifest.json +6 -6
  32. package/dist/collection/components/kup-accordion/kup-accordion.css +0 -213
  33. package/dist/collection/components/kup-accordion/kup-accordion.js +15 -16
  34. package/dist/collection/components/kup-autocomplete/kup-autocomplete-declarations.js +2 -2
  35. package/dist/collection/components/kup-autocomplete/kup-autocomplete.css +5 -2381
  36. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +83 -111
  37. package/dist/collection/components/kup-badge/kup-badge.css +1 -35
  38. package/dist/collection/components/kup-badge/kup-badge.js +13 -14
  39. package/dist/collection/components/kup-box/kup-box.css +47 -780
  40. package/dist/collection/components/kup-box/kup-box.js +240 -366
  41. package/dist/collection/components/kup-button/kup-button.css +0 -333
  42. package/dist/collection/components/kup-button/kup-button.js +27 -28
  43. package/dist/collection/components/kup-button-list/kup-button-list.css +0 -332
  44. package/dist/collection/components/kup-button-list/kup-button-list.js +19 -20
  45. package/dist/collection/components/kup-calendar/kup-calendar.css +0 -517
  46. package/dist/collection/components/kup-calendar/kup-calendar.js +47 -45
  47. package/dist/collection/components/kup-card/builtin/kup-card-builtin.js +20 -0
  48. package/dist/collection/components/kup-card/builtin/kup-card-calendar.js +458 -0
  49. package/dist/collection/components/kup-card/builtin/kup-card-clock.js +321 -0
  50. package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +18 -0
  51. package/dist/collection/components/kup-card/free/kup-card-free.js +13 -0
  52. package/dist/collection/components/kup-card/kup-card-declarations.js +19 -0
  53. package/dist/collection/components/kup-card/kup-card-helper.js +19 -1
  54. package/dist/collection/components/kup-card/kup-card.css +615 -185
  55. package/dist/collection/components/kup-card/kup-card.js +94 -34
  56. package/dist/collection/components/kup-card/standard/kup-card-standard.js +75 -0
  57. package/dist/collection/components/kup-cell/kup-cell-declarations.js +11 -0
  58. package/dist/collection/components/kup-cell/kup-cell.css +20 -0
  59. package/dist/collection/components/kup-cell/kup-cell.js +413 -0
  60. package/dist/collection/components/kup-chart/kup-chart.js +41 -42
  61. package/dist/collection/components/kup-checkbox/kup-checkbox.css +0 -214
  62. package/dist/collection/components/kup-checkbox/kup-checkbox.js +19 -20
  63. package/dist/collection/components/kup-chip/kup-chip.css +0 -217
  64. package/dist/collection/components/kup-chip/kup-chip.js +15 -16
  65. package/dist/collection/components/kup-color-picker/kup-color-picker.css +7 -2380
  66. package/dist/collection/components/kup-color-picker/kup-color-picker.js +41 -41
  67. package/dist/collection/components/kup-combobox/kup-combobox-declarations.js +1 -0
  68. package/dist/collection/components/kup-combobox/kup-combobox.css +5 -2381
  69. package/dist/collection/components/kup-combobox/kup-combobox.js +68 -28
  70. package/dist/collection/components/kup-dash-list/kup-dash-list.js +13 -4
  71. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +2 -0
  72. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +61 -102
  73. package/dist/collection/components/kup-data-table/kup-data-table.css +118 -3232
  74. package/dist/collection/components/kup-data-table/kup-data-table.js +589 -1089
  75. package/dist/collection/components/kup-date-picker/kup-date-picker.css +1 -85
  76. package/dist/collection/components/kup-date-picker/kup-date-picker.js +92 -395
  77. package/dist/collection/components/kup-drawer/kup-drawer.js +9 -10
  78. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +12 -340
  79. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +56 -45
  80. package/dist/collection/components/kup-field/kup-field.js +21 -22
  81. package/dist/collection/components/kup-gauge/kup-gauge.js +17 -18
  82. package/dist/collection/components/kup-grid/kup-grid.css +2 -1
  83. package/dist/collection/components/kup-grid/kup-grid.js +13 -14
  84. package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
  85. package/dist/collection/components/kup-image/assets/svg/ketchup.svg +74 -0
  86. package/dist/collection/components/kup-image/assets/svg/smeup.svg +59 -0
  87. package/dist/collection/components/kup-image/kup-image.css +0 -32
  88. package/dist/collection/components/kup-image/kup-image.js +25 -26
  89. package/dist/collection/components/kup-lazy/kup-lazy.js +17 -18
  90. package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
  91. package/dist/collection/components/kup-list/kup-list.css +4 -260
  92. package/dist/collection/components/kup-list/kup-list.js +39 -49
  93. package/dist/collection/components/kup-magic-box/kup-magic-box.css +13 -39
  94. package/dist/collection/components/kup-magic-box/kup-magic-box.js +29 -38
  95. package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +11 -12
  96. package/dist/collection/components/kup-paginator/kup-paginator.css +0 -332
  97. package/dist/collection/components/kup-paginator/kup-paginator.js +44 -12
  98. package/dist/collection/components/kup-probe/kup-probe.js +9 -9
  99. package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +21 -22
  100. package/dist/collection/components/kup-radio/kup-radio.js +17 -18
  101. package/dist/collection/components/kup-rating/kup-rating.js +15 -16
  102. package/dist/collection/components/kup-snackbar/kup-snackbar-declarations.js +13 -0
  103. package/dist/collection/components/kup-snackbar/kup-snackbar.css +75 -0
  104. package/dist/collection/components/kup-snackbar/kup-snackbar.js +390 -0
  105. package/dist/collection/components/kup-spinner/kup-spinner.js +23 -24
  106. package/dist/collection/components/kup-switch/kup-switch.css +0 -156
  107. package/dist/collection/components/kup-switch/kup-switch.js +17 -18
  108. package/dist/collection/components/kup-tab-bar/kup-tab-bar.css +0 -199
  109. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +13 -14
  110. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  111. package/dist/collection/components/kup-text-field/kup-text-field.css +4 -2371
  112. package/dist/collection/components/kup-text-field/kup-text-field.js +77 -51
  113. package/dist/collection/components/kup-time-picker/kup-time-picker.css +7 -0
  114. package/dist/collection/components/kup-time-picker/kup-time-picker.js +97 -317
  115. package/dist/collection/components/kup-tooltip/kup-tooltip.js +24 -14
  116. package/dist/collection/components/kup-tree/kup-tree.css +27 -371
  117. package/dist/collection/components/kup-tree/kup-tree.js +163 -383
  118. package/dist/collection/f-components/f-button/f-button.js +4 -2
  119. package/dist/collection/f-components/f-cell/f-cell-declarations.js +143 -0
  120. package/dist/collection/f-components/f-cell/f-cell.js +471 -0
  121. package/dist/collection/f-components/f-checkbox/f-checkbox.js +1 -1
  122. package/dist/collection/f-components/f-chip/f-chip.js +2 -2
  123. package/dist/collection/f-components/f-image/f-image.js +2 -3
  124. package/dist/collection/f-components/f-switch/f-switch.js +1 -1
  125. package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +1 -1
  126. package/dist/collection/f-components/f-text-field/f-text-field.js +25 -21
  127. package/dist/collection/utils/cell-utils.js +18 -222
  128. package/dist/collection/utils/filters/filters.js +31 -37
  129. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +15 -3
  130. package/dist/collection/utils/kup-dates/kup-dates.js +14 -2
  131. package/dist/collection/utils/kup-debug/kup-debug-browser-utils.js +3 -3
  132. package/dist/collection/utils/kup-debug/kup-debug.js +57 -29
  133. package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +5 -7
  134. package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
  135. package/dist/collection/utils/kup-interact/kup-interact.js +379 -0
  136. package/dist/collection/utils/kup-language/kup-language-declarations.js +2 -0
  137. package/dist/collection/utils/kup-language/kup-language.js +1 -1
  138. package/dist/collection/utils/kup-manager/kup-manager.js +47 -10
  139. package/dist/collection/utils/kup-objects/kup-objects.js +9 -33
  140. package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
  141. package/dist/collection/utils/kup-search/kup-search-declarations.js +1 -0
  142. package/dist/collection/utils/kup-search/kup-search.js +75 -0
  143. package/dist/collection/utils/kup-theme/kup-theme-declarations.js +1 -0
  144. package/dist/collection/utils/kup-theme/kup-theme.js +4 -3
  145. package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
  146. package/dist/collection/utils/utils.js +15 -23
  147. package/dist/esm/cell-utils-8f512ea9.js +160 -0
  148. package/dist/esm/f-button-30dbcaa9.js +103 -0
  149. package/dist/esm/f-cell-95c186c6.js +727 -0
  150. package/dist/esm/f-chip-c0e9c0ff.js +139 -0
  151. package/dist/esm/{f-image-68b34fab.js → f-image-3bc8b24f.js} +4 -5
  152. package/dist/esm/{index-bf2824a6.js → index-e0e67c23.js} +74 -65
  153. package/dist/esm/ketchup.js +3 -3
  154. package/dist/esm/kup-accordion.entry.js +6 -8
  155. package/dist/esm/{kup-autocomplete_29.entry.js → kup-autocomplete_28.entry.js} +2379 -2858
  156. package/dist/esm/kup-calendar.entry.js +10 -10
  157. package/dist/esm/kup-cell.entry.js +197 -0
  158. package/dist/esm/kup-dash-list.entry.js +15 -7
  159. package/dist/esm/kup-dash_2.entry.js +104 -62
  160. package/dist/esm/kup-drawer.entry.js +4 -6
  161. package/dist/esm/kup-field.entry.js +3 -5
  162. package/dist/esm/kup-iframe.entry.js +3 -4
  163. package/dist/esm/kup-lazy.entry.js +4 -6
  164. package/dist/esm/kup-magic-box.entry.js +21 -31
  165. package/dist/esm/kup-manager-7fc234da.js +5800 -0
  166. package/dist/esm/kup-nav-bar.entry.js +4 -6
  167. package/dist/esm/kup-probe.entry.js +3 -4
  168. package/dist/esm/kup-qlik.entry.js +2 -3
  169. package/dist/esm/kup-snackbar.entry.js +148 -0
  170. package/dist/esm/loader.js +3 -3
  171. package/dist/esm/{utils-13dd007a.js → utils-6c73709d.js} +15 -78
  172. package/dist/ketchup/assets/svg/ketchup.svg +74 -0
  173. package/dist/ketchup/assets/svg/smeup.svg +59 -0
  174. package/dist/ketchup/ketchup.esm.js +1 -1
  175. package/dist/ketchup/p-15321eae.js +1 -0
  176. package/dist/ketchup/p-1baf1205.entry.js +1 -0
  177. package/dist/ketchup/p-1c6178e4.entry.js +1 -0
  178. package/dist/ketchup/p-44375e49.js +1 -0
  179. package/dist/ketchup/p-4dcdbd31.entry.js +45 -0
  180. package/dist/ketchup/p-5a5f2a53.js +1 -0
  181. package/dist/ketchup/{p-c7ee1fbc.js → p-61faaa38.js} +2 -2
  182. package/dist/ketchup/p-62816d0b.entry.js +1 -0
  183. package/dist/ketchup/p-65adc15b.entry.js +1 -0
  184. package/dist/ketchup/p-7e23ea7c.entry.js +1 -0
  185. package/dist/ketchup/p-a378ba56.entry.js +1 -0
  186. package/dist/ketchup/p-a878016f.entry.js +1 -0
  187. package/dist/ketchup/p-a96e6e32.entry.js +1 -0
  188. package/dist/ketchup/p-ad32821e.entry.js +1 -0
  189. package/dist/ketchup/p-af4a6191.entry.js +1 -0
  190. package/dist/ketchup/p-c18c7bb0.entry.js +27 -0
  191. package/dist/ketchup/p-ca0ca27f.entry.js +1 -0
  192. package/dist/ketchup/p-cb5f4994.js +1 -0
  193. package/dist/ketchup/p-ccda584a.entry.js +1 -0
  194. package/dist/ketchup/p-d4aa4922.js +1 -0
  195. package/dist/ketchup/p-dbb6998b.entry.js +1 -0
  196. package/dist/ketchup/p-de83f2f6.js +1 -0
  197. package/dist/ketchup/p-ec3a3db9.js +1 -0
  198. package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +2 -6
  199. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +7 -13
  200. package/dist/types/components/kup-box/kup-box-declarations.d.ts +13 -4
  201. package/dist/types/components/kup-box/kup-box.d.ts +13 -6
  202. package/dist/types/components/kup-card/builtin/kup-card-builtin.d.ts +14 -0
  203. package/dist/types/components/kup-card/builtin/kup-card-calendar.d.ts +2 -0
  204. package/dist/types/components/kup-card/builtin/kup-card-clock.d.ts +2 -0
  205. package/dist/types/components/kup-card/dialog/kup-card-dialog.d.ts +6 -0
  206. package/dist/types/components/kup-card/free/kup-card-free.d.ts +8 -0
  207. package/dist/types/components/kup-card/kup-card-declarations.d.ts +74 -0
  208. package/dist/types/components/kup-card/kup-card.d.ts +12 -3
  209. package/dist/types/components/kup-card/standard/kup-card-standard.d.ts +6 -0
  210. package/dist/types/components/kup-cell/kup-cell-declarations.d.ts +10 -0
  211. package/dist/types/components/kup-cell/kup-cell.d.ts +67 -0
  212. package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +1 -1
  213. package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +3 -2
  214. package/dist/types/components/kup-combobox/kup-combobox.d.ts +5 -0
  215. package/dist/types/components/kup-dash-list/kup-dash-list.d.ts +4 -0
  216. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +20 -36
  217. package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +1 -15
  218. package/dist/types/components/kup-data-table/kup-data-table.d.ts +33 -83
  219. package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +11 -23
  220. package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +1 -4
  221. package/dist/types/components/kup-list/kup-list-declarations.d.ts +1 -1
  222. package/dist/types/components/kup-list/kup-list.d.ts +2 -3
  223. package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +1 -0
  224. package/dist/types/components/kup-paginator/kup-paginator.d.ts +6 -0
  225. package/dist/types/components/kup-snackbar/kup-snackbar-declarations.d.ts +12 -0
  226. package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +79 -0
  227. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +2 -1
  228. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  229. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +10 -20
  230. package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +1 -0
  231. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
  232. package/dist/types/components/kup-tree/kup-tree.d.ts +12 -23
  233. package/dist/types/components.d.ts +348 -176
  234. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +153 -0
  235. package/dist/types/f-components/f-cell/f-cell.d.ts +3 -0
  236. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  237. package/dist/types/f-components/f-text-field/f-text-field-mdc.d.ts +1 -1
  238. package/dist/types/utils/cell-utils.d.ts +0 -19
  239. package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +2 -0
  240. package/dist/types/utils/kup-dates/kup-dates.d.ts +9 -4
  241. package/dist/types/utils/kup-debug/kup-debug.d.ts +1 -1
  242. package/dist/types/utils/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +1 -1
  243. package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
  244. package/dist/types/utils/kup-interact/kup-interact-declarations.d.ts +127 -0
  245. package/dist/types/utils/kup-interact/kup-interact.d.ts +93 -0
  246. package/dist/types/utils/kup-language/kup-language-declarations.d.ts +2 -0
  247. package/dist/types/utils/kup-language/kup-language.d.ts +1 -1
  248. package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +28 -8
  249. package/dist/types/utils/kup-manager/kup-manager.d.ts +18 -5
  250. package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
  251. package/dist/types/utils/kup-search/kup-search-declarations.d.ts +7 -0
  252. package/dist/types/utils/kup-search/kup-search.d.ts +20 -0
  253. package/dist/types/utils/kup-theme/kup-theme-declarations.d.ts +2 -0
  254. package/dist/types/utils/kup-theme/kup-theme.d.ts +2 -2
  255. package/dist/types/utils/utils.d.ts +0 -1
  256. package/package.json +4 -6
  257. package/dist/cjs/cell-utils-1f89a299.js +0 -1527
  258. package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
  259. package/dist/cjs/f-chip-2d58c8f7.js +0 -239
  260. package/dist/cjs/kup-grid.cjs.entry.js +0 -130
  261. package/dist/cjs/kup-manager-59ad8bdc.js +0 -4845
  262. package/dist/cjs/kup-objects-59ea949c.js +0 -717
  263. package/dist/collection/assets/images/drag-multiple.js +0 -1
  264. package/dist/collection/components/kup-editor/kup-editor.css +0 -5
  265. package/dist/collection/components/kup-editor/kup-editor.js +0 -59
  266. package/dist/collection/components/kup-layout/kup-layout.css +0 -53
  267. package/dist/collection/components/kup-layout/kup-layout.js +0 -156
  268. package/dist/collection/utils/drag-and-drop.js +0 -109
  269. package/dist/collection/utils/kup-dialog/kup-dialog-declarations.js +0 -36
  270. package/dist/collection/utils/kup-dialog/kup-dialog.js +0 -310
  271. package/dist/esm/cell-utils-cb612463.js +0 -1510
  272. package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
  273. package/dist/esm/f-chip-125d5dd6.js +0 -236
  274. package/dist/esm/kup-grid.entry.js +0 -126
  275. package/dist/esm/kup-manager-e7d7b353.js +0 -4842
  276. package/dist/esm/kup-objects-d38d2fa2.js +0 -711
  277. package/dist/ketchup/p-00fe1e3e.js +0 -1
  278. package/dist/ketchup/p-0320e24e.entry.js +0 -1
  279. package/dist/ketchup/p-08c7a092.js +0 -1
  280. package/dist/ketchup/p-1165f4ea.entry.js +0 -1
  281. package/dist/ketchup/p-170d3cba.js +0 -1
  282. package/dist/ketchup/p-18cb3ba3.js +0 -1
  283. package/dist/ketchup/p-23541a97.entry.js +0 -45
  284. package/dist/ketchup/p-64ea7e37.entry.js +0 -1
  285. package/dist/ketchup/p-7896031c.entry.js +0 -1
  286. package/dist/ketchup/p-876da4c2.entry.js +0 -1
  287. package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
  288. package/dist/ketchup/p-940ab57a.entry.js +0 -1
  289. package/dist/ketchup/p-9c858a38.entry.js +0 -1
  290. package/dist/ketchup/p-a12a5690.entry.js +0 -1
  291. package/dist/ketchup/p-a5424073.js +0 -1
  292. package/dist/ketchup/p-b0724035.entry.js +0 -1
  293. package/dist/ketchup/p-b14e77f0.js +0 -1
  294. package/dist/ketchup/p-d24cfdea.entry.js +0 -1
  295. package/dist/ketchup/p-ee89966f.entry.js +0 -27
  296. package/dist/ketchup/p-fcd2fd8f.js +0 -1
  297. package/dist/ketchup/p-fce3b9d8.entry.js +0 -1
  298. package/dist/types/assets/images/drag-multiple.d.ts +0 -1
  299. package/dist/types/components/kup-editor/kup-editor.d.ts +0 -16
  300. package/dist/types/components/kup-layout/kup-layout.d.ts +0 -25
  301. package/dist/types/utils/drag-and-drop.d.ts +0 -53
  302. package/dist/types/utils/kup-dialog/kup-dialog-declarations.d.ts +0 -43
  303. package/dist/types/utils/kup-dialog/kup-dialog.d.ts +0 -50
@@ -1,14 +1,12 @@
1
- import { Component, Element, Event, forceUpdate, getAssetPath, h, Host, Method, Prop, State, Watch, } from '@stencil/core';
2
- import { FixedCellsClasses, FixedCellsCSSVarsBase, GroupLabelDisplayMode, KupDataTableColumnDragType, KupDataTableRowDragType, KupDataTableColumnDragRemoveType, LoadMoreMode, PaginatorPos, ShowGrid, SortMode, TotalMode, totalMenuOpenID, TotalLabel, KupDataTableProps, fieldColumn, iconColumn, keyColumn, SelectionMode, KupDataTableColumnDragGroupType, } from './kup-data-table-declarations';
3
- import { isRating, isGauge, isKnob, getCellType, getColumnByName, getCellValueForDisplay, } from '../../utils/cell-utils';
4
- import { calcTotals, normalizeRows, filterRows, groupRows, paginateRows, sortRows, styleHasBorderRadius, styleHasWritingMode, dropHandlersCell, } from './kup-data-table-helper';
5
- import { stringToNumber, numberToFormattedStringNumber, identify, deepEqual, getProps, setProps, } from '../../utils/utils';
1
+ import { Component, Element, Event, forceUpdate, h, Host, Method, Prop, State, Watch, } from '@stencil/core';
2
+ import { FixedCellsClasses, FixedCellsCSSVarsBase, GroupLabelDisplayMode, LoadMoreMode, PaginatorPos, ShowGrid, SortMode, TotalMode, TotalLabel, KupDataTableProps, fieldColumn, iconColumn, keyColumn, SelectionMode, } from './kup-data-table-declarations';
3
+ import { getColumnByName } from '../../utils/cell-utils';
4
+ import { calcTotals, normalizeRows, filterRows, groupRows, paginateRows, sortRows, } from './kup-data-table-helper';
5
+ import { numberToFormattedStringNumber, identify, deepEqual, getProps, setProps, } from '../../utils/utils';
6
6
  import { ItemsDisplayMode, } from '../kup-list/kup-list-declarations';
7
7
  import { kupManagerInstance, } from '../../utils/kup-manager/kup-manager';
8
8
  import { KupDataTableState } from './kup-data-table-state';
9
9
  import { setTooltip, unsetTooltip } from '../../utils/helpers';
10
- import { setDragEffectAllowed, setKetchupDraggable, setKetchupDroppable, setDragDropPayload, getDragDropPayload, } from '../../utils/drag-and-drop';
11
- import { dragMultipleImg } from '../../assets/images/drag-multiple';
12
10
  import { FImage } from '../../f-components/f-image/f-image';
13
11
  import { FTextField } from '../../f-components/f-text-field/f-text-field';
14
12
  import { FChip } from '../../f-components/f-chip/f-chip';
@@ -26,6 +24,9 @@ import { KupLanguageDensity, KupLanguageFontsize, KupLanguageGeneric, KupLanguag
26
24
  import { KupThemeColorValues, KupThemeIconValues, } from '../../utils/kup-theme/kup-theme-declarations';
27
25
  import { componentWrapperId } from '../../variables/GenericVariables';
28
26
  import { KupDatesFormats } from '../../utils/kup-dates/kup-dates-declarations';
27
+ import { kupDragActiveAttr, KupDragEffect, kupDraggableCellAttr, kupDraggableColumnAttr, KupDropEventTypes, KupPointerEventTypes, } from '../../utils/kup-interact/kup-interact-declarations';
28
+ import { FCellPadding, } from '../../f-components/f-cell/f-cell-declarations';
29
+ import { FCell } from '../../f-components/f-cell/f-cell';
29
30
  export class KupDataTable {
30
31
  constructor() {
31
32
  //////////////////////////////
@@ -33,6 +34,11 @@ export class KupDataTable {
33
34
  //////////////////////////////
34
35
  this.stateId = '';
35
36
  this.state = new KupDataTableState();
37
+ /**
38
+ * When true and when a row is missing some columns, the missing cells will be autogenerated.
39
+ * @default false
40
+ */
41
+ this.autoFillMissingCells = false;
36
42
  /**
37
43
  * Custom style of the component. For more information: https://ketchup.smeup.com/ketchup-showcase/#/customization
38
44
  */
@@ -40,7 +46,7 @@ export class KupDataTable {
40
46
  /**
41
47
  * The density of the rows, defaults at 'medium' and can be also set to 'large' or 'small'.
42
48
  */
43
- this.density = 'dense';
49
+ this.density = FCellPadding.DENSE;
44
50
  /**
45
51
  * Enables drag.
46
52
  */
@@ -159,6 +165,10 @@ export class KupDataTable {
159
165
  * Sets the possibility to remove the selected column.
160
166
  */
161
167
  this.removableColumns = false;
168
+ /**
169
+ * Gives the possibility to resize columns by dragging on their right edge.
170
+ */
171
+ this.resizableColumns = true;
162
172
  /**
163
173
  * Sets the number of rows per page to display.
164
174
  */
@@ -244,10 +254,6 @@ export class KupDataTable {
244
254
  * name of the column with the opened total menu
245
255
  */
246
256
  this.openedTotalMenu = null;
247
- /**
248
- * name of the column with the opened group menu
249
- */
250
- this.openedGroupMenu = null;
251
257
  this.openedCustomSettings = false;
252
258
  this.fontsize = 'medium';
253
259
  /**
@@ -264,32 +270,6 @@ export class KupDataTable {
264
270
  this.renderedRows = [];
265
271
  this.loadMoreEventCounter = 0;
266
272
  this.loadMoreEventPreviousQuantity = 0;
267
- /**
268
- * Internal not reactive state used to keep track if a column is being dragged.
269
- * @private
270
- */
271
- this.columnsAreBeingDragged = false;
272
- /**
273
- * Attribute to set when a column is being dragged on the whole thead element
274
- * @const
275
- * @default 'columns-dragging'
276
- * @private
277
- */
278
- this.dragFlagAttribute = 'columns-dragging';
279
- /**
280
- * The string representing the drag over attribute
281
- * @const
282
- * @default 'drag-over'
283
- * @private
284
- */
285
- this.dragOverAttribute = 'drag-over';
286
- /**
287
- * The string representing the drag starter attribute to set onto the element
288
- * @const
289
- * @default 'drag-starter'
290
- * @private
291
- */
292
- this.dragStarterAttribute = 'drag-starter';
293
273
  /**
294
274
  * contains the original data, used in transposed function
295
275
  * @private
@@ -300,13 +280,23 @@ export class KupDataTable {
300
280
  this.navBarHeight = 0;
301
281
  this.theadIntersecting = false;
302
282
  this.tableIntersecting = false;
303
- this.iconPaths = undefined;
304
283
  this.isSafariBrowser = false;
305
284
  this.isRestoringState = false;
306
285
  this.totalMenuCoords = null;
307
286
  this.clickTimeout = [];
287
+ this.thRefs = [];
308
288
  this.rowsRefs = [];
309
289
  this.oldWidth = null;
290
+ this.hold = false;
291
+ this.interactableDrag = [];
292
+ this.interactableDrop = [];
293
+ this.interactableResize = [];
294
+ this.interactableTouch = [];
295
+ this.dropareaRef = null;
296
+ this.removeDropareaRef = null;
297
+ this.groupsDropareaRef = null;
298
+ this.clickCb = null;
299
+ this.clickCbCustomPanel = null;
310
300
  /**
311
301
  * Reference to the row detail card.
312
302
  */
@@ -338,7 +328,6 @@ export class KupDataTable {
338
328
  'format-color-text',
339
329
  'format-font-size-increase',
340
330
  ];
341
- this.DENSITY_CODES = ['dense', 'medium', 'wide'];
342
331
  this.DENSITY_DECODES = ['Dense', 'Normal', 'Wide'];
343
332
  this.DENSITY_ICONS = [
344
333
  'format-align-justify',
@@ -627,16 +616,6 @@ export class KupDataTable {
627
616
  this.columnMenuCard.layoutNumber = 12;
628
617
  this.columnMenuCard.sizeX = 'auto';
629
618
  this.columnMenuCard.sizeY = 'auto';
630
- this.columnMenuCard.tabIndex = -1;
631
- this.columnMenuCard.onclick = (e) => e.stopPropagation();
632
- this.columnMenuCard.addEventListener('blur', () => {
633
- if (this.kupManager.utilities.lastPointerDownPath.includes(this.columnMenuCard)) {
634
- this.columnMenuCard.focus();
635
- }
636
- else {
637
- this.closeColumnMenu();
638
- }
639
- });
640
619
  this.columnMenuCard.addEventListener('kup-card-click', (e) => {
641
620
  this.kupDataTableColumnMenu.emit({
642
621
  comp: this,
@@ -685,6 +664,32 @@ export class KupDataTable {
685
664
  this.resizeTimeout = window.setTimeout(() => this.refresh(), 300);
686
665
  }
687
666
  }
667
+ /**
668
+ * Sets the focus on an editable table cell.
669
+ * @param {string} column - Name of the column.
670
+ * @param {string} rowId - Id of the row.
671
+ */
672
+ async setFocus(column, rowId) {
673
+ const cells = this.rootElement.shadowRoot.querySelectorAll('td[data-column="' + column + '"]');
674
+ for (let index = 0; cells && index < cells.length; index++) {
675
+ const cell = cells[index];
676
+ if (cell['data-row'] && cell['data-row'].id == rowId) {
677
+ const input = cell.querySelector('input');
678
+ if (input) {
679
+ input.focus();
680
+ }
681
+ else {
682
+ const kupInput = cell.querySelector('.hydrated');
683
+ if (kupInput) {
684
+ try {
685
+ kupInput.setFocus();
686
+ }
687
+ catch (error) { }
688
+ }
689
+ }
690
+ }
691
+ }
692
+ }
688
693
  /**
689
694
  * Sets the props to the component.
690
695
  * @param {GenericObject} props - Object containing props that will be set to the component.
@@ -911,7 +916,7 @@ export class KupDataTable {
911
916
  cells[cellName].icon = oldColumn.icon;
912
917
  }
913
918
  if (oldColumn.shape && !cells[cellName].shape) {
914
- cells[cellName].shape = oldColumn.icon;
919
+ cells[cellName].shape = oldColumn.shape;
915
920
  }
916
921
  }
917
922
  // If a record is key and no column argument is provided, it will be placed on top
@@ -951,14 +956,16 @@ export class KupDataTable {
951
956
  else {
952
957
  this.navBarHeight = 0;
953
958
  }
954
- this.stickyTheadRef.style.top = this.navBarHeight + 'px';
955
- const widthTable = this.tableAreaRef.offsetWidth;
956
- this.stickyTheadRef.style.maxWidth = widthTable + 'px';
957
- const thCollection = this.theadRef.querySelectorAll('th');
958
- const thStickyCollection = this.stickyTheadRef.querySelectorAll('th-sticky');
959
- for (let i = 0; i < thCollection.length; i++) {
960
- const widthTH = thCollection[i].offsetWidth;
961
- thStickyCollection[i].style.width = widthTH + 'px';
959
+ if (this.stickyTheadRef) {
960
+ this.stickyTheadRef.style.top = this.navBarHeight + 'px';
961
+ const widthTable = this.tableAreaRef.offsetWidth;
962
+ this.stickyTheadRef.style.maxWidth = widthTable + 'px';
963
+ const thCollection = this.theadRef.querySelectorAll('th');
964
+ const thStickyCollection = this.stickyTheadRef.querySelectorAll('th-sticky');
965
+ for (let i = 0; i < thCollection.length; i++) {
966
+ const widthTH = thCollection[i].offsetWidth;
967
+ thStickyCollection[i].style.width = widthTH + 'px';
968
+ }
962
969
  }
963
970
  }
964
971
  setObserver() {
@@ -1010,9 +1017,237 @@ export class KupDataTable {
1010
1017
  };
1011
1018
  this.intObserver = new IntersectionObserver(callback, options);
1012
1019
  }
1013
- didRenderObservers() {
1014
- if (this.paginatedRowsLength < this.rowsLength && this.lazyLoadRows) {
1015
- this.intObserver.observe(this.rowsRefs[this.paginatedRowsLength - 1]);
1020
+ didLoadInteractables() {
1021
+ this.interactableTouch.push(this.tableRef);
1022
+ const tapCb = (e) => {
1023
+ if (this.hold) {
1024
+ this.hold = false;
1025
+ return;
1026
+ }
1027
+ switch (e.button) {
1028
+ // left click
1029
+ case 0:
1030
+ // Note: event must be cloned
1031
+ // otherwise inside setTimeout will be exiting the Shadow DOM scope(causing loss of information, including target).
1032
+ const clone = {};
1033
+ for (const key in e) {
1034
+ clone[key] = e[key];
1035
+ }
1036
+ this.clickTimeout.push(setTimeout(() => {
1037
+ this.kupDataTableClick.emit({
1038
+ comp: this,
1039
+ id: this.rootElement.id,
1040
+ details: this.clickHandler(clone),
1041
+ });
1042
+ }, 300));
1043
+ break;
1044
+ // right click
1045
+ case 2:
1046
+ this.kupDataTableContextMenu.emit({
1047
+ comp: this,
1048
+ id: this.rootElement.id,
1049
+ details: this.contextMenuHandler(e),
1050
+ });
1051
+ break;
1052
+ }
1053
+ };
1054
+ const doubletapCb = (e) => {
1055
+ switch (e.button) {
1056
+ // left click
1057
+ case 0:
1058
+ for (let index = 0; index < this.clickTimeout.length; index++) {
1059
+ clearTimeout(this.clickTimeout[index]);
1060
+ this.kupManager.debug.logMessage(this, 'Cleared clickHandler timeout(' +
1061
+ this.clickTimeout[index] +
1062
+ ').');
1063
+ }
1064
+ this.clickTimeout = [];
1065
+ this.kupDataTableDblClick.emit({
1066
+ comp: this,
1067
+ id: this.rootElement.id,
1068
+ details: this.dblClickHandler(e),
1069
+ });
1070
+ break;
1071
+ }
1072
+ };
1073
+ const holdCb = (e) => {
1074
+ if (e.pointerType === 'pen' || e.pointerType === 'touch') {
1075
+ this.hold = true;
1076
+ this.kupDataTableContextMenu.emit({
1077
+ comp: this,
1078
+ id: this.rootElement.id,
1079
+ details: this.contextMenuHandler(e),
1080
+ });
1081
+ }
1082
+ };
1083
+ this.kupManager.interact.on(this.tableRef, KupPointerEventTypes.TAP, tapCb);
1084
+ this.kupManager.interact.on(this.tableRef, KupPointerEventTypes.DOUBLETAP, doubletapCb);
1085
+ this.kupManager.interact.on(this.tableRef, KupPointerEventTypes.HOLD, holdCb);
1086
+ }
1087
+ didRenderInteractables() {
1088
+ if (this.showGroups) {
1089
+ if (!this.interactableDrop.includes(this.groupsDropareaRef)) {
1090
+ this.interactableDrop.push(this.groupsDropareaRef);
1091
+ this.kupManager.interact.dropzone(this.groupsDropareaRef, {
1092
+ accept: `[${kupDraggableColumnAttr}]`,
1093
+ }, null, {
1094
+ drop: (e) => {
1095
+ const draggedTh = e.relatedTarget;
1096
+ const grouped = getColumnByName(this.getColumns(), draggedTh.dataset.column);
1097
+ this.handleColumnGroup(grouped);
1098
+ this.tableRef.removeAttribute(kupDragActiveAttr);
1099
+ },
1100
+ });
1101
+ }
1102
+ }
1103
+ if (this.removableColumns) {
1104
+ if (!this.interactableDrop.includes(this.removeDropareaRef)) {
1105
+ this.interactableDrop.push(this.removeDropareaRef);
1106
+ this.kupManager.interact.dropzone(this.removeDropareaRef, {
1107
+ accept: `[${kupDraggableColumnAttr}]`,
1108
+ }, null, {
1109
+ drop: (e) => {
1110
+ const draggedTh = e.relatedTarget;
1111
+ const deleted = getColumnByName(this.getColumns(), draggedTh.dataset.column);
1112
+ this.handleColumnRemove(deleted);
1113
+ this.tableRef.removeAttribute(kupDragActiveAttr);
1114
+ },
1115
+ });
1116
+ }
1117
+ }
1118
+ if (this.enableSortableColumns) {
1119
+ const dataCb = (e) => {
1120
+ const draggable = e.target;
1121
+ return {
1122
+ cell: null,
1123
+ column: getColumnByName(this.getVisibleColumns(), draggable.dataset.column),
1124
+ id: this.rootElement.id,
1125
+ multiple: !!(this.selection === SelectionMode.MULTIPLE ||
1126
+ this.selection === SelectionMode.MULTIPLE_CHECKBOX),
1127
+ row: null,
1128
+ selectedRows: this.selectedRows,
1129
+ };
1130
+ };
1131
+ const dropCb = (e) => {
1132
+ const draggable = e.relatedTarget;
1133
+ const sorted = draggable.kupDragDrop.column;
1134
+ const receiving = getColumnByName(this.getColumns(), e.target.dataset.column);
1135
+ if (receiving && sorted) {
1136
+ this.handleColumnSort(receiving, sorted);
1137
+ }
1138
+ this.tableRef.removeAttribute(kupDragActiveAttr);
1139
+ };
1140
+ const startCb = (e) => {
1141
+ const draggable = e.target;
1142
+ this.hideShowColumnDropArea(true, draggable);
1143
+ };
1144
+ const endCb = () => {
1145
+ this.hideShowColumnDropArea(false);
1146
+ };
1147
+ const dropCallbacks = {
1148
+ drop: dropCb,
1149
+ };
1150
+ const dragCallbacks = {
1151
+ start: startCb,
1152
+ end: endCb,
1153
+ };
1154
+ for (let index = 0; index < this.thRefs.length; index++) {
1155
+ const th = this.thRefs[index];
1156
+ if (th && !this.interactableDrag.includes(th)) {
1157
+ this.interactableDrag.push(th);
1158
+ this.kupManager.interact.dropzone(th, {
1159
+ accept: `[${kupDraggableColumnAttr}]`,
1160
+ }, null, dropCallbacks);
1161
+ this.kupManager.interact.draggable(th, {
1162
+ cursorChecker() {
1163
+ return null;
1164
+ },
1165
+ ignoreFrom: '.header-cell__drag-handler',
1166
+ }, {
1167
+ callback: dataCb,
1168
+ }, KupDragEffect.CLONE, dragCallbacks);
1169
+ }
1170
+ }
1171
+ }
1172
+ if (this.resizableColumns) {
1173
+ const moveCb = (e) => {
1174
+ const column = getColumnByName(this.getVisibleColumns(), e.target.dataset.column);
1175
+ column.size = e.rect.width + 'px';
1176
+ this.refresh();
1177
+ };
1178
+ const callbacks = {
1179
+ move: moveCb,
1180
+ };
1181
+ for (let index = 0; index < this.thRefs.length; index++) {
1182
+ const th = this.thRefs[index];
1183
+ if (th && !this.interactableResize.includes(th)) {
1184
+ this.interactableResize.push(th);
1185
+ this.kupManager.interact.resizable(th, {
1186
+ allowFrom: '.header-cell__drag-handler',
1187
+ edges: {
1188
+ left: false,
1189
+ right: true,
1190
+ bottom: false,
1191
+ top: false,
1192
+ },
1193
+ ignoreFrom: '.header-cell__content',
1194
+ }, callbacks);
1195
+ }
1196
+ }
1197
+ }
1198
+ if (this.dragEnabled) {
1199
+ for (let index = 0; index < this.rowsRefs.length; index++) {
1200
+ const row = this.rowsRefs[index];
1201
+ const dataCb = () => {
1202
+ const cellEl = this.rootElement.shadowRoot.querySelector('td:hover');
1203
+ return {
1204
+ cell: cellEl['data-cell'],
1205
+ column: getColumnByName(this.getVisibleColumns(), cellEl.dataset.column),
1206
+ id: this.rootElement.id,
1207
+ multiple: !!(this.selection === SelectionMode.MULTIPLE ||
1208
+ this.selection === SelectionMode.MULTIPLE_CHECKBOX),
1209
+ row: cellEl['data-row'],
1210
+ selectedRows: this.selectedRows,
1211
+ };
1212
+ };
1213
+ if (row && !this.interactableDrag.includes(row)) {
1214
+ this.interactableDrag.push(row);
1215
+ this.kupManager.interact.draggable(row, {
1216
+ allowFrom: 'td',
1217
+ cursorChecker() {
1218
+ return null;
1219
+ },
1220
+ }, {
1221
+ callback: dataCb,
1222
+ }, KupDragEffect.BADGE);
1223
+ }
1224
+ }
1225
+ }
1226
+ if (this.dropEnabled) {
1227
+ const dataCb = () => {
1228
+ const receivingDetails = this.getEventDetails([
1229
+ this.rootElement.shadowRoot.querySelector('td:hover'),
1230
+ ]);
1231
+ return {
1232
+ cell: receivingDetails.cell,
1233
+ column: receivingDetails.column,
1234
+ id: this.rootElement.id,
1235
+ row: receivingDetails.row,
1236
+ };
1237
+ };
1238
+ for (let index = 0; index < this.rowsRefs.length; index++) {
1239
+ const row = this.rowsRefs[index];
1240
+ if (row && !this.interactableDrop.includes(row)) {
1241
+ this.interactableDrop.push(row);
1242
+ this.kupManager.interact.dropzone(row, {
1243
+ accept: `[${kupDraggableCellAttr}]`,
1244
+ }, {
1245
+ callback: dataCb,
1246
+ dispatcher: this.rootElement,
1247
+ type: KupDropEventTypes.DATATABLE,
1248
+ });
1249
+ }
1250
+ }
1016
1251
  }
1017
1252
  }
1018
1253
  didLoadObservers() {
@@ -1023,6 +1258,11 @@ export class KupDataTable {
1023
1258
  this.intObserver.observe(this.theadRef);
1024
1259
  }
1025
1260
  }
1261
+ didRenderObservers() {
1262
+ if (this.paginatedRowsLength < this.rowsLength && this.lazyLoadRows) {
1263
+ this.intObserver.observe(this.rowsRefs[this.paginatedRowsLength - 1]);
1264
+ }
1265
+ }
1026
1266
  didLoadEventHandling() {
1027
1267
  this.tableAreaRef.addEventListener('scroll', () => this.scrollStickyHeader());
1028
1268
  }
@@ -1049,11 +1289,9 @@ export class KupDataTable {
1049
1289
  }
1050
1290
  }
1051
1291
  customizePanelPosition() {
1052
- if (this.customizeTopButtonRef) {
1053
- this.kupManager.dynamicPosition.register(this.customizeTopPanelRef, this.customizeTopButtonRef);
1054
- }
1055
- if (this.customizeBottomButtonRef) {
1056
- this.kupManager.dynamicPosition.register(this.customizeBottomPanelRef, this.customizeBottomButtonRef);
1292
+ if (this.customizeTopButtonRef &&
1293
+ !this.kupManager.dynamicPosition.isRegistered(this.customizeTopPanelRef)) {
1294
+ this.kupManager.dynamicPosition.register(this.customizeTopPanelRef, this.customizeTopButtonRef, 0, KupDynamicPositionPlacement.BOTTOM, true);
1057
1295
  }
1058
1296
  }
1059
1297
  rowsPointLength() {
@@ -1130,7 +1368,7 @@ export class KupDataTable {
1130
1368
  componentDidRender() {
1131
1369
  const root = this.rootElement.shadowRoot;
1132
1370
  if (root) {
1133
- const fs = root.querySelectorAll('.f-text-field--wrapper');
1371
+ const fs = root.querySelectorAll('.f-text-field');
1134
1372
  for (let index = 0; index < fs.length; index++) {
1135
1373
  FTextFieldMDC(fs[index]);
1136
1374
  }
@@ -1141,6 +1379,7 @@ export class KupDataTable {
1141
1379
  this.totalMenuPosition();
1142
1380
  this.checkScrollOnHover();
1143
1381
  this.didRenderObservers();
1382
+ this.didRenderInteractables();
1144
1383
  this.hideShowColumnDropArea(false);
1145
1384
  this.setDynPosElements();
1146
1385
  if (this.headerIsPersistent &&
@@ -1160,7 +1399,7 @@ export class KupDataTable {
1160
1399
  componentDidLoad() {
1161
1400
  this.didLoadObservers();
1162
1401
  this.didLoadEventHandling();
1163
- // automatic row selection
1402
+ this.didLoadInteractables();
1164
1403
  if (this.selectRowsById) {
1165
1404
  this.setSelectedRows(this.selectRowsById);
1166
1405
  }
@@ -1181,6 +1420,17 @@ export class KupDataTable {
1181
1420
  this.kupManager.debug.logLoad(this, true);
1182
1421
  }
1183
1422
  //======== Utility methods ========
1423
+ getEventPath(e) {
1424
+ let path = [];
1425
+ let currentEl = e.target;
1426
+ while (currentEl !== this.rootElement && currentEl !== document.body) {
1427
+ path.push(currentEl);
1428
+ currentEl = currentEl.parentNode
1429
+ ? currentEl.parentNode
1430
+ : currentEl.host;
1431
+ }
1432
+ return path;
1433
+ }
1184
1434
  resetSelectedRows() {
1185
1435
  if (!this.data || !this.data.rows || this.data.rows.length === 0)
1186
1436
  return;
@@ -1361,12 +1611,58 @@ export class KupDataTable {
1361
1611
  }
1362
1612
  this.detailCard.data = cardData;
1363
1613
  this.detailCard.style.position = 'fixed';
1364
- this.detailCard.style.left = x + 'px';
1365
- this.detailCard.style.top = y + 'px';
1614
+ this.detailCard.style.left = '0';
1615
+ this.detailCard.style.top = '0';
1616
+ this.detailCard.setAttribute('data-x', x.toString());
1617
+ this.detailCard.setAttribute('data-y', y.toString());
1618
+ this.detailCard.style.transform = 'translate(' + x + 'px,' + y + 'px)';
1366
1619
  this.rootElement.shadowRoot.append(this.detailCard);
1367
1620
  }
1368
- getEventDetails(el) {
1369
- const isHeader = !!el.closest('thead'), isBody = !!el.closest('tbody'), isFooter = !!el.closest('tfoot'), td = el.closest('td'), textfield = el.closest('.f-text-field--wrapper'), th = el.closest('th'), tr = el.closest('tr'), filterRemove = el.closest('th .filter-remove');
1621
+ getEventDetails(path) {
1622
+ let isHeader, isBody, isFooter, td, textfield, th, tr, filterRemove;
1623
+ if (path) {
1624
+ for (let i = path.length - 1; i >= 0; i--) {
1625
+ let p = path[i];
1626
+ if (!p.tagName) {
1627
+ continue;
1628
+ }
1629
+ switch (p.tagName.toUpperCase()) {
1630
+ case 'THEAD': {
1631
+ isHeader = true;
1632
+ break;
1633
+ }
1634
+ case 'TBODY': {
1635
+ isBody = true;
1636
+ break;
1637
+ }
1638
+ case 'TFOOT': {
1639
+ isFooter = true;
1640
+ break;
1641
+ }
1642
+ case 'TD': {
1643
+ td = p;
1644
+ break;
1645
+ }
1646
+ case 'TH': {
1647
+ th = p;
1648
+ break;
1649
+ }
1650
+ case 'TR': {
1651
+ tr = p;
1652
+ break;
1653
+ }
1654
+ default: {
1655
+ if (p.classList.contains('f-text-field')) {
1656
+ textfield = p;
1657
+ }
1658
+ else if (p.classList.contains(KupThemeIconValues.FILTER_REMOVE.replace('--', ''))) {
1659
+ filterRemove = p;
1660
+ }
1661
+ break;
1662
+ }
1663
+ }
1664
+ }
1665
+ }
1370
1666
  let cell = null, column = null, isGroupRow = false, row = null;
1371
1667
  if (isBody) {
1372
1668
  if (tr) {
@@ -1414,7 +1710,7 @@ export class KupDataTable {
1414
1710
  };
1415
1711
  }
1416
1712
  clickHandler(e) {
1417
- const details = this.getEventDetails(e.target);
1713
+ const details = this.getEventDetails(this.getEventPath(e));
1418
1714
  if (details.area === 'header') {
1419
1715
  if (details.th && details.column) {
1420
1716
  if (details.filterRemove) {
@@ -1446,15 +1742,14 @@ export class KupDataTable {
1446
1742
  return details;
1447
1743
  }
1448
1744
  if (details.td && details.row && !details.textfield) {
1449
- this.onRowClick(e, details.row, true);
1745
+ this.onRowClick(details.row, details.td, true);
1450
1746
  return details;
1451
1747
  }
1452
1748
  }
1453
1749
  return details;
1454
1750
  }
1455
1751
  contextMenuHandler(e) {
1456
- e.preventDefault();
1457
- const details = this.getEventDetails(e.target);
1752
+ const details = this.getEventDetails(this.getEventPath(e));
1458
1753
  if (details.area === 'header') {
1459
1754
  if (details.th && details.column) {
1460
1755
  this.openColumnMenu(details.column.name);
@@ -1463,7 +1758,7 @@ export class KupDataTable {
1463
1758
  }
1464
1759
  else if (details.area === 'body') {
1465
1760
  const _hasTooltip = details.cell.obj
1466
- ? this.kupManager.objects.hasTooltip(details.cell.obj)
1761
+ ? !this.kupManager.objects.isEmptyKupObj(details.cell.obj)
1467
1762
  : false;
1468
1763
  if (_hasTooltip &&
1469
1764
  this.showTooltipOnRightClick &&
@@ -1484,37 +1779,18 @@ export class KupDataTable {
1484
1779
  return details;
1485
1780
  }
1486
1781
  dblClickHandler(e) {
1487
- const details = this.getEventDetails(e.target);
1782
+ const details = this.getEventDetails(this.getEventPath(e));
1488
1783
  if (details.area === 'body') {
1489
1784
  if (this.selection == SelectionMode.MULTIPLE) {
1490
1785
  this.resetSelectedRows();
1491
1786
  }
1492
1787
  if (this.selection == SelectionMode.SINGLE ||
1493
1788
  this.selection == SelectionMode.MULTIPLE) {
1494
- this.onRowClick(e, details.row, false);
1789
+ this.onRowClick(details.row, details.td, false);
1495
1790
  }
1496
1791
  }
1497
1792
  return details;
1498
1793
  }
1499
- mouseMoveHandler(e) {
1500
- const details = this.getEventDetails(e.target);
1501
- const hoverEl = this.rootElement.shadowRoot.querySelector('.hover');
1502
- if (hoverEl) {
1503
- hoverEl.classList.remove('hover');
1504
- }
1505
- if (details.area === 'body') {
1506
- if (details.tr) {
1507
- details.tr.classList.add('hover');
1508
- return;
1509
- }
1510
- }
1511
- }
1512
- mouseOutHandler() {
1513
- const hoverEl = this.rootElement.shadowRoot.querySelector('.hover');
1514
- if (hoverEl) {
1515
- hoverEl.classList.remove('hover');
1516
- }
1517
- }
1518
1794
  getVisibleColumns() {
1519
1795
  // TODO: change into `visible ?? true` when TS dependency has been updated
1520
1796
  const visibleColumns = this.getColumns().filter(({ visible }) => visible !== undefined ? visible : true);
@@ -1559,12 +1835,6 @@ export class KupDataTable {
1559
1835
  getRows() {
1560
1836
  return this.data && this.data.rows ? this.data.rows : [];
1561
1837
  }
1562
- // TODO if is not shared, move this in the third parameter of setKetchupDraggable method
1563
- addMultiSelectDragImageToEvent(event) {
1564
- const dragImage = document.createElement('img');
1565
- dragImage.src = dragMultipleImg;
1566
- event.dataTransfer.setDragImage(dragImage, 0, 0);
1567
- }
1568
1838
  initRows() {
1569
1839
  this.filterRows();
1570
1840
  this.footer = calcTotals(normalizeRows(this.getColumns(), this.rows), this.totals);
@@ -1803,9 +2073,7 @@ export class KupDataTable {
1803
2073
  this.currentRowsPerPage = detail.newRowsPerPage;
1804
2074
  this.adjustPaginator();
1805
2075
  }
1806
- onRowClick(event, row, emitEvent) {
1807
- // checking target
1808
- const target = event.target;
2076
+ onRowClick(row, td, emitEvent) {
1809
2077
  // selecting row
1810
2078
  if (!row.unselectable) {
1811
2079
  switch (this.selection) {
@@ -1830,18 +2098,9 @@ export class KupDataTable {
1830
2098
  }
1831
2099
  }
1832
2100
  // find clicked column
1833
- let clickedColumn = null;
1834
- if (target instanceof HTMLElement) {
1835
- if (target.tagName !== 'TR') {
1836
- let currentElement = target;
1837
- while (currentElement.tagName !== 'TD') {
1838
- currentElement = currentElement.parentElement;
1839
- }
1840
- clickedColumn = currentElement.dataset.column;
1841
- }
1842
- }
2101
+ const clickedColumn = td.dataset.column;
1843
2102
  // selecting clicked column
1844
- if (clickedColumn) {
2103
+ if (this.selection !== SelectionMode.NONE && clickedColumn) {
1845
2104
  this.deselectColumn(this.selectedColumn);
1846
2105
  this.selectedColumn = clickedColumn;
1847
2106
  this.selectColumn(this.selectedColumn);
@@ -1896,33 +2155,6 @@ export class KupDataTable {
1896
2155
  type: 'expander',
1897
2156
  });
1898
2157
  }
1899
- cellUpdate(e, value, cell, column, row) {
1900
- if (this.kupManager.objects.isCheckbox(cell.obj)) {
1901
- if (cell.data && cell.data['checked'] !== undefined) {
1902
- cell.data['checked'] = value === 'on' ? false : true;
1903
- }
1904
- }
1905
- else {
1906
- if (cell.obj) {
1907
- cell.obj.k = value;
1908
- }
1909
- cell.value = value;
1910
- cell.displayedValue = null;
1911
- cell.displayedValue = getCellValueForDisplay(column, cell);
1912
- if (cell.data && cell.data['value'] !== undefined) {
1913
- cell.data['value'] = value;
1914
- }
1915
- }
1916
- this.refresh();
1917
- this.kupDataTableCellUpdate.emit({
1918
- comp: this,
1919
- id: this.rootElement.id,
1920
- cell: cell,
1921
- column: column,
1922
- row: row,
1923
- event: e,
1924
- });
1925
- }
1926
2158
  handleRowSelect(row) {
1927
2159
  const index = this.selectedRows.indexOf(row);
1928
2160
  if (index < 0) {
@@ -1973,93 +2205,14 @@ export class KupDataTable {
1973
2205
  }
1974
2206
  closeTotalMenu() {
1975
2207
  this.openedTotalMenu = null;
2208
+ this.kupManager.removeClickCallback(this.clickCb);
1976
2209
  }
1977
- /* TODO
1978
- private openGroupMenu(column: Column) {
1979
- this.openedGroupMenu = column.name;
1980
- }
1981
-
1982
- private closeGroupMenu() {
1983
- this.openedGroupMenu = null;
1984
- }
1985
- */
1986
2210
  closeMenuAndTooltip() {
1987
2211
  unsetTooltip(this.tooltip);
1988
2212
  }
1989
- isOpenedTotalMenu() {
1990
- return this.openedTotalMenu != null;
1991
- }
1992
2213
  isOpenedTotalMenuForColumn(column) {
1993
2214
  return this.openedTotalMenu === column;
1994
2215
  }
1995
- isOpenedGroupMenu() {
1996
- return this.openedGroupMenu != null;
1997
- }
1998
- isOpenedGroupMenuForColumn(column) {
1999
- return this.openedGroupMenu === column;
2000
- }
2001
- /**
2002
- * Type guard needed to be sure that an object returned from composePath() is an HTMLElement with classes
2003
- * @param node
2004
- */
2005
- isHTMLElementFromEventTarget(node) {
2006
- return node.classList !== undefined;
2007
- }
2008
- hasOverlayActions(column) {
2009
- if (column == null || column.obj == null) {
2010
- return false;
2011
- }
2012
- return this.kupManager.objects.canHaveAutomaticDerivedColumn(column.obj);
2013
- }
2014
- onHeaderCellContextMenuClose(event) {
2015
- // Gets the path of the event (does not work in IE11 or previous)
2016
- const eventPath = event.composedPath();
2017
- let fromTotalMenu = false;
2018
- let fromSameTable = false;
2019
- // Examine the path
2020
- for (let elem of eventPath) {
2021
- // TODO When the footer is considered stable please do this in another dedicated method
2022
- // check if is the open menu button the element which fired the event
2023
- // TODO Maybe a better approach would be to use the blur event in order to hide the menu
2024
- if (elem.id === totalMenuOpenID) {
2025
- return;
2026
- }
2027
- // If we encounter our table we can stop looping the elements
2028
- if (elem === this.tableAreaRef) {
2029
- fromSameTable = true;
2030
- break;
2031
- }
2032
- // TODO When the footer is considered stable please do this in another dedicated method
2033
- // If the event comes from a menu of the table footer
2034
- if (this.isHTMLElementFromEventTarget(elem) &&
2035
- elem.classList &&
2036
- elem.classList.contains('total-menu')) {
2037
- fromTotalMenu = true;
2038
- }
2039
- }
2040
- // TODO When the footer is considered stable please do this in another dedicated method
2041
- if (this.isOpenedTotalMenu() && !(fromTotalMenu && fromSameTable)) {
2042
- this.closeTotalMenu();
2043
- }
2044
- }
2045
- onJ4btnClicked(row, column, cell) {
2046
- // Since this function is called with bind, the event from the kup-button gets passed into the arguments array
2047
- const buttonEvent = arguments[3];
2048
- if (buttonEvent) {
2049
- // Prevents double events to be fired.
2050
- buttonEvent.stopPropagation();
2051
- }
2052
- else {
2053
- throw 'kup-data-table error: missing event';
2054
- }
2055
- this.kupCellButtonClick.emit({
2056
- comp: this,
2057
- id: this.rootElement.id,
2058
- cell: cell,
2059
- column: column,
2060
- row: row,
2061
- });
2062
- }
2063
2216
  // utility methods
2064
2217
  groupRows() {
2065
2218
  if (!this.isGrouping()) {
@@ -2219,7 +2372,7 @@ export class KupDataTable {
2219
2372
  * @param extraCells - the extra cells rendered into the table
2220
2373
  */
2221
2374
  composeHeaderCellClassAndStyle(columnIndex, extraCells = 0, column) {
2222
- let columnClass = {}, thStyle = {};
2375
+ let columnClass = { ['header-cell']: true }, thStyle = column.style ? Object.assign({}, column.style) : {};
2223
2376
  if (this.kupManager.objects.isBar(column.obj) ||
2224
2377
  this.kupManager.objects.isButton(column.obj) ||
2225
2378
  this.kupManager.objects.isChart(column.obj) ||
@@ -2229,13 +2382,13 @@ export class KupDataTable {
2229
2382
  this.kupManager.objects.isProgressBar(column.obj) ||
2230
2383
  this.kupManager.objects.isRadio(column.obj) ||
2231
2384
  this.kupManager.objects.isVoCodver(column.obj)) {
2232
- columnClass.centered = true;
2385
+ columnClass['header-cell--centered'] = true;
2233
2386
  }
2234
2387
  if (this.kupManager.objects.isNumber(column.obj)) {
2235
- columnClass.number = true;
2388
+ columnClass['header-cell--is-number'] = true;
2236
2389
  }
2237
2390
  if (this.kupManager.objects.isIcon(column.obj)) {
2238
- columnClass.icon = true;
2391
+ columnClass['header-cell--is-icon'] = true;
2239
2392
  }
2240
2393
  // For fixed cells styles and classes
2241
2394
  const fixedCellStyle = this.composeFixedCellStyleAndClass(columnIndex + 1 + extraCells, 0, extraCells);
@@ -2281,30 +2434,17 @@ export class KupDataTable {
2281
2434
  }
2282
2435
  // Renders normal cells
2283
2436
  const dataColumns = this.getVisibleColumns().map((column, columnIndex) => {
2284
- // Composes column cell style and classes
2285
2437
  const { columnClass, thStyle } = this.composeHeaderCellClassAndStyle(columnIndex, specialExtraCellsCount, column);
2286
- const overlay = null;
2287
- //---- Filter ----
2288
2438
  let filter = null;
2289
2439
  if (this.filtersColumnMenuInstance.hasFiltersForColumn(this.filters, column)) {
2290
2440
  const svgLabel = this.kupManager.language.translate(KupLanguageGeneric.REMOVE_FILTERS) + `: '${this.getFilterValueForTooltip(column)}'`;
2291
- /**
2292
- * When column has a filter but filters must not be displayed, shows an icon to remove the filter.
2293
- * Upon click, the filter gets removed.
2294
- * The payload event is simulated here.
2295
- */
2296
2441
  filter = (h("span", { title: svgLabel, class: `kup-icon ${KupThemeIconValues.FILTER_REMOVE.replace('--', '')}` }));
2297
2442
  }
2298
- //---- Sort ----
2299
2443
  let sortIcon = null;
2300
- // When sorting is enabled, there are two things to do:
2301
- // 1 - Add correct icon to the table
2302
- // 2 - stores the handler to be later set onto the whole cell
2303
2444
  let iconClass = this.getSortIcon(column.name);
2304
2445
  if (iconClass !== '') {
2305
2446
  sortIcon = (h("span", { class: iconClass, title: this.getSortDecode(column.name) }));
2306
2447
  }
2307
- // Adds the sortable class to the header cell
2308
2448
  columnClass['header-cell--sortable'] = true;
2309
2449
  let keyIcon = null;
2310
2450
  if (column.isKey) {
@@ -2326,97 +2466,14 @@ export class KupDataTable {
2326
2466
  }
2327
2467
  }
2328
2468
  }
2329
- // Reference for drag events and what they permit or not
2330
- // https://html.spec.whatwg.org/multipage/dnd.html#concept-dnd-p
2331
- const dragHandlers = {
2332
- onDragStart: (e) => {
2333
- // Sets the type of drag
2334
- setDragEffectAllowed(e, 'move');
2335
- const overElement = this.getThElement(e.target);
2336
- // Remember that the current target is different from the one print out in the console
2337
- // Sets which element has started the drag
2338
- overElement.setAttribute(this.dragStarterAttribute, '');
2339
- this.theadRef.setAttribute(this.dragFlagAttribute, '');
2340
- this.columnsAreBeingDragged = true;
2341
- this.hideShowColumnDropArea(true, overElement);
2342
- // TODO set drag payload and get it in the other methods when need it
2343
- // setDragDropPayload
2344
- // getDragDropPayload
2345
- // replace the used flags set with attribute
2346
- },
2347
- onDragEnd: (e) => {
2348
- // When the drag has ended, checks if the element still exists or it was destroyed by JSX
2349
- const overElement = this.getThElement(e.target);
2350
- if (overElement) {
2351
- // If it still exists, removes the attribute so that it can perform a new drag again
2352
- overElement.removeAttribute(this.dragStarterAttribute);
2353
- }
2354
- // Remove the over attribute
2355
- const dragDropPayload = getDragDropPayload();
2356
- if (dragDropPayload && dragDropPayload.overElement) {
2357
- dragDropPayload.overElement.removeAttribute(this.dragOverAttribute);
2358
- }
2359
- this.theadRef.removeAttribute(this.dragFlagAttribute);
2360
- this.columnsAreBeingDragged = false;
2361
- this.hideShowColumnDropArea(false);
2362
- },
2363
- };
2364
- const dropHandlers = {
2365
- onDrop: (e) => {
2366
- const transferredData = JSON.parse(e.dataTransfer.getData(KupDataTableColumnDragType));
2367
- // We are sure the tables have been dropped in a valid location -> starts sorting the columns
2368
- this.handleColumnSort(column, transferredData);
2369
- return KupDataTableColumnDragType;
2370
- },
2371
- onDragLeave: (e) => {
2372
- if (e.dataTransfer.types.indexOf(KupDataTableColumnDragType) >= 0) {
2373
- const overElement = this.getThElement(e.target);
2374
- if (overElement) {
2375
- overElement.removeAttribute(this.dragOverAttribute);
2376
- }
2377
- }
2378
- },
2379
- onDragOver: (e) => {
2380
- if (e.dataTransfer.types.indexOf(KupDataTableColumnDragType) >= 0) {
2381
- const overElement = this.getThElement(e.target);
2382
- overElement.setAttribute(this.dragOverAttribute, '');
2383
- // TODO do it without using the element but with data like id, etc.
2384
- setDragDropPayload({
2385
- overElement,
2386
- });
2387
- // If element can have a drop effect
2388
- if (!overElement.hasAttribute(this.dragStarterAttribute) &&
2389
- this.columnsAreBeingDragged) {
2390
- setDragEffectAllowed(e, 'move');
2391
- return true;
2392
- }
2393
- else {
2394
- setDragEffectAllowed(e, 'none');
2395
- return false;
2396
- }
2397
- }
2398
- },
2399
- };
2400
- columnClass.number = this.kupManager.objects.isNumber(column.obj);
2401
- return (h("th", Object.assign({ "data-cell": column, "data-column": column.name, class: columnClass, style: thStyle }, (this.enableSortableColumns
2402
- ? setKetchupDraggable(dragHandlers, {
2403
- [KupDataTableColumnDragType]: column,
2404
- 'kup-drag-source-element': {
2405
- column: column,
2406
- id: this.rootElement.id,
2407
- },
2408
- })
2409
- : {}), (this.enableSortableColumns
2410
- ? setKetchupDroppable(dropHandlers, [KupDataTableColumnDragType], this.rootElement, {
2411
- column: column,
2412
- id: this.rootElement.id,
2413
- })
2414
- : {})),
2415
- h("span", { class: "column-title" }, this.applyLineBreaks(column.title)),
2416
- overlay,
2417
- keyIcon,
2418
- sortIcon,
2419
- filter));
2469
+ return (h("th", { ref: (el) => this.thRefs.push(el), "data-cell": column, "data-column": column.name, class: columnClass, style: thStyle },
2470
+ h("div", { class: "header-cell__content" },
2471
+ h("span", { class: "header-cell__title" }, this.applyLineBreaks(column.title)),
2472
+ h("span", { class: "header-cell__icons" },
2473
+ keyIcon,
2474
+ sortIcon,
2475
+ filter)),
2476
+ this.resizableColumns ? (h("span", { class: "header-cell__drag-handler" })) : null));
2420
2477
  });
2421
2478
  return [multiSelectColumn, actionsColumn, ...dataColumns];
2422
2479
  // return [multiSelectColumn, groupColumn, actionsColumn, ...dataColumns];
@@ -2455,10 +2512,10 @@ export class KupDataTable {
2455
2512
  const dataColumns = this.getVisibleColumns().map((column, columnIndex) => {
2456
2513
  const { columnClass, thStyle } = this.composeHeaderCellClassAndStyle(columnIndex, specialExtraCellsCount, column);
2457
2514
  return (h("th-sticky", { class: columnClass, style: thStyle },
2458
- h("span", { class: "column-title" }, this.applyLineBreaks(column.title))));
2515
+ h("div", { class: "header-cell__content" },
2516
+ h("span", { class: "header-cell__title" }, this.applyLineBreaks(column.title)))));
2459
2517
  });
2460
2518
  return [multiSelectColumn, actionsColumn, ...dataColumns];
2461
- //return [multiSelectColumn, groupColumn, actionsColumn, ...dataColumns];
2462
2519
  }
2463
2520
  renderTooltip() {
2464
2521
  if (this.tooltipEnabled == false) {
@@ -2466,9 +2523,7 @@ export class KupDataTable {
2466
2523
  }
2467
2524
  return (h("kup-tooltip", { class: "datatable-tooltip", owner: this.rootElement.tagName, loadTimeout: this.showTooltipOnRightClick == true
2468
2525
  ? 0
2469
- : this.tooltipLoadTimeout, onBlur: () => {
2470
- this.tooltip.data = null;
2471
- }, detailTimeout: this.tooltipDetailTimeout, ref: (el) => (this.tooltip = el), tabindex: 0 }));
2526
+ : this.tooltipLoadTimeout, detailTimeout: this.tooltipDetailTimeout, ref: (el) => (this.tooltip = el) }));
2472
2527
  }
2473
2528
  areTotalsSelected(column) {
2474
2529
  return this.totals && this.totals[column.name] ? true : false;
@@ -2496,10 +2551,16 @@ export class KupDataTable {
2496
2551
  if (this.rootElement.shadowRoot) {
2497
2552
  const menu = this.rootElement.shadowRoot.querySelector('#totals-menu');
2498
2553
  if (menu) {
2499
- this.kupManager.dynamicPosition.register(menu, this.totalMenuCoords, 0, KupDynamicPositionPlacement.TOP_RIGHT);
2554
+ this.kupManager.dynamicPosition.register(menu, this.totalMenuCoords);
2555
+ this.clickCb = {
2556
+ cb: () => {
2557
+ this.closeTotalMenu();
2558
+ },
2559
+ el: menu,
2560
+ };
2561
+ this.kupManager.addClickCallback(this.clickCb, true);
2500
2562
  this.kupManager.dynamicPosition.start(menu);
2501
- menu.classList.add('visible');
2502
- setTimeout(() => menu.focus(), 0);
2563
+ menu.menuVisible = true;
2503
2564
  }
2504
2565
  }
2505
2566
  }
@@ -2639,7 +2700,7 @@ export class KupDataTable {
2639
2700
  });
2640
2701
  }
2641
2702
  }
2642
- totalMenu = (h("kup-list", { class: `kup-menu total-menu`, data: listData, id: "totals-menu", "is-menu": true, keyboardNavigation: true, "menu-visible": true, onBlur: () => this.closeTotalMenu(), "onkup-list-click": (event) => this.onTotalsChange(event, column), tabindex: 0 }));
2703
+ totalMenu = (h("kup-list", { class: `total-menu`, data: listData, id: "totals-menu", "is-menu": true, keyboardNavigation: true, "menu-visible": true, "onkup-list-click": (event) => this.onTotalsChange(event, column), tabindex: 0 }));
2643
2704
  }
2644
2705
  // TODO please use getValueForDisplay
2645
2706
  let value;
@@ -2748,33 +2809,6 @@ export class KupDataTable {
2748
2809
  value = numberToFormattedStringNumber(totalValue, column.decimals, column.obj ? column.obj.p : '');
2749
2810
  }
2750
2811
  }
2751
- /*
2752
- TODO Group Menu
2753
- const groupMenu = undefined;
2754
- if (this.isOpenedGroupMenuForColumn(column.name)) {
2755
- const listData: KupListData[] = [
2756
- {
2757
- text: 'Matrice dei totali',
2758
- value: 'MATTOT',
2759
- selected: false,
2760
- },
2761
- ];
2762
-
2763
- groupMenu = (
2764
- <kup-list
2765
- class={`kup-menu group-menu`}
2766
- data={...listData}
2767
- id="group-menu"
2768
- is-menu
2769
- menu-visible
2770
- onBlur={() => this.closeGroupMenu()}
2771
- onkup-list-click={(event) => console.log(event)}
2772
- tabindex={0}
2773
- ></kup-list>
2774
- );
2775
- }
2776
- {groupMenu}
2777
- */
2778
2812
  cells.push(h("td", { class: totalClass }, value));
2779
2813
  }
2780
2814
  jsxRows.push(h("tr", { ref: (el) => this.rowsRefs.push(el), "data-row": row, class: "group group-label" }, grouplabelcell));
@@ -2884,26 +2918,33 @@ export class KupDataTable {
2884
2918
  indend.push(h("span", { class: "indent" }));
2885
2919
  }
2886
2920
  }
2887
- const cell = row.cells[name];
2888
- const jsxCell = this.renderCell(indend, cell, row, currentColumn, hideValuesRepetitions && previousRow
2889
- ? previousRow.cells[name].value
2890
- : undefined);
2891
- // Classes which will be set onto the single data-table cell
2892
- let cellClass = {
2893
- // 'has-options': !!options,
2894
- 'is-graphic': this.kupManager.objects.isBar(cell.obj),
2895
- number: this.kupManager.objects.isNumber(cell.obj) &&
2896
- !isRating(cell, null) &&
2897
- !isGauge(cell, null) &&
2898
- !isKnob(cell, null),
2899
- };
2900
- if (cell.cssClass) {
2901
- cellClass[cell.cssClass] = true;
2902
- }
2903
- let cellStyle = null;
2904
- if (!styleHasBorderRadius(cell)) {
2905
- cellStyle = Object.assign({}, cell.style);
2921
+ const cell = row.cells[name] ? row.cells[name] : null;
2922
+ if (!cell) {
2923
+ if (this.autoFillMissingCells) {
2924
+ return h("td", { "data-column": name, "data-row": row });
2925
+ }
2926
+ else {
2927
+ return null;
2928
+ }
2906
2929
  }
2930
+ const cellProps = {
2931
+ cell: cell,
2932
+ column: currentColumn,
2933
+ component: this,
2934
+ density: this.density,
2935
+ editable: this.editableData,
2936
+ indents: indend,
2937
+ previousValue: hideValuesRepetitions && previousRow
2938
+ ? previousRow.cells[name].value
2939
+ : undefined,
2940
+ renderKup: this.lazyLoadCells,
2941
+ row: row,
2942
+ setSizes: true,
2943
+ };
2944
+ const jsxCell = h(FCell, Object.assign({}, cellProps));
2945
+ // Classes which will be set onto the single data-table cell;
2946
+ let cellClass = null;
2947
+ let cellStyle = Object.assign({}, cell.style);
2907
2948
  //-- For fixed cells --
2908
2949
  const fixedStyles = this.composeFixedCellStyleAndClass(cellIndex + 1 + specialExtraCellsCount, rowCssIndex, specialExtraCellsCount);
2909
2950
  if (fixedStyles) {
@@ -2936,20 +2977,10 @@ export class KupDataTable {
2936
2977
  * Controls if current cell needs a tooltip and eventually adds it.
2937
2978
  * @todo When the option forceOneLine is active, there is a problem with the current implementation of the tooltip. See documentation in the mauer wiki for better understanding.
2938
2979
  */
2939
- const _hasTooltip = this.kupManager.objects.hasTooltip(cell.obj);
2980
+ const _hasTooltip = !this.kupManager.objects.isEmptyKupObj(cell.obj);
2940
2981
  let eventHandlers = undefined;
2941
2982
  let title = undefined;
2942
2983
  if (_hasTooltip) {
2943
- cellClass['is-obj'] = true;
2944
- if (this.kupManager.debug.isDebug()) {
2945
- title =
2946
- cell.obj.t +
2947
- '; ' +
2948
- cell.obj.p +
2949
- '; ' +
2950
- cell.obj.k +
2951
- ';';
2952
- }
2953
2984
  if (!this.showTooltipOnRightClick) {
2954
2985
  eventHandlers = {
2955
2986
  onMouseEnter: (ev) => {
@@ -2961,14 +2992,8 @@ export class KupDataTable {
2961
2992
  };
2962
2993
  }
2963
2994
  }
2964
- return (h("td", Object.assign({}, (this.dropEnabled
2965
- ? setKetchupDroppable(dropHandlersCell, [KupDataTableRowDragType], this.rootElement, {
2966
- row: row,
2967
- cell: cell,
2968
- column: currentColumn,
2969
- id: this.rootElement.id,
2970
- })
2971
- : {}), { title: title, "data-cell": cell, "data-column": name, "data-row": row, style: cellStyle, class: cellClass }, eventHandlers), jsxCell));
2995
+ cellClass = Object.assign({}, cellClass);
2996
+ return (h("td", Object.assign({ title: title, colSpan: cell.span && cell.span.col ? cell.span.col : null, rowSpan: cell.span && cell.span.row ? cell.span.row : null, "data-cell": cell, "data-column": name, "data-row": row, style: cellStyle, class: cellClass }, eventHandlers), jsxCell));
2972
2997
  });
2973
2998
  // adding row to rendered rows
2974
2999
  this.renderedRows.push(row);
@@ -2978,67 +3003,10 @@ export class KupDataTable {
2978
3003
  if (row.cssClass) {
2979
3004
  rowClass[row.cssClass] = true;
2980
3005
  }
2981
- const dragHandlersRow = {
2982
- onDragStart: (e) => {
2983
- // get the tr tag
2984
- const trElement = e.target;
2985
- let cell = {};
2986
- let column = {};
2987
- if (trElement) {
2988
- // get the elements inside the row that were touched
2989
- const hoverElements = trElement.querySelectorAll(':hover');
2990
- if (hoverElements) {
2991
- // the td in position 0 is ALWAYS the last td touched
2992
- const tdElement = hoverElements[0];
2993
- if (tdElement) {
2994
- // get the column name in td element
2995
- const columnName = tdElement.getAttribute('data-column');
2996
- if (columnName) {
2997
- // finally get the cell
2998
- cell = row.cells[columnName];
2999
- // and the column
3000
- column = getColumnByName(this.getColumns(), columnName);
3001
- }
3002
- }
3003
- }
3004
- }
3005
- // because I found the cell and the column inside this method I have to set here the event data
3006
- // in this scenario it is not necessary pass the data parameter in setKetchupDraggable method
3007
- const sourceElementData = {
3008
- id: this.rootElement.id,
3009
- row,
3010
- selectedRows: this.selectedRows,
3011
- cell,
3012
- column,
3013
- };
3014
- // set event data
3015
- // this is mandatory in order to add the source element data in the kup drop event
3016
- e.dataTransfer.setData('kup-drag-source-element', JSON.stringify(sourceElementData));
3017
- // Sets the type of drag
3018
- setDragEffectAllowed(e, 'move');
3019
- if (this.selectedRows.length > 1 ||
3020
- (this.selectedRows.length == 1 &&
3021
- !this.selectedRows.includes(row))) {
3022
- this.addMultiSelectDragImageToEvent(e);
3023
- }
3024
- },
3025
- onDragEnd: (_e) => {
3026
- // Remove the over class
3027
- const dragDropPayload = getDragDropPayload();
3028
- if (dragDropPayload && dragDropPayload.overElement) {
3029
- dragDropPayload.overElement.classList.remove('selected');
3030
- }
3031
- },
3032
- };
3033
3006
  const style = {
3034
3007
  '--kup_datatable_row_actions': rowActionsCount,
3035
3008
  };
3036
- return (h("tr", Object.assign({ ref: (el) => this.rowsRefs.push(el), "data-row": row, class: rowClass, style: style }, (this.dragEnabled
3037
- ? setKetchupDraggable(dragHandlersRow, {
3038
- [KupDataTableRowDragType]: row,
3039
- 'kup-drag-source-element': {}, // I put nothing in there because I overwrite the content inside the onDragStart method
3040
- })
3041
- : {})),
3009
+ return (h("tr", { ref: (el) => this.rowsRefs.push(el), "data-row": row, class: rowClass, style: style },
3042
3010
  selectRowCell,
3043
3011
  rowActionsCell,
3044
3012
  cells));
@@ -3063,356 +3031,6 @@ export class KupDataTable {
3063
3031
  return h(FImage, Object.assign({}, props));
3064
3032
  });
3065
3033
  }
3066
- /**
3067
- * FActory function for cells.
3068
- * @param cell - cell object
3069
- * @param column - the cell's column name
3070
- * @param previousRowCellValue - An optional value of the previous cell on the same column. If set and equal to the value of the current cell, makes the value of the current cell go blank.
3071
- * @param cellData - Additional data for the current cell.
3072
- * @param cellData.column - The column object to which the cell belongs.
3073
- * @param cellData.row - The row object to which the cell belongs.
3074
- */
3075
- renderCell(indend, cell, row, column, previousRowCellValue) {
3076
- const isEditable = cell.isEditable && this.editableData ? true : false;
3077
- const classObj = {
3078
- 'cell-content': true,
3079
- clickable: !!column.clickable,
3080
- 'force-one-line': this.forceOneLine == true ? true : null,
3081
- };
3082
- // When the previous row value is different from the current value, we can show the current value.
3083
- const valueToDisplay = previousRowCellValue !== cell.value ? cell.value : '';
3084
- // Sets the default value
3085
- let content = valueToDisplay;
3086
- const cellType = this.getCellType(cell);
3087
- const props = Object.assign({}, cell.data);
3088
- classObj[cellType + '-cell'] = true;
3089
- if (isEditable &&
3090
- (cellType === 'checkbox' ||
3091
- cellType === 'date' ||
3092
- cellType === 'number' ||
3093
- cellType === 'string')) {
3094
- content = this.setEditableCell(cellType, cell, column, row);
3095
- }
3096
- else if (cellType === 'checkbox' ||
3097
- cellType === 'date' ||
3098
- cellType === 'time' ||
3099
- cellType === 'datetime' ||
3100
- cellType === 'icon' ||
3101
- cellType === 'image' ||
3102
- cellType === 'link' ||
3103
- cellType === 'number' ||
3104
- cellType === 'string') {
3105
- this.setCellSize(cellType, props, cell);
3106
- content = this.setCell(cellType, props, content, classObj, cell, column);
3107
- }
3108
- else if (cell.data) {
3109
- this.setCellSizeKup(cellType, props, cell);
3110
- if (!this.lazyLoadCells) {
3111
- content = this.setLazyKupCell(cellType, props);
3112
- }
3113
- else {
3114
- content = this.setKupCell(cellType, classObj, props, cell, row, column);
3115
- }
3116
- }
3117
- const style = cell.style;
3118
- if (styleHasWritingMode(cell)) {
3119
- classObj['is-vertical'] = true;
3120
- }
3121
- let icon = undefined;
3122
- if (!isEditable && (column.icon || cell.icon) && content) {
3123
- let svg = '';
3124
- if (cell.icon) {
3125
- svg = cell.icon;
3126
- }
3127
- else {
3128
- svg = column.icon;
3129
- }
3130
- svg = this.getIconPath(svg);
3131
- const iconStyle = {
3132
- mask: svg,
3133
- webkitMask: svg,
3134
- };
3135
- icon = h("span", { style: iconStyle, class: "kup-icon obj-icon" });
3136
- }
3137
- let cellTitle = null;
3138
- if (cell.title != null && cell.title.trim() != '') {
3139
- cellTitle = cell.title;
3140
- }
3141
- // Informational icon
3142
- let infoEl = null;
3143
- if (cell.info && cell.info.message) {
3144
- const info = Object.assign({}, cell.info);
3145
- if (!info.color) {
3146
- info.color = `var(${KupThemeColorValues.INFO})`;
3147
- }
3148
- if (!info.icon) {
3149
- info.icon = 'info';
3150
- }
3151
- let fProps = {
3152
- color: info.color,
3153
- resource: info.icon,
3154
- sizeX: '1.25em',
3155
- sizeY: '1.25em',
3156
- title: info.message,
3157
- wrapperClass: 'cell-info',
3158
- };
3159
- infoEl = h(FImage, Object.assign({}, fProps));
3160
- }
3161
- return (h("span", { class: classObj, style: style, title: cellTitle },
3162
- indend,
3163
- infoEl,
3164
- icon,
3165
- content));
3166
- }
3167
- getIconPath(icon) {
3168
- let svg = '';
3169
- if (this.iconPaths) {
3170
- for (let index = 0; index < this.iconPaths.length || svg !== ''; index++) {
3171
- if (this.iconPaths[index].icon === icon) {
3172
- return this.iconPaths[index].path;
3173
- }
3174
- }
3175
- }
3176
- svg = `url('${getAssetPath(`./assets/svg/${icon}.svg`)}') no-repeat center`;
3177
- if (!this.iconPaths) {
3178
- this.iconPaths = [
3179
- {
3180
- icon: icon,
3181
- path: svg,
3182
- },
3183
- ];
3184
- }
3185
- else {
3186
- this.iconPaths.push({ icon: icon, path: svg });
3187
- }
3188
- return svg;
3189
- }
3190
- // TODO: cell type can depend also from shape (see isRating)
3191
- // NOTE: keep care to change conditions order... shape wins on object .. -> so if isNumber after shape checks.. ->
3192
- // TODO: more clear conditions when refactoring...
3193
- getCellType(cell) {
3194
- return getCellType(cell);
3195
- }
3196
- setLazyKupCell(cellType, props) {
3197
- const lazyClass = 'cell-' + cellType + ' placeholder';
3198
- const style = { minHeight: props.sizeY };
3199
- return h("span", { style: style, class: lazyClass });
3200
- }
3201
- setCellSize(cellType, props, cell) {
3202
- switch (cellType) {
3203
- case 'checkbox':
3204
- case 'icon':
3205
- if (!props.sizeX) {
3206
- props['sizeX'] = '18px';
3207
- }
3208
- if (!props.sizeY) {
3209
- props['sizeY'] = '18px';
3210
- }
3211
- if (cell.style) {
3212
- if (!cell.style.height) {
3213
- cell.style['minHeight'] = props['sizeY'];
3214
- }
3215
- }
3216
- else {
3217
- cell.style = {
3218
- minHeight: props['sizeY'],
3219
- };
3220
- }
3221
- break;
3222
- case 'image':
3223
- if (!props.sizeX) {
3224
- props['sizeX'] = 'auto';
3225
- }
3226
- if (!props.sizeY) {
3227
- props['sizeY'] = '64px';
3228
- }
3229
- break;
3230
- }
3231
- }
3232
- setCellSizeKup(cellType, props, cell) {
3233
- switch (cellType) {
3234
- case 'bar':
3235
- if (!props.sizeY) {
3236
- props['sizeY'] = '26px';
3237
- if (this.density === 'medium') {
3238
- props['sizeY'] = '36px';
3239
- }
3240
- if (this.density === 'wide') {
3241
- props['sizeY'] = '50px';
3242
- }
3243
- }
3244
- break;
3245
- case 'button':
3246
- let height = '';
3247
- if (props.label) {
3248
- height = '36px';
3249
- }
3250
- if (cell.style) {
3251
- if (!cell.style.height) {
3252
- cell.style['minHeight'] = height;
3253
- }
3254
- }
3255
- else {
3256
- cell.style = { minHeight: height };
3257
- }
3258
- break;
3259
- case 'chart':
3260
- if (!props.sizeX) {
3261
- props['sizeX'] = '100%';
3262
- }
3263
- if (!props.sizeY) {
3264
- props['sizeY'] = '100%';
3265
- }
3266
- break;
3267
- case 'chips':
3268
- if (cell.style) {
3269
- if (!cell.style.height) {
3270
- cell.style['minHeight'] = '40px';
3271
- }
3272
- }
3273
- else {
3274
- cell.style = { minHeight: '40px' };
3275
- }
3276
- break;
3277
- case 'radio':
3278
- if (cell.style) {
3279
- if (!cell.style.height) {
3280
- cell.style['minHeight'] = '40px';
3281
- }
3282
- }
3283
- else {
3284
- cell.style = { minHeight: '40px' };
3285
- }
3286
- break;
3287
- }
3288
- }
3289
- setEditableCell(cellType, cell, column, row) {
3290
- switch (cellType) {
3291
- case 'checkbox':
3292
- return (h(FCheckbox, { checked: cell.data['checked'], onChange: (e) => this.cellUpdate(e, e.target.value, cell, column, row) }));
3293
- case 'date':
3294
- return (h("kup-date-picker", { "onkup-datepicker-change": (e) => this.cellUpdate(e, e.detail.value, cell, column, row), data: {
3295
- 'kup-text-field': {
3296
- fullWidth: true,
3297
- },
3298
- }, initialValue: cell.value }));
3299
- case 'number':
3300
- return (h(FTextField, { icon: cell.icon
3301
- ? cell.icon
3302
- : column.icon
3303
- ? column.icon
3304
- : null, fullWidth: true, inputType: "number", value: stringToNumber(cell.value).toString(), onBlur: (e) => this.cellUpdate(e, e.target.value, cell, column, row), onChange: (e) => this.cellUpdate(e, e.target.value, cell, column, row) }));
3305
- case 'string':
3306
- return (h(FTextField, { icon: cell.icon
3307
- ? cell.icon
3308
- : column.icon
3309
- ? column.icon
3310
- : null, fullWidth: true, value: cell.value, onBlur: (e) => this.cellUpdate(e, e.target.value, cell, column, row), onChange: (e) => this.cellUpdate(e, e.target.value, cell, column, row) }));
3311
- }
3312
- }
3313
- setKupCell(cellType, classObj, props, cell, row, column) {
3314
- switch (cellType) {
3315
- case 'bar':
3316
- if (!props.data) {
3317
- return h("kup-image", Object.assign({}, props));
3318
- }
3319
- else {
3320
- const barStyle = {
3321
- height: props.sizeY,
3322
- };
3323
- return (h("div", { class: "bar-cell-content", style: barStyle },
3324
- h(FImage, Object.assign({}, props))));
3325
- }
3326
- case 'button':
3327
- classObj['is-centered'] = true;
3328
- props['onkup-button-click'] = this.onJ4btnClicked.bind(this, row, column, cell);
3329
- return h("kup-button", Object.assign({}, props));
3330
- case 'btn':
3331
- classObj['is-centered'] = true;
3332
- props['data-storage'] = {
3333
- cell: cell,
3334
- row: row,
3335
- column: column,
3336
- };
3337
- return h("kup-button-list", Object.assign({}, props));
3338
- case 'chart':
3339
- classObj['is-centered'] = true;
3340
- return h("kup-chart", Object.assign({}, props));
3341
- case 'chips':
3342
- return h(FChip, Object.assign({}, props));
3343
- case 'color-picker':
3344
- return (h("kup-color-picker", Object.assign({ value: cell.value }, props, { disabled: true })));
3345
- case 'gauge':
3346
- return (h("kup-gauge", Object.assign({ value: stringToNumber(cell.value), "width-component": "100%" }, props)));
3347
- case 'knob':
3348
- case 'progress-bar':
3349
- return h("kup-progress-bar", Object.assign({}, props));
3350
- case 'rating':
3351
- return (h("kup-rating", Object.assign({ value: stringToNumber(cell.value) }, props, { disabled: true })));
3352
- case 'radio':
3353
- classObj['is-centered'] = true;
3354
- props['disabled'] = row.readOnly;
3355
- return h("kup-radio", Object.assign({}, props));
3356
- case 'text-field':
3357
- props['disabled'] = row.readOnly;
3358
- props['dataSet'] = {
3359
- 'data-cell': cell,
3360
- 'data-column': column,
3361
- 'data-row': row,
3362
- };
3363
- return h(FTextField, Object.assign({}, props));
3364
- }
3365
- }
3366
- setCell(cellType, props, content, classObj, cell, column) {
3367
- switch (cellType) {
3368
- case 'checkbox':
3369
- classObj['is-centered'] = true;
3370
- props['resource'] = props.checked
3371
- ? 'check_box'
3372
- : 'check_box_outline_blank';
3373
- return h(FImage, Object.assign({}, props));
3374
- case 'date':
3375
- if (content && content != '') {
3376
- const cellValue = getCellValueForDisplay(column, cell);
3377
- return cellValue;
3378
- }
3379
- return content;
3380
- case 'datetime':
3381
- if (content && content != '') {
3382
- const cellValue = getCellValueForDisplay(column, cell);
3383
- return cellValue;
3384
- }
3385
- return content;
3386
- case 'icon':
3387
- case 'image':
3388
- classObj['is-centered'] = true;
3389
- if (props.badgeData) {
3390
- classObj['has-padding'] = true;
3391
- }
3392
- return h(FImage, Object.assign({}, props));
3393
- case 'link':
3394
- return (h("a", { class: "cell-link", href: content, target: "_blank" }, cell.value));
3395
- case 'number':
3396
- if (content && content != '') {
3397
- const cellValueNumber = stringToNumber(cell.value);
3398
- const cellValue = getCellValueForDisplay(column, cell);
3399
- if (cellValueNumber < 0) {
3400
- classObj['negative-number'] = true;
3401
- }
3402
- return cellValue;
3403
- }
3404
- return content;
3405
- case 'time':
3406
- if (content && content != '') {
3407
- const cellValue = getCellValueForDisplay(column, cell);
3408
- return cellValue;
3409
- }
3410
- return content;
3411
- case 'string':
3412
- default:
3413
- return content;
3414
- }
3415
- }
3416
3034
  renderLoadMoreButton(isSlotted = true) {
3417
3035
  return (h("kup-button", { styling: FButtonStyling.FLAT, class: "load-more-button", label: this.kupManager.language.translate(KupLanguageGeneric.LOAD_MORE), icon: "plus", slot: isSlotted ? 'more-results' : null, "onkup-button-click": () => {
3418
3036
  this.onLoadMoreClick();
@@ -3427,19 +3045,28 @@ export class KupDataTable {
3427
3045
  }
3428
3046
  }
3429
3047
  openCustomSettings() {
3430
- this.customizeTopPanelRef.classList.add('visible');
3048
+ this.customizeTopPanelRef.menuVisible = true;
3431
3049
  this.customizeTopButtonRef.classList.add('toggled');
3432
3050
  this.kupManager.dynamicPosition.start(this.customizeTopPanelRef);
3433
3051
  this.openedCustomSettings = true;
3052
+ if (!this.clickCbCustomPanel) {
3053
+ this.clickCbCustomPanel = {
3054
+ cb: () => {
3055
+ this.closeCustomSettings();
3056
+ },
3057
+ el: this.customizeTopPanelRef,
3058
+ };
3059
+ }
3060
+ this.kupManager.addClickCallback(this.clickCbCustomPanel, true);
3434
3061
  }
3435
3062
  closeCustomSettings() {
3436
3063
  this.customizeTopButtonRef.classList.remove('toggled');
3437
3064
  if (this.customizeTopPanelRef == null) {
3438
3065
  return;
3439
3066
  }
3440
- this.customizeTopPanelRef.classList.remove('visible');
3441
- this.kupManager.dynamicPosition.stop(this.customizeTopPanelRef);
3067
+ this.customizeTopPanelRef.menuVisible = false;
3442
3068
  this.openedCustomSettings = false;
3069
+ this.kupManager.removeClickCallback(this.clickCbCustomPanel);
3443
3070
  }
3444
3071
  renderPaginator(top) {
3445
3072
  return (h("div", { class: "paginator-wrapper" },
@@ -3463,9 +3090,9 @@ export class KupDataTable {
3463
3090
  totalsMatrix = this.renderTotalsMatrix();
3464
3091
  }
3465
3092
  }
3466
- return (h("div", { class: "kup-menu customize-panel", ref: (el) => {
3093
+ return (h("kup-card", { customStyle: "::slotted(kup-switch) { width: max-content !important; } ::slotted(*) { margin: auto !important; } ::slotted(.customize-element) { margin: auto !important; padding: 0 1em 1em 1em !important; width: max-content !important; } ::slotted(.customize-element):nth-child(1) { padding-top: 1em !important; }", isMenu: true, layoutFamily: KupCardFamily.FREE, ref: (el) => {
3467
3094
  this.customizeTopPanelRef = el;
3468
- } },
3095
+ }, sizeX: "360px", sizeY: "300px" },
3469
3096
  density,
3470
3097
  grid,
3471
3098
  fontsize,
@@ -3480,134 +3107,26 @@ export class KupDataTable {
3480
3107
  totalsMatrix));
3481
3108
  }
3482
3109
  columnRemoveArea() {
3483
- const dropHandlersRemoveCols = {
3484
- onDrop: (e) => {
3485
- const transferredData = JSON.parse(e.dataTransfer.getData(KupDataTableColumnDragType));
3486
- const overElement = this.getElementById(e.target, 'remove-column-area');
3487
- overElement.removeAttribute(this.dragOverAttribute);
3488
- // We are sure the tables have been dropped in a valid location -> starts ...
3489
- this.handleColumnRemove(transferredData);
3490
- return KupDataTableColumnDragRemoveType;
3491
- },
3492
- onDragOver: (e) => {
3493
- const overElement = this.getElementById(e.target, 'remove-column-area');
3494
- overElement.setAttribute(this.dragOverAttribute, '');
3495
- return true;
3496
- },
3497
- onDragLeave: (e) => {
3498
- const overElement = this.getElementById(e.target, 'remove-column-area');
3499
- overElement.removeAttribute(this.dragOverAttribute);
3500
- return true;
3501
- },
3502
- };
3503
- return (h("div", Object.assign({ id: "remove-column-area" }, setKetchupDroppable(dropHandlersRemoveCols, [
3504
- KupDataTableColumnDragType,
3505
- KupDataTableColumnDragRemoveType,
3506
- ], this.rootElement, {})),
3110
+ return (h("div", { class: "droparea__remove", ref: (el) => (this.removeDropareaRef = el) },
3507
3111
  h(FImage, { resource: "delete", color: `var(${KupThemeColorValues.DANGER})`, sizeX: "30px", sizeY: "50px" }),
3508
3112
  h(FImage, { resource: "delete-empty", color: `var(${KupThemeColorValues.DANGER})`, sizeX: "30px", sizeY: "50px" })));
3509
3113
  }
3510
3114
  columnGroupArea() {
3511
- const dropHandlersGroupCols = {
3512
- onDrop: (e) => {
3513
- const transferredData = JSON.parse(e.dataTransfer.getData(KupDataTableColumnDragType));
3514
- const overElement = this.getElementById(e.target, 'group-column-area');
3515
- overElement.removeAttribute(this.dragOverAttribute);
3516
- // We are sure the tables have been dropped in a valid location -> starts ...
3517
- this.handleColumnGroup(transferredData);
3518
- return KupDataTableColumnDragGroupType;
3519
- },
3520
- onDragOver: (e) => {
3521
- const overElement = this.getElementById(e.target, 'group-column-area');
3522
- overElement.setAttribute(this.dragOverAttribute, '');
3523
- return true;
3524
- },
3525
- onDragLeave: (e) => {
3526
- const overElement = this.getElementById(e.target, 'group-column-area');
3527
- overElement.removeAttribute(this.dragOverAttribute);
3528
- return true;
3529
- },
3530
- };
3531
- return (h("div", Object.assign({ id: "group-column-area" }, setKetchupDroppable(dropHandlersGroupCols, [
3532
- KupDataTableColumnDragType,
3533
- KupDataTableColumnDragGroupType,
3534
- ], this.rootElement, {})),
3535
- h(FImage, { resource: "bookmark", color: `var(${KupThemeColorValues.DANGER})`, sizeX: "30px", sizeY: "50px" }),
3536
- h(FImage, { resource: "book", color: `var(${KupThemeColorValues.DANGER})`, sizeX: "30px", sizeY: "50px" })));
3537
- }
3538
- startDynamicPositioning(dropArea, th) {
3539
- if (this.kupManager.dynamicPosition.isRegistered(dropArea)) {
3540
- this.kupManager.dynamicPosition.changeAnchor(dropArea, th);
3541
- }
3542
- else {
3543
- this.kupManager.dynamicPosition.register(dropArea, th, 10, KupDynamicPositionPlacement.TOP);
3544
- }
3545
- this.kupManager.dynamicPosition.start(dropArea);
3546
- dropArea.classList.add('visible');
3547
- }
3548
- stopDynamicPositioning(dropArea) {
3549
- dropArea.classList.remove('visible');
3550
- this.kupManager.dynamicPosition.stop(dropArea);
3551
- // Chrome workaround: dropArea is draggable even with the display:none rule
3552
- dropArea.style.top = '-50px';
3553
- dropArea.style.left = '-50px';
3554
- }
3555
- getElementById(target, id) {
3556
- let element = target;
3557
- if (element) {
3558
- if (element.nodeType == Node.TEXT_NODE) {
3559
- element = element.parentNode;
3560
- }
3561
- if (element.id !== id) {
3562
- element = element.closest('#' + id);
3563
- }
3564
- }
3565
- return element;
3566
- }
3567
- getThElement(target) {
3568
- let element = target;
3569
- if (element) {
3570
- if (element.nodeType == Node.TEXT_NODE) {
3571
- element = element.parentNode;
3572
- }
3573
- if (element.tagName !== 'TH') {
3574
- element = element.closest('th');
3575
- }
3576
- }
3577
- return element;
3115
+ return (h("div", { class: "droparea__groups", ref: (el) => (this.groupsDropareaRef = el) },
3116
+ h(FImage, { resource: "bookmark", color: `var(${KupThemeColorValues.TEXT})`, sizeX: "30px", sizeY: "50px" }),
3117
+ h(FImage, { resource: "book", color: `var(${KupThemeColorValues.TEXT})`, sizeX: "30px", sizeY: "50px" })));
3578
3118
  }
3579
3119
  hideShowColumnDropArea(show, th) {
3580
- this.hideShowColumnRemoveDropArea(show, th);
3581
- this.hideShowColumnGroupDropArea(show, th);
3582
- }
3583
- hideShowColumnRemoveDropArea(show, th) {
3584
- if (!this.removableColumns) {
3585
- return;
3586
- }
3587
- const dropArea = this.rootElement.shadowRoot.querySelector('#remove-column-area');
3588
- if (show) {
3589
- const offset = this.showGroups ? '0px' : '25px';
3590
- dropArea.style.marginLeft =
3591
- 'calc(' + th.clientWidth / 2 + 'px - ' + offset + ')';
3592
- this.startDynamicPositioning(dropArea, th);
3593
- }
3594
- else {
3595
- this.stopDynamicPositioning(dropArea);
3596
- }
3597
- }
3598
- hideShowColumnGroupDropArea(show, th) {
3599
- if (!this.showGroups) {
3600
- return;
3601
- }
3602
- const dropArea = this.rootElement.shadowRoot.querySelector('#group-column-area');
3603
- if (show) {
3604
- const offset = this.removableColumns ? '51px' : '25px';
3605
- dropArea.style.marginLeft =
3606
- 'calc(' + th.clientWidth / 2 + 'px - ' + offset + ')';
3607
- this.startDynamicPositioning(dropArea, th);
3120
+ if (show && th && (this.removableColumns || this.showGroups)) {
3121
+ this.dropareaRef.classList.add('droparea--visible');
3122
+ this.kupManager.dynamicPosition.register(this.dropareaRef, th, 10, KupDynamicPositionPlacement.TOP);
3123
+ this.kupManager.dynamicPosition.start(this.dropareaRef);
3124
+ this.dropareaRef.style.marginLeft =
3125
+ th.clientWidth / 2 - this.dropareaRef.clientWidth / 2 + 'px';
3608
3126
  }
3609
3127
  else {
3610
- this.stopDynamicPositioning(dropArea);
3128
+ this.dropareaRef.classList.remove('droparea--visible');
3129
+ +this.kupManager.dynamicPosition.stop(this.dropareaRef);
3611
3130
  }
3612
3131
  }
3613
3132
  handleColumnRemove(column2remove) {
@@ -3724,14 +3243,11 @@ export class KupDataTable {
3724
3243
  this.fontsize = this.getFontSizeCodeFromDecode(e.detail.value);
3725
3244
  } })));
3726
3245
  }
3727
- getDensityDecodeFromCode(code) {
3728
- return this.transcodeItem(code, this.DENSITY_CODES, this.DENSITY_DECODES);
3729
- }
3730
3246
  getDensityCodeFromDecode(decode) {
3731
- return this.transcodeItem(decode, this.DENSITY_DECODES, this.DENSITY_CODES);
3247
+ return this.transcodeItem(decode, this.DENSITY_DECODES, Object.values(FCellPadding));
3732
3248
  }
3733
3249
  renderDensityPanel() {
3734
- const listItems = this.createListData(this.DENSITY_CODES, this.DENSITY_ICONS, this.density);
3250
+ const listItems = this.createListData(Object.values(FCellPadding), this.DENSITY_ICONS, this.density);
3735
3251
  const listData = { data: listItems, showIcons: true };
3736
3252
  const textfieldData = {
3737
3253
  trailingIcon: true,
@@ -3813,6 +3329,7 @@ export class KupDataTable {
3813
3329
  } })));
3814
3330
  }
3815
3331
  render() {
3332
+ this.thRefs = [];
3816
3333
  this.rowsRefs = [];
3817
3334
  this.renderedRows = [];
3818
3335
  let elStyle = undefined;
@@ -3820,14 +3337,7 @@ export class KupDataTable {
3820
3337
  let rows = null;
3821
3338
  if (this.paginatedRowsLength === 0) {
3822
3339
  rows = (h("tr", { ref: (el) => this.rowsRefs.push(el) },
3823
- h("td", Object.assign({}, (this.dropEnabled
3824
- ? setKetchupDroppable(dropHandlersCell, [KupDataTableRowDragType], this.rootElement, {
3825
- row: null,
3826
- cell: null,
3827
- column: null,
3828
- id: this.rootElement.id,
3829
- })
3830
- : {}), { colSpan: this.calculateColspan() }), this.emptyDataLabel)));
3340
+ h("td", { colSpan: this.calculateColspan() }, this.emptyDataLabel)));
3831
3341
  }
3832
3342
  else {
3833
3343
  rows = [];
@@ -3884,10 +3394,10 @@ export class KupDataTable {
3884
3394
  data: chipsData,
3885
3395
  id: 'group-chips',
3886
3396
  type: FChipType.INPUT,
3887
- onClick: [],
3397
+ onIconClick: [],
3888
3398
  };
3889
3399
  for (let i = 0; i < chipsData.length; i++) {
3890
- props.onClick.push(() => this.removeGroup(i));
3400
+ props.onIconClick.push(() => this.removeGroup(i));
3891
3401
  }
3892
3402
  groupChips = h(FChip, Object.assign({}, props));
3893
3403
  }
@@ -3930,9 +3440,8 @@ export class KupDataTable {
3930
3440
  if (this.tableHeight !== undefined || this.tableWidth !== undefined) {
3931
3441
  belowClass += ' custom-size';
3932
3442
  }
3933
- const customStyle = this.kupManager.theme.setCustomStyle(this.rootElement);
3934
3443
  const compCreated = (h(Host, null,
3935
- customStyle ? h("style", null, customStyle) : null,
3444
+ h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)),
3936
3445
  h("div", { id: componentWrapperId },
3937
3446
  h("div", { class: "above-wrapper" },
3938
3447
  this.globalFilter ? (h("div", { id: "global-filter" },
@@ -3944,6 +3453,9 @@ export class KupDataTable {
3944
3453
  } }))) : null,
3945
3454
  paginatorTop),
3946
3455
  h("div", { class: "group-wrapper" }, groupChips),
3456
+ h("div", { class: "droparea", ref: (el) => (this.dropareaRef = el) },
3457
+ this.showGroups ? this.columnGroupArea() : null,
3458
+ this.removableColumns ? this.columnRemoveArea() : null),
3947
3459
  h("div", { style: elStyle, class: belowClass, ref: (el) => (this.tableAreaRef = el) },
3948
3460
  this.showCustomization
3949
3461
  ? [
@@ -3960,40 +3472,9 @@ export class KupDataTable {
3960
3472
  h("table", { class: tableClass, ref: (el) => (this.tableRef = el), onMouseLeave: (ev) => {
3961
3473
  ev.stopPropagation();
3962
3474
  unsetTooltip(this.tooltip);
3963
- }, onClick: (e) => {
3964
- // Note: event must be cloned
3965
- // otherwise inside setTimeout will be exiting the Shadow DOM scope(causing loss of information, including target).
3966
- const clone = {};
3967
- for (const key in e) {
3968
- clone[key] = e[key];
3969
- }
3970
- this.clickTimeout.push(setTimeout(() => {
3971
- this.kupDataTableClick.emit({
3972
- comp: this,
3973
- id: this.rootElement.id,
3974
- details: this.clickHandler(clone),
3975
- });
3976
- }, 300));
3977
3475
  }, onContextMenu: (e) => {
3978
- this.kupDataTableContextMenu.emit({
3979
- comp: this,
3980
- id: this.rootElement.id,
3981
- details: this.contextMenuHandler(e),
3982
- });
3983
- }, onDblClick: (e) => {
3984
- for (let index = 0; index < this.clickTimeout.length; index++) {
3985
- clearTimeout(this.clickTimeout[index]);
3986
- this.kupManager.debug.logMessage(this, 'Cleared clickHandler timeout(' +
3987
- this.clickTimeout[index] +
3988
- ').');
3989
- }
3990
- this.clickTimeout = [];
3991
- this.kupDataTableDblClick.emit({
3992
- comp: this,
3993
- id: this.rootElement.id,
3994
- details: this.dblClickHandler(e),
3995
- });
3996
- }, onMouseMove: (e) => this.mouseMoveHandler(e), onMouseOut: () => this.mouseOutHandler() },
3476
+ e.preventDefault();
3477
+ } },
3997
3478
  h("thead", { hidden: !this.showHeader, ref: (el) => (this.theadRef = el) },
3998
3479
  h("tr", null, header)),
3999
3480
  h("tbody", null, rows),
@@ -4002,18 +3483,20 @@ export class KupDataTable {
4002
3483
  : null),
4003
3484
  stickyEl),
4004
3485
  tooltip,
4005
- paginatorBottom),
4006
- this.showGroups ? this.columnGroupArea() : null,
4007
- this.removableColumns ? this.columnRemoveArea() : null));
3486
+ paginatorBottom)));
4008
3487
  return compCreated;
4009
3488
  }
4010
3489
  disconnectedCallback() {
3490
+ this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop, this.interactableResize, this.interactableTouch));
4011
3491
  this.kupManager.language.unregister(this);
4012
3492
  this.kupManager.theme.unregister(this);
4013
3493
  const dynamicPositionElements = this.rootElement.shadowRoot.querySelectorAll('[' + kupDynamicPositionAttribute + ']');
4014
3494
  if (dynamicPositionElements.length > 0) {
4015
3495
  this.kupManager.dynamicPosition.unregister(Array.prototype.slice.call(dynamicPositionElements));
4016
3496
  }
3497
+ if (this.customizeTopPanelRef) {
3498
+ this.customizeTopPanelRef.remove();
3499
+ }
4017
3500
  if (this.columnMenuCard) {
4018
3501
  this.columnMenuCard.remove();
4019
3502
  }
@@ -4070,6 +3553,27 @@ export class KupDataTable {
4070
3553
  "text": ""
4071
3554
  }
4072
3555
  },
3556
+ "autoFillMissingCells": {
3557
+ "type": "boolean",
3558
+ "mutable": false,
3559
+ "complexType": {
3560
+ "original": "boolean",
3561
+ "resolved": "boolean",
3562
+ "references": {}
3563
+ },
3564
+ "required": false,
3565
+ "optional": false,
3566
+ "docs": {
3567
+ "tags": [{
3568
+ "name": "default",
3569
+ "text": "false"
3570
+ }],
3571
+ "text": "When true and when a row is missing some columns, the missing cells will be autogenerated."
3572
+ },
3573
+ "attribute": "auto-fill-missing-cells",
3574
+ "reflect": false,
3575
+ "defaultValue": "false"
3576
+ },
4073
3577
  "customStyle": {
4074
3578
  "type": "string",
4075
3579
  "mutable": false,
@@ -4112,9 +3616,14 @@ export class KupDataTable {
4112
3616
  "type": "string",
4113
3617
  "mutable": false,
4114
3618
  "complexType": {
4115
- "original": "string",
4116
- "resolved": "string",
4117
- "references": {}
3619
+ "original": "FCellPadding",
3620
+ "resolved": "FCellPadding.DENSE | FCellPadding.MEDIUM | FCellPadding.NONE | FCellPadding.WIDE",
3621
+ "references": {
3622
+ "FCellPadding": {
3623
+ "location": "import",
3624
+ "path": "../../f-components/f-cell/f-cell-declarations"
3625
+ }
3626
+ }
4118
3627
  },
4119
3628
  "required": false,
4120
3629
  "optional": false,
@@ -4124,7 +3633,7 @@ export class KupDataTable {
4124
3633
  },
4125
3634
  "attribute": "density",
4126
3635
  "reflect": false,
4127
- "defaultValue": "'dense'"
3636
+ "defaultValue": "FCellPadding.DENSE"
4128
3637
  },
4129
3638
  "dragEnabled": {
4130
3639
  "type": "boolean",
@@ -4141,7 +3650,7 @@ export class KupDataTable {
4141
3650
  "text": "Enables drag."
4142
3651
  },
4143
3652
  "attribute": "drag-enabled",
4144
- "reflect": false,
3653
+ "reflect": true,
4145
3654
  "defaultValue": "false"
4146
3655
  },
4147
3656
  "dropEnabled": {
@@ -4159,7 +3668,7 @@ export class KupDataTable {
4159
3668
  "text": "Enables drop."
4160
3669
  },
4161
3670
  "attribute": "drop-enabled",
4162
- "reflect": false,
3671
+ "reflect": true,
4163
3672
  "defaultValue": "false"
4164
3673
  },
4165
3674
  "editableData": {
@@ -4174,8 +3683,8 @@ export class KupDataTable {
4174
3683
  "optional": false,
4175
3684
  "docs": {
4176
3685
  "tags": [{
4177
- "text": "false",
4178
- "name": "default"
3686
+ "name": "default",
3687
+ "text": "false"
4179
3688
  }],
4180
3689
  "text": "When set to true, editable cells will be rendered using input components."
4181
3690
  },
@@ -4288,8 +3797,8 @@ export class KupDataTable {
4288
3797
  "optional": false,
4289
3798
  "docs": {
4290
3799
  "tags": [{
4291
- "text": "fixedRows",
4292
- "name": "see"
3800
+ "name": "see",
3801
+ "text": "fixedRows"
4293
3802
  }],
4294
3803
  "text": "Fixes the given number of columns so that they stay visible when horizontally scrolling the data-table.\nIf grouping is active or the value of the prop is <= 0, this prop will have no effect.\nCan be combined with fixedRows."
4295
3804
  },
@@ -4309,8 +3818,8 @@ export class KupDataTable {
4309
3818
  "optional": false,
4310
3819
  "docs": {
4311
3820
  "tags": [{
4312
- "text": "fixedColumns",
4313
- "name": "see"
3821
+ "name": "see",
3822
+ "text": "fixedColumns"
4314
3823
  }],
4315
3824
  "text": "Fixes the given number of rows so that they stay visible when vertically scrolling the data-table.\nIf grouping is active or the value of the prop is <= 0, this prop will have no effect.\nCan be combined with fixedColumns."
4316
3825
  },
@@ -4449,8 +3958,8 @@ export class KupDataTable {
4449
3958
  "optional": false,
4450
3959
  "docs": {
4451
3960
  "tags": [{
4452
- "text": "false",
4453
- "name": "default"
3961
+ "name": "default",
3962
+ "text": "false"
4454
3963
  }],
4455
3964
  "text": "When set to true, clicked-on rows will have a visual feedback."
4456
3965
  },
@@ -4529,11 +4038,11 @@ export class KupDataTable {
4529
4038
  "optional": false,
4530
4039
  "docs": {
4531
4040
  "tags": [{
4532
- "text": "loadMoreStep *",
4533
- "name": "see"
4041
+ "name": "see",
4042
+ "text": "loadMoreStep *"
4534
4043
  }, {
4535
- "text": "loadMoreLimit",
4536
- "name": "see"
4044
+ "name": "see",
4045
+ "text": "loadMoreLimit"
4537
4046
  }],
4538
4047
  "text": "Establish the modality of how many new records will be downloaded.\n\nThis property is regulated also by loadMoreStep."
4539
4048
  },
@@ -4553,11 +4062,11 @@ export class KupDataTable {
4553
4062
  "optional": false,
4554
4063
  "docs": {
4555
4064
  "tags": [{
4556
- "text": "loadMoreMode *",
4557
- "name": "see"
4065
+ "name": "see",
4066
+ "text": "loadMoreMode *"
4558
4067
  }, {
4559
- "text": "loadMoreLimit",
4560
- "name": "see"
4068
+ "name": "see",
4069
+ "text": "loadMoreLimit"
4561
4070
  }],
4562
4071
  "text": "The number of records which will be requested to be downloaded when clicking on the load more button.\n\nThis property is regulated also by loadMoreMode."
4563
4072
  },
@@ -4624,6 +4133,24 @@ export class KupDataTable {
4624
4133
  "reflect": false,
4625
4134
  "defaultValue": "false"
4626
4135
  },
4136
+ "resizableColumns": {
4137
+ "type": "boolean",
4138
+ "mutable": false,
4139
+ "complexType": {
4140
+ "original": "boolean",
4141
+ "resolved": "boolean",
4142
+ "references": {}
4143
+ },
4144
+ "required": false,
4145
+ "optional": false,
4146
+ "docs": {
4147
+ "tags": [],
4148
+ "text": "Gives the possibility to resize columns by dragging on their right edge."
4149
+ },
4150
+ "attribute": "resizable-columns",
4151
+ "reflect": false,
4152
+ "defaultValue": "true"
4153
+ },
4627
4154
  "rowActions": {
4628
4155
  "type": "unknown",
4629
4156
  "mutable": false,
@@ -4847,8 +4374,8 @@ export class KupDataTable {
4847
4374
  "optional": false,
4848
4375
  "docs": {
4849
4376
  "tags": [{
4850
- "text": "KupDataTable.showHeader",
4851
- "name": "namespace"
4377
+ "name": "namespace",
4378
+ "text": "KupDataTable.showHeader"
4852
4379
  }],
4853
4380
  "text": "Enables rendering of the table header."
4854
4381
  },
@@ -5088,7 +4615,6 @@ export class KupDataTable {
5088
4615
  "columnMenuAnchor": {},
5089
4616
  "groupState": {},
5090
4617
  "openedTotalMenu": {},
5091
- "openedGroupMenu": {},
5092
4618
  "openedCustomSettings": {},
5093
4619
  "fontsize": {},
5094
4620
  "triggerColumnSortRerender": {}
@@ -5193,26 +4719,6 @@ export class KupDataTable {
5193
4719
  }
5194
4720
  }
5195
4721
  }
5196
- }, {
5197
- "method": "kupDataTableCellUpdate",
5198
- "name": "kup-datatable-cellupdate",
5199
- "bubbles": true,
5200
- "cancelable": false,
5201
- "composed": true,
5202
- "docs": {
5203
- "tags": [],
5204
- "text": "Emitted when a cell's data has been updated."
5205
- },
5206
- "complexType": {
5207
- "original": "KupDatatableCellUpdateEventPayload",
5208
- "resolved": "KupDatatableCellUpdateEventPayload",
5209
- "references": {
5210
- "KupDatatableCellUpdateEventPayload": {
5211
- "location": "import",
5212
- "path": "./kup-data-table-declarations"
5213
- }
5214
- }
5215
- }
5216
4722
  }, {
5217
4723
  "method": "kupDataTableClick",
5218
4724
  "name": "kup-datatable-click",
@@ -5333,46 +4839,6 @@ export class KupDataTable {
5333
4839
  }
5334
4840
  }
5335
4841
  }
5336
- }, {
5337
- "method": "kupCellButtonClick",
5338
- "name": "kup-datatable-cellbuttonclick",
5339
- "bubbles": true,
5340
- "cancelable": false,
5341
- "composed": true,
5342
- "docs": {
5343
- "tags": [],
5344
- "text": ""
5345
- },
5346
- "complexType": {
5347
- "original": "KupDataTableCellButtonClickEventPayload",
5348
- "resolved": "KupDataTableCellButtonClickEventPayload",
5349
- "references": {
5350
- "KupDataTableCellButtonClickEventPayload": {
5351
- "location": "import",
5352
- "path": "./kup-data-table-declarations"
5353
- }
5354
- }
5355
- }
5356
- }, {
5357
- "method": "kupCellTextFieldInput",
5358
- "name": "kup-datatable-textfieldinput",
5359
- "bubbles": true,
5360
- "cancelable": false,
5361
- "composed": true,
5362
- "docs": {
5363
- "tags": [],
5364
- "text": ""
5365
- },
5366
- "complexType": {
5367
- "original": "KupDataTableCellTextFieldInputEventPayload",
5368
- "resolved": "KupDataTableCellTextFieldInputEventPayload",
5369
- "references": {
5370
- "KupDataTableCellTextFieldInputEventPayload": {
5371
- "location": "import",
5372
- "path": "./kup-data-table-declarations"
5373
- }
5374
- }
5375
- }
5376
4842
  }]; }
5377
4843
  static get methods() { return {
5378
4844
  "closeColumnMenu": {
@@ -5428,8 +4894,8 @@ export class KupDataTable {
5428
4894
  "signature": "(descriptions?: boolean) => Promise<GenericObject>",
5429
4895
  "parameters": [{
5430
4896
  "tags": [{
5431
- "text": "descriptions - When provided and true, the result will be the list of props with their description.",
5432
- "name": "param"
4897
+ "name": "param",
4898
+ "text": "descriptions - When provided and true, the result will be the list of props with their description."
5433
4899
  }],
5434
4900
  "text": "- When provided and true, the result will be the list of props with their description."
5435
4901
  }],
@@ -5460,8 +4926,8 @@ export class KupDataTable {
5460
4926
  "signature": "(column: string) => Promise<void>",
5461
4927
  "parameters": [{
5462
4928
  "tags": [{
5463
- "text": "column - Name of the column.",
5464
- "name": "param"
4929
+ "name": "param",
4930
+ "text": "column - Name of the column."
5465
4931
  }],
5466
4932
  "text": "- Name of the column."
5467
4933
  }],
@@ -5523,13 +4989,47 @@ export class KupDataTable {
5523
4989
  "tags": []
5524
4990
  }
5525
4991
  },
4992
+ "setFocus": {
4993
+ "complexType": {
4994
+ "signature": "(column: string, rowId: string) => Promise<void>",
4995
+ "parameters": [{
4996
+ "tags": [{
4997
+ "name": "param",
4998
+ "text": "column - Name of the column."
4999
+ }],
5000
+ "text": "- Name of the column."
5001
+ }, {
5002
+ "tags": [{
5003
+ "name": "param",
5004
+ "text": "rowId - Id of the row."
5005
+ }],
5006
+ "text": "- Id of the row."
5007
+ }],
5008
+ "references": {
5009
+ "Promise": {
5010
+ "location": "global"
5011
+ }
5012
+ },
5013
+ "return": "Promise<void>"
5014
+ },
5015
+ "docs": {
5016
+ "text": "Sets the focus on an editable table cell.",
5017
+ "tags": [{
5018
+ "name": "param",
5019
+ "text": "column - Name of the column."
5020
+ }, {
5021
+ "name": "param",
5022
+ "text": "rowId - Id of the row."
5023
+ }]
5024
+ }
5025
+ },
5526
5026
  "setProps": {
5527
5027
  "complexType": {
5528
5028
  "signature": "(props: GenericObject) => Promise<void>",
5529
5029
  "parameters": [{
5530
5030
  "tags": [{
5531
- "text": "props - Object containing props that will be set to the component.",
5532
- "name": "param"
5031
+ "name": "param",
5032
+ "text": "props - Object containing props that will be set to the component."
5533
5033
  }],
5534
5034
  "text": "- Object containing props that will be set to the component."
5535
5035
  }],
@@ -5557,14 +5057,14 @@ export class KupDataTable {
5557
5057
  "signature": "(rowsById: string, emitEvent?: boolean) => Promise<void>",
5558
5058
  "parameters": [{
5559
5059
  "tags": [{
5560
- "text": "rowsById - String containing the ids separated by \";\".",
5561
- "name": "param"
5060
+ "name": "param",
5061
+ "text": "rowsById - String containing the ids separated by \";\"."
5562
5062
  }],
5563
5063
  "text": "- String containing the ids separated by \";\"."
5564
5064
  }, {
5565
5065
  "tags": [{
5566
- "text": "emitEvent - The event will always be emitted unless emitEvent is set to false.",
5567
- "name": "param"
5066
+ "name": "param",
5067
+ "text": "emitEvent - The event will always be emitted unless emitEvent is set to false."
5568
5068
  }],
5569
5069
  "text": "- The event will always be emitted unless emitEvent is set to false."
5570
5070
  }],