@visactor/vtable 1.16.0 → 1.16.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 (77) hide show
  1. package/cjs/ListTable.js +2 -2
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/core/BaseTable.js +1 -1
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/dataset/dataset.js +11 -11
  6. package/cjs/dataset/dataset.js.map +1 -1
  7. package/cjs/event/event.js +4 -3
  8. package/cjs/event/event.js.map +1 -1
  9. package/cjs/event/listener/table-group.js +1 -0
  10. package/cjs/event/listener/table-group.js.map +1 -1
  11. package/cjs/index.d.ts +1 -1
  12. package/cjs/index.js +1 -1
  13. package/cjs/index.js.map +1 -1
  14. package/cjs/scenegraph/group-creater/cell-helper.js +20 -12
  15. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  16. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +6 -3
  17. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  18. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +16 -2
  19. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  20. package/cjs/scenegraph/scenegraph.js +17 -1
  21. package/cjs/scenegraph/scenegraph.js.map +1 -1
  22. package/cjs/scenegraph/style/frame-border.js +4 -0
  23. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  24. package/cjs/state/state.d.ts +1 -1
  25. package/cjs/state/state.js +4 -4
  26. package/cjs/state/state.js.map +1 -1
  27. package/cjs/themes/theme.js +4 -0
  28. package/cjs/themes/theme.js.map +1 -1
  29. package/cjs/ts-types/base-table.d.ts +1 -0
  30. package/cjs/ts-types/base-table.js.map +1 -1
  31. package/cjs/ts-types/dataset/aggregation.js +3 -1
  32. package/cjs/ts-types/dataset/aggregation.js.map +1 -1
  33. package/cjs/ts-types/table-engine.d.ts +2 -0
  34. package/cjs/ts-types/table-engine.js.map +1 -1
  35. package/cjs/ts-types/theme.d.ts +3 -2
  36. package/cjs/ts-types/theme.js.map +1 -1
  37. package/cjs/vrender.js.map +1 -1
  38. package/dist/vtable.js +130 -42
  39. package/dist/vtable.min.js +2 -2
  40. package/es/ListTable.js +2 -2
  41. package/es/ListTable.js.map +1 -1
  42. package/es/core/BaseTable.js +1 -1
  43. package/es/core/BaseTable.js.map +1 -1
  44. package/es/dataset/dataset.js +11 -11
  45. package/es/dataset/dataset.js.map +1 -1
  46. package/es/event/event.js +4 -3
  47. package/es/event/event.js.map +1 -1
  48. package/es/event/listener/table-group.js +1 -0
  49. package/es/event/listener/table-group.js.map +1 -1
  50. package/es/index.d.ts +1 -1
  51. package/es/index.js +1 -1
  52. package/es/index.js.map +1 -1
  53. package/es/scenegraph/group-creater/cell-helper.js +20 -12
  54. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  55. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +6 -3
  56. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  57. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +17 -1
  58. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  59. package/es/scenegraph/scenegraph.js +12 -1
  60. package/es/scenegraph/scenegraph.js.map +1 -1
  61. package/es/scenegraph/style/frame-border.js +4 -0
  62. package/es/scenegraph/style/frame-border.js.map +1 -1
  63. package/es/state/state.d.ts +1 -1
  64. package/es/state/state.js +4 -4
  65. package/es/state/state.js.map +1 -1
  66. package/es/themes/theme.js +4 -0
  67. package/es/themes/theme.js.map +1 -1
  68. package/es/ts-types/base-table.d.ts +1 -0
  69. package/es/ts-types/base-table.js.map +1 -1
  70. package/es/ts-types/dataset/aggregation.js +3 -1
  71. package/es/ts-types/dataset/aggregation.js.map +1 -1
  72. package/es/ts-types/table-engine.d.ts +2 -0
  73. package/es/ts-types/table-engine.js.map +1 -1
  74. package/es/ts-types/theme.d.ts +3 -2
  75. package/es/ts-types/theme.js.map +1 -1
  76. package/es/vrender.js.map +1 -1
  77. package/package.json +4 -4
