dtable-statistic 4.3.3 → 4.3.4
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/es/api/dtable-db-api.js +3 -10
- package/es/calculator/base-calculator.js +12 -20
- package/es/calculator/basic-chart-calculator.js +65 -72
- package/es/calculator/combination-calculator.js +57 -64
- package/es/calculator/compare-bar-calculator.js +26 -33
- package/es/calculator/completeness-calculator.js +30 -37
- package/es/calculator/copy-value.js +1 -7
- package/es/calculator/dashboard-calculator.js +13 -20
- package/es/calculator/heat-map-calculator.js +18 -25
- package/es/calculator/horizontal-bar-calculator.js +8 -15
- package/es/calculator/index.js +35 -42
- package/es/calculator/map-calculator.js +22 -29
- package/es/calculator/mirror-calculator.js +20 -27
- package/es/calculator/number-card-calculator.js +10 -17
- package/es/calculator/pivot-table-calculator.js +58 -65
- package/es/calculator/scatter-calculator.js +14 -21
- package/es/calculator/thread-manager.js +1 -7
- package/es/calculator/trend-calculator.js +22 -29
- package/es/calculator/workers/basic-chart-calculator-worker.js +76 -83
- package/es/calculator/workers/calculator.worker.js +30 -33
- package/es/calculator/workers/card-calculator-worker.js +13 -19
- package/es/calculator/workers/combination-calculator-worker.js +46 -53
- package/es/calculator/workers/compare-bar-chart-calculator-worker.js +22 -29
- package/es/calculator/workers/completeness-calculator-worker.js +34 -41
- package/es/calculator/workers/dashboard-calculator-worker.js +18 -24
- package/es/calculator/workers/mirror-calculator-worker.js +22 -29
- package/es/calculator/workers/pivot-table-calculator-worker.js +77 -84
- package/es/calculator/workers/scatter-calculator-worker.js +20 -27
- package/es/calculator/workers/trend-calculator-worker.js +27 -34
- package/es/calculator/world-map-calculator.js +17 -24
- package/es/components/common-add-tool.js +5 -12
- package/es/components/dialog/chart-addition-edit-dialog.js +12 -20
- package/es/components/dialog/chart-addition-widgets/chart-selector.js +101 -108
- package/es/components/dialog/color-theme-dialog.js +15 -22
- package/es/components/dialog/delete-confirmation-dialog.js +11 -18
- package/es/components/dialog/enlarged-chart-dialog.js +20 -28
- package/es/components/dialog/new-table-dialog.js +16 -23
- package/es/components/dialog/new-view-dialog.js +14 -21
- package/es/components/dialog/rename-view-dialog.js +14 -22
- package/es/components/dialog/statistic-record-dialog/index.js +37 -45
- package/es/components/dialog/statistic-types-dialog/index.js +14 -22
- package/es/components/dialog/table-select-dialog.js +15 -23
- package/es/components/dropdown-menu/statistic-dropdown-menu.js +41 -49
- package/es/components/dtable-popover.js +12 -19
- package/es/components/dtable-search-input.js +13 -21
- package/es/components/dtable-select.js +15 -21
- package/es/components/icon.js +4 -11
- package/es/components/index.js +11 -76
- package/es/components/loading.js +3 -10
- package/es/components/modal-portal.js +5 -12
- package/es/components/popover/color-rules/color-rule.js +25 -33
- package/es/components/popover/color-rules/index.js +6 -14
- package/es/components/popover/color-rules/rule-filters/filter.js +27 -34
- package/es/components/popover/color-rules/rule-filters/index.js +17 -25
- package/es/components/popover/color-rules/rule-filters/number-input.js +9 -17
- package/es/components/popover/color-rules-popover.js +24 -32
- package/es/components/popover/color-selector-popover.js +10 -17
- package/es/components/seatable-radio/index.js +9 -16
- package/es/components/select/index.js +2 -9
- package/es/components/select/option-group.js +19 -27
- package/es/components/select/option.js +6 -14
- package/es/components/select/select.js +17 -25
- package/es/components/toast/alert.js +24 -31
- package/es/components/toast/index.js +3 -10
- package/es/components/toast/toast.js +12 -20
- package/es/components/toast/toastManager.js +9 -17
- package/es/components/toast/toaster.js +6 -14
- package/es/constants/color-rules.js +6 -12
- package/es/constants/dtable-select-style.js +4 -9
- package/es/constants/event-types.js +4 -10
- package/es/constants/index.js +67 -96
- package/es/constants/key-codes.js +0 -2
- package/es/constants/map.js +2 -8
- package/es/constants/model.js +20 -26
- package/es/constants/regions.js +3 -8
- package/es/constants/zIndexes.js +1 -7
- package/es/custom-g2.js +208 -236
- package/es/dashboard.js +50 -58
- package/es/desktop-dashboard.js +47 -55
- package/es/index.js +3 -6
- package/es/locale/index.js +10 -13
- package/es/locale/lang/de.js +1 -7
- package/es/locale/lang/en.js +1 -7
- package/es/locale/lang/fr.js +1 -7
- package/es/locale/lang/zh_CN.js +1 -7
- package/es/mobile-dashboard.js +38 -46
- package/es/model/bar-group.js +11 -19
- package/es/model/bar.js +10 -18
- package/es/model/base-model.js +2 -9
- package/es/model/basic-number-card.js +8 -16
- package/es/model/collaborators.js +2 -9
- package/es/model/combination.js +12 -20
- package/es/model/compare-bar.js +16 -24
- package/es/model/completeness-group.js +8 -16
- package/es/model/completeness.js +5 -13
- package/es/model/custom-bar.js +6 -14
- package/es/model/dashboard.js +6 -14
- package/es/model/generic-model.js +133 -141
- package/es/model/heat-map.js +11 -19
- package/es/model/horizontal-bar-group.js +10 -18
- package/es/model/horizontal-bar.js +10 -18
- package/es/model/index.js +53 -185
- package/es/model/map.js +15 -23
- package/es/model/mirror.js +13 -21
- package/es/model/pie.js +10 -18
- package/es/model/ring.js +11 -19
- package/es/model/scatter.js +6 -14
- package/es/model/statistic-dashboard.js +2 -9
- package/es/model/table.js +10 -18
- package/es/model/trend.js +12 -20
- package/es/model/world-map.js +13 -21
- package/es/service/chart-service.js +7 -14
- package/es/service/dashboard-service.js +34 -41
- package/es/service/map-json.js +8 -14
- package/es/stat-editor/chart-name-editor.js +8 -15
- package/es/stat-editor/index.js +16 -24
- package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +21 -29
- package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +49 -57
- package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +4 -11
- package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +19 -27
- package/es/stat-editor/stat-settings/advance-chart-settings/index.js +43 -51
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +37 -45
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +19 -27
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +26 -34
- package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +47 -55
- package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +22 -30
- package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +18 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +27 -35
- package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +24 -32
- package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +33 -41
- package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +22 -30
- package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +27 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +46 -54
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +23 -31
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +26 -34
- package/es/stat-editor/stat-settings/basic-chart-settings/index.js +77 -85
- package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +21 -29
- package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +73 -81
- package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +16 -24
- package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +19 -27
- package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +18 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +49 -57
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +17 -25
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +47 -55
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +11 -19
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +45 -53
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +9 -17
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +20 -28
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +30 -38
- package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +50 -58
- package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +17 -25
- package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +47 -55
- package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +11 -19
- package/es/stat-editor/stat-settings/color-setting/color-picker.js +12 -19
- package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +62 -70
- package/es/stat-editor/stat-settings/map/map-level.js +13 -20
- package/es/stat-editor/stat-settings/map/map-province-city.js +20 -27
- package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +11 -19
- package/es/stat-editor/stat-settings/public-setting/base-settings.js +20 -28
- package/es/stat-editor/stat-settings/public-setting/calender.js +22 -29
- package/es/stat-editor/stat-settings/public-setting/column-settings.js +6 -13
- package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +9 -16
- package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +13 -21
- package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +8 -15
- package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +11 -19
- package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +27 -35
- package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +8 -15
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +18 -26
- package/es/stat-list/chart-preview.js +20 -28
- package/es/stat-list/index.js +27 -35
- package/es/stat-view/area-chart.js +43 -50
- package/es/stat-view/bar-chart.js +47 -54
- package/es/stat-view/base-chart.js +24 -32
- package/es/stat-view/basic-number-card.js +19 -26
- package/es/stat-view/combination-chart.js +49 -56
- package/es/stat-view/compare-chart.js +39 -46
- package/es/stat-view/completeness-chart.js +28 -35
- package/es/stat-view/custom-bar.js +31 -38
- package/es/stat-view/dashboard-chart.js +15 -22
- package/es/stat-view/heat-map.js +43 -50
- package/es/stat-view/horizontal-bar-chart.js +51 -58
- package/es/stat-view/index.js +73 -80
- package/es/stat-view/line-chart.js +39 -46
- package/es/stat-view/map.js +33 -40
- package/es/stat-view/mirror.js +21 -28
- package/es/stat-view/pie-chart.js +29 -36
- package/es/stat-view/pivot-table/index.js +32 -39
- package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +31 -39
- package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +29 -37
- package/es/stat-view/pivot-table/pivot-table-display-name.js +46 -54
- package/es/stat-view/pivot-table/two-dimension-table.js +62 -70
- package/es/stat-view/ring-chart.js +38 -45
- package/es/stat-view/scatter-chart.js +30 -37
- package/es/stat-view/treemap-chart.js +37 -44
- package/es/stat-view/trend-chart.js +32 -39
- package/es/stat-view/world-map.js +33 -40
- package/es/tabs/index.js +32 -40
- package/es/tabs/tab.js +26 -34
- package/es/utils/basic-chart-utils.js +2 -9
- package/es/utils/cell-format.js +14 -22
- package/es/utils/cell-value.js +7 -14
- package/es/utils/collaborator.js +4 -13
- package/es/utils/color-utils.js +18 -29
- package/es/utils/column-utils.js +18 -29
- package/es/utils/column.js +4 -11
- package/es/utils/common-utils.js +41 -65
- package/es/utils/date-format.js +2 -8
- package/es/utils/export-table-utils.js +82 -91
- package/es/utils/index.js +11 -100
- package/es/utils/map.js +26 -36
- package/es/utils/model.js +6 -14
- package/es/utils/object.js +6 -15
- package/es/utils/pivot-table.js +16 -23
- package/es/utils/row-utils.js +23 -33
- package/es/utils/search.js +21 -29
- package/es/utils/sql-utils.js +65 -75
- package/es/utils/stat-utils.js +60 -66
- package/es/utils/trend-utils.js +32 -40
- package/package.json +1 -1
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _summarySettings = _interopRequireDefault(require("./summary-settings"));
|
|
15
|
-
var _timerPicker = _interopRequireDefault(require("./timer-picker"));
|
|
16
|
-
var _barChartStyleSetting = _interopRequireDefault(require("./style-setting/bar-chart-style-setting"));
|
|
17
|
-
var _timeCompareStyle = _interopRequireDefault(require("./style-setting/time-compare-style"));
|
|
18
|
-
var _colorPicker = _interopRequireDefault(require("../color-setting/color-picker"));
|
|
19
|
-
var _constants = require("../../../constants");
|
|
20
|
-
var _statisticTimePickerModule = _interopRequireDefault(require("../../../assets/css/statistic-time-picker.module.css"));
|
|
21
|
-
class TimeComparisonSettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import { DTableSelect } from '../../../components';
|
|
4
|
+
import BaseSettings from '../public-setting/base-settings';
|
|
5
|
+
import ToggleSetting from '../public-setting/toggle-setting';
|
|
6
|
+
import SummarySettings from './summary-settings';
|
|
7
|
+
import TimePicker from './timer-picker';
|
|
8
|
+
import BarChartStyle from './style-setting/bar-chart-style-setting';
|
|
9
|
+
import TimeCompareStyle from './style-setting/time-compare-style';
|
|
10
|
+
import ColorPicker from '../color-setting/color-picker';
|
|
11
|
+
import { TIME_COLUMN_LIST } from '../../../constants';
|
|
12
|
+
import styles from '../../../assets/css/statistic-time-picker.module.css';
|
|
13
|
+
class TimeComparisonSettings extends Component {
|
|
22
14
|
constructor(props) {
|
|
23
15
|
super(props);
|
|
24
16
|
this.renderGroupbyDateGranularity = () => {
|
|
@@ -27,9 +19,9 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
27
19
|
groupbyDateGranularity
|
|
28
20
|
} = this.props;
|
|
29
21
|
let selectedDateGranularity = this.getSelectedDateGranularity(groupbyDateGranularity);
|
|
30
|
-
return /*#__PURE__*/
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
23
|
className: "statistic-chart-parameter-item"
|
|
32
|
-
}, /*#__PURE__*/
|
|
24
|
+
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
33
25
|
value: selectedDateGranularity,
|
|
34
26
|
onChange: this.onSelectGroupbyDateGranularity,
|
|
35
27
|
options: dateGranularityOptions
|
|
@@ -43,10 +35,10 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
43
35
|
x_axis_column_key
|
|
44
36
|
} = statItem;
|
|
45
37
|
let selectedColumnOption = this.props.getSelectedColumnOption(x_axis_column_key, this.columnsOptions);
|
|
46
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
47
39
|
className: "statistic-chart-parameter-item"
|
|
48
|
-
}, /*#__PURE__*/
|
|
49
|
-
placeholder:
|
|
40
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('X-axis')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
41
|
+
placeholder: intl.get('Select_a_column'),
|
|
50
42
|
value: selectedColumnOption,
|
|
51
43
|
onChange: this.onSelectGroupbyColumn,
|
|
52
44
|
options: this.columnsOptions
|
|
@@ -59,9 +51,9 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
59
51
|
} = this.props;
|
|
60
52
|
dateGranularityOptions = dateGranularityOptions.filter(item => item.value !== 'year');
|
|
61
53
|
let selectedDateGranularity = this.getSelectedDateGranularity(statItem.x_axis_date_granularity);
|
|
62
|
-
return /*#__PURE__*/
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
55
|
className: "statistic-chart-parameter-item"
|
|
64
|
-
}, /*#__PURE__*/
|
|
56
|
+
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
65
57
|
value: selectedDateGranularity,
|
|
66
58
|
onChange: this.onSelectGroupbyDateGranularity,
|
|
67
59
|
options: dateGranularityOptions
|
|
@@ -94,16 +86,16 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
94
86
|
const {
|
|
95
87
|
statItem
|
|
96
88
|
} = this.props;
|
|
97
|
-
return /*#__PURE__*/
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
98
90
|
className: "statistic-chart-parameter-item"
|
|
99
|
-
}, /*#__PURE__*/
|
|
100
|
-
className:
|
|
101
|
-
}, /*#__PURE__*/
|
|
91
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Date_range')), /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: styles['time-input-container']
|
|
93
|
+
}, /*#__PURE__*/React.createElement(TimePicker, {
|
|
102
94
|
onCommit: value => this.updateDate('x_axis_date_range_start', value),
|
|
103
95
|
value: statItem.x_axis_date_range_start
|
|
104
|
-
}), /*#__PURE__*/
|
|
105
|
-
className:
|
|
106
|
-
}, ' - '), /*#__PURE__*/
|
|
96
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: styles['concat']
|
|
98
|
+
}, ' - '), /*#__PURE__*/React.createElement(TimePicker, {
|
|
107
99
|
onCommit: value => this.updateDate('x_axis_date_range_end', value),
|
|
108
100
|
value: statItem.x_axis_date_range_end
|
|
109
101
|
})));
|
|
@@ -112,16 +104,16 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
112
104
|
const {
|
|
113
105
|
statItem
|
|
114
106
|
} = this.props;
|
|
115
|
-
return /*#__PURE__*/
|
|
107
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
116
108
|
className: "statistic-chart-parameter-item"
|
|
117
|
-
}, /*#__PURE__*/
|
|
118
|
-
className:
|
|
119
|
-
}, /*#__PURE__*/
|
|
109
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Compare_to_date_range')), /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: styles['time-input-container']
|
|
111
|
+
}, /*#__PURE__*/React.createElement(TimePicker, {
|
|
120
112
|
onCommit: value => this.updateDate('x_axis_compared_date_range_start', value),
|
|
121
113
|
value: statItem.x_axis_compared_date_range_start
|
|
122
|
-
}), /*#__PURE__*/
|
|
123
|
-
className:
|
|
124
|
-
}, ' - '), /*#__PURE__*/
|
|
114
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: styles['concat']
|
|
116
|
+
}, ' - '), /*#__PURE__*/React.createElement(TimePicker, {
|
|
125
117
|
onCommit: value => this.updateDate('x_axis_compared_date_range_end', value),
|
|
126
118
|
value: statItem.x_axis_compared_date_range_end
|
|
127
119
|
})));
|
|
@@ -133,12 +125,12 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
133
125
|
const {
|
|
134
126
|
display_increase
|
|
135
127
|
} = statItem;
|
|
136
|
-
return /*#__PURE__*/
|
|
128
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
137
129
|
className: "statistic-chart-parameter-item"
|
|
138
|
-
}, /*#__PURE__*/
|
|
130
|
+
}, /*#__PURE__*/React.createElement(ToggleSetting, {
|
|
139
131
|
isChecked: display_increase || false,
|
|
140
132
|
handleToggleChange: this.onToggleIncrease,
|
|
141
|
-
label:
|
|
133
|
+
label: intl.get('Display_increase')
|
|
142
134
|
}));
|
|
143
135
|
};
|
|
144
136
|
this.renderColorPicker = () => {
|
|
@@ -147,9 +139,9 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
147
139
|
increase_line_color = '#fbd44a'
|
|
148
140
|
}
|
|
149
141
|
} = this.props;
|
|
150
|
-
return /*#__PURE__*/
|
|
142
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
151
143
|
className: "statistic-chart-parameter-item"
|
|
152
|
-
}, /*#__PURE__*/
|
|
144
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Line_color')), /*#__PURE__*/React.createElement(ColorPicker, {
|
|
153
145
|
isPickAllColor: true,
|
|
154
146
|
activeColor: increase_line_color,
|
|
155
147
|
onColorChanged: this.onColorChanged
|
|
@@ -212,13 +204,13 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
212
204
|
comparedDateRangeEnd: x_axis_compared_date_range_end
|
|
213
205
|
};
|
|
214
206
|
this.columnsOptions = generalColumnsOptions.filter(item => {
|
|
215
|
-
return
|
|
207
|
+
return TIME_COLUMN_LIST.includes(item.value.type);
|
|
216
208
|
});
|
|
217
209
|
}
|
|
218
210
|
componentWillReceiveProps(nextProps, props) {
|
|
219
211
|
if (nextProps.selectedTableId !== this.props.selectedTableId || nextProps.generalColumnsOptions !== props.generalColumnsOptions) {
|
|
220
212
|
this.columnsOptions = nextProps.generalColumnsOptions.filter(item => {
|
|
221
|
-
return
|
|
213
|
+
return TIME_COLUMN_LIST.includes(item.value.type);
|
|
222
214
|
});
|
|
223
215
|
}
|
|
224
216
|
}
|
|
@@ -239,19 +231,19 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
239
231
|
y_axis_summary_method
|
|
240
232
|
} = statItem || {};
|
|
241
233
|
if (settingType === 'style') {
|
|
242
|
-
return /*#__PURE__*/
|
|
234
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BarChartStyle, {
|
|
243
235
|
hideDisplayDataSetting: false,
|
|
244
236
|
statItem: statItem,
|
|
245
237
|
labelColorConfigs: labelColorConfigs,
|
|
246
238
|
eventBus: eventBus,
|
|
247
239
|
getTableById: getTableById,
|
|
248
240
|
updateStatItem: this.props.updateStatItem
|
|
249
|
-
}), /*#__PURE__*/
|
|
241
|
+
}), /*#__PURE__*/React.createElement(TimeCompareStyle, {
|
|
250
242
|
statItem: statItem,
|
|
251
243
|
updateStatItem: this.props.updateStatItem
|
|
252
244
|
}), this.renderColorPicker());
|
|
253
245
|
}
|
|
254
|
-
return /*#__PURE__*/
|
|
246
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(BaseSettings, {
|
|
255
247
|
statItem: statItem,
|
|
256
248
|
selectedTableId: selectedTableId,
|
|
257
249
|
selectedViewId: selectedViewId,
|
|
@@ -260,13 +252,13 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
260
252
|
getTableById: this.props.getTableById,
|
|
261
253
|
getConvertedChart: this.props.getConvertedChart,
|
|
262
254
|
updateStatItem: this.props.updateStatItem
|
|
263
|
-
}), /*#__PURE__*/
|
|
255
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
264
256
|
className: "statistic-chart-parameter-divider"
|
|
265
|
-
}), this.renderGroupby(), this.renderGroupbyDateGranularity(), this.renderDateRange(), this.renderComparedDateRange(), /*#__PURE__*/
|
|
257
|
+
}), this.renderGroupby(), this.renderGroupbyDateGranularity(), this.renderDateRange(), this.renderComparedDateRange(), /*#__PURE__*/React.createElement("div", {
|
|
266
258
|
className: "statistic-chart-parameter-divider"
|
|
267
|
-
}), /*#__PURE__*/
|
|
259
|
+
}), /*#__PURE__*/React.createElement(SummarySettings, {
|
|
268
260
|
statItem: statItem,
|
|
269
|
-
label:
|
|
261
|
+
label: intl.get('Y-axis'),
|
|
270
262
|
numericColumnsOptions: numericColumnsOptions,
|
|
271
263
|
summaryType: y_axis_summary_type,
|
|
272
264
|
summaryColumnKey: y_axis_column_key,
|
|
@@ -275,9 +267,9 @@ class TimeComparisonSettings extends _react.Component {
|
|
|
275
267
|
onChangeSummaryType: this.updatedSummaryType,
|
|
276
268
|
onSelectNumericColumn: this.updateSummaryColumn,
|
|
277
269
|
onSelectSummaryMethod: this.updateSummaryMethod
|
|
278
|
-
}), /*#__PURE__*/
|
|
270
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
279
271
|
className: "statistic-chart-parameter-divider"
|
|
280
272
|
}), this.renderIncrementLineSetting());
|
|
281
273
|
}
|
|
282
274
|
}
|
|
283
|
-
|
|
275
|
+
export default TimeComparisonSettings;
|
|
@@ -1,17 +1,9 @@
|
|
|
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 _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
|
-
var _calender = _interopRequireDefault(require("../public-setting/calender"));
|
|
12
|
-
var _statisticTimePickerModule = _interopRequireDefault(require("../../../assets/css/statistic-time-picker.module.css"));
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import DateEditorPopover from '../public-setting/calender';
|
|
4
|
+
import styles from '../../../assets/css/statistic-time-picker.module.css';
|
|
13
5
|
const DATE_FORMAT = 'YYYY-MM-DD';
|
|
14
|
-
class TimePicker extends
|
|
6
|
+
class TimePicker extends React.Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.onDateEditorToggle = () => {
|
|
@@ -58,9 +50,9 @@ class TimePicker extends _react.default.Component {
|
|
|
58
50
|
componentDidMount() {
|
|
59
51
|
const isZhcn = window.dtable && window.dtable.lang === 'zh-cn';
|
|
60
52
|
if (isZhcn) {
|
|
61
|
-
|
|
53
|
+
dayjs.locale('zh-cn');
|
|
62
54
|
} else {
|
|
63
|
-
|
|
55
|
+
dayjs.locale('en-gb');
|
|
64
56
|
}
|
|
65
57
|
this.setState({
|
|
66
58
|
isDateInit: true
|
|
@@ -68,11 +60,11 @@ class TimePicker extends _react.default.Component {
|
|
|
68
60
|
}
|
|
69
61
|
render() {
|
|
70
62
|
if (!this.state.isDateInit) {
|
|
71
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
64
|
className: "cell-editor date-editor"
|
|
73
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
74
66
|
className: "date-editor-container"
|
|
75
|
-
}, /*#__PURE__*/
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
68
|
className: "control-form"
|
|
77
69
|
})));
|
|
78
70
|
}
|
|
@@ -80,15 +72,15 @@ class TimePicker extends _react.default.Component {
|
|
|
80
72
|
isPopoverShow
|
|
81
73
|
} = this.state;
|
|
82
74
|
let lang = window.dtable && window.dtable.lang || 'zh-cn';
|
|
83
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
84
76
|
onKeyDown: this.handleKeyDown,
|
|
85
|
-
className:
|
|
86
|
-
}, !isPopoverShow && /*#__PURE__*/
|
|
87
|
-
className:
|
|
88
|
-
}, /*#__PURE__*/
|
|
77
|
+
className: styles['date-editor']
|
|
78
|
+
}, !isPopoverShow && /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: styles['date-editor-container']
|
|
80
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
89
81
|
className: "form-control",
|
|
90
82
|
onClick: this.onDateEditorToggle
|
|
91
|
-
}, this.props.value)), isPopoverShow && /*#__PURE__*/
|
|
83
|
+
}, this.props.value)), isPopoverShow && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(DateEditorPopover, {
|
|
92
84
|
lang: lang,
|
|
93
85
|
value: this.props.value,
|
|
94
86
|
dateFormat: DATE_FORMAT,
|
|
@@ -101,4 +93,4 @@ class TimePicker extends _react.default.Component {
|
|
|
101
93
|
TimePicker.defaultProps = {
|
|
102
94
|
value: ''
|
|
103
95
|
};
|
|
104
|
-
|
|
96
|
+
export default TimePicker;
|
|
@@ -1,33 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _components = require("../../../components");
|
|
12
|
-
var _groupbySettings = _interopRequireDefault(require("./groupby-settings"));
|
|
13
|
-
var _summaryMethodSetting = _interopRequireDefault(require("./summary-method-setting"));
|
|
14
|
-
var _numericSummaryItem = _interopRequireDefault(require("../public-setting/numeric-summary-item"));
|
|
15
|
-
var _constants = require("../../../constants");
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import { DTableSelect } from '../../../components';
|
|
4
|
+
import GroupbySettings from './groupby-settings';
|
|
5
|
+
import SummaryMethodSettings from './summary-method-setting';
|
|
6
|
+
import NumericSummaryItem from '../public-setting/numeric-summary-item';
|
|
7
|
+
import { GROUPBY_TYPE, STATISTICS_COUNT_SHOW, SUMMARY_METHOD, SUMMARY_TYPE } from '../../../constants';
|
|
16
8
|
const GROUP_TYPES = {
|
|
17
9
|
COUNT: 'count',
|
|
18
10
|
SINGLE_NUMERIC_COLUMN: 'single_numeric_column',
|
|
19
11
|
MULTIPLE_NUMERIC_COLUMN: 'multiple_numeric_column'
|
|
20
12
|
};
|
|
21
|
-
class GroupingSettings extends
|
|
13
|
+
class GroupingSettings extends Component {
|
|
22
14
|
constructor(props) {
|
|
23
15
|
super(props);
|
|
24
16
|
this.getSummaryMethodsOptions = () => {
|
|
25
|
-
return
|
|
17
|
+
return SUMMARY_METHOD.map(m => {
|
|
26
18
|
return {
|
|
27
19
|
value: m,
|
|
28
|
-
label: /*#__PURE__*/
|
|
20
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
29
21
|
className: 'select-module select-module-name'
|
|
30
|
-
},
|
|
22
|
+
}, intl.get(STATISTICS_COUNT_SHOW[m]))
|
|
31
23
|
};
|
|
32
24
|
});
|
|
33
25
|
};
|
|
@@ -35,10 +27,10 @@ class GroupingSettings extends _react.Component {
|
|
|
35
27
|
let {
|
|
36
28
|
y_axis_summary_type
|
|
37
29
|
} = _ref;
|
|
38
|
-
if (y_axis_summary_type ===
|
|
30
|
+
if (y_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
39
31
|
return GROUP_TYPES.SINGLE_NUMERIC_COLUMN;
|
|
40
32
|
}
|
|
41
|
-
if (y_axis_summary_type ===
|
|
33
|
+
if (y_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
42
34
|
return GROUP_TYPES.SINGLE_NUMERIC_COLUMN;
|
|
43
35
|
}
|
|
44
36
|
return GROUP_TYPES.COUNT;
|
|
@@ -46,25 +38,25 @@ class GroupingSettings extends _react.Component {
|
|
|
46
38
|
this.getGroupTypeOptions = () => {
|
|
47
39
|
return [{
|
|
48
40
|
value: GROUP_TYPES.COUNT,
|
|
49
|
-
label: /*#__PURE__*/
|
|
41
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
50
42
|
className: 'select-module select-module-name'
|
|
51
|
-
},
|
|
43
|
+
}, intl.get(STATISTICS_COUNT_SHOW['count'])), /*#__PURE__*/React.createElement("div", {
|
|
52
44
|
className: "summary-type-explanation"
|
|
53
|
-
},
|
|
45
|
+
}, intl.get('Count_the_number_of_records_in_each_group')))
|
|
54
46
|
}, {
|
|
55
47
|
value: GROUP_TYPES.SINGLE_NUMERIC_COLUMN,
|
|
56
|
-
label: /*#__PURE__*/
|
|
48
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
57
49
|
className: 'select-module select-module-name'
|
|
58
|
-
},
|
|
50
|
+
}, intl.get(STATISTICS_COUNT_SHOW['advanced'])), /*#__PURE__*/React.createElement("div", {
|
|
59
51
|
className: "summary-type-explanation"
|
|
60
|
-
},
|
|
52
|
+
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_a_field')))
|
|
61
53
|
}, {
|
|
62
54
|
value: GROUP_TYPES.MULTIPLE_NUMERIC_COLUMN,
|
|
63
|
-
label: /*#__PURE__*/
|
|
55
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
64
56
|
className: 'select-module select-module-name'
|
|
65
|
-
},
|
|
57
|
+
}, intl.get('Summarize_multiple_fields')), /*#__PURE__*/React.createElement("div", {
|
|
66
58
|
className: "summary-type-explanation"
|
|
67
|
-
},
|
|
59
|
+
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_multiple_fields')))
|
|
68
60
|
}];
|
|
69
61
|
};
|
|
70
62
|
this.onChangeGroupType = option => {
|
|
@@ -85,14 +77,14 @@ class GroupingSettings extends _react.Component {
|
|
|
85
77
|
y_axis_summary_method
|
|
86
78
|
} = this.props.statItem || {};
|
|
87
79
|
if (value === GROUP_TYPES.SINGLE_NUMERIC_COLUMN) {
|
|
88
|
-
y_axis_summary_type =
|
|
80
|
+
y_axis_summary_type = SUMMARY_TYPE.ADVANCED;
|
|
89
81
|
y_axis_column_key = null;
|
|
90
82
|
column_groupby_multiple_numeric_column = false;
|
|
91
83
|
column_groupby_numeric_columns = [];
|
|
92
84
|
column_groupby_date_granularity = null;
|
|
93
85
|
column_groupby_column_key = null;
|
|
94
86
|
column_groupby_geolocation_granularity = null;
|
|
95
|
-
y_axis_summary_method =
|
|
87
|
+
y_axis_summary_method = SUMMARY_METHOD[0];
|
|
96
88
|
} else if (value === GROUP_TYPES.COUNT) {
|
|
97
89
|
column_groupby_multiple_numeric_column = false;
|
|
98
90
|
column_groupby_numeric_columns = [];
|
|
@@ -104,19 +96,19 @@ class GroupingSettings extends _react.Component {
|
|
|
104
96
|
return key !== x_axis_column_key && (type !== 'date' || type !== 'geolocation');
|
|
105
97
|
}) || {};
|
|
106
98
|
column_groupby_column_key = groupColumn.key;
|
|
107
|
-
y_axis_summary_type =
|
|
99
|
+
y_axis_summary_type = SUMMARY_TYPE.COUNT;
|
|
108
100
|
y_axis_column_key = null;
|
|
109
101
|
column_groupby_date_granularity = null;
|
|
110
102
|
column_groupby_geolocation_granularity = null;
|
|
111
103
|
} else if (value === GROUP_TYPES.MULTIPLE_NUMERIC_COLUMN) {
|
|
112
|
-
y_axis_summary_type =
|
|
104
|
+
y_axis_summary_type = SUMMARY_TYPE.ADVANCED;
|
|
113
105
|
column_groupby_multiple_numeric_column = true;
|
|
114
106
|
column_groupby_numeric_columns = [];
|
|
115
|
-
y_axis_summary_type =
|
|
107
|
+
y_axis_summary_type = SUMMARY_TYPE.ADVANCED;
|
|
116
108
|
y_axis_column_key = this.props.numericColumnsOptions.length > 0 ? this.props.numericColumnsOptions[0].value.key : null;
|
|
117
109
|
column_groupby_date_granularity = null;
|
|
118
110
|
column_groupby_geolocation_granularity = null;
|
|
119
|
-
y_axis_summary_method =
|
|
111
|
+
y_axis_summary_method = SUMMARY_METHOD[0];
|
|
120
112
|
}
|
|
121
113
|
let updated = {
|
|
122
114
|
column_groupby_column_key,
|
|
@@ -145,10 +137,10 @@ class GroupingSettings extends _react.Component {
|
|
|
145
137
|
if (column_groupby_multiple_numeric_column) {
|
|
146
138
|
return this.groupTypeOptions.find(item => item.value === GROUP_TYPES.MULTIPLE_NUMERIC_COLUMN);
|
|
147
139
|
}
|
|
148
|
-
if (y_axis_summary_type ===
|
|
140
|
+
if (y_axis_summary_type === SUMMARY_TYPE.COUNT) {
|
|
149
141
|
return this.groupTypeOptions[0];
|
|
150
142
|
}
|
|
151
|
-
if (y_axis_summary_type ===
|
|
143
|
+
if (y_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
152
144
|
return this.groupTypeOptions[1];
|
|
153
145
|
}
|
|
154
146
|
};
|
|
@@ -191,7 +183,7 @@ class GroupingSettings extends _react.Component {
|
|
|
191
183
|
} = statItem;
|
|
192
184
|
if (!column_groupby_numeric_columns || !Array.isArray(column_groupby_numeric_columns)) return null;
|
|
193
185
|
return column_groupby_numeric_columns.map((item, index) => {
|
|
194
|
-
return /*#__PURE__*/
|
|
186
|
+
return /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
195
187
|
statItem: statItem,
|
|
196
188
|
key: "number-column-".concat(index),
|
|
197
189
|
numericColumnsOptions: this.props.numericColumnsOptions,
|
|
@@ -217,12 +209,12 @@ class GroupingSettings extends _react.Component {
|
|
|
217
209
|
column_groupby_numeric_columns = [...column_groupby_numeric_columns];
|
|
218
210
|
column_groupby_numeric_columns.push({
|
|
219
211
|
column_key: newNumericColumnKey,
|
|
220
|
-
summary_method:
|
|
212
|
+
summary_method: SUMMARY_METHOD[0]
|
|
221
213
|
});
|
|
222
214
|
} else {
|
|
223
215
|
column_groupby_numeric_columns = [{
|
|
224
216
|
column_key: newNumericColumnKey,
|
|
225
|
-
summary_method:
|
|
217
|
+
summary_method: SUMMARY_METHOD[0]
|
|
226
218
|
}];
|
|
227
219
|
}
|
|
228
220
|
this.props.updateStatItem(Object.assign({}, this.props.statItem, {
|
|
@@ -308,14 +300,14 @@ class GroupingSettings extends _react.Component {
|
|
|
308
300
|
column_groupby_geolocation_granularity,
|
|
309
301
|
column_groupby_multiple_numeric_column
|
|
310
302
|
} = statItem || {};
|
|
311
|
-
return /*#__PURE__*/
|
|
303
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
312
304
|
className: "statistic-chart-parameter-item"
|
|
313
|
-
}, /*#__PURE__*/
|
|
305
|
+
}, /*#__PURE__*/React.createElement("label", null, label), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
314
306
|
classNamePrefix: "statistic-chart-summary-types",
|
|
315
307
|
value: selectedGroupItem,
|
|
316
308
|
onChange: this.onChangeGroupType,
|
|
317
309
|
options: this.groupTypeOptions
|
|
318
|
-
})), y_axis_summary_type ===
|
|
310
|
+
})), y_axis_summary_type === SUMMARY_TYPE.ADVANCED && (column_groupby_multiple_numeric_column ? /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
319
311
|
statItem: statItem,
|
|
320
312
|
key: "number-column-".concat(0),
|
|
321
313
|
numericColumnsOptions: numericColumnsOptions,
|
|
@@ -327,7 +319,7 @@ class GroupingSettings extends _react.Component {
|
|
|
327
319
|
},
|
|
328
320
|
onChangeColumnOption: this.onChangeGroupbyNumericColumn,
|
|
329
321
|
onChangeSummaryMethod: this.onChangeSummaryMethod
|
|
330
|
-
}) : /*#__PURE__*/
|
|
322
|
+
}) : /*#__PURE__*/React.createElement(SummaryMethodSettings, {
|
|
331
323
|
statItem: statItem,
|
|
332
324
|
numericColumnsOptions: numericColumnsOptions,
|
|
333
325
|
summaryType: y_axis_summary_type,
|
|
@@ -338,29 +330,29 @@ class GroupingSettings extends _react.Component {
|
|
|
338
330
|
onSelectSummaryMethod: this.updateSummaryMethod,
|
|
339
331
|
onSelectNumericColumn: this.updateSummaryColumn,
|
|
340
332
|
updateStatItem: this.props.updateStatItem
|
|
341
|
-
})), column_groupby_multiple_numeric_column && /*#__PURE__*/
|
|
333
|
+
})), column_groupby_multiple_numeric_column && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
342
334
|
className: "statistics-add-number"
|
|
343
|
-
}, this.renderGroupbyNumericColumns()), Array.isArray(numericColumnsOptions) && numericColumnsOptions.length > 0 && /*#__PURE__*/
|
|
335
|
+
}, this.renderGroupbyNumericColumns()), Array.isArray(numericColumnsOptions) && numericColumnsOptions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
344
336
|
className: "statistics-add-number-column",
|
|
345
337
|
onClick: this.onAddNumericColumn
|
|
346
|
-
}, /*#__PURE__*/
|
|
338
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
347
339
|
className: "number-column-item dtable-font dtable-icon-add-table"
|
|
348
|
-
}), /*#__PURE__*/
|
|
340
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
349
341
|
className: "number-column-item add-number-column-description"
|
|
350
|
-
},
|
|
342
|
+
}, intl.get('Add_new_numeric_column')))), (!column_groupby_multiple_numeric_column && y_axis_summary_type === SUMMARY_TYPE.ADVANCED || y_axis_summary_type === SUMMARY_TYPE.COUNT) && /*#__PURE__*/React.createElement(GroupbySettings, {
|
|
351
343
|
selectedTable: selectedTable,
|
|
352
344
|
columnsOptions: columnGroupbyColumnsOptions,
|
|
353
345
|
dateGranularityOptions: dateGranularityOptions,
|
|
354
346
|
geolocationGranularityOptions: geolocationGranularityOptions,
|
|
355
|
-
label:
|
|
347
|
+
label: intl.get('Group_by'),
|
|
356
348
|
groupbyColumnKey: column_groupby_column_key,
|
|
357
349
|
groupbyDateGranularity: column_groupby_date_granularity,
|
|
358
350
|
groupbyGeolocationGranularity: column_groupby_geolocation_granularity,
|
|
359
351
|
getSelectedColumnOption: this.props.getSelectedColumnOption,
|
|
360
|
-
onSelectGroupbyColumn: this.onSelectGroupbyColumn.bind(this,
|
|
361
|
-
onSelectGroupbyDateGranularity: this.onSelectGroupbyDateGranularity.bind(this,
|
|
362
|
-
onSelectGroupbyGeolocationGranularity: this.onSelectGroupbyGeolocationGranularity.bind(this,
|
|
352
|
+
onSelectGroupbyColumn: this.onSelectGroupbyColumn.bind(this, GROUPBY_TYPE.COLUMN),
|
|
353
|
+
onSelectGroupbyDateGranularity: this.onSelectGroupbyDateGranularity.bind(this, GROUPBY_TYPE.COLUMN),
|
|
354
|
+
onSelectGroupbyGeolocationGranularity: this.onSelectGroupbyGeolocationGranularity.bind(this, GROUPBY_TYPE.COLUMN)
|
|
363
355
|
}));
|
|
364
356
|
}
|
|
365
357
|
}
|
|
366
|
-
|
|
358
|
+
export default GroupingSettings;
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _components = require("../../../components");
|
|
12
|
-
var _constants = require("../../../constants");
|
|
13
|
-
class ColorGroupSelector extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import { DTableSelect } from '../../../components';
|
|
4
|
+
import { COLOR_OPTIONS } from '../../../constants';
|
|
5
|
+
class ColorGroupSelector extends Component {
|
|
14
6
|
constructor(props) {
|
|
15
7
|
super(props);
|
|
16
8
|
this.getColorOptions = () => {
|
|
17
|
-
return
|
|
9
|
+
return COLOR_OPTIONS.map(colorOption => {
|
|
18
10
|
return {
|
|
19
11
|
value: colorOption.name,
|
|
20
|
-
label: /*#__PURE__*/
|
|
12
|
+
label: /*#__PURE__*/React.createElement("div", {
|
|
21
13
|
className: "statistic-color-option d-flex"
|
|
22
14
|
}, colorOption.exampleColors.map((color, index) => {
|
|
23
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
24
16
|
className: "statistic-color-block",
|
|
25
17
|
key: index,
|
|
26
18
|
style: {
|
|
@@ -42,9 +34,9 @@ class ColorGroupSelector extends _react.Component {
|
|
|
42
34
|
currentColor
|
|
43
35
|
} = this.props;
|
|
44
36
|
const currentOption = this.colorOptions.filter(item => item.value === currentColor)[0] || this.colorOptions[0];
|
|
45
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
46
38
|
className: "statistic-chart-parameter-item"
|
|
47
|
-
}, /*#__PURE__*/
|
|
39
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Color')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
48
40
|
classNamePrefix: 'chart-color',
|
|
49
41
|
value: currentOption,
|
|
50
42
|
onChange: this.changeColor,
|
|
@@ -52,4 +44,4 @@ class ColorGroupSelector extends _react.Component {
|
|
|
52
44
|
}));
|
|
53
45
|
}
|
|
54
46
|
}
|
|
55
|
-
|
|
47
|
+
export default ColorGroupSelector;
|