@etsoo/react 1.6.59 → 1.6.61
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.
|
@@ -78,8 +78,9 @@ export type GridCellRendererProps<T, P = any> = GridCellFormatterProps<T> & {
|
|
|
78
78
|
renderProps?: GridColumnRenderProps;
|
|
79
79
|
/**
|
|
80
80
|
* Set items for rerenderer
|
|
81
|
+
* @param callback Callback
|
|
81
82
|
*/
|
|
82
|
-
setItems: (items: T[]) => void;
|
|
83
|
+
setItems: (callback: (items: T[]) => T[] | undefined) => void;
|
|
83
84
|
};
|
|
84
85
|
/**
|
|
85
86
|
* Grid header cell renderer props
|
|
@@ -10,8 +10,9 @@ export type ScrollerGridItemRendererProps<T> = Omit<GridChildComponentProps<T>,
|
|
|
10
10
|
selectedItems: T[];
|
|
11
11
|
/**
|
|
12
12
|
* Set items for rerenderer
|
|
13
|
+
* @param callback Callback
|
|
13
14
|
*/
|
|
14
|
-
setItems: (items: T[]) => void;
|
|
15
|
+
setItems: (callback: (items: T[]) => T[] | undefined) => void;
|
|
15
16
|
/**
|
|
16
17
|
* Data
|
|
17
18
|
*/
|
|
@@ -94,7 +94,12 @@ export const ScrollerGrid = (props) => {
|
|
|
94
94
|
...itemProps,
|
|
95
95
|
data,
|
|
96
96
|
selectedItems: state.selectedItems,
|
|
97
|
-
setItems:
|
|
97
|
+
setItems: (callback) => {
|
|
98
|
+
const result = callback(rows);
|
|
99
|
+
if (result == null)
|
|
100
|
+
return;
|
|
101
|
+
setRows(result);
|
|
102
|
+
}
|
|
98
103
|
});
|
|
99
104
|
};
|
|
100
105
|
// Local items renderer callback
|
package/package.json
CHANGED
|
@@ -117,8 +117,9 @@ export type GridCellRendererProps<T, P = any> = GridCellFormatterProps<T> & {
|
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Set items for rerenderer
|
|
120
|
+
* @param callback Callback
|
|
120
121
|
*/
|
|
121
|
-
setItems: (items: T[]) => void;
|
|
122
|
+
setItems: (callback: (items: T[]) => T[] | undefined) => void;
|
|
122
123
|
};
|
|
123
124
|
|
|
124
125
|
/**
|
|
@@ -21,8 +21,9 @@ export type ScrollerGridItemRendererProps<T> = Omit<
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Set items for rerenderer
|
|
24
|
+
* @param callback Callback
|
|
24
25
|
*/
|
|
25
|
-
setItems: (items: T[]) => void;
|
|
26
|
+
setItems: (callback: (items: T[]) => T[] | undefined) => void;
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Data
|
|
@@ -284,7 +285,11 @@ export const ScrollerGrid = <
|
|
|
284
285
|
...itemProps,
|
|
285
286
|
data,
|
|
286
287
|
selectedItems: state.selectedItems,
|
|
287
|
-
setItems:
|
|
288
|
+
setItems: (callback: (items: T[]) => T[] | undefined) => {
|
|
289
|
+
const result = callback(rows);
|
|
290
|
+
if (result == null) return;
|
|
291
|
+
setRows(result);
|
|
292
|
+
}
|
|
288
293
|
});
|
|
289
294
|
};
|
|
290
295
|
|