vxe-table 4.11.1 → 4.11.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.
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.1739871583820.ttf +0 -0
  8. package/es/iconfont.1739871583820.woff +0 -0
  9. package/es/iconfont.1739871583820.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 +66 -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.1739871583820.ttf +0 -0
  49. package/lib/iconfont.1739871583820.woff +0 -0
  50. package/lib/iconfont.1739871583820.woff2 +0 -0
  51. package/lib/index.css +1 -1
  52. package/lib/index.min.css +1 -1
  53. package/lib/index.umd.js +68 -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 +65 -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 +69 -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.2";
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.2"}`;
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
  }
@@ -20384,6 +20389,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20384
20389
  return;
20385
20390
  }
20386
20391
  }
20392
+ console.log('triggerBodyScrollEvent', 11);
20387
20393
  let scrollTop = yHandleEl.scrollTop;
20388
20394
  let scrollLeft = xHandleEl.scrollLeft;
20389
20395
  if (leftScrollElem && fixedType === 'left') {
@@ -20440,14 +20446,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20440
20446
  inBodyScroll,
20441
20447
  inFooterScroll
20442
20448
  } = internalData;
20449
+ if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
20450
+ return;
20451
+ }
20443
20452
  const yHandleEl = refScrollYHandleElem.value;
20444
20453
  const xHandleEl = refScrollXHandleElem.value;
20445
20454
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
20446
20455
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
20447
20456
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
20448
- if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
20449
- return;
20450
- }
20451
20457
  if (intoRunScroll) {
20452
20458
  return;
20453
20459
  }
@@ -20460,6 +20466,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20460
20466
  if (!yHandleEl) {
20461
20467
  return;
20462
20468
  }
20469
+ console.log('triggerHeaderScrollEvent', 11);
20463
20470
  const scrollTop = yHandleEl.scrollTop;
20464
20471
  const scrollLeft = headerScrollElem.scrollLeft;
20465
20472
  const isRollX = true;
@@ -20488,14 +20495,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20488
20495
  inHeaderScroll,
20489
20496
  inBodyScroll
20490
20497
  } = internalData;
20498
+ if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
20499
+ return;
20500
+ }
20491
20501
  const yHandleEl = refScrollYHandleElem.value;
20492
20502
  const xHandleEl = refScrollXHandleElem.value;
20493
20503
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
20494
20504
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
20495
20505
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
20496
- if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
20497
- return;
20498
- }
20499
20506
  if (intoRunScroll) {
20500
20507
  return;
20501
20508
  }
@@ -20508,6 +20515,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20508
20515
  if (!yHandleEl) {
20509
20516
  return;
20510
20517
  }
20518
+ console.log('triggerFooterScrollEvent');
20511
20519
  const scrollTop = yHandleEl.scrollTop;
20512
20520
  const scrollLeft = footerScrollElem.scrollLeft;
20513
20521
  const isRollX = true;
@@ -20537,8 +20545,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20537
20545
  highlightHoverRow
20538
20546
  } = src_props;
20539
20547
  const {
20548
+ scrollXLoad,
20540
20549
  scrollYLoad
20541
20550
  } = reactData;
20551
+ const leftFixedWidth = computeLeftFixedWidth.value;
20552
+ const rightFixedWidth = computeRightFixedWidth.value;
20553
+ if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
20554
+ return;
20555
+ }
20542
20556
  const {
20543
20557
  elemStore,
20544
20558
  lastScrollTop,
@@ -20548,7 +20562,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20548
20562
  const xHandleEl = refScrollXHandleElem.value;
20549
20563
  const yHandleEl = refScrollYHandleElem.value;
20550
20564
  const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
20565
+ const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
20551
20566
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
20567
+ const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
20552
20568
  const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
20553
20569
  const rowExpandEl = refRowExpandElem.value;
20554
20570
  if (!xHandleEl) {
@@ -20561,24 +20577,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20561
20577
  return;
20562
20578
  }
20563
20579
  const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
20564
- const deltaTop = deltaY * wheelSpeed;
20565
- const deltaLeft = deltaX * wheelSpeed;
20580
+ const deltaTop = Math.ceil(deltaY * wheelSpeed);
20581
+ const deltaLeft = Math.ceil(deltaX * wheelSpeed);
20566
20582
  const isTopWheel = deltaTop < 0;
20567
20583
  const currScrollTop = bodyScrollElem.scrollTop;
20568
20584
  // 如果滚动位置已经是顶部或底部,则不需要触发
20569
20585
  if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
20570
20586
  return;
20571
20587
  }
