dtable-statistic 4.3.4 → 4.3.5

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.
Files changed (222) hide show
  1. package/es/api/dtable-db-api.js +10 -3
  2. package/es/calculator/base-calculator.js +20 -12
  3. package/es/calculator/basic-chart-calculator.js +72 -65
  4. package/es/calculator/combination-calculator.js +64 -57
  5. package/es/calculator/compare-bar-calculator.js +33 -26
  6. package/es/calculator/completeness-calculator.js +37 -30
  7. package/es/calculator/copy-value.js +7 -1
  8. package/es/calculator/dashboard-calculator.js +20 -13
  9. package/es/calculator/heat-map-calculator.js +25 -18
  10. package/es/calculator/horizontal-bar-calculator.js +15 -8
  11. package/es/calculator/index.js +42 -35
  12. package/es/calculator/map-calculator.js +29 -22
  13. package/es/calculator/mirror-calculator.js +27 -20
  14. package/es/calculator/number-card-calculator.js +17 -10
  15. package/es/calculator/pivot-table-calculator.js +65 -58
  16. package/es/calculator/scatter-calculator.js +21 -14
  17. package/es/calculator/thread-manager.js +7 -1
  18. package/es/calculator/trend-calculator.js +29 -22
  19. package/es/calculator/workers/basic-chart-calculator-worker.js +83 -76
  20. package/es/calculator/workers/calculator.worker.js +33 -30
  21. package/es/calculator/workers/card-calculator-worker.js +19 -13
  22. package/es/calculator/workers/combination-calculator-worker.js +53 -46
  23. package/es/calculator/workers/compare-bar-chart-calculator-worker.js +29 -22
  24. package/es/calculator/workers/completeness-calculator-worker.js +41 -34
  25. package/es/calculator/workers/dashboard-calculator-worker.js +24 -18
  26. package/es/calculator/workers/mirror-calculator-worker.js +29 -22
  27. package/es/calculator/workers/pivot-table-calculator-worker.js +84 -77
  28. package/es/calculator/workers/scatter-calculator-worker.js +27 -20
  29. package/es/calculator/workers/trend-calculator-worker.js +34 -27
  30. package/es/calculator/world-map-calculator.js +24 -17
  31. package/es/components/common-add-tool.js +12 -5
  32. package/es/components/dialog/chart-addition-edit-dialog.js +20 -12
  33. package/es/components/dialog/chart-addition-widgets/chart-selector.js +108 -101
  34. package/es/components/dialog/color-theme-dialog.js +22 -15
  35. package/es/components/dialog/delete-confirmation-dialog.js +18 -11
  36. package/es/components/dialog/enlarged-chart-dialog.js +28 -20
  37. package/es/components/dialog/new-table-dialog.js +23 -16
  38. package/es/components/dialog/new-view-dialog.js +21 -14
  39. package/es/components/dialog/rename-view-dialog.js +22 -14
  40. package/es/components/dialog/statistic-record-dialog/index.js +45 -37
  41. package/es/components/dialog/statistic-types-dialog/index.js +22 -14
  42. package/es/components/dialog/table-select-dialog.js +23 -15
  43. package/es/components/dropdown-menu/statistic-dropdown-menu.js +49 -41
  44. package/es/components/dtable-popover.js +19 -12
  45. package/es/components/dtable-search-input.js +21 -13
  46. package/es/components/dtable-select.js +20 -12
  47. package/es/components/icon.js +11 -4
  48. package/es/components/index.js +76 -11
  49. package/es/components/loading.js +10 -3
  50. package/es/components/modal-portal.js +12 -5
  51. package/es/components/popover/color-rules/color-rule.js +33 -25
  52. package/es/components/popover/color-rules/index.js +14 -6
  53. package/es/components/popover/color-rules/rule-filters/filter.js +34 -27
  54. package/es/components/popover/color-rules/rule-filters/index.js +25 -17
  55. package/es/components/popover/color-rules/rule-filters/number-input.js +17 -9
  56. package/es/components/popover/color-rules-popover.js +32 -24
  57. package/es/components/popover/color-selector-popover.js +17 -10
  58. package/es/components/seatable-radio/index.js +16 -9
  59. package/es/components/select/index.js +9 -2
  60. package/es/components/select/option-group.js +27 -19
  61. package/es/components/select/option.js +14 -6
  62. package/es/components/select/select.js +25 -17
  63. package/es/components/toast/alert.js +31 -24
  64. package/es/components/toast/index.js +10 -3
  65. package/es/components/toast/toast.js +20 -12
  66. package/es/components/toast/toastManager.js +17 -9
  67. package/es/components/toast/toaster.js +14 -6
  68. package/es/constants/color-rules.js +12 -6
  69. package/es/constants/dtable-select-style.js +9 -4
  70. package/es/constants/event-types.js +10 -4
  71. package/es/constants/index.js +96 -67
  72. package/es/constants/key-codes.js +2 -0
  73. package/es/constants/map.js +8 -2
  74. package/es/constants/model.js +26 -20
  75. package/es/constants/regions.js +8 -3
  76. package/es/constants/zIndexes.js +7 -1
  77. package/es/custom-g2.js +236 -208
  78. package/es/dashboard.js +58 -50
  79. package/es/desktop-dashboard.js +55 -47
  80. package/es/index.js +6 -3
  81. package/es/locale/index.js +13 -10
  82. package/es/locale/lang/de.js +7 -1
  83. package/es/locale/lang/en.js +7 -1
  84. package/es/locale/lang/fr.js +7 -1
  85. package/es/locale/lang/zh_CN.js +7 -1
  86. package/es/mobile-dashboard.js +46 -38
  87. package/es/model/bar-group.js +19 -11
  88. package/es/model/bar.js +18 -10
  89. package/es/model/base-model.js +9 -2
  90. package/es/model/basic-number-card.js +16 -8
  91. package/es/model/collaborators.js +9 -2
  92. package/es/model/combination.js +20 -12
  93. package/es/model/compare-bar.js +24 -16
  94. package/es/model/completeness-group.js +16 -8
  95. package/es/model/completeness.js +13 -5
  96. package/es/model/custom-bar.js +14 -6
  97. package/es/model/dashboard.js +14 -6
  98. package/es/model/generic-model.js +141 -133
  99. package/es/model/heat-map.js +19 -11
  100. package/es/model/horizontal-bar-group.js +18 -10
  101. package/es/model/horizontal-bar.js +18 -10
  102. package/es/model/index.js +185 -53
  103. package/es/model/map.js +23 -15
  104. package/es/model/mirror.js +21 -13
  105. package/es/model/pie.js +18 -10
  106. package/es/model/ring.js +19 -11
  107. package/es/model/scatter.js +14 -6
  108. package/es/model/statistic-dashboard.js +9 -2
  109. package/es/model/table.js +18 -10
  110. package/es/model/trend.js +20 -12
  111. package/es/model/world-map.js +21 -13
  112. package/es/service/chart-service.js +14 -7
  113. package/es/service/dashboard-service.js +41 -34
  114. package/es/service/map-json.js +14 -8
  115. package/es/stat-editor/chart-name-editor.js +15 -8
  116. package/es/stat-editor/index.js +24 -16
  117. package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +29 -21
  118. package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +57 -49
  119. package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +31 -23
  120. package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +11 -4
  121. package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +27 -19
  122. package/es/stat-editor/stat-settings/advance-chart-settings/index.js +51 -43
  123. package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +31 -23
  124. package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +31 -23
  125. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +45 -37
  126. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +27 -19
  127. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +34 -26
  128. package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +55 -47
  129. package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +30 -22
  130. package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +26 -18
  131. package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +35 -27
  132. package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +32 -24
  133. package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +41 -33
  134. package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +30 -22
  135. package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +26 -18
  136. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +54 -46
  137. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +31 -23
  138. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +34 -26
  139. package/es/stat-editor/stat-settings/basic-chart-settings/index.js +85 -77
  140. package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +29 -21
  141. package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +81 -73
  142. package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +24 -16
  143. package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +27 -19
  144. package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +26 -18
  145. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +57 -49
  146. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +25 -17
  147. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +55 -47
  148. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +19 -11
  149. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +53 -45
  150. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +17 -9
  151. package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +28 -20
  152. package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +38 -30
  153. package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +58 -50
  154. package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +25 -17
  155. package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +55 -47
  156. package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +19 -11
  157. package/es/stat-editor/stat-settings/color-setting/color-picker.js +19 -12
  158. package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +70 -62
  159. package/es/stat-editor/stat-settings/map/map-level.js +20 -13
  160. package/es/stat-editor/stat-settings/map/map-province-city.js +27 -20
  161. package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +19 -11
  162. package/es/stat-editor/stat-settings/public-setting/base-settings.js +28 -20
  163. package/es/stat-editor/stat-settings/public-setting/calender.js +29 -22
  164. package/es/stat-editor/stat-settings/public-setting/column-settings.js +13 -6
  165. package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +16 -9
  166. package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +21 -13
  167. package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +15 -8
  168. package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +19 -11
  169. package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +35 -27
  170. package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +15 -8
  171. package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +26 -18
  172. package/es/stat-list/chart-preview.js +28 -20
  173. package/es/stat-list/index.js +35 -27
  174. package/es/stat-view/area-chart.js +50 -43
  175. package/es/stat-view/bar-chart.js +54 -47
  176. package/es/stat-view/base-chart.js +32 -24
  177. package/es/stat-view/basic-number-card.js +26 -19
  178. package/es/stat-view/combination-chart.js +56 -49
  179. package/es/stat-view/compare-chart.js +46 -39
  180. package/es/stat-view/completeness-chart.js +35 -28
  181. package/es/stat-view/custom-bar.js +38 -31
  182. package/es/stat-view/dashboard-chart.js +22 -15
  183. package/es/stat-view/heat-map.js +50 -43
  184. package/es/stat-view/horizontal-bar-chart.js +58 -51
  185. package/es/stat-view/index.js +80 -73
  186. package/es/stat-view/line-chart.js +46 -39
  187. package/es/stat-view/map.js +40 -33
  188. package/es/stat-view/mirror.js +28 -21
  189. package/es/stat-view/pie-chart.js +36 -29
  190. package/es/stat-view/pivot-table/index.js +39 -32
  191. package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +39 -31
  192. package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +37 -29
  193. package/es/stat-view/pivot-table/pivot-table-display-name.js +54 -46
  194. package/es/stat-view/pivot-table/two-dimension-table.js +70 -62
  195. package/es/stat-view/ring-chart.js +45 -38
  196. package/es/stat-view/scatter-chart.js +37 -30
  197. package/es/stat-view/treemap-chart.js +44 -37
  198. package/es/stat-view/trend-chart.js +39 -32
  199. package/es/stat-view/world-map.js +40 -33
  200. package/es/tabs/index.js +40 -32
  201. package/es/tabs/tab.js +34 -26
  202. package/es/utils/basic-chart-utils.js +9 -2
  203. package/es/utils/cell-format.js +22 -14
  204. package/es/utils/cell-value.js +14 -7
  205. package/es/utils/collaborator.js +13 -4
  206. package/es/utils/color-utils.js +29 -18
  207. package/es/utils/column-utils.js +29 -18
  208. package/es/utils/column.js +11 -4
  209. package/es/utils/common-utils.js +65 -41
  210. package/es/utils/date-format.js +8 -2
  211. package/es/utils/export-table-utils.js +91 -82
  212. package/es/utils/index.js +100 -11
  213. package/es/utils/map.js +36 -26
  214. package/es/utils/model.js +14 -6
  215. package/es/utils/object.js +15 -6
  216. package/es/utils/pivot-table.js +23 -16
  217. package/es/utils/row-utils.js +33 -23
  218. package/es/utils/search.js +29 -21
  219. package/es/utils/sql-utils.js +75 -65
  220. package/es/utils/stat-utils.js +66 -60
  221. package/es/utils/trend-utils.js +40 -32
  222. package/package.json +3 -3
