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,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var _constants = require("../../constants");
|
|
14
|
-
var _utils = require("../../utils");
|
|
15
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
16
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
17
|
-
var _icon = _interopRequireDefault(require("../icon"));
|
|
18
|
-
var _useForceUpdate = _interopRequireDefault(require("./use-force-update"));
|
|
19
|
-
require("./index.css");
|
|
1
|
+
import _DTableModalHeader from "dtable-ui-component/lib/DTableModalHeader";
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { Modal, ModalBody, ModalFooter, UncontrolledTooltip, Button } from 'reactstrap';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import { CHART_TYPE, CHART_TYPES, CHART_TYPE_SHOW, ZH_CN_SUPPORT_CHARTS } from '../../constants';
|
|
6
|
+
import { eventStopPropagation } from '../../utils';
|
|
7
|
+
import context from '../../context';
|
|
8
|
+
import intl from '../../intl';
|
|
9
|
+
import Icon from '../icon';
|
|
10
|
+
import useForceUpdate from './use-force-update';
|
|
11
|
+
import './index.css';
|
|
20
12
|
const TypesDialog = _ref => {
|
|
21
13
|
let {
|
|
22
14
|
type,
|
|
@@ -25,114 +17,114 @@ const TypesDialog = _ref => {
|
|
|
25
17
|
onChange,
|
|
26
18
|
dataSources
|
|
27
19
|
} = _ref;
|
|
28
|
-
const [currentCatIndex, setCurrentCatIndex] =
|
|
29
|
-
const [selectedType, setType] =
|
|
30
|
-
const seaChartTypeContainerRef =
|
|
31
|
-
const forceUpdate = (
|
|
32
|
-
const notSupportStatisticTypes =
|
|
33
|
-
const lang =
|
|
34
|
-
return lang !== 'zh-cn' ?
|
|
20
|
+
const [currentCatIndex, setCurrentCatIndex] = useState(0);
|
|
21
|
+
const [selectedType, setType] = useState(type);
|
|
22
|
+
const seaChartTypeContainerRef = useRef(null);
|
|
23
|
+
const forceUpdate = useForceUpdate();
|
|
24
|
+
const notSupportStatisticTypes = useMemo(() => {
|
|
25
|
+
const lang = context.getSetting('lang');
|
|
26
|
+
return lang !== 'zh-cn' ? ZH_CN_SUPPORT_CHARTS : [];
|
|
35
27
|
}, []);
|
|
36
|
-
|
|
28
|
+
useEffect(() => {
|
|
37
29
|
if (lang) {
|
|
38
|
-
|
|
30
|
+
intl.setLang(lang);
|
|
39
31
|
forceUpdate();
|
|
40
32
|
}
|
|
41
33
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
34
|
}, []);
|
|
43
|
-
|
|
44
|
-
const selectStatisticIndex =
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const selectStatisticIndex = CHART_TYPES.findIndex(item => item.children.includes(type));
|
|
45
37
|
const currentCatIndex = selectStatisticIndex < 0 ? 0 : selectStatisticIndex;
|
|
46
38
|
if (currentCatIndex === 0) return;
|
|
47
39
|
if (!seaChartTypeContainerRef.current) return;
|
|
48
|
-
seaChartTypeContainerRef.current.scrollTop = document.getElementById(
|
|
40
|
+
seaChartTypeContainerRef.current.scrollTop = document.getElementById(`chart-type-${currentCatIndex + 1}`).offsetTop - 60;
|
|
49
41
|
}, [type]);
|
|
50
|
-
const onToggle =
|
|
42
|
+
const onToggle = useCallback(() => {
|
|
51
43
|
propsOnToggle();
|
|
52
44
|
}, [propsOnToggle]);
|
|
53
|
-
const modifyCurrentCatIndex =
|
|
54
|
-
|
|
45
|
+
const modifyCurrentCatIndex = useCallback((event, index) => {
|
|
46
|
+
eventStopPropagation(event);
|
|
55
47
|
setCurrentCatIndex(index);
|
|
56
48
|
if (!seaChartTypeContainerRef.current) return;
|
|
57
|
-
seaChartTypeContainerRef.current.scrollTop = document.getElementById(
|
|
49
|
+
seaChartTypeContainerRef.current.scrollTop = document.getElementById(`chart-type-${index + 1}`).offsetTop - 60;
|
|
58
50
|
}, [seaChartTypeContainerRef]);
|
|
59
|
-
const onTypeChange =
|
|
60
|
-
|
|
51
|
+
const onTypeChange = useCallback((event, type, index) => {
|
|
52
|
+
eventStopPropagation(event);
|
|
61
53
|
if (type === selectedType) return;
|
|
62
54
|
setType(type);
|
|
63
55
|
setCurrentCatIndex(index);
|
|
64
56
|
}, [selectedType]);
|
|
65
|
-
const onSubmit =
|
|
57
|
+
const onSubmit = useCallback(() => {
|
|
66
58
|
onChange(selectedType);
|
|
67
59
|
onToggle();
|
|
68
60
|
}, [onChange, selectedType, onToggle]);
|
|
69
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
70
62
|
isOpen: true,
|
|
71
63
|
toggle: onToggle,
|
|
72
64
|
className: "sea-chart-types-dialog"
|
|
73
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/React.createElement(_DTableModalHeader, {
|
|
74
66
|
toggle: onToggle
|
|
75
|
-
}, type ?
|
|
67
|
+
}, type ? intl.get('Edit_type') : intl.get('All_charts')), /*#__PURE__*/React.createElement(ModalBody, {
|
|
76
68
|
className: "sea-chart-types-body"
|
|
77
|
-
}, /*#__PURE__*/
|
|
69
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
78
70
|
className: "sea-chart-types-container d-flex flex-column h-100"
|
|
79
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
80
72
|
className: "sea-chart-chart-categories-nav flex-shrink-0 d-flex flex-wrap align-items-center list-unstyled"
|
|
81
|
-
},
|
|
82
|
-
return /*#__PURE__*/
|
|
73
|
+
}, CHART_TYPES.map((item, index) => {
|
|
74
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
83
75
|
key: index,
|
|
84
76
|
className: "px-4 py-2 sea-chart-chart-cat-nav-item"
|
|
85
|
-
}, /*#__PURE__*/
|
|
86
|
-
id:
|
|
87
|
-
className: (
|
|
77
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
id: `sea-chart-icon-${item.icon}-container`,
|
|
79
|
+
className: classnames('sea-chart-chart-cat-nav-item-container', {
|
|
88
80
|
'sea-chart-icon-highlight': currentCatIndex === index
|
|
89
81
|
}),
|
|
90
82
|
onClick: event => modifyCurrentCatIndex(event, index)
|
|
91
|
-
}, /*#__PURE__*/
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
92
84
|
symbol: item.icon,
|
|
93
85
|
className: "chart-icon w-100 h-100"
|
|
94
|
-
})), /*#__PURE__*/
|
|
86
|
+
})), /*#__PURE__*/React.createElement(UncontrolledTooltip, {
|
|
95
87
|
placement: "bottom",
|
|
96
|
-
target:
|
|
88
|
+
target: `sea-chart-icon-${item.icon}-container`,
|
|
97
89
|
delay: 0,
|
|
98
90
|
fade: false
|
|
99
|
-
},
|
|
100
|
-
})), /*#__PURE__*/
|
|
91
|
+
}, intl.get(item.name)));
|
|
92
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
101
93
|
className: "flex-fill o-auto sea-chart-type-container",
|
|
102
94
|
ref: seaChartTypeContainerRef
|
|
103
|
-
},
|
|
104
|
-
return /*#__PURE__*/
|
|
105
|
-
key:
|
|
95
|
+
}, CHART_TYPES.map((item, index) => {
|
|
96
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
key: `sea-chart-type-${index}`,
|
|
106
98
|
className: "mb-7"
|
|
107
|
-
}, /*#__PURE__*/
|
|
99
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
108
100
|
className: "sea-chart-type-title m-0",
|
|
109
|
-
id:
|
|
110
|
-
},
|
|
101
|
+
id: `chart-type-${index + 1}`
|
|
102
|
+
}, intl.get(item.name)), /*#__PURE__*/React.createElement("div", {
|
|
111
103
|
className: "d-flex flex-wrap"
|
|
112
104
|
}, item.children.map(chartType => {
|
|
113
105
|
if (notSupportStatisticTypes.includes(chartType)) return null;
|
|
114
106
|
// Table_element only supported on external apps
|
|
115
|
-
if (chartType ===
|
|
116
|
-
return /*#__PURE__*/
|
|
107
|
+
if (chartType === CHART_TYPE.TABLE_ELEMENT && (dataSources === 'view' || !dataSources)) return null;
|
|
108
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
117
109
|
key: chartType,
|
|
118
110
|
onClick: event => onTypeChange(event, chartType, index),
|
|
119
|
-
className:
|
|
120
|
-
}, /*#__PURE__*/
|
|
111
|
+
className: `sea-chart-type-item ${selectedType === chartType ? 'selected' : ''}`
|
|
112
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
121
113
|
className: "sea-chart-type-description"
|
|
122
|
-
},
|
|
114
|
+
}, intl.get(CHART_TYPE_SHOW[chartType])), /*#__PURE__*/React.createElement("div", {
|
|
123
115
|
className: "sea-chart-type-image-container"
|
|
124
|
-
}, /*#__PURE__*/
|
|
125
|
-
src:
|
|
116
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
117
|
+
src: context.getChartImageUrl(chartType),
|
|
126
118
|
alt: "",
|
|
127
119
|
className: "sea-chart-type-demo-image"
|
|
128
120
|
})));
|
|
129
121
|
})));
|
|
130
|
-
})))), /*#__PURE__*/
|
|
122
|
+
})))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
131
123
|
color: "secondary",
|
|
132
124
|
onClick: onToggle
|
|
133
|
-
},
|
|
125
|
+
}, intl.get('Cancel')), /*#__PURE__*/React.createElement(Button, {
|
|
134
126
|
color: "primary",
|
|
135
127
|
onClick: onSubmit
|
|
136
|
-
},
|
|
128
|
+
}, intl.get('Submit'))));
|
|
137
129
|
};
|
|
138
|
-
|
|
130
|
+
export default TypesDialog;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
8
2
|
const useForceUpdate = () => {
|
|
9
|
-
const [, setState] =
|
|
10
|
-
const forceUpdate =
|
|
3
|
+
const [, setState] = useState(0);
|
|
4
|
+
const forceUpdate = useCallback(() => {
|
|
11
5
|
setState(n => n + 1);
|
|
12
6
|
}, []);
|
|
13
7
|
return forceUpdate;
|
|
14
8
|
};
|
|
15
|
-
|
|
9
|
+
export default useForceUpdate;
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS = exports.FILTER_TYPE_2_CELL_TYPE = exports.EMPTY_PREDICATE = exports.DISPLAY_COLOR_RULE_FILTER_TYPE = exports.COLOR_RULE_FILTER_TYPE_MAP = exports.COLOR_OPTIONS = void 0;
|
|
7
|
-
var _dtableUtils = require("dtable-utils");
|
|
8
|
-
const SUPPORT_SINGLE_SELECT_THEMES_OPTIONS = exports.SUPPORT_SINGLE_SELECT_THEMES_OPTIONS = {
|
|
1
|
+
import { CellType, FILTER_PREDICATE_TYPE } from 'dtable-utils';
|
|
2
|
+
export const SUPPORT_SINGLE_SELECT_THEMES_OPTIONS = {
|
|
9
3
|
DEFAULT: 'default',
|
|
10
4
|
SINGLE_SELECT_COLUMN_COLORS: 'single_select_column_colors'
|
|
11
5
|
};
|
|
12
|
-
const COLOR_RULE_FILTER_TYPE_MAP =
|
|
6
|
+
export const COLOR_RULE_FILTER_TYPE_MAP = {
|
|
13
7
|
NUMERIC_VALUE: 'numeric_value'
|
|
14
8
|
};
|
|
15
|
-
const DISPLAY_COLOR_RULE_FILTER_TYPE =
|
|
9
|
+
export const DISPLAY_COLOR_RULE_FILTER_TYPE = {
|
|
16
10
|
[COLOR_RULE_FILTER_TYPE_MAP.NUMERIC_VALUE]: 'Numeric_value'
|
|
17
11
|
};
|
|
18
|
-
const FILTER_TYPE_2_CELL_TYPE =
|
|
19
|
-
[COLOR_RULE_FILTER_TYPE_MAP.NUMERIC_VALUE]:
|
|
12
|
+
export const FILTER_TYPE_2_CELL_TYPE = {
|
|
13
|
+
[COLOR_RULE_FILTER_TYPE_MAP.NUMERIC_VALUE]: CellType.NUMBER
|
|
20
14
|
};
|
|
21
|
-
const EMPTY_PREDICATE =
|
|
22
|
-
const COLOR_OPTIONS =
|
|
15
|
+
export const EMPTY_PREDICATE = [FILTER_PREDICATE_TYPE.EMPTY, FILTER_PREDICATE_TYPE.NOT_EMPTY];
|
|
16
|
+
export const COLOR_OPTIONS = [{
|
|
23
17
|
name: 'blue',
|
|
24
18
|
exampleColors: ['#CAE9FF', '#9AC5FF', '#7DAAFF', '#5C90F9', '#3C77DD', '#075FBF', '#0047A5', '#053791', '#001E79'],
|
|
25
19
|
borderColor: '#5F7190',
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ROW_HEIGHT = exports.NEED_FORMATTER = exports.LINK_NOT_SUPPORT_TYPES = exports.EXTERNAL_EVENT = exports.DELETED_OPTION_TIPS = exports.DELETED_OPTION_BACKGROUND_COLOR = exports.CommonEventTypes = void 0;
|
|
7
|
-
var _dtableUtils = require("dtable-utils");
|
|
8
|
-
const CommonEventTypes = exports.CommonEventTypes = {
|
|
1
|
+
import { CellType } from 'dtable-utils';
|
|
2
|
+
export const CommonEventTypes = {
|
|
9
3
|
OPEN_SELECT: 'OPEN_SELECT',
|
|
10
4
|
REFRESH_CHARTS: 'REFRESH_CHARTS',
|
|
11
5
|
CHANGE_HEADER_WIDTH: 'CHANGE_HEADER_WIDTH',
|
|
12
6
|
EXPAND_ROW_UPDATED: 'EXPAND_ROW_UPDATED',
|
|
13
7
|
EXPAND_ROW_DELETED: 'EXPAND_ROW_DELETED'
|
|
14
8
|
};
|
|
15
|
-
const EXTERNAL_EVENT =
|
|
9
|
+
export const EXTERNAL_EVENT = {
|
|
16
10
|
SHOW_ROW_DETAIL_DIALOG: 'RowDetailDialog'
|
|
17
11
|
};
|
|
18
|
-
const ROW_HEIGHT =
|
|
19
|
-
const DELETED_OPTION_BACKGROUND_COLOR =
|
|
20
|
-
const DELETED_OPTION_TIPS =
|
|
21
|
-
const LINK_NOT_SUPPORT_TYPES =
|
|
22
|
-
const NEED_FORMATTER =
|
|
12
|
+
export const ROW_HEIGHT = 32;
|
|
13
|
+
export const DELETED_OPTION_BACKGROUND_COLOR = '#eaeaea';
|
|
14
|
+
export const DELETED_OPTION_TIPS = 'deleted_option';
|
|
15
|
+
export const LINK_NOT_SUPPORT_TYPES = [CellType.CHECKBOX, CellType.RATE, CellType.LONG_TEXT, CellType.IMAGE, CellType.FILE, CellType.COLLABORATOR, CellType.MULTIPLE_SELECT, CellType.GEOLOCATION, CellType.LINK_FORMULA, CellType.BUTTON, CellType.LINK, CellType.DIGITAL_SIGN];
|
|
16
|
+
export const NEED_FORMATTER = [CellType.CREATOR, CellType.LAST_MODIFIER, CellType.SINGLE_SELECT];
|
package/dist/constants/error.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SERVER_ERROR_MSG = exports.SERVER_ERROR_DISPLAY_KEY = void 0;
|
|
7
|
-
const SERVER_ERROR_MSG = exports.SERVER_ERROR_MSG = {
|
|
1
|
+
export const SERVER_ERROR_MSG = {
|
|
8
2
|
EXECUTION_COST_EXCEEDED: 'Execution cost exceeded'
|
|
9
3
|
};
|
|
10
|
-
const SERVER_ERROR_DISPLAY_KEY =
|
|
4
|
+
export const SERVER_ERROR_DISPLAY_KEY = {
|
|
11
5
|
[SERVER_ERROR_MSG.EXECUTION_COST_EXCEEDED]: 'Execution_time_of_the_query_exceeds_the_limit'
|
|
12
6
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MUNICIPALITIES = exports.MAP_LEVELS = exports.MAP_LEVEL = exports.LABEL_COLORS = exports.GEOLOCATION_GRANULARITY_LIST = exports.GEOLOCATION_GRANULARITY = exports.GEOLOCATION_FORMAT_MAP = exports.GEOLOCATION_FORMAT_COUNTY = exports.GEOLOCATION_FORMAT_CITY = void 0;
|
|
7
|
-
const GEOLOCATION_FORMAT_MAP = exports.GEOLOCATION_FORMAT_MAP = {
|
|
1
|
+
export const GEOLOCATION_FORMAT_MAP = {
|
|
8
2
|
LNG_LAT: 'lng_lat',
|
|
9
3
|
MAP_SELECTION: 'map_selection',
|
|
10
4
|
GEOLOCATION: 'geolocation',
|
|
@@ -13,22 +7,22 @@ const GEOLOCATION_FORMAT_MAP = exports.GEOLOCATION_FORMAT_MAP = {
|
|
|
13
7
|
PROVINCE_CITY: 'province_city',
|
|
14
8
|
PROVINCE: 'province'
|
|
15
9
|
};
|
|
16
|
-
const GEOLOCATION_FORMAT_CITY =
|
|
17
|
-
const GEOLOCATION_FORMAT_COUNTY =
|
|
18
|
-
const GEOLOCATION_GRANULARITY =
|
|
10
|
+
export const GEOLOCATION_FORMAT_CITY = 'city';
|
|
11
|
+
export const GEOLOCATION_FORMAT_COUNTY = 'county';
|
|
12
|
+
export const GEOLOCATION_GRANULARITY = {
|
|
19
13
|
PROVINCE: 'province',
|
|
20
14
|
CITY: 'city',
|
|
21
15
|
DISTRICT: 'district'
|
|
22
16
|
};
|
|
23
|
-
const GEOLOCATION_GRANULARITY_LIST =
|
|
24
|
-
const MAP_LEVEL =
|
|
17
|
+
export const GEOLOCATION_GRANULARITY_LIST = [GEOLOCATION_GRANULARITY.PROVINCE, GEOLOCATION_GRANULARITY.CITY, GEOLOCATION_GRANULARITY.DISTRICT];
|
|
18
|
+
export const MAP_LEVEL = {
|
|
25
19
|
WORLD: 'world',
|
|
26
20
|
COUNTRY: 'country',
|
|
27
21
|
PROVINCE: 'province',
|
|
28
22
|
CITY: 'city'
|
|
29
23
|
};
|
|
30
|
-
const MUNICIPALITIES =
|
|
31
|
-
const MAP_LEVELS =
|
|
24
|
+
export const MUNICIPALITIES = ['北京市', '天津市', '上海市', '重庆市'];
|
|
25
|
+
export const MAP_LEVELS = [{
|
|
32
26
|
key: MAP_LEVEL.COUNTRY,
|
|
33
27
|
name: '国家'
|
|
34
28
|
}, {
|
|
@@ -38,4 +32,4 @@ const MAP_LEVELS = exports.MAP_LEVELS = [{
|
|
|
38
32
|
key: MAP_LEVEL.CITY,
|
|
39
33
|
name: '市级'
|
|
40
34
|
}];
|
|
41
|
-
const LABEL_COLORS =
|
|
35
|
+
export const LABEL_COLORS = ['#2a67d1', '#4ecccb', '#59cb74', '#fbd44a', '#f4667c', '#9860e5', '#9f8cf1', '#dc82d2', '#eaa775', '#addf84', '#85e0be', '#89d2ea'];
|