@sme.up/ketchup 4.3.0-SNAPSHOT → 5.1.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 (343) hide show
  1. package/README.md +107 -3
  2. package/dist/cjs/{cell-utils-dc0884a3.js → cell-utils-9b1d6563.js} +4 -4
  3. package/dist/cjs/{component-8fbc31a2.js → component-d1496215.js} +203 -174
  4. package/dist/cjs/{f-button-2ba74fb5.js → f-button-02a7cde4.js} +2 -2
  5. package/dist/cjs/{f-cell-fe60a08d.js → f-cell-4d1450a8.js} +38 -28
  6. package/dist/cjs/f-chip-a50b9f00.js +130 -0
  7. package/dist/cjs/{f-image-d3bd4e08.js → f-image-db55ac49.js} +3 -3
  8. package/dist/cjs/{index-0416afab.js → index-ab119fad.js} +23 -0
  9. package/dist/cjs/ketchup.cjs.js +3 -3
  10. package/dist/cjs/kup-accordion.cjs.entry.js +7 -7
  11. package/dist/cjs/{kup-autocomplete_28.cjs.entry.js → kup-autocomplete_27.cjs.entry.js} +4636 -4073
  12. package/dist/cjs/kup-calendar.cjs.entry.js +626 -359
  13. package/dist/cjs/kup-cell.cjs.entry.js +15 -13
  14. package/dist/cjs/kup-dash-list.cjs.entry.js +4 -4
  15. package/dist/cjs/kup-dash_2.cjs.entry.js +8 -7
  16. package/dist/cjs/kup-drawer.cjs.entry.js +3 -3
  17. package/dist/cjs/kup-echart.cjs.entry.js +93039 -0
  18. package/dist/cjs/kup-field.cjs.entry.js +2 -2
  19. package/dist/cjs/kup-iframe.cjs.entry.js +3 -3
  20. package/dist/cjs/kup-lazy.cjs.entry.js +22 -5
  21. package/dist/cjs/kup-magic-box.cjs.entry.js +95 -42
  22. package/dist/cjs/{kup-manager-1a2688ca.js → kup-manager-5877b2ee.js} +3392 -753
  23. package/dist/cjs/kup-nav-bar.cjs.entry.js +3 -3
  24. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  25. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  26. package/dist/cjs/kup-snackbar.cjs.entry.js +5 -5
  27. package/dist/cjs/loader.cjs.js +3 -3
  28. package/dist/cjs/{tslib.es6-4360c099.js → tslib.es6-0ee02c67.js} +13 -0
  29. package/dist/cjs/utils-1b5c8c70.js +482 -0
  30. package/dist/collection/assets/calendar.js +46 -1
  31. package/dist/collection/assets/card.js +15 -15
  32. package/dist/collection/assets/data-table.js +18 -6
  33. package/dist/collection/assets/index.js +8 -0
  34. package/dist/collection/assets/kupdata.js +937 -0
  35. package/dist/collection/collection-manifest.json +4 -4
  36. package/dist/collection/components/kup-accordion/kup-accordion.css +0 -1
  37. package/dist/collection/components/kup-accordion/kup-accordion.js +2 -2
  38. package/dist/collection/components/kup-autocomplete/kup-autocomplete-declarations.js +2 -0
  39. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +148 -52
  40. package/dist/collection/components/kup-badge/kup-badge.js +2 -2
  41. package/dist/collection/components/kup-box/kup-box.js +31 -17
  42. package/dist/collection/components/kup-button/kup-button.js +2 -2
  43. package/dist/collection/components/kup-button-list/kup-button-list.js +26 -8
  44. package/dist/collection/components/kup-calendar/kup-calendar-declarations.js +14 -8
  45. package/dist/collection/components/kup-calendar/kup-calendar.css +2 -2
  46. package/dist/collection/components/kup-calendar/kup-calendar.js +185 -315
  47. package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +38 -0
  48. package/dist/collection/components/kup-card/{builtin → built-in}/kup-card-calendar.js +1 -1
  49. package/dist/collection/components/kup-card/{builtin → built-in}/kup-card-clock.js +32 -32
  50. package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +167 -0
  51. package/dist/collection/components/kup-card/collapsible/kup-card-collapsible.js +1 -1
  52. package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +2 -2
  53. package/dist/collection/components/kup-card/free/kup-card-free.js +11 -2
  54. package/dist/collection/components/kup-card/kup-card-declarations.js +14 -14
  55. package/dist/collection/components/kup-card/kup-card-helper.js +3 -3
  56. package/dist/collection/components/kup-card/kup-card.css +423 -137
  57. package/dist/collection/components/kup-card/kup-card.js +62 -11
  58. package/dist/collection/components/kup-card/scalable/kup-card-scalable.js +1 -1
  59. package/dist/collection/components/kup-card/standard/kup-card-standard.js +18 -5
  60. package/dist/collection/components/kup-cell/kup-cell.js +15 -13
  61. package/dist/collection/components/kup-chart/kup-chart-builder.js +3 -4
  62. package/dist/collection/components/kup-chart/kup-chart.js +7 -7
  63. package/dist/collection/components/kup-checkbox/kup-checkbox.js +1 -1
  64. package/dist/collection/components/kup-chip/kup-chip.css +1 -0
  65. package/dist/collection/components/kup-chip/kup-chip.js +51 -92
  66. package/dist/collection/components/kup-color-picker/kup-color-picker.css +1 -265
  67. package/dist/collection/components/kup-color-picker/kup-color-picker.js +93 -48
  68. package/dist/collection/components/kup-combobox/kup-combobox.js +148 -115
  69. package/dist/collection/components/kup-dash/kup-dash.js +1 -1
  70. package/dist/collection/components/kup-dash-list/kup-dash-list.js +5 -5
  71. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +3 -1
  72. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +28 -56
  73. package/dist/collection/components/kup-data-table/kup-data-table.css +4 -0
  74. package/dist/collection/components/kup-data-table/kup-data-table.js +345 -158
  75. package/dist/collection/components/kup-date-picker/kup-date-picker.js +8 -5
  76. package/dist/collection/components/kup-drawer/kup-drawer.js +1 -1
  77. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +2 -2
  78. package/dist/collection/components/kup-echart/assets/maps/africa.json +6116 -0
  79. package/dist/collection/components/kup-echart/assets/maps/america.json +5416 -0
  80. package/dist/collection/components/kup-echart/assets/maps/asia.json +6053 -0
  81. package/dist/collection/components/kup-echart/assets/maps/europe.json +5051 -0
  82. package/dist/collection/components/kup-echart/assets/maps/italy.json +3562 -0
  83. package/dist/collection/components/kup-echart/assets/maps/oceania.json +1069 -0
  84. package/dist/collection/components/kup-echart/assets/maps/world.json +23685 -0
  85. package/dist/collection/components/kup-echart/kup-echart-declarations.js +45 -0
  86. package/dist/collection/components/kup-echart/kup-echart.css +13 -0
  87. package/dist/collection/components/kup-echart/kup-echart.js +1165 -0
  88. package/dist/collection/components/kup-field/kup-field.js +2 -2
  89. package/dist/collection/components/kup-gauge/kup-gauge.js +3 -3
  90. package/dist/collection/components/kup-grid/kup-grid.css +2 -2
  91. package/dist/collection/components/kup-grid/kup-grid.js +6 -5
  92. package/dist/collection/components/kup-iframe/kup-iframe.js +2 -2
  93. package/dist/collection/components/kup-image/assets/svg/science.svg +1 -0
  94. package/dist/collection/components/kup-image/kup-image.js +3 -3
  95. package/dist/collection/components/kup-lazy/kup-lazy.css +21 -11
  96. package/dist/collection/components/kup-lazy/kup-lazy.js +62 -3
  97. package/dist/collection/components/kup-list/kup-list-helper.js +7 -1
  98. package/dist/collection/components/kup-list/kup-list.css +3 -0
  99. package/dist/collection/components/kup-list/kup-list.js +219 -288
  100. package/dist/collection/components/kup-magic-box/kup-magic-box-declarations.js +11 -7
  101. package/dist/collection/components/kup-magic-box/kup-magic-box.js +90 -41
  102. package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +1 -1
  103. package/dist/collection/components/kup-probe/kup-probe.js +1 -1
  104. package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +1 -1
  105. package/dist/collection/components/kup-qlik/kup-qlik.js +1 -1
  106. package/dist/collection/components/kup-radio/kup-radio.js +1 -1
  107. package/dist/collection/components/kup-rating/kup-rating.js +1 -1
  108. package/dist/collection/components/kup-snackbar/kup-snackbar.js +1 -1
  109. package/dist/collection/components/kup-spinner/kup-spinner.js +1 -1
  110. package/dist/collection/components/kup-state/mock-store.js +1 -1
  111. package/dist/collection/components/kup-switch/kup-switch.js +1 -1
  112. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +3 -3
  113. package/dist/collection/components/kup-text-field/kup-text-field.css +2 -0
  114. package/dist/collection/components/kup-text-field/kup-text-field.js +2 -2
  115. package/dist/collection/components/kup-time-picker/kup-time-picker.js +8 -5
  116. package/dist/collection/components/kup-tooltip/kup-tooltip.js +3 -3
  117. package/dist/collection/components/kup-tree/kup-tree-declarations.js +0 -5
  118. package/dist/collection/components/kup-tree/kup-tree-faker.js +2 -3
  119. package/dist/collection/components/kup-tree/kup-tree.css +2 -0
  120. package/dist/collection/components/kup-tree/kup-tree.js +145 -70
  121. package/dist/collection/f-components/f-cell/f-cell-declarations.js +3 -1
  122. package/dist/collection/f-components/f-cell/f-cell.js +29 -19
  123. package/dist/collection/f-components/f-chip/f-chip.js +76 -87
  124. package/dist/collection/f-components/f-image/f-image.js +2 -2
  125. package/dist/collection/f-components/f-paginator/f-paginator-declarations.js +5 -0
  126. package/dist/collection/f-components/f-paginator/f-paginator-utils.js +28 -0
  127. package/dist/collection/f-components/f-paginator/f-paginator.js +91 -0
  128. package/dist/collection/f-components/f-text-field/f-text-field.js +4 -4
  129. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +52 -0
  130. package/dist/collection/managers/kup-data/kup-data-column-helper.js +272 -0
  131. package/dist/collection/managers/kup-data/kup-data-declarations.js +9 -0
  132. package/dist/collection/managers/kup-data/kup-data-node-helper.js +72 -0
  133. package/dist/collection/managers/kup-data/kup-data-row-helper.js +28 -0
  134. package/dist/collection/managers/kup-data/kup-data.js +382 -0
  135. package/dist/collection/{utils → managers}/kup-dates/kup-dates-declarations.js +0 -0
  136. package/dist/collection/{utils → managers}/kup-dates/kup-dates.js +53 -19
  137. package/dist/collection/{utils → managers}/kup-debug/kup-debug-browser-utils.js +1 -1
  138. package/dist/collection/{utils → managers}/kup-debug/kup-debug-declarations.js +0 -0
  139. package/dist/collection/{utils → managers}/kup-debug/kup-debug.js +79 -124
  140. package/dist/collection/{utils → managers}/kup-dynamic-position/kup-dynamic-position-declarations.js +0 -0
  141. package/dist/collection/{utils → managers}/kup-dynamic-position/kup-dynamic-position.js +10 -1
  142. package/dist/collection/{utils → managers}/kup-interact/kup-interact-declarations.js +1 -0
  143. package/dist/collection/{utils → managers}/kup-interact/kup-interact.js +22 -13
  144. package/dist/collection/{utils → managers}/kup-language/kup-language-declarations.js +10 -0
  145. package/dist/collection/{utils → managers}/kup-language/kup-language.js +5 -5
  146. package/dist/collection/{utils → managers}/kup-manager/kup-manager-declarations.js +0 -0
  147. package/dist/collection/{utils → managers}/kup-manager/kup-manager.js +45 -4
  148. package/dist/collection/managers/kup-math/kup-math-declarations.js +13 -0
  149. package/dist/collection/managers/kup-math/kup-math-helper.js +39 -0
  150. package/dist/collection/managers/kup-math/kup-math.js +151 -0
  151. package/dist/collection/{utils → managers}/kup-objects/kup-objects-declarations.js +0 -0
  152. package/dist/collection/{utils → managers}/kup-objects/kup-objects.js +15 -0
  153. package/dist/collection/{utils → managers}/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +0 -0
  154. package/dist/collection/{utils → managers}/kup-scroll-on-hover/kup-scroll-on-hover.js +0 -0
  155. package/dist/collection/{utils → managers}/kup-search/kup-search-declarations.js +0 -0
  156. package/dist/collection/{utils → managers}/kup-search/kup-search.js +0 -0
  157. package/dist/collection/{utils → managers}/kup-theme/kup-theme-declarations.js +99 -0
  158. package/dist/collection/{utils → managers}/kup-theme/kup-theme.js +117 -68
  159. package/dist/collection/{utils → managers}/kup-toolbar/kup-toolbar-declarations.js +0 -0
  160. package/dist/collection/{utils → managers}/kup-toolbar/kup-toolbar.js +0 -0
  161. package/dist/collection/types/GenericTypes.js +48 -1
  162. package/dist/collection/utils/cell-utils.js +3 -4
  163. package/dist/collection/utils/filters/filters-column-menu.js +7 -7
  164. package/dist/collection/utils/filters/filters-rows.js +2 -2
  165. package/dist/collection/utils/filters/filters-tree-items.js +12 -12
  166. package/dist/collection/utils/filters/filters.js +3 -2
  167. package/dist/collection/utils/kup-column-menu/kup-column-menu-declarations.js +1 -0
  168. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +100 -68
  169. package/dist/collection/utils/utils.js +4 -4
  170. package/dist/esm/{cell-utils-8f512ea9.js → cell-utils-571978d6.js} +4 -4
  171. package/dist/esm/{component-d2803feb.js → component-c4eb6153.js} +204 -170
  172. package/dist/esm/{f-button-30dbcaa9.js → f-button-b3011cc2.js} +2 -2
  173. package/dist/esm/{f-cell-95c186c6.js → f-cell-b88b2731.js} +38 -28
  174. package/dist/esm/f-chip-a52489ec.js +128 -0
  175. package/dist/esm/{f-image-3bc8b24f.js → f-image-5e5ed7e2.js} +3 -3
  176. package/dist/esm/{index-e0e67c23.js → index-78f3699d.js} +23 -0
  177. package/dist/esm/ketchup.js +3 -3
  178. package/dist/esm/kup-accordion.entry.js +7 -7
  179. package/dist/esm/{kup-autocomplete_28.entry.js → kup-autocomplete_27.entry.js} +4420 -3856
  180. package/dist/esm/kup-calendar.entry.js +626 -359
  181. package/dist/esm/kup-cell.entry.js +15 -13
  182. package/dist/esm/kup-dash-list.entry.js +4 -4
  183. package/dist/esm/kup-dash_2.entry.js +8 -7
  184. package/dist/esm/kup-drawer.entry.js +3 -3
  185. package/dist/esm/kup-echart.entry.js +93035 -0
  186. package/dist/esm/kup-field.entry.js +2 -2
  187. package/dist/esm/kup-iframe.entry.js +3 -3
  188. package/dist/esm/kup-lazy.entry.js +22 -5
  189. package/dist/esm/kup-magic-box.entry.js +95 -42
  190. package/dist/esm/{kup-manager-7fc234da.js → kup-manager-1f76a3ef.js} +3388 -753
  191. package/dist/esm/kup-nav-bar.entry.js +3 -3
  192. package/dist/esm/kup-probe.entry.js +2 -2
  193. package/dist/esm/kup-qlik.entry.js +2 -2
  194. package/dist/esm/kup-snackbar.entry.js +5 -5
  195. package/dist/esm/loader.js +3 -3
  196. package/dist/esm/polyfills/css-shim.js +1 -1
  197. package/dist/esm/{tslib.es6-e6137777.js → tslib.es6-8f2d44b6.js} +13 -1
  198. package/dist/esm/utils-93ae800f.js +461 -0
  199. package/dist/ketchup/assets/maps/africa.json +6116 -0
  200. package/dist/ketchup/assets/maps/america.json +5416 -0
  201. package/dist/ketchup/assets/maps/asia.json +6053 -0
  202. package/dist/ketchup/assets/maps/europe.json +5051 -0
  203. package/dist/ketchup/assets/maps/italy.json +3562 -0
  204. package/dist/ketchup/assets/maps/oceania.json +1069 -0
  205. package/dist/ketchup/assets/maps/world.json +23685 -0
  206. package/dist/ketchup/assets/svg/science.svg +1 -0
  207. package/dist/ketchup/ketchup.esm.js +1 -1
  208. package/dist/ketchup/{p-a878016f.entry.js → p-088a886c.entry.js} +1 -1
  209. package/dist/ketchup/p-135cabdc.entry.js +1 -0
  210. package/dist/ketchup/{p-1c6178e4.entry.js → p-1c1e830f.entry.js} +1 -1
  211. package/dist/ketchup/{p-62816d0b.entry.js → p-29208220.entry.js} +1 -1
  212. package/dist/ketchup/{p-ca0ca27f.entry.js → p-2b9f2019.entry.js} +1 -1
  213. package/dist/ketchup/p-52d0582a.js +1 -0
  214. package/dist/ketchup/p-554bd5f0.entry.js +39 -0
  215. package/dist/ketchup/{p-de83f2f6.js → p-5f52e313.js} +1 -1
  216. package/dist/ketchup/{p-ccda584a.entry.js → p-65449480.entry.js} +1 -1
  217. package/dist/ketchup/p-79cf3874.entry.js +1 -0
  218. package/dist/ketchup/p-7a85cda4.js +1 -0
  219. package/dist/ketchup/p-84cce555.entry.js +27 -0
  220. package/dist/ketchup/p-8c44c3b9.js +135 -0
  221. package/dist/ketchup/{p-65adc15b.entry.js → p-9d49cdb2.entry.js} +1 -1
  222. package/dist/ketchup/{p-5a4a5fdc.js → p-a0b1d769.js} +1 -1
  223. package/dist/ketchup/{p-dbb6998b.entry.js → p-a2b6672e.entry.js} +1 -1
  224. package/dist/ketchup/{p-a378ba56.entry.js → p-a4be630b.entry.js} +1 -1
  225. package/dist/ketchup/p-c072b270.js +1 -0
  226. package/dist/ketchup/{p-1baf1205.entry.js → p-c648972c.entry.js} +1 -1
  227. package/dist/ketchup/{p-af4a6191.entry.js → p-d67d39c0.entry.js} +1 -1
  228. package/dist/ketchup/p-d6e2f2b0.entry.js +1 -0
  229. package/dist/ketchup/{p-44375e49.js → p-da387e0e.js} +1 -1
  230. package/dist/ketchup/p-e5c9ec9e.js +1 -0
  231. package/dist/ketchup/{p-cb5f4994.js → p-ed0b8666.js} +0 -0
  232. package/dist/ketchup/p-ef539eda.js +9 -0
  233. package/dist/ketchup/p-f316234c.entry.js +143 -0
  234. package/dist/types/components/kup-accordion/kup-accordion-declarations.d.ts +2 -2
  235. package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +6 -0
  236. package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +29 -22
  237. package/dist/types/components/kup-box/kup-box-declarations.d.ts +7 -11
  238. package/dist/types/components/kup-box/kup-box.d.ts +4 -4
  239. package/dist/types/components/kup-button-list/kup-button-list-declarations.d.ts +6 -1
  240. package/dist/types/components/kup-button-list/kup-button-list.d.ts +4 -3
  241. package/dist/types/components/kup-calendar/kup-calendar-declarations.d.ts +28 -10
  242. package/dist/types/components/kup-calendar/kup-calendar.d.ts +19 -47
  243. package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +27 -0
  244. package/dist/types/components/kup-card/{builtin → built-in}/kup-card-calendar.d.ts +0 -0
  245. package/dist/types/components/kup-card/{builtin → built-in}/kup-card-clock.d.ts +0 -0
  246. package/dist/types/components/kup-card/built-in/kup-card-column-drop-menu.d.ts +3 -0
  247. package/dist/types/components/kup-card/free/kup-card-free.d.ts +7 -1
  248. package/dist/types/components/kup-card/kup-card-declarations.d.ts +46 -21
  249. package/dist/types/components/kup-card/kup-card.d.ts +9 -2
  250. package/dist/types/components/kup-cell/kup-cell.d.ts +3 -3
  251. package/dist/types/components/kup-chart/kup-chart-builder.d.ts +5 -5
  252. package/dist/types/components/kup-chart/kup-chart-declarations.d.ts +3 -3
  253. package/dist/types/components/kup-chart/kup-chart.d.ts +2 -2
  254. package/dist/types/components/kup-chip/kup-chip-declarations.d.ts +6 -3
  255. package/dist/types/components/kup-chip/kup-chip.d.ts +9 -13
  256. package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +7 -3
  257. package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +4 -0
  258. package/dist/types/components/kup-combobox/kup-combobox.d.ts +11 -33
  259. package/dist/types/components/kup-dash-list/kup-dash-list.d.ts +2 -2
  260. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +45 -104
  261. package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +8 -11
  262. package/dist/types/components/kup-data-table/kup-data-table.d.ts +49 -27
  263. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +55 -0
  264. package/dist/types/components/kup-echart/kup-echart.d.ts +100 -0
  265. package/dist/types/components/kup-lazy/kup-lazy.d.ts +13 -1
  266. package/dist/types/components/kup-list/kup-list-declarations.d.ts +2 -1
  267. package/dist/types/components/kup-list/kup-list.d.ts +4 -35
  268. package/dist/types/components/kup-magic-box/kup-magic-box-declarations.d.ts +6 -10
  269. package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +7 -11
  270. package/dist/types/components/kup-tooltip/kup-tooltip-declarations.d.ts +11 -13
  271. package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +14 -35
  272. package/dist/types/components/kup-tree/kup-tree-faker.d.ts +10 -10
  273. package/dist/types/components/kup-tree/kup-tree.d.ts +45 -35
  274. package/dist/types/components.d.ts +305 -186
  275. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +11 -10
  276. package/dist/types/f-components/f-chip/f-chip-declarations.d.ts +7 -22
  277. package/dist/types/f-components/f-paginator/f-paginator-declarations.d.ts +22 -0
  278. package/dist/types/f-components/f-paginator/f-paginator-utils.d.ts +2 -0
  279. package/dist/types/f-components/f-paginator/f-paginator.d.ts +3 -0
  280. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +24 -0
  281. package/dist/types/managers/kup-data/kup-data-column-helper.d.ts +31 -0
  282. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +160 -0
  283. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +23 -0
  284. package/dist/types/managers/kup-data/kup-data-row-helper.d.ts +14 -0
  285. package/dist/types/managers/kup-data/kup-data.d.ts +77 -0
  286. package/dist/types/{utils → managers}/kup-dates/kup-dates-declarations.d.ts +0 -0
  287. package/dist/types/{utils → managers}/kup-dates/kup-dates.d.ts +24 -2
  288. package/dist/types/{utils → managers}/kup-debug/kup-debug-declarations.d.ts +0 -0
  289. package/dist/types/{utils → managers}/kup-debug/kup-debug.d.ts +6 -13
  290. package/dist/types/{utils → managers}/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +1 -0
  291. package/dist/types/{utils → managers}/kup-dynamic-position/kup-dynamic-position.d.ts +0 -0
  292. package/dist/types/{utils → managers}/kup-interact/kup-interact-declarations.d.ts +9 -8
  293. package/dist/types/{utils → managers}/kup-interact/kup-interact.d.ts +7 -6
  294. package/dist/types/{utils → managers}/kup-language/kup-language-declarations.d.ts +11 -1
  295. package/dist/types/{utils → managers}/kup-language/kup-language.d.ts +3 -3
  296. package/dist/types/{utils → managers}/kup-manager/kup-manager-declarations.d.ts +21 -2
  297. package/dist/types/{utils → managers}/kup-manager/kup-manager.d.ts +4 -0
  298. package/dist/types/managers/kup-math/kup-math-declarations.d.ts +21 -0
  299. package/dist/types/managers/kup-math/kup-math-helper.d.ts +17 -0
  300. package/dist/types/managers/kup-math/kup-math.d.ts +60 -0
  301. package/dist/types/{utils → managers}/kup-objects/kup-objects-declarations.d.ts +0 -0
  302. package/dist/types/{utils → managers}/kup-objects/kup-objects.d.ts +6 -0
  303. package/dist/types/{utils → managers}/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +0 -0
  304. package/dist/types/{utils → managers}/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +0 -0
  305. package/dist/types/{utils → managers}/kup-search/kup-search-declarations.d.ts +0 -0
  306. package/dist/types/{utils → managers}/kup-search/kup-search.d.ts +0 -0
  307. package/dist/types/{utils → managers}/kup-theme/kup-theme-declarations.d.ts +37 -1
  308. package/dist/types/{utils → managers}/kup-theme/kup-theme.d.ts +19 -19
  309. package/dist/types/{utils → managers}/kup-toolbar/kup-toolbar-declarations.d.ts +0 -0
  310. package/dist/types/{utils → managers}/kup-toolbar/kup-toolbar.d.ts +0 -0
  311. package/dist/types/stencil-public-runtime.d.ts +6 -4
  312. package/dist/types/types/GenericTypes.d.ts +53 -6
  313. package/dist/types/utils/cell-utils.d.ts +7 -6
  314. package/dist/types/utils/filters/filters-column-menu.d.ts +16 -16
  315. package/dist/types/utils/filters/filters-rows.d.ts +10 -10
  316. package/dist/types/utils/filters/filters-tree-items.d.ts +7 -7
  317. package/dist/types/utils/helpers.d.ts +2 -2
  318. package/dist/types/utils/kup-column-menu/kup-column-menu-declarations.d.ts +1 -0
  319. package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +27 -33
  320. package/dist/types/utils/utils.d.ts +4 -2
  321. package/package.json +31 -26
  322. package/dist/cjs/f-chip-90d95d22.js +0 -141
  323. package/dist/cjs/utils-0cc466b9.js +0 -1492
  324. package/dist/collection/components/kup-card/builtin/kup-card-builtin.js +0 -20
  325. package/dist/collection/components/kup-paginator/kup-paginator-declarations.js +0 -5
  326. package/dist/collection/components/kup-paginator/kup-paginator.css +0 -46
  327. package/dist/collection/components/kup-paginator/kup-paginator.js +0 -408
  328. package/dist/esm/f-chip-c0e9c0ff.js +0 -139
  329. package/dist/esm/utils-6c73709d.js +0 -1470
  330. package/dist/ketchup/p-15321eae.js +0 -1
  331. package/dist/ketchup/p-5a5f2a53.js +0 -1
  332. package/dist/ketchup/p-61faaa38.js +0 -8
  333. package/dist/ketchup/p-7e23ea7c.entry.js +0 -1
  334. package/dist/ketchup/p-9d02a676.js +0 -134
  335. package/dist/ketchup/p-a96e6e32.entry.js +0 -1
  336. package/dist/ketchup/p-ad32821e.entry.js +0 -1
  337. package/dist/ketchup/p-c18c7bb0.entry.js +0 -27
  338. package/dist/ketchup/p-d4aa4922.js +0 -1
  339. package/dist/ketchup/p-ec3a3db9.js +0 -1
  340. package/dist/ketchup/p-ecccb3a4.entry.js +0 -45
  341. package/dist/types/components/kup-card/builtin/kup-card-builtin.d.ts +0 -14
  342. package/dist/types/components/kup-paginator/kup-paginator-declarations.d.ts +0 -11
  343. package/dist/types/components/kup-paginator/kup-paginator.d.ts +0 -48
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
12
  var _KupDebug_debugWidget;
