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,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _DTableSelect2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSelect"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _dtableUtils = require("dtable-utils");
|
|
13
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
-
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
15
|
-
require("./index.css");
|
|
1
|
+
import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { Label, FormGroup } from 'reactstrap';
|
|
4
|
+
import { getTableById, getNonPrivateViews, isArchiveView } from 'dtable-utils';
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
import intl from '../../../intl';
|
|
7
|
+
import './index.css';
|
|
16
8
|
const SelectView = _ref => {
|
|
17
9
|
let {
|
|
18
10
|
tables,
|
|
@@ -20,10 +12,10 @@ const SelectView = _ref => {
|
|
|
20
12
|
selectedViewId,
|
|
21
13
|
onChange
|
|
22
14
|
} = _ref;
|
|
23
|
-
const viewOptions =
|
|
24
|
-
const table =
|
|
15
|
+
const viewOptions = useMemo(() => {
|
|
16
|
+
const table = getTableById(tables, selectedTableId);
|
|
25
17
|
if (!table) return [];
|
|
26
|
-
let views =
|
|
18
|
+
let views = getNonPrivateViews(table.views);
|
|
27
19
|
let selectedView = views.find(view => view._id === selectedViewId);
|
|
28
20
|
if (!selectedView) {
|
|
29
21
|
selectedView = views[0];
|
|
@@ -31,23 +23,23 @@ const SelectView = _ref => {
|
|
|
31
23
|
|
|
32
24
|
// not support archive view on plugin, do not show archive view
|
|
33
25
|
// but if it is selected, keep it
|
|
34
|
-
if (selectedView && !
|
|
35
|
-
views = views.filter(v => !
|
|
26
|
+
if (selectedView && !isArchiveView(selectedView)) {
|
|
27
|
+
views = views.filter(v => !isArchiveView(v));
|
|
36
28
|
}
|
|
37
29
|
return Array.isArray(views) ? views.map(view => {
|
|
38
30
|
const value = view._id;
|
|
39
|
-
const archiveView =
|
|
31
|
+
const archiveView = isArchiveView(view);
|
|
40
32
|
return {
|
|
41
|
-
label: /*#__PURE__*/
|
|
33
|
+
label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
42
34
|
className: "sea-chart-table-view mr-2"
|
|
43
|
-
}, /*#__PURE__*/
|
|
44
|
-
className: (
|
|
35
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
36
|
+
className: classnames('dtable-font',
|
|
45
37
|
// 'dtable-icon-main-view',
|
|
46
38
|
{
|
|
47
39
|
'dtable-icon-archive-view': archiveView,
|
|
48
40
|
'dtable-icon-main-view': !archiveView
|
|
49
41
|
})
|
|
50
|
-
})), /*#__PURE__*/
|
|
42
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
51
43
|
className: "select-option-name"
|
|
52
44
|
}, view.name)),
|
|
53
45
|
value
|
|
@@ -55,13 +47,13 @@ const SelectView = _ref => {
|
|
|
55
47
|
}) : [];
|
|
56
48
|
}, [tables, selectedTableId, selectedViewId]);
|
|
57
49
|
const selectedOption = selectedViewId ? viewOptions.find(option => option.value === selectedViewId) : null;
|
|
58
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
59
51
|
className: "sea-chart-setting-item table-setting"
|
|
60
|
-
}, /*#__PURE__*/
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('View')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
61
53
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
62
54
|
value: selectedOption,
|
|
63
55
|
options: viewOptions,
|
|
64
56
|
onChange: onChange
|
|
65
57
|
}));
|
|
66
58
|
};
|
|
67
|
-
|
|
59
|
+
export default SelectView;
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _DTableSwitch2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSwitch"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _dtableUtils = require("dtable-utils");
|
|
13
|
-
var _utils = require("../../utils");
|
|
14
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
15
|
-
class Stack extends _react.Component {
|
|
1
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import { Label, FormGroup } from 'reactstrap';
|
|
4
|
+
import { getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
5
|
+
import { eventStopPropagation } from '../../utils';
|
|
6
|
+
import intl from '../../intl';
|
|
7
|
+
class Stack extends Component {
|
|
16
8
|
constructor() {
|
|
17
9
|
super(...arguments);
|
|
18
10
|
this.onUseStackChange = event => {
|
|
19
|
-
|
|
11
|
+
eventStopPropagation(event);
|
|
20
12
|
const {
|
|
21
13
|
chart
|
|
22
14
|
} = this.props;
|
|
@@ -42,17 +34,17 @@ class Stack extends _react.Component {
|
|
|
42
34
|
column_groupby_column_key
|
|
43
35
|
} = chart.config;
|
|
44
36
|
if (!column_groupby_column_key) return null;
|
|
45
|
-
const selectedTable =
|
|
37
|
+
const selectedTable = getTableById(tables, selectedTableId);
|
|
46
38
|
if (!selectedTable) return null;
|
|
47
|
-
const columnGroupbyColumn =
|
|
39
|
+
const columnGroupbyColumn = getTableColumnByKey(selectedTable, column_groupby_column_key);
|
|
48
40
|
if (!columnGroupbyColumn) return null;
|
|
49
|
-
return /*#__PURE__*/
|
|
41
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
50
42
|
className: "sea-chart-parameter-item"
|
|
51
|
-
}, /*#__PURE__*/
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Display_mode')), /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
52
44
|
checked: y_axis_use_stack || false,
|
|
53
|
-
placeholder:
|
|
45
|
+
placeholder: intl.get('Stack'),
|
|
54
46
|
onChange: this.onUseStackChange
|
|
55
47
|
}));
|
|
56
48
|
}
|
|
57
49
|
}
|
|
58
|
-
|
|
50
|
+
export default Stack;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _DTableSelect2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSelect"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _shallowequal = _interopRequireDefault(require("shallowequal"));
|
|
13
|
-
var _constants = require("../../constants");
|
|
14
|
-
var _utils = require("../../utils");
|
|
15
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
16
|
-
class SummaryMethodSettings extends _react.Component {
|
|
1
|
+
import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import { FormGroup, Label } from 'reactstrap';
|
|
4
|
+
import shallowEqual from 'shallowequal';
|
|
5
|
+
import { CHART_SUMMARY_CALCULATION_METHOD, CHART_SUMMARY_SHOW, CHART_DATE_SUMMARY_CALCULATION_METHOD } from '../../constants';
|
|
6
|
+
import { BaseUtils } from '../../utils';
|
|
7
|
+
import intl from '../../intl';
|
|
8
|
+
class SummaryMethodSettings extends Component {
|
|
17
9
|
constructor(_props) {
|
|
18
10
|
super(_props);
|
|
19
11
|
this.initSummaryMethodOptions = props => {
|
|
@@ -22,11 +14,11 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
22
14
|
numericColumnOptions
|
|
23
15
|
} = props;
|
|
24
16
|
const selectedOption = numericColumnOptions.find(item => item.value.key === value.column_key);
|
|
25
|
-
const summaryMethodOptions = selectedOption &&
|
|
17
|
+
const summaryMethodOptions = selectedOption && BaseUtils.isDateSummaryColumn(selectedOption.value) ? CHART_DATE_SUMMARY_CALCULATION_METHOD : CHART_SUMMARY_CALCULATION_METHOD;
|
|
26
18
|
this.summaryMethodOptions = summaryMethodOptions.map(item => {
|
|
27
19
|
return {
|
|
28
20
|
value: item,
|
|
29
|
-
label:
|
|
21
|
+
label: intl.get(CHART_SUMMARY_SHOW[item])
|
|
30
22
|
};
|
|
31
23
|
});
|
|
32
24
|
};
|
|
@@ -36,7 +28,7 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
36
28
|
this.initSummaryMethodOptions(_props);
|
|
37
29
|
}
|
|
38
30
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
39
|
-
if (!(
|
|
31
|
+
if (!shallowEqual(this.props.value, nextProps.value)) {
|
|
40
32
|
this.initSummaryMethodOptions(nextProps);
|
|
41
33
|
}
|
|
42
34
|
}
|
|
@@ -51,17 +43,17 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
51
43
|
} = value;
|
|
52
44
|
const selectedColumnOption = numericColumnOptions.find(option => option.value.key === column_key);
|
|
53
45
|
const selectedSummaryMethodOption = this.summaryMethodOptions.find(option => option.value === summary_method);
|
|
54
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormGroup, {
|
|
55
47
|
className: "chart-parameter-item"
|
|
56
|
-
}, /*#__PURE__*/
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Summary_field')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
57
49
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
58
50
|
value: selectedColumnOption,
|
|
59
|
-
placeholder:
|
|
51
|
+
placeholder: intl.get('Select_a_column'),
|
|
60
52
|
onChange: this.props.onColumnOptionChange,
|
|
61
53
|
options: numericColumnOptions
|
|
62
|
-
})), /*#__PURE__*/
|
|
54
|
+
})), /*#__PURE__*/React.createElement(FormGroup, {
|
|
63
55
|
className: "chart-parameter-item"
|
|
64
|
-
}, /*#__PURE__*/
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
65
57
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
66
58
|
value: selectedSummaryMethodOption,
|
|
67
59
|
onChange: this.props.onSummaryMethodChange,
|
|
@@ -69,4 +61,4 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
69
61
|
})));
|
|
70
62
|
}
|
|
71
63
|
}
|
|
72
|
-
|
|
64
|
+
export default SummaryMethodSettings;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _dtableUtils = require("dtable-utils");
|
|
13
|
-
var _reactstrap = require("reactstrap");
|
|
14
|
-
var _utils = require("../../utils");
|
|
15
|
-
var _constants = require("../../constants");
|
|
16
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
17
|
-
var _numericSummaryItem = _interopRequireDefault(require("./numeric-summary-item"));
|
|
18
|
-
class SummarySettings extends _react.Component {
|
|
1
|
+
import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
2
|
+
import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
|
|
3
|
+
import React, { Component, Fragment } from 'react';
|
|
4
|
+
import { getTableById } from 'dtable-utils';
|
|
5
|
+
import { FormGroup, Label } from 'reactstrap';
|
|
6
|
+
import { BaseUtils } from '../../utils';
|
|
7
|
+
import { CHART_SUMMARY_SHOW, CHART_SUMMARY_CALCULATION_METHOD, CHART_SUMMARY_TYPE, CHART_Y_GROUP_TYPE, CHART_TYPE, CHART_SUPPORT_COLUMNS, CHART_DATE_SUMMARY_CALCULATION_METHOD } from '../../constants';
|
|
8
|
+
import intl from '../../intl';
|
|
9
|
+
import NumericSummaryItem from './numeric-summary-item';
|
|
10
|
+
class SummarySettings extends Component {
|
|
19
11
|
constructor(_props) {
|
|
20
12
|
super(_props);
|
|
21
13
|
this.initTable = props => {
|
|
@@ -26,7 +18,7 @@ class SummarySettings extends _react.Component {
|
|
|
26
18
|
const {
|
|
27
19
|
table_id
|
|
28
20
|
} = config;
|
|
29
|
-
this.selectedTable =
|
|
21
|
+
this.selectedTable = getTableById(tables, table_id);
|
|
30
22
|
};
|
|
31
23
|
this.initColumns = () => {
|
|
32
24
|
if (!this.selectedTable) {
|
|
@@ -38,22 +30,22 @@ class SummarySettings extends _react.Component {
|
|
|
38
30
|
const columns = Array.isArray(this.selectedTable.columns) ? this.selectedTable.columns : [];
|
|
39
31
|
this.columns = this.getAvailableColumns(columns);
|
|
40
32
|
this.columnGroupbyColumnsOptions = this.getColumnOptions(this.columns);
|
|
41
|
-
this.numericColumns = this.columns.filter(column =>
|
|
33
|
+
this.numericColumns = this.columns.filter(column => BaseUtils.isNumericSummaryColumn(column));
|
|
42
34
|
this.numericColumnsOptions = this.getColumnOptions(this.numericColumns);
|
|
43
35
|
};
|
|
44
36
|
this.getAvailableColumns = columns => {
|
|
45
37
|
if (!columns || !Array.isArray(columns)) return [];
|
|
46
|
-
return columns.filter(column =>
|
|
38
|
+
return columns.filter(column => CHART_SUPPORT_COLUMNS.includes(column.type));
|
|
47
39
|
};
|
|
48
40
|
this.getColumnOptions = columns => {
|
|
49
41
|
const options = columns.map(column => {
|
|
50
42
|
return {
|
|
51
43
|
value: column,
|
|
52
|
-
label: /*#__PURE__*/
|
|
44
|
+
label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
53
45
|
className: "sea-chart-column-icon"
|
|
54
|
-
}, /*#__PURE__*/
|
|
46
|
+
}, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
|
|
55
47
|
column: column
|
|
56
|
-
})), /*#__PURE__*/
|
|
48
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
57
49
|
className: 'select-module select-module-name ml-0'
|
|
58
50
|
}, column.name))
|
|
59
51
|
};
|
|
@@ -62,9 +54,9 @@ class SummarySettings extends _react.Component {
|
|
|
62
54
|
value: {
|
|
63
55
|
key: 'Groupby_null'
|
|
64
56
|
},
|
|
65
|
-
label: /*#__PURE__*/
|
|
57
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
66
58
|
className: 'select-module select-module-name null-option-name ml-0'
|
|
67
|
-
},
|
|
59
|
+
}, intl.get('Select_a_column')),
|
|
68
60
|
style: {
|
|
69
61
|
color: 'rgba(0, 0, 0, .25)'
|
|
70
62
|
}
|
|
@@ -72,30 +64,30 @@ class SummarySettings extends _react.Component {
|
|
|
72
64
|
};
|
|
73
65
|
this.getSummaryTypeOptions = () => {
|
|
74
66
|
const summaryTypes = [{
|
|
75
|
-
value:
|
|
76
|
-
label: /*#__PURE__*/
|
|
67
|
+
value: CHART_Y_GROUP_TYPE.COUNT,
|
|
68
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
77
69
|
className: "select-module select-module-name ml-0"
|
|
78
|
-
},
|
|
70
|
+
}, intl.get(CHART_SUMMARY_SHOW['count'])), /*#__PURE__*/React.createElement("div", {
|
|
79
71
|
className: "summary-type-explanation"
|
|
80
|
-
},
|
|
72
|
+
}, intl.get('Count_the_number_of_records_in_each_group')))
|
|
81
73
|
}, {
|
|
82
|
-
value:
|
|
83
|
-
label: /*#__PURE__*/
|
|
74
|
+
value: CHART_Y_GROUP_TYPE.SINGLE_NUMERIC_COLUMN,
|
|
75
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
84
76
|
className: "select-module select-module-name ml-0"
|
|
85
|
-
},
|
|
77
|
+
}, intl.get(CHART_SUMMARY_SHOW['advanced'])), /*#__PURE__*/React.createElement("div", {
|
|
86
78
|
className: "summary-type-explanation"
|
|
87
|
-
},
|
|
79
|
+
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_a_field')))
|
|
88
80
|
}];
|
|
89
81
|
|
|
90
82
|
// multiple_numeric_column
|
|
91
83
|
if (this.props.useMultipleSummaryColumns) {
|
|
92
84
|
summaryTypes.push({
|
|
93
|
-
value:
|
|
94
|
-
label: /*#__PURE__*/
|
|
85
|
+
value: CHART_Y_GROUP_TYPE.MULTIPLE_NUMERIC_COLUMN,
|
|
86
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
95
87
|
className: "select-module select-module-name ml-0"
|
|
96
|
-
},
|
|
88
|
+
}, intl.get('Summarize_multiple_fields')), /*#__PURE__*/React.createElement("div", {
|
|
97
89
|
className: "summary-type-explanation"
|
|
98
|
-
},
|
|
90
|
+
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_multiple_fields')))
|
|
99
91
|
});
|
|
100
92
|
}
|
|
101
93
|
return summaryTypes;
|
|
@@ -106,42 +98,42 @@ class SummarySettings extends _react.Component {
|
|
|
106
98
|
} = this.props;
|
|
107
99
|
const chartType = config.type;
|
|
108
100
|
let variable = '';
|
|
109
|
-
if (chartType ===
|
|
101
|
+
if (chartType === CHART_TYPE.MAP) {
|
|
110
102
|
variable = '位置字段';
|
|
111
103
|
}
|
|
112
|
-
if (chartType ===
|
|
113
|
-
variable =
|
|
104
|
+
if (chartType === CHART_TYPE.WORLD_MAP) {
|
|
105
|
+
variable = intl.get('Location_field');
|
|
114
106
|
}
|
|
115
|
-
if (chartType ===
|
|
116
|
-
variable =
|
|
107
|
+
if (chartType === CHART_TYPE.HEAT_MAP) {
|
|
108
|
+
variable = intl.get('Time_field');
|
|
117
109
|
}
|
|
118
|
-
if (chartType ===
|
|
119
|
-
variable =
|
|
110
|
+
if (chartType === CHART_TYPE.MIRROR) {
|
|
111
|
+
variable = intl.get('Statistic_field');
|
|
120
112
|
}
|
|
121
|
-
if (chartType ===
|
|
122
|
-
variable =
|
|
113
|
+
if (chartType === CHART_TYPE.COMBINATION) {
|
|
114
|
+
variable = intl.get('X-axis');
|
|
123
115
|
}
|
|
124
|
-
if (chartType ===
|
|
116
|
+
if (chartType === CHART_TYPE.TREND) {
|
|
125
117
|
return {
|
|
126
|
-
count:
|
|
127
|
-
advanced:
|
|
118
|
+
count: intl.get('Calculate_the_number_of_records_in_two_time_periods'),
|
|
119
|
+
advanced: intl.get('Use_a_field_to_calculate_the_sum_maximum_or_minimum_value_of_records_in_two_time_periods')
|
|
128
120
|
};
|
|
129
121
|
}
|
|
130
122
|
return {
|
|
131
|
-
count:
|
|
123
|
+
count: intl.get('Count_by_var', {
|
|
132
124
|
var: variable
|
|
133
125
|
}),
|
|
134
|
-
advanced:
|
|
126
|
+
advanced: intl.get('Compute_sum_max_min_by_var', {
|
|
135
127
|
var: variable
|
|
136
128
|
})
|
|
137
129
|
};
|
|
138
130
|
};
|
|
139
131
|
this.getSummaryMethodsOptions = () => {
|
|
140
|
-
return
|
|
132
|
+
return CHART_SUMMARY_CALCULATION_METHOD.map(method => {
|
|
141
133
|
return {
|
|
142
|
-
label: /*#__PURE__*/
|
|
134
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
143
135
|
className: "select-option-name"
|
|
144
|
-
},
|
|
136
|
+
}, intl.get(CHART_SUMMARY_SHOW[method])),
|
|
145
137
|
value: method
|
|
146
138
|
};
|
|
147
139
|
});
|
|
@@ -154,9 +146,9 @@ class SummarySettings extends _react.Component {
|
|
|
154
146
|
label
|
|
155
147
|
} = this.props;
|
|
156
148
|
const selectedSummaryType = this.getSelectedSummaryType();
|
|
157
|
-
return /*#__PURE__*/
|
|
149
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
158
150
|
className: "sea-chart-parameter-item"
|
|
159
|
-
}, /*#__PURE__*/
|
|
151
|
+
}, /*#__PURE__*/React.createElement(Label, null, label), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
160
152
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
161
153
|
classNamePrefix: "chart-summary-types",
|
|
162
154
|
value: selectedSummaryType,
|
|
@@ -166,14 +158,14 @@ class SummarySettings extends _react.Component {
|
|
|
166
158
|
};
|
|
167
159
|
this.getSelectedSummaryType = () => {
|
|
168
160
|
const {
|
|
169
|
-
summaryType =
|
|
161
|
+
summaryType = CHART_SUMMARY_TYPE.COUNT,
|
|
170
162
|
config,
|
|
171
163
|
useMultipleSummaryColumns
|
|
172
164
|
} = this.props;
|
|
173
|
-
if (summaryType ===
|
|
165
|
+
if (summaryType === CHART_SUMMARY_TYPE.COUNT) {
|
|
174
166
|
return this.summaryTypeOptions[0];
|
|
175
167
|
}
|
|
176
|
-
if (config.type ===
|
|
168
|
+
if (config.type === CHART_TYPE.COMBINATION && config.y_axis_left_group_by_multiple_numeric_column && useMultipleSummaryColumns) {
|
|
177
169
|
return this.summaryTypeOptions[2];
|
|
178
170
|
}
|
|
179
171
|
return this.summaryTypeOptions[1];
|
|
@@ -194,24 +186,24 @@ class SummarySettings extends _react.Component {
|
|
|
194
186
|
summaryColumn
|
|
195
187
|
} = this.props;
|
|
196
188
|
let selectedColumnOption = this.numericColumnsOptions.find(o => o.value.key === summaryColumn);
|
|
197
|
-
return /*#__PURE__*/
|
|
189
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
198
190
|
className: "sea-chart-parameter-item"
|
|
199
|
-
}, /*#__PURE__*/
|
|
191
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Summary_field')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
200
192
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
201
193
|
value: selectedColumnOption,
|
|
202
194
|
onChange: this.onSelectSummaryColumn,
|
|
203
195
|
options: this.numericColumnsOptions,
|
|
204
|
-
placeholder:
|
|
196
|
+
placeholder: intl.get('Select_a_column'),
|
|
205
197
|
noOptionsMessage: () => {
|
|
206
|
-
return /*#__PURE__*/
|
|
198
|
+
return /*#__PURE__*/React.createElement("span", null, intl.get('No_options'));
|
|
207
199
|
}
|
|
208
200
|
}));
|
|
209
201
|
};
|
|
210
202
|
this.renderSummaryMethod = () => {
|
|
211
203
|
let selectedMethodOption = this.getSelectedMethodOption(this.props.summaryMethod, this.summaryMethodsOptions);
|
|
212
|
-
return /*#__PURE__*/
|
|
204
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
213
205
|
className: "sea-chart-parameter-item"
|
|
214
|
-
}, /*#__PURE__*/
|
|
206
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
215
207
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
216
208
|
value: selectedMethodOption,
|
|
217
209
|
onChange: this.onSelectSummaryMethod,
|
|
@@ -230,13 +222,13 @@ class SummarySettings extends _react.Component {
|
|
|
230
222
|
type
|
|
231
223
|
} = config;
|
|
232
224
|
let column_key, summary_method;
|
|
233
|
-
if (type ===
|
|
225
|
+
if (type === CHART_TYPE.COMBINATION) {
|
|
234
226
|
column_key = config.y_axis_left_summary_column;
|
|
235
227
|
summary_method = config.y_axis_left_summary_method;
|
|
236
228
|
}
|
|
237
|
-
return /*#__PURE__*/
|
|
229
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
238
230
|
chart: chart,
|
|
239
|
-
key:
|
|
231
|
+
key: `number-column-${0}`,
|
|
240
232
|
numericColumnOptions: this.numericColumnsOptions,
|
|
241
233
|
onColumnOptionChange: this.onChangeNumericSummaryColumn,
|
|
242
234
|
onSummaryMethodChange: this.onChangeNumericSummaryMethod,
|
|
@@ -245,14 +237,14 @@ class SummarySettings extends _react.Component {
|
|
|
245
237
|
column_key,
|
|
246
238
|
summary_method
|
|
247
239
|
}
|
|
248
|
-
}), this.renderGroupbyNumericColumns(), Array.isArray(this.numericColumnsOptions) && this.numericColumnsOptions.length > 0 && /*#__PURE__*/
|
|
240
|
+
}), this.renderGroupbyNumericColumns(), Array.isArray(this.numericColumnsOptions) && this.numericColumnsOptions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
249
241
|
className: "statistic-add-number-columns d-flex align-items-center",
|
|
250
242
|
onClick: this.onAddNumericColumn
|
|
251
|
-
}, /*#__PURE__*/
|
|
243
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
252
244
|
className: "dtable-font dtable-icon-add-table mr-2"
|
|
253
|
-
}), /*#__PURE__*/
|
|
245
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
254
246
|
className: "number-column-item add-number-column-description"
|
|
255
|
-
},
|
|
247
|
+
}, intl.get('Add_new_field'))));
|
|
256
248
|
};
|
|
257
249
|
this.onDeleteNumericColumnItem = index => {
|
|
258
250
|
let {
|
|
@@ -277,12 +269,12 @@ class SummarySettings extends _react.Component {
|
|
|
277
269
|
y_axis_left_group_by_numeric_columns = [...y_axis_left_group_by_numeric_columns];
|
|
278
270
|
y_axis_left_group_by_numeric_columns.push({
|
|
279
271
|
column_key: newNumericColumnKey,
|
|
280
|
-
summary_method:
|
|
272
|
+
summary_method: CHART_SUMMARY_CALCULATION_METHOD[0]
|
|
281
273
|
});
|
|
282
274
|
} else {
|
|
283
275
|
y_axis_left_group_by_numeric_columns = [{
|
|
284
276
|
column_key: newNumericColumnKey,
|
|
285
|
-
summary_method:
|
|
277
|
+
summary_method: CHART_SUMMARY_CALCULATION_METHOD[0]
|
|
286
278
|
}];
|
|
287
279
|
}
|
|
288
280
|
this.props.onChange({
|
|
@@ -301,7 +293,7 @@ class SummarySettings extends _react.Component {
|
|
|
301
293
|
const {
|
|
302
294
|
config
|
|
303
295
|
} = chart;
|
|
304
|
-
const summaryMethods =
|
|
296
|
+
const summaryMethods = BaseUtils.isDateSummaryColumn(column) ? CHART_DATE_SUMMARY_CALCULATION_METHOD : CHART_SUMMARY_CALCULATION_METHOD;
|
|
305
297
|
if (index === 0) {
|
|
306
298
|
let {
|
|
307
299
|
y_axis_left_summary_method
|
|
@@ -376,9 +368,9 @@ class SummarySettings extends _react.Component {
|
|
|
376
368
|
} = config;
|
|
377
369
|
if (!y_axis_left_group_by_numeric_columns || !Array.isArray(y_axis_left_group_by_numeric_columns)) return null;
|
|
378
370
|
return y_axis_left_group_by_numeric_columns.map((item, index) => {
|
|
379
|
-
return /*#__PURE__*/
|
|
371
|
+
return /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
380
372
|
chart: chart,
|
|
381
|
-
key:
|
|
373
|
+
key: `number-column-${index}`,
|
|
382
374
|
numericColumnOptions: this.numericColumnsOptions,
|
|
383
375
|
onColumnOptionChange: this.onChangeNumericSummaryColumn,
|
|
384
376
|
onSummaryMethodChange: this.onChangeNumericSummaryMethod,
|
|
@@ -394,8 +386,8 @@ class SummarySettings extends _react.Component {
|
|
|
394
386
|
summaryType,
|
|
395
387
|
useMultipleSummaryColumns
|
|
396
388
|
} = this.props;
|
|
397
|
-
if (config.type ===
|
|
398
|
-
if (useMultipleSummaryColumns && summaryType ===
|
|
389
|
+
if (config.type === CHART_TYPE.COMBINATION) {
|
|
390
|
+
if (useMultipleSummaryColumns && summaryType === CHART_SUMMARY_TYPE.ADVANCED && config.y_axis_left_group_by_multiple_numeric_column) {
|
|
399
391
|
return true;
|
|
400
392
|
}
|
|
401
393
|
}
|
|
@@ -417,7 +409,7 @@ class SummarySettings extends _react.Component {
|
|
|
417
409
|
summaryType
|
|
418
410
|
} = this.props;
|
|
419
411
|
const _useMultipleSummaryColumns = this.useMultipleSummaryColumns();
|
|
420
|
-
return /*#__PURE__*/
|
|
412
|
+
return /*#__PURE__*/React.createElement(Fragment, null, this.renderSummaryTypes(), !_useMultipleSummaryColumns && summaryType === CHART_SUMMARY_TYPE.ADVANCED && /*#__PURE__*/React.createElement(Fragment, null, this.renderNumericColumn(), this.renderSummaryMethod()), _useMultipleSummaryColumns && this.renderNumericSummaryItem());
|
|
421
413
|
}
|
|
422
414
|
}
|
|
423
|
-
|
|
415
|
+
export default SummarySettings;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _DTableSwitch2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableSwitch"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
require("./index.css");
|
|
1
|
+
import _DTableSwitch from "dtable-ui-component/lib/DTableSwitch";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import './index.css';
|
|
12
5
|
const Switch = _ref => {
|
|
13
6
|
let {
|
|
14
7
|
checked,
|
|
@@ -17,10 +10,10 @@ const Switch = _ref => {
|
|
|
17
10
|
disabled,
|
|
18
11
|
onChange
|
|
19
12
|
} = _ref;
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
-
className: (
|
|
22
|
-
}, /*#__PURE__*/
|
|
23
|
-
key:
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: classnames('sea-chart-parameter-container', className)
|
|
15
|
+
}, /*#__PURE__*/React.createElement(_DTableSwitch, {
|
|
16
|
+
key: `custom-switch-checkbox-${checked}`,
|
|
24
17
|
checked: checked,
|
|
25
18
|
disabled: disabled,
|
|
26
19
|
switchClassName: "sea-chart-toggle-parameter",
|
|
@@ -28,4 +21,4 @@ const Switch = _ref => {
|
|
|
28
21
|
onChange: onChange
|
|
29
22
|
}));
|
|
30
23
|
};
|
|
31
|
-
|
|
24
|
+
export default Switch;
|