@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/PivotTable.js CHANGED
@@ -78,8 +78,8 @@ class PivotTable extends BaseTable_1.BaseTable {
78
78
  "node" !== env_1.Env.mode && (this.editorManager = new edit_manager_1.EditManeger(this)),
79
79
  this.refreshHeader(), this.stateManager.initCheckedState(records), this.scenegraph.createSceneGraph(),
80
80
  options.title && (this.internalProps.title = new title_1.Title(options.title, this),
81
- 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)),
82
- setTimeout((() => {
81
+ this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
82
+ this.internalProps.emptyTip.resetVisible()), setTimeout((() => {
83
83
  this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
84
84
  }), 0);
85
85
  }
@@ -165,8 +165,8 @@ class PivotTable extends BaseTable_1.BaseTable {
165
165
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
166
166
  })), internalProps.releaseList = null), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(),
167
167
  options.title && (this.internalProps.title = new title_1.Title(options.title, this),
168
- 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)),
169
- new Promise((resolve => {
168
+ this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
169
+ this.internalProps.emptyTip.resetVisible()), new Promise((resolve => {
170
170
  setTimeout(resolve, 0);
171
171
  }));
172
172
  }
@@ -230,13 +230,20 @@ class PivotTable extends BaseTable_1.BaseTable {
230
230
  if (this.dataset) {
231
231
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
232
232
  if (cellDimensionPath) {
233
- const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
233
+ let indicatorPosition;
234
+ const colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
234
235
  var _a;
235
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
236
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
236
+ return colPath.indicatorKey && (indicatorPosition = {
237
+ position: "col",
238
+ index: index
239
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
240
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
237
241
  var _a;
238
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
239
- })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
242
+ return rowPath.indicatorKey && (indicatorPosition = {
243
+ position: "row",
244
+ index: index
245
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
246
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
240
247
  if (aggregator.records && aggregator.records.length >= 1) return aggregator.records[0][field];
241
248
  }
242
249
  } else if (this.flatDataToObjects) {
@@ -277,13 +284,21 @@ class PivotTable extends BaseTable_1.BaseTable {
277
284
  return dataValue;
278
285
  }
279
286
  if (this.dataset) {
280
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_c = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual))) || void 0 === _c ? void 0 : _c.map((colPath => {
287
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
288
+ let indicatorPosition;
289
+ const colKeys = null === (_c = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual))) || void 0 === _c ? void 0 : _c.map(((colPath, index) => {
281
290
  var _a;
282
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
283
- })), rowKeys = null === (_e = null === (_d = cellDimensionPath.rowHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual))) || void 0 === _e ? void 0 : _e.map((rowPath => {
291
+ return colPath.indicatorKey && (indicatorPosition = {
292
+ position: "col",
293
+ index: index
294
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
295
+ })), rowKeys = null === (_e = null === (_d = cellDimensionPath.rowHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual))) || void 0 === _e ? void 0 : _e.map(((rowPath, index) => {
284
296
  var _a;
285
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
286
- })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)), {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row);
297
+ return rowPath.indicatorKey && (indicatorPosition = {
298
+ position: "row",
299
+ index: index
300
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
301
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition), {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row);
287
302
  return aggregator.formatValue ? aggregator.formatValue(col, row, this) : "function" == typeof fieldFormat ? fieldFormat(null == aggregator ? void 0 : aggregator.value(), col, row, this) : null !== (_f = null == aggregator ? void 0 : aggregator.value()) && void 0 !== _f ? _f : "";
288
303
  }
289
304
  if (this.flatDataToObjects) {
@@ -309,13 +324,20 @@ class PivotTable extends BaseTable_1.BaseTable {
309
324
  return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
310
325
  }
311
326
  if (this.dataset) {
312
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
327
+ let indicatorPosition;
328
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
313
329
  var _a;
314
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
315
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
330
+ return colPath.indicatorKey && (indicatorPosition = {
331
+ position: "col",
332
+ index: index
333
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
334
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
316
335
  var _a;
317
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
318
- })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
336
+ return rowPath.indicatorKey && (indicatorPosition = {
337
+ position: "row",
338
+ index: index
339
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
340
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
319
341
  return aggregator.value ? aggregator.value() : void 0;
320
342
  }
321
343
  if (this.flatDataToObjects) {
@@ -341,13 +363,20 @@ class PivotTable extends BaseTable_1.BaseTable {
341
363
  return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
342
364
  }
343
365
  if (this.dataset) {
344
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
366
+ let indicatorPosition;
367
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
345
368
  var _a;
346
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
347
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
369
+ return colPath.indicatorKey && (indicatorPosition = {
370
+ position: "col",
371
+ index: index
372
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
373
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
348
374
  var _a;
349
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
350
- })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !1);
375
+ return rowPath.indicatorKey && (indicatorPosition = {
376
+ position: "row",
377
+ index: index
378
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
379
+ })), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !1, indicatorPosition);
351
380
  return aggregator.value ? aggregator.value() : void 0;
352
381
  }
353
382
  if (this.flatDataToObjects) {
@@ -369,14 +398,21 @@ class PivotTable extends BaseTable_1.BaseTable {
369
398
  return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
370
399
  }
371
400
  if (this.dataset) {
372
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
401
+ let indicatorPosition;
402
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
373
403
  var _a;
374
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
375
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
404
+ return colPath.indicatorKey && (indicatorPosition = {
405
+ position: "col",
406
+ index: index
407
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
408
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
376
409
  var _a;
377
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
410
+ return rowPath.indicatorKey && (indicatorPosition = {
411
+ position: "row",
412
+ index: index
413
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
378
414
  }));
379
- return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
415
+ return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition).records;
380
416
  }
381
417
  if (this.flatDataToObjects) {
382
418
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
@@ -398,14 +434,21 @@ class PivotTable extends BaseTable_1.BaseTable {
398
434
  return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
399
435
  }
400
436
  if (this.dataset) {
401
- const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
437
+ let indicatorPosition;
438
+ const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
402
439
  var _a;
403
- return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
404
- })), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
440
+ return colPath.indicatorKey && (indicatorPosition = {
441
+ position: "col",
442
+ index: index
443
+ }), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
444
+ })), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
405
445
  var _a;
406
- return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
446
+ return rowPath.indicatorKey && (indicatorPosition = {
447
+ position: "row",
448
+ index: index
449
+ }), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
407
450
  }));
408
- return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
451
+ return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !1, indicatorPosition).records;
409
452
  }
410
453
  if (this.flatDataToObjects) {
411
454
  const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {