@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.
- package/README.md +1 -1
- package/dist/cjs/{cell-utils-720be0c8.js → cell-utils-d96b2993.js} +4 -4
- package/dist/cjs/{f-button-dbf3cd3a.js → f-button-2b9b99b1.js} +2 -2
- package/dist/cjs/{f-cell-93d984ad.js → f-cell-8351cb84.js} +8 -96
- package/dist/cjs/{f-chip-438213eb.js → f-chip-df59e1b0.js} +3 -3
- package/dist/cjs/{f-image-21865ab7.js → f-image-12bab3b5.js} +2 -2
- package/dist/cjs/f-text-field-e7c35b5b.js +94 -0
- package/dist/cjs/f-text-field-mdc-a67f5dfe.js +2852 -0
- package/dist/cjs/{index-ab119fad.js → index-eb556444.js} +6 -1
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +641 -3331
- package/dist/cjs/kup-calendar.cjs.entry.js +8 -8
- package/dist/cjs/kup-cell.cjs.entry.js +9 -8
- package/dist/cjs/kup-dash-list.cjs.entry.js +5 -5
- package/dist/cjs/kup-dash_2.cjs.entry.js +5 -5
- package/dist/cjs/kup-drawer.cjs.entry.js +8 -5
- package/dist/cjs/kup-echart.cjs.entry.js +210 -60
- package/dist/cjs/kup-field.cjs.entry.js +3 -3
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -4
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -4
- package/dist/cjs/kup-magic-box.cjs.entry.js +7 -7
- package/dist/cjs/{kup-manager-09c0c1fc.js → kup-manager-5c03da64.js} +3061 -2642
- package/dist/cjs/kup-nav-bar.cjs.entry.js +6 -6
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +423 -0
- package/dist/cjs/kup-photo-frame.cjs.entry.js +179 -0
- package/dist/cjs/kup-probe.cjs.entry.js +3 -3
- package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
- package/dist/cjs/kup-snackbar.cjs.entry.js +6 -6
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-a60ab5fa.js → utils-e99921c1.js} +4 -38
- package/dist/collection/assets/card.js +30 -30
- package/dist/collection/assets/data-table.js +24 -74
- package/dist/collection/assets/echart.js +481 -0
- package/dist/collection/assets/index.js +87 -79
- package/dist/collection/assets/kupdata.js +29 -41
- package/dist/collection/assets/kuptooltip.js +608 -0
- package/dist/collection/assets/list.js +6 -6
- package/dist/collection/assets/nav-bar.js +4 -4
- package/dist/collection/assets/probe.js +18 -18
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +4 -4
- package/dist/collection/components/kup-box/kup-box.js +9 -9
- package/dist/collection/components/kup-button-list/kup-button-list.js +4 -4
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +10 -0
- package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +20 -20
- package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +153 -0
- package/dist/collection/components/kup-card/kup-card.css +35 -0
- package/dist/collection/components/kup-card/kup-card.js +1 -0
- package/dist/collection/components/kup-chip/kup-chip.js +4 -4
- package/dist/collection/components/kup-combobox/kup-combobox.js +5 -5
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +0 -2
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +31 -32
- package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
- package/dist/collection/components/kup-data-table/kup-data-table.js +112 -159
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +1 -1
- package/dist/collection/components/kup-drawer/kup-drawer.js +4 -1
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +3 -3
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +14 -14
- package/dist/collection/components/kup-echart/kup-echart-declarations.js +3 -0
- package/dist/collection/components/kup-echart/kup-echart.js +246 -58
- package/dist/collection/components/kup-image/assets/svg/instagram.svg +1 -0
- package/dist/collection/components/kup-image/assets/svg/pinterest.svg +1 -0
- package/dist/collection/components/kup-image/assets/svg/reddit.svg +1 -0
- package/dist/collection/components/kup-list/kup-list-helper.js +26 -26
- package/dist/collection/components/kup-list/kup-list.css +35 -3
- package/dist/collection/components/kup-list/kup-list.js +52 -44
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +3 -3
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +2 -2
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +16 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.css +50 -0
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +895 -0
- package/dist/collection/components/kup-photo-frame/kup-photo-frame-declarations.js +10 -0
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +70 -0
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +382 -0
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.css +1 -1
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +8 -8
- package/dist/collection/components/kup-tree/kup-tree.js +25 -38
- package/dist/collection/f-components/f-paginator/f-paginator.js +6 -6
- package/dist/collection/managers/kup-data/kup-data-cell-helper.js +2 -2
- package/dist/collection/managers/kup-data/kup-data-column-helper.js +27 -3
- package/dist/collection/managers/kup-data/kup-data-declarations.js +2 -1
- package/dist/collection/managers/kup-data/kup-data-node-helper.js +1 -1
- package/dist/collection/managers/kup-data/kup-data-row-helper.js +2 -2
- package/dist/collection/managers/kup-data/kup-data.js +337 -155
- package/dist/collection/managers/kup-dates/kup-dates.js +2 -2
- package/dist/collection/managers/kup-debug/kup-debug.js +7 -6
- package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +1 -1
- package/dist/collection/managers/kup-language/kup-language.js +2 -2
- package/dist/collection/managers/kup-manager/kup-manager.js +25 -1
- package/dist/collection/managers/kup-math/kup-math-declarations.js +13 -0
- package/dist/collection/managers/kup-math/kup-math-helper.js +39 -0
- package/dist/collection/managers/kup-math/kup-math.js +161 -0
- package/dist/collection/managers/kup-objects/kup-objects.js +48 -1
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +1 -0
- package/dist/collection/managers/kup-theme/kup-theme.js +2 -2
- package/dist/collection/managers/kup-tooltip/kup-tooltip-declarations.js +1 -0
- package/dist/collection/managers/kup-tooltip/kup-tooltip.js +191 -0
- package/dist/collection/types/GenericTypes.js +1 -0
- package/dist/collection/utils/cell-utils.js +2 -3
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +1 -1
- package/dist/collection/utils/utils.js +3 -74
- package/dist/esm/{cell-utils-b80ccb8c.js → cell-utils-f4bdbbc8.js} +4 -4
- package/dist/esm/{f-button-9e835467.js → f-button-54a49fd8.js} +2 -2
- package/dist/esm/{f-cell-f8bb2e04.js → f-cell-d5dac50b.js} +8 -95
- package/dist/esm/{f-chip-953c6915.js → f-chip-a3035b4b.js} +3 -3
- package/dist/esm/{f-image-78c5265e.js → f-image-d32465e3.js} +2 -2
- package/dist/esm/f-text-field-c25cc63f.js +92 -0
- package/dist/esm/f-text-field-mdc-9fbbefc3.js +2850 -0
- package/dist/esm/{index-78f3699d.js → index-baeab1ac.js} +6 -2
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +5 -5
- package/dist/esm/kup-autocomplete_27.entry.js +625 -3315
- package/dist/esm/kup-calendar.entry.js +8 -8
- package/dist/esm/kup-cell.entry.js +9 -8
- package/dist/esm/kup-dash-list.entry.js +5 -5
- package/dist/esm/kup-dash_2.entry.js +5 -5
- package/dist/esm/kup-drawer.entry.js +8 -5
- package/dist/esm/kup-echart.entry.js +210 -60
- package/dist/esm/kup-field.entry.js +3 -3
- package/dist/esm/kup-iframe.entry.js +4 -4
- package/dist/esm/kup-lazy.entry.js +4 -4
- package/dist/esm/kup-magic-box.entry.js +7 -7
- package/dist/esm/{kup-manager-bba62291.js → kup-manager-9316a184.js} +3062 -2642
- package/dist/esm/kup-nav-bar.entry.js +6 -6
- package/dist/esm/kup-numeric-picker.entry.js +419 -0
- package/dist/esm/kup-photo-frame.entry.js +175 -0
- package/dist/esm/kup-probe.entry.js +3 -3
- package/dist/esm/kup-qlik.entry.js +3 -3
- package/dist/esm/kup-snackbar.entry.js +6 -6
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-d1569956.js → utils-f24319a0.js} +5 -37
- package/dist/ketchup/assets/svg/instagram.svg +1 -0
- package/dist/ketchup/assets/svg/pinterest.svg +1 -0
- package/dist/ketchup/assets/svg/reddit.svg +1 -0
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-09d708c4.entry.js +1 -0
- package/dist/ketchup/p-11e72a8c.entry.js +1 -0
- package/dist/ketchup/p-12773ca8.js +9 -0
- package/dist/ketchup/p-203d6295.entry.js +1 -0
- package/dist/ketchup/p-34748c91.js +1 -0
- package/dist/ketchup/p-34b74425.js +1 -0
- package/dist/ketchup/p-40f97429.js +1 -0
- package/dist/ketchup/p-4173422f.entry.js +1 -0
- package/dist/ketchup/p-41741c28.entry.js +1 -0
- package/dist/ketchup/p-44192f30.entry.js +1 -0
- package/dist/ketchup/{p-ebf4cf56.js → p-44f8da2a.js} +1 -1
- package/dist/ketchup/{p-fa540f82.js → p-4f56932b.js} +1 -1
- package/dist/ketchup/p-669bde31.js +1 -0
- package/dist/ketchup/p-67842f1e.entry.js +1 -0
- package/dist/ketchup/{p-f993f813.js → p-7a74ad17.js} +1 -1
- package/dist/ketchup/p-7ba8fa4a.entry.js +39 -0
- package/dist/ketchup/p-7de0d7e1.js +1 -0
- package/dist/ketchup/p-8418e8fa.entry.js +1 -0
- package/dist/ketchup/p-96bf19aa.entry.js +1 -0
- package/dist/ketchup/p-9a61d8dc.entry.js +1 -0
- package/dist/ketchup/p-b0ddcce9.entry.js +9 -0
- package/dist/ketchup/{p-aa27f9f7.entry.js → p-b6c21223.entry.js} +2 -2
- package/dist/ketchup/p-bb8844bf.entry.js +1 -0
- package/dist/ketchup/p-c58a2a81.entry.js +1 -0
- package/dist/ketchup/p-ca3d585b.entry.js +1 -0
- package/dist/ketchup/p-e6709c26.entry.js +1 -0
- package/dist/ketchup/p-e8e3c9da.entry.js +1 -0
- package/dist/ketchup/p-ecb7069b.js +135 -0
- package/dist/types/components/kup-button-list/kup-button-list-declarations.d.ts +2 -1
- package/dist/types/components/kup-card/built-in/kup-card-built-in.d.ts +7 -0
- package/dist/types/components/kup-card/built-in/kup-card-numeric.d.ts +2 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +26 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +2 -2
- package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +7 -15
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +1 -1
- package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +3 -0
- package/dist/types/components/kup-echart/kup-echart.d.ts +12 -1
- package/dist/types/components/kup-list/kup-list-declarations.d.ts +3 -7
- package/dist/types/components/kup-list/kup-list-helper.d.ts +6 -6
- package/dist/types/components/kup-list/kup-list.d.ts +2 -2
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +19 -0
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +121 -0
- package/dist/types/components/kup-photo-frame/kup-photo-frame-declarations.d.ts +9 -0
- package/dist/types/components/kup-photo-frame/kup-photo-frame.d.ts +61 -0
- package/dist/types/components.d.ts +249 -28
- package/dist/types/managers/kup-data/kup-data-column-helper.d.ts +9 -1
- package/dist/types/managers/kup-data/kup-data-declarations.d.ts +4 -25
- package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +1 -1
- package/dist/types/managers/kup-data/kup-data.d.ts +63 -27
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +21 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +4 -0
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +27 -0
- package/dist/types/managers/kup-math/kup-math-helper.d.ts +17 -0
- package/dist/types/managers/kup-math/kup-math.d.ts +61 -0
- package/dist/types/managers/kup-objects/kup-objects.d.ts +22 -0
- package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +8 -0
- package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +40 -0
- package/dist/types/types/GenericTypes.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +0 -18
- package/package.json +3 -3
- package/CHANGELOG.md +0 -5
- package/dist/collection/managers/kup-data/kup-data-dataset-helper.js +0 -262
- package/dist/collection/managers/kup-data/kup-data-helper.js +0 -61
- package/dist/collection/utils/state-utils.js +0 -9
- package/dist/ketchup/p-0032a782.entry.js +0 -1
- package/dist/ketchup/p-18c4d083.entry.js +0 -1
- package/dist/ketchup/p-199c972e.entry.js +0 -1
- package/dist/ketchup/p-29800a2e.js +0 -1
- package/dist/ketchup/p-34aa8d8a.entry.js +0 -1
- package/dist/ketchup/p-542279e9.entry.js +0 -1
- package/dist/ketchup/p-5b26a7a8.entry.js +0 -39
- package/dist/ketchup/p-5c97e7ab.js +0 -1
- package/dist/ketchup/p-6817ca85.entry.js +0 -1
- package/dist/ketchup/p-76e674ca.entry.js +0 -1
- package/dist/ketchup/p-78aa6f1b.js +0 -1
- package/dist/ketchup/p-842b66aa.entry.js +0 -1
- package/dist/ketchup/p-894981c0.entry.js +0 -143
- package/dist/ketchup/p-8ac2fa75.entry.js +0 -1
- package/dist/ketchup/p-907c9e11.entry.js +0 -1
- package/dist/ketchup/p-9ae9149b.entry.js +0 -1
- package/dist/ketchup/p-b0d1bdd8.js +0 -9
- package/dist/ketchup/p-e1e4c951.entry.js +0 -1
- package/dist/ketchup/p-eba369d9.entry.js +0 -1
- package/dist/ketchup/p-ed0b8666.js +0 -1
- package/dist/types/managers/kup-data/kup-data-dataset-helper.d.ts +0 -42
- package/dist/types/managers/kup-data/kup-data-helper.d.ts +0 -11
- 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 {
|
|
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 =
|
|
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 =
|
|
309
|
-
groupRow.group.totals[key] =
|
|
310
|
-
|
|
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] =
|
|
317
|
-
|
|
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 =
|
|
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 =
|
|
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] =
|
|
532
|
-
.
|
|
533
|
-
|
|
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.
|
|
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 (
|
|
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 =
|
|
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 =
|
|
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
|
|
610
|
+
footerRow[key] = Math.min(currentFooterValue, cellValue);
|
|
613
611
|
}
|
|
614
612
|
else {
|
|
615
|
-
footerRow[key] = cellValue
|
|
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
|
|
618
|
+
footerRow[key] = Math.max(currentFooterValue, cellValue);
|
|
621
619
|
}
|
|
622
620
|
else {
|
|
623
|
-
footerRow[key] = cellValue
|
|
621
|
+
footerRow[key] = cellValue;
|
|
624
622
|
}
|
|
625
623
|
break;
|
|
626
624
|
default:
|
|
627
625
|
// SUM
|
|
628
626
|
currentFooterValue = footerRow[key] || 0;
|
|
629
|
-
footerRow[key] =
|
|
630
|
-
|
|
631
|
-
|
|
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] =
|
|
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.
|
|
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 = '';
|