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
package/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.11.0";
3141
+ const version = "4.11.3";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3335,8 +3335,8 @@ core_.VxeUI.setConfig({
3335
3335
  virtualYConfig: {
3336
3336
  enabled: true,
3337
3337
  gt: 100,
3338
- preSize: 1,
3339
- oSize: 2
3338
+ preSize: 0,
3339
+ oSize: 1
3340
3340
  },
3341
3341
  scrollbarConfig: {
3342
3342
  // width: 0,
@@ -3586,7 +3586,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3586
3586
  const {
3587
3587
  log: log_log
3588
3588
  } = core_.VxeUI;
3589
- const log_version = `table v${"4.11.0"}`;
3589
+ const log_version = `table v${"4.11.3"}`;
3590
3590
  const warnLog = log_log.create('warn', log_version);
3591
3591
  const errLog = log_log.create('error', log_version);
3592
3592
  ;// ./packages/table/src/columnInfo.ts
@@ -14103,7 +14103,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14103
14103
  }
14104
14104
  return multiple;
14105
14105
  };
14106
- const wheelScrollTo = (diffNum, cb) => {
14106
+ const wheelScrollLeftTo = (scrollLeft, cb) => {
14107
+ requestAnimationFrame(() => {
14108
+ cb(scrollLeft);
14109
+ });
14110
+ };
14111
+ const wheelScrollTopTo = (diffNum, cb) => {
14107
14112
  const duration = Math.abs(diffNum);
14108
14113
  const startTime = performance.now();
14109
14114
  let countTop = 0;
@@ -20356,6 +20361,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20356
20361
  scrollRenderType,
20357
20362
  inFooterScroll
20358
20363
  } = internalData;
20364
+ if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
20365
+ return;
20366
+ }
20359
20367
  const xHandleEl = refScrollXHandleElem.value;
20360
20368
  const yHandleEl = refScrollYHandleElem.value;
20361
20369
  const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
@@ -20364,9 +20372,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20364
20372
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
20365
20373
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
20366
20374
  const rowExpandEl = refRowExpandElem.value;
20367
- if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
20368
- return;
20369
- }
20370
20375
  if (intoRunScroll) {
20371
20376
  return;
20372
20377
  }
@@ -20440,14 +20445,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20440
20445
  inBodyScroll,
20441
20446
  inFooterScroll
20442
20447
  } = internalData;
20448
+ if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
20449
+ return;
20450
+ }
20443
20451
  const yHandleEl = refScrollYHandleElem.value;
20444
20452
  const xHandleEl = refScrollXHandleElem.value;
20445
20453
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
20446
20454
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
20447
20455
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
20448
- if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
20449
- return;
20450
- }
20451
20456
  if (intoRunScroll) {
20452
20457
  return;
20453
20458
  }
@@ -20488,14 +20493,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20488
20493
  inHeaderScroll,
20489
20494
  inBodyScroll
20490
20495
  } = internalData;
20496
+ if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
20497
+ return;
20498
+ }
20491
20499
  const yHandleEl = refScrollYHandleElem.value;
20492
20500
  const xHandleEl = refScrollXHandleElem.value;
20493
20501
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
20494
20502
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
20495
20503
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
20496
- if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
20497
- return;
20498
- }
20499
20504
  if (intoRunScroll) {
20500
20505
  return;
20501
20506
  }
@@ -20537,8 +20542,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20537
20542
  highlightHoverRow
20538
20543
  } = src_props;
20539
20544
  const {
20545
+ scrollXLoad,
20540
20546
  scrollYLoad
20541
20547
  } = reactData;
20548
+ const leftFixedWidth = computeLeftFixedWidth.value;
20549
+ const rightFixedWidth = computeRightFixedWidth.value;
20550
+ if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
20551
+ return;
20552
+ }
20542
20553
  const {
20543
20554
  elemStore,
20544
20555
  lastScrollTop,
@@ -20548,7 +20559,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20548
20559
  const xHandleEl = refScrollXHandleElem.value;
20549
20560
  const yHandleEl = refScrollYHandleElem.value;
20550
20561
  const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
20562
+ const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
20551
20563
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
20564
+ const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
20552
20565
  const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
20553
20566
  const rowExpandEl = refRowExpandElem.value;
20554
20567
  if (!xHandleEl) {
@@ -20561,24 +20574,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20561
20574
  return;
20562
20575
  }
20563
20576
  const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
20564
- const deltaTop = deltaY * wheelSpeed;
20565
- const deltaLeft = deltaX * wheelSpeed;
20577
+ const deltaTop = Math.ceil(deltaY * wheelSpeed);
20578
+ const deltaLeft = Math.ceil(deltaX * wheelSpeed);
20566
20579
  const isTopWheel = deltaTop < 0;
20567
20580
  const currScrollTop = bodyScrollElem.scrollTop;
20568
20581
  // 如果滚动位置已经是顶部或底部,则不需要触发
20569
20582
  if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
20570
20583
  return;
20571
20584
  }
