k-vtable 1.0.33 → 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 +16 -0
- package/cjs/core/BaseTable.js +167 -45
- 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 +8 -4
- 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 +2460 -747
- 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 +16 -0
- package/es/core/BaseTable.js +166 -44
- 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 +8 -4
- 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/cjs/core/BaseTable.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { PluginManager } from '../plugins/plugin-manager';
|
|
|
27
27
|
export declare abstract class BaseTable extends EventTarget implements BaseTableAPI {
|
|
28
28
|
internalProps: IBaseTableProtected;
|
|
29
29
|
showFrozenIcon: boolean;
|
|
30
|
+
_scrollToRowCorrectTimer: ReturnType<typeof setTimeout> | null;
|
|
30
31
|
padding: {
|
|
31
32
|
top: number;
|
|
32
33
|
left: number;
|
|
@@ -163,6 +164,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
163
164
|
set heightAdaptiveMode(heightAdaptiveMode: HeightAdaptiveModeDef);
|
|
164
165
|
_colWidthDefineToPxWidth(width: string | number): number;
|
|
165
166
|
_getMaxFrozenWidth(): number;
|
|
167
|
+
_getMaxRightFrozenWidth(): number;
|
|
166
168
|
_getComputedFrozenColCount(frozenColCount: number): number;
|
|
167
169
|
private _getColWidthLimits;
|
|
168
170
|
_adjustColWidth(col: number, orgWidth: number): number;
|
|
@@ -264,6 +266,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
264
266
|
release: () => void;
|
|
265
267
|
}): void;
|
|
266
268
|
private dispose;
|
|
269
|
+
clearCorrectTimer(): void;
|
|
267
270
|
release(): void;
|
|
268
271
|
fireListeners<TYPE extends keyof TableEventHandlersEventArgumentMap>(type: TYPE, event: TableEventHandlersEventArgumentMap[TYPE]): TableEventHandlersReturnMap[TYPE][];
|
|
269
272
|
updateOption(options: BaseTableConstructorOptions, updateConfig?: {
|
|
@@ -273,8 +276,14 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
273
276
|
renderWithRecreateCells(): void;
|
|
274
277
|
getFrozenRowsHeight(): number;
|
|
275
278
|
getFrozenColsWidth(): number;
|
|
279
|
+
getFrozenColsContentWidth(): number;
|
|
280
|
+
getFrozenColsOffset(): number;
|
|
281
|
+
getFrozenColsScrollLeft(): number;
|
|
276
282
|
getBottomFrozenRowsHeight(): number;
|
|
277
283
|
getRightFrozenColsWidth(): number;
|
|
284
|
+
getRightFrozenColsContentWidth(): number;
|
|
285
|
+
getRightFrozenColsOffset(): number;
|
|
286
|
+
getRightFrozenColsScrollLeft(): number;
|
|
278
287
|
getDrawRange(): Rect;
|
|
279
288
|
_getMouseAbstractPoint(evt: TouchEvent | MouseEvent | undefined): {
|
|
280
289
|
x: number;
|
|
@@ -296,6 +305,11 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
296
305
|
endDragSelect(): void;
|
|
297
306
|
startDragSelectRow(rowIndex: number, enableCtrlSelectMode?: boolean, isShift?: boolean, makeSelectCellVisible?: boolean): void;
|
|
298
307
|
dragSelectRow(rowIndex: number, isCtrl?: boolean, makeSelectCellVisible?: boolean): void;
|
|
308
|
+
changeHeaderPosition(args: {
|
|
309
|
+
source: CellAddress;
|
|
310
|
+
target: CellAddress;
|
|
311
|
+
movingColumnOrRow?: 'column' | 'row';
|
|
312
|
+
}): boolean;
|
|
299
313
|
abstract isListTable(): boolean;
|
|
300
314
|
abstract isPivotTable(): boolean;
|
|
301
315
|
abstract isPivotChart(): boolean;
|
|
@@ -457,6 +471,8 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
457
471
|
disableScroll(): void;
|
|
458
472
|
enableScroll(): void;
|
|
459
473
|
getGroupTitleLevel(col: number, row: number): number | undefined;
|
|
474
|
+
getTargetScrollTop(row: number): number;
|
|
475
|
+
private _scheduleScrollToRowCorrect;
|
|
460
476
|
scrollToRow(row: number, animationOption?: ITableAnimationOption | boolean): void;
|
|
461
477
|
scrollToCol(col: number, animationOption?: ITableAnimationOption | boolean): void;
|
|
462
478
|
scrollToCell(cellAddr: {
|
package/cjs/core/BaseTable.js
CHANGED
|
@@ -43,12 +43,22 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
43
43
|
}
|
|
44
44
|
constructor(container, options = {}) {
|
|
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
|
-
if (super(), this.showFrozenIcon = !0, this.
|
|
47
|
-
this.
|
|
48
|
-
this.id = `VTable${Date.now()}`, this.isReleased = !1,
|
|
49
|
-
this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0,
|
|
47
|
+
this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0,
|
|
48
|
+
this.version = "1.0.35", this.id = `VTable${Date.now()}`, this.isReleased = !1,
|
|
49
|
+
this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
|
|
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,
|
|
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,
|
|
54
64
|
container: container
|
|
@@ -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")
|
|
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"),
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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(),
|
|
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,
|
|
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.
|
|
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,27 +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
|
-
|
|
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
|
-
null === (
|
|
956
|
-
null === (
|
|
957
|
-
null === (
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
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 => {
|
|
961
1005
|
null == legend || legend.release();
|
|
962
|
-
})), null === (
|
|
963
|
-
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,
|
|
964
1008
|
internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
965
1009
|
var _a;
|
|
966
1010
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
967
1011
|
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
|
|
968
|
-
const parentElement = null === (
|
|
1012
|
+
const parentElement = null === (_0 = internalProps.element) || void 0 === _0 ? void 0 : _0.parentElement;
|
|
969
1013
|
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
|
|
970
|
-
null === (
|
|
971
|
-
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (
|
|
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(),
|
|
972
1016
|
(0, chart_render_helper_1.clearChartRenderQueue)();
|
|
973
1017
|
}
|
|
974
1018
|
fireListeners(type, event) {
|
|
@@ -1098,8 +1142,22 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1098
1142
|
return this.getRowsHeight(0, this.frozenRowCount - 1);
|
|
1099
1143
|
}
|
|
1100
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() {
|
|
1101
1151
|
return this.getColsWidth(0, this.frozenColCount - 1);
|
|
1102
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
|
+
}
|
|
1103
1161
|
getBottomFrozenRowsHeight() {
|
|
1104
1162
|
if (this.bottomFrozenRowCount > 0) {
|
|
1105
1163
|
let height = 0;
|
|
@@ -1109,6 +1167,12 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1109
1167
|
return 0;
|
|
1110
1168
|
}
|
|
1111
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() {
|
|
1112
1176
|
if (this.rightFrozenColCount > 0) {
|
|
1113
1177
|
let width = 0;
|
|
1114
1178
|
for (let col = this.colCount - this.rightFrozenColCount; col <= this.colCount - 1; col++) width += this.getColWidth(col);
|
|
@@ -1116,6 +1180,14 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1116
1180
|
}
|
|
1117
1181
|
return 0;
|
|
1118
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
|
+
}
|
|
1119
1191
|
getDrawRange() {
|
|
1120
1192
|
var _a, _b;
|
|
1121
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());
|
|
@@ -1266,6 +1338,31 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1266
1338
|
lastSelectRange && (lastSelectRange.end.row = rowIndex), this.stateManager.updateSelectPos(this.colCount - 1, rowIndex, !1, isCtrl, !1, makeSelectCellVisible, !0),
|
|
1267
1339
|
this.stateManager.select.selecting = !1;
|
|
1268
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
|
+
}
|
|
1269
1366
|
get recordsCount() {
|
|
1270
1367
|
var _a;
|
|
1271
1368
|
return null === (_a = this.records) || void 0 === _a ? void 0 : _a.length;
|
|
@@ -1341,10 +1438,14 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1341
1438
|
}
|
|
1342
1439
|
getCellType(col, row) {
|
|
1343
1440
|
let cellType;
|
|
1344
|
-
|
|
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,
|
|
1345
1446
|
(0, get_prop_1.getProp)("cellType", {
|
|
1346
1447
|
cellType: cellType
|
|
1347
|
-
}, col, row, this)
|
|
1448
|
+
}, col, row, this);
|
|
1348
1449
|
}
|
|
1349
1450
|
getHeaderField(col, row) {
|
|
1350
1451
|
return this.internalProps.layoutMap.getHeaderField(col, row);
|
|
@@ -1418,7 +1519,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1418
1519
|
getCustomMerge(col, row) {
|
|
1419
1520
|
if (this.internalProps.customMergeCell) {
|
|
1420
1521
|
const customMerge = this.internalProps.customMergeCell(col, row, this);
|
|
1421
|
-
if (customMerge && customMerge.range
|
|
1522
|
+
if (customMerge && customMerge.range) {
|
|
1422
1523
|
if (customMerge.style) {
|
|
1423
1524
|
const styleClass = this.internalProps.bodyHelper.getStyleClass("text"), style = customMerge.style, fullStyle = columnStyleContents.of(style, this.theme.bodyStyle, {
|
|
1424
1525
|
col: col,
|
|
@@ -2074,12 +2175,33 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
2074
2175
|
this.eventManager.enableScroll();
|
|
2075
2176
|
}
|
|
2076
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
|
+
}
|
|
2182
|
+
_scheduleScrollToRowCorrect(row, delay = 0) {
|
|
2183
|
+
this._scrollToRowCorrectTimer = setTimeout((() => {
|
|
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
|
+
}
|
|
2191
|
+
}), delay);
|
|
2192
|
+
}
|
|
2077
2193
|
scrollToRow(row, animationOption) {
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
row:
|
|
2082
|
-
});
|
|
2194
|
+
var _a;
|
|
2195
|
+
const targetRow = Math.min(Math.max(Math.floor(row), 0), this.rowCount - 1);
|
|
2196
|
+
if (this.clearCorrectTimer(), !animationOption) return this.scrollToCell({
|
|
2197
|
+
row: targetRow
|
|
2198
|
+
}), void this._scheduleScrollToRowCorrect(targetRow);
|
|
2199
|
+
const duration = (0, vutils_1.isBoolean)(animationOption) ? 3e3 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3;
|
|
2200
|
+
this.animationManager.scrollTo({
|
|
2201
|
+
row: targetRow
|
|
2202
|
+
}, animationOption), this._scrollToRowCorrectTimer = setTimeout((() => {
|
|
2203
|
+
this.scrollToRow(targetRow, !1);
|
|
2204
|
+
}), duration);
|
|
2083
2205
|
}
|
|
2084
2206
|
scrollToCol(col, animationOption) {
|
|
2085
2207
|
animationOption ? this.animationManager.scrollTo({
|
|
@@ -2096,8 +2218,8 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
2096
2218
|
this.scrollLeft = Math.min(left - frozenWidth, this.getAllColsWidth() - drawRange.width);
|
|
2097
2219
|
}
|
|
2098
2220
|
if ((0, vutils_1.isValid)(cellAddr.row) && cellAddr.row >= this.frozenRowCount) {
|
|
2099
|
-
const frozenHeight = this.getFrozenRowsHeight(), top = this.
|
|
2100
|
-
this.scrollTop = Math.min(top - frozenHeight, this.
|
|
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);
|
|
2101
2223
|
}
|
|
2102
2224
|
this.render();
|
|
2103
2225
|
}
|