@visactor/vtable 0.9.1 → 0.9.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 (167) hide show
  1. package/cjs/core/BaseTable.d.ts +1 -1
  2. package/cjs/core/BaseTable.js +10 -8
  3. package/cjs/core/BaseTable.js.map +1 -1
  4. package/cjs/event/event.js +1 -1
  5. package/cjs/event/event.js.map +1 -1
  6. package/cjs/index.d.ts +1 -1
  7. package/cjs/index.js +1 -1
  8. package/cjs/index.js.map +1 -1
  9. package/cjs/layout/pivot-header-layout.d.ts +2 -0
  10. package/cjs/layout/pivot-header-layout.js +26 -0
  11. package/cjs/layout/pivot-header-layout.js.map +1 -1
  12. package/cjs/layout/pivot-layout.d.ts +2 -0
  13. package/cjs/layout/pivot-layout.js +26 -0
  14. package/cjs/layout/pivot-layout.js.map +1 -1
  15. package/cjs/layout/simple-header-layout.d.ts +2 -0
  16. package/cjs/layout/simple-header-layout.js +6 -0
  17. package/cjs/layout/simple-header-layout.js.map +1 -1
  18. package/cjs/render/layout/container.js +13 -0
  19. package/cjs/render/layout/container.js.map +1 -1
  20. package/cjs/scenegraph/graphic/text.js +5 -5
  21. package/cjs/scenegraph/graphic/text.js.map +1 -1
  22. package/cjs/scenegraph/group-creater/cell-helper.d.ts +1 -1
  23. package/cjs/scenegraph/group-creater/cell-helper.js +14 -10
  24. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  25. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +2 -1
  26. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -4
  27. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  28. package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  29. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -2
  30. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  31. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +2 -1
  32. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +2 -3
  33. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  34. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -2
  35. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -18
  36. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  37. package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  38. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -2
  39. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  40. package/cjs/scenegraph/group-creater/column-helper.js +9 -30
  41. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  42. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +31 -12
  43. package/cjs/scenegraph/group-creater/progress/proxy.js +118 -123
  44. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  45. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -0
  46. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +112 -0
  47. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -0
  48. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +2 -0
  49. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +109 -0
  50. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -0
  51. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.d.ts +2 -0
  52. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +24 -0
  53. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -0
  54. package/cjs/scenegraph/layout/compute-col-width.d.ts +9 -1
  55. package/cjs/scenegraph/layout/compute-col-width.js +11 -9
  56. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  57. package/cjs/scenegraph/layout/compute-row-height.d.ts +3 -0
  58. package/cjs/scenegraph/layout/compute-row-height.js +162 -0
  59. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -0
  60. package/cjs/scenegraph/layout/update-height.js +3 -2
  61. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  62. package/cjs/scenegraph/layout/update-width.js +3 -2
  63. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  64. package/cjs/scenegraph/scenegraph.d.ts +4 -5
  65. package/cjs/scenegraph/scenegraph.js +23 -42
  66. package/cjs/scenegraph/scenegraph.js.map +1 -1
  67. package/cjs/scenegraph/stick-text/index.d.ts +1 -0
  68. package/cjs/scenegraph/stick-text/index.js +16 -2
  69. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  70. package/cjs/scenegraph/utils/text-icon-layout.d.ts +2 -1
  71. package/cjs/scenegraph/utils/text-icon-layout.js +6 -5
  72. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  73. package/cjs/state/hover/col.js +4 -4
  74. package/cjs/state/hover/col.js.map +1 -1
  75. package/cjs/tools/NumberMap.d.ts +1 -0
  76. package/cjs/tools/NumberMap.js +3 -0
  77. package/cjs/tools/NumberMap.js.map +1 -1
  78. package/cjs/ts-types/base-table.d.ts +12 -0
  79. package/cjs/ts-types/base-table.js.map +1 -1
  80. package/cjs/ts-types/list-table/layout-map/api.d.ts +2 -0
  81. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  82. package/dist/vtable.js +7621 -7036
  83. package/dist/vtable.min.js +2 -2
  84. package/es/core/BaseTable.d.ts +1 -1
  85. package/es/core/BaseTable.js +10 -8
  86. package/es/core/BaseTable.js.map +1 -1
  87. package/es/event/event.js +2 -2
  88. package/es/event/event.js.map +1 -1
  89. package/es/index.d.ts +1 -1
  90. package/es/index.js +1 -1
  91. package/es/index.js.map +1 -1
  92. package/es/layout/pivot-header-layout.d.ts +2 -0
  93. package/es/layout/pivot-header-layout.js +26 -0
  94. package/es/layout/pivot-header-layout.js.map +1 -1
  95. package/es/layout/pivot-layout.d.ts +2 -0
  96. package/es/layout/pivot-layout.js +26 -0
  97. package/es/layout/pivot-layout.js.map +1 -1
  98. package/es/layout/simple-header-layout.d.ts +2 -0
  99. package/es/layout/simple-header-layout.js +6 -0
  100. package/es/layout/simple-header-layout.js.map +1 -1
  101. package/es/render/layout/container.js +13 -0
  102. package/es/render/layout/container.js.map +1 -1
  103. package/es/scenegraph/graphic/text.js +5 -5
  104. package/es/scenegraph/graphic/text.js.map +1 -1
  105. package/es/scenegraph/group-creater/cell-helper.d.ts +1 -1
  106. package/es/scenegraph/group-creater/cell-helper.js +14 -9
  107. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  108. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +2 -1
  109. package/es/scenegraph/group-creater/cell-type/chart-cell.js +3 -5
  110. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  111. package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +1 -1
  112. package/es/scenegraph/group-creater/cell-type/image-cell.js +0 -3
  113. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  114. package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +2 -1
  115. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -4
  116. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  117. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +1 -2
  118. package/es/scenegraph/group-creater/cell-type/text-cell.js +3 -17
  119. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  120. package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +1 -1
  121. package/es/scenegraph/group-creater/cell-type/video-cell.js +0 -3
  122. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  123. package/es/scenegraph/group-creater/column-helper.js +8 -29
  124. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  125. package/es/scenegraph/group-creater/progress/proxy.d.ts +31 -12
  126. package/es/scenegraph/group-creater/progress/proxy.js +124 -123
  127. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  128. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +2 -0
  129. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +104 -0
  130. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -0
  131. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +2 -0
  132. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +102 -0
  133. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -0
  134. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.d.ts +2 -0
  135. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +18 -0
  136. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -0
  137. package/es/scenegraph/layout/compute-col-width.d.ts +9 -1
  138. package/es/scenegraph/layout/compute-col-width.js +9 -8
  139. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  140. package/es/scenegraph/layout/compute-row-height.d.ts +3 -0
  141. package/es/scenegraph/layout/compute-row-height.js +164 -0
  142. package/es/scenegraph/layout/compute-row-height.js.map +1 -0
  143. package/es/scenegraph/layout/update-height.js +3 -1
  144. package/es/scenegraph/layout/update-height.js.map +1 -1
  145. package/es/scenegraph/layout/update-width.js +3 -1
  146. package/es/scenegraph/layout/update-width.js.map +1 -1
  147. package/es/scenegraph/scenegraph.d.ts +4 -5
  148. package/es/scenegraph/scenegraph.js +24 -44
  149. package/es/scenegraph/scenegraph.js.map +1 -1
  150. package/es/scenegraph/stick-text/index.d.ts +1 -0
  151. package/es/scenegraph/stick-text/index.js +14 -0
  152. package/es/scenegraph/stick-text/index.js.map +1 -1
  153. package/es/scenegraph/utils/text-icon-layout.d.ts +2 -1
  154. package/es/scenegraph/utils/text-icon-layout.js +4 -4
  155. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  156. package/es/state/hover/col.js +4 -4
  157. package/es/state/hover/col.js.map +1 -1
  158. package/es/tools/NumberMap.d.ts +1 -0
  159. package/es/tools/NumberMap.js +3 -0
  160. package/es/tools/NumberMap.js.map +1 -1
  161. package/es/ts-types/base-table.d.ts +12 -0
  162. package/es/ts-types/base-table.js.map +1 -1
  163. package/es/ts-types/list-table/layout-map/api.d.ts +2 -0
  164. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  165. package/package.json +4 -4
  166. package/dist/vtable.es5.js +0 -53155
  167. package/dist/vtable.es5.min.js +0 -3
@@ -24,31 +24,51 @@ var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, gener
24
24
  }));
25
25
  };
26
26
 
27
- import { updateCellHeightForColumn } from "../../layout/update-height";
27
+ import { Group } from "../../graphic/group";
28
28
 
29
- import { emptyGroup } from "../../utils/empty-group";
29
+ import { computeColsWidth } from "../../layout/compute-col-width";
30
30
 
31
- import { getProp } from "../../utils/get-prop";
31
+ import { computeRowsHeight } from "../../layout/compute-row-height";
32
32
 
33
- import { getQuadProps } from "../../utils/padding";
33
+ import { emptyGroup } from "../../utils/empty-group";
34
34
 
35
35
  import { createColGroup } from "../column";
36
36
 
37
37
  import { createComplexColumn } from "../column-helper";
38
38
 