20572
- const scrollTop = bodyScrollElem.scrollTop + deltaTop;
20585
+ const scrollTop = currScrollTop + deltaTop;
20573
20586
  const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
20574
20587
  const isRollX = scrollLeft !== lastScrollLeft;
20575
20588
  const isRollY = scrollTop !== lastScrollTop;
20589
+ if (rowOpts.isHover || highlightHoverRow) {
20590
+ $xeTable.clearHoverRow();
20591
+ }
20576
20592
  // 用于鼠标纵向滚轮处理
20593
+ if (isRollX) {
20594
+ evnt.preventDefault();
20595
+ internalData.inWheelScroll = true;
20596
+ wheelScrollLeftTo(scrollLeft, offsetLeft => {
20597
+ const currLeftNum = offsetLeft;
20598
+ setScrollLeft(xHandleEl, currLeftNum);
20599
+ setScrollLeft(bodyScrollElem, currLeftNum);
20600
+ setScrollLeft(headerScrollElem, currLeftNum);
20601
+ setScrollLeft(footerScrollElem, currLeftNum);
20602
+ if (scrollXLoad) {
20603
+ $xeTable.triggerScrollXEvent(evnt);
20604
+ }
20605
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
20606
+ type: 'table',
20607
+ fixed: ''
20608
+ });
20609
+ });
20610
+ }
20577
20611
  if (isRollY) {
20578
- if (rowOpts.isHover || highlightHoverRow) {
20579
- $xeTable.clearHoverRow();
20580
- }
20581
- wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
20612
+ evnt.preventDefault();
20613
+ wheelScrollTopTo(scrollTop - currScrollTop, offsetTop => {
20582
20614
  const currTopNum = bodyScrollElem.scrollTop + offsetTop;
20583
20615
  internalData.inWheelScroll = true;
20584
20616
  setScrollTop(yHandleEl, currTopNum);
@@ -20589,7 +20621,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20589
20621
  if (scrollYLoad) {
20590
20622
  $xeTable.triggerScrollYEvent(evnt);
20591
20623
  }
20592
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
20624
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
20593
20625
  type: 'table',
20594
20626
  fixed: ''
20595
20627
  });
@@ -21238,7 +21270,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
21238
21270
  } = props;
21239
21271
  const {
21240
21272
  overflowX,
21241
- scrollYLoad,
21242
21273
  tableData,
21243
21274
  tableColumn,
21244
21275
  tableGroupColumn,
@@ -21249,16 +21280,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
21249
21280
  leftList,
21250
21281
  rightList
21251
21282
  } = columnStore;
21252
- const leftFixedWidth = computeLeftFixedWidth.value;
21253
- const rightFixedWidth = computeRightFixedWidth.value;
21254
- const ons = {};
21255
- if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
21256
- ons.onWheelPassive = $xeTable.triggerBodyWheelEvent;
21257
- }
21258
21283
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
21259
21284
  ref: refTableViewportElem,
21260
- class: 'vxe-table--viewport-wrapper',
21261
- ...ons
21285
+ class: 'vxe-table--viewport-wrapper'
21262
21286
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
21263
21287
  class: 'vxe-table--main-wrapper'
21264
21288
  }, [
@@ -21918,6 +21942,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
21918
21942
  }
21919
21943
  }
21920
21944
  });
21945
+ const tableViewportEl = refTableViewportElem.value;
21946
+ if (tableViewportEl) {
21947
+ tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, {
21948
+ passive: false
21949
+ });
21950
+ }
21921
21951
  table_globalEvents.on($xeTable, 'paste', handleGlobalPasteEvent);
21922
21952
  table_globalEvents.on($xeTable, 'copy', handleGlobalCopyEvent);
21923
21953
  table_globalEvents.on($xeTable, 'cut', handleGlobalCutEvent);
@@ -21932,6 +21962,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
21932
21962
  });
21933
21963
  });
21934
21964
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
21965
+ const tableViewportEl = refTableViewportElem.value;
21966
+ if (tableViewportEl) {
21967
+ tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
21968
+ }
21935
21969
  if (resizeObserver) {
21936
21970
  resizeObserver.disconnect();
21937
21971
  }