@visactor/vtable 1.3.1-alpha.1 → 1.3.2-alpha.0

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 (97) hide show
  1. package/cjs/ListTable.js +13 -11
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.js +7 -6
  4. package/cjs/PivotChart.js.map +1 -1
  5. package/cjs/PivotTable.js +8 -6
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/components/empty-tip/empty-tip.js +2 -2
  8. package/cjs/components/empty-tip/empty-tip.js.map +1 -1
  9. package/cjs/components/tooltip/TooltipHandler.js +3 -1
  10. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  11. package/cjs/components/tooltip/logic/BubbleTooltipElement.js +3 -7
  12. package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  13. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
  14. package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  15. package/cjs/core/BaseTable.js +3 -3
  16. package/cjs/core/BaseTable.js.map +1 -1
  17. package/cjs/dataset/dataset.d.ts +2 -0
  18. package/cjs/dataset/dataset.js +8 -7
  19. package/cjs/dataset/dataset.js.map +1 -1
  20. package/cjs/event/listener/container-dom.js +3 -2
  21. package/cjs/event/listener/container-dom.js.map +1 -1
  22. package/cjs/index.d.ts +1 -1
  23. package/cjs/index.js +1 -1
  24. package/cjs/index.js.map +1 -1
  25. package/cjs/layout/pivot-header-layout.js +59 -39
  26. package/cjs/layout/pivot-header-layout.js.map +1 -1
  27. package/cjs/layout/row-height-map.js +1 -0
  28. package/cjs/layout/row-height-map.js.map +1 -1
  29. package/cjs/scenegraph/layout/compute-row-height.js +4 -1
  30. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  31. package/cjs/scenegraph/scenegraph.js +2 -2
  32. package/cjs/scenegraph/scenegraph.js.map +1 -1
  33. package/cjs/state/cell-move/index.js +1 -1
  34. package/cjs/state/cell-move/index.js.map +1 -1
  35. package/cjs/state/sort/index.js +2 -2
  36. package/cjs/state/sort/index.js.map +1 -1
  37. package/cjs/themes/theme.js +0 -6
  38. package/cjs/themes/theme.js.map +1 -1
  39. package/cjs/ts-types/base-table.d.ts +3 -2
  40. package/cjs/ts-types/base-table.js.map +1 -1
  41. package/cjs/ts-types/icon.d.ts +0 -2
  42. package/cjs/ts-types/icon.js.map +1 -1
  43. package/cjs/ts-types/theme.d.ts +0 -2
  44. package/cjs/ts-types/theme.js.map +1 -1
  45. package/cjs/ts-types/tooltip.d.ts +0 -2
  46. package/cjs/ts-types/tooltip.js.map +1 -1
  47. package/cjs/vrender.js.map +1 -1
  48. package/dist/vtable.js +178 -65
  49. package/dist/vtable.min.js +2 -2
  50. package/es/ListTable.js +13 -12
  51. package/es/ListTable.js.map +1 -1
  52. package/es/PivotChart.js +8 -7
  53. package/es/PivotChart.js.map +1 -1
  54. package/es/PivotTable.js +9 -7
  55. package/es/PivotTable.js.map +1 -1
  56. package/es/components/empty-tip/empty-tip.js +2 -2
  57. package/es/components/empty-tip/empty-tip.js.map +1 -1
  58. package/es/components/tooltip/TooltipHandler.js +3 -1
  59. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  60. package/es/components/tooltip/logic/BubbleTooltipElement.js +3 -7
  61. package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
  62. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
  63. package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
  64. package/es/core/BaseTable.js +3 -3
  65. package/es/core/BaseTable.js.map +1 -1
  66. package/es/dataset/dataset.d.ts +2 -0
  67. package/es/dataset/dataset.js +8 -7
  68. package/es/dataset/dataset.js.map +1 -1
  69. package/es/event/listener/container-dom.js +3 -2
  70. package/es/event/listener/container-dom.js.map +1 -1
  71. package/es/index.d.ts +1 -1
  72. package/es/index.js +1 -1
  73. package/es/index.js.map +1 -1
  74. package/es/layout/pivot-header-layout.js +58 -37
  75. package/es/layout/pivot-header-layout.js.map +1 -1
  76. package/es/layout/row-height-map.js +1 -0
  77. package/es/layout/row-height-map.js.map +1 -1
  78. package/es/scenegraph/layout/compute-row-height.js +4 -1
  79. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  80. package/es/scenegraph/scenegraph.js +2 -2
  81. package/es/scenegraph/scenegraph.js.map +1 -1
  82. package/es/state/cell-move/index.js +1 -1
  83. package/es/state/cell-move/index.js.map +1 -1
  84. package/es/state/sort/index.js +2 -2
  85. package/es/state/sort/index.js.map +1 -1
  86. package/es/themes/theme.js +0 -6
  87. package/es/themes/theme.js.map +1 -1
  88. package/es/ts-types/base-table.d.ts +3 -2
  89. package/es/ts-types/base-table.js.map +1 -1
  90. package/es/ts-types/icon.d.ts +0 -2
  91. package/es/ts-types/icon.js.map +1 -1
  92. package/es/ts-types/theme.d.ts +0 -2
  93. package/es/ts-types/theme.js.map +1 -1
  94. package/es/ts-types/tooltip.d.ts +0 -2
  95. package/es/ts-types/tooltip.js.map +1 -1
  96. package/es/vrender.js.map +1 -1
  97. package/package.json +4 -4
