@kdcloudjs/table 1.1.2 → 1.1.3-canary.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.
package/es/table/base/table.js
CHANGED
|
@@ -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
|
-
//
|
|
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 的情况
|
package/lib/table/base/table.js
CHANGED
|
@@ -705,7 +705,12 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
705
705
|
offsetY: offsetY
|
|
706
706
|
};
|
|
707
707
|
}), op.distinctUntilChanged(function (x, y) {
|
|
708
|
-
//
|
|
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 的情况
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kdcloudjs/table",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3-canary.1",
|
|
4
4
|
"description": "金蝶 react table 组件",
|
|
5
5
|
"title": "table",
|
|
6
6
|
"keywords": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"test:ci": "jest --config .jest.js --coverage --ci --update-snapshot",
|
|
56
56
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --skip-unstable",
|
|
57
57
|
"pub": "npm run test:all && npm run build && cross-env PUB_ENV=pub np --no-cleanup --no-tests",
|
|
58
|
-
"pub:
|
|
58
|
+
"pub:canary": "npm run build && cross-env PUB_ENV=pub np --no-cleanup --anyBranch --no-tests --tag=canary",
|
|
59
59
|
"new": "node scripts/create-component.js",
|
|
60
60
|
"kd-ui": "npm install @kingdee-ui/kui --registry http://npm.kingdee.com/"
|
|
61
61
|
},
|