k-vtable 1.0.34 → 1.0.35

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 (189) hide show
  1. package/cjs/ListTable.d.ts +1 -0
  2. package/cjs/ListTable.js +184 -25
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.js +3 -2
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.d.ts +1 -0
  7. package/cjs/PivotTable.js +95 -15
  8. package/cjs/PivotTable.js.map +1 -1
  9. package/cjs/core/BaseTable.d.ts +14 -0
  10. package/cjs/core/BaseTable.js +149 -41
  11. package/cjs/core/BaseTable.js.map +1 -1
  12. package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
  13. package/cjs/core/TABLE_EVENT_TYPE.js +2 -0
  14. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  15. package/cjs/core/record-helper.js +83 -13
  16. package/cjs/core/record-helper.js.map +1 -1
  17. package/cjs/core/tableHelper.js +5 -3
  18. package/cjs/core/tableHelper.js.map +1 -1
  19. package/cjs/core/utils/get-cell-position.js +23 -12
  20. package/cjs/core/utils/get-cell-position.js.map +1 -1
  21. package/cjs/data/DataSource.js +3 -2
  22. package/cjs/data/DataSource.js.map +1 -1
  23. package/cjs/dataset/dataset.js +5 -1
  24. package/cjs/dataset/dataset.js.map +1 -1
  25. package/cjs/edit/edit-manager.js +24 -16
  26. package/cjs/edit/edit-manager.js.map +1 -1
  27. package/cjs/event/EventTarget.js +3 -1
  28. package/cjs/event/EventTarget.js.map +1 -1
  29. package/cjs/event/helper.js +1 -1
  30. package/cjs/event/listener/container-dom.js +11 -6
  31. package/cjs/event/listener/container-dom.js.map +1 -1
  32. package/cjs/event/listener/scroll-bar.js +77 -6
  33. package/cjs/event/listener/scroll-bar.js.map +1 -1
  34. package/cjs/event/listener/table-group.js +53 -23
  35. package/cjs/event/listener/table-group.js.map +1 -1
  36. package/cjs/event/media-click.js +1 -1
  37. package/cjs/event/scroll.js +35 -12
  38. package/cjs/event/scroll.js.map +1 -1
  39. package/cjs/event/sparkline-event.js +1 -1
  40. package/cjs/event/util.d.ts +2 -0
  41. package/cjs/event/util.js +29 -4
  42. package/cjs/event/util.js.map +1 -1
  43. package/cjs/header-helper/header-helper.js +2 -2
  44. package/cjs/header-helper/header-helper.js.map +1 -1
  45. package/cjs/header-helper/style.js +2 -1
  46. package/cjs/index.d.ts +3 -3
  47. package/cjs/index.js +51 -12
  48. package/cjs/index.js.map +1 -1
  49. package/cjs/layout/cell-range/simple-cell-range.js +14 -5
  50. package/cjs/layout/cell-range/simple-cell-range.js.map +1 -1
  51. package/cjs/plugins/index.js +1 -1
  52. package/cjs/plugins/interface.js +1 -1
  53. package/cjs/plugins/invert-highlight.js +1 -1
  54. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  55. package/cjs/plugins/plugin-manager.js +1 -1
  56. package/cjs/scenegraph/component/table-component.d.ts +6 -1
  57. package/cjs/scenegraph/component/table-component.js +143 -17
  58. package/cjs/scenegraph/component/table-component.js.map +1 -1
  59. package/cjs/scenegraph/component/util.js +5 -2
  60. package/cjs/scenegraph/component/util.js.map +1 -1
  61. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +29 -10
  62. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  63. package/cjs/scenegraph/group-creater/cell-helper.js +7 -4
  64. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  65. package/cjs/scenegraph/group-creater/init-scenegraph.js +37 -7
  66. package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  67. package/cjs/scenegraph/group-creater/progress/proxy.js +4 -2
  68. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  69. package/cjs/scenegraph/scenegraph.d.ts +13 -0
  70. package/cjs/scenegraph/scenegraph.js +194 -23
  71. package/cjs/scenegraph/scenegraph.js.map +1 -1
  72. package/cjs/scenegraph/select/create-select-border.js +9 -10
  73. package/cjs/scenegraph/select/create-select-border.js.map +1 -1
  74. package/cjs/scenegraph/select/delete-select-border.js.map +1 -1
  75. package/cjs/scenegraph/select/move-select-border.js.map +1 -1
  76. package/cjs/scenegraph/select/update-custom-select-border.js +9 -9
  77. package/cjs/scenegraph/select/update-custom-select-border.js.map +1 -1
  78. package/cjs/scenegraph/select/update-select-border.js +27 -122
  79. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  80. package/cjs/scenegraph/select/update-select-style.js.map +1 -1
  81. package/cjs/state/select/update-position.js +2 -1
  82. package/cjs/state/select/update-position.js.map +1 -1
  83. package/cjs/state/state.d.ts +8 -1
  84. package/cjs/state/state.js +82 -40
  85. package/cjs/state/state.js.map +1 -1
  86. package/cjs/ts-types/base-table.d.ts +15 -0
  87. package/cjs/ts-types/base-table.js.map +1 -1
  88. package/cjs/ts-types/dataset/aggregation.js +94 -39
  89. package/cjs/ts-types/dataset/aggregation.js.map +1 -1
  90. package/cjs/ts-types/events.d.ts +16 -0
  91. package/cjs/ts-types/events.js.map +1 -1
  92. package/cjs/ts-types/table-engine.js.map +1 -1
  93. package/cjs/vrender.js.map +1 -1
  94. package/dist/vtable.js +2381 -733
  95. package/dist/vtable.min.js +1 -15
  96. package/es/ListTable.d.ts +1 -0
  97. package/es/ListTable.js +178 -25
  98. package/es/ListTable.js.map +1 -1
  99. package/es/PivotChart.js +2 -2
  100. package/es/PivotChart.js.map +1 -1
  101. package/es/PivotTable.d.ts +1 -0
  102. package/es/PivotTable.js +93 -15
  103. package/es/PivotTable.js.map +1 -1
  104. package/es/core/BaseTable.d.ts +14 -0
  105. package/es/core/BaseTable.js +148 -40
  106. package/es/core/BaseTable.js.map +1 -1
  107. package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
  108. package/es/core/TABLE_EVENT_TYPE.js +2 -0
  109. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  110. package/es/core/record-helper.js +83 -12
  111. package/es/core/record-helper.js.map +1 -1
  112. package/es/core/tableHelper.js +5 -3
  113. package/es/core/tableHelper.js.map +1 -1
  114. package/es/core/utils/get-cell-position.js +23 -12
  115. package/es/core/utils/get-cell-position.js.map +1 -1
  116. package/es/data/DataSource.js +3 -2
  117. package/es/data/DataSource.js.map +1 -1
  118. package/es/dataset/dataset.js +5 -1
  119. package/es/dataset/dataset.js.map +1 -1
  120. package/es/edit/edit-manager.js +22 -16
  121. package/es/edit/edit-manager.js.map +1 -1
  122. package/es/event/EventTarget.js +3 -1
  123. package/es/event/EventTarget.js.map +1 -1
  124. package/es/event/helper.js +1 -1
  125. package/es/event/listener/container-dom.js +10 -5
  126. package/es/event/listener/container-dom.js.map +1 -1
  127. package/es/event/listener/scroll-bar.js +75 -6
  128. package/es/event/listener/scroll-bar.js.map +1 -1
  129. package/es/event/listener/table-group.js +53 -24
  130. package/es/event/listener/table-group.js.map +1 -1
  131. package/es/event/media-click.js +1 -1
  132. package/es/event/scroll.js +35 -12
  133. package/es/event/scroll.js.map +1 -1
  134. package/es/event/sparkline-event.js +1 -1
  135. package/es/event/util.d.ts +2 -0
  136. package/es/event/util.js +25 -1
  137. package/es/event/util.js.map +1 -1
  138. package/es/header-helper/header-helper.js +2 -2
  139. package/es/header-helper/header-helper.js.map +1 -1
  140. package/es/header-helper/style.js +2 -1
  141. package/es/index.d.ts +3 -3
  142. package/es/index.js +5 -3
  143. package/es/index.js.map +1 -1
  144. package/es/layout/cell-range/simple-cell-range.js +14 -5
  145. package/es/layout/cell-range/simple-cell-range.js.map +1 -1
  146. package/es/plugins/index.js +1 -1
  147. package/es/plugins/interface.js +1 -1
  148. package/es/plugins/invert-highlight.js +1 -1
  149. package/es/plugins/list-tree-stick-cell.js +1 -1
  150. package/es/plugins/plugin-manager.js +1 -1
  151. package/es/scenegraph/component/table-component.d.ts +6 -1
  152. package/es/scenegraph/component/table-component.js +141 -17
  153. package/es/scenegraph/component/table-component.js.map +1 -1
  154. package/es/scenegraph/component/util.js +5 -2
  155. package/es/scenegraph/component/util.js.map +1 -1
  156. package/es/scenegraph/graphic/contributions/group-contribution-render.js +29 -10
  157. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  158. package/es/scenegraph/group-creater/cell-helper.js +7 -4
  159. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  160. package/es/scenegraph/group-creater/init-scenegraph.js +37 -7
  161. package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
  162. package/es/scenegraph/group-creater/progress/proxy.js +4 -2
  163. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  164. package/es/scenegraph/scenegraph.d.ts +13 -0
  165. package/es/scenegraph/scenegraph.js +185 -18
  166. package/es/scenegraph/scenegraph.js.map +1 -1
  167. package/es/scenegraph/select/create-select-border.js +9 -10
  168. package/es/scenegraph/select/create-select-border.js.map +1 -1
  169. package/es/scenegraph/select/delete-select-border.js.map +1 -1
  170. package/es/scenegraph/select/move-select-border.js.map +1 -1
  171. package/es/scenegraph/select/update-custom-select-border.js +9 -9
  172. package/es/scenegraph/select/update-custom-select-border.js.map +1 -1
  173. package/es/scenegraph/select/update-select-border.js +25 -118
  174. package/es/scenegraph/select/update-select-border.js.map +1 -1
  175. package/es/scenegraph/select/update-select-style.js.map +1 -1
  176. package/es/state/select/update-position.js +3 -0
  177. package/es/state/select/update-position.js.map +1 -1
  178. package/es/state/state.d.ts +8 -1
  179. package/es/state/state.js +81 -40
  180. package/es/state/state.js.map +1 -1
  181. package/es/ts-types/base-table.d.ts +15 -0
  182. package/es/ts-types/base-table.js.map +1 -1
  183. package/es/ts-types/dataset/aggregation.js +68 -38
  184. package/es/ts-types/dataset/aggregation.js.map +1 -1
  185. package/es/ts-types/events.d.ts +16 -0
  186. package/es/ts-types/events.js.map +1 -1
  187. package/es/ts-types/table-engine.js.map +1 -1
  188. package/es/vrender.js.map +1 -1
  189. package/package.json +12 -11