39
+ import { dynamicSetX } from "./update-position/dynamic-set-x";
40
+
41
+ import { dynamicSetY } from "./update-position/dynamic-set-y";
42
+
43
+ import { updateAutoRow } from "./update-position/update-auto-row";
44
+
39
45
  export class SceneProxy {
40
46
  constructor(table) {
41
- this.currentRow = 0, this.rowLimit = 1e3, this.accurateY = 0, this.rowStart = 0,
42
- this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.cellCache = new Map,
43
- this.table = table, this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount);
47
+ this.mode = "column", this.rowLimit = 1e3, this.currentRow = 0, this.rowStart = 0,
48
+ this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.colLimit = 1e3,
49
+ this.screenLeftCol = 0, this.cellCache = new Map, this.table = table, this.table.internalProps.transpose ? this.mode = "row" : this.table.isPivotTable() && (this.mode = "pivot"),
50
+ this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount);
51
+ }
52
+ setParamsForColumn() {
53
+ this.bodyLeftCol = this.table.rowHeaderLevelCount, this.bodyRightCol = this.table.colCount - 1;
54
+ const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);
55
+ this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1, this.colStart = this.bodyLeftCol;
56
+ const defaultColWidth = this.table.defaultColWidth;
57
+ this.taskColCount = 1 * Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);
58
+ const totalBodyWidth = defaultColWidth * totalActualBodyColCount, totalWidth = defaultColWidth * (this.bodyRightCol - this.bodyLeftCol + 1);
59
+ this.xLimitLeft = totalBodyWidth / 2, this.xLimitRight = totalWidth - totalBodyWidth / 2;
60
+ const widthLimit = 5 * this.table.tableNoFrameWidth;
61
+ this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth),
62
+ this.firstScreenColLimit = this.bodyLeftCol + Math.ceil(widthLimit / defaultColWidth),
63
+ this.colUpdatePos = this.bodyRightCol;
44
64
  }
45
- setParams() {
65
+ setParamsForRow() {
46
66
  this.bodyTopRow = this.table.columnHeaderLevelCount, this.bodyBottomRow = this.table.rowCount - 1,
47
67
  this.bodyLeftCol = 0, this.bodyRightCol = this.table.colCount - 1;
48
68
  const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1);
49
69
  this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1, this.rowStart = this.bodyTopRow;
50
70
  const defaultRowHeight = this.table.defaultRowHeight;
51
- this.taskRowCount = 5 * Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);
71
+ this.taskRowCount = 1 * Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);
52
72
  const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount, totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);
53
73
  this.yLimitTop = totalBodyHeight / 2, this.yLimitBottom = totalHeight - totalBodyHeight / 2;
54
74
  const heightLimit = 5 * this.table.tableNoFrameHeight;
@@ -56,10 +76,37 @@ export class SceneProxy {
56
76
  this.firstScreenRowLimit = this.bodyTopRow + Math.ceil(heightLimit / defaultRowHeight),
57
77
  this.rowUpdatePos = this.bodyBottomRow;
58
78
  }
79
+ createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, bodyGroup, xOrigin, yOrigin) {
80
+ var _a, _b, _c, _d;
81
+ return __awaiter(this, void 0, void 0, (function*() {
82
+ this.setParamsForRow(), this.setParamsForColumn(), this.table.internalProps._colWidthsMap.clear(),
83
+ this.table._clearColRangeWidthsMap(), computeColsWidth(this.table, 0, Math.min(this.firstScreenColLimit, this.table.colCount - 1)),
84
+ this.table.internalProps._rowHeightsMap.clear(), this.table._clearRowRangeHeightsMap(),
85
+ computeRowsHeight(this.table, 0, Math.min(this.firstScreenRowLimit, this.table.rowCount - 1)),
86
+ this.table.scenegraph.colHeaderGroup.setAttribute("x", this.table.getFrozenColsWidth()),
87
+ this.table.scenegraph.rowHeaderGroup.setAttribute("y", this.table.getFrozenRowsHeight()),
88
+ this.table.scenegraph.bodyGroup.setAttributes({
89
+ x: this.table.getFrozenColsWidth(),
90
+ y: this.table.getFrozenRowsHeight()
91
+ }), createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, this.table.rowHeaderLevelCount - 1, 0, this.table.columnHeaderLevelCount - 1, "cornerHeader", this.table),
92
+ createColGroup(colHeaderGroup, xOrigin, yOrigin, this.table.rowHeaderLevelCount, Math.min(this.firstScreenColLimit, this.table.colCount - 1), 0, this.table.columnHeaderLevelCount - 1, "columnHeader", this.table),
93
+ createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, this.table.rowHeaderLevelCount - 1, this.table.columnHeaderLevelCount, Math.min(this.firstScreenRowLimit, this.table.rowCount - 1), "rowHeader", this.table),
94
+ createColGroup(bodyGroup, xOrigin, yOrigin, this.table.rowHeaderLevelCount, Math.min(this.firstScreenColLimit, this.table.colCount - 1), this.table.columnHeaderLevelCount, Math.min(this.firstScreenRowLimit, this.table.rowCount - 1), "body", this.table),
95
+ bodyGroup.firstChild ? (this.currentRow = null !== (_b = null === (_a = bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.rowNumber) && void 0 !== _b ? _b : this.totalRow,
96
+ this.rowEnd = this.currentRow, this.rowUpdatePos = this.rowEnd, this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2),
97
+ this.currentCol = null !== (_d = null === (_c = bodyGroup.lastChild) || void 0 === _c ? void 0 : _c.col) && void 0 !== _d ? _d : this.totalCol,
98
+ this.colEnd = this.currentCol, this.colUpdatePos = this.colEnd, this.referenceCol = this.colStart + Math.floor((this.colEnd - this.colStart) / 2),
99
+ yield this.progress()) : (this.currentRow = this.totalRow, this.rowEnd = this.currentRow,
100
+ this.rowUpdatePos = this.rowEnd, this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2),
101
+ this.currentCol = this.totalCol, this.colEnd = this.currentCol, this.colUpdatePos = this.colEnd,
102
+ this.referenceCol = this.colStart + Math.floor((this.colEnd - this.colStart) / 2));
103
+ }));
104
+ }
59
105
  createColGroupForFirstScreen(rowHeaderGroup, bodyGroup, xOrigin, yOrigin, table) {
60
106
  var _a, _b;
61
107
  return __awaiter(this, void 0, void 0, (function*() {
62
- this.setParams(), createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.rowHeaderLevelCount - 1, table.columnHeaderLevelCount, table.rowCount - 1, "rowHeader", table, this.firstScreenRowLimit),
108
+ this.setParamsForRow(), this.setParamsForColumn(), computeRowsHeight(table, this.table.columnHeaderLevelCount, Math.min(this.firstScreenRowLimit, table.rowCount - 1)),
109
+ createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.rowHeaderLevelCount - 1, table.columnHeaderLevelCount, table.rowCount - 1, "rowHeader", table, this.firstScreenRowLimit),
63
110
  createColGroup(bodyGroup, xOrigin, yOrigin, table.rowHeaderLevelCount, table.colCount - 1, table.columnHeaderLevelCount, table.rowCount - 1, "body", table, this.firstScreenRowLimit),
64
111
  bodyGroup.firstChild ? (this.currentRow = null !== (_b = null === (_a = bodyGroup.firstChild) || void 0 === _a ? void 0 : _a.rowNumber) && void 0 !== _b ? _b : this.totalRow,
65
112
  this.rowEnd = this.currentRow, this.rowUpdatePos = this.rowEnd, this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2),
@@ -70,10 +117,12 @@ export class SceneProxy {
70
117
  progress() {
71
118
  return __awaiter(this, void 0, void 0, (function*() {
72
119
  return new Promise(((resolve, reject) => {
73
- setTimeout((() => {
74
- this.rowUpdatePos < this.rowEnd ? (this.updateCellGroupsAsync(), this.progress()) : this.currentRow < this.totalRow && (this.createRow(),
75
- this.progress()), resolve();
76
- }), 0);
120
+ setTimeout((() => __awaiter(this, void 0, void 0, (function*() {
121
+ this.colUpdatePos < this.colEnd ? (yield this.updateColCellGroupsAsync(), yield this.progress()) : this.rowUpdatePos < this.rowEnd ? (yield this.updateRowCellGroupsAsync(),
122
+ yield this.progress()) : this.currentCol < this.totalCol ? (yield this.createCol(),
123
+ yield this.progress()) : this.currentRow < this.totalRow && (yield this.createRow(),
124
+ yield this.progress()), resolve();
125
+ }))), 0);
77
126
  }));
78
127
  }));
79
128
  }
@@ -83,101 +132,64 @@ export class SceneProxy {
83
132
  this.createRowCellGroup(this.taskRowCount));
84
133
  }));
85
134
  }
135
+ createCol() {
136
+ return __awaiter(this, void 0, void 0, (function*() {
137
+ this.taskColCount && (console.log("createCol", this.currentCol, this.currentCol + this.taskColCount),
138
+ this.createColGroup(this.taskRowCount));
139
+ }));
140
+ }
86
141
  createRowCellGroup(onceCount) {
87
142
  const endRow = Math.min(this.totalRow, this.currentRow + onceCount);
143
+ computeRowsHeight(this.table, this.currentRow + 1, endRow);
88
144
  let maxHeight = 0;
89
145
  for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
90
146
  const colGroup = this.table.scenegraph.getColGroup(col), cellType = col < this.table.rowHeaderLevelCount ? "rowHeader" : "body", {height: height} = createComplexColumn(colGroup, col, colGroup.attribute.width, this.currentRow + 1, endRow, this.table.scenegraph.mergeMap, this.table.internalProps.defaultRowHeight, this.table, cellType);
91
147
  maxHeight = Math.max(maxHeight, height);
92
148
  }
