@visactor/vtable 0.9.3-alpha.6 → 0.10.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 (237) hide show
  1. package/cjs/ListTable.d.ts +2 -1
  2. package/cjs/ListTable.js +9 -7
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +1 -0
  5. package/cjs/PivotChart.js +6 -5
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +1 -0
  8. package/cjs/PivotTable.js +7 -5
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/components/axis/axis.d.ts +1 -0
  11. package/cjs/components/axis/axis.js +10 -1
  12. package/cjs/components/axis/axis.js.map +1 -1
  13. package/cjs/components/axis/get-axis-component-size.js +13 -9
  14. package/cjs/components/axis/get-axis-component-size.js.map +1 -1
  15. package/cjs/components/legend/legend.js +5 -3
  16. package/cjs/components/legend/legend.js.map +1 -1
  17. package/cjs/core/BaseTable.d.ts +8 -5
  18. package/cjs/core/BaseTable.js +40 -27
  19. package/cjs/core/BaseTable.js.map +1 -1
  20. package/cjs/event/drill.d.ts +2 -0
  21. package/cjs/event/drill.js +15 -2
  22. package/cjs/event/drill.js.map +1 -1
  23. package/cjs/event/event.js +2 -1
  24. package/cjs/event/event.js.map +1 -1
  25. package/cjs/event/listener/container-dom.js +1 -1
  26. package/cjs/event/listener/container-dom.js.map +1 -1
  27. package/cjs/event/listener/scroll-bar.js +2 -0
  28. package/cjs/event/listener/scroll-bar.js.map +1 -1
  29. package/cjs/event/pivot-chart/axis-click.js +3 -2
  30. package/cjs/event/pivot-chart/axis-click.js.map +1 -1
  31. package/cjs/event/scroll.js +8 -4
  32. package/cjs/event/scroll.js.map +1 -1
  33. package/cjs/index.d.ts +1 -1
  34. package/cjs/index.js +1 -1
  35. package/cjs/index.js.map +1 -1
  36. package/cjs/layout/chart-helper/get-axis-config.js +5 -5
  37. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  38. package/cjs/layout/chart-helper/get-chart-spec.js +2 -2
  39. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  40. package/cjs/layout/pivot-layout.js +4 -2
  41. package/cjs/layout/pivot-layout.js.map +1 -1
  42. package/cjs/render/layout/text.js +1 -0
  43. package/cjs/render/layout/text.js.map +1 -1
  44. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  45. package/cjs/scenegraph/graphic/contributions/chart-render-helper.d.ts +8 -0
  46. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +66 -0
  47. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -0
  48. package/cjs/scenegraph/graphic/contributions/chart-render.js +9 -35
  49. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  50. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +6 -3
  51. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  52. package/cjs/scenegraph/graphic/text.js +6 -4
  53. package/cjs/scenegraph/graphic/text.js.map +1 -1
  54. package/cjs/scenegraph/group-creater/cell-helper.js +2 -1
  55. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  56. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
  57. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  58. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -1
  59. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  60. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  61. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  62. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  63. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  64. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  65. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  66. package/cjs/scenegraph/group-creater/column-helper.js +3 -3
  67. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  68. package/cjs/scenegraph/group-creater/init-scenegraph.d.ts +2 -0
  69. package/cjs/scenegraph/group-creater/init-scenegraph.js +61 -0
  70. package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -0
  71. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +7 -2
  72. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  73. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
  74. package/cjs/scenegraph/group-creater/progress/proxy.js +12 -21
  75. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  76. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +36 -44
  77. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  78. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +5 -19
  79. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  80. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.d.ts +2 -0
  81. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js +37 -0
  82. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -0
  83. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  84. package/cjs/scenegraph/group-creater/progress/update-position/util.d.ts +8 -0
  85. package/cjs/scenegraph/group-creater/progress/update-position/util.js +70 -0
  86. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -0
  87. package/cjs/scenegraph/layout/compute-col-width.js +5 -3
  88. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  89. package/cjs/scenegraph/layout/compute-row-height.d.ts +1 -1
  90. package/cjs/scenegraph/layout/compute-row-height.js +26 -13
  91. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  92. package/cjs/scenegraph/layout/frozen.d.ts +2 -0
  93. package/cjs/scenegraph/layout/frozen.js +139 -6
  94. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  95. package/cjs/scenegraph/layout/update-height.js +2 -1
  96. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  97. package/cjs/scenegraph/layout/update-width.js +45 -66
  98. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  99. package/cjs/scenegraph/refresh-node/update-chart.js +8 -6
  100. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  101. package/cjs/scenegraph/scenegraph.d.ts +9 -4
  102. package/cjs/scenegraph/scenegraph.js +39 -102
  103. package/cjs/scenegraph/scenegraph.js.map +1 -1
  104. package/cjs/scenegraph/style/corner-cell.d.ts +2 -2
  105. package/cjs/scenegraph/style/corner-cell.js +8 -9
  106. package/cjs/scenegraph/style/corner-cell.js.map +1 -1
  107. package/cjs/scenegraph/utils/measure-text.js +9 -8
  108. package/cjs/scenegraph/utils/measure-text.js.map +1 -1
  109. package/cjs/state/hover/update-position.js +1 -1
  110. package/cjs/state/hover/update-position.js.map +1 -1
  111. package/cjs/state/state.d.ts +1 -0
  112. package/cjs/state/state.js +4 -2
  113. package/cjs/state/state.js.map +1 -1
  114. package/cjs/ts-types/base-table.d.ts +10 -2
  115. package/cjs/ts-types/base-table.js.map +1 -1
  116. package/cjs/ts-types/table-engine.d.ts +1 -1
  117. package/cjs/ts-types/table-engine.js.map +1 -1
  118. package/dist/vtable.js +1244 -790
  119. package/dist/vtable.min.js +3 -3
  120. package/es/ListTable.d.ts +2 -1
  121. package/es/ListTable.js +9 -7
  122. package/es/ListTable.js.map +1 -1
  123. package/es/PivotChart.d.ts +1 -0
  124. package/es/PivotChart.js +6 -5
  125. package/es/PivotChart.js.map +1 -1
  126. package/es/PivotTable.d.ts +1 -0
  127. package/es/PivotTable.js +7 -5
  128. package/es/PivotTable.js.map +1 -1
  129. package/es/components/axis/axis.d.ts +1 -0
  130. package/es/components/axis/axis.js +10 -1
  131. package/es/components/axis/axis.js.map +1 -1
  132. package/es/components/axis/get-axis-component-size.js +13 -9
  133. package/es/components/axis/get-axis-component-size.js.map +1 -1
  134. package/es/components/legend/legend.js +5 -3
  135. package/es/components/legend/legend.js.map +1 -1
  136. package/es/core/BaseTable.d.ts +8 -5
  137. package/es/core/BaseTable.js +34 -20
  138. package/es/core/BaseTable.js.map +1 -1
  139. package/es/event/drill.d.ts +2 -0
  140. package/es/event/drill.js +13 -0
  141. package/es/event/drill.js.map +1 -1
  142. package/es/event/event.js +3 -3
  143. package/es/event/event.js.map +1 -1
  144. package/es/event/listener/container-dom.js +1 -1
  145. package/es/event/listener/container-dom.js.map +1 -1
  146. package/es/event/listener/scroll-bar.js +2 -0
  147. package/es/event/listener/scroll-bar.js.map +1 -1
  148. package/es/event/pivot-chart/axis-click.js +3 -2
  149. package/es/event/pivot-chart/axis-click.js.map +1 -1
  150. package/es/event/scroll.js +4 -1
  151. package/es/event/scroll.js.map +1 -1
  152. package/es/index.d.ts +1 -1
  153. package/es/index.js +1 -1
  154. package/es/index.js.map +1 -1
  155. package/es/layout/chart-helper/get-axis-config.js +5 -5
  156. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  157. package/es/layout/chart-helper/get-chart-spec.js +2 -2
  158. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  159. package/es/layout/pivot-layout.js +4 -2
  160. package/es/layout/pivot-layout.js.map +1 -1
  161. package/es/render/layout/text.js +1 -0
  162. package/es/render/layout/text.js.map +1 -1
  163. package/es/scenegraph/graphic/chart.js.map +1 -1
  164. package/es/scenegraph/graphic/contributions/chart-render-helper.d.ts +8 -0
  165. package/es/scenegraph/graphic/contributions/chart-render-helper.js +61 -0
  166. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -0
  167. package/es/scenegraph/graphic/contributions/chart-render.js +9 -34
  168. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  169. package/es/scenegraph/graphic/contributions/group-contribution-render.js +7 -2
  170. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  171. package/es/scenegraph/graphic/text.js +6 -4
  172. package/es/scenegraph/graphic/text.js.map +1 -1
  173. package/es/scenegraph/group-creater/cell-helper.js +2 -1
  174. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  175. package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
  176. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  177. package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
  178. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  179. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  180. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  181. package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  182. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  183. package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  184. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  185. package/es/scenegraph/group-creater/column-helper.js +3 -3
  186. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  187. package/es/scenegraph/group-creater/init-scenegraph.d.ts +2 -0
  188. package/es/scenegraph/group-creater/init-scenegraph.js +55 -0
  189. package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -0
  190. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +6 -2
  191. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  192. package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
  193. package/es/scenegraph/group-creater/progress/proxy.js +13 -18
  194. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  195. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +37 -44
  196. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  197. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +6 -22
  198. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  199. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.d.ts +2 -0
  200. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js +29 -0
  201. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -0
  202. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  203. package/es/scenegraph/group-creater/progress/update-position/util.d.ts +8 -0
  204. package/es/scenegraph/group-creater/progress/update-position/util.js +60 -0
  205. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -0
  206. package/es/scenegraph/layout/compute-col-width.js +4 -2
  207. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  208. package/es/scenegraph/layout/compute-row-height.d.ts +1 -1
  209. package/es/scenegraph/layout/compute-row-height.js +26 -13
  210. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  211. package/es/scenegraph/layout/frozen.d.ts +2 -0
  212. package/es/scenegraph/layout/frozen.js +137 -3
  213. package/es/scenegraph/layout/frozen.js.map +1 -1
  214. package/es/scenegraph/layout/update-height.js +2 -1
  215. package/es/scenegraph/layout/update-height.js.map +1 -1
  216. package/es/scenegraph/layout/update-width.js +45 -66
  217. package/es/scenegraph/layout/update-width.js.map +1 -1
  218. package/es/scenegraph/refresh-node/update-chart.js +9 -5
  219. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  220. package/es/scenegraph/scenegraph.d.ts +9 -4
  221. package/es/scenegraph/scenegraph.js +39 -104
  222. package/es/scenegraph/scenegraph.js.map +1 -1
  223. package/es/scenegraph/style/corner-cell.d.ts +2 -2
  224. package/es/scenegraph/style/corner-cell.js +4 -7
  225. package/es/scenegraph/style/corner-cell.js.map +1 -1
  226. package/es/scenegraph/utils/measure-text.js +10 -9
  227. package/es/scenegraph/utils/measure-text.js.map +1 -1
  228. package/es/state/hover/update-position.js +1 -1
  229. package/es/state/hover/update-position.js.map +1 -1
  230. package/es/state/state.d.ts +1 -0
  231. package/es/state/state.js +5 -1
  232. package/es/state/state.js.map +1 -1
  233. package/es/ts-types/base-table.d.ts +10 -2
  234. package/es/ts-types/base-table.js.map +1 -1
  235. package/es/ts-types/table-engine.d.ts +1 -1
  236. package/es/ts-types/table-engine.js.map +1 -1
  237. package/package.json +2 -2
package/dist/vtable.js CHANGED
@@ -28300,153 +28300,6 @@
28300
28300
  params[params.W = 1] = "W", params[params.H = 2] = "H", params[params.WH = 3] = "WH";
28301
28301
  }(params || (params = {}));
28302
28302
 
