@etsoo/react 1.6.59 → 1.6.60
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.
|
@@ -76,10 +76,6 @@ export type GridCellRendererProps<T, P = any> = GridCellFormatterProps<T> & {
|
|
|
76
76
|
* Render props
|
|
77
77
|
*/
|
|
78
78
|
renderProps?: GridColumnRenderProps;
|
|
79
|
-
/**
|
|
80
|
-
* Set items for rerenderer
|
|
81
|
-
*/
|
|
82
|
-
setItems: (items: T[]) => void;
|
|
83
79
|
};
|
|
84
80
|
/**
|
|
85
81
|
* 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
|
@@ -114,11 +114,6 @@ export type GridCellRendererProps<T, P = any> = GridCellFormatterProps<T> & {
|
|
|
114
114
|
* Render props
|
|
115
115
|
*/
|
|
116
116
|
renderProps?: GridColumnRenderProps;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Set items for rerenderer
|
|
120
|
-
*/
|
|
121
|
-
setItems: (items: T[]) => void;
|
|
122
117
|
};
|
|
123
118
|
|
|
124
119
|
/**
|
|
@@ -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
|
|