@@ -41,7 +41,9 @@ export declare class Dataset {
41
41
  collectedValues: Record<string, Record<string, CollectedValue>>;
42
42
  cacheCollectedValues: Record<string, Record<string, CollectedValue>>;
43
43
  rows: string[];
44
+ rowsHasValue: boolean[];
44
45
  columns: string[];
46
+ columnsHasValue: boolean[];
45
47
  indicatorKeys: string[];
46
48
  customRowTree?: IHeaderTreeDefine[];
47
49
  customColTree?: IHeaderTreeDefine[];
@@ -43,7 +43,8 @@ export class Dataset {
43
43
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
44
44
  if (this.records = records, this.collectedValues = {}, this.cacheCollectedValues = {},
45
45
  this.totalRecordsTree = {}, this.tree = {}, this.colFlatKeys = {}, this.rowFlatKeys = {},
46
- this.colKeys = [], this.rowKeys = [], records) {
46
+ this.colKeys = [], this.rowKeys = [], this.rowsHasValue = [], this.columnsHasValue = [],
47
+ records) {
47
48
  this.records = records;
48
49
  "undefined" != typeof window && window.performance.now();
49
50
  this.processRecords(), this.processCollectedValuesWithSumBy(), this.generateCollectedValuesSortRule(),
@@ -53,8 +54,8 @@ export class Dataset {
53
54
  "undefined" != typeof window && window.performance.now(), "undefined" != typeof window && window.performance.now();
54
55
  this.sortKeys();
55
56
  "undefined" != typeof window && window.performance.now(), "undefined" != typeof window && window.performance.now();
56
- this.customRowTree ? this.rowHeaderTree = this.customRowTree : "tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, 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, 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),
57
- this.customColTree ? this.colHeaderTree = this.customColTree : this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns, 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);
57
+ 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),
58
+ 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);
58
59
  "undefined" != typeof window && window.performance.now();
59
60
  (null === (_u = this.dataConfig) || void 0 === _u ? void 0 : _u.isPivotChart) && this.cacheDeminsionCollectedValues();
60
61
  }
@@ -158,7 +159,7 @@ export class Dataset {
158
159
  let isToTalRecord = !1;
159
160
  for (let l = 0, len1 = this.rows.length; l < len1; l++) {
160
161
  const rowAttr = this.rows[l];
161
- if (rowAttr in record) rowKey.push(record[rowAttr]); else if (rowAttr !== IndicatorDimensionKeyPlaceholder) {
162
+ if (rowAttr in record) this.rowsHasValue[l] = !0, rowKey.push(record[rowAttr]); else if (rowAttr !== IndicatorDimensionKeyPlaceholder) {
162
163
  if ((null === (_d = null === (_c = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.totals) || void 0 === _c ? void 0 : _c.row) || void 0 === _d ? void 0 : _d.showGrandTotals) && 0 === l && !this.rows.find((rk => rk in record))) {
163
164
  rowKey.push(this.rowGrandTotalLabel), isToTalRecord = !0;
164
165
  break;
@@ -171,7 +172,7 @@ export class Dataset {
171
172
  }
172
173
  for (let n = 0, len2 = this.columns.length; n < len2; n++) {
173
174
  const colAttr = this.columns[n];
174
- if (colAttr in record) colKey.push(record[colAttr]); else if (colAttr !== IndicatorDimensionKeyPlaceholder) {
175
+ if (colAttr in record) this.columnsHasValue[n] = !0, colKey.push(record[colAttr]); else if (colAttr !== IndicatorDimensionKeyPlaceholder) {
175
176
  if ((null === (_o = null === (_m = null === (_l = this.dataConfig) || void 0 === _l ? void 0 : _l.totals) || void 0 === _m ? void 0 : _m.column) || void 0 === _o ? void 0 : _o.showGrandTotals) && 0 === n && !this.columns.find((ck => ck in record))) {
176
177
  colKey.push(this.colGrandTotalLabel), isToTalRecord = !0;
177
178
  break;
@@ -221,8 +222,8 @@ export class Dataset {
221
222
  }
222
223
  updateSortRules(sortRules) {
223
224
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
224
- this.sorted = !1, this.sortRules = sortRules, this.sortKeys(), this.customRowTree || ("tree" === this.rowHierarchyType ? this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, 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, 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)),
225
- this.customColTree || (this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns, 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));
225
+ 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)),
226
+ 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));
226
227
  }
227
228
  updateFilterRules(filterRules, isResetTree = !1) {
228
229
  var _a;