28303
- class Group extends Group$1 {
28304
- role;
28305
- col;
28306
- row;
28307
- mergeCol;
28308
- mergeRow;
28309
- rowNumber;
28310
- colHeight;
28311
- border;
28312
- needUpdate;
28313
- clear() {
28314
- this.removeAllChild();
28315
- }
28316
- getChildByName(name, deep) {
28317
- let result = null;
28318
- this.forEachChildren((child) => {
28319
- if (child.name === name) {
28320
- result = child;
28321
- return true;
28322
- }
28323
- return false;
28324
- });
28325
- if (deep) {
28326
- this.forEachChildren((child) => {
28327
- if (child.getChildByName) {
28328
- const target = child.getChildByName(name, true);
28329
- if (target) {
28330
- result = target;
28331
- return true;
28332
- }
28333
- }
28334
- return false;
28335
- });
28336
- }
28337
- return result;
28338
- }
28339
- get width() {
28340
- let width = this.AABBBounds.width();
28341
- if (width === Infinity || width === -Infinity) {
28342
- width = 0;
28343
- }
28344
- return Math.max(width, this.attribute.width ?? 0);
28345
- }
28346
- get height() {
28347
- let height = this.AABBBounds.height();
28348
- if (height === Infinity || height === -Infinity) {
28349
- height = 0;
28350
- }
28351
- return Math.max(height, this.attribute.height ?? 0);
28352
- }
28353
- setDeltaWidth(deltaX) {
28354
- this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);
28355
- if (this.border) {
28356
- this.border.setAttribute('width', this.border.attribute.width + deltaX);
28357
- }
28358
- }
28359
- setDeltaHeight(deltaY) {
28360
- this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);
28361
- if (this.border) {
28362
- this.border.setAttribute('height', this.border.attribute.height + deltaY);
28363
- }
28364
- }
28365
- setDeltaX(deltaX) {
28366
- this.setAttribute('x', this.attribute.x + deltaX);
28367
- }
28368
- setDeltaY(deltaY) {
28369
- this.setAttribute('y', this.attribute.y + deltaY);
28370
- }
28371
- forEachChildrenSkipChild(cb, skipChildName = 'border-rect', reverse = false) {
28372
- if (reverse) {
28373
- let child = this._lastChild;
28374
- let i = 0;
28375
- while (child) {
28376
- if (child.name !== skipChildName) {
28377
- const breakTag = cb(child, i++);
28378
- if (breakTag) {
28379
- return;
28380
- }
28381
- }
28382
- child = child._prev;
28383
- }
28384
- }
28385
- else {
28386
- let child = this._firstChild;
28387
- let i = 0;
28388
- while (child) {
28389
- if (child.name !== skipChildName) {
28390
- const breakTag = cb(child, i++);
28391
- if (breakTag) {
28392
- return;
28393
- }
28394
- }
28395
- child = child._next;
28396
- }
28397
- }
28398
- }
28399
- getColGroup(col) {
28400
- let c = this._firstChild;
28401
- if (!c) {
28402
- return null;
28403
- }
28404
- for (let i = 0; i < this.childrenCount; i++) {
28405
- if (c.col === col) {
28406
- return c;
28407
- }
28408
- c = c._next;
28409
- }
28410
- return null;
28411
- }
28412
- getRowGroup(row) {
28413
- let c = this._firstChild;
28414
- if (!c) {
28415
- return null;
28416
- }
28417
- for (let i = 0; i < this.childrenCount; i++) {
28418
- if (c.row === row) {
28419
- return c;
28420
- }
28421
- c = c._next;
28422
- }
28423
- return null;
28424
- }
28425
- getChildAt(index) {
28426
- const child = super.getChildAt(index);
28427
- if (child && child.name === 'border-rect') {
28428
- return child._next;
28429
- }
28430
- return child;
28431
- }
28432
- updateColumnRowNumber(row) {
28433
- if (!this.rowNumber) {
28434
- this.rowNumber = row;
28435
- }
28436
- else {
28437
- this.rowNumber = Math.max(this.rowNumber, row);
28438
- }
28439
- }
28440
- updateColumnHeight(cellHeight) {
28441
- if (!this.colHeight) {
28442
- this.colHeight = cellHeight;
28443
- }
28444
- else {
28445
- this.colHeight += cellHeight;
28446
- }
28447
- }
28448
- }
28449
-
28450
28303
  function getCellMergeInfo(table, col, row) {
28451
28304
  if (!table.isHeader(col, row) && table.getBodyColumnDefine(col, row)?.mergeCell !== true) {
28452
28305
  return false;
@@ -36651,6 +36504,19 @@
36651
36504
  attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
36652
36505
  this.component = new LineAxis(merge$2({}, axisStylrAttrs, attrs));
36653
36506
  this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
36507
+ this.component.originAxis = this;
36508
+ }
36509
+ resize(width, height) {
36510
+ this.width = width;
36511
+ this.height = height;
36512
+ this.updateScaleRange();
36513
+ this.computeData();
36514
+ const axisStylrAttrs = getAxisAttributes(this.option);
36515
+ const attrs = this.getUpdateAttribute();
36516
+ attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
36517
+ this.component.setAttributes(merge$2({}, axisStylrAttrs, attrs));
36518
+ this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
36519
+ this.overlap();
36654
36520
  }
36655
36521
  overlap() {
36656
36522
  doOverlap(this.component, this);
@@ -38234,55 +38100,202 @@
38234
38100
  return extend(builtins, icons);
38235
38101
  }
38236
38102
 
38237
- function calcKeepAspectRatioSize(width, height, maxWidth, maxHeight) {
38238
- let newWidth = width;
38239
- let newHeight = height;
38240
- if (newWidth > maxWidth) {
38241
- newWidth = maxWidth;
38242
- newHeight = (newWidth * height) / width;
38103
+ class Group extends Group$1 {
38104
+ role;
38105
+ col;
38106
+ row;
38107
+ mergeCol;
38108
+ mergeRow;
38109
+ rowNumber;
38110
+ colHeight;
38111
+ border;
38112
+ needUpdate;
38113
+ clear() {
38114
+ this.removeAllChild();
38243
38115
  }
38244
- if (newHeight > maxHeight) {
38245
- newHeight = maxHeight;
38246
- newWidth = (newHeight * width) / height;
38116
+ getChildByName(name, deep) {
38117
+ let result = null;
38118
+ this.forEachChildren((child) => {
38119
+ if (child.name === name) {
38120
+ result = child;
38121
+ return true;
38122
+ }
38123
+ return false;
38124
+ });
38125
+ if (deep) {
38126
+ this.forEachChildren((child) => {
38127
+ if (child.getChildByName) {
38128
+ const target = child.getChildByName(name, true);
38129
+ if (target) {
38130
+ result = target;
38131
+ return true;
38132
+ }
38133
+ }
38134
+ return false;
38135
+ });
38136
+ }
38137
+ return result;
38247
38138
  }
38248
- return {
38249
- width: newWidth,
38250
- height: newHeight
38251
- };
38252
- }
38253
-
38254
- function calcStartPosition(left, top, width, height, contentWidth, contentHeight, textAlign = 'left', textBaseline = 'middle', margin = [0, 0, 0, 0], paddingLeft = 0, paddingRight = 0, paddingTop = 0, paddingBottom = 0) {
38255
- const right = left + width;
38256
- const bottom = top + height;
38257
- let x = left + margin[3] + paddingLeft;
38258
- if (textAlign === 'right' || textAlign === 'end') {
38259
- x = right - contentWidth - margin[1] - paddingRight;
38139
+ get width() {
38140
+ let width = this.AABBBounds.width();
38141
+ if (width === Infinity || width === -Infinity) {
38142
+ width = 0;
38143
+ }
38144
+ return Math.max(width, this.attribute.width ?? 0);
38260
38145
  }
38261
- else if (textAlign === 'center') {
38262
- x = left + (width - contentWidth + paddingLeft - paddingRight) / 2;
38146
+ get height() {
38147
+ let height = this.AABBBounds.height();
38148
+ if (height === Infinity || height === -Infinity) {
38149
+ height = 0;
38150
+ }
38151
+ return Math.max(height, this.attribute.height ?? 0);
38263
38152
  }
38264
- let y = top + margin[0] + paddingTop;
38265
- if (textBaseline === 'bottom' || textBaseline === 'alphabetic' || textBaseline === 'ideographic') {
38266
- y = bottom - contentHeight - margin[2] - paddingBottom;
38153
+ setDeltaWidth(deltaX) {
38154
+ this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);
38155
+ if (this.border) {
38156
+ this.border.setAttribute('width', this.border.attribute.width + deltaX);
38157
+ }
38267
38158
  }
38268
- else if (textBaseline === 'middle') {
38269
- y = top + (height - contentHeight + paddingTop - paddingBottom) / 2;
38159
+ setDeltaHeight(deltaY) {
38160
+ this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);
38161
+ if (this.border) {
38162
+ this.border.setAttribute('height', this.border.attribute.height + deltaY);
38163
+ }
38270
38164
  }
38271
- return { x, y };
38272
- }
38273
-
38274
- function getProp(name, cellStyle, col, row, _table) {
38275
- const prop = cellStyle && isValid$1(cellStyle[name]) ? cellStyle[name] : null;
38276
- if (typeof prop === 'function') {
38277
- const arg = {
38278
- col,
38279
- row,
38280
- table: _table,
38281
- value: _table.getCellValue(col, row),
38282
- dataValue: _table.getCellOriginValue(col, row),
38283
- cellHeaderPaths: _table.getCellHeaderPaths(col, row)
38284
- };
38285
- return prop(arg);
38165
+ setDeltaX(deltaX) {
38166
+ this.setAttribute('x', this.attribute.x + deltaX);
38167
+ }
38168
+ setDeltaY(deltaY) {
38169
+ this.setAttribute('y', this.attribute.y + deltaY);
38170
+ }
38171
+ forEachChildrenSkipChild(cb, skipChildName = 'border-rect', reverse = false) {
38172
+ if (reverse) {
38173
+ let child = this._lastChild;
38174
+ let i = 0;
38175
+ while (child) {
38176
+ if (child.name !== skipChildName) {
38177
+ const breakTag = cb(child, i++);
38178
+ if (breakTag) {
38179
+ return;
38180
+ }
38181
+ }
38182
+ child = child._prev;
38183
+ }
38184
+ }
38185
+ else {
38186
+ let child = this._firstChild;
38187
+ let i = 0;
38188
+ while (child) {
38189
+ if (child.name !== skipChildName) {
38190
+ const breakTag = cb(child, i++);
38191
+ if (breakTag) {
38192
+ return;
38193
+ }
38194
+ }
38195
+ child = child._next;
38196
+ }
38197
+ }
38198
+ }
38199
+ getColGroup(col) {
38200
+ let c = this._firstChild;
38201
+ if (!c) {
38202
+ return null;
38203
+ }
38204
+ for (let i = 0; i < this.childrenCount; i++) {
38205
+ if (c.col === col) {
38206
+ return c;
38207
+ }
38208
+ c = c._next;
38209
+ }
38210
+ return null;
38211
+ }
38212
+ getRowGroup(row) {
38213
+ let c = this._firstChild;
38214
+ if (!c) {
38215
+ return null;
38216
+ }
38217
+ for (let i = 0; i < this.childrenCount; i++) {
38218
+ if (c.row === row) {
38219
+ return c;
38220
+ }
38221
+ c = c._next;
38222
+ }
38223
+ return null;
38224
+ }
38225
+ getChildAt(index) {
38226
+ const child = super.getChildAt(index);
38227
+ if (child && child.name === 'border-rect') {
38228
+ return child._next;
38229
+ }
38230
+ return child;
38231
+ }
38232
+ updateColumnRowNumber(row) {
38233
+ if (!this.rowNumber) {
38234
+ this.rowNumber = row;
38235
+ }
38236
+ else {
38237
+ this.rowNumber = Math.max(this.rowNumber, row);
38238
+ }
38239
+ }
38240
+ updateColumnHeight(cellHeight) {
38241
+ if (!this.colHeight) {
38242
+ this.colHeight = cellHeight;
38243
+ }
38244
+ else {
38245
+ this.colHeight += cellHeight;
38246
+ }
38247
+ }
38248
+ }
38249
+
38250
+ function calcKeepAspectRatioSize(width, height, maxWidth, maxHeight) {
38251
+ let newWidth = width;
38252
+ let newHeight = height;
38253
+ if (newWidth > maxWidth) {
38254
+ newWidth = maxWidth;
38255
+ newHeight = (newWidth * height) / width;
38256
+ }
38257
+ if (newHeight > maxHeight) {
38258
+ newHeight = maxHeight;
38259
+ newWidth = (newHeight * width) / height;
38260
+ }
38261
+ return {
38262
+ width: newWidth,
38263
+ height: newHeight
38264
+ };
38265
+ }
38266
+
38267
+ function calcStartPosition(left, top, width, height, contentWidth, contentHeight, textAlign = 'left', textBaseline = 'middle', margin = [0, 0, 0, 0], paddingLeft = 0, paddingRight = 0, paddingTop = 0, paddingBottom = 0) {
38268
+ const right = left + width;
38269
+ const bottom = top + height;
38270
+ let x = left + margin[3] + paddingLeft;
38271
+ if (textAlign === 'right' || textAlign === 'end') {
38272
+ x = right - contentWidth - margin[1] - paddingRight;
38273
+ }
38274
+ else if (textAlign === 'center') {
38275
+ x = left + (width - contentWidth + paddingLeft - paddingRight) / 2;
38276
+ }
38277
+ let y = top + margin[0] + paddingTop;
38278
+ if (textBaseline === 'bottom' || textBaseline === 'alphabetic' || textBaseline === 'ideographic') {
38279
+ y = bottom - contentHeight - margin[2] - paddingBottom;
38280
+ }
38281
+ else if (textBaseline === 'middle') {
38282
+ y = top + (height - contentHeight + paddingTop - paddingBottom) / 2;
38283
+ }
38284
+ return { x, y };
38285
+ }
38286
+
38287
+ function getProp(name, cellStyle, col, row, _table) {
38288
+ const prop = cellStyle && isValid$1(cellStyle[name]) ? cellStyle[name] : null;
38289
+ if (typeof prop === 'function') {
38290
+ const arg = {
38291
+ col,
38292
+ row,
38293
+ table: _table,
38294
+ value: _table.getCellValue(col, row),
38295
+ dataValue: _table.getCellOriginValue(col, row),
38296
+ cellHeaderPaths: _table.getCellHeaderPaths(col, row)
38297
+ };
38298
+ return prop(arg);
38286
38299
  }
38287
38300
  return prop;
38288
38301
  }
@@ -38332,7 +38345,7 @@
38332
38345
  cellGroup.role = 'cell';
38333
38346
  cellGroup.col = col;
38334
38347
  cellGroup.row = row;
38335
- columnGroup.addChild(cellGroup);
38348
+ columnGroup?.addChild(cellGroup);
38336
38349
  const value = table.getCellValue(col, row);
38337
38350
  const image = createImage({
38338
38351
  x: padding[3],
@@ -38903,7 +38916,7 @@
38903
38916
  cellGroup.role = 'cell';
38904
38917
  cellGroup.col = col;
38905
38918
  cellGroup.row = row;
38906
- columnGroup.addChild(cellGroup);
38919
+ columnGroup?.addChild(cellGroup);
38907
38920
  }
38908
38921
  const chartGroup = createSparkLine(col, row, width, height, padding, table);
38909
38922
  if (chartGroup) {
@@ -39137,34 +39150,35 @@
39137
39150
  fontSize: DEFAULT_TEXT_FONT_SIZE
39138
39151
  },
39139
39152
  getTextBounds: useNaiveCanvas ? undefined : getTextBounds,
39140
- specialCharSet: `-/: .,@%'"~${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}`,
39153
+ specialCharSet: `{}()//&-/: .,@%'"~${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}`,
39141
39154
  ...(option ?? {})
39142
39155
  }, textSpec);
39143
39156
  };
39144
39157
  const fastTextMeasureCache = new Map();
39145
- function getFastTextMeasure(fontSize, fontFamily) {
39146
- const key = `${fontSize}-${fontFamily}`;
39158
+ function getFastTextMeasure(fontSize, fontWeight, fontFamily) {
39159
+ const key = `${fontSize}-${fontWeight}-${fontFamily}`;
39147
39160
  const cache = fastTextMeasureCache.get(key);
39148
39161
  if (cache) {
39149
39162
  return cache;
39150
39163
  }
39151
39164
  const fastTextMeasure = initTextMeasure({
39152
39165
  fontSize,
39153
- fontFamily
39166
+ fontFamily,
39167
+ fontWeight
39154
39168
  });
39155
39169
  fastTextMeasureCache.set(key, fastTextMeasure);
39156
39170
  return fastTextMeasure;
39157
39171
  }
39158
39172
  class TextMeasureTool {
39159
39173
  measureText(text, options) {
39160
- const { fontSize, fontFamily } = options;
39161
- const fastTextMeasure = getFastTextMeasure(fontSize, fontFamily);
39174
+ const { fontSize, fontFamily, fontWeight } = options;
39175
+ const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily);
39162
39176
  const textMeasure = fastTextMeasure.measure(text);
39163
39177
  return textMeasure;
39164
39178
  }
39165
39179
  measureTextWidth(text, options) {
39166
- const { fontSize, fontFamily = 'sans-serif' } = options;
39167
- const fastTextMeasure = getFastTextMeasure(fontSize, fontFamily);
39180
+ const { fontSize, fontFamily = 'sans-serif', fontWeight = 'normal' } = options;
39181
+ const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily);
39168
39182
  const textMeasure = fastTextMeasure.measure(text);
39169
39183
  return textMeasure.width;
39170
39184
  }
@@ -39245,7 +39259,7 @@
39245
39259
  let width;
39246
39260
  let str;
39247
39261
  const attribute = this.attribute;
39248
- const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontFamily = textTheme.fontFamily, stroke = textTheme.stroke, lineHeight = attribute.lineHeight ?? attribute.fontSize ?? textTheme.fontSize, lineWidth = textTheme.lineWidth } = attribute;
39262
+ const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontFamily = textTheme.fontFamily, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineHeight = attribute.lineHeight ?? attribute.fontSize ?? textTheme.fontSize, lineWidth = textTheme.lineWidth } = attribute;
39249
39263
  if (!this.shouldUpdateShape() && this.cache) {
39250
39264
  width = this.cache.clipedWidth;
39251
39265
  const dx = textDrawOffsetX(textAlign, width);
@@ -39272,7 +39286,7 @@
39272
39286
  this.cache.clipedWidth = width;
39273
39287
  }
39274
39288
  else {
39275
- width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontFamily });
39289
+ width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontFamily, fontWeight });
39276
39290
  this.cache.clipedText = text.toString();
39277
39291
  this.cache.clipedWidth = width;
39278
39292
  }
@@ -39287,7 +39301,7 @@
39287
39301
  }
39288
39302
  updateMultilineAABBBounds(text) {
39289
39303
  const textTheme = getTheme(this).text;
39290
- const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, lineHeight = this.attribute.lineHeight ?? this.attribute.fontSize ?? textTheme.fontSize, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, heightLimit = -1, lineClamp = textTheme.lineClamp, autoWrapText = textTheme.autoWrapText } = this.attribute;
39304
+ const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, fontWeight = textTheme.fontWeight, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, lineHeight = this.attribute.lineHeight ?? this.attribute.fontSize ?? textTheme.fontSize, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, heightLimit = -1, lineClamp = textTheme.lineClamp, autoWrapText = textTheme.autoWrapText } = this.attribute;
39291
39305
  if (!this.shouldUpdateShape() && this.cache?.layoutData) {
39292
39306
  const bbox = this.cache.layoutData.bbox;
39293
39307
  this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);
@@ -39336,7 +39350,7 @@
39336
39350
  const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth);
39337
39351
  if (str !== '' && clip.str === '') {
39338
39352
  clip.str = str.substring(0, 1);
39339
- clip.width = textMeasure.measureTextWidth(clip.str, { fontSize, fontFamily });
39353
+ clip.width = textMeasure.measureTextWidth(clip.str, { fontSize, fontFamily, fontWeight });
39340
39354
  }
39341
39355
  linesLayout.push({
39342
39356
  str: clip.str,
@@ -40419,6 +40433,9 @@
40419
40433
  else if (type === 'image' || type === 'video') {
40420
40434
  updateImageCellContentWhileResize(cell, col, row, scene.table);
40421
40435
  }
40436
+ else if (cell.firstChild?.name === 'axis') {
40437
+ cell.firstChild?.originAxis.resize(cell.attribute.width, cell.attribute.height);
40438
+ }
40422
40439
  else {
40423
40440
  const style = scene.table._getCellStyle(col, row);
40424
40441
  updateCellContentHeight(cell, distHeight, detaY, scene.table.heightMode === 'autoHeight', getQuadProps(style.padding), style.textAlign, style.textBaseline);
@@ -40452,111 +40469,21 @@
40452
40469
 
40453
40470
  function updateColWidth(scene, col, detaX) {
40454
40471
  const autoRowHeight = scene.table.heightMode === 'autoHeight';
40455
- let needRerangeRow = false;
40456
40472
  const colOrCornerHeaderColumn = scene.getColGroup(col, true);
40457
- const oldColOrCornerHeaderColumnWidth = colOrCornerHeaderColumn?.attribute.width;
40458
- colOrCornerHeaderColumn?.setAttribute('width', oldColOrCornerHeaderColumnWidth + detaX);
40459
- colOrCornerHeaderColumn?.forEachChildren((cell, index) => {
40460
- const isHeightChange = updateCellWidth(scene, cell, col, cell.row, oldColOrCornerHeaderColumnWidth, detaX, index < scene.table.columnHeaderLevelCount, autoRowHeight);
40461
- if (isHeightChange) {
40462
- const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
40463
- if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40464
- for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
40465
- resetRowHeight(scene, row);
40466
- }
40467
- }
40468
- else {
40469
- resetRowHeight(scene, cell.row);
40470
- }
40471
- needRerangeRow = true;
40472
- }
40473
- });
40474
- if (needRerangeRow) {
40475
- let newTotalHeight = 0;
40476
- for (let col = 0; col < scene.table.colCount; col++) {
40477
- const colGroup = scene.getColGroup(col, true);
40478
- let y = 0;
40479
- colGroup.forEachChildren((cellGroup) => {
40480
- if (cellGroup.role !== 'cell') {
40481
- return;
40482
- }
40483
- cellGroup.setAttribute('y', y);
40484
- y += cellGroup.attribute.height;
40485
- });
40486
- newTotalHeight = y;
40487
- }
40488
- scene.updateContainerHeight(0, newTotalHeight - scene.colHeaderGroup.attribute.height);
40473
+ if (colOrCornerHeaderColumn) {
40474
+ updateColunmWidth(colOrCornerHeaderColumn, detaX, autoRowHeight, 'col-corner', scene);
40489
40475
  }
40490
- needRerangeRow = false;
40491
40476
  const rowHeaderOrBodyColumn = scene.getColGroup(col);
40492
- const oldRowHeaderOrBodyColumn = rowHeaderOrBodyColumn.attribute.width;
40493
- rowHeaderOrBodyColumn?.setAttribute('width', oldRowHeaderOrBodyColumn + detaX);
40494
- rowHeaderOrBodyColumn?.forEachChildren((cell, index) => {
40495
- const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldRowHeaderOrBodyColumn, detaX, col < scene.table.rowHeaderLevelCount, autoRowHeight);
40496
- if (isHeightChange) {
40497
- const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
40498
- if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40499
- for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
40500
- resetRowHeight(scene, row);
40501
- }
40502
- }
40503
- else {
40504
- resetRowHeight(scene, cell.row);
40505
- }
40506
- needRerangeRow = true;
40507
- }
40508
- });
40509
- if (needRerangeRow) {
40510
- let newTotalHeight = 0;
40511
- for (let col = 0; col < scene.table.colCount; col++) {
40512
- const colGroup = scene.getColGroup(col, false);
40513
- let y = 0;
40514
- colGroup.forEachChildren((cellGroup) => {
40515
- if (cellGroup.role !== 'cell') {
40516
- return;
40517
- }
40518
- cellGroup.setAttribute('y', y);
40519
- y += cellGroup.attribute.height;
40520
- });
40521
- newTotalHeight = y;
40522
- }
40523
- scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
40477
+ if (rowHeaderOrBodyColumn) {
40478
+ updateColunmWidth(rowHeaderOrBodyColumn, detaX, autoRowHeight, 'row-body', scene);
40479
+ }
40480
+ const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);
40481
+ if (leftBottomColumn) {
40482
+ updateColunmWidth(leftBottomColumn, detaX, autoRowHeight, 'left-bottom', scene);
40524
40483
  }
40525
40484
  const bottomColumn = scene.getColGroupInBottom(col);
40526
40485
  if (bottomColumn) {
40527
- const oldBottomColumnWidth = bottomColumn.attribute.width;
40528
- bottomColumn?.setAttribute('width', oldBottomColumnWidth + detaX);
40529
- bottomColumn?.forEachChildren((cell, index) => {
40530
- const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldBottomColumnWidth, detaX, col < scene.table.rowHeaderLevelCount, autoRowHeight);
40531
- if (isHeightChange) {
40532
- const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
40533
- if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40534
- for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
40535
- resetRowHeight(scene, row);
40536
- }
40537
- }
40538
- else {
40539
- resetRowHeight(scene, cell.row);
40540
- }
40541
- needRerangeRow = true;
40542
- }
40543
- });
40544
- if (needRerangeRow) {
40545
- let newTotalHeight = 0;
40546
- for (let col = 0; col < scene.table.colCount; col++) {
40547
- const colGroup = scene.getColGroup(col, false);
40548
- let y = 0;
40549
- colGroup.forEachChildren((cellGroup) => {
40550
- if (cellGroup.role !== 'cell') {
40551
- return;
40552
- }
40553
- cellGroup.setAttribute('y', y);
40554
- y += cellGroup.attribute.height;
40555
- });
40556
- newTotalHeight = y;
40557
- }
40558
- scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
40559
- }
40486
+ updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);
40560
40487
  }
