vxe-table 3.15.13 → 3.15.14
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/es/style.css +1 -1
- package/es/table/src/methods.js +109 -66
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +119 -68
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/methods.js +117 -66
- package/lib/table/src/methods.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/src/methods.ts +113 -70
- /package/es/{iconfont.1745800652359.ttf → iconfont.1745827933282.ttf} +0 -0
- /package/es/{iconfont.1745800652359.woff → iconfont.1745827933282.woff} +0 -0
- /package/es/{iconfont.1745800652359.woff2 → iconfont.1745827933282.woff2} +0 -0
- /package/lib/{iconfont.1745800652359.ttf → iconfont.1745827933282.ttf} +0 -0
- /package/lib/{iconfont.1745800652359.woff → iconfont.1745827933282.woff} +0 -0
- /package/lib/{iconfont.1745800652359.woff2 → iconfont.1745827933282.woff2} +0 -0
package/lib/table/src/methods.js
CHANGED
|
@@ -3624,42 +3624,54 @@ const createGetColumnCacheProp = prop => {
|
|
|
3624
3624
|
return -1;
|
|
3625
3625
|
};
|
|
3626
3626
|
};
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3627
|
+
function lazyScrollXData($xeTable) {
|
|
3628
|
+
const internalData = $xeTable;
|
|
3629
|
+
const {
|
|
3630
|
+
lxTimeout,
|
|
3631
|
+
lxRunTime,
|
|
3632
|
+
scrollXStore
|
|
3633
|
+
} = internalData;
|
|
3634
|
+
const {
|
|
3635
|
+
visibleSize
|
|
3636
|
+
} = scrollXStore;
|
|
3637
|
+
const fpsTime = visibleSize > 26 ? 26 : visibleSize > 16 ? 14 : 6;
|
|
3638
|
+
if (lxTimeout) {
|
|
3639
|
+
clearTimeout(lxTimeout);
|
|
3640
|
+
}
|
|
3641
|
+
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
3642
|
+
internalData.lxRunTime = Date.now();
|
|
3643
|
+
loadScrollXData($xeTable);
|
|
3644
|
+
}
|
|
3645
|
+
internalData.lxTimeout = setTimeout(() => {
|
|
3646
|
+
internalData.lxTimeout = undefined;
|
|
3647
|
+
internalData.lxRunTime = undefined;
|
|
3648
|
+
loadScrollXData($xeTable);
|
|
3649
|
+
}, fpsTime);
|
|
3650
|
+
}
|
|
3651
|
+
function lazyScrollYData($xeTable) {
|
|
3652
|
+
const internalData = $xeTable;
|
|
3653
|
+
const {
|
|
3654
|
+
lyTimeout,
|
|
3655
|
+
lyRunTime,
|
|
3656
|
+
scrollYStore
|
|
3657
|
+
} = internalData;
|
|
3658
|
+
const {
|
|
3659
|
+
visibleSize
|
|
3660
|
+
} = scrollYStore;
|
|
3661
|
+
const fpsTime = visibleSize > 30 ? 32 : visibleSize > 20 ? 18 : 8;
|
|
3662
|
+
if (lyTimeout) {
|
|
3663
|
+
clearTimeout(lyTimeout);
|
|
3664
|
+
}
|
|
3665
|
+
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
3666
|
+
internalData.lyRunTime = Date.now();
|
|
3667
|
+
loadScrollYData($xeTable);
|
|
3668
|
+
}
|
|
3669
|
+
internalData.lyTimeout = setTimeout(() => {
|
|
3670
|
+
internalData.lyTimeout = undefined;
|
|
3671
|
+
internalData.lyRunTime = undefined;
|
|
3672
|
+
loadScrollYData($xeTable);
|
|
3673
|
+
}, fpsTime);
|
|
3674
|
+
}
|
|
3663
3675
|
function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
3664
3676
|
const reactData = $xeTable;
|
|
3665
3677
|
const internalData = $xeTable;
|
|
@@ -10555,24 +10567,24 @@ const Methods = {
|
|
|
10555
10567
|
*/
|
|
10556
10568
|
triggerScrollXEvent() {
|
|
10557
10569
|
const $xeTable = this;
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10570
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
10571
|
+
if (virtualXOpts.immediate) {
|
|
10572
|
+
loadScrollXData($xeTable);
|
|
10573
|
+
} else {
|
|
10574
|
+
lazyScrollXData($xeTable);
|
|
10575
|
+
}
|
|
10564
10576
|
},
|
|
10565
10577
|
/**
|
|
10566
10578
|
* 纵向 Y 可视渲染事件处理
|
|
10567
10579
|
*/
|
|
10568
10580
|
triggerScrollYEvent() {
|
|
10569
10581
|
const $xeTable = this;
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10582
|
+
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
10583
|
+
if (virtualYOpts.immediate) {
|
|
10584
|
+
loadScrollYData($xeTable);
|
|
10585
|
+
} else {
|
|
10586
|
+
lazyScrollYData($xeTable);
|
|
10587
|
+
}
|
|
10576
10588
|
},
|
|
10577
10589
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
10578
10590
|
const $xeTable = this;
|
|
@@ -10838,8 +10850,8 @@ const Methods = {
|
|
|
10838
10850
|
if (isRollX) {
|
|
10839
10851
|
evnt.preventDefault();
|
|
10840
10852
|
internalData.inWheelScroll = true;
|
|
10841
|
-
|
|
10842
|
-
const currLeftNum =
|
|
10853
|
+
if (browseObj['-moz'] || browseObj.safari) {
|
|
10854
|
+
const currLeftNum = scrollLeft;
|
|
10843
10855
|
(0, _dom.setScrollLeft)(xHandleEl, currLeftNum);
|
|
10844
10856
|
(0, _dom.setScrollLeft)(bodyScrollElem, currLeftNum);
|
|
10845
10857
|
(0, _dom.setScrollLeft)(headerScrollElem, currLeftNum);
|
|
@@ -10851,13 +10863,27 @@ const Methods = {
|
|
|
10851
10863
|
type: 'table',
|
|
10852
10864
|
fixed: ''
|
|
10853
10865
|
});
|
|
10854
|
-
}
|
|
10866
|
+
} else {
|
|
10867
|
+
wheelScrollLeftTo(scrollLeft, offsetLeft => {
|
|
10868
|
+
const currLeftNum = offsetLeft;
|
|
10869
|
+
(0, _dom.setScrollLeft)(xHandleEl, currLeftNum);
|
|
10870
|
+
(0, _dom.setScrollLeft)(bodyScrollElem, currLeftNum);
|
|
10871
|
+
(0, _dom.setScrollLeft)(headerScrollElem, currLeftNum);
|
|
10872
|
+
(0, _dom.setScrollLeft)(footerScrollElem, currLeftNum);
|
|
10873
|
+
if (scrollXLoad) {
|
|
10874
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
10875
|
+
}
|
|
10876
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
|
|
10877
|
+
type: 'table',
|
|
10878
|
+
fixed: ''
|
|
10879
|
+
});
|
|
10880
|
+
});
|
|
10881
|
+
}
|
|
10855
10882
|
}
|
|
10856
10883
|
if (isRollY) {
|
|
10857
10884
|
evnt.preventDefault();
|
|
10858
|
-
|
|
10859
|
-
const currTopNum =
|
|
10860
|
-
internalData.inWheelScroll = true;
|
|
10885
|
+
if (browseObj['-moz'] || browseObj.safari) {
|
|
10886
|
+
const currTopNum = scrollTop;
|
|
10861
10887
|
(0, _dom.setScrollTop)(yHandleEl, currTopNum);
|
|
10862
10888
|
(0, _dom.setScrollTop)(bodyScrollElem, currTopNum);
|
|
10863
10889
|
(0, _dom.setScrollTop)(leftScrollElem, currTopNum);
|
|
@@ -10870,7 +10896,24 @@ const Methods = {
|
|
|
10870
10896
|
type: 'table',
|
|
10871
10897
|
fixed: ''
|
|
10872
10898
|
});
|
|
10873
|
-
}
|
|
10899
|
+
} else {
|
|
10900
|
+
wheelScrollTopTo(scrollTop - currScrollTop, offsetTop => {
|
|
10901
|
+
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
10902
|
+
internalData.inWheelScroll = true;
|
|
10903
|
+
(0, _dom.setScrollTop)(yHandleEl, currTopNum);
|
|
10904
|
+
(0, _dom.setScrollTop)(bodyScrollElem, currTopNum);
|
|
10905
|
+
(0, _dom.setScrollTop)(leftScrollElem, currTopNum);
|
|
10906
|
+
(0, _dom.setScrollTop)(rightScrollElem, currTopNum);
|
|
10907
|
+
(0, _dom.setScrollTop)(rowExpandEl, currTopNum);
|
|
10908
|
+
if (scrollYLoad) {
|
|
10909
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
10910
|
+
}
|
|
10911
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
|
|
10912
|
+
type: 'table',
|
|
10913
|
+
fixed: ''
|
|
10914
|
+
});
|
|
10915
|
+
});
|
|
10916
|
+
}
|
|
10874
10917
|
}
|
|
10875
10918
|
},
|
|
10876
10919
|
triggerVirtualScrollXEvent(evnt) {
|
|
@@ -11034,20 +11077,18 @@ const Methods = {
|
|
|
11034
11077
|
ySpaceWidth = maxXWidth;
|
|
11035
11078
|
isScrollXBig = true;
|
|
11036
11079
|
}
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
marginLeft = `${xSpaceLeft}px`;
|
|
11080
|
+
if (!(scrollXLoad && overflowX)) {
|
|
11081
|
+
xSpaceLeft = 0;
|
|
11040
11082
|
}
|
|
11041
11083
|
if (headerTableElem) {
|
|
11042
|
-
headerTableElem.style.
|
|
11084
|
+
headerTableElem.style.transform = headerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
|
|
11043
11085
|
}
|
|
11044
11086
|
if (bodyTableElem) {
|
|
11045
|
-
bodyTableElem.style.
|
|
11087
|
+
bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
|
|
11046
11088
|
}
|
|
11047
11089
|
if (footerTableElem) {
|
|
11048
|
-
footerTableElem.style.
|
|
11090
|
+
footerTableElem.style.transform = footerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
|
|
11049
11091
|
}
|
|
11050
|
-
reactData.isScrollXBig = isScrollXBig;
|
|
11051
11092
|
const containerList = ['main'];
|
|
11052
11093
|
containerList.forEach(name => {
|
|
11053
11094
|
const layoutList = ['header', 'body', 'footer'];
|
|
@@ -11058,6 +11099,9 @@ const Methods = {
|
|
|
11058
11099
|
}
|
|
11059
11100
|
});
|
|
11060
11101
|
});
|
|
11102
|
+
reactData.scrollXLeft = xSpaceLeft;
|
|
11103
|
+
reactData.scrollXWidth = ySpaceWidth;
|
|
11104
|
+
reactData.isScrollXBig = isScrollXBig;
|
|
11061
11105
|
const scrollXSpaceEl = $xeTable.$refs.refScrollXSpaceElem;
|
|
11062
11106
|
if (scrollXSpaceEl) {
|
|
11063
11107
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
|
|
@@ -11108,6 +11152,8 @@ const Methods = {
|
|
|
11108
11152
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
11109
11153
|
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
11110
11154
|
const bodyTableElem = (0, _util.getRefElem)(elemStore['main-body-table']);
|
|
11155
|
+
const leftBodyTableElem = (0, _util.getRefElem)(elemStore['left-body-table']);
|
|
11156
|
+
const rightbodyTableElem = (0, _util.getRefElem)(elemStore['right-body-table']);
|
|
11111
11157
|
const containerList = ['main', 'left', 'right'];
|
|
11112
11158
|
let ySpaceTop = 0;
|
|
11113
11159
|
let scrollYHeight = 0;
|
|
@@ -11158,12 +11204,17 @@ const Methods = {
|
|
|
11158
11204
|
}
|
|
11159
11205
|
ySpaceHeight = maxYHeight;
|
|
11160
11206
|
}
|
|
11207
|
+
if (leftBodyTableElem) {
|
|
11208
|
+
leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
|
|
11209
|
+
}
|
|
11210
|
+
if (bodyTableElem) {
|
|
11211
|
+
bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
|
|
11212
|
+
}
|
|
11213
|
+
if (rightbodyTableElem) {
|
|
11214
|
+
rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
|
|
11215
|
+
}
|
|
11161
11216
|
containerList.forEach(name => {
|
|
11162
11217
|
const layoutList = ['header', 'body', 'footer'];
|
|
11163
|
-
const tableElem = (0, _util.getRefElem)(elemStore[`${name}-body-table`]);
|
|
11164
|
-
if (tableElem) {
|
|
11165
|
-
tableElem.style.marginTop = scrollYTop ? `${scrollYTop}px` : '';
|
|
11166
|
-
}
|
|
11167
11218
|
layoutList.forEach(layout => {
|
|
11168
11219
|
const ySpaceElem = (0, _util.getRefElem)(elemStore[`${name}-${layout}-ySpace`]);
|
|
11169
11220
|
if (ySpaceElem) {
|