vxe-table 4.11.0 → 4.11.2
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/export/hook.js +9 -6
- package/es/table/src/table.js +65 -27
- package/es/table/style.css +2 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +3 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +2 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +77 -38
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/export/hook.js +10 -7
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/table.js +64 -27
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +2 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +3 -3
- 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/lib/vxe-table/style/style.css +2 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/export/hook.ts +9 -6
- package/packages/table/src/table.ts +68 -31
- package/packages/ui/index.ts +2 -2
- package/styles/components/table.scss +2 -0
- /package/es/{iconfont.1739842441645.ttf → iconfont.1739871583820.ttf} +0 -0
- /package/es/{iconfont.1739842441645.woff → iconfont.1739871583820.woff} +0 -0
- /package/es/{iconfont.1739842441645.woff2 → iconfont.1739871583820.woff2} +0 -0
- /package/lib/{iconfont.1739842441645.ttf → iconfont.1739871583820.ttf} +0 -0
- /package/lib/{iconfont.1739842441645.woff → iconfont.1739871583820.woff} +0 -0
- /package/lib/{iconfont.1739842441645.woff2 → iconfont.1739871583820.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -3236,7 +3236,12 @@ export default defineComponent({
|
|
|
3236
3236
|
}
|
|
3237
3237
|
return multiple;
|
|
3238
3238
|
};
|
|
3239
|
-
const
|
|
3239
|
+
const wheelScrollLeftTo = (scrollLeft, cb) => {
|
|
3240
|
+
requestAnimationFrame(() => {
|
|
3241
|
+
cb(scrollLeft);
|
|
3242
|
+
});
|
|
3243
|
+
};
|
|
3244
|
+
const wheelScrollTopTo = (diffNum, cb) => {
|
|
3240
3245
|
const duration = Math.abs(diffNum);
|
|
3241
3246
|
const startTime = performance.now();
|
|
3242
3247
|
let countTop = 0;
|
|
@@ -8635,6 +8640,9 @@ export default defineComponent({
|
|
|
8635
8640
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
8636
8641
|
const { scrollYLoad, scrollXLoad } = reactData;
|
|
8637
8642
|
const { elemStore, intoRunScroll, lastScrollTop, lastScrollLeft, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll, scrollRenderType, inFooterScroll } = internalData;
|
|
8643
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
8644
|
+
return;
|
|
8645
|
+
}
|
|
8638
8646
|
const xHandleEl = refScrollXHandleElem.value;
|
|
8639
8647
|
const yHandleEl = refScrollYHandleElem.value;
|
|
8640
8648
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
@@ -8643,9 +8651,6 @@ export default defineComponent({
|
|
|
8643
8651
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8644
8652
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8645
8653
|
const rowExpandEl = refRowExpandElem.value;
|
|
8646
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
8647
|
-
return;
|
|
8648
|
-
}
|
|
8649
8654
|
if (intoRunScroll) {
|
|
8650
8655
|
return;
|
|
8651
8656
|
}
|
|
@@ -8663,6 +8668,7 @@ export default defineComponent({
|
|
|
8663
8668
|
return;
|
|
8664
8669
|
}
|
|
8665
8670
|
}
|
|
8671
|
+
console.log('triggerBodyScrollEvent', 11);
|
|
8666
8672
|
let scrollTop = yHandleEl.scrollTop;
|
|
8667
8673
|
let scrollLeft = xHandleEl.scrollLeft;
|
|
8668
8674
|
if (leftScrollElem && fixedType === 'left') {
|
|
@@ -8714,14 +8720,14 @@ export default defineComponent({
|
|
|
8714
8720
|
triggerHeaderScrollEvent(evnt, fixedType) {
|
|
8715
8721
|
const { scrollXLoad } = reactData;
|
|
8716
8722
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inBodyScroll, inFooterScroll } = internalData;
|
|
8723
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
8724
|
+
return;
|
|
8725
|
+
}
|
|
8717
8726
|
const yHandleEl = refScrollYHandleElem.value;
|
|
8718
8727
|
const xHandleEl = refScrollXHandleElem.value;
|
|
8719
8728
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8720
8729
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8721
8730
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8722
|
-
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
8723
|
-
return;
|
|
8724
|
-
}
|
|
8725
8731
|
if (intoRunScroll) {
|
|
8726
8732
|
return;
|
|
8727
8733
|
}
|
|
@@ -8734,6 +8740,7 @@ export default defineComponent({
|
|
|
8734
8740
|
if (!yHandleEl) {
|
|
8735
8741
|
return;
|
|
8736
8742
|
}
|
|
8743
|
+
console.log('triggerHeaderScrollEvent', 11);
|
|
8737
8744
|
const scrollTop = yHandleEl.scrollTop;
|
|
8738
8745
|
const scrollLeft = headerScrollElem.scrollLeft;
|
|
8739
8746
|
const isRollX = true;
|
|
@@ -8753,14 +8760,14 @@ export default defineComponent({
|
|
|
8753
8760
|
triggerFooterScrollEvent(evnt, fixedType) {
|
|
8754
8761
|
const { scrollXLoad } = reactData;
|
|
8755
8762
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData;
|
|
8763
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
8764
|
+
return;
|
|
8765
|
+
}
|
|
8756
8766
|
const yHandleEl = refScrollYHandleElem.value;
|
|
8757
8767
|
const xHandleEl = refScrollXHandleElem.value;
|
|
8758
8768
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8759
8769
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8760
8770
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8761
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
8762
|
-
return;
|
|
8763
|
-
}
|
|
8764
8771
|
if (intoRunScroll) {
|
|
8765
8772
|
return;
|
|
8766
8773
|
}
|
|
@@ -8773,6 +8780,7 @@ export default defineComponent({
|
|
|
8773
8780
|
if (!yHandleEl) {
|
|
8774
8781
|
return;
|
|
8775
8782
|
}
|
|
8783
|
+
console.log('triggerFooterScrollEvent');
|
|
8776
8784
|
const scrollTop = yHandleEl.scrollTop;
|
|
8777
8785
|
const scrollLeft = footerScrollElem.scrollLeft;
|
|
8778
8786
|
const isRollX = true;
|
|
@@ -8795,13 +8803,20 @@ export default defineComponent({
|
|
|
8795
8803
|
return;
|
|
8796
8804
|
}
|
|
8797
8805
|
const { highlightHoverRow } = tableProps;
|
|
8798
|
-
const { scrollYLoad } = reactData;
|
|
8806
|
+
const { scrollXLoad, scrollYLoad } = reactData;
|
|
8807
|
+
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
8808
|
+
const rightFixedWidth = computeRightFixedWidth.value;
|
|
8809
|
+
if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
|
|
8810
|
+
return;
|
|
8811
|
+
}
|
|
8799
8812
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData;
|
|
8800
8813
|
const rowOpts = computeRowOpts.value;
|
|
8801
8814
|
const xHandleEl = refScrollXHandleElem.value;
|
|
8802
8815
|
const yHandleEl = refScrollYHandleElem.value;
|
|
8803
8816
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
8817
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8804
8818
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8819
|
+
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8805
8820
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
8806
8821
|
const rowExpandEl = refRowExpandElem.value;
|
|
8807
8822
|
if (!xHandleEl) {
|
|
@@ -8814,25 +8829,43 @@ export default defineComponent({
|
|
|
8814
8829
|
return;
|
|
8815
8830
|
}
|
|
8816
8831
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
8817
|
-
const deltaTop = deltaY * wheelSpeed;
|
|
8818
|
-
const deltaLeft = deltaX * wheelSpeed;
|
|
8832
|
+
const deltaTop = Math.ceil(deltaY * wheelSpeed);
|
|
8833
|
+
const deltaLeft = Math.ceil(deltaX * wheelSpeed);
|
|
8819
8834
|
const isTopWheel = deltaTop < 0;
|
|
8820
8835
|
const currScrollTop = bodyScrollElem.scrollTop;
|
|
8821
8836
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
8822
8837
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
8823
8838
|
return;
|
|
8824
8839
|
}
|
|
8825
|
-
const scrollTop =
|
|
8840
|
+
const scrollTop = currScrollTop + deltaTop;
|
|
8826
8841
|
const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
|
|
8827
8842
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
8828
8843
|
const isRollY = scrollTop !== lastScrollTop;
|
|
8844
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
8845
|
+
$xeTable.clearHoverRow();
|
|
8846
|
+
}
|
|
8829
8847
|
// 用于鼠标纵向滚轮处理
|
|
8848
|
+
if (isRollX) {
|
|
8849
|
+
evnt.preventDefault();
|
|
8850
|
+
internalData.inWheelScroll = true;
|
|
8851
|
+
wheelScrollLeftTo(scrollLeft, (offsetLeft) => {
|
|
8852
|
+
const currLeftNum = offsetLeft;
|
|
8853
|
+
setScrollLeft(xHandleEl, currLeftNum);
|
|
8854
|
+
setScrollLeft(bodyScrollElem, currLeftNum);
|
|
8855
|
+
setScrollLeft(headerScrollElem, currLeftNum);
|
|
8856
|
+
setScrollLeft(footerScrollElem, currLeftNum);
|
|
8857
|
+
if (scrollXLoad) {
|
|
8858
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
8859
|
+
}
|
|
8860
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
|
|
8861
|
+
type: 'table',
|
|
8862
|
+
fixed: ''
|
|
8863
|
+
});
|
|
8864
|
+
});
|
|
8865
|
+
}
|
|
8830
8866
|
if (isRollY) {
|
|
8831
8867
|
evnt.preventDefault();
|
|
8832
|
-
|
|
8833
|
-
$xeTable.clearHoverRow();
|
|
8834
|
-
}
|
|
8835
|
-
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, (offsetTop) => {
|
|
8868
|
+
wheelScrollTopTo(scrollTop - currScrollTop, (offsetTop) => {
|
|
8836
8869
|
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
8837
8870
|
internalData.inWheelScroll = true;
|
|
8838
8871
|
setScrollTop(yHandleEl, currTopNum);
|
|
@@ -8843,7 +8876,7 @@ export default defineComponent({
|
|
|
8843
8876
|
if (scrollYLoad) {
|
|
8844
8877
|
$xeTable.triggerScrollYEvent(evnt);
|
|
8845
8878
|
}
|
|
8846
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
8879
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
|
|
8847
8880
|
type: 'table',
|
|
8848
8881
|
fixed: ''
|
|
8849
8882
|
});
|
|
@@ -9430,15 +9463,12 @@ export default defineComponent({
|
|
|
9430
9463
|
};
|
|
9431
9464
|
const renderViewport = () => {
|
|
9432
9465
|
const { showHeader, showFooter } = props;
|
|
9433
|
-
const { overflowX,
|
|
9466
|
+
const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData;
|
|
9434
9467
|
const { leftList, rightList } = columnStore;
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
ons.onWheel = $xeTable.triggerBodyWheelEvent;
|
|
9440
|
-
}
|
|
9441
|
-
return h('div', Object.assign({ ref: refTableViewportElem, class: 'vxe-table--viewport-wrapper' }, ons), [
|
|
9468
|
+
return h('div', {
|
|
9469
|
+
ref: refTableViewportElem,
|
|
9470
|
+
class: 'vxe-table--viewport-wrapper'
|
|
9471
|
+
}, [
|
|
9442
9472
|
h('div', {
|
|
9443
9473
|
class: 'vxe-table--main-wrapper'
|
|
9444
9474
|
}, [
|
|
@@ -10105,6 +10135,10 @@ export default defineComponent({
|
|
|
10105
10135
|
}
|
|
10106
10136
|
}
|
|
10107
10137
|
});
|
|
10138
|
+
const tableViewportEl = refTableViewportElem.value;
|
|
10139
|
+
if (tableViewportEl) {
|
|
10140
|
+
tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, { passive: false });
|
|
10141
|
+
}
|
|
10108
10142
|
globalEvents.on($xeTable, 'paste', handleGlobalPasteEvent);
|
|
10109
10143
|
globalEvents.on($xeTable, 'copy', handleGlobalCopyEvent);
|
|
10110
10144
|
globalEvents.on($xeTable, 'cut', handleGlobalCutEvent);
|
|
@@ -10117,6 +10151,10 @@ export default defineComponent({
|
|
|
10117
10151
|
tablePrivateMethods.preventEvent(null, 'mounted', { $table: $xeTable });
|
|
10118
10152
|
});
|
|
10119
10153
|
onBeforeUnmount(() => {
|
|
10154
|
+
const tableViewportEl = refTableViewportElem.value;
|
|
10155
|
+
if (tableViewportEl) {
|
|
10156
|
+
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
|
|
10157
|
+
}
|
|
10120
10158
|
if (resizeObserver) {
|
|
10121
10159
|
resizeObserver.disconnect();
|
|
10122
10160
|
}
|
package/es/table/style.css
CHANGED
|
@@ -1734,6 +1734,7 @@
|
|
|
1734
1734
|
overflow: hidden;
|
|
1735
1735
|
outline: 0;
|
|
1736
1736
|
scrollbar-width: none;
|
|
1737
|
+
-webkit-overflow-scrolling: touch;
|
|
1737
1738
|
}
|
|
1738
1739
|
|
|
1739
1740
|
.vxe-table--header-inner-wrapper,
|
|
@@ -1744,6 +1745,7 @@
|
|
|
1744
1745
|
height: 100%;
|
|
1745
1746
|
scrollbar-width: none;
|
|
1746
1747
|
-ms-overflow-style: none;
|
|
1748
|
+
-webkit-overflow-scrolling: touch;
|
|
1747
1749
|
}
|
|
1748
1750
|
.vxe-table--header-inner-wrapper::-webkit-scrollbar,
|
|
1749
1751
|
.vxe-table--body-inner-wrapper::-webkit-scrollbar,
|