20572
- const scrollTop = bodyScrollElem.scrollTop + deltaTop;
20588
+ const scrollTop = currScrollTop + deltaTop;
20573
20589
  const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
20574
20590
  const isRollX = scrollLeft !== lastScrollLeft;
20575
20591
  const isRollY = scrollTop !== lastScrollTop;
20592
+ if (rowOpts.isHover || highlightHoverRow) {
20593
+ $xeTable.clearHoverRow();
20594
+ }
20576
20595
  // 用于鼠标纵向滚轮处理
20596
+ if (isRollX) {
20597
+ evnt.preventDefault();
20598
+ internalData.inWheelScroll = true;
20599
+ wheelScrollLeftTo(scrollLeft, offsetLeft => {
20600
+ const currLeftNum = offsetLeft;
20601
+ setScrollLeft(xHandleEl, currLeftNum);
20602
+ setScrollLeft(bodyScrollElem, currLeftNum);
20603
+ setScrollLeft(headerScrollElem, currLeftNum);
20604
+ setScrollLeft(footerScrollElem, currLeftNum);
20605
+ if (scrollXLoad) {
20606
+ $xeTable.triggerScrollXEvent(evnt);
20607
+ }
20608
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
20609
+ type: 'table',
20610
+ fixed: ''
20611
+ });
20612
+ });
20613
+ }
20577
20614
  if (isRollY) {
20578
- if (rowOpts.isHover || highlightHoverRow) {
20579
- $xeTable.clearHoverRow();
20580
- }
20581
- wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
20615
+ evnt.preventDefault();
20616
+ wheelScrollTopTo(scrollTop - currScrollTop, offsetTop => {
20582
20617
  const currTopNum = bodyScrollElem.scrollTop + offsetTop;
20583
20618
  internalData.inWheelScroll = true;
20584
20619
  setScrollTop(yHandleEl, currTopNum);
@@ -20589,7 +20624,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20589
20624
  if (scrollYLoad) {
20590
20625
  $xeTable.triggerScrollYEvent(evnt);
20591
20626
  }
20592
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
20627
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
20593
20628
  type: 'table',
20594
20629
  fixed: ''
20595
20630
  });
@@ -21238,7 +21273,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
21238
21273
  } = props;
21239
21274
  const {
21240
21275
  overflowX,
21241
- scrollYLoad,
21242
21276
  tableData,
21243
21277
  tableColumn,
21244
21278
  tableGroupColumn,
@@ -21249,16 +21283,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
21249
21283
  leftList,
21250
21284
  rightList
21251
21285
  } = 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
21286
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
21259
21287
  ref: refTableViewportElem,
21260
- class: 'vxe-table--viewport-wrapper',
21261
- ...ons
21288
+ class: 'vxe-table--viewport-wrapper'
21262
21289
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
21263
21290
  class: 'vxe-table--main-wrapper'
21264
21291
  }, [
@@ -21918,6 +21945,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
21918
21945
  }
21919
21946
  }
21920
21947
  });
21948
+ const tableViewportEl = refTableViewportElem.value;
21949
+ if (tableViewportEl) {
21950
+ tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, {
21951
+ passive: false
21952
+ });
21953
+ }
21921
21954
  table_globalEvents.on($xeTable, 'paste', handleGlobalPasteEvent);
21922
21955
  table_globalEvents.on($xeTable, 'copy', handleGlobalCopyEvent);
21923
21956
  table_globalEvents.on($xeTable, 'cut', handleGlobalCutEvent);
@@ -21932,6 +21965,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
21932
21965
  });
21933
21966
  });
21934
21967
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
21968
+ const tableViewportEl = refTableViewportElem.value;
21969
+ if (tableViewportEl) {
21970
+ tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
21971
+ }
21935
21972
  if (resizeObserver) {
21936
21973
  resizeObserver.disconnect();
21937
21974
  }