@etsoo/react 1.8.57 → 1.8.59
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.
- package/lib/cjs/components/GridMethodRef.d.ts +5 -0
- package/lib/cjs/components/ScrollerGrid.js +4 -1
- package/lib/cjs/components/ScrollerList.js +3 -0
- package/lib/mjs/components/GridMethodRef.d.ts +5 -0
- package/lib/mjs/components/ScrollerGrid.js +4 -1
- package/lib/mjs/components/ScrollerList.js +3 -0
- package/package.json +9 -10
- package/src/components/GridMethodRef.ts +6 -0
- package/src/components/ScrollerGrid.tsx +4 -1
- package/src/components/ScrollerList.tsx +3 -0
|
@@ -8,6 +8,11 @@ export type ScrollToRowParam = Parameters<ListImperativeAPI["scrollToRow"]>[0];
|
|
|
8
8
|
* Grid method ref
|
|
9
9
|
*/
|
|
10
10
|
export interface GridMethodRef<T> {
|
|
11
|
+
/**
|
|
12
|
+
* Get the element
|
|
13
|
+
* @returns Element
|
|
14
|
+
*/
|
|
15
|
+
get element(): HTMLElement | null | undefined;
|
|
11
16
|
/**
|
|
12
17
|
* Delete item at the index
|
|
13
18
|
* @param index Index
|
|
@@ -15,7 +15,7 @@ const useCombinedRefs_1 = require("../uses/useCombinedRefs");
|
|
|
15
15
|
*/
|
|
16
16
|
const ScrollerGrid = (props) => {
|
|
17
17
|
// Destruct
|
|
18
|
-
const { autoLoad = true, defaultOrderBy, footerRenderer, headerRenderer, height = "100%", gridRef, width = "100%", style = {}, idField = "id", loadBatchSize, loadData, mRef, onCellsRendered, onSelectChange, rowHeight
|
|
18
|
+
const { autoLoad = true, defaultOrderBy, footerRenderer, headerRenderer, height = "100%", gridRef, width = "100%", style = {}, idField = "id", loadBatchSize, loadData, mRef, onCellsRendered, onSelectChange, rowHeight, threshold = 3, onInitLoad, onUpdateRows, ...rest } = props;
|
|
19
19
|
// Style
|
|
20
20
|
Object.assign(style, {
|
|
21
21
|
width,
|
|
@@ -128,6 +128,9 @@ const ScrollerGrid = (props) => {
|
|
|
128
128
|
setRows(items, true);
|
|
129
129
|
};
|
|
130
130
|
react_1.default.useImperativeHandle(mRef, () => ({
|
|
131
|
+
get element() {
|
|
132
|
+
return localRef.current?.element;
|
|
133
|
+
},
|
|
131
134
|
delete(index) {
|
|
132
135
|
const item = rows.at(index);
|
|
133
136
|
if (item) {
|
|
@@ -8,6 +8,11 @@ export type ScrollToRowParam = Parameters<ListImperativeAPI["scrollToRow"]>[0];
|
|
|
8
8
|
* Grid method ref
|
|
9
9
|
*/
|
|
10
10
|
export interface GridMethodRef<T> {
|
|
11
|
+
/**
|
|
12
|
+
* Get the element
|
|
13
|
+
* @returns Element
|
|
14
|
+
*/
|
|
15
|
+
get element(): HTMLElement | null | undefined;
|
|
11
16
|
/**
|
|
12
17
|
* Delete item at the index
|
|
13
18
|
* @param index Index
|
|
@@ -9,7 +9,7 @@ import { useCombinedRefs } from "../uses/useCombinedRefs";
|
|
|
9
9
|
*/
|
|
10
10
|
export const ScrollerGrid = (props) => {
|
|
11
11
|
// Destruct
|
|
12
|
-
const { autoLoad = true, defaultOrderBy, footerRenderer, headerRenderer, height = "100%", gridRef, width = "100%", style = {}, idField = "id", loadBatchSize, loadData, mRef, onCellsRendered, onSelectChange, rowHeight
|
|
12
|
+
const { autoLoad = true, defaultOrderBy, footerRenderer, headerRenderer, height = "100%", gridRef, width = "100%", style = {}, idField = "id", loadBatchSize, loadData, mRef, onCellsRendered, onSelectChange, rowHeight, threshold = 3, onInitLoad, onUpdateRows, ...rest } = props;
|
|
13
13
|
// Style
|
|
14
14
|
Object.assign(style, {
|
|
15
15
|
width,
|
|
@@ -122,6 +122,9 @@ export const ScrollerGrid = (props) => {
|
|
|
122
122
|
setRows(items, true);
|
|
123
123
|
};
|
|
124
124
|
React.useImperativeHandle(mRef, () => ({
|
|
125
|
+
get element() {
|
|
126
|
+
return localRef.current?.element;
|
|
127
|
+
},
|
|
125
128
|
delete(index) {
|
|
126
129
|
const item = rows.at(index);
|
|
127
130
|
if (item) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.59",
|
|
4
4
|
"description": "TypeScript ReactJs UI Independent Framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@etsoo/appscript": "^1.6.45",
|
|
42
42
|
"@etsoo/notificationbase": "^1.1.64",
|
|
43
43
|
"@etsoo/shared": "^1.2.76",
|
|
44
|
-
"react": "^19.
|
|
45
|
-
"react-dom": "^19.
|
|
46
|
-
"react-router-dom": "^7.9.
|
|
47
|
-
"react-window": "^2.
|
|
44
|
+
"react": "^19.2.0",
|
|
45
|
+
"react-dom": "^19.2.0",
|
|
46
|
+
"react-router-dom": "^7.9.4",
|
|
47
|
+
"react-window": "^2.2.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/cli": "^7.28.3",
|
|
@@ -52,14 +52,13 @@
|
|
|
52
52
|
"@babel/plugin-transform-runtime": "^7.28.3",
|
|
53
53
|
"@babel/preset-env": "^7.28.3",
|
|
54
54
|
"@babel/runtime-corejs3": "^7.28.4",
|
|
55
|
-
"@testing-library/jest-dom": "^6.9.
|
|
55
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
56
56
|
"@testing-library/react": "^16.3.0",
|
|
57
|
-
"@types/react": "^19.
|
|
58
|
-
"@types/react-dom": "^19.1
|
|
59
|
-
"@types/react-window": "^2.0.0",
|
|
57
|
+
"@types/react": "^19.2.2",
|
|
58
|
+
"@types/react-dom": "^19.2.1",
|
|
60
59
|
"@vitejs/plugin-react": "^5.0.4",
|
|
61
60
|
"jsdom": "^27.0.0",
|
|
62
|
-
"typescript": "^5.9.
|
|
61
|
+
"typescript": "^5.9.3",
|
|
63
62
|
"vitest": "^3.2.4"
|
|
64
63
|
}
|
|
65
64
|
}
|
|
@@ -10,6 +10,12 @@ export type ScrollToRowParam = Parameters<ListImperativeAPI["scrollToRow"]>[0];
|
|
|
10
10
|
* Grid method ref
|
|
11
11
|
*/
|
|
12
12
|
export interface GridMethodRef<T> {
|
|
13
|
+
/**
|
|
14
|
+
* Get the element
|
|
15
|
+
* @returns Element
|
|
16
|
+
*/
|
|
17
|
+
get element(): HTMLElement | null | undefined;
|
|
18
|
+
|
|
13
19
|
/**
|
|
14
20
|
* Delete item at the index
|
|
15
21
|
* @param index Index
|
|
@@ -151,7 +151,7 @@ export const ScrollerGrid = <T extends object>(props: ScrollerGridProps<T>) => {
|
|
|
151
151
|
mRef,
|
|
152
152
|
onCellsRendered,
|
|
153
153
|
onSelectChange,
|
|
154
|
-
rowHeight
|
|
154
|
+
rowHeight,
|
|
155
155
|
threshold = 3,
|
|
156
156
|
onInitLoad,
|
|
157
157
|
onUpdateRows,
|
|
@@ -292,6 +292,9 @@ export const ScrollerGrid = <T extends object>(props: ScrollerGridProps<T>) => {
|
|
|
292
292
|
React.useImperativeHandle(
|
|
293
293
|
mRef,
|
|
294
294
|
() => ({
|
|
295
|
+
get element() {
|
|
296
|
+
return localRef.current?.element;
|
|
297
|
+
},
|
|
295
298
|
delete(index) {
|
|
296
299
|
const item = rows.at(index);
|
|
297
300
|
if (item) {
|