sea-chart 0.0.67-alpha.3 → 0.0.67-alpha.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.
@@ -126,23 +126,21 @@ class TwoDimensionTable extends PureComponent {
126
126
  total
127
127
  }, selectedCell);
128
128
  };
129
- this.renderEmptyCell = (summary_columns, cellIdx) => {
130
- if (summary_columns && (summary_columns === null || summary_columns === void 0 ? void 0 : summary_columns.length) !== 0) {
131
- return summary_columns.map(() => {
132
- return /*#__PURE__*/React.createElement("div", {
133
- key: "table-cell-".concat(cellIdx),
134
- className: classnames('pivot-cell', {
135
- 'pivot-empty-cell': true
136
- })
137
- }, /*#__PURE__*/React.createElement("i", null));
138
- });
139
- }
129
+ this.renderSingle = (total, display_empty, cellIdx, isSelectedCell, isSelectedCellTop, isSelectedCellLeft) => {
130
+ const isValidDisplayValue = BaseUtils.isValidValue(total, display_empty);
140
131
  return /*#__PURE__*/React.createElement("div", {
141
132
  key: "table-cell-".concat(cellIdx),
142
133
  className: classnames('pivot-cell', {
143
- 'pivot-empty-cell': true
134
+ 'pivot-empty-cell': !isValidDisplayValue,
135
+ 'selected-pivot-cell': isSelectedCell,
136
+ 'selected-pivot-cell-top': isSelectedCellTop,
137
+ 'selected-pivot-cell-left': isSelectedCellLeft
138
+ })
139
+ }, isValidDisplayValue ? total : /*#__PURE__*/React.createElement("i", null), /*#__PURE__*/React.createElement("span", {
140
+ className: classnames({
141
+ 'selected-pivot-cell-border': isSelectedCell
144
142
  })
145
- }, /*#__PURE__*/React.createElement("i", null));
143
+ }));
146
144
  };
147
145
  this.renderRows = () => {
148
146
  const {
@@ -156,7 +154,8 @@ class TwoDimensionTable extends PureComponent {
156
154
  const {
157
155
  display_total = true,
158
156
  display_empty,
159
- summary_type
157
+ summary_type,
158
+ column_groupby_multiple_numeric_column
160
159
  } = chart.config;
161
160
  const {
162
161
  pivot_rows,
@@ -244,11 +243,13 @@ class TwoDimensionTable extends PureComponent {
244
243
  }));
245
244
  }
246
245
  return /*#__PURE__*/React.createElement("td", {
247
- className: classnames('pivot-cell'),
246
+ className: classnames('pivot-cell', {
247
+ 'pivot-empty-cell': !total
248
+ }),
248
249
  key: "table-cell-".concat(cellIdx)
249
250
  }, /*#__PURE__*/React.createElement("div", {
250
- className: "pivot-cells-container"
251
- }, total && total.map && total.map((summaryCell, idx) => {
251
+ className: classnames('pivot-cells-container')
252
+ }, column_groupby_multiple_numeric_column && (total && total.map && total.map((summaryCell, idx) => {
252
253
  const summaryCellColumnKey = summaryCell[2];
253
254
  const summaryCellColumn = summary_columns.find(item => item.key === summaryCellColumnKey);
254
255
  const displayValue = BaseUtils.getSummaryValueDisplayString(summaryCellColumn, summaryCell[1], summaryMethod);
@@ -266,7 +267,14 @@ class TwoDimensionTable extends PureComponent {
266
267
  'selected-pivot-cell-border': isSelectedCell
267
268
  })
268
269
  }));
269
- }), !total && this.renderEmptyCell(summary_columns, cellIdx)));
270
+ }), !total && (summary_columns === null || summary_columns === void 0 ? void 0 : summary_columns.map(() => {
271
+ return /*#__PURE__*/React.createElement("div", {
272
+ key: "table-cell-".concat(cellIdx),
273
+ className: classnames('pivot-cell', {
274
+ 'pivot-empty-cell': true
275
+ })
276
+ }, /*#__PURE__*/React.createElement("i", null));
277
+ }))), !column_groupby_multiple_numeric_column && this.renderSingle(total, display_empty, cellIdx, isSelectedCell, isSelectedCellTop, isSelectedCellLeft)));
270
278
  }), display_total && /*#__PURE__*/React.createElement("td", {
271
279
  className: classnames('pivot-cell', {
272
280
  'pivot-empty-cell': !isValidSummaryDisplayValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "0.0.67-alpha.3",
3
+ "version": "0.0.67-alpha.4",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",