@nokecy/qc-ui 0.3.17 → 0.3.18
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/queryForm/index.js +10 -1
- package/dist/cjs/ag-grid-plus/utils.d.ts +1 -1
- package/dist/cjs/ag-grid-plus/utils.js +3 -3
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +1 -1
- package/dist/esm/ag-grid-plus/queryForm/index.js +10 -1
- package/dist/esm/ag-grid-plus/utils.d.ts +1 -1
- package/dist/esm/ag-grid-plus/utils.js +3 -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"), treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id"
|
|
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") : rowData;
|
|
298
298
|
}, [rowData, props.treeData]);
|
|
299
299
|
return /*#__PURE__*/_react.default.createElement(_antd.Spin, {
|
|
300
300
|
spinning: loading,
|
|
@@ -134,6 +134,16 @@ var FormRender = function FormRender(props) {
|
|
|
134
134
|
break;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
switch (colDef.type) {
|
|
138
|
+
case "dateTimeColumn":
|
|
139
|
+
component = "DatePicker.RangePicker";
|
|
140
|
+
break;
|
|
141
|
+
|
|
142
|
+
case "boolColumn":
|
|
143
|
+
component = "BoolSelect";
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
137
147
|
return component ? component : "Input";
|
|
138
148
|
}
|
|
139
149
|
};
|
|
@@ -163,7 +173,6 @@ var FormRender = function FormRender(props) {
|
|
|
163
173
|
return x.colId == colDef.field;
|
|
164
174
|
});
|
|
165
175
|
var columnDefs = gridApi === null || gridApi === void 0 ? void 0 : gridApi.getColumnDef(colDef.field);
|
|
166
|
-
console.log("columnDefs", columnDefs);
|
|
167
176
|
return _objectSpread(_objectSpread(_objectSpread({}, colDef), columnDefs), state);
|
|
168
177
|
});
|
|
169
178
|
columns = columns ? (_columns = columns) === null || _columns === void 0 ? void 0 : _columns.filter(function (i) {
|
|
@@ -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[], keyName: any,
|
|
6
|
+
declare const flatten: (arr: any[], keyName: 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,12 +122,12 @@ var dateTimeValueFormatter = function dateTimeValueFormatter(params) {
|
|
|
122
122
|
|
|
123
123
|
exports.dateTimeValueFormatter = dateTimeValueFormatter;
|
|
124
124
|
|
|
125
|
-
var flatten = function flatten(arr, keyName,
|
|
125
|
+
var flatten = function flatten(arr, keyName, parentref) {
|
|
126
126
|
var data = arr ? arr.reduce(function (result, item) {
|
|
127
127
|
return [].concat(_toConsumableArray(result), [_objectSpread(_objectSpread({}, item), {}, {
|
|
128
128
|
children: undefined,
|
|
129
|
-
hierarchy: parentref ? [].concat(_toConsumableArray(parentref), [item[
|
|
130
|
-
})], _toConsumableArray(flatten(item.children, keyName,
|
|
129
|
+
hierarchy: parentref ? [].concat(_toConsumableArray(parentref), [item[keyName]]) : [item[keyName]]
|
|
130
|
+
})], _toConsumableArray(flatten(item.children, keyName, parentref ? [].concat(_toConsumableArray(parentref), [item[keyName]]) : [item[keyName]])));
|
|
131
131
|
}, []) : [];
|
|
132
132
|
return data;
|
|
133
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"), treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id"
|
|
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") : rowData;
|
|
269
269
|
}, [rowData, props.treeData]);
|
|
270
270
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
271
271
|
spinning: loading,
|
|
@@ -113,6 +113,16 @@ var FormRender = function FormRender(props) {
|
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
switch (colDef.type) {
|
|
117
|
+
case "dateTimeColumn":
|
|
118
|
+
component = "DatePicker.RangePicker";
|
|
119
|
+
break;
|
|
120
|
+
|
|
121
|
+
case "boolColumn":
|
|
122
|
+
component = "BoolSelect";
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
|
|
116
126
|
return component ? component : "Input";
|
|
117
127
|
}
|
|
118
128
|
};
|
|
@@ -142,7 +152,6 @@ var FormRender = function FormRender(props) {
|
|
|
142
152
|
return x.colId == colDef.field;
|
|
143
153
|
});
|
|
144
154
|
var columnDefs = gridApi === null || gridApi === void 0 ? void 0 : gridApi.getColumnDef(colDef.field);
|
|
145
|
-
console.log("columnDefs", columnDefs);
|
|
146
155
|
return _objectSpread(_objectSpread(_objectSpread({}, colDef), columnDefs), state);
|
|
147
156
|
});
|
|
148
157
|
columns = columns ? (_columns = columns) === null || _columns === void 0 ? void 0 : _columns.filter(function (i) {
|
|
@@ -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[], keyName: any,
|
|
6
|
+
declare const flatten: (arr: any[], keyName: 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,12 +105,12 @@ var dateTimeValueFormatter = function dateTimeValueFormatter(params) {
|
|
|
105
105
|
}; //@ts-ignore
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
var flatten = function flatten(arr, keyName,
|
|
108
|
+
var flatten = function flatten(arr, keyName, parentref) {
|
|
109
109
|
var data = arr ? arr.reduce(function (result, item) {
|
|
110
110
|
return [].concat(_toConsumableArray(result), [_objectSpread(_objectSpread({}, item), {}, {
|
|
111
111
|
children: undefined,
|
|
112
|
-
hierarchy: parentref ? [].concat(_toConsumableArray(parentref), [item[
|
|
113
|
-
})], _toConsumableArray(flatten(item.children, keyName,
|
|
112
|
+
hierarchy: parentref ? [].concat(_toConsumableArray(parentref), [item[keyName]]) : [item[keyName]]
|
|
113
|
+
})], _toConsumableArray(flatten(item.children, keyName, parentref ? [].concat(_toConsumableArray(parentref), [item[keyName]]) : [item[keyName]])));
|
|
114
114
|
}, []) : [];
|
|
115
115
|
return data;
|
|
116
116
|
};
|