40561
40488
  if (col < scene.frozenColCount) {
40562
40489
  scene.cornerHeaderGroup.forEachChildrenSkipChild((column, index) => {
@@ -40581,15 +40508,81 @@
40581
40508
  column.setAttribute('x', column.attribute.x + detaX);
40582
40509
  }
40583
40510
  });
40584
- if (bottomColumn) {
40585
- scene.bottomFrozenGroup.forEachChildrenSkipChild((column, index) => {
40586
- if (column.col > col) {
40587
- column.setAttribute('x', column.attribute.x + detaX);
40511
+ }
40512
+ if (leftBottomColumn) {
40513
+ scene.leftBottomCornerGroup.forEachChildrenSkipChild((column, index) => {
40514
+ if (column.col > col) {
40515
+ column.setAttribute('x', column.attribute.x + detaX);
40516
+ }
40517
+ });
40518
+ }
40519
+ if (bottomColumn) {
40520
+ scene.bottomFrozenGroup.forEachChildrenSkipChild((column, index) => {
40521
+ if (column.col > col) {
40522
+ column.setAttribute('x', column.attribute.x + detaX);
40523
+ }
40524
+ });
40525
+ }
40526
+ scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);
40527
+ }
40528
+ function updateColunmWidth(columnGroup, detaX, autoRowHeight, mode, scene) {
40529
+ let needRerangeRow = false;
40530
+ const oldColumnWidth = columnGroup?.attribute.width ?? 0;
40531
+ columnGroup?.setAttribute('width', oldColumnWidth + detaX);
40532
+ columnGroup?.forEachChildren((cell, index) => {
40533
+ const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, detaX, mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true, autoRowHeight);
40534
+ if (isHeightChange) {
40535
+ const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
40536
+ if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40537
+ for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
40538
+ resetRowHeight(scene, row);
40539
+ }
40540
+ }
40541
+ else {
40542
+ resetRowHeight(scene, cell.row);
40543
+ }
40544
+ needRerangeRow = true;
40545
+ }
40546
+ });
40547
+ if (needRerangeRow) {
40548
+ let newTotalHeight = 0;
40549
+ let colGroup;
40550
+ let oldContainerHeight;
40551
+ let row;
40552
+ for (let col = 0; col < scene.table.colCount; col++) {
40553
+ if (mode === 'col-corner') {
40554
+ row = 0;
40555
+ colGroup = scene.getColGroup(col, true);
40556
+ oldContainerHeight = scene.colHeaderGroup.attribute.height ?? 0;
40557
+ }
40558
+ else if (mode === 'row-body') {
40559
+ row = scene.table.frozenRowCount;
40560
+ colGroup = scene.getColGroup(col, false);
40561
+ oldContainerHeight = scene.bodyGroup.attribute.height ?? 0;
40562
+ }
40563
+ else if (mode === 'bottom') {
40564
+ row = scene.table.rowCount - scene.table.bottomFrozenRowCount;
40565
+ colGroup = scene.getColGroupInBottom(col);
40566
+ oldContainerHeight = scene.bottomFrozenGroup.attribute.height ?? 0;
40567
+ }
40568
+ else if (mode === 'left-bottom') {
40569
+ row = scene.table.rowCount - scene.table.bottomFrozenRowCount;
40570
+ colGroup = scene.getColGroupInLeftBottomCorner(col);
40571
+ oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;
40572
+ }
40573
+ let y = 0;
40574
+ colGroup.forEachChildren((cellGroup) => {
40575
+ if (cellGroup.role !== 'cell') {
40576
+ cellGroup.setAttribute('y', y);
40577
+ return;
40588
40578
  }
40579
+ cellGroup.setAttribute('y', y);
40580
+ y += cellGroup.attribute.height ?? 0;
40589
40581
  });
40582
+ newTotalHeight = y;
40590
40583
  }
40584
+ scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);
40591
40585
  }
40592
- scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);
40593
40586
  }
40594
40587
  function updateCellWidth(scene, cell, col, row, width, detaX, isHeader, autoRowHeight) {
40595
40588
  let cellGroup;
@@ -40654,6 +40647,9 @@
40654
40647
  axis.overlap();
40655
40648
  }
40656
40649
  }
40650
+ else if (cell.firstChild?.name === 'axis') {
40651
+ cell.firstChild?.originAxis.resize(cell.attribute.width, cell.attribute.height);
40652
+ }
40657
40653
  else {
40658
40654
  const style = scene.table._getCellStyle(col, row);
40659
40655
  isHeightChange = updateCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline, scene);
@@ -40664,6 +40660,9 @@
40664
40660
  let maxHeight = 0;
40665
40661
  for (let col = 0; col < scene.table.colCount; col++) {
40666
40662
  const cell = scene.highPerformanceGetCell(col, row);
40663
+ if (cell.role === 'empty') {
40664
+ return;
40665
+ }
40667
40666
  let cellHeight = getCleanCellHeight(cell, scene);
40668
40667
  const mergeInfo = getCellMergeInfo(scene.table, col, row);
40669
40668
  if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
@@ -40674,6 +40673,9 @@
40674
40673
  for (let col = 0; col < scene.table.colCount; col++) {
40675
40674
  let distHeight = maxHeight;
40676
40675
  const cell = scene.highPerformanceGetCell(col, row);
40676
+ if (cell.role === 'empty') {
40677
+ return;
40678
+ }
40677
40679
  const mergeInfo = getCellMergeInfo(scene.table, col, row);
40678
40680
  if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40679
40681
  for (let rowIndex = mergeInfo.start.row; rowIndex <= mergeInfo.end.row; rowIndex++) {
@@ -41794,18 +41796,101 @@
41794
41796
  }
41795
41797
  }
41796
41798
 
41797
- const ChartRender = Symbol.for('ChartRender');
41798
- let DefaultCanvasChartRender = class DefaultCanvasChartRender {
41799
- type;
41800
- numberType = CHART_NUMBER_TYPE;
41801
- drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
41802
- const groupAttribute = getTheme(chart, params?.theme).group;
41803
- const { dataId, data } = chart.attribute;
41804
- const viewBox = chart.getViewBox();
41805
- const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
41806
- const { chartInstance, active, cacheCanvas, activeChartInstance } = chart;
41807
- if (!active && cacheCanvas) {
41808
- context.drawImage(cacheCanvas, x, y, width, height);
41799
+ const chartRenderKeys = [];
41800
+ const chartRenderQueueList = [];
41801
+ let batchRenderChartCount = 5;
41802
+ let isHandlingChartQueue = false;
41803
+ function setBatchRenderChartCount(count) {
41804
+ if (isValid$1(count)) {
41805
+ batchRenderChartCount = count;
41806
+ }
41807
+ }
41808
+ function IsHandlingChartQueue() {
41809
+ return isHandlingChartQueue;
41810
+ }
41811
+ function renderChart(chart) {
41812
+ const { axes, dataId, data } = chart.attribute;
41813
+ const { chartInstance } = chart;
41814
+ const viewBox = chart.getViewBox();
41815
+ axes.forEach((axis, index) => {
41816
+ if (axis.type === 'linear') {
41817
+ const chartAxis = chartInstance._chart._components[index];
41818
+ chartAxis._domain = {
41819
+ min: axis.range?.min ?? 0,
41820
+ max: axis.range?.max ?? 0
41821
+ };
41822
+ }
41823
+ else if (axis.type === 'band') {
41824
+ const chartAxis = chartInstance._chart._components[index];
41825
+ chartAxis._spec.domain = axis.domain.slice(0);
41826
+ chartAxis.updateScaleDomain();
41827
+ }
41828
+ });
41829
+ chartInstance.updateViewBox({
41830
+ x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
41831
+ x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
41832
+ y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
41833
+ y2: viewBox.y2 - chart.getRootNode().table.scrollTop
41834
+ }, false, false);
41835
+ if (typeof dataId === 'string') {
41836
+ chartInstance.updateDataSync(dataId, data ?? []);
41837
+ }
41838
+ else {
41839
+ const dataBatch = [];
41840
+ for (const dataIdStr in dataId) {
41841
+ const dataIdAndField = dataId[dataIdStr];
41842
+ dataBatch.push({
41843
+ id: dataIdStr,
41844
+ data: dataIdAndField
41845
+ ? data?.filter((item) => {
41846
+ return item.hasOwnProperty(dataIdAndField);
41847
+ }) ?? []
41848
+ : data ?? []
41849
+ });
41850
+ if (!chartInstance.updateDataInBatchesSync) {
41851
+ chartInstance.updateDataSync(dataIdStr, dataIdAndField
41852
+ ? data?.filter((item) => {
41853
+ return item.hasOwnProperty(dataIdAndField);
41854
+ }) ?? []
41855
+ : data ?? []);
41856
+ }
41857
+ }
41858
+ chartInstance.updateDataInBatchesSync?.(dataBatch);
41859
+ }
41860
+ const sg = chartInstance.getStage();
41861
+ chart.cacheCanvas = sg.toCanvas();
41862
+ }
41863
+ function startRenderChartQueue(table) {
41864
+ isHandlingChartQueue = true;
41865
+ if (chartRenderQueueList.length > 0) {
41866
+ requestAnimationFrame(() => {
41867
+ const chartsToRender = chartRenderQueueList.splice(0, batchRenderChartCount);
41868
+ chartRenderKeys.splice(0, batchRenderChartCount);
41869
+ chartsToRender.forEach(chart => {
41870
+ renderChart(chart);
41871
+ chart.addUpdateBoundTag();
41872
+ });
41873
+ table.render();
41874
+ startRenderChartQueue(table);
41875
+ });
41876
+ }
41877
+ else {
41878
+ isHandlingChartQueue = false;
41879
+ }
41880
+ }
41881
+
41882
+ const ChartRender = Symbol.for('ChartRender');
41883
+ let DefaultCanvasChartRender = class DefaultCanvasChartRender {
41884
+ type;
41885
+ numberType = CHART_NUMBER_TYPE;
41886
+ drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
41887
+ const groupAttribute = getTheme(chart, params?.theme).group;
41888
+ const { dataId, data } = chart.attribute;
41889
+ chart.getViewBox();
41890
+ const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
41891
+ const { chartInstance, active, cacheCanvas, activeChartInstance } = chart;
41892
+ if (!active && cacheCanvas) {
41893
+ context.drawImage(cacheCanvas, x, y, width, height);
41809
41894
  }
41810
41895
  else if (activeChartInstance) {
41811
41896
  if (typeof dataId === 'string') {
@@ -41823,42 +41908,18 @@
41823
41908
  }
41824
41909
  }
41825
41910
  else {
41826
- const { axes } = chart.attribute;
41827
- axes.forEach((axis, index) => {
41828
- if (axis.type === 'linear') {
41829
- const chartAxis = chartInstance._chart._components[index];
41830
- chartAxis._domain = {
41831
- min: axis.range?.min ?? 0,
41832
- max: axis.range?.max ?? 0
41833
- };
41911
+ if (chart.getRootNode().table.internalProps.renderChartAsync) {
41912
+ if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {
41913
+ chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);
41914
+ chartRenderQueueList.push(chart);
41834
41915
  }
41835
- else if (axis.type === 'band') {
41836
- const chartAxis = chartInstance._chart._components[index];
41837
- chartAxis._spec.domain = axis.domain.slice(0);
41838
- chartAxis.updateScaleDomain();
41916
+ if (!IsHandlingChartQueue()) {
41917
+ startRenderChartQueue(chart.getRootNode().table);
41839
41918
  }
41840
- });
41841
- chartInstance.updateViewBox({
41842
- x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
41843
- x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
41844
- y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
41845
- y2: viewBox.y2 - chart.getRootNode().table.scrollTop
41846
- }, false);
41847
- if (typeof dataId === 'string') {
41848
- chartInstance.updateDataSync(dataId, data ?? []);
41849
41919
  }
41850
41920
  else {
41851
- for (const dataIdStr in dataId) {
41852
- const dataIdAndField = dataId[dataIdStr];
41853
- chartInstance.updateDataSync(dataIdStr, dataIdAndField
41854
- ? data?.filter((item) => {
41855
- return item.hasOwnProperty(dataIdAndField);
41856
- }) ?? []
41857
- : data ?? []);
41858
- }
41921
+ renderChart(chart);
41859
41922
  }
41860
- const sg = chartInstance.getStage();
41861
- chart.cacheCanvas = sg.toCanvas();
41862
41923
  }
41863
41924
  }
41864
41925
  draw(chart, renderService, drawContext, params) {
@@ -41881,26 +41942,7 @@
41881
41942
  else {
41882
41943
  this.drawShape(chart, context, 0, 0, drawContext);
41883
41944
  }
41884
- const chartAttribute = getTheme(chart, params?.theme).group;
41885
- const { scrollX = chartAttribute.scrollX, scrollY = chartAttribute.scrollY } = chart.attribute;
41886
- if (scrollX || scrollY) {
41887
- context.translate(scrollX, scrollY);
41888
- }
41889
- let p;
41890
- if (params && params.drawingCb) {
41891
- p = params.drawingCb();
41892
- }
41893
- if (p && p.then) {
41894
- p.then(() => {
41895
- if (clip) {
41896
- context.restore();
41897
- }
41898
- else {
41899
- context.highPerformanceRestore();
41900
- }
41901
- });
41902
- }
41903
- else if (clip) {
41945
+ if (clip) {
41904
41946
  context.restore();
41905
41947
  }
41906
41948
  else {
@@ -42337,10 +42379,12 @@
42337
42379
  drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
42338
42380
  if (group.role === 'cell') {
42339
42381
  const table = group.stage.table;
42340
- const hoverColor = getCellHoverColor(group, table);
42341
- if (hoverColor) {
42342
- group.oldColor = group.attribute.fill;
42343
- group.attribute.fill = hoverColor;
42382
+ if (table.stateManeger.interactionState !== InteractionState.scrolling) {
42383
+ const hoverColor = getCellHoverColor(group, table);
42384
+ if (hoverColor) {
42385
+ group.oldColor = group.attribute.fill;
42386
+ group.attribute.fill = hoverColor;
42387
+ }
42344
42388
  }
42345
42389
  }
42346
42390
  }
@@ -42558,10 +42602,10 @@
42558
42602
  if (isArray$3(rowDimensionKey)) {
42559
42603
  rowDimensionKey = rowDimensionKey[0];
42560
42604
  }
42561
- const data = layout.dataset.collectedValues[rowDimensionKey];
42605
+ const data = layout.dataset.collectedValues[rowDimensionKey] ?? [];
42562
42606
  const recordRow = layout.getRecordIndexByRow(row);
42563
42607
  const rowPath = layout.getRowKeysPath()[recordRow];
42564
- const domain = data[rowPath[rowPath.length - 1]];
42608
+ const domain = data[rowPath[rowPath.length - 1]] ?? [];
42565
42609
  const axisOption = getAxisOption(col, row, 'left', layout);
42566
42610
  if (axisOption?.visible === false) {
42567
42611
  return;
@@ -42659,7 +42703,7 @@
42659
42703
  if (isArray$3(columnDimensionKey)) {
42660
42704
  columnDimensionKey = columnDimensionKey[0];
42661
42705
  }
42662
- const data = layout.dataset.collectedValues[columnDimensionKey];
42706
+ const data = layout.dataset.collectedValues[columnDimensionKey] ?? [];
42663
42707
  const recordCol = layout.getRecordIndexByCol(col);
42664
42708
  const colPath = layout.getColKeysPath()[recordCol];
42665
42709
  const domain = data?.[colPath[colPath.length - 1]] ?? [];
@@ -42743,6 +42787,7 @@
42743
42787
  }
42744
42788
  labelWidth = Math.max(labelWidth, table.measureText(text, {
42745
42789
  fontSize: attribute.label?.style?.fontSize,
42790
+ fontWeight: attribute.label?.style?.fontWeight,
42746
42791
  fontFamily: attribute.label?.style?.fontFamily
42747
42792
  }).width);
42748
42793
  });
@@ -42759,6 +42804,7 @@
42759
42804
  }
42760
42805
  labelWidth = Math.max(labelWidth, table.measureText(text, {
42761
42806
  fontSize: attribute.label?.style?.fontSize,
42807
+ fontWeight: attribute.label?.style?.fontWeight,
42762
42808
  fontFamily: attribute.label?.style?.fontFamily
42763
42809
  }).width + 2);
42764
42810
  });
@@ -42771,6 +42817,7 @@
42771
42817
  titleWidth =
42772
42818
  table.measureText(attribute.title.text, {
42773
42819
  fontSize: attribute.title?.style?.fontSize,
42820
+ fontWeight: attribute.title?.style?.fontWeight,
42774
42821
  fontFamily: attribute.title?.style?.fontFamily
42775
42822
  }).height + 2;
42776
42823
  }
@@ -42778,6 +42825,7 @@
42778
42825
  titleWidth =
42779
42826
  table.measureText(attribute.title.text, {
42780
42827
  fontSize: attribute.title?.style?.fontSize,
42828
+ fontWeight: attribute.title?.style?.fontWeight,
42781
42829
  fontFamily: attribute.title?.style?.fontFamily
42782
42830
  }).width + 2;
42783
42831
  }
@@ -42848,6 +42896,7 @@
42848
42896
  }
42849
42897
 
42850
42898
  function computeColsWidth(table, colStart, colEnd, update) {
42899
+ typeof window !== 'undefined' ? window.performance.now() : 0;
42851
42900
  colStart = colStart ?? 0;
42852
42901
  colEnd = colEnd ?? table.colCount - 1;
42853
42902
  if (colStart === 0 && colEnd === table.colCount - 1) {
@@ -43127,12 +43176,14 @@
43127
43176
  const paddingWidth = padding[1] + padding[3];
43128
43177
  const fontSize = getProp('fontSize', actStyle, col, row, table);
43129
43178
  const fontFamily = getProp('fontFamily', actStyle, col, row, table);
43179
+ const fontWeight = getProp('fontWeight', actStyle, col, row, table);
43130
43180
  const lines = validToString(cellValue).split('\n') || [];
43131
43181
  if (lines.length >= 1) {
43132
43182
  lines.forEach((line) => {
43133
43183
  const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {
43134
43184
  fontSize,
43135
- fontFamily
43185
+ fontFamily,
43186
+ fontWeight
43136
43187
  }).width;
43137
43188
  maxWidth = Math.max((width + paddingWidth + 4 + iconWidth) / spanCol, maxWidth);
43138
43189
  });
@@ -43164,19 +43215,14 @@
43164
43215
  height: 0,
43165
43216
  textConfig: []
43166
43217
  });