13
- import { KupCardFamily } from '../../components/kup-card/kup-card-declarations';
13
+ import { KupCardFamily, } from '../../components/kup-card/kup-card-declarations';
14
14
  import { KupLanguageDebug } from '../kup-language/kup-language-declarations';
15
15
  import { KupDebugCategory, KupDebugLogColor, } from './kup-debug-declarations';
16
16
  const dom = document.documentElement;
@@ -221,12 +221,83 @@ export class KupDebug {
221
221
  debugWidget.id = 'kup-debug-widget';
222
222
  debugWidget.layoutFamily = KupCardFamily.DIALOG;
223
223
  debugWidget.layoutNumber = 3;
224
- debugWidget.sizeX = 'auto';
224
+ debugWidget.sizeX = 'max-content';
225
225
  debugWidget.sizeY = 'auto';
226
- debugWidget.addEventListener('kup-card-event', (e) => this.handleEvents(e));
226
+ const handler = this.handleEvents;
227
+ debugWidget.addEventListener('kup-card-event', (e) => handler(e, this));
227
228
  this.container.append(debugWidget);
228
229
  __classPrivateFieldSet(this, _KupDebug_debugWidget, debugWidget, "f");
229
230
  }
231
+ /**
232
+ * Listens the card events and handles the related actions.
233
+ * @param {CustomEvent<KupCardEventPayload>} e - kup-card-event.
234
+ * @param {KupDebug} kupDebug - Instance of the KupDebug class.
235
+ */
236
+ handleEvents(e, kupDebug) {
237
+ const compEvent = e.detail.event;
238
+ const compID = compEvent.detail.id;
239
+ switch (compEvent.type) {
240
+ case 'kup-button-click':
241
+ switch (compID) {
242
+ case 'kup-debug-autoprint':
243
+ kupDebug.autoPrint = !kupDebug.autoPrint;
244
+ break;
245
+ case 'kup-debug-clear':
246
+ kupDebug.widgetClear();
247
+ __classPrivateFieldGet(kupDebug, _KupDebug_debugWidget, "f").refresh();
248
+ break;
249
+ case 'kup-debug-dl-props':
250
+ kupDebug.getProps().then((res) => {
251
+ kupDebug.downloadProps(res);
252
+ });
253
+ break;
254
+ case 'kup-debug-dl-all':
255
+ kupDebug.getProps(true).then((res) => {
256
+ kupDebug.downloadProps(res);
257
+ });
258
+ break;
259
+ case 'kup-debug-delete':
260
+ kupDebug.dump();
261
+ break;
262
+ case 'kup-debug-magic-box':
263
+ dom.ketchup.toggleMagicBox();
264
+ break;
265
+ case 'kup-debug-off':
266
+ kupDebug.toggle();
267
+ break;
268
+ case 'kup-debug-print':
269
+ kupDebug.widgetClear();
270
+ kupDebug.widgetPrint();
271
+ __classPrivateFieldGet(kupDebug, _KupDebug_debugWidget, "f").refresh();
272
+ break;
273
+ }
274
+ break;
275
+ case 'kup-combobox-itemclick':
276
+ switch (compID) {
277
+ case 'kup-debug-language-changer':
278
+ dom.ketchup.language.set(compEvent.detail.value);
279
+ break;
280
+ case 'kup-debug-locale-changer':
281
+ dom.ketchup.dates.setLocale(compEvent.detail.value);
282
+ break;
283
+ case 'kup-debug-theme-changer':
284
+ dom.ketchup.theme.set(compEvent.detail.value);
285
+ break;
286
+ }
287
+ case 'kup-textfield-input':
288
+ switch (compID) {
289
+ case 'kup-debug-log-limit':
290
+ if (compEvent.detail.value === '' ||
291
+ compEvent.detail.value < 1) {
292
+ kupDebug.logLimit = 1;
293
+ }
294
+ else {
295
+ kupDebug.logLimit = compEvent.detail.value;
296
+ }
297
+ break;
298
+ }
299
+ }
300
+ }
230
301
  /**
231
302
  * Closes the debug widget.
232
303
  */
