@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/cjs/PivotTable.js CHANGED
@@ -33,12 +33,13 @@ const ts_types_1 = require("./ts-types"), pivot_header_layout_1 = require("./lay
33
33
 
34
34
  class PivotTable extends BaseTable_1.BaseTable {
35
35
  constructor(container, options) {
36
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
36
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
37
37
  if ("node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
38
38
  container = container.container ? container.container : null), super(container, options),
39
39
  this.layoutNodeId = {
40
40
  seqId: 0
41
41
  }, options) {
42
+ options.rowHierarchyType || (options.rowHierarchyType = "grid"), options.columnHierarchyType || (options.columnHierarchyType = "grid"),
42
43
  options.layout && Object.assign(options, options.layout), this.internalProps.columns = (0,
43
44
  vutils_1.cloneDeep)(options.columns), this.internalProps.rows = (0, vutils_1.cloneDeep)(options.rows),
44
45
  this.internalProps.indicators = (0, vutils_extension_1.cloneDeepSpec)(options.indicators),
@@ -54,7 +55,7 @@ class PivotTable extends BaseTable_1.BaseTable {
54
55
  const records = this.internalProps.records;
55
56
  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),
56
57
  !1 === (null === (_g = options.customConfig) || void 0 === _g ? void 0 : _g.enableDataAnalysis)) {
57
- const columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_h = this.internalProps.columnTree) && void 0 !== _h ? _h : [], this.layoutNodeId), rowDimensionTree = new tree_helper_1.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);
58
+ const columnDimensionTree = new tree_helper_1.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 tree_helper_1.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);
58
59
  this.internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree),
59
60
  !1 === this.internalProps.recordsIsTwoDimensionalArray && (this.flatDataToObjects = new flatDataToObject_1.FlatDataToObjects({
60
61
  rows: this.internalProps.layoutMap.fullRowDimensionKeys,
@@ -66,31 +67,31 @@ class PivotTable extends BaseTable_1.BaseTable {
66
67
  } else {
67
68
  const keysResults = (0, layout_helper_1.parseColKeyRowKeyForPivotTable)(this, options), {rowKeys: rowKeys, columnKeys: columnKeys, indicatorKeys: indicatorKeys} = keysResults;
68
69
  let {columnDimensionTree: columnDimensionTree, rowDimensionTree: rowDimensionTree} = keysResults;
69
- this.dataset = new dataset_1.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),
70
+ this.dataset = new dataset_1.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),
70
71
  options.columnTree ? columnDimensionTree.hasHideNode && ((0, layout_helper_1.deleteHideIndicatorNode)(columnDimensionTree.tree.children, options.indicators, !0, this),
71
72
  columnDimensionTree.reset(columnDimensionTree.tree.children)) : (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = (0,
72
73
  layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.colHeaderTree, options.indicators)),
73
74
  !1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && (0,
74
75
  layout_helper_1.deleteHideIndicatorNode)(this.dataset.colHeaderTree, options.indicators, !1, this),
75
- columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_m = this.dataset.colHeaderTree) && void 0 !== _m ? _m : [], this.layoutNodeId)),
76
+ columnDimensionTree = new tree_helper_1.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)),
76
77
  options.rowTree ? rowDimensionTree.hasHideNode && ((0, layout_helper_1.deleteHideIndicatorNode)(rowDimensionTree.tree.children, options.indicators, !0, this),
77
78
  rowDimensionTree.reset(rowDimensionTree.tree.children)) : (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = (0,
78
79
  layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.rowHeaderTree, options.indicators)),
79
80
  !1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && (0,
80
81
  layout_helper_1.deleteHideIndicatorNode)(this.dataset.rowHeaderTree, options.indicators, !1, this),
