@etsoo/react 1.8.11 → 1.8.12
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.
- package/lib/components/GridLoader.d.ts +2 -2
- package/lib/components/ScrollerGrid.d.ts +2 -2
- package/lib/components/ScrollerList.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/GridLoader.ts +2 -2
- package/src/components/ScrollerGrid.tsx +42 -38
- package/src/components/ScrollerList.tsx +40 -41
|
@@ -69,7 +69,7 @@ export type GridLoadDataPartialProps = {
|
|
|
69
69
|
/**
|
|
70
70
|
* Grid data loader
|
|
71
71
|
*/
|
|
72
|
-
export
|
|
72
|
+
export type GridLoader<T extends object> = {
|
|
73
73
|
/**
|
|
74
74
|
* Auto load data, otherwise call reset
|
|
75
75
|
* @default true
|
|
@@ -103,7 +103,7 @@ export interface GridLoader<T extends object> {
|
|
|
103
103
|
* Threshold at which to pre-fetch data; default is half of loadBatchSize
|
|
104
104
|
*/
|
|
105
105
|
threshold?: number | undefined;
|
|
106
|
-
}
|
|
106
|
+
};
|
|
107
107
|
type GridLoaderProps<T> = {
|
|
108
108
|
/**
|
|
109
109
|
* Auto load data, otherwise call reset
|
|
@@ -21,7 +21,7 @@ export type ScrollerGridItemRendererProps<T> = Omit<GridChildComponentProps<T>,
|
|
|
21
21
|
/**
|
|
22
22
|
* Scroller vertical grid props
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type ScrollerGridProps<T extends object> = GridLoader<T> & Omit<VariableSizeGridProps<T>, "children" | "rowCount" | "rowHeight"> & {
|
|
25
25
|
/**
|
|
26
26
|
* Footer renderer
|
|
27
27
|
*/
|
|
@@ -50,7 +50,7 @@ export interface ScrollerGridProps<T extends object> extends GridLoader<T>, Omit
|
|
|
50
50
|
* Returns the height of the specified row.
|
|
51
51
|
*/
|
|
52
52
|
rowHeight?: ((index: number) => number) | number;
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
54
|
/**
|
|
55
55
|
* Scroller grid forward ref
|
|
56
56
|
*/
|
|
@@ -6,7 +6,7 @@ import { GridMethodRef } from "./GridMethodRef";
|
|
|
6
6
|
/**
|
|
7
7
|
* Scroller vertical list props
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type ScrollerListProps<T extends object> = GridLoader<T> & Omit<ListProps<T>, "outerRef" | "height" | "width" | "children" | "itemCount"> & {
|
|
10
10
|
/**
|
|
11
11
|
* Methods ref
|
|
12
12
|
*/
|
|
@@ -35,7 +35,7 @@ export interface ScrollerListProps<T extends object> extends GridLoader<T>, Omit
|
|
|
35
35
|
* Item size, a function indicates its a variable size list
|
|
36
36
|
*/
|
|
37
37
|
itemSize: ((index: number) => number) | number;
|
|
38
|
-
}
|
|
38
|
+
};
|
|
39
39
|
/**
|
|
40
40
|
* Scroller list ref
|
|
41
41
|
*/
|
package/package.json
CHANGED
|
@@ -116,7 +116,7 @@ export type GridLoadDataPartialProps = {
|
|
|
116
116
|
/**
|
|
117
117
|
* Grid data loader
|
|
118
118
|
*/
|
|
119
|
-
export
|
|
119
|
+
export type GridLoader<T extends object> = {
|
|
120
120
|
/**
|
|
121
121
|
* Auto load data, otherwise call reset
|
|
122
122
|
* @default true
|
|
@@ -161,7 +161,7 @@ export interface GridLoader<T extends object> {
|
|
|
161
161
|
* Threshold at which to pre-fetch data; default is half of loadBatchSize
|
|
162
162
|
*/
|
|
163
163
|
threshold?: number | undefined;
|
|
164
|
-
}
|
|
164
|
+
};
|
|
165
165
|
|
|
166
166
|
type GridLoaderProps<T> = {
|
|
167
167
|
/**
|
|
@@ -44,44 +44,48 @@ export type ScrollerGridItemRendererProps<T> = Omit<
|
|
|
44
44
|
/**
|
|
45
45
|
* Scroller vertical grid props
|
|
46
46
|
*/
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
47
|
+
export type ScrollerGridProps<T extends object> = GridLoader<T> &
|
|
48
|
+
Omit<VariableSizeGridProps<T>, "children" | "rowCount" | "rowHeight"> & {
|
|
49
|
+
/**
|
|
50
|
+
* Footer renderer
|
|
51
|
+
*/
|
|
52
|
+
footerRenderer?: (
|
|
53
|
+
rows: T[],
|
|
54
|
+
states: GridLoaderStates<T>
|
|
55
|
+
) => React.ReactNode;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Header renderer
|
|
59
|
+
*/
|
|
60
|
+
headerRenderer?: (states: GridLoaderStates<T>) => React.ReactNode;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Id field
|
|
64
|
+
*/
|
|
65
|
+
idField?: DataTypes.Keys<T>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Item renderer
|
|
69
|
+
*/
|
|
70
|
+
itemRenderer: (
|
|
71
|
+
props: ScrollerGridItemRendererProps<T>
|
|
72
|
+
) => React.ReactElement;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Methods
|
|
76
|
+
*/
|
|
77
|
+
mRef?: React.Ref<ScrollerGridForwardRef<T>>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* On items select change
|
|
81
|
+
*/
|
|
82
|
+
onSelectChange?: (selectedItems: T[]) => void;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Returns the height of the specified row.
|
|
86
|
+
*/
|
|
87
|
+
rowHeight?: ((index: number) => number) | number;
|
|
88
|
+
};
|
|
85
89
|
|
|
86
90
|
/**
|
|
87
91
|
* Scroller grid forward ref
|
|
@@ -21,47 +21,46 @@ import { GridMethodRef } from "./GridMethodRef";
|
|
|
21
21
|
/**
|
|
22
22
|
* Scroller vertical list props
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
24
|
+
export type ScrollerListProps<T extends object> = GridLoader<T> &
|
|
25
|
+
Omit<
|
|
26
|
+
ListProps<T>,
|
|
27
|
+
"outerRef" | "height" | "width" | "children" | "itemCount" // Exclude these props, shoud be exisited otherwise will be failed
|
|
28
|
+
> & {
|
|
29
|
+
/**
|
|
30
|
+
* Methods ref
|
|
31
|
+
*/
|
|
32
|
+
mRef?: React.Ref<ScrollerListForwardRef<T>>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Outer div ref
|
|
36
|
+
*/
|
|
37
|
+
oRef?: React.Ref<HTMLDivElement>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Height of the list
|
|
41
|
+
*/
|
|
42
|
+
height?: number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Width of the list
|
|
46
|
+
*/
|
|
47
|
+
width?: number | string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Id field
|
|
51
|
+
*/
|
|
52
|
+
idField?: DataTypes.Keys<T>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Item renderer
|
|
56
|
+
*/
|
|
57
|
+
itemRenderer: (props: ListChildComponentProps<T>) => React.ReactElement;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Item size, a function indicates its a variable size list
|
|
61
|
+
*/
|
|
62
|
+
itemSize: ((index: number) => number) | number;
|
|
63
|
+
};
|
|
65
64
|
|
|
66
65
|
/**
|
|
67
66
|
* Scroller list ref
|