@toolbox-web/grid 0.3.3 → 0.4.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/all.d.ts +19 -19
- package/all.d.ts.map +1 -1
- package/all.js +1775 -1202
- package/all.js.map +1 -1
- package/index.js +2152 -2028
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +22 -12
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/columns.d.ts +0 -9
- package/lib/core/internal/columns.d.ts.map +1 -1
- package/lib/core/internal/config-manager.d.ts +236 -0
- package/lib/core/internal/config-manager.d.ts.map +1 -0
- package/lib/core/internal/event-delegation.d.ts.map +1 -1
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/internal/keyboard.d.ts.map +1 -1
- package/lib/core/internal/render-scheduler.d.ts +123 -0
- package/lib/core/internal/render-scheduler.d.ts.map +1 -0
- package/lib/core/internal/rows.d.ts +8 -3
- package/lib/core/internal/rows.d.ts.map +1 -1
- package/lib/core/internal/sanitize.d.ts +2 -2
- package/lib/core/internal/sanitize.d.ts.map +1 -1
- package/lib/core/internal/shell.d.ts +40 -2
- package/lib/core/internal/shell.d.ts.map +1 -1
- package/lib/core/internal/validate-config.d.ts +11 -0
- package/lib/core/internal/validate-config.d.ts.map +1 -0
- package/lib/core/plugin/base-plugin.d.ts +70 -0
- package/lib/core/plugin/base-plugin.d.ts.map +1 -1
- package/lib/core/plugin/plugin-manager.d.ts +13 -2
- package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/core/plugin/types.d.ts +17 -3
- package/lib/core/plugin/types.d.ts.map +1 -1
- package/lib/core/types.d.ts +112 -12
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +50 -18
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +60 -25
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +51 -16
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts +117 -0
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -0
- package/lib/{core/internal → plugins/editing}/editors.d.ts +1 -1
- package/lib/plugins/editing/editors.d.ts.map +1 -0
- package/lib/plugins/editing/index.d.ts +8 -0
- package/lib/plugins/editing/index.d.ts.map +1 -0
- package/lib/plugins/editing/index.js +705 -0
- package/lib/plugins/editing/index.js.map +1 -0
- package/lib/plugins/editing/types.d.ts +45 -0
- package/lib/plugins/editing/types.d.ts.map +1 -0
- package/lib/plugins/export/ExportPlugin.d.ts.map +1 -1
- package/lib/plugins/export/index.js +74 -39
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
- package/lib/plugins/filtering/index.js +87 -50
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/grouping-columns.d.ts +4 -4
- package/lib/plugins/grouping-columns/grouping-columns.d.ts.map +1 -1
- package/lib/plugins/grouping-columns/index.js +59 -24
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/grouping-rows.d.ts.map +1 -1
- package/lib/plugins/grouping-rows/index.js +46 -11
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +2 -2
- package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
- package/lib/plugins/master-detail/index.js +140 -102
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/master-detail/types.d.ts +12 -2
- package/lib/plugins/master-detail/types.d.ts.map +1 -1
- package/lib/plugins/multi-sort/MultiSortPlugin.d.ts.map +1 -1
- package/lib/plugins/multi-sort/index.js +59 -22
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +41 -6
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/PinnedRowsPlugin.d.ts.map +1 -1
- package/lib/plugins/pinned-rows/index.js +45 -9
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +42 -7
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
- package/lib/plugins/reorder/index.js +59 -19
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/selection/index.js +41 -6
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +48 -13
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/TreePlugin.d.ts +3 -3
- package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
- package/lib/plugins/tree/index.js +165 -126
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/tree/tree-data.d.ts +6 -6
- package/lib/plugins/tree/tree-data.d.ts.map +1 -1
- package/lib/plugins/tree/tree-detect.d.ts +5 -9
- package/lib/plugins/tree/tree-detect.d.ts.map +1 -1
- package/lib/plugins/tree/types.d.ts +16 -4
- package/lib/plugins/tree/types.d.ts.map +1 -1
- package/lib/plugins/undo-redo/index.js +46 -11
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +37 -2
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/public.d.ts +104 -13
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +31 -19
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +18 -6
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +1 -1
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +2 -0
- package/umd/plugins/editing.umd.js.map +1 -0
- package/umd/plugins/export.umd.js +2 -2
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/reorder.umd.js +1 -1
- package/umd/plugins/reorder.umd.js.map +1 -1
- package/umd/plugins/tree.umd.js +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
- package/lib/core/internal/column-state.d.ts +0 -124
- package/lib/core/internal/column-state.d.ts.map +0 -1
- package/lib/core/internal/editing.d.ts +0 -76
- package/lib/core/internal/editing.d.ts.map +0 -1
- package/lib/core/internal/editors.d.ts.map +0 -1
- package/lib/core/internal/grid-internals.d.ts +0 -83
- package/lib/core/internal/grid-internals.d.ts.map +0 -1
package/lib/core/grid.d.ts
CHANGED
|
@@ -49,15 +49,22 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
49
49
|
field: string;
|
|
50
50
|
direction: 1 | -1;
|
|
51
51
|
} | null;
|
|
52
|
-
_activeEditRows: number;
|
|
53
|
-
_rowEditSnapshots: Map<number, T>;
|
|
54
|
-
_changedRowIndices: Set<number>;
|
|
55
52
|
_gridTemplate: string;
|
|
56
53
|
__rowRenderEpoch: number;
|
|
57
54
|
__didInitialAutoSize: boolean;
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
/** Light DOM columns cache - delegates to ConfigManager */
|
|
56
|
+
get __lightDomColumnsCache(): ColumnInternal[] | undefined;
|
|
57
|
+
set __lightDomColumnsCache(value: ColumnInternal[] | undefined);
|
|
58
|
+
/** Original column nodes - delegates to ConfigManager */
|
|
59
|
+
get __originalColumnNodes(): HTMLElement[] | undefined;
|
|
60
|
+
set __originalColumnNodes(value: HTMLElement[] | undefined);
|
|
60
61
|
__originalOrder: T[];
|
|
62
|
+
/**
|
|
63
|
+
* Framework adapter instance set by framework directives (Angular Grid, React DataGrid).
|
|
64
|
+
* Used to handle framework-specific component rendering.
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
__frameworkAdapter?: FrameworkAdapter;
|
|
61
68
|
__rowsBodyEl: HTMLElement | null;
|
|
62
69
|
get rows(): T[];
|
|
63
70
|
set rows(value: T[]);
|
|
@@ -186,14 +193,15 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
186
193
|
* const canMove = !responses.includes(false);
|
|
187
194
|
*/
|
|
188
195
|
queryPlugins<T>(query: PluginQuery): T[];
|
|
189
|
-
get changedRows(): T[];
|
|
190
|
-
get changedRowIndices(): number[];
|
|
191
|
-
resetChangedRows(silent?: boolean): Promise<void>;
|
|
192
|
-
beginBulkEdit(rowIndex: number): Promise<void>;
|
|
193
|
-
commitActiveRowEdit(): Promise<void>;
|
|
194
|
-
cancelActiveRowEdit(): Promise<void>;
|
|
195
196
|
ready(): Promise<void>;
|
|
196
197
|
forceLayout(): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Trim the internal row pool to match the current visible window size.
|
|
200
|
+
*
|
|
201
|
+
* The grid maintains a pool of reusable row DOM elements for virtualization.
|
|
202
|
+
* When the dataset shrinks significantly (e.g., after filtering or deleting rows),
|
|
203
|
+
* the pool may have excess elements that consume memory unnecessarily.
|
|
204
|
+
*
|
|
197
205
|
/** Public method: returns a frozen snapshot of the merged effective configuration */
|
|
198
206
|
getConfig(): Promise<Readonly<GridConfig<T>>>;
|
|
199
207
|
setColumnVisible(field: string, visible: boolean): boolean;
|
|
@@ -281,6 +289,8 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
281
289
|
* Register custom CSS styles to be injected into the grid's shadow DOM.
|
|
282
290
|
* Use this to style custom cell renderers, editors, or detail panels.
|
|
283
291
|
*
|
|
292
|
+
* Uses adoptedStyleSheets for efficiency - styles survive shadow DOM rebuilds.
|
|
293
|
+
*
|
|
284
294
|
* @param id - Unique identifier for the style block (for removal/updates)
|
|
285
295
|
* @param css - CSS string to inject
|
|
286
296
|
*
|
|
@@ -312,7 +322,7 @@ export declare class DataGridElement<T = any> extends HTMLElement implements Int
|
|
|
312
322
|
/**
|
|
313
323
|
* Re-parse light DOM column elements and refresh the grid.
|
|
314
324
|
* Call this after framework adapters have registered their templates.
|
|
315
|
-
*
|
|
325
|
+
* Uses the render scheduler to batch with other pending updates.
|
|
316
326
|
* @internal Used by framework integration libraries (Angular, React, Vue)
|
|
317
327
|
*/
|
|
318
328
|
refreshColumns(): void;
|
package/lib/core/grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../libs/grid/src/lib/core/grid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../../../libs/grid/src/lib/core/grid.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EACV,cAAc,EAGd,WAAW,EAEZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAEV,YAAY,EACZ,eAAe,EACf,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACb,MAAM,SAAS,CAAC;AAmDjB,qBAAa,eAAe,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,WAAY,YAAW,YAAY,CAAC,CAAC,CAAC;;IAElF,MAAM,CAAC,QAAQ,CAAC,OAAO,cAAc;IACrC,MAAM,CAAC,QAAQ,CAAC,OAAO,SAAsE;IAG7F;;;;OAIG;IACH,OAAO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KnD,sCAAsC;IACtC,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK1C,iDAAiD;IACjD,iBAAiB,IAAI,uBAAuB,EAAE;IAI9C,kEAAkE;IAClE,qBAAqB,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAI7D,wCAAwC;IACxC,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIhD,0CAA0C;IAC1C,iBAAiB,IAAI,iBAAiB,EAAE;IAIxC,yDAAyD;IACzD,qBAAqB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;IAIxD,0CAA0C;IAC1C,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI/C,6CAA6C;IAC7C,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;IAInE;;;OAGG;IACH,kBAAkB,IAAI,IAAI;IAsB1B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAa7C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAMlC;;OAEG;IACH,mBAAmB,IAAI,MAAM,EAAE;IA6E/B;;;;;OAKG;IACH,cAAc,IAAI,IAAI;IAuFtB;;;;OAIG;IACH,oBAAoB,CAAC,KAAK,UAAQ,GAAG,IAAI;CAwM1C;AAWD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,eAAe,CAAC;KAC7B;CACF"}
|
|
@@ -17,15 +17,6 @@ export declare function mergeColumns(programmatic: ColumnConfig[] | undefined, d
|
|
|
17
17
|
* without duplicating values. Falls back to string manipulation if `el.part` API isn't present.
|
|
18
18
|
*/
|
|
19
19
|
export declare function addPart(el: HTMLElement, token: string): void;
|
|
20
|
-
/**
|
|
21
|
-
* Resolve the effective column list for the grid by combining:
|
|
22
|
-
* 1. Programmatic columns (`grid._columns`)
|
|
23
|
-
* 2. Light DOM `<tbw-grid-column>` definitions (cached)
|
|
24
|
-
* 3. Inferred columns (if none provided)
|
|
25
|
-
* Also compiles inline template expressions into fast functions.
|
|
26
|
-
* Columns with `hidden: true` in config are added to hidden tracking.
|
|
27
|
-
*/
|
|
28
|
-
export declare function getColumnConfiguration(grid: InternalGrid): void;
|
|
29
20
|
/**
|
|
30
21
|
* Measure rendered header + visible cell content to assign initial pixel widths
|
|
31
22
|
* to columns when in `content` fit mode. Runs only once unless fit mode changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/columns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/columns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAmB,YAAY,EAAuB,MAAM,UAAU,CAAC;AAYjH;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,EAAE,CA0FxE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,YAAY,EAAE,YAAY,EAAE,GAAG,SAAS,EACxC,GAAG,EAAE,YAAY,EAAE,GAAG,SAAS,GAC9B,cAAc,EAAE,CA+DlB;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAS5D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CA4BxD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CA0BvD"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { BaseGridPlugin } from '../plugin';
|
|
2
|
+
import { ColumnConfig, ColumnConfigMap, ColumnInternal, FitMode, GridColumnState, GridConfig, HeaderContentDefinition, ToolbarButtonConfig, ToolPanelDefinition } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Callbacks for ConfigManager to notify the grid of changes.
|
|
5
|
+
*/
|
|
6
|
+
export interface ConfigManagerCallbacks<T> {
|
|
7
|
+
/** Get current rows for column inference */
|
|
8
|
+
getRows: () => T[];
|
|
9
|
+
/** Get current sort state */
|
|
10
|
+
getSortState: () => {
|
|
11
|
+
field: string;
|
|
12
|
+
direction: 1 | -1;
|
|
13
|
+
} | null;
|
|
14
|
+
/** Set sort state */
|
|
15
|
+
setSortState: (state: {
|
|
16
|
+
field: string;
|
|
17
|
+
direction: 1 | -1;
|
|
18
|
+
} | null) => void;
|
|
19
|
+
/** Notify that config changed and re-render is needed */
|
|
20
|
+
onConfigChange: () => void;
|
|
21
|
+
/** Emit a custom event */
|
|
22
|
+
emit: (eventName: string, detail: unknown) => void;
|
|
23
|
+
/** Clear row pool for visibility changes */
|
|
24
|
+
clearRowPool: () => void;
|
|
25
|
+
/** Run setup after state changes */
|
|
26
|
+
setup: () => void;
|
|
27
|
+
/** Render header */
|
|
28
|
+
renderHeader: () => void;
|
|
29
|
+
/** Update column template */
|
|
30
|
+
updateTemplate: () => void;
|
|
31
|
+
/** Refresh virtual window */
|
|
32
|
+
refreshVirtualWindow: () => void;
|
|
33
|
+
/** Get virtualization state for row height application */
|
|
34
|
+
getVirtualization: () => {
|
|
35
|
+
rowHeight: number;
|
|
36
|
+
};
|
|
37
|
+
/** Set row height on virtualization state */
|
|
38
|
+
setRowHeight: (height: number) => void;
|
|
39
|
+
/** Apply animation config to host element */
|
|
40
|
+
applyAnimationConfig: (config: GridConfig<T>) => void;
|
|
41
|
+
/** Get light DOM title from shell state (synced from parseLightDomShell) */
|
|
42
|
+
getShellLightDomTitle: () => string | null;
|
|
43
|
+
/** Get registered tool panels from shell state */
|
|
44
|
+
getShellToolPanels: () => Map<string, ToolPanelDefinition>;
|
|
45
|
+
/** Get registered header contents from shell state */
|
|
46
|
+
getShellHeaderContents: () => Map<string, HeaderContentDefinition>;
|
|
47
|
+
/** Get registered toolbar buttons from shell state */
|
|
48
|
+
getShellToolbarButtons: () => Map<string, ToolbarButtonConfig>;
|
|
49
|
+
/** Get light DOM header content elements */
|
|
50
|
+
getShellLightDomHeaderContent: () => HTMLElement[];
|
|
51
|
+
/** Get whether a tool buttons container was found in light DOM */
|
|
52
|
+
getShellHasToolButtonsContainer: () => boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* ConfigManager handles all configuration lifecycle for the grid.
|
|
56
|
+
*
|
|
57
|
+
* Manages:
|
|
58
|
+
* - Source collection (gridConfig, columns, attributes, Light DOM)
|
|
59
|
+
* - Effective config (merged from all sources)
|
|
60
|
+
* - State persistence (collectState, applyState, resetState)
|
|
61
|
+
* - Column visibility and ordering
|
|
62
|
+
*/
|
|
63
|
+
export declare class ConfigManager<T = unknown> {
|
|
64
|
+
#private;
|
|
65
|
+
constructor(callbacks: ConfigManagerCallbacks<T>);
|
|
66
|
+
/** Get the frozen original config (compiled from sources, immutable) */
|
|
67
|
+
get original(): GridConfig<T>;
|
|
68
|
+
/** Get the mutable effective config (current runtime state) */
|
|
69
|
+
get effective(): GridConfig<T>;
|
|
70
|
+
/** Get columns from effective config */
|
|
71
|
+
get columns(): ColumnInternal<T>[];
|
|
72
|
+
/** Set columns on effective config */
|
|
73
|
+
set columns(value: ColumnInternal<T>[]);
|
|
74
|
+
/** Get light DOM columns cache */
|
|
75
|
+
get lightDomColumnsCache(): ColumnInternal<T>[] | undefined;
|
|
76
|
+
/** Set light DOM columns cache */
|
|
77
|
+
set lightDomColumnsCache(value: ColumnInternal<T>[] | undefined);
|
|
78
|
+
/** Get original column nodes */
|
|
79
|
+
get originalColumnNodes(): HTMLElement[] | undefined;
|
|
80
|
+
/** Set original column nodes */
|
|
81
|
+
set originalColumnNodes(value: HTMLElement[] | undefined);
|
|
82
|
+
/** Get light DOM title */
|
|
83
|
+
get lightDomTitle(): string | undefined;
|
|
84
|
+
/** Set light DOM title */
|
|
85
|
+
set lightDomTitle(value: string | undefined);
|
|
86
|
+
/** Get initial column state */
|
|
87
|
+
get initialColumnState(): GridColumnState | undefined;
|
|
88
|
+
/** Set initial column state */
|
|
89
|
+
set initialColumnState(value: GridColumnState | undefined);
|
|
90
|
+
/**
|
|
91
|
+
* Check if sources have changed since last merge.
|
|
92
|
+
*/
|
|
93
|
+
get sourcesChanged(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Mark that sources have changed and need re-merging.
|
|
96
|
+
* Call this when external state (shell maps, etc.) that feeds into
|
|
97
|
+
* collectAllSources() has been updated.
|
|
98
|
+
*/
|
|
99
|
+
markSourcesChanged(): void;
|
|
100
|
+
/** Set gridConfig source */
|
|
101
|
+
setGridConfig(config: GridConfig<T> | undefined): void;
|
|
102
|
+
/** Get the raw gridConfig source */
|
|
103
|
+
getGridConfig(): GridConfig<T> | undefined;
|
|
104
|
+
/** Set columns source */
|
|
105
|
+
setColumns(columns: ColumnConfig<T>[] | ColumnConfigMap<T> | undefined): void;
|
|
106
|
+
/** Get the raw columns source */
|
|
107
|
+
getColumns(): ColumnConfig<T>[] | ColumnConfigMap<T> | undefined;
|
|
108
|
+
/** Set fitMode source */
|
|
109
|
+
setFitMode(mode: FitMode | undefined): void;
|
|
110
|
+
/** Get the raw fitMode source */
|
|
111
|
+
getFitMode(): FitMode | undefined;
|
|
112
|
+
/** Set editOn source */
|
|
113
|
+
setEditOn(editOn: string | boolean | undefined): void;
|
|
114
|
+
/** Get the raw editOn source */
|
|
115
|
+
getEditOn(): string | boolean | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Merge all sources into effective config.
|
|
118
|
+
* Also applies post-merge operations (rowHeight, fixed mode widths, animation).
|
|
119
|
+
*
|
|
120
|
+
* Called by RenderScheduler's mergeConfig phase.
|
|
121
|
+
*
|
|
122
|
+
* Two-layer architecture:
|
|
123
|
+
* 1. Sources → #originalConfig (frozen, immutable)
|
|
124
|
+
* 2. Clone → #effectiveConfig (mutable, runtime changes)
|
|
125
|
+
*
|
|
126
|
+
* When sources change, both layers are rebuilt.
|
|
127
|
+
* When sources haven't changed AND columns exist, this is a no-op.
|
|
128
|
+
* Runtime mutations only affect effectiveConfig.
|
|
129
|
+
* resetState() clones originalConfig back to effectiveConfig.
|
|
130
|
+
*/
|
|
131
|
+
merge(): void;
|
|
132
|
+
/**
|
|
133
|
+
* Collect current column state by diffing original vs effective.
|
|
134
|
+
* Returns only the changes from the original configuration.
|
|
135
|
+
*/
|
|
136
|
+
collectState(plugins: BaseGridPlugin[]): GridColumnState;
|
|
137
|
+
/**
|
|
138
|
+
* Apply column state to the grid.
|
|
139
|
+
*/
|
|
140
|
+
applyState(state: GridColumnState, plugins: BaseGridPlugin[]): void;
|
|
141
|
+
/**
|
|
142
|
+
* Reset state to original configuration.
|
|
143
|
+
*
|
|
144
|
+
* Two-layer architecture: Clones #originalConfig back to #effectiveConfig.
|
|
145
|
+
* This discards all runtime changes (hidden, width, order) and restores
|
|
146
|
+
* the state to what was compiled from sources.
|
|
147
|
+
*/
|
|
148
|
+
resetState(plugins: BaseGridPlugin[]): void;
|
|
149
|
+
/**
|
|
150
|
+
* Request a debounced state change event.
|
|
151
|
+
*/
|
|
152
|
+
requestStateChange(plugins: BaseGridPlugin[]): void;
|
|
153
|
+
/**
|
|
154
|
+
* Set the visibility of a column.
|
|
155
|
+
* @returns true if visibility changed, false otherwise
|
|
156
|
+
*/
|
|
157
|
+
setColumnVisible(field: string, visible: boolean): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Toggle column visibility.
|
|
160
|
+
*/
|
|
161
|
+
toggleColumnVisibility(field: string): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Check if a column is visible.
|
|
164
|
+
*/
|
|
165
|
+
isColumnVisible(field: string): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Show all columns.
|
|
168
|
+
*/
|
|
169
|
+
showAllColumns(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Get all columns with visibility info.
|
|
172
|
+
*/
|
|
173
|
+
getAllColumns(): Array<{
|
|
174
|
+
field: string;
|
|
175
|
+
header: string;
|
|
176
|
+
visible: boolean;
|
|
177
|
+
lockVisible?: boolean;
|
|
178
|
+
}>;
|
|
179
|
+
/**
|
|
180
|
+
* Get current column order.
|
|
181
|
+
*/
|
|
182
|
+
getColumnOrder(): string[];
|
|
183
|
+
/**
|
|
184
|
+
* Set column order.
|
|
185
|
+
*/
|
|
186
|
+
setColumnOrder(order: string[]): void;
|
|
187
|
+
/**
|
|
188
|
+
* Parse light DOM columns from host element.
|
|
189
|
+
*/
|
|
190
|
+
parseLightDomColumns(host: HTMLElement): void;
|
|
191
|
+
/**
|
|
192
|
+
* Clear the light DOM columns cache.
|
|
193
|
+
*/
|
|
194
|
+
clearLightDomCache(): void;
|
|
195
|
+
/**
|
|
196
|
+
* Register a handler for Light DOM element changes.
|
|
197
|
+
* When elements matching the tag name are added/removed/changed,
|
|
198
|
+
* the callback will be invoked (debounced).
|
|
199
|
+
*
|
|
200
|
+
* @param tagName - The lowercase tag name to watch (e.g., 'tbw-grid-header')
|
|
201
|
+
* @param callback - Called when matching elements change
|
|
202
|
+
*/
|
|
203
|
+
registerLightDomHandler(tagName: string, callback: () => void): void;
|
|
204
|
+
/**
|
|
205
|
+
* Unregister a Light DOM element handler.
|
|
206
|
+
*/
|
|
207
|
+
unregisterLightDomHandler(tagName: string): void;
|
|
208
|
+
/**
|
|
209
|
+
* Set up MutationObserver to watch for Light DOM changes.
|
|
210
|
+
* This is generic infrastructure - specific handling is done via registered handlers.
|
|
211
|
+
*
|
|
212
|
+
* When Light DOM elements are added/removed/changed, the observer:
|
|
213
|
+
* 1. Identifies which registered tag names were affected
|
|
214
|
+
* 2. Debounces multiple mutations into a single callback per handler
|
|
215
|
+
* 3. Invokes the registered callbacks
|
|
216
|
+
*
|
|
217
|
+
* This mechanism allows plugins to register their own Light DOM elements
|
|
218
|
+
* and handle parsing themselves, then hand config to ConfigManager.
|
|
219
|
+
*
|
|
220
|
+
* @param host - The host element to observe (the grid element)
|
|
221
|
+
*/
|
|
222
|
+
observeLightDOM(host: HTMLElement): void;
|
|
223
|
+
/**
|
|
224
|
+
* Register a change listener.
|
|
225
|
+
*/
|
|
226
|
+
onChange(callback: () => void): void;
|
|
227
|
+
/**
|
|
228
|
+
* Notify all change listeners.
|
|
229
|
+
*/
|
|
230
|
+
notifyChange(): void;
|
|
231
|
+
/**
|
|
232
|
+
* Dispose of the ConfigManager and clean up resources.
|
|
233
|
+
*/
|
|
234
|
+
dispose(): void;
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=config-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-manager.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/config-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,cAAc,EAGd,OAAO,EACP,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAQlB;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;IACnB,6BAA6B;IAC7B,YAAY,EAAE,MAAM;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IAChE,qBAAqB;IACrB,YAAY,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;KA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AAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IASlG;;OAEG;IACH,cAAc,IAAI,MAAM,EAAE;IAI1B;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IA8BrC;;OAEG;IACH,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAO7C;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAa1B;;;;;;;OAOG;IACH,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAIpE;;OAEG;IACH,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIhD;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA8DxC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAIpC;;OAEG;IACH,YAAY,IAAI,IAAI;IAUpB;;OAEG;IACH,OAAO,IAAI,IAAI;CAOhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-delegation.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/event-delegation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"event-delegation.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/event-delegation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA+B7C;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAe3G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/header.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/header.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,UAAU,CAAC;AAiBxE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CA2FrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/keyboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/keyboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,GAAG,IAAI,CAuH5E;AAED;;GAEG;AACH,UAAU,wBAAwB;IAChC,2DAA2D;IAC3D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,IAAI,CA2F9F"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized Render Scheduler for the Grid component.
|
|
3
|
+
*
|
|
4
|
+
* This scheduler batches all rendering work into a single requestAnimationFrame,
|
|
5
|
+
* eliminating race conditions between different parts of the grid (ResizeObserver,
|
|
6
|
+
* framework adapters, virtualization, etc.) that previously scheduled independent RAFs.
|
|
7
|
+
*
|
|
8
|
+
* ## Design Principles
|
|
9
|
+
*
|
|
10
|
+
* 1. **Single RAF per frame**: All render requests are batched into one RAF callback
|
|
11
|
+
* 2. **Phase-based execution**: Work is organized into ordered phases that run sequentially
|
|
12
|
+
* 3. **Highest-phase wins**: Multiple requests merge to the highest requested phase
|
|
13
|
+
* 4. **Framework-agnostic timing**: Eliminates need for "double RAF" hacks
|
|
14
|
+
*
|
|
15
|
+
* ## Render Phases (execute in order)
|
|
16
|
+
*
|
|
17
|
+
* - STYLE (1): Lightweight style/class updates, plugin afterRender hooks
|
|
18
|
+
* - VIRTUALIZATION (2): Virtual window recalculation (scroll, resize)
|
|
19
|
+
* - HEADER (3): Header re-render only
|
|
20
|
+
* - ROWS (4): Row model rebuild + header + template + virtual window
|
|
21
|
+
* - COLUMNS (5): Column processing + rows phase work
|
|
22
|
+
* - FULL (6): Complete render including config merge
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const scheduler = new RenderScheduler({
|
|
27
|
+
* mergeConfig: () => this.#mergeEffectiveConfig(),
|
|
28
|
+
* processColumns: () => this.#processColumns(),
|
|
29
|
+
* processRows: () => this.#rebuildRowModel(),
|
|
30
|
+
* renderHeader: () => renderHeader(this),
|
|
31
|
+
* updateTemplate: () => updateTemplate(this),
|
|
32
|
+
* renderVirtualWindow: () => this.refreshVirtualWindow(true),
|
|
33
|
+
* afterRender: () => this.#pluginManager?.afterRender(),
|
|
34
|
+
* isConnected: () => this.isConnected && this.#connected,
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Request a full render
|
|
38
|
+
* scheduler.requestPhase(RenderPhase.FULL, 'initial-setup');
|
|
39
|
+
*
|
|
40
|
+
* // Wait for render to complete
|
|
41
|
+
* await scheduler.whenReady();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Render phases in order of execution.
|
|
46
|
+
* Higher phases include all lower phase work.
|
|
47
|
+
*/
|
|
48
|
+
export declare enum RenderPhase {
|
|
49
|
+
/** Lightweight style updates only (plugin afterRender hooks) */
|
|
50
|
+
STYLE = 1,
|
|
51
|
+
/** Virtual window recalculation (includes STYLE) */
|
|
52
|
+
VIRTUALIZATION = 2,
|
|
53
|
+
/** Header re-render (includes VIRTUALIZATION) */
|
|
54
|
+
HEADER = 3,
|
|
55
|
+
/** Row model rebuild (includes HEADER) */
|
|
56
|
+
ROWS = 4,
|
|
57
|
+
/** Column processing (includes ROWS) */
|
|
58
|
+
COLUMNS = 5,
|
|
59
|
+
/** Full render including config merge (includes COLUMNS) */
|
|
60
|
+
FULL = 6
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
/**
|
|
64
|
+
* Callbacks that the scheduler invokes during flush.
|
|
65
|
+
* Each callback corresponds to work done in a specific phase.
|
|
66
|
+
*/
|
|
67
|
+
export interface RenderCallbacks {
|
|
68
|
+
/** Merge effective config (FULL phase) */
|
|
69
|
+
mergeConfig: () => void;
|
|
70
|
+
/** Process columns through plugins (COLUMNS phase) */
|
|
71
|
+
processColumns: () => void;
|
|
72
|
+
/** Rebuild row model through plugins (ROWS phase) */
|
|
73
|
+
processRows: () => void;
|
|
74
|
+
/** Render header DOM (HEADER phase) */
|
|
75
|
+
renderHeader: () => void;
|
|
76
|
+
/** Update CSS grid template (ROWS phase) */
|
|
77
|
+
updateTemplate: () => void;
|
|
78
|
+
/** Recalculate virtual window (VIRTUALIZATION phase) */
|
|
79
|
+
renderVirtualWindow: () => void;
|
|
80
|
+
/** Run plugin afterRender hooks (STYLE phase) */
|
|
81
|
+
afterRender: () => void;
|
|
82
|
+
/** Check if grid is still connected to DOM */
|
|
83
|
+
isConnected: () => boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Centralized render scheduler that batches all grid rendering into single RAF.
|
|
87
|
+
*/
|
|
88
|
+
export declare class RenderScheduler {
|
|
89
|
+
#private;
|
|
90
|
+
constructor(callbacks: RenderCallbacks);
|
|
91
|
+
/**
|
|
92
|
+
* Request a render at the specified phase.
|
|
93
|
+
* Multiple requests are batched - the highest phase wins.
|
|
94
|
+
*
|
|
95
|
+
* @param phase - The render phase to execute
|
|
96
|
+
* @param _source - Debug identifier for what triggered this request (unused, kept for API compatibility)
|
|
97
|
+
*/
|
|
98
|
+
requestPhase(phase: RenderPhase, _source: string): void;
|
|
99
|
+
/**
|
|
100
|
+
* Returns a promise that resolves when the current render cycle completes.
|
|
101
|
+
* If no render is pending, returns an already-resolved promise.
|
|
102
|
+
*/
|
|
103
|
+
whenReady(): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Set the initial ready resolver (called once on first render).
|
|
106
|
+
* This connects to the grid's `ready()` promise.
|
|
107
|
+
*/
|
|
108
|
+
setInitialReadyResolver(resolver: () => void): void;
|
|
109
|
+
/**
|
|
110
|
+
* Cancel any pending render.
|
|
111
|
+
* Useful for cleanup when component disconnects.
|
|
112
|
+
*/
|
|
113
|
+
cancel(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Check if a render is currently pending.
|
|
116
|
+
*/
|
|
117
|
+
get isPending(): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Get the current pending phase (0 if none).
|
|
120
|
+
*/
|
|
121
|
+
get pendingPhase(): RenderPhase | 0;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=render-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-scheduler.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/render-scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH;;;GAGG;AACH,oBAAY,WAAW;IACrB,gEAAgE;IAChE,KAAK,IAAI;IACT,oDAAoD;IACpD,cAAc,IAAI;IAClB,iDAAiD;IACjD,MAAM,IAAI;IACV,0CAA0C;IAC1C,IAAI,IAAI;IACR,wCAAwC;IACxC,OAAO,IAAI;IACX,4DAA4D;IAC5D,IAAI,IAAI;CACT;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,sDAAsD;IACtD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,qDAAqD;IACrD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,uCAAuC;IACvC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,4CAA4C;IAC5C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,wDAAwD;IACxD,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,iDAAiD;IACjD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,eAAe;;gBAiBd,SAAS,EAAE,eAAe;IAItC;;;;;;OAMG;IACH,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAavD;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAO1B;;;OAGG;IACH,uBAAuB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAInD;;;OAGG;IACH,MAAM,IAAI,IAAI;IAed;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,WAAW,GAAG,CAAC,CAElC;CAwFF"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { InternalGrid } from '../types';
|
|
2
2
|
/** Callback type for plugin row rendering hook */
|
|
3
3
|
export type RenderRowHook = (row: any, rowEl: HTMLElement, rowIndex: number) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* CSS selector for focusable editor elements within a cell.
|
|
6
|
+
* Used by EditingPlugin and keyboard navigation.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FOCUSABLE_EDITOR_SELECTOR = "input,select,textarea,[contenteditable=\"true\"],[contenteditable=\"\"],[tabindex]:not([tabindex=\"-1\"])";
|
|
4
9
|
/**
|
|
5
10
|
* Create a row element from template. Significantly faster than createElement + setAttribute.
|
|
6
11
|
*/
|
|
@@ -23,8 +28,8 @@ export declare function renderVisibleRows(grid: InternalGrid, start: number, end
|
|
|
23
28
|
*/
|
|
24
29
|
export declare function renderInlineRow(grid: InternalGrid, rowEl: HTMLElement, rowData: any, rowIndex: number): void;
|
|
25
30
|
/**
|
|
26
|
-
* Handle click / double click interaction to focus cells
|
|
27
|
-
*
|
|
31
|
+
* Handle click / double click interaction to focus cells.
|
|
32
|
+
* Edit triggering is handled by EditingPlugin via onCellClick hook.
|
|
28
33
|
*/
|
|
29
|
-
export declare function handleRowClick(grid: InternalGrid, e: MouseEvent, rowEl: HTMLElement,
|
|
34
|
+
export declare function handleRowClick(grid: InternalGrid, e: MouseEvent, rowEl: HTMLElement, _isDbl: boolean): void;
|
|
30
35
|
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,UAAU,CAAC;AAKjE,kDAAkD;AAClD,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;AAMxF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,8GACiE,CAAC;AA+CxG;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,cAAc,CAEtD;AAID;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAI5D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAwJN;AAwJD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAwK5G;AAED;;;GAGG;AAEH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CA+C3G"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EvalContext } from '../types';
|
|
1
|
+
import { CompiledViewFunction, EvalContext } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Escape a plain text string for safe insertion into HTML.
|
|
4
4
|
* Converts special HTML characters to their entity equivalents.
|
|
@@ -17,5 +17,5 @@ export declare function escapeHtml(text: string): string;
|
|
|
17
17
|
export declare function sanitizeHTML(html: string): string;
|
|
18
18
|
export declare function evalTemplateString(raw: string, ctx: EvalContext): string;
|
|
19
19
|
export declare function finalCellScrub(cell: HTMLElement): void;
|
|
20
|
-
export declare function compileTemplate(raw: string):
|
|
20
|
+
export declare function compileTemplate(raw: string): CompiledViewFunction<any>;
|
|
21
21
|
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/sanitize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../../libs/grid/src/lib/core/internal/sanitize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAUlE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ/C;AAgDD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYjD;AAiED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAgBxE;AAoCD,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAetD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,6BAS1C"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { HeaderContentDefinition, IconValue, ShellConfig, ToolbarButtonConfig, ToolbarButtonInfo, ToolPanelDefinition } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* State for managing shell UI.
|
|
4
|
+
*
|
|
5
|
+
* NOTE: This interface is being refactored. Config-like properties are moving
|
|
6
|
+
* to effectiveConfig.shell. Only runtime state should remain here.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Properties that are configuration (toolPanels, headerContents, etc.)
|
|
9
|
+
* are moving to ShellConfig in types.ts. Use ShellRuntimeState for new code.
|
|
4
10
|
*/
|
|
5
11
|
export interface ShellState {
|
|
6
12
|
/** Registered tool panels (from plugins + consumer API) */
|
|
@@ -30,14 +36,43 @@ export interface ShellState {
|
|
|
30
36
|
/** Cleanup functions for toolbar button render returns */
|
|
31
37
|
toolbarButtonCleanups: Map<string, () => void>;
|
|
32
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Runtime-only shell state (not configuration).
|
|
41
|
+
*
|
|
42
|
+
* Configuration (toolPanels, headerContents, toolbarButtons, title) lives in
|
|
43
|
+
* effectiveConfig.shell. This state holds runtime UI state and cleanup functions.
|
|
44
|
+
*/
|
|
45
|
+
export interface ShellRuntimeState {
|
|
46
|
+
/** Whether the tool panel sidebar is currently open */
|
|
47
|
+
isPanelOpen: boolean;
|
|
48
|
+
/** Which accordion sections are currently expanded (by panel ID) */
|
|
49
|
+
expandedSections: Set<string>;
|
|
50
|
+
/** Cleanup functions for header content render returns */
|
|
51
|
+
headerContentCleanups: Map<string, () => void>;
|
|
52
|
+
/** Cleanup functions for each panel section's render return */
|
|
53
|
+
panelCleanups: Map<string, () => void>;
|
|
54
|
+
/** Cleanup functions for toolbar button render returns */
|
|
55
|
+
toolbarButtonCleanups: Map<string, () => void>;
|
|
56
|
+
/** IDs of tool panels registered from light DOM (to avoid re-parsing) */
|
|
57
|
+
lightDomToolPanelIds: Set<string>;
|
|
58
|
+
/** IDs of tool panels registered via registerToolPanel API */
|
|
59
|
+
apiToolPanelIds: Set<string>;
|
|
60
|
+
/** Whether a <tbw-grid-tool-buttons> container was found in light DOM */
|
|
61
|
+
hasToolButtonsContainer: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create initial shell runtime state.
|
|
65
|
+
*/
|
|
66
|
+
export declare function createShellRuntimeState(): ShellRuntimeState;
|
|
33
67
|
/**
|
|
34
68
|
* Create initial shell state.
|
|
35
69
|
*/
|
|
36
70
|
export declare function createShellState(): ShellState;
|
|
37
71
|
/**
|
|
38
72
|
* Determine if shell header should be rendered.
|
|
73
|
+
* Reads only from effectiveConfig.shell (single source of truth).
|
|
39
74
|
*/
|
|
40
|
-
export declare function shouldRenderShellHeader(config: ShellConfig | undefined
|
|
75
|
+
export declare function shouldRenderShellHeader(config: ShellConfig | undefined): boolean;
|
|
41
76
|
/**
|
|
42
77
|
* Render the shell header HTML.
|
|
43
78
|
*
|
|
@@ -236,7 +271,10 @@ export declare const GRID_CONTENT_HTML = "\n <div class=\"tbw-scroll-area\">\n
|
|
|
236
271
|
* @param icons - Optional icons
|
|
237
272
|
* @returns Whether shell is active (for post-render setup)
|
|
238
273
|
*/
|
|
239
|
-
export declare function buildGridDOMIntoShadow(shadowRoot: ShadowRoot, shellConfig: ShellConfig | undefined,
|
|
274
|
+
export declare function buildGridDOMIntoShadow(shadowRoot: ShadowRoot, shellConfig: ShellConfig | undefined, runtimeState: {
|
|
275
|
+
isPanelOpen: boolean;
|
|
276
|
+
expandedSections: Set<string>;
|
|
277
|
+
}, icons?: {
|
|
240
278
|
toolPanel?: IconValue;
|
|
241
279
|
expand?: IconValue;
|
|
242
280
|
collapse?: IconValue;
|