vxe-table 3.13.1 → 3.13.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/mixin.js +9 -6
- package/es/table/src/methods.js +51 -21
- package/es/table/src/table.js +13 -10
- package/es/table/style.css +2 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- 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 -39
- 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/mixin.js +10 -7
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/methods.js +51 -20
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +14 -10
- 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 +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/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/mixin.ts +9 -6
- package/packages/table/src/methods.ts +54 -23
- package/packages/table/src/table.ts +17 -11
- package/styles/components/table.scss +2 -0
- /package/es/{iconfont.1739845316237.ttf → iconfont.1739871566624.ttf} +0 -0
- /package/es/{iconfont.1739845316237.woff → iconfont.1739871566624.woff} +0 -0
- /package/es/{iconfont.1739845316237.woff2 → iconfont.1739871566624.woff2} +0 -0
- /package/lib/{iconfont.1739845316237.ttf → iconfont.1739871566624.ttf} +0 -0
- /package/lib/{iconfont.1739845316237.woff → iconfont.1739871566624.woff} +0 -0
- /package/lib/{iconfont.1739845316237.woff2 → iconfont.1739871566624.woff2} +0 -0
package/es/table/src/methods.js
CHANGED
|
@@ -1794,7 +1794,12 @@ const getWheelSpeed = (lastScrollTime) => {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
return multiple;
|
|
1796
1796
|
};
|
|
1797
|
-
const
|
|
1797
|
+
const wheelScrollLeftTo = (scrollLeft, cb) => {
|
|
1798
|
+
requestAnimationFrame(() => {
|
|
1799
|
+
cb(scrollLeft);
|
|
1800
|
+
});
|
|
1801
|
+
};
|
|
1802
|
+
const wheelScrollTopTo = (diffNum, cb) => {
|
|
1798
1803
|
const duration = Math.abs(diffNum);
|
|
1799
1804
|
const startTime = performance.now();
|
|
1800
1805
|
let countTop = 0;
|
|
@@ -7941,6 +7946,9 @@ const Methods = {
|
|
|
7941
7946
|
const internalData = $xeTable;
|
|
7942
7947
|
const { scrollYLoad, scrollXLoad } = reactData;
|
|
7943
7948
|
const { elemStore, intoRunScroll, lastScrollTop, lastScrollLeft, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll, scrollRenderType, inFooterScroll } = internalData;
|
|
7949
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
7950
|
+
return;
|
|
7951
|
+
}
|
|
7944
7952
|
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
7945
7953
|
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
7946
7954
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
@@ -7949,9 +7957,6 @@ const Methods = {
|
|
|
7949
7957
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
7950
7958
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
7951
7959
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
7952
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
7953
|
-
return;
|
|
7954
|
-
}
|
|
7955
7960
|
if (intoRunScroll) {
|
|
7956
7961
|
return;
|
|
7957
7962
|
}
|
|
@@ -8023,17 +8028,17 @@ const Methods = {
|
|
|
8023
8028
|
const internalData = $xeTable;
|
|
8024
8029
|
const { scrollXLoad } = reactData;
|
|
8025
8030
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inBodyScroll, inFooterScroll } = internalData;
|
|
8026
|
-
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
8027
|
-
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
8028
|
-
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8029
|
-
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8030
|
-
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8031
8031
|
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
8032
8032
|
return;
|
|
8033
8033
|
}
|
|
8034
8034
|
if (intoRunScroll) {
|
|
8035
8035
|
return;
|
|
8036
8036
|
}
|
|
8037
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
8038
|
+
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
8039
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8040
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8041
|
+
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8037
8042
|
if (!headerScrollElem) {
|
|
8038
8043
|
return;
|
|
8039
8044
|
}
|
|
@@ -8065,14 +8070,14 @@ const Methods = {
|
|
|
8065
8070
|
const internalData = $xeTable;
|
|
8066
8071
|
const { scrollXLoad } = reactData;
|
|
8067
8072
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData;
|
|
8073
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
8074
|
+
return;
|
|
8075
|
+
}
|
|
8068
8076
|
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
8069
8077
|
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
8070
8078
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8071
8079
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8072
8080
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8073
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
8074
|
-
return;
|
|
8075
|
-
}
|
|
8076
8081
|
if (intoRunScroll) {
|
|
8077
8082
|
return;
|
|
8078
8083
|
}
|
|
@@ -8111,13 +8116,20 @@ const Methods = {
|
|
|
8111
8116
|
return;
|
|
8112
8117
|
}
|
|
8113
8118
|
const { highlightHoverRow } = tableProps;
|
|
8114
|
-
const { scrollYLoad } = reactData;
|
|
8119
|
+
const { scrollXLoad, scrollYLoad } = reactData;
|
|
8120
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
8121
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
8122
|
+
if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
|
|
8123
|
+
return;
|
|
8124
|
+
}
|
|
8115
8125
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData;
|
|
8116
8126
|
const rowOpts = $xeTable.computeRowOpts;
|
|
8117
8127
|
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
8118
8128
|
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
8119
8129
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
8130
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8120
8131
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8132
|
+
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8121
8133
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
8122
8134
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
8123
8135
|
if (!xHandleEl) {
|
|
@@ -8130,25 +8142,43 @@ const Methods = {
|
|
|
8130
8142
|
return;
|
|
8131
8143
|
}
|
|
8132
8144
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
8133
|
-
const deltaTop = deltaY * wheelSpeed;
|
|
8134
|
-
const deltaLeft = deltaX * wheelSpeed;
|
|
8145
|
+
const deltaTop = Math.ceil(deltaY * wheelSpeed);
|
|
8146
|
+
const deltaLeft = Math.ceil(deltaX * wheelSpeed);
|
|
8135
8147
|
const isTopWheel = deltaTop < 0;
|
|
8136
8148
|
const currScrollTop = bodyScrollElem.scrollTop;
|
|
8137
8149
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
8138
8150
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
8139
8151
|
return;
|
|
8140
8152
|
}
|
|
8141
|
-
const scrollTop =
|
|
8153
|
+
const scrollTop = currScrollTop + deltaTop;
|
|
8142
8154
|
const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
|
|
8143
8155
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
8144
8156
|
const isRollY = scrollTop !== lastScrollTop;
|
|
8157
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
8158
|
+
$xeTable.clearHoverRow();
|
|
8159
|
+
}
|
|
8145
8160
|
// 用于鼠标纵向滚轮处理
|
|
8161
|
+
if (isRollX) {
|
|
8162
|
+
evnt.preventDefault();
|
|
8163
|
+
internalData.inWheelScroll = true;
|
|
8164
|
+
wheelScrollLeftTo(scrollLeft, (offsetLeft) => {
|
|
8165
|
+
const currLeftNum = offsetLeft;
|
|
8166
|
+
setScrollLeft(xHandleEl, currLeftNum);
|
|
8167
|
+
setScrollLeft(bodyScrollElem, currLeftNum);
|
|
8168
|
+
setScrollLeft(headerScrollElem, currLeftNum);
|
|
8169
|
+
setScrollLeft(footerScrollElem, currLeftNum);
|
|
8170
|
+
if (scrollXLoad) {
|
|
8171
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
8172
|
+
}
|
|
8173
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
|
|
8174
|
+
type: 'table',
|
|
8175
|
+
fixed: ''
|
|
8176
|
+
});
|
|
8177
|
+
});
|
|
8178
|
+
}
|
|
8146
8179
|
if (isRollY) {
|
|
8147
8180
|
evnt.preventDefault();
|
|
8148
|
-
|
|
8149
|
-
$xeTable.clearHoverRow();
|
|
8150
|
-
}
|
|
8151
|
-
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, (offsetTop) => {
|
|
8181
|
+
wheelScrollTopTo(scrollTop - currScrollTop, (offsetTop) => {
|
|
8152
8182
|
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
8153
8183
|
internalData.inWheelScroll = true;
|
|
8154
8184
|
setScrollTop(yHandleEl, currTopNum);
|
|
@@ -8159,7 +8189,7 @@ const Methods = {
|
|
|
8159
8189
|
if (scrollYLoad) {
|
|
8160
8190
|
$xeTable.triggerScrollYEvent(evnt);
|
|
8161
8191
|
}
|
|
8162
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
8192
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
|
|
8163
8193
|
type: 'table',
|
|
8164
8194
|
fixed: ''
|
|
8165
8195
|
});
|
package/es/table/src/table.js
CHANGED
|
@@ -311,18 +311,11 @@ function renderViewport(h, $xeTable) {
|
|
|
311
311
|
const props = $xeTable;
|
|
312
312
|
const reactData = $xeTable;
|
|
313
313
|
const { showHeader, showFooter } = props;
|
|
314
|
-
const { overflowX,
|
|
314
|
+
const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData;
|
|
315
315
|
const { leftList, rightList } = columnStore;
|
|
316
|
-
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
317
|
-
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
318
|
-
const ons = {};
|
|
319
|
-
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
320
|
-
ons.wheel = $xeTable.triggerBodyWheelEvent;
|
|
321
|
-
}
|
|
322
316
|
return h('div', {
|
|
323
317
|
ref: 'refTableViewportElem',
|
|
324
|
-
class: 'vxe-table--viewport-wrapper'
|
|
325
|
-
on: ons
|
|
318
|
+
class: 'vxe-table--viewport-wrapper'
|
|
326
319
|
}, [
|
|
327
320
|
h('div', {
|
|
328
321
|
class: 'vxe-table--main-wrapper'
|
|
@@ -1216,6 +1209,7 @@ export default {
|
|
|
1216
1209
|
}
|
|
1217
1210
|
},
|
|
1218
1211
|
created() {
|
|
1212
|
+
const $xeTable = this;
|
|
1219
1213
|
const { scrollXStore, sYOpts, scrollYStore, data, editOpts, treeOpts, treeConfig, showOverflow, rowOpts } = Object.assign(this, {
|
|
1220
1214
|
tZindex: 0,
|
|
1221
1215
|
elemStore: {},
|
|
@@ -1468,7 +1462,7 @@ export default {
|
|
|
1468
1462
|
globalEvents.on(this, 'keydown', this.handleGlobalKeydownEvent);
|
|
1469
1463
|
globalEvents.on(this, 'resize', this.handleGlobalResizeEvent);
|
|
1470
1464
|
globalEvents.on(this, 'contextmenu', this.handleGlobalContextmenuEvent);
|
|
1471
|
-
|
|
1465
|
+
$xeTable.preventEvent(null, 'created');
|
|
1472
1466
|
},
|
|
1473
1467
|
mounted() {
|
|
1474
1468
|
const $xeTable = this;
|
|
@@ -1518,6 +1512,10 @@ export default {
|
|
|
1518
1512
|
resizeObserver.observe(this.getParentElem());
|
|
1519
1513
|
this.$resize = resizeObserver;
|
|
1520
1514
|
}
|
|
1515
|
+
const tableViewportEl = $xeTable.$refs.refTableViewportElem;
|
|
1516
|
+
if (tableViewportEl) {
|
|
1517
|
+
tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, { passive: false });
|
|
1518
|
+
}
|
|
1521
1519
|
this.preventEvent(null, 'mounted');
|
|
1522
1520
|
},
|
|
1523
1521
|
activated() {
|
|
@@ -1528,6 +1526,11 @@ export default {
|
|
|
1528
1526
|
this.preventEvent(null, 'deactivated');
|
|
1529
1527
|
},
|
|
1530
1528
|
beforeDestroy() {
|
|
1529
|
+
const $xeTable = this;
|
|
1530
|
+
const tableViewportEl = $xeTable.$refs.refTableViewportElem;
|
|
1531
|
+
if (tableViewportEl) {
|
|
1532
|
+
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
|
|
1533
|
+
}
|
|
1531
1534
|
if (this.$resize) {
|
|
1532
1535
|
this.$resize.disconnect();
|
|
1533
1536
|
}
|
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,
|