vxe-table 3.19.0 → 3.19.1

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 (54) hide show
  1. package/README.md +2 -2
  2. package/es/grid/src/grid.js +27 -31
  3. package/es/index.css +1 -1
  4. package/es/index.min.css +1 -1
  5. package/es/locale/lang/en-US.js +22 -22
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/table/src/methods.js +52 -15
  9. package/es/table/src/table.js +18 -5
  10. package/es/table/src/util.js +29 -23
  11. package/es/table/style.css +29 -2
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +1 -1
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +29 -2
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/lib/grid/src/grid.js +48 -52
  18. package/lib/grid/src/grid.min.js +1 -1
  19. package/lib/index.css +1 -1
  20. package/lib/index.min.css +1 -1
  21. package/lib/index.umd.js +136 -95
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/locale/lang/en-US.js +22 -22
  24. package/lib/locale/lang/en-US.min.js +1 -1
  25. package/lib/locale/lang/en-US.umd.js +22 -22
  26. package/lib/style.css +1 -1
  27. package/lib/style.min.css +1 -1
  28. package/lib/table/src/methods.js +55 -15
  29. package/lib/table/src/methods.min.js +1 -1
  30. package/lib/table/src/table.js +14 -3
  31. package/lib/table/src/table.min.js +1 -1
  32. package/lib/table/src/util.js +17 -23
  33. package/lib/table/src/util.min.js +1 -1
  34. package/lib/table/style/style.css +29 -2
  35. package/lib/table/style/style.min.css +1 -1
  36. package/lib/ui/index.js +1 -1
  37. package/lib/ui/index.min.js +1 -1
  38. package/lib/ui/src/log.js +1 -1
  39. package/lib/ui/src/log.min.js +1 -1
  40. package/lib/vxe-table/style/style.css +29 -2
  41. package/lib/vxe-table/style/style.min.css +1 -1
  42. package/package.json +2 -2
  43. package/packages/grid/src/grid.ts +64 -68
  44. package/packages/locale/lang/en-US.ts +22 -22
  45. package/packages/table/src/methods.ts +55 -15
  46. package/packages/table/src/table.ts +19 -5
  47. package/packages/table/src/util.ts +37 -23
  48. package/styles/components/table.scss +52 -2
  49. /package/es/{iconfont.1760925668508.ttf → iconfont.1761181583983.ttf} +0 -0
  50. /package/es/{iconfont.1760925668508.woff → iconfont.1761181583983.woff} +0 -0
  51. /package/es/{iconfont.1760925668508.woff2 → iconfont.1761181583983.woff2} +0 -0
  52. /package/lib/{iconfont.1760925668508.ttf → iconfont.1761181583983.ttf} +0 -0
  53. /package/lib/{iconfont.1760925668508.woff → iconfont.1761181583983.woff} +0 -0
  54. /package/lib/{iconfont.1760925668508.woff2 → iconfont.1761181583983.woff2} +0 -0