43167
- function computeRowsHeight(table, rowStart, rowEnd) {
43168
- const time = typeof window !== 'undefined' ? window.performance.now() : 0;
43218
+ function computeRowsHeight(table, rowStart, rowEnd, isClearRowRangeHeightsMap = true) {
43219
+ typeof window !== 'undefined' ? window.performance.now() : 0;
43169
43220
  if (table.heightMode === 'autoHeight' || table.heightMode === 'adaptive') {
43170
43221
  rowStart = rowStart ?? 0;
43171
43222
  rowEnd = rowEnd ?? table.rowCount - 1;
43172
- if (rowStart === 0 && rowEnd === table.rowCount - 1) {
43223
+ if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {
43173
43224
  table._clearRowRangeHeightsMap();
43174
43225
  }
43175
- else {
43176
- for (let row = rowStart; row <= rowEnd; row++) {
43177
- table._clearRowRangeHeightsMap(row);
43178
- }
43179
- }
43180
43226
  for (let row = rowStart; row < table.columnHeaderLevelCount; row++) {
43181
43227
  const height = computeRowHeight(row, 0, table.colCount - 1, table);
43182
43228
  table.setRowHeight(row, height);
@@ -43184,24 +43230,31 @@
43184
43230
  if (rowEnd < table.columnHeaderLevelCount) {
43185
43231
  return;
43186
43232
  }
43187
- if (!table.internalProps.transpose &&
43188
- !(table.isPivotTable() && table.internalProps.layoutMap.indicatorsAsCol) &&
43233
+ if (!(table.internalProps.transpose ||
43234
+ (table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol)) &&
43189
43235
  checkFixedStyleAndNoWrap(table)) {
43190
43236
  const height = computeRowHeight(table.columnHeaderLevelCount, 0, table.colCount - 1, table);
43191
- fillRowsHeight(height, table.columnHeaderLevelCount, table.rowCount - 1, table);
43237
+ fillRowsHeight(height, table.columnHeaderLevelCount, table.rowCount - 1 - table.bottomFrozenRowCount, table);
43238
+ for (let row = table.rowCount - table.bottomFrozenRowCount; row <= rowEnd; row++) {
43239
+ const height = computeRowHeight(row, 0, table.colCount - 1, table);
43240
+ table.setRowHeight(row, height);
43241
+ }
43192
43242
  }
43193
- else if ((table.internalProps.transpose ||
43194
- (table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol)) &&
43195
- checkFixedStyleAndNoWrap(table)) {
43243
+ else if (table.internalProps.transpose ||
43244
+ (table.isPivotTable() && !table.internalProps.layoutMap.indicatorsAsCol)) {
43196
43245
  for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {
43197
- table._clearRowRangeHeightsMap(row);
43198
- const height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);
43246
+ let height;
43247
+ if (checkFixedStyleAndNoWrapForTranspose(table, row)) {
43248
+ height = computeRowHeight(row, 0, table.rowHeaderLevelCount, table);
43249
+ }
43250
+ else {
43251
+ height = computeRowHeight(row, 0, table.colCount - 1, table);
43252
+ }
43199
43253
  table.setRowHeight(row, height);
43200
43254
  }
43201
43255
  }
43202
43256
  else {
43203
43257
  for (let row = Math.max(rowStart, table.columnHeaderLevelCount); row <= rowEnd; row++) {
43204
- table._clearRowRangeHeightsMap(row);
43205
43258
  const height = computeRowHeight(row, 0, table.colCount - 1, table);
43206
43259
  table.setRowHeight(row, height);
43207
43260
  }
@@ -43227,7 +43280,6 @@
43227
43280
  table.setRowHeight(row, rowHeight, false);
43228
43281
  }
43229
43282
  }
43230
- console.log('computeRowsHeight time:', (typeof window !== 'undefined' ? window.performance.now() : 0) - time);
43231
43283
  }
43232
43284
  function computeRowHeight(row, startCol, endCol, table) {
43233
43285
  let maxHeight = 0;
@@ -43269,14 +43321,16 @@
43269
43321
  function checkFixedStyleAndNoWrap(table) {
43270
43322
  const { layoutMap } = table.internalProps;
43271
43323
  const row = table.columnHeaderLevelCount;
43324
+ if (table.internalProps.autoWrapText &&
43325
+ (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')) {
43326
+ return false;
43327
+ }
43272
43328
  for (let col = 0; col < table.colCount; col++) {
43273
- const isHeader = layoutMap.isHeader(col, row);
43274
- const cellDefine = isHeader ? layoutMap.getHeader(col, row) : layoutMap.getBody(col, row);
43329
+ const cellDefine = layoutMap.getBody(col, row);
43275
43330
  if (typeof cellDefine.style === 'function' ||
43276
43331
  typeof cellDefine.icon === 'function' ||
43277
- typeof cellDefine.headerIcon === 'function' ||
43278
- (isHeader ? cellDefine.define?.headerCustomRender : cellDefine.define?.customRender) ||
43279
- (isHeader ? typeof cellDefine.define?.headerIcon === 'function' : typeof cellDefine.define?.icon === 'function')) {
43332
+ cellDefine.define?.customRender ||
43333
+ typeof cellDefine.define?.icon === 'function') {
43280
43334
  return false;
43281
43335
  }
43282
43336
  const cellStyle = table._getCellStyle(col, row);
@@ -43289,6 +43343,28 @@
43289
43343
  }
43290
43344
  return true;
43291
43345
  }
43346
+ function checkFixedStyleAndNoWrapForTranspose(table, row) {
43347
+ const { layoutMap } = table.internalProps;
43348
+ if (table.internalProps.autoWrapText &&
43349
+ (table.options.heightMode === 'autoHeight' || table.options.heightMode === 'adaptive')) {
43350
+ return false;
43351
+ }
43352
+ const cellDefine = layoutMap.getBody(table.rowHeaderLevelCount, row);
43353
+ if (typeof cellDefine.style === 'function' ||
43354
+ typeof cellDefine.icon === 'function' ||
43355
+ cellDefine.define?.customRender ||
43356
+ typeof cellDefine.define?.icon === 'function') {
43357
+ return false;
43358
+ }
43359
+ const cellStyle = table._getCellStyle(table.rowHeaderLevelCount, row);
43360
+ if (typeof cellStyle.padding === 'function' ||
43361
+ typeof cellStyle.fontSize === 'function' ||
43362
+ typeof cellStyle.lineHeight === 'function' ||
43363
+ cellStyle.autoWrapText === true) {
43364
+ return false;
43365
+ }
43366
+ return true;
43367
+ }
43292
43368
  function fillRowsHeight(height, startRow, endRow, table) {
43293
43369
  for (let row = startRow; row <= endRow; row++) {
43294
43370
  table.setRowHeight(row, height);
@@ -43450,7 +43526,7 @@
43450
43526
  cellGroup.role = 'cell';
43451
43527
  cellGroup.col = col;
43452
43528
  cellGroup.row = row;
43453
- columnGroup.addChild(cellGroup);
43529
+ columnGroup?.addChild(cellGroup);
43454
43530
  }
43455
43531
  cellGroup.AABBBounds.width();
43456
43532
  const chartGroup = new Chart({
@@ -43506,7 +43582,7 @@
43506
43582
  cellGroup.role = 'cell';
43507
43583
  cellGroup.col = col;
43508
43584
  cellGroup.row = row;
43509
- columnGroup.addChild(cellGroup);
43585
+ columnGroup?.addChild(cellGroup);
43510
43586
  if (customElementsGroup) {
43511
43587
  cellGroup.appendChild(customElementsGroup);
43512
43588
  }
@@ -43570,7 +43646,7 @@
43570
43646
  cellGroup.role = 'cell';
43571
43647
  cellGroup.col = col;
43572
43648
  cellGroup.row = row;
43573
- columnGroup.addChild(cellGroup);
43649
+ columnGroup?.addChild(cellGroup);
43574
43650
  const value = table.getCellValue(col, row);
43575
43651
  const video = document.createElement('video');
43576
43652
  video.addEventListener('loadeddata', () => {
@@ -43783,6 +43859,7 @@
43783
43859
  if (!addNew) {
43784
43860
  oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
43785
43861
  oldCellGroup.parent.removeChild(oldCellGroup);
43862
+ updateCell$1(range.start.col, range.start.row, table, false);
43786
43863
  }
43787
43864
  }
43788
43865
  else {
@@ -43923,7 +44000,7 @@
43923
44000
  cellGroup.row = row;
43924
44001
  cellGroup.mergeCol = range.start.col;
43925
44002
  cellGroup.mergeRow = range.start.row;
43926
- columnGroup.addChild(cellGroup);
44003
+ columnGroup?.addChild(cellGroup);
43927
44004
  columnGroup.updateColumnRowNumber(row);
43928
44005
  columnGroup.updateColumnHeight(height);
43929
44006
  range = table.getCellRange(col, row);
@@ -43992,6 +44069,7 @@
43992
44069
  }
43993
44070
 
43994
44071
  async function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, proxy) {
44072
+ const { leftBottomCornerGroup, rightTopCornerGroup, rightBottomCornerGroup } = proxy.table.scenegraph;
43995
44073
  proxy.setParamsForRow();
43996
44074
  proxy.setParamsForColumn();
43997
44075
  proxy.table.internalProps._colWidthsMap.clear();
@@ -44018,11 +44096,20 @@
44018
44096
  createColGroup(colHeaderGroup, xOrigin, yOrigin, proxy.table.rowHeaderLevelCount, Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), 0, proxy.table.columnHeaderLevelCount - 1, 'columnHeader', proxy.table);
44019
44097
  createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, proxy.table.rowHeaderLevelCount - 1, proxy.table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), 'rowHeader', proxy.table);
44020
44098
  if (proxy.table.bottomFrozenRowCount > 0) {
44099
+ if (!proxy.table.isPivotChart()) {
44100
+ createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, proxy.table.rowHeaderLevelCount - 1, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, proxy.table.rowCount - 1, 'rowHeader', proxy.table);
44101
+ }
44021
44102
  createColGroup(bottomFrozenGroup, xOrigin, yOrigin, proxy.table.rowHeaderLevelCount, Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, proxy.table.rowCount - 1, 'body', proxy.table);
44022
44103
  }
44023
44104
  if (proxy.table.rightFrozenColCount > 0) {
44105
+ if (!proxy.table.isPivotChart()) {
44106
+ createColGroup(rightTopCornerGroup, xOrigin, yOrigin, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, proxy.table.colCount - 1, 0, proxy.table.columnHeaderLevelCount - 1, 'columnHeader', proxy.table);
44107
+ }
44024
44108
  createColGroup(rightFrozenGroup, xOrigin, yOrigin, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, proxy.table.colCount - 1, proxy.table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), 'body', proxy.table);
44025
44109
  }
44110
+ if (proxy.table.bottomFrozenRowCount > 0 && proxy.table.rightFrozenColCount > 0 && !proxy.table.isPivotChart()) {
44111
+ createColGroup(rightBottomCornerGroup, xOrigin, yOrigin, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, proxy.table.colCount - 1, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, proxy.table.rowCount - 1, 'body', proxy.table);
44112
+ }
44026
44113
  createColGroup(bodyGroup, xOrigin, yOrigin, proxy.table.rowHeaderLevelCount, Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), proxy.table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), 'body', proxy.table);
44027
44114
  if (!bodyGroup.firstChild) {
44028
44115
  proxy.currentRow = proxy.totalRow;
@@ -44047,34 +44134,171 @@
44047
44134
  }
44048
44135
  }
44049
44136
 
44137
+ function checkFirstRowMerge(row, proxy) {
44138
+ for (let col = 0; col < proxy.table.colCount; col++) {
44139
+ if ((col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||
44140
+ (col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)) {
44141
+ continue;
44142
+ }
44143
+ const range = getCellMergeInfo(proxy.table, col, row);
44144
+ if (range && range.start.row !== row) {
44145
+ const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
44146
+ const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
44147
+ newCellGroup.col = col;
44148
+ newCellGroup.row = row;
44149
+ newCellGroup.setAttribute('y', proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1));
44150
+ oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
44151
+ oldCellGroup.parent.removeChild(oldCellGroup);
44152
+ oldCellGroup.needUpdate = false;
44153
+ newCellGroup.needUpdate = false;
44154
+ if (proxy.cellCache.get(col)) {
44155
+ proxy.cellCache.set(col, newCellGroup);
44156
+ }
44157
+ }
44158
+ }
44159
+ }
44160
+ function checkFirstColMerge(col, scrolling, proxy) {
44161
+ for (let row = 0; row < proxy.table.rowCount; row++) {
44162
+ if ((row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||
44163
+ (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)) {
44164
+ continue;
44165
+ }
44166
+ const range = getCellMergeInfo(proxy.table, col, row);
44167
+ if (range && range.start.col !== col) {
44168
+ if (scrolling && checkHasColMerge(range.start.col, range.end.col, row, proxy)) {
44169
+ continue;
44170
+ }
44171
+ const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
44172
+ const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
44173
+ newCellGroup.col = col;
44174
+ newCellGroup.row = row;
44175
+ newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x);
44176
+ oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
44177
+ oldCellGroup.parent.removeChild(oldCellGroup);
44178
+ oldCellGroup.needUpdate = false;
44179
+ newCellGroup.needUpdate = false;
44180
+ if (proxy.cellCache.get(col)) {
44181
+ proxy.cellCache.set(col, newCellGroup);
44182
+ }
44183
+ }
44184
+ }
44185
+ }
44186
+ function checkHasColMerge(colStart, colEnd, row, proxy) {
44187
+ for (let col = colStart; col <= colEnd; col++) {
44188
+ if (proxy.highPerformanceGetCell(col, row, true).role !== 'shadow-cell' &&
44189
+ proxy.highPerformanceGetCell(col, row, true).role !== 'empty') {
44190
+ return true;
44191
+ }
44192
+ }
44193
+ return false;
44194
+ }
44195
+ function getFirstChild(containerGroup) {
44196
+ let child = containerGroup.firstChild;
44197
+ while (child.type !== 'group') {
44198
+ child = child._next;
44199
+ }
44200
+ return child;
44201
+ }
44202
+ function getLastChild(containerGroup) {
44203
+ let child = containerGroup.lastChild;
44204
+ while (child.type !== 'group') {
44205
+ child = child._prev;
44206
+ }
44207
+ return child;
44208
+ }
44209
+ function getPrevGroup(group) {
44210
+ let child = group._prev;
44211
+ while (child && child.type !== 'group') {
44212
+ child = child._prev;
44213
+ }
44214
+ return child;
44215
+ }
44216
+ function getNextGroup(group) {
44217
+ let child = group._next;
44218
+ while (child && child.type !== 'group') {
44219
+ child = child._next;
44220
+ }
44221
+ return child;
44222
+ }
44223
+
44224
+ function updateAutoColumn(colStart, colEnd, table, direction = 'left') {
44225
+ for (let col = colStart; col <= colEnd; col++) {
44226
+ const bodyColGroup = table.scenegraph.getColGroup(col);
44227
+ if (bodyColGroup) {
44228
+ moveColumnGroup(bodyColGroup, table, direction);
44229
+ }
44230
+ const columnHeaderColGroup = table.scenegraph.getColGroup(col, true);
44231
+ if (columnHeaderColGroup) {
44232
+ moveColumnGroup(columnHeaderColGroup, table, direction);
44233
+ }
44234
+ const bottomColGroup = table.scenegraph.getColGroupInBottom(col);
44235
+ if (bottomColGroup) {
44236
+ moveColumnGroup(bottomColGroup, table, direction);
44237
+ }
44238
+ }
44239
+ const totalActualBodyColumnCount = Math.min(table.scenegraph.proxy.colLimit, table.scenegraph.proxy.bodyRightCol - table.scenegraph.proxy.bodyLeftCol + 1);
44240
+ const totalBodyWidth = table.getColsWidth(table.rowHeaderLevelCount, table.rowHeaderLevelCount + totalActualBodyColumnCount);
44241
+ const totalWidth = table.getColsWidth(table.rowHeaderLevelCount, table.colCount - 1);
44242
+ table.scenegraph.proxy.xLimitLeft = totalBodyWidth / 2;
44243
+ table.scenegraph.proxy.xLimitRight = totalWidth - totalBodyWidth / 2;
44244
+ }
44245
+ function moveColumnGroup(colGroup, table, direction = 'left') {
44246
+ if (direction === 'left') {
44247
+ let x;
44248
+ const prevCellGroup = getPrevGroup(colGroup);
44249
+ if (prevCellGroup) {
44250
+ x = prevCellGroup.attribute.x + table.getColWidth(colGroup._prev.col);
44251
+ }
44252
+ else {
44253
+ x = table.getColsWidth(table.rowHeaderLevelCount, colGroup.col - 1);
44254
+ }
44255
+ colGroup.setAttribute('x', x);
44256
+ }
44257
+ else {
44258
+ let x;
44259
+ const nextCellGroup = getNextGroup(colGroup);
44260
+ if (nextCellGroup) {
44261
+ x = nextCellGroup.attribute.x - table.getColWidth(colGroup.col);
44262
+ }
44263
+ else {
44264
+ x = table.getColsWidth(table.rowHeaderLevelCount, colGroup.col - 1);
44265
+ }
44266
+ colGroup.setAttribute('x', x);
44267
+ }
44268
+ }
44269
+
44050
44270
  async function dynamicSetX(x, proxy) {
44051
44271
  const screenLeft = proxy.table.getTargetColAt(x + proxy.table.scenegraph.rowHeaderGroup.attribute.width);
44052
44272
  if (!screenLeft) {
44053
44273
  return;
44054
44274
  }
44055
- proxy.screenLeftCol = screenLeft.col;
44275
+ const screenLeftCol = screenLeft.col;
44276
+ const screenLeftX = screenLeft.left;
44277
+ proxy.screenLeftCol = screenLeftCol;
44056
44278
  const deltaCol = proxy.screenLeftCol - proxy.referenceCol;
44057
44279
  if (deltaCol > 0) {
44058
- proxy.table.scenegraph.setBodyAndColHeaderX(-x);
44059
- await moveColumn(deltaCol, 'left', proxy.screenLeftCol, proxy);
44280
+ moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);
44281
+ proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
44060
44282
  }
44061
44283
  else if (deltaCol < 0) {
44062
- proxy.table.scenegraph.setBodyAndColHeaderX(-x);
44063
- await moveColumn(-deltaCol, 'right', proxy.screenLeftCol, proxy);
44284
+ moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);
44285
+ proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
44064
44286
  }
44065
44287
  else {
44066
- proxy.table.scenegraph.setBodyAndColHeaderX(-x);
44288
+ proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
44067
44289
  }
44068
44290
  proxy.table.scenegraph.updateNextFrame();
44069
44291
  }