@@ -164,6 +164,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
164
164
  set heightAdaptiveMode(heightAdaptiveMode: HeightAdaptiveModeDef);
165
165
  _colWidthDefineToPxWidth(width: string | number): number;
166
166
  _getMaxFrozenWidth(): number;
167
+ _getMaxRightFrozenWidth(): number;
167
168
  _getComputedFrozenColCount(frozenColCount: number): number;
168
169
  private _getColWidthLimits;
169
170
  _adjustColWidth(col: number, orgWidth: number): number;
@@ -265,6 +266,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
265
266
  release: () => void;
266
267
  }): void;
267
268
  private dispose;
269
+ clearCorrectTimer(): void;
268
270
  release(): void;
269
271
  fireListeners<TYPE extends keyof TableEventHandlersEventArgumentMap>(type: TYPE, event: TableEventHandlersEventArgumentMap[TYPE]): TableEventHandlersReturnMap[TYPE][];
270
272
  updateOption(options: BaseTableConstructorOptions, updateConfig?: {
@@ -274,8 +276,14 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
274
276
  renderWithRecreateCells(): void;
275
277
  getFrozenRowsHeight(): number;
276
278
  getFrozenColsWidth(): number;
279
+ getFrozenColsContentWidth(): number;
280
+ getFrozenColsOffset(): number;
281
+ getFrozenColsScrollLeft(): number;
277
282
  getBottomFrozenRowsHeight(): number;
278
283
  getRightFrozenColsWidth(): number;
284
+ getRightFrozenColsContentWidth(): number;
285
+ getRightFrozenColsOffset(): number;
286
+ getRightFrozenColsScrollLeft(): number;
279
287
  getDrawRange(): Rect;
280
288
  _getMouseAbstractPoint(evt: TouchEvent | MouseEvent | undefined): {
281
289
  x: number;
@@ -297,6 +305,11 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
297
305
  endDragSelect(): void;
298
306
  startDragSelectRow(rowIndex: number, enableCtrlSelectMode?: boolean, isShift?: boolean, makeSelectCellVisible?: boolean): void;
299
307
  dragSelectRow(rowIndex: number, isCtrl?: boolean, makeSelectCellVisible?: boolean): void;
308
+ changeHeaderPosition(args: {
309
+ source: CellAddress;
310
+ target: CellAddress;
311
+ movingColumnOrRow?: 'column' | 'row';
312
+ }): boolean;
300
313
  abstract isListTable(): boolean;
301
314
  abstract isPivotTable(): boolean;
302
315
  abstract isPivotChart(): boolean;
@@ -458,6 +471,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
458
471
  disableScroll(): void;
459
472
  enableScroll(): void;
460
473
  getGroupTitleLevel(col: number, row: number): number | undefined;
474
+ getTargetScrollTop(row: number): number;
461
475
  private _scheduleScrollToRowCorrect;
462
476
  scrollToRow(row: number, animationOption?: ITableAnimationOption | boolean): void;
463
477
  scrollToCol(col: number, animationOption?: ITableAnimationOption | boolean): void;
@@ -45,9 +45,19 @@ class BaseTable extends EventTarget_1.EventTarget {
45
45
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
46
46
  if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0,
47
47
  this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0,
48
- this.version = "1.0.34", this.id = `VTable${Date.now()}`, this.isReleased = !1,
48
+ this.version = "1.0.35", this.id = `VTable${Date.now()}`, this.isReleased = !1,
49
49
  this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
50
- "node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
50
+ "undefined" != typeof window) {
51
+ const g = window;
52
+ g[this.id] = this;
53
+ const registry = g.__vtable__ || (g.__vtable__ = {
54
+ byId: Object.create(null),
55
+ list: [],
56
+ last: null
57
+ });
58
+ registry.byId[this.id] = this, registry.list.push(this), registry.last = this, g.__vtable_last_id__ = this.id;
59
+ }
60
+ if ("node" === env_1.Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
51
61
  container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
52
62
  this.pluginManager = new plugin_manager_1.PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.BEFORE_INIT, {
53
63
  options: options,
@@ -87,10 +97,14 @@ class BaseTable extends EventTarget_1.EventTarget {
87
97
  void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
88
98
  this.options.canvas ? ("node" !== env_1.Env.mode && (internalProps.element = this.options.canvas.parentElement,
89
99
  internalProps.element.style.position = "relative"), internalProps.focusControl = new FouseInput_1.FocusInput(this, internalProps.element),
90
- internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== env_1.Env.mode && (internalProps.element = (0,
100
+ internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d"),
101
+ internalProps.canvas.__vtable__ = this, internalProps.canvas.__vtable_id__ = this.id,
102
+ internalProps.element && (internalProps.element.__vtable__ = this, internalProps.element.__vtable_id__ = this.id)) : "node" !== env_1.Env.mode && (internalProps.element = (0,
91
103
  tableHelper_1.createRootElement)(this.padding), internalProps.focusControl = new FouseInput_1.FocusInput(this, internalProps.element),
92
104
  internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas),
93
- internalProps.context = internalProps.canvas.getContext("2d"), (null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && (0,
105
+ internalProps.context = internalProps.canvas.getContext("2d"), internalProps.canvas.__vtable__ = this,
106
+ internalProps.canvas.__vtable_id__ = this.id, internalProps.element.__vtable__ = this,
107
+ internalProps.element.__vtable_id__ = this.id, (null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && (0,
94
108
  frozen_react_1.createReactContainer)(this)), internalProps.handler = new EventHandler_1.EventHandler,
95
109
  (0, vutils_1.isNumber)(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
96
110
  internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount,
@@ -257,7 +271,7 @@ class BaseTable extends EventTarget_1.EventTarget {
257
271
  frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
258
272
  this.options.frozenColCount = frozenColCount;
259
273
  const maxFrozenWidth = this._getMaxFrozenWidth();
260
- if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
274
+ if (!this.options.scrollFrozenCols && this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
261
275
  const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
262
276
  this.internalProps.frozenColCount = computedFrozenColCount;
263
277
  }
@@ -267,7 +281,7 @@ class BaseTable extends EventTarget_1.EventTarget {
267
281
  frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
268
282
  this.options.frozenColCount = frozenColCount;
269
283
  const maxFrozenWidth = this._getMaxFrozenWidth();
270
- if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
284
+ if (!this.options.scrollFrozenCols && this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
271
285
  const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
272
286
  this.internalProps.frozenColCount = computedFrozenColCount;
273
287
  }
@@ -422,6 +436,11 @@ class BaseTable extends EventTarget_1.EventTarget {
422
436
  const maxFrozenWidth = null !== (_a = this.options.maxFrozenWidth) && void 0 !== _a ? _a : "80%";
423
437
  return (0, tableHelper_1._toPxWidth)(this, maxFrozenWidth);
424
438
  }
439
+ _getMaxRightFrozenWidth() {
440
+ var _a, _b;
441
+ const maxRightFrozenWidth = null !== (_b = null !== (_a = this.options.maxRightFrozenWidth) && void 0 !== _a ? _a : this.options.maxFrozenWidth) && void 0 !== _b ? _b : "80%";
442
+ return (0, tableHelper_1._toPxWidth)(this, maxRightFrozenWidth);
443
+ }
425
444
  _getComputedFrozenColCount(frozenColCount) {
426
445
  const maxFrozenWidth = this._getMaxFrozenWidth();
427
446
  let computedfrozenColCount = frozenColCount;
@@ -746,22 +765,27 @@ class BaseTable extends EventTarget_1.EventTarget {
746
765
  let relativeX = !0, relativeY = !0;
747
766
  (null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
748
767
  relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
749
- const cellRect = this.getCellRect(col, row);
750
- return this._toRelativeRect(cellRect, relativeX, relativeY);
768
+ const cellRect = this.getCellRect(col, row), rect = this._toRelativeRect(cellRect, relativeX, relativeY);
769
+ return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(col, row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
770
+ rect;
751
771
  }
752
772
  getCellRangeRelativeRect(range) {
753
773
  if (range.start) {
754
774
  const isFrozenCell = this.isFrozenCell(range.start.col, range.start.row);
755
775
  let relativeX = !0, relativeY = !0;
756
- return (null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
757
- relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1),
758
- this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
776
+ (null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
777
+ relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
778
+ const rect = this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
779
+ return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(range.start.col, range.start.row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
780
+ rect;
759
781
  }
760
782
  const cellRange = this.getCellRange(range.col, range.row), isFrozenCell = this.isFrozenCell(range.col, range.row);
761
783
  let relativeX = !0, relativeY = !0;
762
- return (null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
763
- relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1),
764
- this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
784
+ (null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
785
+ relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
786
+ const rect = this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
787
+ return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(range.col, range.row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
788
+ rect;
765
789
  }
766
790
  getVisibleCellRangeRelativeRect(range) {
767
791
  let cellRange;
@@ -863,7 +887,7 @@ class BaseTable extends EventTarget_1.EventTarget {
863
887
  }
864
888
  getVisibleRect() {
865
889
  const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, width = this.tableNoFrameWidth, height = this.tableNoFrameHeight;
866
- return new Rect_1.Rect(scrollLeft, scrollTop, width, height);
890
+ return new Rect_1.Rect(scrollLeft + this.getFrozenColsOffset(), scrollTop, width, height);
867
891
  }
868
892
  get visibleRowCount() {
869
893
  const {frozenRowCount: frozenRowCount} = this, visibleRect = this.getVisibleRect(), visibleTop = frozenRowCount > 0 ? visibleRect.top + this.getRowsHeight(0, frozenRowCount - 1) : visibleRect.top, initRow = this.getTargetRowAt(visibleTop);
@@ -879,7 +903,7 @@ class BaseTable extends EventTarget_1.EventTarget {
879
903
  return count;
880
904
  }
881
905
  getBodyVisibleCellRange() {
882
- const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenRowsHeight = this.getFrozenRowsHeight(), frozenColsWidth = this.getFrozenColsWidth(), bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.getRightFrozenColsWidth(), {row: rowStart} = this.getRowAt(scrollTop + frozenRowsHeight + 1), {col: colStart} = this.getColAt(scrollLeft + frozenColsWidth + 1), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight).row : this.rowCount - 1, colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth).col : this.colCount - 1;
906
+ const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenRowsHeight = this.getFrozenRowsHeight(), frozenColsContentWidth = this.getFrozenColsContentWidth(), frozenColsOffset = this.getFrozenColsOffset(), bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.getRightFrozenColsWidth(), {row: rowStart} = this.getRowAt(scrollTop + frozenRowsHeight + 1), {col: colStart} = this.getColAt(scrollLeft + frozenColsContentWidth + 1), rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight).row : this.rowCount - 1, colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + frozenColsOffset + this.tableNoFrameWidth - 1 - rightFrozenColsWidth).col : this.colCount - 1;
883
907
  return colEnd < 0 || rowEnd < 0 ? null : {
884
908
  rowStart: rowStart,
885
909
  colStart: colStart,
@@ -895,14 +919,14 @@ class BaseTable extends EventTarget_1.EventTarget {
895
919
  };
896
920
  }
897
921
  getBodyVisibleColRange(start_deltaX = 0, end_deltaX = 0) {
898
- const {scrollLeft: scrollLeft} = this, frozenColsWidth = this.getFrozenColsWidth(), rightFrozenColsWidth = this.getRightFrozenColsWidth(), {col: colStart} = this.getColAt(scrollLeft + frozenColsWidth + 1 + start_deltaX), colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth + end_deltaX).col : this.colCount - 1;
922
+ const {scrollLeft: scrollLeft} = this, frozenColsContentWidth = this.getFrozenColsContentWidth(), frozenColsOffset = this.getFrozenColsOffset(), rightFrozenColsWidth = this.getRightFrozenColsWidth(), {col: colStart} = this.getColAt(scrollLeft + frozenColsContentWidth + 1 + start_deltaX), colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + frozenColsOffset + this.tableNoFrameWidth - 1 - rightFrozenColsWidth + end_deltaX).col : this.colCount - 1;
899
923
  return colEnd < 0 ? null : {
900
924
  colStart: colStart,
901
925
  colEnd: colEnd
902
926
  };
903
927
  }
904
928
  get visibleColCount() {
905
- const {frozenColCount: frozenColCount} = this, visibleRect = this.getVisibleRect(), visibleLeft = frozenColCount > 0 ? visibleRect.left + this.getColsWidth(0, frozenColCount - 1) : visibleRect.left, initCol = this.getTargetColAt(visibleLeft);
929
+ const {frozenColCount: frozenColCount} = this, visibleRect = this.getVisibleRect(), visibleLeft = frozenColCount > 0 ? visibleRect.left + this.getFrozenColsWidth() : visibleRect.left, initCol = this.getTargetColAt(visibleLeft);
906
930
  if (!initCol) return 0;
907
931
  const startCol = Math.max(initCol.left >= visibleLeft ? initCol.col : initCol.col + 1, frozenColCount);
908
932
  let absoluteLeft = this.getColsWidth(0, startCol - 1), count = 0;
@@ -948,28 +972,47 @@ class BaseTable extends EventTarget_1.EventTarget {
948
972
  dispose() {
949
973
  this.release();
950
974
  }
975
+ clearCorrectTimer() {
976
+ this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null);
977
+ }
951
978
  release() {
952
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
953
- const internalProps = this.internalProps;
979
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
980
+ if ("undefined" != typeof window) {
981
+ const g = window;
982
+ (null == g ? void 0 : g[this.id]) === this ? delete g[this.id] : (null == g ? void 0 : g[this.id]) && (g[this.id] = null);
983
+ const registry = null == g ? void 0 : g.__vtable__;
984
+ (null === (_a = null == registry ? void 0 : registry.byId) || void 0 === _a ? void 0 : _a[this.id]) === this && delete registry.byId[this.id];
985
+ const list = null == registry ? void 0 : registry.list;
986
+ if (Array.isArray(list) && list.length) for (let i = list.length - 1; i >= 0; i--) list[i] === this && list.splice(i, 1);
987
+ (null == registry ? void 0 : registry.last) === this && (registry.last = Array.isArray(list) && list.length ? list[list.length - 1] : null),
988
+ (null == g ? void 0 : g.__vtable_last_id__) === this.id && (g.__vtable_last_id__ = null !== (_c = null === (_b = null == registry ? void 0 : registry.last) || void 0 === _b ? void 0 : _b.id) && void 0 !== _c ? _c : null);
989
+ }
954
990
  if (this.isReleased) return;
955
- this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null),
956
- null === (_b = null === (_a = internalProps.tooltipHandler) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a),
957
- null === (_d = null === (_c = internalProps.menuHandler) || void 0 === _c ? void 0 : _c.release) || void 0 === _d || _d.call(_c),
958
- null === (_e = super.release) || void 0 === _e || _e.call(this), this.pluginManager.release(),
959
- null === (_g = null === (_f = internalProps.handler) || void 0 === _f ? void 0 : _f.release) || void 0 === _g || _g.call(_f),
960
- this.eventManager.release(), null === (_j = null === (_h = internalProps.focusControl) || void 0 === _h ? void 0 : _h.release) || void 0 === _j || _j.call(_h),
961
- null === (_k = internalProps.legends) || void 0 === _k || _k.forEach((legend => {
991
+ null === (_f = null === (_e = null === (_d = this.scenegraph) || void 0 === _d ? void 0 : _d.component) || void 0 === _e ? void 0 : _e.vScrollBar) || void 0 === _f || _f.release(),
992
+ null === (_j = null === (_h = null === (_g = this.scenegraph) || void 0 === _g ? void 0 : _g.component) || void 0 === _h ? void 0 : _h.hScrollBar) || void 0 === _j || _j.release(),
993
+ this.animationManager.clear(), this.animationManager.ticker.release(), null === (_m = null === (_l = null === (_k = this.scenegraph) || void 0 === _k ? void 0 : _k.stage) || void 0 === _l ? void 0 : _l.ticker) || void 0 === _m || _m.release();
994
+ const internalProps = this.internalProps, canvas = null == internalProps ? void 0 : internalProps.canvas;
995
+ (null == canvas ? void 0 : canvas.__vtable__) === this && (delete canvas.__vtable__,
996
+ delete canvas.__vtable_id__);
997
+ const element = null == internalProps ? void 0 : internalProps.element;
998
+ (null == element ? void 0 : element.__vtable__) === this && (delete element.__vtable__,
999
+ delete element.__vtable_id__), this.clearCorrectTimer(), null === (_p = null === (_o = internalProps.tooltipHandler) || void 0 === _o ? void 0 : _o.release) || void 0 === _p || _p.call(_o),
1000
+ null === (_r = null === (_q = internalProps.menuHandler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q),
1001
+ null === (_s = super.release) || void 0 === _s || _s.call(this), this.pluginManager.release(),
1002
+ null === (_u = null === (_t = internalProps.handler) || void 0 === _t ? void 0 : _t.release) || void 0 === _u || _u.call(_t),
1003
+ this.eventManager.release(), null === (_w = null === (_v = internalProps.focusControl) || void 0 === _v ? void 0 : _v.release) || void 0 === _w || _w.call(_v),
1004
+ null === (_x = internalProps.legends) || void 0 === _x || _x.forEach((legend => {
962
1005
  null == legend || legend.release();
963
- })), null === (_l = internalProps.title) || void 0 === _l || _l.release(), internalProps.title = null,
964
- null === (_m = internalProps.emptyTip) || void 0 === _m || _m.release(), internalProps.emptyTip = null,
1006
+ })), null === (_y = internalProps.title) || void 0 === _y || _y.release(), internalProps.title = null,
1007
+ null === (_z = internalProps.emptyTip) || void 0 === _z || _z.release(), internalProps.emptyTip = null,
965
1008
  internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
966
1009
  var _a;
967
1010
  return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
968
1011
  })), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
969
- const parentElement = null === (_o = internalProps.element) || void 0 === _o ? void 0 : _o.parentElement;
1012
+ const parentElement = null === (_0 = internalProps.element) || void 0 === _0 ? void 0 : _0.parentElement;
970
1013
  parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
971
- null === (_r = null === (_q = null === (_p = this.editorManager) || void 0 === _p ? void 0 : _p.editingEditor) || void 0 === _q ? void 0 : _q.onEnd) || void 0 === _r || _r.call(_q),
972
- this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_s = this.reactCustomLayout) || void 0 === _s || _s.clearCache(),
1014
+ null === (_3 = null === (_2 = null === (_1 = this.editorManager) || void 0 === _1 ? void 0 : _1.editingEditor) || void 0 === _2 ? void 0 : _2.onEnd) || void 0 === _3 || _3.call(_2),
1015
+ this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_4 = this.reactCustomLayout) || void 0 === _4 || _4.clearCache(),
973
1016
  (0, chart_render_helper_1.clearChartRenderQueue)();
974
1017
  }
975
1018
  fireListeners(type, event) {
@@ -1099,8 +1142,22 @@ class BaseTable extends EventTarget_1.EventTarget {
1099
1142
  return this.getRowsHeight(0, this.frozenRowCount - 1);
1100
1143
  }
1101
1144
  getFrozenColsWidth() {
1145
+ const contentWidth = this.getFrozenColsContentWidth();
1146
+ if (!this.options.scrollFrozenCols) return contentWidth;
1147
+ const maxFrozenWidth = this._getMaxFrozenWidth();
1148
+ return Math.min(contentWidth, maxFrozenWidth);
1149
+ }
1150
+ getFrozenColsContentWidth() {
1102
1151
  return this.getColsWidth(0, this.frozenColCount - 1);
1103
1152
  }
1153
+ getFrozenColsOffset() {
1154
+ const contentWidth = this.getFrozenColsContentWidth(), viewportWidth = this.getFrozenColsWidth();
1155
+ return Math.max(0, contentWidth - viewportWidth);
1156
+ }
1157
+ getFrozenColsScrollLeft() {
1158
+ var _a;
1159
+ return null !== (_a = this.stateManager.scroll.frozenHorizontalBarPos) && void 0 !== _a ? _a : 0;
1160
+ }
1104
1161
  getBottomFrozenRowsHeight() {
1105
1162
  if (this.bottomFrozenRowCount > 0) {
1106
1163
  let height = 0;
@@ -1110,6 +1167,12 @@ class BaseTable extends EventTarget_1.EventTarget {
1110
1167
  return 0;
1111
1168
  }
1112
1169
  getRightFrozenColsWidth() {
1170
+ const contentWidth = this.getRightFrozenColsContentWidth();
1171
+ if (!this.options.scrollRightFrozenCols) return contentWidth;
1172
+ const maxRightFrozenWidth = this._getMaxRightFrozenWidth();
1173
+ return Math.min(contentWidth, maxRightFrozenWidth);
1174
+ }
1175
+ getRightFrozenColsContentWidth() {
1113
1176
  if (this.rightFrozenColCount > 0) {
1114
1177
  let width = 0;
1115
1178
  for (let col = this.colCount - this.rightFrozenColCount; col <= this.colCount - 1; col++) width += this.getColWidth(col);
@@ -1117,6 +1180,14 @@ class BaseTable extends EventTarget_1.EventTarget {
1117
1180
  }
1118
1181
  return 0;
1119
1182
  }
1183
+ getRightFrozenColsOffset() {
1184
+ const contentWidth = this.getRightFrozenColsContentWidth(), viewportWidth = this.getRightFrozenColsWidth();
1185
+ return Math.max(0, contentWidth - viewportWidth);
1186
+ }
1187
+ getRightFrozenColsScrollLeft() {
1188
+ var _a;
1189
+ return null !== (_a = this.stateManager.scroll.rightFrozenHorizontalBarPos) && void 0 !== _a ? _a : 0;
1190
+ }
1120
1191
  getDrawRange() {
1121
1192
  var _a, _b;
1122
1193
  const width = (null === (_a = this.containerFit) || void 0 === _a ? void 0 : _a.width) ? this.tableNoFrameWidth : Math.min(this.tableNoFrameWidth, this.getAllColsWidth()), height = (null === (_b = this.containerFit) || void 0 === _b ? void 0 : _b.height) ? this.tableNoFrameHeight : Math.min(this.tableNoFrameHeight, this.getAllRowsHeight());
@@ -1267,6 +1338,31 @@ class BaseTable extends EventTarget_1.EventTarget {
1267
1338
  lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, makeSelectCellVisible, !0),
1268
1339
  this.stateManager.select.selecting = !1;
1269
1340
  }
1341
+ changeHeaderPosition(args) {
1342
+ var _a, _b, _c, _d, _e;
1343
+ if (!("canMoveHeaderPosition" in this.internalProps.layoutMap) || !0 === (null === (_a = this.options.customConfig) || void 0 === _a ? void 0 : _a.notUpdateInColumnRowMove)) return !1;
1344
+ const prevMoving = this.stateManager.columnMove.movingColumnOrRow;
1345
+ this.stateManager.columnMove.movingColumnOrRow = args.movingColumnOrRow;
1346
+ try {
1347
+ if (!1 === (null === (_c = (_b = this.internalProps.layoutMap).canMoveHeaderPosition) || void 0 === _c ? void 0 : _c.call(_b, args.source, args.target))) return !1;
1348
+ const oldSourceMergeInfo = this.getCellRange(args.source.col, args.source.row), oldTargetMergeInfo = this.getCellRange(args.target.col, args.target.row), moveContext = this._moveHeaderPosition(args.source, args.target);
1349
+ if (!moveContext || moveContext.targetIndex === moveContext.sourceIndex) return !1;
1350
+ this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.layoutMap.clearCellRangeMap();
1351
+ const sourceMergeInfo = this.getCellRange(args.source.col, args.source.row), targetMergeInfo = this.getCellRange(args.target.col, args.target.row), colMin = Math.min(sourceMergeInfo.start.col, targetMergeInfo.start.col, oldSourceMergeInfo.start.col, oldTargetMergeInfo.start.col), colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col), rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
1352
+ let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
1353
+ if ("row" === moveContext.moveType && "tree" === this.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1),
1354
+ this.transpose || !this.isSeriesNumberInBody(args.source.col, args.source.row) && "row" !== args.movingColumnOrRow || (this.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex),
1355
+ this.stateManager.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex)),
1356
+ "column" === moveContext.moveType) for (let col = colMin; col <= colMax; col++) this._clearColRangeWidthsMap(col); else for (let row = rowMin; row <= rowMax; row++) this._clearRowRangeHeightsMap(row);
1357
+ return this.clearCellStyleCache(), this.isSeriesNumberInBody(args.source.col, args.source.row) || "row" === args.movingColumnOrRow ? this.scenegraph.updateHeaderPosition(this.scenegraph.proxy.colStart, this.scenegraph.proxy.colEnd, this.scenegraph.proxy.rowStart, this.scenegraph.proxy.rowEnd, moveContext.moveType) : "column" === moveContext.moveType ? this.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType) : this.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType),
1358
+ "adjustFrozenCount" === this.internalProps.frozenColDragHeaderMode && this.isListTable() && (this.isLeftFrozenColumn(args.target.col) && !this.isLeftFrozenColumn(args.source.col) ? this.frozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : this.isLeftFrozenColumn(args.source.col) && !this.isLeftFrozenColumn(args.target.col) && (this.frozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1),
1359
+ this.isRightFrozenColumn(args.target.col) && !this.isRightFrozenColumn(args.source.col) ? this.rightFrozenColCount += sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1 : this.isRightFrozenColumn(args.source.col) && !this.isRightFrozenColumn(args.target.col) && (this.rightFrozenColCount -= sourceMergeInfo.end.col - sourceMergeInfo.start.col + 1)),
1360
+ null === (_e = (_d = this.scenegraph).updateNextFrame) || void 0 === _e || _e.call(_d),
1361
+ !0;
1362
+ } finally {
1363
+ this.stateManager.columnMove.movingColumnOrRow = prevMoving;
1364
+ }
1365
+ }
1270
1366
  get recordsCount() {
1271
1367
  var _a;
1272
1368
  return null === (_a = this.records) || void 0 === _a ? void 0 : _a.length;
@@ -1342,10 +1438,14 @@ class BaseTable extends EventTarget_1.EventTarget {
1342
1438
  }
1343
1439
  getCellType(col, row) {
1344
1440
  let cellType;
1345
- return this.isSeriesNumberInHeader(col, row) ? this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType : (cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType,
1441
+ if (this.isSeriesNumberInHeader(col, row)) {
1442
+ const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
1443
+ return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
1444
+ }
1445
+ return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType,
1346
1446
  (0, get_prop_1.getProp)("cellType", {
1347
1447
  cellType: cellType
1348
- }, col, row, this));
1448
+ }, col, row, this);
1349
1449
  }
1350
1450
  getHeaderField(col, row) {
1351
1451
  return this.internalProps.layoutMap.getHeaderField(col, row);
@@ -1419,7 +1519,7 @@ class BaseTable extends EventTarget_1.EventTarget {
1419
1519
  getCustomMerge(col, row) {
1420
1520
  if (this.internalProps.customMergeCell) {
1421
1521
  const customMerge = this.internalProps.customMergeCell(col, row, this);
1422
- if (customMerge && customMerge.range && ((0, vutils_1.isValid)(customMerge.text) || customMerge.customLayout || this.customRender)) {
1522
+ if (customMerge && customMerge.range) {
1423
1523
  if (customMerge.style) {
1424
1524
  const styleClass = this.internalProps.bodyHelper.getStyleClass("text"), style = customMerge.style, fullStyle = columnStyleContents.of(style, this.theme.bodyStyle, {
1425
1525
  col: col,
@@ -2075,17 +2175,25 @@ class BaseTable extends EventTarget_1.EventTarget {
2075
2175
  this.eventManager.enableScroll();
2076
2176
  }
2077
2177
  getGroupTitleLevel(col, row) {}
2178
+ getTargetScrollTop(row) {
2179
+ const drawRange = this.getDrawRange(), frozenHeight = this.getFrozenRowsHeight();
2180
+ return Math.max(0, Math.min(this.getRowsHeight(0, row - 1) - frozenHeight, this.getAllRowsHeight() - drawRange.height));
2181
+ }
2078
2182
  _scheduleScrollToRowCorrect(row, delay = 0) {
2079
2183
  this._scrollToRowCorrectTimer = setTimeout((() => {
2080
- const drawRange = this.getDrawRange(), frozenHeight = this.getFrozenRowsHeight(), targetScrollTop = Math.max(0, Math.min(this.getRowsHeight(0, row) - frozenHeight, this.getAllRowsHeight() - drawRange.height));
2081
- targetScrollTop !== this.scrollTop && (this.scrollTop = targetScrollTop);
2184
+ this.clearCorrectTimer();
2185
+ const targetScrollTop = this.getTargetScrollTop(row);
2186
+ if (targetScrollTop !== this.scrollTop) {
2187
+ this.scrollTop = targetScrollTop;
2188
+ const correctedTargetScrollTop = this.getTargetScrollTop(row);
2189
+ correctedTargetScrollTop !== this.scrollTop && (this.scrollTop = correctedTargetScrollTop);
2190
+ }
2082
2191
  }), delay);
2083
2192
  }
2084
2193
  scrollToRow(row, animationOption) {
2085
2194
  var _a;
2086
- if (!(0, vutils_1.isNumber)(row) || this.rowCount <= 0) return;
2087
2195
  const targetRow = Math.min(Math.max(Math.floor(row), 0), this.rowCount - 1);
2088
- if (!animationOption) return this.scrollToCell({
2196
+ if (this.clearCorrectTimer(), !animationOption) return this.scrollToCell({
2089
2197
  row: targetRow
2090
2198
  }), void this._scheduleScrollToRowCorrect(targetRow);
2091
2199
  const duration = (0, vutils_1.isBoolean)(animationOption) ? 3e3 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3;
@@ -2110,8 +2218,8 @@ class BaseTable extends EventTarget_1.EventTarget {
2110
2218
  this.scrollLeft = Math.min(left - frozenWidth, this.getAllColsWidth() - drawRange.width);
2111
2219
  }
2112
2220
  if ((0, vutils_1.isValid)(cellAddr.row) && cellAddr.row >= this.frozenRowCount) {
2113
- const frozenHeight = this.getFrozenRowsHeight(), top = this.getRowsHeight(0, cellAddr.row - 1);
2114
- this.scrollTop = Math.min(top - frozenHeight, this.getAllRowsHeight() - drawRange.height);
2221
+ const frozenHeight = this.getFrozenRowsHeight(), top = this.rowHeightsMap.getSumInRange(0, cellAddr.row - 1);
2222
+ this.scrollTop = Math.min(top - frozenHeight, this.rowHeightsMap.getSumInRange(0, this.rowCount - 1) - drawRange.height);
2115
2223
  }
2116
2224
  this.render();
2117
2225
  }