81
- rowDimensionTree = new tree_helper_1.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 tree_helper_1.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 pivot_header_layout_1.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_1.Env.mode && (this.editorManager = new edit_manager_1.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_1.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_1.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_1.TABLE_EVENT_TYPE.INITIALIZED, null);
@@ -125,9 +126,10 @@ class PivotTable extends BaseTable_1.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 = (0, vutils_1.cloneDeep)(options.columns), this.internalProps.rows = (0,
133
135
  vutils_1.cloneDeep)(options.rows), this.internalProps.indicators = (null === (_a = options.indicators) || void 0 === _a ? void 0 : _a.length) ? (0,
@@ -141,7 +143,7 @@ class PivotTable extends BaseTable_1.BaseTable {
141
143
  internalProps.rowResizeType = null !== (_f = options.rowResizeType) && void 0 !== _f ? _f : "row",
142
144
  internalProps.dataConfig = (0, vutils_1.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 @@ class PivotTable extends BaseTable_1.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 tree_helper_1.DimensionTree(null !== (_k = this.internalProps.columnTree) && void 0 !== _k ? _k : [], this.layoutNodeId)),
156
- options.rowTree && (rowDimensionTree = new tree_helper_1.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 tree_helper_1.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 tree_helper_1.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 pivot_header_layout_1.PivotHeaderLayoutMap(this, null, columnDimensionTree, rowDimensionTree),
158
160
  !1 === this.internalProps.recordsIsTwoDimensionalArray && (this.flatDataToObjects = new flatDataToObject_1.FlatDataToObjects({
159
161
  rows: internalProps.layoutMap.fullRowDimensionKeys,
@@ -165,22 +167,22 @@ class PivotTable extends BaseTable_1.BaseTable {
165
167
  } else {
166
168
  const keysResults = (0, layout_helper_1.parseColKeyRowKeyForPivotTable)(this, options), {rowKeys: rowKeys, columnKeys: columnKeys, indicatorKeys: indicatorKeys} = keysResults;
167
169
  let {columnDimensionTree: columnDimensionTree, rowDimensionTree: rowDimensionTree} = keysResults;
168
- this.dataset = new dataset_1.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_1.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 && ((0, layout_helper_1.deleteHideIndicatorNode)(columnDimensionTree.tree.children, options.indicators, !0, this),
170
172
  columnDimensionTree.reset(columnDimensionTree.tree.children)) : (!1 !== options.indicatorsAsCol && (this.dataset.colHeaderTree = (0,
171
173
  layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.colHeaderTree, options.indicators)),
172
174
  !1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && (0,
173
175
  layout_helper_1.deleteHideIndicatorNode)(this.dataset.colHeaderTree, options.indicators, !1, this),
174
- columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_p = this.dataset.colHeaderTree) && void 0 !== _p ? _p : [], this.layoutNodeId)),
176
+ columnDimensionTree = new tree_helper_1.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)),
175
177
  options.rowTree ? rowDimensionTree.hasHideNode && ((0, layout_helper_1.deleteHideIndicatorNode)(rowDimensionTree.tree.children, options.indicators, !0, this),
176
178
  rowDimensionTree.reset(rowDimensionTree.tree.children)) : (!1 === options.indicatorsAsCol && (this.dataset.rowHeaderTree = (0,
177
179
  layout_helper_1.supplementIndicatorNodesForCustomTree)(this.dataset.rowHeaderTree, options.indicators)),
178
180
  !1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && (0,
179
181
  layout_helper_1.deleteHideIndicatorNode)(this.dataset.rowHeaderTree, options.indicators, !1, this),
180
- rowDimensionTree = new tree_helper_1.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)),
182
+ rowDimensionTree = new tree_helper_1.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)),
181
183
  internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree);
182
184
  }
