@toolbox-web/grid-react 1.3.0 → 1.5.0
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 +1 -1
- package/chunks/grid-detail-panel-CR7YUhdN.js +52 -0
- package/chunks/grid-responsive-card-BB28Zl2O.js +45 -0
- package/chunks/portal-bridge-DLA6Zs11.js +51 -0
- package/chunks/react-column-config-Sb-U7Bq3.js +109 -0
- package/chunks/react-grid-adapter-CzByOnua.js +416 -0
- package/features/editing.js +5 -0
- package/features/filtering.d.ts.map +1 -1
- package/features/filtering.js +55 -45
- package/features/grouping-columns.js +18 -23
- package/features/grouping-rows.js +11 -16
- package/features/index.js +3 -3
- package/features/master-detail.js +18 -0
- package/features/pinned-rows.d.ts.map +1 -1
- package/features/pinned-rows.js +24 -17
- package/features/responsive.js +18 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +438 -895
- package/lib/column-shorthand.d.ts +22 -1
- package/lib/column-shorthand.d.ts.map +1 -1
- package/lib/data-grid.d.ts.map +1 -1
- package/lib/editor-mount-hooks.d.ts +39 -0
- package/lib/editor-mount-hooks.d.ts.map +1 -0
- package/lib/event-props.d.ts +132 -6
- package/lib/event-props.d.ts.map +1 -1
- package/lib/feature-props.d.ts +17 -2
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/portal-bridge.d.ts +11 -0
- package/lib/portal-bridge.d.ts.map +1 -1
- package/lib/portal-manager.d.ts.map +1 -1
- package/lib/react-column-config.d.ts +36 -5
- package/lib/react-column-config.d.ts.map +1 -1
- package/lib/react-grid-adapter.d.ts +111 -14
- package/lib/react-grid-adapter.d.ts.map +1 -1
- package/lib/use-grid-overlay.d.ts +74 -0
- package/lib/use-grid-overlay.d.ts.map +1 -0
- package/package.json +1 -1
- package/chunks/portal-bridge-DZ4yQkmm.js +0 -42
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnConfig } from '
|
|
1
|
+
import { ColumnConfig } from './react-column-config';
|
|
2
2
|
/**
|
|
3
3
|
* Type for column shorthand notation.
|
|
4
4
|
*
|
|
@@ -49,6 +49,27 @@ export declare function parseColumnShorthand<TRow = unknown>(shorthand: string):
|
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
51
|
export declare function normalizeColumns<TRow = unknown>(columns: ColumnShorthand<TRow>[]): ColumnConfig<TRow>[];
|
|
52
|
+
/**
|
|
53
|
+
* Apply column defaults to a list of columns. Individual column properties
|
|
54
|
+
* override defaults — the per-column value always wins over the default.
|
|
55
|
+
*
|
|
56
|
+
* @param columns - Normalized columns to merge defaults into
|
|
57
|
+
* @param defaults - Partial column config applied as a baseline; pass `undefined` to no-op
|
|
58
|
+
* @returns A new array with the defaults merged in (input is not mutated)
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* applyColumnDefaults(
|
|
63
|
+
* [{ field: 'id' }, { field: 'name', sortable: false }],
|
|
64
|
+
* { sortable: true, resizable: true },
|
|
65
|
+
* );
|
|
66
|
+
* // [
|
|
67
|
+
* // { field: 'id', sortable: true, resizable: true },
|
|
68
|
+
* // { field: 'name', sortable: false, resizable: true },
|
|
69
|
+
* // ]
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function applyColumnDefaults<TRow = unknown>(columns: ColumnConfig<TRow>[], defaults: Partial<ColumnConfig<TRow>> | undefined): ColumnConfig<TRow>[];
|
|
52
73
|
/**
|
|
53
74
|
* Check if an array of columns contains any shorthand strings.
|
|
54
75
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-shorthand.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/column-shorthand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"column-shorthand.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/column-shorthand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,eAAe,CAAC,IAAI,GAAG,OAAO,IAAI,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;AA2C1E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAG,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAsB1F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,CAOvG;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,GAAG,OAAO,EAChD,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,EAC7B,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAChD,YAAY,CAAC,IAAI,CAAC,EAAE,CAGtB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,CAEnF"}
|
package/lib/data-grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/data-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,
|
|
1
|
+
{"version":3,"file":"data-grid.d.ts","sourceRoot":"","sources":["../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I,CAAC;IACzD,4CAA4C;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,yCAAyC;IACzC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,0CAA0C;IAC1C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,uDAAuD;IACvD,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,eAAO,MAAM,QAAQ,EAmbf,CAAC,IAAI,GAAG,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAA;CAAE,KAAK,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editor mount hook registry — append-only hooks called when a React-managed
|
|
3
|
+
* editor container is mounted into the DOM with a known owner grid.
|
|
4
|
+
*
|
|
5
|
+
* This is the augmentation point that lets feature secondary entries
|
|
6
|
+
* (e.g. `@toolbox-web/grid-react/features/editing`) install per-editor
|
|
7
|
+
* lifecycle behaviour (such as the `before-edit-close` blur bridge)
|
|
8
|
+
* without coupling the central adapter / column-config files to the
|
|
9
|
+
* editing feature. Mirrors how core grid plugins augment the grid via
|
|
10
|
+
* `registerPlugin()`.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Hook called when an editor container is mounted. Returning a function
|
|
17
|
+
* registers a teardown that runs when the editor is released.
|
|
18
|
+
*/
|
|
19
|
+
export type EditorMountHook = (ctx: {
|
|
20
|
+
container: HTMLElement;
|
|
21
|
+
gridEl: HTMLElement;
|
|
22
|
+
}) => (() => void) | void;
|
|
23
|
+
/**
|
|
24
|
+
* Install an editor-mount hook. Called by feature secondary entries
|
|
25
|
+
* (e.g. `features/editing`) on import. Idempotent across hot-reload
|
|
26
|
+
* boundaries is NOT guaranteed; consumers should import once.
|
|
27
|
+
*
|
|
28
|
+
* @internal Plugin API
|
|
29
|
+
*/
|
|
30
|
+
export declare function registerEditorMountHook(hook: EditorMountHook): void;
|
|
31
|
+
/**
|
|
32
|
+
* Run all registered editor-mount hooks for a freshly mounted editor.
|
|
33
|
+
* Returns a combined teardown that invokes each hook's teardown in
|
|
34
|
+
* registration order.
|
|
35
|
+
*
|
|
36
|
+
* @internal Adapter / column-config use only.
|
|
37
|
+
*/
|
|
38
|
+
export declare function notifyEditorMounted(container: HTMLElement, gridEl: HTMLElement): () => void;
|
|
39
|
+
//# sourceMappingURL=editor-mount-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-mount-hooks.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/editor-mount-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE;IAAE,SAAS,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;AAI5G;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,IAAI,CAS3F"}
|
package/lib/event-props.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CellActivateDetail, CellChangeDetail, CellClickDetail, CellCommitDetail, ChangedRowsResetDetail, ColumnMoveDetail, ColumnResizeDetail, ColumnVisibilityDetail, CopyDetail, DetailExpandDetail, ExportCompleteDetail, FilterChangeDetail, GridColumnState, GroupToggleDetail, PasteDetail, PrintCompleteDetail, PrintStartDetail, ResponsiveChangeDetail, RowClickDetail, RowCommitDetail, RowDragEndDetail, RowDragStartDetail, RowDropDetail, RowMoveDetail, RowTransferDetail, SelectionChangeDetail, SortChangeDetail, TbwScrollDetail, TreeExpandDetail, UndoRedoDetail } from '@toolbox-web/grid/all';
|
|
1
|
+
import { CellActivateDetail, CellChangeDetail, CellClickDetail, CellCommitDetail, ChangedRowsResetDetail, ColumnMoveDetail, ColumnResizeDetail, ColumnVisibilityDetail, CopyDetail, DataGridEventMap, DetailExpandDetail, ExportCompleteDetail, FilterChangeDetail, GridColumnState, GroupToggleDetail, PasteDetail, PrintCompleteDetail, PrintStartDetail, ResponsiveChangeDetail, RowClickDetail, RowCommitDetail, RowDragEndDetail, RowDragStartDetail, RowDropDetail, RowMoveDetail, RowTransferDetail, SelectionChangeDetail, SortChangeDetail, TbwScrollDetail, TreeExpandDetail, UndoRedoDetail } from '@toolbox-web/grid/all';
|
|
2
2
|
/**
|
|
3
3
|
* Event handler type with unwrapped detail.
|
|
4
4
|
* Pattern: `(detail: T, event?: CustomEvent) => void`
|
|
@@ -87,6 +87,40 @@ export interface EventProps<TRow = unknown> {
|
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
89
|
onChangedRowsReset?: EventHandler<ChangedRowsResetDetail<TRow>>;
|
|
90
|
+
/**
|
|
91
|
+
* Fired when an editor opens for a cell.
|
|
92
|
+
*
|
|
93
|
+
* @requires `import '@toolbox-web/grid-react/features/editing';`
|
|
94
|
+
*/
|
|
95
|
+
onEditOpen?: EventHandler<DataGridEventMap<TRow>['edit-open']>;
|
|
96
|
+
/**
|
|
97
|
+
* Fired before an editor closes (commit or cancel). Cancelable.
|
|
98
|
+
*
|
|
99
|
+
* @requires `import '@toolbox-web/grid-react/features/editing';`
|
|
100
|
+
*/
|
|
101
|
+
onBeforeEditClose?: EventHandler<DataGridEventMap<TRow>['before-edit-close']>;
|
|
102
|
+
/**
|
|
103
|
+
* Fired after an editor closes (commit or cancel).
|
|
104
|
+
*
|
|
105
|
+
* @requires `import '@toolbox-web/grid-react/features/editing';`
|
|
106
|
+
*/
|
|
107
|
+
onEditClose?: EventHandler<DataGridEventMap<TRow>['edit-close']>;
|
|
108
|
+
/**
|
|
109
|
+
* Fired when a cell edit is canceled (e.g. Escape key).
|
|
110
|
+
*
|
|
111
|
+
* @requires `import '@toolbox-web/grid-react/features/editing';`
|
|
112
|
+
*/
|
|
113
|
+
onCellCancel?: EventHandler<DataGridEventMap<TRow>['cell-cancel']>;
|
|
114
|
+
/**
|
|
115
|
+
* Fired when the dirty/changed-rows state transitions.
|
|
116
|
+
*
|
|
117
|
+
* @requires `import '@toolbox-web/grid-react/features/editing';`
|
|
118
|
+
*/
|
|
119
|
+
onDirtyChange?: EventHandler<DataGridEventMap<TRow>['dirty-change']>;
|
|
120
|
+
/**
|
|
121
|
+
* Fired when the row data is replaced (e.g. via the `data` property setter).
|
|
122
|
+
*/
|
|
123
|
+
onDataChange?: EventHandler<DataGridEventMap<TRow>['data-change']>;
|
|
90
124
|
/**
|
|
91
125
|
* Fired when sort state changes.
|
|
92
126
|
*
|
|
@@ -135,7 +169,22 @@ export interface EventProps<TRow = unknown> {
|
|
|
135
169
|
*/
|
|
136
170
|
onColumnMove?: EventHandler<ColumnMoveDetail>;
|
|
137
171
|
/**
|
|
138
|
-
* Fired when column
|
|
172
|
+
* Fired when a column resize is reset (e.g. via double-click on the resize handle).
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```tsx
|
|
176
|
+
* onColumnResizeReset={(detail) => console.log('Reset width for:', detail.field)}
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
onColumnResizeReset?: EventHandler<DataGridEventMap<TRow>['column-resize-reset']>;
|
|
180
|
+
/**
|
|
181
|
+
* Fired when a column is shown or hidden — either via the visibility
|
|
182
|
+
* sidebar, `grid.toggleColumnVisibility(field)`, `grid.setColumnVisible(field, visible)`,
|
|
183
|
+
* or `grid.showAllColumns()`.
|
|
184
|
+
*
|
|
185
|
+
* `field` and `visible` are present for single-column toggles and
|
|
186
|
+
* `undefined` for bulk operations (`showAllColumns`). `visibleColumns`
|
|
187
|
+
* always lists the current set.
|
|
139
188
|
*
|
|
140
189
|
* @requires `import '@toolbox-web/grid-react/features/visibility';`
|
|
141
190
|
*
|
|
@@ -143,6 +192,7 @@ export interface EventProps<TRow = unknown> {
|
|
|
143
192
|
* ```tsx
|
|
144
193
|
* onColumnVisibility={(detail) => {
|
|
145
194
|
* console.log(detail.hidden ? 'Hidden:' : 'Shown:', detail.field);
|
|
195
|
+
* localStorage.setItem('visibleColumns', JSON.stringify(detail.visibleColumns));
|
|
146
196
|
* }}
|
|
147
197
|
* ```
|
|
148
198
|
*/
|
|
@@ -226,6 +276,24 @@ export interface EventProps<TRow = unknown> {
|
|
|
226
276
|
* ```
|
|
227
277
|
*/
|
|
228
278
|
onGroupToggle?: EventHandler<GroupToggleDetail>;
|
|
279
|
+
/**
|
|
280
|
+
* Fired when a group is expanded.
|
|
281
|
+
*
|
|
282
|
+
* @requires `import '@toolbox-web/grid-react/features/grouping-rows';`
|
|
283
|
+
*/
|
|
284
|
+
onGroupExpand?: EventHandler<DataGridEventMap<TRow>['group-expand']>;
|
|
285
|
+
/**
|
|
286
|
+
* Fired when a group is collapsed.
|
|
287
|
+
*
|
|
288
|
+
* @requires `import '@toolbox-web/grid-react/features/grouping-rows';`
|
|
289
|
+
*/
|
|
290
|
+
onGroupCollapse?: EventHandler<DataGridEventMap<TRow>['group-collapse']>;
|
|
291
|
+
/**
|
|
292
|
+
* Fired when the context menu opens.
|
|
293
|
+
*
|
|
294
|
+
* @requires `import '@toolbox-web/grid-react/features/context-menu';`
|
|
295
|
+
*/
|
|
296
|
+
onContextMenuOpen?: EventHandler<DataGridEventMap<TRow>['context-menu-open']>;
|
|
229
297
|
/**
|
|
230
298
|
* Fired when a tree node is expanded.
|
|
231
299
|
*
|
|
@@ -286,16 +354,27 @@ export interface EventProps<TRow = unknown> {
|
|
|
286
354
|
*/
|
|
287
355
|
onPaste?: EventHandler<PasteDetail>;
|
|
288
356
|
/**
|
|
289
|
-
* Fired when undo
|
|
357
|
+
* Fired when an undo action is performed.
|
|
358
|
+
*
|
|
359
|
+
* @requires `import '@toolbox-web/grid-react/features/undo-redo';`
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* ```tsx
|
|
363
|
+
* onUndo={(detail) => console.log('Undid:', detail.action.type, '- Can undo:', detail.canUndo)}
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
onUndo?: EventHandler<UndoRedoDetail>;
|
|
367
|
+
/**
|
|
368
|
+
* Fired when a redo action is performed.
|
|
290
369
|
*
|
|
291
370
|
* @requires `import '@toolbox-web/grid-react/features/undo-redo';`
|
|
292
371
|
*
|
|
293
372
|
* @example
|
|
294
373
|
* ```tsx
|
|
295
|
-
*
|
|
374
|
+
* onRedo={(detail) => console.log('Redid:', detail.action.type, '- Can redo:', detail.canRedo)}
|
|
296
375
|
* ```
|
|
297
376
|
*/
|
|
298
|
-
|
|
377
|
+
onRedo?: EventHandler<UndoRedoDetail>;
|
|
299
378
|
/**
|
|
300
379
|
* Fired when export completes.
|
|
301
380
|
*
|
|
@@ -350,8 +429,55 @@ export interface EventProps<TRow = unknown> {
|
|
|
350
429
|
/**
|
|
351
430
|
* Map of event handler prop names to their corresponding event names.
|
|
352
431
|
* Used internally to wire up event listeners.
|
|
432
|
+
*
|
|
433
|
+
* The `satisfies` clause enforces bidirectional sync:
|
|
434
|
+
* - Every key must be a valid `keyof EventProps` (interface drift fails)
|
|
435
|
+
* - Every value must be a valid `keyof DataGridEventMap` (event-name typos
|
|
436
|
+
* and stale entries pointing at non-existent events fail at compile time)
|
|
353
437
|
*/
|
|
354
|
-
export declare const EVENT_PROP_MAP:
|
|
438
|
+
export declare const EVENT_PROP_MAP: {
|
|
439
|
+
readonly onCellClick: "cell-click";
|
|
440
|
+
readonly onRowClick: "row-click";
|
|
441
|
+
readonly onCellActivate: "cell-activate";
|
|
442
|
+
readonly onCellChange: "cell-change";
|
|
443
|
+
readonly onCellCommit: "cell-commit";
|
|
444
|
+
readonly onCellCancel: "cell-cancel";
|
|
445
|
+
readonly onRowCommit: "row-commit";
|
|
446
|
+
readonly onChangedRowsReset: "changed-rows-reset";
|
|
447
|
+
readonly onEditOpen: "edit-open";
|
|
448
|
+
readonly onBeforeEditClose: "before-edit-close";
|
|
449
|
+
readonly onEditClose: "edit-close";
|
|
450
|
+
readonly onDirtyChange: "dirty-change";
|
|
451
|
+
readonly onDataChange: "data-change";
|
|
452
|
+
readonly onSortChange: "sort-change";
|
|
453
|
+
readonly onFilterChange: "filter-change";
|
|
454
|
+
readonly onColumnResize: "column-resize";
|
|
455
|
+
readonly onColumnResizeReset: "column-resize-reset";
|
|
456
|
+
readonly onColumnMove: "column-move";
|
|
457
|
+
readonly onColumnVisibility: "column-visibility";
|
|
458
|
+
readonly onColumnStateChange: "column-state-change";
|
|
459
|
+
readonly onSelectionChange: "selection-change";
|
|
460
|
+
readonly onRowMove: "row-move";
|
|
461
|
+
readonly onRowDragStart: "row-drag-start";
|
|
462
|
+
readonly onRowDragEnd: "row-drag-end";
|
|
463
|
+
readonly onRowDrop: "row-drop";
|
|
464
|
+
readonly onRowTransfer: "row-transfer";
|
|
465
|
+
readonly onGroupToggle: "group-toggle";
|
|
466
|
+
readonly onGroupExpand: "group-expand";
|
|
467
|
+
readonly onGroupCollapse: "group-collapse";
|
|
468
|
+
readonly onTreeExpand: "tree-expand";
|
|
469
|
+
readonly onDetailExpand: "detail-expand";
|
|
470
|
+
readonly onResponsiveChange: "responsive-change";
|
|
471
|
+
readonly onContextMenuOpen: "context-menu-open";
|
|
472
|
+
readonly onCopy: "copy";
|
|
473
|
+
readonly onPaste: "paste";
|
|
474
|
+
readonly onUndo: "undo";
|
|
475
|
+
readonly onRedo: "redo";
|
|
476
|
+
readonly onExportComplete: "export-complete";
|
|
477
|
+
readonly onPrintStart: "print-start";
|
|
478
|
+
readonly onPrintComplete: "print-complete";
|
|
479
|
+
readonly onTbwScroll: "tbw-scroll";
|
|
480
|
+
};
|
|
355
481
|
/**
|
|
356
482
|
* Gets all event prop names.
|
|
357
483
|
*/
|
package/lib/event-props.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-props.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/event-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,WAAW,UAAU,CAAC,IAAI,GAAG,OAAO;IAKxC;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IAElD;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IAEhD;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAExD;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IAMpD;;;;;;;;;;;;;;;OAeG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IAEpD;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IAElD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,YAAY,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"event-props.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/event-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,MA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Y,CAAC,gBAAgB,CAAC,CAAC;IAE9C;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC,mBAAmB,CAAC,CAAC;IAMpD;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;CAC7C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C6D,CAAC;AAEzF;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,CAAC,MAAM,UAAU,CAAC,EAAE,CAExD"}
|
package/lib/feature-props.d.ts
CHANGED
|
@@ -369,11 +369,26 @@ export interface FeatureProps<TRow = unknown> {
|
|
|
369
369
|
}
|
|
370
370
|
/**
|
|
371
371
|
* Props for controlling SSR behavior.
|
|
372
|
+
*
|
|
373
|
+
* @deprecated This prop is a no-op in any meaningful sense and will be removed
|
|
374
|
+
* in a future major release. The original RFC introduced `ssr` to disable
|
|
375
|
+
* dynamic feature imports during server-side rendering, but the React adapter
|
|
376
|
+
* no longer uses dynamic imports — features are registered via synchronous
|
|
377
|
+
* side-effect imports (`import '@toolbox-web/grid-react/features/...'`), which
|
|
378
|
+
* are SSR-safe by construction. Setting `ssr={true}` today only skips plugin
|
|
379
|
+
* instantiation on the React side; `<tbw-grid>` itself is a custom element
|
|
380
|
+
* that requires a custom-elements polyfill to render anything server-side, and
|
|
381
|
+
* upon client hydration the grid mounts and renders normally regardless of
|
|
382
|
+
* this flag. If you need real SSR support (Next.js / Remix / Astro), open an
|
|
383
|
+
* issue describing your hydration requirements so we can design a proper
|
|
384
|
+
* cross-adapter story rather than relying on this flag.
|
|
372
385
|
*/
|
|
373
386
|
export interface SSRProps {
|
|
374
387
|
/**
|
|
375
|
-
* Enable SSR mode -
|
|
376
|
-
*
|
|
388
|
+
* Enable SSR mode - skips React-side plugin instantiation.
|
|
389
|
+
*
|
|
390
|
+
* @deprecated No-op in practice — see {@link SSRProps} for details. Will be
|
|
391
|
+
* removed in a future major release.
|
|
377
392
|
* @default false
|
|
378
393
|
*/
|
|
379
394
|
ssr?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-props.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/feature-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,
|
|
1
|
+
{"version":3,"file":"feature-props.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/feature-props.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,EAEZ,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;GAMG;AACH,KAAK,iBAAiB,CAAC,IAAI,GAAG,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,qBAAqB,CAAC,GAAG;IACzF,mBAAmB,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE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;;;;OAWG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAM9B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;CACnC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,IAAI,GAAG,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC"}
|
package/lib/portal-bridge.d.ts
CHANGED
|
@@ -48,6 +48,17 @@ export declare function clearContainersForGrid(gridEl: HTMLElement): void;
|
|
|
48
48
|
* Use `clearContainersForGrid()` in multi-grid scenarios instead.
|
|
49
49
|
*/
|
|
50
50
|
export declare function clearAllContainers(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Wrap a React-returning render function as a vanilla `(ctx) => HTMLElement | null`
|
|
53
|
+
* suitable for any grid renderer slot (cell renderer, group header, pinned-row
|
|
54
|
+
* panel, etc.). Returns `null` when the React function returns `null` /
|
|
55
|
+
* `undefined` / `false`, so built-in conditional renderers can opt out.
|
|
56
|
+
*
|
|
57
|
+
* The wrapper is a `<div style="display:contents">` so it imposes no layout.
|
|
58
|
+
* Each call mounts a fresh portal — call sites that need to update the same
|
|
59
|
+
* container instead should use `renderToContainer` directly with `existingKey`.
|
|
60
|
+
*/
|
|
61
|
+
export declare function createNodeBridge<TCtx>(reactFn: (ctx: TCtx) => ReactNode): (ctx: TCtx) => HTMLElement | null;
|
|
51
62
|
/**
|
|
52
63
|
* Reset the key counter. Only use in tests.
|
|
53
64
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-bridge.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/portal-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MA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ED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,mBAAmB,GAAG,IAAI,CAIjF;AAuCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,SAAS,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,WAAW,GACnB,MAAM,CAoBR;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAQnF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAWhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAczC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK,WAAW,GAAG,IAAI,CAS3G;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAKlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-manager.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/portal-manager.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"portal-manager.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/portal-manager.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAkE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAsDvG;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;IAE5E;;;;;;;OAOG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEhD,0BAA0B;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,+FA6IxB,CAAC"}
|
|
@@ -81,19 +81,50 @@ export type GridConfig<TRow = unknown> = Omit<BaseGridConfig<TRow>, 'columns' |
|
|
|
81
81
|
loadingRenderer?: BaseGridConfig<TRow>['loadingRenderer'] | ((ctx: LoadingContext) => ReactNode);
|
|
82
82
|
};
|
|
83
83
|
/**
|
|
84
|
-
* Clean up config-based editor portals whose containers are
|
|
85
|
-
* Called by the React GridAdapter's releaseCell
|
|
86
|
-
*
|
|
84
|
+
* Clean up config-based editor and renderer portals whose containers are
|
|
85
|
+
* inside the given element. Called by the React GridAdapter's `releaseCell`
|
|
86
|
+
* to unmount portals created by `wrapReactEditor` / `wrapReactRenderer`
|
|
87
|
+
* (which bypass the adapter's per-cell portal tracking).
|
|
87
88
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
89
|
+
* Targets both `.react-cell-editor` AND `.react-cell-renderer` containers:
|
|
90
|
+
* editors always tear down on cell release, and renderers MUST also tear
|
|
91
|
+
* down before the editing pipeline runs `cell.innerHTML = ''` (otherwise
|
|
92
|
+
* React's still-mounted fiber tree points at orphan DOM and throws on the
|
|
93
|
+
* next commit — see `wrapReactRenderer` doc and issue #250). The renderer
|
|
94
|
+
* cache will create a fresh container on the next render via its
|
|
95
|
+
* cellEl.contains() check.
|
|
90
96
|
*
|
|
91
97
|
* @internal
|
|
92
98
|
*/
|
|
93
99
|
export declare function cleanupConfigRootsIn(parentEl: HTMLElement): void;
|
|
100
|
+
/**
|
|
101
|
+
* Returns a function that, when invoked, blurs the focused input/textarea/select
|
|
102
|
+
* inside `container` (if any). Used by the `before-edit-close` bridge so editors
|
|
103
|
+
* with `onBlur={commit}` flush their pending value before the cell DOM is torn
|
|
104
|
+
* down by Tab / programmatic row exit. The native `.blur()` method fires both
|
|
105
|
+
* `blur` (non-bubbling) and `focusout` (bubbling) — React's event delegation
|
|
106
|
+
* listens to `focusout` and maps it to `onBlur`.
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
export declare function makeFlushFocusedInput(container: HTMLElement): () => void;
|
|
94
110
|
/**
|
|
95
111
|
* Wraps a React renderer function into a DOM-returning viewRenderer.
|
|
96
112
|
* Used internally by DataGrid to process reactRenderer properties.
|
|
113
|
+
*
|
|
114
|
+
* Cache invariant: a cached `{ portalKey, container }` is only safe to reuse
|
|
115
|
+
* while `container` is still attached to the original cell. The editing
|
|
116
|
+
* pipeline (`editor-injection.ts`) wipes a cell with `cell.innerHTML = ''`
|
|
117
|
+
* when an editor opens — this detaches the renderer container from the cell
|
|
118
|
+
* without React knowing, leaving React's fiber tree pointing at orphaned
|
|
119
|
+
* nodes. If we then reuse the cached entry on the next render, the user's
|
|
120
|
+
* `onCellCommit` → `setRows` triggers a React commit that tries to
|
|
121
|
+
* `removeChild` nodes that no longer exist in the DOM and throws
|
|
122
|
+
* `NotFoundError: Failed to execute 'removeChild' on 'Node'` (issue #250).
|
|
123
|
+
*
|
|
124
|
+
* Defense: before reusing a cached entry, verify the container is still
|
|
125
|
+
* inside the cell. If not, synchronously unmount the stale React root
|
|
126
|
+
* (`removeFromContainer(..., { sync: true })` so it tears down before any
|
|
127
|
+
* batched user setState runs against it) and create a fresh container.
|
|
97
128
|
*/
|
|
98
129
|
export declare function wrapReactRenderer<TRow>(renderFn: (ctx: CellRenderContext<TRow>) => ReactNode): (ctx: CellRenderContext<TRow>) => HTMLElement;
|
|
99
130
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-column-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"react-column-config.d.ts","sourceRoot":"","sources":["../../../../libs/grid-react/src/lib/react-column-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,UAAU,IAAI,cAAc,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,YAAY,CAAC,IAAI,GAAG,OAAO,CAAE,SAAQ,IAAI,CACxD,gBAAgB,CAAC,IAAI,CAAC,EACtB,UAAU,GAAG,cAAc,GAAG,QAAQ,GAAG,gBAAgB,GAAG,qBAAqB,CAClF;IACC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAEvD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAEvD;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;IAE7D;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;CACpE;AAKD;;;;;;;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E,kBAAkB,CAAC,IAAI,CAAC,KAAK,SAAS,GACrD,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,WAAW,CAShD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,SAAS,GAC3C,CAAC,GAAG,EAAE,cAAc,KAAK,WAAW,GAAG,MAAM,CAkB/C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,SAAS,CA0D9G"}
|
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
import { CellRenderContext, ColumnEditorContext, ColumnEditorSpec, ColumnViewRenderer, GridConfig as CoreGridConfig, FrameworkAdapter, TypeDefault } from '@toolbox-web/grid';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { registerEditorMountHook, EditorMountHook } from './editor-mount-hooks';
|
|
3
4
|
import { TypeDefaultsMap } from './grid-type-registry';
|
|
5
|
+
export { registerEditorMountHook, type EditorMountHook };
|
|
6
|
+
/**
|
|
7
|
+
* Context handed to feature bridge installers so they can hook the adapter's
|
|
8
|
+
* portal lifecycle without depending on its private fields.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export interface FeatureBridgeContext {
|
|
12
|
+
/** Track a portal key + container for cleanup on releaseCell / destroy. */
|
|
13
|
+
trackPortal(key: string, container: HTMLElement, isEditor: boolean): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Installer signature: given a grid element + bridge context, returns the
|
|
17
|
+
* row-renderer the adapter should expose, or undefined if no React template
|
|
18
|
+
* is registered for that grid.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export type RowRendererBridge = <TRow = unknown>(gridEl: HTMLElement, ctx: FeatureBridgeContext) => ((row: TRow, rowIndex: number) => HTMLElement) | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Installer signature for the type-default `filterPanelRenderer` wrapper.
|
|
24
|
+
* Receives the user's React render function (typed loosely as `unknown` so
|
|
25
|
+
* the adapter does not depend on filtering types) and returns the imperative
|
|
26
|
+
* `(container, params) => void` form required by the core grid.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export type FilterPanelTypeDefaultBridge = (renderFn: unknown, gridEl: HTMLElement | undefined, ctx: FeatureBridgeContext) => NonNullable<TypeDefault['filterPanelRenderer']>;
|
|
30
|
+
/**
|
|
31
|
+
* Install the master-detail row-renderer bridge. Called once on import by
|
|
32
|
+
* `@toolbox-web/grid-react/features/master-detail`. Mirrors how core grid
|
|
33
|
+
* plugins augment the grid via `registerPlugin()`.
|
|
34
|
+
* @internal Plugin API
|
|
35
|
+
*/
|
|
36
|
+
export declare function registerDetailRendererBridge(bridge: RowRendererBridge): void;
|
|
37
|
+
/**
|
|
38
|
+
* Install the responsive card row-renderer bridge. Called once on import by
|
|
39
|
+
* `@toolbox-web/grid-react/features/responsive`.
|
|
40
|
+
* @internal Plugin API
|
|
41
|
+
*/
|
|
42
|
+
export declare function registerResponsiveCardRendererBridge(bridge: RowRendererBridge): void;
|
|
43
|
+
/**
|
|
44
|
+
* Install the type-default `filterPanelRenderer` wrapper. Called once on
|
|
45
|
+
* import by `@toolbox-web/grid-react/features/filtering`. Without this
|
|
46
|
+
* bridge, type-default filterPanelRenderer entries are dropped silently —
|
|
47
|
+
* filter panels only work if the filtering feature is also imported, which
|
|
48
|
+
* is the same precondition as the FilteringPlugin itself (TBW031).
|
|
49
|
+
* @internal Plugin API
|
|
50
|
+
*/
|
|
51
|
+
export declare function registerFilterPanelTypeDefaultBridge(bridge: FilterPanelTypeDefaultBridge): void;
|
|
4
52
|
/**
|
|
5
53
|
* Register a React cell renderer for a column element.
|
|
6
54
|
* Called by GridColumn when it has a children render prop.
|
|
@@ -26,12 +74,6 @@ export declare function getColumnEditor(element: HTMLElement): ((ctx: ColumnEdit
|
|
|
26
74
|
* @internal
|
|
27
75
|
*/
|
|
28
76
|
export declare function getRegisteredFields(): string[];
|
|
29
|
-
/**
|
|
30
|
-
* Clear the field registries.
|
|
31
|
-
* Called during adapter cleanup and in tests.
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export declare function clearFieldRegistries(): void;
|
|
35
77
|
/**
|
|
36
78
|
* Framework adapter that enables React component integration
|
|
37
79
|
* with the grid's light DOM configuration API.
|
|
@@ -69,6 +111,38 @@ export declare class GridAdapter implements FrameworkAdapter {
|
|
|
69
111
|
private editorPortalKeys;
|
|
70
112
|
/** Maps portal keys to their containers (for container-based lookups in releaseCell/unmount). */
|
|
71
113
|
private keyToContainer;
|
|
114
|
+
/**
|
|
115
|
+
* Reverse index: container element → portal key. Maintained alongside
|
|
116
|
+
* `keyToContainer` so `releaseCell` can resolve only the containers
|
|
117
|
+
* actually inside the released cell (via `cellEl.querySelectorAll`)
|
|
118
|
+
* instead of scanning every tracked portal — important for grids with
|
|
119
|
+
* many cells, where `releaseCell` runs on every cell teardown.
|
|
120
|
+
*/
|
|
121
|
+
private containerToKey;
|
|
122
|
+
/**
|
|
123
|
+
* Per-editor `before-edit-close` listener teardown functions, keyed by portal key.
|
|
124
|
+
*
|
|
125
|
+
* The grid's editing plugin emits `before-edit-close` on the host `<tbw-grid>`
|
|
126
|
+
* before tearing down a row's managed editors. React editors commonly write
|
|
127
|
+
* `onBlur={commit}` to flush local state on click-away, but Tab / programmatic
|
|
128
|
+
* row exit rebuilds the cell DOM synchronously without giving the focused
|
|
129
|
+
* input a chance to fire `blur` first.
|
|
130
|
+
*
|
|
131
|
+
* To bridge that gap we call `.blur()` on the focused input inside the editor
|
|
132
|
+
* container as soon as `before-edit-close` fires. The native `.blur()` method
|
|
133
|
+
* is what React's event system actually observes — React 17+ delegates focus
|
|
134
|
+
* events at the root by listening to `focusout` (bubbling) and mapping it to
|
|
135
|
+
* `onBlur`. A bare `dispatchEvent(new FocusEvent('blur'))` would be ignored
|
|
136
|
+
* by React because `blur` does not bubble. Calling the native `.blur()`
|
|
137
|
+
* dispatches the full focus-loss chain (`blur` + `focusout`) and also moves
|
|
138
|
+
* focus off the input — both desirable here since the editor DOM is about to
|
|
139
|
+
* be torn down anyway.
|
|
140
|
+
*
|
|
141
|
+
* Mirrors the Angular adapter's `BaseGridEditor.onBeforeEditClose()` hook.
|
|
142
|
+
* Requires zero per-editor code: any editor with `onBlur={commit}` is
|
|
143
|
+
* automatically covered for Tab commits and programmatic row exit.
|
|
144
|
+
*/
|
|
145
|
+
private editorBeforeCloseUnsubs;
|
|
72
146
|
private typeDefaults;
|
|
73
147
|
/**
|
|
74
148
|
* Sets the type defaults map for this adapter.
|
|
@@ -107,7 +181,10 @@ export declare class GridAdapter implements FrameworkAdapter {
|
|
|
107
181
|
createEditor<TRow = unknown, TValue = unknown>(element: HTMLElement): ColumnEditorSpec<TRow, TValue>;
|
|
108
182
|
/**
|
|
109
183
|
* Creates a detail renderer function for MasterDetailPlugin.
|
|
110
|
-
*
|
|
184
|
+
* Implementation is installed by `@toolbox-web/grid-react/features/master-detail`
|
|
185
|
+
* via {@link registerDetailRendererBridge}. Returns undefined if the
|
|
186
|
+
* master-detail feature has not been imported, or if no GridDetailPanel
|
|
187
|
+
* was registered for this grid.
|
|
111
188
|
*/
|
|
112
189
|
createDetailRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow, rowIndex: number) => HTMLElement) | undefined;
|
|
113
190
|
/**
|
|
@@ -117,7 +194,10 @@ export declare class GridAdapter implements FrameworkAdapter {
|
|
|
117
194
|
parseDetailElement<TRow = unknown>(detailElement: Element): ((row: TRow, rowIndex: number) => HTMLElement | string) | undefined;
|
|
118
195
|
/**
|
|
119
196
|
* Creates a responsive card renderer function for ResponsivePlugin.
|
|
120
|
-
*
|
|
197
|
+
* Implementation is installed by `@toolbox-web/grid-react/features/responsive`
|
|
198
|
+
* via {@link registerResponsiveCardRendererBridge}. Returns undefined if
|
|
199
|
+
* the responsive feature has not been imported, or if no GridResponsiveCard
|
|
200
|
+
* was registered for this grid.
|
|
121
201
|
*/
|
|
122
202
|
createResponsiveCardRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow, rowIndex: number) => HTMLElement) | undefined;
|
|
123
203
|
/**
|
|
@@ -170,10 +250,11 @@ export declare class GridAdapter implements FrameworkAdapter {
|
|
|
170
250
|
*/
|
|
171
251
|
private createTypeEditor;
|
|
172
252
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
253
|
+
* Stable bridge context handed to feature installers. Bound once per adapter
|
|
254
|
+
* so feature bridges can call `trackPortal` without each invocation creating
|
|
255
|
+
* a fresh closure.
|
|
175
256
|
*/
|
|
176
|
-
private
|
|
257
|
+
private readonly bridgeContext;
|
|
177
258
|
/** Register a portal key for lifecycle tracking. */
|
|
178
259
|
private trackPortal;
|
|
179
260
|
/** Unregister a portal key from all tracking sets. */
|
|
@@ -185,9 +266,25 @@ export declare class GridAdapter implements FrameworkAdapter {
|
|
|
185
266
|
destroy(): void;
|
|
186
267
|
/**
|
|
187
268
|
* Called when a cell's content is about to be wiped.
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
269
|
+
*
|
|
270
|
+
* Destroys editor portals AND renderer portals whose container is inside
|
|
271
|
+
* the cell. Releasing renderers here is critical: the editing pipeline
|
|
272
|
+
* runs `cell.innerHTML = ''` immediately after this returns, which
|
|
273
|
+
* silently detaches React-managed renderer containers from the DOM.
|
|
274
|
+
* If we leave the React root mounted, its fiber tree still believes
|
|
275
|
+
* the now-orphaned children are present — a subsequent React commit
|
|
276
|
+
* (e.g. the user's `onCellCommit` → `setRows`) tries to `removeChild`
|
|
277
|
+
* those gone nodes and throws `NotFoundError` (issue #250).
|
|
278
|
+
*
|
|
279
|
+
* Calling this BEFORE the wipe lets React unmount cleanly while DOM
|
|
280
|
+
* still matches its fiber tree. The `wrapReactRenderer` cache will
|
|
281
|
+
* detect the missing entry on the next render and create a fresh
|
|
282
|
+
* container — see the cache-validation defense in `createRenderer`
|
|
283
|
+
* and `wrapReactRenderer` (`react-column-config.ts`).
|
|
284
|
+
*
|
|
285
|
+
* Also cleans up config-based editor and renderer roots
|
|
286
|
+
* (from processGridConfig/wrapReactEditor/wrapReactRenderer) that
|
|
287
|
+
* bypass the adapter's own portal tracking.
|
|
191
288
|
*/
|
|
192
289
|
releaseCell(cellEl: HTMLElement): void;
|
|
193
290
|
/**
|