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,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _DTableRadioGroup2 = _interopRequireDefault(require("dtable-ui-component/lib/DTableRadioGroup"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var _constants = require("../../constants");
|
|
14
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
1
|
+
import _DTableRadioGroup from "dtable-ui-component/lib/DTableRadioGroup";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { Row, Label } from 'reactstrap';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import { HORIZONTAL_ALIGNS, HORIZONTAL_ALIGN_SHOW } from '../../constants';
|
|
6
|
+
import intl from '../../intl';
|
|
15
7
|
const TextHorizontalSettings = _ref => {
|
|
16
8
|
let {
|
|
17
9
|
defaultValue,
|
|
@@ -19,25 +11,25 @@ const TextHorizontalSettings = _ref => {
|
|
|
19
11
|
onChange,
|
|
20
12
|
className
|
|
21
13
|
} = _ref;
|
|
22
|
-
const validValue = value || defaultValue ||
|
|
23
|
-
const onHorizontalChanged =
|
|
14
|
+
const validValue = value || defaultValue || HORIZONTAL_ALIGNS[0];
|
|
15
|
+
const onHorizontalChanged = useCallback(value => {
|
|
24
16
|
onChange && onChange(value);
|
|
25
17
|
}, [onChange]);
|
|
26
18
|
const getOptionsDisplay = () => {
|
|
27
|
-
return
|
|
19
|
+
return HORIZONTAL_ALIGNS.reduce((optionDisplayMap, align) => {
|
|
28
20
|
return {
|
|
29
21
|
...optionDisplayMap,
|
|
30
|
-
[align]:
|
|
22
|
+
[align]: intl.get(HORIZONTAL_ALIGN_SHOW[align])
|
|
31
23
|
};
|
|
32
24
|
}, {});
|
|
33
25
|
};
|
|
34
|
-
return /*#__PURE__*/
|
|
35
|
-
className: (
|
|
36
|
-
}, /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
27
|
+
className: classnames('mt-0 mb-4 ml-0 mr-0 settings-text-horizontal-align sea-chart-select-group', className)
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Text_horizontal_alignment')), /*#__PURE__*/React.createElement(_DTableRadioGroup, {
|
|
37
29
|
activeOption: validValue,
|
|
38
|
-
options:
|
|
30
|
+
options: HORIZONTAL_ALIGNS,
|
|
39
31
|
optionsDisplay: getOptionsDisplay(),
|
|
40
32
|
onSelectChanged: onHorizontalChanged
|
|
41
33
|
}));
|
|
42
34
|
};
|
|
43
|
-
|
|
35
|
+
export default TextHorizontalSettings;
|
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _Picker = _interopRequireDefault(require("@seafile/seafile-calendar/lib/Picker"));
|
|
13
|
-
require("dayjs/locale/zh-cn");
|
|
14
|
-
require("dayjs/locale/en-gb");
|
|
15
|
-
var _utils = require("../../utils");
|
|
16
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
17
|
-
var _context = _interopRequireDefault(require("../../context"));
|
|
18
|
-
require("@seafile/seafile-calendar/assets/index.css");
|
|
19
|
-
let now = (0, _dayjs.default)();
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import Calendar from '@seafile/seafile-calendar';
|
|
4
|
+
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
|
5
|
+
import 'dayjs/locale/zh-cn';
|
|
6
|
+
import 'dayjs/locale/en-gb';
|
|
7
|
+
import { translateCalendar } from '../../utils';
|
|
8
|
+
import intl from '../../intl';
|
|
9
|
+
import context from '../../context';
|
|
10
|
+
import '@seafile/seafile-calendar/assets/index.css';
|
|
11
|
+
let now = dayjs();
|
|
20
12
|
const DATE_FORMAT = 'YYYY-MM-DD';
|
|
21
|
-
class TimePicker extends
|
|
13
|
+
class TimePicker extends Component {
|
|
22
14
|
constructor(props) {
|
|
23
15
|
super(props);
|
|
24
16
|
this.getDefaultMinutesTime = () => {
|
|
25
17
|
const {
|
|
26
18
|
value
|
|
27
19
|
} = this.props;
|
|
28
|
-
if (value) return (
|
|
20
|
+
if (value) return dayjs(value).format('HH:mm');
|
|
29
21
|
return '';
|
|
30
22
|
};
|
|
31
23
|
this.getCalendarContainer = () => {
|
|
@@ -81,24 +73,24 @@ class TimePicker extends _react.Component {
|
|
|
81
73
|
open: false,
|
|
82
74
|
value: null
|
|
83
75
|
};
|
|
84
|
-
this.calendarContainerRef =
|
|
76
|
+
this.calendarContainerRef = React.createRef();
|
|
85
77
|
this.defaultCalendarValue = null;
|
|
86
78
|
}
|
|
87
79
|
componentDidMount() {
|
|
88
80
|
const {
|
|
89
81
|
value
|
|
90
82
|
} = this.props;
|
|
91
|
-
const iszhcn =
|
|
83
|
+
const iszhcn = context.getSetting('lang') === 'zh-cn';
|
|
92
84
|
if (iszhcn) {
|
|
93
85
|
now = now.locale('zh-cn');
|
|
94
86
|
} else {
|
|
95
87
|
now = now.locale('en-gb');
|
|
96
88
|
}
|
|
97
89
|
this.defaultCalendarValue = now.clone();
|
|
98
|
-
if (value && (
|
|
99
|
-
let validValue = (
|
|
90
|
+
if (value && dayjs(value).isValid()) {
|
|
91
|
+
let validValue = dayjs(value).isValid() ? dayjs(value) : dayjs(this.defaultCalendarValue);
|
|
100
92
|
this.setState({
|
|
101
|
-
value: iszhcn ? (
|
|
93
|
+
value: iszhcn ? dayjs(validValue).locale('zh-cn') : dayjs(validValue).locale('en-gb')
|
|
102
94
|
});
|
|
103
95
|
}
|
|
104
96
|
}
|
|
@@ -111,7 +103,7 @@ class TimePicker extends _react.Component {
|
|
|
111
103
|
open
|
|
112
104
|
} = this.state;
|
|
113
105
|
const minutesTime = this.getDefaultMinutesTime();
|
|
114
|
-
if (isReadOnly) return /*#__PURE__*/
|
|
106
|
+
if (isReadOnly) return /*#__PURE__*/React.createElement("input", {
|
|
115
107
|
className: "ant-calendar-picker-input ant-input form-control",
|
|
116
108
|
value: value && value.format(DATE_FORMAT) || '',
|
|
117
109
|
disabled: true
|
|
@@ -124,17 +116,17 @@ class TimePicker extends _react.Component {
|
|
|
124
116
|
fontSize: '12px',
|
|
125
117
|
cursor: 'pointer'
|
|
126
118
|
};
|
|
127
|
-
const clearIcon =
|
|
119
|
+
const clearIcon = React.createElement('i', {
|
|
128
120
|
className: 'item-icon dtable-font dtable-icon-x',
|
|
129
121
|
style: clearStyle
|
|
130
122
|
});
|
|
131
|
-
const calendar = /*#__PURE__*/
|
|
123
|
+
const calendar = /*#__PURE__*/React.createElement(Calendar, {
|
|
132
124
|
className: "dtable-rc-calendar",
|
|
133
|
-
locale:
|
|
125
|
+
locale: translateCalendar(),
|
|
134
126
|
style: {
|
|
135
127
|
zIndex: 1001
|
|
136
128
|
},
|
|
137
|
-
dateInputPlaceholder:
|
|
129
|
+
dateInputPlaceholder: intl.get('Please_input_date'),
|
|
138
130
|
format: DATE_FORMAT,
|
|
139
131
|
defaultValue: this.defaultCalendarValue,
|
|
140
132
|
showDateInput: true,
|
|
@@ -145,10 +137,10 @@ class TimePicker extends _react.Component {
|
|
|
145
137
|
defaultMinutesTime: minutesTime,
|
|
146
138
|
onClickRightPanelTime: this.onClickRightPanelTime
|
|
147
139
|
});
|
|
148
|
-
return /*#__PURE__*/
|
|
140
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
149
141
|
className: "sea-chart-date-picker-container",
|
|
150
142
|
ref: ref => this.datePicker = ref
|
|
151
|
-
}, /*#__PURE__*/
|
|
143
|
+
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
152
144
|
calendar: calendar,
|
|
153
145
|
value: value,
|
|
154
146
|
onChange: this.onChange,
|
|
@@ -162,19 +154,19 @@ class TimePicker extends _react.Component {
|
|
|
162
154
|
let {
|
|
163
155
|
value
|
|
164
156
|
} = _ref;
|
|
165
|
-
return /*#__PURE__*/
|
|
157
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
166
158
|
tabIndex: "0",
|
|
167
159
|
onFocus: this.onReadOnlyFocus
|
|
168
|
-
}, /*#__PURE__*/
|
|
160
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
169
161
|
tabIndex: "-1",
|
|
170
162
|
onChange: () => {},
|
|
171
163
|
className: "ant-calendar-picker-input ant-input form-control",
|
|
172
164
|
value: value && value.format(DATE_FORMAT) || '',
|
|
173
165
|
onMouseDown: this.handleMouseDown
|
|
174
|
-
}), /*#__PURE__*/
|
|
166
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
175
167
|
ref: this.calendarContainerRef
|
|
176
168
|
}));
|
|
177
169
|
}));
|
|
178
170
|
}
|
|
179
171
|
}
|
|
180
|
-
|
|
172
|
+
export default TimePicker;
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _contexts = require("../../../utils/contexts");
|
|
13
|
-
var _fontSettings = require("../font-settings");
|
|
14
|
-
var _textHorizontalSettings = _interopRequireDefault(require("../text-horizontal-settings"));
|
|
15
|
-
var _constants = require("../../../constants");
|
|
16
|
-
var _intl = _interopRequireDefault(require("../../../intl"));
|
|
17
|
-
var _titleText = _interopRequireDefault(require("./title-text"));
|
|
1
|
+
import _CollapsibleSettingLayout from "dtable-ui-component/lib/CollapsibleSettingLayout";
|
|
2
|
+
import React, { useMemo, useContext } from 'react';
|
|
3
|
+
import { Label } from 'reactstrap';
|
|
4
|
+
import { GlobalThemeContext, settingsContext } from '../../../utils/contexts';
|
|
5
|
+
import { FontSizeSettings, FontWeightSettings, FontColorSettings } from '../font-settings';
|
|
6
|
+
import TextHorizontalSettings from '../text-horizontal-settings';
|
|
7
|
+
import { DEFAULT_CHART_FONT_WEIGHT, DEFAULT_CHART_TITLE_FONT_SIZE, CHART_SUPPORT_FONT_WEIGHTS, HORIZONTAL_ALIGN, DEFAULT_TREND_CHART_TITLE_FONT_SIZE, CHART_TYPE, TITLE_FONT_COLOR_MAP, DEFAULT_CHART_TITLE_FONT_COLOR_LIGHT } from '../../../constants';
|
|
8
|
+
import intl from '../../../intl';
|
|
9
|
+
import TitleText from './title-text';
|
|
18
10
|
const TitleSetting = props => {
|
|
19
11
|
const {
|
|
20
12
|
hideTitleStyleSetting
|
|
21
|
-
} =
|
|
13
|
+
} = useContext(settingsContext);
|
|
22
14
|
const {
|
|
23
15
|
globalTheme
|
|
24
|
-
} =
|
|
25
|
-
const initialTitle =
|
|
16
|
+
} = useContext(GlobalThemeContext);
|
|
17
|
+
const initialTitle = useMemo(() => {
|
|
26
18
|
return props.title || {};
|
|
27
19
|
}, [props.title]);
|
|
28
20
|
const modifyTitle = updated => {
|
|
@@ -63,45 +55,45 @@ const TitleSetting = props => {
|
|
|
63
55
|
font_color: updatedFontColor
|
|
64
56
|
});
|
|
65
57
|
};
|
|
66
|
-
const isCard = props.type ===
|
|
58
|
+
const isCard = props.type === CHART_TYPE.TREND || props.type === CHART_TYPE.BASIC_NUMBER_CARD;
|
|
67
59
|
|
|
68
60
|
// if no text then set trend default font size to 16 and font_weight to 400
|
|
69
61
|
if (isCard && !initialTitle.text) {
|
|
70
|
-
initialTitle.font_weight =
|
|
71
|
-
initialTitle.font_size =
|
|
62
|
+
initialTitle.font_weight = CHART_SUPPORT_FONT_WEIGHTS[0];
|
|
63
|
+
initialTitle.font_size = DEFAULT_TREND_CHART_TITLE_FONT_SIZE;
|
|
72
64
|
}
|
|
73
65
|
const getChildren = () => {
|
|
74
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TitleText, {
|
|
75
67
|
text: initialTitle.text,
|
|
76
68
|
modifyText: modifyText
|
|
77
|
-
}), /*#__PURE__*/
|
|
69
|
+
}), /*#__PURE__*/React.createElement(FontSizeSettings, {
|
|
78
70
|
className: 'mt-3',
|
|
79
71
|
fontSize: initialTitle.font_size,
|
|
80
|
-
defaultFontSize: isCard ?
|
|
72
|
+
defaultFontSize: isCard ? DEFAULT_TREND_CHART_TITLE_FONT_SIZE : DEFAULT_CHART_TITLE_FONT_SIZE,
|
|
81
73
|
modifyFontSize: modifyFontSize
|
|
82
|
-
}), /*#__PURE__*/
|
|
74
|
+
}), /*#__PURE__*/React.createElement(FontWeightSettings, {
|
|
83
75
|
className: 'mt-3',
|
|
84
|
-
fontWeight: initialTitle.font_weight ||
|
|
85
|
-
supportFontWeights:
|
|
76
|
+
fontWeight: initialTitle.font_weight || DEFAULT_CHART_FONT_WEIGHT,
|
|
77
|
+
supportFontWeights: CHART_SUPPORT_FONT_WEIGHTS,
|
|
86
78
|
modifyFontWeight: modifyFontWeight
|
|
87
|
-
}), /*#__PURE__*/
|
|
79
|
+
}), /*#__PURE__*/React.createElement(FontColorSettings, {
|
|
88
80
|
className: 'mt-3',
|
|
89
81
|
fontColor: initialTitle.font_color,
|
|
90
|
-
defaultFontColor:
|
|
82
|
+
defaultFontColor: TITLE_FONT_COLOR_MAP[globalTheme] || DEFAULT_CHART_TITLE_FONT_COLOR_LIGHT,
|
|
91
83
|
modifyFontColor: modifyFontColor
|
|
92
|
-
}), /*#__PURE__*/
|
|
84
|
+
}), /*#__PURE__*/React.createElement(TextHorizontalSettings, {
|
|
93
85
|
className: 'mt-3',
|
|
94
86
|
value: initialTitle.horizontal_align,
|
|
95
|
-
defaultValue:
|
|
87
|
+
defaultValue: HORIZONTAL_ALIGN.LEFT,
|
|
96
88
|
onChange: modifyHorizontalAlign
|
|
97
89
|
}));
|
|
98
90
|
};
|
|
99
|
-
return /*#__PURE__*/
|
|
91
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, hideTitleStyleSetting && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Label, null, intl.get('Title')), /*#__PURE__*/React.createElement(TitleText, {
|
|
100
92
|
text: initialTitle.text,
|
|
101
93
|
modifyText: modifyText
|
|
102
|
-
})), !hideTitleStyleSetting && /*#__PURE__*/
|
|
103
|
-
title:
|
|
94
|
+
})), !hideTitleStyleSetting && /*#__PURE__*/React.createElement(_CollapsibleSettingLayout, {
|
|
95
|
+
title: intl.get('Title'),
|
|
104
96
|
children: getChildren()
|
|
105
97
|
}));
|
|
106
98
|
};
|
|
107
|
-
|
|
99
|
+
export default TitleSetting;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactstrap = require("reactstrap");
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Input } from 'reactstrap';
|
|
10
3
|
const TitleText = props => {
|
|
11
|
-
const [currText, setCurrText] =
|
|
4
|
+
const [currText, setCurrText] = useState(props.text || '');
|
|
12
5
|
const onKeyDown = event => {
|
|
13
6
|
if (event.key === 'Enter') {
|
|
14
7
|
event.preventDefault();
|
|
@@ -18,7 +11,7 @@ const TitleText = props => {
|
|
|
18
11
|
const onSaveText = () => {
|
|
19
12
|
props.modifyText(currText);
|
|
20
13
|
};
|
|
21
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
22
15
|
type: "text",
|
|
23
16
|
value: currText,
|
|
24
17
|
onBlur: onSaveText,
|
|
@@ -26,4 +19,4 @@ const TitleText = props => {
|
|
|
26
19
|
onKeyDown: onKeyDown
|
|
27
20
|
});
|
|
28
21
|
};
|
|
29
|
-
|
|
22
|
+
export default TitleText;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _dtableUtils = require("dtable-utils");
|
|
14
|
-
var _constants = require("../../constants");
|
|
15
|
-
var _utils = require("../../utils");
|
|
16
|
-
var _intl = _interopRequireDefault(require("../../intl"));
|
|
17
|
-
var _numericSummaryItem = _interopRequireDefault(require("./numeric-summary-item"));
|
|
18
|
-
var _summaryMethodSetting = _interopRequireDefault(require("./summary-method-setting"));
|
|
19
|
-
var _groupBy = _interopRequireDefault(require("./group-by"));
|
|
20
|
-
class YAxisGroupSettings 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 } from 'react';
|
|
4
|
+
import { FormGroup, Label } from 'reactstrap';
|
|
5
|
+
import { getTableById } from 'dtable-utils';
|
|
6
|
+
import { CHART_Y_GROUP_TYPE, CHART_SUMMARY_SHOW, CHART_SUMMARY_CALCULATION_METHOD, CHART_SUMMARY_TYPE, DATE_GRANULATES, GEOLOCATION_GRANULATES, CHART_DATE_SUMMARY_CALCULATION_METHOD, CHART_SUPPORT_COLUMNS, CHART_TYPE } from '../../constants';
|
|
7
|
+
import { BaseUtils } from '../../utils';
|
|
8
|
+
import intl from '../../intl';
|
|
9
|
+
import NumericSummaryItem from './numeric-summary-item';
|
|
10
|
+
import SummaryMethodSettings from './summary-method-setting';
|
|
11
|
+
import Groupby from './group-by';
|
|
12
|
+
class YAxisGroupSettings extends Component {
|
|
21
13
|
constructor(_props) {
|
|
22
14
|
super(_props);
|
|
23
15
|
this.initTable = props => {
|
|
@@ -29,32 +21,32 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
29
21
|
table_id,
|
|
30
22
|
type
|
|
31
23
|
} = chart.config;
|
|
32
|
-
this.isMapChart = [
|
|
33
|
-
this.selectedTable =
|
|
24
|
+
this.isMapChart = [CHART_TYPE.MAP, CHART_TYPE.MAP_BUBBLE, CHART_TYPE.WORLD_MAP, CHART_TYPE.WORLD_MAP_BUBBLE].includes(type);
|
|
25
|
+
this.selectedTable = getTableById(tables, table_id);
|
|
34
26
|
};
|
|
35
27
|
this.initGroupTypeOptions = () => {
|
|
36
28
|
this.groupTypeOptions = [{
|
|
37
|
-
value:
|
|
38
|
-
label: /*#__PURE__*/
|
|
29
|
+
value: CHART_Y_GROUP_TYPE.COUNT,
|
|
30
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
39
31
|
className: "select-module select-module-name ml-0"
|
|
40
|
-
},
|
|
32
|
+
}, intl.get(CHART_SUMMARY_SHOW['count'])), /*#__PURE__*/React.createElement("div", {
|
|
41
33
|
className: "summary-type-explanation"
|
|
42
|
-
},
|
|
34
|
+
}, intl.get('Count_the_number_of_records_in_each_group')))
|
|
43
35
|
}, {
|
|
44
|
-
value:
|
|
45
|
-
label: /*#__PURE__*/
|
|
36
|
+
value: CHART_Y_GROUP_TYPE.SINGLE_NUMERIC_COLUMN,
|
|
37
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
46
38
|
className: "select-module select-module-name ml-0"
|
|
47
|
-
},
|
|
39
|
+
}, intl.get(CHART_SUMMARY_SHOW['advanced'])), /*#__PURE__*/React.createElement("div", {
|
|
48
40
|
className: "summary-type-explanation"
|
|
49
|
-
},
|
|
41
|
+
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_a_field')))
|
|
50
42
|
}];
|
|
51
43
|
const MULTIPLE_NUMERIC_COLUMN = {
|
|
52
|
-
value:
|
|
53
|
-
label: /*#__PURE__*/
|
|
44
|
+
value: CHART_Y_GROUP_TYPE.MULTIPLE_NUMERIC_COLUMN,
|
|
45
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
54
46
|
className: "select-module select-module-name ml-0"
|
|
55
|
-
},
|
|
47
|
+
}, intl.get('Summarize_multiple_fields')), /*#__PURE__*/React.createElement("div", {
|
|
56
48
|
className: "summary-type-explanation"
|
|
57
|
-
},
|
|
49
|
+
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_multiple_fields')))
|
|
58
50
|
};
|
|
59
51
|
if (!this.isMapChart) {
|
|
60
52
|
this.groupTypeOptions.push(MULTIPLE_NUMERIC_COLUMN);
|
|
@@ -70,22 +62,22 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
70
62
|
const columns = Array.isArray(this.selectedTable.columns) ? this.selectedTable.columns : [];
|
|
71
63
|
this.columns = this.getAvailableColumns(columns);
|
|
72
64
|
this.columnGroupbyColumnsOptions = this.getColumnOptions(this.columns);
|
|
73
|
-
this.numericColumns = this.columns.filter(column =>
|
|
65
|
+
this.numericColumns = this.columns.filter(column => BaseUtils.isNumericSummaryColumn(column));
|
|
74
66
|
this.numericColumnOptions = this.getColumnOptions(this.numericColumns);
|
|
75
67
|
};
|
|
76
68
|
this.getAvailableColumns = columns => {
|
|
77
69
|
if (!columns || !Array.isArray(columns)) return [];
|
|
78
|
-
return columns.filter(column =>
|
|
70
|
+
return columns.filter(column => CHART_SUPPORT_COLUMNS.includes(column.type));
|
|
79
71
|
};
|
|
80
72
|
this.getColumnOptions = columns => {
|
|
81
73
|
const options = columns.map(column => {
|
|
82
74
|
return {
|
|
83
75
|
value: column,
|
|
84
|
-
label: /*#__PURE__*/
|
|
76
|
+
label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
85
77
|
className: "sea-chart-column-icon"
|
|
86
|
-
}, /*#__PURE__*/
|
|
78
|
+
}, /*#__PURE__*/React.createElement(_DTableColumnIcon, {
|
|
87
79
|
column: column
|
|
88
|
-
})), /*#__PURE__*/
|
|
80
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
89
81
|
className: 'select-module select-module-name ml-0'
|
|
90
82
|
}, column.name))
|
|
91
83
|
};
|
|
@@ -94,9 +86,9 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
94
86
|
value: {
|
|
95
87
|
key: 'Groupby_null'
|
|
96
88
|
},
|
|
97
|
-
label: /*#__PURE__*/
|
|
89
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
98
90
|
className: 'select-module select-module-name null-option-name ml-0'
|
|
99
|
-
},
|
|
91
|
+
}, intl.get('Select_a_column')),
|
|
100
92
|
style: {
|
|
101
93
|
color: 'rgba(0, 0, 0, .25)'
|
|
102
94
|
}
|
|
@@ -111,30 +103,30 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
111
103
|
} = chart;
|
|
112
104
|
const value = option.value;
|
|
113
105
|
let update = {};
|
|
114
|
-
if (value ===
|
|
106
|
+
if (value === CHART_Y_GROUP_TYPE.COUNT) {
|
|
115
107
|
update.column_groupby_multiple_numeric_column = false;
|
|
116
108
|
update.summary_columns = [];
|
|
117
|
-
update.y_axis_summary_type =
|
|
109
|
+
update.y_axis_summary_type = CHART_SUMMARY_TYPE.COUNT;
|
|
118
110
|
update.y_axis_summary_column_key = null;
|
|
119
|
-
update.y_axis_summary_method =
|
|
111
|
+
update.y_axis_summary_method = CHART_SUMMARY_CALCULATION_METHOD[0];
|
|
120
112
|
update.column_groupby_column_key = config.column_groupby_column_key || null;
|
|
121
113
|
update.column_groupby_date_granularity = config.column_groupby_date_granularity || null;
|
|
122
114
|
update.column_groupby_geolocation_granularity = config.column_groupby_geolocation_granularity || null;
|
|
123
|
-
} else if (value ===
|
|
115
|
+
} else if (value === CHART_Y_GROUP_TYPE.SINGLE_NUMERIC_COLUMN) {
|
|
124
116
|
update.column_groupby_multiple_numeric_column = false;
|
|
125
117
|
update.summary_columns = [];
|
|
126
|
-
update.y_axis_summary_type =
|
|
118
|
+
update.y_axis_summary_type = CHART_SUMMARY_TYPE.ADVANCED;
|
|
127
119
|
update.y_axis_summary_column_key = this.numericColumns[0] ? this.numericColumns[0].key : null;
|
|
128
|
-
update.y_axis_summary_method =
|
|
120
|
+
update.y_axis_summary_method = CHART_SUMMARY_CALCULATION_METHOD[0];
|
|
129
121
|
update.column_groupby_column_key = config.column_groupby_column_key || null;
|
|
130
122
|
update.column_groupby_date_granularity = config.column_groupby_date_granularity || null;
|
|
131
123
|
update.column_groupby_geolocation_granularity = config.column_groupby_geolocation_granularity || null;
|
|
132
|
-
} else if (value ===
|
|
124
|
+
} else if (value === CHART_Y_GROUP_TYPE.MULTIPLE_NUMERIC_COLUMN) {
|
|
133
125
|
update.column_groupby_multiple_numeric_column = true;
|
|
134
126
|
update.summary_columns = [];
|
|
135
|
-
update.y_axis_summary_type =
|
|
127
|
+
update.y_axis_summary_type = CHART_SUMMARY_TYPE.ADVANCED;
|
|
136
128
|
update.y_axis_summary_column_key = this.numericColumns[0] ? this.numericColumns[0].key : null;
|
|
137
|
-
update.y_axis_summary_method =
|
|
129
|
+
update.y_axis_summary_method = CHART_SUMMARY_CALCULATION_METHOD[0];
|
|
138
130
|
update.column_groupby_date_granularity = null;
|
|
139
131
|
update.column_groupby_geolocation_granularity = null;
|
|
140
132
|
update.column_groupby_geolocation_granularity = null;
|
|
@@ -153,12 +145,12 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
153
145
|
y_axis_summary_type
|
|
154
146
|
} = config;
|
|
155
147
|
if (column_groupby_multiple_numeric_column) {
|
|
156
|
-
return this.groupTypeOptions.find(item => item.value ===
|
|
148
|
+
return this.groupTypeOptions.find(item => item.value === CHART_Y_GROUP_TYPE.MULTIPLE_NUMERIC_COLUMN);
|
|
157
149
|
}
|
|
158
|
-
if (y_axis_summary_type ===
|
|
150
|
+
if (y_axis_summary_type === CHART_SUMMARY_TYPE.COUNT) {
|
|
159
151
|
return this.groupTypeOptions[0];
|
|
160
152
|
}
|
|
161
|
-
if (y_axis_summary_type ===
|
|
153
|
+
if (y_axis_summary_type === CHART_SUMMARY_TYPE.ADVANCED) {
|
|
162
154
|
return this.groupTypeOptions[1];
|
|
163
155
|
}
|
|
164
156
|
return this.groupTypeOptions[0];
|
|
@@ -192,7 +184,7 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
192
184
|
const {
|
|
193
185
|
config
|
|
194
186
|
} = chart;
|
|
195
|
-
const summaryMethods =
|
|
187
|
+
const summaryMethods = BaseUtils.isDateSummaryColumn(column) ? CHART_DATE_SUMMARY_CALCULATION_METHOD : CHART_SUMMARY_CALCULATION_METHOD;
|
|
196
188
|
if (index === 0) {
|
|
197
189
|
let {
|
|
198
190
|
y_axis_summary_method
|
|
@@ -270,7 +262,7 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
270
262
|
summary_columns
|
|
271
263
|
} = config;
|
|
272
264
|
const newNumericColumnKey = column.key;
|
|
273
|
-
const summaryMethods =
|
|
265
|
+
const summaryMethods = BaseUtils.isDateSummaryColumn(column) ? CHART_DATE_SUMMARY_CALCULATION_METHOD : CHART_SUMMARY_CALCULATION_METHOD;
|
|
274
266
|
if (Array.isArray(summary_columns)) {
|
|
275
267
|
summary_columns = [...summary_columns];
|
|
276
268
|
summary_columns.push({
|
|
@@ -300,8 +292,8 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
300
292
|
if (column_groupby_column_key === column.key) return;
|
|
301
293
|
this.props.onChange({
|
|
302
294
|
column_groupby_column_key: column.key,
|
|
303
|
-
column_groupby_date_granularity:
|
|
304
|
-
column_groupby_geolocation_granularity:
|
|
295
|
+
column_groupby_date_granularity: DATE_GRANULATES[0],
|
|
296
|
+
column_groupby_geolocation_granularity: GEOLOCATION_GRANULATES[0]
|
|
305
297
|
});
|
|
306
298
|
};
|
|
307
299
|
this.onGroupbyDateGranularityChange = option => {
|
|
@@ -348,8 +340,8 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
348
340
|
} = config;
|
|
349
341
|
if (!summary_columns || !Array.isArray(summary_columns)) return null;
|
|
350
342
|
return summary_columns.map((item, index) => {
|
|
351
|
-
return /*#__PURE__*/
|
|
352
|
-
key:
|
|
343
|
+
return /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
344
|
+
key: `number-column-${index}`,
|
|
353
345
|
index: index + 1,
|
|
354
346
|
value: item,
|
|
355
347
|
chart: chart,
|
|
@@ -372,16 +364,16 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
372
364
|
if (!column_groupby_multiple_numeric_column) return null;
|
|
373
365
|
const usedSummaryColumnKeys = Array.isArray(summary_columns) ? summary_columns.map(item => item.column_key) : [];
|
|
374
366
|
const unUsedSummaryColumns = this.numericColumns.filter(column => column.key !== y_axis_summary_column_key && !usedSummaryColumnKeys.includes(column.key));
|
|
375
|
-
return /*#__PURE__*/
|
|
367
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
376
368
|
className: "statistic-add-number"
|
|
377
|
-
}, this.renderGroupbyNumericColumns()), Array.isArray(unUsedSummaryColumns) && unUsedSummaryColumns.length > 0 && /*#__PURE__*/
|
|
369
|
+
}, this.renderGroupbyNumericColumns()), Array.isArray(unUsedSummaryColumns) && unUsedSummaryColumns.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
378
370
|
className: "statistic-add-number-columns d-flex align-items-center",
|
|
379
371
|
onClick: () => this.onAddNumericColumn(unUsedSummaryColumns[0])
|
|
380
|
-
}, /*#__PURE__*/
|
|
372
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
381
373
|
className: "dtable-font dtable-icon-add-table mr-2"
|
|
382
|
-
}), /*#__PURE__*/
|
|
374
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
383
375
|
className: "number-column-item add-number-column-description"
|
|
384
|
-
},
|
|
376
|
+
}, intl.get('Add_new_field'))));
|
|
385
377
|
};
|
|
386
378
|
this.initTable(_props);
|
|
387
379
|
this.initGroupTypeOptions();
|
|
@@ -413,11 +405,11 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
413
405
|
} = chart.config;
|
|
414
406
|
|
|
415
407
|
// if user do not select Single Numeric Column, then do not use it as the first config of multiple numeric column
|
|
416
|
-
const hasSingleNumericColumnConfig = !!(y_axis_summary_column_key && y_axis_summary_type ===
|
|
408
|
+
const hasSingleNumericColumnConfig = !!(y_axis_summary_column_key && y_axis_summary_type === CHART_SUMMARY_TYPE.ADVANCED);
|
|
417
409
|
const hasMultipleNumericColumnsConfig = column_groupby_multiple_numeric_column;
|
|
418
|
-
return /*#__PURE__*/
|
|
410
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormGroup, {
|
|
419
411
|
className: "sea-chart-parameter-item"
|
|
420
|
-
}, /*#__PURE__*/
|
|
412
|
+
}, /*#__PURE__*/React.createElement(Label, null, label), /*#__PURE__*/React.createElement(_DTableSelect, {
|
|
421
413
|
menuPortalTarget: "#sea-chart-settings-content",
|
|
422
414
|
classNamePrefix: "chart-summary-types",
|
|
423
415
|
value: selectedTypeOption,
|
|
@@ -425,7 +417,7 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
425
417
|
options: this.groupTypeOptions
|
|
426
418
|
})),
|
|
427
419
|
// multiple but has single selected numeric column as the first config item
|
|
428
|
-
hasMultipleNumericColumnsConfig && (hasSingleNumericColumnConfig ? /*#__PURE__*/
|
|
420
|
+
hasMultipleNumericColumnsConfig && (hasSingleNumericColumnConfig ? /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
429
421
|
index: 0,
|
|
430
422
|
value: {
|
|
431
423
|
column_key: y_axis_summary_column_key,
|
|
@@ -437,7 +429,7 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
437
429
|
onSummaryMethodChange: this.onSummaryMethodChange
|
|
438
430
|
}) : null),
|
|
439
431
|
// single selected numeric columns
|
|
440
|
-
!hasMultipleNumericColumnsConfig && hasSingleNumericColumnConfig && /*#__PURE__*/
|
|
432
|
+
!hasMultipleNumericColumnsConfig && hasSingleNumericColumnConfig && /*#__PURE__*/React.createElement(SummaryMethodSettings, {
|
|
441
433
|
value: {
|
|
442
434
|
column_key: y_axis_summary_column_key,
|
|
443
435
|
summary_method: y_axis_summary_method
|
|
@@ -446,8 +438,8 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
446
438
|
numericColumnOptions: this.numericColumnOptions,
|
|
447
439
|
onColumnOptionChange: option => this.onGroupbyNumericColumnChange(option, 0),
|
|
448
440
|
onSummaryMethodChange: option => this.onSummaryMethodChange(option, 0)
|
|
449
|
-
}), this.renderColumnGroupbyMultipleNumericColumn(), (!column_groupby_multiple_numeric_column && y_axis_summary_type ===
|
|
450
|
-
label:
|
|
441
|
+
}), this.renderColumnGroupbyMultipleNumericColumn(), (!column_groupby_multiple_numeric_column && y_axis_summary_type === CHART_SUMMARY_TYPE.ADVANCED || y_axis_summary_type === CHART_SUMMARY_TYPE.COUNT) && !this.isMapChart && /*#__PURE__*/React.createElement(Groupby, {
|
|
442
|
+
label: intl.get('Group_by'),
|
|
451
443
|
tables: tables,
|
|
452
444
|
selectedTableId: table_id,
|
|
453
445
|
selectedColumnKey: column_groupby_column_key,
|
|
@@ -459,4 +451,4 @@ class YAxisGroupSettings extends _react.Component {
|
|
|
459
451
|
}));
|
|
460
452
|
}
|
|
461
453
|
}
|
|
462
|
-
|
|
454
|
+
export default YAxisGroupSettings;
|