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
@@ -3793,7 +3793,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
3793
3793
  }
3794
3794
  return multiple;
3795
3795
  };
3796
- const wheelScrollTo = (diffNum, cb) => {
3796
+ const wheelScrollLeftTo = (scrollLeft, cb) => {
3797
+ requestAnimationFrame(() => {
3798
+ cb(scrollLeft);
3799
+ });
3800
+ };
3801
+ const wheelScrollTopTo = (diffNum, cb) => {
3797
3802
  const duration = Math.abs(diffNum);
3798
3803
  const startTime = performance.now();
3799
3804
  let countTop = 0;
@@ -10033,6 +10038,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
10033
10038
  scrollRenderType,
10034
10039
  inFooterScroll
10035
10040
  } = internalData;
10041
+ if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
10042
+ return;
10043
+ }
10036
10044
  const xHandleEl = refScrollXHandleElem.value;
10037
10045
  const yHandleEl = refScrollYHandleElem.value;
10038
10046
  const leftScrollElem = (0, _util.getRefElem)(elemStore['left-body-scroll']);
@@ -10041,9 +10049,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
10041
10049
  const headerScrollElem = (0, _util.getRefElem)(elemStore['main-header-scroll']);
10042
10050
  const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
10043
10051
  const rowExpandEl = refRowExpandElem.value;
10044
- if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
10045
- return;
10046
- }
10047
10052
  if (intoRunScroll) {
10048
10053
  return;
10049
10054
  }
@@ -10117,14 +10122,14 @@ var _default = exports.default = (0, _vue.defineComponent)({
10117
10122
  inBodyScroll,
10118
10123
  inFooterScroll
10119
10124
  } = internalData;
10125
+ if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
10126
+ return;
10127
+ }
10120
10128
  const yHandleEl = refScrollYHandleElem.value;
10121
10129
  const xHandleEl = refScrollXHandleElem.value;
10122
10130
  const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
10123
10131
  const headerScrollElem = (0, _util.getRefElem)(elemStore['main-header-scroll']);
10124
10132
  const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
10125
- if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
10126
- return;
10127
- }
10128
10133
  if (intoRunScroll) {
10129
10134
  return;
10130
10135
  }
@@ -10165,14 +10170,14 @@ var _default = exports.default = (0, _vue.defineComponent)({
10165
10170
  inHeaderScroll,
10166
10171
  inBodyScroll
10167
10172
  } = internalData;
10173
+ if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
10174
+ return;
10175
+ }
10168
10176
  const yHandleEl = refScrollYHandleElem.value;
10169
10177
  const xHandleEl = refScrollXHandleElem.value;
10170
10178
  const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
10171
10179
  const headerScrollElem = (0, _util.getRefElem)(elemStore['main-header-scroll']);
10172
10180
  const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
10173
- if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
10174
- return;
10175
- }
10176
10181
  if (intoRunScroll) {
10177
10182
  return;
10178
10183
  }
