@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/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;
|
|
@@ -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/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.
|
|
95
|
+
this.version = "1.25.1-alpha.0", 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,
|
|
@@ -299,7 +313,7 @@ export class BaseTable extends EventTarget {
|
|
|
299
313
|
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
|
|
300
314
|
this.options.frozenColCount = frozenColCount;
|
|
301
315
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
302
|
-
if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
316
|
+
if (!this.options.scrollFrozenCols && this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
303
317
|
const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
|
|
304
318
|
this.internalProps.frozenColCount = computedFrozenColCount;
|
|
305
319
|
}
|
|
@@ -309,7 +323,7 @@ export class BaseTable extends EventTarget {
|
|
|
309
323
|
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
|
|
310
324
|
this.options.frozenColCount = frozenColCount;
|
|
311
325
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
312
|
-
if (this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
326
|
+
if (!this.options.scrollFrozenCols && this.getColsWidth(0, frozenColCount - 1) > maxFrozenWidth) if (this.internalProps.unfreezeAllOnExceedsMaxWidth) this.internalProps.frozenColCount = 0; else {
|
|
313
327
|
const computedFrozenColCount = this._getComputedFrozenColCount(frozenColCount);
|
|
314
328
|
this.internalProps.frozenColCount = computedFrozenColCount;
|
|
315
329
|
}
|
|
@@ -464,6 +478,11 @@ export class BaseTable extends EventTarget {
|
|
|
464
478
|
const maxFrozenWidth = null !== (_a = this.options.maxFrozenWidth) && void 0 !== _a ? _a : "80%";
|
|
465
479
|
return _toPxWidth(this, maxFrozenWidth);
|
|
466
480
|
}
|
|
481
|
+
_getMaxRightFrozenWidth() {
|
|
482
|
+
var _a, _b;
|
|
483
|
+
const maxRightFrozenWidth = null !== (_b = null !== (_a = this.options.maxRightFrozenWidth) && void 0 !== _a ? _a : this.options.maxFrozenWidth) && void 0 !== _b ? _b : "80%";
|
|
484
|
+
return _toPxWidth(this, maxRightFrozenWidth);
|
|
485
|
+
}
|
|
467
486
|
_getComputedFrozenColCount(frozenColCount) {
|
|
468
487
|
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
469
488
|
let computedfrozenColCount = frozenColCount;
|
|
@@ -786,22 +805,27 @@ export class BaseTable extends EventTarget {
|
|
|
786
805
|
let relativeX = !0, relativeY = !0;
|
|
787
806
|
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
788
807
|
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
789
|
-
const cellRect = this.getCellRect(col, row);
|
|
790
|
-
return this.
|
|
808
|
+
const cellRect = this.getCellRect(col, row), rect = this._toRelativeRect(cellRect, relativeX, relativeY);
|
|
809
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(col, row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
810
|
+
rect;
|
|
791
811
|
}
|
|
792
812
|
getCellRangeRelativeRect(range) {
|
|
793
813
|
if (range.start) {
|
|
794
814
|
const isFrozenCell = this.isFrozenCell(range.start.col, range.start.row);
|
|
795
815
|
let relativeX = !0, relativeY = !0;
|
|
796
|
-
|
|
797
|
-
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1)
|
|
798
|
-
this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
|
|
816
|
+
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
817
|
+
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
818
|
+
const rect = this._toRelativeRect(this.getCellsRect(range.start.col, range.start.row, range.end.col, range.end.row), relativeX, relativeY);
|
|
819
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(range.start.col, range.start.row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
820
|
+
rect;
|
|
799
821
|
}
|
|
800
822
|
const cellRange = this.getCellRange(range.col, range.row), isFrozenCell = this.isFrozenCell(range.col, range.row);
|
|
801
823
|
let relativeX = !0, relativeY = !0;
|
|
802
|
-
|
|
803
|
-
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1)
|
|
804
|
-
this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
|
|
824
|
+
(null == isFrozenCell ? void 0 : isFrozenCell.col) && (null == isFrozenCell ? void 0 : isFrozenCell.row) ? (relativeX = !1,
|
|
825
|
+
relativeY = !1) : (null == isFrozenCell ? void 0 : isFrozenCell.col) ? relativeX = !1 : (null == isFrozenCell ? void 0 : isFrozenCell.row) && (relativeY = !1);
|
|
826
|
+
const rect = this._toRelativeRect(this.getCellsRect(cellRange.start.col, cellRange.start.row, cellRange.end.col, cellRange.end.row), relativeX, relativeY);
|
|
827
|
+
return (null == isFrozenCell ? void 0 : isFrozenCell.col) && !this.isRightFrozenColumn(range.col, range.row) && rect.offsetLeft(-this.getFrozenColsScrollLeft()),
|
|
828
|
+
rect;
|
|
805
829
|
}
|
|
806
830
|
getVisibleCellRangeRelativeRect(range) {
|
|
807
831
|
let cellRange;
|
|
@@ -903,7 +927,7 @@ export class BaseTable extends EventTarget {
|
|
|
903
927
|
}
|
|
904
928
|
getVisibleRect() {
|
|
905
929
|
const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, width = this.tableNoFrameWidth, height = this.tableNoFrameHeight;
|
|
906
|
-
return new Rect(scrollLeft, scrollTop, width, height);
|
|
930
|
+
return new Rect(scrollLeft + this.getFrozenColsOffset(), scrollTop, width, height);
|
|
907
931
|
}
|
|
908
932
|
get visibleRowCount() {
|
|
909
933
|
const {frozenRowCount: frozenRowCount} = this, visibleRect = this.getVisibleRect(), visibleTop = frozenRowCount > 0 ? visibleRect.top + this.getRowsHeight(0, frozenRowCount - 1) : visibleRect.top, initRow = this.getTargetRowAt(visibleTop);
|
|
@@ -919,7 +943,7 @@ export class BaseTable extends EventTarget {
|
|
|
919
943
|
return count;
|
|
920
944
|
}
|
|
921
945
|
getBodyVisibleCellRange() {
|
|
922
|
-
const {scrollTop: scrollTop, scrollLeft: scrollLeft} = this, frozenRowsHeight = this.getFrozenRowsHeight(),
|
|
946
|
+
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;
|
|
923
947
|
return colEnd < 0 || rowEnd < 0 ? null : {
|
|
924
948
|
rowStart: rowStart,
|
|
925
949
|
colStart: colStart,
|
|
@@ -935,14 +959,14 @@ export class BaseTable extends EventTarget {
|
|
|
935
959
|
};
|
|
936
960
|
}
|
|
937
961
|
getBodyVisibleColRange(start_deltaX = 0, end_deltaX = 0) {
|
|
938
|
-
const {scrollLeft: scrollLeft} = this,
|
|
962
|
+
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;
|
|
939
963
|
return colEnd < 0 ? null : {
|
|
940
964
|
colStart: colStart,
|
|
941
965
|
colEnd: colEnd
|
|
942
966
|
};
|
|
943
967
|
}
|
|
944
968
|
get visibleColCount() {
|
|
945
|
-
const {frozenColCount: frozenColCount} = this, visibleRect = this.getVisibleRect(), visibleLeft = frozenColCount > 0 ? visibleRect.left + this.
|
|
969
|
+
const {frozenColCount: frozenColCount} = this, visibleRect = this.getVisibleRect(), visibleLeft = frozenColCount > 0 ? visibleRect.left + this.getFrozenColsWidth() : visibleRect.left, initCol = this.getTargetColAt(visibleLeft);
|
|
946
970
|
if (!initCol) return 0;
|
|
947
971
|
const startCol = Math.max(initCol.left >= visibleLeft ? initCol.col : initCol.col + 1, frozenColCount);
|
|
948
972
|
let absoluteLeft = this.getColsWidth(0, startCol - 1), count = 0;
|
|
@@ -992,29 +1016,43 @@ export class BaseTable extends EventTarget {
|
|
|
992
1016
|
this._scrollToRowCorrectTimer && (clearTimeout(this._scrollToRowCorrectTimer), this._scrollToRowCorrectTimer = null);
|
|
993
1017
|
}
|
|
994
1018
|
release() {
|
|
995
|
-
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;
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1019
|
+
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;
|
|
1020
|
+
if ("undefined" != typeof window) {
|
|
1021
|
+
const g = window;
|
|
1022
|
+
(null == g ? void 0 : g[this.id]) === this ? delete g[this.id] : (null == g ? void 0 : g[this.id]) && (g[this.id] = null);
|
|
1023
|
+
const registry = null == g ? void 0 : g.__vtable__;
|
|
1024
|
+
(null === (_a = null == registry ? void 0 : registry.byId) || void 0 === _a ? void 0 : _a[this.id]) === this && delete registry.byId[this.id];
|
|
1025
|
+
const list = null == registry ? void 0 : registry.list;
|
|
1026
|
+
if (Array.isArray(list) && list.length) for (let i = list.length - 1; i >= 0; i--) list[i] === this && list.splice(i, 1);
|
|
1027
|
+
(null == registry ? void 0 : registry.last) === this && (registry.last = Array.isArray(list) && list.length ? list[list.length - 1] : null),
|
|
1028
|
+
(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);
|
|
1029
|
+
}
|
|
1000
1030
|
if (this.isReleased) return;
|
|
1001
|
-
|
|
1002
|
-
null === (
|
|
1003
|
-
null === (
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1031
|
+
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(),
|
|
1032
|
+
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(),
|
|
1033
|
+
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();
|
|
1034
|
+
const internalProps = this.internalProps, canvas = null == internalProps ? void 0 : internalProps.canvas;
|
|
1035
|
+
(null == canvas ? void 0 : canvas.__vtable__) === this && (delete canvas.__vtable__,
|
|
1036
|
+
delete canvas.__vtable_id__);
|
|
1037
|
+
const element = null == internalProps ? void 0 : internalProps.element;
|
|
1038
|
+
(null == element ? void 0 : element.__vtable__) === this && (delete element.__vtable__,
|
|
1039
|
+
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),
|
|
1040
|
+
null === (_r = null === (_q = internalProps.menuHandler) || void 0 === _q ? void 0 : _q.release) || void 0 === _r || _r.call(_q),
|
|
1041
|
+
null === (_s = super.release) || void 0 === _s || _s.call(this), this.pluginManager.release(),
|
|
1042
|
+
null === (_u = null === (_t = internalProps.handler) || void 0 === _t ? void 0 : _t.release) || void 0 === _u || _u.call(_t),
|
|
1043
|
+
this.eventManager.release(), null === (_w = null === (_v = internalProps.focusControl) || void 0 === _v ? void 0 : _v.release) || void 0 === _w || _w.call(_v),
|
|
1044
|
+
null === (_x = internalProps.legends) || void 0 === _x || _x.forEach((legend => {
|
|
1007
1045
|
null == legend || legend.release();
|
|
1008
|
-
})), null === (
|
|
1009
|
-
null === (
|
|
1046
|
+
})), null === (_y = internalProps.title) || void 0 === _y || _y.release(), internalProps.title = null,
|
|
1047
|
+
null === (_z = internalProps.emptyTip) || void 0 === _z || _z.release(), internalProps.emptyTip = null,
|
|
1010
1048
|
internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
1011
1049
|
var _a;
|
|
1012
1050
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
1013
1051
|
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
|
|
1014
|
-
const parentElement = null === (
|
|
1052
|
+
const parentElement = null === (_0 = internalProps.element) || void 0 === _0 ? void 0 : _0.parentElement;
|
|
1015
1053
|
parentElement && !this.options.canvas && parentElement.removeChild(internalProps.element),
|
|
1016
|
-
null === (
|
|
1017
|
-
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (
|
|
1054
|
+
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),
|
|
1055
|
+
this.isReleased = !0, this.scenegraph = null, this.internalProps = null, null === (_4 = this.reactCustomLayout) || void 0 === _4 || _4.clearCache(),
|
|
1018
1056
|
clearChartRenderQueue();
|
|
1019
1057
|
}
|
|
1020
1058
|
fireListeners(type, event) {
|
|
@@ -1143,8 +1181,22 @@ export class BaseTable extends EventTarget {
|
|
|
1143
1181
|
return this.getRowsHeight(0, this.frozenRowCount - 1);
|
|
1144
1182
|
}
|
|
1145
1183
|
getFrozenColsWidth() {
|
|
1184
|
+
const contentWidth = this.getFrozenColsContentWidth();
|
|
1185
|
+
if (!this.options.scrollFrozenCols) return contentWidth;
|
|
1186
|
+
const maxFrozenWidth = this._getMaxFrozenWidth();
|
|
1187
|
+
return Math.min(contentWidth, maxFrozenWidth);
|
|
1188
|
+
}
|
|
1189
|
+
getFrozenColsContentWidth() {
|
|
1146
1190
|
return this.getColsWidth(0, this.frozenColCount - 1);
|
|
1147
1191
|
}
|
|
1192
|
+
getFrozenColsOffset() {
|
|
1193
|
+
const contentWidth = this.getFrozenColsContentWidth(), viewportWidth = this.getFrozenColsWidth();
|
|
1194
|
+
return Math.max(0, contentWidth - viewportWidth);
|
|
1195
|
+
}
|
|
1196
|
+
getFrozenColsScrollLeft() {
|
|
1197
|
+
var _a;
|
|
1198
|
+
return null !== (_a = this.stateManager.scroll.frozenHorizontalBarPos) && void 0 !== _a ? _a : 0;
|
|
1199
|
+
}
|
|
1148
1200
|
getBottomFrozenRowsHeight() {
|
|
1149
1201
|
if (this.bottomFrozenRowCount > 0) {
|
|
1150
1202
|
let height = 0;
|
|
@@ -1154,6 +1206,12 @@ export class BaseTable extends EventTarget {
|
|
|
1154
1206
|
return 0;
|
|
1155
1207
|
}
|
|
1156
1208
|
getRightFrozenColsWidth() {
|
|
1209
|
+
const contentWidth = this.getRightFrozenColsContentWidth();
|
|
1210
|
+
if (!this.options.scrollRightFrozenCols) return contentWidth;
|
|
1211
|
+
const maxRightFrozenWidth = this._getMaxRightFrozenWidth();
|
|
1212
|
+
return Math.min(contentWidth, maxRightFrozenWidth);
|
|
1213
|
+
}
|
|
1214
|
+
getRightFrozenColsContentWidth() {
|
|
1157
1215
|
if (this.rightFrozenColCount > 0) {
|
|
1158
1216
|
let width = 0;
|
|
1159
1217
|
for (let col = this.colCount - this.rightFrozenColCount; col <= this.colCount - 1; col++) width += this.getColWidth(col);
|
|
@@ -1161,6 +1219,14 @@ export class BaseTable extends EventTarget {
|
|
|
1161
1219
|
}
|
|
1162
1220
|
return 0;
|
|
1163
1221
|
}
|
|
1222
|
+
getRightFrozenColsOffset() {
|
|
1223
|
+
const contentWidth = this.getRightFrozenColsContentWidth(), viewportWidth = this.getRightFrozenColsWidth();
|
|
1224
|
+
return Math.max(0, contentWidth - viewportWidth);
|
|
1225
|
+
}
|
|
1226
|
+
getRightFrozenColsScrollLeft() {
|
|
1227
|
+
var _a;
|
|
1228
|
+
return null !== (_a = this.stateManager.scroll.rightFrozenHorizontalBarPos) && void 0 !== _a ? _a : 0;
|
|
1229
|
+
}
|
|
1164
1230
|
getDrawRange() {
|
|
1165
1231
|
var _a, _b;
|
|
1166
1232
|
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());
|