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.
- package/cjs/ListTable.d.ts +1 -0
- package/cjs/ListTable.js +184 -25
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +3 -2
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -0
- package/cjs/PivotTable.js +95 -15
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +14 -0
- package/cjs/core/BaseTable.js +149 -41
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/record-helper.js +83 -13
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/core/tableHelper.js +5 -3
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/core/utils/get-cell-position.js +23 -12
- package/cjs/core/utils/get-cell-position.js.map +1 -1
- package/cjs/data/DataSource.js +3 -2
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.js +5 -1
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/edit/edit-manager.js +24 -16
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/EventTarget.js +3 -1
- package/cjs/event/EventTarget.js.map +1 -1
- package/cjs/event/helper.js +1 -1
- package/cjs/event/listener/container-dom.js +11 -6
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/scroll-bar.js +77 -6
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/listener/table-group.js +53 -23
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +1 -1
- package/cjs/event/scroll.js +35 -12
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/event/sparkline-event.js +1 -1
- package/cjs/event/util.d.ts +2 -0
- package/cjs/event/util.js +29 -4
- package/cjs/event/util.js.map +1 -1
- package/cjs/header-helper/header-helper.js +2 -2
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/header-helper/style.js +2 -1
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +51 -12
- package/cjs/index.js.map +1 -1
- package/cjs/layout/cell-range/simple-cell-range.js +14 -5
- package/cjs/layout/cell-range/simple-cell-range.js.map +1 -1
- package/cjs/plugins/index.js +1 -1
- package/cjs/plugins/interface.js +1 -1
- package/cjs/plugins/invert-highlight.js +1 -1
- package/cjs/plugins/list-tree-stick-cell.js +1 -1
- package/cjs/plugins/plugin-manager.js +1 -1
- package/cjs/scenegraph/component/table-component.d.ts +6 -1
- package/cjs/scenegraph/component/table-component.js +143 -17
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/component/util.js +5 -2
- package/cjs/scenegraph/component/util.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +29 -10
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +7 -4
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/init-scenegraph.js +37 -7
- package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +4 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +13 -0
- package/cjs/scenegraph/scenegraph.js +194 -23
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/create-select-border.js +9 -10
- package/cjs/scenegraph/select/create-select-border.js.map +1 -1
- package/cjs/scenegraph/select/delete-select-border.js.map +1 -1
- package/cjs/scenegraph/select/move-select-border.js.map +1 -1
- package/cjs/scenegraph/select/update-custom-select-border.js +9 -9
- package/cjs/scenegraph/select/update-custom-select-border.js.map +1 -1
- package/cjs/scenegraph/select/update-select-border.js +27 -122
- package/cjs/scenegraph/select/update-select-border.js.map +1 -1
- package/cjs/scenegraph/select/update-select-style.js.map +1 -1
- package/cjs/state/select/update-position.js +2 -1
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +8 -1
- package/cjs/state/state.js +82 -40
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +15 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/dataset/aggregation.js +94 -39
- package/cjs/ts-types/dataset/aggregation.js.map +1 -1
- package/cjs/ts-types/events.d.ts +16 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +2381 -733
- package/dist/vtable.min.js +1 -15
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +178 -25
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +2 -2
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -0
- package/es/PivotTable.js +93 -15
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +14 -0
- package/es/core/BaseTable.js +148 -40
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/es/core/TABLE_EVENT_TYPE.js +2 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/record-helper.js +83 -12
- package/es/core/record-helper.js.map +1 -1
- package/es/core/tableHelper.js +5 -3
- package/es/core/tableHelper.js.map +1 -1
- package/es/core/utils/get-cell-position.js +23 -12
- package/es/core/utils/get-cell-position.js.map +1 -1
- package/es/data/DataSource.js +3 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.js +5 -1
- package/es/dataset/dataset.js.map +1 -1
- package/es/edit/edit-manager.js +22 -16
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/EventTarget.js +3 -1
- package/es/event/EventTarget.js.map +1 -1
- package/es/event/helper.js +1 -1
- package/es/event/listener/container-dom.js +10 -5
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/scroll-bar.js +75 -6
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/listener/table-group.js +53 -24
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +1 -1
- package/es/event/scroll.js +35 -12
- package/es/event/scroll.js.map +1 -1
- package/es/event/sparkline-event.js +1 -1
- package/es/event/util.d.ts +2 -0
- package/es/event/util.js +25 -1
- package/es/event/util.js.map +1 -1
- package/es/header-helper/header-helper.js +2 -2
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/header-helper/style.js +2 -1
- package/es/index.d.ts +3 -3
- package/es/index.js +5 -3
- package/es/index.js.map +1 -1
- package/es/layout/cell-range/simple-cell-range.js +14 -5
- package/es/layout/cell-range/simple-cell-range.js.map +1 -1
- package/es/plugins/index.js +1 -1
- package/es/plugins/interface.js +1 -1
- package/es/plugins/invert-highlight.js +1 -1
- package/es/plugins/list-tree-stick-cell.js +1 -1
- package/es/plugins/plugin-manager.js +1 -1
- package/es/scenegraph/component/table-component.d.ts +6 -1
- package/es/scenegraph/component/table-component.js +141 -17
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/component/util.js +5 -2
- package/es/scenegraph/component/util.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +29 -10
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +7 -4
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/init-scenegraph.js +37 -7
- package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +4 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +13 -0
- package/es/scenegraph/scenegraph.js +185 -18
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/create-select-border.js +9 -10
- package/es/scenegraph/select/create-select-border.js.map +1 -1
- package/es/scenegraph/select/delete-select-border.js.map +1 -1
- package/es/scenegraph/select/move-select-border.js.map +1 -1
- package/es/scenegraph/select/update-custom-select-border.js +9 -9
- package/es/scenegraph/select/update-custom-select-border.js.map +1 -1
- package/es/scenegraph/select/update-select-border.js +25 -118
- package/es/scenegraph/select/update-select-border.js.map +1 -1
- package/es/scenegraph/select/update-select-style.js.map +1 -1
- package/es/state/select/update-position.js +3 -0
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.d.ts +8 -1
- package/es/state/state.js +81 -40
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +15 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/dataset/aggregation.js +68 -38
- package/es/ts-types/dataset/aggregation.js.map +1 -1
- package/es/ts-types/events.d.ts +16 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +12 -11
package/es/core/BaseTable.d.ts
CHANGED
|
@@ -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;
|
package/es/core/BaseTable.js
CHANGED
|
@@ -92,9 +92,19 @@ export class BaseTable extends EventTarget {
|
|
|
92
92
|
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;
|
|
93
93
|
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0,
|
|
94
94
|
this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0,
|
|
95
|
-
this.version = "1.0.
|
|
95
|
+
this.version = "1.0.35", this.id = `VTable${Date.now()}`, this.isReleased = !1,
|
|
96
96
|
this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
97
|
-
"
|
|
97
|
+
"undefined" != typeof window) {
|
|
98
|
+
const g = window;
|
|
99
|
+
g[this.id] = this;
|
|
100
|
+
const registry = g.__vtable__ || (g.__vtable__ = {
|
|
101
|
+
byId: Object.create(null),
|
|
102
|
+
list: [],
|
|
103
|
+
last: null
|
|
104
|
+
});
|
|
105
|
+
registry.byId[this.id] = this, registry.list.push(this), registry.last = this, g.__vtable_last_id__ = this.id;
|
|
106
|
+
}
|
|
107
|
+
if ("node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container,
|
|
98
108
|
container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
99
109
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
100
110
|
options: options,
|
|
@@ -132,9 +142,13 @@ export class BaseTable extends EventTarget {
|
|
|
132
142
|
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
133
143
|
this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement,
|
|
134
144
|
internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element),
|
|
135
|
-
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")
|
|
145
|
+
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d"),
|
|
146
|
+
internalProps.canvas.__vtable__ = this, internalProps.canvas.__vtable_id__ = this.id,
|
|
147
|
+
internalProps.element && (internalProps.element.__vtable__ = this, internalProps.element.__vtable_id__ = this.id)) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
|
|
136
148
|
internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"),
|
|
137
149
|
internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"),
|
|
150
|
+
internalProps.canvas.__vtable__ = this, internalProps.canvas.__vtable_id__ = this.id,
|
|
151
|
+
internalProps.element.__vtable__ = this, internalProps.element.__vtable_id__ = this.id,
|
|
138
152
|
(null === (_e = options.customConfig) || void 0 === _e ? void 0 : _e.createReactContainer) && createReactContainer(this)),
|
|
139
153
|
internalProps.handler = new EventHandler, isNumber(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
|
|
140
154
|
internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount,
|
|
@@ -301,7 +315,7 @@ export class BaseTable extends EventTarget {
|
|
|
301
315
|
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
|
|
302
316
|
this.options.frozenColCount = frozenColCount;
|
|
303
317
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
304
|
-
if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
318
|
+
if (!this.options.scrollFrozenCols && this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
305
319
|
const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
|
|
306
320
|
this.internalProps.frozenColCount = computedFrozenColCount;
|
|
307
321
|
}
|
|
@@ -311,7 +325,7 @@ export class BaseTable extends EventTarget {
|
|
|
311
325
|
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
|
|
312
326
|
this.options.frozenColCount = frozenColCount;
|
|
313
327
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
314
|
-
if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
328
|
+
if (!this.options.scrollFrozenCols && this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
315
329
|
const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
|
|
316
330
|
this.internalProps.frozenColCount = computedFrozenColCount;
|
|
317
331
|
}
|
|
@@ -466,6 +480,11 @@ export class BaseTable extends EventTarget {
|
|
|
466
480
|
const maxFrozenWidth = null !== (_a = this.options.maxFrozenWidth) && void 0 !== _a ? _a : "80%";
|
|
467
481
|
return _toPxWidth(this, maxFrozenWidth);
|
|
468
482
|
}
|
|
483
|
+
_getMaxRightFrozenWidth() {
|
|
484
|
+
var _a, _b;
|
|
485
|
+
const maxRightFrozenWidth = null !== (_b = null !== (_a = this.options.maxRightFrozenWidth) && void 0 !== _a ? _a : this.options.maxFrozenWidth) && void 0 !== _b ? _b : "80%";
|
|
486
|
+
return _toPxWidth(this, maxRightFrozenWidth);
|
|
487
|
+
}
|
|
469
488
|
_getComputedFrozenColCount(frozenColCount) {
|
|
470
489
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
471
490
|
let computedfrozenColCount = frozenColCount;
|
|
@@ -788,22 +807,27 @@ export class BaseTable extends EventTarget {
|
|
|
788
807
|
let relativeX = !0, relativeY = !0;
|
|
789
808
|
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
790
809
|
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
791
|
-
const cellRect = this.getCellRect(col, row);
|
|
792
|
-
return this.
|
|
810
|
+
const cellRect = this.getCellRect(col, row), rect = this._toRelativeRect(cellRect, relativeX, relativeY);
|
|
811
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(col, row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
812
|
+
rect;
|
|
793
813
|
}
|
|
794
814
|
getCellRangeRelativeRect(range) {
|
|
795
815
|
if (range.start) {
|
|
796
816
|
const isFrozenCell = this.isFrozenCell(range.start.col, range.start.row);
|
|
797
817
|
let relativeX = !0, relativeY = !0;
|
|
798
|
-
|
|
799
|
-
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1)
|
|
800
|
-
this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
|
|
818
|
+
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
819
|
+
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
820
|
+
const rect = this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
|
|
821
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(range.start.col, range.start.row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
822
|
+
rect;
|
|
801
823
|
}
|
|
802
824
|
const cellRange = this.getCellRange(range.col, range.row), isFrozenCell = this.isFrozenCell(range.col, range.row);
|
|
803
825
|
let relativeX = !0, relativeY = !0;
|
|
804
|
-
|
|
805
|
-
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1)
|
|
806
|
-
this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
|
|
826
|
+
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
827
|
+
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
828
|
+
const rect = this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
|
|
829
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(range.col, range.row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
830
|
+
rect;
|
|
807
831
|
}
|
|
808
832
|
getVisibleCellRangeRelativeRect(range) {
|
|
809
833
|
let cellRange;
|
|
@@ -905,7 +929,7 @@ export class BaseTable extends EventTarget {
|
|
|
905
929
|
}
|
|
906
930
|
getVisibleRect() {
|
|
907
931
|
const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, width = this.tableNoFrameWidth, height = this.tableNoFrameHeight;
|
|
908
|
-
return new Rect(scrollLeft, scrollTop, width, height);
|
|
932
|
+
return new Rect(scrollLeft + this.getFrozenColsOffset(), scrollTop, width, height);
|
|
909
933
|
}
|
|
910
934
|
get visibleRowCount() {
|
|
911
935
|
const {frozenRowCount: frozenRowCount} = this, visibleRect = this.getVisibleRect(), visibleTop = frozenRowCount > 0 ? visibleRect.top + this.getRowsHeight(0, frozenRowCount - 1) : visibleRect.top, initRow = this.getTargetRowAt(visibleTop);
|
|
@@ -921,7 +945,7 @@ export class BaseTable extends EventTarget {
|
|
|
921
945
|
return count;
|
|
922
946
|
}
|
|
923
947
|
getBodyVisibleCellRange() {
|
|
924
|
-
const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenRowsHeight = this.getFrozenRowsHeight(),
|
|
948
|
+
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;
|
|
925
949
|
return colEnd < 0 || rowEnd < 0 ? null : {
|
|
926
950
|
rowStart: rowStart,
|
|
927
951
|
colStart: colStart,
|
|
@@ -937,14 +961,14 @@ export class BaseTable extends EventTarget {
|
|
|
937
961
|
};
|
|
938
962
|
}
|
|
939
963
|
getBodyVisibleColRange(start_deltaX = 0, end_deltaX = 0) {
|
|
940
|
-
const {scrollLeft: scrollLeft} = this,
|
|
964
|
+
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;
|
|
941
965
|
return colEnd < 0 ? null : {
|
|
942
966
|
colStart: colStart,
|
|
943
967
|
colEnd: colEnd
|
|
944
968
|
};
|
|
945
969
|
}
|
|
946
970
|
get visibleColCount() {
|
|
947
|
-
const {frozenColCount: frozenColCount} = this, visibleRect = this.getVisibleRect(), visibleLeft = frozenColCount > 0 ? visibleRect.left + this.
|
|
971
|
+
const {frozenColCount: frozenColCount} = this, visibleRect = this.getVisibleRect(), visibleLeft = frozenColCount > 0 ? visibleRect.left + this.getFrozenColsWidth() : visibleRect.left, initCol = this.getTargetColAt(visibleLeft);
|
|
948
972
|
if (!initCol) return 0;
|
|
949
973
|
const startCol = Math.max(initCol.left >= visibleLeft ? initCol.col : initCol.col + 1, frozenColCount);
|
|
950
974
|
let absoluteLeft = this.getColsWidth(0, startCol - 1), count = 0;
|
|
@@ -990,28 +1014,47 @@ export class BaseTable extends EventTarget {
|
|
|
990
1014
|
dispose() {
|
|
991
1015
|
this.release();
|
|
992
1016
|
}
|
|
1017
|
+
clearCorrectTimer() {
|
|
1018
|
+
this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null);
|
|
1019
|
+
}
|
|
993
1020
|
release() {
|
|
994
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
995
|
-
|
|
1021
|
+
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;
|
|
1022
|
+
if ("undefined" != typeof window) {
|
|
1023
|
+
const g = window;
|
|
1024
|
+
(null == g ? void 0 : g[this.id]) === this ? delete g[this.id] : (null == g ? void 0 : g[this.id]) && (g[this.id] = null);
|
|
1025
|
+
const registry = null == g ? void 0 : g.__vtable__;
|
|
1026
|
+
(null === (_a = null == registry ? void 0 : registry.byId) || void 0 === _a ? void 0 : _a[this.id]) === this && delete registry.byId[this.id];
|
|
1027
|
+
const list = null == registry ? void 0 : registry.list;
|
|
1028
|
+
if (Array.isArray(list) && list.length) for (let i = list.length - 1; i >= 0; i--) list[i] === this && list.splice(i, 1);
|
|
1029
|
+
(null == registry ? void 0 : registry.last) === this && (registry.last = Array.isArray(list) && list.length ? list[list.length - 1] : null),
|
|
1030
|
+
(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);
|
|
1031
|
+
}
|
|
996
1032
|
if (this.isReleased) return;
|
|
997
|
-
|
|
998
|
-
null === (
|
|
999
|
-
null === (
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1033
|
+
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(),
|
|
1034
|
+
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(),
|
|
1035
|
+
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();
|
|
1036
|
+
const internalProps = this.internalProps, canvas = null == internalProps ? void 0 : internalProps.canvas;
|
|
1037
|
+
(null == canvas ? void 0 : canvas.__vtable__) === this && (delete canvas.__vtable__,
|
|
1038
|
+
delete canvas.__vtable_id__);
|
|
1039
|
+
const element = null == internalProps ? void 0 : internalProps.element;
|
|
1040
|
+
(null == element ? void 0 : element.__vtable__) === this && (delete element.__vtable__,
|
|
1041
|
+
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),
|
|
1042
|
+
null === (_r = null === (_q = internalProps.menuHandler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q),
|
|
1043
|
+
null === (_s = super.release) || void 0 === _s || _s.call(this), this.pluginManager.release(),
|
|
1044
|
+
null === (_u = null === (_t = internalProps.handler) || void 0 === _t ? void 0 : _t.release) || void 0 === _u || _u.call(_t),
|
|
1045
|
+
this.eventManager.release(), null === (_w = null === (_v = internalProps.focusControl) || void 0 === _v ? void 0 : _v.release) || void 0 === _w || _w.call(_v),
|
|
1046
|
+
null === (_x = internalProps.legends) || void 0 === _x || _x.forEach((legend => {
|
|
1004
1047
|
null == legend || legend.release();
|
|
1005
|
-
})), null === (
|
|
1006
|
-
null === (
|
|
1048
|
+
})), null === (_y = internalProps.title) || void 0 === _y || _y.release(), internalProps.title = null,
|
|
1049
|
+
null === (_z = internalProps.emptyTip) || void 0 === _z || _z.release(), internalProps.emptyTip = null,
|
|
1007
1050
|
internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
1008
1051
|
var _a;
|
|
1009
1052
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
1010
1053
|
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
|
|
1011
|
-
const parentElement = null === (
|
|
1054
|
+
const parentElement = null === (_0 = internalProps.element) || void 0 === _0 ? void 0 : _0.parentElement;
|
|
1012
1055
|
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
|
|
1013
|
-
null === (
|
|
1014
|
-
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (
|
|
1056
|
+
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),
|
|
1057
|
+
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_4 = this.reactCustomLayout) || void 0 === _4 || _4.clearCache(),
|
|
1015
1058
|
clearChartRenderQueue();
|
|
1016
1059
|
}
|
|
1017
1060
|
fireListeners(type, event) {
|
|
@@ -1140,8 +1183,22 @@ export class BaseTable extends EventTarget {
|
|
|
1140
1183
|
return this.getRowsHeight(0, this.frozenRowCount - 1);
|
|
1141
1184
|
}
|
|
1142
1185
|
getFrozenColsWidth() {
|
|
1186
|
+
const contentWidth = this.getFrozenColsContentWidth();
|
|
1187
|
+
if (!this.options.scrollFrozenCols) return contentWidth;
|
|
1188
|
+
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
1189
|
+
return Math.min(contentWidth, maxFrozenWidth);
|
|
1190
|
+
}
|
|
1191
|
+
getFrozenColsContentWidth() {
|
|
1143
1192
|
return this.getColsWidth(0, this.frozenColCount - 1);
|
|
1144
1193
|
}
|
|
1194
|
+
getFrozenColsOffset() {
|
|
1195
|
+
const contentWidth = this.getFrozenColsContentWidth(), viewportWidth = this.getFrozenColsWidth();
|
|
1196
|
+
return Math.max(0, contentWidth - viewportWidth);
|
|
1197
|
+
}
|
|
1198
|
+
getFrozenColsScrollLeft() {
|
|
1199
|
+
var _a;
|
|
1200
|
+
return null !== (_a = this.stateManager.scroll.frozenHorizontalBarPos) && void 0 !== _a ? _a : 0;
|
|
1201
|
+
}
|
|
1145
1202
|
getBottomFrozenRowsHeight() {
|
|
1146
1203
|
if (this.bottomFrozenRowCount > 0) {
|
|
1147
1204
|
let height = 0;
|
|
@@ -1151,6 +1208,12 @@ export class BaseTable extends EventTarget {
|
|
|
1151
1208
|
return 0;
|
|
1152
1209
|
}
|
|
1153
1210
|
getRightFrozenColsWidth() {
|
|
1211
|
+
const contentWidth = this.getRightFrozenColsContentWidth();
|
|
1212
|
+
if (!this.options.scrollRightFrozenCols) return contentWidth;
|
|
1213
|
+
const maxRightFrozenWidth = this._getMaxRightFrozenWidth();
|
|
1214
|
+
return Math.min(contentWidth, maxRightFrozenWidth);
|
|
1215
|
+
}
|
|
1216
|
+
getRightFrozenColsContentWidth() {
|
|
1154
1217
|
if (this.rightFrozenColCount > 0) {
|
|
1155
1218
|
let width = 0;
|
|
1156
1219
|
for (let col = this.colCount - this.rightFrozenColCount; col <= this.colCount - 1; col++) width += this.getColWidth(col);
|
|
@@ -1158,6 +1221,14 @@ export class BaseTable extends EventTarget {
|
|
|
1158
1221
|
}
|
|
1159
1222
|
return 0;
|
|
1160
1223
|
}
|
|
1224
|
+
getRightFrozenColsOffset() {
|
|
1225
|
+
const contentWidth = this.getRightFrozenColsContentWidth(), viewportWidth = this.getRightFrozenColsWidth();
|
|
1226
|
+
return Math.max(0, contentWidth - viewportWidth);
|
|
1227
|
+
}
|
|
1228
|
+
getRightFrozenColsScrollLeft() {
|
|
1229
|
+
var _a;
|
|
1230
|
+
return null !== (_a = this.stateManager.scroll.rightFrozenHorizontalBarPos) && void 0 !== _a ? _a : 0;
|
|
1231
|
+
}
|
|
1161
1232
|
getDrawRange() {
|
|
1162
1233
|
var _a, _b;
|
|
1163
1234
|
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());
|
|
@@ -1308,6 +1379,31 @@ export class BaseTable extends EventTarget {
|
|
|
1308
1379
|
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, makeSelectCellVisible, !0),
|
|
1309
1380
|
this.stateManager.select.selecting = !1;
|
|
1310
1381
|
}
|
|
1382
|
+
changeHeaderPosition(args) {
|
|
1383
|
+
var _a, _b, _c, _d, _e;
|
|
1384
|
+
if (!("canMoveHeaderPosition" in this.internalProps.layoutMap) || !0 === (null === (_a = this.options.customConfig) || void 0 === _a ? void 0 : _a.notUpdateInColumnRowMove)) return !1;
|
|
1385
|
+
const prevMoving = this.stateManager.columnMove.movingColumnOrRow;
|
|
1386
|
+
this.stateManager.columnMove.movingColumnOrRow = args.movingColumnOrRow;
|
|
1387
|
+
try {
|
|
1388
|
+
if (!1 === (null === (_c = (_b = this.internalProps.layoutMap).canMoveHeaderPosition) || void 0 === _c ? void 0 : _c.call(_b, args.source, args.target))) return !1;
|
|
1389
|
+
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);
|
|
1390
|
+
if (!moveContext || moveContext.targetIndex === moveContext.sourceIndex) return !1;
|
|
1391
|
+
this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.layoutMap.clearCellRangeMap();
|
|
1392
|
+
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);
|
|
1393
|
+
let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
|
|
1394
|
+
if ("row" === moveContext.moveType && "tree" === this.internalProps.layoutMap.rowHierarchyType && (rowMax = moveContext.targetIndex > moveContext.sourceIndex ? rowMax + moveContext.targetSize - 1 : rowMax + moveContext.sourceSize - 1),
|
|
1395
|
+
this.transpose || !this.isSeriesNumberInBody(args.source.col, args.source.row) && "row" !== args.movingColumnOrRow || (this.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex),
|
|
1396
|
+
this.stateManager.changeCheckboxAndRadioOrder(moveContext.sourceIndex, moveContext.targetIndex)),
|
|
1397
|
+
"column" === moveContext.moveType) for (let col = colMin; col <= colMax; col++) this._clearColRangeWidthsMap(col); else for (let row = rowMin; row <= rowMax; row++) this._clearRowRangeHeightsMap(row);
|
|
1398
|
+
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),
|
|
1399
|
+
"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),
|
|
1400
|
+
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)),
|
|
1401
|
+
null === (_e = (_d = this.scenegraph).updateNextFrame) || void 0 === _e || _e.call(_d),
|
|
1402
|
+
!0;
|
|
1403
|
+
} finally {
|
|
1404
|
+
this.stateManager.columnMove.movingColumnOrRow = prevMoving;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1311
1407
|
get recordsCount() {
|
|
1312
1408
|
var _a;
|
|
1313
1409
|
return null === (_a = this.records) || void 0 === _a ? void 0 : _a.length;
|
|
@@ -1382,10 +1478,14 @@ export class BaseTable extends EventTarget {
|
|
|
1382
1478
|
}
|
|
1383
1479
|
getCellType(col, row) {
|
|
1384
1480
|
let cellType;
|
|
1385
|
-
|
|
1481
|
+
if (this.isSeriesNumberInHeader(col, row)) {
|
|
1482
|
+
const seriesHeaderCellType = this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
|
|
1483
|
+
return "radio" === seriesHeaderCellType ? "text" : seriesHeaderCellType;
|
|
1484
|
+
}
|
|
1485
|
+
return cellType = this.isHeader(col, row) ? this.internalProps.layoutMap.getHeader(col, row).headerType : this.internalProps.layoutMap.getBody(col, row).cellType,
|
|
1386
1486
|
getProp("cellType", {
|
|
1387
1487
|
cellType: cellType
|
|
1388
|
-
}, col, row, this)
|
|
1488
|
+
}, col, row, this);
|
|
1389
1489
|
}
|
|
1390
1490
|
getHeaderField(col, row) {
|
|
1391
1491
|
return this.internalProps.layoutMap.getHeaderField(col, row);
|
|
@@ -1459,7 +1559,7 @@ export class BaseTable extends EventTarget {
|
|
|
1459
1559
|
getCustomMerge(col, row) {
|
|
1460
1560
|
if (this.internalProps.customMergeCell) {
|
|
1461
1561
|
const customMerge = this.internalProps.customMergeCell(col, row, this);
|
|
1462
|
-
if (customMerge && customMerge.range
|
|
1562
|
+
if (customMerge && customMerge.range) {
|
|
1463
1563
|
if (customMerge.style) {
|
|
1464
1564
|
const styleClass = this.internalProps.bodyHelper.getStyleClass("text"), style = customMerge.style, fullStyle = columnStyleContents.of(style, this.theme.bodyStyle, {
|
|
1465
1565
|
col: col,
|
|
@@ -2110,17 +2210,25 @@ export class BaseTable extends EventTarget {
|
|
|
2110
2210
|
this.eventManager.enableScroll();
|
|
2111
2211
|
}
|
|
2112
2212
|
getGroupTitleLevel(col, row) {}
|
|
2213
|
+
getTargetScrollTop(row) {
|
|
2214
|
+
const drawRange = this.getDrawRange(), frozenHeight = this.getFrozenRowsHeight();
|
|
2215
|
+
return Math.max(0, Math.min(this.getRowsHeight(0, row - 1) - frozenHeight, this.getAllRowsHeight() - drawRange.height));
|
|
2216
|
+
}
|
|
2113
2217
|
_scheduleScrollToRowCorrect(row, delay = 0) {
|
|
2114
2218
|
this._scrollToRowCorrectTimer = setTimeout((() => {
|
|
2115
|
-
|
|
2116
|
-
targetScrollTop
|
|
2219
|
+
this.clearCorrectTimer();
|
|
2220
|
+
const targetScrollTop = this.getTargetScrollTop(row);
|
|
2221
|
+
if (targetScrollTop !== this.scrollTop) {
|
|
2222
|
+
this.scrollTop = targetScrollTop;
|
|
2223
|
+
const correctedTargetScrollTop = this.getTargetScrollTop(row);
|
|
2224
|
+
correctedTargetScrollTop !== this.scrollTop && (this.scrollTop = correctedTargetScrollTop);
|
|
2225
|
+
}
|
|
2117
2226
|
}), delay);
|
|
2118
2227
|
}
|
|
2119
2228
|
scrollToRow(row, animationOption) {
|
|
2120
2229
|
var _a;
|
|
2121
|
-
if (!isNumber(row) || this.rowCount <= 0) return;
|
|
2122
2230
|
const targetRow = Math.min(Math.max(Math.floor(row), 0), this.rowCount - 1);
|
|
2123
|
-
if (!animationOption) return this.scrollToCell({
|
|
2231
|
+
if (this.clearCorrectTimer(), !animationOption) return this.scrollToCell({
|
|
2124
2232
|
row: targetRow
|
|
2125
2233
|
}), void this._scheduleScrollToRowCorrect(targetRow);
|
|
2126
2234
|
const duration = isBoolean(animationOption) ? 3e3 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3;
|
|
@@ -2145,8 +2253,8 @@ export class BaseTable extends EventTarget {
|
|
|
2145
2253
|
this.scrollLeft = Math.min(left - frozenWidth, this.getAllColsWidth() - drawRange.width);
|
|
2146
2254
|
}
|
|
2147
2255
|
if (isValid(cellAddr.row) && cellAddr.row >= this.frozenRowCount) {
|
|
2148
|
-
const frozenHeight = this.getFrozenRowsHeight(), top = this.
|
|
2149
|
-
this.scrollTop = Math.min(top - frozenHeight, this.
|
|
2256
|
+
const frozenHeight = this.getFrozenRowsHeight(), top = this.rowHeightsMap.getSumInRange(0, cellAddr.row - 1);
|
|
2257
|
+
this.scrollTop = Math.min(top - frozenHeight, this.rowHeightsMap.getSumInRange(0, this.rowCount - 1) - drawRange.height);
|
|
2150
2258
|
}
|
|
2151
2259
|
this.render();
|
|
2152
2260
|
}
|