@visactor/vtable 1.15.3-alpha.1 → 1.16.0-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 (147) hide show
  1. package/cjs/PivotChart.d.ts +0 -1
  2. package/cjs/PivotChart.js +2 -5
  3. package/cjs/PivotChart.js.map +1 -1
  4. package/cjs/PivotTable.d.ts +2 -2
  5. package/cjs/PivotTable.js +41 -33
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/components/index.js +1 -1
  8. package/cjs/core/BaseTable.d.ts +1 -2
  9. package/cjs/core/BaseTable.js +2 -2
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/data/DataSource.d.ts +2 -2
  12. package/cjs/data/DataSource.js +4 -4
  13. package/cjs/data/DataSource.js.map +1 -1
  14. package/cjs/dataset/dataset-pivot-table.js +1 -2
  15. package/cjs/dataset/dataset.d.ts +3 -2
  16. package/cjs/dataset/dataset.js +13 -9
  17. package/cjs/dataset/dataset.js.map +1 -1
  18. package/cjs/index.d.ts +1 -1
  19. package/cjs/index.js +1 -1
  20. package/cjs/index.js.map +1 -1
  21. package/cjs/layout/index.js +1 -2
  22. package/cjs/layout/layout-helper.js +10 -9
  23. package/cjs/layout/layout-helper.js.map +1 -1
  24. package/cjs/layout/pivot-header-layout.d.ts +33 -5
  25. package/cjs/layout/pivot-header-layout.js +137 -31
  26. package/cjs/layout/pivot-header-layout.js.map +1 -1
  27. package/cjs/layout/tree-helper.d.ts +5 -4
  28. package/cjs/layout/tree-helper.js +105 -23
  29. package/cjs/layout/tree-helper.js.map +1 -1
  30. package/cjs/plugins/custom-cell-style.js +1 -1
  31. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
  32. package/cjs/scenegraph/group-creater/progress/proxy.js +5 -2
  33. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  34. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +8 -4
  35. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  36. package/cjs/scenegraph/layout/compute-col-width.js +1 -1
  37. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  38. package/cjs/scenegraph/layout/frozen.d.ts +1 -0
  39. package/cjs/scenegraph/layout/frozen.js +91 -2
  40. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  41. package/cjs/scenegraph/layout/update-col.js +4 -1
  42. package/cjs/scenegraph/layout/update-col.js.map +1 -1
  43. package/cjs/scenegraph/layout/update-row.js +3 -2
  44. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  45. package/cjs/scenegraph/scenegraph.d.ts +5 -0
  46. package/cjs/scenegraph/scenegraph.js +18 -0
  47. package/cjs/scenegraph/scenegraph.js.map +1 -1
  48. package/cjs/scenegraph/utils/get-hierarchy-offset.js +1 -1
  49. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  50. package/cjs/state/state.d.ts +2 -0
  51. package/cjs/state/state.js +7 -2
  52. package/cjs/state/state.js.map +1 -1
  53. package/cjs/tools/NumberMap.js +4 -2
  54. package/cjs/tools/NumberMap.js.map +1 -1
  55. package/cjs/tools/diff-cell.d.ts +58 -3
  56. package/cjs/tools/diff-cell.js +90 -11
  57. package/cjs/tools/diff-cell.js.map +1 -1
  58. package/cjs/tools/get-data-path/create-dataset.js +1 -1
  59. package/cjs/tools/get-data-path/create-dataset.js.map +1 -1
  60. package/cjs/ts-types/base-table.d.ts +2 -1
  61. package/cjs/ts-types/base-table.js.map +1 -1
  62. package/cjs/ts-types/list-table/define/basic-define.d.ts +1 -1
  63. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
  64. package/cjs/ts-types/list-table/layout-map/api.d.ts +4 -4
  65. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  66. package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +2 -2
  67. package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
  68. package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -1
  69. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  70. package/cjs/ts-types/table-engine.d.ts +6 -3
  71. package/cjs/ts-types/table-engine.js.map +1 -1
  72. package/cjs/vrender.js.map +1 -1
  73. package/dist/vtable.js +759 -116
  74. package/dist/vtable.min.js +2 -2
  75. package/es/PivotChart.d.ts +0 -1
  76. package/es/PivotChart.js +2 -5
  77. package/es/PivotChart.js.map +1 -1
  78. package/es/PivotTable.d.ts +2 -2
  79. package/es/PivotTable.js +41 -33
  80. package/es/PivotTable.js.map +1 -1
  81. package/es/components/index.js +1 -1
  82. package/es/core/BaseTable.d.ts +1 -2
  83. package/es/core/BaseTable.js +2 -2
  84. package/es/core/BaseTable.js.map +1 -1
  85. package/es/data/DataSource.d.ts +2 -2
  86. package/es/data/DataSource.js +4 -4
  87. package/es/data/DataSource.js.map +1 -1
  88. package/es/dataset/dataset-pivot-table.js +1 -2
  89. package/es/dataset/dataset.d.ts +3 -2
  90. package/es/dataset/dataset.js +14 -10
  91. package/es/dataset/dataset.js.map +1 -1
  92. package/es/index.d.ts +1 -1
  93. package/es/index.js +1 -1
  94. package/es/index.js.map +1 -1
  95. package/es/layout/index.js +1 -2
  96. package/es/layout/layout-helper.js +10 -9
  97. package/es/layout/layout-helper.js.map +1 -1
  98. package/es/layout/pivot-header-layout.d.ts +33 -5
  99. package/es/layout/pivot-header-layout.js +138 -33
  100. package/es/layout/pivot-header-layout.js.map +1 -1
  101. package/es/layout/tree-helper.d.ts +5 -4
  102. package/es/layout/tree-helper.js +102 -19
  103. package/es/layout/tree-helper.js.map +1 -1
  104. package/es/plugins/custom-cell-style.js +1 -1
  105. package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
  106. package/es/scenegraph/group-creater/progress/proxy.js +5 -2
  107. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  108. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +8 -4
  109. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  110. package/es/scenegraph/layout/compute-col-width.js +1 -1
  111. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  112. package/es/scenegraph/layout/frozen.d.ts +1 -0
  113. package/es/scenegraph/layout/frozen.js +89 -0
  114. package/es/scenegraph/layout/frozen.js.map +1 -1
  115. package/es/scenegraph/layout/update-col.js +4 -1
  116. package/es/scenegraph/layout/update-col.js.map +1 -1
  117. package/es/scenegraph/layout/update-row.js +3 -2
  118. package/es/scenegraph/layout/update-row.js.map +1 -1
  119. package/es/scenegraph/scenegraph.d.ts +5 -0
  120. package/es/scenegraph/scenegraph.js +16 -1
  121. package/es/scenegraph/scenegraph.js.map +1 -1
  122. package/es/scenegraph/utils/get-hierarchy-offset.js +1 -1
  123. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  124. package/es/state/state.d.ts +2 -0
  125. package/es/state/state.js +7 -2
  126. package/es/state/state.js.map +1 -1
  127. package/es/tools/NumberMap.js +4 -2
  128. package/es/tools/NumberMap.js.map +1 -1
  129. package/es/tools/diff-cell.d.ts +58 -3
  130. package/es/tools/diff-cell.js +85 -9
  131. package/es/tools/diff-cell.js.map +1 -1
  132. package/es/tools/get-data-path/create-dataset.js +1 -1
  133. package/es/tools/get-data-path/create-dataset.js.map +1 -1
  134. package/es/ts-types/base-table.d.ts +2 -1
  135. package/es/ts-types/base-table.js.map +1 -1
  136. package/es/ts-types/list-table/define/basic-define.d.ts +1 -1
  137. package/es/ts-types/list-table/define/basic-define.js.map +1 -1
  138. package/es/ts-types/list-table/layout-map/api.d.ts +4 -4
  139. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  140. package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +2 -2
  141. package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -1
  142. package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +1 -1
  143. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -1
  144. package/es/ts-types/table-engine.d.ts +6 -3
  145. package/es/ts-types/table-engine.js.map +1 -1
  146. package/es/vrender.js.map +1 -1
  147. package/package.json +4 -4
