@sme.up/ketchup 5.0.0 → 5.2.1-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 (224) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/{cell-utils-720be0c8.js → cell-utils-d96b2993.js} +4 -4
  3. package/dist/cjs/{f-button-dbf3cd3a.js → f-button-2b9b99b1.js} +2 -2
  4. package/dist/cjs/{f-cell-93d984ad.js → f-cell-8351cb84.js} +8 -96
  5. package/dist/cjs/{f-chip-438213eb.js → f-chip-df59e1b0.js} +3 -3
  6. package/dist/cjs/{f-image-21865ab7.js → f-image-12bab3b5.js} +2 -2
  7. package/dist/cjs/f-text-field-e7c35b5b.js +94 -0
  8. package/dist/cjs/f-text-field-mdc-a67f5dfe.js +2852 -0
  9. package/dist/cjs/{index-ab119fad.js → index-eb556444.js} +6 -1
  10. package/dist/cjs/ketchup.cjs.js +3 -3
  11. package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
  12. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +641 -3331
  13. package/dist/cjs/kup-calendar.cjs.entry.js +8 -8
  14. package/dist/cjs/kup-cell.cjs.entry.js +9 -8
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +5 -5
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +5 -5
  17. package/dist/cjs/kup-drawer.cjs.entry.js +8 -5
  18. package/dist/cjs/kup-echart.cjs.entry.js +210 -60
  19. package/dist/cjs/kup-field.cjs.entry.js +3 -3
  20. package/dist/cjs/kup-iframe.cjs.entry.js +4 -4
  21. package/dist/cjs/kup-lazy.cjs.entry.js +4 -4
  22. package/dist/cjs/kup-magic-box.cjs.entry.js +7 -7
  23. package/dist/cjs/{kup-manager-09c0c1fc.js → kup-manager-5c03da64.js} +3061 -2642
  24. package/dist/cjs/kup-nav-bar.cjs.entry.js +6 -6
  25. package/dist/cjs/kup-numeric-picker.cjs.entry.js +423 -0
  26. package/dist/cjs/kup-photo-frame.cjs.entry.js +179 -0
  27. package/dist/cjs/kup-probe.cjs.entry.js +3 -3
  28. package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
  29. package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
  30. package/dist/cjs/loader.cjs.js +3 -3
  31. package/dist/cjs/{utils-a60ab5fa.js → utils-e99921c1.js} +4 -38
  32. package/dist/collection/assets/card.js +30 -30
  33. package/dist/collection/assets/data-table.js +24 -74
  34. package/dist/collection/assets/echart.js +481 -0
  35. package/dist/collection/assets/index.js +87 -79
  36. package/dist/collection/assets/kupdata.js +29 -41
  37. package/dist/collection/assets/kuptooltip.js +608 -0
  38. package/dist/collection/assets/list.js +6 -6
  39. package/dist/collection/assets/nav-bar.js +4 -4
  40. package/dist/collection/assets/probe.js +18 -18
  41. package/dist/collection/collection-manifest.json +3 -1
  42. package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +4 -4
  43. package/dist/collection/components/kup-box/kup-box.js +9 -9
  44. package/dist/collection/components/kup-button-list/kup-button-list.js +4 -4
  45. package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -0
  46. package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +20 -20
  47. package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +153 -0
  48. package/dist/collection/components/kup-card/kup-card.css +35 -0
  49. package/dist/collection/components/kup-card/kup-card.js +1 -0
  50. package/dist/collection/components/kup-chip/kup-chip.js +4 -4
  51. package/dist/collection/components/kup-combobox/kup-combobox.js +5 -5
  52. package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +0 -2
  53. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +31 -32
  54. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  55. package/dist/collection/components/kup-data-table/kup-data-table.js +112 -159
  56. package/dist/collection/components/kup-date-picker/kup-date-picker.js +1 -1
  57. package/dist/collection/components/kup-drawer/kup-drawer.js +4 -1
  58. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +3 -3
  59. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +14 -14
  60. package/dist/collection/components/kup-echart/kup-echart-declarations.js +3 -0
  61. package/dist/collection/components/kup-echart/kup-echart.js +246 -58
  62. package/dist/collection/components/kup-image/assets/svg/instagram.svg +1 -0
  63. package/dist/collection/components/kup-image/assets/svg/pinterest.svg +1 -0
  64. package/dist/collection/components/kup-image/assets/svg/reddit.svg +1 -0
  65. package/dist/collection/components/kup-list/kup-list-helper.js +26 -26
  66. package/dist/collection/components/kup-list/kup-list.css +35 -3
  67. package/dist/collection/components/kup-list/kup-list.js +52 -44
  68. package/dist/collection/components/kup-magic-box/kup-magic-box.js +3 -3
  69. package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +2 -2
  70. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -0
  71. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.css +50 -0
  72. package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +895 -0
  73. package/dist/collection/components/kup-photo-frame/kup-photo-frame-declarations.js +10 -0
  74. package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +70 -0
  75. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +382 -0
  76. package/dist/collection/components/kup-tab-bar/kup-tab-bar.css +1 -1
  77. package/dist/collection/components/kup-time-picker/kup-time-picker.js +8 -8
  78. package/dist/collection/components/kup-tree/kup-tree.js +25 -38
  79. package/dist/collection/f-components/f-paginator/f-paginator.js +6 -6
  80. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +2 -2
  81. package/dist/collection/managers/kup-data/kup-data-column-helper.js +27 -3
  82. package/dist/collection/managers/kup-data/kup-data-declarations.js +2 -1
  83. package/dist/collection/managers/kup-data/kup-data-node-helper.js +1 -1
  84. package/dist/collection/managers/kup-data/kup-data-row-helper.js +2 -2
  85. package/dist/collection/managers/kup-data/kup-data.js +337 -155
  86. package/dist/collection/managers/kup-dates/kup-dates.js +2 -2
  87. package/dist/collection/managers/kup-debug/kup-debug.js +7 -6
  88. package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +1 -1
  89. package/dist/collection/managers/kup-language/kup-language.js +2 -2
  90. package/dist/collection/managers/kup-manager/kup-manager.js +25 -1
  91. package/dist/collection/managers/kup-math/kup-math-declarations.js +13 -0
  92. package/dist/collection/managers/kup-math/kup-math-helper.js +39 -0
  93. package/dist/collection/managers/kup-math/kup-math.js +161 -0
  94. package/dist/collection/managers/kup-objects/kup-objects.js +48 -1
  95. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +1 -0
  96. package/dist/collection/managers/kup-theme/kup-theme.js +2 -2
  97. package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -0
  98. package/dist/collection/managers/kup-tooltip/kup-tooltip.js +191 -0
  99. package/dist/collection/types/GenericTypes.js +1 -0
  100. package/dist/collection/utils/cell-utils.js +2 -3
  101. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +1 -1
  102. package/dist/collection/utils/utils.js +3 -74
  103. package/dist/esm/{cell-utils-b80ccb8c.js → cell-utils-f4bdbbc8.js} +4 -4
  104. package/dist/esm/{f-button-9e835467.js → f-button-54a49fd8.js} +2 -2
  105. package/dist/esm/{f-cell-f8bb2e04.js → f-cell-d5dac50b.js} +8 -95
  106. package/dist/esm/{f-chip-953c6915.js → f-chip-a3035b4b.js} +3 -3
  107. package/dist/esm/{f-image-78c5265e.js → f-image-d32465e3.js} +2 -2
  108. package/dist/esm/f-text-field-c25cc63f.js +92 -0
  109. package/dist/esm/f-text-field-mdc-9fbbefc3.js +2850 -0
  110. package/dist/esm/{index-78f3699d.js → index-baeab1ac.js} +6 -2
  111. package/dist/esm/ketchup.js +3 -3
  112. package/dist/esm/kup-accordion.entry.js +5 -5
  113. package/dist/esm/kup-autocomplete_27.entry.js +625 -3315
  114. package/dist/esm/kup-calendar.entry.js +8 -8
  115. package/dist/esm/kup-cell.entry.js +9 -8
  116. package/dist/esm/kup-dash-list.entry.js +5 -5
  117. package/dist/esm/kup-dash_2.entry.js +5 -5
  118. package/dist/esm/kup-drawer.entry.js +8 -5
  119. package/dist/esm/kup-echart.entry.js +210 -60
  120. package/dist/esm/kup-field.entry.js +3 -3
  121. package/dist/esm/kup-iframe.entry.js +4 -4
  122. package/dist/esm/kup-lazy.entry.js +4 -4
  123. package/dist/esm/kup-magic-box.entry.js +7 -7
  124. package/dist/esm/{kup-manager-bba62291.js → kup-manager-9316a184.js} +3062 -2642
  125. package/dist/esm/kup-nav-bar.entry.js +6 -6
  126. package/dist/esm/kup-numeric-picker.entry.js +419 -0
  127. package/dist/esm/kup-photo-frame.entry.js +175 -0
  128. package/dist/esm/kup-probe.entry.js +3 -3
  129. package/dist/esm/kup-qlik.entry.js +3 -3
  130. package/dist/esm/kup-snackbar.entry.js +6 -6
  131. package/dist/esm/loader.js +3 -3
  132. package/dist/esm/{utils-d1569956.js → utils-f24319a0.js} +5 -37
  133. package/dist/ketchup/assets/svg/instagram.svg +1 -0
  134. package/dist/ketchup/assets/svg/pinterest.svg +1 -0
  135. package/dist/ketchup/assets/svg/reddit.svg +1 -0
  136. package/dist/ketchup/ketchup.esm.js +1 -1
  137. package/dist/ketchup/p-09d708c4.entry.js +1 -0
  138. package/dist/ketchup/p-11e72a8c.entry.js +1 -0
  139. package/dist/ketchup/p-12773ca8.js +9 -0
  140. package/dist/ketchup/p-203d6295.entry.js +1 -0
  141. package/dist/ketchup/p-34748c91.js +1 -0
  142. package/dist/ketchup/p-34b74425.js +1 -0
  143. package/dist/ketchup/p-40f97429.js +1 -0
  144. package/dist/ketchup/p-4173422f.entry.js +1 -0
  145. package/dist/ketchup/p-41741c28.entry.js +1 -0
  146. package/dist/ketchup/p-44192f30.entry.js +1 -0
  147. package/dist/ketchup/{p-ebf4cf56.js → p-44f8da2a.js} +1 -1
  148. package/dist/ketchup/{p-fa540f82.js → p-4f56932b.js} +1 -1
  149. package/dist/ketchup/p-669bde31.js +1 -0
  150. package/dist/ketchup/p-67842f1e.entry.js +1 -0
  151. package/dist/ketchup/{p-f993f813.js → p-7a74ad17.js} +1 -1
  152. package/dist/ketchup/p-7ba8fa4a.entry.js +39 -0
  153. package/dist/ketchup/p-7de0d7e1.js +1 -0
  154. package/dist/ketchup/p-8418e8fa.entry.js +1 -0
  155. package/dist/ketchup/p-96bf19aa.entry.js +1 -0
  156. package/dist/ketchup/p-9a61d8dc.entry.js +1 -0
  157. package/dist/ketchup/p-b0ddcce9.entry.js +9 -0
  158. package/dist/ketchup/{p-aa27f9f7.entry.js → p-b6c21223.entry.js} +2 -2
  159. package/dist/ketchup/p-bb8844bf.entry.js +1 -0
  160. package/dist/ketchup/p-c58a2a81.entry.js +1 -0
  161. package/dist/ketchup/p-ca3d585b.entry.js +1 -0
  162. package/dist/ketchup/p-e6709c26.entry.js +1 -0
  163. package/dist/ketchup/p-e8e3c9da.entry.js +1 -0
  164. package/dist/ketchup/p-ecb7069b.js +135 -0
  165. package/dist/types/components/kup-button-list/kup-button-list-declarations.d.ts +2 -1
  166. package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -0
  167. package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -0
  168. package/dist/types/components/kup-card/kup-card-declarations.d.ts +26 -1
  169. package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +2 -2
  170. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  171. package/dist/types/components/kup-data-table/kup-data-table.d.ts +7 -15
  172. package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +1 -1
  173. package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +3 -0
  174. package/dist/types/components/kup-echart/kup-echart.d.ts +12 -1
  175. package/dist/types/components/kup-list/kup-list-declarations.d.ts +3 -7
  176. package/dist/types/components/kup-list/kup-list-helper.d.ts +6 -6
  177. package/dist/types/components/kup-list/kup-list.d.ts +2 -2
  178. package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -0
  179. package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -0
  180. package/dist/types/components/kup-photo-frame/kup-photo-frame-declarations.d.ts +9 -0
  181. package/dist/types/components/kup-photo-frame/kup-photo-frame.d.ts +61 -0
  182. package/dist/types/components.d.ts +249 -28
  183. package/dist/types/managers/kup-data/kup-data-column-helper.d.ts +9 -1
  184. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +4 -25
  185. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +1 -1
  186. package/dist/types/managers/kup-data/kup-data.d.ts +63 -27
  187. package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +21 -0
  188. package/dist/types/managers/kup-manager/kup-manager.d.ts +4 -0
  189. package/dist/types/managers/kup-math/kup-math-declarations.d.ts +27 -0
  190. package/dist/types/managers/kup-math/kup-math-helper.d.ts +17 -0
  191. package/dist/types/managers/kup-math/kup-math.d.ts +61 -0
  192. package/dist/types/managers/kup-objects/kup-objects.d.ts +22 -0
  193. package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -0
  194. package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +40 -0
  195. package/dist/types/types/GenericTypes.d.ts +1 -0
  196. package/dist/types/utils/utils.d.ts +0 -18
  197. package/package.json +3 -3
  198. package/CHANGELOG.md +0 -5
  199. package/dist/collection/managers/kup-data/kup-data-dataset-helper.js +0 -262
  200. package/dist/collection/managers/kup-data/kup-data-helper.js +0 -61
  201. package/dist/collection/utils/state-utils.js +0 -9
  202. package/dist/ketchup/p-0032a782.entry.js +0 -1
  203. package/dist/ketchup/p-18c4d083.entry.js +0 -1
  204. package/dist/ketchup/p-199c972e.entry.js +0 -1
  205. package/dist/ketchup/p-29800a2e.js +0 -1
  206. package/dist/ketchup/p-34aa8d8a.entry.js +0 -1
  207. package/dist/ketchup/p-542279e9.entry.js +0 -1
  208. package/dist/ketchup/p-5b26a7a8.entry.js +0 -39
  209. package/dist/ketchup/p-5c97e7ab.js +0 -1
  210. package/dist/ketchup/p-6817ca85.entry.js +0 -1
  211. package/dist/ketchup/p-76e674ca.entry.js +0 -1
  212. package/dist/ketchup/p-78aa6f1b.js +0 -1
  213. package/dist/ketchup/p-842b66aa.entry.js +0 -1
  214. package/dist/ketchup/p-894981c0.entry.js +0 -143
  215. package/dist/ketchup/p-8ac2fa75.entry.js +0 -1
  216. package/dist/ketchup/p-907c9e11.entry.js +0 -1
  217. package/dist/ketchup/p-9ae9149b.entry.js +0 -1
  218. package/dist/ketchup/p-b0d1bdd8.js +0 -9
  219. package/dist/ketchup/p-e1e4c951.entry.js +0 -1
  220. package/dist/ketchup/p-eba369d9.entry.js +0 -1
  221. package/dist/ketchup/p-ed0b8666.js +0 -1
  222. package/dist/types/managers/kup-data/kup-data-dataset-helper.d.ts +0 -42
  223. package/dist/types/managers/kup-data/kup-data-helper.d.ts +0 -11
  224. package/dist/types/utils/state-utils.d.ts +0 -1
