dtable-statistic 4.1.2 → 4.1.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/assets/css/dashboard.css +58 -0
- package/es/assets/icons/move-to.svg +20 -0
- package/es/calculator/map-calculator.js +23 -17
- package/es/calculator/workers/basic-chart-calculator-worker.js +7 -3
- package/es/calculator/world-map-calculator.js +5 -1
- package/es/components/dialog/chart-addition-edit-dialog.js +1 -0
- package/es/components/dialog/enlarged-chart-dialog.js +1 -0
- package/es/components/dropdown-menu/statistic-dropdown-menu.js +79 -3
- package/es/constants/index.js +1 -0
- package/es/constants/map.js +7 -0
- package/es/constants/regions.js +2106 -0
- package/es/dashboard.js +31 -1
- package/es/desktop-dashboard.js +23 -10
- package/es/locale/lang/en.js +2 -1
- package/es/locale/lang/zh_CN.js +2 -1
- package/es/mobile-dashboard.js +3 -1
- package/es/model/generic-model.js +5 -0
- package/es/model/map.js +5 -2
- package/es/service/dashboard-service.js +39 -0
- package/es/service/map-json.js +154 -0
- package/es/stat-editor/index.js +1 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +10 -35
- package/es/stat-editor/stat-settings/map/map-level.js +76 -0
- package/es/stat-editor/stat-settings/map/map-province-city.js +144 -0
- package/es/stat-list/chart-preview.js +8 -1
- package/es/stat-list/index.js +4 -0
- package/es/stat-view/index.js +1 -0
- package/es/stat-view/map.js +69 -42
- package/es/stat-view/world-map.js +13 -16
- package/es/utils/map.js +108 -0
- package/package.json +3 -3
|
@@ -581,3 +581,61 @@
|
|
|
581
581
|
.statistic-chart-container .collaborators-formatter .collaborator {
|
|
582
582
|
margin-right: 0 !important;
|
|
583
583
|
}
|
|
584
|
+
|
|
585
|
+
.btn-move-to-statistic-view {
|
|
586
|
+
display: flex;
|
|
587
|
+
align-items: center;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.statistic-views-dropdown {
|
|
591
|
+
width: 100%;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.statistic-views-dropdown-toggle {
|
|
595
|
+
display: flex;
|
|
596
|
+
align-items: center;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.statistic-views-dropdown .item-text {
|
|
600
|
+
flex: 1;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.statistic-views-dropdown .icon-dropdown-toggle {
|
|
604
|
+
display: inline-flex;
|
|
605
|
+
align-items: center;
|
|
606
|
+
width: 12px;
|
|
607
|
+
height: 12px;
|
|
608
|
+
margin-right: 12px;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.move-to-statistic-views-toggle {
|
|
612
|
+
opacity: 0;
|
|
613
|
+
width: 0;
|
|
614
|
+
min-width: 0;
|
|
615
|
+
margin-left: -12px;
|
|
616
|
+
padding: 0;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.dropdown-item .statistic-views-dropdown .item-icon.dtable-icon-right-slide {
|
|
620
|
+
display: inline-flex;
|
|
621
|
+
font-size: 12px;
|
|
622
|
+
-webkit-transform: scale(.8);
|
|
623
|
+
transform: scale(.8);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.statistic-views-dropdown-menu {
|
|
627
|
+
margin-top: -16px !important;
|
|
628
|
+
margin-left: -12px !important;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.statistic-views-dropdown-menu .dropdown-item {
|
|
632
|
+
display: flex;
|
|
633
|
+
align-items: center;
|
|
634
|
+
min-height: 32px;
|
|
635
|
+
padding: 3px 12px;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.statistic-views-dropdown-menu .statistic-view-name {
|
|
639
|
+
display: inline-block;
|
|
640
|
+
width: 100%;
|
|
641
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#949494;}
|
|
7
|
+
</style>
|
|
8
|
+
<title>move-to</title>
|
|
9
|
+
<g id="move-to-">
|
|
10
|
+
<g id="export" transform="translate(2.000000, 3.000000)">
|
|
11
|
+
<path id="形状结合" fill="currentColor" class="st0" d="M10.7,0c0.4,0,0.8,0.1,1.4,0.4c0.7,0.3,1.1,0.7,1.5,1s0.6,0.7,0.8,1
|
|
12
|
+
c0.2,0.3,0.3,0.5,0.6,0.6c0.2,0.1,0.5,0.2,0.9,0.2h8.5c1,0,1.9,0.3,2.5,0.9C27.5,4.8,28,5.5,28,6.4v16.3c0,1-0.4,1.7-1.1,2.3
|
|
13
|
+
S25.4,26,24.4,26H3.5c-1.1,0-1.8-0.2-2.5-1c-0.7-0.8-1-1.4-1-2.3l0-10.3c0-0.1,0-0.2,0-0.4l0-8.8l0,0c0-1,0.5-1.6,1.1-2.2
|
|
14
|
+
C1.8,0.3,2.4,0,3.1,0H10.7z M17.4,9.6c-0.8-0.8-1.6-0.8-2.4,0l0,0l-0.1,0.1c-0.7,0.8-0.6,1.5,0.1,2.3l0,0l1.1,1.1l-8.4,0
|
|
15
|
+
c-1.1,0-1.7,0.6-1.7,1.7l0,0L6,15c0.1,1,0.6,1.5,1.7,1.5l0,0l8.3,0l-1.1,1.1c-0.8,0.8-0.8,1.6,0,2.4l0,0l0.1,0.1
|
|
16
|
+
c0.8,0.7,1.5,0.6,2.3-0.1l0,0l3.6-3.6c0.1-0.1,0.3-0.2,0.4-0.3l0,0l0.1-0.1c0.6-0.7,0.6-1.4,0.1-2c-0.1-0.1-0.2-0.2-0.3-0.3l0,0
|
|
17
|
+
l-0.1-0.1l0,0l0,0L17.4,9.6z"/>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
</svg>
|
|
@@ -9,6 +9,8 @@ import BaseCalculator from './base-calculator';
|
|
|
9
9
|
import { formatNumericValue, getSummaryColumnMethod } from '../utils/common-utils';
|
|
10
10
|
import { getSqlGroup } from '../utils/sql-utils';
|
|
11
11
|
import { DTABLE_DB_SUMMARY_METHOD } from '../constants';
|
|
12
|
+
import { fixMapGeoGranularity } from '../utils/map';
|
|
13
|
+
import StatUtils from '../utils/stat-utils';
|
|
12
14
|
var MapCalculator = /*#__PURE__*/function (_BaseCalculator) {
|
|
13
15
|
_inherits(MapCalculator, _BaseCalculator);
|
|
14
16
|
var _super = _createSuper(MapCalculator);
|
|
@@ -87,12 +89,12 @@ var MapCalculator = /*#__PURE__*/function (_BaseCalculator) {
|
|
|
87
89
|
key: "queryDb",
|
|
88
90
|
value: function () {
|
|
89
91
|
var _queryDb = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(chart) {
|
|
90
|
-
var table_id, view_id, geo_column, summary_type, summary_method, summary_column,
|
|
92
|
+
var table_id, view_id, geo_column, summary_type, summary_method, summary_column, selectedTable, selectedView, column, columnName, isAdvanced, geoGranularity, method, sqlCondition, groupName, sqlString, summaryColumn, summaryColumnName, summaryColumnMethod, result, data, newResult, _summaryColumnMethod, valueKey;
|
|
91
93
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
92
94
|
while (1) {
|
|
93
95
|
switch (_context2.prev = _context2.next) {
|
|
94
96
|
case 0:
|
|
95
|
-
table_id = chart.table_id, view_id = chart.view_id, geo_column = chart.geo_column, summary_type = chart.summary_type, summary_method = chart.summary_method, summary_column = chart.summary_column
|
|
97
|
+
table_id = chart.table_id, view_id = chart.view_id, geo_column = chart.geo_column, summary_type = chart.summary_type, summary_method = chart.summary_method, summary_column = chart.summary_column;
|
|
96
98
|
selectedTable = this.getTableById(table_id);
|
|
97
99
|
selectedView = this.getViewById(view_id, selectedTable);
|
|
98
100
|
column = TableUtils.getTableColumnByKey(selectedTable, geo_column);
|
|
@@ -104,65 +106,69 @@ var MapCalculator = /*#__PURE__*/function (_BaseCalculator) {
|
|
|
104
106
|
case 6:
|
|
105
107
|
columnName = column.name;
|
|
106
108
|
isAdvanced = summary_type === 'advanced';
|
|
109
|
+
geoGranularity = fixMapGeoGranularity(chart);
|
|
107
110
|
method = isAdvanced ? DTABLE_DB_SUMMARY_METHOD[summary_method] : 'COUNT';
|
|
108
111
|
sqlCondition = filter2SqlCondition(selectedTable, selectedView);
|
|
109
|
-
groupName = getSqlGroup(
|
|
112
|
+
groupName = getSqlGroup(geoGranularity, column);
|
|
110
113
|
sqlString = '';
|
|
111
114
|
summaryColumnName = '';
|
|
112
115
|
if (!isAdvanced) {
|
|
113
|
-
_context2.next =
|
|
116
|
+
_context2.next = 23;
|
|
114
117
|
break;
|
|
115
118
|
}
|
|
116
119
|
summaryColumn = TableUtils.getTableColumnByKey(selectedTable, summary_column);
|
|
117
120
|
if (summaryColumn) {
|
|
118
|
-
_context2.next =
|
|
121
|
+
_context2.next = 18;
|
|
119
122
|
break;
|
|
120
123
|
}
|
|
121
124
|
return _context2.abrupt("return", []);
|
|
122
|
-
case
|
|
125
|
+
case 18:
|
|
123
126
|
summaryColumnName = summaryColumn.name;
|
|
124
127
|
summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
|
|
125
128
|
sqlString = "select ".concat(groupName, ", ").concat(summaryColumnMethod, " from `").concat(selectedTable.name, "` ").concat(sqlCondition, " group by ").concat(groupName, " limit 5000");
|
|
126
|
-
_context2.next =
|
|
129
|
+
_context2.next = 24;
|
|
127
130
|
break;
|
|
128
|
-
case 22:
|
|
129
|
-
sqlString = "select ".concat(groupName, ", ").concat(method, "(`").concat(columnName, "`) from `").concat(selectedTable.name, "` ").concat(sqlCondition, " group by ").concat(groupName, " limit 5000");
|
|
130
131
|
case 23:
|
|
131
|
-
|
|
132
|
+
sqlString = "select ".concat(groupName, ", ").concat(method, "(`").concat(columnName, "`) from `").concat(selectedTable.name, "` ").concat(sqlCondition, " group by ").concat(groupName, " limit 5000");
|
|
133
|
+
case 24:
|
|
134
|
+
_context2.next = 26;
|
|
132
135
|
return this.sqlQuery(sqlString);
|
|
133
|
-
case
|
|
136
|
+
case 26:
|
|
134
137
|
result = _context2.sent;
|
|
135
138
|
if (!(result.status === 200 && result.data.success)) {
|
|
136
|
-
_context2.next =
|
|
139
|
+
_context2.next = 36;
|
|
137
140
|
break;
|
|
138
141
|
}
|
|
139
142
|
data = result.data;
|
|
140
143
|
if (data.results) {
|
|
141
|
-
_context2.next =
|
|
144
|
+
_context2.next = 31;
|
|
142
145
|
break;
|
|
143
146
|
}
|
|
144
147
|
return _context2.abrupt("return", []);
|
|
145
|
-
case
|
|
148
|
+
case 31:
|
|
146
149
|
newResult = [];
|
|
147
150
|
_summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
|
|
148
151
|
valueKey = isAdvanced ? "".concat(_summaryColumnMethod) : "".concat(method, "(").concat(columnName, ")");
|
|
149
152
|
data.results.forEach(function (item) {
|
|
150
153
|
var currentValue = item[groupName];
|
|
151
154
|
var value = item[valueKey];
|
|
155
|
+
var formatted_value = value;
|
|
152
156
|
if (isAdvanced) {
|
|
153
157
|
value = formatNumericValue(value, summaryColumn);
|
|
158
|
+
formatted_value = StatUtils.getFormattedValue(value, summaryColumn, method);
|
|
154
159
|
}
|
|
155
160
|
if (currentValue) {
|
|
156
161
|
newResult.push({
|
|
157
162
|
name: currentValue,
|
|
158
|
-
value: value
|
|
163
|
+
value: value,
|
|
164
|
+
formatted_value: formatted_value
|
|
159
165
|
});
|
|
160
166
|
}
|
|
161
167
|
});
|
|
162
168
|
return _context2.abrupt("return", newResult);
|
|
163
|
-
case 35:
|
|
164
|
-
return _context2.abrupt("return", []);
|
|
165
169
|
case 36:
|
|
170
|
+
return _context2.abrupt("return", []);
|
|
171
|
+
case 37:
|
|
166
172
|
case "end":
|
|
167
173
|
return _context2.stop();
|
|
168
174
|
}
|
|
@@ -6,6 +6,7 @@ import { getColorFromSingleSelectColumn } from '../../utils/column-utils';
|
|
|
6
6
|
import { isArrayCellValue } from '../../utils/common-utils';
|
|
7
7
|
import { getFormattedLabel, isValidRow } from '../../utils/row-utils';
|
|
8
8
|
import StatUtils from '../../utils/stat-utils';
|
|
9
|
+
import { fixMapGeoGranularity } from '../../utils/map';
|
|
9
10
|
var MAP_CHART_TYPES = [STAT_TYPE.MAP, STAT_TYPE.WORLD_MAP, STAT_TYPE.MAP_BUBBLE, STAT_TYPE.WORLD_MAP_BUBBLE];
|
|
10
11
|
function calculateChart(chart, value, username, userId) {
|
|
11
12
|
var type = chart.type;
|
|
@@ -306,14 +307,17 @@ function getGroupbyNumericColumnsChartResults(rows, formulaRows, groupbyColumn,
|
|
|
306
307
|
return getGroupChartStatResult(table, value, groupbyColumn, numericSummaryColumnKey, rows, formulaRows, includeEmpty, groupbyDateGranularity, groupbyGeolocationGranularity, columnGroupbyDateGranularity, columnGroupbyGeolocationGranularity, summaryColumn, summaryType, summaryMethod, columnGroupbyMultipleNumericColumn, yAxisType);
|
|
307
308
|
}
|
|
308
309
|
function calculateGeolocationBasicChart(chart, value, username, userId) {
|
|
309
|
-
var
|
|
310
|
+
var type = chart.type,
|
|
311
|
+
table_id = chart.table_id,
|
|
310
312
|
view_id = chart.view_id,
|
|
311
313
|
geo_column = chart.geo_column,
|
|
312
|
-
geolocation_granularity = chart.geolocation_granularity,
|
|
313
314
|
summary_type = chart.summary_type,
|
|
314
315
|
summary_column = chart.summary_column,
|
|
315
316
|
summary_method = chart.summary_method;
|
|
316
|
-
var geolocationGranularity =
|
|
317
|
+
var geolocationGranularity = null;
|
|
318
|
+
if (type && !type.includes('world')) {
|
|
319
|
+
geolocationGranularity = fixMapGeoGranularity(chart);
|
|
320
|
+
}
|
|
317
321
|
var table = TableUtils.getTableById(value.tables, table_id);
|
|
318
322
|
var view = table && Views.getViewById(table.views, view_id);
|
|
319
323
|
if (!view) {
|
|
@@ -8,6 +8,7 @@ import { filter2SqlCondition, TableUtils } from 'dtable-store';
|
|
|
8
8
|
import BaseCalculator from './base-calculator';
|
|
9
9
|
import { formatNumericValue, getSummaryColumnMethod } from '../utils/common-utils';
|
|
10
10
|
import { DTABLE_DB_SUMMARY_METHOD } from '../constants';
|
|
11
|
+
import StatUtils from '../utils/stat-utils';
|
|
11
12
|
var WorldMapCalculator = /*#__PURE__*/function (_BaseCalculator) {
|
|
12
13
|
_inherits(WorldMapCalculator, _BaseCalculator);
|
|
13
14
|
var _super = _createSuper(WorldMapCalculator);
|
|
@@ -149,14 +150,17 @@ var WorldMapCalculator = /*#__PURE__*/function (_BaseCalculator) {
|
|
|
149
150
|
data.results.forEach(function (item) {
|
|
150
151
|
var currentValue = item[column];
|
|
151
152
|
var value = item[valueKey];
|
|
153
|
+
var formatted_value = value;
|
|
152
154
|
if (isAdvanced) {
|
|
153
155
|
value = formatNumericValue(value, summaryColumn);
|
|
156
|
+
formatted_value = StatUtils.getFormattedValue(value, summaryColumn, summary_method);
|
|
154
157
|
}
|
|
155
158
|
if (currentValue) {
|
|
156
159
|
var name = typeof currentValue === 'string' ? currentValue : currentValue.country_region;
|
|
157
160
|
newResult.push({
|
|
158
161
|
name: name,
|
|
159
|
-
value: value
|
|
162
|
+
value: value,
|
|
163
|
+
formatted_value: formatted_value
|
|
160
164
|
});
|
|
161
165
|
}
|
|
162
166
|
});
|
|
@@ -77,6 +77,7 @@ var ChartAdditionEditDialog = /*#__PURE__*/function (_Component) {
|
|
|
77
77
|
getTables: this.props.getTables,
|
|
78
78
|
getViews: this.props.getViews,
|
|
79
79
|
getTableById: getTableById,
|
|
80
|
+
queryMapJson: this.props.queryMapJson,
|
|
80
81
|
getConvertedChart: this.props.getConvertedChart,
|
|
81
82
|
modifyChartName: this.modifyChartName,
|
|
82
83
|
modifyChart: this.modifyChart,
|
|
@@ -41,6 +41,7 @@ var EnlargeChartDialog = /*#__PURE__*/function (_Component) {
|
|
|
41
41
|
eventBus: eventBus,
|
|
42
42
|
chartCalculator: chartCalculator,
|
|
43
43
|
getTableById: getTableById,
|
|
44
|
+
queryMapJson: _this.props.queryMapJson,
|
|
44
45
|
toggleStatisticRecordsDialog: toggleStatisticRecordsDialog
|
|
45
46
|
};
|
|
46
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -6,6 +6,7 @@ import React, { Fragment } from 'react';
|
|
|
6
6
|
import intl from 'react-intl-universal';
|
|
7
7
|
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
|
8
8
|
import { STAT_TYPE } from '../../constants';
|
|
9
|
+
import Icon from '../icon';
|
|
9
10
|
var StatisticDropdownMenu = /*#__PURE__*/function (_React$Component) {
|
|
10
11
|
_inherits(StatisticDropdownMenu, _React$Component);
|
|
11
12
|
var _super = _createSuper(StatisticDropdownMenu);
|
|
@@ -14,6 +15,9 @@ var StatisticDropdownMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
14
15
|
_classCallCheck(this, StatisticDropdownMenu);
|
|
15
16
|
_this = _super.call(this, props);
|
|
16
17
|
_this.onDropdownToggleClick = function (e) {
|
|
18
|
+
if (e.target && _this.viewsDropdownToggle && _this.viewsDropdownToggle.contains(e.target)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
17
21
|
e.preventDefault();
|
|
18
22
|
e.stopPropagation();
|
|
19
23
|
_this.setState({
|
|
@@ -26,17 +30,39 @@ var StatisticDropdownMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
26
30
|
_this.editStatItem = function () {
|
|
27
31
|
_this.props.editStatItem();
|
|
28
32
|
};
|
|
33
|
+
_this.onShowViewsMenu = function () {
|
|
34
|
+
_this.setState({
|
|
35
|
+
isShowViewsMenu: true
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
_this.onHideViewsMenu = function () {
|
|
39
|
+
_this.setState({
|
|
40
|
+
isShowViewsMenu: false
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
_this.onToggleViewsMenu = function () {
|
|
44
|
+
_this.setState({
|
|
45
|
+
isShowViewsMenu: !_this.state.isShowViewsMenu
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
_this.onMoveChartToView = function (viewId) {
|
|
49
|
+
_this.props.moveChartToView(viewId);
|
|
50
|
+
};
|
|
29
51
|
_this.state = {
|
|
30
|
-
isItemMenuShow: false
|
|
52
|
+
isItemMenuShow: false,
|
|
53
|
+
isShowViewsMenu: false
|
|
31
54
|
};
|
|
32
55
|
return _this;
|
|
33
56
|
}
|
|
34
57
|
_createClass(StatisticDropdownMenu, [{
|
|
35
58
|
key: "render",
|
|
36
59
|
value: function render() {
|
|
60
|
+
var _this2 = this;
|
|
37
61
|
var _this$props = this.props,
|
|
38
62
|
isTableReadOnly = _this$props.isTableReadOnly,
|
|
39
63
|
chartType = _this$props.chartType;
|
|
64
|
+
var otherViews = this.props.getOtherStatistics();
|
|
65
|
+
var hasOtherViews = otherViews && otherViews.length > 0;
|
|
40
66
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
41
67
|
isOpen: this.state.isItemMenuShow,
|
|
42
68
|
toggle: this.onDropdownToggleClick,
|
|
@@ -80,13 +106,63 @@ var StatisticDropdownMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
80
106
|
className: "item-icon dtable-font dtable-icon-download"
|
|
81
107
|
}), /*#__PURE__*/React.createElement("span", {
|
|
82
108
|
className: "item-text"
|
|
83
|
-
}, intl.get('Export_as_picture'))), !isTableReadOnly && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
109
|
+
}, intl.get('Export_as_picture'))), !isTableReadOnly && /*#__PURE__*/React.createElement(Fragment, null, hasOtherViews && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
110
|
+
className: "pr-2 btn-move-to-statistic-view",
|
|
111
|
+
tag: "div",
|
|
112
|
+
onClick: function onClick(evt) {
|
|
113
|
+
evt.stopPropagation();
|
|
114
|
+
evt.nativeEvent.stopImmediatePropagation();
|
|
115
|
+
_this2.onShowViewsMenu();
|
|
116
|
+
},
|
|
117
|
+
onMouseEnter: this.onShowViewsMenu,
|
|
118
|
+
onMouseLeave: this.onHideViewsMenu
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
120
|
+
className: "statistic-views-dropdown",
|
|
121
|
+
direction: "right",
|
|
122
|
+
isOpen: this.state.isShowViewsMenu,
|
|
123
|
+
toggle: this.onToggleViewsMenu
|
|
124
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
125
|
+
className: "statistic-views-dropdown-toggle",
|
|
126
|
+
ref: function ref(_ref) {
|
|
127
|
+
return _this2.viewsDropdownToggle = _ref;
|
|
128
|
+
}
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
130
|
+
symbol: "move-to",
|
|
131
|
+
className: "statistic-type-move-to item-icon"
|
|
132
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
133
|
+
className: "item-text"
|
|
134
|
+
}, intl.get('Move_to')), /*#__PURE__*/React.createElement("span", {
|
|
135
|
+
className: "icon-dropdown-toggle"
|
|
136
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
137
|
+
className: "item-icon dtable-font dtable-icon-right-slide"
|
|
138
|
+
})), /*#__PURE__*/React.createElement(DropdownToggle, {
|
|
139
|
+
className: "move-to-statistic-views-toggle"
|
|
140
|
+
})), this.state.isShowViewsMenu && /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
141
|
+
className: "statistic-views-dropdown-menu",
|
|
142
|
+
flip: false,
|
|
143
|
+
positionFixed: true,
|
|
144
|
+
modifiers: {
|
|
145
|
+
preventOverflow: {
|
|
146
|
+
boundariesElement: document.body
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, otherViews.map(function (view) {
|
|
150
|
+
var _id = view._id,
|
|
151
|
+
name = view.name;
|
|
152
|
+
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
153
|
+
key: "move-to-statistic-view-".concat(_id),
|
|
154
|
+
onClick: _this2.onMoveChartToView.bind(_this2, _id)
|
|
155
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
156
|
+
className: "statistic-view-name text-truncate",
|
|
157
|
+
title: name
|
|
158
|
+
}, name));
|
|
159
|
+
})))), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
84
160
|
onMouseDown: this.deleteStatItem
|
|
85
161
|
}, /*#__PURE__*/React.createElement("i", {
|
|
86
162
|
className: "item-icon dtable-font dtable-icon-delete"
|
|
87
163
|
}), /*#__PURE__*/React.createElement("span", {
|
|
88
164
|
className: "item-text"
|
|
89
|
-
}, intl.get('Delete'))))));
|
|
165
|
+
}, intl.get('Delete')))))));
|
|
90
166
|
}
|
|
91
167
|
}]);
|
|
92
168
|
return StatisticDropdownMenu;
|
package/es/constants/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export var DASHBOARD_ACTION_TYPE = {
|
|
|
15
15
|
MODIFY_DASHBOARD_LAYOUT: 'modify_dashboard_layout',
|
|
16
16
|
ADD_CHART: 'add_chart',
|
|
17
17
|
MODIFY_CHART: 'modify_chart',
|
|
18
|
+
MOVE_CHART_TO_VIEW: 'move_chart_to_view',
|
|
18
19
|
DELETE_CHART: 'delete_chart'
|
|
19
20
|
};
|
|
20
21
|
export var STAT_TYPE = {
|