183
- if (this._changePivotSortStateBySortRules(), (null !== (_t = null === (_s = options.pivotSortState) || void 0 === _s ? void 0 : _s.length) && void 0 !== _t ? _t : 0) > 0 && (this.pivotSortState = [],
185
+ if (this._changePivotSortStateBySortRules(), (null !== (_v = null === (_u = options.pivotSortState) || void 0 === _u ? void 0 : _u.length) && void 0 !== _v ? _v : 0) > 0 && (this.pivotSortState = [],
184
186
  this.pivotSortState = options.pivotSortState), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1,
185
187
  internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
186
188
  var _a;
@@ -190,9 +192,9 @@ class PivotTable extends BaseTable_1.BaseTable {
190
192
  const Title = factory_1.Factory.getComponent("title");
191
193
  this.internalProps.title = new Title(options.title, this), this.scenegraph.resize();
192
194
  }
193
- if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_u = this.internalProps.emptyTip) || void 0 === _u || _u.resetVisible(); else {
195
+ if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_w = this.internalProps.emptyTip) || void 0 === _w || _w.resetVisible(); else {
194
196
  const EmptyTip = factory_1.Factory.getComponent("emptyTip");
195
- this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_v = this.internalProps.emptyTip) || void 0 === _v || _v.resetVisible();
197
+ this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_x = this.internalProps.emptyTip) || void 0 === _x || _x.resetVisible();
196
198
  }
197
199
  return new Promise((resolve => {
198
200
  setTimeout(resolve, 0);
@@ -220,12 +222,15 @@ class PivotTable extends BaseTable_1.BaseTable {
220
222
  table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_d = this.options.frozenRowCount) && void 0 !== _d ? _d : 0),
221
223
  table.bottomFrozenRowCount !== (null !== (_e = this.options.bottomFrozenRowCount) && void 0 !== _e ? _e : 0) && (table.bottomFrozenRowCount = null !== (_f = this.options.bottomFrozenRowCount) && void 0 !== _f ? _f : 0),
222
224
  table.rightFrozenColCount !== (null !== (_g = this.options.rightFrozenColCount) && void 0 !== _g ? _g : 0) && (table.rightFrozenColCount = null !== (_h = this.options.rightFrozenColCount) && void 0 !== _h ? _h : 0),
223
- this.stateManager.setFrozenCol(this.internalProps.frozenColCount));
225
+ this.stateManager.setFrozenCol(this.internalProps.frozenColCount), this.stateManager.setFrozenRow(this.frozenRowCount));
224
226
  }
225
227
  _getSortFuncFromHeaderOption(columns, field, fieldKey) {}
226
228
  get rowHierarchyType() {
227
229
  return this.internalProps.layoutMap.rowHierarchyType;
228
230
  }
231
+ get columnHierarchyType() {
232
+ return this.internalProps.layoutMap.columnHierarchyType;
233
+ }
229
234
  _syncHierarchyState(sourceNode, targetNode) {
230
235
  var _a, _b;
231
236
  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,
@@ -655,19 +660,25 @@ class PivotTable extends BaseTable_1.BaseTable {
655
660
  }
656
661
  _refreshHierarchyState(col, row, recalculateColWidths = !0, beforeUpdateCell) {
657
662
  var _a, _b;
663
+ this.frozenColCount, this.frozenRowCount;
664
+ const visibleStartRow = this.getBodyVisibleRowRange().rowStart;
665
+ this.internalProps._oldRowCount = this.rowCount, this.internalProps._oldColCount = this.colCount;
658
666
  let notFillWidth = !1, notFillHeight = !1;
659
667
  this.stateManager.updateHoverIcon(col, row, void 0, void 0);
660
668
  const checkHasChart = this.internalProps.layoutMap.checkHasChart();
661
669
  checkHasChart && (this.autoFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
662
670
  this.autoFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight));
663
- const result = this.internalProps.layoutMap.toggleHierarchyState(col, row);
664
- beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount(), this.clearCellStyleCache(),
665
- this.scenegraph.updateHierarchyIcon(col, row), null === (_a = this.reactCustomLayout) || void 0 === _a || _a.clearCache(),
666
- this.scenegraph.updateRow(result.removeCellPositions, result.addCellPositions, result.updateCellPositions, recalculateColWidths),
671
+ const result = this.internalProps.layoutMap.isRowHeader(col, row) ? this.internalProps.layoutMap.toggleHierarchyState(col, row) : this.internalProps.layoutMap.toggleHierarchyStateForColumnTree(col, row);
672
+ beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount();
673
+ this.frozenColCount, this.frozenRowCount;
674
+ this.clearCellStyleCache(), "tree" === this.rowHierarchyType && this.scenegraph.updateHierarchyIcon(col, row),
675
+ 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(),
676
+ this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.scrollToRow(visibleStartRow)),
667
677
  null === (_b = this.reactCustomLayout) || void 0 === _b || _b.updateAllCustomCell(),
