@etsoo/react 1.7.39 → 1.7.40
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.
|
@@ -72,8 +72,7 @@ export const ScrollerGrid = (props) => {
|
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
74
|
// Set current page
|
|
75
|
-
|
|
76
|
-
refs.current.queryPaging.currentPage = currentPage + pageAdd;
|
|
75
|
+
refs.current.queryPaging.currentPage += pageAdd;
|
|
77
76
|
// Update rows, avoid duplicate items
|
|
78
77
|
const newRows = [...rows];
|
|
79
78
|
for (const item of result) {
|
|
@@ -121,10 +120,6 @@ export const ScrollerGrid = (props) => {
|
|
|
121
120
|
const reset = (add, items = []) => {
|
|
122
121
|
const { queryPaging, ...rest } = add ?? {};
|
|
123
122
|
const resetState = {
|
|
124
|
-
queryPaging: {
|
|
125
|
-
currentPage: 0,
|
|
126
|
-
...queryPaging
|
|
127
|
-
},
|
|
128
123
|
autoLoad: true,
|
|
129
124
|
loadedItems: 0,
|
|
130
125
|
hasNextPage: true,
|
|
@@ -133,6 +128,10 @@ export const ScrollerGrid = (props) => {
|
|
|
133
128
|
...rest
|
|
134
129
|
};
|
|
135
130
|
Object.assign(refs.current, resetState);
|
|
131
|
+
Object.assign(refs.current.queryPaging, {
|
|
132
|
+
currentPage: 0,
|
|
133
|
+
...queryPaging
|
|
134
|
+
});
|
|
136
135
|
// Reset items
|
|
137
136
|
if (refs.current.isMounted !== false)
|
|
138
137
|
setRows(items, true);
|
|
@@ -41,7 +41,7 @@ export const ScrollerList = (props) => {
|
|
|
41
41
|
currentPage: 0,
|
|
42
42
|
orderBy: defaultOrderBy,
|
|
43
43
|
orderByAsc: defaultOrderByAsc,
|
|
44
|
-
batchSize
|
|
44
|
+
batchSize
|
|
45
45
|
},
|
|
46
46
|
autoLoad,
|
|
47
47
|
loadedItems: 0,
|
|
@@ -89,9 +89,7 @@ export const ScrollerList = (props) => {
|
|
|
89
89
|
setRows(newRows);
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
|
-
|
|
93
|
-
stateRefs.current.queryPaging.currentPage =
|
|
94
|
-
currentPage + pageAdd;
|
|
92
|
+
stateRefs.current.queryPaging.currentPage += pageAdd;
|
|
95
93
|
// Update rows, avoid duplicate items
|
|
96
94
|
const newRows = [...rows];
|
|
97
95
|
for (const item of result) {
|
|
@@ -115,11 +113,6 @@ export const ScrollerList = (props) => {
|
|
|
115
113
|
const reset = (add, items = []) => {
|
|
116
114
|
const { queryPaging, ...rest } = add ?? {};
|
|
117
115
|
const resetState = {
|
|
118
|
-
queryPaging: {
|
|
119
|
-
...stateRefs.current.queryPaging,
|
|
120
|
-
currentPage: 0,
|
|
121
|
-
...queryPaging
|
|
122
|
-
},
|
|
123
116
|
autoLoad: true,
|
|
124
117
|
lastLoadedItems: undefined,
|
|
125
118
|
loadedItems: 0,
|
|
@@ -128,6 +121,10 @@ export const ScrollerList = (props) => {
|
|
|
128
121
|
...rest
|
|
129
122
|
};
|
|
130
123
|
Object.assign(stateRefs.current, resetState);
|
|
124
|
+
Object.assign(stateRefs.current.queryPaging, {
|
|
125
|
+
currentPage: 0,
|
|
126
|
+
...queryPaging
|
|
127
|
+
});
|
|
131
128
|
// Reset
|
|
132
129
|
if (stateRefs.current.isMounted !== false)
|
|
133
130
|
setRows(items, true);
|
package/package.json
CHANGED
|
@@ -260,8 +260,7 @@ export const ScrollerGrid = <T extends object>(props: ScrollerGridProps<T>) => {
|
|
|
260
260
|
setRows(newRows);
|
|
261
261
|
} else {
|
|
262
262
|
// Set current page
|
|
263
|
-
|
|
264
|
-
refs.current.queryPaging.currentPage = currentPage + pageAdd;
|
|
263
|
+
refs.current.queryPaging.currentPage += pageAdd;
|
|
265
264
|
|
|
266
265
|
// Update rows, avoid duplicate items
|
|
267
266
|
const newRows = [...rows];
|
|
@@ -325,10 +324,6 @@ export const ScrollerGrid = <T extends object>(props: ScrollerGridProps<T>) => {
|
|
|
325
324
|
const reset = (add?: GridLoaderPartialStates<T>, items: T[] = []) => {
|
|
326
325
|
const { queryPaging, ...rest } = add ?? {};
|
|
327
326
|
const resetState: GridLoaderPartialStates<T> = {
|
|
328
|
-
queryPaging: {
|
|
329
|
-
currentPage: 0,
|
|
330
|
-
...queryPaging
|
|
331
|
-
},
|
|
332
327
|
autoLoad: true,
|
|
333
328
|
loadedItems: 0,
|
|
334
329
|
hasNextPage: true,
|
|
@@ -337,6 +332,10 @@ export const ScrollerGrid = <T extends object>(props: ScrollerGridProps<T>) => {
|
|
|
337
332
|
...rest
|
|
338
333
|
};
|
|
339
334
|
Object.assign(refs.current, resetState);
|
|
335
|
+
Object.assign(refs.current.queryPaging, {
|
|
336
|
+
currentPage: 0,
|
|
337
|
+
...queryPaging
|
|
338
|
+
});
|
|
340
339
|
|
|
341
340
|
// Reset items
|
|
342
341
|
if (refs.current.isMounted !== false) setRows(items, true);
|
|
@@ -159,7 +159,7 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
|
|
|
159
159
|
currentPage: 0,
|
|
160
160
|
orderBy: defaultOrderBy,
|
|
161
161
|
orderByAsc: defaultOrderByAsc,
|
|
162
|
-
batchSize
|
|
162
|
+
batchSize
|
|
163
163
|
},
|
|
164
164
|
autoLoad,
|
|
165
165
|
loadedItems: 0,
|
|
@@ -220,10 +220,7 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
|
|
|
220
220
|
// Update rows
|
|
221
221
|
setRows(newRows);
|
|
222
222
|
} else {
|
|
223
|
-
|
|
224
|
-
stateRefs.current.queryPaging.currentPage ?? 0;
|
|
225
|
-
stateRefs.current.queryPaging.currentPage =
|
|
226
|
-
currentPage + pageAdd;
|
|
223
|
+
stateRefs.current.queryPaging.currentPage += pageAdd;
|
|
227
224
|
|
|
228
225
|
// Update rows, avoid duplicate items
|
|
229
226
|
const newRows = [...rows];
|
|
@@ -252,11 +249,6 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
|
|
|
252
249
|
const reset = (add?: GridLoaderPartialStates<T>, items: T[] = []) => {
|
|
253
250
|
const { queryPaging, ...rest } = add ?? {};
|
|
254
251
|
const resetState: GridLoaderPartialStates<T> = {
|
|
255
|
-
queryPaging: {
|
|
256
|
-
...stateRefs.current.queryPaging,
|
|
257
|
-
currentPage: 0,
|
|
258
|
-
...queryPaging
|
|
259
|
-
},
|
|
260
252
|
autoLoad: true,
|
|
261
253
|
lastLoadedItems: undefined,
|
|
262
254
|
loadedItems: 0,
|
|
@@ -265,6 +257,10 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
|
|
|
265
257
|
...rest
|
|
266
258
|
};
|
|
267
259
|
Object.assign(stateRefs.current, resetState);
|
|
260
|
+
Object.assign(stateRefs.current.queryPaging, {
|
|
261
|
+
currentPage: 0,
|
|
262
|
+
...queryPaging
|
|
263
|
+
});
|
|
268
264
|
|
|
269
265
|
// Reset
|
|
270
266
|
if (stateRefs.current.isMounted !== false) setRows(items, true);
|