@sme.up/ketchup 5.0.0 → 5.1.1
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-5b16c180.js} +4 -4
- package/dist/cjs/{f-button-dbf3cd3a.js → f-button-3b9f32af.js} +2 -2
- package/dist/cjs/{f-cell-93d984ad.js → f-cell-c6ad973a.js} +6 -6
- package/dist/cjs/{f-chip-438213eb.js → f-chip-bed86c4a.js} +3 -3
- package/dist/cjs/{f-image-21865ab7.js → f-image-08a3d340.js} +2 -2
- package/dist/cjs/{index-ab119fad.js → index-8d7bb3be.js} +4 -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 +412 -353
- package/dist/cjs/kup-calendar.cjs.entry.js +8 -8
- package/dist/cjs/kup-cell.cjs.entry.js +8 -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-4227f0a2.js} +2804 -2598
- package/dist/cjs/kup-nav-bar.cjs.entry.js +6 -6
- 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 +7 -7
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-a60ab5fa.js → utils-b9df398c.js} +4 -38
- package/dist/collection/assets/card.js +30 -30
- package/dist/collection/assets/data-table.js +24 -30
- package/dist/collection/assets/echart.js +481 -0
- package/dist/collection/assets/index.js +79 -79
- package/dist/collection/assets/kupdata.js +29 -41
- 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 +2 -1
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +5 -5
- 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-clock.js +1 -1
- package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +21 -22
- package/dist/collection/components/kup-card/kup-card.js +1 -2
- package/dist/collection/components/kup-chip/kup-chip.js +4 -4
- package/dist/collection/components/kup-combobox/kup-combobox.js +6 -6
- 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.js +124 -164
- 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-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-snackbar/kup-snackbar.css +4 -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 +10 -10
- package/dist/collection/components/kup-tree/kup-tree.js +100 -51
- 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 +6 -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 +13 -0
- 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 +151 -0
- package/dist/collection/managers/kup-objects/kup-objects.js +48 -1
- package/dist/collection/managers/kup-theme/kup-theme.js +2 -2
- 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-69f75e2e.js} +4 -4
- package/dist/esm/{f-button-9e835467.js → f-button-7e7607d8.js} +2 -2
- package/dist/esm/{f-cell-f8bb2e04.js → f-cell-e4d83c27.js} +6 -6
- package/dist/esm/{f-chip-953c6915.js → f-chip-51dfefaf.js} +3 -3
- package/dist/esm/{f-image-78c5265e.js → f-image-de331954.js} +2 -2
- package/dist/esm/{index-78f3699d.js → index-aeec9835.js} +4 -1
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +5 -5
- package/dist/esm/kup-autocomplete_27.entry.js +412 -353
- package/dist/esm/kup-calendar.entry.js +8 -8
- package/dist/esm/kup-cell.entry.js +8 -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-0ab94726.js} +2805 -2598
- package/dist/esm/kup-nav-bar.entry.js +6 -6
- 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 +7 -7
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-d1569956.js → utils-35c7a90d.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-0751aaf6.entry.js +1 -0
- package/dist/ketchup/p-10c8d755.js +1 -0
- package/dist/ketchup/{p-aa27f9f7.entry.js → p-24df4f29.entry.js} +2 -2
- package/dist/ketchup/{p-29800a2e.js → p-2d4f19f4.js} +1 -1
- package/dist/ketchup/p-33073f4a.js +1 -0
- package/dist/ketchup/p-3445be1e.entry.js +1 -0
- package/dist/ketchup/p-3813281b.entry.js +1 -0
- package/dist/ketchup/p-4081f5f7.entry.js +1 -0
- package/dist/ketchup/p-47b57d97.js +1 -0
- package/dist/ketchup/p-5186885c.entry.js +1 -0
- package/dist/ketchup/{p-f993f813.js → p-5d190cf5.js} +1 -1
- package/dist/ketchup/p-67c64257.entry.js +1 -0
- package/dist/ketchup/p-68fc1428.entry.js +1 -0
- package/dist/ketchup/p-8be1337b.js +1 -0
- package/dist/ketchup/p-8f735633.entry.js +1 -0
- package/dist/ketchup/p-96101f09.entry.js +39 -0
- package/dist/ketchup/p-9bcda66f.entry.js +1 -0
- package/dist/ketchup/p-b5e1dbfa.entry.js +1 -0
- package/dist/ketchup/{p-ebf4cf56.js → p-c314b1e6.js} +1 -1
- package/dist/ketchup/p-d7af8156.entry.js +1 -0
- package/dist/ketchup/p-dbe87a3f.entry.js +143 -0
- package/dist/ketchup/p-ee33cbe9.js +9 -0
- package/dist/ketchup/p-f250d42b.entry.js +1 -0
- package/dist/ketchup/p-f9c41e20.entry.js +1 -0
- package/dist/ketchup/p-fea316ab.entry.js +1 -0
- package/dist/types/components/kup-button-list/kup-button-list-declarations.d.ts +2 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +0 -2
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +8 -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-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/kup-tree/kup-tree-declarations.d.ts +1 -1
- package/dist/types/components/kup-tree/kup-tree.d.ts +1 -1
- package/dist/types/components.d.ts +110 -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 +11 -0
- package/dist/types/managers/kup-manager/kup-manager.d.ts +2 -0
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +21 -0
- package/dist/types/managers/kup-math/kup-math-helper.d.ts +17 -0
- package/dist/types/managers/kup-math/kup-math.d.ts +60 -0
- package/dist/types/managers/kup-objects/kup-objects.d.ts +22 -0
- package/dist/types/utils/utils.d.ts +0 -18
- package/package.json +2 -2
- 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-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/ketchup/p-fa540f82.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
|
@@ -44,16 +44,16 @@ function prepareList(options) {
|
|
|
44
44
|
const listData = [];
|
|
45
45
|
if (options.enableMerge) {
|
|
46
46
|
listData.push({
|
|
47
|
-
text: dom.ketchup.language.translate(KupLanguageGeneric.MERGE),
|
|
48
|
-
value: KupLanguageGeneric.MERGE,
|
|
49
47
|
icon: 'library_add',
|
|
48
|
+
id: KupLanguageGeneric.MERGE,
|
|
49
|
+
value: dom.ketchup.language.translate(KupLanguageGeneric.MERGE),
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
if (options.enableMove) {
|
|
53
53
|
listData.push({
|
|
54
|
-
text: dom.ketchup.language.translate(KupLanguageGeneric.MOVE),
|
|
55
|
-
value: KupLanguageGeneric.MOVE,
|
|
56
54
|
icon: 'swap_horiz',
|
|
55
|
+
id: KupLanguageGeneric.MOVE,
|
|
56
|
+
value: dom.ketchup.language.translate(KupLanguageGeneric.MOVE),
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
return listData.length > 0 ? (h("kup-list", { data: listData, showIcons: true, "onkup-list-click": (e) => listClick(e, options) })) : null;
|
|
@@ -64,29 +64,29 @@ function prepareCombobox(options, numericalColumnsExist) {
|
|
|
64
64
|
dom.ketchup.objects.isNumber(options.starterColumn.obj);
|
|
65
65
|
if (numeric) {
|
|
66
66
|
comboListData.push({
|
|
67
|
-
|
|
68
|
-
value: KupLanguageTotals.AVERAGE,
|
|
67
|
+
id: KupLanguageTotals.AVERAGE,
|
|
68
|
+
value: dom.ketchup.language.translate(KupLanguageTotals.AVERAGE),
|
|
69
69
|
}, {
|
|
70
|
-
|
|
71
|
-
value: KupLanguageTotals.DIFFERENCE,
|
|
70
|
+
id: KupLanguageTotals.DIFFERENCE,
|
|
71
|
+
value: dom.ketchup.language.translate(KupLanguageTotals.DIFFERENCE),
|
|
72
72
|
}, {
|
|
73
|
-
|
|
74
|
-
value: KupLanguageTotals.PRODUCT,
|
|
73
|
+
id: KupLanguageTotals.PRODUCT,
|
|
74
|
+
value: dom.ketchup.language.translate(KupLanguageTotals.PRODUCT),
|
|
75
75
|
}, {
|
|
76
|
-
|
|
77
|
-
value: KupLanguageTotals.SUM,
|
|
76
|
+
id: KupLanguageTotals.SUM,
|
|
77
|
+
value: dom.ketchup.language.translate(KupLanguageTotals.SUM),
|
|
78
78
|
}, {
|
|
79
|
-
|
|
80
|
-
value: `
|
|
79
|
+
id: `([${options.starterColumn.name}]/[${options.receivingColumn.name}])*100`,
|
|
80
|
+
value: `[${options.starterColumn.name}] / [${options.receivingColumn.name}] * 100`,
|
|
81
81
|
}, {
|
|
82
|
-
|
|
83
|
-
value: `
|
|
82
|
+
id: `([${options.receivingColumn.name}]/[${options.starterColumn.name}])*100`,
|
|
83
|
+
value: `[${options.receivingColumn.name}] / [${options.starterColumn.name}] * 100`,
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
87
|
comboListData.push({
|
|
88
|
-
|
|
89
|
-
value: KupLanguageColumn.NO_FORMULA,
|
|
88
|
+
id: KupLanguageColumn.NO_FORMULA,
|
|
89
|
+
value: dom.ketchup.language.translate(KupLanguageColumn.NO_FORMULA),
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
const comboData = {
|
|
@@ -119,8 +119,7 @@ function typeColumn(e, component) {
|
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
function listClick(e, options) {
|
|
122
|
-
|
|
123
|
-
switch (value) {
|
|
122
|
+
switch (e.detail.selected.id) {
|
|
124
123
|
case KupLanguageGeneric.MERGE:
|
|
125
124
|
if (options.mergeCb) {
|
|
126
125
|
options.mergeCb();
|
|
@@ -139,7 +138,7 @@ async function applyFormula(component) {
|
|
|
139
138
|
if (combobox) {
|
|
140
139
|
const value = (await combobox.getValue());
|
|
141
140
|
if (premadeFormulas.includes(value)) {
|
|
142
|
-
dom.ketchup.data.
|
|
141
|
+
dom.ketchup.data.column.new(options.data, KupDataNewColumnTypes.MATH, {
|
|
143
142
|
columns: [
|
|
144
143
|
options.receivingColumn.name,
|
|
145
144
|
options.starterColumn.name,
|
|
@@ -151,7 +150,7 @@ async function applyFormula(component) {
|
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
152
|
else {
|
|
154
|
-
const result = dom.ketchup.data.
|
|
153
|
+
const result = dom.ketchup.data.column.new(options.data, KupDataNewColumnTypes.MATH, {
|
|
155
154
|
operation: value,
|
|
156
155
|
});
|
|
157
156
|
if (typeof result === 'string' || result instanceof String) {
|
|
@@ -83,7 +83,7 @@ export class KupCard {
|
|
|
83
83
|
this.scalingActive = false;
|
|
84
84
|
this.componentWrapper = null;
|
|
85
85
|
this.colorPicker = null;
|
|
86
|
-
this.firstColorPickerChange =
|
|
86
|
+
this.firstColorPickerChange = true;
|
|
87
87
|
}
|
|
88
88
|
onKupClick(id, value) {
|
|
89
89
|
this.kupClick.emit({
|
|
@@ -256,7 +256,6 @@ export class KupCard {
|
|
|
256
256
|
const color = colorPickerOptions
|
|
257
257
|
? colorPickerOptions.initialValue
|
|
258
258
|
: null;
|
|
259
|
-
this.firstColorPickerChange = true;
|
|
260
259
|
if (!this.colorPicker) {
|
|
261
260
|
this.colorPicker = new Picker({
|
|
262
261
|
alpha: false,
|
|
@@ -46,7 +46,7 @@ export class KupChip {
|
|
|
46
46
|
const isChoice = this.type.toLowerCase() === FChipType.CHOICE;
|
|
47
47
|
const isFilter = this.type.toLowerCase() === FChipType.FILTER;
|
|
48
48
|
if (isChoice) {
|
|
49
|
-
this.kupManager.data.
|
|
49
|
+
this.kupManager.data.node.setProperties(this.data, { checked: false }, true, [chip]);
|
|
50
50
|
}
|
|
51
51
|
if (isChoice || isFilter) {
|
|
52
52
|
chip.checked = chip.checked ? false : true;
|
|
@@ -69,7 +69,7 @@ export class KupChip {
|
|
|
69
69
|
this.kupIconClick.emit({
|
|
70
70
|
comp: this,
|
|
71
71
|
id: this.rootElement.id,
|
|
72
|
-
chip: this.kupManager.data.
|
|
72
|
+
chip: this.kupManager.data.node.remove(this.data, chip),
|
|
73
73
|
});
|
|
74
74
|
this.refresh();
|
|
75
75
|
}
|
|
@@ -83,7 +83,7 @@ export class KupChip {
|
|
|
83
83
|
if (newData.columns) {
|
|
84
84
|
this.kupManager.debug.logMessage(this, 'Detected KupDataDataset: converting rows to nodes.', KupDebugCategory.WARNING);
|
|
85
85
|
const data = this.data;
|
|
86
|
-
this.data = this.kupManager.data.
|
|
86
|
+
this.data = this.kupManager.data.row.toNode(data);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
/*-------------------------------------------------*/
|
|
@@ -176,7 +176,7 @@ export class KupChip {
|
|
|
176
176
|
props.onExpansionClick.push((chip, e) => {
|
|
177
177
|
chip.isExpanded = !chip.isExpanded ? true : false;
|
|
178
178
|
if (e.ctrlKey && chip.children && chip.children.length > 0) {
|
|
179
|
-
this.kupManager.data.
|
|
179
|
+
this.kupManager.data.node.setProperties(chip.children, { isExpanded: chip.isExpanded }, true);
|
|
180
180
|
}
|
|
181
181
|
this.refresh();
|
|
182
182
|
});
|
|
@@ -146,7 +146,7 @@ export class KupCombobox {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
onKupItemClick(e) {
|
|
149
|
-
this.onKupChange(e.detail.selected.
|
|
149
|
+
this.onKupChange(e.detail.selected.id);
|
|
150
150
|
__classPrivateFieldGet(this, _KupCombobox_instances, "m", _KupCombobox_closeList).call(this);
|
|
151
151
|
if (__classPrivateFieldGet(this, _KupCombobox_textfieldEl, "f")) {
|
|
152
152
|
__classPrivateFieldGet(this, _KupCombobox_textfieldEl, "f").focus();
|
|
@@ -808,8 +808,8 @@ _KupCombobox_kupManager = new WeakMap(), _KupCombobox_elStyle = new WeakMap(), _
|
|
|
808
808
|
__classPrivateFieldGet(this, _KupCombobox_kupManager, "f").removeClickCallback(__classPrivateFieldGet(this, _KupCombobox_clickCb, "f"));
|
|
809
809
|
}, _KupCombobox_isListOpened = function _KupCombobox_isListOpened() {
|
|
810
810
|
return __classPrivateFieldGet(this, _KupCombobox_listEl, "f").menuVisible == true;
|
|
811
|
-
}, _KupCombobox_consistencyCheck = function _KupCombobox_consistencyCheck(e,
|
|
812
|
-
let ret = consistencyCheck(
|
|
811
|
+
}, _KupCombobox_consistencyCheck = function _KupCombobox_consistencyCheck(e, idIn, setValue) {
|
|
812
|
+
let ret = consistencyCheck(idIn, this.data['kup-list'], __classPrivateFieldGet(this, _KupCombobox_listEl, "f"), this.selectMode, this.displayMode, e);
|
|
813
813
|
if (ret.exists && setValue) {
|
|
814
814
|
this.value = ret.value;
|
|
815
815
|
this.displayedValue = ret.displayedValue;
|
|
@@ -818,10 +818,10 @@ _KupCombobox_kupManager = new WeakMap(), _KupCombobox_elStyle = new WeakMap(), _
|
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
820
|
else {
|
|
821
|
-
this.value =
|
|
822
|
-
this.displayedValue =
|
|
821
|
+
this.value = idIn;
|
|
822
|
+
this.displayedValue = idIn;
|
|
823
823
|
if (__classPrivateFieldGet(this, _KupCombobox_listEl, "f") != null) {
|
|
824
|
-
__classPrivateFieldGet(this, _KupCombobox_listEl, "f").filter =
|
|
824
|
+
__classPrivateFieldGet(this, _KupCombobox_listEl, "f").filter = idIn;
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
827
|
return ret;
|
|
@@ -40,8 +40,6 @@ export var KupDataTableProps;
|
|
|
40
40
|
KupDataTableProps["rowActions"] = "Sets the actions of the rows.";
|
|
41
41
|
KupDataTableProps["rowsPerPage"] = "Sets the number of rows per page to display.";
|
|
42
42
|
KupDataTableProps["scrollOnHover"] = "Activates the scroll on hover function.";
|
|
43
|
-
KupDataTableProps["selectRow"] = "Selects the row at the specified rendered rows prosition (base 1).";
|
|
44
|
-
KupDataTableProps["selectRowsById"] = "Semicolon separated rows id to select.";
|
|
45
43
|
KupDataTableProps["showCustomization"] = "If set to true, displays the button to open the customization panel.";
|
|
46
44
|
KupDataTableProps["showFilters"] = "When set to true enables the column filters.";
|
|
47
45
|
KupDataTableProps["showFooter"] = "When set to true shows the footer.";
|
|
@@ -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;
|