package/es/PivotTable.js CHANGED
@@ -38,12 +38,13 @@ import { Factory } from "./core/factory";
38
38
 
39
39
  export class PivotTable extends BaseTable {
40
40
  constructor(container, options) {
41
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
41
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
42
42
  if ("node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
43
43
  container = container.container ? container.container : null), super(container, options),
44
44
  this.layoutNodeId = {
45
45
  seqId: 0
46
46
  }, options) {
47
+ options.rowHierarchyType || (options.rowHierarchyType = "grid"), options.columnHierarchyType || (options.columnHierarchyType = "grid"),
47
48
  options.layout && Object.assign(options, options.layout), this.internalProps.columns = cloneDeep(options.columns),
48
49
  this.internalProps.rows = cloneDeep(options.rows), this.internalProps.indicators = cloneDeepSpec(options.indicators),
49
50
  null === (_a = options.indicators) || void 0 === _a || _a.forEach(((indicatorDefine, index) => {
@@ -58,7 +59,7 @@ export class PivotTable extends BaseTable {
58
59
  const records = this.internalProps.records;
59
60
  if (this.internalProps.recordsIsTwoDimensionalArray = !1, (null === (_f = null == records ? void 0 : records[0]) || void 0 === _f ? void 0 : _f.constructor) === Array && (this.internalProps.recordsIsTwoDimensionalArray = !0),
60
61
  !1 === (null === (_g = options.customConfig) || void 0 === _g ? void 0 : _g.enableDataAnalysis)) {
61
- const columnDimensionTree = new DimensionTree(null !== (_h = this.internalProps.columnTree) && void 0 !== _h ? _h : [], this.layoutNodeId), rowDimensionTree = new DimensionTree(null !== (_j = this.internalProps.rowTree) && void 0 !== _j ? _j : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_k = this.options.rowExpandLevel) && void 0 !== _k ? _k : 1 : void 0);
62
+ const columnDimensionTree = new DimensionTree(null !== (_h = this.internalProps.columnTree) && void 0 !== _h ? _h : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_j = this.options.columnExpandLevel) && void 0 !== _j ? _j : 1 : void 0), rowDimensionTree = new DimensionTree(null !== (_k = this.internalProps.rowTree) && void 0 !== _k ? _k : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_l = this.options.rowExpandLevel) && void 0 !== _l ? _l : 1 : void 0);
62
63
  this.internalProps.layoutMap = new PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree),
63
64
  !1 === this.internalProps.recordsIsTwoDimensionalArray && (this.flatDataToObjects = new FlatDataToObjects({
64
65
  rows: this.internalProps.layoutMap.fullRowDimensionKeys,
@@ -70,27 +71,27 @@ export class PivotTable extends BaseTable {
70
71
  } else {
71
72
  const keysResults = parseColKeyRowKeyForPivotTable(this, options), {rowKeys: rowKeys, columnKeys: columnKeys, indicatorKeys: indicatorKeys} = keysResults;
72
73
  let {columnDimensionTree: columnDimensionTree, rowDimensionTree: rowDimensionTree} = keysResults;
73
- this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_l = options.indicatorsAsCol) || void 0 === _l || _l, options.records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, !1, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords),
74
+ this.dataset = new Dataset(this.internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_m = options.indicatorsAsCol) || void 0 === _m || _m, options.records, options.rowHierarchyType, options.columnHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, !1, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords),
74
75
  options.columnTree ? columnDimensionTree.hasHideNode && (deleteHideIndicatorNode(columnDimensionTree.tree.children, options.indicators, !0, this),
75
76
  columnDimensionTree.reset(columnDimensionTree.tree.children)) : (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.colHeaderTree, options.indicators)),
76
77
  !1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, !1, this),
77
- columnDimensionTree = new DimensionTree(null !== (_m = this.dataset.colHeaderTree) && void 0 !== _m ? _m : [], this.layoutNodeId)),
78
+ columnDimensionTree = new DimensionTree(null !== (_o = this.dataset.colHeaderTree) && void 0 !== _o ? _o : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_p = this.options.columnExpandLevel) && void 0 !== _p ? _p : 1 : void 0)),
78
79
  options.rowTree ? rowDimensionTree.hasHideNode && (deleteHideIndicatorNode(rowDimensionTree.tree.children, options.indicators, !0, this),
79
80
  rowDimensionTree.reset(rowDimensionTree.tree.children)) : (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.rowHeaderTree, options.indicators)),
