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