@@ -330,7 +401,7 @@ export class KupDebug {
330
401
  printLog[type] = [];
331
402
  }
332
403
  printLog[type].push({
333
- date: this.formatDate(this.logs[index].date),
404
+ date: dom.ketchup.dates.format(this.logs[index].date, 'LLL:ms'),
334
405
  element: isComponent
335
406
  ? this.logs[index].element
336
407
  : this.logs[index].id,
@@ -388,78 +459,8 @@ export class KupDebug {
388
459
  }
389
460
  }
390
461
  }
391
- /**
392
- * Listens the card events and handles the related actions.
393
- * @param {CustomEvent} e - kup-card-event.
394
- */
395
- handleEvents(e) {
396
- const compEvent = e.detail.event;
397
- const compID = compEvent.detail.id;
398
- switch (compEvent.type) {
399
- case 'kup-button-click':
400
- switch (compID) {
401
- case 'kup-debug-autoprint':
402
- this.autoPrint = !this.autoPrint;
403
- break;
404
- case 'kup-debug-clear':
405
- this.widgetClear();
406
- __classPrivateFieldGet(this, _KupDebug_debugWidget, "f").refresh();
407
- break;
408
- case 'kup-debug-dl-props':
409
- this.getProps().then((res) => {
410
- this.downloadProps(res);
411
- });
412
- break;
413
- case 'kup-debug-dl-all':
414
- this.getProps(true).then((res) => {
415
- this.downloadProps(res);
416
- });
417
- break;
418
- case 'kup-debug-delete':
419
- this.dump();
420
- break;
421
- case 'kup-debug-magic-box':
422
- dom.ketchup.toggleMagicBox();
423
- break;
424
- case 'kup-debug-off':
425
- this.toggle();
426
- break;
427
- case 'kup-debug-print':
428
- this.widgetClear();
429
- this.widgetPrint();
430
- __classPrivateFieldGet(this, _KupDebug_debugWidget, "f").refresh();
431
- break;
432
- }
433
- break;
434
- case 'kup-combobox-itemclick':
435
- switch (compID) {
436
- case 'kup-debug-language-changer':
437
- dom.ketchup.language.set(compEvent.detail.value);
438
- break;
439
- case 'kup-debug-locale-changer':
440
- dom.ketchup.dates.setLocale(compEvent.detail.value);
441
- break;
442
- case 'kup-debug-theme-changer':
443
- dom.ketchup.theme.set(compEvent.detail.value);
444
- break;
445
- }
446
- case 'kup-textfield-input':
447
- switch (compID) {
448
- case 'kup-debug-log-limit':
449
- if (compEvent.detail.value === '' ||
450
- compEvent.detail.value < 1) {
451
- this.logLimit = 1;
452
- }
453
- else {
454
- this.logLimit = compEvent.detail.value;
455
- }
456
- break;
457
- }
458
- }
459
- }
460
462
  /**
461
463
  * Function used to check whether the debug is active or not.
462
- * If kupDebug on documentElement's type is not a boolean, it will be set to false.
463
464
  * @returns {boolean} Status of the debug.
464
465
  */
