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,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _dtableUtils = require("dtable-utils");
|
|
13
|
-
var _components = require("../../../components");
|
|
14
|
-
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { Label } from 'reactstrap';
|
|
4
|
+
import { isNumber } from 'dtable-utils';
|
|
5
|
+
import { PixelEditor } from '../../../components';
|
|
6
|
+
import intl from '../../../intl';
|
|
15
7
|
const FontSizeSettings = _ref => {
|
|
16
8
|
let {
|
|
17
9
|
fontSize,
|
|
@@ -20,22 +12,22 @@ const FontSizeSettings = _ref => {
|
|
|
20
12
|
className,
|
|
21
13
|
title
|
|
22
14
|
} = _ref;
|
|
23
|
-
const initialFontSize =
|
|
24
|
-
if (
|
|
25
|
-
if (
|
|
15
|
+
const initialFontSize = useMemo(() => {
|
|
16
|
+
if (isNumber(fontSize)) return fontSize;
|
|
17
|
+
if (isNumber(defaultFontSize)) return defaultFontSize;
|
|
26
18
|
return null;
|
|
27
19
|
}, [fontSize, defaultFontSize]);
|
|
28
|
-
const onChange =
|
|
20
|
+
const onChange = useCallback(currFontSize => {
|
|
29
21
|
const parsedFontSize = parseInt(currFontSize);
|
|
30
22
|
if (!fontSize && !parsedFontSize || parsedFontSize === fontSize) return;
|
|
31
23
|
modifyFontSize(parsedFontSize);
|
|
32
24
|
}, [fontSize, modifyFontSize]);
|
|
33
|
-
return /*#__PURE__*/
|
|
34
|
-
className: (
|
|
35
|
-
}, /*#__PURE__*/
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: classnames('sea-chart-setting-item font-size-setting', className)
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Label, null, title || intl.get('Font_size')), /*#__PURE__*/React.createElement(PixelEditor, {
|
|
36
28
|
pixel: initialFontSize,
|
|
37
29
|
defaultPixel: defaultFontSize,
|
|
38
30
|
modifyPixel: onChange
|
|
39
31
|
}));
|
|
40
32
|
};
|
|
41
|
-
|
|
33
|
+
export default FontSizeSettings;
|
|
@@ -1,33 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _DTableCustomizeSelect2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableCustomizeSelect"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
-
var _reactstrap = require("reactstrap");
|
|
13
|
-
var _utils = require("../../../utils");
|
|
14
|
-
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
1
|
+
import _DTableCustomizeSelect from "dtable-ui-component/lib/DTableCustomizeSelect";
|
|
2
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { Label } from 'reactstrap';
|
|
5
|
+
import { generatorCommonOptions } from '../../../utils';
|
|
6
|
+
import intl from '../../../intl';
|
|
15
7
|
const FontWeightSettings = props => {
|
|
16
|
-
const [fontWeight, setFontWeight] =
|
|
17
|
-
const mountRef =
|
|
18
|
-
|
|
8
|
+
const [fontWeight, setFontWeight] = useState(props.fontWeight);
|
|
9
|
+
const mountRef = useRef(false);
|
|
10
|
+
useEffect(() => {
|
|
19
11
|
if (!mountRef.current) {
|
|
20
12
|
mountRef.current = true;
|
|
21
13
|
} else {
|
|
22
14
|
setFontWeight(props.fontWeight);
|
|
23
15
|
}
|
|
24
16
|
}, [props.fontWeight]);
|
|
25
|
-
const fontWeightOptions =
|
|
26
|
-
return
|
|
17
|
+
const fontWeightOptions = useMemo(() => {
|
|
18
|
+
return generatorCommonOptions(props.supportFontWeights, fontWeight);
|
|
27
19
|
}, [props.supportFontWeights, fontWeight]);
|
|
28
|
-
const selectedFontWeightOption =
|
|
20
|
+
const selectedFontWeightOption = useMemo(() => {
|
|
29
21
|
return {
|
|
30
|
-
label: /*#__PURE__*/
|
|
22
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
31
23
|
className: "common-selected-font"
|
|
32
24
|
}, fontWeight)
|
|
33
25
|
};
|
|
@@ -40,13 +32,13 @@ const FontWeightSettings = props => {
|
|
|
40
32
|
setFontWeight(nextFontWeight);
|
|
41
33
|
props.modifyFontWeight(nextFontWeight);
|
|
42
34
|
};
|
|
43
|
-
return /*#__PURE__*/
|
|
44
|
-
className: (
|
|
45
|
-
}, /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: classnames('setting-item sea-chart-font-weight-setting', props.className)
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Font_weight')), /*#__PURE__*/React.createElement(_DTableCustomizeSelect, {
|
|
46
38
|
className: "sea-chart-font-weight",
|
|
47
39
|
value: selectedFontWeightOption,
|
|
48
40
|
options: fontWeightOptions,
|
|
49
41
|
onSelectOption: modifyFontWeight
|
|
50
42
|
}));
|
|
51
43
|
};
|
|
52
|
-
|
|
44
|
+
export default FontWeightSettings;
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "FontColorSettings", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _fontColorSettings.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "FontSizeSettings", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _fontSizeSettings.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "FontWeightSettings", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _fontWeightSettings.default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
var _fontSizeSettings = _interopRequireDefault(require("./font-size-settings"));
|
|
26
|
-
var _fontWeightSettings = _interopRequireDefault(require("./font-weight-settings"));
|
|
27
|
-
var _fontColorSettings = _interopRequireDefault(require("./font-color-settings"));
|
|
1
|
+
import FontSizeSettings from './font-size-settings';
|
|
2
|
+
import FontWeightSettings from './font-weight-settings';
|
|
3
|
+
import FontColorSettings from './font-color-settings';
|
|
4
|
+
export { FontSizeSettings, FontWeightSettings, FontColorSettings };
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var _reactstrap = require("reactstrap");
|
|
14
|
-
var _dtableUtils = require("dtable-utils");
|
|
15
|
-
var _columnUtils = require("../../utils/column-utils");
|
|
16
|
-
var _constants = require("../../constants");
|
|
17
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
18
|
-
class GroupBy extends _react.Component {
|
|
1
|
+
import _DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
2
|
+
import _DTableCustomizeSelect from "dtable-ui-component/lib/DTableCustomizeSelect";
|
|
3
|
+
import _DTableColumnIcon from "dtable-ui-component/lib/DTableColumnIcon";
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
import { Label, FormGroup } from 'reactstrap';
|
|
7
|
+
import { CellType, DATE_COLUMN_OPTIONS, getTableById, getTableColumnByKey } from 'dtable-utils';
|
|
8
|
+
import { isDateFormulaColumn } from '../../utils/column-utils';
|
|
9
|
+
import { CHART_SUPPORT_COLUMNS, DATE_GRANULATES, GEOLOCATION_GRANULATES, CHART_SUMMARY_SHOW, GEOLOCATION_FORMAT_MAP, CHART_TYPE, TIME_COLUMN_LIST, COMPLETENESS_GROUPBY_SUPPORTED_COLUMN_TYPE, NUMBERIC_COLUMN_TYPE, MIRROR_COLUMN_LIST } from '../../constants';
|
|
10
|
+
import intl from '../../intl';
|
|
11
|
+
class GroupBy extends Component {
|
|
19
12
|
constructor(_props) {
|
|
20
13
|
super(_props);
|
|
21
14
|
this.generatorGranulatesOptions = granulates => {
|
|
22
15
|
return granulates.map(item => {
|
|
23
16
|
return {
|
|
24
17
|
value: item,
|
|
25
|
-
label: /*#__PURE__*/
|
|
18
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
26
19
|
className: "ml-0 select-module select-module-name"
|
|
27
|
-
},
|
|
20
|
+
}, intl.get(CHART_SUMMARY_SHOW[item]))
|
|
28
21
|
};
|
|
29
22
|
});
|
|
30
23
|
};
|
|
@@ -33,7 +26,7 @@ class GroupBy extends _react.Component {
|
|
|
33
26
|
tables,
|
|
34
27
|
selectedTableId
|
|
35
28
|
} = props;
|
|
36
|
-
this.selectedTable =
|
|
29
|
+
this.selectedTable = getTableById(tables, selectedTableId);
|
|
37
30
|
const columns = this.selectedTable && Array.isArray(this.selectedTable.columns) ? this.selectedTable.columns : [];
|
|
38
31
|
this.validColumns = this.getAvailableColumns(columns);
|
|
39
32
|
this.columnOptions = this.getColumnOptions(this.validColumns);
|
|
@@ -46,7 +39,7 @@ class GroupBy extends _react.Component {
|
|
|
46
39
|
this.geolocationGranulatesOptions = [];
|
|
47
40
|
return;
|
|
48
41
|
}
|
|
49
|
-
const groupbyColumn =
|
|
42
|
+
const groupbyColumn = getTableColumnByKey(this.selectedTable, selectedColumnKey);
|
|
50
43
|
if (!groupbyColumn) {
|
|
51
44
|
this.geolocationGranulatesOptions = [];
|
|
52
45
|
return;
|
|
@@ -54,19 +47,19 @@ class GroupBy extends _react.Component {
|
|
|
54
47
|
const {
|
|
55
48
|
geo_format
|
|
56
49
|
} = groupbyColumn.data || {};
|
|
57
|
-
if (geo_format ===
|
|
58
|
-
this.geolocationGranulatesOptions = this.generatorGranulatesOptions(
|
|
50
|
+
if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE) {
|
|
51
|
+
this.geolocationGranulatesOptions = this.generatorGranulatesOptions(GEOLOCATION_GRANULATES.filter(item => item === GEOLOCATION_FORMAT_MAP.PROVINCE));
|
|
59
52
|
return;
|
|
60
53
|
}
|
|
61
|
-
if (geo_format ===
|
|
62
|
-
this.geolocationGranulatesOptions = this.generatorGranulatesOptions(
|
|
54
|
+
if (geo_format === GEOLOCATION_FORMAT_MAP.PROVINCE_CITY) {
|
|
55
|
+
this.geolocationGranulatesOptions = this.generatorGranulatesOptions(GEOLOCATION_GRANULATES.filter(item => item === 'district'));
|
|
63
56
|
return;
|
|
64
57
|
}
|
|
65
|
-
if (geo_format ===
|
|
58
|
+
if (geo_format === GEOLOCATION_FORMAT_MAP.COUNTRY_REGION || geo_format === GEOLOCATION_FORMAT_MAP.LNG_LAT) {
|
|
66
59
|
this.geolocationGranulatesOptions = [];
|
|
67
60
|
return;
|
|
68
61
|
}
|
|
69
|
-
this.geolocationGranulatesOptions = this.generatorGranulatesOptions(
|
|
62
|
+
this.geolocationGranulatesOptions = this.generatorGranulatesOptions(GEOLOCATION_GRANULATES);
|
|
70
63
|
};
|
|
71
64
|
this.getAvailableColumns = columns => {
|
|
72
65
|
const {
|
|
@@ -77,16 +70,16 @@ class GroupBy extends _react.Component {
|
|
|
77
70
|
if (!columns || !Array.isArray(columns)) return [];
|
|
78
71
|
let newColumns = [];
|
|
79
72
|
if (isMirror) {
|
|
80
|
-
newColumns = columns.filter(column =>
|
|
73
|
+
newColumns = columns.filter(column => MIRROR_COLUMN_LIST.includes(column.type));
|
|
81
74
|
return newColumns;
|
|
82
75
|
}
|
|
83
76
|
if (onlySupportSingleSelect) {
|
|
84
77
|
newColumns = columns.filter(column => column.type === 'single-select');
|
|
85
78
|
return newColumns;
|
|
86
79
|
}
|
|
87
|
-
newColumns = columns.filter(column =>
|
|
80
|
+
newColumns = columns.filter(column => CHART_SUPPORT_COLUMNS.includes(column.type));
|
|
88
81
|
if (onlySupportDate) {
|
|
89
|
-
return newColumns.filter(column =>
|
|
82
|
+
return newColumns.filter(column => TIME_COLUMN_LIST.includes(column.type));
|
|
90
83
|
}
|
|
91
84
|
return newColumns;
|
|
92
85
|
};
|
|
@@ -98,25 +91,25 @@ class GroupBy extends _react.Component {
|
|
|
98
91
|
let newColumns = columns.map(column => {
|
|
99
92
|
return {
|
|
100
93
|
value: column,
|
|
101
|
-
label: /*#__PURE__*/
|
|
94
|
+
label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
102
95
|
className: "header-icon"
|
|
103
|
-
}, /*#__PURE__*/
|
|
104
|
-
|
|
105
|
-
})), /*#__PURE__*/
|
|
96
|
+
}, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
|
|
97
|
+
column: column
|
|
98
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
106
99
|
className: 'select-option-name'
|
|
107
100
|
}, column.name))
|
|
108
101
|
};
|
|
109
102
|
});
|
|
110
|
-
if ([
|
|
111
|
-
newColumns = newColumns.filter(column =>
|
|
112
|
-
} else if (type ===
|
|
103
|
+
if ([CHART_TYPE.COMPLETENESS, CHART_TYPE.COMPLETENESS_GROUP].includes(type)) {
|
|
104
|
+
newColumns = newColumns.filter(column => COMPLETENESS_GROUPBY_SUPPORTED_COLUMN_TYPE.includes(column.value.type));
|
|
105
|
+
} else if (type === CHART_TYPE.SCATTER) {
|
|
113
106
|
newColumns = newColumns.filter(column => {
|
|
114
|
-
if (column.value.type ===
|
|
115
|
-
return column.value.data.result_type ===
|
|
116
|
-
} else if (column.value.type ===
|
|
117
|
-
return [
|
|
107
|
+
if (column.value.type === CellType.FORMULA) {
|
|
108
|
+
return column.value.data.result_type === CellType.NUMBER;
|
|
109
|
+
} else if (column.value.type === CellType.LINK_FORMULA) {
|
|
110
|
+
return [CellType.NUMBER, CellType.RATE].includes(column.value.data.array_type);
|
|
118
111
|
} else {
|
|
119
|
-
return
|
|
112
|
+
return NUMBERIC_COLUMN_TYPE.includes(column.value.type);
|
|
120
113
|
}
|
|
121
114
|
});
|
|
122
115
|
}
|
|
@@ -126,9 +119,9 @@ class GroupBy extends _react.Component {
|
|
|
126
119
|
key: '',
|
|
127
120
|
type: 'text'
|
|
128
121
|
},
|
|
129
|
-
label: /*#__PURE__*/
|
|
122
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
130
123
|
className: "ml-0"
|
|
131
|
-
},
|
|
124
|
+
}, intl.get('Not_used'))
|
|
132
125
|
});
|
|
133
126
|
}
|
|
134
127
|
return newColumns;
|
|
@@ -142,15 +135,15 @@ class GroupBy extends _react.Component {
|
|
|
142
135
|
const options = this.columnOptions.find(option => option.value.key === selectedColumnKey);
|
|
143
136
|
selectedOption = options ? options : null;
|
|
144
137
|
}
|
|
145
|
-
return /*#__PURE__*/
|
|
138
|
+
return /*#__PURE__*/React.createElement(_DTableCustomizeSelect, {
|
|
146
139
|
isLocked: false,
|
|
147
140
|
value: selectedOption,
|
|
148
141
|
options: this.columnOptions,
|
|
149
142
|
onSelectOption: this.props.onGroupByChange,
|
|
150
143
|
isInModal: true,
|
|
151
144
|
searchable: true,
|
|
152
|
-
searchPlaceholder:
|
|
153
|
-
noOptionsPlaceholder:
|
|
145
|
+
searchPlaceholder: intl.get('Select_field'),
|
|
146
|
+
noOptionsPlaceholder: intl.get('No_column')
|
|
154
147
|
});
|
|
155
148
|
};
|
|
156
149
|
this.renderGroupbyDateGranulates = () => {
|
|
@@ -158,9 +151,9 @@ class GroupBy extends _react.Component {
|
|
|
158
151
|
selectedDateGranularity
|
|
159
152
|
} = this.props;
|
|
160
153
|
const selectedOption = this.dateGranulatesOptions.find(option => option.value === selectedDateGranularity);
|
|
161
|
-
return /*#__PURE__*/
|
|
154
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
162
155
|
className: "mt-4 sea-chart-parameter-item"
|
|
163
|
-
}, /*#__PURE__*/
|
|
156
|
+
}, /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
164
157
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
165
158
|
value: selectedOption,
|
|
166
159
|
options: this.dateGranulatesOptions,
|
|
@@ -172,9 +165,9 @@ class GroupBy extends _react.Component {
|
|
|
172
165
|
selectedGeolocationGranularity
|
|
173
166
|
} = this.props;
|
|
174
167
|
const selectedOption = this.geolocationGranulatesOptions.find(option => option.value === selectedGeolocationGranularity);
|
|
175
|
-
return /*#__PURE__*/
|
|
168
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
176
169
|
className: "mt-4 sea-chart-parameter-item"
|
|
177
|
-
}, /*#__PURE__*/
|
|
170
|
+
}, /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
178
171
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
179
172
|
value: selectedOption,
|
|
180
173
|
options: this.geolocationGranulatesOptions,
|
|
@@ -188,14 +181,14 @@ class GroupBy extends _react.Component {
|
|
|
188
181
|
} = this.props;
|
|
189
182
|
if (isMirror) return null;
|
|
190
183
|
if (!selectedColumnKey) return null;
|
|
191
|
-
const groupbyColumn =
|
|
184
|
+
const groupbyColumn = getTableColumnByKey(this.selectedTable, selectedColumnKey);
|
|
192
185
|
if (!groupbyColumn) return null;
|
|
193
186
|
const {
|
|
194
187
|
type: groupbyColumnType
|
|
195
188
|
} = groupbyColumn;
|
|
196
|
-
return /*#__PURE__*/
|
|
189
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (DATE_COLUMN_OPTIONS.includes(groupbyColumnType) || isDateFormulaColumn(groupbyColumn)) && this.renderGroupbyDateGranulates(), groupbyColumnType === CellType.GEOLOCATION && this.geolocationGranulatesOptions.length > 0 && this.renderGroupbyGeolocationGranulates());
|
|
197
190
|
};
|
|
198
|
-
this.dateGranulatesOptions = this.generatorGranulatesOptions(
|
|
191
|
+
this.dateGranulatesOptions = this.generatorGranulatesOptions(DATE_GRANULATES);
|
|
199
192
|
this.initOptions(_props);
|
|
200
193
|
this.initGeolocationOptions(_props);
|
|
201
194
|
}
|
|
@@ -217,11 +210,11 @@ class GroupBy extends _react.Component {
|
|
|
217
210
|
className,
|
|
218
211
|
isRenderGroupBy = true
|
|
219
212
|
} = this.props;
|
|
220
|
-
return /*#__PURE__*/
|
|
221
|
-
className: (
|
|
213
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
214
|
+
className: classnames('sea-chart-setting-item table-setting', {
|
|
222
215
|
[className]: className
|
|
223
216
|
})
|
|
224
|
-
}, /*#__PURE__*/
|
|
217
|
+
}, /*#__PURE__*/React.createElement(Label, null, label), this.renderSelector(), isRenderGroupBy && this.renderGroupBy());
|
|
225
218
|
}
|
|
226
219
|
}
|
|
227
|
-
|
|
220
|
+
export default GroupBy;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
12
|
-
class MinMaxSetting extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { FormGroup, Label, Input } from 'reactstrap';
|
|
3
|
+
import intl from '../../intl';
|
|
4
|
+
class MinMaxSetting extends Component {
|
|
13
5
|
constructor(props) {
|
|
14
6
|
super(props);
|
|
15
7
|
this.onMinChange = e => {
|
|
@@ -38,18 +30,18 @@ class MinMaxSetting extends _react.Component {
|
|
|
38
30
|
min,
|
|
39
31
|
max
|
|
40
32
|
} = this.state;
|
|
41
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormGroup, {
|
|
42
34
|
className: "mb-2"
|
|
43
|
-
}, /*#__PURE__*/
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
44
36
|
for: "min"
|
|
45
|
-
},
|
|
37
|
+
}, intl.get('Min')), /*#__PURE__*/React.createElement(Input, {
|
|
46
38
|
id: "min",
|
|
47
39
|
type: "number",
|
|
48
40
|
value: min,
|
|
49
41
|
onChange: this.onMinChange
|
|
50
|
-
})), /*#__PURE__*/
|
|
42
|
+
})), /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, {
|
|
51
43
|
for: "max"
|
|
52
|
-
},
|
|
44
|
+
}, intl.get('Max')), /*#__PURE__*/React.createElement(Input, {
|
|
53
45
|
id: "max",
|
|
54
46
|
type: "number",
|
|
55
47
|
value: max,
|
|
@@ -57,4 +49,4 @@ class MinMaxSetting extends _react.Component {
|
|
|
57
49
|
})));
|
|
58
50
|
}
|
|
59
51
|
}
|
|
60
|
-
|
|
52
|
+
export default MinMaxSetting;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
-
var _components = require("../../components");
|
|
13
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
14
|
-
class MiniNumSlicePercent extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { FormGroup, Label } from 'reactstrap';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { NumberInput } from '../../components';
|
|
5
|
+
import intl from '../../intl';
|
|
6
|
+
class MiniNumSlicePercent extends Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.replaceNumberNotAllowInput = value => {
|
|
@@ -57,9 +49,9 @@ class MiniNumSlicePercent extends _react.Component {
|
|
|
57
49
|
value,
|
|
58
50
|
className
|
|
59
51
|
} = this.props;
|
|
60
|
-
return /*#__PURE__*/
|
|
61
|
-
className: (
|
|
62
|
-
}, /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
53
|
+
className: classnames('sea-chart-parameter-item', className)
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Minimum_slice_percent')), /*#__PURE__*/React.createElement(NumberInput, {
|
|
63
55
|
value: value,
|
|
64
56
|
onChange: this.onPercentChange,
|
|
65
57
|
step: 0.1,
|
|
@@ -70,4 +62,4 @@ class MiniNumSlicePercent extends _react.Component {
|
|
|
70
62
|
}));
|
|
71
63
|
}
|
|
72
64
|
}
|
|
73
|
-
|
|
65
|
+
export default MiniNumSlicePercent;
|
|
@@ -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 NumericSummaryItem 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 NumericSummaryItem extends Component {
|
|
17
9
|
constructor(_props) {
|
|
18
10
|
super(_props);
|
|
19
11
|
this.initSummaryMethodOptions = props => {
|
|
@@ -22,11 +14,11 @@ class NumericSummaryItem 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
|
};
|
|
@@ -92,7 +84,7 @@ class NumericSummaryItem extends _react.Component {
|
|
|
92
84
|
this.initSummaryMethodOptions(_props);
|
|
93
85
|
}
|
|
94
86
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
95
|
-
if (!(
|
|
87
|
+
if (!shallowEqual(this.props.value, nextProps.value)) {
|
|
96
88
|
this.initSummaryMethodOptions(nextProps);
|
|
97
89
|
}
|
|
98
90
|
}
|
|
@@ -120,34 +112,34 @@ class NumericSummaryItem extends _react.Component {
|
|
|
120
112
|
isExpand
|
|
121
113
|
} = this.state;
|
|
122
114
|
const isFirst = index === 0;
|
|
123
|
-
return /*#__PURE__*/
|
|
115
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
124
116
|
className: "sea-chart-parameter-item"
|
|
125
|
-
}, /*#__PURE__*/
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
126
118
|
className: "numeric-summary-item d-flex align-items-center justify-content-between w-100"
|
|
127
|
-
}, /*#__PURE__*/
|
|
119
|
+
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", {
|
|
128
120
|
onClick: this.onToggleExpand,
|
|
129
|
-
className:
|
|
130
|
-
}), /*#__PURE__*/
|
|
121
|
+
className: `numeric-summary-item-icon dtable-font mr-2 ${isExpand ? 'dtable-icon-drop-down' : 'dtable-icon-right-slide'}`
|
|
122
|
+
}), /*#__PURE__*/React.createElement("span", null, intl.get('Summary_field') + ' ' + (1 + index))), !isFirst && /*#__PURE__*/React.createElement("div", {
|
|
131
123
|
className: "delete-numeric-summary-item-content close d-flex align-items-center justify-content-center",
|
|
132
124
|
onClick: this.handleNumericSummaryItemDelete
|
|
133
|
-
}, /*#__PURE__*/
|
|
125
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
134
126
|
className: "dtable-font dtable-icon-fork-number delete-icon"
|
|
135
|
-
}))), /*#__PURE__*/
|
|
136
|
-
className:
|
|
137
|
-
}, /*#__PURE__*/
|
|
127
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: `pl-4 ${isExpand ? 'expanded-numeric-summary-content' : 'collapsed-numeric-summary-content d-none'}`
|
|
129
|
+
}, /*#__PURE__*/React.createElement(FormGroup, {
|
|
138
130
|
className: "sea-chart-parameter-item numeric-column"
|
|
139
|
-
}, /*#__PURE__*/
|
|
131
|
+
}, /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
140
132
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
141
133
|
value: selectedColumnOption,
|
|
142
|
-
placeholder:
|
|
134
|
+
placeholder: intl.get('Select_a_column'),
|
|
143
135
|
onChange: option => this.props.onColumnOptionChange(option, index, selectedColumnOption, currentAxisesIndex),
|
|
144
136
|
options: availableOptions,
|
|
145
137
|
style: {
|
|
146
138
|
color: '#6e7687'
|
|
147
139
|
}
|
|
148
|
-
})), /*#__PURE__*/
|
|
140
|
+
})), /*#__PURE__*/React.createElement(FormGroup, {
|
|
149
141
|
className: "sea-chart-parameter-item summary-method"
|
|
150
|
-
}, /*#__PURE__*/
|
|
142
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
151
143
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
152
144
|
value: selectedSummaryMethodOption,
|
|
153
145
|
onChange: option => this.props.onSummaryMethodChange(option, index),
|
|
@@ -155,4 +147,4 @@ class NumericSummaryItem extends _react.Component {
|
|
|
155
147
|
}))));
|
|
156
148
|
}
|
|
157
149
|
}
|
|
158
|
-
|
|
150
|
+
export default NumericSummaryItem;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _DTableRadio2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableRadio"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _constants = require("../../../constants");
|
|
12
|
-
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
1
|
+
import _DTableRadio from "dtable-ui-component/lib/DTableRadio";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormGroup, Label } from 'reactstrap';
|
|
4
|
+
import { CHART_LINE_TYPES } from '../../../constants';
|
|
5
|
+
import intl from '../../../intl';
|
|
13
6
|
function SelectLineType(_ref) {
|
|
14
7
|
let {
|
|
15
|
-
selectedLineType =
|
|
8
|
+
selectedLineType = CHART_LINE_TYPES[1],
|
|
16
9
|
onChange
|
|
17
10
|
} = _ref;
|
|
18
11
|
const onChangeLineType = lineType => {
|
|
@@ -21,14 +14,14 @@ function SelectLineType(_ref) {
|
|
|
21
14
|
line_type: lineType
|
|
22
15
|
});
|
|
23
16
|
};
|
|
24
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, null, intl.get('Line_type')), CHART_LINE_TYPES.map((lineType, index) => {
|
|
25
18
|
const isChecked = lineType === selectedLineType;
|
|
26
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/React.createElement(_DTableRadio, {
|
|
27
20
|
key: index,
|
|
28
21
|
isChecked: isChecked,
|
|
29
22
|
onCheckedChange: () => onChangeLineType(lineType),
|
|
30
|
-
label:
|
|
23
|
+
label: intl.get(lineType)
|
|
31
24
|
});
|
|
32
25
|
}));
|
|
33
26
|
}
|
|
34
|
-
|
|
27
|
+
export default SelectLineType;
|