@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
@@ -0,0 +1,382 @@
1
+ import { KupDataNewColumnTypes, } from './kup-data-declarations';
2
+ import { findCell, getCellValue, replaceCell } from './kup-data-cell-helper';
3
+ import { findColumns, hideColumns, newColumn } from './kup-data-column-helper';
4
+ import { findRow, toNode } from './kup-data-row-helper';
5
+ import { removeNode, setPropertiesNode, toStreamNode, } from './kup-data-node-helper';
6
+ import { fieldColumn } from '../../components/kup-data-table/kup-data-table-declarations';
7
+ import { KupDebugCategory } from '../kup-debug/kup-debug-declarations';
8
+ const dom = document.documentElement;
9
+ /**
10
+ * Handles data operations.
11
+ * @module KupData
12
+ */
13
+ export class KupData {
14
+ constructor() {
15
+ this.cell = {
16
+ find(dataset, filters) {
17
+ return findCell(dataset, filters);
18
+ },
19
+ getValue(dataset, columns) {
20
+ return getCellValue(dataset, columns);
21
+ },
22
+ replace(dataset, cell, columns) {
23
+ return replaceCell(dataset, cell, columns);
24
+ },
25
+ };
26
+ this.column = {
27
+ find(dataset, filters) {
28
+ return findColumns(dataset, filters);
29
+ },
30
+ hide(dataset, columns2hide) {
31
+ return hideColumns(dataset, columns2hide);
32
+ },
33
+ new(dataset, type, options) {
34
+ return newColumn(dataset, type, options);
35
+ },
36
+ };
37
+ this.node = {
38
+ remove(nodes, node2remove) {
39
+ return removeNode(nodes, node2remove);
40
+ },
41
+ setProperties(nodes, properties, recursively, exclude) {
42
+ return setPropertiesNode(nodes, properties, recursively, exclude);
43
+ },
44
+ toStream(nodes) {
45
+ return toStreamNode(nodes);
46
+ },
47
+ };
48
+ this.row = {
49
+ find(dataset, filters) {
50
+ return findRow(dataset, filters);
51
+ },
52
+ toNode(dataset) {
53
+ return toNode(dataset);
54
+ },
55
+ };
56
+ }
57
+ /**
58
+ * Utility used by findRow and findCell.
59
+ * @param {KupDataDataset} dataset - Input dataset.
60
+ * @param {KupDataFindCellFilters} filters - Filters of the research.
61
+ * @returns {{cells: KupDataCell[], rows: KupDataRow[]}} Object containing rows and cells.
62
+ */
63
+ finder(dataset, filters) {
64
+ const columns = filters ? filters.columns : null;
65
+ const range = filters ? filters.range : null;
66
+ const value = filters ? filters.value : null;
67
+ const min = range && range.min ? range.min : null;
68
+ const max = range && range.max ? range.max : null;
69
+ const result = {
70
+ cells: [],
71
+ rows: [],
72
+ };
73
+ for (let index = 0; index < dataset.rows.length; index++) {
74
+ const row = dataset.rows[index];
75
+ const cells = row.cells;
76
+ for (const key in cells) {
77
+ const cell = cells[key];
78
+ if (!columns || !columns.length || columns.includes(key)) {
79
+ if (min && max) {
80
+ let d = null, s = '', n = 0;
81
+ if (dom.ketchup.objects.isDate(cell.obj)) {
82
+ d = dom.ketchup.dates.toDate(cell.value);
83
+ const dMax = dom.ketchup.dates.toDate(max instanceof String ? max.valueOf() : max);
84
+ const dMin = dom.ketchup.dates.toDate(min instanceof String ? min.valueOf() : min);
85
+ if (d === dMax ||
86
+ d === dMin ||
87
+ (d < dMax && d > dMin)) {
88
+ result.cells.push(cell);
89
+ result.rows.push(row);
90
+ }
91
+ }
92
+ else if (typeof min === 'string' ||
93
+ min instanceof String) {
94
+ s = cell.value;
95
+ if (s === max ||
96
+ s === min ||
97
+ (s < max && s > min)) {
98
+ result.cells.push(cell);
99
+ result.rows.push(row);
100
+ }
101
+ }
102
+ else {
103
+ n = dom.ketchup.math.numberify(cell.value);
104
+ if (n === max ||
105
+ n === min ||
106
+ (n < max && n > min)) {
107
+ result.cells.push(cell);
108
+ result.rows.push(row);
109
+ }
110
+ }
111
+ }
112
+ else if (value === cell.value) {
113
+ result.cells.push(cell);
114
+ result.rows.push(row);
115
+ }
116
+ }
117
+ }
118
+ }
119
+ return result;
120
+ }
121
+ /**
122
+ * Creates a new dataset with an amount of cells equal to a distinct calculation applied to the given columns.
123
+ * The original value of cells will be stored in the title property of the new cells.
124
+ * @param {KupDataDataset} dataset - Input dataset.
125
+ * @param {string[]} columns - Column names to manage. When missing, defaults to all columns.
126
+ * @param {KupDataColumn} valuesColumn - When present, this column will be included in the final dataset containing the original values of the cells.
127
+ * @returns {KupDataDataset} New dataset with processed data.
128
+ */
129
+ distinct(dataset, columns, valuesColumn) {
130
+ const occurrencies = {};
131
+ const rows = dataset.rows;
132
+ for (let index = 0; index < rows.length; index++) {
133
+ const row = rows[index];
134
+ const cells = row.cells;
135
+ for (const key in cells) {
136
+ const cell = cells[key];
137
+ if (!columns ||
138
+ !columns.length ||
139
+ (columns && columns.includes(key))) {
140
+ if (!occurrencies[key]) {
141
+ occurrencies[key] = {};
142
+ }
143
+ const occurrency = occurrencies[key];
144
+ occurrency[cell.value] = occurrency[cell.value]
145
+ ? occurrency[cell.value] + 1
146
+ : 1;
147
+ }
148
+ }
149
+ }
150
+ const newColumns = [];
151
+ const newRows = [];
152
+ if (valuesColumn) {
153
+ newColumns.push(valuesColumn);
154
+ }
155
+ for (const key in occurrencies) {
156
+ const occurrency = occurrencies[key];
157
+ const column = Object.assign({}, dataset.columns.find((col) => col.name === key));
158
+ column.obj = {
159
+ t: 'NR',
160
+ p: '',
161
+ k: '',
162
+ };
163
+ let rowIndex = 0;
164
+ newColumns.push(column);
165
+ for (const j in occurrency) {
166
+ const value = occurrency[j];
167
+ let row = null;
168
+ if (!newRows[rowIndex]) {
169
+ newRows[rowIndex] = { cells: {} };
170
+ }
171
+ row = newRows[rowIndex];
172
+ row.cells[key] = {
173
+ obj: {
174
+ t: 'NR',
175
+ p: '',
176
+ k: value.toString(),
177
+ },
178
+ title: j,
179
+ value: value.toString(),
180
+ };
181
+ if (valuesColumn) {
182
+ row.cells[valuesColumn.name] = {
183
+ value: j,
184
+ };
185
+ }
186
+ rowIndex++;
187
+ }
188
+ }
189
+ return {
190
+ columns: newColumns,
191
+ rows: newRows,
192
+ };
193
+ }
194
+ /**
195
+ * Creates a new dataset from the input one.
196
+ * The new columns are to be specified in the columns argument along with their creation criteria.
197
+ * @param {KupDataDataset} dataset - Input dataset.
198
+ * @param {KupDataNewColumn[]} newColumns - Array containing the specifics of the new columns to be created.
199
+ * @returns {KupDataDataset} Resulting dataset.
200
+ */
201
+ new(dataset, newColumns) {
202
+ const outputColumns = [];
203
+ const outputRows = [];
204
+ for (let index = 0; index < newColumns.length; index++) {
205
+ const newColumn = newColumns[index].column;
206
+ const criteria = newColumns[index].criteria;
207
+ const cells = findCell(dataset, criteria);
208
+ let rowIndex = 0;
209
+ for (let index = 0; index < cells.length; index++) {
210
+ const cell = cells[index];
211
+ let outputRow = null;
212
+ if (!outputRows[rowIndex]) {
213
+ outputRows[rowIndex] = { cells: {} };
214
+ }
215
+ outputRow = outputRows[rowIndex];
216
+ outputRow.cells[newColumn.name] = JSON.parse(JSON.stringify(cell));
217
+ rowIndex++;
218
+ }
219
+ outputColumns.push(newColumn);
220
+ }
221
+ return {
222
+ columns: outputColumns,
223
+ rows: outputRows,
224
+ };
225
+ }
226
+ /**
227
+ * Performs a distinct/count after previously grouping columns by ranges.
228
+ * @param {KupDataDataset} dataset - Input dataset.
229
+ * @param {KupDataNewColumn[]} rangeColumns - A list of columns coupled with their criteria for creation. These are used to define ranges.
230
+ * @param {KupDataColumn} resultingColumn - The resulting column.
231
+ * @param {KupDataColumn} valuesColumn - When present, this column will be included in the final dataset containing the original values of the cells.
232
+ * @returns {KupDataDataset} New dataset with processed data.
233
+ */
234
+ rangedDistinct(dataset, rangeColumns, resultingColumn, valuesColumn) {
235
+ const newD = this.new(dataset, rangeColumns);
236
+ const columnNames = [];
237
+ for (let index = 0; index < rangeColumns.length; index++) {
238
+ const newColumn = rangeColumns[index].column;
239
+ columnNames.push(newColumn.name);
240
+ replaceCell(newD, { value: newColumn.title }, [newColumn.name]);
241
+ }
242
+ newColumn(newD, KupDataNewColumnTypes.MERGE, {
243
+ columns: columnNames,
244
+ newColumn: resultingColumn,
245
+ });
246
+ return this.distinct(newD, null, valuesColumn);
247
+ }
248
+ /**
249
+ * Creates a new dataset with sorted elements.
250
+ * @param {KupDataDataset} dataset Input dataset.
251
+ * @param {KupDataDatasetSort} sortType Type of sort to apply.
252
+ * @param {string} headerColumn The column used for sorting.
253
+ * @returns {KupDataDataset} Sorted dataset.
254
+ */
255
+ sort(dataset, sortType, headerColumn) {
256
+ if (sortType != 'normalDistribution') {
257
+ const message = 'Wrong sort type! (' + sortType + ')';
258
+ dom.ketchup.debug.logMessage('kup-data', message, KupDebugCategory.WARNING);
259
+ return dataset;
260
+ }
261
+ const output = {
262
+ columns: JSON.parse(JSON.stringify(dataset.columns)),
263
+ rows: [],
264
+ };
265
+ const length = dataset.rows.length;
266
+ // sort all columns values by descending
267
+ let values = getCellValue(dataset, [headerColumn]);
268
+ values.sort(function (a, b) {
269
+ return Number(a) - Number(b);
270
+ });
271
+ values.reverse();
272
+ // excluding duplicates values.
273
+ values = [...new Set(values)];
274
+ // calculating middle index
275
+ const idx = Math.floor(length / 2);
276
+ let lastIdx = idx - 1;
277
+ let leftIdx = idx - 1;
278
+ let rightIdx = idx + 1;
279
+ // sort the rows like a "mountain", the greatest is in the middle and the other ones are splitted left and right
280
+ for (let i = 0; i < length; i++) {
281
+ const value = values[i];
282
+ // looping the rows because we have many rows with same value.
283
+ this.finder(dataset, {
284
+ columns: [headerColumn],
285
+ value: value,
286
+ }).rows.forEach((row) => {
287
+ const xC = output.rows[idx];
288
+ if (xC == null) {
289
+ output.rows[idx] = JSON.parse(JSON.stringify(row));
290
+ }
291
+ else {
292
+ output.rows[lastIdx] = JSON.parse(JSON.stringify(row));
293
+ if (lastIdx > idx) {
294
+ // right from the middle index.
295
+ lastIdx = leftIdx;
296
+ rightIdx++;
297
+ }
298
+ else {
299
+ // left from the middle index.
300
+ lastIdx = rightIdx;
301
+ leftIdx--;
302
+ }
303
+ }
304
+ });
305
+ }
306
+ return output;
307
+ }
308
+ /**
309
+ * Creates a new dataset with transposed columns and rows.
310
+ * @param {KupDataDataset} dataset - Input dataset.
311
+ * @param {string} headerColumn - When specified, it will be the column used as header. When missing, the header will be a series of progressive numbers.
312
+ * @returns {KupDataDataset} Transposed dataset.
313
+ */
314
+ transpose(dataset, headerColumn) {
315
+ const transposed = { columns: [], rows: [] };
316
+ let firstColumn = null;
317
+ if (headerColumn) {
318
+ firstColumn = findColumns(dataset, { name: headerColumn })[0];
319
+ transposed.columns.push(firstColumn);
320
+ for (let index = 0; index < dataset.rows.length; index++) {
321
+ const row = dataset.rows[index];
322
+ const cell = row.cells[firstColumn.name];
323
+ const title = cell.displayedValue
324
+ ? cell.displayedValue
325
+ : cell.value;
326
+ transposed.columns.push({
327
+ name: cell.value + '_' + row.id,
328
+ title,
329
+ });
330
+ }
331
+ }
332
+ else {
333
+ firstColumn = {
334
+ name: fieldColumn.toUpperCase(),
335
+ title: fieldColumn,
336
+ };
337
+ transposed.columns.push(firstColumn);
338
+ for (let index = 0; index < dataset.rows.length; index++) {
339
+ const row = dataset.rows[index];
340
+ transposed.columns.push({
341
+ name: row.id,
342
+ title: '#' + index,
343
+ });
344
+ }
345
+ }
346
+ for (let index = headerColumn ? 1 : 0; index < dataset.columns.length; index++) {
347
+ const oldColumn = dataset.columns[index];
348
+ const cells = {};
349
+ cells[firstColumn.name] = {
350
+ value: oldColumn.title,
351
+ };
352
+ for (let index = 1; index < transposed.columns.length; index++) {
353
+ const newColumn = transposed.columns[index];
354
+ const oldRow = dataset.rows[index - 1];
355
+ const cellName = headerColumn ? newColumn.name : oldRow.id;
356
+ cells[cellName] = oldRow.cells[oldColumn.name];
357
+ if (oldColumn.icon && !cells[cellName].icon) {
358
+ cells[cellName].icon = oldColumn.icon;
359
+ }
360
+ if (oldColumn.shape && !cells[cellName].shape) {
361
+ cells[cellName].shape = oldColumn.shape;
362
+ }
363
+ }
364
+ // If a record is key and no column argument is provided, it will be placed on top
365
+ if (!headerColumn && oldColumn.isKey) {
366
+ transposed.rows.unshift({
367
+ id: String(index),
368
+ cells,
369
+ transposedColumnName: oldColumn.name,
370
+ });
371
+ }
372
+ else {
373
+ transposed.rows.push({
374
+ id: String(index),
375
+ cells,
376
+ transposedColumnName: oldColumn.name,
377
+ });
378
+ }
379
+ }
380
+ return transposed;
381
+ }
382
+ }
@@ -18,6 +18,7 @@ export class KupDates {
18
18
  * Initializes KupDates.
19
19
  */
20
20
  constructor(locale) {
21
+ this.managedComponents = new Set();
21
22
  this.setLocale(locale);
22
23
  this.dayjs = dayjs;
23
24
  dayjs.extend(customParseFormat);
@@ -46,11 +47,15 @@ export class KupDates {
46
47
  .toLowerCase();
47
48
  }
48
49
  dayjs.locale(this.locale);
50
+ this.managedComponents.forEach(function (comp) {
51
+ if (comp.isConnected) {
52
+ comp.refresh();
53
+ }
54
+ });
49
55
  document.dispatchEvent(new CustomEvent('kup-dates-localechange'));
50
56
  }
51
57
  /**
52
- *
53
- * @returns the current locale
58
+ * @returns {string} The current locale.
54
59
  */
55
60
  getLocale() {
56
61
  return this.locale;
@@ -81,6 +86,7 @@ export class KupDates {
81
86
  * Validates the given date.
82
87
  * @param {dayjs.ConfigType} date - Date to be validated.
83
88
  * @param {string} format - Format of the input date.
89
+ * @param {boolean} strict - Strict parsing requires that the format and input match exactly, including delimiters.
84
90
  * @returns {boolean} Returns whether the argument is a valid date or not.
85
91
  */
86
92
  isValid(date, format, strict) {
@@ -173,8 +179,8 @@ export class KupDates {
173
179
  case 3:
174
180
  //input = '0' + input; // continue into case 4
175
181
  case 4:
176
- sub1 = parseInt(input.substr(0, 2));
177
- sub2 = parseInt(input.substr(2));
182
+ sub1 = parseInt(input.substring(0, 2));
183
+ sub2 = parseInt(input.substring(2, 4));
178
184
  if (mIndex === 0) {
179
185
  today.setDate(sub2);
180
186
  today.setMonth(sub1 - 1); // -1 because it's 0 based
@@ -187,10 +193,10 @@ export class KupDates {
187
193
  case 5:
188
194
  //input = '0' + input; // continue into case 6
189
195
  case 6:
190
- sub1 = parseInt(input.substr(0, 2));
191
- sub2 = parseInt(input.substr(2, 2));
196
+ sub1 = parseInt(input.substring(0, 2));
197
+ sub2 = parseInt(input.substring(2, 4));
192
198
  year = today.getFullYear().toString();
193
- year = year.substr(0, 2) + input.substr(4);
199
+ year = year.substring(0, 2) + input.substring(4);
194
200
  if (mIndex === 0) {
195
201
  today.setFullYear(parseInt(year), sub1 - 1, sub2);
196
202
  }
@@ -201,9 +207,9 @@ export class KupDates {
201
207
  case 7:
202
208
  //input = '0' + input; // continue into case 8
203
209
  case 8:
204
- sub1 = parseInt(input.substr(0, 2));
205
- sub2 = parseInt(input.substr(2, 2));
206
- year = input.substr(4);
210
+ sub1 = parseInt(input.substring(0, 2));
211
+ sub2 = parseInt(input.substring(2, 4));
212
+ year = input.substring(4);
207
213
  if (mIndex === 0) {
208
214
  today.setFullYear(parseInt(year), sub1 - 1, sub2);
209
215
  }
@@ -228,25 +234,25 @@ export class KupDates {
228
234
  case 3:
229
235
  //input = '0' + input; // continue into case 4
230
236
  case 4:
231
- hh = parseInt(input.substr(0, 2));
232
- mm = parseInt(input.substr(2));
237
+ hh = parseInt(input.substring(0, 2));
238
+ mm = parseInt(input.substring(2, 4));
233
239
  today.setHours(hh, mm, 0, 0);
234
240
  break;
235
241
  case 5:
236
242
  //input = '0' + input; // continue into case 6
237
243
  case 6:
238
- hh = parseInt(input.substr(0, 2));
239
- mm = parseInt(input.substr(2, 2));
240
- ss = parseInt(input.substr(4));
244
+ hh = parseInt(input.substring(0, 2));
245
+ mm = parseInt(input.substring(2, 4));
246
+ ss = parseInt(input.substring(4, 6));
241
247
  today.setHours(hh, mm, ss, 0);
242
248
  break;
243
249
  case 7:
244
250
  //input = '0' + input; // continue into case 8
245
251
  case 8:
246
- hh = parseInt(input.substr(0, 2));
247
- mm = parseInt(input.substr(2, 2));
248
- ss = parseInt(input.substr(4, 2));
249
- ms = parseInt(input.substr(6));
252
+ hh = parseInt(input.substring(0, 2));
253
+ mm = parseInt(input.substring(2, 4));
254
+ ss = parseInt(input.substring(4, 6));
255
+ ms = parseInt(input.substring(6, 8));
250
256
  today.setHours(hh, mm, ss, ms);
251
257
  break;
252
258
  default:
@@ -281,6 +287,17 @@ export class KupDates {
281
287
  }
282
288
  return dayjs.max(dayjsDates);
283
289
  }
290
+ /**
291
+ * Adds the given amount of time to the input date.
292
+ * @param {dayjs.ConfigType} input - Input date.
293
+ * @param {number} value - The value of the addition (i.e.: 7).
294
+ * @param {dayjs.OpUnitType} unit - The unit of the addition (i.e.: "year").
295
+ * @returns {dayjs.Dayjs} Computed date.
296
+ * @see https://day.js.org/docs/en/manipulate/add
297
+ */
298
+ add(input, value, unit) {
299
+ return dayjs(input).add(value, unit);
300
+ }
284
301
  /**
285
302
  * Subtracts the given amount of time from the input date.
286
303
  * @param {dayjs.ConfigType} input - Input date.
@@ -292,4 +309,21 @@ export class KupDates {
292
309
  subtract(input, value, unit) {
293
310
  return dayjs(input).subtract(value, unit);
294
311
  }
312
+ /**
313
+ * Registers a KupComponent in KupDates, in order to be properly handled whenever the locale changes.
314
+ * @param {any} component - The Ketchup component to be registered.
315
+ */
316
+ register(component) {
317
+ this.managedComponents.add(component.rootElement);
318
+ }
319
+ /**
320
+ * Unregisters a KupComponent, so it won't be refreshed when the locale changes.
321
+ *
322
+ * @param {any} component - The component calling this function.
323
+ */
324
+ unregister(component) {
325
+ if (this.managedComponents) {
326
+ this.managedComponents.delete(component.rootElement);
327
+ }
328
+ }
295
329
  }
@@ -16,7 +16,7 @@ function logCSS(selector, detailedLog) {
16
16
  const cssRule = shadowCSS[index].cssText;
17
17
  if (cssRule.indexOf('@') < 0) {
18
18
  let selectorEnd = shadowCSS[index].cssText.indexOf('{');
19
- CSSArray.push(cssRule.substr(0, selectorEnd));
19
+ CSSArray.push(cssRule.substring(0, selectorEnd));
20
20
  }
21
21
  }
22
22