465
466
  isDebug() {
@@ -580,7 +581,7 @@ export class KupDebug {
580
581
  message: message,
581
582
  };
582
583
  if (this.logs.length > this.logLimit) {
583
- console.warn(this.formatDate(date) +
584
+ console.warn(dom.ketchup.dates.format(date, 'LLL:ms') +
584
585
  ' kup-debug => ' +
585
586
  'Too many logs (> ' +
586
587
  this.logLimit +
@@ -596,63 +597,17 @@ export class KupDebug {
596
597
  }
597
598
  switch (category) {
598
599
  case KupDebugCategory.ERROR:
599
- console.error(this.formatDate(date) + id + message, obj);
600
- window.dispatchEvent(new CustomEvent('kupError', {
600
+ console.error(dom.ketchup.dates.format(date, 'LLL:ms') + id + message, obj);
601
+ window.dispatchEvent(new CustomEvent('kup-debug-error', {
601
602
  bubbles: true,
602
603
  detail: { comp, date, message },
603
604
  }));
604
605
  break;
605
606
  case KupDebugCategory.WARNING:
606
- console.warn(this.formatDate(date) + id + message, obj);
607
+ console.warn(dom.ketchup.dates.format(date, 'LLL:ms') + id + message, obj);
607
608
  break;
608
609
  }
609
610
  }
610
- /**
611
- * Function used to format a date.
612
- * Example: "Sun Mar 14 2021 13:50:56,329pm"
613
- * @param {Date} date - Date to be formatted.
614
- * @returns {string} Formatted
615
- */
616
- formatDate(date) {
617
- let minutes = date.getMinutes().toString().length == 1
618
- ? '0' + date.getMinutes()
619
- : date.getMinutes(), hours = date.getHours().toString().length == 1
620
- ? '0' + date.getHours()
621
- : date.getHours(), seconds = date.getSeconds().toString().length == 1
622
- ? '0' + date.getSeconds()
623
- : date.getSeconds(), milliseconds = date.getMilliseconds().toString().length == 1
624
- ? '0' + date.getMilliseconds()
625
- : date.getMilliseconds(), ampm = date.getHours() >= 12 ? 'pm' : 'am', months = [
626
- 'Jan',
627
- 'Feb',
628
- 'Mar',
629
- 'Apr',
630
- 'May',
631
- 'Jun',
632
- 'Jul',
633
- 'Aug',
634
- 'Sep',
635
- 'Oct',
636
- 'Nov',
637
- 'Dec',
638
- ], days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
639
- return (days[date.getDay()] +
640
- ' ' +
641
- months[date.getMonth()] +
642
- ' ' +
643
- date.getDate() +
644
- ' ' +
645
- date.getFullYear() +
646
- ' ' +
647
- hours +
648
- ':' +
649
- minutes +
650
- ':' +
651
- seconds +
652
- ',' +
653
- milliseconds +
654
- ampm);
655
- }
656
611
  /**
657
612
  * Function used to time the loading times of a component.
658
613
  * @param {any} comp - The component calling this function or a string.
@@ -40,17 +40,26 @@ export class KupDynamicPosition {
40
40
  if (this.anchorIsHTMLElement(anchorEl)) {
41
41
  anchorEl.setAttribute(kupDynamicPositionAnchorAttribute, '');
42
42
  }
43
+ el.style.zIndex = `calc(var(--kup-navbar-zindex) - 1)`;
44
+ const originalPath = [];
43
45
  if (detach) {
46
+ let currentEl = el;
47
+ while (currentEl && currentEl !== document.body) {
48
+ currentEl = currentEl.parentNode
49
+ ? currentEl.parentNode
50
+ : currentEl.host;
51
+ originalPath.push(currentEl);
52
+ }
44
53
  el.style.position = 'absolute';
45
54
  this.container.appendChild(el);
46
55
  }
47
56
  else {
48
57
  el.style.position = 'fixed';
49
58
  }
50
- el.style.zIndex = `calc(var(--kup-navbar-zindex) - 1)`;
51
59
  el.kupDynamicPosition = {
52
60
  anchor: anchorEl,
53
61
  detach: detach ? true : false,
62
+ originalPath: originalPath,
54
63
  margin: margin ? margin : 0,
55
64
  placement: placement ? placement : KupDynamicPositionPlacement.AUTO,
56
65
  rAF: null,
@@ -44,5 +44,6 @@ export var KupDropEventTypes;
44
44
  (function (KupDropEventTypes) {
45
45
  KupDropEventTypes["BOX"] = "text/kup-box-drag";
46
46
  KupDropEventTypes["DATATABLE"] = "text/kup-data-table-row-drag";
47
+ KupDropEventTypes["GENERIC"] = "text/generic";
47
48
  KupDropEventTypes["MAGICBOX"] = "text/kup-magic-box-drag";
48
49
  })(KupDropEventTypes || (KupDropEventTypes = {}));
@@ -35,7 +35,7 @@ export class KupInteract {
35
35
  if (!options) {
36
36
  options = {};
37
37
  }
38
- if (!effect) {
38
+ if (effect === undefined || effect === null) {
39
39
  effect = KupDragEffect.MOVE;
40
40
  }
41
41
  options.listeners = {
@@ -111,10 +111,12 @@ export class KupInteract {
111
111
  ghostImage.style.height = draggable.clientHeight + 'px';
112
112
  ghostImage.style.left =
113
113
  e.clientX - draggable.clientWidth / 2 + 'px';
114
+ ghostImage.style.margin = '0';
114
115
  ghostImage.style.opacity = '0.75';
115
116
  ghostImage.style.position = 'fixed';
116
117
  ghostImage.style.top =
117
118
  e.clientY - draggable.clientHeight / 2 + 'px';
119
+ ghostImage.style.transform = '';
118
120
  ghostImage.style.width = draggable.clientWidth + 'px';
119
121
  ghostImage.style.zIndex =
120
122
  'calc(var(--kup-navbar-zindex) + 1)';
@@ -225,7 +227,6 @@ export class KupInteract {
225
227
  },
226
228
  },
227
229
  });
228
- e.currentTarget.removeAttribute(kupDragOverAttr);
229
230
  eventData.dispatcher.dispatchEvent(ketchupDropEvent);
230
231
  }
231
232
  e.currentTarget.removeAttribute(kupDragOverAttr);
@@ -252,24 +253,32 @@ export class KupInteract {
252
253
  * @param {Partial<ResizableOptions>} options - Options of the resize action.
253
254
  * @param {KupResizeCallbacks} callbacks - Additional callbacks to invoke.
254
255
  * @param {boolean} moveOnResize - When true, the element will be moved when resizing in order to keep its position.
256
+ * @param {boolean} autoResize - When true, the element will be automatically resized (usually the behavior is specified in a callback).
255
257
  * @see https://interactjs.io/docs/action-options/ For more options
256
258
  */
257
- resizable(el, options, callbacks, moveOnResize) {
258
- if (!options) {
259
- options = {};
259
+ resizable(el, options, callbacks, moveOnResize, autoResize) {
260
+ if (!options || !options.edges) {
261
+ options = Object.assign(Object.assign({}, options), { edges: {
262
+ left: true,
263
+ right: true,
264
+ bottom: true,
265
+ top: true,
266
+ } });
260
267
  }
261
268
  options.listeners = {
262
269
  move(e) {
263
270
  if (callbacks && callbacks.move) {
264
271
  callbacks.move(e);
265
272
  }
273
+ if (autoResize) {
274
+ el.style.width = e.rect.width + 'px';
275
+ el.style.height = e.rect.height + 'px';
276
+ }
266
277
  if (moveOnResize) {
267
278
  const el = e.target;
268
279
  const oldTransform = e.target.style.transform;
269
280
  let x = parseFloat(el.getAttribute('data-x')) || 0;
270
281
  let y = parseFloat(el.getAttribute('data-y')) || 0;
271
- el.style.width = e.rect.width + 'px';
272
- el.style.height = e.rect.height + 'px';
273
282
  x += e.deltaRect.left;
274
283
  y += e.deltaRect.top;
275
284
  el.style.transform = 'translate(' + x + 'px,' + y + 'px)';
@@ -286,7 +295,7 @@ export class KupInteract {
286
295
  /**
287
296
  * Adds a new interact.js event listener to the given argument.
288
297
  * @param {HTMLElement} el - The element on which the event listener will be added.
289
- * @param {KupPointerEventTypes} event - Supported events.
298
+ * @param {KupPointerEventTypes} event - Name of the event.
290
299
  * @param {KupResizeCallbacks} callback - Callback to invoke when the event fires.
291
300
  */
292
301
  on(el, event, callback) {
@@ -313,7 +322,7 @@ export class KupInteract {
313
322
  return true;
314
323
  }
315
324
  /**
316
- * This method treats the given element as a dialog, by activating moving-on-drag and, optionally, its resize.
325
+ * This method gives the element dialog-like features, by activating moving on drag and, optionally, the resize.
317
326
  * @param {HTMLElement} el - Dialog element.
318
327
  * @param {HTMLElement} handleEl - Element that must be dragged in order to trigger movement. When not provided, dragging anywhere on "el" will move it.
319
328
  * @param {boolean} unresizable - When true, the dialog can't be resized.
@@ -353,12 +362,12 @@ export class KupInteract {
353
362
  min: { width: 100, height: 100 },
354
363
  }),
355
364
  ],
356
- }, null, true);
365
+ }, null, true, true);
357
366
  }
358
367
  }
359
368
  /**
360
- * Removes the elements from the MoveOnDrag class watchlist.
361
- * @param {HTMLElement[]} elements - Elements to remove.
369
+ * Removes all event listeners from the elements in the array.
370
+ * @param {HTMLElement[]} elements - Elements to handle.
362
371
  */
363
372
  unregister(elements) {
364
373
  if (this.managedElements) {
@@ -369,7 +378,7 @@ export class KupInteract {
369
378
  }
370
379
  }
371
380
  /**
372
- * Returns whether an element was previously registered or not.
381
+ * Checks whether an element is currently registered or not.
373
382
  * @param {HTMLElement} el - Element to test.
374
383
  * @returns {boolean} True if the element was registered.
375
384
  */
@@ -30,6 +30,11 @@ export var KupLanguageColumn;
30
30
  KupLanguageColumn["ADD_DESCRIPTION"] = "columnAddDescription";
31
31
  KupLanguageColumn["COLUMNS"] = "columnColumns";
32
32
  KupLanguageColumn["HIDE"] = "columnHide";
33
+ KupLanguageColumn["MERGE"] = "columnMerge";
34
+ KupLanguageColumn["NO_FORMULA"] = "columnNoFormula";
35
+ KupLanguageColumn["NON_NUMERICAL"] = "columnNonNumerical";
36
+ KupLanguageColumn["NON_NUMERICAL_IN_TABLE"] = "columnNonNumericalInTable";
37
+ KupLanguageColumn["SWAP"] = "columnSwap";
33
38
  })(KupLanguageColumn || (KupLanguageColumn = {}));
34
39
  /**
35
40
  * Debug widget decodes.
@@ -93,8 +98,10 @@ export var KupLanguageGeneric;
93
98
  KupLanguageGeneric["LAYOUT_NYI"] = "genericLayoutNotYetImplemented";
94
99
  KupLanguageGeneric["LIST"] = "genericList";
95
100
  KupLanguageGeneric["LOAD_MORE"] = "genericLoadMoreData";
101
+ KupLanguageGeneric["MERGE"] = "genericMerge";
96
102
  KupLanguageGeneric["MENU"] = "genericMenu";
97
103
  KupLanguageGeneric["MONTH"] = "genericMonth";
104
+ KupLanguageGeneric["MOVE"] = "genericMove";
98
105
  KupLanguageGeneric["NEXT"] = "genericNext";
99
106
  KupLanguageGeneric["OPEN_NAVIGATION_MENU"] = "genericOpenNavigationMenu";
100
107
  KupLanguageGeneric["OPEN_IN_NEW_TAB"] = "genericOpenInNewTab";
@@ -106,6 +113,7 @@ export var KupLanguageGeneric;
106
113
  KupLanguageGeneric["SHOW_ROW_OPTIONS"] = "genericShowRowOptions";
107
114
  KupLanguageGeneric["SHOW_TOOLTIP_INFO"] = "genericShowTooltipInfo";
108
115
  KupLanguageGeneric["SORT_BY"] = "genericSortBy";
116
+ KupLanguageGeneric["SWAP"] = "genericSwap";
109
117
  KupLanguageGeneric["TOGGLE"] = "genericToggle";
110
118
  KupLanguageGeneric["TODAY"] = "genericToday";
111
119
  KupLanguageGeneric["TOTALS_TABLE"] = "genericTotalsTable";
@@ -174,9 +182,11 @@ export var KupLanguageTotals;
174
182
  KupLanguageTotals["CALCULATE"] = "totalsCalculate";
175
183
  KupLanguageTotals["CANCEL"] = "totalsCancel";
176
184
  KupLanguageTotals["COUNT"] = "totalsCount";
185
+ KupLanguageTotals["DIFFERENCE"] = "totalsDifference";
177
186
  KupLanguageTotals["DISTINCT"] = "totalsDistinct";
178
187
  KupLanguageTotals["FORMULA"] = "totalsFormula";
179
188
  KupLanguageTotals["MAXIMUM"] = "totalsMaximum";
180
189
  KupLanguageTotals["MINIMUM"] = "totalsMinimum";
190
+ KupLanguageTotals["PRODUCT"] = "totalsProduct";
181
191
  KupLanguageTotals["SUM"] = "totalsSum";
182
192
  })(KupLanguageTotals || (KupLanguageTotals = {}));
@@ -106,8 +106,8 @@ export class KupLanguage {
106
106
  };
107
107
  const separator = language.indexOf('_');
108
108
  if (separator > -1) {
109
- result.variant = language.substr(separator + 1);
110
- result.language = language.substr(0, separator);
109
+ result.variant = language.substring(separator + 1);
110
+ result.language = language.substring(0, separator);
111
111
  }
112
112
  else {
113
113
  result.language = language;
@@ -115,7 +115,7 @@ export class KupLanguage {
115
115
  return result;
116
116
  }
117
117
  /**
118
- * Gets the name of available languages.
118
+ * Gets the name of available languages and variants.
119
119
  * @returns {Array<string>} Array of languages' names.
120
120
  */
121
121
  getLanguages() {
@@ -132,14 +132,14 @@ export class KupLanguage {
132
132
  return languages;
133
133
  }
134
134
  /**
135
- * Registers a KupComponent in KupLanguage, in order to be properly handled whenever the language changes.
135
+ * Registers a KupComponent in KupLanguage, in order to be automatically refreshed whenever the language changes.
136
136
  * @param {any} component - The component calling this function.
137
137
  */
138
138
  register(component) {
139
139
  this.managedComponents.add(component.rootElement);
140
140
  }
141
141
  /**
142
- * Unregisters a KupComponent, so it won't be handled when the theme changes.
142
+ * Unregisters a KupComponent, so it won't be refreshed when the language changes.
143
143
  *
144
144
  * @param {any} component - The component calling this function.
145
145
  */
@@ -8,10 +8,13 @@ import { KupTheme } from '../kup-theme/kup-theme';
8
8
  import { KupToolbar } from '../kup-toolbar/kup-toolbar';
9
9
  import { ResizeObserver } from 'resize-observer';
10
10
  import { KupLanguageDefaults, } from '../kup-language/kup-language-declarations';
11
+ import { KupData } from '../kup-data/kup-data';
11
12
  import { KupDates } from '../kup-dates/kup-dates';
12
13
  import { KupDatesLocales } from '../kup-dates/kup-dates-declarations';
13
14
  import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
14
15
  import { KupSearch } from '../kup-search/kup-search';
16
+ import { KupMathLocales } from '../kup-math/kup-math-declarations';
17
+ import { KupMath } from '../kup-math/kup-math';
15
18
  const dom = document.documentElement;
16
19
  /**
17
20
  * This class controls every other Ketchup utility suite.
@@ -65,12 +68,14 @@ export class KupManager {
65
68
  themeName = theme.name ? theme.name : null;
66
69
  }
67
70
  }
71
+ this.data = new KupData();
68
72
  this.dates = new KupDates(datesLocale);
69
73
  this.debug = new KupDebug(debugActive, debugAutoprint, debugLogLimit);
70
74
  this.dynamicPosition = new KupDynamicPosition();
71
75
  this.interact = new KupInteract(dialogZIndex, dialogRestrictContainer);
72
76
  this.language = new KupLanguage(languageList, languageName);
73
77
  this.magicBox = null;
78
+ this.math = new KupMath();
74
79
  this.overrides = overrides ? overrides : null;
75
80
  this.objects = new KupObjects(objectsList);
76
81
  this.resize = new ResizeObserver((entries) => {
@@ -102,10 +107,14 @@ export class KupManager {
102
107
  const lastString = paths[0].innerText || paths[0].value;
103
108
  this.utilities.lastPointerDownString = lastString;
104
109
  if (lastString) {
105
- document.dispatchEvent(new CustomEvent('kup-manager-stringfinder', {
110
+ const e = new CustomEvent('kup-manager-stringfinder', {
106
111
  bubbles: true,
107
- detail: { string: lastString },
108
- }));
112
+ cancelable: true,
113
+ detail: {
114
+ string: lastString,
115
+ },
116
+ });
117
+ document.dispatchEvent(e);
109
118
  }
110
119
  });
111
120
  document.addEventListener('click', (e) => {
@@ -115,7 +124,29 @@ export class KupManager {
115
124
  obj.el &&
116
125
  obj.el.isConnected &&
117
126
  !paths.includes(obj.el)) {
118
- obj.cb();
127
+ const elAsDynamicPos = obj.el;
128
+ let found = false;
129
+ if (elAsDynamicPos.kupDynamicPosition &&
130
+ elAsDynamicPos.kupDynamicPosition.detach) {
131
+ for (let index = 0; index < paths.length; index++) {
132
+ const pathEl = paths[index];
133
+ const pathElAsDynamicPos = pathEl;
134
+ if (pathElAsDynamicPos.kupDynamicPosition &&
135
+ pathElAsDynamicPos.kupDynamicPosition.detach) {
136
+ const originalPath = pathElAsDynamicPos.kupDynamicPosition
137
+ .originalPath;
138
+ if (originalPath.includes(obj.el)) {
139
+ found = true;
140
+ }
141
+ }
142
+ }
143
+ if (!found) {
144
+ obj.cb();
145
+ }
146
+ }
147
+ else {
148
+ obj.cb();
149
+ }
119
150
  }
120
151
  });
121
152
  });
@@ -170,6 +201,7 @@ export class KupManager {
170
201
  }
171
202
  this.dates.setLocale(locale);
172
203
  this.language.set(KupLanguageDefaults[locale]);
204
+ this.math.setLocale(KupMathLocales[locale]);
173
205
  }
174
206
  /**
175
207
  * Adds a new click callback.
@@ -209,6 +241,15 @@ export function kupManagerInstance() {
209
241
  dom.ketchup.debug.toggle(dom.ketchup.debug.active);
210
242
  }
211
243
  globalThis.kupManager = dom.ketchup;
244
+ if (overrides && overrides.autoSetLocalization) {
245
+ const locale = dom.ketchup.dates.locale;
246
+ if (!overrides.language || !overrides.language.name) {
247
+ dom.ketchup.language.set(KupLanguageDefaults[locale]);
248
+ }
249
+ if (!overrides.math || !overrides.math.locale) {
250
+ dom.ketchup.math.setLocale(KupMathLocales[locale]);
251
+ }
252
+ }
212
253
  document.dispatchEvent(new CustomEvent('kup-manager-ready'));
213
254
  }
214
255
  return dom.ketchup;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Locales available for KupMath.
3
+ */
4
+ export var KupMathLocales;
5
+ (function (KupMathLocales) {
6
+ KupMathLocales["cn"] = "chs";
7
+ KupMathLocales["en"] = "en";
8
+ KupMathLocales["es"] = "es";
9
+ KupMathLocales["it"] = "it";
10
+ KupMathLocales["fr"] = "fr";
11
+ KupMathLocales["pl"] = "pl";
12
+ KupMathLocales["ru"] = "ru";
13
+ })(KupMathLocales || (KupMathLocales = {}));
@@ -0,0 +1,39 @@
1
+ import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
2
+ const dom = document.documentElement;
3
+ /**
4
+ * Takes a mathematical formula as string in input, with column names between brackets, and returns the result as a number.
5
+ * @param {string} formula - Mathematical operation (i.e.: ([COL1] - [COL2]) * 100 / [COL3]).
6
+ * @param {{ [index: string]: number }} row - Object containing column names as indexes and the related values as keys.
7
+ * @returns {number} Result of the formula.
8
+ */
9
+ export function customFormula(formula, row) {
10
+ const keys = Object.keys(row);
11
+ for (let i = 0; i < keys.length; i++) {
12
+ let key = keys[i];
13
+ let value = row[key];
14
+ if (value != null && !isNaN(value)) {
15
+ let re = new RegExp(key, 'g');
16
+ formula = formula.replace(re, value.toString());
17
+ }
18
+ }
19
+ formula = formula.replace(/[\[\]']+/g, '');
20
+ try {
21
+ const result = Function('"use strict"; return (' + formula + ')')();
22
+ return result;
23
+ }
24
+ catch (e) {
25
+ dom.ketchup.debug.logMessage('kup-data', 'Error while evaluating the following formula!(' + formula + ')', KupDebugCategory.ERROR);
26
+ return NaN;
27
+ }
28
+ }
29
+ /**
30
+ * Calculates a single Y point of a normal distribution.
31
+ * @param {number} average - Average.
32
+ * @param {number} variance - Variance.
33
+ * @param {number} x - X coordinate.
34
+ * @returns {number} Result.
35
+ */
36
+ export function normalDistributionFormula(average, variance, x) {
37
+ return ((1 / Math.sqrt(variance * 2 * Math.PI)) *
38
+ Math.exp(-Math.pow(x - average, 2) / (2 * variance)));
39
+ }