93
- this.table.scenegraph.bodyGroup.setAttribute("height", maxHeight), this.table.internalProps.autoRowHeight && updateAutoRow(this.bodyLeftCol, this.bodyRightCol, this.currentRow + 1, endRow, this.table),
94
- this.currentRow = endRow, this.rowEnd = endRow, this.rowUpdatePos = this.rowEnd,
95
- this.referenceRow = Math.floor((endRow - this.rowStart) / 2), this.table.scenegraph.updateContainer(),
96
- this.table.scenegraph.updateBorderSizeAndPosition();
149
+ this.table.scenegraph.bodyGroup.setAttribute("height", maxHeight), this.currentRow = endRow,
150
+ this.rowEnd = endRow, this.rowUpdatePos = this.rowEnd, this.referenceRow = this.rowStart + Math.floor((endRow - this.rowStart) / 2),
151
+ this.table.scenegraph.updateContainer(), this.table.scenegraph.updateBorderSizeAndPosition();
152
+ }
153
+ createColGroup(onceCount) {
154
+ const endCol = Math.min(this.totalCol, this.currentCol + onceCount);
155
+ computeColsWidth(this.table, this.currentCol + 1, endCol);
156
+ const lastColumnGroup = this.table.scenegraph.bodyGroup.lastChild instanceof Group ? this.table.scenegraph.bodyGroup.lastChild : this.table.scenegraph.bodyGroup.lastChild._prev, xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width, yOrigin = lastColumnGroup.attribute.y;
157
+ createColGroup(this.table.scenegraph.bodyGroup, xOrigin, yOrigin, this.currentCol + 1, endCol, this.rowStart, this.rowEnd, "body", this.table),
158
+ this.currentCol = endCol, this.colEnd = endCol, this.colUpdatePos = this.colEnd,
159
+ this.referenceCol = this.colStart + Math.floor((endCol - this.colStart) / 2), console.log("async", this.referenceCol, this.colStart, this.colEnd),
160
+ this.table.scenegraph.updateContainer(), this.table.scenegraph.updateBorderSizeAndPosition();
97
161
  }
98
162
  setY(y) {
99
163
  return __awaiter(this, void 0, void 0, (function*() {
100
164
  y < this.yLimitTop && this.rowStart === this.bodyTopRow || y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow ? this.table.scenegraph.setBodyAndRowHeaderY(-y) : this.dynamicSetY(y);
101
165
  }));
102
166
  }
103
- dynamicSetY(y) {
167
+ setX(x) {
104
168
  return __awaiter(this, void 0, void 0, (function*() {
105
- const screenTop = this.table.getTargetRowAt(y + this.table.scenegraph.colHeaderGroup.attribute.height);
106
- if (!screenTop) return;
107
- const screenTopRow = screenTop.row;
108
- this.y = y, this.screenTopRow = screenTopRow;
109
- const deltaRow = screenTopRow - this.referenceRow;
110
- deltaRow > 0 ? (this.moveCell(deltaRow, "up", screenTopRow), this.updateBody(y)) : deltaRow < 0 ? (this.moveCell(-deltaRow, "down", screenTopRow),
111
- this.updateBody(y)) : this.updateBody(y), this.table.scenegraph.updateNextFrame();
169
+ x < this.xLimitLeft && this.colStart === this.bodyLeftCol || x > this.xLimitRight && this.colEnd === this.bodyRightCol ? this.table.scenegraph.setBodyAndColHeaderX(-x) : this.dynamicSetX(x);
112
170
  }));
113
171
  }
114
- updateBody(y) {
115
- this.table.scenegraph.setBodyAndRowHeaderY(-y);
172
+ dynamicSetY(y) {
173
+ return __awaiter(this, void 0, void 0, (function*() {
174
+ dynamicSetY(y, this);
175
+ }));
116
176
  }
117
- moveCell(count, direction, screenTopRow) {
177
+ dynamicSetX(x) {
118
178
  return __awaiter(this, void 0, void 0, (function*() {
119
- if ("up" === direction && this.rowEnd + count > this.bodyBottomRow ? count = this.bodyBottomRow - this.rowEnd : "down" === direction && this.rowStart - count < this.bodyTopRow && (count = this.rowStart - this.bodyTopRow),
120
- count < this.rowEnd - this.rowStart) {
121
- const startRow = "up" === direction ? this.rowStart : this.rowEnd - count + 1, endRow = "up" === direction ? this.rowStart + count - 1 : this.rowEnd;
122
- for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
123
- const colGroup = this.table.scenegraph.getColGroup(col);
124
- for (let row = startRow; row <= endRow; row++) if ("up" === direction) {
125
- const cellGroup = colGroup.firstChild;
126
- this.updateCellGroupPosition(cellGroup, colGroup.lastChild.row + 1, colGroup.lastChild.attribute.y + colGroup.lastChild.attribute.height),
127
- colGroup.appendChild(cellGroup);
128
- } else {
129
- const cellGroup = colGroup.lastChild;
130
- this.updateCellGroupPosition(cellGroup, colGroup.firstChild.row - 1, colGroup.firstChild.attribute.y - cellGroup.attribute.height),
131
- colGroup.insertBefore(cellGroup, colGroup.firstChild);
132
- }
133
- }
134
- const distStartRow = "up" === direction ? this.rowEnd + 1 : this.rowStart - count, distEndRow = "up" === direction ? this.rowEnd + count : this.rowStart - 1, syncTopRow = Math.max(this.bodyTopRow, screenTopRow - 2 * this.screenRowCount), syncBottomRow = Math.min(this.bodyBottomRow, screenTopRow + 3 * this.screenRowCount);
135
- for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) for (let row = syncTopRow; row <= syncBottomRow; row++) {
136
- const cellGroup = this.highPerformanceGetCell(col, row, distStartRow, distEndRow);
137
- this.updateCellGroupContent(cellGroup);
138
- }
139
- this.table.internalProps.autoRowHeight && updateAutoRow(this.bodyLeftCol, this.bodyRightCol, syncTopRow, syncBottomRow, this.table, direction),
140
- this.rowStart = "up" === direction ? this.rowStart + count : this.rowStart - count,
141
- this.rowEnd = "up" === direction ? this.rowEnd + count : this.rowEnd - count, this.currentRow = "up" === direction ? this.currentRow + count : this.currentRow - count,
142
- this.totalRow = "up" === direction ? this.totalRow + count : this.totalRow - count,
143
- this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2),
144
- this.rowUpdatePos = distStartRow, this.rowUpdateDirection = direction, console.log("move end proxy", this.rowStart, this.rowEnd),
145
- console.log("move end cell", this.table.scenegraph.bodyGroup.firstChild.firstChild.row, this.table.scenegraph.bodyGroup.firstChild.lastChild.row),
146
- this.table.scenegraph.stage.render(), yield this.progress();
147
- } else {
148
- const distStartRow = "up" === direction ? this.rowStart + count : this.rowStart - count, distEndRow = "up" === direction ? this.rowEnd + count : this.rowEnd - count, distStartRowY = this.table.getRowsHeight(this.bodyTopRow, distStartRow - 1);
149
- for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
150
- this.table.scenegraph.getColGroup(col).forEachChildren(((cellGroup, index) => {
151
- this.updateCellGroupPosition(cellGroup, "up" === direction ? cellGroup.row + count : cellGroup.row - count, 0 === index ? distStartRowY : cellGroup._prev.attribute.y + cellGroup._prev.attribute.height);
152
- }));
153
- }
154
- let syncTopRow, syncBottomRow;
155
- this.table.internalProps.autoRowHeight ? (syncTopRow = distStartRow, syncBottomRow = distEndRow) : (syncTopRow = Math.max(this.bodyTopRow, screenTopRow - 2 * this.screenRowCount),
156
- syncBottomRow = Math.min(this.bodyBottomRow, screenTopRow + 3 * this.screenRowCount)),
157
- console.log("更新同步范围", syncTopRow, syncBottomRow);
158
- for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) for (let row = syncTopRow; row <= syncBottomRow; row++) {
159
- const cellGroup = this.highPerformanceGetCell(col, row, distStartRow, distEndRow);
160
- this.updateCellGroupContent(cellGroup);
161
- }
162
- console.log("updateAutoRow", distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? "down" : "up"),
163
- this.table.internalProps.autoRowHeight && updateAutoRow(this.bodyLeftCol, this.bodyRightCol, syncTopRow, syncBottomRow, this.table, distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? "down" : "up"),
164
- this.rowStart = distStartRow, this.rowEnd = distEndRow, this.currentRow = "up" === direction ? this.currentRow + count : this.currentRow - count,
165
- this.totalRow = "up" === direction ? this.totalRow + count : this.totalRow - count,
166
- this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2),
167
- this.rowUpdatePos = this.rowStart, this.rowUpdateDirection = distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? "down" : "up",
168
- console.log("move total end proxy", this.rowStart, this.rowEnd), console.log("move total end cell", this.table.scenegraph.bodyGroup.firstChild.firstChild.row, this.table.scenegraph.bodyGroup.firstChild.lastChild.row),
169
- this.table.internalProps.autoRowHeight || (yield this.progress());
170
- }
179
+ dynamicSetX(x, this);
171
180
  }));
172
181
  }
173
- updateCellGroupsAsync() {
182
+ updateBody(y) {
183
+ this.table.scenegraph.setBodyAndRowHeaderY(-y);
184
+ }
185
+ updateRowCellGroupsAsync() {
174
186
  return __awaiter(this, void 0, void 0, (function*() {
175
187
  this.updateCellGroups(this.taskRowCount);
176
188
  }));
177
189
  }
178
190
  updateCellGroups(count) {
179
191
  const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);
180
- console.log("updateCellGroups", this.rowUpdatePos, distRow);
192
+ this.table.internalProps.autoRowHeight && computeRowsHeight(this.table, this.rowUpdatePos, distRow);
181
193
  for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) for (let row = this.rowUpdatePos; row <= distRow; row++) {
182
194
  const cellGroup = this.highPerformanceGetCell(col, row);
183
195
  this.updateCellGroupContent(cellGroup);
@@ -185,13 +197,33 @@ export class SceneProxy {
185
197
  this.table.internalProps.autoRowHeight && updateAutoRow(this.bodyLeftCol, this.bodyRightCol, this.rowUpdatePos, distRow, this.table, this.rowUpdateDirection),
186
198
  this.rowUpdatePos = distRow + 1;
187
199
  }
200
+ updateColCellGroupsAsync() {
201
+ return __awaiter(this, void 0, void 0, (function*() {
202
+ this.updateColGroups(this.taskRowCount);
203
+ }));
204
+ }
205
+ updateColGroups(count) {
206
+ const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);
207
+ for (let col = this.colUpdatePos; col <= distCol; col++) {
208
+ const colGroup = this.table.scenegraph.getColGroup(col);
209
+ if (colGroup) {
210
+ let cellGroup = colGroup.firstChild;
211
+ for (;cellGroup; ) {
212
+ cellGroup = this.updateCellGroupContent(cellGroup)._next;
213
+ }
214
+ colGroup.needUpdate = !1;
215
+ }
216
+ }
217
+ this.colUpdatePos = distCol + 1;
218
+ }
188
219
  updateCellGroupPosition(cellGroup, newRow, y) {
189
220
  cellGroup.row = newRow, cellGroup.setAttribute("y", y), cellGroup.needUpdate = !0,
190
221
  cellGroup.needUpdateForAutoRowHeight = !0;
191
222
  }
