sea-chart 2.0.37 → 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 +20 -69
- package/dist/assets/css/sea-chart-d3-tooltip.css +0 -1
- 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 +31 -37
- 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 +41 -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 +12 -23
- package/dist/components/index.js +7 -48
- package/dist/components/loading/index.js +6 -13
- package/dist/components/number-input/index.js +11 -24
- package/dist/components/pixel-editor/index.js +15 -23
- package/dist/components/popover/hide-column-popover/hide-column-popover-widgets/hide-column-item.js +13 -16
- package/dist/components/popover/hide-column-popover/hide-column-popover.css +5 -1
- package/dist/components/popover/hide-column-popover/hide-column-popover.js +28 -38
- package/dist/components/popover/sort-popover/sort-popover-widgets/sort-utils.js +9 -18
- package/dist/components/popover/sort-popover/sort-popover.js +58 -69
- 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 +61 -68
- package/dist/components/tooltip/index.js +39 -28
- 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 +13 -16
- 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 +2 -7
- package/dist/locale/lang/en.js +2 -7
- package/dist/locale/lang/es.js +2 -7
- package/dist/locale/lang/fr.js +2 -7
- package/dist/locale/lang/pt.js +2 -7
- package/dist/locale/lang/ru.js +2 -7
- package/dist/locale/lang/zh_CN.js +2 -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 +14 -17
- 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 +14 -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 +66 -73
- 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 +51 -59
- package/dist/settings/basic-number-card/data-settings.js +50 -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 -64
- package/dist/settings/combination-settings/index.js +3 -20
- package/dist/settings/combination-settings/style-settings.js +67 -75
- 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 +44 -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 +22 -30
- 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 +57 -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 +49 -58
- package/dist/settings/table-element-settings/data-settings.js +21 -29
- package/dist/settings/table-element-settings/index.css +1 -31
- package/dist/settings/table-element-settings/index.js +2 -13
- package/dist/settings/table-settings/data-settings.js +113 -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 +44 -52
- 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 +59 -66
- 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 +27 -34
- package/dist/settings/widgets/data-filter/index.js +59 -59
- 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 +52 -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 +75 -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 +65 -72
- package/dist/utils/cell-format-utils.js +25 -33
- package/dist/utils/cell-value-utils.js +4 -11
- package/dist/utils/chart-utils/base-utils.js +467 -367
- package/dist/utils/chart-utils/index.js +29 -40
- package/dist/utils/chart-utils/original-data-utils/basic-chart-calculator.js +78 -85
- package/dist/utils/chart-utils/original-data-utils/card-calculator.js +20 -21
- 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 +28 -26
- 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 +94 -97
- package/dist/utils/chart-utils/original-data-utils/scatter-calculator.js +19 -25
- package/dist/utils/chart-utils/original-data-utils/trend-calculator.js +50 -36
- package/dist/utils/chart-utils/sql-statistics-utils.js +385 -388
- 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 +88 -102
- package/dist/utils/common-utils.js +28 -53
- package/dist/utils/concurrency-manager.js +1 -7
- package/dist/utils/contexts.js +7 -11
- 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 +73 -219
- 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 +251 -183
- 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 +162 -172
- package/dist/utils/sql/index.js +3 -27
- package/dist/utils/trend-utils.js +50 -45
- package/dist/view/index.css +2 -8
- package/dist/view/index.js +102 -103
- package/dist/view/title/index.js +16 -24
- package/dist/view/wrapper/area-group.js +57 -57
- package/dist/view/wrapper/area.js +43 -51
- package/dist/view/wrapper/bar-compare.js +56 -48
- package/dist/view/wrapper/bar-custom-stack.js +73 -55
- package/dist/view/wrapper/bar-group.js +94 -73
- package/dist/view/wrapper/bar-stack.js +49 -57
- package/dist/view/wrapper/bar.js +40 -48
- package/dist/view/wrapper/basic-number-card.js +50 -34
- package/dist/view/wrapper/chart-component.js +164 -569
- package/dist/view/wrapper/combination.js +55 -63
- package/dist/view/wrapper/completeness-group.js +140 -93
- package/dist/view/wrapper/completeness.js +36 -44
- package/dist/view/wrapper/dashboard.js +104 -59
- 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 +70 -58
- package/dist/view/wrapper/horizontal-bar-stack.js +48 -56
- package/dist/view/wrapper/horizontal-bar.js +41 -49
- package/dist/view/wrapper/index.js +107 -115
- package/dist/view/wrapper/line-group.js +49 -52
- 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 +40 -47
- package/dist/view/wrapper/map-world.js +42 -49
- package/dist/view/wrapper/map.js +42 -50
- package/dist/view/wrapper/mirror.js +41 -49
- package/dist/view/wrapper/pie.js +45 -53
- package/dist/view/wrapper/ring.js +50 -58
- package/dist/view/wrapper/scatter.js +50 -56
- 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 -92
- 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 -16
- 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 +8 -13
- 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 +30 -43
- package/dist/view/wrapper/treemap.js +38 -46
- package/dist/view/wrapper/trend.js +80 -65
- package/package.json +15 -12
|
@@ -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 TwoDimensionTable extends _react.PureComponent {
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { CellType, isNumber } from 'dtable-utils';
|
|
4
|
+
import { BaseUtils, formatRowTotal } from '../../../utils';
|
|
5
|
+
import intl from '../../../intl';
|
|
6
|
+
import { CHART_SUMMARY_TYPE, CHART_THEME_COLOR } from '../../../constants';
|
|
7
|
+
import PivotTableDisplayName from './pivot-table-display-name';
|
|
8
|
+
class TwoDimensionTable extends PureComponent {
|
|
17
9
|
constructor() {
|
|
18
10
|
super(...arguments);
|
|
19
11
|
this.getCells = row => {
|
|
@@ -66,10 +58,10 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
66
58
|
cellIdx: selectedCellIdx
|
|
67
59
|
} = selectedCell || {};
|
|
68
60
|
const isSelectedTotalCellBottom = selectRowIdx === 0 && selectedCellIdx === (Array.isArray(pivot_columns) ? pivot_columns.length : 0);
|
|
69
|
-
const isCollaborator = columnGroupbyColumn.type ===
|
|
70
|
-
return /*#__PURE__*/
|
|
61
|
+
const isCollaborator = columnGroupbyColumn.type === CellType.COLLABORATOR;
|
|
62
|
+
return /*#__PURE__*/React.createElement("thead", {
|
|
71
63
|
className: "seatable-table-header-sm"
|
|
72
|
-
}, /*#__PURE__*/
|
|
64
|
+
}, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
73
65
|
className: "pivot-table-header"
|
|
74
66
|
}, !rowGroupName && groupName), Array.isArray(pivot_columns) && pivot_columns.map((item, index) => {
|
|
75
67
|
let {
|
|
@@ -79,39 +71,40 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
79
71
|
original_key = [original_key];
|
|
80
72
|
}
|
|
81
73
|
let isSelectedHeaderBottom = selectRowIdx === 0 && selectedCellIdx === index;
|
|
82
|
-
return /*#__PURE__*/
|
|
83
|
-
className: (
|
|
74
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
75
|
+
className: classnames('pivot-table-header', {
|
|
84
76
|
'selected-pivot-cell-top': isSelectedHeaderBottom
|
|
85
77
|
}),
|
|
86
|
-
key:
|
|
87
|
-
}, /*#__PURE__*/
|
|
78
|
+
key: `pivot-column-${index}`
|
|
79
|
+
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
88
80
|
value: original_key,
|
|
89
81
|
column: columnGroupbyColumn || {},
|
|
90
82
|
rowData: item,
|
|
91
83
|
globalTheme: globalTheme
|
|
92
84
|
}));
|
|
93
|
-
}), display_total && /*#__PURE__*/
|
|
94
|
-
className: (
|
|
85
|
+
}), display_total && /*#__PURE__*/React.createElement("th", {
|
|
86
|
+
className: classnames('pivot-table-header', {
|
|
95
87
|
'selected-pivot-cell-top': isSelectedTotalCellBottom
|
|
96
88
|
})
|
|
97
|
-
}, /*#__PURE__*/
|
|
89
|
+
}, /*#__PURE__*/React.createElement("div", null, intl.get('Total')))), isSingleNumericColumn === 'false' && summary_columns && summary_columns.length && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
98
90
|
className: "pivot-table-header"
|
|
99
91
|
}), Array.isArray(pivot_columns) && pivot_columns.map((item, index) => {
|
|
100
|
-
return /*#__PURE__*/
|
|
92
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
93
|
+
key: `pivot-column-${index}`,
|
|
101
94
|
className: "pivot-table-header summary-columns-header"
|
|
102
|
-
}, /*#__PURE__*/
|
|
95
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
103
96
|
className: "pivot-table-header-summary-columns-container"
|
|
104
97
|
}, summary_columns.map((column, idx) => {
|
|
105
|
-
return /*#__PURE__*/
|
|
106
|
-
className: (
|
|
107
|
-
key:
|
|
108
|
-
}, /*#__PURE__*/
|
|
98
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: classnames('pivot-table-header'),
|
|
100
|
+
key: `pivot-summary-column-${idx}`
|
|
101
|
+
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
109
102
|
value: column.name,
|
|
110
103
|
column: column || {},
|
|
111
104
|
globalTheme: globalTheme
|
|
112
105
|
}));
|
|
113
106
|
})));
|
|
114
|
-
}), display_total && /*#__PURE__*/
|
|
107
|
+
}), display_total && /*#__PURE__*/React.createElement("th", {
|
|
115
108
|
className: "pivot-table-header"
|
|
116
109
|
})));
|
|
117
110
|
};
|
|
@@ -140,23 +133,23 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
140
133
|
this.renderEmpty = (summaryColumns, cellIdx) => {
|
|
141
134
|
if (summaryColumns && (summaryColumns === null || summaryColumns === void 0 ? void 0 : summaryColumns.length) !== 0) {
|
|
142
135
|
return summaryColumns.map(item => {
|
|
143
|
-
return /*#__PURE__*/
|
|
144
|
-
key:
|
|
145
|
-
className: (
|
|
136
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
key: `table-cell-${item === null || item === void 0 ? void 0 : item.key}`,
|
|
138
|
+
className: classnames('pivot-cell', {
|
|
146
139
|
'pivot-empty-cell': true
|
|
147
140
|
})
|
|
148
|
-
}, /*#__PURE__*/
|
|
141
|
+
}, /*#__PURE__*/React.createElement("i", null));
|
|
149
142
|
});
|
|
150
143
|
}
|
|
151
|
-
return /*#__PURE__*/
|
|
152
|
-
key:
|
|
153
|
-
className: (
|
|
144
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
key: `table-cell-${cellIdx}`,
|
|
146
|
+
className: classnames('pivot-cell', {
|
|
154
147
|
'pivot-empty-cell': true
|
|
155
148
|
})
|
|
156
|
-
}, /*#__PURE__*/
|
|
149
|
+
}, /*#__PURE__*/React.createElement("i", null));
|
|
157
150
|
};
|
|
158
151
|
this.getRowTotal = (rowTotal, value) => {
|
|
159
|
-
if (value &&
|
|
152
|
+
if (value && isNumber(value)) {
|
|
160
153
|
return rowTotal + value;
|
|
161
154
|
}
|
|
162
155
|
return rowTotal;
|
|
@@ -191,12 +184,12 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
191
184
|
let pivotColumnCells = [];
|
|
192
185
|
const isSelectRowTotalCellRight = selectRowIdx === pivotRowsLen && selectedCellIdx === 0;
|
|
193
186
|
const isSelectTotal = selectRowIdx === pivotRowsLen && selectedCellIdx === (Array.isArray(pivot_columns) ? pivot_columns.length : 0);
|
|
194
|
-
const tableTotalDisplayValue =
|
|
195
|
-
const isValidTableTotalDisplayValue =
|
|
196
|
-
const isCount = summary_type ===
|
|
187
|
+
const tableTotalDisplayValue = BaseUtils.getSummaryValueDisplayString(summaryColumn, pivot_table_total, summaryMethod);
|
|
188
|
+
const isValidTableTotalDisplayValue = BaseUtils.isValidValue(tableTotalDisplayValue, display_empty);
|
|
189
|
+
const isCount = summary_type === CHART_SUMMARY_TYPE.COUNT;
|
|
197
190
|
this.isCount = isCount;
|
|
198
|
-
const isCollaborator = groupbyColumn.type ===
|
|
199
|
-
return /*#__PURE__*/
|
|
191
|
+
const isCollaborator = groupbyColumn.type === CellType.COLLABORATOR;
|
|
192
|
+
return /*#__PURE__*/React.createElement("tbody", null, pivotRowsLen > 0 && pivot_rows.map((rowItem, rowIdx) => {
|
|
200
193
|
let {
|
|
201
194
|
name,
|
|
202
195
|
total
|
|
@@ -214,13 +207,13 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
214
207
|
pivotColumnCells[rowIdx] = rowItem.rows || [];
|
|
215
208
|
}
|
|
216
209
|
let rowTotal = 0;
|
|
217
|
-
return /*#__PURE__*/
|
|
210
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
218
211
|
key: 'table-row' + rowIdx
|
|
219
|
-
}, /*#__PURE__*/
|
|
220
|
-
className: (
|
|
212
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
213
|
+
className: classnames('pivot-row-name', {
|
|
221
214
|
'selected-pivot-cell-left': isSelectedRowNameRight
|
|
222
215
|
})
|
|
223
|
-
}, /*#__PURE__*/
|
|
216
|
+
}, /*#__PURE__*/React.createElement(PivotTableDisplayName, {
|
|
224
217
|
value: name,
|
|
225
218
|
column: groupbyColumn,
|
|
226
219
|
rowData: rowItem,
|
|
@@ -234,7 +227,7 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
234
227
|
} = c;
|
|
235
228
|
if (isCount) {
|
|
236
229
|
const displayValue = total;
|
|
237
|
-
const isValidDisplayValue =
|
|
230
|
+
const isValidDisplayValue = BaseUtils.isValidValue(displayValue, display_empty);
|
|
238
231
|
rowTotal = this.getRowTotal(rowTotal, displayValue);
|
|
239
232
|
if (c && Array.isArray(c.rows) && c.rows.length > 0) {
|
|
240
233
|
pivotRowCells.push(...c.rows);
|
|
@@ -244,14 +237,14 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
244
237
|
pivotColumnCells[cellIdx] = [...c.rows];
|
|
245
238
|
}
|
|
246
239
|
}
|
|
247
|
-
return /*#__PURE__*/
|
|
248
|
-
className: (
|
|
240
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
241
|
+
className: classnames('pivot-cell', {
|
|
249
242
|
'pivot-empty-cell': !isValidDisplayValue,
|
|
250
243
|
'selected-pivot-cell': isSelectedCell,
|
|
251
244
|
'selected-pivot-cell-top': isSelectedCellTop,
|
|
252
245
|
'selected-pivot-cell-left': isSelectedCellLeft
|
|
253
246
|
}),
|
|
254
|
-
key:
|
|
247
|
+
key: `table-cell-${cellIdx}`,
|
|
255
248
|
onClick: () => this.toggleRecords({
|
|
256
249
|
...c,
|
|
257
250
|
name: rowItem === null || rowItem === void 0 ? void 0 : rowItem.name
|
|
@@ -260,39 +253,39 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
260
253
|
cellIdx
|
|
261
254
|
}),
|
|
262
255
|
title: displayValue
|
|
263
|
-
}, isValidDisplayValue ? displayValue : /*#__PURE__*/
|
|
264
|
-
className: (
|
|
256
|
+
}, isValidDisplayValue ? displayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
257
|
+
className: classnames({
|
|
265
258
|
'selected-pivot-cell-border': isSelectedCell
|
|
266
259
|
})
|
|
267
260
|
}));
|
|
268
261
|
}
|
|
269
|
-
return /*#__PURE__*/
|
|
270
|
-
className: (
|
|
271
|
-
key:
|
|
272
|
-
}, /*#__PURE__*/
|
|
273
|
-
className: (
|
|
262
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
263
|
+
className: classnames('pivot-cell'),
|
|
264
|
+
key: `table-cell-${cellIdx}`
|
|
265
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
266
|
+
className: classnames('pivot-cells-container')
|
|
274
267
|
}, total && total.map && total.map((summaryCell, idx) => {
|
|
275
268
|
const summaryCellColumnKey = summaryCell[2];
|
|
276
269
|
const summaryCellColumn = summaryColumns === null || summaryColumns === void 0 ? void 0 : summaryColumns.find(item => item.key === summaryCellColumnKey);
|
|
277
|
-
const displayValue =
|
|
278
|
-
const isValidDisplayValue =
|
|
270
|
+
const displayValue = BaseUtils.getSummaryValueDisplayString(summaryCellColumn, summaryCell[1], summaryMethod);
|
|
271
|
+
const isValidDisplayValue = BaseUtils.isValidValue(displayValue, display_empty);
|
|
279
272
|
rowTotal = this.getRowTotal(rowTotal, summaryCell[1]);
|
|
280
|
-
return /*#__PURE__*/
|
|
281
|
-
key:
|
|
282
|
-
className: (
|
|
273
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
274
|
+
key: `table-cell-${cellIdx}-${idx}`,
|
|
275
|
+
className: classnames('pivot-cell', {
|
|
283
276
|
'pivot-empty-cell': !isValidDisplayValue,
|
|
284
277
|
'selected-pivot-cell': isSelectedCell,
|
|
285
278
|
'selected-pivot-cell-top': isSelectedCellTop,
|
|
286
279
|
'selected-pivot-cell-left': isSelectedCellLeft
|
|
287
280
|
})
|
|
288
|
-
}, isValidDisplayValue ? displayValue : /*#__PURE__*/
|
|
289
|
-
className: (
|
|
281
|
+
}, isValidDisplayValue ? displayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
282
|
+
className: classnames({
|
|
290
283
|
'selected-pivot-cell-border': isSelectedCell
|
|
291
284
|
})
|
|
292
285
|
}));
|
|
293
286
|
}), !total && !(typeof total === 'number') && this.renderEmpty(summaryColumns, cellIdx)));
|
|
294
|
-
}), display_total && /*#__PURE__*/
|
|
295
|
-
className: (
|
|
287
|
+
}), display_total && /*#__PURE__*/React.createElement("td", {
|
|
288
|
+
className: classnames('pivot-cell', {
|
|
296
289
|
'selected-pivot-cell': isSelectedTotalCell,
|
|
297
290
|
'selected-pivot-cell-top': isSelectedTotalCellTop,
|
|
298
291
|
'selected-pivot-cell-left': isSelectedTotalCellLeft
|
|
@@ -306,29 +299,29 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
306
299
|
cellIdx: cells.length
|
|
307
300
|
}),
|
|
308
301
|
title: rowTotal
|
|
309
|
-
},
|
|
310
|
-
className: (
|
|
302
|
+
}, BaseUtils.isValidValue(rowTotal, display_empty) ? BaseUtils.getSummaryValueDisplayString(summaryColumn, rowTotal, summaryMethod) : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
303
|
+
className: classnames({
|
|
311
304
|
'selected-pivot-cell-border': isSelectedTotalCell
|
|
312
305
|
})
|
|
313
306
|
})));
|
|
314
|
-
}), display_total && /*#__PURE__*/
|
|
315
|
-
className: (
|
|
307
|
+
}), display_total && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
308
|
+
className: classnames('pivot-column-total', {
|
|
316
309
|
'selected-pivot-cell-left': isSelectRowTotalCellRight
|
|
317
310
|
})
|
|
318
|
-
}, /*#__PURE__*/
|
|
311
|
+
}, /*#__PURE__*/React.createElement("div", null, intl.get('Total'))), Array.isArray(pivot_columns) && pivot_columns.map((c, index) => {
|
|
319
312
|
const pivotColumnCell = pivotColumnCells[index];
|
|
320
313
|
const isSelectRowTotalCell = selectRowIdx === pivot_rows.length && selectedCellIdx === index;
|
|
321
314
|
const isSelectRowTotalCellLeft = selectRowIdx === pivot_rows.length && selectedCellIdx - 1 === index;
|
|
322
315
|
const pivotColumnTotal = pivot_columns_total[c.key];
|
|
323
|
-
const totalDisplayValue =
|
|
324
|
-
const isValidTotalDisplayValue =
|
|
325
|
-
return /*#__PURE__*/
|
|
326
|
-
className: (
|
|
316
|
+
const totalDisplayValue = BaseUtils.getSummaryValueDisplayString(summaryColumn, pivotColumnTotal, summaryMethod);
|
|
317
|
+
const isValidTotalDisplayValue = BaseUtils.isValidValue(totalDisplayValue, display_empty);
|
|
318
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
319
|
+
className: classnames('pivot-cell', {
|
|
327
320
|
'pivot-empty-cell': !isValidTotalDisplayValue,
|
|
328
321
|
'selected-pivot-cell': isSelectRowTotalCell,
|
|
329
322
|
'selected-pivot-cell-left': isSelectRowTotalCellLeft
|
|
330
323
|
}),
|
|
331
|
-
key:
|
|
324
|
+
key: `total-cell-${index}`,
|
|
332
325
|
onClick: () => this.toggleRecords({
|
|
333
326
|
rows: pivotColumnCell,
|
|
334
327
|
total: pivot_columns_total[c.key]
|
|
@@ -337,13 +330,13 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
337
330
|
cellIdx: index
|
|
338
331
|
}),
|
|
339
332
|
title: totalDisplayValue
|
|
340
|
-
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/
|
|
341
|
-
className: (
|
|
333
|
+
}, isValidTotalDisplayValue ? totalDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
334
|
+
className: classnames({
|
|
342
335
|
'selected-pivot-cell-border': isSelectRowTotalCell
|
|
343
336
|
})
|
|
344
337
|
}));
|
|
345
|
-
}), /*#__PURE__*/
|
|
346
|
-
className: (
|
|
338
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
339
|
+
className: classnames('pivot-cell pivot-table-total', {
|
|
347
340
|
'pivot-empty-cell': !isValidTableTotalDisplayValue,
|
|
348
341
|
'selected-pivot-cell': isSelectTotal
|
|
349
342
|
}),
|
|
@@ -351,8 +344,8 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
351
344
|
rowIdx: pivot_rows.length,
|
|
352
345
|
cellIdx: Array.isArray(pivot_columns) ? pivot_columns.length : 0
|
|
353
346
|
})
|
|
354
|
-
}, isValidTableTotalDisplayValue ? tableTotalDisplayValue : /*#__PURE__*/
|
|
355
|
-
className: (
|
|
347
|
+
}, isValidTableTotalDisplayValue ? tableTotalDisplayValue : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
|
|
348
|
+
className: classnames({
|
|
356
349
|
'selected-pivot-cell-border': isSelectTotal
|
|
357
350
|
})
|
|
358
351
|
}))));
|
|
@@ -365,16 +358,16 @@ class TwoDimensionTable extends _react.PureComponent {
|
|
|
365
358
|
globalTheme
|
|
366
359
|
} = this.props;
|
|
367
360
|
if (!groupbyColumn) return '';
|
|
368
|
-
return /*#__PURE__*/
|
|
361
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
369
362
|
className: "sea-chart-pivot-table",
|
|
370
363
|
style: {
|
|
371
|
-
color:
|
|
364
|
+
color: CHART_THEME_COLOR[globalTheme].pivotTextColor
|
|
372
365
|
}
|
|
373
|
-
}, /*#__PURE__*/
|
|
366
|
+
}, /*#__PURE__*/React.createElement("caption", {
|
|
374
367
|
className: "column-title"
|
|
375
|
-
}, columnGroupbyColumn.name), /*#__PURE__*/
|
|
368
|
+
}, columnGroupbyColumn.name), /*#__PURE__*/React.createElement("caption", {
|
|
376
369
|
className: "row-title"
|
|
377
370
|
}, groupbyColumn.name), this.renderHeader(), this.renderRows());
|
|
378
371
|
}
|
|
379
372
|
}
|
|
380
|
-
|
|
373
|
+
export default TwoDimensionTable;
|
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.getTwoDimensionArrayValue = exports.getFormulaArrayValue = exports.getCellRecordWidth = exports.convertValueToDtableLongTextValue = exports.DATASET_NOT_SUPPORT_COLUMN_TYPES = void 0;
|
|
7
|
-
exports.isArrayFormalColumn = isArrayFormalColumn;
|
|
8
|
-
exports.isValidCellValue = void 0;
|
|
9
|
-
var _dtableUtils = require("dtable-utils");
|
|
10
|
-
var _seafileEditor = require("@seafile/seafile-editor");
|
|
11
|
-
const DATASET_NOT_SUPPORT_COLUMN_TYPES = exports.DATASET_NOT_SUPPORT_COLUMN_TYPES = [_dtableUtils.CellType.BUTTON];
|
|
12
|
-
const getCellRecordWidth = function (column) {
|
|
1
|
+
import { CellType } from 'dtable-utils';
|
|
2
|
+
import { getPreviewContent } from '@seafile/seafile-editor';
|
|
3
|
+
export const DATASET_NOT_SUPPORT_COLUMN_TYPES = [CellType.BUTTON];
|
|
4
|
+
export const getCellRecordWidth = function (column) {
|
|
13
5
|
let isSample = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
14
6
|
let {
|
|
15
7
|
type,
|
|
16
8
|
data
|
|
17
9
|
} = column;
|
|
18
10
|
switch (type) {
|
|
19
|
-
case
|
|
11
|
+
case CellType.DATE:
|
|
20
12
|
{
|
|
21
13
|
let isShowHourAndMinute = data && data.format && data.format.indexOf('HH:mm') > -1;
|
|
22
14
|
return isShowHourAndMinute ? 160 : 110;
|
|
23
15
|
}
|
|
24
|
-
case
|
|
25
|
-
case
|
|
26
|
-
case
|
|
27
|
-
case
|
|
16
|
+
case CellType.LONG_TEXT:
|
|
17
|
+
case CellType.AUTO_NUMBER:
|
|
18
|
+
case CellType.URL:
|
|
19
|
+
case CellType.EMAIL:
|
|
28
20
|
{
|
|
29
21
|
return 200;
|
|
30
22
|
}
|
|
31
|
-
case
|
|
23
|
+
case CellType.CHECKBOX:
|
|
32
24
|
{
|
|
33
25
|
return 80;
|
|
34
26
|
}
|
|
35
|
-
case
|
|
27
|
+
case CellType.NUMBER:
|
|
36
28
|
{
|
|
37
29
|
return 120;
|
|
38
30
|
}
|
|
39
|
-
case
|
|
40
|
-
case
|
|
31
|
+
case CellType.CTIME:
|
|
32
|
+
case CellType.MTIME:
|
|
41
33
|
{
|
|
42
34
|
return 170;
|
|
43
35
|
}
|
|
44
|
-
case
|
|
36
|
+
case CellType.RATE:
|
|
45
37
|
{
|
|
46
38
|
const {
|
|
47
39
|
rate_max_number
|
|
@@ -49,8 +41,8 @@ const getCellRecordWidth = function (column) {
|
|
|
49
41
|
const rateMaxNumber = rate_max_number || 5;
|
|
50
42
|
return 16 * rateMaxNumber + 20;
|
|
51
43
|
}
|
|
52
|
-
case
|
|
53
|
-
case
|
|
44
|
+
case CellType.IMAGE:
|
|
45
|
+
case CellType.FILE:
|
|
54
46
|
{
|
|
55
47
|
return isSample ? 60 : 160;
|
|
56
48
|
}
|
|
@@ -60,8 +52,7 @@ const getCellRecordWidth = function (column) {
|
|
|
60
52
|
}
|
|
61
53
|
}
|
|
62
54
|
};
|
|
63
|
-
|
|
64
|
-
const getFormulaArrayValue = function (value) {
|
|
55
|
+
export const getFormulaArrayValue = function (value) {
|
|
65
56
|
let isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
66
57
|
if (!Array.isArray(value)) return [];
|
|
67
58
|
if (!isFlat) return getTwoDimensionArrayValue(value);
|
|
@@ -86,19 +77,17 @@ const getFormulaArrayValue = function (value) {
|
|
|
86
77
|
});
|
|
87
78
|
}).flat().filter(item => isValidCellValue(item));
|
|
88
79
|
};
|
|
89
|
-
|
|
90
|
-
const convertValueToDtableLongTextValue = value => {
|
|
80
|
+
export const convertValueToDtableLongTextValue = value => {
|
|
91
81
|
const valueType = Object.prototype.toString.call(value);
|
|
92
82
|
if (value && valueType === '[object String]') {
|
|
93
|
-
return
|
|
83
|
+
return getPreviewContent(value);
|
|
94
84
|
}
|
|
95
85
|
if (valueType === '[object Object]') {
|
|
96
86
|
return value;
|
|
97
87
|
}
|
|
98
88
|
return '';
|
|
99
89
|
};
|
|
100
|
-
|
|
101
|
-
const isValidCellValue = value => {
|
|
90
|
+
export const isValidCellValue = value => {
|
|
102
91
|
if (value === undefined) return false;
|
|
103
92
|
if (value === null) return false;
|
|
104
93
|
if (value === '') return false;
|
|
@@ -106,8 +95,7 @@ const isValidCellValue = value => {
|
|
|
106
95
|
if (JSON.stringify(value) === '[]') return false;
|
|
107
96
|
return true;
|
|
108
97
|
};
|
|
109
|
-
|
|
110
|
-
const getTwoDimensionArrayValue = value => {
|
|
98
|
+
export const getTwoDimensionArrayValue = value => {
|
|
111
99
|
if (!Array.isArray(value)) return [];
|
|
112
100
|
return value.map(item => {
|
|
113
101
|
if (Object.prototype.toString.call(item) !== '[object Object]') {
|
|
@@ -130,7 +118,6 @@ const getTwoDimensionArrayValue = value => {
|
|
|
130
118
|
});
|
|
131
119
|
});
|
|
132
120
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return [_dtableUtils.CellType.IMAGE, _dtableUtils.CellType.FILE, _dtableUtils.CellType.MULTIPLE_SELECT, _dtableUtils.CellType.COLLABORATOR].includes(columnType);
|
|
121
|
+
export function isArrayFormalColumn(columnType) {
|
|
122
|
+
return [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR].includes(columnType);
|
|
136
123
|
}
|