@nokecy/qc-ui 0.3.15 → 0.3.17
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/cjs/ag-grid-plus/ag-gridPlus.js +1 -1
- package/dist/cjs/ag-grid-plus/utils.d.ts +1 -1
- package/dist/cjs/ag-grid-plus/utils.js +4 -3
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +1 -1
- package/dist/esm/ag-grid-plus/utils.d.ts +1 -1
- package/dist/esm/ag-grid-plus/utils.js +4 -3
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +1 -1
|
@@ -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, treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName !== null && treeParentName !== void 0 ? treeParentName : "parentId"), treeParentName) : 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"), treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName) : rowData;
|
|
298
298
|
}, [rowData, props.treeData]);
|
|
299
299
|
return /*#__PURE__*/_react.default.createElement(_antd.Spin, {
|
|
300
300
|
spinning: loading,
|
|
@@ -3,7 +3,7 @@ declare const convertFilterModel: (filterModel: any) => string;
|
|
|
3
3
|
declare const convertSortModel: (sortModel: any[]) => string;
|
|
4
4
|
declare const dateValueFormatter: (params: ValueFormatterParams) => string;
|
|
5
5
|
declare const dateTimeValueFormatter: (params: ValueFormatterParams) => string;
|
|
6
|
-
declare const flatten: (arr: any[], parentPropName: any, parentref?: any[]) => any;
|
|
6
|
+
declare const flatten: (arr: any[], keyName: any, parentPropName: any, parentref?: any[]) => any;
|
|
7
7
|
declare const toTree: (data: any[], keyName: any, parentKeyName: any) => any[];
|
|
8
8
|
declare const flattenTreeDeep: (treeData: any[], childrenName?: string) => any[];
|
|
9
9
|
export { dateValueFormatter, dateTimeValueFormatter, convertFilterModel, convertSortModel, flattenTreeDeep, toTree, flatten };
|
|
@@ -122,11 +122,12 @@ var dateTimeValueFormatter = function dateTimeValueFormatter(params) {
|
|
|
122
122
|
|
|
123
123
|
exports.dateTimeValueFormatter = dateTimeValueFormatter;
|
|
124
124
|
|
|
125
|
-
var flatten = function flatten(arr, parentPropName, parentref) {
|
|
125
|
+
var flatten = function flatten(arr, keyName, 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]]) : [item[keyName]]
|
|
130
|
+
})], _toConsumableArray(flatten(item.children, keyName, parentPropName, parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[keyName]])));
|
|
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, treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName !== null && treeParentName !== void 0 ? treeParentName : "parentId"), treeParentName) : rowData;
|
|
268
|
+
return props.treeData ? flatten(toTree(rowData, treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName !== null && treeParentName !== void 0 ? treeParentName : "parentId"), treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName) : rowData;
|
|
269
269
|
}, [rowData, props.treeData]);
|
|
270
270
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
271
271
|
spinning: loading,
|
|
@@ -3,7 +3,7 @@ declare const convertFilterModel: (filterModel: any) => string;
|
|
|
3
3
|
declare const convertSortModel: (sortModel: any[]) => string;
|
|
4
4
|
declare const dateValueFormatter: (params: ValueFormatterParams) => string;
|
|
5
5
|
declare const dateTimeValueFormatter: (params: ValueFormatterParams) => string;
|
|
6
|
-
declare const flatten: (arr: any[], parentPropName: any, parentref?: any[]) => any;
|
|
6
|
+
declare const flatten: (arr: any[], keyName: any, parentPropName: any, parentref?: any[]) => any;
|
|
7
7
|
declare const toTree: (data: any[], keyName: any, parentKeyName: any) => any[];
|
|
8
8
|
declare const flattenTreeDeep: (treeData: any[], childrenName?: string) => any[];
|
|
9
9
|
export { dateValueFormatter, dateTimeValueFormatter, convertFilterModel, convertSortModel, flattenTreeDeep, toTree, flatten };
|
|
@@ -105,11 +105,12 @@ var dateTimeValueFormatter = function dateTimeValueFormatter(params) {
|
|
|
105
105
|
}; //@ts-ignore
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
var flatten = function flatten(arr, parentPropName, parentref) {
|
|
108
|
+
var flatten = function flatten(arr, keyName, 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]]) : [item[keyName]]
|
|
113
|
+
})], _toConsumableArray(flatten(item.children, keyName, parentPropName, parentref ? [].concat(_toConsumableArray(parentref), [item[parentPropName]]) : [item[keyName]])));
|
|
113
114
|
}, []) : [];
|
|
114
115
|
return data;
|
|
115
116
|
};
|