dtable-statistic 4.3.2 → 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.
Files changed (43) hide show
  1. package/es/calculator/workers/basic-chart-calculator-worker.js +1 -1
  2. package/es/components/dialog/chart-addition-widgets/chart-selector.js +2 -2
  3. package/es/components/dialog/new-view-dialog.js +1 -1
  4. package/es/components/dropdown-menu/statistic-dropdown-menu.js +7 -2
  5. package/es/components/dtable-select.js +3 -1
  6. package/es/components/popover/color-rules/rule-filters/filter.js +1 -1
  7. package/es/service/dashboard-service.js +1 -1
  8. package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +1 -1
  9. package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +1 -1
  10. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +3 -3
  11. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +2 -2
  12. package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +10 -1
  13. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +1 -1
  14. package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +1 -1
  15. package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +1 -1
  16. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +6 -6
  17. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +2 -2
  18. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +6 -6
  19. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +1 -1
  20. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +5 -5
  21. package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +1 -1
  22. package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +2 -1
  23. package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +1 -1
  24. package/es/stat-list/chart-preview.js +5 -0
  25. package/es/stat-list/index.js +1 -1
  26. package/es/stat-view/area-chart.js +1 -1
  27. package/es/stat-view/bar-chart.js +3 -3
  28. package/es/stat-view/combination-chart.js +4 -4
  29. package/es/stat-view/compare-chart.js +1 -1
  30. package/es/stat-view/completeness-chart.js +2 -2
  31. package/es/stat-view/heat-map.js +1 -1
  32. package/es/stat-view/horizontal-bar-chart.js +4 -4
  33. package/es/stat-view/line-chart.js +1 -1
  34. package/es/stat-view/map.js +1 -1
  35. package/es/stat-view/pie-chart.js +1 -1
  36. package/es/stat-view/ring-chart.js +2 -2
  37. package/es/stat-view/treemap-chart.js +2 -2
  38. package/es/stat-view/world-map.js +1 -1
  39. package/es/tabs/tab.js +2 -2
  40. package/es/utils/common-utils.js +2 -2
  41. package/es/utils/row-utils.js +1 -1
  42. package/es/utils/stat-utils.js +1 -0
  43. package/package.json +82 -125