192
223
  updateCellGroupContent(cellGroup) {
193
- cellGroup.needUpdate && (this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row),
194
- cellGroup.needUpdate = !1);
224
+ if (!cellGroup.needUpdate) return cellGroup;
225
+ const newCellGroup = this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);
226
+ return cellGroup.needUpdate = !1, newCellGroup || cellGroup;
195
227
  }
196
228
  sortCell() {
197
229
  return __awaiter(this, void 0, void 0, (function*() {
@@ -201,7 +233,7 @@ export class SceneProxy {
201
233
  let syncTopRow, syncBottomRow;
202
234
  this.table.internalProps.autoRowHeight ? (syncTopRow = this.rowStart, syncBottomRow = this.rowEnd) : (syncTopRow = Math.max(this.bodyTopRow, this.screenTopRow - 2 * this.screenRowCount),
203
235
  syncBottomRow = Math.min(this.bodyBottomRow, this.screenTopRow + 3 * this.screenRowCount)),
204
- console.log("sort更新同步范围", syncTopRow, syncBottomRow);
236
+ console.log("sort更新同步范围", syncTopRow, syncBottomRow), this.table.internalProps.autoRowHeight && computeRowsHeight(this.table, syncTopRow, syncBottomRow);
205
237
  for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) for (let row = syncTopRow; row <= syncBottomRow; row++) {
206
238
  const cellGroup = this.highPerformanceGetCell(col, row);
207
239
  this.updateCellGroupContent(cellGroup);
@@ -216,55 +248,24 @@ export class SceneProxy {
216
248
  this.table.internalProps.autoRowHeight || (yield this.progress());
217
249
  }));
218
250
  }
219
- highPerformanceGetCell(col, row, rowStart = this.rowStart, rowEnd = this.rowEnd) {
251
+ highPerformanceGetCell(col, row, rowStart = this.rowStart, rowEnd = this.rowEnd, getShadow) {
220
252
  if (row < rowStart || row > rowEnd) return emptyGroup;
253
+ if (row < this.rowStart || row > this.rowEnd || col < this.colStart || col > this.colEnd) return emptyGroup;
221
254
  if (this.cellCache.get(col)) {
222
255
  const cacheCellGoup = this.cellCache.get(col);
223
256
  if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {
224
257
  let cellGroup = getCellByCache(cacheCellGoup, row);
225
- return cellGroup || (cellGroup = this.table.scenegraph.getCell(col, row)), cellGroup.row && this.cellCache.set(col, cellGroup),
226
- cellGroup;
258
+ return cellGroup || (cellGroup = this.table.scenegraph.getCell(col, row, getShadow)),
259
+ cellGroup.row && this.cellCache.set(col, cellGroup), cellGroup;
227
260
  }
228
- const cellGroup = this.table.scenegraph.getCell(col, row);
261
+ const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);
229
262
  return cellGroup.row && this.cellCache.set(col, cellGroup), cellGroup;
230
263
  }
231
- const cellGroup = this.table.scenegraph.getCell(col, row);
264
+ const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);
232
265
  return cellGroup.row && this.cellCache.set(col, cellGroup), cellGroup;
233
266
  }
234
267
  }
235
268
 
