gm-datagrid 0.1.32 → 0.1.33
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/CHANGELOG.md +91 -0
- package/dist/context/GridContext.d.ts +4 -1
- package/dist/engine/reconcilePageRows.d.ts +6 -0
- package/dist/engine/resolveGridRowId.d.ts +4 -0
- package/dist/engine/sanitizeRowsForEngine.d.ts +9 -0
- package/dist/engine/useEngineSync.d.ts +3 -17
- package/dist/gm-datagrid.js +6492 -6242
- package/dist/gm-datagrid.umd.cjs +36 -36
- package/dist/index.d.ts +2 -1
- package/dist/toolbar/GridBulkActionsMenu.d.ts +14 -0
- package/dist/toolbar/GridBulkMenuItemHost.d.ts +9 -0
- package/dist/types/index.d.ts +34 -3
- package/docs/PUBLISH.md +52 -0
- package/docs/TOOLBAR_SLOTS.md +58 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,97 @@ All notable changes to `gm-datagrid` are documented here.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [0.1.33] — 2026-11-15
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`valueGetter`**: engine rows are reconciled back to source rows after `get_page` / `get_group_page`; getters run once on raw rows in the UI (`getRowId` prop, default `id` / `uuid`).
|
|
12
|
+
- **Export**: no second `valueGetter` pass on engine-stored cell values.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`GridBulkActionsMenu`** — scrollable bulk menu with `actions[]`, per-option `component` sub-components, optional `group`, confirm + `onAction`.
|
|
17
|
+
- Slot props: `maxSelection`, `clearSelectionOnSuccess`, `showInFloatingBar`.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## [0.1.32] — 2026-11-13
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- **Wasm engine:** `ColumnType::Boolean` — `set_columns` accepts `type: "boolean"` (fixes engine sync with `ColumnDataTypesEnum.BOOLEAN`).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## [0.1.31] — 2026-11-13
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- `ColumnDataTypesEnum.BOOLEAN` with `BooleanCell` (Sí / No chips).
|
|
34
|
+
- Runtime alias `ColumnDataTypesEnum.DATETIME` → `DATE_TIME` for goal-front `grid-definitions` parity.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- `CODE` columns render monospace text; empty values show `—`.
|
|
39
|
+
- `DATE_TIME` / `BOOLEAN` values format correctly in default cells (no raw ISO / `true` strings).
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## [0.1.30] — 2026-11-12
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- **`fillAvailableWidth`** (default `true`): grows columns to use the full grid viewport when the column sum is narrower.
|
|
48
|
+
- **Double-click column resize** to auto-fit width (`disableColumnAutoFit`, `autoFitMaxWidth`).
|
|
49
|
+
- **Sticky header + filter row** inside a single scrollport; viewport-anchored header separator line on horizontal scroll.
|
|
50
|
+
- **`stickyHeader`** (default `true`).
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- Column layout uses `resolveColumnWidths` with `ColumnDef.flex` when distributing extra space.
|
|
55
|
+
- Aggregation footer keeps horizontal scroll in sync with the body scrollport only.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## [0.1.29] — 2026-03-27
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- `floatingSelectionBar` prop (default `true`). Set `false` on grids inside drawers/dialogs to avoid a fixed bar over the main page.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## [0.1.28] — 2026-03-27
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
|
|
71
|
+
- **Selection floating bar**: uses theme `background.paper`, `divider`, and `shadows[8]` instead of hard-coded light colors (readable in dark mode).
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## [0.1.27] — 2026-03-11
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
|
|
79
|
+
- Horizontal scroll: `contentMinWidth` from column sums; virtualized rows use `minWidth` instead of `right: 0`.
|
|
80
|
+
- `minHeight` (default `360`), `bodyMinHeight`, loading skeleton, `showRowNumber` (default `true`), `rowNumberPosition`, `confirmPrompt` / `GridConfirmDialog`.
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- Status switch uses async in-grid confirm dialog (no `window.confirm`).
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## [0.1.26] — 2026-03-11
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
|
|
92
|
+
- **`useVirtualization`**: removed perpetual `requestAnimationFrame` → `setState` loop (caused runaway re-renders / “Maximum update depth exceeded”).
|
|
93
|
+
- **`useEngineSync`**: stop calling `onGroups([])` on every sync when not grouped.
|
|
94
|
+
- **`handleGroups`**: skip state updates when group headers are unchanged.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
7
98
|
## [0.1.25] — 2026-03-11
|
|
8
99
|
|
|
9
100
|
### Fixed
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { GroupHeader, Row } from '../types';
|
|
3
|
+
import { GetRowIdFn } from '../engine/resolveGridRowId';
|
|
3
4
|
import { DataSetState } from '../dataset/useGMDataSet';
|
|
4
5
|
interface GridContextValue extends DataSetState {
|
|
5
6
|
pageRows: Row[];
|
|
@@ -33,13 +34,15 @@ interface GridContextValue extends DataSetState {
|
|
|
33
34
|
getRows: () => Row[];
|
|
34
35
|
getSelectedRows: () => Row[];
|
|
35
36
|
selectedCount: number;
|
|
37
|
+
getRowId: (row: Row) => string;
|
|
36
38
|
}
|
|
37
39
|
interface GridProviderProps {
|
|
38
40
|
dataset: DataSetState;
|
|
39
41
|
children: React.ReactNode;
|
|
40
42
|
defaultPageSize?: number;
|
|
41
43
|
onRowSelectionChange?: (rows: Row[]) => void;
|
|
44
|
+
getRowId?: GetRowIdFn;
|
|
42
45
|
}
|
|
43
|
-
export declare function GridProvider({ dataset, children, defaultPageSize, onRowSelectionChange }: GridProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function GridProvider({ dataset, children, defaultPageSize, onRowSelectionChange, getRowId: getRowIdProp, }: GridProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
44
47
|
export declare function useGMGrid(): GridContextValue;
|
|
45
48
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Row } from '../types';
|
|
2
|
+
import { GetRowIdFn } from './resolveGridRowId';
|
|
3
|
+
/**
|
|
4
|
+
* Maps Wasm page rows back to the original source rows so UI never sees getter-mutated fields.
|
|
5
|
+
*/
|
|
6
|
+
export declare function reconcilePageRows(sourceRows: Row[], engineRows: Row[], getRowId?: GetRowIdFn): Row[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnDef, Row } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert a single cell value to a type the Rust CellValue enum can accept.
|
|
4
|
+
*/
|
|
5
|
+
export declare function toCellValue(v: unknown): string | number | boolean | null;
|
|
6
|
+
/**
|
|
7
|
+
* Build engine rows: apply column valueGetters on a copy; never mutate input rows.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sanitizeRowsForEngine(rows: Row[], columns: ColumnDef[]): Record<string, string | number | boolean | null>[];
|
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
import { ColumnDef, FilterGroup, GroupHeader, Row, SortKey } from '../types';
|
|
2
|
+
import { GetRowIdFn } from './resolveGridRowId';
|
|
2
3
|
interface UseEngineSyncProps {
|
|
3
4
|
engine: any;
|
|
4
5
|
ready: boolean;
|
|
5
6
|
rows: Row[];
|
|
6
7
|
columns: ColumnDef[];
|
|
8
|
+
getRowId?: GetRowIdFn;
|
|
7
9
|
onSynced: (totalCount: number, subtotals: Record<string, number>) => void;
|
|
8
10
|
page: number;
|
|
9
11
|
pageSize: number;
|
|
10
12
|
onPageData: (rows: Row[]) => void;
|
|
11
|
-
/** Applied atomically right after load_data — avoids calling engine methods before data is loaded. */
|
|
12
13
|
sortStack?: SortKey[];
|
|
13
14
|
filterGroup?: FilterGroup | null;
|
|
14
15
|
quickFilterText?: string;
|
|
15
|
-
/** When set, calls engine.set_group_by() and fires onGroups with the resulting headers. */
|
|
16
16
|
groupBy?: string | null;
|
|
17
17
|
onGroups?: (groups: GroupHeader[]) => void;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
* Syncs React state → Wasm engine (push) and pulls page data + subtotals back.
|
|
21
|
-
*
|
|
22
|
-
* IMPORTANT: push and pull are intentionally in ONE effect, not two.
|
|
23
|
-
* wasm-bindgen wraps GridEngine methods with a runtime borrow-check on `&mut self`.
|
|
24
|
-
* Two separate effects that both call engine methods can fire in the same
|
|
25
|
-
* synchronous React flush — the second effect starts before wasm-bindgen has
|
|
26
|
-
* released the `&mut` borrow from the first, triggering:
|
|
27
|
-
* "recursive use of an object detected which would lead to unsafe aliasing in rust"
|
|
28
|
-
*
|
|
29
|
-
* Keeping everything in a single effect guarantees all engine calls are sequential
|
|
30
|
-
* within one borrow, and the pull (get_page / get_subtotals) always sees the
|
|
31
|
-
* data that was just loaded.
|
|
32
|
-
*/
|
|
33
|
-
export declare function useEngineSync({ engine, ready, rows, columns, onSynced, page, pageSize, onPageData, sortStack, filterGroup, quickFilterText, groupBy, onGroups, }: UseEngineSyncProps): void;
|
|
19
|
+
export declare function useEngineSync({ engine, ready, rows, columns, getRowId, onSynced, page, pageSize, onPageData, sortStack, filterGroup, quickFilterText, groupBy, onGroups, }: UseEngineSyncProps): void;
|
|
34
20
|
export {};
|