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
@@ -1274,7 +1274,7 @@ function updateStyle($xeTable) {
1274
1274
  } = internalData;
1275
1275
  const $xeGanttView = internalData.xeGanttView;
1276
1276
  const el = $xeTable.$refs.refElem;
1277
- if (!el || !el.clientHeight) {
1277
+ if (!el || internalData.tBodyHeight && !el.clientHeight) {
1278
1278
  return;
1279
1279
  }
1280
1280
  const containerList = ['main', 'left', 'right'];
@@ -2778,7 +2778,8 @@ function calcTableHeight($xeTable, key) {
2778
2778
  const props = $xeTable;
2779
2779
  const reactData = $xeTable;
2780
2780
  const {
2781
- editConfig
2781
+ editConfig,
2782
+ editRules
2782
2783
  } = props;
2783
2784
  const {
2784
2785
  parentHeight
@@ -2789,7 +2790,7 @@ function calcTableHeight($xeTable, key) {
2789
2790
  if (_xeUtils.default.eqNull(val)) {
2790
2791
  if ((0, _utils.eqEmptyValue)(defMinHeight)) {
2791
2792
  // 编辑模式默认最小高度
2792
- if ((0, _utils.isEnableConf)(editConfig)) {
2793
+ if (editRules && (0, _utils.isEnableConf)(editConfig)) {
2793
2794
  val = 144;
2794
2795
  }
2795
2796
  } else {
@@ -12257,22 +12258,51 @@ const Methods = {
12257
12258
  * 获取表格的滚动状态
12258
12259
  */
12259
12260
  getScroll() {
12261
+ const $xeTable = this;
12262
+ return $xeTable.getScrollData();
12263
+ },
12264
+ /**
12265
+ * 获取表格的滚动数据
12266
+ */
12267
+ getScrollData() {
12260
12268
  const $xeTable = this;
12261
12269
  const reactData = $xeTable;
12262
12270
  const internalData = $xeTable;
12263
12271
  const {
12264
12272
  scrollXLoad,
12265
- scrollYLoad
12273
+ scrollYLoad,
12274
+ scrollbarHeight,
12275
+ scrollbarWidth
12266
12276
  } = reactData;
12267
12277
  const {
12268
12278
  elemStore
12269
12279
  } = internalData;
12270
12280
  const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
12281
+ const scrollTop = bodyScrollElem ? bodyScrollElem.scrollTop : 0;
12282
+ const scrollLeft = bodyScrollElem ? bodyScrollElem.scrollLeft : 0;
12283
+ const clientHeight = bodyScrollElem ? bodyScrollElem.clientHeight : 0;
12284
+ const clientWidth = bodyScrollElem ? bodyScrollElem.clientWidth : 0;
12285
+ const scrollHeight = bodyScrollElem ? bodyScrollElem.scrollHeight : 0;
12286
+ const scrollWidth = bodyScrollElem ? bodyScrollElem.scrollWidth : 0;
12287
+ const isTop = scrollTop <= 0;
12288
+ const isBottom = scrollTop + clientHeight >= scrollHeight;
12289
+ const isLeft = scrollLeft <= 0;
12290
+ const isRight = scrollLeft + clientWidth >= scrollWidth;
12271
12291
  return {
12272
12292
  virtualX: scrollXLoad,
12273
12293
  virtualY: scrollYLoad,
12274
- scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
12275
- scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
12294
+ isTop,
12295
+ isBottom,
12296
+ isLeft,
12297
+ isRight,
12298
+ scrollbarHeight,
12299
+ scrollbarWidth,
12300
+ scrollTop,
12301
+ scrollLeft,
12302
+ scrollHeight,
12303
+ scrollWidth,
12304
+ clientHeight,
12305
+ clientWidth
12276
12306
  };
12277
12307
  },
12278
12308
  handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
@@ -12629,15 +12659,14 @@ const Methods = {
12629
12659
  } = reactData;
12630
12660
  const leftFixedWidth = $xeTable.computeLeftFixedWidth;
12631
12661
  const rightFixedWidth = $xeTable.computeRightFixedWidth;
12632
- if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
12633
- return;
12634
- }
12635
12662
  const {
12636
12663
  elemStore,
12637
12664
  lastScrollTop,
12638
12665
  lastScrollLeft
12639
12666
  } = internalData;
12640
12667
  const rowOpts = $xeTable.computeRowOpts;
12668
+ const scrollbarXOpts = $xeTable.computeScrollbarXOpts;
12669
+ const scrollbarYOpts = $xeTable.computeScrollbarYOpts;
12641
12670
  const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
12642
12671
  const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
12643
12672
  const leftScrollElem = (0, _util.getRefElem)(elemStore['left-body-scroll']);
@@ -12646,12 +12675,6 @@ const Methods = {
12646
12675
  const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
12647
12676
  const rightScrollElem = (0, _util.getRefElem)(elemStore['right-body-scroll']);
12648
12677
  const rowExpandEl = $xeTable.$refs.refRowExpandElem;
12649
- if (!xHandleEl) {
12650
- return;
12651
- }
12652
- if (!yHandleEl) {
12653
- return;
12654
- }
12655
12678
  if (!bodyScrollElem) {
12656
12679
  return;
12657
12680
  }
@@ -12664,13 +12687,28 @@ const Methods = {
12664
12687
  const scrollLeft = currScrollLeft + deltaLeft;
12665
12688
  const isRollX = scrollLeft !== lastScrollLeft;
12666
12689
  const isRollY = scrollTop !== lastScrollTop;
12690
+ if (isRollX) {
12691
+ // 如果禁用滚动
12692
+ if (scrollbarXOpts.visible === 'hidden') {
12693
+ evnt.preventDefault();
12694
+ return;
12695
+ }
12696
+ }
12667
12697
  if (isRollY) {
12698
+ // 如果禁用滚动
12699
+ if (scrollbarYOpts.visible === 'hidden') {
12700
+ evnt.preventDefault();
12701
+ return;
12702
+ }
12668
12703
  const isTopWheel = deltaTop < 0;
12669
12704
  // 如果滚动位置已经是顶部或底部,则不需要触发
12670
12705
  if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
12671
12706
  return;
12672
12707
  }
12673
12708
  }
12709
+ if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
12710
+ return;
12711
+ }
12674
12712
  if (rowOpts.isHover || highlightHoverRow) {
12675
12713
  $xeTable.clearHoverRow();
12676
12714
  }
@@ -13253,6 +13291,8 @@ const Methods = {
13253
13291
  scrollYStore.endIndex = scrollYStore.visibleSize;
13254
13292
  scrollYStore.visibleEndIndex = scrollYStore.visibleSize;
13255
13293
  return $xeTable.$nextTick().then(() => {
13294
+ internalData.lastScrollLeft = 0;
13295
+ internalData.lastScrollTop = 0;
13256
13296
  internalData.intoRunScroll = false;
13257
13297
  });
13258
13298
  },