@visactor/vtable 0.26.0-alpha.1 → 0.26.0-alpha.2

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 (53) hide show
  1. package/cjs/PivotChart.js +11 -5
  2. package/cjs/PivotChart.js.map +1 -1
  3. package/cjs/core/BaseTable.js +5 -4
  4. package/cjs/core/BaseTable.js.map +1 -1
  5. package/cjs/dataset/dataset.d.ts +0 -1
  6. package/cjs/dataset/dataset.js +2 -32
  7. package/cjs/dataset/dataset.js.map +1 -1
  8. package/cjs/event/listener/table-group.js +10 -3
  9. package/cjs/event/listener/table-group.js.map +1 -1
  10. package/cjs/index.d.ts +1 -1
  11. package/cjs/index.js +1 -1
  12. package/cjs/index.js.map +1 -1
  13. package/cjs/layout/layout-helper.d.ts +2 -1
  14. package/cjs/layout/layout-helper.js +36 -6
  15. package/cjs/layout/layout-helper.js.map +1 -1
  16. package/cjs/layout/pivot-header-layout.js +2 -2
  17. package/cjs/layout/pivot-header-layout.js.map +1 -1
  18. package/cjs/layout/tree-helper.js.map +1 -1
  19. package/cjs/tools/get-data-path/create-dataset.js +5 -3
  20. package/cjs/tools/get-data-path/create-dataset.js.map +1 -1
  21. package/cjs/ts-types/base-table.d.ts +1 -0
  22. package/cjs/ts-types/base-table.js.map +1 -1
  23. package/cjs/ts-types/table-engine.d.ts +1 -0
  24. package/cjs/ts-types/table-engine.js.map +1 -1
  25. package/cjs/vrender.js.map +1 -1
  26. package/dist/vtable.js +104 -54
  27. package/dist/vtable.min.js +1 -1
  28. package/es/PivotChart.js +10 -4
  29. package/es/PivotChart.js.map +1 -1
  30. package/es/core/BaseTable.js +5 -4
  31. package/es/core/BaseTable.js.map +1 -1
  32. package/es/dataset/dataset.d.ts +0 -1
  33. package/es/dataset/dataset.js +2 -32
  34. package/es/dataset/dataset.js.map +1 -1
  35. package/es/event/listener/table-group.js +11 -2
  36. package/es/event/listener/table-group.js.map +1 -1
  37. package/es/index.d.ts +1 -1
  38. package/es/index.js +1 -1
  39. package/es/index.js.map +1 -1
  40. package/es/layout/layout-helper.d.ts +2 -1
  41. package/es/layout/layout-helper.js +34 -4
  42. package/es/layout/layout-helper.js.map +1 -1
  43. package/es/layout/pivot-header-layout.js +2 -2
  44. package/es/layout/pivot-header-layout.js.map +1 -1
  45. package/es/layout/tree-helper.js.map +1 -1
  46. package/es/tools/get-data-path/create-dataset.js +6 -2
  47. package/es/tools/get-data-path/create-dataset.js.map +1 -1
  48. package/es/ts-types/base-table.d.ts +1 -0
  49. package/es/ts-types/base-table.js.map +1 -1
  50. package/es/ts-types/table-engine.d.ts +1 -0
  51. package/es/ts-types/table-engine.js.map +1 -1
  52. package/es/vrender.js.map +1 -1
  53. package/package.json +2 -2
@@ -73,7 +73,6 @@ export declare class Dataset {
73
73
  private ArrToTree;
74
74
  private TreeToArr;
75
75
  private cacheDeminsionCollectedValues;
76
- private _adjustCustomTree;
77
76
  changeTreeNodeValue(rowKey: string[] | string, colKey: string[] | string, indicator: string, newValue: string | number): void;
78
77
  changeRecordFieldValue(fieldName: string, oldValue: string | number, value: string | number): void;
79
78
  changeDataConfig(dataConfig: {
@@ -53,10 +53,8 @@ export class Dataset {
53
53
  "undefined" != typeof window && window.performance.now(), "undefined" != typeof window && window.performance.now();
54
54
  this.sortKeys();
55
55
  "undefined" != typeof window && window.performance.now(), "undefined" != typeof window && window.performance.now();
56
- this.customRowTree ? (this.indicatorsAsCol || (this.customRowTree = this._adjustCustomTree(this.customRowTree)),
57
- 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),
58
- this.customColTree ? (this.indicatorsAsCol && (this.customColTree = this._adjustCustomTree(this.customColTree)),
59
- 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);
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);
60
58
  "undefined" != typeof window && window.performance.now();
61
59
  (null === (_u = this.dataConfig) || void 0 === _u ? void 0 : _u.isPivotChart) && this.cacheDeminsionCollectedValues();
62
60
  }
@@ -549,34 +547,6 @@ export class Dataset {
549
547
  cacheDeminsionCollectedValues() {
550
548
  for (const key in this.collectValuesBy) "xField" !== this.collectValuesBy[key].type && "yField" !== this.collectValuesBy[key].type || (this.dataConfig.dimensionSortArray ? this.cacheCollectedValues[key] = arraySortByAnotherArray(this.collectedValues[key], this.dataConfig.dimensionSortArray) : this.cacheCollectedValues[key] = this.collectedValues[key]);
551
549
  }
552
- _adjustCustomTree(customTree) {
553
- var _a;
554
- const checkNode = (nodes, isHasIndicator) => {
555
- nodes.forEach((node => {
556
- var _a, _b;
557
- node.indicatorKey || isHasIndicator || (null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) && node.children ? node.children && Array.isArray(node.children) && checkNode(node.children, isHasIndicator || !!node.indicatorKey) : node.children = null === (_b = this.indicators) || void 0 === _b ? void 0 : _b.map((indicator => {
558
- var _a;
559
- return "string" == typeof indicator ? {
560
- indicatorKey: indicator,
561
- value: indicator
562
- } : {
563
- indicatorKey: indicator.indicatorKey,
564
- value: null !== (_a = indicator.title) && void 0 !== _a ? _a : indicator.indicatorKey
565
- };
566
- }));
567
- }));
568
- };
569
- return (null == customTree ? void 0 : customTree.length) ? checkNode(customTree, !1) : customTree = null === (_a = this.indicators) || void 0 === _a ? void 0 : _a.map((indicator => {
570
- var _a;
571
- return "string" == typeof indicator ? {
572
- indicatorKey: indicator,
573
- value: indicator
574
- } : {
575
- indicatorKey: indicator.indicatorKey,
576
- value: null !== (_a = indicator.title) && void 0 !== _a ? _a : indicator.indicatorKey
577
- };
578
- })), customTree;
579
- }
580
550
  changeTreeNodeValue(rowKey = [], colKey = [], indicator, newValue) {
581
551
  var _a;
582
552
  const indicatorIndex = this.indicatorKeys.indexOf(indicator);