@visactor/vtable 1.24.0 → 1.25.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/core/BaseTable.d.ts +7 -0
- package/cjs/core/BaseTable.js +100 -34
- package/cjs/core/BaseTable.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/event/listener/container-dom.js +7 -5
- 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 +29 -20
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/scroll.js +34 -11
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/event/util.d.ts +2 -0
- package/cjs/event/util.js +28 -3
- package/cjs/event/util.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/component/table-component.d.ts +6 -1
- package/cjs/scenegraph/component/table-component.js +143 -16
- 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/init-scenegraph.js +36 -6
- 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 +14 -73
- 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/state.d.ts +7 -1
- package/cjs/state/state.js +61 -28
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +10 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +1148 -327
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.d.ts +7 -0
- package/es/core/BaseTable.js +99 -33
- package/es/core/BaseTable.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/event/listener/container-dom.js +7 -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 +29 -21
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/scroll.js +34 -11
- package/es/event/scroll.js.map +1 -1
- package/es/event/util.d.ts +2 -0
- package/es/event/util.js +24 -0
- package/es/event/util.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/component/table-component.d.ts +6 -1
- package/es/scenegraph/component/table-component.js +141 -16
- 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/init-scenegraph.js +36 -6
- 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 +14 -73
- 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/state.d.ts +7 -1
- package/es/state/state.js +61 -28
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +10 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +9 -9
package/cjs/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;
|
|
@@ -275,8 +276,14 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
|
|
|
275
276
|
renderWithRecreateCells(): void;
|
|
276
277
|
getFrozenRowsHeight(): number;
|
|
277
278
|
getFrozenColsWidth(): number;
|
|
279
|
+
getFrozenColsContentWidth(): number;
|
|
280
|
+
getFrozenColsOffset(): number;
|
|
281
|
+
getFrozenColsScrollLeft(): number;
|
|
278
282
|
getBottomFrozenRowsHeight(): number;
|
|
279
283
|
getRightFrozenColsWidth(): number;
|
|
284
|
+
getRightFrozenColsContentWidth(): number;
|
|
285
|
+
getRightFrozenColsOffset(): number;
|
|
286
|
+
getRightFrozenColsScrollLeft(): number;
|
|
280
287
|
getDrawRange(): Rect;
|
|
281
288
|
_getMouseAbstractPoint(evt: TouchEvent | MouseEvent | undefined): {
|
|
282
289
|
x: number;
|
package/cjs/core/BaseTable.js
CHANGED
|
@@ -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.
|
|
48
|
+
this.version = "1.25.1-alpha.0", this.id = `VTable${Date.now()}`, this.isReleased = !1,
|
|
49
49
|
this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
|
|
50
|
-
"
|
|
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")
|
|
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,
|
|
@@ -255,7 +269,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
255
269
|
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
|
|
256
270
|
this.options.frozenColCount = frozenColCount;
|
|
257
271
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
258
|
-
if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
272
|
+
if (!this.options.scrollFrozenCols && this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
259
273
|
const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
|
|
260
274
|
this.internalProps.frozenColCount = computedFrozenColCount;
|
|
261
275
|
}
|
|
@@ -265,7 +279,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
265
279
|
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
|
|
266
280
|
this.options.frozenColCount = frozenColCount;
|
|
267
281
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
268
|
-
if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
282
|
+
if (!this.options.scrollFrozenCols && this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
269
283
|
const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
|
|
270
284
|
this.internalProps.frozenColCount = computedFrozenColCount;
|
|
271
285
|
}
|
|
@@ -420,6 +434,11 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
420
434
|
const maxFrozenWidth = null !== (_a = this.options.maxFrozenWidth) && void 0 !== _a ? _a : "80%";
|
|
421
435
|
return (0, tableHelper_1._toPxWidth)(this, maxFrozenWidth);
|
|
422
436
|
}
|
|
437
|
+
_getMaxRightFrozenWidth() {
|
|
438
|
+
var _a, _b;
|
|
439
|
+
const maxRightFrozenWidth = null !== (_b = null !== (_a = this.options.maxRightFrozenWidth) && void 0 !== _a ? _a : this.options.maxFrozenWidth) && void 0 !== _b ? _b : "80%";
|
|
440
|
+
return (0, tableHelper_1._toPxWidth)(this, maxRightFrozenWidth);
|
|
441
|
+
}
|
|
423
442
|
_getComputedFrozenColCount(frozenColCount) {
|
|
424
443
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
425
444
|
let computedfrozenColCount = frozenColCount;
|
|
@@ -744,22 +763,27 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
744
763
|
let relativeX = !0, relativeY = !0;
|
|
745
764
|
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
746
765
|
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
747
|
-
const cellRect = this.getCellRect(col, row);
|
|
748
|
-
return this.
|
|
766
|
+
const cellRect = this.getCellRect(col, row), rect = this._toRelativeRect(cellRect, relativeX, relativeY);
|
|
767
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(col, row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
768
|
+
rect;
|
|
749
769
|
}
|
|
750
770
|
getCellRangeRelativeRect(range) {
|
|
751
771
|
if (range.start) {
|
|
752
772
|
const isFrozenCell = this.isFrozenCell(range.start.col, range.start.row);
|
|
753
773
|
let relativeX = !0, relativeY = !0;
|
|
754
|
-
|
|
755
|
-
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1)
|
|
756
|
-
this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
|
|
774
|
+
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
775
|
+
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
776
|
+
const rect = this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
|
|
777
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(range.start.col, range.start.row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
778
|
+
rect;
|
|
757
779
|
}
|
|
758
780
|
const cellRange = this.getCellRange(range.col, range.row), isFrozenCell = this.isFrozenCell(range.col, range.row);
|
|
759
781
|
let relativeX = !0, relativeY = !0;
|
|
760
|
-
|
|
761
|
-
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1)
|
|
762
|
-
this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
|
|
782
|
+
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
783
|
+
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
784
|
+
const rect = this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
|
|
785
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(range.col, range.row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
786
|
+
rect;
|
|
763
787
|
}
|
|
764
788
|
getVisibleCellRangeRelativeRect(range) {
|
|
765
789
|
let cellRange;
|
|
@@ -861,7 +885,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
861
885
|
}
|
|
862
886
|
getVisibleRect() {
|
|
863
887
|
const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, width = this.tableNoFrameWidth, height = this.tableNoFrameHeight;
|
|
864
|
-
return new Rect_1.Rect(scrollLeft, scrollTop, width, height);
|
|
888
|
+
return new Rect_1.Rect(scrollLeft + this.getFrozenColsOffset(), scrollTop, width, height);
|
|
865
889
|
}
|
|
866
890
|
get visibleRowCount() {
|
|
867
891
|
const {frozenRowCount: frozenRowCount} = this, visibleRect = this.getVisibleRect(), visibleTop = frozenRowCount > 0 ? visibleRect.top + this.getRowsHeight(0, frozenRowCount - 1) : visibleRect.top, initRow = this.getTargetRowAt(visibleTop);
|
|
@@ -877,7 +901,7 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
877
901
|
return count;
|
|
878
902
|
}
|
|
879
903
|
getBodyVisibleCellRange() {
|
|
880
|
-
const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenRowsHeight = this.getFrozenRowsHeight(),
|
|
904
|
+
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;
|
|
881
905
|
return colEnd < 0 || rowEnd < 0 ? null : {
|
|
882
906
|
rowStart: rowStart,
|
|
883
907
|
colStart: colStart,
|
|
@@ -893,14 +917,14 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
893
917
|
};
|
|
894
918
|
}
|
|
895
919
|
getBodyVisibleColRange(start_deltaX = 0, end_deltaX = 0) {
|
|
896
|
-
const {scrollLeft: scrollLeft} = this,
|
|
920
|
+
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;
|
|
897
921
|
return colEnd < 0 ? null : {
|
|
898
922
|
colStart: colStart,
|
|
899
923
|
colEnd: colEnd
|
|
900
924
|
};
|
|
901
925
|
}
|
|
902
926
|
get visibleColCount() {
|
|
903
|
-
const {frozenColCount: frozenColCount} = this, visibleRect = this.getVisibleRect(), visibleLeft = frozenColCount > 0 ? visibleRect.left + this.
|
|
927
|
+
const {frozenColCount: frozenColCount} = this, visibleRect = this.getVisibleRect(), visibleLeft = frozenColCount > 0 ? visibleRect.left + this.getFrozenColsWidth() : visibleRect.left, initCol = this.getTargetColAt(visibleLeft);
|
|
904
928
|
if (!initCol) return 0;
|
|
905
929
|
const startCol = Math.max(initCol.left >= visibleLeft ? initCol.col : initCol.col + 1, frozenColCount);
|
|
906
930
|
let absoluteLeft = this.getColsWidth(0, startCol - 1), count = 0;
|
|
@@ -950,29 +974,43 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
950
974
|
this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null);
|
|
951
975
|
}
|
|
952
976
|
release() {
|
|
953
|
-
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;
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
977
|
+
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;
|
|
978
|
+
if ("undefined" != typeof window) {
|
|
979
|
+
const g = window;
|
|
980
|
+
(null == g ? void 0 : g[this.id]) === this ? delete g[this.id] : (null == g ? void 0 : g[this.id]) && (g[this.id] = null);
|
|
981
|
+
const registry = null == g ? void 0 : g.__vtable__;
|
|
982
|
+
(null === (_a = null == registry ? void 0 : registry.byId) || void 0 === _a ? void 0 : _a[this.id]) === this && delete registry.byId[this.id];
|
|
983
|
+
const list = null == registry ? void 0 : registry.list;
|
|
984
|
+
if (Array.isArray(list) && list.length) for (let i = list.length - 1; i >= 0; i--) list[i] === this && list.splice(i, 1);
|
|
985
|
+
(null == registry ? void 0 : registry.last) === this && (registry.last = Array.isArray(list) && list.length ? list[list.length - 1] : null),
|
|
986
|
+
(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);
|
|
987
|
+
}
|
|
958
988
|
if (this.isReleased) return;
|
|
959
|
-
|
|
960
|
-
null === (
|
|
961
|
-
null === (
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
989
|
+
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(),
|
|
990
|
+
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(),
|
|
991
|
+
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();
|
|
992
|
+
const internalProps = this.internalProps, canvas = null == internalProps ? void 0 : internalProps.canvas;
|
|
993
|
+
(null == canvas ? void 0 : canvas.__vtable__) === this && (delete canvas.__vtable__,
|
|
994
|
+
delete canvas.__vtable_id__);
|
|
995
|
+
const element = null == internalProps ? void 0 : internalProps.element;
|
|
996
|
+
(null == element ? void 0 : element.__vtable__) === this && (delete element.__vtable__,
|
|
997
|
+
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),
|
|
998
|
+
null === (_r = null === (_q = internalProps.menuHandler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q),
|
|
999
|
+
null === (_s = super.release) || void 0 === _s || _s.call(this), this.pluginManager.release(),
|
|
1000
|
+
null === (_u = null === (_t = internalProps.handler) || void 0 === _t ? void 0 : _t.release) || void 0 === _u || _u.call(_t),
|
|
1001
|
+
this.eventManager.release(), null === (_w = null === (_v = internalProps.focusControl) || void 0 === _v ? void 0 : _v.release) || void 0 === _w || _w.call(_v),
|
|
1002
|
+
null === (_x = internalProps.legends) || void 0 === _x || _x.forEach((legend => {
|
|
965
1003
|
null == legend || legend.release();
|
|
966
|
-
})), null === (
|
|
967
|
-
null === (
|
|
1004
|
+
})), null === (_y = internalProps.title) || void 0 === _y || _y.release(), internalProps.title = null,
|
|
1005
|
+
null === (_z = internalProps.emptyTip) || void 0 === _z || _z.release(), internalProps.emptyTip = null,
|
|
968
1006
|
internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
969
1007
|
var _a;
|
|
970
1008
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
971
1009
|
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
|
|
972
|
-
const parentElement = null === (
|
|
1010
|
+
const parentElement = null === (_0 = internalProps.element) || void 0 === _0 ? void 0 : _0.parentElement;
|
|
973
1011
|
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
|
|
974
|
-
null === (
|
|
975
|
-
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (
|
|
1012
|
+
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),
|
|
1013
|
+
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_4 = this.reactCustomLayout) || void 0 === _4 || _4.clearCache(),
|
|
976
1014
|
(0, chart_render_helper_1.clearChartRenderQueue)();
|
|
977
1015
|
}
|
|
978
1016
|
fireListeners(type, event) {
|
|
@@ -1102,8 +1140,22 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1102
1140
|
return this.getRowsHeight(0, this.frozenRowCount - 1);
|
|
1103
1141
|
}
|
|
1104
1142
|
getFrozenColsWidth() {
|
|
1143
|
+
const contentWidth = this.getFrozenColsContentWidth();
|
|
1144
|
+
if (!this.options.scrollFrozenCols) return contentWidth;
|
|
1145
|
+
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
1146
|
+
return Math.min(contentWidth, maxFrozenWidth);
|
|
1147
|
+
}
|
|
1148
|
+
getFrozenColsContentWidth() {
|
|
1105
1149
|
return this.getColsWidth(0, this.frozenColCount - 1);
|
|
1106
1150
|
}
|
|
1151
|
+
getFrozenColsOffset() {
|
|
1152
|
+
const contentWidth = this.getFrozenColsContentWidth(), viewportWidth = this.getFrozenColsWidth();
|
|
1153
|
+
return Math.max(0, contentWidth - viewportWidth);
|
|
1154
|
+
}
|
|
1155
|
+
getFrozenColsScrollLeft() {
|
|
1156
|
+
var _a;
|
|
1157
|
+
return null !== (_a = this.stateManager.scroll.frozenHorizontalBarPos) && void 0 !== _a ? _a : 0;
|
|
1158
|
+
}
|
|
1107
1159
|
getBottomFrozenRowsHeight() {
|
|
1108
1160
|
if (this.bottomFrozenRowCount > 0) {
|
|
1109
1161
|
let height = 0;
|
|
@@ -1113,6 +1165,12 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1113
1165
|
return 0;
|
|
1114
1166
|
}
|
|
1115
1167
|
getRightFrozenColsWidth() {
|
|
1168
|
+
const contentWidth = this.getRightFrozenColsContentWidth();
|
|
1169
|
+
if (!this.options.scrollRightFrozenCols) return contentWidth;
|
|
1170
|
+
const maxRightFrozenWidth = this._getMaxRightFrozenWidth();
|
|
1171
|
+
return Math.min(contentWidth, maxRightFrozenWidth);
|
|
1172
|
+
}
|
|
1173
|
+
getRightFrozenColsContentWidth() {
|
|
1116
1174
|
if (this.rightFrozenColCount > 0) {
|
|
1117
1175
|
let width = 0;
|
|
1118
1176
|
for (let col = this.colCount - this.rightFrozenColCount; col <= this.colCount - 1; col++) width += this.getColWidth(col);
|
|
@@ -1120,6 +1178,14 @@ class BaseTable extends EventTarget_1.EventTarget {
|
|
|
1120
1178
|
}
|
|
1121
1179
|
return 0;
|
|
1122
1180
|
}
|
|
1181
|
+
getRightFrozenColsOffset() {
|
|
1182
|
+
const contentWidth = this.getRightFrozenColsContentWidth(), viewportWidth = this.getRightFrozenColsWidth();
|
|
1183
|
+
return Math.max(0, contentWidth - viewportWidth);
|
|
1184
|
+
}
|
|
1185
|
+
getRightFrozenColsScrollLeft() {
|
|
1186
|
+
var _a;
|
|
1187
|
+
return null !== (_a = this.stateManager.scroll.rightFrozenHorizontalBarPos) && void 0 !== _a ? _a : 0;
|
|
1188
|
+
}
|
|
1123
1189
|
getDrawRange() {
|
|
1124
1190
|
var _a, _b;
|
|
1125
1191
|
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());
|