@etsoo/react 1.6.61 → 1.6.63
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.
|
@@ -2,6 +2,7 @@ import { EntityStatus } from '@etsoo/appscript';
|
|
|
2
2
|
import { DataTypes } from '@etsoo/shared';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { GridLoaderStates } from './GridLoader';
|
|
5
|
+
import { ScrollerGridForwardRef } from './ScrollerGrid';
|
|
5
6
|
/**
|
|
6
7
|
* Grid data type
|
|
7
8
|
*/
|
|
@@ -80,7 +81,7 @@ export type GridCellRendererProps<T, P = any> = GridCellFormatterProps<T> & {
|
|
|
80
81
|
* Set items for rerenderer
|
|
81
82
|
* @param callback Callback
|
|
82
83
|
*/
|
|
83
|
-
setItems: (callback: (items: T[]) => T[] | undefined) => void;
|
|
84
|
+
setItems: (callback: (items: T[], ref?: React.Ref<ScrollerGridForwardRef<T>>) => T[] | undefined | void) => void;
|
|
84
85
|
};
|
|
85
86
|
/**
|
|
86
87
|
* Grid header cell renderer props
|
|
@@ -12,7 +12,7 @@ export type ScrollerGridItemRendererProps<T> = Omit<GridChildComponentProps<T>,
|
|
|
12
12
|
* Set items for rerenderer
|
|
13
13
|
* @param callback Callback
|
|
14
14
|
*/
|
|
15
|
-
setItems: (callback: (items: T[]) => T[] | undefined) => void;
|
|
15
|
+
setItems: (callback: (items: T[], ref?: React.Ref<ScrollerGridForwardRef<T>>) => T[] | undefined | void) => void;
|
|
16
16
|
/**
|
|
17
17
|
* Data
|
|
18
18
|
*/
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import { EntityStatus } from '@etsoo/appscript';
|
|
|
2
2
|
import { DataTypes } from '@etsoo/shared';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { GridLoaderStates } from './GridLoader';
|
|
5
|
+
import { ScrollerGridForwardRef } from './ScrollerGrid';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Grid data type
|
|
@@ -119,7 +120,12 @@ export type GridCellRendererProps<T, P = any> = GridCellFormatterProps<T> & {
|
|
|
119
120
|
* Set items for rerenderer
|
|
120
121
|
* @param callback Callback
|
|
121
122
|
*/
|
|
122
|
-
setItems: (
|
|
123
|
+
setItems: (
|
|
124
|
+
callback: (
|
|
125
|
+
items: T[],
|
|
126
|
+
ref?: React.Ref<ScrollerGridForwardRef<T>>
|
|
127
|
+
) => T[] | undefined | void
|
|
128
|
+
) => void;
|
|
123
129
|
};
|
|
124
130
|
|
|
125
131
|
/**
|
|
@@ -23,7 +23,12 @@ export type ScrollerGridItemRendererProps<T> = Omit<
|
|
|
23
23
|
* Set items for rerenderer
|
|
24
24
|
* @param callback Callback
|
|
25
25
|
*/
|
|
26
|
-
setItems: (
|
|
26
|
+
setItems: (
|
|
27
|
+
callback: (
|
|
28
|
+
items: T[],
|
|
29
|
+
ref?: React.Ref<ScrollerGridForwardRef<T>>
|
|
30
|
+
) => T[] | undefined | void
|
|
31
|
+
) => void;
|
|
27
32
|
|
|
28
33
|
/**
|
|
29
34
|
* Data
|
|
@@ -285,8 +290,13 @@ export const ScrollerGrid = <
|
|
|
285
290
|
...itemProps,
|
|
286
291
|
data,
|
|
287
292
|
selectedItems: state.selectedItems,
|
|
288
|
-
setItems: (
|
|
289
|
-
|
|
293
|
+
setItems: (
|
|
294
|
+
callback: (
|
|
295
|
+
items: T[],
|
|
296
|
+
ref?: React.Ref<ScrollerGridForwardRef<T>>
|
|
297
|
+
) => T[] | undefined | void
|
|
298
|
+
) => {
|
|
299
|
+
const result = callback(rows, mRef);
|
|
290
300
|
if (result == null) return;
|
|
291
301
|
setRows(result);
|
|
292
302
|
}
|