@etsoo/react 1.8.59 → 1.8.61

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.
@@ -6,7 +6,8 @@
6
6
  name: Node.js Package
7
7
 
8
8
  # Event to trigger the action
9
- on: [push]
9
+ on:
10
+ [push]
10
11
  # release:
11
12
  # types: [created]
12
13
 
@@ -22,14 +23,14 @@ jobs:
22
23
  steps:
23
24
  # https://github.com/actions/checkout, This action checks-out your repository under $GITHUB_WORKSPACE
24
25
  # so your workflow can access it.
25
- - uses: actions/checkout@v4
26
-
26
+ - uses: actions/checkout@v5
27
+
27
28
  # Set up your GitHub Actions workflow with a specific version of node.js
28
29
  # Setup .npmrc file to publish to npm
29
- - uses: actions/setup-node@v4
30
+ - uses: actions/setup-node@v6
30
31
  with:
31
- node-version: '20.x'
32
- registry-url: 'https://registry.npmjs.org'
32
+ node-version: "24.11"
33
+ registry-url: "https://registry.npmjs.org"
33
34
 
34
35
  # Named after Continuous Integration, installs dependencies directly from package-lock.json
35
36
  # ci vs install
@@ -45,4 +46,4 @@ jobs:
45
46
  # For scoped package, make it public for free service
46
47
  - run: npm publish --access public
47
48
  env:
48
- NODE_AUTH_TOKEN: ${{ secrets.ETSOONpmToken }}
49
+ NODE_AUTH_TOKEN: ${{ secrets.ETSOONpmToken }}
@@ -93,7 +93,7 @@ export type GridLoader<T extends object, P extends GridJsonData = GridLoadDataPr
93
93
  * @param rows Rows
94
94
  * @param state State
95
95
  */
96
- onUpdateRows?: (rows: T[], state: GridLoaderStates<T>) => void;
96
+ onUpdateRows?: (rows: T[], state: GridLoaderStates<T>, reset: boolean) => void;
97
97
  /**
98
98
  * Threshold at which to pre-fetch data; default is half of loadBatchSize
99
99
  */
