@nokecy/qc-ui 0.3.1 → 0.3.3
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.
|
@@ -115,22 +115,27 @@ function AgGridPlus(props) {
|
|
|
115
115
|
|
|
116
116
|
var _useState9 = (0, _react.useState)({}),
|
|
117
117
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
selectRow = _useState10[0],
|
|
119
|
+
setSelectRow = _useState10[1];
|
|
120
120
|
|
|
121
|
-
var _useState11 = (0, _react.useState)(),
|
|
121
|
+
var _useState11 = (0, _react.useState)({}),
|
|
122
122
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
queryFilter = _useState12[0],
|
|
124
|
+
setQueryFilter = _useState12[1];
|
|
125
125
|
|
|
126
|
-
var _useState13 = (0, _react.useState)(
|
|
126
|
+
var _useState13 = (0, _react.useState)(),
|
|
127
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
128
|
+
sortColumn = _useState14[0],
|
|
129
|
+
setSortColumn = _useState14[1];
|
|
130
|
+
|
|
131
|
+
var _useState15 = (0, _react.useState)({
|
|
127
132
|
pageSize: 200,
|
|
128
133
|
current: 1,
|
|
129
134
|
total: dataSource ? dataSource.length : 0
|
|
130
135
|
}),
|
|
131
|
-
|
|
132
|
-
pagination =
|
|
133
|
-
setPagination =
|
|
136
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
137
|
+
pagination = _useState16[0],
|
|
138
|
+
setPagination = _useState16[1];
|
|
134
139
|
|
|
135
140
|
(0, _react.useImperativeHandle)(propsGridRef, function () {
|
|
136
141
|
return gridRef.current;
|
|
@@ -260,6 +265,7 @@ function AgGridPlus(props) {
|
|
|
260
265
|
props.onSelectionChanged && props.onSelectionChanged(e);
|
|
261
266
|
}, []);
|
|
262
267
|
var onRowSelected = (0, _react.useCallback)(function (e) {
|
|
268
|
+
setSelectRow(e.data);
|
|
263
269
|
props.onRowSelected && props.onRowSelected(e);
|
|
264
270
|
}, []);
|
|
265
271
|
|
|
@@ -271,9 +277,11 @@ function AgGridPlus(props) {
|
|
|
271
277
|
};
|
|
272
278
|
}, [queryFilter, JSON.stringify(gridParams), JSON.stringify(sortColumn)]);
|
|
273
279
|
var colDefs = (0, _react.useMemo)(function () {
|
|
274
|
-
|
|
280
|
+
var columnProps = _react.default.Children.map(children, function (child, index) {
|
|
275
281
|
return child.props;
|
|
276
|
-
})
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
return columnProps ? [] : columnProps.filter(function (x) {
|
|
277
285
|
return !x.hideInTable;
|
|
278
286
|
});
|
|
279
287
|
}, []);
|
|
@@ -88,22 +88,27 @@ function AgGridPlus(props) {
|
|
|
88
88
|
|
|
89
89
|
var _useState9 = useState({}),
|
|
90
90
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
selectRow = _useState10[0],
|
|
92
|
+
setSelectRow = _useState10[1];
|
|
93
93
|
|
|
94
|
-
var _useState11 = useState(),
|
|
94
|
+
var _useState11 = useState({}),
|
|
95
95
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
queryFilter = _useState12[0],
|
|
97
|
+
setQueryFilter = _useState12[1];
|
|
98
98
|
|
|
99
|
-
var _useState13 = useState(
|
|
99
|
+
var _useState13 = useState(),
|
|
100
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
101
|
+
sortColumn = _useState14[0],
|
|
102
|
+
setSortColumn = _useState14[1];
|
|
103
|
+
|
|
104
|
+
var _useState15 = useState({
|
|
100
105
|
pageSize: 200,
|
|
101
106
|
current: 1,
|
|
102
107
|
total: dataSource ? dataSource.length : 0
|
|
103
108
|
}),
|
|
104
|
-
|
|
105
|
-
pagination =
|
|
106
|
-
setPagination =
|
|
109
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
110
|
+
pagination = _useState16[0],
|
|
111
|
+
setPagination = _useState16[1];
|
|
107
112
|
|
|
108
113
|
useImperativeHandle(propsGridRef, function () {
|
|
109
114
|
return gridRef.current;
|
|
@@ -233,6 +238,7 @@ function AgGridPlus(props) {
|
|
|
233
238
|
props.onSelectionChanged && props.onSelectionChanged(e);
|
|
234
239
|
}, []);
|
|
235
240
|
var onRowSelected = useCallback(function (e) {
|
|
241
|
+
setSelectRow(e.data);
|
|
236
242
|
props.onRowSelected && props.onRowSelected(e);
|
|
237
243
|
}, []);
|
|
238
244
|
|
|
@@ -244,9 +250,10 @@ function AgGridPlus(props) {
|
|
|
244
250
|
};
|
|
245
251
|
}, [queryFilter, JSON.stringify(gridParams), JSON.stringify(sortColumn)]);
|
|
246
252
|
var colDefs = useMemo(function () {
|
|
247
|
-
|
|
253
|
+
var columnProps = React.Children.map(children, function (child, index) {
|
|
248
254
|
return child.props;
|
|
249
|
-
})
|
|
255
|
+
});
|
|
256
|
+
return columnProps ? [] : columnProps.filter(function (x) {
|
|
250
257
|
return !x.hideInTable;
|
|
251
258
|
});
|
|
252
259
|
}, []);
|