@sme.up/ketchup 4.0.0 → 4.2.0-SNAPSHOT

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 (295) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/cell-utils-1d44a3f0.js +168 -0
  3. package/dist/cjs/f-button-a5788453.js +105 -0
  4. package/dist/cjs/f-cell-eba6f39e.js +727 -0
  5. package/dist/cjs/f-chip-ce69b7d2.js +141 -0
  6. package/dist/cjs/{f-image-5f4f29ca.js → f-image-e03842eb.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} +1678 -2558
  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-75f1a2cd.js +5794 -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-b3ec89fe.js} +18 -26
  27. package/dist/collection/assets/cell.js +51 -0
  28. package/dist/collection/assets/data-table.js +518 -45
  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/dialog/kup-card-dialog.js +18 -0
  48. package/dist/collection/components/kup-card/kup-card-helper.js +19 -1
  49. package/dist/collection/components/kup-card/kup-card.css +147 -216
  50. package/dist/collection/components/kup-card/kup-card.js +80 -29
  51. package/dist/collection/components/kup-card/standard/kup-card-standard.js +75 -0
  52. package/dist/collection/components/kup-cell/kup-cell-declarations.js +11 -0
  53. package/dist/collection/components/kup-cell/kup-cell.css +20 -0
  54. package/dist/collection/components/kup-cell/kup-cell.js +413 -0
  55. package/dist/collection/components/kup-chart/kup-chart.js +41 -42
  56. package/dist/collection/components/kup-checkbox/kup-checkbox.css +0 -214
  57. package/dist/collection/components/kup-checkbox/kup-checkbox.js +19 -20
  58. package/dist/collection/components/kup-chip/kup-chip.css +0 -217
  59. package/dist/collection/components/kup-chip/kup-chip.js +15 -16
  60. package/dist/collection/components/kup-color-picker/kup-color-picker.css +7 -2380
  61. package/dist/collection/components/kup-color-picker/kup-color-picker.js +41 -41
  62. package/dist/collection/components/kup-combobox/kup-combobox-declarations.js +1 -0
  63. package/dist/collection/components/kup-combobox/kup-combobox.css +5 -2381
  64. package/dist/collection/components/kup-combobox/kup-combobox.js +68 -28
  65. package/dist/collection/components/kup-dash-list/kup-dash-list.js +13 -4
  66. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +3 -1
  67. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +61 -102
  68. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  69. package/dist/collection/components/kup-data-table/kup-data-table.css +127 -3203
  70. package/dist/collection/components/kup-data-table/kup-data-table.js +568 -1085
  71. package/dist/collection/components/kup-date-picker/kup-date-picker.css +6 -8
  72. package/dist/collection/components/kup-date-picker/kup-date-picker.js +77 -106
  73. package/dist/collection/components/kup-drawer/kup-drawer.js +9 -10
  74. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +12 -340
  75. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +56 -45
  76. package/dist/collection/components/kup-field/kup-field.js +21 -22
  77. package/dist/collection/components/kup-gauge/kup-gauge.js +17 -18
  78. package/dist/collection/components/kup-grid/kup-grid.css +2 -1
  79. package/dist/collection/components/kup-grid/kup-grid.js +13 -14
  80. package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
  81. package/dist/collection/components/kup-image/assets/svg/ketchup.svg +74 -0
  82. package/dist/collection/components/kup-image/assets/svg/smeup.svg +59 -0
  83. package/dist/collection/components/kup-image/kup-image.css +0 -32
  84. package/dist/collection/components/kup-image/kup-image.js +25 -26
  85. package/dist/collection/components/kup-lazy/kup-lazy.js +17 -18
  86. package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
  87. package/dist/collection/components/kup-list/kup-list.css +4 -260
  88. package/dist/collection/components/kup-list/kup-list.js +39 -49
  89. package/dist/collection/components/kup-magic-box/kup-magic-box.css +13 -39
  90. package/dist/collection/components/kup-magic-box/kup-magic-box.js +29 -38
  91. package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +11 -12
  92. package/dist/collection/components/kup-paginator/kup-paginator.css +0 -332
  93. package/dist/collection/components/kup-paginator/kup-paginator.js +44 -12
  94. package/dist/collection/components/kup-probe/kup-probe.js +9 -9
  95. package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +21 -22
  96. package/dist/collection/components/kup-radio/kup-radio.js +17 -18
  97. package/dist/collection/components/kup-rating/kup-rating.js +15 -16
  98. package/dist/collection/components/kup-snackbar/kup-snackbar-declarations.js +13 -0
  99. package/dist/collection/components/kup-snackbar/kup-snackbar.css +75 -0
  100. package/dist/collection/components/kup-snackbar/kup-snackbar.js +390 -0
  101. package/dist/collection/components/kup-spinner/kup-spinner.js +23 -24
  102. package/dist/collection/components/kup-switch/kup-switch.css +0 -156
  103. package/dist/collection/components/kup-switch/kup-switch.js +17 -18
  104. package/dist/collection/components/kup-tab-bar/kup-tab-bar.css +0 -199
  105. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +13 -14
  106. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  107. package/dist/collection/components/kup-text-field/kup-text-field.css +3 -2371
  108. package/dist/collection/components/kup-text-field/kup-text-field.js +77 -51
  109. package/dist/collection/components/kup-time-picker/kup-time-picker.css +6 -0
  110. package/dist/collection/components/kup-time-picker/kup-time-picker.js +55 -85
  111. package/dist/collection/components/kup-tooltip/kup-tooltip.js +24 -14
  112. package/dist/collection/components/kup-tree/kup-tree.css +27 -371
  113. package/dist/collection/components/kup-tree/kup-tree.js +158 -383
  114. package/dist/collection/f-components/f-button/f-button.js +4 -2
  115. package/dist/collection/f-components/f-cell/f-cell-declarations.js +143 -0
  116. package/dist/collection/f-components/f-cell/f-cell.js +467 -0
  117. package/dist/collection/f-components/f-checkbox/f-checkbox.js +1 -1
  118. package/dist/collection/f-components/f-chip/f-chip.js +2 -2
  119. package/dist/collection/f-components/f-image/f-image.js +2 -3
  120. package/dist/collection/f-components/f-switch/f-switch.js +1 -1
  121. package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +1 -1
  122. package/dist/collection/f-components/f-text-field/f-text-field.js +25 -21
  123. package/dist/collection/utils/cell-utils.js +18 -222
  124. package/dist/collection/utils/filters/filters.js +31 -37
  125. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +15 -3
  126. package/dist/collection/utils/kup-dates/kup-dates.js +14 -2
  127. package/dist/collection/utils/kup-debug/kup-debug-browser-utils.js +3 -3
  128. package/dist/collection/utils/kup-debug/kup-debug.js +57 -29
  129. package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +5 -7
  130. package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
  131. package/dist/collection/utils/kup-interact/kup-interact.js +379 -0
  132. package/dist/collection/utils/kup-language/kup-language-declarations.js +2 -0
  133. package/dist/collection/utils/kup-language/kup-language.js +1 -1
  134. package/dist/collection/utils/kup-manager/kup-manager.js +47 -10
  135. package/dist/collection/utils/kup-objects/kup-objects.js +9 -33
  136. package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
  137. package/dist/collection/utils/kup-search/kup-search-declarations.js +1 -0
  138. package/dist/collection/utils/kup-search/kup-search.js +76 -0
  139. package/dist/collection/utils/kup-theme/kup-theme-declarations.js +1 -0
  140. package/dist/collection/utils/kup-theme/kup-theme.js +4 -3
  141. package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
  142. package/dist/collection/utils/utils.js +15 -23
  143. package/dist/esm/cell-utils-9a2914fc.js +160 -0
  144. package/dist/esm/f-button-55a9ed88.js +103 -0
  145. package/dist/esm/f-cell-ac520cb2.js +723 -0
  146. package/dist/esm/f-chip-babf1740.js +139 -0
  147. package/dist/esm/{f-image-68b34fab.js → f-image-70ca9dfe.js} +4 -5
  148. package/dist/esm/{index-bf2824a6.js → index-e0e67c23.js} +74 -65
  149. package/dist/esm/ketchup.js +3 -3
  150. package/dist/esm/kup-accordion.entry.js +6 -8
  151. package/dist/esm/{kup-autocomplete_29.entry.js → kup-autocomplete_28.entry.js} +1451 -2330
  152. package/dist/esm/kup-calendar.entry.js +10 -10
  153. package/dist/esm/kup-cell.entry.js +197 -0
  154. package/dist/esm/kup-dash-list.entry.js +15 -7
  155. package/dist/esm/kup-dash_2.entry.js +104 -62
  156. package/dist/esm/kup-drawer.entry.js +4 -6
  157. package/dist/esm/kup-field.entry.js +3 -5
  158. package/dist/esm/kup-iframe.entry.js +3 -4
  159. package/dist/esm/kup-lazy.entry.js +4 -6
  160. package/dist/esm/kup-magic-box.entry.js +21 -31
  161. package/dist/esm/kup-manager-bba32828.js +5781 -0
  162. package/dist/esm/kup-nav-bar.entry.js +4 -6
  163. package/dist/esm/kup-probe.entry.js +3 -4
  164. package/dist/esm/kup-qlik.entry.js +2 -3
  165. package/dist/esm/kup-snackbar.entry.js +148 -0
  166. package/dist/esm/loader.js +3 -3
  167. package/dist/esm/{utils-13dd007a.js → utils-cfcbe33f.js} +16 -23
  168. package/dist/ketchup/assets/svg/ketchup.svg +74 -0
  169. package/dist/ketchup/assets/svg/smeup.svg +59 -0
  170. package/dist/ketchup/ketchup.esm.js +1 -1
  171. package/dist/ketchup/p-03ae1be9.entry.js +1 -0
  172. package/dist/ketchup/p-06c209a5.js +1 -0
  173. package/dist/ketchup/p-1ce9a037.js +1 -0
  174. package/dist/ketchup/p-1e2c3497.js +1 -0
  175. package/dist/ketchup/p-40df35de.entry.js +1 -0
  176. package/dist/ketchup/{p-c7ee1fbc.js → p-4748be4b.js} +2 -2
  177. package/dist/ketchup/p-52038ccb.js +1 -0
  178. package/dist/ketchup/p-5db41fae.entry.js +45 -0
  179. package/dist/ketchup/p-5faf7715.entry.js +1 -0
  180. package/dist/ketchup/p-62208488.entry.js +1 -0
  181. package/dist/ketchup/p-69a705ae.entry.js +1 -0
  182. package/dist/ketchup/p-6cc8264d.entry.js +1 -0
  183. package/dist/ketchup/p-74259992.entry.js +1 -0
  184. package/dist/ketchup/p-756aa8b1.entry.js +1 -0
  185. package/dist/ketchup/p-a7687c0e.entry.js +27 -0
  186. package/dist/ketchup/p-cb5f4994.js +1 -0
  187. package/dist/ketchup/p-d58dbf0e.js +1 -0
  188. package/dist/ketchup/p-d6ce1ac6.entry.js +1 -0
  189. package/dist/ketchup/p-daf03877.entry.js +1 -0
  190. package/dist/ketchup/p-e90934b5.entry.js +1 -0
  191. package/dist/ketchup/p-ea387b49.entry.js +1 -0
  192. package/dist/ketchup/p-f6bff949.js +1 -0
  193. package/dist/ketchup/p-ff7d590e.entry.js +1 -0
  194. package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +2 -6
  195. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +7 -13
  196. package/dist/types/components/kup-box/kup-box-declarations.d.ts +13 -4
  197. package/dist/types/components/kup-box/kup-box.d.ts +13 -6
  198. package/dist/types/components/kup-card/dialog/kup-card-dialog.d.ts +6 -0
  199. package/dist/types/components/kup-card/kup-card.d.ts +9 -0
  200. package/dist/types/components/kup-card/standard/kup-card-standard.d.ts +6 -0
  201. package/dist/types/components/kup-cell/kup-cell-declarations.d.ts +10 -0
  202. package/dist/types/components/kup-cell/kup-cell.d.ts +67 -0
  203. package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +1 -1
  204. package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +3 -2
  205. package/dist/types/components/kup-combobox/kup-combobox.d.ts +5 -0
  206. package/dist/types/components/kup-dash-list/kup-dash-list.d.ts +4 -0
  207. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +21 -32
  208. package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +1 -15
  209. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  210. package/dist/types/components/kup-data-table/kup-data-table.d.ts +32 -81
  211. package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +12 -14
  212. package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +1 -4
  213. package/dist/types/components/kup-list/kup-list-declarations.d.ts +1 -1
  214. package/dist/types/components/kup-list/kup-list.d.ts +2 -3
  215. package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +1 -0
  216. package/dist/types/components/kup-paginator/kup-paginator.d.ts +6 -0
  217. package/dist/types/components/kup-snackbar/kup-snackbar-declarations.d.ts +12 -0
  218. package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +79 -0
  219. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +2 -1
  220. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  221. package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +8 -11
  222. package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +1 -0
  223. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
  224. package/dist/types/components/kup-tree/kup-tree.d.ts +12 -23
  225. package/dist/types/components.d.ts +346 -174
  226. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +153 -0
  227. package/dist/types/f-components/f-cell/f-cell.d.ts +3 -0
  228. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  229. package/dist/types/f-components/f-text-field/f-text-field-mdc.d.ts +1 -1
  230. package/dist/types/utils/cell-utils.d.ts +0 -19
  231. package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +2 -0
  232. package/dist/types/utils/kup-dates/kup-dates.d.ts +9 -4
  233. package/dist/types/utils/kup-debug/kup-debug.d.ts +1 -1
  234. package/dist/types/utils/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +1 -1
  235. package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
  236. package/dist/types/utils/kup-interact/kup-interact-declarations.d.ts +127 -0
  237. package/dist/types/utils/kup-interact/kup-interact.d.ts +93 -0
  238. package/dist/types/utils/kup-language/kup-language-declarations.d.ts +2 -0
  239. package/dist/types/utils/kup-language/kup-language.d.ts +1 -1
  240. package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +28 -8
  241. package/dist/types/utils/kup-manager/kup-manager.d.ts +18 -5
  242. package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
  243. package/dist/types/utils/kup-search/kup-search-declarations.d.ts +7 -0
  244. package/dist/types/utils/kup-search/kup-search.d.ts +20 -0
  245. package/dist/types/utils/kup-theme/kup-theme-declarations.d.ts +2 -0
  246. package/dist/types/utils/kup-theme/kup-theme.d.ts +2 -2
  247. package/dist/types/utils/utils.d.ts +0 -1
  248. package/package.json +4 -6
  249. package/dist/cjs/cell-utils-1f89a299.js +0 -1527
  250. package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
  251. package/dist/cjs/f-chip-2d58c8f7.js +0 -239
  252. package/dist/cjs/kup-grid.cjs.entry.js +0 -130
  253. package/dist/cjs/kup-manager-59ad8bdc.js +0 -4845
  254. package/dist/cjs/kup-objects-59ea949c.js +0 -717
  255. package/dist/collection/assets/images/drag-multiple.js +0 -1
  256. package/dist/collection/components/kup-editor/kup-editor.css +0 -5
  257. package/dist/collection/components/kup-editor/kup-editor.js +0 -59
  258. package/dist/collection/components/kup-layout/kup-layout.css +0 -53
  259. package/dist/collection/components/kup-layout/kup-layout.js +0 -156
  260. package/dist/collection/utils/drag-and-drop.js +0 -109
  261. package/dist/collection/utils/kup-dialog/kup-dialog-declarations.js +0 -36
  262. package/dist/collection/utils/kup-dialog/kup-dialog.js +0 -310
  263. package/dist/esm/cell-utils-cb612463.js +0 -1510
  264. package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
  265. package/dist/esm/f-chip-125d5dd6.js +0 -236
  266. package/dist/esm/kup-grid.entry.js +0 -126
  267. package/dist/esm/kup-manager-e7d7b353.js +0 -4842
  268. package/dist/esm/kup-objects-d38d2fa2.js +0 -711
  269. package/dist/ketchup/p-00fe1e3e.js +0 -1
  270. package/dist/ketchup/p-0320e24e.entry.js +0 -1
  271. package/dist/ketchup/p-08c7a092.js +0 -1
  272. package/dist/ketchup/p-1165f4ea.entry.js +0 -1
  273. package/dist/ketchup/p-170d3cba.js +0 -1
  274. package/dist/ketchup/p-18cb3ba3.js +0 -1
  275. package/dist/ketchup/p-23541a97.entry.js +0 -45
  276. package/dist/ketchup/p-64ea7e37.entry.js +0 -1
  277. package/dist/ketchup/p-7896031c.entry.js +0 -1
  278. package/dist/ketchup/p-876da4c2.entry.js +0 -1
  279. package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
  280. package/dist/ketchup/p-940ab57a.entry.js +0 -1
  281. package/dist/ketchup/p-9c858a38.entry.js +0 -1
  282. package/dist/ketchup/p-a12a5690.entry.js +0 -1
  283. package/dist/ketchup/p-a5424073.js +0 -1
  284. package/dist/ketchup/p-b0724035.entry.js +0 -1
  285. package/dist/ketchup/p-b14e77f0.js +0 -1
  286. package/dist/ketchup/p-d24cfdea.entry.js +0 -1
  287. package/dist/ketchup/p-ee89966f.entry.js +0 -27
  288. package/dist/ketchup/p-fcd2fd8f.js +0 -1
  289. package/dist/ketchup/p-fce3b9d8.entry.js +0 -1
  290. package/dist/types/assets/images/drag-multiple.d.ts +0 -1
  291. package/dist/types/components/kup-editor/kup-editor.d.ts +0 -16
  292. package/dist/types/components/kup-layout/kup-layout.d.ts +0 -25
  293. package/dist/types/utils/drag-and-drop.d.ts +0 -53
  294. package/dist/types/utils/kup-dialog/kup-dialog-declarations.d.ts +0 -43
  295. package/dist/types/utils/kup-dialog/kup-dialog.d.ts +0 -50
