@nokecy/qc-ui 0.3.14 → 0.3.16
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.
|
@@ -294,7 +294,7 @@ function AgGridPlus(props) {
|
|
|
294
294
|
return !columnProps ? props.columnDefs ? props.columnDefs : [] : columnProps;
|
|
295
295
|
}, [props.columnDefs]);
|
|
296
296
|
var rowDataMemo = (0, _react.useMemo)(function () {
|
|
297
|
-
return props.treeData ? (0, _utils.flatten)((0, _utils.toTree)(rowData,
|
|
297
|
+
return props.treeData ? (0, _utils.flatten)((0, _utils.toTree)(rowData, treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName !== null && treeParentName !== void 0 ? treeParentName : "parentId"), treeParentName) : rowData;
|
|
298
298
|
}, [rowData, props.treeData]);
|
|
299
299
|
return /*#__PURE__*/_react.default.createElement(_antd.Spin, {
|
|
300
300
|
spinning: loading,
|
|
@@ -125,8 +125,9 @@ exports.dateTimeValueFormatter = dateTimeValueFormatter;
|
|
|
125
125
|
var flatten = function flatten(arr, parentPropName, parentref) {
|
|
126
126
|
var data = arr ? arr.reduce(function (result, item) {
|
|
127
127
|
return [].concat(_toConsumableArray(result), [_objectSpread(_objectSpread({}, item), {}, {
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
children: undefined,
|
|
129
|
+
hierarchy: parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : []
|
|
130
|
+
})], _toConsumableArray(flatten(item.children, parentPropName, parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [])));
|
|
130
131
|
}, []) : [];
|
|
131
132
|
return data;
|
|
132
133
|
};
|
|
@@ -265,7 +265,7 @@ function AgGridPlus(props) {
|
|
|
265
265
|
return !columnProps ? props.columnDefs ? props.columnDefs : [] : columnProps;
|
|
266
266
|
}, [props.columnDefs]);
|
|
267
267
|
var rowDataMemo = useMemo(function () {
|
|
268
|
-
return props.treeData ? flatten(toTree(rowData,
|
|
268
|
+
return props.treeData ? flatten(toTree(rowData, treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName !== null && treeParentName !== void 0 ? treeParentName : "parentId"), treeParentName) : rowData;
|
|
269
269
|
}, [rowData, props.treeData]);
|
|
270
270
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
271
271
|
spinning: loading,
|
|
@@ -108,8 +108,9 @@ var dateTimeValueFormatter = function dateTimeValueFormatter(params) {
|
|
|
108
108
|
var flatten = function flatten(arr, parentPropName, parentref) {
|
|
109
109
|
var data = arr ? arr.reduce(function (result, item) {
|
|
110
110
|
return [].concat(_toConsumableArray(result), [_objectSpread(_objectSpread({}, item), {}, {
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
children: undefined,
|
|
112
|
+
hierarchy: parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : []
|
|
113
|
+
})], _toConsumableArray(flatten(item.children, parentPropName, parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [])));
|
|
113
114
|
}, []) : [];
|
|
114
115
|
return data;
|
|
115
116
|
};
|