dtable-statistic 5.3.1-alpha.1 → 5.3.2

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.
@@ -44,13 +44,21 @@ class EnlargeChartDialog extends _react.Component {
44
44
  draggable: false
45
45
  }, /*#__PURE__*/_react.default.createElement(_statView.default, viewProps));
46
46
  };
47
- this.onExportChart = () => {
47
+ this.onExportChart = statItem => {
48
48
  const exportContainerID = 'exported-chart-container';
49
49
  const exportContainer = document.createElement('div');
50
50
  exportContainer.setAttribute('id', exportContainerID);
51
51
 
52
52
  // for charts rendered with `<canvas>`
53
- const originalElement = document.querySelector('.statistic-enlarge-modal .statistic-chart-container > div');
53
+ const {
54
+ type
55
+ } = statItem.config;
56
+ let originalElement;
57
+ if (type === 'table') {
58
+ originalElement = document.querySelector('.statistic-enlarge-modal .statistic-chart-container .sea-chart-table-wrapper');
59
+ } else {
60
+ originalElement = document.querySelector('.statistic-enlarge-modal .statistic-chart-container > div');
61
+ }
54
62
  if (originalElement) {
55
63
  const containerWidth = originalElement.scrollWidth + 15 * 2;
56
64
  const containerHeight = originalElement.scrollHeight + 15 * 2;
@@ -90,7 +98,7 @@ class EnlargeChartDialog extends _react.Component {
90
98
  className: "header-close-list"
91
99
  }, /*#__PURE__*/_react.default.createElement("span", {
92
100
  className: "op-item-icon-wrapper",
93
- onClick: this.onExportChart
101
+ onClick: () => this.onExportChart(statItem)
94
102
  }, /*#__PURE__*/_react.default.createElement("i", {
95
103
  className: "item-icon dtable-font dtable-icon-download"
96
104
  })), /*#__PURE__*/_react.default.createElement("span", {
@@ -32,9 +32,15 @@ class ChartPreview extends _react.Component {
32
32
 
33
33
  // for charts rendered with `<canvas>`
34
34
  const {
35
- _id: id
35
+ _id: id,
36
+ type
36
37
  } = statItem.config;
37
- const originalElement = document.querySelector(`#stat-item-${id} .statistic-chart-container > div`);
38
+ let originalElement;
39
+ if (type === 'table') {
40
+ originalElement = document.querySelector(`#stat-item-${id} .statistic-chart-container .sea-chart-table-wrapper`);
41
+ } else {
42
+ originalElement = document.querySelector(`#stat-item-${id} .statistic-chart-container > div`);
43
+ }
38
44
  if (originalElement) {
39
45
  const containerWidth = originalElement.scrollWidth + 15 * 2;
40
46
  const containerHeight = originalElement.scrollHeight + 15 * 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.3.1-alpha.1",
3
+ "version": "5.3.2",
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": "~1.1.63-alpha.10"
21
+ "sea-chart": "^1.1.64"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "dtable-ui-component": "~5.3.*",