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