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.
Files changed (125) hide show
  1. package/es/colgroup/style.css +0 -0
  2. package/es/colgroup/style.min.css +0 -0
  3. package/es/column/style.css +0 -0
  4. package/es/column/style.min.css +0 -0
  5. package/es/grid/style.css +83 -0
  6. package/es/grid/style.min.css +1 -0
  7. package/es/iconfont.1739874198596.ttf +0 -0
  8. package/es/iconfont.1739874198596.woff +0 -0
  9. package/es/iconfont.1739874198596.woff2 +0 -0
  10. package/es/index.css +1 -1
  11. package/es/index.min.css +1 -1
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/table/src/table.js +63 -27
  15. package/es/table/style.css +3476 -0
  16. package/es/table/style.min.css +1 -0
  17. package/es/toolbar/style.css +90 -0
  18. package/es/toolbar/style.min.css +1 -0
  19. package/es/ui/index.js +3 -3
  20. package/es/ui/src/log.js +1 -1
  21. package/es/ui/style.css +0 -0
  22. package/es/ui/style.min.css +0 -0
  23. package/es/v-x-e-table/style.css +0 -0
  24. package/es/v-x-e-table/style.min.css +0 -0
  25. package/es/vxe-colgroup/style.css +0 -0
  26. package/es/vxe-colgroup/style.min.css +0 -0
  27. package/es/vxe-column/style.css +0 -0
  28. package/es/vxe-column/style.min.css +0 -0
  29. package/es/vxe-grid/style.css +83 -0
  30. package/es/vxe-grid/style.min.css +1 -0
  31. package/es/vxe-table/style.css +3476 -0
  32. package/es/vxe-table/style.min.css +1 -0
  33. package/es/vxe-toolbar/style.css +90 -0
  34. package/es/vxe-toolbar/style.min.css +1 -0
  35. package/es/vxe-ui/style.css +0 -0
  36. package/es/vxe-ui/style.min.css +0 -0
  37. package/es/vxe-v-x-e-table/style.css +0 -0
  38. package/es/vxe-v-x-e-table/style.min.css +0 -0
  39. package/lib/colgroup/style/index.js +1 -0
  40. package/lib/colgroup/style/style.css +0 -0
  41. package/lib/colgroup/style/style.min.css +0 -0
  42. package/lib/column/style/index.js +1 -0
  43. package/lib/column/style/style.css +0 -0
  44. package/lib/column/style/style.min.css +0 -0
  45. package/lib/grid/style/index.js +1 -0
  46. package/lib/grid/style/style.css +83 -0
  47. package/lib/grid/style/style.min.css +1 -0
  48. package/lib/iconfont.1739874198596.ttf +0 -0
  49. package/lib/iconfont.1739874198596.woff +0 -0
  50. package/lib/iconfont.1739874198596.woff2 +0 -0
  51. package/lib/index.css +1 -1
  52. package/lib/index.min.css +1 -1
  53. package/lib/index.umd.js +65 -31
  54. package/lib/index.umd.min.js +1 -1
  55. package/lib/locale/lang/en-US.min.js +1 -1
  56. package/lib/locale/lang/en-US.umd.js +715 -0
  57. package/lib/locale/lang/es-ES.min.js +1 -1
  58. package/lib/locale/lang/es-ES.umd.js +722 -0
  59. package/lib/locale/lang/hu-HU.min.js +1 -1
  60. package/lib/locale/lang/hu-HU.umd.js +715 -0
  61. package/lib/locale/lang/ja-JP.min.js +1 -1
  62. package/lib/locale/lang/ja-JP.umd.js +715 -0
  63. package/lib/locale/lang/ko-KR.min.js +1 -1
  64. package/lib/locale/lang/ko-KR.umd.js +715 -0
  65. package/lib/locale/lang/pt-BR.min.js +1 -1
  66. package/lib/locale/lang/pt-BR.umd.js +715 -0
  67. package/lib/locale/lang/ru-RU.min.js +1 -1
  68. package/lib/locale/lang/ru-RU.umd.js +715 -0
  69. package/lib/locale/lang/uk-UA.min.js +1 -1
  70. package/lib/locale/lang/uk-UA.umd.js +715 -0
  71. package/lib/locale/lang/zh-CN.min.js +1 -1
  72. package/lib/locale/lang/zh-CN.umd.js +715 -0
  73. package/lib/locale/lang/zh-HK.min.js +1 -1
  74. package/lib/locale/lang/zh-HK.umd.js +23 -0
  75. package/lib/locale/lang/zh-MO.min.js +1 -1
  76. package/lib/locale/lang/zh-MO.umd.js +23 -0
  77. package/lib/locale/lang/zh-TC.min.js +1 -1
  78. package/lib/locale/lang/zh-TC.umd.js +23 -0
  79. package/lib/locale/lang/zh-TW.min.js +1 -1
  80. package/lib/locale/lang/zh-TW.umd.js +23 -0
  81. package/lib/style.css +1 -1
  82. package/lib/style.min.css +1 -1
  83. package/lib/table/src/table.js +62 -27
  84. package/lib/table/src/table.min.js +1 -1
  85. package/lib/table/style/index.js +1 -0
  86. package/lib/table/style/style.css +3476 -0
  87. package/lib/table/style/style.min.css +1 -0
  88. package/lib/toolbar/style/index.js +1 -0
  89. package/lib/toolbar/style/style.css +90 -0
  90. package/lib/toolbar/style/style.min.css +1 -0
  91. package/lib/ui/index.js +3 -3
  92. package/lib/ui/index.min.js +1 -1
  93. package/lib/ui/src/log.js +1 -1
  94. package/lib/ui/src/log.min.js +1 -1
  95. package/lib/ui/style/index.js +1 -0
  96. package/lib/ui/style/style.css +0 -0
  97. package/lib/ui/style/style.min.css +0 -0
  98. package/lib/v-x-e-table/style/index.js +1 -0
  99. package/lib/v-x-e-table/style/style.css +0 -0
  100. package/lib/v-x-e-table/style/style.min.css +0 -0
  101. package/lib/vxe-colgroup/style/index.js +1 -0
  102. package/lib/vxe-colgroup/style/style.css +0 -0
  103. package/lib/vxe-colgroup/style/style.min.css +0 -0
  104. package/lib/vxe-column/style/index.js +1 -0
  105. package/lib/vxe-column/style/style.css +0 -0
  106. package/lib/vxe-column/style/style.min.css +0 -0
  107. package/lib/vxe-grid/style/index.js +1 -0
  108. package/lib/vxe-grid/style/style.css +83 -0
  109. package/lib/vxe-grid/style/style.min.css +1 -0
  110. package/lib/vxe-table/style/index.js +1 -0
  111. package/lib/vxe-table/style/style.css +3476 -0
  112. package/lib/vxe-table/style/style.min.css +1 -0
  113. package/lib/vxe-toolbar/style/index.js +1 -0
  114. package/lib/vxe-toolbar/style/style.css +90 -0
  115. package/lib/vxe-toolbar/style/style.min.css +1 -0
  116. package/lib/vxe-ui/style/index.js +1 -0
  117. package/lib/vxe-ui/style/style.css +0 -0
  118. package/lib/vxe-ui/style/style.min.css +0 -0
  119. package/lib/vxe-v-x-e-table/style/index.js +1 -0
  120. package/lib/vxe-v-x-e-table/style/style.css +0 -0
  121. package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
  122. package/package.json +1 -1
  123. package/packages/table/src/table.ts +66 -31
  124. package/packages/ui/index.ts +2 -2
  125. package/styles/components/table.scss +2 -0
@@ -3236,7 +3236,12 @@ export default defineComponent({
3236
3236
  }
3237
3237
  return multiple;
3238
3238
  };
3239
- const wheelScrollTo = (diffNum, cb) => {
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 = bodyScrollElem.scrollTop + deltaTop;
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
- if (rowOpts.isHover || highlightHoverRow) {
8832
- $xeTable.clearHoverRow();
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, scrollYLoad, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData;
9463
+ const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData;
9433
9464
  const { leftList, rightList } = columnStore;
9434
- const leftFixedWidth = computeLeftFixedWidth.value;
9435
- const rightFixedWidth = computeRightFixedWidth.value;
9436
- const ons = {};
9437
- if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
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
  }