80
81
  !1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, !1, this),
81
- rowDimensionTree = new DimensionTree(null !== (_o = this.dataset.rowHeaderTree) && void 0 !== _o ? _o : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_p = this.options.rowExpandLevel) && void 0 !== _p ? _p : 1 : void 0)),
82
+ rowDimensionTree = new DimensionTree(null !== (_q = this.dataset.rowHeaderTree) && void 0 !== _q ? _q : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_r = this.options.rowExpandLevel) && void 0 !== _r ? _r : 1 : void 0)),
82
83
  this.internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
83
84
  }
84
- if (this._changePivotSortStateBySortRules(), (null !== (_r = null === (_q = options.pivotSortState) || void 0 === _q ? void 0 : _q.length) && void 0 !== _r ? _r : 0) > 0 && (this.pivotSortState = [],
85
+ if (this._changePivotSortStateBySortRules(), (null !== (_t = null === (_s = options.pivotSortState) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0) > 0 && (this.pivotSortState = [],
85
86
  this.pivotSortState = options.pivotSortState), "node" !== Env.mode && (this.editorManager = new EditManager(this)),
86
87
  this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.stateManager.initCheckedState(records),
87
88
  this.scenegraph.createSceneGraph(), options.title) {
88
89
  const Title = Factory.getComponent("title");
89
90
  this.internalProps.title = new Title(options.title, this), this.scenegraph.resize();
90
91
  }
91
- if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_s = this.internalProps.emptyTip) || void 0 === _s || _s.resetVisible(); else {
92
+ if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_u = this.internalProps.emptyTip) || void 0 === _u || _u.resetVisible(); else {
92
93
  const EmptyTip = Factory.getComponent("emptyTip");
93
- this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_t = this.internalProps.emptyTip) || void 0 === _t || _t.resetVisible();
94
+ this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_v = this.internalProps.emptyTip) || void 0 === _v || _v.resetVisible();
94
95
  }
