@etsoo/react 1.8.12 → 1.8.14
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.
|
@@ -39,15 +39,16 @@ export declare function GridDataGetData<const T>(data?: GridData, template?: T,
|
|
|
39
39
|
/**
|
|
40
40
|
* Grid Json data
|
|
41
41
|
*/
|
|
42
|
-
export type GridJsonData =
|
|
43
|
-
/**
|
|
44
|
-
* Grid data load props
|
|
45
|
-
*/
|
|
46
|
-
export type GridLoadDataProps = {
|
|
42
|
+
export type GridJsonData = {
|
|
47
43
|
/**
|
|
48
44
|
* Query paging data
|
|
49
45
|
*/
|
|
50
46
|
queryPaging: QueryPagingData;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Grid data load props
|
|
50
|
+
*/
|
|
51
|
+
export type GridLoadDataProps = GridJsonData & {
|
|
51
52
|
/**
|
|
52
53
|
* Data related
|
|
53
54
|
*/
|
|
@@ -69,7 +70,7 @@ export type GridLoadDataPartialProps = {
|
|
|
69
70
|
/**
|
|
70
71
|
* Grid data loader
|
|
71
72
|
*/
|
|
72
|
-
export type GridLoader<T extends object> = {
|
|
73
|
+
export type GridLoader<T extends object, P extends GridJsonData = GridLoadDataProps> = {
|
|
73
74
|
/**
|
|
74
75
|
* Auto load data, otherwise call reset
|
|
75
76
|
* @default true
|
|
@@ -86,7 +87,7 @@ export type GridLoader<T extends object> = {
|
|
|
86
87
|
/**
|
|
87
88
|
* Load data
|
|
88
89
|
*/
|
|
89
|
-
loadData: (props:
|
|
90
|
+
loadData: (props: P, lastItem?: T) => PromiseLike<T[] | null | undefined>;
|
|
90
91
|
/**
|
|
91
92
|
* Handler for init load
|
|
92
93
|
* @param ref Ref
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataTypes } from "@etsoo/shared";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Align, GridChildComponentProps, VariableSizeGridProps } from "react-window";
|
|
4
|
-
import { GridLoader, GridLoaderStates } from "./GridLoader";
|
|
4
|
+
import { GridJsonData, GridLoadDataProps, GridLoader, GridLoaderStates } from "./GridLoader";
|
|
5
5
|
import { GridMethodRef } from "./GridMethodRef";
|
|
6
6
|
export type ScrollerGridItemRendererProps<T> = Omit<GridChildComponentProps<T>, "data"> & {
|
|
7
7
|
/**
|
|
@@ -21,7 +21,7 @@ export type ScrollerGridItemRendererProps<T> = Omit<GridChildComponentProps<T>,
|
|
|
21
21
|
/**
|
|
22
22
|
* Scroller vertical grid props
|
|
23
23
|
*/
|
|
24
|
-
export type ScrollerGridProps<T extends object> = GridLoader<T> & Omit<VariableSizeGridProps<T>, "children" | "rowCount" | "rowHeight"> & {
|
|
24
|
+
export type ScrollerGridProps<T extends object, P extends GridJsonData = GridLoadDataProps> = GridLoader<T, P> & Omit<VariableSizeGridProps<T>, "children" | "rowCount" | "rowHeight"> & {
|
|
25
25
|
/**
|
|
26
26
|
* Footer renderer
|
|
27
27
|
*/
|
package/package.json
CHANGED
|
@@ -81,17 +81,17 @@ export function GridDataGetData<const T>(
|
|
|
81
81
|
/**
|
|
82
82
|
* Grid Json data
|
|
83
83
|
*/
|
|
84
|
-
export type GridJsonData =
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Grid data load props
|
|
88
|
-
*/
|
|
89
|
-
export type GridLoadDataProps = {
|
|
84
|
+
export type GridJsonData = {
|
|
90
85
|
/**
|
|
91
86
|
* Query paging data
|
|
92
87
|
*/
|
|
93
88
|
queryPaging: QueryPagingData;
|
|
89
|
+
};
|
|
94
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Grid data load props
|
|
93
|
+
*/
|
|
94
|
+
export type GridLoadDataProps = GridJsonData & {
|
|
95
95
|
/**
|
|
96
96
|
* Data related
|
|
97
97
|
*/
|
|
@@ -116,7 +116,10 @@ export type GridLoadDataPartialProps = {
|
|
|
116
116
|
/**
|
|
117
117
|
* Grid data loader
|
|
118
118
|
*/
|
|
119
|
-
export type GridLoader<
|
|
119
|
+
export type GridLoader<
|
|
120
|
+
T extends object,
|
|
121
|
+
P extends GridJsonData = GridLoadDataProps
|
|
122
|
+
> = {
|
|
120
123
|
/**
|
|
121
124
|
* Auto load data, otherwise call reset
|
|
122
125
|
* @default true
|
|
@@ -136,10 +139,7 @@ export type GridLoader<T extends object> = {
|
|
|
136
139
|
/**
|
|
137
140
|
* Load data
|
|
138
141
|
*/
|
|
139
|
-
loadData: (
|
|
140
|
-
props: GridLoadDataProps,
|
|
141
|
-
lastItem?: T
|
|
142
|
-
) => PromiseLike<T[] | null | undefined>;
|
|
142
|
+
loadData: (props: P, lastItem?: T) => PromiseLike<T[] | null | undefined>;
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* Handler for init load
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
VariableSizeGridProps
|
|
9
9
|
} from "react-window";
|
|
10
10
|
import {
|
|
11
|
+
GridJsonData,
|
|
11
12
|
GridLoadDataProps,
|
|
12
13
|
GridLoader,
|
|
13
14
|
GridLoaderPartialStates,
|
|
@@ -44,7 +45,10 @@ export type ScrollerGridItemRendererProps<T> = Omit<
|
|
|
44
45
|
/**
|
|
45
46
|
* Scroller vertical grid props
|
|
46
47
|
*/
|
|
47
|
-
export type ScrollerGridProps<
|
|
48
|
+
export type ScrollerGridProps<
|
|
49
|
+
T extends object,
|
|
50
|
+
P extends GridJsonData = GridLoadDataProps
|
|
51
|
+
> = GridLoader<T, P> &
|
|
48
52
|
Omit<VariableSizeGridProps<T>, "children" | "rowCount" | "rowHeight"> & {
|
|
49
53
|
/**
|
|
50
54
|
* Footer renderer
|