@@ -311,7 +311,7 @@ function getGroupbyOneColumnChartResults(rows, formulaRows, groupbyColumn, inclu
311
311
  let formattedResult = {
312
312
  ...result
313
313
  };
314
- if (columnGroupByColumn.type == CellType.SINGLE_SELECT) {
314
+ if (columnGroupByColumn.type === CellType.SINGLE_SELECT) {
315
315
  formattedResult.color = getColorFromSingleSelectColumn(columnGroupByColumn, groupName);
316
316
  }
317
317
  formattedResult.group_name = getFormattedLabel(columnGroupByColumn, groupName, value.collaborators);
@@ -127,12 +127,12 @@ class ChartSelector extends React.Component {
127
127
  type: STAT_TYPE.MAP,
128
128
  title: '中国地图',
129
129
  image: 'map.png',
130
- hide: lang != 'zh-cn'
130
+ hide: lang !== 'zh-cn'
131
131
  }, {
132
132
  type: STAT_TYPE.MAP_BUBBLE,
133
133
  title: '中国地图(气泡图)',
134
134
  image: 'map-bubble.png',
135
- hide: lang != 'zh-cn'
135
+ hide: lang !== 'zh-cn'
136
136
  }, {
137
137
  type: STAT_TYPE.WORLD_MAP,
138
138
  title: intl.get('World_map'),
@@ -31,7 +31,7 @@ class NewViewDialog extends React.Component {
31
31
  this.props.onNewViewCancel();
32
32
  };
33
33
  this.handleKeyDown = e => {
34
- if (e.key == 'Enter') {
34
+ if (e.key === 'Enter') {
35
35
  e.preventDefault();
36
36
  this.handleSubmit();
37
37
  }
@@ -6,6 +6,10 @@ import Icon from '../icon';
6
6
  class StatisticDropdownMenu extends React.Component {
7
7
  constructor(props) {
8
8
  super(props);
9
+ this.onMouseDown = event => {
10
+ event.preventDefault();
11
+ event.stopPropagation();
12
+ };
9
13
  this.onDropdownToggleClick = e => {
10
14
  if (e.target && this.viewsDropdownToggle && this.viewsDropdownToggle.contains(e.target)) {
11
15
  return;
@@ -53,9 +57,10 @@ class StatisticDropdownMenu extends React.Component {
53
57
  const otherViews = this.props.getOtherStatistics();
54
58
  const hasOtherViews = otherViews && otherViews.length > 0;
55
59
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Dropdown, {
60
+ className: "dtable-dropdown-menu",
56
61
  isOpen: this.state.isItemMenuShow,
57
- toggle: this.onDropdownToggleClick,
58
- className: "dtable-dropdown-menu"
62
+ onMouseDown: this.onMouseDown,
63
+ toggle: this.onDropdownToggleClick
59
64
  }, /*#__PURE__*/React.createElement(DropdownToggle, {
60
65
  tag: "span",
61
66
  "data-toggle": "dropdown",
@@ -41,7 +41,8 @@ class DTableSelect extends React.Component {
41
41
  noOptionsMessage,
42
42
  classNamePrefix,
43
43
  innerRef,
44
- isDisabled
44
+ isDisabled,
45
+ customFilterOption
45
46
  } = this.props;
46
47
  return /*#__PURE__*/React.createElement(Select, {
47
48
  value: value,
@@ -49,6 +50,7 @@ class DTableSelect extends React.Component {
49
50
  ref: innerRef,
50
51
  onChange: onChange,
51
52
  options: options,
53
+ filterOption: customFilterOption,
52
54
  isMulti: isMulti,
53
55
  classNamePrefix: classNamePrefix,
54
56
  styles: MenuSelectStyle,
@@ -91,7 +91,7 @@ class Filter extends React.Component {
91
91
  switch (type) {
92
92
  case INPUT_CMP_TYPE_MAP.NUMBER:
93
93
  {
94
- const number = filter_term || filter_term == 0 ? filter_term : '';
94
+ const number = filter_term || filter_term === 0 ? filter_term : '';
95
95
  return /*#__PURE__*/React.createElement(NumberInput, {
96
96
  value: number,
97
97
  onChange: this.onNumberFilterTermChanged
@@ -299,7 +299,7 @@ class DashBoardService {
299
299
  const targetDashboard = this.getStatisticById(targetBoardId);
300
300
  const draggedDashboardIndex = this.statistics.indexOf(draggedDashboard);
301
301
  let targetDashboardIndex = this.statistics.indexOf(targetDashboard);
302
- targetDashboardIndex += relativePosition == 'before' ? 0 : 1;
302
+ targetDashboardIndex += relativePosition === 'before' ? 0 : 1;
303
303
  let updatedStatistics = [...this.statistics];
304
304
  if (draggedDashboardIndex < targetDashboardIndex) {
305
305
  if (targetDashboardIndex < updatedStatistics.length) {
@@ -66,7 +66,7 @@ class BasicNumberCardSettings extends Component {
66
66
  }));
67
67
  };
68
68
  this.onKeyDown = e => {
69
- if (e.key == 'Enter') {
69
+ if (e.key === 'Enter') {
70
70
  e.preventDefault();
71
71
  e.target.blur();
72
72
  }
@@ -99,7 +99,7 @@ class DashboardChartSettings extends Component {
99
99
  }));
100
100
  };
101
101
  this.onKeyDown = e => {
102
- if (e.key == 'Enter') {
102
+ if (e.key === 'Enter') {
103
103
  e.preventDefault();
104
104
  e.target.blur();
105
105
  }
@@ -84,7 +84,7 @@ class CombinationChartStyle extends Component {
84
84
  statItem
85
85
  } = this.props;
86
86
  const updated = {
87
- [key]: statItem[key] == undefined ? false : !statItem[key]
87
+ [key]: statItem[key] === undefined || statItem[key] === null ? false : !statItem[key]
88
88
  };
89
89
  this.props.updateStatItem(Object.assign({}, statItem, updated));
90
90
  };
@@ -141,7 +141,7 @@ class CombinationChartStyle extends Component {
141
141
  y_axis_min_left,
142
142
  y_axis_max_left
143
143
  } = statItem;
144
- const checked = y_axis_auto_range_left == undefined ? true : y_axis_auto_range_left;
144
+ const checked = y_axis_auto_range_left === undefined || y_axis_auto_range_left === null ? true : y_axis_auto_range_left;
145
145
  return /*#__PURE__*/React.createElement("div", {
146
146
  className: "mt-1"
147
147
  }, /*#__PURE__*/React.createElement(ToggleSetting, {
@@ -166,7 +166,7 @@ class CombinationChartStyle extends Component {
166
166
  y_axis_min_right,
167
167
  y_axis_max_right
168
168
  } = statItem;
169
- const checked = y_axis_auto_range_right == undefined ? true : y_axis_auto_range_right;
169
+ const checked = y_axis_auto_range_right === undefined || y_axis_auto_range_right === null ? true : y_axis_auto_range_right;
170
170
  return /*#__PURE__*/React.createElement("div", {
171
171
  className: "mt-1"
172
172
  }, /*#__PURE__*/React.createElement(ToggleSetting, {
@@ -23,7 +23,7 @@ class HeatMapStyleSettings extends Component {
23
23
  const key = evt.target.name;
24
24
  const value = evt.target.value.trim().replace(/[^0-9]/g, '');
25
25
  const newValue = value ? Number(value) : null;
26
- if (newValue == statItem[key]) {
26
+ if (newValue === statItem[key]) {
27
27
  return;
28
28
  }
29
29
  if (newValue) {
@@ -33,7 +33,7 @@ class HeatMapStyleSettings extends Component {
33
33
  }
34
34
  };
35
35
  this.onKeyDown = e => {
36
- if (e.key == 'Enter') {
36
+ if (e.key === 'Enter') {
37
37
  e.preventDefault();
38
38
  e.target.blur();
39
39
  }
@@ -5,6 +5,12 @@ import { DTableSelect } from '../../../components';
5
5
  class GroupbySettings extends Component {
6
6
  constructor() {
7
7
  super(...arguments);
8
+ this.getCustomFilterOption = (option, input) => {
9
+ var _option$data, _option$data$value;
10
+ const labelValue = (option === null || option === void 0 ? void 0 : (_option$data = option.data) === null || _option$data === void 0 ? void 0 : (_option$data$value = _option$data.value) === null || _option$data$value === void 0 ? void 0 : _option$data$value.name) && option.data.value.name.trim().toLowerCase() || '';
11
+ const inputValue = typeof input === 'string' && input.trim().toLowerCase();
12
+ return labelValue.includes(inputValue);
13
+ };
8
14
  this.renderGroupby = () => {
9
15
  const {
10
16
  columnsOptions,
@@ -13,10 +19,13 @@ class GroupbySettings extends Component {
13
19
  } = this.props;
14
20
  const selectedColumnOption = this.props.getSelectedColumnOption(groupbyColumnKey, columnsOptions);
15
21
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("label", null, label), /*#__PURE__*/React.createElement(DTableSelect, {
22
+ isSearchable: true,
16
23
  placeholder: intl.get('Select_a_column'),
17
24
  value: selectedColumnOption,
18
25
  onChange: this.onSelectGroupbyColumn,
19
- options: columnsOptions
26
+ options: columnsOptions,
27
+ customFilterOption: this.getCustomFilterOption,
28
+ noOptionsMessage: () => intl.get('No_options')
20
29
  }));
21
30
  };
22
31
  this.renderGroupbyDateGranularity = () => {
@@ -131,7 +131,7 @@ class HorizontalGroupBarChartSettings extends Component {
131
131
  onSelectGroupbyGeolocationGranularity: this.onSelectGroupbyGeolocationGranularity.bind(this, GROUPBY_TYPE.COLUMN),
132
132
  updatedColumnGroupbyNumericColumns: this.updatedColumnGroupbyNumericColumns,
133
133
  updateStatItem: this.props.updateStatItem
134
- }), statItem.type == STAT_TYPE.STACKED_HORIZONTAL_BAR && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
134
+ }), statItem.type === STAT_TYPE.STACKED_HORIZONTAL_BAR && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
135
135
  className: "statistic-chart-parameter-divider"
136
136
  }), /*#__PURE__*/React.createElement(DataSort, {
137
137
  statItem: statItem,
@@ -116,7 +116,7 @@ class PieSettings extends Component {
116
116
  summary_method
117
117
  } = statItem || {};
118
118
  if (settingType === 'style') {
119
- if (statItem.type == STAT_TYPE.TREEMAP) {
119
+ if (statItem.type === STAT_TYPE.TREEMAP) {
120
120
  return null;
121
121
  }
122
122
  return /*#__PURE__*/React.createElement(StyleSettings, {
@@ -246,7 +246,7 @@ class PivotSettings extends Component {
246
246
  const {
247
247
  summary_method
248
248
  } = statItem || {};
249
- if (summary_method == SUMMARY_METHOD_MAP.Sum || summary_method === SUMMARY_METHOD_MAP.Mean) {
249
+ if (summary_method === SUMMARY_METHOD_MAP.Sum || summary_method === SUMMARY_METHOD_MAP.Mean) {
250
250
  updated.summary_method = SUMMARY_METHOD_MAP.Min;
251
251
  }
252
252
  }
@@ -20,7 +20,7 @@ class BarChartStyle extends Component {
20
20
  y_axis_auto_range
21
21
  } = statItem || {};
22
22
  const updated = {
23
- y_axis_auto_range: y_axis_auto_range == undefined ? false : !y_axis_auto_range
23
+ y_axis_auto_range: y_axis_auto_range === undefined || y_axis_auto_range === null ? false : !y_axis_auto_range
24
24
  };
25
25
  this.props.updateStatItem(Object.assign({}, statItem, updated));
26
26
  };
@@ -57,7 +57,7 @@ class BarChartStyle extends Component {
57
57
  y_axis_min,
58
58
  y_axis_max
59
59
  } = statItem;
60
- const checked = y_axis_auto_range == undefined ? true : y_axis_auto_range;
60
+ const checked = y_axis_auto_range === undefined || y_axis_auto_range === null ? true : y_axis_auto_range;
61
61
  return /*#__PURE__*/React.createElement("div", {
62
62
  className: "mt-1"
63
63
  }, /*#__PURE__*/React.createElement(ToggleSetting, {
@@ -190,7 +190,7 @@ class BarChartStyle extends Component {
190
190
  const {
191
191
  type: columnType
192
192
  } = groupByColumn;
193
- if (columnType == CellType.SINGLE_SELECT) {
193
+ if (columnType === CellType.SINGLE_SELECT) {
194
194
  return true;
195
195
  }
196
196
  return false;
@@ -247,7 +247,7 @@ class BarChartStyle extends Component {
247
247
  isChecked: show_y_axis_label || false,
248
248
  handleToggleChange: this.onToggleYAxisLabel,
249
249
  label: intl.get('Display_title')
250
- }), show_y_axis_label && (this.props.enableYAxisCustomTitle || chartType == STAT_TYPE.BAR_STACK) && /*#__PURE__*/React.createElement(CustomTitleSetting, {
250
+ }), show_y_axis_label && (this.props.enableYAxisCustomTitle || chartType === STAT_TYPE.BAR_STACK) && /*#__PURE__*/React.createElement(CustomTitleSetting, {
251
251
  titleName: title_name || '',
252
252
  updateTitleName: this.updateTitleName
253
253
  }), show_y_axis_label && /*#__PURE__*/React.createElement(AxisLabelPosition, {
@@ -266,7 +266,7 @@ class BarChartStyle extends Component {
266
266
  className: "statistic-chart-parameter-item"
267
267
  }, /*#__PURE__*/React.createElement(IndToggleSetting, {
268
268
  isChecked: display_data || false,
269
- label: statItem.type == STAT_TYPE.BAR_STACK ? intl.get('Display_stack_total_value') : intl.get('Display_data'),
269
+ label: statItem.type === STAT_TYPE.BAR_STACK ? intl.get('Display_stack_total_value') : intl.get('Display_data'),
270
270
  handleToggleChange: this.onToggleDisplayData
271
271
  }), display_data && /*#__PURE__*/React.createElement(LabelFontSizeEditor, {
272
272
  fontSize: label_font_size,
@@ -278,7 +278,7 @@ class BarChartStyle extends Component {
278
278
  chart: statItem,
279
279
  labelColorConfigs: labelColorConfigs,
280
280
  updateChart: this.props.updateStatItem
281
- })), (this.props.isDisplayEachBlockData || chartType == STAT_TYPE.BAR_STACK) && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
281
+ })), (this.props.isDisplayEachBlockData || chartType === STAT_TYPE.BAR_STACK) && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
282
282
  className: "statistic-chart-parameter-divider"
283
283
  }), /*#__PURE__*/React.createElement("div", {
284
284
  className: "statistic-chart-parameter-item"
@@ -35,7 +35,7 @@ class CompletenessStyle extends Component {
35
35
  y_axis_auto_range
36
36
  } = statItem || {};
37
37
  const updated = {
38
- y_axis_auto_range: y_axis_auto_range == undefined ? false : !y_axis_auto_range
38
+ y_axis_auto_range: y_axis_auto_range === undefined || y_axis_auto_range === null ? false : !y_axis_auto_range
39
39
  };
40
40
  this.props.updateStatItem(Object.assign({}, statItem, updated));
41
41
  };
@@ -75,7 +75,7 @@ class CompletenessStyle extends Component {
75
75
  y_axis_min,
76
76
  y_axis_max
77
77
  } = statItem;
78
- const checked = y_axis_auto_range == undefined ? true : y_axis_auto_range;
78
+ const checked = y_axis_auto_range === undefined || y_axis_auto_range === null ? true : y_axis_auto_range;
79
79
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
80
80
  className: "statistic-chart-parameter-item"
81
81
  }, /*#__PURE__*/React.createElement(IndToggleSetting, {
@@ -122,7 +122,7 @@ class HorizontalBarChartStyle extends Component {
122
122
  h_axis_auto_range
123
123
  } = statItem || {};
124
124
  const updated = {
125
- h_axis_auto_range: h_axis_auto_range == undefined ? false : !h_axis_auto_range
125
+ h_axis_auto_range: h_axis_auto_range === undefined || h_axis_auto_range === null ? false : !h_axis_auto_range
126
126
  };
127
127
  this.props.updateStatItem(Object.assign({}, statItem, updated));
128
128
  };
@@ -166,7 +166,7 @@ class HorizontalBarChartStyle extends Component {
166
166
  table_id,
167
167
  column_groupby_column_key
168
168
  } = statItem;
169
- if (type == STAT_TYPE.HORIZONTAL_GROUP_BAR || type == STAT_TYPE.STACKED_HORIZONTAL_BAR) {
169
+ if (type === STAT_TYPE.HORIZONTAL_GROUP_BAR || type === STAT_TYPE.STACKED_HORIZONTAL_BAR) {
170
170
  if (!column_groupby_column_key) {
171
171
  return false;
172
172
  }
@@ -175,7 +175,7 @@ class HorizontalBarChartStyle extends Component {
175
175
  const {
176
176
  type: columnType
177
177
  } = groupByColumn;
178
- if (columnType == CellType.SINGLE_SELECT) {
178
+ if (columnType === CellType.SINGLE_SELECT) {
179
179
  return true;
180
180
  }
181
181
  return false;
@@ -191,7 +191,7 @@ class HorizontalBarChartStyle extends Component {
191
191
  h_axis_min,
192
192
  h_axis_max
193
193
  } = statItem;
194
- const checked = h_axis_auto_range == undefined ? true : h_axis_auto_range;
194
+ const checked = h_axis_auto_range === undefined || h_axis_auto_range === null ? true : h_axis_auto_range;
195
195
  return /*#__PURE__*/React.createElement("div", {
196
196
  className: "mt-1"
197
197
  }, /*#__PURE__*/React.createElement(ToggleSetting, {
@@ -225,7 +225,7 @@ class HorizontalBarChartStyle extends Component {
225
225
  isChecked: show_vertical_axis_label || false,
226
226
  handleToggleChange: this.onToggleVerticalAxisLabel,
227
227
  label: intl.get('Display_title')
228
- }), show_vertical_axis_label && chartType == STAT_TYPE.STACKED_HORIZONTAL_BAR && /*#__PURE__*/React.createElement(CustomTitleSetting, {
228
+ }), show_vertical_axis_label && chartType === STAT_TYPE.STACKED_HORIZONTAL_BAR && /*#__PURE__*/React.createElement(CustomTitleSetting, {
229
229
  titleName: title_name,
230
230
  updateTitleName: this.updateTitleName
231
231
  }), show_vertical_axis_label && /*#__PURE__*/React.createElement(AxisLabelPosition, {
@@ -256,7 +256,7 @@ class HorizontalBarChartStyle extends Component {
256
256
  }, /*#__PURE__*/React.createElement(IndToggleSetting, {
257
257
  isChecked: display_data || false,
258
258
  handleToggleChange: this.onToggleDisplayData,
259
- label: chartType == STAT_TYPE.STACKED_HORIZONTAL_BAR ? intl.get('Display_stack_total_value') : intl.get('Display_data')
259
+ label: chartType === STAT_TYPE.STACKED_HORIZONTAL_BAR ? intl.get('Display_stack_total_value') : intl.get('Display_data')
260
260
  }), display_data && /*#__PURE__*/React.createElement(LabelFontSizeEditor, {
261
261
  className: "mt-3",
262
262
  fontSize: label_font_size,
@@ -15,7 +15,7 @@ class LabelFontSizeEditor extends Component {
15
15
  }
16
16
  };
17
17
  this.onKeyDown = e => {
18
- if (e.key == 'Enter') {
18
+ if (e.key === 'Enter') {
19
19
  e.preventDefault();
20
20
  e.target.blur();
21
21
  }
@@ -136,7 +136,7 @@ class PieStyleSettings extends Component {
136
136
  return options[0]; // the 'percent' option
137
137
  }
138
138
 
139
- return options.filter(option => option.value == label_format)[0] || options[0];
139
+ return options.filter(option => option.value === label_format)[0] || options[0];
140
140
  };
141
141
  this.onSelectLabelFormat = option => {
142
142
  const {
@@ -181,7 +181,7 @@ class PieStyleSettings extends Component {
181
181
  const {
182
182
  label_position
183
183
  } = this.props.statItem;
184
- return options.filter(option => option.value == label_position)[0] || options[0];
184
+ return options.filter(option => option.value === label_position)[0] || options[0];
185
185
  };
186
186
  this.onSelectLabelPosition = option => {
187
187
  const {
@@ -261,7 +261,7 @@ class PieStyleSettings extends Component {
261
261
  const {
262
262
  type: columnType
263
263
  } = groupByColumn;
264
- if (columnType == CellType.SINGLE_SELECT) {
264
+ if (columnType === CellType.SINGLE_SELECT) {
265
265
  return true;
266
266
  }
267
267
  return false;
@@ -292,7 +292,7 @@ class PieStyleSettings extends Component {
292
292
  display_annotation
293
293
  } = statItem;
294
294
  // for stat items created before `display_annotation` was added.
295
- if (display_annotation == undefined) {
295
+ if (display_annotation === undefined || display_annotation === null) {
296
296
  display_annotation = true;
297
297
  }
298
298
  return display_annotation;
@@ -338,7 +338,7 @@ class PieStyleSettings extends Component {
338
338
  } = statItem;
339
339
  return /*#__PURE__*/React.createElement(Fragment, null, this.renderShowLegend(), /*#__PURE__*/React.createElement("div", {
340
340
  className: "statistic-chart-parameter-divider"
341
- }), this.renderDisplayLabel(), (show_percent || display_label) && /*#__PURE__*/React.createElement(Fragment, null, this.renderLabelPositionSelector(), this.renderLabelFormatSelector(), this.renderMinimumPercent(), this.labelFontSizeEditor()), statItem.type == STAT_TYPE.RING && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
341
+ }), this.renderDisplayLabel(), (show_percent || display_label) && /*#__PURE__*/React.createElement(Fragment, null, this.renderLabelPositionSelector(), this.renderLabelFormatSelector(), this.renderMinimumPercent(), this.labelFontSizeEditor()), statItem.type === STAT_TYPE.RING && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
342
342
  className: "statistic-chart-parameter-divider"
343
343
  }), this.renderDisplayAnnotation(), this.getDisplayAnnotation() && this.renderAnnotationFontSizeEditor()), this.displayColorSelector() && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
344
344
  className: "statistic-chart-parameter-divider"
@@ -36,7 +36,7 @@ class SummaryMethodSettings extends Component {
36
36
  let selectedColumnOption = this.props.getSelectedColumnOption(summaryColumnKey, numericColumnsOptions);
37
37
  if (selectedColumnOption && TIME_COLUMN_LIST.includes(selectedColumnOption.value.type)) {
38
38
  summaryMethodOption = summaryMethodOption.filter(option => {
39
- return option.value == DATE_COLUMN_SUMMARY_METHOD[0] || option.value == DATE_COLUMN_SUMMARY_METHOD[1];
39
+ return option.value === DATE_COLUMN_SUMMARY_METHOD[0] || option.value === DATE_COLUMN_SUMMARY_METHOD[1];
40
40
  });
41
41
  }
42
42
  return /*#__PURE__*/React.createElement("div", {
@@ -29,7 +29,8 @@ class GroupingSettings extends Component {
29
29
  } = _ref;
30
30
  if (y_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
31
31
  return GROUP_TYPES.SINGLE_NUMERIC_COLUMN;
32
- } else if (y_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
32
+ }
33
+ if (y_axis_summary_type === SUMMARY_TYPE.ADVANCED) {
33
34
  return GROUP_TYPES.SINGLE_NUMERIC_COLUMN;
34
35
  }
35
36
  return GROUP_TYPES.COUNT;
@@ -33,7 +33,7 @@ class ColorGroupSelector extends Component {
33
33
  const {
34
34
  currentColor
35
35
  } = this.props;
36
- const currentOption = this.colorOptions.filter(item => item.value == currentColor)[0] || this.colorOptions[0];
36
+ const currentOption = this.colorOptions.filter(item => item.value === currentColor)[0] || this.colorOptions[0];
37
37
  return /*#__PURE__*/React.createElement("div", {
38
38
  className: "statistic-chart-parameter-item"
39
39
  }, /*#__PURE__*/React.createElement("label", null, intl.get('Color')), /*#__PURE__*/React.createElement(DTableSelect, {
@@ -7,6 +7,10 @@ import { STAT_TYPE } from '../constants';
7
7
  class ChartPreview extends Component {
8
8
  constructor() {
9
9
  super(...arguments);
10
+ this.onMouseDown = event => {
11
+ event.preventDefault();
12
+ event.stopPropagation();
13
+ };
10
14
  this.onToggleShowEnlarged = event => {
11
15
  if (event) {
12
16
  event.preventDefault();
@@ -107,6 +111,7 @@ class ChartPreview extends Component {
107
111
  className: "statistic-chart-preview-operations"
108
112
  }, /*#__PURE__*/React.createElement("span", {
109
113
  className: "statistic-chart-preview-microscope",
114
+ onMouseDown: this.onMouseDown,
110
115
  onClick: this.onToggleShowEnlarged
111
116
  }, /*#__PURE__*/React.createElement("i", {
112
117
  className: "dtable-font dtable-icon-open"
@@ -14,7 +14,7 @@ class StatList extends Component {
14
14
  this.getStatItemsLayout = statItems => {
15
15
  return Array.isArray(statItems) ? statItems.map(chart => {
16
16
  // eslint-disable-next-line
17
- if (chart.layout.y == null) {
17
+ if (chart.layout.y === null || chart.layout.y === undefined) {
18
18
  return {
19
19
  ...chart.layout,
20
20
  y: Infinity
@@ -250,7 +250,7 @@ class AreaChart extends BaseChart {
250
250
  };
251
251
 
252
252
  // eslint-disable-next-line
253
- if (y_axis_auto_range == undefined || y_axis_auto_range) {
253
+ if (y_axis_auto_range === undefined || y_axis_auto_range === null || y_axis_auto_range) {
254
254
  valueScaleOptions = Object.assign(valueScaleOptions, {
255
255
  nice: true
256
256
  });
@@ -41,7 +41,7 @@ class BarChart extends BaseChart {
41
41
  sort_type
42
42
  } = statItem;
43
43
  let data = originalData;
44
- if (type == STAT_TYPE.BAR_STACK && sort_type) {
44
+ if (type === STAT_TYPE.BAR_STACK && sort_type) {
45
45
  data = sortDataByGroupSum(originalData, sort_type);
46
46
  }
47
47
  this.initChartHandler();
@@ -206,7 +206,7 @@ class BarChart extends BaseChart {
206
206
  }
207
207
  };
208
208
  let displayData = display_data;
209
- if (chartType == STAT_TYPE.BAR_STACK) {
209
+ if (chartType === STAT_TYPE.BAR_STACK) {
210
210
  displayData = display_each_block_data;
211
211
  if (displayData) {
212
212
  labelCfg.position = 'middle';
@@ -286,7 +286,7 @@ class BarChart extends BaseChart {
286
286
  };
287
287
 
288
288
  // eslint-disable-next-line
289
- if (y_axis_auto_range == undefined || y_axis_auto_range) {
289
+ if (y_axis_auto_range === undefined || y_axis_auto_range) {
290
290
  valueScaleOptions = Object.assign(valueScaleOptions, {
291
291
  nice: true
292
292
  });
@@ -291,7 +291,7 @@ class CombinationChart extends BaseChart {
291
291
  fill: themeColors.textColor
292
292
  },
293
293
  formatter: name => {
294
- if (name === '' || name == null) {
294
+ if (name === '' || name === null || name === undefined) {
295
295
  return intl.get(EMPTY_NAME);
296
296
  }
297
297
  return name;
@@ -359,7 +359,7 @@ class CombinationChart extends BaseChart {
359
359
  }).adjust('dodge').tooltip('name*formatted_value_left', (name, value) => {
360
360
  return {
361
361
  value,
362
- title: y_axis_left_summary_type == SUMMARY_TYPE.COUNT ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[y_axis_left_summary_method]),
362
+ title: y_axis_left_summary_type === SUMMARY_TYPE.COUNT ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[y_axis_left_summary_method]),
363
363
  name: !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name
364
364
  };
365
365
  });
@@ -385,7 +385,7 @@ class CombinationChart extends BaseChart {
385
385
  this.chart.line().position('name*value_right').color(currentTheme && currentTheme.colors[1]).size(3).tooltip('name*formatted_value_right', (name, value) => {
386
386
  return {
387
387
  value,
388
- title: y_axis_right_summary_type == SUMMARY_TYPE.COUNT ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[y_axis_right_summary_method]),
388
+ title: y_axis_right_summary_type === SUMMARY_TYPE.COUNT ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[y_axis_right_summary_method]),
389
389
  name: !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name
390
390
  };
391
391
  });
@@ -399,7 +399,7 @@ class CombinationChart extends BaseChart {
399
399
  }).tooltip('name*formatted_value_right', (name, value) => {
400
400
  return {
401
401
  value,
402
- title: y_axis_right_summary_type == SUMMARY_TYPE.COUNT ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[y_axis_right_summary_method]),
402
+ title: y_axis_right_summary_type === SUMMARY_TYPE.COUNT ? intl.get(TITLE_AMOUNT) : intl.get(STATISTICS_COUNT_SHOW[y_axis_right_summary_method]),
403
403
  name: !name && typeof name !== 'number' ? intl.get(EMPTY_NAME) : name
404
404
  };
405
405
  });
@@ -120,7 +120,7 @@ class CompareChart extends BaseChart {
120
120
  };
121
121
 
122
122
  // eslint-disable-next-line
123
- if (y_axis_auto_range == undefined || y_axis_auto_range) {
123
+ if (y_axis_auto_range === undefined || y_axis_auto_range === null || y_axis_auto_range) {
124
124
  valueScaleOptions = Object.assign(valueScaleOptions, {
125
125
  nice: true
126
126
  });
@@ -23,14 +23,14 @@ class CompletenessChart extends BaseChart {
23
23
  this.chart = null;
24
24
  };
25
25
  this.sortData = (data, sortType) => {
26
- const compareCompleteness = sortType == 'ascending' ? function (a, b) {
26
+ const compareCompleteness = sortType === 'ascending' ? function (a, b) {
27
27
  return a - b;
28
28
  } : function (a, b) {
29
29
  return b - a;
30
30
  };
31
31
  const sortBy = (a, b) => {
32
32
  if (a.name === b.name) {
33
- return a.type == 'completed' ? -1 : 1;
33
+ return a.type === 'completed' ? -1 : 1;
34
34
  }
35
35
  const aCompleteness = a.current_value / a.target_value;
36
36
  const bCompleteness = b.current_value / b.target_value;
@@ -75,7 +75,7 @@ class HeatMap extends BaseChart {
75
75
  getTableById,
76
76
  statItem
77
77
  } = this.props;
78
- const currentColorOption = COLOR_OPTIONS.filter(item => item.name == statItem.data_color)[0] || COLOR_OPTIONS[0];
78
+ const currentColorOption = COLOR_OPTIONS.filter(item => item.name === statItem.data_color)[0] || COLOR_OPTIONS[0];
79
79
  const {
80
80
  exampleColors
81
81
  } = currentColorOption;
@@ -39,7 +39,7 @@ class HorizontalBarChart extends BaseChart {
39
39
  } = statItem;
40
40
  this.initChartHandler();
41
41
  let data = originalData;
42
- if (type == STAT_TYPE.STACKED_HORIZONTAL_BAR && sort_type) {
42
+ if (type === STAT_TYPE.STACKED_HORIZONTAL_BAR && sort_type) {
43
43
  let convertedSortType = sort_type;
44
44
  if (sort_type === DATA_SORT_TYPE.ASCENDING) {
45
45
  convertedSortType = DATA_SORT_TYPE.DESCENDING;
@@ -138,7 +138,7 @@ class HorizontalBarChart extends BaseChart {
138
138
  return this.getNumberDisplayString(value, summaryColumnData, horizontal_axis_summary_method);
139
139
  }
140
140
  };
141
- if (h_axis_auto_range == undefined || h_axis_auto_range) {
141
+ if (h_axis_auto_range === undefined || h_axis_auto_range === null || h_axis_auto_range) {
142
142
  valueScaleOptions = Object.assign(valueScaleOptions, {
143
143
  // Automatically adjust the maximum and minimum values
144
144
  nice: true
@@ -243,7 +243,7 @@ class HorizontalBarChart extends BaseChart {
243
243
  }
244
244
  };
245
245
  let displayData = display_data;
246
- if (statItem.type == STAT_TYPE.STACKED_HORIZONTAL_BAR) {
246
+ if (statItem.type === STAT_TYPE.STACKED_HORIZONTAL_BAR) {
247
247
  const {
248
248
  display_each_block_data
249
249
  } = statItem;
@@ -298,7 +298,7 @@ class HorizontalBarChart extends BaseChart {
298
298
  }).adjust([{
299
299
  reverseOrder: true,
300
300
  // for 'stack'. It only work for 'stack'.
301
- type: statItem.type == STAT_TYPE.STACKED_HORIZONTAL_BAR ? 'stack' : 'dodge'
301
+ type: statItem.type === STAT_TYPE.STACKED_HORIZONTAL_BAR ? 'stack' : 'dodge'
302
302
  }]).state({
303
303
  active: {
304
304
  style: {
@@ -136,7 +136,7 @@ class LineChart extends BaseChart {
136
136
  };
137
137
 
138
138
  // eslint-disable-next-line
139
- if (y_axis_auto_range == undefined || y_axis_auto_range) {
139
+ if (y_axis_auto_range === undefined || y_axis_auto_range === null || y_axis_auto_range) {
140
140
  valueScaleOptions = Object.assign(valueScaleOptions, {
141
141
  nice: true
142
142
  });
@@ -89,7 +89,7 @@ class Map extends BaseChart {
89
89
  summary_method,
90
90
  summary_column
91
91
  } = this.props.statItem;
92
- const currentColorOption = COLOR_OPTIONS.filter(item => item.name == data_color)[0] || COLOR_OPTIONS[0];
92
+ const currentColorOption = COLOR_OPTIONS.filter(item => item.name === data_color)[0] || COLOR_OPTIONS[0];
93
93
  const {
94
94
  exampleColors,
95
95
  highlightedBorderColor
@@ -113,7 +113,7 @@ class PieChart extends BaseChart {
113
113
  content: this.getLabel(value, percent)
114
114
  };
115
115
  }, {
116
- offset: !label_position || label_position == LABEL_POSITIONS[0] ? isCreating ? -10 : -2 : undefined,
116
+ offset: !label_position || label_position === LABEL_POSITIONS[0] ? isCreating ? -10 : -2 : undefined,
117
117
  style: {
118
118
  fill: themeColors.labelColor,
119
119
  fontSize: this.getLabelFontSize(),
@@ -146,7 +146,7 @@ class RingChart extends BaseChart {
146
146
  content: this.getLabel(value, percent)
147
147
  };
148
148
  }, {
149
- offset: !label_position || label_position == LABEL_POSITIONS[0] ? isCreating ? -10 : -2 : undefined,
149
+ offset: !label_position || label_position === LABEL_POSITIONS[0] ? isCreating ? -10 : -2 : undefined,
150
150
  style: {
151
151
  fill: themeColors.labelColor,
152
152
  fontSize: this.getLabelFontSize(),
@@ -180,7 +180,7 @@ class RingChart extends BaseChart {
180
180
  itemTpl: '<div class="g2-tooltip-list-item"><span style="background-color:{color};" class="g2-tooltip-marker"></span>{name}: {value}</div>'
181
181
  });
182
182
  this.chart.interaction('element-active');
183
- if (display_annotation == undefined || display_annotation) {
183
+ if (display_annotation === undefined || display_annotation === null || display_annotation) {
184
184
  this.setAnnotation({
185
185
  name: intl.get(TITLE_TOTAL),
186
186
  value: summaryColumn ? this.getNumberDisplayString(this.sum, summaryColumnData, summary_method) : this.sum
@@ -111,7 +111,7 @@ class TreemapChart extends BaseChart {
111
111
  children: newData.map(item => {
112
112
  let name = item.name;
113
113
  item.name = name || name === 0 ? name : intl.get(EMPTY_NAME);
114
- if (name == 'Others') {
114
+ if (name === 'Others') {
115
115
  item.name = intl.get('Others');
116
116
  }
117
117
  return item;
@@ -167,7 +167,7 @@ class TreemapChart extends BaseChart {
167
167
  chart.polygon().position('x*y').color('name', colorSet).tooltip('name*formatted_value*percent', (name, value, percent) => {
168
168
  return {
169
169
  name,
170
- info: summary_type == STATISTICS_COUNT_TYPE.COUNT ? "".concat(value) : "".concat(selectedNumericColumn.name, ": ").concat(value, " (").concat(percent, ")")
170
+ info: summary_type === STATISTICS_COUNT_TYPE.COUNT ? "".concat(value) : "".concat(selectedNumericColumn.name, ": ").concat(value, " (").concat(percent, ")")
171
171
  };
172
172
  }).style({
173
173
  lineWidth: 1,
@@ -75,7 +75,7 @@ class WorldMap extends BaseChart {
75
75
  summary_method,
76
76
  summary_column
77
77
  } = this.props.statItem;
78
- const currentColorOption = COLOR_OPTIONS.filter(item => item.name == data_color)[0] || COLOR_OPTIONS[0];
78
+ const currentColorOption = COLOR_OPTIONS.filter(item => item.name === data_color)[0] || COLOR_OPTIONS[0];
79
79
  const {
80
80
  exampleColors,
81
81
  highlightedBorderColor
package/es/tabs/tab.js CHANGED
@@ -74,7 +74,7 @@ class DashBoardTab extends Component {
74
74
  const {
75
75
  _id
76
76
  } = this.props.item;
77
- if (draggedDashboardId == _id) {
77
+ if (draggedDashboardId === _id) {
78
78
  return;
79
79
  }
80
80
  this.props.onMoveDashboard && this.props.onMoveDashboard(draggedDashboardId, _id, dropRelativePosition);
@@ -114,7 +114,7 @@ class DashBoardTab extends Component {
114
114
  onDragOver: this.onDragOver,
115
115
  onDragLeave: this.onDragLeave,
116
116
  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 ")
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
118
  }, /*#__PURE__*/React.createElement("div", {
119
119
  ref: this.props.setViewItem,
120
120
  onClick: this.props.onSelectDashboard,
@@ -331,8 +331,8 @@ export const getCurrentTheme = colorThemeName => {
331
331
  export const sortDataByGroupSum = (data, sortType) => {
332
332
  const nameSumMap = [];
333
333
  data.forEach(item => {
334
- if (nameSumMap.filter(filteredItem => filteredItem.name == item.name).length == 0) {
335
- const items = data.filter(originItem => originItem.name == item.name);
334
+ if (nameSumMap.filter(filteredItem => filteredItem.name === item.name).length === 0) {
335
+ const items = data.filter(originItem => originItem.name === item.name);
336
336
  const valueSum = items.reduce((accumulator, currentItem) => accumulator + currentItem.value, 0);
337
337
  nameSumMap.push({
338
338
  name: item.name,
@@ -73,7 +73,7 @@ export const getFormattedLabel = (column, name, collaborators) => {
73
73
  collaborators
74
74
  });
75
75
  } else if (columnType === CellType.CHECKBOX) {
76
- return name == 'true' ? 'Checked' : 'Unchecked';
76
+ return name === 'true' ? 'Checked' : 'Unchecked';
77
77
  } else if (FORMULA_COLUMN_TYPES_MAP[columnType]) {
78
78
  const {
79
79
  result_type,
@@ -195,6 +195,7 @@ class StatUtils {
195
195
  }
196
196
  }
197
197
  }
198
+ return 0;
198
199
  });
199
200
  }
200
201
  static sortDataByKey(data, key, sortType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "4.3.2",
3
+ "version": "4.3.4",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",
@@ -28,6 +28,74 @@
28
28
  "peerDependencies": {
29
29
  "@antv/scale": "0.3.14"
30
30
  },
31
+ "devDependencies": {
32
+ "@babel/cli": "7.22.15",
33
+ "@babel/core": "^7.16.0",
34
+ "@babel/plugin-proposal-private-property-in-object": "7.21.11",
35
+ "@babel/plugin-transform-runtime": "7.22.10",
36
+ "@babel/runtime": "7.22.11",
37
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
38
+ "@svgr/webpack": "8.1.0",
39
+ "@testing-library/jest-dom": "5.17.0",
40
+ "@testing-library/react": "^11.1.0",
41
+ "@testing-library/user-event": "13.5.0",
42
+ "autoprefixer": "10.4.5",
43
+ "babel-eslint": "10.0.1",
44
+ "babel-jest": "^27.4.2",
45
+ "babel-loader": "^8.2.3",
46
+ "babel-plugin-import": "^1.13.6",
47
+ "babel-plugin-named-asset-import": "^0.3.8",
48
+ "babel-plugin-on-demand-loading": "^0.0.9",
49
+ "babel-preset-react-app": "^10.0.1",
50
+ "bfj": "^7.0.2",
51
+ "browserslist": "^4.18.1",
52
+ "camelcase": "^6.2.1",
53
+ "case-sensitive-paths-webpack-plugin": "^2.4.0",
54
+ "css-loader": "^6.5.1",
55
+ "css-minimizer-webpack-plugin": "^3.2.0",
56
+ "dotenv": "^10.0.0",
57
+ "dotenv-expand": "^5.1.0",
58
+ "eslint": "^8.3.0",
59
+ "eslint-config-react-app": "^7.0.1",
60
+ "eslint-webpack-plugin": "^3.1.1",
61
+ "file-loader": "^6.2.0",
62
+ "fs-extra": "^10.0.0",
63
+ "html-webpack-plugin": "^5.5.0",
64
+ "identity-obj-proxy": "^3.0.0",
65
+ "jest": "^27.4.3",
66
+ "jest-resolve": "^27.4.2",
67
+ "jest-watch-typeahead": "^1.0.0",
68
+ "less": "^4.2.0",
69
+ "less-loader": "^11.1.3",
70
+ "mini-css-extract-plugin": "^2.4.5",
71
+ "node-polyfill-webpack-plugin": "2.0.1",
72
+ "postcss": "^8.4.31",
73
+ "postcss-flexbugs-fixes": "^5.0.2",
74
+ "postcss-loader": "^6.2.1",
75
+ "postcss-normalize": "^10.0.1",
76
+ "postcss-preset-env": "^7.0.1",
77
+ "prompts": "^2.4.2",
78
+ "react-app-polyfill": "^3.0.0",
79
+ "react-dev-utils": "^12.0.1",
80
+ "react-refresh": "^0.11.0",
81
+ "resolve": "^1.20.0",
82
+ "resolve-url-loader": "^4.0.0",
83
+ "sass-loader": "^12.3.0",
84
+ "semver": "^7.3.5",
85
+ "source-map-loader": "^3.0.0",
86
+ "style-loader": "^3.3.1",
87
+ "svg-sprite-loader": "^6.0.11",
88
+ "svgo-loader": "^3.0.1",
89
+ "tailwindcss": "^3.0.2",
90
+ "terser-webpack-plugin": "^5.2.5",
91
+ "url-loader": "^4.1.1",
92
+ "web-vitals": "^2.1.4",
93
+ "webpack": "^5.64.4",
94
+ "webpack-dev-server": "^4.6.0",
95
+ "webpack-manifest-plugin": "^4.0.2",
96
+ "workbox-webpack-plugin": "^6.4.1",
97
+ "worker-loader": "3.0.8"
98
+ },
31
99
  "scripts": {
32
100
  "clean:esm": "rm -rf es && mkdir es",
33
101
  "clean:lib": "rm -rf lib && mkdir lib",
@@ -47,8 +115,20 @@
47
115
  "index.js",
48
116
  "package.json"
49
117
  ],
118
+ "repository": {
119
+ "type": "git",
120
+ "url": "git+https://github.com/seatable/seatable-plugin-advanced-chart.git"
121
+ },
122
+ "keywords": [
123
+ "statistic",
124
+ "chart",
125
+ "pivot table"
126
+ ],
50
127
  "eslintConfig": {
51
- "extends": "react-app"
128
+ "extends": [
129
+ "react-app",
130
+ "react-app/jest"
131
+ ]
52
132
  },
53
133
  "browserslist": {
54
134
  "production": [
@@ -61,128 +141,5 @@
61
141
  "last 1 firefox version",
62
142
  "last 1 safari version"
63
143
  ]
64
- },
65
- "jest": {
66
- "roots": [
67
- "<rootDir>/src"
68
- ],
69
- "collectCoverageFrom": [
70
- "src/**/*.{js,jsx,ts,tsx}",
71
- "!src/**/*.d.ts"
72
- ],
73
- "setupFiles": [
74
- "react-app-polyfill/jsdom"
75
- ],
76
- "setupFilesAfterEnv": [
77
- "<rootDir>/src/setupTests.js"
78
- ],
79
- "testMatch": [
80
- "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
81
- "<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
82
- ],
83
- "testEnvironment": "jest-environment-jsdom-fourteen",
84
- "transform": {
85
- "^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
86
- "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
87
- "^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
88
- },
89
- "transformIgnorePatterns": [
90
- "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
91
- "^.+\\.module\\.(css|sass|scss)$"
92
- ],
93
- "modulePaths": [],
94
- "moduleNameMapper": {
95
- "^react-native$": "react-native-web",
96
- "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
97
- },
98
- "moduleFileExtensions": [
99
- "web.js",
100
- "js",
101
- "web.ts",
102
- "ts",
103
- "web.tsx",
104
- "tsx",
105
- "json",
106
- "web.jsx",
107
- "jsx",
108
- "node"
109
- ],
110
- "watchPlugins": [
111
- "jest-watch-typeahead/filename",
112
- "jest-watch-typeahead/testname"
113
- ]
114
- },
115
- "devDependencies": {
116
- "@babel/cli": "^7.4.4",
117
- "@babel/core": "7.4.3",
118
- "@babel/plugin-proposal-class-properties": "^7.4.4",
119
- "@babel/plugin-proposal-export-default-from": "^7.5.2",
120
- "@babel/plugin-proposal-export-namespace-from": "^7.5.2",
121
- "@babel/plugin-proposal-object-rest-spread": "^7.5.2",
122
- "@babel/plugin-transform-member-expression-literals": "^7.2.0",
123
- "@babel/plugin-transform-property-literals": "^7.2.0",
124
- "@babel/plugin-transform-runtime": "^7.4.4",
125
- "@babel/preset-env": "^7.4.5",
126
- "@babel/preset-react": "^7.0.0",
127
- "@babel/runtime": "^7.14.0",
128
- "@svgr/webpack": "4.1.0",
129
- "@typescript-eslint/eslint-plugin": "1.6.0",
130
- "@typescript-eslint/parser": "1.6.0",
131
- "babel-eslint": "10.0.1",
132
- "babel-jest": "^24.8.0",
133
- "babel-loader": "8.0.5",
134
- "babel-plugin-named-asset-import": "^0.3.2",
135
- "babel-preset-react-app": "^9.0.0",
136
- "camelcase": "^5.2.0",
137
- "case-sensitive-paths-webpack-plugin": "2.2.0",
138
- "css-loader": "^3.0.0",
139
- "debug": "^4.1.1",
140
- "dotenv": "6.2.0",
141
- "dotenv-expand": "4.2.0",
142
- "eslint": "^5.16.0",
143
- "eslint-config-react-app": "^4.0.1",
144
- "eslint-loader": "2.1.2",
145
- "eslint-plugin-flowtype": "2.50.1",
146
- "eslint-plugin-import": "2.16.0",
147
- "eslint-plugin-jsx-a11y": "6.2.1",
148
- "eslint-plugin-react": "7.12.4",
149
- "eslint-plugin-react-hooks": "^1.5.0",
150
- "file-loader": "^4.0.0",
151
- "fs-extra": "7.0.1",
152
- "html-webpack-plugin": "4.0.0-beta.5",
153
- "identity-obj-proxy": "3.0.0",
154
- "is-wsl": "^1.1.0",
155
- "jest": "24.7.1",
156
- "jest-environment-jsdom-fourteen": "0.1.0",
157
- "jest-resolve": "24.7.1",
158
- "jest-watch-typeahead": "0.3.0",
159
- "less": "^3.10.3",
160
- "less-loader": "^5.0.0",
161
- "mini-css-extract-plugin": "0.5.0",
162
- "optimize-css-assets-webpack-plugin": "5.0.1",
163
- "pnp-webpack-plugin": "1.2.1",
164
- "postcss-flexbugs-fixes": "^4.1.0",
165
- "postcss-loader": "^3.0.0",
166
- "postcss-normalize": "7.0.1",
167
- "postcss-preset-env": "6.6.0",
168
- "postcss-safe-parser": "4.0.1",
169
- "react-app-polyfill": "^3.0.0",
170
- "react-dev-utils": "^9.0.1",
171
- "resolve": "1.10.0",
172
- "sass-loader": "^7.1.0",
173
- "semver": "6.0.0",
174
- "style-loader": "^0.23.1",
175
- "svg-sprite-loader": "^6.0.11",
176
- "svgo-loader": "^3.0.0",
177
- "terser-webpack-plugin": "^1.2.3",
178
- "ts-pnp": "1.1.2",
179
- "url-loader": "^2.0.0",
180
- "webpack": "4.29.6",
181
- "webpack-bundle-analyzer": "^4.7.0",
182
- "webpack-cli": "^3.3.4",
183
- "webpack-dev-server": "3.2.1",
184
- "webpack-manifest-plugin": "2.0.4",
185
- "workbox-webpack-plugin": "4.2.0",
186
- "worker-loader": "^3.0.8"
187
144
  }
188
145
  }