dtable-statistic 5.0.34 → 5.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js CHANGED
@@ -57,14 +57,17 @@ class Statistic {
57
57
  const {
58
58
  summary_columns
59
59
  } = item.config || {};
60
- if ((item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.type) === _seaChart.CHART_TYPE.TABLE && summary_columns && (summary_columns === null || summary_columns === void 0 ? void 0 : summary_columns.length) !== 0) {
61
- item.config.summary_columns = item.config.summary_columns.map(item => {
62
- return {
63
- ...item,
64
- column_key: item.key,
65
- summary_method: item.method
66
- };
60
+ if ((item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.type) === _seaChart.CHART_TYPE.TABLE && Array.isArray(summary_columns) && (summary_columns === null || summary_columns === void 0 ? void 0 : summary_columns.length) !== 0) {
61
+ const new_summary_columns = [];
62
+ summary_columns.forEach(item => {
63
+ if (Object.keys(item).length !== 0) {
64
+ new_summary_columns.push({
65
+ column_key: (item === null || item === void 0 ? void 0 : item.column_key) || (item === null || item === void 0 ? void 0 : item.key),
66
+ summary_method: (item === null || item === void 0 ? void 0 : item.summary_method) || (item === null || item === void 0 ? void 0 : item.method)
67
+ });
68
+ }
67
69
  });
70
+ item.config.summary_columns = [...new_summary_columns];
68
71
  }
69
72
  if ((item === null || item === void 0 ? void 0 : (_item$config2 = item.config) === null || _item$config2 === void 0 ? void 0 : _item$config2.type) === _seaChart.CHART_TYPE.BASIC_NUMBER_CARD) {
70
73
  const {
@@ -52,10 +52,12 @@ const convertByType = statItem => {
52
52
  newStatItem['x_axis_include_empty_cells'] = (statItem === null || statItem === void 0 ? void 0 : statItem.x_axis_include_empty) || false;
53
53
  newStatItem['x_axis_show_label'] = (statItem === null || statItem === void 0 ? void 0 : statItem.show_x_axis_label) || false;
54
54
  newStatItem['y_axis_show_label'] = (statItem === null || statItem === void 0 ? void 0 : statItem.show_y_axis_label) || false;
55
- newStatItem['y_axises'] = statItem === null || statItem === void 0 ? void 0 : statItem.y_axises.map(item => ({
56
- ...item,
57
- type: 'bar_stack'
58
- }));
55
+ if (statItem !== null && statItem !== void 0 && statItem.y_axises) {
56
+ newStatItem['y_axises'] = statItem === null || statItem === void 0 ? void 0 : statItem.y_axises.map(item => ({
57
+ ...item,
58
+ type: 'bar_stack'
59
+ }));
60
+ }
59
61
  }
60
62
  if (type === 'completeness_chart' || type === 'group_completeness_chart') {
61
63
  newStatItem['type'] = typeMapping[type];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.0.34",
3
+ "version": "5.0.36",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",
@@ -18,7 +18,7 @@
18
18
  "react-grid-layout": "^1.2.5",
19
19
  "react-intl-universal": "^2.4.8",
20
20
  "reactstrap": "8.9.0",
21
- "sea-chart": "~0.0.81"
21
+ "sea-chart": "~0.0.82"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "dtable-ui-component": "~5.0.*",