@etsoo/react 1.7.36 → 1.7.37

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.
@@ -119,17 +119,19 @@ export const ScrollerGrid = (props) => {
119
119
  };
120
120
  // Reset the state and load again
121
121
  const reset = (add, items = []) => {
122
+ const { queryPaging, ...rest } = add ?? {};
122
123
  const resetState = {
123
124
  queryPaging: {
124
125
  ...refs.current.queryPaging,
125
- currentPage: 0
126
+ currentPage: 0,
127
+ ...queryPaging
126
128
  },
127
129
  autoLoad: true,
128
130
  loadedItems: 0,
129
131
  hasNextPage: true,
130
132
  isNextPageLoading: false,
131
133
  lastLoadedItems: undefined,
132
- ...add
134
+ ...rest
133
135
  };
134
136
  Object.assign(refs.current, resetState);
135
137
  // Reset items
@@ -113,17 +113,19 @@ export const ScrollerList = (props) => {
113
113
  };
114
114
  // Reset the state and load again
115
115
  const reset = (add, items = []) => {
116
+ const { queryPaging, ...rest } = add ?? {};
116
117
  const resetState = {
117
118
  queryPaging: {
118
119
  ...stateRefs.current.queryPaging,
119
- currentPage: 0
120
+ currentPage: 0,
121
+ ...queryPaging
120
122
  },
121
123
  autoLoad: true,
122
124
  lastLoadedItems: undefined,
123
125
  loadedItems: 0,
124
126
  hasNextPage: true,
125
127
  isNextPageLoading: false,
126
- ...add
128
+ ...rest
127
129
  };
128
130
  Object.assign(stateRefs.current, resetState);
129
131
  // Reset
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.7.36",
3
+ "version": "1.7.37",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -65,7 +65,7 @@
65
65
  "@babel/preset-env": "^7.24.5",
66
66
  "@babel/runtime-corejs3": "^7.24.5",
67
67
  "@testing-library/jest-dom": "^6.4.5",
68
- "@testing-library/react": "^15.0.6",
68
+ "@testing-library/react": "^15.0.7",
69
69
  "@types/jest": "^29.5.12",
70
70
  "@types/react": "^18.3.1",
71
71
  "@types/react-dom": "^18.3.0",
@@ -318,17 +318,19 @@ export const ScrollerGrid = <T extends object>(props: ScrollerGridProps<T>) => {
318
318
 
319
319
  // Reset the state and load again
320
320
  const reset = (add?: Partial<GridLoaderStates<T>>, items: T[] = []) => {
321
+ const { queryPaging, ...rest } = add ?? {};
321
322
  const resetState: Partial<GridLoaderStates<T>> = {
322
323
  queryPaging: {
323
324
  ...refs.current.queryPaging,
324
- currentPage: 0
325
+ currentPage: 0,
326
+ ...queryPaging
325
327
  },
326
328
  autoLoad: true,
327
329
  loadedItems: 0,
328
330
  hasNextPage: true,
329
331
  isNextPageLoading: false,
330
332
  lastLoadedItems: undefined,
331
- ...add
333
+ ...rest
332
334
  };
333
335
  Object.assign(refs.current, resetState);
334
336
 
@@ -249,17 +249,19 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
249
249
 
250
250
  // Reset the state and load again
251
251
  const reset = (add?: Partial<GridLoaderStates<T>>, items: T[] = []) => {
252
+ const { queryPaging, ...rest } = add ?? {};
252
253
  const resetState: Partial<GridLoaderStates<T>> = {
253
254
  queryPaging: {
254
255
  ...stateRefs.current.queryPaging,
255
- currentPage: 0
256
+ currentPage: 0,
257
+ ...queryPaging
256
258
  },
257
259
  autoLoad: true,
258
260
  lastLoadedItems: undefined,
259
261
  loadedItems: 0,
260
262
  hasNextPage: true,
261
263
  isNextPageLoading: false,
262
- ...add
264
+ ...rest
263
265
  };
264
266
  Object.assign(stateRefs.current, resetState);
265
267