@kdcloudjs/table 1.1.2-canary.2 → 1.1.3-canary.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.
@@ -658,7 +658,12 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
658
658
  offsetY: offsetY
659
659
  };
660
660
  }), op.distinctUntilChanged(function (x, y) {
661
- // 因为 overscan 的存在,滚动较小的距离时不需要触发组件重渲染
661
+ // 如果表格区域被隐藏, 不需要触发组件重渲染
662
+ if (y.maxRenderHeight === 0 && y.maxRenderWidth === 0) {
663
+ return true;
664
+ } // 因为 overscan 的存在,滚动较小的距离时不需要触发组件重渲染
665
+
666
+
662
667
  return Math.abs(x.maxRenderWidth - y.maxRenderWidth) < OVERSCAN_SIZE / 2 && Math.abs(x.maxRenderHeight - y.maxRenderHeight) < OVERSCAN_SIZE / 2 && Math.abs(x.offsetY - y.offsetY) < OVERSCAN_SIZE / 2;
663
668
  })).subscribe(function (sizeAndOffset) {
664
669
  _this2.setState(sizeAndOffset);
@@ -750,10 +755,12 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
750
755
 
751
756
  if (size === 0) {
752
757
  zeroHeightRowCount += 1;
758
+ } else {
759
+ // 渲染出来的行高度为0,说明是display=none情况,行高不存在该种异常情况,不保存当前的高度
760
+ this.rowHeightManager.updateRow(rowIndex, offset, size);
753
761
  }
754
762
 
755
763
  maxTrBottom = Math.max(maxTrBottom, offset + size);
756
- this.rowHeightManager.updateRow(rowIndex, offset, size);
757
764
  } // 当 estimatedRowHeight 过大时,可能出现「渲染行数过少,无法覆盖可视范围」的情况
758
765
  // 出现这种情况时,我们判断「下一次渲染能够渲染更多行」是否满足,满足的话就直接调用 forceUpdate
759
766
  // zeroHeightRowCount === 0 用于确保当前没有 display=none 的情况
@@ -53,6 +53,7 @@ export function contextMenu() {
53
53
  }
54
54
 
55
55
  e.preventDefault();
56
+ e.stopPropagation();
56
57
  showContextMenu(e);
57
58
  };
58
59
 
@@ -705,7 +705,12 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
705
705
  offsetY: offsetY
706
706
  };
707
707
  }), op.distinctUntilChanged(function (x, y) {
708
- // 因为 overscan 的存在,滚动较小的距离时不需要触发组件重渲染
708
+ // 如果表格区域被隐藏, 不需要触发组件重渲染
709
+ if (y.maxRenderHeight === 0 && y.maxRenderWidth === 0) {
710
+ return true;
711
+ } // 因为 overscan 的存在,滚动较小的距离时不需要触发组件重渲染
712
+
713
+
709
714
  return Math.abs(x.maxRenderWidth - y.maxRenderWidth) < _utils.OVERSCAN_SIZE / 2 && Math.abs(x.maxRenderHeight - y.maxRenderHeight) < _utils.OVERSCAN_SIZE / 2 && Math.abs(x.offsetY - y.offsetY) < _utils.OVERSCAN_SIZE / 2;
710
715
  })).subscribe(function (sizeAndOffset) {
711
716
  _this2.setState(sizeAndOffset);
@@ -797,10 +802,12 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
797
802
 
798
803
  if (size === 0) {
799
804
  zeroHeightRowCount += 1;
805
+ } else {
806
+ // 渲染出来的行高度为0,说明是display=none情况,行高不存在该种异常情况,不保存当前的高度
807
+ this.rowHeightManager.updateRow(rowIndex, offset, size);
800
808
  }
801
809
 
802
810
  maxTrBottom = Math.max(maxTrBottom, offset + size);
803
- this.rowHeightManager.updateRow(rowIndex, offset, size);
804
811
  } // 当 estimatedRowHeight 过大时,可能出现「渲染行数过少,无法覆盖可视范围」的情况
805
812
  // 出现这种情况时,我们判断「下一次渲染能够渲染更多行」是否满足,满足的话就直接调用 forceUpdate
806
813
  // zeroHeightRowCount === 0 用于确保当前没有 display=none 的情况
@@ -87,6 +87,7 @@ function contextMenu() {
87
87
  }
88
88
 
89
89
  e.preventDefault();
90
+ e.stopPropagation();
90
91
  showContextMenu(e);
91
92
  };
92
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/table",
3
- "version": "1.1.2-canary.2",
3
+ "version": "1.1.3-canary.2",
4
4
  "description": "金蝶 react table 组件",
5
5
  "title": "table",
6
6
  "keywords": [