sea-chart 0.0.85 → 0.0.86
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/dist/settings/table-settings/data-settings.js +2 -0
- package/dist/settings/widgets/group-by.js +3 -3
- package/dist/utils/chart-utils/base-utils.js +8 -0
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +48 -67
- package/dist/utils/sql/chart-data-sql.js +0 -4
- package/dist/view/wrapper/index.js +1 -2
- package/dist/view/wrapper/table/index.css +8 -4
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +53 -4
- package/dist/view/wrapper/table/two-dimension-table.js +2 -2
- package/package.json +1 -1
|
@@ -506,6 +506,7 @@ const DataSettings = _ref => {
|
|
|
506
506
|
tables: tables,
|
|
507
507
|
className: "selected-x-axis",
|
|
508
508
|
label: intl.get('Row_grouping_field'),
|
|
509
|
+
isRenderNoUsed: false,
|
|
509
510
|
selectedTableId: table_id,
|
|
510
511
|
selectedColumnKey: groupby_column_key,
|
|
511
512
|
selectedDateGranularity: groupby_date_granularity,
|
|
@@ -524,6 +525,7 @@ const DataSettings = _ref => {
|
|
|
524
525
|
tables: tables,
|
|
525
526
|
className: "selected-x-axis",
|
|
526
527
|
label: intl.get('Column_grouping_field'),
|
|
528
|
+
isRenderNoUsed: true,
|
|
527
529
|
selectedTableId: table_id,
|
|
528
530
|
selectedColumnKey: column_groupby_column_key,
|
|
529
531
|
selectedDateGranularity: column_groupby_date_granularity,
|
|
@@ -84,8 +84,8 @@ class GroupBy extends Component {
|
|
|
84
84
|
};
|
|
85
85
|
this.getColumnOptions = columns => {
|
|
86
86
|
const {
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
type,
|
|
88
|
+
isRenderNoUsed
|
|
89
89
|
} = this.props;
|
|
90
90
|
let newColumns = columns.map(column => {
|
|
91
91
|
return {
|
|
@@ -104,7 +104,7 @@ class GroupBy extends Component {
|
|
|
104
104
|
} else if (type === CHART_TYPE.SCATTER) {
|
|
105
105
|
newColumns = newColumns.filter(column => NUMBERIC_COLUMN_TYPE.includes(column.value.type));
|
|
106
106
|
}
|
|
107
|
-
if (
|
|
107
|
+
if (isRenderNoUsed) {
|
|
108
108
|
newColumns.unshift({
|
|
109
109
|
value: {
|
|
110
110
|
key: '',
|
|
@@ -310,6 +310,14 @@ BaseUtils.getSummaryValue = (_ref, currentValue, nextValue) => {
|
|
|
310
310
|
if (currentValue === null && nextValue === null) return null;
|
|
311
311
|
if (currentValue === null) return nextValue;
|
|
312
312
|
if (nextValue === null) return currentValue;
|
|
313
|
+
if (currentValue && nextValue) {
|
|
314
|
+
if (summaryMethod === 'MAX') {
|
|
315
|
+
return Math.max(currentValue, nextValue);
|
|
316
|
+
}
|
|
317
|
+
if (summaryMethod === 'MIN') {
|
|
318
|
+
return Math.min(currentValue, nextValue);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
313
321
|
}
|
|
314
322
|
return (currentValue - 0 || 0) + (nextValue - 0 || 0);
|
|
315
323
|
};
|
|
@@ -5,6 +5,8 @@ import { isArrayCellValue } from '../../cell-value-utils';
|
|
|
5
5
|
import { getFormattedLabel, isValidRow } from '../../row-utils';
|
|
6
6
|
import BaseUtils from '../base-utils';
|
|
7
7
|
import { summaryMethodColumn2SqlColumn } from '../../sql/column-2-sql-column';
|
|
8
|
+
|
|
9
|
+
// one
|
|
8
10
|
async function calculateOneDimensionTable(chart, value, _ref) {
|
|
9
11
|
let {
|
|
10
12
|
getViewRows,
|
|
@@ -56,7 +58,7 @@ async function calculateOneDimensionTable(chart, value, _ref) {
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
});
|
|
59
|
-
const summary_columns_option_keys = Array.isArray(summary_columns) ? summary_columns.map(option => option.
|
|
61
|
+
const summary_columns_option_keys = Array.isArray(summary_columns) ? summary_columns.map(option => option.column_key) : [];
|
|
60
62
|
const statisticColumnKeys = [summary_column_key, ...summary_columns_option_keys];
|
|
61
63
|
const validStatisticColumnKeys = statisticColumnKeys;
|
|
62
64
|
let statisticColumns = validStatisticColumnKeys.map(key => {
|
|
@@ -70,7 +72,7 @@ async function calculateOneDimensionTable(chart, value, _ref) {
|
|
|
70
72
|
}
|
|
71
73
|
Array.isArray(summary_columns) && summary_columns.forEach((option, index) => {
|
|
72
74
|
if (statisticColumns[index + 1]) {
|
|
73
|
-
statisticColumns[index + 1].method = option.
|
|
75
|
+
statisticColumns[index + 1].method = option.summary_method;
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
const {
|
|
@@ -205,6 +207,8 @@ function getOneDimensionTotal(columns, summary_type, formula_rows) {
|
|
|
205
207
|
pivot_columns_total
|
|
206
208
|
};
|
|
207
209
|
}
|
|
210
|
+
|
|
211
|
+
// two
|
|
208
212
|
async function calculateTwoDimensionTable(chart, value, _ref2) {
|
|
209
213
|
let {
|
|
210
214
|
getViewRows,
|
|
@@ -239,34 +243,7 @@ async function calculateTwoDimensionTable(chart, value, _ref2) {
|
|
|
239
243
|
const summaryColumn = getTableColumnByKey(table, summary_column_key);
|
|
240
244
|
const statRows = await getViewRows(view, table);
|
|
241
245
|
const formulaRows = await getTableFormulaResults(table, statRows);
|
|
242
|
-
const pivot_summary_multiple_columns = [];
|
|
243
|
-
Array.isArray(summary_columns) && summary_columns.forEach(item => {
|
|
244
|
-
const column = getTableColumnByKey(table, item.column_key);
|
|
245
|
-
if (column && isNumericColumn(column)) {
|
|
246
|
-
pivot_summary_multiple_columns.push({
|
|
247
|
-
key: item.column_key,
|
|
248
|
-
type: column.type,
|
|
249
|
-
data: column.data,
|
|
250
|
-
method: item.summary_method,
|
|
251
|
-
column_name: column.name
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
// [{key: null}, {key: cell_value}, {key: cell_value}, ...]
|
|
257
246
|
let pivot_columns = [];
|
|
258
|
-
|
|
259
|
-
// [
|
|
260
|
-
// {
|
|
261
|
-
// name: '',
|
|
262
|
-
// cells: {
|
|
263
|
-
// [key1]: {rows: [], total: ''},
|
|
264
|
-
// [key2]: {rows: [], total: ''},
|
|
265
|
-
// [key3]: {rows: [], total: ''},
|
|
266
|
-
// }
|
|
267
|
-
// },
|
|
268
|
-
// ...
|
|
269
|
-
// ]
|
|
270
247
|
let pivot_rows = [];
|
|
271
248
|
statRows.forEach(row => {
|
|
272
249
|
const {
|
|
@@ -329,9 +306,10 @@ async function calculateTwoDimensionTable(chart, value, _ref2) {
|
|
|
329
306
|
pivot_columns,
|
|
330
307
|
pivot_columns_total: new_pivot_columns_total,
|
|
331
308
|
pivot_table_total,
|
|
332
|
-
pivot_summary_multiple_columns,
|
|
333
309
|
formulaRows,
|
|
334
|
-
dimensions: TABLE_DIMENSIONS.TWO
|
|
310
|
+
dimensions: TABLE_DIMENSIONS.TWO,
|
|
311
|
+
summary_columns: [summaryColumn, ...(summary_columns === null || summary_columns === void 0 ? void 0 : summary_columns.map(item => getTableColumnByKey(table, item.column_key)))],
|
|
312
|
+
isSingleNumericColumn: !summary_columns.length ? 'true' : 'false'
|
|
335
313
|
};
|
|
336
314
|
}
|
|
337
315
|
function updateTwoDimensionColumns(value, pivot_columns, column, row, formulaRow, isIncludeEmpty, dateGranularity, geolocationGranularity, isRowGroupbyColumnDataAsAnArray) {
|
|
@@ -434,7 +412,7 @@ function updateTwoDimensionRows(pivot_rows, pivot_columns, index, name, row, isC
|
|
|
434
412
|
const nextValue = row[current === null || current === void 0 ? void 0 : current.column.key];
|
|
435
413
|
const currentValue = Object.values(cells[key].total).find(item => item[2] === columnKey)[1];
|
|
436
414
|
const computedValue = BaseUtils.getSummaryValue({
|
|
437
|
-
summaryMethod: current.summary_method,
|
|
415
|
+
summaryMethod: current.summary_method.toUpperCase(),
|
|
438
416
|
summaryColumn: current.column
|
|
439
417
|
}, currentValue, nextValue);
|
|
440
418
|
const columnName = current.column.name;
|
|
@@ -528,21 +506,6 @@ function updateTwoDimensionRows(pivot_rows, pivot_columns, index, name, row, isC
|
|
|
528
506
|
total
|
|
529
507
|
});
|
|
530
508
|
}
|
|
531
|
-
function isSameName(prevName, currName) {
|
|
532
|
-
if (isNumber(prevName) && isNumber(currName)) {
|
|
533
|
-
return prevName === currName;
|
|
534
|
-
}
|
|
535
|
-
if (!prevName && !currName) {
|
|
536
|
-
return prevName === null && currName === null || prevName === undefined && currName === undefined || isNaN(prevName) && isNaN(currName);
|
|
537
|
-
}
|
|
538
|
-
return prevName === currName;
|
|
539
|
-
}
|
|
540
|
-
function isSameGroup(isColumnDataAsAnArray, source, target) {
|
|
541
|
-
if (isColumnDataAsAnArray) {
|
|
542
|
-
return (!source || source.length === 0) && !target || source && source.includes(target);
|
|
543
|
-
}
|
|
544
|
-
return source === null && target === null || source === undefined && target === undefined || source === target;
|
|
545
|
-
}
|
|
546
509
|
function getTwoDimensionTotal(summaryColumn, summary_type, summary_method, formula_rows) {
|
|
547
510
|
let pivot_rows = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
548
511
|
let pivot_columns = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
|
|
@@ -619,6 +582,23 @@ function getTwoDimensionTotal(summaryColumn, summary_type, summary_method, formu
|
|
|
619
582
|
pivot_table_total
|
|
620
583
|
};
|
|
621
584
|
}
|
|
585
|
+
|
|
586
|
+
// utils
|
|
587
|
+
function isSameName(prevName, currName) {
|
|
588
|
+
if (isNumber(prevName) && isNumber(currName)) {
|
|
589
|
+
return prevName === currName;
|
|
590
|
+
}
|
|
591
|
+
if (!prevName && !currName) {
|
|
592
|
+
return prevName === null && currName === null || prevName === undefined && currName === undefined || isNaN(prevName) && isNaN(currName);
|
|
593
|
+
}
|
|
594
|
+
return prevName === currName;
|
|
595
|
+
}
|
|
596
|
+
function isSameGroup(isColumnDataAsAnArray, source, target) {
|
|
597
|
+
if (isColumnDataAsAnArray) {
|
|
598
|
+
return (!source || source.length === 0) && !target || source && source.includes(target);
|
|
599
|
+
}
|
|
600
|
+
return source === null && target === null || source === undefined && target === undefined || source === target;
|
|
601
|
+
}
|
|
622
602
|
function getTotal(summary_column, summary_type, summary_method) {
|
|
623
603
|
let rows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
624
604
|
let formula_rows = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
@@ -654,6 +634,7 @@ function getTotal(summary_column, summary_type, summary_method) {
|
|
|
654
634
|
total++;
|
|
655
635
|
}
|
|
656
636
|
});
|
|
637
|
+
total = getTotalByType(oldTotal, total);
|
|
657
638
|
return total;
|
|
658
639
|
}
|
|
659
640
|
if (summary_column && isDateColumn(summary_column)) {
|
|
@@ -711,22 +692,10 @@ function getTotal(summary_column, summary_type, summary_method) {
|
|
|
711
692
|
}
|
|
712
693
|
});
|
|
713
694
|
if (summary_method === 'Sum') {
|
|
714
|
-
|
|
715
|
-
const newTotal = JSON.parse(JSON.stringify(oldTotal));
|
|
716
|
-
newTotal[0][1] = Number.parseFloat(sum.toFixed(8));
|
|
717
|
-
total = newTotal;
|
|
718
|
-
} else {
|
|
719
|
-
total = Number.parseFloat(sum.toFixed(8));
|
|
720
|
-
}
|
|
695
|
+
total = getTotalByType(oldTotal, Number.parseFloat(sum.toFixed(8)));
|
|
721
696
|
} else if (summary_method === 'Mean') {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
const val = validNumbersCount === 0 ? 0 : Number.parseFloat((sum / validNumbersCount).toFixed(8));
|
|
725
|
-
newTotal[0][1] = val;
|
|
726
|
-
total = newTotal;
|
|
727
|
-
} else {
|
|
728
|
-
total = validNumbersCount === 0 ? 0 : Number.parseFloat((sum / validNumbersCount).toFixed(8));
|
|
729
|
-
}
|
|
697
|
+
const val = validNumbersCount === 0 ? 0 : Number.parseFloat((sum / validNumbersCount).toFixed(8));
|
|
698
|
+
total = getTotalByType(oldTotal, val);
|
|
730
699
|
}
|
|
731
700
|
break;
|
|
732
701
|
}
|
|
@@ -759,15 +728,15 @@ function getTotal(summary_column, summary_type, summary_method) {
|
|
|
759
728
|
let formulaRow = formula_rows[result._id];
|
|
760
729
|
if (formulaRow) {
|
|
761
730
|
if (formulaRow[summary_column_key] && typeof formulaRow[summary_column_key] === 'object') {
|
|
762
|
-
total = formulaRow[summary_column_key][0];
|
|
731
|
+
total = getTotalByType(oldTotal, formulaRow[summary_column_key][0]);
|
|
763
732
|
} else {
|
|
764
|
-
|
|
733
|
+
getTotalByType(oldTotal, formulaRow[summary_column_key]);
|
|
765
734
|
}
|
|
766
735
|
} else {
|
|
767
|
-
total = null;
|
|
736
|
+
total = getTotalByType(oldTotal, null);
|
|
768
737
|
}
|
|
769
738
|
} else {
|
|
770
|
-
total = result[summary_column_key];
|
|
739
|
+
total = getTotalByType(oldTotal, result[summary_column_key]);
|
|
771
740
|
}
|
|
772
741
|
}
|
|
773
742
|
break;
|
|
@@ -781,7 +750,7 @@ function getTotal(summary_column, summary_type, summary_method) {
|
|
|
781
750
|
}
|
|
782
751
|
// formula_rows result can be '#VALUE!'
|
|
783
752
|
if (total === '#VALUE!') {
|
|
784
|
-
total = 0;
|
|
753
|
+
total = getTotalByType(oldTotal, 0);
|
|
785
754
|
}
|
|
786
755
|
return total || 0;
|
|
787
756
|
}
|
|
@@ -831,6 +800,18 @@ function getDateMaxOrMinTotal(dateArr, type) {
|
|
|
831
800
|
dateIndex = list.indexOf(dateValue);
|
|
832
801
|
return dateArr[dateIndex];
|
|
833
802
|
}
|
|
803
|
+
function getTotalByType(oldTotal, value) {
|
|
804
|
+
let newTotal = '';
|
|
805
|
+
if (Array.isArray(oldTotal)) {
|
|
806
|
+
newTotal = JSON.parse(JSON.stringify(oldTotal));
|
|
807
|
+
newTotal[0][1] = value;
|
|
808
|
+
} else {
|
|
809
|
+
newTotal = value;
|
|
810
|
+
}
|
|
811
|
+
return newTotal;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// index
|
|
834
815
|
function calculator(chart, value, _ref3) {
|
|
835
816
|
let {
|
|
836
817
|
getViewRows,
|
|
@@ -502,10 +502,6 @@ class ChartDataSQL {
|
|
|
502
502
|
const groupby_include_empty_cells = this.chart['groupby_include_empty_cells'] || false;
|
|
503
503
|
let summary_method = this.chart['summary_method'] || '';
|
|
504
504
|
const summary_columns = this.chart['summary_columns'] || [];
|
|
505
|
-
if (!summary_method) {
|
|
506
|
-
this.error = 'Summary_method_is_not_valid';
|
|
507
|
-
return '';
|
|
508
|
-
}
|
|
509
505
|
const groupby_column = this._get_column_by_key(groupby_column_key);
|
|
510
506
|
if (!groupby_column) {
|
|
511
507
|
this.error = 'Group_by_column_not_found';
|
|
@@ -87,8 +87,7 @@ const Wrapper = _ref => {
|
|
|
87
87
|
summaryColumns: summary_columns,
|
|
88
88
|
columnGroupbyColumn: columnGroupbyColumn,
|
|
89
89
|
summaryMethod: summary_method,
|
|
90
|
-
chartTableColumns: chartTableColumns
|
|
91
|
-
isCalculateByView: isCalculateByView
|
|
90
|
+
chartTableColumns: chartTableColumns
|
|
92
91
|
}));
|
|
93
92
|
}
|
|
94
93
|
case CHART_TYPE.COMBINATION:
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
.sea-chart-pivot-table th,
|
|
20
20
|
.sea-chart-pivot-table td {
|
|
21
|
-
padding:
|
|
21
|
+
padding: 5px;
|
|
22
22
|
border-right: 1px solid #ccc;
|
|
23
23
|
border-left: 1px solid #ccc;
|
|
24
24
|
border-bottom: none;
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
text-overflow: ellipsis;
|
|
31
31
|
white-space: nowrap;
|
|
32
32
|
text-align: center;
|
|
33
|
+
height: 32px;
|
|
34
|
+
max-height: 32px;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
.sea-chart-pivot-table .column-title,
|
|
@@ -161,9 +163,11 @@
|
|
|
161
163
|
|
|
162
164
|
.sea-chart-pivot-table .pivot-table-header-summary-columns-container > div,
|
|
163
165
|
.sea-chart-pivot-table .pivot-cells-container > div {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
height: 100%;
|
|
167
|
+
width: 100%;
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
align-items: center;
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
.sea-chart-pivot-table .pivot-table-header-summary-columns-container > div:not(:first-child),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
+
import { getTableById } from 'dtable-utils';
|
|
3
4
|
import { BaseUtils, ObjectUtils } from '../../../utils';
|
|
4
5
|
import intl from '../../../intl';
|
|
5
|
-
import { CHART_THEME_COLOR } from '../../../constants';
|
|
6
|
+
import { CHART_THEME_COLOR, CHART_SUMMARY_TYPE } from '../../../constants';
|
|
6
7
|
import PivotTableDisplayName from './pivot-table-display-name';
|
|
7
8
|
class OneDimensionTableNoNumericColumns extends PureComponent {
|
|
8
9
|
constructor() {
|
|
@@ -14,11 +15,15 @@ class OneDimensionTableNoNumericColumns extends PureComponent {
|
|
|
14
15
|
chart
|
|
15
16
|
} = this.props;
|
|
16
17
|
const {
|
|
17
|
-
display_total = true
|
|
18
|
+
display_total = true,
|
|
19
|
+
table_id,
|
|
20
|
+
summary_type
|
|
18
21
|
} = chart.config;
|
|
19
22
|
const {
|
|
20
23
|
name: groupName
|
|
21
24
|
} = groupbyColumn;
|
|
25
|
+
const isCount = summary_type === CHART_SUMMARY_TYPE.COUNT;
|
|
26
|
+
const columnName = isCount ? intl.get('Amount') : this.getColumnName();
|
|
22
27
|
const {
|
|
23
28
|
rowIdx: selectRowIdx,
|
|
24
29
|
cellIdx: selectedCellIdx
|
|
@@ -28,12 +33,35 @@ class OneDimensionTableNoNumericColumns extends PureComponent {
|
|
|
28
33
|
className: "seatable-table-header-sm"
|
|
29
34
|
}, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
30
35
|
className: "pivot-table-header"
|
|
31
|
-
}, groupName),
|
|
36
|
+
}, groupName), /*#__PURE__*/React.createElement("th", {
|
|
37
|
+
className: classnames('pivot-table-header', {
|
|
38
|
+
'selected-pivot-cell-top': isSelectedTotalCellBottom
|
|
39
|
+
})
|
|
40
|
+
}, /*#__PURE__*/React.createElement("div", null, columnName)), display_total && /*#__PURE__*/React.createElement("th", {
|
|
32
41
|
className: classnames('pivot-table-header', {
|
|
33
42
|
'selected-pivot-cell-top': isSelectedTotalCellBottom
|
|
34
43
|
})
|
|
35
44
|
}, /*#__PURE__*/React.createElement("div", null, intl.get('Total')))));
|
|
36
45
|
};
|
|
46
|
+
this.getColumnName = () => {
|
|
47
|
+
const {
|
|
48
|
+
tables,
|
|
49
|
+
result,
|
|
50
|
+
chart
|
|
51
|
+
} = this.props;
|
|
52
|
+
const {
|
|
53
|
+
pivot_columns
|
|
54
|
+
} = result;
|
|
55
|
+
const {
|
|
56
|
+
table_id
|
|
57
|
+
} = chart.config;
|
|
58
|
+
if (Array.isArray(pivot_columns) && pivot_columns.length !== 0) {
|
|
59
|
+
const table = getTableById(tables, table_id);
|
|
60
|
+
const column = table === null || table === void 0 ? void 0 : table.columns.find(item => item.key === pivot_columns[0].key);
|
|
61
|
+
return (column === null || column === void 0 ? void 0 : column.name) || '';
|
|
62
|
+
}
|
|
63
|
+
return '';
|
|
64
|
+
};
|
|
37
65
|
this.toggleRecords = (cell, selectedCell) => {
|
|
38
66
|
if (window.isMobile) return;
|
|
39
67
|
const {
|
|
@@ -81,7 +109,6 @@ class OneDimensionTableNoNumericColumns extends PureComponent {
|
|
|
81
109
|
let pivotColumnCells = [];
|
|
82
110
|
const isSelectRowTotalCellRight = selectRowIdx === pivotRowsLen && selectedCellIdx === 0;
|
|
83
111
|
const isSelectTotal = selectRowIdx === pivotRowsLen && selectedCellIdx === 0;
|
|
84
|
-
// eslint-disable-next-line
|
|
85
112
|
const total = ObjectUtils.hasOwnProperty(pivot_columns_total, 'total') ? pivot_columns_total['total'] : 0;
|
|
86
113
|
const summaryDisplayValue = BaseUtils.getSummaryValueDisplayString(summaryColumn, total);
|
|
87
114
|
const isValidSummaryDisplayValue = BaseUtils.isValidValue(summaryDisplayValue, display_empty);
|
|
@@ -108,6 +135,18 @@ class OneDimensionTableNoNumericColumns extends PureComponent {
|
|
|
108
135
|
column: groupbyColumn,
|
|
109
136
|
rowData: rowItem,
|
|
110
137
|
globalTheme: globalTheme
|
|
138
|
+
})), /*#__PURE__*/React.createElement("td", {
|
|
139
|
+
className: classnames('pivot-cell', {
|
|
140
|
+
'pivot-empty-cell': !isValidTotalDisplayValue,
|
|
141
|
+
'selected-pivot-cell': isSelectedTotalCell,
|
|
142
|
+
'selected-pivot-cell-top': isSelectedTotalCellTop,
|
|
143
|
+
'selected-pivot-cell-left': isSelectedTotalCellLeft
|
|
144
|
+
}),
|
|
145
|
+
total: totalDisplayValue
|
|
146
|
+
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
147
|
+
className: classnames({
|
|
148
|
+
'selected-pivot-cell-border': isSelectedTotalCell
|
|
149
|
+
})
|
|
111
150
|
})), display_total && /*#__PURE__*/React.createElement("td", {
|
|
112
151
|
className: classnames('pivot-cell', {
|
|
113
152
|
'pivot-empty-cell': !isValidTotalDisplayValue,
|
|
@@ -134,6 +173,16 @@ class OneDimensionTableNoNumericColumns extends PureComponent {
|
|
|
134
173
|
'selected-pivot-cell-left': isSelectRowTotalCellRight
|
|
135
174
|
})
|
|
136
175
|
}, /*#__PURE__*/React.createElement("div", null, intl.get('Total'))), /*#__PURE__*/React.createElement("td", {
|
|
176
|
+
className: classnames('pivot-cell pivot-table-total', {
|
|
177
|
+
'pivot-empty-cell': !isValidSummaryDisplayValue,
|
|
178
|
+
'selected-pivot-cell': isSelectTotal
|
|
179
|
+
}),
|
|
180
|
+
title: isValidSummaryDisplayValue ? summaryDisplayValue : ''
|
|
181
|
+
}, isValidSummaryDisplayValue ? summaryDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
182
|
+
className: classnames({
|
|
183
|
+
'selected-pivot-cell-border': isSelectTotal
|
|
184
|
+
})
|
|
185
|
+
})), /*#__PURE__*/React.createElement("td", {
|
|
137
186
|
className: classnames('pivot-cell pivot-table-total', {
|
|
138
187
|
'pivot-empty-cell': !isValidSummaryDisplayValue,
|
|
139
188
|
'selected-pivot-cell': isSelectTotal
|
|
@@ -132,9 +132,9 @@ class TwoDimensionTable extends PureComponent {
|
|
|
132
132
|
};
|
|
133
133
|
this.renderEmpty = (summaryColumns, cellIdx) => {
|
|
134
134
|
if (summaryColumns && (summaryColumns === null || summaryColumns === void 0 ? void 0 : summaryColumns.length) !== 0) {
|
|
135
|
-
return summaryColumns
|
|
135
|
+
return summaryColumns.map(item => {
|
|
136
136
|
return /*#__PURE__*/React.createElement("div", {
|
|
137
|
-
key: "table-cell-".concat(
|
|
137
|
+
key: "table-cell-".concat(item.key),
|
|
138
138
|
className: classnames('pivot-cell', {
|
|
139
139
|
'pivot-empty-cell': true
|
|
140
140
|
})
|