vxe-table 4.17.0-beta.1 → 4.17.0-beta.10

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 (75) hide show
  1. package/README.md +2 -2
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/custom/panel.js +34 -32
  7. package/es/table/module/export/export-panel.js +22 -22
  8. package/es/table/module/export/import-panel.js +8 -8
  9. package/es/table/module/keyboard/hook.js +4 -26
  10. package/es/table/render/index.js +14 -2
  11. package/es/table/src/body.js +12 -2
  12. package/es/table/src/emits.js +2 -0
  13. package/es/table/src/header.js +1 -1
  14. package/es/table/src/table.js +50 -15
  15. package/es/table/src/util.js +3 -3
  16. package/es/table/style.css +3 -0
  17. package/es/table/style.min.css +1 -1
  18. package/es/ui/index.js +1 -1
  19. package/es/ui/src/log.js +1 -1
  20. package/es/ui/src/utils.js +6 -5
  21. package/es/vxe-table/style.css +3 -0
  22. package/es/vxe-table/style.min.css +1 -1
  23. package/lib/index.css +1 -1
  24. package/lib/index.min.css +1 -1
  25. package/lib/index.umd.js +99 -101
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/table/module/custom/panel.js +26 -24
  30. package/lib/table/module/custom/panel.min.js +1 -1
  31. package/lib/table/module/export/export-panel.js +19 -18
  32. package/lib/table/module/export/export-panel.min.js +1 -1
  33. package/lib/table/module/export/import-panel.js +8 -7
  34. package/lib/table/module/export/import-panel.min.js +1 -1
  35. package/lib/table/module/keyboard/hook.js +3 -28
  36. package/lib/table/module/keyboard/hook.min.js +1 -1
  37. package/lib/table/render/index.js +13 -2
  38. package/lib/table/render/index.min.js +1 -1
  39. package/lib/table/src/body.js +0 -1
  40. package/lib/table/src/emits.js +1 -1
  41. package/lib/table/src/emits.min.js +1 -1
  42. package/lib/table/src/header.js +1 -1
  43. package/lib/table/src/table.js +12 -6
  44. package/lib/table/src/table.min.js +1 -1
  45. package/lib/table/src/util.js +3 -3
  46. package/lib/table/src/util.min.js +1 -1
  47. package/lib/table/style/style.css +3 -0
  48. package/lib/table/style/style.min.css +1 -1
  49. package/lib/ui/index.js +1 -1
  50. package/lib/ui/index.min.js +1 -1
  51. package/lib/ui/src/log.js +1 -1
  52. package/lib/ui/src/log.min.js +1 -1
  53. package/lib/ui/src/utils.js +8 -5
  54. package/lib/ui/src/utils.min.js +1 -1
  55. package/lib/vxe-table/style/style.css +3 -0
  56. package/lib/vxe-table/style/style.min.css +1 -1
  57. package/package.json +1 -1
  58. package/packages/table/module/custom/panel.ts +34 -32
  59. package/packages/table/module/export/export-panel.ts +22 -22
  60. package/packages/table/module/export/import-panel.ts +8 -8
  61. package/packages/table/module/keyboard/hook.ts +4 -28
  62. package/packages/table/render/index.ts +26 -17
  63. package/packages/table/src/body.ts +12 -3
  64. package/packages/table/src/emits.ts +2 -0
  65. package/packages/table/src/header.ts +2 -2
  66. package/packages/table/src/table.ts +48 -15
  67. package/packages/table/src/util.ts +3 -3
  68. package/packages/ui/src/utils.ts +7 -5
  69. package/styles/components/table.scss +3 -0
  70. /package/es/{iconfont.1759043328183.ttf → iconfont.1760688141383.ttf} +0 -0
  71. /package/es/{iconfont.1759043328183.woff → iconfont.1760688141383.woff} +0 -0
  72. /package/es/{iconfont.1759043328183.woff2 → iconfont.1760688141383.woff2} +0 -0
  73. /package/lib/{iconfont.1759043328183.ttf → iconfont.1760688141383.ttf} +0 -0
  74. /package/lib/{iconfont.1759043328183.woff → iconfont.1760688141383.woff} +0 -0
  75. /package/lib/{iconfont.1759043328183.woff2 → iconfont.1760688141383.woff2} +0 -0
