@kdcloudjs/table 1.2.0-canary.7 → 1.2.0-canary.8

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.
@@ -27,7 +27,8 @@ export var autoFillTableWidth = function autoFillTableWidth() {
27
27
  // 保存剩余的flex总和和剩余宽度总和宽度
28
28
  var residualFlexCount = flexCount;
29
29
  var residualFlexWidth = remainingWidth;
30
- var columnSize = pipeline.getFeatureOptions(COLUMN_SIZE_KEY) || {};
30
+ var columnSize = pipeline.getFeatureOptions(COLUMN_SIZE_KEY);
31
+ var enableColumnResizeWidthFeature = !!columnSize;
31
32
  pipeline.mapColumns(makeRecursiveMapper(function (col, recursiveFlatMapInfo) {
32
33
  var isLeaf = recursiveFlatMapInfo.isLeaf;
33
34
 
@@ -46,12 +47,15 @@ export var autoFillTableWidth = function autoFillTableWidth() {
46
47
  col.width = clamp(minWidth, preColWidth + (residualFlexCount === flex ? residualFlexWidth : usedRemainingWidth), maxWidth);
47
48
  residualFlexCount -= flex;
48
49
  residualFlexWidth -= col.width - preColWidth;
49
- columnSize[code] = col.width;
50
+
51
+ if (enableColumnResizeWidthFeature) {
52
+ columnSize[code] = col.width;
53
+ }
50
54
  }
51
55
 
52
56
  return col;
53
57
  }));
54
- pipeline.setFeatureOptions(COLUMN_SIZE_KEY, columnSize);
58
+ enableColumnResizeWidthFeature && pipeline.setFeatureOptions(COLUMN_SIZE_KEY, columnSize);
55
59
  }
56
60
  } else {
57
61
  // 未设置了flex宽度,创建占位列
@@ -48,7 +48,8 @@ var autoFillTableWidth = function autoFillTableWidth() {
48
48
  // 保存剩余的flex总和和剩余宽度总和宽度
49
49
  var residualFlexCount = flexCount;
50
50
  var residualFlexWidth = remainingWidth;
51
- var columnSize = pipeline.getFeatureOptions(_columnResizeWidth.COLUMN_SIZE_KEY) || {};
51
+ var columnSize = pipeline.getFeatureOptions(_columnResizeWidth.COLUMN_SIZE_KEY);
52
+ var enableColumnResizeWidthFeature = !!columnSize;
52
53
  pipeline.mapColumns((0, _utils.makeRecursiveMapper)(function (col, recursiveFlatMapInfo) {
53
54
  var isLeaf = recursiveFlatMapInfo.isLeaf;
54
55
 
@@ -67,12 +68,15 @@ var autoFillTableWidth = function autoFillTableWidth() {
67
68
  col.width = clamp(minWidth, preColWidth + (residualFlexCount === flex ? residualFlexWidth : usedRemainingWidth), maxWidth);
68
69
  residualFlexCount -= flex;
69
70
  residualFlexWidth -= col.width - preColWidth;
70
- columnSize[code] = col.width;
71
+
72
+ if (enableColumnResizeWidthFeature) {
73
+ columnSize[code] = col.width;
74
+ }
71
75
  }
72
76
 
73
77
  return col;
74
78
  }));
75
- pipeline.setFeatureOptions(_columnResizeWidth.COLUMN_SIZE_KEY, columnSize);
79
+ enableColumnResizeWidthFeature && pipeline.setFeatureOptions(_columnResizeWidth.COLUMN_SIZE_KEY, columnSize);
76
80
  }
77
81
  } else {
78
82
  // 未设置了flex宽度,创建占位列
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/table",
3
- "version": "1.2.0-canary.7",
3
+ "version": "1.2.0-canary.8",
4
4
  "description": "金蝶 react table 组件",
5
5
  "title": "table",
6
6
  "keywords": [