@@ -1,6 +1,5 @@
1
- import numeral from 'numeral';
2
1
  import { SortMode, TotalMode, } from './kup-data-table-declarations';
3
- import { isEmpty, stringToNumber } from '../../utils/utils';
2
+ import { stringToNumber } from '../../utils/utils';
4
3
  import { getCellValueForDisplay, getColumnByName, compareCell, } from '../../utils/cell-utils';
5
4
  import { FiltersRows } from '../../utils/filters/filters-rows';
6
5
  const dom = document.documentElement;
@@ -234,7 +233,7 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
234
233
  return;
235
234
  }
236
235
  keys.forEach((key) => {
237
- const currentTotalValue = groupRow.group.totals[key] || 0;
236
+ const currentTotalValue = dom.ketchup.math.numberify(groupRow.group.totals[key] || 0);
238
237
  const cell = addedRow.cells[key];
239
238
  if (cell) {
240
239
  let _isNumber = dom.ketchup.objects.isNumber(cell.obj);
@@ -253,7 +252,7 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
253
252
  case TotalMode.DISTINCT:
254
253
  let cellValue;
255
254
  if (_isNumber) {
256
- cellValue = numeral(stringToNumber(cell.value)).value();
255
+ cellValue = dom.ketchup.math.numberify(stringToNumber(cell.value));
257
256
  }
258
257
  else {
259
258
  cellValue = cell.value;
@@ -305,17 +304,15 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
305
304
  case TotalMode.SUM:
306
305
  case TotalMode.AVERAGE:
307
306
  if (_isNumber) {
308
- const cellValue = numeral(stringToNumber(cell.value));
309
- groupRow.group.totals[key] = numeral(cellValue)
310
- .add(currentTotalValue)
311
- .value();
307
+ const cellValue = dom.ketchup.math.numberify(stringToNumber(cell.value));
308
+ groupRow.group.totals[key] =
309
+ cellValue + currentTotalValue;
312
310
  // updating parents
313
311
  let parent = groupRow.group.parent;
314
312
  while (parent != null) {
315
- const currentParentSum = parent.group.totals[key] || 0;
316
- parent.group.totals[key] = numeral(cellValue)
317
- .add(currentParentSum)
318
- .value();
313
+ const currentParentSum = dom.ketchup.math.numberify(parent.group.totals[key] || 0);
314
+ parent.group.totals[key] =
315
+ cellValue + currentParentSum;
319
316
  parent = parent.group.parent;
320
317
  }
321
318
  }
@@ -324,7 +321,7 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
324
321
  case TotalMode.MIN:
325
322
  if (_isNumber) {
326
323
  const currentTotalValue = groupRow.group.totals[key];
327
- const cellValue = numeral(stringToNumber(cell.value)).value();
324
+ const cellValue = dom.ketchup.math.numberify(stringToNumber(cell.value));
328
325
  if (currentTotalValue) {
329
326
  groupRow.group.totals[key] = Math.min(currentTotalValue, cellValue);
330
327
  }
@@ -387,7 +384,7 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
387
384
  case TotalMode.MAX:
388
385
  if (_isNumber) {
389
386
  const currentTotalValue = groupRow.group.totals[key];
390
- const cellValue = numeral(stringToNumber(cell.value)).value();
387
+ const cellValue = dom.ketchup.math.numberify(stringToNumber(cell.value));
391
388
  if (currentTotalValue) {
392
389
  groupRow.group.totals[key] = Math.max(currentTotalValue, cellValue);
393
390
  }
@@ -528,13 +525,13 @@ function adjustGroupAverageOrFormula(row, type, toAdjustKeys, totals) {
528
525
  // adjust average/formulas
529
526
  toAdjustKeys.forEach((key) => {
530
527
  if (type == TotalMode.AVERAGE) {
531
- row.group.totals[key] = numeral(row.group.totals[key])
532
- .divide(numberOfLeaf)
533
- .value();
528
+ row.group.totals[key] =
529
+ dom.ketchup.math.numberify(row.group.totals[key]) /
530
+ numberOfLeaf;
534
531
  }
535
532
  if (type == TotalMode.MATH) {
536
533
  let formula = totals[key].substring(TotalMode.MATH.length);
537
- row.group.totals[key] = dom.ketchup.data.formulas.custom(formula, row.group.totals);
534
+ row.group.totals[key] = dom.ketchup.math.formulas.custom(formula, row.group.totals);
538
535
  }
539
536
  });
540
537
  return numberOfLeaf;
@@ -564,7 +561,8 @@ export function normalizeRows(columns, rows) {
564
561
  }
565
562
  }
566
563
  export function calcTotals(rows = [], totals = {}) {
567
- if (isEmpty(rows) || isEmpty(totals)) {
564
+ if (dom.ketchup.objects.isEmptyJsObject(rows) ||
565
+ dom.ketchup.objects.isEmptyJsObject(totals)) {
568
566
  return {};
569
567
  }
570
568
  const keys = Object.keys(totals);
@@ -586,7 +584,7 @@ export function calcTotals(rows = [], totals = {}) {
586
584
  if (totals[key] === TotalMode.DISTINCT) {
587
585
  let cellValue;
588
586
  if (dom.ketchup.objects.isNumber(cell.obj)) {
589
- cellValue = numeral(stringToNumber(cell.value)).value();
587
+ cellValue = dom.ketchup.math.numberify(stringToNumber(cell.value));
590
588
  }
591
589
  else {
592
590
  cellValue = cell.value;
@@ -603,32 +601,32 @@ export function calcTotals(rows = [], totals = {}) {
603
601
  }
604
602
  }
605
603
  else if (dom.ketchup.objects.isNumber(cell.obj)) {
606
- const cellValue = numeral(stringToNumber(cell.value));
604
+ const cellValue = dom.ketchup.math.numberify(stringToNumber(cell.value));
607
605
  let currentFooterValue = footerRow[key];
608
606
  switch (true) {
609
607
  // TODO DRY the MIN and MAX functions
610
608
  case totals[key] === TotalMode.MIN:
611
609
  if (currentFooterValue) {
612
- footerRow[key] = Math.min(currentFooterValue, cellValue.value());
610
+ footerRow[key] = Math.min(currentFooterValue, cellValue);
613
611
  }
614
612
  else {
615
- footerRow[key] = cellValue.value();
613
+ footerRow[key] = cellValue;
616
614
  }
617
615
  break;
618
616
  case totals[key] === TotalMode.MAX:
619
617
  if (currentFooterValue) {
620
- footerRow[key] = Math.max(currentFooterValue, cellValue.value());
618
+ footerRow[key] = Math.max(currentFooterValue, cellValue);
621
619
  }
622
620
  else {
623
- footerRow[key] = cellValue.value();
621
+ footerRow[key] = cellValue;
624
622
  }
625
623
  break;
626
624
  default:
627
625
  // SUM
628
626
  currentFooterValue = footerRow[key] || 0;
629
- footerRow[key] = cellValue
630
- .add(currentFooterValue)
631
- .value();
627
+ footerRow[key] =
628
+ cellValue +
629
+ dom.ketchup.math.numberify(currentFooterValue);
632
630
  }
633
631
  // TODO DRY the MIN and MAX functions
634
632
  }
@@ -684,20 +682,21 @@ export function calcTotals(rows = [], totals = {}) {
684
682
  case totals[key] === TotalMode.AVERAGE:
685
683
  const sum = footerRow[key];
686
684
  if (sum && rows.length > 0) {
687
- footerRow[key] = numeral(sum)
688
- .divide(rows.length)
689
- .value();
685
+ footerRow[key] = sum / rows.length;
690
686
  }
691
687
  break;
692
688
  case totals[key] === TotalMode.COUNT:
693
689
  footerRow[key] = rows.length;
694
690
  break;
695
691
  case totals[key].indexOf(TotalMode.MATH) == 0:
696
- footerRow[key] = dom.ketchup.data.formulas.custom(totals[key].substring(TotalMode.MATH.length), footerRow);
692
+ footerRow[key] = dom.ketchup.math.formulas.custom(totals[key].substring(TotalMode.MATH.length), footerRow);
697
693
  break;
698
694
  default:
699
695
  break;
700
696
  }
697
+ if (footerRow[key]) {
698
+ footerRow[key] = +footerRow[key].toFixed(2);
699
+ }
701
700
  }
702
701
  }
703
702
  return footerRow;
@@ -5,8 +5,8 @@ export class KupDataTableState {
5
5
  this.expandGroups = false;
6
6
  this.groupLabelDisplay = GroupLabelDisplayMode.BOTH;
7
7
  this.density = 'small';
8
- this.enableExtraColumns = true;
9
8
  this.enableSortableColumns = false;
9
+ this.enableExtraColumns = true;
10
10
  this.forceOneLine = false;
11
11
  this.globalFilter = false;
12
12
  this.globalFilterValue = '';