668
678
  checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
669
679
  this.autoFillHeight && !notFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight),
670
- ("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1));
680
+ ("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1)),
681
+ this.internalProps._oldRowCount = void 0, this.internalProps._oldColCount = void 0;
671
682
  }
672
683
  getHeaderCellAddressByPath(dimensionPaths) {
673
684
  return this.internalProps.layoutMap.getPivotCellAdress(dimensionPaths);
@@ -699,9 +710,6 @@ class PivotTable extends BaseTable_1.BaseTable {
699
710
  getCellHeaderTreeNodes(col, row) {
700
711
  return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(col, row);
701
712
  }
702
- _hasHierarchyTreeHeader() {
703
- return "tree" === this.internalProps.layoutMap.rowHierarchyType;
704
- }
705
713
  getMenuInfo(col, row, type) {
706
714
  const dimensionInfos = this.internalProps.layoutMap.getPivotDimensionInfo(col, row);
707
715
  return {
@@ -713,7 +721,7 @@ class PivotTable extends BaseTable_1.BaseTable {
713
721
  };
714
722
  }
715
723
  setRecords(records) {
716
- var _a, _b, _c, _d, _e, _f, _g;
724
+ var _a, _b, _c, _d, _e, _f, _g, _h;
717
725
  const oldHoverState = {
718
726
  col: this.stateManager.hover.cellPos.col,
719
727
  row: this.stateManager.hover.cellPos.row
@@ -731,10 +739,10 @@ class PivotTable extends BaseTable_1.BaseTable {
731
739
  let columnDimensionTree, rowDimensionTree;
732
740
  this.dataset.setRecords(records), options.columnTree ? columnDimensionTree = internalProps.layoutMap.columnDimensionTree : (!1 !== options.indicatorsAsCol && options.indicators && this.dataset.colHeaderTree && (0,
733
741
  layout_helper_1.deleteHideIndicatorNode)(this.dataset.colHeaderTree, options.indicators, !1, this),
734
- columnDimensionTree = new tree_helper_1.DimensionTree(null !== (_c = this.dataset.colHeaderTree) && void 0 !== _c ? _c : [], this.layoutNodeId)),
742
+ columnDimensionTree = new tree_helper_1.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)),
735
743
  options.rowTree ? rowDimensionTree = internalProps.layoutMap.rowDimensionTree : (!1 === options.indicatorsAsCol && this.dataset.rowHeaderTree && options.indicators && (0,
736
744
  layout_helper_1.deleteHideIndicatorNode)(this.dataset.rowHeaderTree, options.indicators, !1, this),
737
- rowDimensionTree = new tree_helper_1.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)),
745
+ rowDimensionTree = new tree_helper_1.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)),
738
746
  internalProps.layoutMap = new pivot_header_layout_1.PivotHeaderLayoutMap(this, this.dataset, columnDimensionTree, rowDimensionTree),
739
747
  this.pivotSortState = [], options.pivotSortState && (this.pivotSortState = options.pivotSortState);
740
748
  }
@@ -742,9 +750,9 @@ class PivotTable extends BaseTable_1.BaseTable {
742
750
  this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row),
743
751
  this.internalProps.title && !this.internalProps.title.isReleased && (this._updateSize(),
744
752
  this.internalProps.title.resize(), this.scenegraph.resize()), this.eventManager.updateEventBinder(),
745
- this.options.emptyTip) if (this.internalProps.emptyTip) null === (_f = this.internalProps.emptyTip) || void 0 === _f || _f.resetVisible(); else {
753
+ this.options.emptyTip) if (this.internalProps.emptyTip) null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible(); else {
746
754
  const EmptyTip = factory_1.Factory.getComponent("emptyTip");
747
- this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible();
755
+ this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible();
748
756
  }
749
757
  }
750
758
  startEditCell(col, row, value) {