@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.
@@ -69,7 +69,7 @@ export type GridLoadDataPartialProps = {
69
69
  /**
70
70
  * Grid data loader
71
71
  */
72
- export interface GridLoader<T extends object> {
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 interface ScrollerGridProps<T extends object> extends GridLoader<T>, Omit<VariableSizeGridProps<T>, "children" | "rowCount" | "rowHeight"> {
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 interface ScrollerListProps<T extends object> extends GridLoader<T>, Omit<ListProps<T>, "outerRef" | "height" | "width" | "children" | "itemCount"> {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.8.11",
3
+ "version": "1.8.12",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -116,7 +116,7 @@ export type GridLoadDataPartialProps = {
116
116
  /**
117
117
  * Grid data loader
118
118
  */
119
- export interface GridLoader<T extends object> {
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 interface ScrollerGridProps<T extends object>
48
- extends GridLoader<T>,
49
- Omit<VariableSizeGridProps<T>, "children" | "rowCount" | "rowHeight"> {
50
- /**
51
- * Footer renderer
52
- */
53
- footerRenderer?: (rows: T[], states: GridLoaderStates<T>) => React.ReactNode;
54
-
55
- /**
56
- * Header renderer
57
- */
58
- headerRenderer?: (states: GridLoaderStates<T>) => React.ReactNode;
59
-
60
- /**
61
- * Id field
62
- */
63
- idField?: DataTypes.Keys<T>;
64
-
65
- /**
66
- * Item renderer
67
- */
68
- itemRenderer: (props: ScrollerGridItemRendererProps<T>) => React.ReactElement;
69
-
70
- /**
71
- * Methods
72
- */
73
- mRef?: React.Ref<ScrollerGridForwardRef<T>>;
74
-
75
- /**
76
- * On items select change
77
- */
78
- onSelectChange?: (selectedItems: T[]) => void;
79
-
80
- /**
81
- * Returns the height of the specified row.
82
- */
83
- rowHeight?: ((index: number) => number) | number;
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 interface ScrollerListProps<T extends object>
25
- extends GridLoader<T>,
26
- Omit<
27
- ListProps<T>,
28
- "outerRef" | "height" | "width" | "children" | "itemCount" // Exclude these props, shoud be exisited otherwise will be failed
29
- > {
30
- /**
31
- * Methods ref
32
- */
33
- mRef?: React.Ref<ScrollerListForwardRef<T>>;
34
-
35
- /**
36
- * Outer div ref
37
- */
38
- oRef?: React.Ref<HTMLDivElement>;
39
-
40
- /**
41
- * Height of the list
42
- */
43
- height?: number;
44
-
45
- /**
46
- * Width of the list
47
- */
48
- width?: number | string;
49
-
50
- /**
51
- * Id field
52
- */
53
- idField?: DataTypes.Keys<T>;
54
-
55
- /**
56
- * Item renderer
57
- */
58
- itemRenderer: (props: ListChildComponentProps<T>) => React.ReactElement;
59
-
60
- /**
61
- * Item size, a function indicates its a variable size list
62
- */
63
- itemSize: ((index: number) => number) | number;
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