@@ -30,8 +30,7 @@ const ScrollerGrid = (props) => {
30
30
  const setRows = (rows, reset = false) => {
31
31
  stateRefs.current.loadedItems = rows.length;
32
32
  updateRows(rows);
33
- if (!reset && onUpdateRows)
34
- onUpdateRows(rows, stateRefs.current);
33
+ onUpdateRows?.(rows, stateRefs.current, reset);
35
34
  };
36
35
  // State Refs
37
36
  const stateRefs = react_1.default.useRef({
@@ -37,8 +37,7 @@ const ScrollerList = (props) => {
37
37
  const setRows = (rows, reset = false) => {
38
38
  stateRefs.current.loadedItems = rows.length;
39
39
  updateRows(rows);
40
- if (!reset && onUpdateRows)
41
- onUpdateRows(rows, stateRefs.current);
40
+ onUpdateRows?.(rows, stateRefs.current, reset);
42
41
  };
43
42
  const batchSize = shared_1.Utils.getResult(loadBatchSize, height);
44
43
  const stateRefs = react_1.default.useRef({
@@ -93,7 +93,7 @@ export type GridLoader<T extends object, P extends GridJsonData = GridLoadDataPr
93
93
  * @param rows Rows
94
94
  * @param state State
95
95
  */
96
- onUpdateRows?: (rows: T[], state: GridLoaderStates<T>) => void;
96
+ onUpdateRows?: (rows: T[], state: GridLoaderStates<T>, reset: boolean) => void;
97
97
  /**
98
98
  * Threshold at which to pre-fetch data; default is half of loadBatchSize
99
99
  */
@@ -24,8 +24,7 @@ export const ScrollerGrid = (props) => {
24
24
  const setRows = (rows, reset = false) => {
25
25
  stateRefs.current.loadedItems = rows.length;
26
26
  updateRows(rows);
27
- if (!reset && onUpdateRows)
28
- onUpdateRows(rows, stateRefs.current);
27
+ onUpdateRows?.(rows, stateRefs.current, reset);
29
28
  };
30
29
  // State Refs
31
30
  const stateRefs = React.useRef({
@@ -31,8 +31,7 @@ export const ScrollerList = (props) => {
31
31
  const setRows = (rows, reset = false) => {
32
32
  stateRefs.current.loadedItems = rows.length;
33
33
  updateRows(rows);
34
- if (!reset && onUpdateRows)
35
- onUpdateRows(rows, stateRefs.current);
34
+ onUpdateRows?.(rows, stateRefs.current, reset);
36
35
  };
37
36
  const batchSize = Utils.getResult(loadBatchSize, height);
38
37
  const stateRefs = React.useRef({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.8.59",
3
+ "version": "1.8.61",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -38,27 +38,27 @@
38
38
  "@emotion/css": "^11.13.5",
39
39
  "@emotion/react": "^11.14.0",
40
40
  "@emotion/styled": "^11.14.1",
41
- "@etsoo/appscript": "^1.6.45",
42
- "@etsoo/notificationbase": "^1.1.64",
43
- "@etsoo/shared": "^1.2.76",
41
+ "@etsoo/appscript": "^1.6.46",
42
+ "@etsoo/notificationbase": "^1.1.65",
43
+ "@etsoo/shared": "^1.2.78",
44
44
  "react": "^19.2.0",
45
45
  "react-dom": "^19.2.0",
46
- "react-router-dom": "^7.9.4",
47
- "react-window": "^2.2.0"
46
+ "react-router-dom": "^7.9.5",
47
+ "react-window": "^2.2.2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@babel/cli": "^7.28.3",
51
- "@babel/core": "^7.28.4",
52
- "@babel/plugin-transform-runtime": "^7.28.3",
53
- "@babel/preset-env": "^7.28.3",
51
+ "@babel/core": "^7.28.5",
52
+ "@babel/plugin-transform-runtime": "^7.28.5",
53
+ "@babel/preset-env": "^7.28.5",
54
54
  "@babel/runtime-corejs3": "^7.28.4",
55
55
  "@testing-library/jest-dom": "^6.9.1",
56
56
  "@testing-library/react": "^16.3.0",
57
57
  "@types/react": "^19.2.2",
58
- "@types/react-dom": "^19.2.1",
59
- "@vitejs/plugin-react": "^5.0.4",
60
- "jsdom": "^27.0.0",
58
+ "@types/react-dom": "^19.2.2",
59
+ "@vitejs/plugin-react": "^5.1.0",
60
+ "jsdom": "^27.1.0",
61
61
  "typescript": "^5.9.3",
62
- "vitest": "^3.2.4"
62
+ "vitest": "^4.0.7"
63
63
  }
64
64
  }
package/setupTests.ts CHANGED
@@ -1,13 +1,7 @@
1
+ import { MockResizeObserver } from "@etsoo/shared";
1
2
  import { vi } from "vitest";
2
3
 
3
4
  (globalThis as any).IS_REACT_ACT_ENVIRONMENT = true;
4
5
 
5
- // Mock the ResizeObserver
6
- const ResizeObserverMock = vi.fn(() => ({
7
- observe: vi.fn(),
8
- unobserve: vi.fn(),
9
- disconnect: vi.fn()
10
- }));
11
-
12
6
  // Stub the global ResizeObserver
13
- vi.stubGlobal("ResizeObserver", ResizeObserverMock);
7
+ vi.stubGlobal("ResizeObserver", MockResizeObserver);
@@ -146,7 +146,11 @@ export type GridLoader<
146
146
  * @param rows Rows
147
147
  * @param state State
148
148
  */
149
- onUpdateRows?: (rows: T[], state: GridLoaderStates<T>) => void;
149
+ onUpdateRows?: (
150
+ rows: T[],
151
+ state: GridLoaderStates<T>,
152
+ reset: boolean
153
+ ) => void;
150
154
 
151
155
  /**
152
156
  * Threshold at which to pre-fetch data; default is half of loadBatchSize
@@ -175,7 +175,7 @@ export const ScrollerGrid = <T extends object>(props: ScrollerGridProps<T>) => {
175
175
  stateRefs.current.loadedItems = rows.length;
176
176
  updateRows(rows);
177
177
 
178
- if (!reset && onUpdateRows) onUpdateRows(rows, stateRefs.current);
178
+ onUpdateRows?.(rows, stateRefs.current, reset);
179
179
  };
180
180
 
181
181
  // State Refs
@@ -118,7 +118,7 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
118
118
  stateRefs.current.loadedItems = rows.length;
119
119
  updateRows(rows);
120
120
 
121
- if (!reset && onUpdateRows) onUpdateRows(rows, stateRefs.current);
121
+ onUpdateRows?.(rows, stateRefs.current, reset);
122
122
  };
123
123
 
124
124
  const batchSize = Utils.getResult<number>(loadBatchSize, height);