vxe-table 4.11.1 → 4.11.3
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/colgroup/style.css +0 -0
- package/es/colgroup/style.min.css +0 -0
- package/es/column/style.css +0 -0
- package/es/column/style.min.css +0 -0
- package/es/grid/style.css +83 -0
- package/es/grid/style.min.css +1 -0
- package/es/iconfont.1739874198596.ttf +0 -0
- package/es/iconfont.1739874198596.woff +0 -0
- package/es/iconfont.1739874198596.woff2 +0 -0
- 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/src/table.js +63 -27
- package/es/table/style.css +3476 -0
- package/es/table/style.min.css +1 -0
- package/es/toolbar/style.css +90 -0
- package/es/toolbar/style.min.css +1 -0
- package/es/ui/index.js +3 -3
- package/es/ui/src/log.js +1 -1
- package/es/ui/style.css +0 -0
- package/es/ui/style.min.css +0 -0
- package/es/v-x-e-table/style.css +0 -0
- package/es/v-x-e-table/style.min.css +0 -0
- package/es/vxe-colgroup/style.css +0 -0
- package/es/vxe-colgroup/style.min.css +0 -0
- package/es/vxe-column/style.css +0 -0
- package/es/vxe-column/style.min.css +0 -0
- package/es/vxe-grid/style.css +83 -0
- package/es/vxe-grid/style.min.css +1 -0
- package/es/vxe-table/style.css +3476 -0
- package/es/vxe-table/style.min.css +1 -0
- package/es/vxe-toolbar/style.css +90 -0
- package/es/vxe-toolbar/style.min.css +1 -0
- package/es/vxe-ui/style.css +0 -0
- package/es/vxe-ui/style.min.css +0 -0
- package/es/vxe-v-x-e-table/style.css +0 -0
- package/es/vxe-v-x-e-table/style.min.css +0 -0
- package/lib/colgroup/style/index.js +1 -0
- package/lib/colgroup/style/style.css +0 -0
- package/lib/colgroup/style/style.min.css +0 -0
- package/lib/column/style/index.js +1 -0
- package/lib/column/style/style.css +0 -0
- package/lib/column/style/style.min.css +0 -0
- package/lib/grid/style/index.js +1 -0
- package/lib/grid/style/style.css +83 -0
- package/lib/grid/style/style.min.css +1 -0
- package/lib/iconfont.1739874198596.ttf +0 -0
- package/lib/iconfont.1739874198596.woff +0 -0
- package/lib/iconfont.1739874198596.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +65 -31
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +715 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +722 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +715 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +715 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +715 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +715 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +715 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +715 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +715 -0
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +23 -0
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +23 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +23 -0
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +23 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/table.js +62 -27
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/index.js +1 -0
- package/lib/table/style/style.css +3476 -0
- package/lib/table/style/style.min.css +1 -0
- package/lib/toolbar/style/index.js +1 -0
- package/lib/toolbar/style/style.css +90 -0
- package/lib/toolbar/style/style.min.css +1 -0
- 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/ui/style/index.js +1 -0
- package/lib/ui/style/style.css +0 -0
- package/lib/ui/style/style.min.css +0 -0
- package/lib/v-x-e-table/style/index.js +1 -0
- package/lib/v-x-e-table/style/style.css +0 -0
- package/lib/v-x-e-table/style/style.min.css +0 -0
- package/lib/vxe-colgroup/style/index.js +1 -0
- package/lib/vxe-colgroup/style/style.css +0 -0
- package/lib/vxe-colgroup/style/style.min.css +0 -0
- package/lib/vxe-column/style/index.js +1 -0
- package/lib/vxe-column/style/style.css +0 -0
- package/lib/vxe-column/style/style.min.css +0 -0
- package/lib/vxe-grid/style/index.js +1 -0
- package/lib/vxe-grid/style/style.css +83 -0
- package/lib/vxe-grid/style/style.min.css +1 -0
- package/lib/vxe-table/style/index.js +1 -0
- package/lib/vxe-table/style/style.css +3476 -0
- package/lib/vxe-table/style/style.min.css +1 -0
- package/lib/vxe-toolbar/style/index.js +1 -0
- package/lib/vxe-toolbar/style/style.css +90 -0
- package/lib/vxe-toolbar/style/style.min.css +1 -0
- package/lib/vxe-ui/style/index.js +1 -0
- package/lib/vxe-ui/style/style.css +0 -0
- package/lib/vxe-ui/style/style.min.css +0 -0
- package/lib/vxe-v-x-e-table/style/index.js +1 -0
- package/lib/vxe-v-x-e-table/style/style.css +0 -0
- package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
- package/package.json +1 -1
- package/packages/table/src/table.ts +66 -31
- package/packages/ui/index.ts +2 -2
- package/styles/components/table.scss +2 -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
|
}
|
|
@@ -8714,14 +8719,14 @@ export default defineComponent({
|
|
|
8714
8719
|
triggerHeaderScrollEvent(evnt, fixedType) {
|
|
8715
8720
|
const { scrollXLoad } = reactData;
|
|
8716
8721
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inBodyScroll, inFooterScroll } = internalData;
|
|
8722
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
8723
|
+
return;
|
|
8724
|
+
}
|
|
8717
8725
|
const yHandleEl = refScrollYHandleElem.value;
|
|
8718
8726
|
const xHandleEl = refScrollXHandleElem.value;
|
|
8719
8727
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8720
8728
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8721
8729
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8722
|
-
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
8723
|
-
return;
|
|
8724
|
-
}
|
|
8725
8730
|
if (intoRunScroll) {
|
|
8726
8731
|
return;
|
|
8727
8732
|
}
|
|
@@ -8753,14 +8758,14 @@ export default defineComponent({
|
|
|
8753
8758
|
triggerFooterScrollEvent(evnt, fixedType) {
|
|
8754
8759
|
const { scrollXLoad } = reactData;
|
|
8755
8760
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData;
|
|
8761
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
8762
|
+
return;
|
|
8763
|
+
}
|
|
8756
8764
|
const yHandleEl = refScrollYHandleElem.value;
|
|
8757
8765
|
const xHandleEl = refScrollXHandleElem.value;
|
|
8758
8766
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8759
8767
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8760
8768
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8761
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
8762
|
-
return;
|
|
8763
|
-
}
|
|
8764
8769
|
if (intoRunScroll) {
|
|
8765
8770
|
return;
|
|
8766
8771
|
}
|
|
@@ -8795,13 +8800,20 @@ export default defineComponent({
|
|
|
8795
8800
|
return;
|
|
8796
8801
|
}
|
|
8797
8802
|
const { highlightHoverRow } = tableProps;
|
|
8798
|
-
const { scrollYLoad } = reactData;
|
|
8803
|
+
const { scrollXLoad, scrollYLoad } = reactData;
|
|
8804
|
+
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
8805
|
+
const rightFixedWidth = computeRightFixedWidth.value;
|
|
8806
|
+
if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
|
|
8807
|
+
return;
|
|
8808
|
+
}
|
|
8799
8809
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData;
|
|
8800
8810
|
const rowOpts = computeRowOpts.value;
|
|
8801
8811
|
const xHandleEl = refScrollXHandleElem.value;
|
|
8802
8812
|
const yHandleEl = refScrollYHandleElem.value;
|
|
8803
8813
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
8814
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
8804
8815
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8816
|
+
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
8805
8817
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
8806
8818
|
const rowExpandEl = refRowExpandElem.value;
|
|
8807
8819
|
if (!xHandleEl) {
|
|
@@ -8814,24 +8826,43 @@ export default defineComponent({
|
|
|
8814
8826
|
return;
|
|
8815
8827
|
}
|
|
8816
8828
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
8817
|
-
const deltaTop = deltaY * wheelSpeed;
|
|
8818
|
-
const deltaLeft = deltaX * wheelSpeed;
|
|
8829
|
+
const deltaTop = Math.ceil(deltaY * wheelSpeed);
|
|
8830
|
+
const deltaLeft = Math.ceil(deltaX * wheelSpeed);
|
|
8819
8831
|
const isTopWheel = deltaTop < 0;
|
|
8820
8832
|
const currScrollTop = bodyScrollElem.scrollTop;
|
|
8821
8833
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
8822
8834
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
8823
8835
|
return;
|
|
8824
8836
|
}
|
|
8825
|
-
const scrollTop =
|
|
8837
|
+
const scrollTop = currScrollTop + deltaTop;
|
|
8826
8838
|
const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
|
|
8827
8839
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
8828
8840
|
const isRollY = scrollTop !== lastScrollTop;
|
|
8841
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
8842
|
+
$xeTable.clearHoverRow();
|
|
8843
|
+
}
|
|
8829
8844
|
// 用于鼠标纵向滚轮处理
|
|
8845
|
+
if (isRollX) {
|
|
8846
|
+
evnt.preventDefault();
|
|
8847
|
+
internalData.inWheelScroll = true;
|
|
8848
|
+
wheelScrollLeftTo(scrollLeft, (offsetLeft) => {
|
|
8849
|
+
const currLeftNum = offsetLeft;
|
|
8850
|
+
setScrollLeft(xHandleEl, currLeftNum);
|
|
8851
|
+
setScrollLeft(bodyScrollElem, currLeftNum);
|
|
8852
|
+
setScrollLeft(headerScrollElem, currLeftNum);
|
|
8853
|
+
setScrollLeft(footerScrollElem, currLeftNum);
|
|
8854
|
+
if (scrollXLoad) {
|
|
8855
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
8856
|
+
}
|
|
8857
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
|
|
8858
|
+
type: 'table',
|
|
8859
|
+
fixed: ''
|
|
8860
|
+
});
|
|
8861
|
+
});
|
|
8862
|
+
}
|
|
8830
8863
|
if (isRollY) {
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
}
|
|
8834
|
-
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, (offsetTop) => {
|
|
8864
|
+
evnt.preventDefault();
|
|
8865
|
+
wheelScrollTopTo(scrollTop - currScrollTop, (offsetTop) => {
|
|
8835
8866
|
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
8836
8867
|
internalData.inWheelScroll = true;
|
|
8837
8868
|
setScrollTop(yHandleEl, currTopNum);
|
|
@@ -8842,7 +8873,7 @@ export default defineComponent({
|
|
|
8842
8873
|
if (scrollYLoad) {
|
|
8843
8874
|
$xeTable.triggerScrollYEvent(evnt);
|
|
8844
8875
|
}
|
|
8845
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
8876
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
|
|
8846
8877
|
type: 'table',
|
|
8847
8878
|
fixed: ''
|
|
8848
8879
|
});
|
|
@@ -9429,15 +9460,12 @@ export default defineComponent({
|
|
|
9429
9460
|
};
|
|
9430
9461
|
const renderViewport = () => {
|
|
9431
9462
|
const { showHeader, showFooter } = props;
|
|
9432
|
-
const { overflowX,
|
|
9463
|
+
const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData;
|
|
9433
9464
|
const { leftList, rightList } = columnStore;
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
ons.onWheelPassive = $xeTable.triggerBodyWheelEvent;
|
|
9439
|
-
}
|
|
9440
|
-
return h('div', Object.assign({ ref: refTableViewportElem, class: 'vxe-table--viewport-wrapper' }, ons), [
|
|
9465
|
+
return h('div', {
|
|
9466
|
+
ref: refTableViewportElem,
|
|
9467
|
+
class: 'vxe-table--viewport-wrapper'
|
|
9468
|
+
}, [
|
|
9441
9469
|
h('div', {
|
|
9442
9470
|
class: 'vxe-table--main-wrapper'
|
|
9443
9471
|
}, [
|
|
@@ -10104,6 +10132,10 @@ export default defineComponent({
|
|
|
10104
10132
|
}
|
|
10105
10133
|
}
|
|
10106
10134
|
});
|
|
10135
|
+
const tableViewportEl = refTableViewportElem.value;
|
|
10136
|
+
if (tableViewportEl) {
|
|
10137
|
+
tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, { passive: false });
|
|
10138
|
+
}
|
|
10107
10139
|
globalEvents.on($xeTable, 'paste', handleGlobalPasteEvent);
|
|
10108
10140
|
globalEvents.on($xeTable, 'copy', handleGlobalCopyEvent);
|
|
10109
10141
|
globalEvents.on($xeTable, 'cut', handleGlobalCutEvent);
|
|
@@ -10116,6 +10148,10 @@ export default defineComponent({
|
|
|
10116
10148
|
tablePrivateMethods.preventEvent(null, 'mounted', { $table: $xeTable });
|
|
10117
10149
|
});
|
|
10118
10150
|
onBeforeUnmount(() => {
|
|
10151
|
+
const tableViewportEl = refTableViewportElem.value;
|
|
10152
|
+
if (tableViewportEl) {
|
|
10153
|
+
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
|
|
10154
|
+
}
|
|
10119
10155
|
if (resizeObserver) {
|
|
10120
10156
|
resizeObserver.disconnect();
|
|
10121
10157
|
}
|