95
96
  setTimeout((() => {
96
97
  this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
@@ -125,9 +126,10 @@ export class PivotTable extends BaseTable {
125
126
  return ifCan;
126
127
  }
127
128
  updateOption(options) {
128
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
129
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
129
130
  const internalProps = this.internalProps;
130
- if (super.updateOption(options), this.layoutNodeId = {
131
+ if (super.updateOption(options), options.rowHierarchyType || (options.rowHierarchyType = "grid"),
132
+ options.columnHierarchyType || (options.columnHierarchyType = "grid"), this.layoutNodeId = {
131
133
  seqId: 0
132
134
  }, this.internalProps.columns = cloneDeep(options.columns), this.internalProps.rows = cloneDeep(options.rows),
133
135
  this.internalProps.indicators = (null === (_a = options.indicators) || void 0 === _a ? void 0 : _a.length) ? cloneDeepSpec(options.indicators) : [],
@@ -141,7 +143,7 @@ export class PivotTable extends BaseTable {
141
143
  internalProps.rowResizeType = null !== (_f = options.rowResizeType) && void 0 !== _f ? _f : "row",
142
144
  internalProps.dataConfig = cloneDeep(options.dataConfig), this.internalProps.columnWidthConfig = options.columnWidthConfig,
143
145
  this.internalProps.columnWidthConfigForRowHeader = options.columnWidthConfigForRowHeader,
144
- "tree" === (null == options ? void 0 : options.rowHierarchyType) && "tree" === this.internalProps.layoutMap.rowHierarchyType && this.internalProps.layoutMap.rowExpandLevel === (null == options ? void 0 : options.rowExpandLevel)) {
146
+ "grid" !== (null == options ? void 0 : options.rowHierarchyType) && "grid" !== this.internalProps.layoutMap.rowHierarchyType && this.internalProps.layoutMap.rowExpandLevel === (null == options ? void 0 : options.rowExpandLevel)) {
145
147
  const beforeRowDimensions = this.internalProps.layoutMap.rowDimensionTree.tree.children;
146
148
  null === (_g = this.internalProps.rowTree) || void 0 === _g || _g.forEach(((node, index) => {
147
149
  const beforeRowDimension = beforeRowDimensions.find((item => item.dimensionKey === node.dimensionKey && item.value === node.value));
@@ -152,8 +154,8 @@ export class PivotTable extends BaseTable {
152
154
  if (this.internalProps.recordsIsTwoDimensionalArray = !1, (null === (_h = null == records ? void 0 : records[0]) || void 0 === _h ? void 0 : _h.constructor) === Array && (this.internalProps.recordsIsTwoDimensionalArray = !0),
153
155
  !1 === (null === (_j = options.customConfig) || void 0 === _j ? void 0 : _j.enableDataAnalysis)) {
154
156
  let columnDimensionTree, rowDimensionTree;
155
- options.columnTree && (columnDimensionTree = new DimensionTree(null !== (_k = this.internalProps.columnTree) && void 0 !== _k ? _k : [], this.layoutNodeId)),
156
- options.rowTree && (rowDimensionTree = new DimensionTree(null !== (_l = this.internalProps.rowTree) && void 0 !== _l ? _l : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_m = this.options.rowExpandLevel) && void 0 !== _m ? _m : 1 : void 0)),
157
+ options.columnTree && (columnDimensionTree = new DimensionTree(null !== (_k = this.internalProps.columnTree) && void 0 !== _k ? _k : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_l = this.options.columnExpandLevel) && void 0 !== _l ? _l : 1 : void 0)),
158
+ options.rowTree && (rowDimensionTree = new DimensionTree(null !== (_m = this.internalProps.rowTree) && void 0 !== _m ? _m : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_o = this.options.rowExpandLevel) && void 0 !== _o ? _o : 1 : void 0)),
157
159
  internalProps.layoutMap = new PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree),
158
160
  !1 === this.internalProps.recordsIsTwoDimensionalArray && (this.flatDataToObjects = new FlatDataToObjects({
159
161
  rows: internalProps.layoutMap.fullRowDimensionKeys,
@@ -165,18 +167,18 @@ export class PivotTable extends BaseTable {
165
167
  } else {
166
168
  const keysResults = parseColKeyRowKeyForPivotTable(this, options), {rowKeys: rowKeys, columnKeys: columnKeys, indicatorKeys: indicatorKeys} = keysResults;
167
169
  let {columnDimensionTree: columnDimensionTree, rowDimensionTree: rowDimensionTree} = keysResults;
168
- this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_o = options.indicatorsAsCol) || void 0 === _o || _o, records, options.rowHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, !1, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords),
170
+ this.dataset = new Dataset(internalProps.dataConfig, rowKeys, columnKeys, indicatorKeys, this.internalProps.indicators, null === (_p = options.indicatorsAsCol) || void 0 === _p || _p, records, options.rowHierarchyType, options.columnHierarchyType, this.internalProps.columnTree, this.internalProps.rowTree, !1, !!options.extensionRows, !!options.parseCustomTreeToMatchRecords),
169
171
  options.columnTree ? columnDimensionTree.hasHideNode && (deleteHideIndicatorNode(columnDimensionTree.tree.children, options.indicators, !0, this),
170
172
  columnDimensionTree.reset(columnDimensionTree.tree.children)) : (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.colHeaderTree, options.indicators)),
171
173
  !1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, !1, this),
172
- columnDimensionTree = new DimensionTree(null !== (_p = this.dataset.colHeaderTree) && void 0 !== _p ? _p : [], this.layoutNodeId)),
174
+ columnDimensionTree = new DimensionTree(null !== (_q = this.dataset.colHeaderTree) && void 0 !== _q ? _q : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_r = this.options.columnExpandLevel) && void 0 !== _r ? _r : 1 : void 0)),
173
175
  options.rowTree ? rowDimensionTree.hasHideNode && (deleteHideIndicatorNode(rowDimensionTree.tree.children, options.indicators, !0, this),
174
176
  rowDimensionTree.reset(rowDimensionTree.tree.children)) : (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = supplementIndicatorNodesForCustomTree(this.dataset.rowHeaderTree, options.indicators)),
175
177
  !1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, !1, this),
176
- rowDimensionTree = new DimensionTree(null !== (_q = this.dataset.rowHeaderTree) && void 0 !== _q ? _q : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_r = this.options.rowExpandLevel) && void 0 !== _r ? _r : 1 : void 0)),
178
+ rowDimensionTree = new DimensionTree(null !== (_s = this.dataset.rowHeaderTree) && void 0 !== _s ? _s : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_t = this.options.rowExpandLevel) && void 0 !== _t ? _t : 1 : void 0)),
177
179
  internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
178
180
  }