@@ -2333,7 +2333,6 @@ export default defineVxeComponent({
2333
2333
  emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
2334
2334
  }
2335
2335
  const scrollbarXConf = scrollbarOpts.x || {};
2336
- const scrollbarXToTop = computeScrollbarXToTop.value;
2337
2336
  const scrollbarYConf = scrollbarOpts.y || {};
2338
2337
  const scrollbarYToLeft = computeScrollbarYToLeft.value;
2339
2338
  let xScrollbarVisible = overflowX ? 'visible' : 'hidden';
@@ -2383,16 +2382,31 @@ export default defineVxeComponent({
2383
2382
  }
2384
2383
  const xWrapperEl = refScrollXWrapperElem.value;
2385
2384
  if (xWrapperEl) {
2386
- xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
2387
2385
  xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
2386
+ if (scrollbarYToLeft) {
2387
+ xWrapperEl.style.left = `${osbWidth}px`;
2388
+ }
2389
+ else {
2390
+ xWrapperEl.style.left = '';
2391
+ }
2388
2392
  }
2389
2393
  if (xLeftCornerEl) {
2390
- xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
2391
- xLeftCornerEl.style.display = scrollbarXToTop ? (overflowX && osbHeight ? 'block' : '') : '';
2394
+ if (scrollbarYToLeft) {
2395
+ xLeftCornerEl.style.width = `${osbWidth}px`;
2396
+ xLeftCornerEl.style.display = overflowY && osbWidth ? 'block' : '';
2397
+ }
2398
+ else {
2399
+ xLeftCornerEl.style.display = '';
2400
+ }
2392
2401
  }
2393
2402
  if (xRightCornerEl) {
2394
- xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
2395
- xRightCornerEl.style.display = scrollbarXToTop ? '' : (xScrollbarVisible === 'visible' ? 'block' : '');
2403
+ if (scrollbarYToLeft) {
2404
+ xRightCornerEl.style.display = '';
2405
+ }
2406
+ else {
2407
+ xRightCornerEl.style.width = `${osbWidth}px`;
2408
+ xRightCornerEl.style.display = xScrollbarVisible === 'visible' ? 'block' : '';
2409
+ }
2396
2410
  }
2397
2411
  const scrollYVirtualEl = refScrollYVirtualElem.value;
2398
2412
  if (scrollYVirtualEl) {
@@ -3970,8 +3984,10 @@ export default defineVxeComponent({
3970
3984
  updateAfterDataIndex();
3971
3985
  return nextTick();
3972
3986
  }).then(() => {
3987
+ updateTreeLineStyle();
3973
3988
  return handleLazyRecalculate(true, true, true);
3974
3989
  }).then(() => {
3990
+ updateTreeLineStyle();
3975
3991
  setTimeout(() => {
3976
3992
  $xeTable.updateCellAreas();
3977
3993
  }, 30);
@@ -4232,7 +4248,10 @@ export default defineVxeComponent({
4232
4248
  let countTop = 0;
4233
4249
  const step = (timestamp) => {
4234
4250
  let progress = (timestamp - startTime) / duration;
4235
- if (progress > 1) {
4251
+ if (progress < 0) {
4252
+ progress = 0;
4253
+ }
4254
+ else if (progress > 1) {
4236
4255
  progress = 1;
4237
4256
  }
4238
4257
  const easedProgress = Math.pow(progress, 2);
@@ -4326,6 +4345,9 @@ export default defineVxeComponent({
4326
4345
  }
4327
4346
  }
4328
4347
  };
4348
+ /**
4349
+ * 更新展开行样式
4350
+ */
4329
4351
  const updateRowExpandStyle = () => {
4330
4352
  const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData;
4331
4353
  const expandOpts = computeExpandOpts.value;
@@ -4381,6 +4403,12 @@ export default defineVxeComponent({
4381
4403
  }
4382
4404
  }
4383
4405
  };
4406
+ /**
4407
+ * 更新树连接线样式
4408
+ */
4409
+ const updateTreeLineStyle = () => {
4410
+ // 待优化
4411
+ };
4384
4412
  const handleRowExpandScroll = () => {
4385
4413
  const { elemStore } = internalData;
4386
4414
  const rowExpandEl = refRowExpandElem.value;
@@ -11194,6 +11222,10 @@ export default defineVxeComponent({
11194
11222
  if (target && /^textarea$/i.test(target.tagName)) {
11195
11223
  return;
11196
11224
  }
11225
+ // 如果滚轮未移动或者触摸板未变化位置
11226
+ if (!deltaY && !deltaX) {
11227
+ return;
11228
+ }
11197
11229
  const { highlightHoverRow } = tableProps;
11198
11230
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
11199
11231
  const leftFixedWidth = computeLeftFixedWidth.value;
@@ -11221,18 +11253,21 @@ export default defineVxeComponent({
11221
11253
  return;
11222
11254
  }
11223
11255
  const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
11224
- const deltaTop = shiftKey ? 0 : Math.ceil(deltaY * wheelSpeed);
11225
- const deltaLeft = shiftKey ? Math.ceil((shiftKey ? (deltaY || deltaX) : deltaX) * wheelSpeed) : 0;
11226
- const isTopWheel = deltaTop < 0;
11256
+ const deltaTop = shiftKey ? 0 : (deltaY * wheelSpeed);
11257
+ const deltaLeft = (shiftKey ? (deltaX || deltaY) : deltaX) * wheelSpeed;
11227
11258
  const currScrollTop = bodyScrollElem.scrollTop;
11228
- // 如果滚动位置已经是顶部或底部,则不需要触发
11229
- if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
11230
- return;
11231
- }
11259
+ const currScrollLeft = bodyScrollElem.scrollLeft;
11232
11260
  const scrollTop = currScrollTop + deltaTop;
11233
- const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft;
11261
+ const scrollLeft = currScrollLeft + deltaLeft;
11234
11262
  const isRollX = scrollLeft !== lastScrollLeft;
11235
11263
  const isRollY = scrollTop !== lastScrollTop;
11264
+ if (isRollY) {
11265
+ const isTopWheel = deltaTop < 0;
11266
+ // 如果滚动位置已经是顶部或底部,则不需要触发
11267
+ if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
11268
+ return;
11269
+ }
11270
+ }
11236
11271
  if (rowOpts.isHover || highlightHoverRow) {
11237
11272
  $xeTable.clearHoverRow();
11238
11273
  }
@@ -566,7 +566,7 @@ const lineOffsetSizes = {
566
566
  medium: 1,
567
567
  large: 0
568
568
  };
569
- function countTreeExpand(prevRow, params) {
569
+ function countTreeExpandSize(prevRow, params) {
570
570
  let count = 1;
571
571
  if (!prevRow) {
572
572
  return count;
@@ -583,7 +583,7 @@ function countTreeExpand(prevRow, params) {
583
583
  const rowChildren = prevRow[transform ? mapChildrenField : childrenField];
584
584
  if (rowChildren && treeExpandedFlag && treeExpandedMaps[getRowid($table, prevRow)]) {
585
585
  for (let index = 0; index < rowChildren.length; index++) {
586
- count += countTreeExpand(rowChildren[index], params);
586
+ count += countTreeExpandSize(rowChildren[index], params);
587
587
  }
588
588
  }
589
589
  return count;
@@ -613,7 +613,7 @@ export function calcTreeLine(params, prevRow) {
613
613
  const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
614
614
  let expandSize = 1;
615
615
  if (prevRow) {
616
- expandSize = countTreeExpand(prevRow, params);
616
+ expandSize = countTreeExpandSize(prevRow, params);
617
617
  }
618
618
  let cellHeight = currCellHeight;
619
619
  const vnHeight = rowRest.height;
@@ -2212,6 +2212,9 @@
2212
2212
  left: 0;
2213
2213
  bottom: 0;
2214
2214
  }
2215
+ .vxe-table .vxe-table--scroll-x-wrapper {
2216
+ height: 100%;
2217
+ }
2215
2218
  .vxe-table .vxe-table--scroll-x-handle {
2216
2219
  overflow-y: hidden;
2217
2220
  overflow-x: scroll;