@@ -10214,8 +10219,14 @@ var _default = exports.default = (0, _vue.defineComponent)({
10214
10219
  highlightHoverRow
10215
10220
  } = _props.default;
10216
10221
  const {
10222
+ scrollXLoad,
10217
10223
  scrollYLoad
10218
10224
  } = reactData;
10225
+ const leftFixedWidth = computeLeftFixedWidth.value;
10226
+ const rightFixedWidth = computeRightFixedWidth.value;
10227
+ if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
10228
+ return;
10229
+ }
10219
10230
  const {
10220
10231
  elemStore,
10221
10232
  lastScrollTop,
@@ -10225,7 +10236,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
10225
10236
  const xHandleEl = refScrollXHandleElem.value;
10226
10237
  const yHandleEl = refScrollYHandleElem.value;
10227
10238
  const leftScrollElem = (0, _util.getRefElem)(elemStore['left-body-scroll']);
10239
+ const headerScrollElem = (0, _util.getRefElem)(elemStore['main-header-scroll']);
10228
10240
  const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
10241
+ const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
10229
10242
  const rightScrollElem = (0, _util.getRefElem)(elemStore['right-body-scroll']);
10230
10243
  const rowExpandEl = refRowExpandElem.value;
10231
10244
  if (!xHandleEl) {
@@ -10238,24 +10251,43 @@ var _default = exports.default = (0, _vue.defineComponent)({
10238
10251
  return;
10239
10252
  }
10240
10253
  const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
10241
- const deltaTop = deltaY * wheelSpeed;
10242
- const deltaLeft = deltaX * wheelSpeed;
10254
+ const deltaTop = Math.ceil(deltaY * wheelSpeed);
10255
+ const deltaLeft = Math.ceil(deltaX * wheelSpeed);
10243
10256
  const isTopWheel = deltaTop < 0;
10244
10257
  const currScrollTop = bodyScrollElem.scrollTop;
10245
10258
  // 如果滚动位置已经是顶部或底部,则不需要触发
10246
10259
  if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
10247
10260
  return;
10248
10261
  }
10249
- const scrollTop = bodyScrollElem.scrollTop + deltaTop;
10262
+ const scrollTop = currScrollTop + deltaTop;
10250
10263
  const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
10251
10264
  const isRollX = scrollLeft !== lastScrollLeft;
10252
10265
  const isRollY = scrollTop !== lastScrollTop;
10266
+ if (rowOpts.isHover || highlightHoverRow) {
10267
+ $xeTable.clearHoverRow();
10268
+ }
10253
10269
  // 用于鼠标纵向滚轮处理
10270
+ if (isRollX) {
10271
+ evnt.preventDefault();
10272
+ internalData.inWheelScroll = true;
10273
+ wheelScrollLeftTo(scrollLeft, offsetLeft => {
10274
+ const currLeftNum = offsetLeft;
10275
+ (0, _dom.setScrollLeft)(xHandleEl, currLeftNum);
10276
+ (0, _dom.setScrollLeft)(bodyScrollElem, currLeftNum);
10277
+ (0, _dom.setScrollLeft)(headerScrollElem, currLeftNum);
10278
+ (0, _dom.setScrollLeft)(footerScrollElem, currLeftNum);
10279
+ if (scrollXLoad) {
10280
+ $xeTable.triggerScrollXEvent(evnt);
10281
+ }
10282
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
10283
+ type: 'table',
10284
+ fixed: ''
10285
+ });
10286
+ });
10287
+ }
10254
10288
  if (isRollY) {
10255
- if (rowOpts.isHover || highlightHoverRow) {
10256
- $xeTable.clearHoverRow();
10257
- }
10258
- wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
10289
+ evnt.preventDefault();
10290
+ wheelScrollTopTo(scrollTop - currScrollTop, offsetTop => {
10259
10291
  const currTopNum = bodyScrollElem.scrollTop + offsetTop;
10260
10292
  internalData.inWheelScroll = true;
10261
10293
  (0, _dom.setScrollTop)(yHandleEl, currTopNum);
@@ -10266,7 +10298,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
10266
10298
  if (scrollYLoad) {
10267
10299
  $xeTable.triggerScrollYEvent(evnt);
10268
10300
  }
10269
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
10301
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
10270
10302
  type: 'table',
10271
10303
  fixed: ''
10272
10304
  });
@@ -10915,7 +10947,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
10915
10947
  } = props;
10916
10948
  const {
10917
10949
  overflowX,
10918
- scrollYLoad,
10919
10950
  tableData,
10920
10951
  tableColumn,
10921
10952
  tableGroupColumn,
@@ -10926,16 +10957,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
10926
10957
  leftList,
10927
10958
  rightList
10928
10959
  } = columnStore;
10929
- const leftFixedWidth = computeLeftFixedWidth.value;
10930
- const rightFixedWidth = computeRightFixedWidth.value;
10931
- const ons = {};
10932
- if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
10933
- ons.onWheelPassive = $xeTable.triggerBodyWheelEvent;
10934
- }
10935
- return (0, _vue.h)('div', Object.assign({
10960
+ return (0, _vue.h)('div', {
10936
10961
  ref: refTableViewportElem,
10937
10962
  class: 'vxe-table--viewport-wrapper'
10938
- }, ons), [(0, _vue.h)('div', {
10963
+ }, [(0, _vue.h)('div', {
10939
10964
  class: 'vxe-table--main-wrapper'
10940
10965
  }, [
10941
10966
  /**
@@ -11594,6 +11619,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
11594
11619
  }
11595
11620
  }
11596
11621
  });
11622
+ const tableViewportEl = refTableViewportElem.value;
11623
+ if (tableViewportEl) {
11624
+ tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, {
11625
+ passive: false
11626
+ });
11627
+ }
11597
11628
  globalEvents.on($xeTable, 'paste', handleGlobalPasteEvent);
11598
11629
  globalEvents.on($xeTable, 'copy', handleGlobalCopyEvent);
11599
11630
  globalEvents.on($xeTable, 'cut', handleGlobalCutEvent);
@@ -11608,6 +11639,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
11608
11639
  });
11609
11640
  });
11610
11641
  (0, _vue.onBeforeUnmount)(() => {
11642
+ const tableViewportEl = refTableViewportElem.value;
11643
+ if (tableViewportEl) {
11644
+ tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
11645
+ }
11611
11646
  if (resizeObserver) {
11612
11647
  resizeObserver.disconnect();
11613
11648
  }