179
- if (this._changePivotSortStateBySortRules(), (null !== (_t = null === (_s = options.pivotSortState) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0) > 0 && (this.pivotSortState = [],
181
+ if (this._changePivotSortStateBySortRules(), (null !== (_v = null === (_u = options.pivotSortState) || void 0 === _u ? void 0 : _u.length) && void 0 !== _v ? _v : 0) > 0 && (this.pivotSortState = [],
180
182
  this.pivotSortState = options.pivotSortState), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1,
181
183
  internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
182
184
  var _a;
@@ -186,9 +188,9 @@ export class PivotTable extends BaseTable {
186
188
  const Title = Factory.getComponent("title");
187
189
  this.internalProps.title = new Title(options.title, this), this.scenegraph.resize();
188
190
  }
189
- if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_u = this.internalProps.emptyTip) || void 0 === _u || _u.resetVisible(); else {
191
+ if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_w = this.internalProps.emptyTip) || void 0 === _w || _w.resetVisible(); else {
190
192
  const EmptyTip = Factory.getComponent("emptyTip");
191
- this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_v = this.internalProps.emptyTip) || void 0 === _v || _v.resetVisible();
193
+ this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_x = this.internalProps.emptyTip) || void 0 === _x || _x.resetVisible();
192
194
  }
193
195
  return new Promise((resolve => {
194
196
  setTimeout(resolve, 0);
@@ -216,12 +218,15 @@ export class PivotTable extends BaseTable {
216
218
  table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_d = this.options.frozenRowCount) && void 0 !== _d ? _d : 0),
217
219
  table.bottomFrozenRowCount !== (null !== (_e = this.options.bottomFrozenRowCount) && void 0 !== _e ? _e : 0) && (table.bottomFrozenRowCount = null !== (_f = this.options.bottomFrozenRowCount) && void 0 !== _f ? _f : 0),
218
220
  table.rightFrozenColCount !== (null !== (_g = this.options.rightFrozenColCount) && void 0 !== _g ? _g : 0) && (table.rightFrozenColCount = null !== (_h = this.options.rightFrozenColCount) && void 0 !== _h ? _h : 0),
219
- this.stateManager.setFrozenCol(this.internalProps.frozenColCount));
221
+ this.stateManager.setFrozenCol(this.internalProps.frozenColCount), this.stateManager.setFrozenRow(this.frozenRowCount));
220
222
  }
