uiw 5.0.0-bate-8 → 5.0.0-bate-9
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/dist/uiw.js +30 -11
- package/dist/uiw.min.js +1 -1
- package/package.json +60 -60
package/dist/uiw.js
CHANGED
|
@@ -16906,24 +16906,35 @@ class NodeTreeData {
|
|
|
16906
16906
|
var parentKey = this.childToParent.get(key) || '';
|
|
16907
16907
|
var childList = this.parentToChild.get(parentKey) || [];
|
|
16908
16908
|
var summary = {};
|
|
16909
|
+
var summaryCount = {};
|
|
16909
16910
|
var lg = childList.length;
|
|
16910
16911
|
for (var index = 0; index < lg; index++) {
|
|
16911
16912
|
var childKey = childList[index];
|
|
16912
16913
|
if (expandedKeys.includes(childKey)) {
|
|
16913
16914
|
(function () {
|
|
16914
|
-
summary[childKey] =
|
|
16915
|
+
summary[childKey] = {
|
|
16916
|
+
count: 1,
|
|
16917
|
+
level: index
|
|
16918
|
+
};
|
|
16915
16919
|
var count = _this.childTreeCount.get(childKey || '') || 0;
|
|
16916
16920
|
Object.entries(summary).forEach(_ref => {
|
|
16917
16921
|
var [k, value] = _ref;
|
|
16918
16922
|
/**计算合并行个数*/
|
|
16919
|
-
summary[k] =
|
|
16923
|
+
summary[k] = {
|
|
16924
|
+
count: value.count + count,
|
|
16925
|
+
level: value.level
|
|
16926
|
+
};
|
|
16927
|
+
summaryCount[value.level] = value.count + count;
|
|
16920
16928
|
});
|
|
16921
16929
|
})();
|
|
16922
16930
|
} else {
|
|
16923
16931
|
break;
|
|
16924
16932
|
}
|
|
16925
16933
|
}
|
|
16926
|
-
return
|
|
16934
|
+
return {
|
|
16935
|
+
summary,
|
|
16936
|
+
summaryCount
|
|
16937
|
+
};
|
|
16927
16938
|
}
|
|
16928
16939
|
}
|
|
16929
16940
|
var getRowSpan = (rowSpan, leve, index) => {
|
|
@@ -17109,11 +17120,13 @@ function TableTr(props) {
|
|
|
17109
17120
|
header,
|
|
17110
17121
|
isAutoExpanded = true,
|
|
17111
17122
|
treeData,
|
|
17112
|
-
isAutoMergeRowSpan
|
|
17123
|
+
isAutoMergeRowSpan,
|
|
17124
|
+
expandIndex,
|
|
17125
|
+
setExpandIndex
|
|
17113
17126
|
} = props;
|
|
17114
17127
|
var [isOpacity, setIsOpacity] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
|
|
17115
17128
|
var [childrenIndex, setChildrenIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0);
|
|
17116
|
-
|
|
17129
|
+
// const [expandIndex, setExpandIndex] = useState<Array<T[keyof T] | number>>([]);
|
|
17117
17130
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
|
|
17118
17131
|
setIsOpacity(!!(data != null && data.find(it => it[childrenColumnName])));
|
|
17119
17132
|
setChildrenIndex((keys == null ? void 0 : keys.findIndex(it => it.key === 'uiw-expanded')) === -1 ? 0 : 1);
|
|
@@ -17151,15 +17164,20 @@ function TableTr(props) {
|
|
|
17151
17164
|
return /*#__PURE__*/(0,jsx_runtime.jsx)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
17152
17165
|
children: data.map((trData, rowNum) => {
|
|
17153
17166
|
var key = rowKey ? trData[rowKey] : rowNum;
|
|
17154
|
-
var summary = treeData == null ? void 0 : treeData.getSum(key, expandIndex);
|
|
17167
|
+
var summary = treeData == null ? void 0 : treeData.getSum(key, expandIndex || []);
|
|
17155
17168
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
|
|
17156
17169
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
|
|
17157
17170
|
children: keys.map((keyName, colNum) => {
|
|
17171
|
+
var isHasChildren = Array.isArray(trData[childrenColumnName]);
|
|
17158
17172
|
var itemShow = {};
|
|
17173
|
+
console.log(isAutoMergeRowSpan, summary);
|
|
17159
17174
|
if (isAutoMergeRowSpan && summary) {
|
|
17160
|
-
|
|
17161
|
-
|
|
17162
|
-
|
|
17175
|
+
var newLaval = Reflect.get(keyName, 'level');
|
|
17176
|
+
var summaryCount = summary.summaryCount[newLaval];
|
|
17177
|
+
if (hierarchy === newLaval && isHasChildren) {
|
|
17178
|
+
itemShow.rowSpan = summaryCount;
|
|
17179
|
+
} else if (hierarchy && Reflect.has(keyName, 'level') && hierarchy > newLaval) {
|
|
17180
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {}, colNum);
|
|
17163
17181
|
}
|
|
17164
17182
|
}
|
|
17165
17183
|
var objs = {
|
|
@@ -17183,7 +17201,6 @@ function TableTr(props) {
|
|
|
17183
17201
|
} else if (itemShow.rowSpan && isAutoMergeRowSpan) {
|
|
17184
17202
|
objs.rowSpan = itemShow.rowSpan;
|
|
17185
17203
|
}
|
|
17186
|
-
var isHasChildren = Array.isArray(trData[childrenColumnName]);
|
|
17187
17204
|
var isExpanded = false;
|
|
17188
17205
|
if ((isOpacity || hierarchy || isHasChildren) && colNum === childrenIndex && isAutoExpanded) {
|
|
17189
17206
|
isExpanded = true;
|
|
@@ -17501,7 +17518,9 @@ function esm_Table(props) {
|
|
|
17501
17518
|
childrenColumnName: (expandable == null ? void 0 : expandable.childrenColumnName) || 'children',
|
|
17502
17519
|
isAutoExpanded: expandable == null ? void 0 : expandable.isAutoExpanded,
|
|
17503
17520
|
treeData: treeData,
|
|
17504
|
-
isAutoMergeRowSpan: isAutoMergeRowSpan
|
|
17521
|
+
isAutoMergeRowSpan: isAutoMergeRowSpan,
|
|
17522
|
+
expandIndex: expandIndex,
|
|
17523
|
+
setExpandIndex: setExpandIndex
|
|
17505
17524
|
})
|
|
17506
17525
|
}), data && data.length === 0 && empty && /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
|
|
17507
17526
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
|