@omnigrid/react 0.1.9 → 0.1.10
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/README.md +37 -37
- package/dist/OmniGrid.js +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
# @omnigrid/react
|
|
2
|
-
|
|
3
|
-
React adapter and renderer for OmniGrid. Renders the headless core engine into the DOM using React.
|
|
4
|
-
|
|
5
|
-
## What it provides
|
|
6
|
-
|
|
7
|
-
- **`<OmniGrid />`** — React component that accepts `GridOptions` and renders a fully virtualized, 2D scrolled data grid
|
|
8
|
-
- **`useGrid()`** — hook that creates and manages a `GridCore` instance with full lifecycle handling
|
|
9
|
-
- **Cell / Row pooling** — reusable React content via DOM-pool integration for minimal re-renders
|
|
10
|
-
- **Styles and default theme** — required structural styles and light/dark default colors are included automatically
|
|
11
|
-
- **`transpilePackages`-ready** — works out of the box with Next.js and other bundlers
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import { OmniGrid } from "@omnigrid/react";
|
|
17
|
-
import { useMemo } from "react";
|
|
18
|
-
|
|
19
|
-
const columns = useMemo(() => [...], []);
|
|
20
|
-
const data = [...];
|
|
21
|
-
|
|
22
|
-
<OmniGrid columns={columns} data={data} />;
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
To customize the table's color style, install a compatible `@omnigrid/*-theme`
|
|
26
|
-
package and import it in the application after `@omnigrid/react`. Theme packages
|
|
27
|
-
include their own light and dark variants; they are not light/dark mode toggles.
|
|
28
|
-
|
|
29
|
-
## Links
|
|
30
|
-
|
|
31
|
-
- **Source:** https://github.com/KRZK-Apps/omnigrid/tree/main/adapters/react
|
|
32
|
-
- **Demo:** https://omnigrid-demo.vercel.app/
|
|
33
|
-
- **Issues:** https://github.com/KRZK-Apps/omnigrid/issues
|
|
34
|
-
|
|
35
|
-
## License
|
|
36
|
-
|
|
37
|
-
MIT © KRZK Apps
|
|
1
|
+
# @omnigrid/react
|
|
2
|
+
|
|
3
|
+
React adapter and renderer for OmniGrid. Renders the headless core engine into the DOM using React.
|
|
4
|
+
|
|
5
|
+
## What it provides
|
|
6
|
+
|
|
7
|
+
- **`<OmniGrid />`** — React component that accepts `GridOptions` and renders a fully virtualized, 2D scrolled data grid
|
|
8
|
+
- **`useGrid()`** — hook that creates and manages a `GridCore` instance with full lifecycle handling
|
|
9
|
+
- **Cell / Row pooling** — reusable React content via DOM-pool integration for minimal re-renders
|
|
10
|
+
- **Styles and default theme** — required structural styles and light/dark default colors are included automatically
|
|
11
|
+
- **`transpilePackages`-ready** — works out of the box with Next.js and other bundlers
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { OmniGrid } from "@omnigrid/react";
|
|
17
|
+
import { useMemo } from "react";
|
|
18
|
+
|
|
19
|
+
const columns = useMemo(() => [...], []);
|
|
20
|
+
const data = [...];
|
|
21
|
+
|
|
22
|
+
<OmniGrid columns={columns} data={data} />;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
To customize the table's color style, install a compatible `@omnigrid/*-theme`
|
|
26
|
+
package and import it in the application after `@omnigrid/react`. Theme packages
|
|
27
|
+
include their own light and dark variants; they are not light/dark mode toggles.
|
|
28
|
+
|
|
29
|
+
## Links
|
|
30
|
+
|
|
31
|
+
- **Source:** https://github.com/KRZK-Apps/omnigrid/tree/main/adapters/react
|
|
32
|
+
- **Demo:** https://omnigrid-demo.vercel.app/
|
|
33
|
+
- **Issues:** https://github.com/KRZK-Apps/omnigrid/issues
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
MIT © KRZK Apps
|
package/dist/OmniGrid.js
CHANGED
|
@@ -443,9 +443,14 @@ export function OmniGrid({ className, style, slotComponents, ...options }) {
|
|
|
443
443
|
const scrollLeft = element ? element.scrollLeft : frame.left;
|
|
444
444
|
// setViewport with scroll-only updates does NOT notify the Store,
|
|
445
445
|
// so this does NOT trigger a React re-render. The DomPool is
|
|
446
|
-
// updated imperatively below
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
// updated imperatively below, and both the row-column rebind and the
|
|
447
|
+
// header window update must flush in the same React paint to avoid
|
|
448
|
+
// one-frame horizontal/vertical jumps when custom cell renderers are
|
|
449
|
+
// mounted into pooled DOM nodes.
|
|
450
|
+
flushSync(() => {
|
|
451
|
+
grid.setViewport({ scrollTop, scrollLeft });
|
|
452
|
+
syncPool(true);
|
|
453
|
+
});
|
|
449
454
|
});
|
|
450
455
|
};
|
|
451
456
|
if (!isMeasured) {
|