@@ -0,0 +1,723 @@
1
+ import { h, a as getAssetPath } from './index-e0e67c23.js';
2
+ import { b as getCellValueForDisplay } from './cell-utils-9a2914fc.js';
3
+ import { a as KupThemeIconValues, b as KupThemeColorValues } from './kup-manager-bba32828.js';
4
+ import { d as stringToNumber } from './utils-cfcbe33f.js';
5
+ import { F as FImage } from './f-image-70ca9dfe.js';
6
+ import { F as FChip } from './f-chip-babf1740.js';
7
+
8
+ /*-------------------------------------------------*/
9
+ /* C o m p o n e n t */
10
+ /*-------------------------------------------------*/
11
+ const FTextField = (props, children) => {
12
+ return (h("div", Object.assign({ class: `f-text-field ${props.danger ? 'kup-danger' : ''} ${props.fullHeight ? 'kup-full-height' : ''} ${props.fullWidth ? 'kup-full-width' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.shaped ? 'kup-shaped' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
13
+ props.leadingLabel || props.trailingLabel ? (h("div", { class: `mdc-form-field ${props.leadingLabel ? 'mdc-form-field--align-end' : ''}` }, [
14
+ setContent(props),
15
+ setHelper(props),
16
+ h("label", null, props.label),
17
+ ])) : ([setContent(props), setHelper(props)]),
18
+ children));
19
+ };
20
+ /*-------------------------------------------------*/
21
+ /* M e t h o d s */
22
+ /*-------------------------------------------------*/
23
+ function setContent(props) {
24
+ const isOutlined = props.textArea || props.outlined;
25
+ let labelEl;
26
+ let iconEl;
27
+ if (props.label && !props.leadingLabel && !props.trailingLabel) {
28
+ labelEl = (h("label", { class: "mdc-floating-label", htmlFor: "kup-input" }, props.label));
29
+ }
30
+ if (props.icon) {
31
+ let iconStyle;
32
+ let iconClass = '';
33
+ if (Object.values(KupThemeIconValues).indexOf(props.icon) > -1) {
34
+ iconClass = props.icon.replace('--', '');
35
+ }
36
+ else {
37
+ let svg = `url('${getAssetPath(`./assets/svg/${props.icon}.svg`)}') no-repeat center`;
38
+ iconStyle = {
39
+ mask: svg,
40
+ webkitMask: svg,
41
+ };
42
+ }
43
+ iconEl = (h("span", { tabindex: "0", style: iconStyle, onClick: props.onIconClick, class: `mdc-text-field__icon kup-icon action ${iconClass}` }));
44
+ }
45
+ const classObj = {
46
+ 'is-clearable': props.isClearable,
47
+ 'mdc-text-field': true,
48
+ 'mdc-text-field--disabled': props.disabled,
49
+ 'mdc-text-field--filled': !props.fullWidth && !isOutlined,
50
+ 'mdc-text-field--no-label': !props.label,
51
+ 'mdc-text-field--fullwidth': props.fullWidth,
52
+ 'mdc-text-field--outlined': isOutlined,
53
+ 'mdc-text-field--textarea': props.textArea,
54
+ 'mdc-text-field--with-leading-icon': props.icon && !props.trailingIcon,
55
+ 'mdc-text-field--with-trailing-icon': props.icon && props.trailingIcon,
56
+ };
57
+ return (h("div", { class: classObj },
58
+ props.textArea && props.maxLength ? (h("div", { class: "mdc-text-field-character-counter" },
59
+ "'0 / ' + ",
60
+ props.maxLength)) : undefined,
61
+ !props.trailingIcon ? iconEl : undefined,
62
+ props.textArea ? (h("span", { class: "mdc-text-field__resizer" },
63
+ h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
64
+ props.isClearable ? (h("span", { tabindex: "1", class: `mdc-text-field__icon kup-icon ${KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
65
+ props.trailingIcon ? iconEl : undefined,
66
+ !props.fullWidth && !isOutlined ? labelEl : undefined,
67
+ isOutlined ? (h("div", { class: "mdc-notched-outline" },
68
+ h("div", { class: "mdc-notched-outline__leading" }),
69
+ h("div", { class: "mdc-notched-outline__notch" }, labelEl),
70
+ h("div", { class: "mdc-notched-outline__trailing" }))) : (h("span", { class: "mdc-line-ripple" }))));
71
+ }
72
+ function setHelper(props) {
73
+ if (props.helperEnabled) {
74
+ if (props.helper) {
75
+ const classObj = {
76
+ 'mdc-text-field-helper-text': true,
77
+ 'mdc-text-field-helper-text--persistent': !props.helperWhenFocused,
78
+ };
79
+ return (h("div", { class: "mdc-text-field-helper-line" },
80
+ h("div", { class: classObj }, props.helper),
81
+ props.maxLength && !props.textArea ? (h("div", { class: "mdc-text-field-character-counter" },
82
+ "'0 / ' + ",
83
+ props.maxLength.toString())) : undefined));
84
+ }
85
+ else {
86
+ if (props.maxLength && !props.textArea) {
87
+ return (h("div", { class: "mdc-text-field-helper-line" },
88
+ h("div", { class: "mdc-text-field-character-counter" },
89
+ "'0 / ' + ",
90
+ props.maxLength)));
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ const autoAlignComps = ['KUP-DATA-TABLE', 'KUP-TREE'];
97
+ /**
98
+ * Supported cell events.
99
+ */
100
+ var FCellEvents;
101
+ (function (FCellEvents) {
102
+ FCellEvents["CLICK"] = "kup-cell-click";
103
+ FCellEvents["INPUT"] = "kup-cell-input";
104
+ FCellEvents["UPDATE"] = "kup-cell-update";
105
+ })(FCellEvents || (FCellEvents = {}));
106
+ /**
107
+ * Supported cell padding.
108
+ */
109
+ var FCellPadding;
110
+ (function (FCellPadding) {
111
+ FCellPadding["DENSE"] = "dense";
112
+ FCellPadding["MEDIUM"] = "medium";
113
+ FCellPadding["NONE"] = "";
114
+ FCellPadding["WIDE"] = "wide";
115
+ })(FCellPadding || (FCellPadding = {}));
116
+ /**
117
+ * Supported cell CSS classes.
118
+ */
119
+ var FCellClasses;
120
+ (function (FCellClasses) {
121
+ FCellClasses["BG_DANGER"] = "danger-bg";
122
+ FCellClasses["BG_GREEN"] = "green-bg";
123
+ FCellClasses["BG_GREY"] = "grey-bg";
124
+ FCellClasses["BG_ORANGE"] = "orange-bg";
125
+ FCellClasses["BG_PURPLE"] = "purple-bg";
126
+ FCellClasses["BG_SUCCESS"] = "success-bg";
127
+ FCellClasses["BG_TEAL"] = "teal-bg";
128
+ FCellClasses["BG_WARNING"] = "warning-bg";
129
+ FCellClasses["C_BG_DANGER"] = "c-danger-bg";
130
+ FCellClasses["C_BG_GREEN"] = "c-green-bg";
131
+ FCellClasses["C_BG_GREY"] = "c-grey-bg";
132
+ FCellClasses["C_BG_ORANGE"] = "c-orange-bg";
133
+ FCellClasses["C_BG_PURPLE"] = "c-purple-bg";
134
+ FCellClasses["C_BG_SUCCESS"] = "c-success-bg";
135
+ FCellClasses["C_BG_TEAL"] = "c-teal-bg";
136
+ FCellClasses["C_BG_WARNING"] = "c-warning-bg";
137
+ FCellClasses["C_CENTERED"] = "c-centered";
138
+ FCellClasses["C_FITTED"] = "c-fitted";
139
+ FCellClasses["C_PADDED"] = "c-padded";
140
+ FCellClasses["C_PADDED_HOR"] = "c-padded-hor";
141
+ FCellClasses["C_PADDED_VER"] = "c-padded-ver";
142
+ FCellClasses["C_ROUND"] = "c-round";
143
+ FCellClasses["C_RIGHT_ALIGNED"] = "c-right-aligned";
144
+ FCellClasses["C_SHAPED"] = "c-shaped";
145
+ FCellClasses["C_TEXT_VERTICAL"] = "c-vertical-text";
146
+ FCellClasses["CLICKABLE"] = "clickable";
147
+ FCellClasses["HOVER_DISPLAY"] = "display-on-hover";
148
+ FCellClasses["HOVER_EXPAND"] = "expand-on-hover";
149
+ FCellClasses["HOVER_REDUCE"] = "reduce-on-hover";
150
+ FCellClasses["INDICATOR_TOPRIGHT"] = "top-right-indicator";
151
+ FCellClasses["LINK"] = "link";
152
+ FCellClasses["MONOSPACE"] = "monospace";
153
+ FCellClasses["OBJ"] = "obj";
154
+ FCellClasses["SHAPED"] = "shaped";
155
+ FCellClasses["TEXT_DANGER"] = "danger-text";
156
+ FCellClasses["TEXT_INFO"] = "info-text";
157
+ FCellClasses["TEXT_PRIMARY"] = "primary-text";
158
+ FCellClasses["TEXT_PURPLE"] = "purple-text";
159
+ FCellClasses["TEXT_SECONDARY"] = "secondary-text";
160
+ FCellClasses["TEXT_STRONG"] = "strong-text";
161
+ FCellClasses["TEXT_SUCCESS"] = "success-text";
162
+ FCellClasses["TEXT_WARNING"] = "warning-text";
163
+ FCellClasses["UNDERLINED"] = "underlined";
164
+ })(FCellClasses || (FCellClasses = {}));
165
+ /**
166
+ * Supported cell shapes.
167
+ */
168
+ var FCellShapes;
169
+ (function (FCellShapes) {
170
+ FCellShapes["AUTOCOMPLETE"] = "ACP";
171
+ FCellShapes["BUTTON_LIST"] = "BTN";
172
+ FCellShapes["CHART"] = "GRA";
173
+ FCellShapes["CHECKBOX"] = "CHK";
174
+ FCellShapes["CHIP"] = "CHI";
175
+ FCellShapes["COLOR_PICKER"] = "CLP";
176
+ FCellShapes["COMBOBOX"] = "CMB";
177
+ FCellShapes["EDITOR"] = "EDT";
178
+ FCellShapes["GAUGE"] = "GAU";
179
+ FCellShapes["IMAGE"] = "IMG";
180
+ FCellShapes["KNOB"] = "KNB";
181
+ FCellShapes["PROGRESS_BAR"] = "PGB";
182
+ FCellShapes["RADIO"] = "RAD";
183
+ FCellShapes["RATING"] = "RTG";
184
+ FCellShapes["TEXT_FIELD"] = "ITX";
185
+ })(FCellShapes || (FCellShapes = {}));
186
+ /**
187
+ * Supported cell types.
188
+ */
189
+ var FCellTypes;
190
+ (function (FCellTypes) {
191
+ FCellTypes["AUTOCOMPLETE"] = "autocomplete";
192
+ FCellTypes["BAR"] = "bar";
193
+ FCellTypes["BUTTON"] = "button";
194
+ FCellTypes["BUTTON_LIST"] = "button-list";
195
+ FCellTypes["CHART"] = "chart";
196
+ FCellTypes["CHECKBOX"] = "checkbox";
197
+ FCellTypes["CHIP"] = "chips";
198
+ FCellTypes["COLOR_PICKER"] = "color-picker";
199
+ FCellTypes["COMBOBOX"] = "combobox";
200
+ FCellTypes["DATE"] = "date";
201
+ FCellTypes["DATETIME"] = "datetime";
202
+ FCellTypes["EDITOR"] = "editor";
203
+ FCellTypes["GAUGE"] = "gauge";
204
+ FCellTypes["ICON"] = "icon";
205
+ FCellTypes["IMAGE"] = "image";
206
+ FCellTypes["KNOB"] = "knob";
207
+ FCellTypes["LINK"] = "link";
208
+ FCellTypes["NUMBER"] = "number";
209
+ FCellTypes["PROGRESS_BAR"] = "progress-bar";
210
+ FCellTypes["RADIO"] = "radio";
211
+ FCellTypes["RATING"] = "rating";
212
+ FCellTypes["STRING"] = "string";
213
+ FCellTypes["TIME"] = "time";
214
+ })(FCellTypes || (FCellTypes = {}));
215
+ const editableTypes = [
216
+ FCellTypes.AUTOCOMPLETE,
217
+ FCellTypes.CHECKBOX,
218
+ FCellTypes.COLOR_PICKER,
219
+ FCellTypes.COMBOBOX,
220
+ FCellTypes.DATE,
221
+ FCellTypes.NUMBER,
222
+ FCellTypes.RATING,
223
+ FCellTypes.STRING,
224
+ FCellTypes.TIME,
225
+ ];
226
+ const kupTypes = [
227
+ FCellTypes.BAR,
228
+ FCellTypes.BUTTON,
229
+ FCellTypes.BUTTON_LIST,
230
+ FCellTypes.CHART,
231
+ FCellTypes.CHIP,
232
+ FCellTypes.COLOR_PICKER,
233
+ FCellTypes.GAUGE,
234
+ FCellTypes.KNOB,
235
+ FCellTypes.PROGRESS_BAR,
236
+ FCellTypes.RADIO,
237
+ FCellTypes.RATING,
238
+ ];
239
+
240
+ /*-------------------------------------------------*/
241
+ /* C o m p o n e n t */
242
+ /*-------------------------------------------------*/
243
+ const FCheckbox = (props) => {
244
+ const indeterminateAttr = {
245
+ 'data-indeterminate': props.indeterminate ? true : false,
246
+ };
247
+ const classObj = {
248
+ checkbox: true,
249
+ 'checkbox--checked': props.checked && !props.indeterminate ? true : false,
250
+ 'checkbox--disabled': props.disabled ? true : false,
251
+ 'checkbox--indeterminate': props.indeterminate ? true : false,
252
+ };
253
+ return (h("div", Object.assign({ class: `f-checkbox ${props.danger ? 'kup-danger' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
254
+ h("div", { class: `form-field ${props.leadingLabel ? 'form-field--align-end' : ''}` },
255
+ h("div", { class: classObj },
256
+ h("input", Object.assign({ type: "checkbox", class: "checkbox__native-control", checked: props.checked, disabled: props.disabled, onBlur: props.onBlur, onChange: props.onChange, onFocus: props.onFocus }, indeterminateAttr, { value: props.checked ? 'on' : 'off' })),
257
+ h("div", { class: "checkbox__background", onClick: props.onChange },
258
+ h("svg", { class: "checkbox__checkmark", viewBox: "0 0 24 24" },
259
+ h("path", { class: "checkbox__checkmark-path", fill: "none", d: "M1.73,12.91 8.1,19.28 22.79,4.59" })),
260
+ h("div", { class: "checkbox__mixedmark" }))),
261
+ props.label ? h("label", null, props.label) : undefined)));
262
+ };
263
+
264
+ const dom = document.documentElement;
265
+ /*-------------------------------------------------*/
266
+ /* C o m p o n e n t */
267
+ /*-------------------------------------------------*/
268
+ const FCell = (props) => {
269
+ const cell = props.cell;
270
+ const column = props.column;
271
+ const row = props.row;
272
+ const shape = props.shape
273
+ ? props.shape
274
+ : cell.shape
275
+ ? cell.shape
276
+ : column.shape
277
+ ? column.shape
278
+ : null;
279
+ const hasObj = !dom.ketchup.objects.isEmptyKupObj(cell.obj);
280
+ const isEditable = cell.isEditable && props.editable ? true : false;
281
+ const valueToDisplay = props.previousValue !== cell.value ? cell.value : '';
282
+ const cellType = getCellType(cell, shape);
283
+ const subcomponentProps = Object.assign({}, cell.data);
284
+ let cssClasses = cell.cssClass
285
+ ? cell.cssClass
286
+ : column.cssClass
287
+ ? column.cssClass
288
+ : '';
289
+ const classObj = {
290
+ 'f-cell': true,
291
+ [FCellClasses.OBJ]: hasObj ? true : false,
292
+ [cellType + '-cell']: true,
293
+ [props.wrapperClass]: props.wrapperClass ? true : false,
294
+ [props.density]: props.density && cellType !== FCellTypes.BAR ? true : false,
295
+ [cssClasses]: cssClasses ? true : false,
296
+ };
297
+ let content = valueToDisplay;
298
+ if (isEditable && editableTypes.includes(cellType)) {
299
+ content = setEditableCell(cellType, classObj, cell, column, props);
300
+ }
301
+ else if (cell.data && kupTypes.includes(cellType)) {
302
+ if (props.setSizes) {
303
+ setCellSizeKup(cellType, subcomponentProps, cell);
304
+ }
305
+ if (!props.renderKup) {
306
+ const lazyClass = 'cell-' + cellType + ' placeholder';
307
+ content = h("span", { class: lazyClass });
308
+ }
309
+ else {
310
+ content = setKupCell(cellType, classObj, subcomponentProps, cell, row, column, props);
311
+ }
312
+ }
313
+ else {
314
+ if (props.setSizes) {
315
+ setCellSize(cellType, subcomponentProps, cell, props);
316
+ }
317
+ content = setCell(cellType, subcomponentProps, content, classObj, cell, column, props);
318
+ }
319
+ let icon = null;
320
+ if (!isEditable && (column.icon || cell.icon) && content) {
321
+ const fProps = {
322
+ color: `rgba(var(${KupThemeColorValues.TEXT}-rgb), 0.375)`,
323
+ resource: cell.icon ? cell.icon : column.icon,
324
+ sizeX: '1.25em',
325
+ sizeY: '1.25em',
326
+ wrapperClass: 'obj-icon',
327
+ };
328
+ icon = h(FImage, Object.assign({}, fProps));
329
+ }
330
+ let cellTitle = null;
331
+ if (dom.ketchup.debug.isDebug() && hasObj) {
332
+ cellTitle = cell.obj.t + '; ' + cell.obj.p + '; ' + cell.obj.k + ';';
333
+ }
334
+ else if (cell.title != null && cell.title.trim() != '') {
335
+ cellTitle = cell.title;
336
+ }
337
+ let infoEl = null;
338
+ if (cell.info) {
339
+ const info = Object.assign({}, cell.info);
340
+ if (!info.color) {
341
+ info.color = `var(${KupThemeColorValues.INFO})`;
342
+ }
343
+ if (!info.icon) {
344
+ info.icon = 'info';
345
+ }
346
+ const fProps = {
347
+ color: info.color,
348
+ resource: info.icon,
349
+ sizeX: '1.25em',
350
+ sizeY: '1.25em',
351
+ title: info.message ? info.message : '',
352
+ wrapperClass: 'cell-info',
353
+ };
354
+ infoEl = h(FImage, Object.assign({}, fProps));
355
+ }
356
+ return (h("div", { class: classObj, style: cell.style },
357
+ h("div", { class: "f-cell__content", style: cell.styleContent, title: cellTitle },
358
+ props.indents,
359
+ infoEl,
360
+ icon,
361
+ content)));
362
+ };
363
+ function setCellSize(cellType, subcomponentProps, cell, props) {
364
+ switch (cellType) {
365
+ case FCellTypes.CHECKBOX:
366
+ case FCellTypes.ICON:
367
+ if (!subcomponentProps.sizeX) {
368
+ subcomponentProps.sizeX = '18px';
369
+ }
370
+ if (!subcomponentProps.sizeY) {
371
+ subcomponentProps.sizeY = '18px';
372
+ }
373
+ if (cell.style) {
374
+ if (!cell.style.height) {
375
+ cell.style['minHeight'] = subcomponentProps.sizeY;
376
+ }
377
+ }
378
+ else {
379
+ cell.style = {
380
+ minHeight: subcomponentProps.sizeY,
381
+ };
382
+ }
383
+ break;
384
+ case FCellTypes.IMAGE:
385
+ if (props.component.rootElement.tagName ===
386
+ 'KUP-BOX') {
387
+ if (!subcomponentProps.sizeY) {
388
+ subcomponentProps.sizeY = 'auto';
389
+ }
390
+ if (subcomponentProps.fit === undefined) {
391
+ subcomponentProps.fit = true;
392
+ }
393
+ }
394
+ else if (!subcomponentProps.sizeX) {
395
+ subcomponentProps.sizeX = 'auto';
396
+ }
397
+ if (!subcomponentProps.sizeY) {
398
+ subcomponentProps.sizeY = '64px';
399
+ }
400
+ break;
401
+ }
402
+ }
403
+ function setCellSizeKup(cellType, subcomponentProps, cell) {
404
+ switch (cellType) {
405
+ case FCellTypes.BAR:
406
+ if (!subcomponentProps.sizeY) {
407
+ subcomponentProps.sizeY = '26px';
408
+ }
409
+ break;
410
+ case FCellTypes.BUTTON:
411
+ let height = '';
412
+ if (subcomponentProps.label) {
413
+ height = '36px';
414
+ }
415
+ if (cell.style) {
416
+ if (!cell.style.height) {
417
+ cell.style['minHeight'] = height;
418
+ }
419
+ }
420
+ else {
421
+ cell.style = { minHeight: height };
422
+ }
423
+ break;
424
+ case FCellTypes.CHART:
425
+ if (!subcomponentProps.sizeX) {
426
+ subcomponentProps.sizeX = '100%';
427
+ }
428
+ if (!subcomponentProps.sizeY) {
429
+ subcomponentProps.sizeY = '100%';
430
+ }
431
+ break;
432
+ case FCellTypes.CHIP:
433
+ if (cell.style) {
434
+ if (!cell.style.height) {
435
+ cell.style['minHeight'] = '40px';
436
+ }
437
+ }
438
+ else {
439
+ cell.style = { minHeight: '40px' };
440
+ }
441
+ break;
442
+ case FCellTypes.RADIO:
443
+ if (cell.style) {
444
+ if (!cell.style.height) {
445
+ cell.style['minHeight'] = '40px';
446
+ }
447
+ }
448
+ else {
449
+ cell.style = { minHeight: '40px' };
450
+ }
451
+ break;
452
+ }
453
+ }
454
+ function setEditableCell(cellType, classObj, cell, column, props) {
455
+ switch (cellType) {
456
+ case FCellTypes.AUTOCOMPLETE:
457
+ return (h("kup-autocomplete", Object.assign({}, cell.data, { class: "kup-full-width", "onkup-autocomplete-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-autocomplete-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
458
+ case FCellTypes.CHECKBOX:
459
+ if (autoAlignComps.includes(props.component.rootElement.tagName)) {
460
+ classObj[FCellClasses.C_CENTERED] = true;
461
+ }
462
+ return (h(FCheckbox, Object.assign({}, cell.data, { onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
463
+ case FCellTypes.COLOR_PICKER:
464
+ return (h("kup-color-picker", Object.assign({}, cell.data, { disabled: false, "onkup-colorpicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
465
+ case FCellTypes.COMBOBOX:
466
+ return (h("kup-combobox", Object.assign({}, cell.data, { class: "kup-full-width", "onkup-combobox-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-combobox-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
467
+ case FCellTypes.DATE:
468
+ return (h("kup-date-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: "kup-full-width", "onkup-datepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-datepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
469
+ case FCellTypes.RATING:
470
+ return (h("kup-rating", Object.assign({}, cell.data, { disabled: false, "onkup-rating-click": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
471
+ case FCellTypes.TIME:
472
+ return (h("kup-time-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: "kup-full-width", "onkup-timepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-timepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
473
+ case FCellTypes.NUMBER:
474
+ case FCellTypes.STRING:
475
+ return (h(FTextField, Object.assign({}, cell.data, { icon: cell.icon ? cell.icon : column.icon ? column.icon : null, fullWidth: true, inputType: cellType === FCellTypes.NUMBER ? 'number' : null, value: cellType === FCellTypes.NUMBER
476
+ ? stringToNumber(cell.value).toString()
477
+ : cell.value, onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), onInput: (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
478
+ }
479
+ }
480
+ function setCell(cellType, subcomponentProps, content, classObj, cell, column, props) {
481
+ switch (cellType) {
482
+ case FCellTypes.AUTOCOMPLETE:
483
+ case FCellTypes.COMBOBOX:
484
+ case FCellTypes.DATE:
485
+ case FCellTypes.DATETIME:
486
+ case FCellTypes.TIME:
487
+ if (content && content != '') {
488
+ const cellValue = getCellValueForDisplay(column, cell);
489
+ return h("div", { class: "f-cell__text" }, cellValue);
490
+ }
491
+ return content;
492
+ case FCellTypes.CHECKBOX:
493
+ if (autoAlignComps.includes(props.component.rootElement.tagName)) {
494
+ classObj[FCellClasses.C_CENTERED] = true;
495
+ }
496
+ return (h(FImage, { resource: subcomponentProps.checked
497
+ ? 'check_box'
498
+ : 'check_box_outline_blank', sizeX: "18px", sizeY: "18px" }));
499
+ case FCellTypes.EDITOR:
500
+ return h("div", { innerHTML: cell.value });
501
+ case FCellTypes.ICON:
502
+ case FCellTypes.IMAGE:
503
+ if (autoAlignComps.includes(props.component.rootElement.tagName)) {
504
+ classObj[FCellClasses.C_CENTERED] = true;
505
+ }
506
+ if (subcomponentProps.badgeData) {
507
+ classObj[FCellClasses.C_PADDED] = true;
508
+ }
509
+ return h(FImage, Object.assign({}, subcomponentProps));
510
+ case FCellTypes.LINK:
511
+ return (h("a", { href: content, target: "_blank" }, cell.value));
512
+ case FCellTypes.NUMBER:
513
+ if (content && content != '') {
514
+ const cellValueNumber = stringToNumber(cell.value);
515
+ const cellValue = getCellValueForDisplay(column, cell);
516
+ if (cellValueNumber < 0) {
517
+ classObj[FCellClasses.TEXT_DANGER] = true;
518
+ }
519
+ if (autoAlignComps.includes(props.component.rootElement.tagName)) {
520
+ classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
521
+ }
522
+ return h("div", { class: "f-cell__text" }, cellValue);
523
+ }
524
+ return h("div", { class: "f-cell__text" }, content);
525
+ default:
526
+ return h("div", { class: "f-cell__text" }, content);
527
+ }
528
+ }
529
+ function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, props) {
530
+ switch (cellType) {
531
+ case FCellTypes.BAR:
532
+ if (!subcomponentProps.data) {
533
+ return h("kup-image", Object.assign({}, subcomponentProps));
534
+ }
535
+ else {
536
+ const barStyle = {
537
+ height: subcomponentProps.sizeY,
538
+ };
539
+ return (h("div", { style: barStyle },
540
+ h(FImage, Object.assign({}, subcomponentProps))));
541
+ }
542
+ case FCellTypes.BUTTON:
543
+ if (autoAlignComps.includes(props.component.rootElement.tagName)) {
544
+ classObj[FCellClasses.C_CENTERED] = true;
545
+ }
546
+ return (h("kup-button", Object.assign({}, subcomponentProps, { "onkup-button-click": (e) => cellEvent(e, props, cellType, FCellEvents.CLICK) })));
547
+ case FCellTypes.BUTTON_LIST:
548
+ if (autoAlignComps.includes(props.component.rootElement.tagName)) {
549
+ classObj[FCellClasses.C_CENTERED] = true;
550
+ }
551
+ subcomponentProps['data-storage'] = {
552
+ cell: cell,
553
+ row: row,
554
+ column: column,
555
+ };
556
+ return h("kup-button-list", Object.assign({}, subcomponentProps));
557
+ case FCellTypes.CHART:
558
+ if (autoAlignComps.includes(props.component.rootElement.tagName)) {
559
+ classObj[FCellClasses.C_CENTERED] = true;
560
+ }
561
+ return h("kup-chart", Object.assign({}, subcomponentProps));
562
+ case FCellTypes.CHIP:
563
+ return h(FChip, Object.assign({}, subcomponentProps));
564
+ case FCellTypes.COLOR_PICKER:
565
+ return (h("kup-color-picker", Object.assign({}, subcomponentProps, { disabled: true })));
566
+ case FCellTypes.GAUGE:
567
+ return (h("kup-gauge", Object.assign({ value: stringToNumber(cell.value), "width-component": "280px" }, subcomponentProps)));
568
+ case FCellTypes.KNOB:
569
+ case FCellTypes.PROGRESS_BAR:
570
+ return h("kup-progress-bar", Object.assign({}, subcomponentProps));
571
+ case FCellTypes.RADIO:
572
+ if (autoAlignComps.includes(props.component.rootElement.tagName)) {
573
+ classObj[FCellClasses.C_CENTERED] = true;
574
+ }
575
+ subcomponentProps['disabled'] = row.readOnly;
576
+ return h("kup-radio", Object.assign({}, subcomponentProps));
577
+ case FCellTypes.RATING:
578
+ return h("kup-rating", Object.assign({}, subcomponentProps, { disabled: true }));
579
+ }
580
+ }
581
+ function getCellType(cell, shape) {
582
+ const obj = cell.obj;
583
+ if (shape) {
584
+ switch (shape.toUpperCase()) {
585
+ case FCellShapes.AUTOCOMPLETE:
586
+ return FCellTypes.AUTOCOMPLETE;
587
+ case FCellShapes.BUTTON_LIST:
588
+ return FCellTypes.BUTTON_LIST;
589
+ case FCellShapes.CHART:
590
+ return FCellTypes.CHART;
591
+ case FCellShapes.CHECKBOX:
592
+ return FCellTypes.CHECKBOX;
593
+ case FCellShapes.CHIP:
594
+ return FCellTypes.CHIP;
595
+ case FCellShapes.COLOR_PICKER:
596
+ return FCellTypes.COLOR_PICKER;
597
+ case FCellShapes.COMBOBOX:
598
+ return FCellTypes.COMBOBOX;
599
+ case FCellShapes.EDITOR:
600
+ return FCellTypes.EDITOR;
601
+ case FCellShapes.GAUGE:
602
+ return FCellTypes.GAUGE;
603
+ case FCellShapes.IMAGE:
604
+ return FCellTypes.IMAGE;
605
+ case FCellShapes.KNOB:
606
+ return FCellTypes.KNOB;
607
+ case FCellShapes.PROGRESS_BAR:
608
+ return FCellTypes.PROGRESS_BAR;
609
+ case FCellShapes.RADIO:
610
+ return FCellTypes.RADIO;
611
+ case FCellShapes.RATING:
612
+ return FCellTypes.RATING;
613
+ case FCellShapes.TEXT_FIELD:
614
+ return FCellTypes.STRING;
615
+ }
616
+ }
617
+ if (dom.ketchup.objects.isBar(obj)) {
618
+ return FCellTypes.BAR;
619
+ }
620
+ else if (dom.ketchup.objects.isButton(obj)) {
621
+ return FCellTypes.BUTTON;
622
+ }
623
+ else if (dom.ketchup.objects.isChart(obj)) {
624
+ return FCellTypes.CHART;
625
+ }
626
+ else if (dom.ketchup.objects.isCheckbox(obj)) {
627
+ return FCellTypes.CHECKBOX;
628
+ }
629
+ else if (dom.ketchup.objects.isColor(obj)) {
630
+ return FCellTypes.COLOR_PICKER;
631
+ }
632
+ else if (dom.ketchup.objects.isIcon(obj)) {
633
+ return FCellTypes.ICON;
634
+ }
635
+ else if (dom.ketchup.objects.isImage(obj)) {
636
+ return FCellTypes.IMAGE;
637
+ }
638
+ else if (dom.ketchup.objects.isLink(obj)) {
639
+ return FCellTypes.LINK;
640
+ }
641
+ else if (dom.ketchup.objects.isProgressBar(obj)) {
642
+ return FCellTypes.PROGRESS_BAR;
643
+ }
644
+ else if (dom.ketchup.objects.isRadio(obj)) {
645
+ return FCellTypes.RADIO;
646
+ }
647
+ else if (dom.ketchup.objects.isKupObjList(obj)) {
648
+ return FCellTypes.CHIP;
649
+ }
650
+ else if (dom.ketchup.objects.isNumber(obj)) {
651
+ return FCellTypes.NUMBER;
652
+ }
653
+ else if (dom.ketchup.objects.isDate(obj)) {
654
+ return FCellTypes.DATE;
655
+ }
656
+ else if (dom.ketchup.objects.isTimestamp(obj)) {
657
+ return FCellTypes.DATETIME;
658
+ }
659
+ else if (dom.ketchup.objects.isTime(obj)) {
660
+ return FCellTypes.TIME;
661
+ }
662
+ else if (dom.ketchup.objects.isVoCodver(obj)) {
663
+ return FCellTypes.ICON;
664
+ }
665
+ else {
666
+ return FCellTypes.STRING;
667
+ }
668
+ }
669
+ function cellEvent(e, props, cellType, cellEventName) {
670
+ const cell = props.cell;
671
+ const column = props.column;
672
+ const comp = props.component;
673
+ const row = props.row;
674
+ const isInputEvent = !!(e.target.tagName === 'INPUT');
675
+ let value = isInputEvent
676
+ ? e.target.value
677
+ : e.detail.value;
678
+ switch (cellType) {
679
+ case FCellTypes.AUTOCOMPLETE:
680
+ case FCellTypes.COMBOBOX:
681
+ case FCellTypes.DATE:
682
+ case FCellTypes.TIME:
683
+ if (cell.data) {
684
+ cell.data['initialValue'] = value;
685
+ }
686
+ break;
687
+ case FCellTypes.CHECKBOX:
688
+ value = value === 'on' ? '0' : '1';
689
+ if (cell.data) {
690
+ cell.data.checked =
691
+ value === '0' ? false : true;
692
+ }
693
+ break;
694
+ }
695
+ if (cell.obj) {
696
+ cell.obj.k = value;
697
+ }
698
+ cell.value = value;
699
+ cell.displayedValue = null;
700
+ cell.displayedValue = getCellValueForDisplay(column, cell);
701
+ if (comp && comp.rootElement) {
702
+ const updateEvent = new CustomEvent(cellEventName, {
703
+ bubbles: true,
704
+ cancelable: true,
705
+ detail: {
706
+ comp: comp,
707
+ id: comp.rootElement.id,
708
+ cell: cell,
709
+ column: column,
710
+ event: e,
711
+ row: row,
712
+ type: cellType,
713
+ },
714
+ });
715
+ comp.rootElement.dispatchEvent(updateEvent);
716
+ try {
717
+ comp.refresh();
718
+ }
719
+ catch (error) { }
720
+ }
721
+ }
722
+
723
+ export { FTextField as F, FCell as a, FCheckbox as b, FCellPadding as c };