44070
- async function moveColumn(count, direction, screenLeftCol, proxy) {
44292
+ async function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
44071
44293
  if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {
44072
44294
  count = proxy.bodyRightCol - proxy.colEnd;
44073
44295
  }
44074
44296
  else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {
44075
44297
  count = proxy.colStart - proxy.bodyLeftCol;
44076
44298
  }
44077
- proxy.table.scenegraph.bodyGroup;
44299
+ if (count <= 0) {
44300
+ return;
44301
+ }
44078
44302
  if (count < proxy.colEnd - proxy.colStart) {
44079
44303
  const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;
44080
44304
  const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;
@@ -44082,18 +44306,22 @@
44082
44306
  const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;
44083
44307
  computeColsWidth(proxy.table, distStartCol, distEndCol);
44084
44308
  updatePartColPosition(startCol, endCol, direction, proxy);
44085
- const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenColCount * 1);
44086
- const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenColCount * 2);
44309
+ const syncLeftCol = distStartCol;
44310
+ const syncRightCol = distEndCol;
44087
44311
  proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;
44088
44312
  proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;
44089
- checkFirstColMerge(distStartCol, proxy);
44313
+ checkFirstColMerge(distStartCol, true, proxy);
44090
44314
  updateColContent(syncLeftCol, syncRightCol, proxy);
44315
+ updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, direction);
44316
+ const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol);
44317
+ const deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
44318
+ proxy.table.scenegraph.proxy.deltaX += deltaX;
44091
44319
  proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
44092
44320
  proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
44093
44321
  proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
44094
44322
  proxy.colUpdatePos = distStartCol;
44095
44323
  proxy.colUpdateDirection = direction;
44096
- proxy.table.scenegraph.stage.render();
44324
+ proxy.table.scenegraph.updateNextFrame();
44097
44325
  await proxy.progress();
44098
44326
  }
44099
44327
  else {
@@ -44101,19 +44329,21 @@
44101
44329
  const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;
44102
44330
  computeColsWidth(proxy.table, distStartCol, distEndCol);
44103
44331
  const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);
44104
- console.log('distStartColY', proxy.bodyLeftCol, distStartCol - 1, distStartColY);
44105
44332
  updateAllColPosition(distStartColY, count, direction, proxy);
44106
- const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenRowCount * 1);
44107
- const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenRowCount * 2);
44333
+ const syncLeftCol = distStartCol;
44334
+ const syncRightCol = distEndCol;
44108
44335
  proxy.colStart = distStartCol;
44109
44336
  proxy.colEnd = distEndCol;
44110
- checkFirstColMerge(distStartCol, proxy);
44337
+ checkFirstColMerge(distStartCol, false, proxy);
44111
44338
  updateColContent(syncLeftCol, syncRightCol, proxy);
44339
+ updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left');
44340
+ proxy.table.scenegraph.proxy.deltaX = 0;
44112
44341
  proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
44113
44342
  proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
44114
44343
  proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
44115
44344
  proxy.colUpdatePos = proxy.colStart;
44116
44345
  proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';
44346
+ proxy.table.scenegraph.updateNextFrame();
44117
44347
  await proxy.progress();
44118
44348
  }
44119
44349
  }
@@ -44127,12 +44357,16 @@
44127
44357
  colGroup.needUpdate = true;
44128
44358
  }
44129
44359
  function updateColGroupContent(colGroup, proxy) {
44360
+ if (!colGroup) {
44361
+ return;
44362
+ }
44130
44363
  let cellGroup = colGroup.firstChild;
44131
44364
  while (cellGroup) {
44132
44365
  const newCellGroup = proxy.updateCellGroupContent(cellGroup);
44133
44366
  cellGroup = newCellGroup._next;
44134
44367
  }
44135
44368
  colGroup.needUpdate = false;
44369
+ colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));
44136
44370
  }
44137
44371
  function updatePartColPosition(startCol, endCol, direction, proxy) {
44138
44372
  for (let col = startCol; col <= endCol; col++) {
@@ -44140,34 +44374,38 @@
44140
44374
  updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
44141
44375
  }
44142
44376
  if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {
44143
- updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
44377
+ updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);
44144
44378
  }
44145
44379
  if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {
44146
- updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
44380
+ updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);
44147
44381
  }
44148
44382
  }
44149
44383
  }
44150
44384
  function updateColPosition(containerGroup, direction, proxy) {
44151
44385
  if (direction === 'left') {
44152
- const colGroup = containerGroup.firstChild;
44153
- updateColGroupPosition(colGroup, containerGroup.lastChild.col + 1, containerGroup.lastChild.attribute.x + containerGroup.lastChild.attribute.width);
44386
+ const colGroup = getFirstChild(containerGroup);
44387
+ const lastChild = getLastChild(containerGroup);
44388
+ updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));
44154
44389
  containerGroup.appendChild(colGroup);
44390
+ if (containerGroup.border) {
44391
+ containerGroup.appendChild(containerGroup.border);
44392
+ }
44155
44393
  }
44156
44394
  else {
44157
- const colGroup = containerGroup.lastChild;
44158
- updateColGroupPosition(colGroup, containerGroup.firstChild.col - 1, containerGroup.firstChild.attribute.x -
44159
- proxy.table.getColWidth(containerGroup.firstChild.col - 1));
44395
+ const colGroup = getLastChild(containerGroup);
44396
+ const firstChild = getFirstChild(containerGroup);
44397
+ updateColGroupPosition(colGroup, firstChild.col - 1, firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1));
44160
44398
  containerGroup.insertBefore(colGroup, containerGroup.firstChild);
44161
44399
  }
44162
44400
  }
44163
44401
  function updateColContent(syncLeftCol, syncRightCol, proxy) {
44164
44402
  for (let col = syncLeftCol; col <= syncRightCol; col++) {
44165
44403
  const colGroup = proxy.table.scenegraph.getColGroup(col);
44166
- updateColGroupContent(colGroup, proxy);
44404
+ colGroup && updateColGroupContent(colGroup, proxy);
44167
44405
  const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);
44168
- updateColGroupContent(colHeaderColGroup, proxy);
44406
+ colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);
44169
44407
  const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);
44170
- updateColGroupContent(bottomColGroup, proxy);
44408
+ bottomColGroup && updateColGroupContent(bottomColGroup, proxy);
44171
44409
  }
44172
44410
  }
44173
44411
  function updateAllColPosition(distStartColY, count, direction, proxy) {
@@ -44193,29 +44431,6 @@
44193
44431
  }
44194
44432
  });
44195
44433
  }
44196
- function checkFirstColMerge(col, proxy) {
44197
- for (let row = 0; row < proxy.table.rowCount; row++) {
44198
- if ((row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||
44199
- (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)) {
44200
- continue;
44201
- }
44202
- const range = getCellMergeInfo(proxy.table, col, row);
44203
- if (range && range.start.row !== row) {
44204
- const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
44205
- const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
44206
- newCellGroup.col = col;
44207
- newCellGroup.row = row;
44208
- newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1));
44209
- oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
44210
- oldCellGroup.parent.removeChild(oldCellGroup);
44211
- oldCellGroup.needUpdate = false;
44212
- newCellGroup.needUpdate = false;
44213
- if (proxy.cellCache.get(col)) {
44214
- proxy.cellCache.set(col, newCellGroup);
44215
- }
44216
- }
44217
- }
44218
- }
44219
44434
 
44220
44435
  function updateAutoRow(colStart, colEnd, rowStart, rowEnd, table, direction = 'up') {
44221
44436
  if (direction === 'up') {
@@ -44308,9 +44523,7 @@
44308
44523
  syncTopRow = Math.max(distStartRow, topRow);
44309
44524
  syncBottomRow = Math.min(distEndRow, BottomRow);
44310
44525
  }
44311
- if (proxy.table.heightMode === 'autoHeight') {
44312
- computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);
44313
- }
44526
+ computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);
44314
44527
  proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
44315
44528
  proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
44316
44529
  checkFirstRowMerge(syncTopRow, proxy);
@@ -44346,9 +44559,7 @@
44346
44559
  syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);
44347
44560
  syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);
44348
44561
  }
44349
- if (proxy.table.heightMode === 'autoHeight') {
44350
- computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);
44351
- }
44562
+ computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);
44352
44563
  proxy.rowStart = distStartRow;
44353
44564
  proxy.rowEnd = distEndRow;
44354
44565
  checkFirstRowMerge(syncTopRow, proxy);
@@ -44446,29 +44657,6 @@
44446
44657
  }
44447
44658
  }
44448
44659
  }
44449
- function checkFirstRowMerge(row, proxy) {
44450
- for (let col = 0; col < proxy.table.colCount; col++) {
44451
- if ((col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||
44452
- (col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)) {
44453
- continue;
44454
- }
44455
- const range = getCellMergeInfo(proxy.table, col, row);
44456
- if (range && range.start.row !== row) {
44457
- const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
44458
- const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
44459
- newCellGroup.col = col;
44460
- newCellGroup.row = row;
44461
- newCellGroup.setAttribute('y', proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1));
44462
- oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
44463
- oldCellGroup.parent.removeChild(oldCellGroup);
44464
- oldCellGroup.needUpdate = false;
44465
- newCellGroup.needUpdate = false;
44466
- if (proxy.cellCache.get(col)) {
44467
- proxy.cellCache.set(col, newCellGroup);
44468
- }
44469
- }
44470
- }
44471
- }
44472
44660
 
44473
44661
  class SceneProxy {
44474
44662
  table;
@@ -44490,7 +44678,7 @@
44490
44678
  rowUpdateDirection;
44491
44679
  screenTopRow = 0;
44492
44680
  deltaY = 0;
44493
- colLimit = 1000;
44681
+ colLimit = 100;
44494
44682
  bodyLeftCol;
44495
44683
  bodyRightCol;
44496
44684
  totalCol;
@@ -44506,6 +44694,7 @@
44506
44694
  referenceCol;
44507
44695
  screenLeftCol = 0;
44508
44696
  colUpdateDirection;
44697
+ deltaX = 0;
44509
44698
  cellCache = new Map();
44510
44699
  constructor(table) {
44511
44700
  this.table = table;
@@ -44566,26 +44755,6 @@
44566
44755
  async createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin) {
44567
44756
  await createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, this);
44568
44757
  }