@@ -53,7 +53,7 @@ export class Dataset {
53
53
  this.setRecords(records);
54
54
  }
55
55
  setRecords(records) {
56
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
56
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
57
57
  if (this.records = records, this.collectedValues = {}, this.cacheCollectedValues = {},
58
58
  this.totalRecordsTree = {}, this.tree = {}, this.colFlatKeys = {}, this.rowFlatKeys = {},
59
59
  this.colKeys = [], this.rowKeys = [], this.rowsHasValue = [], this.columnsHasValue = [],
@@ -69,10 +69,10 @@ export class Dataset {
69
69
  "undefined" != typeof window && window.performance.now();
70
70
  this.sortKeys();
71
71
  "undefined" != typeof window && window.performance.now(), "undefined" != typeof window && window.performance.now();
72
- this.customRowTree ? this.rowHeaderTree = this.customRowTree : "tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_g = null === (_f = null === (_e = this.totals) || void 0 === _e ? void 0 : _e.row) || void 0 === _f ? void 0 : _f.showGrandTotalsOnTop) && void 0 !== _g && _g, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showSubTotalsOnTop) && void 0 !== _k && _k),
73
- this.customColTree ? this.colHeaderTree = this.customColTree : this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_q = null === (_p = null === (_o = this.totals) || void 0 === _o ? void 0 : _o.column) || void 0 === _p ? void 0 : _p.showGrandTotalsOnLeft) && void 0 !== _q && _q, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showSubTotalsOnLeft) && void 0 !== _t && _t);
72
+ this.customRowTree ? this.rowHeaderTree = this.customRowTree : "tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, null !== (_e = null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotalsOnTop) && void 0 !== _e && _e) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_g = null === (_f = this.totals) || void 0 === _f ? void 0 : _f.row) || void 0 === _g ? void 0 : _g.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showGrandTotalsOnTop) && void 0 !== _k && _k, null !== (_o = null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.row) || void 0 === _m ? void 0 : _m.showSubTotalsOnTop) && void 0 !== _o && _o),
73
+ this.customColTree ? this.colHeaderTree = this.customColTree : this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_q = null === (_p = this.totals) || void 0 === _p ? void 0 : _p.column) || void 0 === _q ? void 0 : _q.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showGrandTotalsOnLeft) && void 0 !== _t && _t, null !== (_w = null === (_v = null === (_u = this.totals) || void 0 === _u ? void 0 : _u.column) || void 0 === _v ? void 0 : _v.showSubTotalsOnLeft) && void 0 !== _w && _w);
74
74
  "undefined" != typeof window && window.performance.now();
75
- (null === (_u = this.dataConfig) || void 0 === _u ? void 0 : _u.isPivotChart) && this.cacheDeminsionCollectedValues();
75
+ (null === (_x = this.dataConfig) || void 0 === _x ? void 0 : _x.isPivotChart) && this.cacheDeminsionCollectedValues();
76
76
  }
77
77
  }
78
78
  registerAggregator(type, aggregator) {
@@ -337,9 +337,9 @@ export class Dataset {
337
337
  }
338
338
  }
