@visactor/vtable 1.1.1-alpha.0 → 1.1.1

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 (47) hide show
  1. package/cjs/ListTable.js +7 -6
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.js +40 -19
  4. package/cjs/PivotChart.js.map +1 -1
  5. package/cjs/PivotTable.js +77 -34
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/components/empty-tip/empty-tip.js +1 -5
  8. package/cjs/components/empty-tip/empty-tip.js.map +1 -1
  9. package/cjs/core/BaseTable.js +1 -1
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/dataset/dataset.d.ts +4 -1
  12. package/cjs/dataset/dataset.js +5 -5
  13. package/cjs/dataset/dataset.js.map +1 -1
  14. package/cjs/index.d.ts +1 -1
  15. package/cjs/index.js +2 -2
  16. package/cjs/index.js.map +1 -1
  17. package/cjs/layout/tree-helper.js +1 -0
  18. package/cjs/plugins/themes.js +1 -2
  19. package/cjs/scenegraph/style/frame-border.js +3 -2
  20. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  21. package/cjs/vrender.js +9 -9
  22. package/cjs/vrender.js.map +1 -1
  23. package/dist/vtable.js +184 -51
  24. package/dist/vtable.min.js +2 -2
  25. package/es/ListTable.js +6 -6
  26. package/es/ListTable.js.map +1 -1
  27. package/es/PivotChart.js +40 -19
  28. package/es/PivotChart.js.map +1 -1
  29. package/es/PivotTable.js +77 -34
  30. package/es/PivotTable.js.map +1 -1
  31. package/es/components/empty-tip/empty-tip.js +1 -5
  32. package/es/components/empty-tip/empty-tip.js.map +1 -1
  33. package/es/core/BaseTable.js +1 -1
  34. package/es/core/BaseTable.js.map +1 -1
  35. package/es/dataset/dataset.d.ts +4 -1
  36. package/es/dataset/dataset.js +5 -5
  37. package/es/dataset/dataset.js.map +1 -1
  38. package/es/index.d.ts +1 -1
  39. package/es/index.js +1 -1
  40. package/es/index.js.map +1 -1
  41. package/es/layout/tree-helper.js +2 -1
  42. package/es/plugins/themes.js +1 -2
  43. package/es/scenegraph/style/frame-border.js +3 -2
  44. package/es/scenegraph/style/frame-border.js.map +1 -1
  45. package/es/vrender.js +2 -2
  46. package/es/vrender.js.map +1 -1
  47. package/package.json +3 -3
package/cjs/PivotChart.js CHANGED
@@ -62,8 +62,8 @@ class PivotChart extends BaseTable_1.BaseTable {
62
62
  rowDimensionTree = new tree_helper_1.DimensionTree(null !== (_t = this.dataset.rowHeaderTree) && void 0 !== _t ? _t : [], this.layoutNodeId),
63
63
  this.internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
64
64
  this.refreshHeader(), this.scenegraph.createSceneGraph(), options.title && (this.internalProps.title = new title_1.Title(options.title, this),
65
- this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip ? this.internalProps.emptyTip.resetVisible() : this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
66
- setTimeout((() => {
65
+ this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
66
+ this.internalProps.emptyTip.resetVisible()), setTimeout((() => {
67
67
  this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
68
68
  }), 0);
69
69
  }
@@ -150,8 +150,8 @@ class PivotChart extends BaseTable_1.BaseTable {
150
150
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
151
151
  })), internalProps.releaseList = null), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(),
152
152
  options.title && (this.internalProps.title = new title_1.Title(options.title, this),
153
- this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip ? this.internalProps.emptyTip.resetVisible() : this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
154
- new Promise((resolve => {
153
+ this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
154
+ this.internalProps.emptyTip.resetVisible()), new Promise((resolve => {
155
155
  setTimeout(resolve, 0);
156
156
  }));
157
157
  }
@@ -208,13 +208,20 @@ class PivotChart extends BaseTable_1.BaseTable {
208
208
  return "function" == typeof fieldFormat ? fieldFormat(title, col, row, this) : title;
209
209
  }
210
210
  if (this.dataset) {
211
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
211
+ let indicatorPosition;
212
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
212
213
  var _a;
213
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
214
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
214
+ return colPath.indicatorKey && (indicatorPosition = {
215
+ position: "col",
216
+ index: index
217
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
218
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
215
219
  var _a;
216
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
217
- })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
220
+ return rowPath.indicatorKey && (indicatorPosition = {
221
+ position: "row",
222
+ index: index
223
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
224
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
218
225
  return aggregator.value ? aggregator.value() : void 0;
219
226
  }
220
227
  const {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row), rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col), dataValue = null === (_c = this.records[rowIndex]) || void 0 === _c ? void 0 : _c[colIndex];
@@ -239,13 +246,20 @@ class PivotChart extends BaseTable_1.BaseTable {
239
246
  return "function" == typeof title ? title() : title;
240
247
  }
241
248
  if (this.dataset) {
242
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
249
+ let indicatorPosition;
250
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
243
251
  var _a;
244
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
245
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
252
+ return colPath.indicatorKey && (indicatorPosition = {
253
+ position: "col",
254
+ index: index
255
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
256
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
246
257
  var _a;
247
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
248
- })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
258
+ return rowPath.indicatorKey && (indicatorPosition = {
259
+ position: "row",
260
+ index: index
261
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
262
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
249
263
  return aggregator.value ? aggregator.value() : void 0;
250
264
  }
251
265
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -256,14 +270,21 @@ class PivotChart extends BaseTable_1.BaseTable {
256
270
  }
257
271
  getCellOriginRecord(col, row) {
258
272
  if (!this.internalProps.layoutMap.isHeader(col, row) && this.dataset) {
259
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
273
+ let indicatorPosition;
274
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
260
275
  var _a;
261
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
262
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
276
+ return colPath.indicatorKey && (indicatorPosition = {
277
+ position: "col",
278
+ index: index
279
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
280
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
263
281
  var _a;
264
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
282
+ return rowPath.indicatorKey && (indicatorPosition = {
283
+ position: "row",
284
+ index: index
285
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
265
286
  }));
266
- return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
287
+ return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition).records;
267
288
  }
268
289
  }
269
290
  getCellRawRecord(col, row) {