@@ -1,26 +1,33 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import DataSet from '@antv/data-set';
4
- import intl from 'react-intl-universal';
5
- import { each, pick } from '@antv/util';
6
- import { getEllipsisText } from '@antv/g2/esm/util/text';
7
- import { TableUtils } from 'dtable-store';
8
- import BaseChart from './base-chart';
9
- import { Chart, registerGeometryLabelLayout } from '../custom-g2';
10
- import { formatPieChartData, getCurrentTheme } from '../utils/common-utils';
11
- import { EMPTY_NAME, STATISTICS_COUNT_TYPE } from '../constants';
12
- import chartStyles from '../assets/css/statistic-chart.module.css';
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _dataSet = _interopRequireDefault(require("@antv/data-set"));
11
+ var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
12
+ var _util = require("@antv/util");
13
+ var _text = require("@antv/g2/esm/util/text");
14
+ var _dtableStore = require("dtable-store");
15
+ var _baseChart = _interopRequireDefault(require("./base-chart"));
16
+ var _customG = require("../custom-g2");
17
+ var _commonUtils = require("../utils/common-utils");
18
+ var _constants = require("../constants");
19
+ var _statisticChartModule = _interopRequireDefault(require("../assets/css/statistic-chart.module.css"));
13
20
  const propTypes = {
14
- isPreview: PropTypes.bool,
15
- isEnlarge: PropTypes.bool,
16
- theme: PropTypes.string,
17
- colorThemeName: PropTypes.string,
18
- statItem: PropTypes.object,
19
- chartCalculator: PropTypes.object,
20
- getTableById: PropTypes.func,
21
- toggleStatisticRecordsDialog: PropTypes.func
21
+ isPreview: _propTypes.default.bool,
22
+ isEnlarge: _propTypes.default.bool,
23
+ theme: _propTypes.default.string,
24
+ colorThemeName: _propTypes.default.string,
25
+ statItem: _propTypes.default.object,
26
+ chartCalculator: _propTypes.default.object,
27
+ getTableById: _propTypes.default.func,
28
+ toggleStatisticRecordsDialog: _propTypes.default.func
22
29
  };
