@versini/ui-datagrid 1.0.0 → 1.0.1
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/dist/131.js +1 -1
- package/dist/298.js +1 -1
- package/dist/46.js +1 -1
- package/dist/511.js +2 -2
- package/dist/926.js +1 -1
- package/dist/DataGrid/index.js +1 -1
- package/dist/DataGridAnimated/index.js +1 -1
- package/dist/DataGridBody/index.js +1 -1
- package/dist/DataGridCell/index.js +1 -1
- package/dist/DataGridCellSort/index.js +1 -1
- package/dist/DataGridConstants/index.js +1 -1
- package/dist/DataGridFooter/index.js +1 -1
- package/dist/DataGridHeader/index.js +1 -1
- package/dist/DataGridInfinite/DataGridInfiniteBody.d.ts +44 -4
- package/dist/DataGridInfinite/index.js +3 -6
- package/dist/DataGridRow/index.js +1 -1
- package/dist/DataGridSorting/index.js +1 -1
- package/package.json +4 -4
package/dist/131.js
CHANGED
package/dist/298.js
CHANGED
package/dist/46.js
CHANGED
package/dist/511.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.0.
|
|
2
|
+
@versini/ui-datagrid v1.0.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
export { createContext, default as react,
|
|
9
|
+
export { createContext, default as react, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
package/dist/926.js
CHANGED
package/dist/DataGrid/index.js
CHANGED
|
@@ -45,8 +45,48 @@ export type DataGridInfiniteBodyRef = {
|
|
|
45
45
|
scrollToIndex: (index: number) => void;
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* A DataGridBody variant that handles infinite scroll internally.
|
|
49
|
+
*
|
|
50
|
+
* This component manages all the complexity of infinite scroll:
|
|
51
|
+
* - Progressive data loading with IntersectionObserver
|
|
52
|
+
* - Correct marker placement for seamless scrolling
|
|
53
|
+
* - Automatic data slicing and memoization
|
|
54
|
+
* - Programmatic scroll-to-row with smooth animation
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* const infiniteBodyRef = useRef<DataGridInfiniteBodyRef>(null);
|
|
59
|
+
*
|
|
60
|
+
* // Jump to a specific row
|
|
61
|
+
* const handleJumpToRow = () => {
|
|
62
|
+
* infiniteBodyRef.current?.scrollToIndex(134);
|
|
63
|
+
* };
|
|
64
|
+
*
|
|
65
|
+
* <DataGrid maxHeight="400px" stickyHeader>
|
|
66
|
+
* <DataGridHeader caption={`Showing ${visibleCount} of ${data.length}`}>
|
|
67
|
+
* <DataGridRow>
|
|
68
|
+
* <DataGridCell>Name</DataGridCell>
|
|
69
|
+
* <DataGridCell>Role</DataGridCell>
|
|
70
|
+
* </DataGridRow>
|
|
71
|
+
* </DataGridHeader>
|
|
72
|
+
*
|
|
73
|
+
* <DataGridInfiniteBody
|
|
74
|
+
* ref={infiniteBodyRef}
|
|
75
|
+
* data={largeData}
|
|
76
|
+
* batchSize={25}
|
|
77
|
+
* onVisibleCountChange={(count) => setVisibleCount(count)}
|
|
78
|
+
* >
|
|
79
|
+
* {(row) => (
|
|
80
|
+
* <DataGridRow key={row.id}>
|
|
81
|
+
* <DataGridCell>{row.name}</DataGridCell>
|
|
82
|
+
* <DataGridCell>{row.role}</DataGridCell>
|
|
83
|
+
* </DataGridRow>
|
|
84
|
+
* )}
|
|
85
|
+
* </DataGridInfiniteBody>
|
|
86
|
+
* </DataGrid>
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
49
89
|
*/
|
|
50
|
-
export declare
|
|
51
|
-
ref?: React.
|
|
52
|
-
})
|
|
90
|
+
export declare function DataGridInfiniteBody<T>({ data, children: renderRow, batchSize, threshold, rootMargin, onVisibleCountChange, className, ref, }: DataGridInfiniteBodyProps<T> & {
|
|
91
|
+
ref?: React.Ref<DataGridInfiniteBodyRef>;
|
|
92
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-datagrid v1.0.
|
|
2
|
+
@versini/ui-datagrid v1.0.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { useMemo, useContext, useImperativeHandle, useState,
|
|
6
|
+
import { useMemo, useContext, useImperativeHandle, useState, useCallback, useRef, useEffect, jsx } from "../511.js";
|
|
7
7
|
import { DataGridContext } from "../926.js";
|
|
8
8
|
import { CellWrapper } from "../46.js";
|
|
9
9
|
import { getBodyClass, useColumnMeasurement } from "../131.js";
|
|
@@ -75,7 +75,7 @@ const ROW_INDEX_DATA_ATTR = "data-row-index";
|
|
|
75
75
|
* </DataGrid>
|
|
76
76
|
* ```
|
|
77
77
|
*
|
|
78
|
-
*/ function
|
|
78
|
+
*/ function DataGridInfiniteBody({ data, children: renderRow, batchSize = DEFAULT_BATCH_SIZE, threshold = DEFAULT_THRESHOLD, rootMargin = DEFAULT_ROOT_MARGIN, onVisibleCountChange, className, ref }) {
|
|
79
79
|
const ctx = useContext(DataGridContext);
|
|
80
80
|
const bodyRef = useRef(null);
|
|
81
81
|
const observerRef = useRef(null);
|
|
@@ -312,9 +312,6 @@ const ROW_INDEX_DATA_ATTR = "data-row-index";
|
|
|
312
312
|
})
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
|
-
/**
|
|
316
|
-
* DataGridInfiniteBody with forwardRef support for imperative methods.
|
|
317
|
-
*/ const DataGridInfiniteBody = /*#__PURE__*/ forwardRef(DataGridInfiniteBodyInner);
|
|
318
315
|
|
|
319
316
|
|
|
320
317
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-datagrid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -87,16 +87,16 @@
|
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@testing-library/jest-dom": "6.9.1",
|
|
90
|
-
"@versini/ui-button": "12.0.
|
|
90
|
+
"@versini/ui-button": "12.0.1",
|
|
91
91
|
"@versini/ui-types": "8.3.0"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@versini/ui-icons": "4.18.1",
|
|
95
95
|
"clsx": "2.1.1",
|
|
96
|
-
"tailwindcss": "4.
|
|
96
|
+
"tailwindcss": "4.2.0"
|
|
97
97
|
},
|
|
98
98
|
"sideEffects": [
|
|
99
99
|
"**/*.css"
|
|
100
100
|
],
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "9129610bbd6d91a2bc6cac41b0ccf8430a13fa41"
|
|
102
102
|
}
|