@etsoo/react 1.6.61 → 1.6.62
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[]) => T[] | undefined, ref?: React.Ref<ScrollerGridForwardRef<T>>) => 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[]) => T[] | undefined, ref?: React.Ref<ScrollerGridForwardRef<T>>) => 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,10 @@ 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: (items: T[]) => T[] | undefined,
|
|
125
|
+
ref?: React.Ref<ScrollerGridForwardRef<T>>
|
|
126
|
+
) => void;
|
|
123
127
|
};
|
|
124
128
|
|
|
125
129
|
/**
|
|
@@ -23,7 +23,10 @@ export type ScrollerGridItemRendererProps<T> = Omit<
|
|
|
23
23
|
* Set items for rerenderer
|
|
24
24
|
* @param callback Callback
|
|
25
25
|
*/
|
|
26
|
-
setItems: (
|
|
26
|
+
setItems: (
|
|
27
|
+
callback: (items: T[]) => T[] | undefined,
|
|
28
|
+
ref?: React.Ref<ScrollerGridForwardRef<T>>
|
|
29
|
+
) => void;
|
|
27
30
|
|
|
28
31
|
/**
|
|
29
32
|
* Data
|
|
@@ -285,8 +288,13 @@ export const ScrollerGrid = <
|
|
|
285
288
|
...itemProps,
|
|
286
289
|
data,
|
|
287
290
|
selectedItems: state.selectedItems,
|
|
288
|
-
setItems: (
|
|
289
|
-
|
|
291
|
+
setItems: (
|
|
292
|
+
callback: (
|
|
293
|
+
items: T[],
|
|
294
|
+
ref?: React.Ref<ScrollerGridForwardRef<T>>
|
|
295
|
+
) => T[] | undefined
|
|
296
|
+
) => {
|
|
297
|
+
const result = callback(rows, mRef);
|
|
290
298
|
if (result == null) return;
|
|
291
299
|
setRows(result);
|
|
292
300
|
}
|