44569
- async createColGroupForFirstScreen(rowHeaderGroup, bodyGroup, xOrigin, yOrigin, table) {
44570
- this.setParamsForRow();
44571
- this.setParamsForColumn();
44572
- computeRowsHeight(table, this.table.columnHeaderLevelCount, Math.min(this.firstScreenRowLimit, table.rowCount - 1));
44573
- createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.rowHeaderLevelCount - 1, table.columnHeaderLevelCount, table.rowCount - 1, 'rowHeader', table, this.firstScreenRowLimit);
44574
- createColGroup(bodyGroup, xOrigin, yOrigin, table.rowHeaderLevelCount, table.colCount - 1, table.columnHeaderLevelCount, table.rowCount - 1, 'body', table, this.firstScreenRowLimit);
44575
- if (!bodyGroup.firstChild) {
44576
- this.currentRow = this.totalRow;
44577
- this.rowEnd = this.currentRow;
44578
- this.rowUpdatePos = this.rowEnd;
44579
- this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);
44580
- }
44581
- else {
44582
- this.currentRow = bodyGroup.firstChild?.rowNumber ?? this.totalRow;
44583
- this.rowEnd = this.currentRow;
44584
- this.rowUpdatePos = this.rowEnd;
44585
- this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);
44586
- await this.progress();
44587
- }
44588
- }
44589
44758
  async progress() {
44590
44759
  return new Promise((resolve, reject) => {
44591
44760
  setTimeout(async () => {
@@ -44625,7 +44794,7 @@
44625
44794
  }
44626
44795
  createRowCellGroup(onceCount) {
44627
44796
  const endRow = Math.min(this.totalRow, this.currentRow + onceCount);
44628
- computeRowsHeight(this.table, this.currentRow + 1, endRow);
44797
+ computeRowsHeight(this.table, this.currentRow + 1, endRow, false);
44629
44798
  if (this.table.rowHeaderLevelCount) {
44630
44799
  let maxHeight = 0;
44631
44800
  for (let col = 0; col < this.table.rowHeaderLevelCount; col++) {
@@ -44664,6 +44833,12 @@
44664
44833
  createColGroup(onceCount) {
44665
44834
  const endCol = Math.min(this.totalCol, this.currentCol + onceCount);
44666
44835
  computeColsWidth(this.table, this.currentCol + 1, endCol);
44836
+ for (let row = 0; row < this.table.rowCount; row++) {
44837
+ const cellGroup = this.highPerformanceGetCell(this.currentCol, row);
44838
+ if (isNumber(cellGroup.mergeCol) && cellGroup.mergeCol > this.currentCol) {
44839
+ this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);
44840
+ }
44841
+ }
44667
44842
  if (this.table.columnHeaderLevelCount) {
44668
44843
  const lastColumnGroup = (this.table.scenegraph.colHeaderGroup.lastChild instanceof Group
44669
44844
  ? this.table.scenegraph.colHeaderGroup.lastChild
@@ -44731,7 +44906,7 @@
44731
44906
  updateCellGroups(count) {
44732
44907
  const distRow = Math.min(this.bodyBottomRow, this.rowUpdatePos + count);
44733
44908
  if (this.table.heightMode === 'autoHeight') {
44734
- computeRowsHeight(this.table, this.rowUpdatePos, distRow);
44909
+ computeRowsHeight(this.table, this.rowUpdatePos, distRow, false);
44735
44910
  }
44736
44911
  updateRowContent(this.rowUpdatePos, distRow, this);
44737
44912
  if (this.table.heightMode === 'autoHeight') {
@@ -44780,9 +44955,7 @@
44780
44955
  syncBottomRow = Math.min(this.bodyBottomRow, this.screenTopRow + this.screenRowCount * 3);
44781
44956
  }
44782
44957
  console.log('sort更新同步范围', syncTopRow, syncBottomRow);
44783
- if (this.table.heightMode === 'autoHeight') {
44784
- computeRowsHeight(this.table, syncTopRow, syncBottomRow);
44785
- }
44958
+ computeRowsHeight(this.table, syncTopRow, syncBottomRow);
44786
44959
  for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
44787
44960
  for (let row = syncTopRow; row <= syncBottomRow; row++) {
44788
44961
  const cellGroup = this.highPerformanceGetCell(col, row);
@@ -45417,25 +45590,296 @@
45417
45590
  });
45418
45591
  }
45419
45592
  }
45420
- function checkHaveTextStick(table) {
45421
- const headerObjects = table.internalProps.layoutMap.headerObjects;
45422
- const columnObjects = table.internalProps.layoutMap.columnObjects;
45423
- for (let i = 0; i < headerObjects.length; i++) {
45424
- const header = headerObjects[i];
45425
- if (header && header.style?.textStick) {
45426
- console.log('checkHaveTextStick', true);
45427
- return true;
45428
- }
45593
+ function checkHaveTextStick(table) {
45594
+ const headerObjects = table.internalProps.layoutMap.headerObjects;
45595
+ const columnObjects = table.internalProps.layoutMap.columnObjects;
45596
+ for (let i = 0; i < headerObjects.length; i++) {
45597
+ const header = headerObjects[i];
45598
+ if (header && header.style?.textStick) {
45599
+ console.log('checkHaveTextStick', true);
45600
+ return true;
45601
+ }
45602
+ }
45603
+ for (let i = 0; i < columnObjects.length; i++) {
45604
+ const column = columnObjects[i];
45605
+ if (column && column.style?.textStick) {
45606
+ console.log('checkHaveTextStick', true);
45607
+ return true;
45608
+ }
45609
+ }
45610
+ console.log('checkHaveTextStick', false);
45611
+ return false;
45612
+ }
45613
+
45614
+ function dealFrozen(scene) {
45615
+ if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {
45616
+ scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
45617
+ scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
45618
+ scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
45619
+ for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
45620
+ moveColumnFromBodyToRowHeader(scene);
45621
+ moveColumnFromColHeaderToCornerHeader(scene);
45622
+ }
45623
+ }
45624
+ else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) {
45625
+ for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) {
45626
+ moveColumnFromRowHeaderToBody(scene);
45627
+ moveColumnFromCornerHeaderToColHeader(scene);
45628
+ }
45629
+ }
45630
+ scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
45631
+ scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
45632
+ scene.updateContainer();
45633
+ scene.updateBorderSizeAndPosition();
45634
+ if (!scene.isPivot && !scene.transpose) {
45635
+ scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
45636
+ }
45637
+ scene.hasFrozen = true;
45638
+ scene.frozenColCount = scene.table.frozenColCount;
45639
+ scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
45640
+ }
45641
+ function resetFrozen(scene) {
45642
+ if (scene.frozenColCount > scene.table.rowHeaderLevelCount) {
45643
+ for (let i = 0; i < scene.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
45644
+ moveColumnFromRowHeaderToBody(scene);
45645
+ moveColumnFromCornerHeaderToColHeader(scene);
45646
+ }
45647
+ }
45648
+ else if (scene.frozenColCount < scene.table.rowHeaderLevelCount) {
45649
+ scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
45650
+ scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
45651
+ scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
45652
+ for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.frozenColCount; i++) {
45653
+ moveColumnFromBodyToRowHeader(scene);
45654
+ moveColumnFromColHeaderToCornerHeader(scene);
45655
+ }
45656
+ }
45657
+ scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
45658
+ scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
45659
+ scene.updateContainer();
45660
+ scene.updateBorderSizeAndPosition();
45661
+ if (!scene.isPivot && !scene.transpose) {
45662
+ scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
45663
+ }
45664
+ scene.hasFrozen = true;
45665
+ scene.frozenColCount = scene.table.rowHeaderLevelCount;
45666
+ scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
45667
+ }
45668
+ function moveColumnFromBodyToRowHeader(scene) {
45669
+ const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;
45670
+ if (column) {
45671
+ scene.rowHeaderGroup.appendChild(column);
45672
+ scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width + column.attribute.width);
45673
+ scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width - column.attribute.width);
45674
+ }
45675
+ }
45676
+ function moveColumnFromColHeaderToCornerHeader(scene) {
45677
+ const headerColumn = scene.colHeaderGroup.firstChild instanceof Group ? scene.colHeaderGroup.firstChild : null;
45678
+ if (headerColumn) {
45679
+ scene.cornerHeaderGroup.appendChild(headerColumn);
45680
+ scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width + headerColumn.attribute.width);
45681
+ scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width - headerColumn.attribute.width);
45682
+ }
45683
+ }
45684
+ function moveColumnFromRowHeaderToBody(scene) {
45685
+ const column = scene.rowHeaderGroup.lastChild instanceof Group
45686
+ ? scene.rowHeaderGroup.lastChild
45687
+ : scene.rowHeaderGroup.lastChild?._prev;
45688
+ if (column) {
45689
+ insertBefore(scene.bodyGroup, column, scene.bodyGroup.firstChild);
45690
+ scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width + column.attribute.width);
45691
+ scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width - column.attribute.width);
45692
+ }
45693
+ }
45694
+ function moveColumnFromCornerHeaderToColHeader(scene) {
45695
+ const headerColumn = scene.cornerHeaderGroup.lastChild instanceof Group
45696
+ ? scene.cornerHeaderGroup.lastChild
45697
+ : scene.cornerHeaderGroup.lastChild?._prev;
45698
+ if (headerColumn) {
45699
+ insertBefore(scene.colHeaderGroup, headerColumn, scene.colHeaderGroup.firstChild);
45700
+ scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width + headerColumn.attribute.width);
45701
+ scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width);
45702
+ }
45703
+ }
45704
+ function dealRightFrozen(distRightFrozenCol, scene) {
45705
+ const { table, proxy, rightTopCornerGroup, rightFrozenGroup, rightBottomCornerGroup, bottomFrozenGroup, bodyGroup, colHeaderGroup } = scene;
45706
+ const currentRightFrozenCol = scene.table.rightFrozenColCount;
45707
+ if (distRightFrozenCol > currentRightFrozenCol) {
45708
+ for (let col = table.colCount - currentRightFrozenCol - 1; col >= table.colCount - distRightFrozenCol; col--) {
45709
+ const colGroup = scene.getColGroup(col);
45710
+ insertBefore(rightFrozenGroup, colGroup, rightFrozenGroup.firstChild);
45711
+ const headerColGroup = scene.getColGroup(col, true);
45712
+ insertBefore(rightTopCornerGroup, headerColGroup, rightTopCornerGroup.firstChild);
45713
+ const bottomColGroup = scene.getColGroupInBottom(col);
45714
+ insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild);
45715
+ }
45716
+ let x = 0;
45717
+ rightFrozenGroup.forEachChildren((columnGroup) => {
45718
+ columnGroup.setAttribute('x', x);
45719
+ x += columnGroup.attribute.width;
45720
+ });
45721
+ x = 0;
45722
+ rightTopCornerGroup.forEachChildren((columnGroup) => {
45723
+ columnGroup.setAttribute('x', x);
45724
+ x += columnGroup.attribute.width;
45725
+ });
45726
+ x = 0;
45727
+ rightBottomCornerGroup.forEachChildren((columnGroup) => {
45728
+ columnGroup.setAttribute('x', x);
45729
+ x += columnGroup.attribute.width;
45730
+ });
45731
+ }
45732
+ else if (distRightFrozenCol < currentRightFrozenCol) {
45733
+ for (let col = table.colCount - currentRightFrozenCol; col < table.colCount - distRightFrozenCol; col++) {
45734
+ const colGroup = scene.getColGroup(col);
45735
+ colGroup.setAttribute('x', bodyGroup.lastChild.attribute.x + table.getColWidth(bodyGroup.lastChild.col));
45736
+ bodyGroup.appendChild(colGroup);
45737
+ const headerColGroup = scene.getColGroupInRightTopCorner(col);
45738
+ headerColGroup.setAttribute('x', colHeaderGroup.lastChild.attribute.x + table.getColWidth(colHeaderGroup.lastChild.col));
45739
+ colHeaderGroup.appendChild(headerColGroup);
45740
+ const bottomColGroup = scene.getColGroupInRightBottomCorner(col);
45741
+ bottomColGroup.setAttribute('x', bottomFrozenGroup.lastChild.attribute.x +
45742
+ table.getColWidth(bottomFrozenGroup.lastChild.col));
45743
+ bottomFrozenGroup.appendChild(bottomColGroup);
45744
+ }
45745
+ let x = 0;
45746
+ rightFrozenGroup.forEachChildren((columnGroup) => {
45747
+ columnGroup.setAttribute('x', x);
45748
+ x += columnGroup.attribute.width;
45749
+ });
45750
+ x = 0;
45751
+ rightTopCornerGroup.forEachChildren((columnGroup) => {
45752
+ columnGroup.setAttribute('x', x);
45753
+ x += columnGroup.attribute.width;
45754
+ });
45755
+ x = 0;
45756
+ rightBottomCornerGroup.forEachChildren((columnGroup) => {
45757
+ columnGroup.setAttribute('x', x);
45758
+ x += columnGroup.attribute.width;
45759
+ });
45760
+ }
45761
+ rightFrozenGroup.setAttribute('width', table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1));
45762
+ rightTopCornerGroup.setAttribute('width', table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1));
45763
+ rightBottomCornerGroup.setAttribute('width', table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1));
45764
+ table.internalProps.rightFrozenColCount = distRightFrozenCol;
45765
+ scene.updateContainer();
45766
+ scene.component.updateScrollBar();
45767
+ scene.updateNextFrame();
45768
+ }
45769
+ function dealBottomFrozen(distBottomFrozenRow, scene) {
45770
+ const { table, proxy, bottomFrozenGroup, leftBottomCornerGroup, rightBottomCornerGroup } = scene;
45771
+ if (!bottomFrozenGroup.childrenCount) {
45772
+ if (!proxy.table.isPivotChart()) {
45773
+ createColGroup(leftBottomCornerGroup, 0, 0, 0, table.rowHeaderLevelCount - 1, 0, -1, 'rowHeader', table);
45774
+ createColGroup(rightBottomCornerGroup, 0, 0, table.colCount - table.rightFrozenColCount, table.colCount - 1, 0, -1, 'body', table);
45775
+ }
45776
+ createColGroup(bottomFrozenGroup, 0, 0, proxy.colStart, proxy.colEnd, 0, -1, 'body', table);
45777
+ }
45778
+ const currentBottomFrozenRow = scene.table.bottomFrozenRowCount;
45779
+ if (distBottomFrozenRow > currentBottomFrozenRow) {
45780
+ for (let col = 0; col < table.rowHeaderLevelCount; col++) {
45781
+ const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);
45782
+ for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {
45783
+ const cellGroup = scene.getCell(col, row, true);
45784
+ insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild);
45785
+ }
45786
+ let y = 0;
45787
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45788
+ cellGroup.setAttribute('y', y);
45789
+ y += table.getRowHeight(cellGroup.row);
45790
+ });
45791
+ }
45792
+ for (let col = proxy.colStart; col <= proxy.colEnd; col++) {
45793
+ const bottomFrozenColumnGroup = scene.getColGroupInBottom(col);
45794
+ for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {
45795
+ const cellGroup = scene.getCell(col, row, true);
45796
+ insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild);
45797
+ }
45798
+ let y = 0;
45799
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45800
+ cellGroup.setAttribute('y', y);
45801
+ y += table.getRowHeight(cellGroup.row);
45802
+ });
45803
+ }
45804
+ if (table.rightFrozenColCount > 0) {
45805
+ for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {
45806
+ const bottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);
45807
+ for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {
45808
+ const cellGroup = scene.getCell(col, row, true);
45809
+ insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild);
45810
+ }
45811
+ let y = 0;
45812
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45813
+ cellGroup.setAttribute('y', y);
45814
+ y += table.getRowHeight(cellGroup.row);
45815
+ });
45816
+ }
45817
+ }
45818
+ }
45819
+ else if (distBottomFrozenRow < currentBottomFrozenRow) {
45820
+ for (let col = 0; col < table.rowHeaderLevelCount; col++) {
45821
+ const columnGroup = scene.getColGroup(col);
45822
+ for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {
45823
+ const cellGroup = scene.getCell(col, row, true);
45824
+ cellGroup.setAttribute('y', columnGroup.lastChild.attribute.y + table.getRowHeight(columnGroup.lastChild.row));
45825
+ columnGroup.appendChild(cellGroup);
45826
+ }
45827
+ const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);
45828
+ let y = 0;
45829
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45830
+ cellGroup.setAttribute('y', y);
45831
+ y += table.getRowHeight(cellGroup.row);
45832
+ });
45833
+ }
45834
+ for (let col = proxy.colStart; col <= proxy.colEnd; col++) {
45835
+ const columnGroup = scene.getColGroup(col);
45836
+ for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {
45837
+ const cellGroup = scene.getCell(col, row, true);
45838
+ cellGroup.setAttribute('y', columnGroup.lastChild.attribute.y + table.getRowHeight(columnGroup.lastChild.row));
45839
+ columnGroup.appendChild(cellGroup);
45840
+ }
45841
+ const bottomFrozenColumnGroup = scene.getColGroupInBottom(col);
45842
+ let y = 0;
45843
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45844
+ cellGroup.setAttribute('y', y);
45845
+ y += table.getRowHeight(cellGroup.row);
45846
+ });
45847
+ }
45848
+ if (table.rightFrozenColCount > 0) {
45849
+ for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {
45850
+ const columnGroup = scene.getColGroup(col);
45851
+ for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {
45852
+ const cellGroup = scene.getCell(col, row, true);
45853
+ cellGroup.setAttribute('y', columnGroup.lastChild.attribute.y + table.getRowHeight(columnGroup.lastChild.row));
45854
+ columnGroup.appendChild(cellGroup);
45855
+ }
45856
+ const bottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);
45857
+ let y = 0;
45858
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45859
+ cellGroup.setAttribute('y', y);
45860
+ y += table.getRowHeight(cellGroup.row);
45861
+ });
45862
+ }
45863
+ }
45864
+ }
45865
+ bottomFrozenGroup.setAttribute('height', table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1));
45866
+ leftBottomCornerGroup.setAttribute('height', table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1));
45867
+ rightBottomCornerGroup.setAttribute('height', table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1));
45868
+ table.internalProps.bottomFrozenRowCount = distBottomFrozenRow;
45869
+ scene.updateContainer();
45870
+ scene.component.updateScrollBar();
45871
+ scene.updateNextFrame();
45872
+ }
45873
+ function insertBefore(container, newNode, targetGroup) {
45874
+ if (!newNode || !container) {
45875
+ return;
45429
45876
  }
45430
- for (let i = 0; i < columnObjects.length; i++) {
45431
- const column = columnObjects[i];
45432
- if (column && column.style?.textStick) {
45433
- console.log('checkHaveTextStick', true);
45434
- return true;
45435
- }
45877
+ if (targetGroup) {
45878
+ container.insertBefore(newNode, targetGroup);
45879
+ }
45880
+ else {
45881
+ container.appendChild(newNode);
45436
45882
  }
45437
- console.log('checkHaveTextStick', false);
45438
- return false;
45439
45883
  }
45440
45884
 
45441
45885
  function updateChartSize(scenegraph, col) {
@@ -45497,7 +45941,7 @@
45497
45941
  if ((datum === null || datum?.length === 0 || Object.keys(datum).length === 0) && preSelectItemsCount === 0) {
45498
45942
  return;
45499
45943
  }
45500
- table._selectedDataItemsInChart = [];
45944
+ const newSelectedDataItemsInChart = [];
45501
45945
  if (Array.isArray(datum)) {
45502
45946
  datum.forEach((dataItem) => {
45503
45947
  if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {
@@ -45507,7 +45951,7 @@
45507
45951
  selectedState[itemKey] = dataItem[itemKey];
45508
45952
  }
45509
45953
  }
45510
- table._selectedDataItemsInChart.push(selectedState);
45954
+ newSelectedDataItemsInChart.push(selectedState);
45511
45955
  }
45512
45956
  });
45513
45957
  }
@@ -45518,13 +45962,14 @@
45518
45962
  selectedState[itemKey] = datum[itemKey];
45519
45963
  }
45520
45964
  }
45521
- table._selectedDataItemsInChart.push(selectedState);
45965
+ newSelectedDataItemsInChart.push(selectedState);
45522
45966
  }
45523
- if (table._selectedDataItemsInChart.length === 0 && preSelectItemsCount === 0) {
45524
- return;
45967
+ if (!isEqual(table._selectedDataItemsInChart, newSelectedDataItemsInChart)) {
45968
+ table._selectedDataItemsInChart = newSelectedDataItemsInChart;
45969
+ table.internalProps.layoutMap.updateDataStateToChartInstance();
45970
+ clearChartCacheImage(scenegraph);
45971
+ table.scenegraph.updateNextFrame();
45525
45972
  }
45526
- table.internalProps.layoutMap.updateDataStateToChartInstance();
45527
- clearChartCacheImage(scenegraph);
45528
45973
  }
45529
45974
  }
45530
45975
  function updateTableAxes(containerGroup, table) {
@@ -45553,108 +45998,7 @@
45553
45998
  });
45554
45999
  }
45555
46000
 
