k-vtable 1.0.35 → 1.0.37
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 +11 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.js +12 -6
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.js +11 -9
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/event.js +3 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/helper.js +1 -1
- package/cjs/event/listener/container-dom.js +39 -26
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +53 -52
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +1 -1
- package/cjs/event/scroll.js +1 -1
- package/cjs/event/sparkline-event.js +1 -1
- package/cjs/event/util.js +1 -1
- package/cjs/header-helper/header-helper.js +2 -1
- package/cjs/header-helper/style.js +1 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +2 -2
- package/cjs/layout/simple-header-layout.js +7 -7
- package/cjs/layout/simple-header-layout.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 +30 -4
- package/cjs/plugins/list-tree-stick-cell.js.map +1 -1
- package/cjs/plugins/plugin-manager.js +1 -1
- package/cjs/scenegraph/component/custom.js +2 -2
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +41 -50
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/component/util.d.ts +1 -0
- package/cjs/scenegraph/component/util.js +9 -3
- package/cjs/scenegraph/component/util.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.d.ts +2 -0
- package/cjs/scenegraph/group-creater/progress/proxy.js +18 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +2 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +7 -3
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +3 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +12 -6
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/padding.d.ts +5 -2
- package/cjs/scenegraph/utils/padding.js +16 -13
- package/cjs/scenegraph/utils/padding.js.map +1 -1
- package/cjs/state/select/update-position.js +2 -2
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.js +15 -15
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +2 -2
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +347 -155
- package/dist/vtable.min.js +1 -1
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +11 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.js +12 -6
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.js +11 -9
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/event.js +3 -1
- package/es/event/event.js.map +1 -1
- package/es/event/helper.js +1 -1
- package/es/event/listener/container-dom.js +39 -26
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +53 -52
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +1 -1
- package/es/event/scroll.js +1 -1
- package/es/event/sparkline-event.js +1 -1
- package/es/event/util.js +1 -1
- package/es/header-helper/header-helper.js +2 -1
- package/es/header-helper/style.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +2 -2
- package/es/layout/simple-header-layout.js +7 -7
- package/es/layout/simple-header-layout.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 +33 -3
- package/es/plugins/list-tree-stick-cell.js.map +1 -1
- package/es/plugins/plugin-manager.js +1 -1
- package/es/scenegraph/component/custom.js +2 -2
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/component/table-component.js +41 -51
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/component/util.d.ts +1 -0
- package/es/scenegraph/component/util.js +6 -0
- package/es/scenegraph/component/util.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.d.ts +2 -0
- package/es/scenegraph/group-creater/progress/proxy.js +18 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +2 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +2 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +1 -1
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +7 -3
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +4 -0
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/scenegraph.js +12 -6
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/padding.d.ts +5 -2
- package/es/scenegraph/utils/padding.js +13 -9
- package/es/scenegraph/utils/padding.js.map +1 -1
- package/es/state/select/update-position.js +2 -2
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.js +15 -13
- package/es/state/state.js.map +1 -1
- package/es/ts-types/icon.d.ts +2 -2
- package/es/ts-types/icon.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +2 -2
package/dist/vtable.js
CHANGED
|
@@ -41970,26 +41970,53 @@
|
|
|
41970
41970
|
return parse$2(font);
|
|
41971
41971
|
}
|
|
41972
41972
|
|
|
41973
|
-
function
|
|
41974
|
-
if (
|
|
41975
|
-
|
|
41976
|
-
|
|
41977
|
-
|
|
41978
|
-
|
|
41979
|
-
|
|
41980
|
-
|
|
41981
|
-
|
|
41982
|
-
|
|
41973
|
+
function normalizeQuadArray(values) {
|
|
41974
|
+
if (values.length === 0) {
|
|
41975
|
+
return [0, 0, 0, 0];
|
|
41976
|
+
}
|
|
41977
|
+
if (values.length === 1) {
|
|
41978
|
+
return [values[0], values[0], values[0], values[0]];
|
|
41979
|
+
}
|
|
41980
|
+
if (values.length === 2) {
|
|
41981
|
+
return [values[0], values[1], values[0], values[1]];
|
|
41982
|
+
}
|
|
41983
|
+
if (values.length === 3) {
|
|
41984
|
+
return [values[0], values[1], values[2], values[1]];
|
|
41983
41985
|
}
|
|
41984
|
-
|
|
41985
|
-
|
|
41986
|
-
|
|
41987
|
-
|
|
41988
|
-
|
|
41986
|
+
return [values[0], values[1], values[2], values[3]];
|
|
41987
|
+
}
|
|
41988
|
+
function parseStringQuad(padding) {
|
|
41989
|
+
const tokens = padding.trim().split(/\s+/);
|
|
41990
|
+
const values = tokens.map(token => Number.parseFloat(token)).filter(value => Number.isFinite(value));
|
|
41991
|
+
if (values.length === tokens.length && values.length > 0) {
|
|
41992
|
+
return normalizeQuadArray(values);
|
|
41993
|
+
}
|
|
41994
|
+
return [padding, padding, padding, padding];
|
|
41995
|
+
}
|
|
41996
|
+
function normalizePaddingObject(paddingOrigin) {
|
|
41997
|
+
if (Number.isFinite(paddingOrigin.bottom) ||
|
|
41998
|
+
Number.isFinite(paddingOrigin.left) ||
|
|
41999
|
+
Number.isFinite(paddingOrigin.right) ||
|
|
42000
|
+
Number.isFinite(paddingOrigin.top)) {
|
|
41989
42001
|
return [paddingOrigin.top ?? 0, paddingOrigin.right ?? 0, paddingOrigin.bottom ?? 0, paddingOrigin.left ?? 0];
|
|
41990
42002
|
}
|
|
41991
42003
|
return [0, 0, 0, 0];
|
|
41992
42004
|
}
|
|
42005
|
+
function getQuadProps(paddingOrigin) {
|
|
42006
|
+
if (Array.isArray(paddingOrigin)) {
|
|
42007
|
+
return normalizeQuadArray(paddingOrigin.slice(0, 4));
|
|
42008
|
+
}
|
|
42009
|
+
if (typeof paddingOrigin === 'number' && Number.isFinite(paddingOrigin)) {
|
|
42010
|
+
return [paddingOrigin, paddingOrigin, paddingOrigin, paddingOrigin];
|
|
42011
|
+
}
|
|
42012
|
+
if (typeof paddingOrigin === 'string') {
|
|
42013
|
+
return parseStringQuad(paddingOrigin);
|
|
42014
|
+
}
|
|
42015
|
+
if (paddingOrigin && typeof paddingOrigin === 'object') {
|
|
42016
|
+
return normalizePaddingObject(paddingOrigin);
|
|
42017
|
+
}
|
|
42018
|
+
return [0, 0, 0, 0];
|
|
42019
|
+
}
|
|
41993
42020
|
|
|
41994
42021
|
const TYPE_PAREN = 0;
|
|
41995
42022
|
const TYPE_UNIT = 1;
|
|
@@ -43511,7 +43538,7 @@
|
|
|
43511
43538
|
col: range?.start.col ?? col,
|
|
43512
43539
|
row: range?.start.row ?? row,
|
|
43513
43540
|
dataValue: table.getCellOriginValue(col, row),
|
|
43514
|
-
value: table.getCellValue(col, row)
|
|
43541
|
+
value: table.getCellValue(col, row),
|
|
43515
43542
|
rect: {
|
|
43516
43543
|
left: 0,
|
|
43517
43544
|
top: 0,
|
|
@@ -43547,7 +43574,7 @@
|
|
|
43547
43574
|
col,
|
|
43548
43575
|
row,
|
|
43549
43576
|
dataValue: table.getCellOriginValue(col, row),
|
|
43550
|
-
value: table.getCellValue(col, row)
|
|
43577
|
+
value: table.getCellValue(col, row),
|
|
43551
43578
|
rect: {
|
|
43552
43579
|
left: 0,
|
|
43553
43580
|
top: 0,
|
|
@@ -46990,7 +47017,7 @@
|
|
|
46990
47017
|
col: cellRange?.start.col ?? col,
|
|
46991
47018
|
row: cellRange?.start.row ?? row,
|
|
46992
47019
|
dataValue: table.getCellOriginValue(col, row),
|
|
46993
|
-
value: table.getCellValue(col, row)
|
|
47020
|
+
value: table.getCellValue(col, row),
|
|
46994
47021
|
rect: getCellRect$1(col, row, table),
|
|
46995
47022
|
table,
|
|
46996
47023
|
originCol: col,
|
|
@@ -47259,6 +47286,10 @@
|
|
|
47259
47286
|
if (cell.role === 'empty') {
|
|
47260
47287
|
continue;
|
|
47261
47288
|
}
|
|
47289
|
+
const mergeInfo = getCellMergeInfo(scene.table, col, row);
|
|
47290
|
+
if (mergeInfo && mergeInfo.start.col !== col) {
|
|
47291
|
+
continue;
|
|
47292
|
+
}
|
|
47262
47293
|
const height = cell.attribute.height;
|
|
47263
47294
|
updateCellHeightForRow(scene, cell, col, row, height + detaY, detaY, scene.table.isHeader(col, row));
|
|
47264
47295
|
scene.updateCellContentWhileResize(col, row);
|
|
@@ -48344,6 +48375,16 @@
|
|
|
48344
48375
|
}
|
|
48345
48376
|
}
|
|
48346
48377
|
|
|
48378
|
+
function getBodyHorizontalScrollRange(table) {
|
|
48379
|
+
const totalWidth = table.getAllColsWidth();
|
|
48380
|
+
const frozenColsWidth = table.getFrozenColsWidth();
|
|
48381
|
+
const rightFrozenColsWidth = table.getRightFrozenColsWidth();
|
|
48382
|
+
const frozenColsContentWidth = table.getFrozenColsContentWidth?.() ?? frozenColsWidth;
|
|
48383
|
+
const rightFrozenColsContentWidth = table.getRightFrozenColsContentWidth?.() ?? rightFrozenColsWidth;
|
|
48384
|
+
const bodyViewportWidth = table.tableNoFrameWidth - frozenColsWidth - rightFrozenColsWidth;
|
|
48385
|
+
const bodyContentWidth = totalWidth - frozenColsContentWidth - rightFrozenColsContentWidth;
|
|
48386
|
+
return Math.max(0, bodyContentWidth - bodyViewportWidth);
|
|
48387
|
+
}
|
|
48347
48388
|
function getColX(col, table, isRightFrozen) {
|
|
48348
48389
|
if (isRightFrozen) {
|
|
48349
48390
|
return (Math.min(table.tableNoFrameWidth, table.getAllColsWidth()) -
|
|
@@ -48748,24 +48789,25 @@
|
|
|
48748
48789
|
const rightFrozenColsContentWidth = this.table.getRightFrozenColsContentWidth?.() ?? rightFrozenColsWidth;
|
|
48749
48790
|
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
48750
48791
|
const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
48751
|
-
|
|
48752
|
-
|
|
48792
|
+
const bodyScrollRange = getBodyHorizontalScrollRange(this.table);
|
|
48793
|
+
const y = Math.min(tableHeight, totalHeight);
|
|
48794
|
+
let attrY = 0;
|
|
48795
|
+
if (this.table.theme.scrollStyle.barToSide) {
|
|
48796
|
+
attrY =
|
|
48797
|
+
this.table.tableNoFrameHeight -
|
|
48798
|
+
(hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) +
|
|
48799
|
+
this.table.tableY;
|
|
48800
|
+
}
|
|
48801
|
+
else {
|
|
48802
|
+
attrY = y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
|
|
48803
|
+
}
|
|
48804
|
+
const ignoreFrozenCols = this.table.theme.scrollStyle?.ignoreFrozenCols ?? false;
|
|
48805
|
+
if (bodyScrollRange > sizeTolerance) {
|
|
48753
48806
|
const bodyViewportWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
|
|
48754
|
-
const bodyContentWidth =
|
|
48807
|
+
const bodyContentWidth = bodyViewportWidth + bodyScrollRange;
|
|
48755
48808
|
const rangeEnd = bodyContentWidth > 0 ? Math.max(0.05, bodyViewportWidth / bodyContentWidth) : 1;
|
|
48756
|
-
let attrY = 0;
|
|
48757
|
-
if (this.table.theme.scrollStyle.barToSide) {
|
|
48758
|
-
attrY =
|
|
48759
|
-
this.table.tableNoFrameHeight -
|
|
48760
|
-
(hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) +
|
|
48761
|
-
this.table.tableY;
|
|
48762
|
-
}
|
|
48763
|
-
else {
|
|
48764
|
-
attrY = y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
|
|
48765
|
-
}
|
|
48766
48809
|
let hScrollBarx = frozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0);
|
|
48767
48810
|
let hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
|
|
48768
|
-
const ignoreFrozenCols = this.table.theme.scrollStyle?.ignoreFrozenCols ?? false;
|
|
48769
48811
|
if (ignoreFrozenCols) {
|
|
48770
48812
|
hScrollBarx = !hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0;
|
|
48771
48813
|
hScrollBarWidth = tableWidth;
|
|
@@ -48789,62 +48831,6 @@
|
|
|
48789
48831
|
if (horizontalVisible === 'always') {
|
|
48790
48832
|
this.hScrollBar.showAll();
|
|
48791
48833
|
}
|
|
48792
|
-
const frozenScrollable = this.table.options.scrollFrozenCols && this.table.getFrozenColsOffset() > 0;
|
|
48793
|
-
if (!ignoreFrozenCols && frozenScrollable) {
|
|
48794
|
-
const frozenRangeEnd = Math.max(0.05, frozenColsWidth / frozenColsContentWidth);
|
|
48795
|
-
const x = !hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0;
|
|
48796
|
-
this.frozenHScrollBar.setAttributes({
|
|
48797
|
-
x,
|
|
48798
|
-
y: attrY,
|
|
48799
|
-
width: frozenColsWidth,
|
|
48800
|
-
range: [0, frozenRangeEnd],
|
|
48801
|
-
visible: horizontalVisible === 'always'
|
|
48802
|
-
});
|
|
48803
|
-
const bounds = this.frozenHScrollBar.AABBBounds && this.frozenHScrollBar.globalAABBBounds;
|
|
48804
|
-
this.frozenHScrollBar._viewPosition = {
|
|
48805
|
-
x: bounds.x1,
|
|
48806
|
-
y: bounds.y1
|
|
48807
|
-
};
|
|
48808
|
-
if (horizontalVisible === 'always') {
|
|
48809
|
-
this.frozenHScrollBar.showAll();
|
|
48810
|
-
}
|
|
48811
|
-
}
|
|
48812
|
-
else {
|
|
48813
|
-
this.frozenHScrollBar.setAttributes({
|
|
48814
|
-
x: -this.table.tableNoFrameWidth * 2,
|
|
48815
|
-
y: -this.table.tableNoFrameHeight * 2,
|
|
48816
|
-
width: 0,
|
|
48817
|
-
visible: false
|
|
48818
|
-
});
|
|
48819
|
-
}
|
|
48820
|
-
const rightFrozenScrollable = this.table.options.scrollRightFrozenCols && this.table.getRightFrozenColsOffset() > 0;
|
|
48821
|
-
if (!ignoreFrozenCols && rightFrozenScrollable) {
|
|
48822
|
-
const rightFrozenRangeEnd = Math.max(0.05, rightFrozenColsWidth / rightFrozenColsContentWidth);
|
|
48823
|
-
const x = tableWidth - rightFrozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0);
|
|
48824
|
-
this.rightFrozenHScrollBar.setAttributes({
|
|
48825
|
-
x,
|
|
48826
|
-
y: attrY,
|
|
48827
|
-
width: rightFrozenColsWidth,
|
|
48828
|
-
range: [0, rightFrozenRangeEnd],
|
|
48829
|
-
visible: horizontalVisible === 'always'
|
|
48830
|
-
});
|
|
48831
|
-
const bounds = this.rightFrozenHScrollBar.AABBBounds && this.rightFrozenHScrollBar.globalAABBBounds;
|
|
48832
|
-
this.rightFrozenHScrollBar._viewPosition = {
|
|
48833
|
-
x: bounds.x1,
|
|
48834
|
-
y: bounds.y1
|
|
48835
|
-
};
|
|
48836
|
-
if (horizontalVisible === 'always') {
|
|
48837
|
-
this.rightFrozenHScrollBar.showAll();
|
|
48838
|
-
}
|
|
48839
|
-
}
|
|
48840
|
-
else {
|
|
48841
|
-
this.rightFrozenHScrollBar.setAttributes({
|
|
48842
|
-
x: -this.table.tableNoFrameWidth * 2,
|
|
48843
|
-
y: -this.table.tableNoFrameHeight * 2,
|
|
48844
|
-
width: 0,
|
|
48845
|
-
visible: false
|
|
48846
|
-
});
|
|
48847
|
-
}
|
|
48848
48834
|
}
|
|
48849
48835
|
else {
|
|
48850
48836
|
this.hScrollBar.setAttributes({
|
|
@@ -48853,12 +48839,56 @@
|
|
|
48853
48839
|
width: 0,
|
|
48854
48840
|
visible: false
|
|
48855
48841
|
});
|
|
48842
|
+
}
|
|
48843
|
+
const frozenScrollable = this.table.options.scrollFrozenCols && this.table.getFrozenColsOffset() > 0;
|
|
48844
|
+
if (!ignoreFrozenCols && frozenScrollable) {
|
|
48845
|
+
const frozenRangeEnd = Math.max(0.05, frozenColsWidth / frozenColsContentWidth);
|
|
48846
|
+
const x = !hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0;
|
|
48847
|
+
this.frozenHScrollBar.setAttributes({
|
|
48848
|
+
x,
|
|
48849
|
+
y: attrY,
|
|
48850
|
+
width: frozenColsWidth,
|
|
48851
|
+
range: [0, frozenRangeEnd],
|
|
48852
|
+
visible: horizontalVisible === 'always'
|
|
48853
|
+
});
|
|
48854
|
+
const bounds = this.frozenHScrollBar.AABBBounds && this.frozenHScrollBar.globalAABBBounds;
|
|
48855
|
+
this.frozenHScrollBar._viewPosition = {
|
|
48856
|
+
x: bounds.x1,
|
|
48857
|
+
y: bounds.y1
|
|
48858
|
+
};
|
|
48859
|
+
if (horizontalVisible === 'always') {
|
|
48860
|
+
this.frozenHScrollBar.showAll();
|
|
48861
|
+
}
|
|
48862
|
+
}
|
|
48863
|
+
else {
|
|
48856
48864
|
this.frozenHScrollBar.setAttributes({
|
|
48857
48865
|
x: -this.table.tableNoFrameWidth * 2,
|
|
48858
48866
|
y: -this.table.tableNoFrameHeight * 2,
|
|
48859
48867
|
width: 0,
|
|
48860
48868
|
visible: false
|
|
48861
48869
|
});
|
|
48870
|
+
}
|
|
48871
|
+
const rightFrozenScrollable = this.table.options.scrollRightFrozenCols && this.table.getRightFrozenColsOffset() > 0;
|
|
48872
|
+
if (!ignoreFrozenCols && rightFrozenScrollable) {
|
|
48873
|
+
const rightFrozenRangeEnd = Math.max(0.05, rightFrozenColsWidth / rightFrozenColsContentWidth);
|
|
48874
|
+
const x = tableWidth - rightFrozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0);
|
|
48875
|
+
this.rightFrozenHScrollBar.setAttributes({
|
|
48876
|
+
x,
|
|
48877
|
+
y: attrY,
|
|
48878
|
+
width: rightFrozenColsWidth,
|
|
48879
|
+
range: [0, rightFrozenRangeEnd],
|
|
48880
|
+
visible: horizontalVisible === 'always'
|
|
48881
|
+
});
|
|
48882
|
+
const bounds = this.rightFrozenHScrollBar.AABBBounds && this.rightFrozenHScrollBar.globalAABBBounds;
|
|
48883
|
+
this.rightFrozenHScrollBar._viewPosition = {
|
|
48884
|
+
x: bounds.x1,
|
|
48885
|
+
y: bounds.y1
|
|
48886
|
+
};
|
|
48887
|
+
if (horizontalVisible === 'always') {
|
|
48888
|
+
this.rightFrozenHScrollBar.showAll();
|
|
48889
|
+
}
|
|
48890
|
+
}
|
|
48891
|
+
else {
|
|
48862
48892
|
this.rightFrozenHScrollBar.setAttributes({
|
|
48863
48893
|
x: -this.table.tableNoFrameWidth * 2,
|
|
48864
48894
|
y: -this.table.tableNoFrameHeight * 2,
|
|
@@ -53744,7 +53774,7 @@
|
|
|
53744
53774
|
col: cellRange?.start.col ?? col,
|
|
53745
53775
|
row: cellRange?.start.row ?? row,
|
|
53746
53776
|
dataValue: table.getCellOriginValue(col, row),
|
|
53747
|
-
value: table.getCellValue(col, row)
|
|
53777
|
+
value: table.getCellValue(col, row),
|
|
53748
53778
|
rect: getCellRect(col, row, table),
|
|
53749
53779
|
table,
|
|
53750
53780
|
originCol: col,
|
|
@@ -54590,6 +54620,9 @@
|
|
|
54590
54620
|
|
|
54591
54621
|
async function dynamicSetX(x, screenLeft, isEnd, proxy) {
|
|
54592
54622
|
if (!screenLeft) {
|
|
54623
|
+
proxy.updateDeltaX(x);
|
|
54624
|
+
proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
|
|
54625
|
+
proxy.table.scenegraph.updateNextFrame();
|
|
54593
54626
|
return;
|
|
54594
54627
|
}
|
|
54595
54628
|
const screenLeftCol = screenLeft.col;
|
|
@@ -54900,6 +54933,9 @@
|
|
|
54900
54933
|
|
|
54901
54934
|
async function dynamicSetY(y, screenTop, isEnd, proxy) {
|
|
54902
54935
|
if (!screenTop) {
|
|
54936
|
+
proxy.updateDeltaY(y);
|
|
54937
|
+
proxy.updateBody(y - proxy.deltaY);
|
|
54938
|
+
proxy.table.scenegraph.updateNextFrame();
|
|
54903
54939
|
return;
|
|
54904
54940
|
}
|
|
54905
54941
|
const screenTopRow = screenTop.row;
|
|
@@ -55818,7 +55854,7 @@
|
|
|
55818
55854
|
async setY(y, isEnd = false) {
|
|
55819
55855
|
const yLimitTop = this.table.getRowsHeight(this.bodyTopRow, this.bodyTopRow + (this.rowEnd - this.rowStart + 1)) / 2;
|
|
55820
55856
|
const yLimitBottom = this.table.getAllRowsHeight() - yLimitTop;
|
|
55821
|
-
const screenTop = this.
|
|
55857
|
+
const screenTop = this.resolveTargetRowInfo(y + this.table.scenegraph.colHeaderGroup.attribute.height);
|
|
55822
55858
|
if (screenTop) {
|
|
55823
55859
|
this.screenTopRow = screenTop.row;
|
|
55824
55860
|
}
|
|
@@ -55846,7 +55882,7 @@
|
|
|
55846
55882
|
async setX(x, isEnd = false) {
|
|
55847
55883
|
const xLimitLeft = this.table.getColsWidth(this.bodyLeftCol, this.bodyLeftCol + (this.colEnd - this.colStart + 1)) / 2;
|
|
55848
55884
|
const xLimitRight = this.table.getAllColsWidth() - xLimitLeft;
|
|
55849
|
-
const screenLeft = this.
|
|
55885
|
+
const screenLeft = this.resolveTargetColInfo(x + this.table.scenegraph.rowHeaderGroup.attribute.width + (this.table.getFrozenColsOffset?.() ?? 0));
|
|
55850
55886
|
if (screenLeft) {
|
|
55851
55887
|
this.screenLeftCol = screenLeft.col;
|
|
55852
55888
|
}
|
|
@@ -55874,6 +55910,26 @@
|
|
|
55874
55910
|
async dynamicSetX(x, screenLeft, isEnd = false) {
|
|
55875
55911
|
dynamicSetX(x, screenLeft, isEnd, this);
|
|
55876
55912
|
}
|
|
55913
|
+
resolveTargetColInfo(absoluteX) {
|
|
55914
|
+
const offsets = [0, -1, 1, -2, 2];
|
|
55915
|
+
for (let i = 0; i < offsets.length; i++) {
|
|
55916
|
+
const screenLeft = this.table.getTargetColAt(absoluteX + offsets[i]);
|
|
55917
|
+
if (screenLeft) {
|
|
55918
|
+
return screenLeft;
|
|
55919
|
+
}
|
|
55920
|
+
}
|
|
55921
|
+
return null;
|
|
55922
|
+
}
|
|
55923
|
+
resolveTargetRowInfo(absoluteY) {
|
|
55924
|
+
const offsets = [0, -1, 1, -2, 2];
|
|
55925
|
+
for (let i = 0; i < offsets.length; i++) {
|
|
55926
|
+
const screenTop = this.table.getTargetRowAt(absoluteY + offsets[i]);
|
|
55927
|
+
if (screenTop) {
|
|
55928
|
+
return screenTop;
|
|
55929
|
+
}
|
|
55930
|
+
}
|
|
55931
|
+
return null;
|
|
55932
|
+
}
|
|
55877
55933
|
updateBody(y) {
|
|
55878
55934
|
this.table.scenegraph.setBodyAndRowHeaderY(-y);
|
|
55879
55935
|
}
|
|
@@ -57504,7 +57560,9 @@
|
|
|
57504
57560
|
const headerColGroup = scene.getColGroup(col, true);
|
|
57505
57561
|
insertBefore(rightTopCornerGroup, headerColGroup, rightTopCornerGroup.firstChild);
|
|
57506
57562
|
const bottomColGroup = scene.getColGroupInBottom(col);
|
|
57507
|
-
|
|
57563
|
+
if (bottomColGroup) {
|
|
57564
|
+
insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild);
|
|
57565
|
+
}
|
|
57508
57566
|
}
|
|
57509
57567
|
let x = 0;
|
|
57510
57568
|
rightFrozenGroup.forEachChildren((columnGroup) => {
|
|
@@ -57531,9 +57589,11 @@
|
|
|
57531
57589
|
headerColGroup?.setAttribute('x', colHeaderGroup.lastChild.attribute.x + table.getColWidth(colHeaderGroup.lastChild.col));
|
|
57532
57590
|
colHeaderGroup?.appendChild(headerColGroup);
|
|
57533
57591
|
const bottomColGroup = scene.getColGroupInRightBottomCorner(col);
|
|
57534
|
-
bottomColGroup
|
|
57535
|
-
|
|
57536
|
-
|
|
57592
|
+
if (bottomColGroup) {
|
|
57593
|
+
const lastBottomColGroup = bottomFrozenGroup.lastChild;
|
|
57594
|
+
bottomColGroup.setAttribute('x', lastBottomColGroup ? lastBottomColGroup.attribute.x + table.getColWidth(lastBottomColGroup.col) : 0);
|
|
57595
|
+
bottomFrozenGroup.appendChild(bottomColGroup);
|
|
57596
|
+
}
|
|
57537
57597
|
}
|
|
57538
57598
|
let x = 0;
|
|
57539
57599
|
rightFrozenGroup.forEachChildren((columnGroup) => {
|
|
@@ -60022,8 +60082,13 @@
|
|
|
60022
60082
|
this.table.scenegraph.proxy.setY(-y, isEnd);
|
|
60023
60083
|
}
|
|
60024
60084
|
setBodyAndRowHeaderY(y) {
|
|
60025
|
-
const
|
|
60026
|
-
const
|
|
60085
|
+
const firstBodyColGroup = this.bodyGroup.firstChild;
|
|
60086
|
+
const firstRowHeaderColGroup = this.rowHeaderGroup.firstChild;
|
|
60087
|
+
const firstBodyCell = firstBodyColGroup?.firstChild ?? firstRowHeaderColGroup?.firstChild;
|
|
60088
|
+
let lastBodyCell = (firstBodyColGroup?.lastChild ?? firstRowHeaderColGroup?.lastChild);
|
|
60089
|
+
if (lastBodyCell && lastBodyCell.type !== 'group') {
|
|
60090
|
+
lastBodyCell = lastBodyCell._prev;
|
|
60091
|
+
}
|
|
60027
60092
|
if (y === 0 &&
|
|
60028
60093
|
firstBodyCell &&
|
|
60029
60094
|
firstBodyCell.row === this.table.frozenRowCount &&
|
|
@@ -60067,7 +60132,10 @@
|
|
|
60067
60132
|
}
|
|
60068
60133
|
setBodyAndColHeaderX(x) {
|
|
60069
60134
|
const firstBodyCol = this.bodyGroup.firstChild;
|
|
60070
|
-
|
|
60135
|
+
let lastBodyCol = this.bodyGroup.lastChild;
|
|
60136
|
+
if (lastBodyCol && lastBodyCol.type !== 'group') {
|
|
60137
|
+
lastBodyCol = lastBodyCol._prev;
|
|
60138
|
+
}
|
|
60071
60139
|
if (x === 0 && firstBodyCol && firstBodyCol.col === this.table.frozenColCount && firstBodyCol.attribute.x + x < 0) {
|
|
60072
60140
|
x = -firstBodyCol.attribute.x;
|
|
60073
60141
|
}
|
|
@@ -60083,6 +60151,9 @@
|
|
|
60083
60151
|
lastBodyCol.attribute.x -
|
|
60084
60152
|
lastBodyCol.attribute.width;
|
|
60085
60153
|
}
|
|
60154
|
+
if (this.table.options.scrollFrozenCols && x > 0) {
|
|
60155
|
+
x = 0;
|
|
60156
|
+
}
|
|
60086
60157
|
if (this.table.getFrozenColsWidth() + x === this.bodyGroup.attribute.x) {
|
|
60087
60158
|
return;
|
|
60088
60159
|
}
|
|
@@ -60198,11 +60269,17 @@
|
|
|
60198
60269
|
this.rowHeaderGroup.forEachChildrenSkipChild((column) => {
|
|
60199
60270
|
rowHeaderWidth += column.attribute.width;
|
|
60200
60271
|
});
|
|
60272
|
+
if (table.options.scrollFrozenCols) {
|
|
60273
|
+
rowHeaderWidth = table.getFrozenColsWidth();
|
|
60274
|
+
}
|
|
60201
60275
|
this.rowHeaderGroup.setAttribute('width', rowHeaderWidth);
|
|
60202
60276
|
let cornerHeaderWidth = 0;
|
|
60203
60277
|
this.cornerHeaderGroup.forEachChildrenSkipChild((column) => {
|
|
60204
60278
|
cornerHeaderWidth += column.attribute.width;
|
|
60205
60279
|
});
|
|
60280
|
+
if (table.options.scrollFrozenCols) {
|
|
60281
|
+
cornerHeaderWidth = table.getFrozenColsWidth();
|
|
60282
|
+
}
|
|
60206
60283
|
this.cornerHeaderGroup.setAttribute('width', cornerHeaderWidth);
|
|
60207
60284
|
this.colHeaderGroup.setAttribute('x', this.cornerHeaderGroup.attribute.width);
|
|
60208
60285
|
this.rowHeaderGroup.setAttribute('y', this.cornerHeaderGroup.attribute.height);
|
|
@@ -61280,6 +61357,8 @@
|
|
|
61280
61357
|
if (!enableShiftSelectMode) {
|
|
61281
61358
|
currentRange.end = currentRange.start;
|
|
61282
61359
|
}
|
|
61360
|
+
cellPos.col = col;
|
|
61361
|
+
cellPos.row = row;
|
|
61283
61362
|
scenegraph.deleteLastSelectedRangeComponents();
|
|
61284
61363
|
scenegraph.updateCellSelectBorder(currentRange);
|
|
61285
61364
|
}
|
|
@@ -63964,11 +64043,8 @@
|
|
|
63964
64043
|
}
|
|
63965
64044
|
}
|
|
63966
64045
|
updateHorizontalScrollBar(xRatio) {
|
|
63967
|
-
const totalWidth = this.table.getAllColsWidth();
|
|
63968
64046
|
const oldHorizontalBarPos = this.scroll.horizontalBarPos;
|
|
63969
|
-
const
|
|
63970
|
-
const rightFrozenOffset = this.table.getRightFrozenColsOffset?.() ?? 0;
|
|
63971
|
-
const scrollRange = Math.max(0, totalWidth - this.table.scenegraph.width - frozenOffset - rightFrozenOffset);
|
|
64047
|
+
const scrollRange = getBodyHorizontalScrollRange(this.table);
|
|
63972
64048
|
let horizontalBarPos = Math.ceil(xRatio * scrollRange);
|
|
63973
64049
|
if (!isValid$1(horizontalBarPos) || isNaN(horizontalBarPos)) {
|
|
63974
64050
|
horizontalBarPos = 0;
|
|
@@ -64078,10 +64154,7 @@
|
|
|
64078
64154
|
return;
|
|
64079
64155
|
}
|
|
64080
64156
|
this.table.scrollLeft;
|
|
64081
|
-
const
|
|
64082
|
-
const frozenOffset = this.table.getFrozenColsOffset?.() ?? 0;
|
|
64083
|
-
const rightFrozenOffset = this.table.getRightFrozenColsOffset?.() ?? 0;
|
|
64084
|
-
const scrollRange = Math.max(0, totalWidth - this.table.scenegraph.width - frozenOffset - rightFrozenOffset);
|
|
64157
|
+
const scrollRange = getBodyHorizontalScrollRange(this.table);
|
|
64085
64158
|
const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
64086
64159
|
left = Math.max(0, Math.min(left, scrollRange - sizeTolerance));
|
|
64087
64160
|
left = Math.ceil(left);
|
|
@@ -65360,15 +65433,19 @@
|
|
|
65360
65433
|
if (e.button !== 0) {
|
|
65361
65434
|
return;
|
|
65362
65435
|
}
|
|
65436
|
+
const endedResizeCol = stateManager.isResizeCol();
|
|
65437
|
+
const endedResizeRow = stateManager.isResizeRow();
|
|
65438
|
+
const endedMoveCol = stateManager.isMoveCol();
|
|
65439
|
+
const shouldSkipClickCell = endedResizeCol || endedResizeRow;
|
|
65363
65440
|
if (stateManager.interactionState === 'grabing') {
|
|
65364
65441
|
stateManager.updateInteractionState(InteractionState.default);
|
|
65365
|
-
if (
|
|
65442
|
+
if (endedResizeCol) {
|
|
65366
65443
|
endResizeCol(table);
|
|
65367
65444
|
}
|
|
65368
|
-
else if (
|
|
65445
|
+
else if (endedResizeRow) {
|
|
65369
65446
|
endResizeRow(table);
|
|
65370
65447
|
}
|
|
65371
|
-
else if (
|
|
65448
|
+
else if (endedMoveCol) {
|
|
65372
65449
|
const endMoveColSuccess = table.stateManager.endMoveCol();
|
|
65373
65450
|
fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
|
|
65374
65451
|
}
|
|
@@ -65398,7 +65475,7 @@
|
|
|
65398
65475
|
else if (stateManager.interactionState === InteractionState.scrolling) {
|
|
65399
65476
|
stateManager.updateInteractionState(InteractionState.default);
|
|
65400
65477
|
}
|
|
65401
|
-
if (!table.eventManager.isDraging) {
|
|
65478
|
+
if (!table.eventManager.isDraging && !shouldSkipClickCell) {
|
|
65402
65479
|
const eventArgsSet = getEventArgsSet(e);
|
|
65403
65480
|
if (!eventManager.isTouchMove &&
|
|
65404
65481
|
e.button === 0 &&
|
|
@@ -65892,6 +65969,9 @@
|
|
|
65892
65969
|
});
|
|
65893
65970
|
}
|
|
65894
65971
|
function dblclickHandler(e, table) {
|
|
65972
|
+
if (typeof e.button === 'number' && e.button !== 0) {
|
|
65973
|
+
return;
|
|
65974
|
+
}
|
|
65895
65975
|
const eventArgsSet = getCellEventArgsSetWithTable(e, table);
|
|
65896
65976
|
let col = -1;
|
|
65897
65977
|
let row = -1;
|
|
@@ -66253,6 +66333,18 @@
|
|
|
66253
66333
|
const table = eventManager.table;
|
|
66254
66334
|
const stateManager = table.stateManager;
|
|
66255
66335
|
const handler = table.internalProps.handler;
|
|
66336
|
+
const focusEditingInput = () => {
|
|
66337
|
+
table.editorManager?.editingEditor?.getInputElement?.()?.focus?.();
|
|
66338
|
+
};
|
|
66339
|
+
const afterCompleteEdit = (completeEditResult, onSuccess) => {
|
|
66340
|
+
getPromiseValue(completeEditResult, (isCompleteEdit) => {
|
|
66341
|
+
if (isCompleteEdit === false) {
|
|
66342
|
+
focusEditingInput();
|
|
66343
|
+
return;
|
|
66344
|
+
}
|
|
66345
|
+
onSuccess();
|
|
66346
|
+
});
|
|
66347
|
+
};
|
|
66256
66348
|
handler.on(table.getElement(), 'blur', (e) => {
|
|
66257
66349
|
const relatedTarget = e.relatedTarget;
|
|
66258
66350
|
if (relatedTarget) {
|
|
@@ -66355,15 +66447,17 @@
|
|
|
66355
66447
|
return;
|
|
66356
66448
|
}
|
|
66357
66449
|
const isEditingCell = !!table.editorManager?.editingEditor;
|
|
66358
|
-
table.editorManager?.completeEdit();
|
|
66359
|
-
|
|
66360
|
-
|
|
66361
|
-
|
|
66362
|
-
|
|
66363
|
-
if (table.
|
|
66364
|
-
table.
|
|
66450
|
+
const completeEditResult = table.editorManager?.completeEdit();
|
|
66451
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
66452
|
+
table.getElement().focus();
|
|
66453
|
+
const enableShiftSelectMode = table.options.keyboardOptions?.shiftMultiSelect ?? true;
|
|
66454
|
+
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
66455
|
+
if ((table.options.keyboardOptions?.moveEditCellOnArrowKeys ?? false) && isEditingCell) {
|
|
66456
|
+
if (table.getEditor(targetCol, targetRow)) {
|
|
66457
|
+
table.editorManager?.startEditCell(targetCol, targetRow);
|
|
66458
|
+
}
|
|
66365
66459
|
}
|
|
66366
|
-
}
|
|
66460
|
+
});
|
|
66367
66461
|
}
|
|
66368
66462
|
else if (e.key === 'Escape') {
|
|
66369
66463
|
table.editorManager?.cancelEdit();
|
|
@@ -66372,17 +66466,19 @@
|
|
|
66372
66466
|
else if (e.key === 'Enter') {
|
|
66373
66467
|
if (table.editorManager?.editingEditor) {
|
|
66374
66468
|
handleKeydownListener(e);
|
|
66375
|
-
table.editorManager?.completeEdit();
|
|
66376
|
-
|
|
66377
|
-
|
|
66378
|
-
|
|
66379
|
-
|
|
66380
|
-
|
|
66381
|
-
|
|
66469
|
+
const completeEditResult = table.editorManager?.completeEdit();
|
|
66470
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
66471
|
+
table.getElement().focus();
|
|
66472
|
+
if (table.options.keyboardOptions?.moveFocusCellOnEnter === true) {
|
|
66473
|
+
const targetCol = stateManager.select.cellPos.col;
|
|
66474
|
+
const targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
66475
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) {
|
|
66476
|
+
return;
|
|
66477
|
+
}
|
|
66478
|
+
const enableShiftSelectMode = table.options.keyboardOptions?.shiftMultiSelect ?? true;
|
|
66479
|
+
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
66382
66480
|
}
|
|
66383
|
-
|
|
66384
|
-
table.selectCell(targetCol, targetRow, e.shiftKey && enableShiftSelectMode);
|
|
66385
|
-
}
|
|
66481
|
+
});
|
|
66386
66482
|
return;
|
|
66387
66483
|
}
|
|
66388
66484
|
if (table.options.keyboardOptions?.moveFocusCellOnEnter === true) {
|
|
@@ -66430,14 +66526,16 @@
|
|
|
66430
66526
|
return;
|
|
66431
66527
|
}
|
|
66432
66528
|
const isEditingCell = !!table.editorManager?.editingEditor;
|
|
66433
|
-
table.editorManager?.completeEdit();
|
|
66434
|
-
|
|
66435
|
-
|
|
66436
|
-
|
|
66437
|
-
if (
|
|
66438
|
-
table.
|
|
66529
|
+
const completeEditResult = table.editorManager?.completeEdit();
|
|
66530
|
+
afterCompleteEdit(completeEditResult, () => {
|
|
66531
|
+
table.getElement().focus();
|
|
66532
|
+
table.selectCell(targetCol, targetRow);
|
|
66533
|
+
if (isEditingCell) {
|
|
66534
|
+
if (table.getEditor(targetCol, targetRow)) {
|
|
66535
|
+
table.editorManager?.startEditCell(targetCol, targetRow);
|
|
66536
|
+
}
|
|
66439
66537
|
}
|
|
66440
|
-
}
|
|
66538
|
+
});
|
|
66441
66539
|
}
|
|
66442
66540
|
}
|
|
66443
66541
|
}
|
|
@@ -67623,6 +67721,9 @@
|
|
|
67623
67721
|
}
|
|
67624
67722
|
cellIsHeaderCheck(eventArgsSet, update) {
|
|
67625
67723
|
const { eventArgs } = eventArgsSet;
|
|
67724
|
+
if (!eventArgs) {
|
|
67725
|
+
return false;
|
|
67726
|
+
}
|
|
67626
67727
|
const { col, row, target } = eventArgs;
|
|
67627
67728
|
if (!this.table.isHeader(col, row)) {
|
|
67628
67729
|
return false;
|
|
@@ -72225,7 +72326,7 @@
|
|
|
72225
72326
|
return TABLE_EVENT_TYPE;
|
|
72226
72327
|
}
|
|
72227
72328
|
options;
|
|
72228
|
-
version = "1.0.
|
|
72329
|
+
version = "1.0.37";
|
|
72229
72330
|
pagination;
|
|
72230
72331
|
id = `VTable${Date.now()}`;
|
|
72231
72332
|
headerStyleCache;
|
|
@@ -73755,15 +73856,14 @@
|
|
|
73755
73856
|
}
|
|
73756
73857
|
getBodyVisibleCellRange() {
|
|
73757
73858
|
const { scrollTop, scrollLeft } = this;
|
|
73758
|
-
const frozenRowsHeight = this.getFrozenRowsHeight();
|
|
73759
73859
|
const frozenColsContentWidth = this.getFrozenColsContentWidth();
|
|
73760
73860
|
const frozenColsOffset = this.getFrozenColsOffset();
|
|
73761
73861
|
const bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight();
|
|
73762
73862
|
const rightFrozenColsWidth = this.getRightFrozenColsWidth();
|
|
73763
|
-
const
|
|
73863
|
+
const rowStart = Math.max(this.getTargetRowAt(scrollTop + 1)?.row ?? -1, this.frozenRowCount);
|
|
73764
73864
|
const { col: colStart } = this.getColAt(scrollLeft + frozenColsContentWidth + 1);
|
|
73765
73865
|
const rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight
|
|
73766
|
-
? this.
|
|
73866
|
+
? Math.max(this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight)?.row ?? -1, rowStart)
|
|
73767
73867
|
: this.rowCount - 1;
|
|
73768
73868
|
const colEnd = this.getAllColsWidth() > this.tableNoFrameWidth
|
|
73769
73869
|
? this.getColAt(scrollLeft + frozenColsOffset + this.tableNoFrameWidth - 1 - rightFrozenColsWidth).col
|
|
@@ -73775,11 +73875,11 @@
|
|
|
73775
73875
|
}
|
|
73776
73876
|
getBodyVisibleRowRange(start_deltaY = 0, end_deltaY = 0) {
|
|
73777
73877
|
const { scrollTop } = this;
|
|
73778
|
-
const frozenRowsHeight = this.getFrozenRowsHeight();
|
|
73779
73878
|
const bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight();
|
|
73780
|
-
const
|
|
73879
|
+
const rowStart = Math.max(this.getTargetRowAt(scrollTop + 1 + start_deltaY)?.row ?? -1, this.frozenRowCount);
|
|
73781
73880
|
const rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight
|
|
73782
|
-
? this.
|
|
73881
|
+
? Math.max(this.getTargetRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight + end_deltaY)?.row ??
|
|
73882
|
+
-1, rowStart)
|
|
73783
73883
|
: this.rowCount - 1;
|
|
73784
73884
|
if (rowEnd < 0) {
|
|
73785
73885
|
return null;
|
|
@@ -75642,18 +75742,21 @@
|
|
|
75642
75742
|
}, delay);
|
|
75643
75743
|
}
|
|
75644
75744
|
scrollToRow(row, animationOption) {
|
|
75645
|
-
const targetRow = Math.min(Math.max(
|
|
75745
|
+
const targetRow = Math.min(Math.max(row, 0), this.rowCount - 1);
|
|
75746
|
+
const targetRowInt = Math.floor(targetRow);
|
|
75646
75747
|
this.clearCorrectTimer();
|
|
75647
75748
|
if (!animationOption) {
|
|
75648
|
-
this.scrollToCell({ row:
|
|
75649
|
-
this._scheduleScrollToRowCorrect(
|
|
75749
|
+
this.scrollToCell({ row: targetRowInt });
|
|
75750
|
+
this._scheduleScrollToRowCorrect(targetRowInt);
|
|
75650
75751
|
return;
|
|
75651
75752
|
}
|
|
75652
75753
|
const duration = !isBoolean$2(animationOption) ? animationOption?.duration ?? 3000 : 3000;
|
|
75653
75754
|
this.animationManager.scrollTo({ row: targetRow }, animationOption);
|
|
75654
|
-
|
|
75655
|
-
this.
|
|
75656
|
-
|
|
75755
|
+
if (targetRowInt === targetRow) {
|
|
75756
|
+
this._scrollToRowCorrectTimer = setTimeout(() => {
|
|
75757
|
+
this.scrollToRow(targetRowInt, false);
|
|
75758
|
+
}, duration);
|
|
75759
|
+
}
|
|
75657
75760
|
}
|
|
75658
75761
|
scrollToCol(col, animationOption) {
|
|
75659
75762
|
if (!animationOption) {
|
|
@@ -78089,7 +78192,13 @@
|
|
|
78089
78192
|
}
|
|
78090
78193
|
}
|
|
78091
78194
|
}
|
|
78092
|
-
const
|
|
78195
|
+
const sourceColIndex = sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount;
|
|
78196
|
+
const targetColIndex = target.col >= source.col
|
|
78197
|
+
? targetCellRange.end.col - this.leftRowSeriesNumberColumnCount
|
|
78198
|
+
: targetCellRange.start.col - this.leftRowSeriesNumberColumnCount;
|
|
78199
|
+
const sourceTotalIndex = this._columns[sourceColIndex]?.define?.startInTotal ?? sourceColIndex;
|
|
78200
|
+
const targetTotalIndex = this._columns[targetColIndex]?.define?.startInTotal ?? targetColIndex;
|
|
78201
|
+
const sourceColumns = this._columns.splice(sourceColIndex, sourceSize);
|
|
78093
78202
|
sourceColumns.unshift((targetIndex - this.leftRowSeriesNumberColumnCount), 0);
|
|
78094
78203
|
Array.prototype.splice.apply(this._columns, sourceColumns);
|
|
78095
78204
|
if (this._table.options.dragOrder?.maintainArrayDataOrder) {
|
|
@@ -78097,7 +78206,7 @@
|
|
|
78097
78206
|
this._columns[i].field = i;
|
|
78098
78207
|
}
|
|
78099
78208
|
}
|
|
78100
|
-
this.columnTree.movePosition(sourceCellRange.start.row,
|
|
78209
|
+
this.columnTree.movePosition(sourceCellRange.start.row, sourceTotalIndex, targetTotalIndex);
|
|
78101
78210
|
if (this._table.options.dragOrder?.maintainArrayDataOrder) {
|
|
78102
78211
|
for (let i = 0; i < this.columnTree.tree.children.length; i++) {
|
|
78103
78212
|
this.columnTree.tree.children[i].field = i;
|
|
@@ -78135,10 +78244,14 @@
|
|
|
78135
78244
|
sourceIds.unshift(targetIndex, 0);
|
|
78136
78245
|
Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
|
|
78137
78246
|
}
|
|
78138
|
-
const
|
|
78247
|
+
const sourceRowIndex = sourceCellRange.start.row;
|
|
78248
|
+
const targetRowIndex = target.row >= source.row ? targetCellRange.end.row : targetCellRange.start.row;
|
|
78249
|
+
const sourceTotalIndex = this._columns[sourceRowIndex]?.define?.startInTotal ?? sourceRowIndex;
|
|
78250
|
+
const targetTotalIndex = this._columns[targetRowIndex]?.define?.startInTotal ?? targetRowIndex;
|
|
78251
|
+
const sourceColumns = this._columns.splice(sourceRowIndex, sourceSize);
|
|
78139
78252
|
sourceColumns.unshift(targetIndex, 0);
|
|
78140
78253
|
Array.prototype.splice.apply(this._columns, sourceColumns);
|
|
78141
|
-
this.columnTree.movePosition(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount,
|
|
78254
|
+
this.columnTree.movePosition(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceTotalIndex, targetTotalIndex);
|
|
78142
78255
|
this.columnTree.reset(this.columnTree.tree.children);
|
|
78143
78256
|
this._cellRangeMap = new Map();
|
|
78144
78257
|
return {
|
|
@@ -80523,10 +80636,32 @@
|
|
|
80523
80636
|
}
|
|
80524
80637
|
adjustHeightResizedRowMap(moveContext, this);
|
|
80525
80638
|
}
|
|
80639
|
+
this.syncColumnsStateFromLayoutMap();
|
|
80526
80640
|
return moveContext;
|
|
80527
80641
|
}
|
|
80528
80642
|
return null;
|
|
80529
80643
|
}
|
|
80644
|
+
syncColumnsStateFromLayoutMap() {
|
|
80645
|
+
const nextColumns = cloneDeepSpec(this.internalProps.columns, ['children']);
|
|
80646
|
+
const cleanColumns = (columns) => {
|
|
80647
|
+
columns.forEach(col => {
|
|
80648
|
+
delete col.level;
|
|
80649
|
+
delete col.size;
|
|
80650
|
+
delete col.startInTotal;
|
|
80651
|
+
delete col.startIndex;
|
|
80652
|
+
delete col.id;
|
|
80653
|
+
delete col.hierarchyState;
|
|
80654
|
+
if (col.columns) {
|
|
80655
|
+
cleanColumns(col.columns);
|
|
80656
|
+
}
|
|
80657
|
+
});
|
|
80658
|
+
};
|
|
80659
|
+
cleanColumns(nextColumns);
|
|
80660
|
+
this.options.columns = nextColumns;
|
|
80661
|
+
if (this.options.header) {
|
|
80662
|
+
this.options.header = nextColumns;
|
|
80663
|
+
}
|
|
80664
|
+
}
|
|
80530
80665
|
changeRecordOrder(sourceIndex, targetIndex) {
|
|
80531
80666
|
if (this.transpose) {
|
|
80532
80667
|
sourceIndex = this.getRecordShowIndexByCell(sourceIndex, 0);
|
|
@@ -84768,7 +84903,18 @@
|
|
|
84768
84903
|
const titleRows = table.listTreeStickCellPlugin.titleRows;
|
|
84769
84904
|
const { shadowTarget } = e.pickParams;
|
|
84770
84905
|
const cellGroup = getTargetCell(shadowTarget);
|
|
84771
|
-
|
|
84906
|
+
if (!cellGroup) {
|
|
84907
|
+
return;
|
|
84908
|
+
}
|
|
84909
|
+
const iconInfo = getIconAndPositionFromTarget(shadowTarget);
|
|
84910
|
+
const funcType = iconInfo?.icon?.attribute?.funcType;
|
|
84911
|
+
if (funcType === IconFuncTypeEnum.collapse || funcType === IconFuncTypeEnum.expand) {
|
|
84912
|
+
const stickCellTop = getStickCellTop(cellGroup, table);
|
|
84913
|
+
table.toggleHierarchyState(cellGroup.col, cellGroup.row);
|
|
84914
|
+
keepRowAtVisiblePosition(cellGroup.col, cellGroup.row, stickCellTop, table);
|
|
84915
|
+
return;
|
|
84916
|
+
}
|
|
84917
|
+
const { row } = cellGroup;
|
|
84772
84918
|
const rowIndex = titleRows.indexOf(row);
|
|
84773
84919
|
scrollToRow(row - rowIndex, table);
|
|
84774
84920
|
});
|
|
@@ -84789,7 +84935,18 @@
|
|
|
84789
84935
|
const titleRows = table.listTreeStickCellPlugin.titleRows;
|
|
84790
84936
|
const { shadowTarget } = e.pickParams;
|
|
84791
84937
|
const cellGroup = getTargetCell(shadowTarget);
|
|
84792
|
-
|
|
84938
|
+
if (!cellGroup) {
|
|
84939
|
+
return;
|
|
84940
|
+
}
|
|
84941
|
+
const iconInfo = getIconAndPositionFromTarget(shadowTarget);
|
|
84942
|
+
const funcType = iconInfo?.icon?.attribute?.funcType;
|
|
84943
|
+
if (funcType === IconFuncTypeEnum.collapse || funcType === IconFuncTypeEnum.expand) {
|
|
84944
|
+
const stickCellTop = getStickCellTop(cellGroup, table);
|
|
84945
|
+
table.toggleHierarchyState(cellGroup.col, cellGroup.row);
|
|
84946
|
+
keepRowAtVisiblePosition(cellGroup.col, cellGroup.row, stickCellTop, table);
|
|
84947
|
+
return;
|
|
84948
|
+
}
|
|
84949
|
+
const { row } = cellGroup;
|
|
84793
84950
|
const rowIndex = titleRows.indexOf(row);
|
|
84794
84951
|
scrollToRow(row - rowIndex, table);
|
|
84795
84952
|
});
|
|
@@ -84809,6 +84966,15 @@
|
|
|
84809
84966
|
}
|
|
84810
84967
|
table.scenegraph.updateNextFrame();
|
|
84811
84968
|
}
|
|
84969
|
+
function getStickCellTop(cellGroup, table) {
|
|
84970
|
+
return table.getFrozenRowsHeight() + (cellGroup.attribute?.y ?? 0);
|
|
84971
|
+
}
|
|
84972
|
+
function keepRowAtVisiblePosition(col, row, visibleTop, table) {
|
|
84973
|
+
const drawRange = table.getDrawRange();
|
|
84974
|
+
const targetScrollTop = Math.max(0, Math.min(table.getCellRect(col, row).top - visibleTop, table.getAllRowsHeight() - drawRange.height));
|
|
84975
|
+
table.scrollTop = targetScrollTop;
|
|
84976
|
+
table.scenegraph.updateNextFrame();
|
|
84977
|
+
}
|
|
84812
84978
|
const registerListTreeStickCellPlugin = () => {
|
|
84813
84979
|
Factory.registerComponent('listTreeStickCellPlugin', ListTreeStickCellPlugin);
|
|
84814
84980
|
};
|
|
@@ -94282,6 +94448,11 @@
|
|
|
94282
94448
|
_refreshHierarchyState(col, row, recalculateColWidths = true, beforeUpdateCell) {
|
|
94283
94449
|
this.frozenColCount;
|
|
94284
94450
|
this.frozenRowCount;
|
|
94451
|
+
const sizeTolerance = this.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
94452
|
+
const getMaxScrollTop = () => Math.max(0, this.getAllRowsHeight() - (this.scenegraph?.height ?? this.tableNoFrameHeight) - sizeTolerance);
|
|
94453
|
+
const oldMaxScrollTop = getMaxScrollTop();
|
|
94454
|
+
const isScrollToBottom = oldMaxScrollTop > 0 && this.scrollTop >= oldMaxScrollTop - 1;
|
|
94455
|
+
const oldScrollTop = this.scrollTop;
|
|
94285
94456
|
const visibleStartRow = this.getBodyVisibleRowRange().rowStart;
|
|
94286
94457
|
this.internalProps._oldRowCount = this.rowCount;
|
|
94287
94458
|
this.internalProps._oldColCount = this.colCount;
|
|
@@ -94298,6 +94469,9 @@
|
|
|
94298
94469
|
}
|
|
94299
94470
|
}
|
|
94300
94471
|
const isChangeRowTree = this.internalProps.layoutMap.isRowHeader(col, row);
|
|
94472
|
+
const oldHierarchyState = isChangeRowTree ? this.getHierarchyState(col, row) : undefined;
|
|
94473
|
+
const shouldKeepBottomAfterToggle = isScrollToBottom && oldHierarchyState === 'expand';
|
|
94474
|
+
const shouldKeepScrollAfterToggle = isChangeRowTree && !shouldKeepBottomAfterToggle;
|
|
94301
94475
|
const result = isChangeRowTree
|
|
94302
94476
|
? this.internalProps.layoutMap.toggleHierarchyState(col, row)
|
|
94303
94477
|
: this.internalProps.layoutMap.toggleHierarchyStateForColumnTree(col, row);
|
|
@@ -94319,8 +94493,26 @@
|
|
|
94319
94493
|
this.clearCellStyleCache();
|
|
94320
94494
|
this.scenegraph.createSceneGraph();
|
|
94321
94495
|
this.scrollToRow(visibleStartRow);
|
|
94496
|
+
if (shouldKeepBottomAfterToggle) {
|
|
94497
|
+
this.clearCorrectTimer();
|
|
94498
|
+
this.setScrollTop(Number.MAX_SAFE_INTEGER);
|
|
94499
|
+
}
|
|
94500
|
+
else if (shouldKeepScrollAfterToggle) {
|
|
94501
|
+
this.clearCorrectTimer();
|
|
94502
|
+
this.setScrollTop(oldScrollTop);
|
|
94503
|
+
}
|
|
94322
94504
|
}
|
|
94323
94505
|
this.reactCustomLayout?.updateAllCustomCell();
|
|
94506
|
+
if (shouldKeepBottomAfterToggle) {
|
|
94507
|
+
this.clearCorrectTimer();
|
|
94508
|
+
this.setScrollTop(Number.MAX_SAFE_INTEGER);
|
|
94509
|
+
}
|
|
94510
|
+
else if (shouldKeepScrollAfterToggle &&
|
|
94511
|
+
this.rowHierarchyType !== 'grid-tree' &&
|
|
94512
|
+
this.columnHierarchyType !== 'grid-tree') {
|
|
94513
|
+
this.clearCorrectTimer();
|
|
94514
|
+
this.setScrollTop(oldScrollTop);
|
|
94515
|
+
}
|
|
94324
94516
|
if (checkHasChart) {
|
|
94325
94517
|
if (this.autoFillWidth && !notFillWidth) {
|
|
94326
94518
|
notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth;
|
|
@@ -96800,7 +96992,7 @@
|
|
|
96800
96992
|
}
|
|
96801
96993
|
|
|
96802
96994
|
registerForVrender();
|
|
96803
|
-
const version = "1.0.
|
|
96995
|
+
const version = "1.0.37";
|
|
96804
96996
|
function getIcons() {
|
|
96805
96997
|
return get$2();
|
|
96806
96998
|
}
|