339
339
  updateSortRules(sortRules) {
340
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
341
- this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.customRowTree || ("tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_g = null === (_f = null === (_e = this.totals) || void 0 === _e ? void 0 : _e.row) || void 0 === _f ? void 0 : _f.showGrandTotalsOnTop) && void 0 !== _g && _g, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showSubTotalsOnTop) && void 0 !== _k && _k)),
342
- this.customColTree || (this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.column) || void 0 === _m ? void 0 : _m.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_q = null === (_p = null === (_o = this.totals) || void 0 === _o ? void 0 : _o.column) || void 0 === _p ? void 0 : _p.showGrandTotalsOnLeft) && void 0 !== _q && _q, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showSubTotalsOnLeft) && void 0 !== _t && _t));
340
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
341
+ this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.customRowTree || ("tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, (null === (_b = null === (_a = this.totals) || void 0 === _a ? void 0 : _a.row) || void 0 === _b ? void 0 : _b.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, null !== (_e = null === (_d = null === (_c = this.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotalsOnTop) && void 0 !== _e && _e) : this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter(((key, index) => this.rowsHasValue[index])), this.indicatorsAsCol ? void 0 : this.indicators, this.rowsIsTotal, (null === (_g = null === (_f = this.totals) || void 0 === _f ? void 0 : _f.row) || void 0 === _g ? void 0 : _g.showGrandTotals) || this.indicatorsAsCol && 0 === this.rows.length, this.rowGrandTotalLabel, this.rowSubTotalLabel, null !== (_k = null === (_j = null === (_h = this.totals) || void 0 === _h ? void 0 : _h.row) || void 0 === _j ? void 0 : _j.showGrandTotalsOnTop) && void 0 !== _k && _k, null !== (_o = null === (_m = null === (_l = this.totals) || void 0 === _l ? void 0 : _l.row) || void 0 === _m ? void 0 : _m.showSubTotalsOnTop) && void 0 !== _o && _o)),
342
+ this.customColTree || (this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter(((key, index) => this.columnsHasValue[index])), this.indicatorsAsCol ? this.indicators : void 0, this.colsIsTotal, (null === (_q = null === (_p = this.totals) || void 0 === _p ? void 0 : _p.column) || void 0 === _q ? void 0 : _q.showGrandTotals) || !this.indicatorsAsCol && 0 === this.columns.length, this.colGrandTotalLabel, this.colSubTotalLabel, null !== (_t = null === (_s = null === (_r = this.totals) || void 0 === _r ? void 0 : _r.column) || void 0 === _s ? void 0 : _s.showGrandTotalsOnLeft) && void 0 !== _t && _t, null !== (_w = null === (_v = null === (_u = this.totals) || void 0 === _u ? void 0 : _u.column) || void 0 === _v ? void 0 : _v.showSubTotalsOnLeft) && void 0 !== _w && _w));
343
343
  }
344
344
  updateFilterRules(filterRules, isResetTree = !1) {
345
345
  var _a, _b;
@@ -598,9 +598,9 @@ export class Dataset {
598
598
  }
599
599
  for (const flatRowKey in that.totalRecordsTree) for (const flatColKey in that.totalRecordsTree[flatRowKey]) colCompute(flatRowKey, flatColKey);
600
600
  }
601
- ArrToTree1(arr, rows, indicators, isGrandTotal, grandTotalLabel) {
601
+ ArrToTree1(arr, rows, indicators, isGrandTotal, grandTotalLabel, showGrandTotalsOnTop) {
602
602
  const result = [], concatStr = this.stringJoinChar, map = new Map;
603
- function addList(list) {
603
+ function addList(list, isGrandTotal) {
604
604
  const path = [];
605
605
  let node;
606
606
  list.forEach(((value, index) => {
@@ -618,11 +618,11 @@ export class Dataset {
618
618
  indicatorKey: indicator.indicatorKey,
619
619
  value: indicator.title
620
620
  })) : []
621
- }, map.set(flatKey, item), node ? node.children.push(item) : result.push(item)),
621
+ }, map.set(flatKey, item), node ? node.children.push(item) : showGrandTotalsOnTop && isGrandTotal ? result.unshift(item) : result.push(item)),
622
622
  node = item;
623
623
  }));
624
624
  }
625
- return arr.forEach((item => addList(item))), isGrandTotal && addList([ grandTotalLabel ]),
625
+ return arr.forEach((item => addList(item, !1))), isGrandTotal && addList([ grandTotalLabel ], isGrandTotal),
626
626
  result;
627
627
  }
628
628
  ArrToTree(arr, rows, indicators, subTotalFlags, isGrandTotal, grandTotalLabel, subTotalLabel, showGrandTotalsOnTop, showSubTotalsOnTop) {