45556
- function dealFrozen(scene) {
45557
- if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {
45558
- scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
45559
- scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
45560
- scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
45561
- for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
45562
- moveColumnFromBodyToRowHeader(scene);
45563
- moveColumnFromColHeaderToCornerHeader(scene);
45564
- }
45565
- }
45566
- else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) {
45567
- for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) {
45568
- moveColumnFromRowHeaderToBody(scene);
45569
- moveColumnFromCornerHeaderToColHeader(scene);
45570
- }
45571
- }
45572
- scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
45573
- scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
45574
- scene.updateContainer();
45575
- scene.updateBorderSizeAndPosition();
45576
- if (!scene.isPivot && !scene.transpose) {
45577
- scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
45578
- }
45579
- scene.hasFrozen = true;
45580
- scene.frozenColCount = scene.table.frozenColCount;
45581
- scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
45582
- }
45583
- function resetFrozen(scene) {
45584
- if (scene.frozenColCount > scene.table.rowHeaderLevelCount) {
45585
- for (let i = 0; i < scene.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
45586
- moveColumnFromRowHeaderToBody(scene);
45587
- moveColumnFromCornerHeaderToColHeader(scene);
45588
- }
45589
- }
45590
- else if (scene.frozenColCount < scene.table.rowHeaderLevelCount) {
45591
- scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
45592
- scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
45593
- scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
45594
- for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.frozenColCount; i++) {
45595
- moveColumnFromBodyToRowHeader(scene);
45596
- moveColumnFromColHeaderToCornerHeader(scene);
45597
- }
45598
- }
45599
- scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
45600
- scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
45601
- scene.updateContainer();
45602
- scene.updateBorderSizeAndPosition();
45603
- if (!scene.isPivot && !scene.transpose) {
45604
- scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
45605
- }
45606
- scene.hasFrozen = true;
45607
- scene.frozenColCount = scene.table.rowHeaderLevelCount;
45608
- scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
45609
- }
45610
- function moveColumnFromBodyToRowHeader(scene) {
45611
- const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;
45612
- if (column) {
45613
- scene.rowHeaderGroup.appendChild(column);
45614
- scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width + column.attribute.width);
45615
- scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width - column.attribute.width);
45616
- }
45617
- }
45618
- function moveColumnFromColHeaderToCornerHeader(scene) {
45619
- const headerColumn = scene.colHeaderGroup.firstChild instanceof Group ? scene.colHeaderGroup.firstChild : null;
45620
- if (headerColumn) {
45621
- scene.cornerHeaderGroup.appendChild(headerColumn);
45622
- scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width + headerColumn.attribute.width);
45623
- scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width - headerColumn.attribute.width);
45624
- }
45625
- }
45626
- function moveColumnFromRowHeaderToBody(scene) {
45627
- const column = scene.rowHeaderGroup.lastChild instanceof Group
45628
- ? scene.rowHeaderGroup.lastChild
45629
- : scene.rowHeaderGroup.lastChild?._prev;
45630
- if (column) {
45631
- if (scene.bodyGroup.firstChild) {
45632
- scene.bodyGroup.insertBefore(column, scene.bodyGroup.firstChild);
45633
- }
45634
- else {
45635
- scene.bodyGroup.appendChild(column);
45636
- }
45637
- scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width + column.attribute.width);
45638
- scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width - column.attribute.width);
45639
- }
45640
- }
45641
- function moveColumnFromCornerHeaderToColHeader(scene) {
45642
- const headerColumn = scene.cornerHeaderGroup.lastChild instanceof Group
45643
- ? scene.cornerHeaderGroup.lastChild
45644
- : scene.cornerHeaderGroup.lastChild?._prev;
45645
- if (headerColumn) {
45646
- if (scene.colHeaderGroup.firstChild) {
45647
- scene.colHeaderGroup.insertBefore(headerColumn, scene.colHeaderGroup.firstChild);
45648
- }
45649
- else {
45650
- scene.bodyGroup.appendChild(headerColumn);
45651
- }
45652
- scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width + headerColumn.attribute.width);
45653
- scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width);
45654
- }
45655
- }
45656
-
45657
- function createCornerCell(frameTheme) {
46001
+ function createCornerCell(cellGroup, frameTheme) {
45658
46002
  const { bgColor, borderColor, borderLineWidth, borderLineDash } = frameTheme;
45659
46003
  const rectAttributes = {
45660
46004
  x: 0,
@@ -45676,9 +46020,71 @@
45676
46020
  rectAttributes.strokeArrayWidth = getQuadProps(borderLineWidth);
45677
46021
  rectAttributes.lineWidth = 1;
45678
46022
  }
45679
- const cornerCellGroup = new Group(rectAttributes);
45680
- cornerCellGroup.role = 'corner-frozen';
45681
- return cornerCellGroup;
46023
+ cellGroup.setAttributes(rectAttributes);
46024
+ cellGroup.role = 'corner-frozen';
46025
+ return cellGroup;
46026
+ }
46027
+
46028
+ function initSceneGraph(scene) {
46029
+ const width = scene.table.tableNoFrameWidth;
46030
+ const height = scene.table.tableNoFrameHeight;
46031
+ scene.tableGroup = new Group({ x: 0, y: 0, width, height, clip: true, pickable: false });
46032
+ scene.tableGroup.role = 'table';
46033
+ const colHeaderGroup = createContainerGroup(0, 0);
46034
+ colHeaderGroup.role = 'col-header';
46035
+ scene.colHeaderGroup = colHeaderGroup;
46036
+ const cornerHeaderGroup = createContainerGroup(0, 0);
46037
+ cornerHeaderGroup.role = 'corner-header';
46038
+ scene.cornerHeaderGroup = cornerHeaderGroup;
46039
+ const rowHeaderGroup = createContainerGroup(0, 0);
46040
+ rowHeaderGroup.role = 'row-header';
46041
+ scene.rowHeaderGroup = rowHeaderGroup;
46042
+ const bodyGroup = createContainerGroup(width, 0);
46043
+ bodyGroup.role = 'body';
46044
+ scene.bodyGroup = bodyGroup;
46045
+ const rightFrozenGroup = createContainerGroup(0, 0);
46046
+ rightFrozenGroup.role = 'right-frozen';
46047
+ scene.rightFrozenGroup = rightFrozenGroup;
46048
+ const bottomFrozenGroup = createContainerGroup(0, 0);
46049
+ bottomFrozenGroup.role = 'bottom-frozen';
46050
+ scene.bottomFrozenGroup = bottomFrozenGroup;
46051
+ const componentGroup = createContainerGroup(0, 0);
46052
+ componentGroup.role = 'component';
46053
+ scene.componentGroup = componentGroup;
46054
+ const rightTopCornerGroup = createContainerGroup(0, 0);
46055
+ rightTopCornerGroup.role = 'corner-right-top-header';
46056
+ scene.rightTopCornerGroup = rightTopCornerGroup;
46057
+ const rightBottomCornerGroup = createContainerGroup(0, 0);
46058
+ rightBottomCornerGroup.role = 'corner-right-bottom-header';
46059
+ scene.rightBottomCornerGroup = rightBottomCornerGroup;
46060
+ const leftBottomCornerGroup = createContainerGroup(0, 0);
46061
+ leftBottomCornerGroup.role = 'corner-left-bottom-header';
46062
+ scene.leftBottomCornerGroup = leftBottomCornerGroup;
46063
+ if (scene.table.isPivotChart()) {
46064
+ createCornerCell(rightTopCornerGroup, scene.table.theme.cornerRightTopCellStyle || scene.table.theme.cornerHeaderStyle);
46065
+ createCornerCell(leftBottomCornerGroup, scene.table.theme.cornerLeftBottomCellStyle || scene.table.theme.cornerHeaderStyle);
46066
+ createCornerCell(rightBottomCornerGroup, scene.table.theme.cornerRightBottomCellStyle || scene.table.theme.cornerHeaderStyle);
46067
+ }
46068
+ scene.tableGroup.addChild(bodyGroup);
46069
+ scene.tableGroup.addChild(rightFrozenGroup);
46070
+ scene.tableGroup.addChild(bottomFrozenGroup);
46071
+ scene.tableGroup.addChild(rowHeaderGroup);
46072
+ scene.tableGroup.addChild(colHeaderGroup);
46073
+ scene.tableGroup.addChild(rightBottomCornerGroup);
46074
+ scene.tableGroup.addChild(rightTopCornerGroup);
46075
+ scene.tableGroup.addChild(leftBottomCornerGroup);
46076
+ scene.tableGroup.addChild(cornerHeaderGroup);
46077
+ scene.tableGroup.addChild(componentGroup);
46078
+ }
46079
+ function createContainerGroup(width, height) {
46080
+ return new Group({
46081
+ x: 0,
46082
+ y: 0,
46083
+ width,
46084
+ height,
46085
+ clip: false,
46086
+ pickable: false
46087
+ });
45682
46088
  }
45683
46089
 
45684
46090
  container.load(splitModule);
@@ -45691,9 +46097,9 @@
45691
46097
  bodyGroup;
45692
46098
  rightFrozenGroup;
45693
46099
  bottomFrozenGroup;
45694
- rightTopCellGroup;
45695
- leftBottomCellGroup;
45696
- rightBottomCellGroup;
46100
+ rightTopCornerGroup;
46101
+ leftBottomCornerGroup;
46102
+ rightBottomCornerGroup;
45697
46103
  componentGroup;
45698
46104
  selectedRangeComponents;
45699
46105
  selectingRangeComponents;
@@ -45760,94 +46166,7 @@
45760
46166
  initSceneGraph() {
45761
46167
  this.isPivot = this.table.isPivotTable();
45762
46168
  this.transpose = this.table.options.transpose;
45763
- const width = this.table.tableNoFrameWidth;
45764
- const height = this.table.tableNoFrameHeight;
45765
- this.tableGroup = new Group({ x: 0, y: 0, width, height, clip: true, pickable: false });
45766
- this.tableGroup.role = 'table';
45767
- const colHeaderGroup = new Group({
45768
- x: 0,
45769
- y: 0,
45770
- width: 0,
45771
- height: 0,
45772
- clip: false,
45773
- pickable: false
45774
- });
45775
- colHeaderGroup.role = 'col-header';
45776
- this.colHeaderGroup = colHeaderGroup;
45777
- const cornerHeaderGroup = new Group({
45778
- x: 0,
45779
- y: 0,
45780
- width: 0,
45781
- height: 0,
45782
- clip: false,
45783
- pickable: false
45784
- });
45785
- cornerHeaderGroup.role = 'corner-header';
45786
- this.cornerHeaderGroup = cornerHeaderGroup;
45787
- const rowHeaderGroup = new Group({
45788
- x: 0,
45789
- y: 0,
45790
- width: 0,
45791
- height: 0,
45792
- clip: false,
45793
- pickable: false
45794
- });
45795
- rowHeaderGroup.role = 'row-header';
45796
- this.rowHeaderGroup = rowHeaderGroup;
45797
- const bodyGroup = new Group({
45798
- x: 0,
45799
- y: 0,
45800
- width,
45801
- height: 0,
45802
- clip: false,
45803
- pickable: false
45804
- });
45805
- bodyGroup.role = 'body';
45806
- this.bodyGroup = bodyGroup;
45807
- const rightFrozenGroup = new Group({
45808
- x: 0,
45809
- y: 0,
45810
- width,
45811
- height: 0,
45812
- clip: false,
45813
- pickable: false
45814
- });
45815
- rightFrozenGroup.role = 'right-frozen';
45816
- this.rightFrozenGroup = rightFrozenGroup;
45817
- const bottomFrozenGroup = new Group({
45818
- x: 0,
45819
- y: 0,
45820
- width,
45821
- height: 0,
45822
- clip: false,
45823
- pickable: false
45824
- });
45825
- bottomFrozenGroup.role = 'bottom-frozen';
45826
- this.bottomFrozenGroup = bottomFrozenGroup;
45827
- const componentGroup = new Group({
45828
- x: 0,
45829
- y: 0,
45830
- width: 0,
45831
- height: 0,
45832
- clip: false,
45833
- pickable: false,
45834
- childrenPickable: true
45835
- });
45836
- componentGroup.role = 'component';
45837
- this.componentGroup = componentGroup;
45838
- this.rightTopCellGroup = createCornerCell(this.table.theme.cornerRightTopCellStyle || this.table.theme.cornerHeaderStyle);
45839
- this.leftBottomCellGroup = createCornerCell(this.table.theme.cornerLeftBottomCellStyle || this.table.theme.cornerHeaderStyle);
45840
- this.rightBottomCellGroup = createCornerCell(this.table.theme.cornerRightBottomCellStyle || this.table.theme.cornerHeaderStyle);
45841
- this.tableGroup.addChild(bodyGroup);
45842
- this.tableGroup.addChild(rightFrozenGroup);
45843
- this.tableGroup.addChild(bottomFrozenGroup);
45844
- this.tableGroup.addChild(rowHeaderGroup);
45845
- this.tableGroup.addChild(colHeaderGroup);
45846
- this.tableGroup.addChild(this.rightBottomCellGroup);
45847
- this.tableGroup.addChild(this.rightTopCellGroup);
45848
- this.tableGroup.addChild(this.leftBottomCellGroup);
45849
- this.tableGroup.addChild(cornerHeaderGroup);
45850
- this.tableGroup.addChild(componentGroup);
46169
+ initSceneGraph(this);
45851
46170
  }
45852
46171
  clearCells() {
45853
46172
  this.clear = true;
@@ -45859,9 +46178,9 @@
45859
46178
  this.bodyGroup.clear();
45860
46179
  this.bottomFrozenGroup.clear();
45861
46180
  this.rightFrozenGroup.clear();
45862
- this.rightTopCellGroup.clear();
45863
- this.rightBottomCellGroup.clear();
45864
- this.leftBottomCellGroup.clear();
46181
+ this.rightTopCornerGroup.clear();
46182
+ this.rightBottomCornerGroup.clear();
46183
+ this.leftBottomCornerGroup.clear();
45865
46184
  this.colHeaderGroup.setAttributes({
45866
46185
  x: 0,
45867
46186
  y: 0,
@@ -45898,21 +46217,21 @@
45898
46217
  width: 0,
45899
46218
  height: 0
45900
46219
  });
45901
- this.rightTopCellGroup.setAttributes({
46220
+ this.rightTopCornerGroup.setAttributes({
45902
46221
  x: 0,
45903
46222
  y: 0,
45904
46223
  width: 0,
45905
46224
  height: 0,
45906
46225
  visible: false
45907
46226
  });
45908
- this.leftBottomCellGroup.setAttributes({
46227
+ this.leftBottomCornerGroup.setAttributes({
45909
46228
  x: 0,
45910
46229
  y: 0,
45911
46230
  width: 0,
45912
46231
  height: 0,
45913
46232
  visible: false
45914
46233
  });
45915
- this.rightTopCellGroup.setAttributes({
46234
+ this.rightBottomCornerGroup.setAttributes({
45916
46235
  x: 0,
45917
46236
  y: 0,
45918
46237
  width: 0,
@@ -45990,7 +46309,23 @@
45990
46309
  }
45991
46310
  getCell(col, row, getShadow) {
45992
46311
  let cell;
45993
- if (this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount) {
46312
+ if (this.table.rightFrozenColCount > 0 &&
46313
+ col >= this.table.colCount - this.table.rightFrozenColCount &&
46314
+ row < this.table.frozenRowCount) {
46315
+ cell = this.rightBottomCornerGroup.getColGroup(col)?.getRowGroup(row);
46316
+ }
46317
+ else if (this.table.bottomFrozenRowCount > 0 &&
46318
+ row >= this.table.rowCount - this.table.bottomFrozenRowCount &&
46319
+ col < this.table.frozenColCount) {
46320
+ cell = this.leftBottomCornerGroup.getColGroup(col)?.getRowGroup(row);
46321
+ }
46322
+ else if (this.table.rightFrozenColCount > 0 &&
46323
+ this.table.bottomFrozenRowCount > 0 &&
46324
+ col >= this.table.colCount - this.table.rightFrozenColCount &&
46325
+ row >= this.table.rowCount - this.table.bottomFrozenRowCount) {
46326
+ cell = this.rightBottomCornerGroup.getColGroup(col)?.getRowGroup(row);
46327
+ }
46328
+ else if (this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount) {
45994
46329
  cell = this.rightFrozenGroup.getColGroup(col)?.getRowGroup(row);
45995
46330
  }
45996
46331
  else if (this.table.bottomFrozenRowCount > 0 && row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount) {
@@ -46038,6 +46373,24 @@
46038
46373
  }
46039
46374
  return undefined;
46040
46375
  }
46376
+ getColGroupInLeftBottomCorner(col) {
46377
+ if (this.table.bottomFrozenRowCount > 0) {
46378
+ return this.leftBottomCornerGroup.getColGroup(col);
46379
+ }
46380
+ return undefined;
46381
+ }
46382
+ getColGroupInRightTopCorner(col) {
46383
+ if (this.table.rightFrozenColCount > 0) {
46384
+ return this.rightTopCornerGroup.getColGroup(col);
46385
+ }
46386
+ return undefined;
46387
+ }
46388
+ getColGroupInRightBottomCorner(col) {
46389
+ if (this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0) {
46390
+ return this.rightBottomCornerGroup.getColGroup(col);
46391
+ }
46392
+ return undefined;
46393
+ }
46041
46394
  getCellSize(col, row) {
46042
46395
  const cell = this.getCell(col, row);
46043
46396
  const mergeInfo = getCellMergeInfo(this.table, col, row);
@@ -46217,9 +46570,7 @@
46217
46570
  }
46218
46571
  resize() {
46219
46572
  this.recalculateColWidths();
46220
- if (this.table.heightMode === 'autoHeight') {
46221
- this.recalculateRowHeights();
46222
- }
46573
+ this.recalculateRowHeights();
46223
46574
  this.dealWidthMode();
46224
46575
  this.dealHeightMode();
46225
46576
  this.dealFrozen();
@@ -46235,7 +46586,7 @@
46235
46586
  this.tableGroup.setAttributes({
46236
46587
  width: Math.min(this.table.tableNoFrameWidth, Math.max(this.colHeaderGroup.attribute.width, this.bodyGroup.attribute.width, 0) +
46237
46588
  Math.max(this.cornerHeaderGroup.attribute.width, this.rowHeaderGroup.attribute.width, 0) +
46238
- this.rightBottomCellGroup.attribute.width),
46589
+ this.rightBottomCornerGroup.attribute.width),
46239
46590
  height: Math.min(this.table.tableNoFrameHeight, (this.colHeaderGroup.attribute.height ?? 0) +
46240
46591
  (this.bodyGroup.attribute.height ?? 0) +
46241
46592
  this.bottomFrozenGroup.attribute.height)
@@ -46248,13 +46599,13 @@
46248
46599
  }
46249
46600
  if (this.table.bottomFrozenRowCount > 0) {
46250
46601
  this.bottomFrozenGroup.setAttribute('y', this.tableGroup.attribute.height - this.bottomFrozenGroup.attribute.height);
46251
- this.leftBottomCellGroup.setAttributes({
46602
+ this.leftBottomCornerGroup.setAttributes({
46252
46603
  visible: true,
46253
46604
  y: this.tableGroup.attribute.height - this.bottomFrozenGroup.attribute.height,
46254
46605
  height: this.bottomFrozenGroup.attribute.height,
46255
46606
  width: this.table.getFrozenColsWidth()
46256
46607
  });
46257
- this.rightBottomCellGroup.setAttributes({
46608
+ this.rightBottomCornerGroup.setAttributes({
46258
46609
  visible: true,
46259
46610
  y: this.tableGroup.attribute.height - this.bottomFrozenGroup.attribute.height,
46260
46611
  height: this.bottomFrozenGroup.attribute.height
@@ -46262,13 +46613,13 @@
46262
46613
  }
46263
46614
  if (this.table.rightFrozenColCount > 0) {
46264
46615
  this.rightFrozenGroup.setAttribute('x', this.tableGroup.attribute.width - this.rightFrozenGroup.attribute.width);
46265
- this.rightTopCellGroup.setAttributes({
46616
+ this.rightTopCornerGroup.setAttributes({
46266
46617
  visible: true,
46267
46618
  x: this.tableGroup.attribute.width - this.rightFrozenGroup.attribute.width,
46268
46619
  width: this.rightFrozenGroup.attribute.width,
46269
46620
  height: this.table.getFrozenRowsHeight()
46270
46621
  });
46271
- this.rightBottomCellGroup.setAttributes({
46622
+ this.rightBottomCornerGroup.setAttributes({
46272
46623
  visible: true,
46273
46624
  x: this.tableGroup.attribute.width - this.rightFrozenGroup.attribute.width,
46274
46625
  width: this.rightFrozenGroup.attribute.width
@@ -46295,12 +46646,17 @@
46295
46646
  this.updateNextFrame();
46296
46647
  }
46297
46648
  updateContainerHeight(row, detaY) {
46298
- if (row < this.frozenRowCount) {
46649
+ if (row < this.table.frozenRowCount) {
46299
46650
  this.colHeaderGroup.setDeltaHeight(detaY);
46300
46651
  this.cornerHeaderGroup.setDeltaHeight(detaY);
46301
46652
  this.rowHeaderGroup.setDeltaY(detaY);
46302
46653
  this.bodyGroup.setDeltaY(detaY);
46303
46654
  }
46655
+ else if (row >= this.table.rowCount - this.table.bottomFrozenRowCount) {
46656
+ this.leftBottomCornerGroup.setDeltaHeight(detaY);
46657
+ this.bottomFrozenGroup.setDeltaHeight(detaY);
46658
+ this.rightBottomCornerGroup.setDeltaHeight(detaY);
46659
+ }
46304
46660
  else {
46305
46661
  this.rowHeaderGroup.setDeltaHeight(detaY);
46306
46662
  this.bodyGroup.setDeltaHeight(detaY);
@@ -46581,6 +46937,20 @@
46581
46937
  this.dealFrozen();
46582
46938
  this.component.updateScrollBar();
46583
46939
  }
46940
+ dealWidthRightFrozen(rightFrozenColCount) {
46941
+ if (this.clear) {
46942
+ this.table.internalProps.rightFrozenColCount = rightFrozenColCount;
46943
+ return;
46944
+ }
46945
+ dealRightFrozen(rightFrozenColCount, this);
46946
+ }
46947
+ dealWidthBottomFrozen(bottomFrozenRowCount) {
46948
+ if (this.clear) {
46949
+ this.table.internalProps.bottomFrozenRowCount = bottomFrozenRowCount;
46950
+ return;
46951
+ }
46952
+ dealBottomFrozen(bottomFrozenRowCount, this);
46953
+ }
46584
46954
  updateBorderSizeAndPosition() {
46585
46955
  if (this.bodyGroup.border) {
46586
46956
  this.bodyGroup.appendChild(this.bodyGroup.border);
@@ -46735,9 +47105,7 @@
46735
47105
  updateRow(removeCells, addCells) {
46736
47106
  updateRow(removeCells, addCells, this.table);
46737
47107
  this.recalculateColWidths();
46738
- if (this.table.heightMode === 'autoHeight') {
46739
- this.recalculateRowHeights();
46740
- }
47108
+ this.recalculateRowHeights();
46741
47109
  this.table.stateManeger.checkFrozen();
46742
47110
  this.updateNextFrame();
46743
47111
  }
@@ -46887,7 +47255,7 @@
46887
47255
  if (col === -1 || row === -1) {
46888
47256
  cellPos.col = -1;
46889
47257
  cellPos.row = -1;
46890
- if (updateScenegraph) {
47258
+ if (updateScenegraph && (prevHoverCellCol !== col || prevHoverCellRow !== row)) {
46891
47259
  state.table.scenegraph.updateNextFrame();
46892
47260
  }
46893
47261
  return;
@@ -47474,6 +47842,9 @@
47474
47842
  sparkLine;
47475
47843
  _clearVerticalScrollBar;
47476
47844
  _clearHorizontalScrollBar;
47845
+ resetInteractionState = debounce(() => {
47846
+ this.updateInteractionState(InteractionState.default);
47847
+ }, 100);
47477
47848
  constructor(table) {
47478
47849
  this.table = table;
47479
47850
  this.initState();
@@ -48225,6 +48596,23 @@
48225
48596
  function drillClick(table) {
48226
48597
  table.fireListeners(PIVOT_TABLE_EVENT_TYPE.DRILLMENU_CLICK, table.stateManeger.drill);
48227
48598
  }
48599
+ function checkHaveDrill(table) {
48600
+ const rowsDefine = table.internalProps.layoutMap.rowsDefine;
48601
+ const columnsDefine = table.internalProps.layoutMap.columnsDefine;
48602
+ for (let i = 0; i < rowsDefine.length; i++) {
48603
+ const row = rowsDefine[i];
48604
+ if (typeof row !== 'string' && (row.drillDown || row.drillUp)) {
48605
+ return true;
48606
+ }
48607
+ }
48608
+ for (let i = 0; i < columnsDefine.length; i++) {
48609
+ const column = columnsDefine[i];
48610
+ if (typeof column !== 'string' && (column.drillDown || column.drillUp)) {
48611
+ return true;
48612
+ }
48613
+ }
48614
+ return false;
48615
+ }
48228
48616
 
48229
48617
  function bindSparklineHoverEvent(table) {
48230
48618
  let hasSparkLine = false;
@@ -48763,10 +49151,16 @@
48763
49151
  const throttleVerticalWheel = throttle(stateManeger.updateVerticalScrollBar, 20);
48764
49152
  const throttleHorizontalWheel = throttle(stateManeger.updateHorizontalScrollBar, 20);
48765
49153
  scenegraph.component.vScrollBar.addEventListener('scroll', (e) => {
49154
+ if (stateManeger.interactionState !== InteractionState.scrolling) {
49155
+ stateManeger.updateInteractionState(InteractionState.scrolling);
49156
+ }
48766
49157
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
48767
49158
  throttleVerticalWheel(ratio, e);
48768
49159
  });
48769
49160
  scenegraph.component.hScrollBar.addEventListener('scroll', (e) => {
49161
+ if (stateManeger.interactionState !== InteractionState.scrolling) {
49162
+ stateManeger.updateInteractionState(InteractionState.scrolling);
49163
+ }
48770
49164
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
48771
49165
  throttleHorizontalWheel(ratio);
48772
49166
  });
@@ -48779,6 +49173,11 @@
48779
49173
  deltaY = 0;
48780
49174
  }
48781
49175
  const [optimizedDeltaX, optimizedDeltaY] = optimizeScrollXY(deltaX, deltaY, { horizontal: 1, vertical: 1 });
49176
+ if (optimizedDeltaX || optimizedDeltaY) {
49177
+ if (state.interactionState !== InteractionState.scrolling) {
49178
+ state.updateInteractionState(InteractionState.scrolling);
49179
+ }
49180
+ }
48782
49181
  if (optimizedDeltaX) {
48783
49182
  state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX);
48784
49183
  state.showHorizontalScrollBar(true);
@@ -48787,6 +49186,7 @@
48787
49186
  state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY);
48788
49187
  state.showVerticalScrollBar(true);
48789
49188
  }
49189
+ state.resetInteractionState();
48790
49190
  if (event.cancelable &&
48791
49191
  ((deltaY !== 0 && isVerticalScrollable(deltaY, state)) || (deltaX !== 0 && isHorizontalScrollable(deltaX, state)))) {
48792
49192
  event.preventDefault();
@@ -48876,7 +49276,7 @@
48876
49276
  handler.on(table.getElement(), 'contextmenu', (e) => {
48877
49277
  e.preventDefault();
48878
49278
  });
48879
- handler.on(table.getParentElement(), 'resize', () => {
49279
+ handler.on(table.getContainer(), 'resize', () => {
48880
49280
  table.resize();
48881
49281
  });
48882
49282
  }
@@ -48997,6 +49397,9 @@
48997
49397
  return;
48998
49398
  }
48999
49399
  table.scenegraph.tableGroup.addEventListener('click', (e) => {
49400
+ if (table.stateManeger.columnMove.moving || table.stateManeger.columnResize.resizing) {
49401
+ return;
49402
+ }
49000
49403
  if (e.target.name === 'axis-label') {
49001
49404
  const eventArgsSet = getCellEventArgsSet(e);
49002
49405
  const { col, row } = eventArgsSet.eventArgs;
@@ -49029,7 +49432,7 @@
49029
49432
  clearChartCacheImage(table.scenegraph);
49030
49433
  table.scenegraph.updateNextFrame();
49031
49434
  }
49032
- else if (table._selectedDimensionInChart) {
49435
+ else if (table._selectedDimensionInChart?.length) {
49033
49436
  table._selectedDimensionInChart.length = 0;
49034
49437
  const layout = table.internalProps.layoutMap;
49035
49438
  layout.updateDataStateToChartInstance();
@@ -49172,7 +49575,7 @@
49172
49575
  }
49173
49576
  }
49174
49577
  });
49175
- if (this.table.isPivotTable()) {
49578
+ if (this.table.isPivotTable() && checkHaveDrill(this.table)) {
49176
49579
  bindDrillEvent(this.table);
49177
49580
  }
49178
49581
  bindSparklineHoverEvent(this.table);
@@ -51743,19 +52146,19 @@
51743
52146
  if (this.legendComponent) {
51744
52147
  this.legendComponent.addEventListener(LegendEvent.legendItemClick, (e) => {
51745
52148
  const selectedData = get$4(e, 'detail.currentSelected');
51746
- this.table.scenegraph.updateNextFrame();
51747
52149
  this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_CLICK, { model: this, value: selectedData, event: e });
51748
52150
  });
51749
52151
  this.legendComponent.addEventListener(LegendEvent.legendItemHover, (e) => {
51750
52152
  const detail = get$4(e, 'detail');
51751
- this.table.scenegraph.updateNextFrame();
51752
52153
  this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_HOVER, { model: this, value: detail, event: e });
51753
52154
  });
51754
52155
  this.legendComponent.addEventListener(LegendEvent.legendItemUnHover, (e) => {
51755
52156
  const detail = get$4(e, 'detail');
51756
- this.table.scenegraph.updateNextFrame();
51757
52157
  this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_UNHOVER, { model: this, value: detail, event: e });
51758
52158
  });
52159
+ this.legendComponent.addEventListener('legendItemAttributeUpdate', (e) => {
52160
+ this.table.scenegraph.updateNextFrame();
52161
+ });
51759
52162
  }
51760
52163
  }
51761
52164
  getLegendBounds() {
@@ -51930,21 +52333,25 @@
51930
52333
  stateManeger;
51931
52334
  eventManeger;
51932
52335
  _pixelRatio;
51933
- bottomFrozenRowCount = 0;
51934
- rightFrozenColCount = 0;
51935
52336
  static get EVENT_TYPE() {
51936
52337
  return TABLE_EVENT_TYPE;
51937
52338
  }
51938
52339
  options;
51939
- version = "0.9.3-alpha.6";
52340
+ version = "0.10.0";
51940
52341
  pagerConf;
51941
52342
  id = `VTable${Date.now()}`;
51942
52343
  headerStyleCache;
51943
52344
  bodyStyleCache;
51944
- constructor(options = {}) {
52345
+ container;
52346
+ constructor(container, options = {}) {
51945
52347
  super();
51946
- const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, keyboardOptions, parentElement, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio } = options;
52348
+ if (!container) {
52349
+ throw new Error("vtable's container is undefined");
52350
+ }
52351
+ const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, keyboardOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount } = options;
52352
+ this.container = container;
51947
52353
  this.options = options;
52354
+ this.options.container = container;
51948
52355
  this._widthMode = widthMode;
51949
52356
  this._heightMode = heightMode;
51950
52357
  this._autoFillWidth = autoFillWidth;
@@ -51986,6 +52393,8 @@
51986
52393
  internalProps.keyboardOptions = keyboardOptions;
51987
52394
  internalProps.columnResizeMode = columnResizeMode;
51988
52395
  internalProps.dragHeaderMode = dragHeaderMode;
52396
+ internalProps.renderChartAsync = renderChartAsync;
52397
+ setBatchRenderChartCount(renderChartAsyncBatchCount);
51989
52398
  internalProps._rowHeightsMap = new NumberMap();
51990
52399
  internalProps._rowRangeHeightsMap = new Map();
51991
52400
  internalProps._colRangeWidthsMap = new Map();
@@ -52001,9 +52410,9 @@
52001
52410
  internalProps.cellTextOverflows = {};
52002
52411
  internalProps.focusedTable = false;
52003
52412
  internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
52004
- if (parentElement) {
52005
- parentElement.innerHTML = '';
52006
- parentElement.appendChild(internalProps.element);
52413
+ if (container) {
52414
+ container.innerHTML = '';
52415
+ container.appendChild(internalProps.element);
52007
52416
  this._updateSize();
52008
52417
  }
52009
52418
  else {
@@ -52056,8 +52465,8 @@
52056
52465
  this.bodyStyleCache = new Map();
52057
52466
  }
52058
52467
  throttleInvalidate = throttle2(this.render.bind(this), 200);
52059
- getParentElement() {
52060
- return this.options.parentElement;
52468
+ getContainer() {
52469
+ return this.container;
52061
52470
  }
52062
52471
  getElement() {
52063
52472
  return this.internalProps.element;
@@ -52134,6 +52543,18 @@
52134
52543
  set frozenRowCount(frozenRowCount) {
52135
52544
  this.internalProps.frozenRowCount = frozenRowCount;
52136
52545
  }
52546
+ get rightFrozenColCount() {
52547
+ return this.internalProps.rightFrozenColCount ?? 0;
52548
+ }
52549
+ set rightFrozenColCount(rightFrozenColCount) {
52550
+ this.scenegraph.dealWidthRightFrozen(rightFrozenColCount);
52551
+ }
52552
+ get bottomFrozenRowCount() {
52553
+ return this.internalProps.bottomFrozenRowCount ?? 0;
52554
+ }
52555
+ set bottomFrozenRowCount(bottomFrozenRowCount) {
52556
+ this.scenegraph.dealWidthBottomFrozen(bottomFrozenRowCount);
52557
+ }
52137
52558
  get defaultRowHeight() {
52138
52559
  return this.internalProps.defaultRowHeight;
52139
52560
  }
@@ -52378,12 +52799,6 @@
52378
52799
  this._clearRowRangeHeightsMap(row);
52379
52800
  }
52380
52801
  }
52381
- fillRowsHeight(rowStart, rowEnd, rowHeight) {
52382
- for (let row = rowStart; row <= rowEnd; row++) {
52383
- this.rowHeightsMap.put(row, Math.round(rowHeight));
52384
- this._rowRangeHeightsMap.set(`$0$${row}`, Math.round((this._rowRangeHeightsMap.get(`$0$${row - 1}`) ?? 0) + rowHeight));
52385
- }
52386
- }
52387
52802
  getRowsHeight(startRow, endRow) {
52388
52803
  const cachedRowHeight = this._rowRangeHeightsMap.get(`$${startRow}$${endRow}`);
52389
52804
  if (cachedRowHeight !== null && cachedRowHeight !== undefined) {
@@ -52873,7 +53288,7 @@
52873
53288
  }
52874
53289
  updateOption(options) {
52875
53290
  this.options = options;
52876
- const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, customRender } = options;
53291
+ const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, customRender, renderChartAsync, renderChartAsyncBatchCount } = options;
52877
53292
  if (pixelRatio && pixelRatio !== this.internalProps.pixelRatio) {
52878
53293
  this.internalProps.pixelRatio = pixelRatio;
52879
53294
  }
@@ -52911,6 +53326,8 @@
52911
53326
  internalProps.keyboardOptions = keyboardOptions;
52912
53327
  internalProps.columnResizeMode = columnResizeMode;
52913
53328
  internalProps.dragHeaderMode = dragHeaderMode;
53329
+ internalProps.renderChartAsync = renderChartAsync;
53330
+ setBatchRenderChartCount(renderChartAsyncBatchCount);
52914
53331
  internalProps.cellTextOverflows = {};
52915
53332
  internalProps._rowHeightsMap = new NumberMap();
52916
53333
  internalProps._rowRangeHeightsMap = new Map();
@@ -53492,7 +53909,9 @@
53492
53909
  dataValue: this.getCellOriginValue(col, row),
53493
53910
  cellHeaderPaths: this.getCellHeaderPaths(col, row)
53494
53911
  }, styleClass, this.options.autoWrapText);
53495
- this.bodyStyleCache.set(cacheKey, cacheStyle);
53912
+ if (!isFunction(style)) {
53913
+ this.bodyStyleCache.set(cacheKey, cacheStyle);
53914
+ }
53496
53915
  return cacheStyle;
53497
53916
  }
53498
53917
  clearCellStyleCache() {
@@ -54075,7 +54494,9 @@
54075
54494
  if (isArray$3(rowDimensionKey)) {
54076
54495
  rowDimensionKey = rowDimensionKey[0];
54077
54496
  }
54078
- const data = layout.dataset.cacheCollectedValues[rowDimensionKey] || layout.dataset.collectedValues[rowDimensionKey];
54497
+ const data = layout.dataset.cacheCollectedValues[rowDimensionKey] ||
54498
+ layout.dataset.collectedValues[rowDimensionKey] ||
54499
+ [];
54079
54500
  const recordRow = layout.getRecordIndexByRow(row);
54080
54501
  const rowPath = layout.getRowKeysPath()[recordRow];
54081
54502
  const domain = data[rowPath[rowPath.length - 1]];
@@ -54126,7 +54547,9 @@
54126
54547
  if (isArray$3(columnDimensionKey)) {
54127
54548
  columnDimensionKey = columnDimensionKey[0];
54128
54549
  }
54129
- const data = layout.dataset.cacheCollectedValues[columnDimensionKey] || layout.dataset.collectedValues[columnDimensionKey];
54550
+ const data = layout.dataset.cacheCollectedValues[columnDimensionKey] ||
54551
+ layout.dataset.collectedValues[columnDimensionKey] ||
54552
+ [];
54130
54553
  const recordCol = layout.getRecordIndexByCol(col);
54131
54554
  const colPath = layout.getColKeysPath()[recordCol];
54132
54555
  const domain = data?.[colPath[colPath.length - 1]] ?? [];
@@ -54830,8 +55253,17 @@
54830
55253
 
54831
55254
  class ListTable extends BaseTable {
54832
55255
  showHeader = true;
54833
- constructor(options = {}) {
54834
- super(options);
55256
+ constructor(container, options) {
55257
+ if (!(container instanceof HTMLElement)) {
55258
+ options = container;
55259
+ if (container.container) {
55260
+ container = container.container;
55261
+ }
55262
+ else {
55263
+ container = null;
55264
+ }
55265
+ }
55266
+ super(container, options);
54835
55267
  const internalProps = this.internalProps;
54836
55268
  this.pagerConf = options.pagerConf;
54837
55269
  internalProps.sortState = options.sortState;
@@ -55018,6 +55450,7 @@
55018
55450
  (table.internalProps.dataSource?.length ?? 0) * layoutMap.bodyRowCount + layoutMap.headerLevelCount;
55019
55451
  table.frozenRowCount = 0;
55020
55452
  table.frozenColCount = layoutMap.headerLevelCount;
55453
+ table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
55021
55454
  }
55022
55455
  else {
55023
55456
  table.colCount = layoutMap.colCount ?? 0;
@@ -55025,6 +55458,8 @@
55025
55458
  (table.internalProps.dataSource?.length ?? 0) * layoutMap.bodyRowCount + layoutMap.headerLevelCount;
55026
55459
  table.frozenColCount = table.options.frozenColCount ?? 0;
55027
55460
  table.frozenRowCount = layoutMap.headerLevelCount;
55461
+ table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
55462
+ table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
55028
55463
  }
55029
55464
  }
55030
55465
  getFieldData(field, col, row) {
@@ -57836,7 +58271,7 @@
57836
58271
  });
57837
58272
  return !!match;
57838
58273
  }
57839
- else if (this._table._selectedDimensionInChart.length) {
58274
+ else if (this._table._selectedDimensionInChart?.length) {
57840
58275
  const match = this._table._selectedDimensionInChart.every(item => {
57841
58276
  if (datum[item.key] !== item.value) {
57842
58277
  return false;
@@ -57861,7 +58296,7 @@
57861
58296
  });
57862
58297
  return !match;
57863
58298
  }
57864
- else if (this._table._selectedDimensionInChart.length) {
58299
+ else if (this._table._selectedDimensionInChart?.length) {
57865
58300
  const match = this._table._selectedDimensionInChart.every(item => {
57866
58301
  if (datum[item.key] !== item.value) {
57867
58302
  return false;
@@ -59397,8 +59832,17 @@
59397
59832
  pivotSortState;
59398
59833
  dataset;
59399
59834
  flatDataToObjects;
59400
- constructor(options) {
59401
- super(options);
59835
+ constructor(container, options) {
59836
+ if (!(container instanceof HTMLElement)) {
59837
+ options = container;
59838
+ if (container.container) {
59839
+ container = container.container;
59840
+ }
59841
+ else {
59842
+ container = null;
59843
+ }
59844
+ }
59845
+ super(container, options);
59402
59846
  if (options.layout) {
59403
59847
  Object.assign(options, options.layout);
59404
59848
  }
@@ -59585,8 +60029,8 @@
59585
60029
  table.rowCount = layoutMap.rowCount ?? 0;
59586
60030
  table.frozenColCount = layoutMap.rowHeaderLevelCount;
59587
60031
  table.frozenRowCount = layoutMap.headerLevelCount;
59588
- table.bottomFrozenRowCount = layoutMap?.bottomFrozenRowCount ?? 0;
59589
- table.rightFrozenColCount = layoutMap?.rightFrozenColCount ?? 0;
60032
+ table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
60033
+ table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
59590
60034
  }
59591
60035
  _getSortFuncFromHeaderOption(columns, field, fieldKey) {
59592
60036
  return undefined;
@@ -59838,8 +60282,17 @@
59838
60282
  _selectedDimensionInChart = [];
59839
60283
  _chartEventMap = {};
59840
60284
  _axes;
59841
- constructor(options) {
59842
- super(options);
60285
+ constructor(container, options) {
60286
+ if (!(container instanceof HTMLElement)) {
60287
+ options = container;
60288
+ if (container.container) {
60289
+ container = container.container;
60290
+ }
60291
+ else {
60292
+ container = null;
60293
+ }
60294
+ }
60295
+ super(container, options);
59843
60296
  if (options.layout) {
59844
60297
  Object.assign(options, options.layout);
59845
60298
  }
@@ -60412,11 +60865,11 @@
60412
60865
  });
60413
60866
  }
60414
60867
  onVChartEvent(type, query, callback) {
60415
- if (query) {
60416
- this._chartEventMap[type] = { callback, query };
60868
+ if (typeof query === 'function') {
60869
+ this._chartEventMap[type] = { callback: query };
60417
60870
  }
60418
60871
  else {
60419
- this._chartEventMap[type] = { callback };
60872
+ this._chartEventMap[type] = { callback, query };
60420
60873
  }
60421
60874
  }
60422
60875
  offVChartEvent(type) {
@@ -61053,6 +61506,7 @@
61053
61506
  getSize(table) {
61054
61507
  const { width, height } = table.measureText(this.text, {
61055
61508
  fontSize: this.fontSize,
61509
+ fontWeight: this.fontWeight,
61056
61510
  fontFamily: this.fontFamily
61057
61511
  });
61058
61512
  this.width = width;
@@ -61111,7 +61565,7 @@
61111
61565
  percentCalc: percentCalc
61112
61566
  });
61113
61567
 
61114
- const version = "0.9.3-alpha.6";
61568
+ const version = "0.10.0";
61115
61569
  function getIcons() {
61116
61570
  return get$1();
61117
61571
  }