@@ -957,7 +957,7 @@ function updateStyle($xeTable) {
957
957
  const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
958
958
  const $xeGanttView = internalData.xeGanttView;
959
959
  const el = $xeTable.$refs.refElem;
960
- if (!el || !el.clientHeight) {
960
+ if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
961
961
  return;
962
962
  }
963
963
  const containerList = ['main', 'left', 'right'];
@@ -2272,7 +2272,7 @@ function clearAllSort($xeTable) {
2272
2272
  function calcTableHeight($xeTable, key) {
2273
2273
  const props = $xeTable;
2274
2274
  const reactData = $xeTable;
2275
- const { editConfig } = props;
2275
+ const { editConfig, editRules } = props;
2276
2276
  const { parentHeight } = reactData;
2277
2277
  let val = props[key];
2278
2278
  if (key === 'minHeight') {
@@ -2280,7 +2280,7 @@ function calcTableHeight($xeTable, key) {
2280
2280
  if (XEUtils.eqNull(val)) {
2281
2281
  if (eqEmptyValue(defMinHeight)) {
2282
2282
  // 编辑模式默认最小高度
2283
- if (isEnableConf(editConfig)) {
2283
+ if (editRules && isEnableConf(editConfig)) {
2284
2284
  val = 144;
2285
2285
  }
2286
2286
  }
@@ -10482,17 +10482,44 @@ const Methods = {
10482
10482
  * 获取表格的滚动状态
10483
10483
  */
10484
10484
  getScroll() {
10485
+ const $xeTable = this;
10486
+ return $xeTable.getScrollData();
10487
+ },
10488
+ /**
10489
+ * 获取表格的滚动数据
10490
+ */
10491
+ getScrollData() {
10485
10492
  const $xeTable = this;
10486
10493
  const reactData = $xeTable;
10487
10494
  const internalData = $xeTable;
10488
- const { scrollXLoad, scrollYLoad } = reactData;
10495
+ const { scrollXLoad, scrollYLoad, scrollbarHeight, scrollbarWidth } = reactData;
10489
10496
  const { elemStore } = internalData;
10490
10497
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
10498
+ const scrollTop = bodyScrollElem ? bodyScrollElem.scrollTop : 0;
10499
+ const scrollLeft = bodyScrollElem ? bodyScrollElem.scrollLeft : 0;
10500
+ const clientHeight = bodyScrollElem ? bodyScrollElem.clientHeight : 0;
10501
+ const clientWidth = bodyScrollElem ? bodyScrollElem.clientWidth : 0;
10502
+ const scrollHeight = bodyScrollElem ? bodyScrollElem.scrollHeight : 0;
10503
+ const scrollWidth = bodyScrollElem ? bodyScrollElem.scrollWidth : 0;
10504
+ const isTop = scrollTop <= 0;
10505
+ const isBottom = scrollTop + clientHeight >= scrollHeight;
10506
+ const isLeft = scrollLeft <= 0;
10507
+ const isRight = scrollLeft + clientWidth >= scrollWidth;
10491
10508
  return {
10492
10509
  virtualX: scrollXLoad,
10493
10510
  virtualY: scrollYLoad,
10494
- scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
10495
- scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
10511
+ isTop,
10512
+ isBottom,
10513
+ isLeft,
10514
+ isRight,
10515
+ scrollbarHeight,
10516
+ scrollbarWidth,
10517
+ scrollTop,
10518
+ scrollLeft,
10519
+ scrollHeight,
10520
+ scrollWidth,
10521
+ clientHeight,
10522
+ clientWidth
10496
10523
  };
10497
10524
  },
10498
10525
  handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
@@ -10804,11 +10831,10 @@ const Methods = {
10804
10831
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
10805
10832
  const leftFixedWidth = $xeTable.computeLeftFixedWidth;
10806
10833
  const rightFixedWidth = $xeTable.computeRightFixedWidth;
10807
- if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
10808
- return;
10809
- }
10810
10834
  const { elemStore, lastScrollTop, lastScrollLeft } = internalData;
10811
10835
  const rowOpts = $xeTable.computeRowOpts;
10836
+ const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
10837
+ const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
10812
10838
  const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
10813
10839
  const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
10814
10840
  const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
@@ -10817,12 +10843,6 @@ const Methods = {
10817
10843
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
10818
10844
  const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
10819
10845
  const rowExpandEl = $xeTable.$refs.refRowExpandElem;
10820
- if (!xHandleEl) {
10821
- return;
10822
- }
10823
- if (!yHandleEl) {
10824
- return;
10825
- }
10826
10846
  if (!bodyScrollElem) {
10827
10847
  return;
10828
10848
  }
@@ -10835,13 +10855,28 @@ const Methods = {
10835
10855
  const scrollLeft = currScrollLeft + deltaLeft;
10836
10856
  const isRollX = scrollLeft !== lastScrollLeft;
10837
10857
  const isRollY = scrollTop !== lastScrollTop;
10858
+ if (isRollX) {
10859
+ // 如果禁用滚动
10860
+ if (scrollbarXOpts.visible === 'hidden') {
10861
+ evnt.preventDefault();
10862
+ return;
10863
+ }
10864
+ }
10838
10865
  if (isRollY) {
10866
+ // 如果禁用滚动
10867
+ if (scrollbarYOpts.visible === 'hidden') {
10868
+ evnt.preventDefault();
10869
+ return;
10870
+ }
10839
10871
  const isTopWheel = deltaTop < 0;
10840
10872
  // 如果滚动位置已经是顶部或底部,则不需要触发
10841
10873
  if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
10842
10874
  return;
10843
10875
  }
10844
10876
  }
10877
+ if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
10878
+ return;
10879
+ }
10845
10880
  if (rowOpts.isHover || highlightHoverRow) {
10846
10881
  $xeTable.clearHoverRow();
10847
10882
  }
@@ -11367,6 +11402,8 @@ const Methods = {
11367
11402
  scrollYStore.endIndex = scrollYStore.visibleSize;
11368
11403
  scrollYStore.visibleEndIndex = scrollYStore.visibleSize;
11369
11404
  return $xeTable.$nextTick().then(() => {
11405
+ internalData.lastScrollLeft = 0;
11406
+ internalData.lastScrollTop = 0;
11370
11407
  internalData.intoRunScroll = false;
11371
11408
  });
11372
11409
  },
@@ -72,7 +72,7 @@ function renderViewFixed(h, $xeTable, fixedType) {
72
72
  const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
73
73
  return h('div', {
74
74
  ref: isFixedLeft ? 'refLeftContainer' : 'refRightContainer',
75
- class: [`vxe-table--fixed-${fixedType}-wrapper`, {
75
+ class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
76
76
  [`x-ob--${osXBehavior}`]: osXBehavior,
77
77
  [`y-ob--${osYBehavior}`]: osYBehavior
78
78
  }]
@@ -413,7 +413,7 @@ function renderViewport(h, $xeTable) {
413
413
  }]
414
414
  }, [
415
415
  h('div', {
416
- class: 'vxe-table--main-wrapper'
416
+ class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
417
417
  }, [
418
418
  /**
419
419
  * 表头
@@ -1364,6 +1364,12 @@ export default {
1364
1364
  },
1365
1365
  computeVxeLanguage() {
1366
1366
  return VxeUI.getLanguage();
1367
+ },
1368
+ computeScrollbarVisible() {
1369
+ const $xeTable = this;
1370
+ const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
1371
+ const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
1372
+ return `${scrollbarXOpts.visible}${scrollbarYOpts.visible}`;
1367
1373
  } }),
1368
1374
  watch: {
1369
1375
  data(value) {
@@ -1433,6 +1439,9 @@ export default {
1433
1439
  computeVxeLanguage() {
1434
1440
  this.reLayoutFlag++;
1435
1441
  },
1442
+ computeScrollbarVisible() {
1443
+ this.reLayoutFlag++;
1444
+ },
1436
1445
  reLayoutFlag() {
1437
1446
  const $xeTable = this;
1438
1447
  $xeTable.$nextTick(() => $xeTable.recalculate(true));
@@ -2051,11 +2060,15 @@ export default {
2051
2060
  h('div', {
2052
2061
  key: 'tn',
2053
2062
  ref: 'refEmptyPlaceholder',
2054
- class: 'vxe-table--empty-placeholder'
2063
+ class: 'vxe-table--empty-place-wrapper'
2055
2064
  }, [
2056
2065
  h('div', {
2057
- class: 'vxe-table--empty-content'
2058
- }, renderEmptyBody(h, $xeTable))
2066
+ class: 'vxe-table--empty-placeholder'
2067
+ }, [
2068
+ h('div', {
2069
+ class: 'vxe-table--empty-content'
2070
+ }, renderEmptyBody(h, $xeTable))
2071
+ ])
2059
2072
  ]),
2060
2073
  /**
2061
2074
  * 边框线
@@ -576,29 +576,35 @@ export function getRefElem(refEl) {
576
576
  }
577
577
  return null;
578
578
  }
579
- export function clearTableDefaultStatus(_vm) {
580
- _vm.initStatus = false;
581
- _vm.clearSort();
582
- _vm.clearCurrentRow();
583
- _vm.clearCurrentColumn();
584
- _vm.clearRadioRow();
585
- _vm.clearRadioReserve();
586
- _vm.clearCheckboxRow();
587
- _vm.clearCheckboxReserve();
588
- _vm.clearRowExpand();
589
- _vm.clearTreeExpand();
590
- _vm.clearTreeExpandReserve();
591
- if (_vm.clearEdit) {
592
- _vm.clearEdit();
593
- }
594
- if (_vm.clearSelected && (_vm.keyboardConfig || _vm.mouseConfig)) {
595
- _vm.clearSelected();
596
- }
597
- if (_vm.clearCellAreas && _vm.mouseConfig) {
598
- _vm.clearCellAreas();
599
- _vm.clearCopyCellArea();
600
- }
601
- return _vm.clearScroll();
579
+ export function clearTableDefaultStatus($xeTable) {
580
+ const props = $xeTable;
581
+ const internalData = $xeTable;
582
+ internalData.initStatus = false;
583
+ const actionList = [
584
+ $xeTable.clearSort(),
585
+ $xeTable.clearCurrentRow(),
586
+ $xeTable.clearCurrentColumn(),
587
+ $xeTable.clearRadioRow(),
588
+ $xeTable.clearRadioReserve(),
589
+ $xeTable.clearCheckboxRow(),
590
+ $xeTable.clearCheckboxReserve(),
591
+ $xeTable.clearRowExpand(),
592
+ $xeTable.clearTreeExpand(),
593
+ $xeTable.clearTreeExpandReserve(),
594
+ $xeTable.clearPendingRow()
595
+ ];
596
+ if ($xeTable.clearFilter) {
597
+ actionList.push($xeTable.clearFilter());
598
+ }
599
+ if ($xeTable.clearSelected && (props.keyboardConfig || props.mouseConfig)) {
600
+ actionList.push($xeTable.clearSelected());
601
+ }
602
+ if ($xeTable.clearCellAreas && props.mouseConfig) {
603
+ actionList.push($xeTable.clearCellAreas(), $xeTable.clearCopyCellArea());
604
+ }
605
+ return Promise.all(actionList).then(() => {
606
+ return $xeTable.clearScroll();
607
+ });
602
608
  }
603
609
  export function clearTableAllStatus(_vm) {
604
610
  if (_vm.clearFilter) {
@@ -1839,6 +1839,28 @@
1839
1839
  overflow-x: scroll;
1840
1840
  }
1841
1841
 
1842
+ .vxe-table--main-wrapper.sx--hidden > .vxe-table--header-wrapper > .vxe-table--header-inner-wrapper {
1843
+ overflow-x: hidden;
1844
+ }
1845
+ .vxe-table--main-wrapper.sx--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper {
1846
+ overflow-x: hidden;
1847
+ }
1848
+ .vxe-table--main-wrapper.sx--hidden > .vxe-table--footer-wrapper > .vxe-table--footer-inner-wrapper {
1849
+ overflow-x: hidden;
1850
+ }
1851
+ .vxe-table--main-wrapper.sy--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper {
1852
+ overflow-y: hidden;
1853
+ }
1854
+
1855
+ .vxe-table--fixed-left-wrapper.sx--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper,
1856
+ .vxe-table--fixed-right-wrapper.sx--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper {
1857
+ overflow-x: hidden;
1858
+ }
1859
+ .vxe-table--fixed-left-wrapper.sy--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper,
1860
+ .vxe-table--fixed-right-wrapper.sy--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper {
1861
+ overflow-y: hidden;
1862
+ }
1863
+
1842
1864
  .vxe-loading--custom-wrapper {
1843
1865
  display: none;
1844
1866
  position: absolute;
@@ -3496,11 +3518,16 @@
3496
3518
  display: none;
3497
3519
  visibility: hidden;
3498
3520
  }
3499
- .vxe-table--render-default .vxe-table--empty-placeholder {
3521
+ .vxe-table--render-default .vxe-table--empty-place-wrapper {
3500
3522
  display: none;
3501
3523
  position: absolute;
3524
+ width: 100%;
3502
3525
  top: 0;
3503
3526
  z-index: 5;
3527
+ overflow: hidden;
3528
+ }
3529
+ .vxe-table--render-default .vxe-table--empty-placeholder {
3530
+ display: flex;
3504
3531
  }
3505
3532
  .vxe-table--render-default .vxe-table--empty-content {
3506
3533
  display: block;
@@ -3508,7 +3535,7 @@
3508
3535
  pointer-events: auto;
3509
3536
  }
3510
3537
  .vxe-table--render-default.is--empty .vxe-table--empty-block,
3511
- .vxe-table--render-default.is--empty .vxe-table--empty-placeholder {
3538
+ .vxe-table--render-default.is--empty .vxe-table--empty-place-wrapper {
3512
3539
  display: flex;
3513
3540
  }
3514
3541
  .vxe-table--render-default .vxe-body--column.col--selected {