236
- function updateAutoRow(colStart, colEnd, rowStart, rowEnd, table, direction = "up") {
237
- var _a, _b, _c, _d, _e, _f, _g, _h;
238
- for (let row = rowStart; row <= rowEnd; row++) {
239
- let maxRowHeight = 0;
240
- for (let col = colStart; col <= colEnd; col++) {
241
- const cellGroup = table.scenegraph.getCell(col, row);
242
- if (!cellGroup.row) continue;
243
- const text = cellGroup.getChildByName("text") || cellGroup.getChildByName("content"), headerStyle = table._getCellStyle(col, row), padding = getQuadProps(getProp("padding", headerStyle, col, row, table)), height = text.AABBBounds.height() + (padding[0] + padding[2]);
244
- maxRowHeight = Math.max(maxRowHeight, height), cellGroup.needUpdateForAutoRowHeight = !1;
245
- }
246
- for (let col = colStart; col <= colEnd; col++) {
247
- const cellGroup = table.scenegraph.getCell(col, row);
248
- updateCellHeightForColumn(table.scenegraph, cellGroup, col, row, maxRowHeight, 0, !1);
249
- }
250
- table.setRowHeight(row, maxRowHeight, !0);
251
- }
252
- if ("up" === direction) for (let col = colStart; col <= colEnd; col++) for (let row = rowStart; row <= rowEnd; row++) {
253
- const cellGroup = table.scenegraph.getCell(col, row);
254
- if (!cellGroup.row) continue;
255
- let y;
256
- y = cellGroup._prev ? (null !== (_b = null === (_a = cellGroup._prev) || void 0 === _a ? void 0 : _a.attribute.y) && void 0 !== _b ? _b : 0) + (null !== (_d = null === (_c = cellGroup._prev) || void 0 === _c ? void 0 : _c.attribute.height) && void 0 !== _d ? _d : 0) : table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1),
257
- cellGroup.setAttribute("y", y);
258
- } else for (let col = colStart; col <= colEnd; col++) for (let row = rowEnd; row >= rowStart; row--) {
259
- const cellGroup = table.scenegraph.getCell(col, row);
260
- if (!cellGroup.row) continue;
261
- let y;
262
- cellGroup._next ? y = (null !== (_f = null === (_e = cellGroup._next) || void 0 === _e ? void 0 : _e.attribute.y) && void 0 !== _f ? _f : 0) - (null !== (_g = cellGroup.attribute.height) && void 0 !== _g ? _g : 0) : (y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row) - (null !== (_h = cellGroup.attribute.height) && void 0 !== _h ? _h : 0),
263
- console.log("估计位置", table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row))),
264
- cellGroup.setAttribute("y", y);
265
- }
266
- }
267
-
268
269
  function getCellByCache(cacheCellGroup, row) {
269
270
  return cacheCellGroup ? cacheCellGroup.row === row ? cacheCellGroup : cacheCellGroup.row > row ? getCellByCache(cacheCellGroup._prev, row) : getCellByCache(cacheCellGroup._next, row) : null;
270
271
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["scenegraph/group-creater/progress/proxy.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CA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C,GAAG,EAAE,GAAG,CAAC,CAAC;gBACrD,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE;oBAClB,SAAS;iBACV;gBACD,IAAI,CAAC,CAAC;gBACN,IAAI,SAAS,CAAC,KAAK,EAAE;oBACnB,CAAC,GAAG,CAAC,MAAA,MAAC,SAAS,CAAC,KAAe,0CAAE,SAAS,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,SAAS,CAAC,SAAS,CAAC,MAAM,mCAAI,CAAC,CAAC,CAAC;iBACxF;qBAAM;oBAEL,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,MAAA,SAAS,CAAC,SAAS,CAAC,MAAM,mCAAI,CAAC,CAAC,CAAC;oBACzG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;iBACvF;gBACD,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aAChC;SACF;KACF;AACH,CAAC;AAED,SAAS,cAAc,CAAC,cAAqB,EAAE,GAAW;IACxD,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,cAAc,CAAC,GAAG,KAAK,GAAG,EAAE;QAC9B,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,cAAc,CAAC,GAAG,GAAG,GAAG,EAAE;QACnC,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;KAC3D;IACD,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC","file":"proxy.js","sourcesContent":["import type { BaseTableAPI } from '../../../ts-types/base-table';\nimport type { Group } from '../../graphic/group';\nimport type { WrapText } from '../../graphic/text';\nimport { updateCellHeightForColumn } from '../../layout/update-height';\nimport { emptyGroup } from '../../utils/empty-group';\nimport { getProp } from '../../utils/get-prop';\nimport { getQuadProps } from '../../utils/padding';\nimport { createColGroup } from '../column';\nimport { createComplexColumn } from '../column-helper';\n\nexport class SceneProxy {\n table: BaseTableAPI;\n currentRow = 0;\n totalRow: number;\n rowLimit = 1000;\n yLimitTop: number; // y > yLimitTop动态更新,否则直接修改xy\n yLimitBottom: number; // y < yLimitBottom动态更新,否则直接修改xy\n // bottomOffset: number;\n // scroll\n accurateY = 0;\n rowStart = 0;\n rowEnd = 0;\n referenceRow = 0;\n\n bodyTopRow: number;\n bodyBottomRow: number;\n bodyLeftCol: number;\n bodyRightCol: number;\n screenRowCount: number;\n firstScreenRowLimit: number;\n taskRowCount: number;\n rowUpdatePos: number;\n rowUpdateDirection: 'up' | 'down';\n screenTopRow: number = 0;\n screenTopRowDeltaY: number;\n y: number;\n\n cellCache: Map<number, Group> = new Map(); // 单元格位置快速查找缓存\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n if (this.table.options.maintainedDataCount) {\n this.rowLimit = this.table.options.maintainedDataCount;\n }\n }\n\n setParams() {\n this.bodyTopRow = this.table.columnHeaderLevelCount;\n this.bodyBottomRow = this.table.rowCount - 1;\n this.bodyLeftCol = 0;\n this.bodyRightCol = this.table.colCount - 1;\n\n // 计算渐进加载数量\n const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1);\n this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1; // 目标渐进完成的row\n this.rowStart = this.bodyTopRow;\n const defaultRowHeight = this.table.defaultRowHeight;\n this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 5;\n\n // 确定动态更新限制\n const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;\n const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);\n this.yLimitTop = totalBodyHeight / 2;\n this.yLimitBottom = totalHeight - totalBodyHeight / 2;\n // this.bottomOffset = totalHeight - totalBodyHeight / 2;\n\n // 确定首屏高度范围\n const heightLimit = this.table.tableNoFrameHeight * 5;\n this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);\n this.firstScreenRowLimit = this.bodyTopRow + Math.ceil(heightLimit / defaultRowHeight);\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.rowUpdatePos = this.bodyBottomRow;\n }\n\n async createColGroupForFirstScreen(\n rowHeaderGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number,\n table: BaseTableAPI\n ) {\n this.setParams();\n\n // 生成首屏单元格\n // rowHeader\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.rowHeaderLevelCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'rowHeader', // isHeader\n table,\n this.firstScreenRowLimit\n );\n // body\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.rowHeaderLevelCount, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table,\n this.firstScreenRowLimit\n );\n\n // 更新row信息\n if (!bodyGroup.firstChild) {\n // 无数据\n this.currentRow = this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);\n } else {\n this.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);\n // 开始异步任务\n await this.progress();\n }\n }\n\n // async progress() {\n // if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // // 先更新\n // await this.updateCellGroupsAsync();\n // await this.progress();\n // } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // // 先更新没有需要更新的节点,在生成新节点\n // await this.createRow();\n // await this.progress();\n // }\n // }\n async progress() {\n return new Promise<void>((resolve, reject) => {\n setTimeout(() => {\n if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // 先更新\n this.updateCellGroupsAsync();\n this.progress();\n } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // 先更新没有需要更新的节点,在生成新节点\n this.createRow();\n this.progress();\n }\n\n resolve();\n }, 0);\n });\n }\n\n async createRow() {\n if (!this.taskRowCount) {\n return;\n }\n console.log('createRow', this.currentRow, this.currentRow + this.taskRowCount);\n this.createRowCellGroup(this.taskRowCount);\n }\n\n createRowCellGroup(onceCount: number) {\n const endRow = Math.min(this.totalRow, this.currentRow + onceCount);\n let maxHeight = 0;\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellType = col < this.table.rowHeaderLevelCount ? 'rowHeader' : 'body';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellType\n );\n maxHeight = Math.max(maxHeight, height);\n }\n this.table.scenegraph.bodyGroup.setAttribute('height', maxHeight);\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.currentRow + 1, // rowStart\n endRow, // rowEnd\n this.table\n );\n }\n this.currentRow = endRow;\n this.rowEnd = endRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((endRow - this.rowStart) / 2);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n async setY(y: number) {\n if (y < this.yLimitTop && this.rowStart === this.bodyTopRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else if (y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else {\n // 执行动态更新节点\n this.dynamicSetY(y);\n }\n }\n\n async dynamicSetY(y: number) {\n // 计算变动row range\n // const screenTopRow = this.table.getRowAt(y).row;\n const screenTop = (this.table as any).getTargetRowAt(y + this.table.scenegraph.colHeaderGroup.attribute.height);\n if (!screenTop) {\n return;\n }\n const screenTopRow = screenTop.row;\n this.y = y;\n this.screenTopRow = screenTopRow;\n // this.screenTopRowDeltaY = y - this.table.getRowsHeight(this.bodyTopRow, screenTopRow - 1);\n const deltaRow = screenTopRow - this.referenceRow;\n if (deltaRow > 0) {\n // 向下滚动,顶部cell group移到底部\n this.moveCell(deltaRow, 'up', screenTopRow);\n this.updateBody(y);\n // if (this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow) {\n // const totalHeight = this.table.getAllRowsHeight();\n // const top = totalHeight - this.table.scenegraph.height;\n // this.updateBody(top);\n // } else {\n // this.updateBody(y);\n // }\n } else if (deltaRow < 0) {\n // 向上滚动,底部cell group移到顶部\n this.moveCell(-deltaRow, 'down', screenTopRow);\n this.updateBody(y);\n // if (this.rowStart === this.bodyTopRow) {\n // this.updateBody(0);\n // } else {\n // this.updateBody(y);\n // }\n } else {\n // 不改变row,更新body group范围\n this.updateBody(y);\n }\n\n this.table.scenegraph.updateNextFrame();\n }\n\n updateBody(y: number) {\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n }\n\n async moveCell(count: number, direction: 'up' | 'down', screenTopRow: number) {\n // 限制count范围\n if (direction === 'up' && this.rowEnd + count > this.bodyBottomRow) {\n count = this.bodyBottomRow - this.rowEnd;\n } else if (direction === 'down' && this.rowStart - count < this.bodyTopRow) {\n count = this.rowStart - this.bodyTopRow;\n }\n\n // 两种更新模式\n // 1. count < rowEnd - rowStart:从顶/底部移动count数量的单元格到底/顶部\n // 2. count >= rowEnd - rowStart:整体移动到目标位置\n if (count < this.rowEnd - this.rowStart) {\n // 计算更新区域\n const startRow = direction === 'up' ? this.rowStart : this.rowEnd - count + 1;\n const endRow = direction === 'up' ? this.rowStart + count - 1 : this.rowEnd;\n // console.log('move', startRow, endRow, direction);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n for (let row = startRow; row <= endRow; row++) {\n if (direction === 'up') {\n const cellGroup = colGroup.firstChild as Group;\n this.updateCellGroupPosition(\n cellGroup,\n (colGroup.lastChild as Group).row + 1,\n (colGroup.lastChild as Group).attribute.y + (colGroup.lastChild as Group).attribute.height\n );\n colGroup.appendChild(cellGroup);\n } else {\n const cellGroup = colGroup.lastChild as Group;\n this.updateCellGroupPosition(\n cellGroup,\n (colGroup.firstChild as Group).row - 1,\n (colGroup.firstChild as Group).attribute.y - cellGroup.attribute.height\n );\n colGroup.insertBefore(cellGroup, colGroup.firstChild);\n }\n }\n }\n const distStartRow = direction === 'up' ? this.rowEnd + 1 : this.rowStart - count;\n const distEndRow = direction === 'up' ? this.rowEnd + count : this.rowStart - 1;\n\n // 更新同步范围\n const syncTopRow = Math.max(this.bodyTopRow, screenTopRow - this.screenRowCount * 2);\n const syncBottomRow = Math.min(this.bodyBottomRow, screenTopRow + this.screenRowCount * 3);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row, distStartRow, distEndRow);\n this.updateCellGroupContent(cellGroup);\n }\n }\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n direction\n );\n }\n\n this.rowStart = direction === 'up' ? this.rowStart + count : this.rowStart - count;\n this.rowEnd = direction === 'up' ? this.rowEnd + count : this.rowEnd - count;\n this.currentRow = direction === 'up' ? this.currentRow + count : this.currentRow - count;\n this.totalRow = direction === 'up' ? this.totalRow + count : this.totalRow - count;\n this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);\n this.rowUpdatePos = distStartRow;\n this.rowUpdateDirection = direction;\n console.log('move end proxy', this.rowStart, this.rowEnd);\n console.log(\n 'move end cell',\n (this.table as any).scenegraph.bodyGroup.firstChild.firstChild.row,\n (this.table as any).scenegraph.bodyGroup.firstChild.lastChild.row\n );\n\n this.table.scenegraph.stage.render();\n await this.progress();\n } else {\n const distStartRow = direction === 'up' ? this.rowStart + count : this.rowStart - count;\n const distEndRow = direction === 'up' ? this.rowEnd + count : this.rowEnd - count;\n const distStartRowY = this.table.getRowsHeight(this.bodyTopRow, distStartRow - 1);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n colGroup.forEachChildren((cellGroup: Group, index) => {\n // 这里使用colGroup变量而不是for this.rowStart to this.rowEndthis.rowEnd是因为在更新内可能出现row号码重复的情况\n this.updateCellGroupPosition(\n cellGroup,\n direction === 'up' ? cellGroup.row + count : cellGroup.row - count,\n index === 0 // row === this.rowStart\n ? distStartRowY\n : (cellGroup._prev as Group).attribute.y + (cellGroup._prev as Group).attribute.height\n );\n });\n }\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (this.table.internalProps.autoRowHeight) {\n syncTopRow = distStartRow;\n syncBottomRow = distEndRow;\n } else {\n syncTopRow = Math.max(this.bodyTopRow, screenTopRow - this.screenRowCount * 2);\n syncBottomRow = Math.min(this.bodyBottomRow, screenTopRow + this.screenRowCount * 3);\n }\n console.log('更新同步范围', syncTopRow, syncBottomRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row, distStartRow, distEndRow);\n this.updateCellGroupContent(cellGroup);\n }\n }\n console.log('updateAutoRow', distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up');\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n\n this.rowStart = distStartRow;\n this.rowEnd = distEndRow;\n this.currentRow = direction === 'up' ? this.currentRow + count : this.currentRow - count;\n this.totalRow = direction === 'up' ? this.totalRow + count : this.totalRow - count;\n this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);\n this.rowUpdatePos = this.rowStart;\n this.rowUpdateDirection = distEndRow > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up';\n console.log('move total end proxy', this.rowStart, this.rowEnd);\n console.log(\n 'move total end cell',\n (this.table as any).scenegraph.bodyGroup.firstChild.firstChild.row,\n (this.table as any).scenegraph.bodyGroup.firstChild.lastChild.row\n );\n\n if (!this.table.internalProps.autoRowHeight) {\n await this.progress();\n }\n }\n }\n\n async updateCellGroupsAsync() {\n this.updateCellGroups(this.taskRowCount);\n }\n\n updateCellGroups(count: number) {\n const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);\n console.log('updateCellGroups', this.rowUpdatePos, distRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = this.rowUpdatePos; row <= distRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n this.updateCellGroupContent(cellGroup);\n }\n }\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.rowUpdatePos, // rowStart\n distRow, // rowEnd\n this.table,\n this.rowUpdateDirection\n );\n }\n\n this.rowUpdatePos = distRow + 1;\n }\n\n updateCellGroupPosition(cellGroup: Group, newRow: number, y: number) {\n // 更新位置&row\n cellGroup.row = newRow;\n cellGroup.setAttribute('y', y);\n (cellGroup as any).needUpdate = true;\n (cellGroup as any).needUpdateForAutoRowHeight = true;\n }\n\n updateCellGroupContent(cellGroup: Group) {\n if (!cellGroup.needUpdate) {\n return;\n }\n\n this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n // 更新内容\n // const textMark = cellGroup.firstChild as WrapText;\n // const autoWrapText = Array.isArray(textMark.attribute.text);\n // const textStr: string = this.table.getCellValue(cellGroup.col, cellGroup.row);\n // let text;\n // if (autoWrapText) {\n // text = String(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n // } else {\n // text = textStr;\n // }\n\n // textMark.setAttribute('text', text);\n\n cellGroup.needUpdate = false;\n }\n\n async sortCell() {\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = this.rowStart; row <= this.rowEnd; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n cellGroup.needUpdate = true;\n }\n }\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (this.table.internalProps.autoRowHeight) {\n syncTopRow = this.rowStart;\n syncBottomRow = this.rowEnd;\n } else {\n syncTopRow = Math.max(this.bodyTopRow, this.screenTopRow - this.screenRowCount * 2);\n syncBottomRow = Math.min(this.bodyBottomRow, this.screenTopRow + this.screenRowCount * 3);\n }\n console.log('sort更新同步范围', syncTopRow, syncBottomRow);\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n this.updateCellGroupContent(cellGroup);\n }\n }\n console.log('updateAutoRow', this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up');\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n this.rowUpdatePos = this.rowStart;\n this.rowUpdateDirection = this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up';\n\n if (\n this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow &&\n this.rowStart === this.table.scenegraph.proxy.bodyTopRow\n ) {\n // 全量更新,do nothing\n } else if (this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow) {\n const totalHeight = this.table.getAllRowsHeight();\n const top = totalHeight - this.table.scenegraph.height;\n this.updateBody(top);\n } else if (this.rowStart === this.table.scenegraph.proxy.bodyTopRow) {\n this.updateBody(0);\n }\n\n if (!this.table.internalProps.autoRowHeight) {\n await this.progress();\n }\n }\n\n highPerformanceGetCell(col: number, row: number, rowStart: number = this.rowStart, rowEnd: number = this.rowEnd) {\n if (row < rowStart || row > rowEnd) {\n return emptyGroup;\n }\n if (this.cellCache.get(col)) {\n const cacheCellGoup = this.cellCache.get(col);\n if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {\n // 由缓存单元格向前后查找要快于从头查找\n let cellGroup = getCellByCache(cacheCellGoup, row);\n if (!cellGroup) {\n cellGroup = this.table.scenegraph.getCell(col, row);\n }\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row);\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row);\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n}\n\nfunction updateAutoRow(\n colStart: number,\n colEnd: number,\n rowStart: number,\n rowEnd: number,\n table: BaseTableAPI,\n direction: 'up' | 'down' = 'up'\n) {\n // 获取行高\n for (let row = rowStart; row <= rowEnd; row++) {\n let maxRowHeight = 0;\n for (let col = colStart; col <= colEnd; col++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n // const contentHeight = cellGroup.getContentHeight();\n const text = (cellGroup.getChildByName('text') as WrapText) || cellGroup.getChildByName('content');\n const headerStyle = table._getCellStyle(col, row);\n const padding = getQuadProps(getProp('padding', headerStyle, col, row, table));\n const height = text.AABBBounds.height() + (padding[0] + padding[2]);\n maxRowHeight = Math.max(maxRowHeight, height);\n (cellGroup as any).needUpdateForAutoRowHeight = false;\n }\n // updateRowHeight(table.scenegraph, row, table.getRowHeight(row) - maxRowHeight);\n for (let col = colStart; col <= colEnd; col++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n updateCellHeightForColumn(table.scenegraph, cellGroup, col, row, maxRowHeight, 0, false);\n }\n\n table.setRowHeight(row, maxRowHeight, true);\n }\n\n // 更新y位置\n if (direction === 'up') {\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowStart; row <= rowEnd; row++) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n let y;\n if (cellGroup._prev) {\n y = ((cellGroup._prev as Group)?.attribute.y ?? 0) + ((cellGroup._prev as Group)?.attribute.height ?? 0);\n } else {\n // 估计位置\n y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1);\n }\n cellGroup.setAttribute('y', y);\n }\n }\n } else {\n for (let col = colStart; col <= colEnd; col++) {\n for (let row = rowEnd; row >= rowStart; row--) {\n const cellGroup = table.scenegraph.getCell(col, row);\n if (!cellGroup.row) {\n continue;\n }\n let y;\n if (cellGroup._next) {\n y = ((cellGroup._next as Group)?.attribute.y ?? 0) - (cellGroup.attribute.height ?? 0);\n } else {\n // 估计位置\n y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row) - (cellGroup.attribute.height ?? 0);\n console.log('估计位置', table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row));\n }\n cellGroup.setAttribute('y', y);\n }\n }\n }\n}\n\nfunction getCellByCache(cacheCellGroup: Group, row: number): Group | null {\n if (!cacheCellGroup) {\n return null;\n }\n if (cacheCellGroup.row === row) {\n return cacheCellGroup;\n } else if (cacheCellGroup.row > row) {\n return getCellByCache(cacheCellGroup._prev as Group, row);\n }\n return getCellByCache(cacheCellGroup._next as Group, row);\n}\n"]}
1
+ {"version":3,"sources":["scenegraph/group-creater/progress/proxy.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,MAAM,OAAO,UAAU;IAwCrB,YAAY,KAAmB;QAtC/B,SAAI,GAA+B,QAAQ,CAAC;QAE5C,aAAQ,GAAG,IAAI,CAAC;QAChB,eAAU,GAAG,CAAC,CAAC;QAIf,aAAQ,GAAG,CAAC,CAAC;QACb,WAAM,GAAG,CAAC,CAAC;QACX,iBAAY,GAAG,CAAC,CAAC;QAQjB,iBAAY,GAAW,CAAC,CAAC;QAEzB,aAAQ,GAAG,IAAI,CAAC;QAchB,kBAAa,GAAW,CAAC,CAAC;QAG1B,cAAS,GAAu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GAAG,EAAE,SAAS,CAAC,CAAC;QACrE,SAAS,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAED,SAAS,cAAc,CAAC,cAAqB,EAAE,GAAW;IACxD,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,cAAc,CAAC,GAAG,KAAK,GAAG,EAAE;QAC9B,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,cAAc,CAAC,GAAG,GAAG,GAAG,EAAE;QACnC,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;KAC3D;IACD,OAAO,cAAc,CAAC,cAAc,CAAC,KAAc,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC","file":"proxy.js","sourcesContent":["import type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { Group } from '../../graphic/group';\nimport { computeColsWidth } from '../../layout/compute-col-width';\nimport { computeRowsHeight } from '../../layout/compute-row-height';\nimport { emptyGroup } from '../../utils/empty-group';\nimport { createColGroup } from '../column';\nimport { createComplexColumn } from '../column-helper';\nimport { dynamicSetX } from './update-position/dynamic-set-x';\nimport { dynamicSetY } from './update-position/dynamic-set-y';\nimport { updateAutoRow } from './update-position/update-auto-row';\n\nexport class SceneProxy {\n table: BaseTableAPI;\n mode: 'column' | 'row' | 'pivot' = 'column';\n\n rowLimit = 1000;\n currentRow = 0; // 目前渐进生成的row number\n totalRow: number; // 渐进完成最后一行的row number\n yLimitTop: number; // y > yLimitTop动态更新,否则直接修改xy\n yLimitBottom: number; // y < yLimitBottom动态更新,否则直接修改xy\n rowStart = 0; // 当前维护的部分第一行的row number\n rowEnd = 0; // 当前维护的部分最后一行的row number\n referenceRow = 0; // 当前维护的部分中间一行的row number,认为referenceRow对应当前屏幕显示范围的第一行\n bodyTopRow: number; // table body部分的第一行row number\n bodyBottomRow: number; // table body部分的最后一行row number\n screenRowCount: number; // 预计屏幕范围内显示的row count\n firstScreenRowLimit: number; // 首屏同步加载部分最后一行的row number\n taskRowCount: number; // 一次任务生成/更新的row count\n rowUpdatePos: number; // 异步任务目前更新到的行的row number\n rowUpdateDirection: 'up' | 'down'; // 当前行更新的方向\n screenTopRow: number = 0; // 当前屏幕范围内显示的第一行的row number\n\n colLimit = 1000;\n bodyLeftCol: number; // table body部分的第一列col number\n bodyRightCol: number; // table body部分的最后一列col number\n totalCol: number; // 渐进完成最后一列的col number\n colStart: number; // 当前维护的部分第一列的col number\n colEnd: number; // 当前维护的部分最后一列的col number\n taskColCount: number; // 一次任务生成/更新的col count\n xLimitLeft: number; // x > xLimitLeft动态更新,否则直接修改xy\n xLimitRight: number; // x < xLimitRight动态更新,否则直接修改xy\n screenColCount: number; // 预计屏幕范围内显示的col count\n firstScreenColLimit: number; // 首屏同步加载部分最后一列的col number\n colUpdatePos: number; // 异步任务目前更新到的列的col number\n currentCol: number; // 目前渐进生成的col number\n referenceCol: number; // 当前维护的部分中间一列的col number,认为referenceCol对应当前屏幕显示范围的第一列\n screenLeftCol: number = 0; // 当前屏幕范围内显示的第一列的col number\n colUpdateDirection: 'left' | 'right'; // 当前列更新方向\n\n cellCache: Map<number, Group> = new Map(); // 单元格位置快速查找缓存\n\n constructor(table: BaseTableAPI) {\n this.table = table;\n\n if (this.table.internalProps.transpose) {\n this.mode = 'row';\n } else if (this.table.isPivotTable()) {\n this.mode = 'pivot';\n }\n if (this.table.options.maintainedDataCount) {\n this.rowLimit = this.table.options.maintainedDataCount;\n }\n }\n\n setParamsForColumn() {\n this.bodyLeftCol = this.table.rowHeaderLevelCount;\n this.bodyRightCol = this.table.colCount - 1;\n\n // compute the column info about progress creation\n const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);\n this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1; // 目标渐进完成的col\n this.colStart = this.bodyLeftCol;\n const defaultColWidth = this.table.defaultColWidth;\n this.taskColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth) * 1;\n\n // 确定动态更新限制\n const totalBodyWidth = defaultColWidth * totalActualBodyColCount;\n const totalWidth = defaultColWidth * (this.bodyRightCol - this.bodyLeftCol + 1);\n this.xLimitLeft = totalBodyWidth / 2;\n this.xLimitRight = totalWidth - totalBodyWidth / 2;\n\n // 确定首屏高度范围\n const widthLimit = this.table.tableNoFrameWidth * 5;\n this.screenColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth);\n this.firstScreenColLimit = this.bodyLeftCol + Math.ceil(widthLimit / defaultColWidth);\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.colUpdatePos = this.bodyRightCol;\n }\n\n setParamsForRow() {\n this.bodyTopRow = this.table.columnHeaderLevelCount;\n this.bodyBottomRow = this.table.rowCount - 1;\n this.bodyLeftCol = 0;\n this.bodyRightCol = this.table.colCount - 1;\n\n // 计算渐进加载数量\n const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1); // 渐进加载总row数量\n this.totalRow = this.bodyTopRow + totalActualBodyRowCount - 1; // 目标渐进完成的row\n this.rowStart = this.bodyTopRow;\n const defaultRowHeight = this.table.defaultRowHeight;\n this.taskRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight) * 1;\n\n // 确定动态更新限制\n const totalBodyHeight = defaultRowHeight * totalActualBodyRowCount;\n const totalHeight = defaultRowHeight * (this.bodyBottomRow - this.bodyTopRow + 1);\n this.yLimitTop = totalBodyHeight / 2;\n this.yLimitBottom = totalHeight - totalBodyHeight / 2;\n // this.bottomOffset = totalHeight - totalBodyHeight / 2;\n\n // 确定首屏高度范围\n const heightLimit = this.table.tableNoFrameHeight * 5;\n this.screenRowCount = Math.ceil(this.table.tableNoFrameHeight / defaultRowHeight);\n this.firstScreenRowLimit = this.bodyTopRow + Math.ceil(heightLimit / defaultRowHeight);\n // this.firstScreenRowLimit = this.bodyBottomRow;\n\n this.rowUpdatePos = this.bodyBottomRow;\n }\n\n async createGroupForFirstScreen(\n cornerHeaderGroup: Group,\n colHeaderGroup: Group,\n rowHeaderGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number\n ) {\n // compute parameters\n this.setParamsForRow();\n this.setParamsForColumn();\n\n // compute colums width in first screen\n this.table.internalProps._colWidthsMap.clear();\n this.table._clearColRangeWidthsMap();\n computeColsWidth(this.table, 0, Math.min(this.firstScreenColLimit, this.table.colCount - 1));\n\n // compute rows height in first screen\n this.table.internalProps._rowHeightsMap.clear();\n this.table._clearRowRangeHeightsMap();\n computeRowsHeight(this.table, 0, Math.min(this.firstScreenRowLimit, this.table.rowCount - 1));\n\n // update colHeaderGroup rowHeaderGroup bodyGroup position\n this.table.scenegraph.colHeaderGroup.setAttribute('x', this.table.getFrozenColsWidth());\n this.table.scenegraph.rowHeaderGroup.setAttribute('y', this.table.getFrozenRowsHeight());\n this.table.scenegraph.bodyGroup.setAttributes({\n x: this.table.getFrozenColsWidth(),\n y: this.table.getFrozenRowsHeight()\n });\n\n // create cornerHeaderGroup\n createColGroup(\n cornerHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n this.table.rowHeaderLevelCount - 1, // colEnd\n 0, // rowStart\n this.table.columnHeaderLevelCount - 1, // rowEnd\n 'cornerHeader', // CellType\n this.table\n );\n\n // create colHeaderGroup\n createColGroup(\n colHeaderGroup,\n xOrigin,\n yOrigin,\n this.table.rowHeaderLevelCount, // colStart\n Math.min(this.firstScreenColLimit, this.table.colCount - 1), // colEnd\n 0, // rowStart\n this.table.columnHeaderLevelCount - 1, // rowEnd\n 'columnHeader', // isHeader\n this.table\n );\n\n // create rowHeaderGroup\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n this.table.rowHeaderLevelCount - 1, // colEnd\n this.table.columnHeaderLevelCount, // rowStart\n Math.min(this.firstScreenRowLimit, this.table.rowCount - 1), // rowEnd\n 'rowHeader', // isHeader\n this.table\n );\n\n // create bodyGroup\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n this.table.rowHeaderLevelCount, // colStart\n Math.min(this.firstScreenColLimit, this.table.colCount - 1), // colEnd\n this.table.columnHeaderLevelCount, // rowStart\n Math.min(this.firstScreenRowLimit, this.table.rowCount - 1), // rowEnd\n 'body', // isHeader\n this.table\n );\n\n // update progress information\n if (!bodyGroup.firstChild) {\n // 无数据\n this.currentRow = this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);\n\n this.currentCol = this.totalCol;\n this.colEnd = this.currentCol;\n this.colUpdatePos = this.colEnd;\n this.referenceCol = this.colStart + Math.floor((this.colEnd - this.colStart) / 2);\n } else {\n this.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);\n\n this.currentCol = (bodyGroup.lastChild as Group)?.col ?? this.totalCol;\n this.colEnd = this.currentCol;\n this.colUpdatePos = this.colEnd;\n this.referenceCol = this.colStart + Math.floor((this.colEnd - this.colStart) / 2);\n\n // 开始异步任务\n await this.progress();\n }\n }\n\n async createColGroupForFirstScreen(\n rowHeaderGroup: Group,\n bodyGroup: Group,\n xOrigin: number,\n yOrigin: number,\n table: BaseTableAPI\n ) {\n this.setParamsForRow();\n this.setParamsForColumn();\n\n // compute row height in first screen\n computeRowsHeight(table, this.table.columnHeaderLevelCount, Math.min(this.firstScreenRowLimit, table.rowCount - 1));\n\n // 生成首屏单元格\n // rowHeader\n createColGroup(\n rowHeaderGroup,\n xOrigin,\n yOrigin,\n 0, // colStart\n table.rowHeaderLevelCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'rowHeader', // isHeader\n table,\n this.firstScreenRowLimit\n );\n // body\n createColGroup(\n bodyGroup,\n xOrigin,\n yOrigin,\n table.rowHeaderLevelCount, // colStart\n table.colCount - 1, // colEnd\n table.columnHeaderLevelCount, // rowStart\n table.rowCount - 1, // rowEnd\n 'body', // isHeader\n table,\n this.firstScreenRowLimit\n );\n\n // 更新row信息\n if (!bodyGroup.firstChild) {\n // 无数据\n this.currentRow = this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);\n } else {\n this.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? this.totalRow;\n this.rowEnd = this.currentRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);\n // 开始异步任务\n await this.progress();\n }\n }\n\n // async progress() {\n // if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // // 先更新\n // await this.updateCellGroupsAsync();\n // await this.progress();\n // } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // // 先更新没有需要更新的节点,在生成新节点\n // await this.createRow();\n // await this.progress();\n // }\n // }\n async progress() {\n return new Promise<void>((resolve, reject) => {\n setTimeout(async () => {\n if (this.colUpdatePos < this.colEnd) {\n await this.updateColCellGroupsAsync();\n await this.progress();\n } else if (this.rowUpdatePos < this.rowEnd) {\n // console.log('progress rowUpdatePos', this.rowUpdatePos);\n // 先更新\n await this.updateRowCellGroupsAsync();\n await this.progress();\n } else if (this.currentCol < this.totalCol) {\n await this.createCol();\n await this.progress();\n } else if (this.currentRow < this.totalRow) {\n // console.log('progress currentRow', this.currentRow);\n // 先更新没有需要更新的节点,在生成新节点\n await this.createRow();\n await this.progress();\n }\n resolve();\n }, 0);\n });\n }\n\n async createRow() {\n if (!this.taskRowCount) {\n return;\n }\n console.log('createRow', this.currentRow, this.currentRow + this.taskRowCount);\n this.createRowCellGroup(this.taskRowCount);\n }\n\n async createCol() {\n if (!this.taskColCount) {\n return;\n }\n console.log('createCol', this.currentCol, this.currentCol + this.taskColCount);\n this.createColGroup(this.taskRowCount);\n }\n\n createRowCellGroup(onceCount: number) {\n const endRow = Math.min(this.totalRow, this.currentRow + onceCount);\n // compute rows height\n computeRowsHeight(this.table, this.currentRow + 1, endRow);\n\n // create row cellGroup\n let maxHeight = 0;\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n const cellType = col < this.table.rowHeaderLevelCount ? 'rowHeader' : 'body';\n const { height } = createComplexColumn(\n colGroup,\n col,\n colGroup.attribute.width,\n this.currentRow + 1,\n endRow,\n this.table.scenegraph.mergeMap,\n this.table.internalProps.defaultRowHeight,\n this.table,\n cellType\n );\n maxHeight = Math.max(maxHeight, height);\n }\n this.table.scenegraph.bodyGroup.setAttribute('height', maxHeight);\n\n this.currentRow = endRow;\n this.rowEnd = endRow;\n this.rowUpdatePos = this.rowEnd;\n this.referenceRow = this.rowStart + Math.floor((endRow - this.rowStart) / 2);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n createColGroup(onceCount: number) {\n // compute rows height\n const endCol = Math.min(this.totalCol, this.currentCol + onceCount);\n computeColsWidth(this.table, this.currentCol + 1, endCol);\n\n // create colGroup\n const lastColumnGroup = (\n this.table.scenegraph.bodyGroup.lastChild instanceof Group\n ? this.table.scenegraph.bodyGroup.lastChild\n : this.table.scenegraph.bodyGroup.lastChild._prev\n ) as Group;\n const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;\n const yOrigin = lastColumnGroup.attribute.y;\n // create bodyGroup\n createColGroup(\n this.table.scenegraph.bodyGroup,\n xOrigin,\n yOrigin,\n this.currentCol + 1, // colStart\n endCol, // colEnd\n this.rowStart, // rowStart\n this.rowEnd, // rowEnd\n 'body', // isHeader\n this.table\n );\n\n this.currentCol = endCol;\n this.colEnd = endCol;\n this.colUpdatePos = this.colEnd;\n this.referenceCol = this.colStart + Math.floor((endCol - this.colStart) / 2);\n console.log('async', this.referenceCol, this.colStart, this.colEnd);\n\n // update container group size and border\n this.table.scenegraph.updateContainer();\n this.table.scenegraph.updateBorderSizeAndPosition();\n }\n\n async setY(y: number) {\n if (y < this.yLimitTop && this.rowStart === this.bodyTopRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else if (y > this.yLimitBottom && this.rowEnd === this.bodyBottomRow) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n } else {\n // 执行动态更新节点\n this.dynamicSetY(y);\n }\n }\n\n async setX(x: number) {\n if (x < this.xLimitLeft && this.colStart === this.bodyLeftCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else if (x > this.xLimitRight && this.colEnd === this.bodyRightCol) {\n // 执行真实body group坐标修改\n this.table.scenegraph.setBodyAndColHeaderX(-x);\n } else {\n // 执行动态更新节点\n this.dynamicSetX(x);\n }\n }\n\n async dynamicSetY(y: number) {\n dynamicSetY(y, this);\n }\n async dynamicSetX(x: number) {\n dynamicSetX(x, this);\n }\n\n updateBody(y: number) {\n this.table.scenegraph.setBodyAndRowHeaderY(-y);\n }\n\n async updateRowCellGroupsAsync() {\n this.updateCellGroups(this.taskRowCount);\n }\n\n updateCellGroups(count: number) {\n const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);\n // console.log('updateCellGroups', this.rowUpdatePos, distRow);\n if (this.table.internalProps.autoRowHeight) {\n computeRowsHeight(this.table, this.rowUpdatePos, distRow);\n }\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = this.rowUpdatePos; row <= distRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n this.updateCellGroupContent(cellGroup);\n }\n }\n\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n this.rowUpdatePos, // rowStart\n distRow, // rowEnd\n this.table,\n this.rowUpdateDirection\n );\n }\n\n this.rowUpdatePos = distRow + 1;\n }\n\n async updateColCellGroupsAsync() {\n this.updateColGroups(this.taskRowCount);\n }\n\n updateColGroups(count: number) {\n const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);\n // console.log('updateCellGroups', this.colUpdatePos, distCol);\n for (let col = this.colUpdatePos; col <= distCol; col++) {\n const colGroup = this.table.scenegraph.getColGroup(col);\n if (colGroup) {\n // colGroup.forEachChildren((cellGroup: Group) => {\n // this.updateCellGroupContent(cellGroup);\n // });\n // for (let row = (colGroup.firstChild as Group).row; row <= (colGroup.lastChild as Group).row; row++) {\n // const cellGroup = this.highPerformanceGetCell(colGroup.col, row);\n // this.updateCellGroupContent(cellGroup);\n // }\n let cellGroup = colGroup.firstChild;\n while (cellGroup) {\n // this.updateCellGroupContent(cellGroup as Group);\n // cellGroup = cellGroup._next;\n const newCellGroup = this.updateCellGroupContent(cellGroup as Group);\n cellGroup = newCellGroup._next;\n }\n colGroup.needUpdate = false;\n }\n }\n this.colUpdatePos = distCol + 1;\n }\n\n updateCellGroupPosition(cellGroup: Group, newRow: number, y: number) {\n // 更新位置&row\n cellGroup.row = newRow;\n cellGroup.setAttribute('y', y);\n (cellGroup as any).needUpdate = true;\n (cellGroup as any).needUpdateForAutoRowHeight = true;\n }\n\n updateCellGroupContent(cellGroup: Group) {\n if (!cellGroup.needUpdate) {\n return cellGroup;\n }\n\n const newCellGroup = this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);\n // 更新内容\n // const textMark = cellGroup.firstChild as WrapText;\n // const autoWrapText = Array.isArray(textMark.attribute.text);\n // const textStr: string = this.table.getCellValue(cellGroup.col, cellGroup.row);\n // let text;\n // if (autoWrapText) {\n // text = String(textStr).replace(/\\r?\\n/g, '\\n').replace(/\\r/g, '\\n').split('\\n');\n // } else {\n // text = textStr;\n // }\n\n // textMark.setAttribute('text', text);\n\n cellGroup.needUpdate = false;\n return newCellGroup || cellGroup;\n }\n\n async sortCell() {\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = this.rowStart; row <= this.rowEnd; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n cellGroup.needUpdate = true;\n }\n }\n\n // 更新同步范围\n let syncTopRow;\n let syncBottomRow;\n if (this.table.internalProps.autoRowHeight) {\n syncTopRow = this.rowStart;\n syncBottomRow = this.rowEnd;\n } else {\n syncTopRow = Math.max(this.bodyTopRow, this.screenTopRow - this.screenRowCount * 2);\n syncBottomRow = Math.min(this.bodyBottomRow, this.screenTopRow + this.screenRowCount * 3);\n }\n console.log('sort更新同步范围', syncTopRow, syncBottomRow);\n if (this.table.internalProps.autoRowHeight) {\n computeRowsHeight(this.table, syncTopRow, syncBottomRow);\n }\n for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {\n for (let row = syncTopRow; row <= syncBottomRow; row++) {\n // const cellGroup = this.table.scenegraph.getCell(col, row);\n const cellGroup = this.highPerformanceGetCell(col, row);\n this.updateCellGroupContent(cellGroup);\n }\n }\n console.log('updateAutoRow', this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up');\n if (this.table.internalProps.autoRowHeight) {\n updateAutoRow(\n this.bodyLeftCol, // colStart\n this.bodyRightCol, // colEnd\n syncTopRow, // rowStart\n syncBottomRow, // rowEnd\n this.table,\n this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up' // 跳转到底部时,从下向上对齐\n );\n }\n this.rowUpdatePos = this.rowStart;\n this.rowUpdateDirection = this.rowEnd > this.bodyBottomRow - (this.rowEnd - this.rowStart + 1) ? 'down' : 'up';\n\n if (\n this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow &&\n this.rowStart === this.table.scenegraph.proxy.bodyTopRow\n ) {\n // 全量更新,do nothing\n } else if (this.rowEnd === this.table.scenegraph.proxy.bodyBottomRow) {\n const totalHeight = this.table.getAllRowsHeight();\n const top = totalHeight - this.table.scenegraph.height;\n this.updateBody(top);\n } else if (this.rowStart === this.table.scenegraph.proxy.bodyTopRow) {\n this.updateBody(0);\n }\n\n if (!this.table.internalProps.autoRowHeight) {\n await this.progress();\n }\n }\n\n highPerformanceGetCell(\n col: number,\n row: number,\n rowStart: number = this.rowStart,\n rowEnd: number = this.rowEnd,\n getShadow?: boolean\n ) {\n if (row < rowStart || row > rowEnd) {\n return emptyGroup;\n }\n if (row < this.rowStart || row > this.rowEnd || col < this.colStart || col > this.colEnd) {\n return emptyGroup;\n }\n if (this.cellCache.get(col)) {\n const cacheCellGoup = this.cellCache.get(col);\n if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {\n // 由缓存单元格向前后查找要快于从头查找\n let cellGroup = getCellByCache(cacheCellGoup, row);\n if (!cellGroup) {\n cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n }\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n const cellGroup = this.table.scenegraph.getCell(col, row, getShadow);\n cellGroup.row && this.cellCache.set(col, cellGroup);\n return cellGroup;\n }\n}\n\nfunction getCellByCache(cacheCellGroup: Group, row: number): Group | null {\n if (!cacheCellGroup) {\n return null;\n }\n if (cacheCellGroup.row === row) {\n return cacheCellGroup;\n } else if (cacheCellGroup.row > row) {\n return getCellByCache(cacheCellGroup._prev as Group, row);\n }\n return getCellByCache(cacheCellGroup._next as Group, row);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { SceneProxy } from '../proxy';
2
+ export declare function dynamicSetX(x: number, proxy: SceneProxy): Promise<void>;