23
- class TreemapChart extends BaseChart {
30
+ class TreemapChart extends _baseChart.default {
24
31
  constructor(props) {
25
32
  super(props);
26
33
  this.componentDidMount = async () => {
@@ -83,14 +90,14 @@ class TreemapChart extends BaseChart {
83
90
  summary_column_key
84
91
  } = statItem;
85
92
  const table = getTableById(table_id);
86
- const selectedNumericColumn = TableUtils.getTableColumnByKey(table, summary_column_key);
93
+ const selectedNumericColumn = _dtableStore.TableUtils.getTableColumnByKey(table, summary_column_key);
87
94
  if (isPreview) {
88
- this.chart = new Chart({
95
+ this.chart = new _customG.Chart({
89
96
  container: this.container,
90
97
  autoFit: true
91
98
  });
92
99
  } else {
93
- this.chart = new Chart({
100
+ this.chart = new _customG.Chart({
94
101
  container: this.container,
95
102
  height: 400,
96
103
  width: 700
@@ -99,20 +106,20 @@ class TreemapChart extends BaseChart {
99
106
  this.chart.on('element:click', e => {
100
107
  this.props.toggleStatisticRecordsDialog(e.data.data, statItem);
101
108
  });
102
- const currentTheme = getCurrentTheme(colorThemeName);
103
- const newData = formatPieChartData(data, statItem, table, currentTheme);
109
+ const currentTheme = (0, _commonUtils.getCurrentTheme)(colorThemeName);
110
+ const newData = (0, _commonUtils.formatPieChartData)(data, statItem, table, currentTheme);
104
111
  const colorSet = newData.colorSet;
105
112
  const {
106
113
  DataView
107
- } = DataSet;
114
+ } = _dataSet.default;
108
115
  const dv = new DataView();
109
116
  const fullData = {
110
117
  name: 'root',
111
118
  children: newData.map(item => {
112
119
  let name = item.name;
113
- item.name = name || name === 0 ? name : intl.get(EMPTY_NAME);
120
+ item.name = name || name === 0 ? name : _reactIntlUniversal.default.get(_constants.EMPTY_NAME);
114
121
  if (name === 'Others') {
115
- item.name = intl.get('Others');
122
+ item.name = _reactIntlUniversal.default.get('Others');
116
123
  }
117
124
  return item;
118
125
  })
@@ -167,7 +174,7 @@ class TreemapChart extends BaseChart {
167
174
  chart.polygon().position('x*y').color('name', colorSet).tooltip('name*formatted_value*percent', (name, value, percent) => {
168
175
  return {
169
176
  name,
170
- info: summary_type === STATISTICS_COUNT_TYPE.COUNT ? "".concat(value) : "".concat(selectedNumericColumn.name, ": ").concat(value, " (").concat(percent, ")")
177
+ info: summary_type === _constants.STATISTICS_COUNT_TYPE.COUNT ? "".concat(value) : "".concat(selectedNumericColumn.name, ": ").concat(value, " (").concat(percent, ")")
171
178
  };
172
179
  }).style({
173
180
  lineWidth: 1,
@@ -196,22 +203,22 @@ class TreemapChart extends BaseChart {
196
203
 
197
204
  // customize label layout: show ellipsis for long labels
198
205
  function limitInShape(items, labels, shapes, region) {
199
- each(labels, (label, index) => {
206
+ (0, _util.each)(labels, (label, index) => {
200
207
  const labelBBox = label.getCanvasBBox();
201
208
  const shapeBBox = shapes[index].getBBox();
202
209
  if (labelBBox.minX < shapeBBox.minX || labelBBox.minY < shapeBBox.minY || labelBBox.maxX > shapeBBox.maxX || labelBBox.maxY > shapeBBox.maxY) {
203
210
  const translateX = labelBBox.width - shapeBBox.width + 20;
204
211
  const textShapes = label.findAll(shape => shape.get('type') === 'text');
205
212
  textShapes.forEach(textShape => {
206
- const style = pick(textShape.attr(), ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'fontVariant']);
213
+ const style = (0, _util.pick)(textShape.attr(), ['fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'fontVariant']);
207
214
  const textBox = textShape.getCanvasBBox();
208
- const text = getEllipsisText(textShape.attr('text'), textBox.width - Math.abs(translateX), style);
215
+ const text = (0, _text.getEllipsisText)(textShape.attr('text'), textBox.width - Math.abs(translateX), style);
209
216
  textShape.attr('text', text);
210
217
  });
211
218
  }
212
219
  });
213
220
  }
214
- registerGeometryLabelLayout('custom-limit-in-shape', limitInShape);
221
+ (0, _customG.registerGeometryLabelLayout)('custom-limit-in-shape', limitInShape);
215
222
  }
216
223
  shouldComponentUpdate(nextProps, nextState) {
217
224
  const {
@@ -235,11 +242,11 @@ class TreemapChart extends BaseChart {
235
242
  const {
236
243
  isCalculatingData
237
244
  } = this.state;
238
- return /*#__PURE__*/React.createElement(React.Fragment, null, isCalculatingData && this.renderLoading(), /*#__PURE__*/React.createElement("div", {
245
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isCalculatingData && this.renderLoading(), /*#__PURE__*/_react.default.createElement("div", {
239
246
  ref: ref => this.container = ref,
240
- className: "statistic-chart-container ".concat(chartStyles['statistic-treemap-chart-container'])
247
+ className: "statistic-chart-container ".concat(_statisticChartModule.default['statistic-treemap-chart-container'])
241
248
  }));
242
249
  }
243
250
  }
244
251
  TreemapChart.propTypes = propTypes;
245
- export default TreemapChart;
252
+ var _default = exports.default = TreemapChart;
@@ -1,17 +1,24 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import intl from 'react-intl-universal';
4
- import { TableUtils } from 'dtable-store';
5
- import BaseChart from './base-chart';
6
- import { Chart } from '../custom-g2';
7
- import { DATE_GRANULARITY, EMPTY_NAME, STATISTICS_COUNT_TYPE, SUMMARY_METHOD_MAP } from '../constants';
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
11
+ var _dtableStore = require("dtable-store");
12
+ var _baseChart = _interopRequireDefault(require("./base-chart"));
13
+ var _customG = require("../custom-g2");
14
+ var _constants = require("../constants");
8
15
  const propTypes = {
9
- isPreview: PropTypes.bool,
10
- statItem: PropTypes.object,
11
- chartCalculator: PropTypes.object,
12
- getTableById: PropTypes.func
16
+ isPreview: _propTypes.default.bool,
17
+ statItem: _propTypes.default.object,
18
+ chartCalculator: _propTypes.default.object,
19
+ getTableById: _propTypes.default.func
13
20
  };
14
- class BasicNumericCard extends BaseChart {
21
+ class BasicNumericCard extends _baseChart.default {
15
22
  constructor(props) {
16
23
  super(props);
17
24
  this.componentDidMount = async () => {
@@ -67,12 +74,12 @@ class BasicNumericCard extends BaseChart {
67
74
  statItem
68
75
  } = this.props;
69
76
  if (isPreview) {
70
- this.chart = new Chart({
77
+ this.chart = new _customG.Chart({
71
78
  container: this.container,
72
79
  autoFit: true
73
80
  });
74
81
  } else {
75
- this.chart = new Chart({
82
+ this.chart = new _customG.Chart({
76
83
  container: this.container,
77
84
  autoFit: true,
78
85
  height: 400,
@@ -83,7 +90,7 @@ class BasicNumericCard extends BaseChart {
83
90
  summary_method
84
91
  } = statItem;
85
92
  const latest = data && data.latest;
86
- const content = summary_method === SUMMARY_METHOD_MAP.Distinct_values ? latest : this.formatData(latest);
93
+ const content = summary_method === _constants.SUMMARY_METHOD_MAP.Distinct_values ? latest : this.formatData(latest);
87
94
  const fontSize = this.getFontSize(content);
88
95
  let labelFontSize = fontSize - 32;
89
96
  const themeColors = this.getThemeColors();
@@ -99,15 +106,15 @@ class BasicNumericCard extends BaseChart {
99
106
  getTableById,
100
107
  statItem
101
108
  } = this.props;
102
- if (typeof data !== 'number') return intl.get(EMPTY_NAME);
109
+ if (typeof data !== 'number') return _reactIntlUniversal.default.get(_constants.EMPTY_NAME);
103
110
  const {
104
111
  table_id,
105
112
  summary_type,
106
113
  summary_column
107
114
  } = statItem;
108
- if (summary_type !== STATISTICS_COUNT_TYPE.COUNT) {
115
+ if (summary_type !== _constants.STATISTICS_COUNT_TYPE.COUNT) {
109
116
  const table = getTableById(table_id);
110
- const selectedColumn = TableUtils.getTableColumnByKey(table, summary_column);
117
+ const selectedColumn = _dtableStore.TableUtils.getTableColumnByKey(table, summary_column);
111
118
  return this.getNumberDisplayString(data, selectedColumn.data || {});
112
119
  }
113
120
  let string = data + '';
@@ -167,20 +174,20 @@ class BasicNumericCard extends BaseChart {
167
174
  date_granularity
168
175
  } = statItem;
169
176
  let conjunctions = '';
170
- if (date_granularity === DATE_GRANULARITY.YEAR) {
171
- conjunctions = intl.get('The_year_before_last');
172
- } else if (date_granularity === DATE_GRANULARITY.QUARTER) {
173
- conjunctions = intl.get('The_quarter_before_last');
174
- } else if (date_granularity === DATE_GRANULARITY.MONTH) {
175
- conjunctions = intl.get('The_month_before_last');
176
- } else if (date_granularity === DATE_GRANULARITY.WEEK) {
177
- conjunctions = intl.get('The_week_before_last');
177
+ if (date_granularity === _constants.DATE_GRANULARITY.YEAR) {
178
+ conjunctions = _reactIntlUniversal.default.get('The_year_before_last');
179
+ } else if (date_granularity === _constants.DATE_GRANULARITY.QUARTER) {
180
+ conjunctions = _reactIntlUniversal.default.get('The_quarter_before_last');
181
+ } else if (date_granularity === _constants.DATE_GRANULARITY.MONTH) {
182
+ conjunctions = _reactIntlUniversal.default.get('The_month_before_last');
183
+ } else if (date_granularity === _constants.DATE_GRANULARITY.WEEK) {
184
+ conjunctions = _reactIntlUniversal.default.get('The_week_before_last');
178
185
  } else if (date_granularity === 'days_7') {
179
- conjunctions = intl.get('Previous_7_days');
186
+ conjunctions = _reactIntlUniversal.default.get('Previous_7_days');
180
187
  } else if (date_granularity === 'days_30') {
181
- conjunctions = intl.get('Previous_30_days');
188
+ conjunctions = _reactIntlUniversal.default.get('Previous_30_days');
182
189
  } else {
183
- conjunctions = intl.get('The_day_before_yesterday');
190
+ conjunctions = _reactIntlUniversal.default.get('The_day_before_yesterday');
184
191
  }
185
192
  const {
186
193
  result,
@@ -195,7 +202,7 @@ class BasicNumericCard extends BaseChart {
195
202
  }
196
203
  let resultText = "".concat(Number.parseFloat(result * 100).toFixed(2), "%&#8226;").concat(conjunctions).concat(previous);
197
204
  if (!previous) {
198
- resultText = intl.get('Can_not_compare_with_var', {
205
+ resultText = _reactIntlUniversal.default.get('Can_not_compare_with_var', {
199
206
  var: conjunctions.toLowerCase()
200
207
  });
201
208
  }
@@ -232,11 +239,11 @@ class BasicNumericCard extends BaseChart {
232
239
  const {
233
240
  isCalculatingData
234
241
  } = this.state;
235
- return /*#__PURE__*/React.createElement(React.Fragment, null, isCalculatingData && this.renderLoading(), /*#__PURE__*/React.createElement("div", {
242
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isCalculatingData && this.renderLoading(), /*#__PURE__*/_react.default.createElement("div", {
236
243
  ref: ref => this.container = ref,
237
244
  className: "statistic-chart-container statistic-number-card"
238
245
  }));
239
246
  }
240
247
  }
241
248
  BasicNumericCard.propTypes = propTypes;
242
- export default BasicNumericCard;
249
+ var _default = exports.default = BasicNumericCard;
@@ -1,15 +1,22 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import DataSet from '@antv/data-set/lib/index';
4
- import intl from 'react-intl-universal';
5
- import { TableUtils } from 'dtable-store';
6
- import BaseChart from './base-chart';
7
- import { Chart } from '../custom-g2';
8
- import { COLOR_OPTIONS, DEFAULT_NUMBER_FORMAT_OBJECT, STAT_TYPE, SUMMARY_TYPE, TITLE_AMOUNT } from '../constants';
9
- import { MAP_LEVEL } from '../constants/map';
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _index = _interopRequireDefault(require("@antv/data-set/lib/index"));
11
+ var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
12
+ var _dtableStore = require("dtable-store");
13
+ var _baseChart = _interopRequireDefault(require("./base-chart"));
14
+ var _customG = require("../custom-g2");
15
+ var _constants = require("../constants");
16
+ var _map = require("../constants/map");
10
17
  const WIDTH = 798;
11
18
  const HEIGHT = 394;
12
- class WorldMap extends BaseChart {
19
+ class WorldMap extends _baseChart.default {
13
20
  constructor(props) {
14
21
  super(props);
15
22
  this.rerenderChart = () => {
@@ -46,13 +53,13 @@ class WorldMap extends BaseChart {
46
53
  value: value || 0,
47
54
  formatted_value: item.formatted_value
48
55
  });
49
- if (type === STAT_TYPE.WORLD_MAP_BUBBLE) {
56
+ if (type === _constants.STAT_TYPE.WORLD_MAP_BUBBLE) {
50
57
  sum += item.value;
51
58
  }
52
59
  }
53
60
  }
54
61
  });
55
- if (type === STAT_TYPE.WORLD_MAP_BUBBLE) {
62
+ if (type === _constants.STAT_TYPE.WORLD_MAP_BUBBLE) {
56
63
  statisticNewData.sum = sum;
57
64
  }
58
65
  return statisticNewData;
@@ -75,16 +82,16 @@ class WorldMap extends BaseChart {
75
82
  summary_method,
76
83
  summary_column
77
84
  } = this.props.statItem;
78
- const currentColorOption = COLOR_OPTIONS.filter(item => item.name === data_color)[0] || COLOR_OPTIONS[0];
85
+ const currentColorOption = _constants.COLOR_OPTIONS.filter(item => item.name === data_color)[0] || _constants.COLOR_OPTIONS[0];
79
86
  const {
80
87
  exampleColors,
81
88
  highlightedBorderColor
82
89
  } = currentColorOption;
83
- let summaryColumnData = DEFAULT_NUMBER_FORMAT_OBJECT;
84
- if (summary_type === SUMMARY_TYPE.ADVANCED) {
90
+ let summaryColumnData = _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
91
+ if (summary_type === _constants.SUMMARY_TYPE.ADVANCED) {
85
92
  const table = getTableById(table_id);
86
- const summaryColumn = TableUtils.getTableColumnByKey(table, summary_column) || {};
87
- summaryColumnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
93
+ const summaryColumn = _dtableStore.TableUtils.getTableColumnByKey(table, summary_column) || {};
94
+ summaryColumnData = summaryColumn.data || _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
88
95
  }
89
96
  this.statisticView = this.chart.createView();
90
97
  this.statisticView.data(userDataView.rows);
@@ -149,11 +156,11 @@ class WorldMap extends BaseChart {
149
156
  summary_method,
150
157
  summary_column
151
158
  } = this.props.statItem;
152
- let summaryColumnData = DEFAULT_NUMBER_FORMAT_OBJECT;
153
- if (summary_type === SUMMARY_TYPE.ADVANCED) {
159
+ let summaryColumnData = _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
160
+ if (summary_type === _constants.SUMMARY_TYPE.ADVANCED) {
154
161
  const table = getTableById(table_id);
155
- const summaryColumn = TableUtils.getTableColumnByKey(table, summary_column) || {};
156
- summaryColumnData = summaryColumn.data || DEFAULT_NUMBER_FORMAT_OBJECT;
162
+ const summaryColumn = _dtableStore.TableUtils.getTableColumnByKey(table, summary_column) || {};
163
+ summaryColumnData = summaryColumn.data || _constants.DEFAULT_NUMBER_FORMAT_OBJECT;
157
164
  }
158
165
  this.statisticView = this.chart.createView();
159
166
  this.statisticView.data(userDv.rows);
@@ -262,7 +269,7 @@ class WorldMap extends BaseChart {
262
269
  } = this.getSize();
263
270
  const horizontalPadding = (containerWidth - mapWidth) / 4;
264
271
  const leftPadding = horizontalPadding < 20 ? 20 : horizontalPadding;
265
- this.chart = new Chart({
272
+ this.chart = new _customG.Chart({
266
273
  container: this.container,
267
274
  width: containerWidth,
268
275
  height: containerHeight,
@@ -285,7 +292,7 @@ class WorldMap extends BaseChart {
285
292
  showMarkers: false,
286
293
  shared: true,
287
294
  containerTpl: '<div class="g2-tooltip"><div class="g2-tooltip-list"></div></div>',
288
- itemTpl: "<div class=\"g2-tooltip-content\"><div class=\"tooltip-name\">{name}<div><div class=\"tooltip-item\">".concat(intl.get(TITLE_AMOUNT), " : {value}<div></div>"),
295
+ itemTpl: "<div class=\"g2-tooltip-content\"><div class=\"tooltip-name\">{name}<div><div class=\"tooltip-item\">".concat(_reactIntlUniversal.default.get(_constants.TITLE_AMOUNT), " : {value}<div></div>"),
289
296
  domStyles: {
290
297
  'g2-tooltip': this.getDefaultChartStyleByKey('g2-tooltip'),
291
298
  'tooltip-item': this.getDefaultChartStyleByKey('tooltip-item')
@@ -300,7 +307,7 @@ class WorldMap extends BaseChart {
300
307
  }
301
308
  });
302
309
  this.chart.axis(false);
303
- this.dataSet = new DataSet();
310
+ this.dataSet = new _index.default();
304
311
 
305
312
  // transform map data
306
313
  const mapData = this.dataSet.createView('mapDataModel').source(geolocation, {
@@ -339,7 +346,7 @@ class WorldMap extends BaseChart {
339
346
  chartCalculator
340
347
  } = this.props;
341
348
  this.props.queryMapJson({
342
- map_level: MAP_LEVEL.WORLD
349
+ map_level: _map.MAP_LEVEL.WORLD
343
350
  }, mapJson => {
344
351
  this.setState({
345
352
  isDataLoaded: true
@@ -407,18 +414,18 @@ class WorldMap extends BaseChart {
407
414
  isDataLoaded,
408
415
  isCalculatingData
409
416
  } = this.state;
410
- return /*#__PURE__*/React.createElement(React.Fragment, null, (!isDataLoaded || isCalculatingData) && this.renderLoading(), /*#__PURE__*/React.createElement("div", {
417
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (!isDataLoaded || isCalculatingData) && this.renderLoading(), /*#__PURE__*/_react.default.createElement("div", {
411
418
  ref: ref => this.container = ref,
412
419
  className: "statistic-chart-container map d-flex justify-content-around align-items-center w-100 h-100"
413
420
  }));
414
421
  }
415
422
  }
416
423
  WorldMap.propTypes = {
417
- isPreview: PropTypes.bool,
418
- statItem: PropTypes.object,
419
- chartCalculator: PropTypes.object,
420
- getTableById: PropTypes.func,
421
- queryMapJson: PropTypes.func.isRequired,
422
- toggleStatisticRecordsDialog: PropTypes.func
424
+ isPreview: _propTypes.default.bool,
425
+ statItem: _propTypes.default.object,
426
+ chartCalculator: _propTypes.default.object,
427
+ getTableById: _propTypes.default.func,
428
+ queryMapJson: _propTypes.default.func.isRequired,
429
+ toggleStatisticRecordsDialog: _propTypes.default.func
423
430
  };
424
- export default WorldMap;
431
+ var _default = exports.default = WorldMap;
package/es/tabs/index.js CHANGED
@@ -1,15 +1,23 @@
1
- import React, { Component } from 'react';
2
- import intl from 'react-intl-universal';
3
- import NewViewDialog from '../components/dialog/new-view-dialog';
4
- import RenameViewDialog from '../components/dialog/rename-view-dialog';
5
- import DeleteConfirmationDialog from '../components/dialog/delete-confirmation-dialog';
6
- import Tab from './tab';
7
- import styles from './statistic-tabs.module.css';
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
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 _newViewDialog = _interopRequireDefault(require("../components/dialog/new-view-dialog"));
12
+ var _renameViewDialog = _interopRequireDefault(require("../components/dialog/rename-view-dialog"));
13
+ var _deleteConfirmationDialog = _interopRequireDefault(require("../components/dialog/delete-confirmation-dialog"));
14
+ var _tab = _interopRequireDefault(require("./tab"));
15
+ var _statisticTabsModule = _interopRequireDefault(require("./statistic-tabs.module.css"));
8
16
  const SCROLL_TYPE = {
9
17
  PREV: 'prev',
10
18
  NEXT: 'next'
11
19
  };
12
- class DashboardTabs extends Component {
20
+ class DashboardTabs extends _react.Component {
13
21
  constructor(_props) {
14
22
  super(_props);
15
23
  this.initSelectedViewScroll = props => {
@@ -175,7 +183,7 @@ class DashboardTabs extends Component {
175
183
  }
176
184
  const canDelete = statistics.length > 1;
177
185
  return statistics.map((item, index) => {
178
- return /*#__PURE__*/React.createElement(Tab, {
186
+ return /*#__PURE__*/_react.default.createElement(_tab.default, {
179
187
  key: "statistic-view-".concat(index),
180
188
  item: item,
181
189
  theme: theme,
@@ -224,39 +232,39 @@ class DashboardTabs extends Component {
224
232
  statistics,
225
233
  selectedDashboardIdx
226
234
  } = this.props;
227
- return /*#__PURE__*/React.createElement("div", {
228
- className: styles['tabs-container']
229
- }, /*#__PURE__*/React.createElement("div", {
230
- className: "".concat(styles['views-tabs-scroll'], " d-flex pr-1"),
235
+ return /*#__PURE__*/_react.default.createElement("div", {
236
+ className: _statisticTabsModule.default['tabs-container']
237
+ }, /*#__PURE__*/_react.default.createElement("div", {
238
+ className: "".concat(_statisticTabsModule.default['views-tabs-scroll'], " d-flex pr-1"),
231
239
  ref: ref => this.viewsTabsScroll = ref,
232
240
  onScroll: this.onViewsScroll
233
- }, this.renderTabs()), (canScrollPrev || canScrollNext) && !isMobile && /*#__PURE__*/React.createElement("div", {
234
- className: styles['views-scroll-control']
235
- }, /*#__PURE__*/React.createElement("span", {
236
- className: "".concat(styles['scroll-control-btn'], " ").concat(styles['scroll-prev'], " ").concat(canScrollPrev && styles['scroll-active']),
241
+ }, this.renderTabs()), (canScrollPrev || canScrollNext) && !isMobile && /*#__PURE__*/_react.default.createElement("div", {
242
+ className: _statisticTabsModule.default['views-scroll-control']
243
+ }, /*#__PURE__*/_react.default.createElement("span", {
244
+ className: "".concat(_statisticTabsModule.default['scroll-control-btn'], " ").concat(_statisticTabsModule.default['scroll-prev'], " ").concat(canScrollPrev && _statisticTabsModule.default['scroll-active']),
237
245
  onClick: this.onScrollWithControl.bind(this, SCROLL_TYPE.PREV)
238
- }, /*#__PURE__*/React.createElement("i", {
239
- className: "dtable-font dtable-icon-left-slide ".concat(styles['btn-scroll-icon'])
240
- })), /*#__PURE__*/React.createElement("span", {
241
- className: "".concat(styles['scroll-control-btn'], " ").concat(styles['scroll-next'], " ").concat(canScrollNext && styles['scroll-active']),
246
+ }, /*#__PURE__*/_react.default.createElement("i", {
247
+ className: "dtable-font dtable-icon-left-slide ".concat(_statisticTabsModule.default['btn-scroll-icon'])
248
+ })), /*#__PURE__*/_react.default.createElement("span", {
249
+ className: "".concat(_statisticTabsModule.default['scroll-control-btn'], " ").concat(_statisticTabsModule.default['scroll-next'], " ").concat(canScrollNext && _statisticTabsModule.default['scroll-active']),
242
250
  onClick: this.onScrollWithControl.bind(this, SCROLL_TYPE.NEXT)
243
- }, /*#__PURE__*/React.createElement("i", {
244
- className: "dtable-font dtable-icon-right-slide ".concat(styles['btn-scroll-icon'])
245
- }))), !isMobile && /*#__PURE__*/React.createElement("div", {
246
- className: styles['btn-add-view'],
251
+ }, /*#__PURE__*/_react.default.createElement("i", {
252
+ className: "dtable-font dtable-icon-right-slide ".concat(_statisticTabsModule.default['btn-scroll-icon'])
253
+ }))), !isMobile && /*#__PURE__*/_react.default.createElement("div", {
254
+ className: _statisticTabsModule.default['btn-add-view'],
247
255
  key: 'btn-add-view',
248
256
  onClick: this.onNewViewToggle
249
- }, /*#__PURE__*/React.createElement("i", {
250
- className: "".concat(styles['add-map-view-icon'], " dtable-font dtable-icon-add-table")
251
- })), isShowNewViewDialog && /*#__PURE__*/React.createElement(NewViewDialog, {
257
+ }, /*#__PURE__*/_react.default.createElement("i", {
258
+ className: "".concat(_statisticTabsModule.default['add-map-view-icon'], " dtable-font dtable-icon-add-table")
259
+ })), isShowNewViewDialog && /*#__PURE__*/_react.default.createElement(_newViewDialog.default, {
252
260
  onNewViewConfirm: this.onAddDashboard,
253
261
  onNewViewCancel: this.onNewViewCancel
254
- }), isShowRenameViewDialog && /*#__PURE__*/React.createElement(RenameViewDialog, {
262
+ }), isShowRenameViewDialog && /*#__PURE__*/_react.default.createElement(_renameViewDialog.default, {
255
263
  viewName: statistics[selectedDashboardIdx].name,
256
264
  onRenameDashboard: this.props.renameDashboard,
257
265
  hideRenameViewDialog: this.hideRenameViewDialog
258
- }), isShowDeleteViewDialog && /*#__PURE__*/React.createElement(DeleteConfirmationDialog, {
259
- header: intl.get('Delete_dashboard'),
266
+ }), isShowDeleteViewDialog && /*#__PURE__*/_react.default.createElement(_deleteConfirmationDialog.default, {
267
+ header: _reactIntlUniversal.default.get('Delete_dashboard'),
260
268
  name: statistics[selectedDashboardIdx].name,
261
269
  onToggle: this.onToggleDeleteView,
262
270
  onDelete: this.onDeleteDashBoard
@@ -266,4 +274,4 @@ class DashboardTabs extends Component {
266
274
  DashboardTabs.defaultProps = {
267
275
  isMobile: false
268
276
  };
269
- export default DashboardTabs;
277
+ var _default = exports.default = DashboardTabs;
package/es/tabs/tab.js CHANGED
@@ -1,10 +1,18 @@
1
- import React, { Component } from 'react';
2
- import intl from 'react-intl-universal';
3
- import { ModalPortal } from '../components';
4
- import { isMobile } from '../utils';
5
- import { THEME_NAME_MAP } from '../constants';
6
- import styles from './statistic-tabs.module.css';
7
- class DashBoardTab extends Component {
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
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 _utils = require("../utils");
13
+ var _constants = require("../constants");
14
+ var _statisticTabsModule = _interopRequireDefault(require("./statistic-tabs.module.css"));
15
+ class DashBoardTab extends _react.Component {
8
16
  constructor(props) {
9
17
  super(props);
10
18
  this.onHideViewDropdown = () => {
@@ -106,7 +114,7 @@ class DashBoardTab extends Component {
106
114
  dropdownMenuPosition,
107
115
  dropRelativePosition
108
116
  } = this.state;
109
- return /*#__PURE__*/React.createElement("div", {
117
+ return /*#__PURE__*/_react.default.createElement("div", {
110
118
  ref: ref => this.itemRef = ref,
111
119
  draggable: "true",
112
120
  onDragStart: this.onDragStart,
@@ -114,40 +122,40 @@ class DashBoardTab extends Component {
114
122
  onDragOver: this.onDragOver,
115
123
  onDragLeave: this.onDragLeave,
116
124
  onDrop: this.onDrop,
117
- className: "\n ".concat(styles['dashboard-tab'], "\n ").concat(dropRelativePosition === 'before' ? styles['dashboard-tab-can-drop-before'] : '', "\n ").concat(dropRelativePosition === 'after' ? styles['dashboard-tab-can-drop-after'] : '', "\n ")
118
- }, /*#__PURE__*/React.createElement("div", {
125
+ className: "\n ".concat(_statisticTabsModule.default['dashboard-tab'], "\n ").concat(dropRelativePosition === 'before' ? _statisticTabsModule.default['dashboard-tab-can-drop-before'] : '', "\n ").concat(dropRelativePosition === 'after' ? _statisticTabsModule.default['dashboard-tab-can-drop-after'] : '', "\n ")
126
+ }, /*#__PURE__*/_react.default.createElement("div", {
119
127
  ref: this.props.setViewItem,
120
128
  onClick: this.props.onSelectDashboard,
121
- className: "".concat(styles['dashboard-tab-content'], " ").concat(selected ? isMobile ? styles['tab-item-active-mobile'] : styles['tab-item-active'] : '')
122
- }, /*#__PURE__*/React.createElement("div", {
129
+ className: "".concat(_statisticTabsModule.default['dashboard-tab-content'], " ").concat(selected ? _utils.isMobile ? _statisticTabsModule.default['tab-item-active-mobile'] : _statisticTabsModule.default['tab-item-active'] : '')
130
+ }, /*#__PURE__*/_react.default.createElement("div", {
123
131
  className: "view-name"
124
- }, item.name), selected && !isMobile && /*#__PURE__*/React.createElement("div", {
132
+ }, item.name), selected && !_utils.isMobile && /*#__PURE__*/_react.default.createElement("div", {
125
133
  onClick: this.onDropdownToggle,
126
134
  ref: ref => this.btnViewDropdown = ref,
127
- className: "".concat(styles['btn-view-dropdown'])
128
- }, /*#__PURE__*/React.createElement("i", {
129
- className: "".concat(styles['icon'], " dtable-font dtable-icon-drop-down")
130
- }), isShowViewDropdown && /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement("div", {
131
- className: "".concat(theme === THEME_NAME_MAP.DARK ? 'statistic-tabs-dropdown-dark' : 'statistic-tabs-dropdown-light', " statistic-dropdown-menu dropdown-menu large show"),
135
+ className: "".concat(_statisticTabsModule.default['btn-view-dropdown'])
136
+ }, /*#__PURE__*/_react.default.createElement("i", {
137
+ className: "".concat(_statisticTabsModule.default['icon'], " dtable-font dtable-icon-drop-down")
138
+ }), isShowViewDropdown && /*#__PURE__*/_react.default.createElement(_components.ModalPortal, null, /*#__PURE__*/_react.default.createElement("div", {
139
+ className: "".concat(theme === _constants.THEME_NAME_MAP.DARK ? 'statistic-tabs-dropdown-dark' : 'statistic-tabs-dropdown-light', " statistic-dropdown-menu dropdown-menu large show"),
132
140
  style: {
133
141
  ...dropdownMenuPosition,
134
142
  zIndex: 1500
135
143
  }
136
- }, /*#__PURE__*/React.createElement("button", {
144
+ }, /*#__PURE__*/_react.default.createElement("button", {
137
145
  className: "dropdown-item",
138
146
  onClick: this.props.onToggleRenameView
139
- }, /*#__PURE__*/React.createElement("i", {
147
+ }, /*#__PURE__*/_react.default.createElement("i", {
140
148
  className: "item-icon dtable-font dtable-icon-rename"
141
- }), /*#__PURE__*/React.createElement("span", {
149
+ }), /*#__PURE__*/_react.default.createElement("span", {
142
150
  className: "item-text"
143
- }, intl.get('Rename'))), canDelete && /*#__PURE__*/React.createElement("button", {
151
+ }, _reactIntlUniversal.default.get('Rename'))), canDelete && /*#__PURE__*/_react.default.createElement("button", {
144
152
  className: "dropdown-item",
145
153
  onClick: this.props.onDeleteDashboard
146
- }, /*#__PURE__*/React.createElement("i", {
154
+ }, /*#__PURE__*/_react.default.createElement("i", {
147
155
  className: "item-icon dtable-font dtable-icon-delete"
148
- }), /*#__PURE__*/React.createElement("span", {
156
+ }), /*#__PURE__*/_react.default.createElement("span", {
149
157
  className: "item-text"
150
- }, intl.get('Delete'))))))));
158
+ }, _reactIntlUniversal.default.get('Delete'))))))));
151
159
  }
152
160
  }
153
- export default DashBoardTab;
161
+ var _default = exports.default = DashBoardTab;