221
223
  _getSortFuncFromHeaderOption(columns, field, fieldKey) {}
222
224
  get rowHierarchyType() {
223
225
  return this.internalProps.layoutMap.rowHierarchyType;
224
226
  }
227
+ get columnHierarchyType() {
228
+ return this.internalProps.layoutMap.columnHierarchyType;
229
+ }
225
230
  _syncHierarchyState(sourceNode, targetNode) {
226
231
  var _a, _b;
227
232
  sourceNode.value === targetNode.value && sourceNode.dimensionKey === targetNode.dimensionKey && (targetNode.hierarchyState = null !== (_a = targetNode.hierarchyState) && void 0 !== _a ? _a : (null == targetNode ? void 0 : targetNode.children) ? sourceNode.hierarchyState : void 0,
@@ -650,19 +655,25 @@ export class PivotTable extends BaseTable {
650
655
  }
651
656
  _refreshHierarchyState(col, row, recalculateColWidths = !0, beforeUpdateCell) {
652
657
  var _a, _b;
658
+ this.frozenColCount, this.frozenRowCount;
659
+ const visibleStartRow = this.getBodyVisibleRowRange().rowStart;
660
+ this.internalProps._oldRowCount = this.rowCount, this.internalProps._oldColCount = this.colCount;
653
661
  let notFillWidth = !1, notFillHeight = !1;
654
662
  this.stateManager.updateHoverIcon(col, row, void 0, void 0);
655
663
  const checkHasChart = this.internalProps.layoutMap.checkHasChart();
656
664
  checkHasChart && (this.autoFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
657
665
  this.autoFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight));
658
- const result = this.internalProps.layoutMap.toggleHierarchyState(col, row);
659
- beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount(), this.clearCellStyleCache(),
660
- this.scenegraph.updateHierarchyIcon(col, row), null === (_a = this.reactCustomLayout) || void 0 === _a || _a.clearCache(),
661
- this.scenegraph.updateRow(result.removeCellPositions, result.addCellPositions, result.updateCellPositions, recalculateColWidths),
666
+ const result = this.internalProps.layoutMap.isRowHeader(col, row) ? this.internalProps.layoutMap.toggleHierarchyState(col, row) : this.internalProps.layoutMap.toggleHierarchyStateForColumnTree(col, row);
667
+ beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount();
668
+ this.frozenColCount, this.frozenRowCount;
669
+ this.clearCellStyleCache(), "tree" === this.rowHierarchyType && this.scenegraph.updateHierarchyIcon(col, row),
670
+ null === (_a = this.reactCustomLayout) || void 0 === _a || _a.clearCache(), "grid-tree" !== this.rowHierarchyType && "grid-tree" !== this.columnHierarchyType ? this.scenegraph.updateRow(result.removeCellPositionsRowDirection, result.addCellPositionsRowDirection, result.updateCellPositionsRowDirection, recalculateColWidths) : (this.scenegraph.clearCells(),
671
+ this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.scrollToRow(visibleStartRow)),
662
672
  null === (_b = this.reactCustomLayout) || void 0 === _b || _b.updateAllCustomCell(),
663
673
  checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
664
674
  this.autoFillHeight && !notFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight),
665
- ("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1));
675
+ ("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1)),
676
+ this.internalProps._oldRowCount = void 0, this.internalProps._oldColCount = void 0;
666
677
  }
667
678
  getHeaderCellAddressByPath(dimensionPaths) {
668
679
  return this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
@@ -694,9 +705,6 @@ export class PivotTable extends BaseTable {
694
705
  getCellHeaderTreeNodes(col, row) {
695
706
  return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(col, row);
696
707
  }
697
- _hasHierarchyTreeHeader() {
698
- return "tree" === this.internalProps.layoutMap.rowHierarchyType;
699
- }
700
708
  getMenuInfo(col, row, type) {
701
709
  const dimensionInfos = this.internalProps.layoutMap.getPivotDimensionInfo(col, row);
702
710
  return {
@@ -708,7 +716,7 @@ export class PivotTable extends BaseTable {
708
716
  };
709
717
  }
710
718
  setRecords(records) {
711
- var _a, _b, _c, _d, _e, _f, _g;
719
+ var _a, _b, _c, _d, _e, _f, _g, _h;
712
720
  const oldHoverState = {
713
721
  col: this.stateManager.hover.cellPos.col,
714
722
  row: this.stateManager.hover.cellPos.row
@@ -725,9 +733,9 @@ export class PivotTable extends BaseTable {
725
733
  }, records)); else {
726
734
  let columnDimensionTree, rowDimensionTree;
727
735
  this.dataset.setRecords(records), options.columnTree ? columnDimensionTree = internalProps.layoutMap.columnDimensionTree : (!1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && deleteHideIndicatorNode(this.dataset.colHeaderTree, options.indicators, !1, this),
728
- columnDimensionTree = new DimensionTree(null !== (_c = this.dataset.colHeaderTree) && void 0 !== _c ? _c : [], this.layoutNodeId)),
736
+ columnDimensionTree = new DimensionTree(null !== (_c = this.dataset.colHeaderTree) && void 0 !== _c ? _c : [], this.layoutNodeId, this.options.columnHierarchyType, "grid" !== this.options.columnHierarchyType ? null !== (_d = this.options.columnExpandLevel) && void 0 !== _d ? _d : 1 : void 0)),
729
737
  options.rowTree ? rowDimensionTree = internalProps.layoutMap.rowDimensionTree : (!1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && deleteHideIndicatorNode(this.dataset.rowHeaderTree, options.indicators, !1, this),
730
- rowDimensionTree = new DimensionTree(null !== (_d = this.dataset.rowHeaderTree) && void 0 !== _d ? _d : [], this.layoutNodeId, this.options.rowHierarchyType, "tree" === this.options.rowHierarchyType ? null !== (_e = this.options.rowExpandLevel) && void 0 !== _e ? _e : 1 : void 0)),
738
+ rowDimensionTree = new DimensionTree(null !== (_e = this.dataset.rowHeaderTree) && void 0 !== _e ? _e : [], this.layoutNodeId, this.options.rowHierarchyType, "grid" !== this.options.rowHierarchyType ? null !== (_f = this.options.rowExpandLevel) && void 0 !== _f ? _f : 1 : void 0)),
731
739
  internalProps.layoutMap = new PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
732
740
  this.pivotSortState = [], options.pivotSortState && (this.pivotSortState = options.pivotSortState);
733
741
  }
@@ -735,9 +743,9 @@ export class PivotTable extends BaseTable {
735
743
  this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
736
744
  this.internalProps.title && !this.internalProps.title.isReleased && (this._updateSize(),
737
745
  this.internalProps.title.resize(), this.scenegraph.resize()), this.eventManager.updateEventBinder(),
738
- this.options.emptyTip) if (this.internalProps.emptyTip) null === (_f = this.internalProps.emptyTip) || void 0 === _f || _f.resetVisible(); else {
746
+ this.options.emptyTip) if (this.internalProps.emptyTip) null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible(); else {
739
747
  const EmptyTip = Factory.getComponent("emptyTip");
740
- this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible();
748
+ this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();
741
749
  }
742
750
  }
743
751
  startEditCell(col, row, value) {