gm-datagrid 0.1.0 → 0.1.2
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/engine/useEngineSync.d.ts +11 -2
- package/dist/gm-datagrid.js +1185 -1163
- package/dist/gm-datagrid.umd.cjs +9 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnDef, Row } from '../types';
|
|
1
|
+
import { ColumnDef, FilterGroup, Row, SortKey } from '../types';
|
|
2
2
|
interface UseEngineSyncProps {
|
|
3
3
|
engine: any;
|
|
4
4
|
ready: boolean;
|
|
@@ -8,12 +8,21 @@ interface UseEngineSyncProps {
|
|
|
8
8
|
page: number;
|
|
9
9
|
pageSize: number;
|
|
10
10
|
onPageData: (rows: Row[]) => void;
|
|
11
|
+
/** Applied atomically right after load_data — avoids calling engine methods before data is loaded. */
|
|
12
|
+
sortStack?: SortKey[];
|
|
13
|
+
filterGroup?: FilterGroup | null;
|
|
14
|
+
quickFilterText?: string;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
13
17
|
* Syncs React state → Wasm engine (push) and pulls page data + subtotals back.
|
|
14
18
|
*
|
|
19
|
+
* Sort, filter and quick-filter are applied INSIDE this hook immediately after
|
|
20
|
+
* engine.load_data(), which guarantees the engine's memory is initialised before
|
|
21
|
+
* any method is called. This prevents the "memory access out of bounds" WASM
|
|
22
|
+
* crash that occurs when those calls are made from a render-body side-effect.
|
|
23
|
+
*
|
|
15
24
|
* Uses a `dataVersion` ref to skip redundant pulls on re-renders where
|
|
16
25
|
* nothing has actually changed in the engine.
|
|
17
26
|
*/
|
|
18
|
-
export declare function useEngineSync({ engine, ready, rows, columns, onSynced, page, pageSize, onPageData, }: UseEngineSyncProps): void;
|
|
27
|
+
export declare function useEngineSync({ engine, ready, rows, columns, onSynced, page, pageSize, onPageData, sortStack, filterGroup, quickFilterText, }: UseEngineSyncProps): void;
|
|
19
28
|
export {};
|