sea-chart 2.0.36 → 2.0.38
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/api/index.js +8 -15
- package/dist/components/cell-factory/FormatterConfig.js +55 -62
- package/dist/components/cell-factory/SimpleCellFormatter.js +5 -12
- package/dist/components/cell-factory/SingleSelectOption.js +11 -18
- package/dist/components/cell-factory/cell-editor-factory.js +5 -12
- package/dist/components/cell-factory/cell-formatter-factory.js +4 -11
- package/dist/components/cell-factory/link-content.js +30 -38
- package/dist/components/chart-color-selector/color-selector.js +11 -18
- package/dist/components/collaborator/index.js +7 -14
- package/dist/components/color-picker/index.js +12 -19
- package/dist/components/color-popover/color-rules/color-rule.js +26 -34
- package/dist/components/color-popover/color-rules/index.js +7 -15
- package/dist/components/color-popover/color-rules/rule-filters/filter.js +27 -34
- package/dist/components/color-popover/color-rules/rule-filters/index.js +17 -25
- package/dist/components/color-popover/color-rules/rule-filters/number-input.js +9 -17
- package/dist/components/color-popover/color-rules-popover.js +30 -38
- package/dist/components/color-popover/color-selector-popover.js +12 -20
- package/dist/components/color-setting/color-group-selector.js +13 -21
- package/dist/components/common-add-tool/index.js +8 -15
- package/dist/components/data-process-setter/data-setting-header.js +7 -14
- package/dist/components/data-process-setter/hide-column-setter.js +13 -20
- package/dist/components/data-process-setter/index.js +4 -27
- package/dist/components/data-process-setter/sort-setter.js +18 -26
- package/dist/components/draggable/Draggable.js +7 -13
- package/dist/components/drill-down-settings/drill-down-fields-popover/index.js +40 -48
- package/dist/components/drill-down-settings/drill-down-fields-settings/index.js +10 -18
- package/dist/components/drill-down-settings/index.js +11 -18
- package/dist/components/dtable-popover/index.js +13 -20
- package/dist/components/dtable-search-input/index.js +13 -21
- package/dist/components/font-settings/index.js +14 -22
- package/dist/components/goal-line-setting/goal-setting-item.js +6 -14
- package/dist/components/goal-line-setting/index.js +12 -19
- package/dist/components/highlighter/highlighter.js +7 -14
- package/dist/components/icon/index.js +5 -12
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +4 -11
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +8 -15
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +26 -34
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +55 -65
- package/dist/components/resize-handle/ResizeHandle.js +6 -13
- package/dist/components/row-card/row-card-header-cell.js +17 -24
- package/dist/components/row-card/row-card-header.js +15 -22
- package/dist/components/row-card/row-card-item.js +35 -43
- package/dist/components/row-card/row-card.js +17 -25
- package/dist/components/statistic-record-dialog/index.js +56 -64
- package/dist/components/tooltip/index.js +14 -21
- package/dist/components/types-dialog/index.js +62 -70
- package/dist/components/types-dialog/use-force-update.js +4 -10
- package/dist/constants/color-rules.js +8 -14
- package/dist/constants/common-constants.js +8 -14
- package/dist/constants/error.js +2 -8
- package/dist/constants/geolocation.js +9 -15
- package/dist/constants/index.js +142 -271
- package/dist/constants/key-codes.js +0 -2
- package/dist/constants/model.js +3 -9
- package/dist/constants/regions.js +3 -8
- package/dist/constants/style.js +6 -12
- package/dist/constants/table.js +1 -7
- package/dist/constants/type-image.js +33 -39
- package/dist/constants/type.js +3 -9
- package/dist/context.js +13 -20
- package/dist/editor/index.js +8 -15
- package/dist/index.js +13 -104
- package/dist/intl.js +10 -17
- package/dist/locale/index.js +16 -23
- package/dist/locale/lang/de.js +1 -7
- package/dist/locale/lang/en.js +1 -7
- package/dist/locale/lang/es.js +1 -7
- package/dist/locale/lang/fr.js +1 -7
- package/dist/locale/lang/pt.js +1 -7
- package/dist/locale/lang/ru.js +1 -7
- package/dist/locale/lang/zh_CN.js +1 -7
- package/dist/model/area-group.js +12 -19
- package/dist/model/area.js +12 -19
- package/dist/model/bar-custom.js +11 -18
- package/dist/model/bar-group.js +12 -19
- package/dist/model/bar-stack.js +10 -17
- package/dist/model/bar.js +11 -18
- package/dist/model/base-model.js +4 -11
- package/dist/model/basic-number-card.js +13 -20
- package/dist/model/chart.js +7 -13
- package/dist/model/combination.js +15 -22
- package/dist/model/compare-bar.js +14 -21
- package/dist/model/completeness-group.js +11 -18
- package/dist/model/completeness.js +10 -17
- package/dist/model/dashboard.js +7 -14
- package/dist/model/funnel.js +14 -21
- package/dist/model/generic-model.js +135 -143
- package/dist/model/heat-map.js +9 -16
- package/dist/model/horizontal-bar.js +11 -18
- package/dist/model/horizontal-group-bar.js +10 -17
- package/dist/model/index.js +69 -93
- package/dist/model/line-group.js +13 -20
- package/dist/model/line.js +12 -19
- package/dist/model/map-bubble.js +12 -19
- package/dist/model/map.js +12 -19
- package/dist/model/mirror.js +13 -20
- package/dist/model/pie.js +12 -19
- package/dist/model/ring.js +12 -19
- package/dist/model/scatter.js +10 -17
- package/dist/model/stacked-horizontal-bar.js +11 -18
- package/dist/model/table-element.js +5 -12
- package/dist/model/table.js +7 -14
- package/dist/model/tree-map.js +7 -14
- package/dist/model/trend.js +11 -18
- package/dist/model/user.js +1 -7
- package/dist/model/world-map-bubble.js +12 -19
- package/dist/model/world-map.js +12 -19
- package/dist/services/map-json.js +11 -17
- package/dist/settings/advance-bar-settings/data-settings.js +36 -44
- package/dist/settings/advance-bar-settings/index.js +3 -20
- package/dist/settings/advance-bar-settings/style-settings.js +63 -71
- package/dist/settings/bar-settings/data-settings.js +39 -47
- package/dist/settings/bar-settings/index.js +3 -20
- package/dist/settings/bar-settings/style-settings.js +49 -57
- package/dist/settings/basic-number-card/data-settings.js +49 -57
- package/dist/settings/basic-number-card/index.js +3 -20
- package/dist/settings/basic-number-card/style-settings.js +19 -27
- package/dist/settings/combination-settings/data-settings.js +55 -63
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +65 -73
- package/dist/settings/completeness-settings/callbacks/callbacks.js +16 -27
- package/dist/settings/completeness-settings/data-settings/completion-settings.js +21 -28
- package/dist/settings/completeness-settings/data-settings/data-settings.js +25 -32
- package/dist/settings/completeness-settings/index.js +3 -20
- package/dist/settings/completeness-settings/style-settings.js +19 -26
- package/dist/settings/dashboard-settings/data-settings.js +43 -51
- package/dist/settings/dashboard-settings/index.js +2 -13
- package/dist/settings/data-settings.js +72 -79
- package/dist/settings/funnel-settings/components/dnd-item/dnd-item.js +12 -19
- package/dist/settings/funnel-settings/components/dnd-list.js +15 -23
- package/dist/settings/funnel-settings/components/funnel-label-setting.js +32 -40
- package/dist/settings/funnel-settings/components/funnel-layer-setting.js +20 -28
- package/dist/settings/funnel-settings/data-settings.js +23 -31
- package/dist/settings/funnel-settings/index.js +3 -20
- package/dist/settings/funnel-settings/style-settings.js +11 -19
- package/dist/settings/heat-map-settings/data-settings.js +18 -26
- package/dist/settings/heat-map-settings/index.js +3 -20
- package/dist/settings/heat-map-settings/style-settings.js +18 -26
- package/dist/settings/horizontal-bar-settings/data-settings.js +12 -19
- package/dist/settings/horizontal-bar-settings/index.js +3 -20
- package/dist/settings/horizontal-bar-settings/style-settings.js +12 -19
- package/dist/settings/index.js +52 -70
- package/dist/settings/map-settings/components/location-field-selector.js +10 -17
- package/dist/settings/map-settings/components/map-level-selector.js +11 -18
- package/dist/settings/map-settings/components/map-province-city-selector.js +19 -26
- package/dist/settings/map-settings/index.js +3 -20
- package/dist/settings/map-settings/map-data-settings.js +23 -30
- package/dist/settings/map-settings/map-style-settings.js +27 -35
- package/dist/settings/mirror-settings/data-settings.js +26 -34
- package/dist/settings/mirror-settings/index.js +2 -13
- package/dist/settings/pie-settings/data-settings.js +33 -41
- package/dist/settings/pie-settings/index.js +3 -20
- package/dist/settings/pie-settings/style-settings.js +47 -55
- package/dist/settings/scatter/data-settings.js +27 -34
- package/dist/settings/scatter/index.js +3 -12
- package/dist/settings/stacks-settings/index.js +19 -27
- package/dist/settings/stacks-settings/stack-item-settings.js +19 -27
- package/dist/settings/style-settings.js +65 -73
- package/dist/settings/table-element-settings/components/data-filter.js +30 -38
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +112 -120
- package/dist/settings/table-settings/index.js +2 -13
- package/dist/settings/time-comparison-settings/data-settings.js +43 -51
- package/dist/settings/time-comparison-settings/index.js +3 -20
- package/dist/settings/time-comparison-settings/style-settings.js +42 -50
- package/dist/settings/trend-settings/data-settings.js +24 -32
- package/dist/settings/trend-settings/index.js +3 -20
- package/dist/settings/trend-settings/style-setting.js +19 -27
- package/dist/settings/widgets/basic-summary/index.js +55 -63
- package/dist/settings/widgets/chart-type/index.js +18 -26
- package/dist/settings/widgets/color-settings/index.js +72 -80
- package/dist/settings/widgets/common-data-settings.js +21 -29
- package/dist/settings/widgets/data-filter/index.js +35 -43
- package/dist/settings/widgets/data-sort.js +16 -24
- package/dist/settings/widgets/date-summary-item.js +26 -34
- package/dist/settings/widgets/display-values-settings/index.js +14 -22
- package/dist/settings/widgets/divider/index.js +8 -16
- package/dist/settings/widgets/font-settings/font-color-settings.js +11 -19
- package/dist/settings/widgets/font-settings/font-size-settings.js +14 -22
- package/dist/settings/widgets/font-settings/font-weight-settings.js +17 -25
- package/dist/settings/widgets/font-settings/index.js +4 -27
- package/dist/settings/widgets/group-by.js +51 -59
- package/dist/settings/widgets/min-max-setting.js +10 -18
- package/dist/settings/widgets/mininum-slice-percent.js +10 -18
- package/dist/settings/widgets/numeric-summary-item.js +25 -33
- package/dist/settings/widgets/select-line-type/index.js +10 -17
- package/dist/settings/widgets/select-table/index.js +9 -16
- package/dist/settings/widgets/select-view/index.js +20 -28
- package/dist/settings/widgets/stack.js +14 -22
- package/dist/settings/widgets/summary-method-setting.js +17 -25
- package/dist/settings/widgets/summary-settings.js +74 -82
- package/dist/settings/widgets/switch/index.js +9 -16
- package/dist/settings/widgets/text-horizontal-settings.js +15 -23
- package/dist/settings/widgets/time-picker.js +29 -37
- package/dist/settings/widgets/title-settings/index.js +29 -37
- package/dist/settings/widgets/title-settings/title-text.js +5 -12
- package/dist/settings/widgets/x-axios.js +0 -1
- package/dist/settings/widgets/y-axis-group-settings.js +64 -72
- package/dist/utils/cell-format-utils.js +17 -27
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +324 -332
- package/dist/utils/chart-utils/index.js +28 -41
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +77 -84
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +13 -20
- package/dist/utils/chart-utils/original-data-utils/combination-calculator.js +45 -52
- package/dist/utils/chart-utils/original-data-utils/compare-bar-chart-calculator.js +21 -28
- package/dist/utils/chart-utils/original-data-utils/completeness-calculator.js +33 -40
- package/dist/utils/chart-utils/original-data-utils/dashboard-calculator.js +16 -23
- package/dist/utils/chart-utils/original-data-utils/index.js +50 -57
- package/dist/utils/chart-utils/original-data-utils/mirror-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/pivot-table-calculator.js +90 -96
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -26
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +31 -38
- package/dist/utils/chart-utils/sql-statistics-utils.js +229 -237
- package/dist/utils/chart.js +9 -17
- package/dist/utils/collaborator-manager.js +3 -9
- package/dist/utils/collaborator-utils.js +19 -31
- package/dist/utils/collaborator.js +6 -15
- package/dist/utils/color-utils.js +18 -29
- package/dist/utils/column-utils.js +77 -104
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +5 -12
- package/dist/utils/date-translate.js +12 -20
- package/dist/utils/digital-sign-utils.js +7 -14
- package/dist/utils/event-bus.js +1 -7
- package/dist/utils/hotkey.js +5 -11
- package/dist/utils/index.js +54 -221
- package/dist/utils/key-generator.js +2 -9
- package/dist/utils/map.js +22 -31
- package/dist/utils/object-utils.js +2 -8
- package/dist/utils/options-utils.js +10 -18
- package/dist/utils/row-record-utils.js +166 -178
- package/dist/utils/row-utils.js +27 -38
- package/dist/utils/search.js +24 -32
- package/dist/utils/sql/chart-data-sql.js +106 -112
- package/dist/utils/sql/column-2-sql-column.js +158 -168
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +39 -47
- package/dist/view/index.js +90 -96
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area-group.js +45 -53
- package/dist/view/wrapper/area.js +43 -51
- package/dist/view/wrapper/bar-compare.js +38 -46
- package/dist/view/wrapper/bar-custom-stack.js +39 -47
- package/dist/view/wrapper/bar-group.js +45 -53
- package/dist/view/wrapper/bar-stack.js +48 -56
- package/dist/view/wrapper/bar.js +40 -48
- package/dist/view/wrapper/basic-number-card.js +26 -34
- package/dist/view/wrapper/chart-component.js +123 -131
- package/dist/view/wrapper/combination.js +55 -63
- package/dist/view/wrapper/completeness-group.js +40 -48
- package/dist/view/wrapper/completeness.js +36 -44
- package/dist/view/wrapper/dashboard.js +39 -44
- package/dist/view/wrapper/funnel.js +40 -43
- package/dist/view/wrapper/heat-map.js +62 -70
- package/dist/view/wrapper/horizontal-bar-group.js +52 -60
- package/dist/view/wrapper/horizontal-bar-stack.js +47 -55
- package/dist/view/wrapper/horizontal-bar.js +41 -49
- package/dist/view/wrapper/index.js +107 -115
- package/dist/view/wrapper/line-group.js +43 -51
- package/dist/view/wrapper/line.js +42 -50
- package/dist/view/wrapper/map-bubble.js +40 -48
- package/dist/view/wrapper/map-world-bubble.js +39 -47
- package/dist/view/wrapper/map-world.js +41 -49
- package/dist/view/wrapper/map.js +42 -50
- package/dist/view/wrapper/mirror.js +41 -49
- package/dist/view/wrapper/pie.js +44 -52
- package/dist/view/wrapper/ring.js +49 -57
- package/dist/view/wrapper/scatter.js +42 -50
- package/dist/view/wrapper/table/index.js +14 -22
- package/dist/view/wrapper/table/one-dimension-table-no-numeric-columns.js +49 -57
- package/dist/view/wrapper/table/one-dimension-table-with-numeric-columns.js +53 -61
- package/dist/view/wrapper/table/pivot-table-display-name.js +82 -90
- package/dist/view/wrapper/table/two-dimension-table.js +85 -93
- package/dist/view/wrapper/table-element/components/dataset-utils.js +23 -36
- package/dist/view/wrapper/table-element/components/formatter.js +90 -99
- package/dist/view/wrapper/table-element/components/formatters/FileFormatter/index.js +23 -32
- package/dist/view/wrapper/table-element/components/formatters/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/formatters/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/formula-formatter.js +9 -16
- package/dist/view/wrapper/table-element/components/link-formatter.js +90 -97
- package/dist/view/wrapper/table-element/components/record.js +13 -20
- package/dist/view/wrapper/table-element/components/records-body.js +9 -17
- package/dist/view/wrapper/table-element/components/records-header/index.js +7 -15
- package/dist/view/wrapper/table-element/components/records-header/records-header-cell.js +8 -16
- package/dist/view/wrapper/table-element/components/records.js +25 -33
- package/dist/view/wrapper/table-element/components/resize-column-handle/resize-column-handle.js +5 -12
- package/dist/view/wrapper/table-element/components/utils.js +6 -16
- package/dist/view/wrapper/table-element/components/value-display-utils.js +4 -11
- package/dist/view/wrapper/table-element/components/vertical-scrollbar/index.js +6 -13
- package/dist/view/wrapper/table-element/index.js +18 -26
- package/dist/view/wrapper/treemap.js +38 -46
- package/dist/view/wrapper/trend.js +58 -66
- package/package.json +5 -5
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _dtableUtils = require("dtable-utils");
|
|
12
|
-
var _utils = require("../../../utils");
|
|
13
|
-
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
14
|
-
var _constants = require("../../../constants");
|
|
15
|
-
var _pivotTableDisplayName = _interopRequireDefault(require("./pivot-table-display-name"));
|
|
16
|
-
class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { getTableById } from 'dtable-utils';
|
|
4
|
+
import { BaseUtils, ObjectUtils } from '../../../utils';
|
|
5
|
+
import intl from '../../../intl';
|
|
6
|
+
import { CHART_THEME_COLOR, CHART_SUMMARY_TYPE } from '../../../constants';
|
|
7
|
+
import PivotTableDisplayName from './pivot-table-display-name';
|
|
8
|
+
class OneDimensionTableNoNumericColumns extends PureComponent {
|
|
17
9
|
constructor() {
|
|
18
10
|
super(...arguments);
|
|
19
11
|
this.renderHeader = () => {
|
|
@@ -30,27 +22,27 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
30
22
|
const {
|
|
31
23
|
name: groupName
|
|
32
24
|
} = groupbyColumn;
|
|
33
|
-
const isCount = summary_type ===
|
|
25
|
+
const isCount = summary_type === CHART_SUMMARY_TYPE.COUNT;
|
|
34
26
|
this.isCount = isCount;
|
|
35
|
-
const columnName = isCount ?
|
|
27
|
+
const columnName = isCount ? intl.get('Amount') : this.getColumnName();
|
|
36
28
|
const {
|
|
37
29
|
rowIdx: selectRowIdx,
|
|
38
30
|
cellIdx: selectedCellIdx
|
|
39
31
|
} = selectedCell || {};
|
|
40
32
|
const isSelectedTotalCellBottom = selectRowIdx === 0 && selectedCellIdx === 0;
|
|
41
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/React.createElement("thead", {
|
|
42
34
|
className: "seatable-table-header-sm"
|
|
43
|
-
}, /*#__PURE__*/
|
|
35
|
+
}, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
44
36
|
className: "pivot-table-header"
|
|
45
|
-
}, groupName), /*#__PURE__*/
|
|
46
|
-
className: (
|
|
37
|
+
}, groupName), /*#__PURE__*/React.createElement("th", {
|
|
38
|
+
className: classnames('pivot-table-header', {
|
|
47
39
|
'selected-pivot-cell-top': isSelectedTotalCellBottom
|
|
48
40
|
})
|
|
49
|
-
}, /*#__PURE__*/
|
|
50
|
-
className: (
|
|
41
|
+
}, /*#__PURE__*/React.createElement("div", null, columnName)), display_total && /*#__PURE__*/React.createElement("th", {
|
|
42
|
+
className: classnames('pivot-table-header', {
|
|
51
43
|
'selected-pivot-cell-top': isSelectedTotalCellBottom
|
|
52
44
|
})
|
|
53
|
-
}, /*#__PURE__*/
|
|
45
|
+
}, /*#__PURE__*/React.createElement("div", null, intl.get('Total')))));
|
|
54
46
|
};
|
|
55
47
|
this.getColumnName = () => {
|
|
56
48
|
const {
|
|
@@ -65,7 +57,7 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
65
57
|
table_id
|
|
66
58
|
} = chart.config;
|
|
67
59
|
if (Array.isArray(pivot_columns) && pivot_columns.length !== 0) {
|
|
68
|
-
const table =
|
|
60
|
+
const table = getTableById(tables, table_id);
|
|
69
61
|
const column = table === null || table === void 0 ? void 0 : table.columns.find(item => item.key === pivot_columns[0].key);
|
|
70
62
|
return (column === null || column === void 0 ? void 0 : column.name) || '';
|
|
71
63
|
}
|
|
@@ -127,10 +119,10 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
127
119
|
let pivotColumnCells = [];
|
|
128
120
|
const isSelectRowTotalCellRight = selectRowIdx === pivotRowsLen && selectedCellIdx === 0;
|
|
129
121
|
const isSelectTotal = selectRowIdx === pivotRowsLen && selectedCellIdx === 0;
|
|
130
|
-
const total =
|
|
131
|
-
const summaryDisplayValue =
|
|
132
|
-
const isValidSummaryDisplayValue =
|
|
133
|
-
return /*#__PURE__*/
|
|
122
|
+
const total = ObjectUtils.hasOwnProperty(pivot_columns_total, 'total') ? pivot_columns_total['total'] : 0;
|
|
123
|
+
const summaryDisplayValue = BaseUtils.getSummaryValueDisplayString(summaryColumn, total);
|
|
124
|
+
const isValidSummaryDisplayValue = BaseUtils.isValidValue(summaryDisplayValue, display_empty);
|
|
125
|
+
return /*#__PURE__*/React.createElement("tbody", null, pivotRowsLen > 0 && pivot_rows.map((rowItem, rowIdx) => {
|
|
134
126
|
const {
|
|
135
127
|
name,
|
|
136
128
|
total
|
|
@@ -140,21 +132,21 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
140
132
|
let isSelectedTotalCellTop = selectRowIdx - 1 === rowIdx && selectedCellIdx === 0;
|
|
141
133
|
let isSelectedTotalCellLeft = selectRowIdx === rowIdx && selectedCellIdx === 0;
|
|
142
134
|
pivotColumnCells[rowIdx] = rowItem;
|
|
143
|
-
const totalDisplayValue =
|
|
144
|
-
const isValidTotalDisplayValue =
|
|
145
|
-
return /*#__PURE__*/
|
|
135
|
+
const totalDisplayValue = BaseUtils.getSummaryValueDisplayString(summaryColumn, total.total);
|
|
136
|
+
const isValidTotalDisplayValue = BaseUtils.isValidValue(totalDisplayValue, display_empty);
|
|
137
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
146
138
|
key: 'table-row-' + rowIdx
|
|
147
|
-
}, /*#__PURE__*/
|
|
148
|
-
className: (
|
|
139
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
140
|
+
className: classnames('pivot-row-name', {
|
|
149
141
|
'selected-pivot-cell-left': isSelectedRowNameRight
|
|
150
142
|
})
|
|
151
|
-
}, /*#__PURE__*/
|
|
143
|
+
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
152
144
|
value: name,
|
|
153
145
|
column: groupbyColumn,
|
|
154
146
|
rowData: rowItem,
|
|
155
147
|
globalTheme: globalTheme
|
|
156
|
-
})), /*#__PURE__*/
|
|
157
|
-
className: (
|
|
148
|
+
})), /*#__PURE__*/React.createElement("td", {
|
|
149
|
+
className: classnames('pivot-cell', {
|
|
158
150
|
'pivot-empty-cell': !isValidTotalDisplayValue,
|
|
159
151
|
'selected-pivot-cell': isSelectedTotalCell,
|
|
160
152
|
'selected-pivot-cell-top': isSelectedTotalCellTop,
|
|
@@ -169,12 +161,12 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
169
161
|
cellIdx: 0,
|
|
170
162
|
isRow: true
|
|
171
163
|
})
|
|
172
|
-
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/
|
|
173
|
-
className: (
|
|
164
|
+
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
165
|
+
className: classnames({
|
|
174
166
|
'selected-pivot-cell-border': isSelectedTotalCell
|
|
175
167
|
})
|
|
176
|
-
})), display_total && /*#__PURE__*/
|
|
177
|
-
className: (
|
|
168
|
+
})), display_total && /*#__PURE__*/React.createElement("td", {
|
|
169
|
+
className: classnames('pivot-cell', {
|
|
178
170
|
'pivot-empty-cell': !isValidTotalDisplayValue,
|
|
179
171
|
'selected-pivot-cell': isSelectedTotalCell,
|
|
180
172
|
'selected-pivot-cell-top': isSelectedTotalCellTop,
|
|
@@ -189,17 +181,17 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
189
181
|
isRow: true
|
|
190
182
|
}),
|
|
191
183
|
total: totalDisplayValue
|
|
192
|
-
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/
|
|
193
|
-
className: (
|
|
184
|
+
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
185
|
+
className: classnames({
|
|
194
186
|
'selected-pivot-cell-border': isSelectedTotalCell
|
|
195
187
|
})
|
|
196
188
|
})));
|
|
197
|
-
}), display_total && /*#__PURE__*/
|
|
198
|
-
className: (
|
|
189
|
+
}), display_total && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
190
|
+
className: classnames('pivot-column-total', {
|
|
199
191
|
'selected-pivot-cell-left': isSelectRowTotalCellRight
|
|
200
192
|
})
|
|
201
|
-
}, /*#__PURE__*/
|
|
202
|
-
className: (
|
|
193
|
+
}, /*#__PURE__*/React.createElement("div", null, intl.get('Total'))), /*#__PURE__*/React.createElement("td", {
|
|
194
|
+
className: classnames('pivot-cell pivot-table-total', {
|
|
203
195
|
'pivot-empty-cell': !isValidSummaryDisplayValue,
|
|
204
196
|
'selected-pivot-cell': isSelectTotal
|
|
205
197
|
}),
|
|
@@ -208,12 +200,12 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
208
200
|
cellIdx: 0
|
|
209
201
|
}),
|
|
210
202
|
title: isValidSummaryDisplayValue ? summaryDisplayValue : ''
|
|
211
|
-
}, isValidSummaryDisplayValue ? summaryDisplayValue : /*#__PURE__*/
|
|
212
|
-
className: (
|
|
203
|
+
}, isValidSummaryDisplayValue ? summaryDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
204
|
+
className: classnames({
|
|
213
205
|
'selected-pivot-cell-border': isSelectTotal
|
|
214
206
|
})
|
|
215
|
-
})), /*#__PURE__*/
|
|
216
|
-
className: (
|
|
207
|
+
})), /*#__PURE__*/React.createElement("td", {
|
|
208
|
+
className: classnames('pivot-cell pivot-table-total', {
|
|
217
209
|
'pivot-empty-cell': !isValidSummaryDisplayValue,
|
|
218
210
|
'selected-pivot-cell': isSelectTotal
|
|
219
211
|
}),
|
|
@@ -222,8 +214,8 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
222
214
|
cellIdx: 0
|
|
223
215
|
}),
|
|
224
216
|
title: isValidSummaryDisplayValue ? summaryDisplayValue : ''
|
|
225
|
-
}, isValidSummaryDisplayValue ? summaryDisplayValue : /*#__PURE__*/
|
|
226
|
-
className: (
|
|
217
|
+
}, isValidSummaryDisplayValue ? summaryDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
218
|
+
className: classnames({
|
|
227
219
|
'selected-pivot-cell-border': isSelectTotal
|
|
228
220
|
})
|
|
229
221
|
}))));
|
|
@@ -235,12 +227,12 @@ class OneDimensionTableNoNumericColumns extends _react.PureComponent {
|
|
|
235
227
|
globalTheme
|
|
236
228
|
} = this.props;
|
|
237
229
|
if (!groupbyColumn) return '';
|
|
238
|
-
return /*#__PURE__*/
|
|
230
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
239
231
|
className: "sea-chart-pivot-table",
|
|
240
232
|
style: {
|
|
241
|
-
color:
|
|
233
|
+
color: CHART_THEME_COLOR[globalTheme].pivotTextColor
|
|
242
234
|
}
|
|
243
235
|
}, this.renderHeader(), this.renderRows());
|
|
244
236
|
}
|
|
245
237
|
}
|
|
246
|
-
|
|
238
|
+
export default OneDimensionTableNoNumericColumns;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _dtableUtils = require("dtable-utils");
|
|
12
|
-
var _utils = require("../../../utils");
|
|
13
|
-
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
14
|
-
var _constants = require("../../../constants");
|
|
15
|
-
var _pivotTableDisplayName = _interopRequireDefault(require("./pivot-table-display-name"));
|
|
16
|
-
class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { isNumber } from 'dtable-utils';
|
|
4
|
+
import { BaseUtils, formatRowTotal } from '../../../utils';
|
|
5
|
+
import intl from '../../../intl';
|
|
6
|
+
import { CHART_THEME_COLOR } from '../../../constants';
|
|
7
|
+
import PivotTableDisplayName from './pivot-table-display-name';
|
|
8
|
+
class OneDimensionTableWithNumericColumns extends PureComponent {
|
|
17
9
|
constructor(_props) {
|
|
18
10
|
super(_props);
|
|
19
11
|
this.init = props => {
|
|
@@ -32,7 +24,7 @@ class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
|
32
24
|
}
|
|
33
25
|
};
|
|
34
26
|
this.getRowTotal = (rowTotal, value) => {
|
|
35
|
-
if (value &&
|
|
27
|
+
if (value && isNumber(value)) {
|
|
36
28
|
return rowTotal + value;
|
|
37
29
|
}
|
|
38
30
|
return rowTotal;
|
|
@@ -63,9 +55,9 @@ class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
|
63
55
|
cellIdx: selectedCellIdx
|
|
64
56
|
} = selectedCell || {};
|
|
65
57
|
const isSelectedTotalHeaderBottom = selectRowIdx === 0 && selectedCellIdx === (pivot_columns === null || pivot_columns === void 0 ? void 0 : pivot_columns.length);
|
|
66
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/React.createElement("thead", {
|
|
67
59
|
className: "seatable-table-header-sm"
|
|
68
|
-
}, /*#__PURE__*/
|
|
60
|
+
}, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
69
61
|
className: "pivot-table-header"
|
|
70
62
|
}, !rowGroupName && groupName), Array.isArray(pivot_columns) && pivot_columns.map((item, index) => {
|
|
71
63
|
const {
|
|
@@ -73,17 +65,17 @@ class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
|
73
65
|
} = item;
|
|
74
66
|
const column = chartTableColumns.find(column => column.key === key);
|
|
75
67
|
const isSelectedHeaderBottom = selectRowIdx === 0 && selectedCellIdx === index;
|
|
76
|
-
return /*#__PURE__*/
|
|
77
|
-
className: (
|
|
68
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
69
|
+
className: classnames('pivot-table-header', {
|
|
78
70
|
'selected-pivot-cell-top': isSelectedHeaderBottom
|
|
79
71
|
}),
|
|
80
|
-
key:
|
|
81
|
-
}, /*#__PURE__*/
|
|
82
|
-
}), display_total && /*#__PURE__*/
|
|
83
|
-
className: (
|
|
72
|
+
key: `pivot-column-${index}`
|
|
73
|
+
}, /*#__PURE__*/React.createElement("div", null, column.name));
|
|
74
|
+
}), display_total && /*#__PURE__*/React.createElement("th", {
|
|
75
|
+
className: classnames('pivot-table-header', {
|
|
84
76
|
'selected-pivot-cell-top': isSelectedTotalHeaderBottom
|
|
85
77
|
})
|
|
86
|
-
}, /*#__PURE__*/
|
|
78
|
+
}, /*#__PURE__*/React.createElement("div", null, intl.get('Total')))));
|
|
87
79
|
};
|
|
88
80
|
this.toggleRecords = (cell, selectedCell) => {
|
|
89
81
|
if (window.isMobile) return;
|
|
@@ -135,7 +127,7 @@ class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
|
135
127
|
const isSelectRowTotalCellRight = selectRowIdx === pivotRowsLen && selectedCellIdx === 0;
|
|
136
128
|
let lastRowTotal = 0;
|
|
137
129
|
let lastRows = [];
|
|
138
|
-
return /*#__PURE__*/
|
|
130
|
+
return /*#__PURE__*/React.createElement("tbody", null, pivotRowsLen > 0 && pivot_rows.map((rowItem, rowIdx) => {
|
|
139
131
|
const {
|
|
140
132
|
name,
|
|
141
133
|
total,
|
|
@@ -150,13 +142,13 @@ class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
|
150
142
|
if (!Array.isArray(pivot_columns)) {
|
|
151
143
|
pivotColumnCells[rowIdx] = rowItem.rows || [];
|
|
152
144
|
}
|
|
153
|
-
return /*#__PURE__*/
|
|
145
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
154
146
|
key: 'table-row' + rowIdx
|
|
155
|
-
}, /*#__PURE__*/
|
|
156
|
-
className: (
|
|
147
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
148
|
+
className: classnames('pivot-row-name', {
|
|
157
149
|
'selected-pivot-cell-left': isSelectedRowNameRight
|
|
158
150
|
})
|
|
159
|
-
}, /*#__PURE__*/
|
|
151
|
+
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
160
152
|
value: name,
|
|
161
153
|
column: groupbyColumn,
|
|
162
154
|
rowData: rowItem,
|
|
@@ -170,8 +162,8 @@ class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
|
170
162
|
} = columnMap;
|
|
171
163
|
const column = chartTableColumns.find(item => item.key === key);
|
|
172
164
|
rowTotal = this.getRowTotal(rowTotal, total[key]);
|
|
173
|
-
const displayValue =
|
|
174
|
-
const isValidDisplayValue =
|
|
165
|
+
const displayValue = BaseUtils.getSummaryValueDisplayString(column, total[key], this.summaryColumnsMethodMap[key]);
|
|
166
|
+
const isValidDisplayValue = BaseUtils.isValidValue(displayValue, display_empty);
|
|
175
167
|
if (Array.isArray(rows) && rows.length > 0) {
|
|
176
168
|
if (pivotColumnCells[cellIdx]) {
|
|
177
169
|
pivotColumnCells[cellIdx].push(...rows);
|
|
@@ -179,71 +171,71 @@ class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
|
179
171
|
pivotColumnCells[cellIdx] = [...rows];
|
|
180
172
|
}
|
|
181
173
|
}
|
|
182
|
-
return /*#__PURE__*/
|
|
183
|
-
className: (
|
|
174
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
175
|
+
className: classnames('pivot-cell', {
|
|
184
176
|
'pivot-empty-cell': !isValidDisplayValue,
|
|
185
177
|
'selected-pivot-cell': isSelectedCell,
|
|
186
178
|
'selected-pivot-cell-top': isSelectedCellTop,
|
|
187
179
|
'selected-pivot-cell-left': isSelectedCellLeft
|
|
188
180
|
}),
|
|
189
|
-
key:
|
|
181
|
+
key: `table-cell-${cellIdx}`
|
|
190
182
|
// onClick={() => this.toggleRecords({ rows, name: rowItem?.name, total: total[key] }, { rowIdx, cellIdx })}
|
|
191
183
|
,
|
|
192
184
|
title: isValidDisplayValue ? displayValue : ''
|
|
193
|
-
}, isValidDisplayValue ? displayValue : /*#__PURE__*/
|
|
194
|
-
className: (
|
|
185
|
+
}, isValidDisplayValue ? displayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
186
|
+
className: classnames({
|
|
195
187
|
'selected-pivot-cell-border': isSelectedCell
|
|
196
188
|
})
|
|
197
189
|
}));
|
|
198
|
-
}), display_total && /*#__PURE__*/
|
|
199
|
-
className: (
|
|
190
|
+
}), display_total && /*#__PURE__*/React.createElement("td", {
|
|
191
|
+
className: classnames('pivot-cell', {
|
|
200
192
|
'selected-pivot-cell': isSelectedTotalCell,
|
|
201
193
|
'selected-pivot-cell-top': isSelectedTotalCellTop,
|
|
202
194
|
'selected-pivot-cell-left': isSelectedTotalCellLeft
|
|
203
195
|
})
|
|
204
196
|
// onClick={() => this.toggleRecords({ rows, name: rowItem?.name, total: rowTotal }, { rowIdx })}
|
|
205
197
|
,
|
|
206
|
-
title: rowTotal ?
|
|
207
|
-
}, rowTotal ?
|
|
208
|
-
className: (
|
|
198
|
+
title: rowTotal ? formatRowTotal(rowTotal) : 0
|
|
199
|
+
}, rowTotal ? formatRowTotal(rowTotal) : /*#__PURE__*/React.createElement("i", null, "0"), /*#__PURE__*/React.createElement("span", {
|
|
200
|
+
className: classnames({
|
|
209
201
|
'selected-pivot-cell-border': isSelectedTotalCell
|
|
210
202
|
})
|
|
211
203
|
})));
|
|
212
|
-
}), display_total && /*#__PURE__*/
|
|
213
|
-
className: (
|
|
204
|
+
}), display_total && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
205
|
+
className: classnames('pivot-column-total', {
|
|
214
206
|
'selected-pivot-cell-left': isSelectRowTotalCellRight
|
|
215
207
|
})
|
|
216
|
-
}, /*#__PURE__*/
|
|
208
|
+
}, /*#__PURE__*/React.createElement("div", null, intl.get('Total'))), Array.isArray(pivot_columns) && pivot_columns.map((c, index) => {
|
|
217
209
|
const pivotColumnTotal = pivot_columns_total[c.key];
|
|
218
210
|
const column = chartTableColumns.find(column => column.key === c.key);
|
|
219
|
-
const totalDisplayValue =
|
|
220
|
-
const isValidTotalDisplayValue =
|
|
211
|
+
const totalDisplayValue = BaseUtils.getSummaryValueDisplayString(column, pivotColumnTotal, this.summaryColumnsMethodMap[c.key]);
|
|
212
|
+
const isValidTotalDisplayValue = BaseUtils.isValidValue(totalDisplayValue, display_empty);
|
|
221
213
|
const isSelectRowTotalCell = selectRowIdx === pivot_rows.length && selectedCellIdx === index;
|
|
222
214
|
const isSelectRowTotalCellLeft = selectRowIdx === pivot_rows.length && selectedCellIdx - 1 === index;
|
|
223
215
|
lastRowTotal = this.getRowTotal(lastRowTotal, pivotColumnTotal);
|
|
224
|
-
return /*#__PURE__*/
|
|
225
|
-
className: (
|
|
216
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
217
|
+
className: classnames('pivot-cell', {
|
|
226
218
|
'pivot-empty-cell': !isValidTotalDisplayValue,
|
|
227
219
|
'selected-pivot-cell': isSelectRowTotalCell,
|
|
228
220
|
'selected-pivot-cell-left': isSelectRowTotalCellLeft
|
|
229
221
|
}),
|
|
230
|
-
key:
|
|
222
|
+
key: `total-cell-${index}`
|
|
231
223
|
// onClick={() => this.toggleRecords({ rows: pivotColumnCell, total: pivot_columns_total[c.key] }, { rowIdx: pivot_rows.length, cellIdx: index })}
|
|
232
224
|
,
|
|
233
225
|
title: totalDisplayValue
|
|
234
|
-
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/
|
|
235
|
-
className: (
|
|
226
|
+
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
227
|
+
className: classnames({
|
|
236
228
|
'selected-pivot-cell-border': isSelectRowTotalCell
|
|
237
229
|
})
|
|
238
230
|
}));
|
|
239
|
-
}), /*#__PURE__*/
|
|
240
|
-
className: (
|
|
241
|
-
'pivot-empty-cell': !
|
|
231
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
232
|
+
className: classnames('pivot-cell', {
|
|
233
|
+
'pivot-empty-cell': !BaseUtils.isValidValue(lastRowTotal, display_empty)
|
|
242
234
|
})
|
|
243
235
|
// onClick={() => this.toggleRecords({ rows: lastRows, total: lastRowTotal }, { rowIdx: pivot_rows.length, cellIdx: pivot_columns?.length })}
|
|
244
236
|
,
|
|
245
|
-
title:
|
|
246
|
-
},
|
|
237
|
+
title: formatRowTotal(lastRowTotal)
|
|
238
|
+
}, BaseUtils.isValidValue(lastRowTotal, display_empty) ? formatRowTotal(lastRowTotal) : /*#__PURE__*/React.createElement("i", null))));
|
|
247
239
|
};
|
|
248
240
|
this.init(_props);
|
|
249
241
|
}
|
|
@@ -253,12 +245,12 @@ class OneDimensionTableWithNumericColumns extends _react.PureComponent {
|
|
|
253
245
|
globalTheme
|
|
254
246
|
} = this.props;
|
|
255
247
|
if (!groupbyColumn) return '';
|
|
256
|
-
return /*#__PURE__*/
|
|
248
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
257
249
|
className: "sea-chart-pivot-table",
|
|
258
250
|
style: {
|
|
259
|
-
color:
|
|
251
|
+
color: CHART_THEME_COLOR[globalTheme].pivotTextColor
|
|
260
252
|
}
|
|
261
253
|
}, this.renderHeader(), this.renderRows());
|
|
262
254
|
}
|
|
263
255
|
}
|
|
264
|
-
|
|
256
|
+
export default OneDimensionTableWithNumericColumns;
|