@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/es/PivotChart.js CHANGED
@@ -86,8 +86,8 @@ export class PivotChart extends BaseTable {
86
86
  rowDimensionTree = new DimensionTree(null !== (_t = this.dataset.rowHeaderTree) && void 0 !== _t ? _t : [], this.layoutNodeId),
87
87
  this.internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
88
88
  this.refreshHeader(), this.scenegraph.createSceneGraph(), options.title && (this.internalProps.title = new Title(options.title, this),
89
- this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip ? this.internalProps.emptyTip.resetVisible() : this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this)),
90
- setTimeout((() => {
89
+ this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this)),
90
+ this.internalProps.emptyTip.resetVisible()), setTimeout((() => {
91
91
  this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
92
92
  }), 0);
93
93
  }
@@ -170,8 +170,8 @@ export class PivotChart extends BaseTable {
170
170
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
171
171
  })), internalProps.releaseList = null), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(),
172
172
  options.title && (this.internalProps.title = new Title(options.title, this), this.scenegraph.resize()),
173
- this.options.emptyTip && (this.internalProps.emptyTip ? this.internalProps.emptyTip.resetVisible() : this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this)),
174
- new Promise((resolve => {
173
+ this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this)),
174
+ this.internalProps.emptyTip.resetVisible()), new Promise((resolve => {
175
175
  setTimeout(resolve, 0);
176
176
  }));
177
177
  }
@@ -228,13 +228,20 @@ export class PivotChart extends BaseTable {
228
228
  return "function" == typeof fieldFormat ? fieldFormat(title, col, row, this) : title;
229
229
  }
230
230
  if (this.dataset) {
231
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
231
+ let indicatorPosition;
232
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
232
233
  var _a;
233
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
234
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
234
+ return colPath.indicatorKey && (indicatorPosition = {
235
+ position: "col",
236
+ index: index
237
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
238
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
235
239
  var _a;
236
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
237
- })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
240
+ return rowPath.indicatorKey && (indicatorPosition = {
241
+ position: "row",
242
+ index: index
243
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
244
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
238
245
  return aggregator.value ? aggregator.value() : void 0;
239
246
  }
240
247
  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];
@@ -259,13 +266,20 @@ export class PivotChart extends BaseTable {
259
266
  return "function" == typeof title ? title() : title;
260
267
  }
261
268
  if (this.dataset) {
262
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
269
+ let indicatorPosition;
270
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
263
271
  var _a;
264
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
265
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
272
+ return colPath.indicatorKey && (indicatorPosition = {
273
+ position: "col",
274
+ index: index
275
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
276
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
266
277
  var _a;
267
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
268
- })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
278
+ return rowPath.indicatorKey && (indicatorPosition = {
279
+ position: "row",
280
+ index: index
281
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
282
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
269
283
  return aggregator.value ? aggregator.value() : void 0;
270
284
  }
271
285
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
@@ -276,14 +290,21 @@ export class PivotChart extends BaseTable {
276
290
  }
277
291
  getCellOriginRecord(col, row) {
278
292
  if (!this.internalProps.layoutMap.isHeader(col, row) && this.dataset) {
279
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
293
+ let indicatorPosition;
294
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
280
295
  var _a;
281
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
282
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
296
+ return colPath.indicatorKey && (indicatorPosition = {
297
+ position: "col",
298
+ index: index
299
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
300
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
283
301
  var _a;
284
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
302
+ return rowPath.indicatorKey && (indicatorPosition = {
303
+ position: "row",
304
+ index: index
305
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
285
306
  }));
286
- return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
307
+ return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition).records;
287
308
  }
288
309
  }
289
310
  getCellRawRecord(col, row) {