@toolbox-web/grid-angular 2.2.0 → 2.3.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 +25 -55
- package/fesm2022/toolbox-web-grid-angular-features-editing.mjs +14 -4
- package/fesm2022/toolbox-web-grid-angular-features-editing.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-filtering.mjs +10 -30
- package/fesm2022/toolbox-web-grid-angular-features-filtering.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-shell.mjs +2 -3
- package/fesm2022/toolbox-web-grid-angular-features-shell.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular-features-tree.mjs +47 -14
- package/fesm2022/toolbox-web-grid-angular-features-tree.mjs.map +1 -1
- package/fesm2022/toolbox-web-grid-angular.mjs +7 -0
- package/fesm2022/toolbox-web-grid-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/types/toolbox-web-grid-angular-features-editing.d.ts +11 -3
- package/types/toolbox-web-grid-angular-features-editing.d.ts.map +1 -1
- package/types/toolbox-web-grid-angular-features-filtering.d.ts +6 -22
- package/types/toolbox-web-grid-angular-features-filtering.d.ts.map +1 -1
- package/types/toolbox-web-grid-angular-features-tree.d.ts +23 -4
- package/types/toolbox-web-grid-angular-features-tree.d.ts.map +1 -1
- package/types/toolbox-web-grid-angular.d.ts +7 -1
- package/types/toolbox-web-grid-angular.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbox-web-grid-angular.mjs","sources":["../../../../libs/grid-angular/src/lib/angular-column-config.ts","../../../../libs/grid-angular/src/lib/directives/grid-column-view.directive.ts","../../../../libs/grid-angular/src/lib/directives/structural-directives.ts","../../../../libs/grid-angular/src/lib/editor-mount-hooks.ts","../../../../libs/grid-angular/src/lib/editor-wiring.ts","../../../../libs/grid-angular/src/lib/grid-type-registry.ts","../../../../libs/grid-angular/src/lib/internal/feature-bridges.ts","../../../../libs/grid-angular/src/lib/internal/feature-extensions.ts","../../../../libs/grid-angular/src/lib/angular-grid-adapter.ts","../../../../libs/grid-angular/src/lib/grid-icon-registry.ts","../../../../libs/grid-angular/src/lib/inject-grid.ts","../../../../libs/grid-angular/src/lib/internal/feature-augmentations.ts","../../../../libs/grid-angular/src/lib/feature-registry.ts","../../../../libs/grid-angular/src/lib/directives/grid-column.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-header.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-tool-buttons.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-type.directive.ts","../../../../libs/grid-angular/src/lib/column-shorthand.ts","../../../../libs/grid-angular/src/lib/internal/feature-claims.ts","../../../../libs/grid-angular/src/lib/directives/row-diff.ts","../../../../libs/grid-angular/src/lib/directives/grid.directive.ts","../../../../libs/grid-angular/src/lib/grid-provider.ts","../../../../libs/grid-angular/src/index.ts","../../../../libs/grid-angular/src/toolbox-web-grid-angular.ts"],"sourcesContent":["/**\n * Angular-specific column configuration types.\n *\n * These types extend the base grid column config to allow Angular component\n * classes to be used directly as renderers and editors.\n */\nimport type { Type } from '@angular/core';\nimport type { ColumnConfig as BaseColumnConfig, GridConfig as BaseGridConfig, ColumnFieldKey } from '@toolbox-web/grid';\nimport type { FilterPanelParams, FilterPanelRenderer } from '@toolbox-web/grid/plugins/filtering';\n\n// #region CellRenderer Interface\n/**\n * Interface for cell renderer components.\n *\n * Renderer components receive the cell value, row data, and column config as inputs.\n * Use Angular signal inputs for reactive updates.\n *\n * @example\n * ```typescript\n * import { Component, input } from '@angular/core';\n * import type { CellRenderer } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-status-badge',\n * template: `<span [class]=\"'badge-' + value()\">{{ value() }}</span>`\n * })\n * export class StatusBadgeComponent implements CellRenderer<Employee, string> {\n * value = input.required<string>();\n * row = input.required<Employee>();\n * column = input<unknown>();\n * }\n * ```\n * @since 0.11.0\n */\nexport interface CellRenderer<TRow = unknown, TValue = unknown> {\n /** The cell value - use `input<TValue>()` or `input.required<TValue>()` */\n value: { (): TValue | undefined };\n /** The full row data - use `input<TRow>()` or `input.required<TRow>()` */\n row: { (): TRow | undefined };\n /** The column configuration (optional) - use `input<unknown>()` */\n column?: { (): unknown };\n}\n\n// #endregion\n\n// #region CellEditor Interface\n/**\n * Interface for cell editor components.\n *\n * Editor components receive the cell value, row data, and column config as inputs,\n * plus must emit `commit` and `cancel` outputs.\n *\n * @example\n * ```typescript\n * import { Component, input, output } from '@angular/core';\n * import type { CellEditor } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-status-editor',\n * template: `\n * <select [value]=\"value()\" (change)=\"commit.emit($any($event.target).value)\">\n * <option value=\"active\">Active</option>\n * <option value=\"inactive\">Inactive</option>\n * </select>\n * `\n * })\n * export class StatusEditorComponent implements CellEditor<Employee, string> {\n * value = input.required<string>();\n * row = input.required<Employee>();\n * column = input<unknown>();\n * commit = output<string>();\n * cancel = output<void>();\n * }\n * ```\n * @since 0.11.0\n */\nexport interface CellEditor<TRow = unknown, TValue = unknown> extends CellRenderer<TRow, TValue> {\n /** Emit to commit the new value - use `output<TValue>()` */\n commit: { emit(value: TValue): void; subscribe?(fn: (value: TValue) => void): { unsubscribe(): void } };\n /** Emit to cancel editing - use `output<void>()` */\n cancel: { emit(): void; subscribe?(fn: () => void): { unsubscribe(): void } };\n}\n\n// #endregion\n\n// #region FilterPanel Interface\n/**\n * Interface for filter panel components.\n *\n * Filter panel components receive the full `FilterPanelParams` as a single input,\n * providing access to field info, unique values, and filter action methods.\n *\n * @example\n * ```typescript\n * import { Component, input } from '@angular/core';\n * import type { FilterPanel } from '@toolbox-web/grid-angular';\n * import type { FilterPanelParams } from '@toolbox-web/grid/plugins/filtering';\n *\n * @Component({\n * selector: 'app-custom-filter',\n * template: `\n * <div>\n * <input (input)=\"onSearch($event)\" />\n * <button (click)=\"params().clearFilter()\">Clear</button>\n * </div>\n * `\n * })\n * export class CustomFilterComponent implements FilterPanel {\n * params = input.required<FilterPanelParams>();\n * }\n * ```\n * @since 0.12.0\n */\nexport interface FilterPanel {\n /** The filter panel parameters — use `input.required<FilterPanelParams>()` */\n params: { (): FilterPanelParams };\n}\n// #endregion\n\n// #region TypeDefault Interface\n/**\n * Type default configuration.\n *\n * Allows Angular component classes for renderers and editors in typeDefaults.\n *\n * @example\n * ```typescript\n * import type { GridConfig, TypeDefault } from '@toolbox-web/grid-angular';\n *\n * const config: GridConfig<Employee> = {\n * typeDefaults: {\n * boolean: {\n * renderer: (ctx) => { ... }, // vanilla JS renderer\n * editor: CheckboxEditorComponent, // Angular component\n * },\n * date: {\n * editor: DatePickerComponent, // Angular component\n * }\n * }\n * };\n * ```\n * @since 0.10.0\n */\nexport interface TypeDefault<TRow = unknown> {\n /** Format function for cell display */\n format?: (value: unknown, row: TRow) => string;\n /** Cell renderer - can be vanilla JS function or Angular component */\n renderer?: BaseColumnConfig<TRow>['renderer'] | Type<CellRenderer<TRow, unknown>>;\n /** Cell editor - can be vanilla JS function or Angular component */\n editor?: BaseColumnConfig<TRow>['editor'] | Type<CellEditor<TRow, unknown>>;\n /** Default editor parameters */\n editorParams?: Record<string, unknown>;\n /**\n * Custom filter panel renderer for this type. Requires FilteringPlugin.\n *\n * Can be:\n * - A vanilla `FilterPanelRenderer` function `(container, params) => void`\n * - An Angular component class implementing `FilterPanel`\n *\n * @example Using an Angular component\n * ```typescript\n * typeDefaults: {\n * date: {\n * filterPanelRenderer: DateFilterPanelComponent,\n * }\n * }\n * ```\n */\n filterPanelRenderer?: FilterPanelRenderer | Type<FilterPanel>;\n}\n\n// #endregion\n\n// #region ColumnConfig Interface\n/**\n * Column configuration for Angular applications.\n *\n * Extends the base ColumnConfig to allow Angular component classes\n * to be used directly as renderers and editors.\n *\n * @example\n * ```typescript\n * import type { ColumnConfig } from '@toolbox-web/grid-angular';\n * import { StatusBadgeComponent, StatusEditorComponent } from './components';\n *\n * const columns: ColumnConfig<Employee>[] = [\n * { field: 'name', header: 'Name' },\n * {\n * field: 'status',\n * header: 'Status',\n * editable: true,\n * renderer: StatusBadgeComponent,\n * editor: StatusEditorComponent,\n * },\n * ];\n * ```\n * @since 0.3.0\n */\nexport interface ColumnConfig<TRow = unknown, TField extends string = ColumnFieldKey<TRow>> extends Omit<\n BaseColumnConfig<TRow, TField>,\n 'renderer' | 'editor' | 'headerRenderer' | 'headerLabelRenderer'\n> {\n /**\n * Cell renderer - can be:\n * - A function `(ctx) => HTMLElement | string`\n * - An Angular component class implementing CellRenderer\n */\n renderer?: BaseColumnConfig<TRow>['renderer'] | Type<CellRenderer<TRow, unknown>>;\n\n /**\n * Cell editor - can be:\n * - A function `(ctx) => HTMLElement`\n * - An Angular component class implementing CellEditor\n */\n editor?: BaseColumnConfig<TRow>['editor'] | Type<CellEditor<TRow, unknown>>;\n\n /**\n * Header cell renderer - can be:\n * - A function `(ctx: HeaderCellContext) => Node | string | void | null`\n * - An Angular component class with column, value, sortState, filterActive, renderSortIcon, renderFilterButton inputs\n */\n headerRenderer?: BaseColumnConfig<TRow>['headerRenderer'] | Type<unknown>;\n\n /**\n * Header label renderer - can be:\n * - A function `(ctx: HeaderLabelContext) => Node | string | void | null`\n * - An Angular component class with column and value inputs\n */\n headerLabelRenderer?: BaseColumnConfig<TRow>['headerLabelRenderer'] | Type<unknown>;\n}\n\n// #endregion\n\n// #region GridConfig Interface\n/**\n * Grid configuration for Angular applications.\n *\n * Extends the base GridConfig to use Angular-augmented ColumnConfig and TypeDefault.\n * This allows component classes as renderers/editors.\n *\n * @example\n * ```typescript\n * import type { GridConfig, ColumnConfig } from '@toolbox-web/grid-angular';\n *\n * const config: GridConfig<Employee> = {\n * columns: [...],\n * plugins: [...],\n * };\n * ```\n * @since 0.3.0\n */\nexport interface GridConfig<TRow = unknown, TField extends string = ColumnFieldKey<TRow>> extends Omit<\n BaseGridConfig<TRow, TField>,\n 'columns' | 'typeDefaults' | 'loadingRenderer' | 'emptyRenderer'\n> {\n columns?: ColumnConfig<TRow, TField>[];\n /** Type-level defaults that can use Angular component classes */\n typeDefaults?: Record<string, TypeDefault<TRow>>;\n /**\n * Custom loading renderer - can be:\n * - A function `(ctx: LoadingContext) => HTMLElement | string`\n * - An Angular component class with a `size` input\n */\n loadingRenderer?: BaseGridConfig<TRow>['loadingRenderer'] | Type<unknown>;\n /**\n * Custom empty-state renderer shown when the grid has no rows and is not\n * loading. Can be:\n * - A function `(ctx: EmptyContext) => HTMLElement | string`\n * - An Angular component class with `sourceRowCount` and `filteredOut` inputs\n *\n * Set explicitly to `null` to suppress the built-in default message.\n */\n emptyRenderer?: BaseGridConfig<TRow>['emptyRenderer'] | Type<unknown>;\n}\n\n// #endregion\n\n// #region Utilities\n/**\n * Type guard to check if a value is an Angular component class.\n *\n * Detects Angular components by checking for internal Angular markers:\n * - ɵcmp (component definition)\n * - ɵfac (factory function)\n *\n * Also checks if it's an ES6 class (vs function) by inspecting the\n * string representation.\n * @since 0.3.0\n */\nexport function isComponentClass(value: unknown): value is Type<unknown> {\n if (typeof value !== 'function' || value.prototype === undefined) {\n return false;\n }\n\n // Check for Angular component markers (AOT compiled)\n if (Object.prototype.hasOwnProperty.call(value, 'ɵcmp') || Object.prototype.hasOwnProperty.call(value, 'ɵfac')) {\n return true;\n }\n\n // Check if it's an ES6 class (vs regular function)\n // Class definitions start with \"class\" in their toString()\n const fnString = Function.prototype.toString.call(value);\n return fnString.startsWith('class ') || fnString.startsWith('class{');\n}\n// #endregion\n","import { contentChild, Directive, effect, ElementRef, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context object passed to the cell renderer template.\n * Contains the cell value, row data, and column configuration.\n * @since 0.1.0\n */\nexport interface GridCellContext<TValue = unknown, TRow = unknown> {\n /** The cell value for this column */\n $implicit: TValue;\n /** The cell value (explicit binding) */\n value: TValue;\n /** The full row data object */\n row: TRow;\n /** The column configuration */\n column: unknown;\n}\n\n// Global registry mapping DOM elements to their templates\nconst templateRegistry = new Map<HTMLElement, TemplateRef<GridCellContext>>();\n\n/**\n * Gets the template registered for a given element.\n * Used by AngularGridAdapter to retrieve templates at render time.\n */\nexport function getViewTemplate(element: HTMLElement): TemplateRef<GridCellContext> | undefined {\n return templateRegistry.get(element);\n}\n\n/**\n * Directive that captures an `<ng-template>` for use as a cell renderer.\n *\n * This enables declarative Angular component usage with proper input bindings\n * that satisfy Angular's AOT compiler.\n *\n * ## Usage\n *\n * ```html\n * <tbw-grid-column field=\"status\">\n * <tbw-grid-column-view>\n * <ng-template let-value let-row=\"row\">\n * <app-status-badge [value]=\"value\" [row]=\"row\" />\n * </ng-template>\n * </tbw-grid-column-view>\n * </tbw-grid-column>\n * ```\n *\n * The template context provides:\n * - `$implicit` / `value`: The cell value\n * - `row`: The full row data object\n * - `column`: The column configuration\n *\n * Import the directive in your component:\n *\n * ```typescript\n * import { GridColumnView } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [GridColumnView],\n * // ...\n * })\n * ```\n *\n * @category Directive\n * @since 0.1.0\n */\n@Directive({ selector: 'tbw-grid-column-view' })\nexport class GridColumnView {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * Query for the ng-template content child.\n */\n template = contentChild(TemplateRef<GridCellContext>);\n\n /** Effect that triggers when the template is available */\n private onTemplateReceived = effect(() => {\n const template = this.template();\n if (template) {\n // Register the template for this element\n templateRegistry.set(this.elementRef.nativeElement, template);\n }\n });\n\n /**\n * Static type guard for template context.\n * Enables type inference in templates.\n */\n static ngTemplateContextGuard(dir: GridColumnView, ctx: unknown): ctx is GridCellContext {\n return true;\n }\n}\n","import { Directive, effect, ElementRef, inject, OnDestroy, TemplateRef } from '@angular/core';\nimport { getViewTemplate } from './grid-column-view.directive';\n\n/**\n * Context type for structural directives with `any` defaults.\n * This provides better ergonomics in templates without requiring explicit type annotations.\n *\n * @internal Use `GridCellContext` in application code for stricter typing.\n * @since 0.1.1\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface StructuralCellContext<TValue = any, TRow = any> {\n /** The cell value for this column */\n $implicit: TValue;\n /** The cell value (explicit binding) */\n value: TValue;\n /** The full row data object */\n row: TRow;\n /** The column configuration */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n column: any;\n}\n\n// Registry for structural view templates\nconst structuralViewRegistry = new Map<HTMLElement, TemplateRef<StructuralCellContext>>();\n\n/**\n * Gets the view template registered by the structural directive for a given column element.\n * Falls back to the non-structural directive registry.\n */\nexport function getStructuralViewTemplate(columnElement: HTMLElement): TemplateRef<StructuralCellContext> | undefined {\n // First check structural directive registry\n const template = structuralViewRegistry.get(columnElement);\n if (template) return template;\n\n // Fall back to the nested element registry\n const viewEl = columnElement.querySelector('tbw-grid-column-view');\n if (viewEl) {\n return getViewTemplate(viewEl as HTMLElement) as TemplateRef<StructuralCellContext> | undefined;\n }\n return undefined;\n}\n\n/**\n * Structural directive for cell view rendering.\n *\n * This provides a cleaner syntax for defining custom cell renderers without\n * the nested `<tbw-grid-column-view>` and `<ng-template>` boilerplate.\n *\n * ## Usage\n *\n * ```html\n * <!-- Instead of this verbose syntax: -->\n * <tbw-grid-column field=\"status\">\n * <tbw-grid-column-view>\n * <ng-template let-value let-row=\"row\">\n * <app-status-badge [value]=\"value\" />\n * </ng-template>\n * </tbw-grid-column-view>\n * </tbw-grid-column>\n *\n * <!-- Use this cleaner syntax: -->\n * <tbw-grid-column field=\"status\">\n * <app-status-badge *tbwRenderer=\"let value; row as row\" [value]=\"value\" />\n * </tbw-grid-column>\n * ```\n *\n * ## Template Context\n *\n * The structural directive provides the same context as `GridColumnView`:\n * - `$implicit` / `value`: The cell value (use `let value` or `let-value`)\n * - `row`: The full row data object (use `row as row` or `let-row=\"row\"`)\n * - `column`: The column configuration\n *\n * ## Import\n *\n * ```typescript\n * import { TbwRenderer } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [TbwRenderer],\n * // ...\n * })\n * ```\n *\n * @example\n * ```html\n * <tbw-grid-column field=\"status\">\n * <app-status-badge *tbwRenderer=\"let value; row as row\" [value]=\"value\" />\n * </tbw-grid-column>\n * ```\n *\n * @category Directive\n * @since 0.1.1\n */\n@Directive({ selector: '[tbwRenderer]' })\nexport class TbwRenderer implements OnDestroy {\n private template = inject(TemplateRef<StructuralCellContext>);\n private elementRef = inject(ElementRef<HTMLElement>);\n private columnElement: HTMLElement | null = null;\n\n constructor() {\n // Angular structural directives wrap the host element in a comment node.\n // We need to find the parent tbw-grid-column element.\n // Since we're injected into the template, we use an effect to register once the DOM is stable.\n effect(() => {\n this.registerTemplate();\n });\n }\n\n private registerTemplate(): void {\n // Find the parent tbw-grid-column or tbw-grid-type element\n // The template's host element may not be in the DOM yet, so we traverse from the comment node\n let parent = this.elementRef.nativeElement?.parentElement;\n while (parent && parent.tagName !== 'TBW-GRID-COLUMN' && parent.tagName !== 'TBW-GRID-TYPE') {\n parent = parent.parentElement;\n }\n\n if (parent) {\n this.columnElement = parent;\n structuralViewRegistry.set(parent, this.template);\n }\n }\n\n ngOnDestroy(): void {\n if (this.columnElement) {\n structuralViewRegistry.delete(this.columnElement);\n }\n }\n\n /**\n * Static type guard for template context.\n * Uses `any` defaults for ergonomic template usage.\n */\n static ngTemplateContextGuard(dir: TbwRenderer, ctx: unknown): ctx is StructuralCellContext {\n return true;\n }\n}\n","/**\n * Editor mount hook registry — append-only hooks called when an Angular-managed\n * editor host is mounted into the DOM with a known owner grid.\n *\n * This is the augmentation point that lets feature secondary entries\n * (e.g. `@toolbox-web/grid-angular/features/editing`) install per-editor\n * lifecycle behaviour (such as the `before-edit-close` blur bridge)\n * without coupling the central adapter file to the editing feature.\n * Mirrors React's and Vue's `editor-mount-hooks` and how core grid plugins\n * augment the grid via `registerPlugin()`.\n *\n * @packageDocumentation\n * @internal\n */\n\n/**\n * Hook called when an editor host is mounted. Returning a function\n * registers a teardown that runs when the editor is released.\n * @since 1.4.0\n */\nexport type EditorMountHook = (ctx: { container: HTMLElement; gridEl: HTMLElement }) => (() => void) | void;\n\nconst editorMountHooks: EditorMountHook[] = [];\n\n/**\n * Install an editor-mount hook. Called by feature secondary entries\n * (e.g. `features/editing`) on import.\n *\n * @internal Plugin API\n * @since 1.4.0\n */\nexport function registerEditorMountHook(hook: EditorMountHook): void {\n editorMountHooks.push(hook);\n}\n\n/**\n * Run all registered editor-mount hooks for a freshly mounted editor.\n * Returns a combined teardown that invokes each hook's teardown in\n * registration order.\n *\n * @internal Adapter use only.\n */\nexport function notifyEditorMounted(container: HTMLElement, gridEl: HTMLElement): () => void {\n const teardowns: Array<() => void> = [];\n for (const hook of editorMountHooks) {\n const teardown = hook({ container, gridEl });\n if (teardown) teardowns.push(teardown);\n }\n return () => {\n for (const teardown of teardowns) teardown();\n };\n}\n\n/**\n * Returns a function that, when invoked, blurs the focused input/textarea/select\n * inside `host` (if any). Used by the `before-edit-close` bridge installed by\n * `@toolbox-web/grid-angular/features/editing` so editors that commit on\n * `(blur)` flush their pending value before the cell DOM is torn down by Tab /\n * programmatic row exit.\n * @internal\n * @since 1.4.0\n */\nexport function makeFlushFocusedInput(host: HTMLElement): () => void {\n return () => {\n const focused = host.ownerDocument.activeElement as HTMLElement | null;\n if (\n focused &&\n host.contains(focused) &&\n (focused instanceof HTMLInputElement ||\n focused instanceof HTMLTextAreaElement ||\n focused instanceof HTMLSelectElement)\n ) {\n focused.blur();\n }\n };\n}\n","/**\n * Editor Wiring Helpers\n *\n * Pure functions for wiring up commit/cancel handlers on editor components.\n * Extracted from GridAdapter to enable unit testing without Angular DI.\n *\n * @internal\n */\n\n// #region subscribeToOutput\n\n/**\n * Subscribes to an Angular output on a component instance.\n * Works with both EventEmitter and OutputEmitterRef (signal outputs).\n *\n * @param instance - The component instance (as a plain record)\n * @param outputName - Name of the output property\n * @param callback - Callback to invoke when the output emits\n * @returns `true` if the output was found and subscribed, `false` otherwise\n * @internal\n */\nexport function subscribeToOutput<T>(\n instance: Record<string, unknown>,\n outputName: string,\n callback: (value: T) => void,\n): boolean {\n const output = instance[outputName];\n if (!output) return false;\n\n // Check if it's an Observable-like (EventEmitter or OutputEmitterRef)\n if (typeof (output as { subscribe?: unknown }).subscribe === 'function') {\n (output as { subscribe: (fn: (v: T) => void) => void }).subscribe(callback);\n return true;\n }\n return false;\n}\n\n// #endregion\n\n// #region wireEditorCallbacks\n\n/**\n * Wire up commit/cancel handlers for an editor component.\n *\n * Supports both Angular outputs and DOM CustomEvents. When both fire\n * (the BaseGridEditor pattern), a per-action flag prevents the callback\n * from running twice.\n *\n * @param hostElement - The host DOM element for the editor\n * @param instance - The component instance (as a plain record)\n * @param commit - Callback to invoke when committing a value\n * @param cancel - Callback to invoke when cancelling the edit\n * @internal\n */\nexport function wireEditorCallbacks<TValue>(\n hostElement: HTMLElement,\n instance: Record<string, unknown>,\n commit: (value: TValue) => void,\n cancel: () => void,\n): void {\n // Guard: when both Angular output AND DOM event fire (BaseGridEditor.commitValue\n // emits both), only the first should call commit/cancel(). The flags prevent\n // double-fires that cause redundant cell-commit events and extra dirty-tracking work.\n let commitHandledByOutput = false;\n let cancelHandledByOutput = false;\n\n subscribeToOutput(instance, 'commit', (value: TValue) => {\n commitHandledByOutput = true;\n commit(value);\n });\n subscribeToOutput(instance, 'cancel', () => {\n cancelHandledByOutput = true;\n cancel();\n });\n\n // Also listen for DOM CustomEvents as a fallback for editors that don't\n // have Angular commit/cancel outputs (e.g., third-party web components).\n hostElement.addEventListener('commit', (e: Event) => {\n e.stopPropagation();\n if (commitHandledByOutput) {\n // Already handled by the Angular output subscription — reset and skip.\n commitHandledByOutput = false;\n return;\n }\n const customEvent = e as CustomEvent<TValue>;\n commit(customEvent.detail);\n });\n hostElement.addEventListener('cancel', (e: Event) => {\n e.stopPropagation();\n if (cancelHandledByOutput) {\n cancelHandledByOutput = false;\n return;\n }\n cancel();\n });\n}\n\n// #endregion\n","/**\n * Type-level default registry for Angular applications.\n *\n * Provides application-wide type defaults for renderers and editors\n * that all grids inherit automatically.\n */\nimport {\n EnvironmentProviders,\n inject,\n Injectable,\n InjectionToken,\n makeEnvironmentProviders,\n Type,\n} from '@angular/core';\nimport type { TypeDefault } from '@toolbox-web/grid';\nimport type { FilterPanelRenderer } from '@toolbox-web/grid/plugins/filtering';\n\n/**\n * Type default registration configuration.\n * Uses Angular component types for renderers/editors.\n *\n * @example\n * ```typescript\n * const defaults: Record<string, TypeDefaultRegistration> = {\n * country: {\n * renderer: CountryCellComponent,\n * editor: CountryEditorComponent,\n * },\n * };\n * ```\n * @since 0.11.0\n */\nexport interface TypeDefaultRegistration<_TRow = unknown> {\n /** Angular component class for rendering cells of this type */\n renderer?: Type<any>;\n /** Angular component class for editing cells of this type */\n editor?: Type<any>;\n /** Default editorParams for this type */\n editorParams?: Record<string, unknown>;\n /**\n * Custom filter panel for this type.\n *\n * Accepts either:\n * - An Angular component class implementing `FilterPanel` (has a `params` signal input)\n * - A vanilla imperative function `(container, params) => void`\n */\n filterPanelRenderer?: FilterPanelRenderer | Type<any>;\n}\n\n/**\n * Injection token for providing type defaults at app level.\n * @since 0.3.0\n */\nexport const GRID_TYPE_DEFAULTS = new InjectionToken<Record<string, TypeDefaultRegistration>>('GRID_TYPE_DEFAULTS');\n\n/**\n * Injectable service for managing type-level defaults.\n *\n * Use `provideGridTypeDefaults()` in your app config to set up defaults,\n * or inject this service for dynamic registration.\n *\n * @example\n * ```typescript\n * // App-level setup (app.config.ts)\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridTypeDefaults({\n * country: {\n * renderer: CountryCellComponent,\n * editor: CountryEditorComponent\n * },\n * status: {\n * renderer: StatusBadgeComponent\n * }\n * })\n * ]\n * };\n *\n * // Dynamic registration\n * @Component({ ... })\n * export class AppComponent {\n * private registry = inject(GridTypeRegistry);\n *\n * ngOnInit() {\n * this.registry.register('currency', {\n * renderer: CurrencyCellComponent\n * });\n * }\n * }\n * ```\n * @since 0.3.0\n */\n@Injectable({ providedIn: 'root' })\nexport class GridTypeRegistry {\n private readonly defaults = new Map<string, TypeDefaultRegistration>();\n\n constructor() {\n // Merge any initial defaults from provider\n const initial = inject(GRID_TYPE_DEFAULTS, { optional: true });\n if (initial) {\n for (const [type, config] of Object.entries(initial)) {\n this.defaults.set(type, config);\n }\n }\n }\n\n /**\n * Register type-level defaults for a custom type.\n *\n * @param type - The type name (e.g., 'country', 'currency')\n * @param defaults - Renderer/editor configuration\n */\n register<T = unknown>(type: string, defaults: TypeDefaultRegistration<T>): void {\n this.defaults.set(type, defaults);\n }\n\n /**\n * Get type defaults for a given type.\n */\n get(type: string): TypeDefaultRegistration | undefined {\n return this.defaults.get(type);\n }\n\n /**\n * Remove type defaults for a type.\n */\n unregister(type: string): void {\n this.defaults.delete(type);\n }\n\n /**\n * Check if a type has registered defaults.\n */\n has(type: string): boolean {\n return this.defaults.has(type);\n }\n\n /**\n * Get all registered type names.\n */\n getRegisteredTypes(): string[] {\n return Array.from(this.defaults.keys());\n }\n\n /**\n * Convert to TypeDefault for use with grid's typeDefaults.\n * This is used internally by the adapter.\n *\n * @internal\n */\n getAsTypeDefault(type: string): TypeDefault | undefined {\n const config = this.defaults.get(type);\n if (!config) return undefined;\n\n // Note: The actual renderer/editor functions are created by the adapter\n // when it calls getTypeDefault() - we just return the config here\n return {\n editorParams: config.editorParams,\n // renderer and editor are handled by the adapter which creates\n // the actual functions that instantiate Angular components\n };\n }\n}\n\n/**\n * Provides application-level type defaults for all grids.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * import { provideGridTypeDefaults } from '@toolbox-web/grid-angular';\n * import { CountryCellComponent, StatusBadgeComponent } from './components';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridTypeDefaults({\n * country: { renderer: CountryCellComponent },\n * status: { renderer: StatusBadgeComponent },\n * date: { editor: DatePickerComponent }\n * })\n * ]\n * };\n * ```\n * @since 0.3.0\n */\nexport function provideGridTypeDefaults(defaults: Record<string, TypeDefaultRegistration>): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: GRID_TYPE_DEFAULTS, useValue: defaults }]);\n}\n","/**\n * Append-only bridge registries used by `@toolbox-web/grid-angular`.\n *\n * These let feature secondary entries plug into the central `GridAdapter`\n * without the adapter needing to know about them. Mirrors React's and Vue's\n * `register*Bridge` modules and how core grid plugins augment the grid via\n * `registerPlugin()`.\n *\n * This module is deliberately framework-free: it holds plain module-level\n * `let` state and never imports from `@angular/core` or from\n * `@toolbox-web/grid/plugins/...`. Feature subpaths import the setters via\n * the `@toolbox-web/grid-angular` package barrel (relative imports outside\n * a secondary entry's `rootDir` are forbidden by ng-packagr).\n *\n * @internal\n */\n\nimport type { TypeDefault as BaseTypeDefault, ColumnEditorSpec } from '@toolbox-web/grid';\nimport type { GridAdapter } from '../angular-grid-adapter';\n\n/**\n * Installer signature: given a grid element + adapter, returns the row-renderer\n * the adapter should expose, or undefined if no Angular template is registered\n * for that grid. Used by `features/master-detail` and `features/responsive`.\n * @internal\n * @since 1.4.0\n */\nexport type RowRendererBridge = <TRow = unknown>(\n gridElement: HTMLElement,\n adapter: GridAdapter,\n) => ((row: TRow, rowIndex: number) => HTMLElement) | undefined;\n\n/**\n * Installer signature for the type-default `filterPanelRenderer` wrapper.\n * Receives the user-supplied component class loosely typed as `unknown`\n * (so the adapter does not depend on filtering types) and returns the\n * imperative `(container, params) => void` form required by core.\n * @internal\n * @since 1.4.0\n */\nexport type FilterPanelTypeDefaultBridge = (\n rendererValue: unknown,\n adapter: GridAdapter,\n) => NonNullable<BaseTypeDefault['filterPanelRenderer']> | undefined;\n\n/**\n * Installer signature for the template-based cell editor. Given a column/editor\n * light-DOM element + adapter, returns the `ColumnEditorSpec` the grid should\n * use, or undefined if no Angular editor template (`*tbwEditor` /\n * `<tbw-grid-column-editor>`) is registered for that element. Installed by\n * `@toolbox-web/grid-angular/features/editing`; without it, template-based\n * editors are not resolved (component-class editors are unaffected).\n * @internal\n * @since 3.0.0\n */\nexport type EditorSpecBridge = <TRow = unknown, TValue = unknown>(\n element: HTMLElement,\n adapter: GridAdapter,\n) => ColumnEditorSpec<TRow, TValue> | undefined;\n\n/**\n * Installer signature for the tool-panel renderer. Given a tool-panel\n * light-DOM element + adapter, returns the imperative renderer the grid should\n * use, or undefined if no Angular tool-panel template is registered. Installed\n * by `@toolbox-web/grid-angular/features/shell`.\n * @internal\n * @since 3.0.0\n */\nexport type ToolPanelRendererBridge = (\n element: HTMLElement,\n adapter: GridAdapter,\n) => ((container: HTMLElement) => void | (() => void)) | undefined;\n\nlet detailRendererBridge: RowRendererBridge | null = null;\nlet responsiveCardRendererBridge: RowRendererBridge | null = null;\nlet filterPanelTypeDefaultBridge: FilterPanelTypeDefaultBridge | null = null;\nlet editorSpecBridge: EditorSpecBridge | null = null;\nlet toolPanelRendererBridge: ToolPanelRendererBridge | null = null;\n\n/**\n * Install the master-detail row-renderer bridge. Called once on import by\n * `@toolbox-web/grid-angular/features/master-detail`.\n * @internal Plugin API\n * @since 1.4.0\n */\nexport function registerDetailRendererBridge(bridge: RowRendererBridge): void {\n detailRendererBridge = bridge;\n}\n\n/**\n * Install the responsive-card row-renderer bridge. Called once on import by\n * `@toolbox-web/grid-angular/features/responsive`.\n * @internal Plugin API\n * @since 1.4.0\n */\nexport function registerResponsiveCardRendererBridge(bridge: RowRendererBridge): void {\n responsiveCardRendererBridge = bridge;\n}\n\n/**\n * Install the type-default `filterPanelRenderer` wrapper. Called once on import\n * by `@toolbox-web/grid-angular/features/filtering`. Without this bridge,\n * type-default and grid-config-level component-class filterPanelRenderers are\n * silently dropped — same precondition as the FilteringPlugin (TBW031).\n * @internal Plugin API\n * @since 1.4.0\n */\nexport function registerFilterPanelTypeDefaultBridge(bridge: FilterPanelTypeDefaultBridge): void {\n filterPanelTypeDefaultBridge = bridge;\n}\n\n/** @internal Adapter use only. */\nexport function getDetailRendererBridge(): RowRendererBridge | null {\n return detailRendererBridge;\n}\n\n/** @internal Adapter use only. */\nexport function getResponsiveCardRendererBridge(): RowRendererBridge | null {\n return responsiveCardRendererBridge;\n}\n\n/** @internal Adapter use only. */\nexport function getFilterPanelTypeDefaultBridge(): FilterPanelTypeDefaultBridge | null {\n return filterPanelTypeDefaultBridge;\n}\n\n/**\n * Install the template-based editor bridge. Called once on import by\n * `@toolbox-web/grid-angular/features/editing`.\n * @internal Plugin API\n * @since 3.0.0\n */\nexport function registerEditorSpecBridge(bridge: EditorSpecBridge): void {\n editorSpecBridge = bridge;\n}\n\n/** @internal Adapter use only. */\nexport function getEditorSpecBridge(): EditorSpecBridge | null {\n return editorSpecBridge;\n}\n\n/**\n * Install the tool-panel renderer bridge. Called once on import by\n * `@toolbox-web/grid-angular/features/shell`.\n * @internal Plugin API\n * @since 3.0.0\n */\nexport function registerToolPanelRendererBridge(bridge: ToolPanelRendererBridge): void {\n toolPanelRendererBridge = bridge;\n}\n\n/** @internal Adapter use only. */\nexport function getToolPanelRendererBridge(): ToolPanelRendererBridge | null {\n return toolPanelRendererBridge;\n}\n","/**\n * Internal registries used by `@toolbox-web/grid-angular`.\n *\n * Two extension points are exposed so individual feature secondary entries\n * (e.g. `@toolbox-web/grid-angular/features/master-detail`) can plug into\n * the core `Grid` directive without the directive needing to know about them.\n *\n * - {@link registerTemplateBridge} — runs in `ngAfterContentInit` once Angular\n * templates inside the grid have been registered. Used to discover light-DOM\n * slot elements (`<tbw-grid-detail>`, `<tbw-grid-responsive-card>`, …) and\n * wire them to the corresponding plugin's renderer setter.\n * - {@link registerFeatureConfigPreprocessor} — runs inside the directive's\n * feature-plugin builder before `createPluginFromFeature` is called. Lets a\n * feature transform its config object (e.g. to convert Angular component\n * classes embedded in `customPanels` to renderer functions).\n *\n * Both registries are append-only and module-scoped: they are populated by\n * side-effect imports of feature secondary entries and consumed by the core\n * `Grid` directive. Order is insertion order.\n *\n * @internal — public for cross-entry-point use; not part of the supported API.\n */\n\nimport type { GridAdapter } from '../angular-grid-adapter';\nimport type { FeatureName } from '../feature-registry';\n\n/**\n * Context passed to template bridges.\n *\n * @internal\n * @since 1.4.0\n */\nexport interface TemplateBridgeContext {\n /** The `<tbw-grid>` element this directive is attached to. */\n grid: HTMLElement;\n /** The Angular `GridAdapter` instance for this grid. */\n adapter: GridAdapter;\n}\n\n/**\n * A template bridge runs once per grid in `ngAfterContentInit`, after the\n * grid has refreshed its columns and Angular content templates have been\n * registered. Bridges may be async; the directive does not await them\n * sequentially — they run concurrently.\n *\n * @internal\n * @since 1.4.0\n */\nexport type TemplateBridge = (ctx: TemplateBridgeContext) => void | Promise<void>;\n\nconst templateBridges: TemplateBridge[] = [];\n\n/**\n * Register a template bridge. Called by feature secondary entries at module\n * load (e.g. `import '@toolbox-web/grid-angular/features/master-detail'`).\n *\n * Bridges are append-only and never deduplicated; calling registration twice\n * for the same feature module is safe because module imports are deduplicated\n * by the JS loader.\n *\n * @internal\n * @since 1.4.0\n */\nexport function registerTemplateBridge(bridge: TemplateBridge): void {\n templateBridges.push(bridge);\n}\n\n/**\n * Run all registered template bridges for a grid. The directive calls this\n * from `ngAfterContentInit` after `refreshColumns()`. Bridges run concurrently;\n * errors thrown by one bridge do not stop the others.\n *\n * @internal\n * @since 1.4.0\n */\nexport function runTemplateBridges(ctx: TemplateBridgeContext): void {\n for (const bridge of templateBridges) {\n try {\n const result = bridge(ctx);\n if (result && typeof (result as Promise<void>).catch === 'function') {\n (result as Promise<void>).catch((err) => {\n console.error('[tbw-grid-angular] template bridge threw:', err);\n });\n }\n } catch (err) {\n console.error('[tbw-grid-angular] template bridge threw:', err);\n }\n }\n}\n\n/**\n * A feature config preprocessor receives the user-supplied config for a\n * specific feature input and returns a transformed config that the core\n * plugin factory can consume. Used to bridge Angular component classes\n * embedded in feature configs (e.g. `customPanels`, `groupHeaderRenderer`)\n * to plain renderer functions.\n *\n * Receives the typed config and the directive's adapter. Returning the same\n * reference is fine — preprocessors typically clone-and-augment.\n *\n * @internal\n * @since 1.4.0\n */\nexport type FeatureConfigPreprocessor = (config: unknown, adapter: GridAdapter) => unknown;\n\nconst featureConfigPreprocessors = new Map<FeatureName, FeatureConfigPreprocessor>();\n\n/**\n * Register a feature config preprocessor. Last registration wins (subsequent\n * imports of the same feature module re-register the same function, which is\n * a no-op).\n *\n * @internal\n * @since 1.4.0\n */\nexport function registerFeatureConfigPreprocessor(name: FeatureName, fn: FeatureConfigPreprocessor): void {\n featureConfigPreprocessors.set(name, fn);\n}\n\n/**\n * Look up the preprocessor for a feature, if any.\n *\n * @internal\n * @since 1.4.0\n */\nexport function getFeatureConfigPreprocessor(name: FeatureName): FeatureConfigPreprocessor | undefined {\n return featureConfigPreprocessors.get(name);\n}\n","import {\n ApplicationRef,\n ComponentRef,\n createComponent,\n EmbeddedViewRef,\n EnvironmentInjector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport type {\n ColumnConfig as BaseColumnConfig,\n GridConfig as BaseGridConfig,\n TypeDefault as BaseTypeDefault,\n CellRenderContext,\n ColumnEditorContext,\n ColumnEditorSpec,\n ColumnViewRenderer,\n EmptyContext,\n FrameworkAdapter,\n HeaderCellContext,\n HeaderLabelContext,\n LoadingContext,\n} from '@toolbox-web/grid';\nimport { isComponentClass, type ColumnConfig, type GridConfig, type TypeDefault } from './angular-column-config';\nimport { getViewTemplate, GridCellContext } from './directives/grid-column-view.directive';\nimport { getStructuralViewTemplate } from './directives/structural-directives';\nimport { notifyEditorMounted, registerEditorMountHook, type EditorMountHook } from './editor-mount-hooks';\nimport { wireEditorCallbacks } from './editor-wiring';\nimport type { FeatureName } from './feature-registry';\nimport { GridTypeRegistry } from './grid-type-registry';\nimport {\n getDetailRendererBridge,\n getEditorSpecBridge,\n getFilterPanelTypeDefaultBridge,\n getResponsiveCardRendererBridge,\n getToolPanelRendererBridge,\n} from './internal/feature-bridges';\nimport { getFeatureConfigPreprocessor } from './internal/feature-extensions';\n\n// Re-export so feature secondary entries can install editor-mount hooks via\n// `import { registerEditorMountHook } from '@toolbox-web/grid-angular'`.\nexport { makeFlushFocusedInput } from './editor-mount-hooks';\nexport {\n registerDetailRendererBridge,\n registerEditorSpecBridge,\n registerFilterPanelTypeDefaultBridge,\n registerResponsiveCardRendererBridge,\n registerToolPanelRendererBridge,\n} from './internal/feature-bridges';\nexport type {\n EditorSpecBridge,\n FilterPanelTypeDefaultBridge,\n RowRendererBridge,\n ToolPanelRendererBridge,\n} from './internal/feature-bridges';\nexport { registerEditorMountHook, type EditorMountHook };\n\n// #region Feature bridge registries\n// (Storage lives in `./internal/feature-bridges` so feature subpaths can\n// install bridges without pulling Angular runtime into specs that mock\n// `@angular/core` — see filtering feature spec.)\n// #endregion\n\n/**\n * Helper to get view template from either structural directive or nested directive.\n */\nfunction getAnyViewTemplate(element: HTMLElement): TemplateRef<GridCellContext> | undefined {\n // First check structural directive registry (for *tbwRenderer syntax)\n const structuralTemplate = getStructuralViewTemplate(element);\n if (structuralTemplate) return structuralTemplate as unknown as TemplateRef<GridCellContext>;\n\n // Fall back to nested directive (for <tbw-grid-column-view> syntax)\n return getViewTemplate(element);\n}\n\n/**\n * Framework adapter that enables zero-boilerplate integration of Angular components\n * with the grid's light DOM configuration API.\n *\n * ## Usage\n *\n * **One-time setup in your app:**\n * ```typescript\n * import { Component, inject, EnvironmentInjector, ApplicationRef, ViewContainerRef } from '@angular/core';\n * import { GridElement } from '@toolbox-web/grid';\n * import { GridAdapter } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-root',\n * // ...\n * })\n * export class AppComponent {\n * constructor() {\n * const injector = inject(EnvironmentInjector);\n * const appRef = inject(ApplicationRef);\n * const viewContainerRef = inject(ViewContainerRef);\n * GridElement.registerAdapter(new GridAdapter(injector, appRef, viewContainerRef));\n * }\n * }\n * ```\n *\n * **Declarative configuration in templates (structural directive - recommended):**\n * ```html\n * <tbw-grid>\n * <tbw-grid-column field=\"status\">\n * <app-status-badge *tbwRenderer=\"let value; row as row\" [value]=\"value\" />\n * <app-status-editor *tbwEditor=\"let value\" [value]=\"value\" />\n * </tbw-grid-column>\n * </tbw-grid>\n * ```\n *\n * **Declarative configuration in templates (nested directive - legacy):**\n * ```html\n * <tbw-grid>\n * <tbw-grid-column field=\"status\">\n * <tbw-grid-column-view>\n * <ng-template let-value let-row=\"row\">\n * <app-status-badge [value]=\"value\" [row]=\"row\" />\n * </ng-template>\n * </tbw-grid-column-view>\n * <tbw-grid-column-editor>\n * <ng-template let-value let-onCommit=\"onCommit\" let-onCancel=\"onCancel\">\n * <app-status-select [value]=\"value\" (commit)=\"onCommit($event)\" (cancel)=\"onCancel()\" />\n * </ng-template>\n * </tbw-grid-column-editor>\n * </tbw-grid-column>\n * </tbw-grid>\n * ```\n *\n * The adapter automatically:\n * - Detects Angular templates registered by directives (both structural and nested)\n * - Creates embedded views with cell context (value, row, column)\n * - Handles editor callbacks (onCommit/onCancel)\n * - Manages view lifecycle and change detection\n */\n\n/**\n * Synchronize an embedded view's rootNodes into a stable container element.\n *\n * Angular's control flow blocks (@if, @for, @switch) can dynamically add or\n * remove rootNodes during `detectChanges()`. This helper ensures the container\n * always reflects the current set of rootNodes, preventing orphaned or stale\n * nodes when the template's DOM structure changes between renders.\n */\nfunction syncRootNodes(viewRef: EmbeddedViewRef<unknown>, container: HTMLElement): void {\n // Fast path: if the container already holds exactly the right nodes, skip DOM mutations.\n const rootNodes: Node[] = viewRef.rootNodes;\n const children = container.childNodes;\n\n let needsSync = children.length !== rootNodes.length;\n if (!needsSync) {\n for (let i = 0; i < rootNodes.length; i++) {\n if (children[i] !== rootNodes[i]) {\n needsSync = true;\n break;\n }\n }\n }\n\n if (needsSync) {\n // Clear and re-append. replaceChildren is efficient (single reflow).\n container.replaceChildren(...rootNodes);\n }\n}\n\n/** @since 0.11.0 */\nexport class GridAdapter implements FrameworkAdapter {\n private viewRefs: EmbeddedViewRef<unknown>[] = [];\n private componentRefs: ComponentRef<unknown>[] = [];\n /** Editor-specific view refs tracked separately for per-cell cleanup via releaseCell. */\n private editorViewRefs: EmbeddedViewRef<unknown>[] = [];\n /** Editor-specific component refs tracked separately for per-cell cleanup via releaseCell. */\n private editorComponentRefs: ComponentRef<unknown>[] = [];\n /**\n * Per-editor mount-hook teardown functions, keyed by editor host element.\n *\n * Populated by {@link runEditorMountHooks} (which invokes\n * {@link notifyEditorMounted}) and torn down per-cell from\n * {@link releaseCell}, with full sweep on {@link destroy}. The actual\n * lifecycle behaviour is supplied by feature secondary entries (e.g.\n * `@toolbox-web/grid-angular/features/editing` installs the\n * `before-edit-close` blur bridge).\n */\n private editorMountTeardowns: Map<HTMLElement, () => void> = new Map();\n private typeRegistry: GridTypeRegistry | null = null;\n\n constructor(\n private injector: EnvironmentInjector,\n private appRef: ApplicationRef,\n private viewContainerRef: ViewContainerRef,\n ) {\n // Register globally for directive access\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).__ANGULAR_GRID_ADAPTER__ = this;\n\n // Try to get the type registry from the injector\n try {\n this.typeRegistry = this.injector.get(GridTypeRegistry, null);\n } catch {\n // GridTypeRegistry not available - type defaults won't be resolved\n }\n }\n\n /**\n * Processes an Angular grid configuration, converting component class references\n * to actual renderer/editor functions.\n *\n * Call this method on your gridConfig before passing it to the grid.\n *\n * @example\n * ```typescript\n * import { GridAdapter, type GridConfig } from '@toolbox-web/grid-angular';\n *\n * const config: GridConfig<Employee> = {\n * columns: [\n * { field: 'status', renderer: StatusBadgeComponent, editor: StatusEditorComponent },\n * ],\n * };\n *\n * // In component\n * constructor() {\n * const adapter = inject(GridAdapter); // or create new instance\n * this.processedConfig = adapter.processGridConfig(config);\n * }\n * ```\n *\n * @param config - Angular grid configuration with possible component class references\n * @returns Processed GridConfig with actual renderer/editor functions\n */\n processGridConfig<TRow = unknown>(config: GridConfig<TRow>): BaseGridConfig<TRow> {\n return this.processConfig(config as BaseGridConfig<TRow>);\n }\n\n /**\n * FrameworkAdapter.processConfig implementation.\n * Called automatically by the grid's `set gridConfig` setter.\n */\n processConfig<TRow = unknown>(config: BaseGridConfig<TRow>): BaseGridConfig<TRow> {\n // Cast to Angular's extended GridConfig since the config may contain\n // Angular component classes as renderers/editors at runtime\n const angularConfig = config as unknown as GridConfig<TRow>;\n const result = { ...angularConfig };\n\n // Process columns\n if (angularConfig.columns) {\n result.columns = angularConfig.columns.map((col) => this.processColumn(col));\n }\n\n // Process typeDefaults - convert Angular component classes to renderer/editor functions\n if (angularConfig.typeDefaults) {\n result.typeDefaults = this.processTypeDefaults(angularConfig.typeDefaults) as typeof angularConfig.typeDefaults;\n }\n\n // Process feature configs - bridge Angular component classes embedded in\n // `gridConfig.features.<name>` (e.g. `groupingColumns.groupHeaderRenderer`,\n // per-group `renderer`) to plain renderer functions via the per-feature\n // preprocessors registered by the feature secondary entries. Without this,\n // component-class renderers supplied through `gridConfig.features` reach the\n // core plugin factory raw and are invoked without `new` at render time.\n // (The directive-input path bridges these in `createFeaturePlugins`; this\n // covers the equivalent `gridConfig.features` path.)\n if (angularConfig.features && typeof angularConfig.features === 'object') {\n const features = angularConfig.features as Record<string, unknown>;\n const processedFeatures: Record<string, unknown> = { ...features };\n let featuresChanged = false;\n for (const [name, featureConfig] of Object.entries(features)) {\n if (!featureConfig || typeof featureConfig !== 'object') continue;\n const preprocess = getFeatureConfigPreprocessor(name as FeatureName);\n if (!preprocess) continue;\n const processedFeature = preprocess(featureConfig, this);\n if (processedFeature !== featureConfig) {\n processedFeatures[name] = processedFeature;\n featuresChanged = true;\n }\n }\n if (featuresChanged) {\n (result as { features?: unknown }).features = processedFeatures;\n }\n }\n\n // Process loadingRenderer - convert Angular component class to function\n if (angularConfig.loadingRenderer && isComponentClass(angularConfig.loadingRenderer)) {\n (result as BaseGridConfig<TRow>).loadingRenderer = this.createComponentLoadingRenderer(\n angularConfig.loadingRenderer,\n ) as unknown as BaseGridConfig<TRow>['loadingRenderer'];\n }\n\n // Process emptyRenderer - convert Angular component class to function.\n // `null` is a valid opt-out value (suppresses the built-in default message);\n // non-component values (vanilla functions, null) are forwarded unchanged.\n if (angularConfig.emptyRenderer && isComponentClass(angularConfig.emptyRenderer)) {\n (result as BaseGridConfig<TRow>).emptyRenderer = this.createComponentEmptyRenderer(\n angularConfig.emptyRenderer,\n ) as unknown as BaseGridConfig<TRow>['emptyRenderer'];\n }\n\n return result as BaseGridConfig<TRow>;\n }\n\n /**\n * Processes typeDefaults configuration, converting component class references\n * to actual renderer/editor functions.\n *\n * @param typeDefaults - Angular type defaults with possible component class references\n * @returns Processed TypeDefault record\n */\n processTypeDefaults<TRow = unknown>(\n typeDefaults: Record<string, TypeDefault<TRow>>,\n ): Record<string, BaseTypeDefault<TRow>> {\n const processed: Record<string, BaseTypeDefault<TRow>> = {};\n\n for (const [type, config] of Object.entries(typeDefaults)) {\n const processedConfig: BaseTypeDefault<TRow> = { ...config } as BaseTypeDefault<TRow>;\n\n // Convert renderer component class to function\n if (config.renderer && isComponentClass(config.renderer)) {\n processedConfig.renderer = this.createComponentRenderer(config.renderer);\n }\n\n // Convert editor component class to function\n if (config.editor && isComponentClass(config.editor)) {\n (processedConfig as any).editor = this.createComponentEditor(config.editor);\n }\n\n // Convert filterPanelRenderer component class to function via the\n // filtering feature bridge. Without `@toolbox-web/grid-angular/features/filtering`\n // imported, component-class filterPanelRenderers are dropped silently.\n if (config.filterPanelRenderer && isComponentClass(config.filterPanelRenderer)) {\n const wrapped = getFilterPanelTypeDefaultBridge()?.(config.filterPanelRenderer, this);\n if (wrapped) processedConfig.filterPanelRenderer = wrapped;\n }\n\n processed[type] = processedConfig;\n }\n\n return processed;\n }\n\n /**\n * Processes a single column configuration, converting component class references\n * to actual renderer/editor functions.\n *\n * @param column - Angular column configuration\n * @returns Processed ColumnConfig\n */\n processColumn<TRow = unknown>(column: ColumnConfig<TRow>): BaseColumnConfig<TRow> {\n const processed = { ...column } as BaseColumnConfig<TRow>;\n\n // Convert renderer component class to function\n if (column.renderer && isComponentClass(column.renderer)) {\n processed.renderer = this.createComponentRenderer(column.renderer);\n }\n\n // Convert editor component class to function\n if (column.editor && isComponentClass(column.editor)) {\n processed.editor = this.createComponentEditor(column.editor);\n }\n\n // Convert headerRenderer component class to function\n if (column.headerRenderer && isComponentClass(column.headerRenderer)) {\n processed.headerRenderer = this.createComponentHeaderRenderer(column.headerRenderer) as any;\n }\n\n // Convert headerLabelRenderer component class to function\n if (column.headerLabelRenderer && isComponentClass(column.headerLabelRenderer)) {\n processed.headerLabelRenderer = this.createComponentHeaderLabelRenderer(column.headerLabelRenderer) as any;\n }\n\n return processed;\n }\n\n /**\n * Determines if this adapter can handle the given element.\n * Checks if a template is registered for this element (structural or nested\n * view template, or a template-based editor resolved by the editing feature).\n */\n canHandle(element: HTMLElement): boolean {\n return getAnyViewTemplate(element) !== undefined || getEditorSpecBridge()?.(element, this) !== undefined;\n }\n\n /**\n * Creates a view renderer function that creates an embedded view\n * from the registered template and returns its DOM element.\n *\n * Returns undefined if no template is registered for this element,\n * allowing the grid to use its default rendering.\n */\n createRenderer<TRow = unknown, TValue = unknown>(element: HTMLElement): ColumnViewRenderer<TRow, TValue> | undefined {\n const template = getAnyViewTemplate(element) as TemplateRef<GridCellContext<TValue, TRow>> | undefined;\n\n if (!template) {\n // Return undefined so the grid uses default rendering\n // This is important when only an editor template is provided (no view template)\n return undefined;\n }\n\n // Cell cache for this column - maps cell element to its view ref and container.\n // When the grid recycles pool elements during scroll, the same cellEl is reused\n // for different row data. By caching per cellEl, we reuse the Angular view and\n // just update its context instead of creating a new embedded view every time.\n // This matches what React and Vue adapters do with their cell caches.\n //\n // IMPORTANT: We always use a stable wrapper container (display:contents) rather\n // than caching individual rootNodes. This is critical because Angular's control\n // flow (@if, @for, @switch) can dynamically add/remove rootNodes during\n // detectChanges(). If we cached a single rootNode, newly created nodes (e.g.,\n // from an @if becoming true) would be orphaned outside the grid cell.\n const cellCache = new WeakMap<\n HTMLElement,\n { viewRef: EmbeddedViewRef<GridCellContext<TValue, TRow>>; container: HTMLElement }\n >();\n\n return (ctx: CellRenderContext<TRow, TValue>) => {\n // Skip rendering if the cell is in editing mode\n // This prevents the renderer from overwriting the editor when the grid re-renders\n if (ctx.cellEl?.classList.contains('editing')) {\n return null;\n }\n\n const cellEl = ctx.cellEl as HTMLElement | undefined;\n\n if (cellEl) {\n const cached = cellCache.get(cellEl);\n if (cached) {\n // Reuse existing view - just update context and re-run change detection\n cached.viewRef.context.$implicit = ctx.value;\n cached.viewRef.context.value = ctx.value;\n cached.viewRef.context.row = ctx.row;\n cached.viewRef.context.column = ctx.column;\n cached.viewRef.detectChanges();\n // Re-sync rootNodes into the container. Angular's control flow (@if/@for)\n // may have added or removed nodes during detectChanges().\n syncRootNodes(cached.viewRef, cached.container);\n return cached.container;\n }\n }\n\n // Create the context for the template\n const context: GridCellContext<TValue, TRow> = {\n $implicit: ctx.value,\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n };\n\n // Create embedded view from template\n const viewRef = this.viewContainerRef.createEmbeddedView(template, context);\n this.viewRefs.push(viewRef);\n\n // Trigger change detection\n viewRef.detectChanges();\n\n // Always use a stable wrapper container so Angular can freely add/remove\n // rootNodes (via @if, @for, etc.) without orphaning them outside the grid cell.\n const container = document.createElement('span');\n container.style.display = 'contents';\n syncRootNodes(viewRef, container);\n\n // Cache for reuse on scroll recycles\n if (cellEl) {\n cellCache.set(cellEl, { viewRef, container });\n }\n\n return container;\n };\n }\n\n /**\n * Creates an editor spec that creates an embedded view.\n *\n * **Auto-wiring**: The adapter automatically listens for `commit` and `cancel`\n * CustomEvents on the rendered component. If the component emits these events,\n * the adapter will call the grid's commit/cancel functions automatically.\n *\n * This means templates can be simplified from:\n * ```html\n * <app-editor *tbwEditor=\"let value; onCommit as onCommit\"\n * [value]=\"value\" (commit)=\"onCommit($event)\" />\n * ```\n * To just:\n * ```html\n * <app-editor *tbwEditor=\"let value\" [value]=\"value\" />\n * ```\n * As long as the component emits `(commit)` with the new value.\n */\n createEditor<TRow = unknown, TValue = unknown>(element: HTMLElement): ColumnEditorSpec<TRow, TValue> | undefined {\n // Template-based editors (`*tbwEditor` / `<tbw-grid-column-editor>`) are\n // owned by `@toolbox-web/grid-angular/features/editing`. Delegate to its\n // bridge, which returns undefined when the feature is not imported or no\n // editor template is registered for this element. Component-class editors\n // (column `editor` / type-default `editor`) are handled separately and do\n // not require the editing feature import.\n return getEditorSpecBridge()?.<TRow, TValue>(element, this);\n }\n\n /**\n * Creates a detail renderer function for MasterDetailPlugin. Delegates to\n * the bridge installed by `@toolbox-web/grid-angular/features/master-detail`.\n * Returns undefined if the feature is not imported or no `<tbw-grid-detail>`\n * template is registered for this grid.\n */\n createDetailRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow) => HTMLElement) | undefined {\n return getDetailRendererBridge()?.<TRow>(gridElement, this) as ((row: TRow) => HTMLElement) | undefined;\n }\n\n /**\n * FrameworkAdapter hook called by MasterDetailPlugin during attach(). Delegates\n * to {@link createDetailRenderer} (bridge installed by master-detail feature).\n */\n parseDetailElement<TRow = unknown>(\n detailElement: Element,\n ): ((row: TRow, rowIndex: number) => HTMLElement | string) | undefined {\n const gridElement = detailElement.closest('tbw-grid, [data-tbw-grid]') as HTMLElement | null;\n if (!gridElement) return undefined;\n return getDetailRendererBridge()?.<TRow>(gridElement, this);\n }\n\n /**\n * Creates a responsive card renderer function for ResponsivePlugin. Delegates\n * to the bridge installed by `@toolbox-web/grid-angular/features/responsive`.\n */\n createResponsiveCardRenderer<TRow = unknown>(\n gridElement: HTMLElement,\n ): ((row: TRow, rowIndex: number) => HTMLElement) | undefined {\n return getResponsiveCardRendererBridge()?.<TRow>(gridElement, this);\n }\n\n /**\n * FrameworkAdapter hook called by ResponsivePlugin during attach(). Delegates\n * to {@link createResponsiveCardRenderer} (bridge installed by responsive feature).\n */\n parseResponsiveCardElement<TRow = unknown>(\n cardElement: Element,\n ): ((row: TRow, rowIndex: number) => HTMLElement) | undefined {\n const gridElement = cardElement.closest('tbw-grid, [data-tbw-grid]') as HTMLElement | null;\n if (!gridElement) return undefined;\n return getResponsiveCardRendererBridge()?.<TRow>(gridElement, this);\n }\n\n /**\n * Creates a tool panel renderer from a light DOM element. Tool-panel\n * templates are owned by `@toolbox-web/grid-angular/features/shell`; delegate\n * to its bridge, which returns undefined when the feature is not imported or\n * no tool-panel template is registered for this element.\n */\n createToolPanelRenderer(element: HTMLElement): ((container: HTMLElement) => void | (() => void)) | undefined {\n return getToolPanelRendererBridge()?.(element, this);\n }\n\n /**\n * Gets type-level defaults from the application's GridTypeRegistry.\n *\n * This enables application-wide type defaults configured via `provideGridTypeDefaults()`.\n * The returned TypeDefault contains renderer/editor functions that instantiate\n * Angular components dynamically.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridTypeDefaults({\n * country: {\n * renderer: CountryCellComponent,\n * editor: CountryEditorComponent\n * }\n * })\n * ]\n * };\n *\n * // Any grid with type: 'country' columns will use these components\n * gridConfig = {\n * columns: [{ field: 'country', type: 'country' }]\n * };\n * ```\n */\n getTypeDefault<TRow = unknown>(type: string, _gridEl?: HTMLElement): BaseTypeDefault<TRow> | undefined {\n if (!this.typeRegistry) {\n return undefined;\n }\n\n const config = this.typeRegistry.get(type);\n if (!config) {\n return undefined;\n }\n\n const typeDefault: BaseTypeDefault<TRow> = {\n editorParams: config.editorParams,\n };\n\n // Create renderer function that instantiates the Angular component\n if (config.renderer) {\n typeDefault.renderer = this.createComponentRenderer<TRow, unknown>(config.renderer);\n }\n\n // Create editor function that instantiates the Angular component\n if (config.editor) {\n // Type assertion needed: adapter bridges TRow to core's unknown\n typeDefault.editor = this.createComponentEditor<TRow, unknown>(config.editor) as BaseTypeDefault['editor'];\n }\n\n // Create filterPanelRenderer function that instantiates the Angular component\n // via the filtering feature bridge. Drop silently if the feature is not imported.\n if (config.filterPanelRenderer && isComponentClass(config.filterPanelRenderer)) {\n const wrapped = getFilterPanelTypeDefaultBridge()?.(config.filterPanelRenderer, this);\n if (wrapped) typeDefault.filterPanelRenderer = wrapped;\n } else if (config.filterPanelRenderer) {\n typeDefault.filterPanelRenderer = config.filterPanelRenderer as BaseTypeDefault['filterPanelRenderer'];\n }\n\n return typeDefault;\n }\n\n /**\n * Generalized component-mount primitive. All `createComponent*Renderer` methods\n * are thin wrappers around this. Returns a function `(ctx) => { hostElement, componentRef }`\n * so callers that need the `componentRef` (editor wiring, value-change subscription)\n * still have it; callers that only need the host element use `.hostElement`.\n *\n * Public so feature secondary entries can compose their own component renderers\n * without re-implementing the mount/track plumbing.\n *\n * @param componentClass Angular component class to instantiate per call.\n * @param mapInputs Maps the renderer context to a `setInput()` bag.\n * @param pool Which `componentRefs[]` array tracks the instance for cleanup.\n * `'render'` (default) is the long-lived pool cleared at `dispose()`.\n * `'editor'` is the per-cell pool swept by `releaseCell()`.\n * @internal\n */\n mountComponentRenderer<TCtx>(\n componentClass: Type<unknown>,\n mapInputs: (ctx: TCtx) => Record<string, unknown>,\n pool: 'render' | 'editor' = 'render',\n ): (ctx: TCtx) => { hostElement: HTMLSpanElement; componentRef: ComponentRef<unknown> } {\n return (ctx: TCtx) => {\n const hostElement = document.createElement('span');\n hostElement.style.display = 'contents';\n const componentRef = createComponent(componentClass, {\n environmentInjector: this.injector,\n hostElement,\n });\n this.setComponentInputs(componentRef, mapInputs(ctx));\n this.appRef.attachView(componentRef.hostView);\n (pool === 'editor' ? this.editorComponentRefs : this.componentRefs).push(componentRef);\n componentRef.changeDetectorRef.detectChanges();\n return { hostElement, componentRef };\n };\n }\n\n /**\n * Creates a renderer function from an Angular component class.\n * Wraps {@link mountComponentRenderer} with a per-cell `WeakMap` cache so\n * scroll-recycled cells reuse the existing component (just refresh inputs)\n * instead of mounting a fresh one.\n * @internal\n */\n private createComponentRenderer<TRow = unknown, TValue = unknown>(\n componentClass: Type<unknown>,\n ): ColumnViewRenderer<TRow, TValue> {\n const cellCache = new WeakMap<HTMLElement, { componentRef: ComponentRef<unknown>; hostElement: HTMLSpanElement }>();\n const mount = this.mountComponentRenderer<CellRenderContext<TRow, TValue>>(componentClass, (ctx) => ({\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n }));\n\n return (ctx: CellRenderContext<TRow, TValue>) => {\n const cellEl = ctx.cellEl as HTMLElement | undefined;\n\n if (cellEl) {\n const cached = cellCache.get(cellEl);\n if (cached) {\n // Reuse existing component - just update inputs.\n this.setComponentInputs(cached.componentRef, {\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n });\n cached.componentRef.changeDetectorRef.detectChanges();\n return cached.hostElement;\n }\n }\n\n const { hostElement, componentRef } = mount(ctx);\n if (cellEl) cellCache.set(cellEl, { componentRef, hostElement });\n return hostElement;\n };\n }\n\n /**\n * Creates an editor function from an Angular component class.\n * Wraps {@link mountComponentRenderer} (using the `'editor'` pool for per-cell\n * cleanup) plus editor-specific wiring: callback bridge, mount-hook fan-out\n * (see {@link runEditorMountHooks}), and external value-change subscription.\n * @internal\n */\n private createComponentEditor<TRow = unknown, TValue = unknown>(\n componentClass: Type<unknown>,\n ): ColumnEditorSpec<TRow, TValue> {\n const mount = this.mountComponentRenderer<ColumnEditorContext<TRow, TValue>>(\n componentClass,\n (ctx) => ({ value: ctx.value, row: ctx.row, column: ctx.column }),\n 'editor',\n );\n\n return (ctx: ColumnEditorContext<TRow, TValue>) => {\n const { hostElement, componentRef } = mount(ctx);\n\n wireEditorCallbacks<TValue>(\n hostElement,\n componentRef.instance as Record<string, unknown>,\n (value) => ctx.commit(value),\n () => ctx.cancel(),\n );\n this.runEditorMountHooks(hostElement);\n\n // Auto-update editor when value changes externally (e.g., via updateRow cascade\n // or Escape-revert). Update the component input and run detectChanges() —\n // the component's own template handles rendering regardless of editor type.\n ctx.onValueChange?.((newVal: unknown) => {\n try {\n // Notify the editor so it can clear stale internal state (e.g., searchText\n // in autocomplete editors) before the value input updates.\n const instance = componentRef.instance;\n if (typeof (instance as Record<string, unknown>)['onExternalValueChange'] === 'function') {\n (instance as { onExternalValueChange: (v: unknown) => void }).onExternalValueChange(newVal);\n }\n componentRef.setInput('value', newVal);\n componentRef.changeDetectorRef.detectChanges();\n } catch {\n // Component is destroyed — nothing to update.\n }\n });\n\n return hostElement;\n };\n }\n\n /**\n * Creates a header renderer function from an Angular component class.\n * Mounts the component with full header context (column, value, sortState, etc.).\n * @internal\n */\n private createComponentHeaderRenderer<TRow = unknown>(\n componentClass: Type<unknown>,\n ): (ctx: HeaderCellContext<TRow>) => HTMLElement {\n const mount = this.mountComponentRenderer<HeaderCellContext<TRow>>(componentClass, (ctx) => ({\n column: ctx.column,\n value: ctx.value,\n sortState: ctx.sortState,\n filterActive: ctx.filterActive,\n renderSortIcon: ctx.renderSortIcon,\n renderFilterButton: ctx.renderFilterButton,\n }));\n return (ctx) => mount(ctx).hostElement;\n }\n\n /**\n * Creates a header label renderer function from an Angular component class.\n * Mounts the component with label context (column, value).\n * @internal\n */\n private createComponentHeaderLabelRenderer<TRow = unknown>(\n componentClass: Type<unknown>,\n ): (ctx: HeaderLabelContext<TRow>) => HTMLElement {\n const mount = this.mountComponentRenderer<HeaderLabelContext<TRow>>(componentClass, (ctx) => ({\n column: ctx.column,\n value: ctx.value,\n }));\n return (ctx) => mount(ctx).hostElement;\n }\n\n /**\n * Creates a loading renderer function from an Angular component class.\n *\n * The component should accept a `size` input ('large' | 'small').\n * @internal\n */\n private createComponentLoadingRenderer(componentClass: Type<unknown>): (ctx: LoadingContext) => HTMLElement {\n const mount = this.mountComponentRenderer<LoadingContext>(componentClass, (ctx) => ({ size: ctx.size }));\n return (ctx) => mount(ctx).hostElement;\n }\n\n /**\n * Creates an empty-state renderer function from an Angular component class.\n *\n * The component receives `sourceRowCount` and `filteredOut` inputs.\n * @internal\n */\n private createComponentEmptyRenderer(componentClass: Type<unknown>): (ctx: EmptyContext) => HTMLElement {\n const mount = this.mountComponentRenderer<EmptyContext>(componentClass, (ctx) => ({\n sourceRowCount: ctx.sourceRowCount,\n filteredOut: ctx.filteredOut,\n }));\n return (ctx) => mount(ctx).hostElement;\n }\n\n /**\n * Create an embedded view from a `TemplateRef` and append-track it on the\n * adapter's view-ref pool so it is cleaned up on `destroy()` / `unmount()`.\n * Public so feature secondary entries can mount Angular templates (e.g.\n * master-detail rows, responsive cards) without reaching into the adapter's\n * private `viewContainerRef` / `viewRefs`.\n * @internal\n */\n createTrackedEmbeddedView<TCtx>(template: TemplateRef<TCtx>, context: TCtx): EmbeddedViewRef<TCtx> {\n const viewRef = this.viewContainerRef.createEmbeddedView(template, context);\n this.viewRefs.push(viewRef);\n viewRef.detectChanges();\n return viewRef;\n }\n\n /**\n * Create an editor embedded view from a `TemplateRef`: tracks it in the\n * per-cell editor pool (swept by `releaseCell()` when the grid recycles the\n * cell), wraps its root nodes in a stable `display:contents` span, and runs\n * the registered editor-mount hooks against that span. Public so the editing\n * feature secondary entry can mount `*tbwEditor` / `<tbw-grid-column-editor>`\n * templates without reaching into the adapter's private view pools or\n * mount-hook fan-out.\n * @internal\n * @since 3.0.0\n */\n createEditorTemplateView<TCtx>(\n template: TemplateRef<TCtx>,\n context: TCtx,\n ): { container: HTMLElement; viewRef: EmbeddedViewRef<TCtx> } {\n const viewRef = this.viewContainerRef.createEmbeddedView(template, context);\n // Track in editor-specific pool for per-cell cleanup via releaseCell().\n this.editorViewRefs.push(viewRef);\n viewRef.detectChanges();\n // Stable wrapper so Angular's rootNodes (which may include comment\n // placeholders from <ng-container>/control flow) live inside one element.\n const container = document.createElement('span');\n container.style.display = 'contents';\n syncRootNodes(viewRef, container);\n this.runEditorMountHooks(container);\n return { container, viewRef };\n }\n\n /**\n * Re-sync an editor embedded view's root nodes into its `display:contents`\n * container after an external `detectChanges()` (Angular control flow may\n * have added/removed nodes). Public for the editing feature's external\n * value-change handler.\n * @internal\n * @since 3.0.0\n */\n syncEditorTemplateView(viewRef: EmbeddedViewRef<unknown>, container: HTMLElement): void {\n syncRootNodes(viewRef, container);\n }\n\n /**\n * Processes a GroupingColumnsConfig. Delegates to the feature config\n * preprocessor installed by `@toolbox-web/grid-angular/features/grouping-columns`,\n * which handles converting Angular component class references to actual\n * renderer functions. Returns the input config unchanged if the feature\n * is not imported.\n */\n processGroupingColumnsConfig<TConfig>(config: TConfig): TConfig {\n return this.applyFeatureConfigPreprocessor('groupingColumns', config);\n }\n\n /**\n * Processes a GroupingRowsConfig. Delegates to the feature config preprocessor\n * installed by `@toolbox-web/grid-angular/features/grouping-rows`.\n */\n processGroupingRowsConfig<TConfig>(config: TConfig): TConfig {\n return this.applyFeatureConfigPreprocessor('groupingRows', config);\n }\n\n /**\n * Processes a PinnedRowsConfig. Delegates to the feature config preprocessor\n * installed by `@toolbox-web/grid-angular/features/pinned-rows`.\n */\n processPinnedRowsConfig<TConfig>(config: TConfig): TConfig {\n return this.applyFeatureConfigPreprocessor('pinnedRows', config);\n }\n\n /**\n * Run a registered feature-config preprocessor against `config`, returning\n * the original config unchanged when the feature is not imported.\n * @internal\n */\n private applyFeatureConfigPreprocessor<TConfig>(name: FeatureName, config: TConfig): TConfig {\n if (!config || typeof config !== 'object') return config;\n const preprocessor = getFeatureConfigPreprocessor(name);\n if (!preprocessor) return config;\n return preprocessor(config, this) as TConfig;\n }\n\n /**\n * Sets component inputs using Angular's setInput API.\n * @internal\n */\n private setComponentInputs(componentRef: ComponentRef<unknown>, inputs: Record<string, unknown>): void {\n for (const [key, value] of Object.entries(inputs)) {\n try {\n componentRef.setInput(key, value);\n } catch {\n // Input doesn't exist on component - that's okay, some inputs are optional\n }\n }\n }\n\n /**\n * Called when a cell's content is about to be wiped (e.g., exiting edit mode,\n * scroll-recycling a row, or rebuilding a row).\n *\n * Destroys any editor embedded views or component refs whose DOM is\n * inside the given cell element. This prevents memory leaks from\n * orphaned Angular views that would otherwise stay in the change\n * detection tree indefinitely.\n */\n releaseCell(cellEl: HTMLElement): void {\n // Release editor embedded views whose root nodes are inside this cell\n for (let i = this.editorViewRefs.length - 1; i >= 0; i--) {\n const ref = this.editorViewRefs[i];\n if (ref.rootNodes.some((n: Node) => cellEl.contains(n))) {\n ref.destroy();\n this.editorViewRefs.splice(i, 1);\n }\n }\n // Release editor component refs whose host element is inside this cell\n for (let i = this.editorComponentRefs.length - 1; i >= 0; i--) {\n const ref = this.editorComponentRefs[i];\n if (cellEl.contains(ref.location.nativeElement)) {\n ref.destroy();\n this.editorComponentRefs.splice(i, 1);\n }\n }\n // Detach editor-mount hook teardowns for editor hosts inside this cell.\n for (const [hostEl, unsub] of this.editorMountTeardowns) {\n if (cellEl.contains(hostEl)) {\n unsub();\n this.editorMountTeardowns.delete(hostEl);\n }\n }\n }\n\n /**\n * Open a teardown batch. No-op for the Angular adapter — `viewRef.destroy()`\n * and `componentRef.destroy()` are synchronous DOM operations with no\n * deferred-commit warning analogous to React's `flushSync`. Implemented\n * for {@link FrameworkAdapter} parity so grid core's bulk-teardown\n * wrappers work uniformly across adapters.\n */\n beginBatch(_gridEl?: HTMLElement): void {\n // intentionally empty\n }\n\n /**\n * Close a teardown batch opened by {@link beginBatch}. No-op for Angular —\n * see {@link beginBatch}.\n */\n endBatch(_gridEl?: HTMLElement): void {\n // intentionally empty\n }\n\n /**\n * Unmount a specific container (e.g., detail panel, tool panel).\n * Finds the matching view or component ref whose DOM nodes are inside\n * the container and properly destroys it to prevent memory leaks.\n */\n unmount(container: HTMLElement): void {\n for (let i = this.viewRefs.length - 1; i >= 0; i--) {\n const ref = this.viewRefs[i];\n if (ref.rootNodes.some((n: Node) => container.contains(n))) {\n ref.destroy();\n this.viewRefs.splice(i, 1);\n return;\n }\n }\n for (let i = this.componentRefs.length - 1; i >= 0; i--) {\n const ref = this.componentRefs[i];\n if (container.contains(ref.location.nativeElement)) {\n ref.destroy();\n this.componentRefs.splice(i, 1);\n return;\n }\n }\n }\n\n /**\n * Clean up all view references and component references.\n * Call this when your app/component is destroyed.\n */\n destroy(): void {\n this.viewRefs.forEach((ref) => ref.destroy());\n this.viewRefs = [];\n this.editorViewRefs.forEach((ref) => ref.destroy());\n this.editorViewRefs = [];\n this.componentRefs.forEach((ref) => ref.destroy());\n this.componentRefs = [];\n this.editorComponentRefs.forEach((ref) => ref.destroy());\n this.editorComponentRefs = [];\n this.editorMountTeardowns.forEach((unsub) => unsub());\n this.editorMountTeardowns.clear();\n }\n\n /**\n * Runs every registered {@link EditorMountHook} against a freshly mounted\n * editor host once it has been parented to the grid. The grid is resolved\n * lazily via `queueMicrotask` because the host is appended to the cell\n * *after* the editor wrapper returns. Mirror of Vue's\n * `attachBeforeEditCloseFlush` and React's `wrapReactEditor`\n * queueMicrotask bridge.\n *\n * Without any feature imports the hook list is empty and this is a no-op\n * — `before-edit-close` blur handling lives in\n * `@toolbox-web/grid-angular/features/editing`.\n * @internal\n */\n private runEditorMountHooks(host: HTMLElement): void {\n queueMicrotask(() => {\n const gridEl = host.closest('tbw-grid, [data-tbw-grid]') as HTMLElement | null;\n if (!gridEl) return;\n this.editorMountTeardowns.set(host, notifyEditorMounted(host, gridEl));\n });\n }\n}\n","/**\n * Icon configuration registry for Angular applications.\n *\n * Provides application-wide icon overrides for all grids via\n * Angular's dependency injection.\n */\nimport { EnvironmentProviders, inject, Injectable, InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport type { GridIcons } from '@toolbox-web/grid';\n\n/**\n * Injection token for providing icon overrides at app level.\n * @since 0.8.0\n */\nexport const GRID_ICONS = new InjectionToken<Partial<GridIcons>>('GRID_ICONS');\n\n/**\n * Injectable service for managing grid icons.\n *\n * Use `provideGridIcons()` in your app config to set up icons,\n * or inject this service for dynamic registration.\n *\n * @example\n * ```typescript\n * // App-level setup (app.config.ts)\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridIcons({\n * expand: '➕',\n * collapse: '➖',\n * sortAsc: '↑',\n * sortDesc: '↓',\n * })\n * ]\n * };\n *\n * // Dynamic registration\n * @Component({ ... })\n * export class AppComponent {\n * private registry = inject(GridIconRegistry);\n *\n * ngOnInit() {\n * this.registry.set('filter', '<svg>...</svg>');\n * }\n * }\n * ```\n * @since 0.8.0\n */\n@Injectable({ providedIn: 'root' })\nexport class GridIconRegistry {\n private readonly icons = new Map<keyof GridIcons, GridIcons[keyof GridIcons]>();\n\n constructor() {\n // Merge any initial icons from provider\n const initial = inject(GRID_ICONS, { optional: true });\n if (initial) {\n for (const [key, value] of Object.entries(initial)) {\n this.icons.set(key as keyof GridIcons, value);\n }\n }\n }\n\n /**\n * Set an icon override.\n *\n * @param name - The icon name (e.g., 'expand', 'collapse', 'filter')\n * @param value - The icon value (string text or SVG markup)\n */\n set<K extends keyof GridIcons>(name: K, value: GridIcons[K]): void {\n this.icons.set(name, value);\n }\n\n /**\n * Get an icon value.\n */\n get<K extends keyof GridIcons>(name: K): GridIcons[K] | undefined {\n return this.icons.get(name) as GridIcons[K] | undefined;\n }\n\n /**\n * Remove an icon override.\n */\n remove(name: keyof GridIcons): void {\n this.icons.delete(name);\n }\n\n /**\n * Check if an icon has an override.\n */\n has(name: keyof GridIcons): boolean {\n return this.icons.has(name);\n }\n\n /**\n * Get all icon overrides as a GridIcons partial.\n * Used internally by the adapter.\n *\n * @internal\n */\n getAll(): Partial<GridIcons> {\n const result: Partial<GridIcons> = {};\n for (const [key, value] of this.icons) {\n (result as Record<keyof GridIcons, GridIcons[keyof GridIcons]>)[key] = value;\n }\n return result;\n }\n\n /**\n * Get all registered icon names.\n */\n getRegisteredIcons(): (keyof GridIcons)[] {\n return Array.from(this.icons.keys());\n }\n}\n\n/**\n * Provides application-level icon overrides for all grids.\n *\n * Available icons to override:\n * - `expand` - Expand icon for collapsed items (trees, groups, details)\n * - `collapse` - Collapse icon for expanded items\n * - `sortAsc` - Sort ascending indicator\n * - `sortDesc` - Sort descending indicator\n * - `sortNone` - Sort neutral/unsorted indicator\n * - `submenuArrow` - Submenu arrow for context menus\n * - `dragHandle` - Drag handle icon for reordering\n * - `toolPanel` - Tool panel toggle icon in toolbar\n * - `filter` - Filter icon in column headers\n * - `filterActive` - Filter icon when filter is active\n * - `print` - Print icon for print button\n *\n * @example\n * ```typescript\n * // app.config.ts\n * import { provideGridIcons } from '@toolbox-web/grid-angular';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridIcons({\n * expand: '➕',\n * collapse: '➖',\n * sortAsc: '↑',\n * sortDesc: '↓',\n * filter: '<svg viewBox=\"0 0 16 16\">...</svg>',\n * })\n * ]\n * };\n * ```\n * @since 0.8.0\n */\nexport function provideGridIcons(icons: Partial<GridIcons>): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: GRID_ICONS, useValue: icons }]);\n}\n","import { afterNextRender, computed, DestroyRef, ElementRef, inject, type Signal, signal } from '@angular/core';\nimport type { ColumnConfig, DataGridElement, GridConfig } from '@toolbox-web/grid';\n\n/**\n * Return type for injectGrid function.\n * @since 0.6.0\n */\nexport interface InjectGridReturn<TRow = unknown> {\n /** Direct access to the typed grid element */\n element: Signal<DataGridElement<TRow> | null>;\n /** Whether the grid is ready */\n isReady: Signal<boolean>;\n /** Current grid configuration */\n config: Signal<GridConfig<TRow> | null>;\n /** Get the effective configuration */\n getConfig: () => Promise<GridConfig<TRow> | null>;\n /** Force a layout recalculation */\n forceLayout: () => Promise<void>;\n /** Toggle a group row */\n toggleGroup: (key: string) => Promise<void>;\n /** Register custom styles */\n registerStyles: (id: string, css: string) => void;\n /** Unregister custom styles */\n unregisterStyles: (id: string) => void;\n /** Get current visible columns */\n visibleColumns: Signal<ColumnConfig<TRow>[]>;\n /**\n * Look up a plugin instance by its class constructor.\n * Returns `undefined` if the plugin is not registered or the grid is not yet ready.\n */\n getPlugin: <T>(pluginClass: new (...args: unknown[]) => T) => T | undefined;\n /**\n * Look up a plugin instance by its registered name (e.g. `'tooltip'`, `'undoRedo'`).\n * Returns `undefined` if the plugin is not registered or the grid is not yet ready.\n */\n getPluginByName: DataGridElement<TRow>['getPluginByName'];\n}\n\n/**\n * Angular inject function for programmatic access to a grid instance.\n *\n * This function should be called in the constructor or as a field initializer\n * of an Angular component that contains a `<tbw-grid>` element.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid, injectGrid } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * template: `\n * <button (click)=\"handleResize()\">Force Layout</button>\n * <button (click)=\"handleExport()\" [disabled]=\"!grid.isReady()\">Export</button>\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\"></tbw-grid>\n * `\n * })\n * export class MyGridComponent {\n * grid = injectGrid<Employee>();\n *\n * async handleResize() {\n * await this.grid.forceLayout();\n * }\n *\n * async handleExport() {\n * const config = await this.grid.getConfig();\n * console.log('Exporting with columns:', config?.columns);\n * }\n * }\n * ```\n *\n * @param selector - Optional CSS selector to target a specific grid element.\n * Defaults to `'tbw-grid'` (first grid in the component). Use when the\n * component contains multiple grids, e.g. `'tbw-grid.primary'` or `'#my-grid'`.\n * @returns Object with grid access methods and state signals\n * @since 0.6.0\n */\nexport function injectGrid<TRow = unknown>(selector = 'tbw-grid'): InjectGridReturn<TRow> {\n const elementRef = inject(ElementRef);\n const destroyRef = inject(DestroyRef);\n\n // Reactive signals\n const isReady = signal(false);\n const config = signal<GridConfig<TRow> | null>(null);\n const element = signal<DataGridElement<TRow> | null>(null);\n\n // Track destruction so async work doesn't touch signals after teardown\n let destroyed = false;\n destroyRef.onDestroy(() => {\n destroyed = true;\n });\n\n // Initialize after render\n afterNextRender(() => {\n const gridElement = elementRef.nativeElement.querySelector(selector) as DataGridElement<TRow>;\n if (!gridElement) {\n console.warn('[injectGrid] No tbw-grid element found in component');\n return;\n }\n\n element.set(gridElement);\n\n // Wait for grid to be ready. Use Promise.resolve to guard against\n // gridElement.ready being undefined (would otherwise throw on .then).\n Promise.resolve(gridElement.ready?.())\n .then(async () => {\n if (destroyed) return;\n isReady.set(true);\n const effectiveConfig = await gridElement.getConfig?.();\n if (destroyed) return;\n if (effectiveConfig) {\n config.set(effectiveConfig as GridConfig<TRow>);\n }\n })\n .catch((err) => {\n console.error('[injectGrid] Error waiting for grid to be ready:', err);\n });\n });\n\n // Computed visible columns\n const visibleColumns = computed<ColumnConfig<TRow>[]>(() => {\n const currentConfig = config();\n if (!currentConfig?.columns) return [];\n return currentConfig.columns.filter((col) => !col.hidden);\n });\n\n // ═══════════════════════════════════════════════════════════════════\n // CORE METHODS\n // ═══════════════════════════════════════════════════════════════════\n\n const getConfig = async (): Promise<GridConfig<TRow> | null> => {\n const gridElement = element();\n if (!gridElement) return null;\n const effectiveConfig = gridElement.getConfig?.();\n return (effectiveConfig as GridConfig<TRow>) ?? null;\n };\n\n const forceLayout = async (): Promise<void> => {\n const gridElement = element();\n if (!gridElement) return;\n await gridElement.forceLayout?.();\n };\n\n const toggleGroup = async (key: string): Promise<void> => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n if (!gridElement) return;\n await gridElement.toggleGroup?.(key);\n };\n\n const registerStyles = (id: string, css: string): void => {\n element()?.registerStyles?.(id, css);\n };\n\n const unregisterStyles = (id: string): void => {\n element()?.unregisterStyles?.(id);\n };\n\n const getPlugin = <T>(pluginClass: new (...args: unknown[]) => T): T | undefined => {\n return element()?.getPlugin?.(pluginClass);\n };\n\n const getPluginByName = ((name: string) => {\n return element()?.getPluginByName?.(name);\n }) as DataGridElement<TRow>['getPluginByName'];\n\n return {\n element,\n isReady,\n config,\n visibleColumns,\n getConfig,\n forceLayout,\n toggleGroup,\n registerStyles,\n unregisterStyles,\n getPlugin,\n getPluginByName,\n };\n}\n","// @internal Types-only barrel: pulls core feature modules onto ng-packagr's type\n// graph so FeatureConfig augmentations merge before emit. See\n// .github/knowledge/adapters-angular.md (\"FeatureName derivation\"). Use `//` not\n// `/** */` — terser preserves JSDoc in the fesm bundle (~1.5 KiB cost).\n//\n// Each line re-exports the core feature's `_Augmentation` anchor type under a\n// unique local name. This is functionally equivalent to\n// `import type {} from '@toolbox-web/grid/features/<name>'` but survives\n// Prettier / organize-imports, which strip empty-brace imports as unused.\n// The re-exports are type-only (zero runtime cost) and stay internal because\n// `feature-registry.ts` consumes this file with a bare side-effect import\n// (`import './internal/feature-augmentations'`), not a re-export.\n// Append a new line whenever a core feature is added.\n\nexport type { _Augmentation as _ClipboardAugmentation } from '@toolbox-web/grid/features/clipboard';\nexport type { _Augmentation as _ColumnVirtualizationAugmentation } from '@toolbox-web/grid/features/column-virtualization';\nexport type { _Augmentation as _ContextMenuAugmentation } from '@toolbox-web/grid/features/context-menu';\nexport type { _Augmentation as _EditingAugmentation } from '@toolbox-web/grid/features/editing';\nexport type { _Augmentation as _ExportAugmentation } from '@toolbox-web/grid/features/export';\nexport type { _Augmentation as _FilteringAugmentation } from '@toolbox-web/grid/features/filtering';\nexport type { _Augmentation as _GroupingColumnsAugmentation } from '@toolbox-web/grid/features/grouping-columns';\nexport type { _Augmentation as _GroupingRowsAugmentation } from '@toolbox-web/grid/features/grouping-rows';\nexport type { _Augmentation as _MasterDetailAugmentation } from '@toolbox-web/grid/features/master-detail';\nexport type { _Augmentation as _MultiSortAugmentation } from '@toolbox-web/grid/features/multi-sort';\nexport type { _Augmentation as _PinnedColumnsAugmentation } from '@toolbox-web/grid/features/pinned-columns';\nexport type { _Augmentation as _PinnedRowsAugmentation } from '@toolbox-web/grid/features/pinned-rows';\nexport type { _Augmentation as _PivotAugmentation } from '@toolbox-web/grid/features/pivot';\nexport type { _Augmentation as _PrintAugmentation } from '@toolbox-web/grid/features/print';\nexport type { _Augmentation as _ReorderColumnsAugmentation } from '@toolbox-web/grid/features/reorder-columns';\nexport type { _Augmentation as _ResponsiveAugmentation } from '@toolbox-web/grid/features/responsive';\nexport type { _Augmentation as _RowDragDropAugmentation } from '@toolbox-web/grid/features/row-drag-drop';\nexport type { _Augmentation as _SelectionAugmentation } from '@toolbox-web/grid/features/selection';\nexport type { _Augmentation as _ServerSideAugmentation } from '@toolbox-web/grid/features/server-side';\nexport type { _Augmentation as _ShellAugmentation } from '@toolbox-web/grid/features/shell';\nexport type { _Augmentation as _StickyRowsAugmentation } from '@toolbox-web/grid/features/sticky-rows';\nexport type { _Augmentation as _TooltipAugmentation } from '@toolbox-web/grid/features/tooltip';\nexport type { _Augmentation as _TreeAugmentation } from '@toolbox-web/grid/features/tree';\nexport type { _Augmentation as _UndoRedoAugmentation } from '@toolbox-web/grid/features/undo-redo';\nexport type { _Augmentation as _VisibilityAugmentation } from '@toolbox-web/grid/features/visibility';\n","/**\n * Feature Registry for @toolbox-web/grid-angular\n *\n * Delegates to the core registry at `@toolbox-web/grid/features/registry`.\n * This module re-exports core functions so existing feature modules continue\n * to work without changing their import paths.\n *\n * @example\n * ```typescript\n * // Import features you need (side-effect imports)\n * import '@toolbox-web/grid-angular/features/selection';\n * import '@toolbox-web/grid-angular/features/filtering';\n *\n * // Inputs work automatically - no async loading, no HTTP requests\n * <tbw-grid [selection]=\"'range'\" [filtering]=\"{ debounceMs: 200 }\" />\n * ```\n */\n\n// Re-export core registry — all adapters share the same registry Map\nexport {\n clearFeatureRegistry,\n createPluginFromFeature,\n getFeatureFactory,\n getRegisteredFeatures,\n isFeatureRegistered,\n registerFeature,\n} from '@toolbox-web/grid/features/registry';\n\nexport type { PluginFactory } from '@toolbox-web/grid/features/registry';\n\nimport type { FeatureConfig } from '@toolbox-web/grid';\n// Anchor every core feature module on the type graph so its `FeatureConfig`\n// augmentation is visible to ng-packagr's partial compilation when emitting\n// the `keyof FeatureConfig` below — see `internal/feature-augmentations.ts`\n// header for the full rationale (gh #356 phase 6).\nimport './internal/feature-augmentations';\n\n/**\n * Feature names supported by the Grid directive, derived from the core\n * augmentable `FeatureConfig` interface — stays in lockstep with core: any\n * feature that augments `FeatureConfig` (via `declare module\n * '@toolbox-web/grid'`) is automatically a member of this union, including\n * third-party features.\n *\n * The `__brand` sentinel declared on core's `FeatureConfig` (to keep the\n * interface non-empty for excess-property checks) is filtered out — it is\n * not a real feature name.\n *\n * The `feature-registry.spec.ts` superset check enforces the strict\n * additive contract (gh #356 §7): every previously-accepted name must stay\n * assignable to the derived union.\n *\n * @since 0.6.0\n */\ntype DerivedFeatureName = Exclude<keyof FeatureConfig, '__brand'>;\n\n// Defensive fallback for dist-linked builds where external FeatureConfig\n// augmentations fail to load under ng-packagr and `keyof FeatureConfig`\n// collapses to just `__brand`.\nexport type FeatureName = [DerivedFeatureName] extends [never] ? string : DerivedFeatureName;\n","import { Directive } from '@angular/core';\n\n/**\n * Directive that registers `<tbw-grid-column>` as a known Angular element.\n *\n * This directive exists so that Angular's template compiler recognises\n * `<tbw-grid-column>` without requiring `CUSTOM_ELEMENTS_SCHEMA`.\n * The underlying web component reads its attributes (`field`, `header`,\n * `type`, `width`, etc.) directly from the DOM, so no `@Input()` forwarding\n * is needed — Angular's standard property/attribute binding handles it.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid, TbwGridColumn, TbwRenderer } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [Grid, TbwGridColumn, TbwRenderer],\n * template: `\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-column field=\"status\">\n * <app-status-badge *tbwRenderer=\"let value\" [value]=\"value\" />\n * </tbw-grid-column>\n * </tbw-grid>\n * `\n * })\n * export class MyComponent { }\n * ```\n *\n * @category Directive\n * @since 0.13.0\n */\n@Directive({\n selector: 'tbw-grid-column',\n})\nexport class TbwGridColumn {}\n","import { Directive } from '@angular/core';\n\n/**\n * Directive that registers `<tbw-grid-header>` as a known Angular element.\n *\n * This directive exists so that Angular's template compiler recognises\n * `<tbw-grid-header>` without requiring `CUSTOM_ELEMENTS_SCHEMA`.\n * The grid's `config-manager` reads attributes like `title` directly\n * from the DOM element.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid, TbwGridHeader } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [Grid, TbwGridHeader],\n * template: `\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-header title=\"My Grid Title\"></tbw-grid-header>\n * </tbw-grid>\n * `\n * })\n * export class MyComponent { }\n * ```\n *\n * @category Directive\n * @since 0.13.0\n */\n@Directive({\n selector: 'tbw-grid-header',\n})\nexport class TbwGridHeader {}\n","import { Directive } from '@angular/core';\n\n/**\n * Directive that registers `<tbw-grid-tool-buttons>` as a known Angular element.\n *\n * This directive exists so that Angular's template compiler recognises\n * `<tbw-grid-tool-buttons>` without requiring `CUSTOM_ELEMENTS_SCHEMA`.\n * The grid's shell reads toolbar buttons directly from the DOM.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid, TbwGridToolButtons } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [Grid, TbwGridToolButtons],\n * template: `\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-tool-buttons>\n * <button (click)=\"doSomething()\">Action</button>\n * </tbw-grid-tool-buttons>\n * </tbw-grid>\n * `\n * })\n * export class MyComponent { }\n * ```\n *\n * @category Directive\n * @since 0.13.0\n */\n@Directive({\n selector: 'tbw-grid-tool-buttons',\n})\nexport class TbwGridToolButtons {}\n","import { Directive } from '@angular/core';\n\n/**\n * Directive that registers `<tbw-grid-type>` as a known Angular element.\n *\n * This keeps Angular template compilation happy without requiring\n * `CUSTOM_ELEMENTS_SCHEMA` and mirrors the existing `TbwGridColumn` directive.\n *\n * @category Directive\n * @since 2.0.0\n */\n@Directive({\n selector: 'tbw-grid-type',\n})\nexport class TbwGridType {}\n","/**\n * Column shorthand parsing for `@toolbox-web/grid-angular`.\n *\n * The parser, header generation and defaults helpers live in `@toolbox-web/grid`\n * core (issue #276). This module re-exports them so the adapter's public import\n * path is unchanged while the implementation stays in one place. Angular's\n * shorthand API types against core's `ColumnConfig` (these helpers take no\n * component-typed override), so a direct re-export is type-identical.\n */\nexport { applyColumnDefaults, hasColumnShorthands, normalizeColumns, parseColumnShorthand } from '@toolbox-web/grid';\nexport type { ColumnShorthand } from '@toolbox-web/grid';\n","/**\n * Per-grid-element claims registry used by the hybrid feature-directive\n * refactor (v1.4 → v2).\n *\n * Background: historically every plugin's input/output (e.g. `[filtering]`,\n * `(filterChange)`) was declared on the central {@link Grid} directive. That\n * pulled the typed surface for every {@link FeatureName} into the core\n * bundle — even for apps that only used a few. The new approach gives every\n * feature a thin **attribute-selector** directive (e.g.\n * `GridFilteringDirective` with selector `tbw-grid[filtering], tbw-grid[filterChange]`)\n * that lives in the feature secondary entry, so the plugin's typed surface\n * is only paid for when the feature is actually imported.\n *\n * To stay non-breaking in v1.x, the deprecated inputs/outputs remain on\n * {@link Grid}. When a feature directive is present on the same `<tbw-grid>`\n * element it **claims** its feature here; {@link Grid} consults the registry\n * and lets the directive own the input + event so we never produce duplicate\n * plugins or double-emit events.\n *\n * This module is deliberately framework-free (plain {@link WeakMap} state, no\n * `@angular/core` imports) so feature secondary entries can import it through\n * the package barrel without introducing circular module graphs. The\n * {@link FeatureName} and {@link DataGridEventMap} type imports are\n * type-only, so no runtime dependency leaks.\n *\n * @internal\n */\nimport type { DataGridEventMap } from '@toolbox-web/grid';\nimport type { FeatureName } from '../feature-registry';\n\n/** Event names that can be claimed by a feature directive. */\ntype ClaimableEventName = keyof DataGridEventMap<unknown>;\n\n/**\n * Reads the directive-owned config value for a feature. The function is\n * called during {@link Grid}'s `createFeaturePlugins` effect, so reading a\n * signal inside it establishes reactive dependency tracking — the effect\n * re-runs when the directive's input changes.\n * @internal\n * @since 1.4.0\n */\nexport type FeatureConfigGetter = () => unknown;\n\n/** Per-element map of claimed feature names → config getter. */\nconst featureClaims = new WeakMap<HTMLElement, Map<FeatureName, FeatureConfigGetter>>();\n\n/** Per-element set of claimed event names (matches `keyof DataGridEventMap`). */\nconst eventClaims = new WeakMap<HTMLElement, Set<ClaimableEventName>>();\n\n/**\n * Register a feature claim. Called by a feature directive's constructor;\n * the {@link Grid} directive will then use {@link getFeatureClaim} during\n * plugin creation instead of reading its own deprecated input.\n * @internal\n * @since 1.4.0\n */\nexport function registerFeatureClaim(grid: HTMLElement, name: FeatureName, getConfig: FeatureConfigGetter): void {\n let map = featureClaims.get(grid);\n if (!map) {\n map = new Map<FeatureName, FeatureConfigGetter>();\n featureClaims.set(grid, map);\n }\n map.set(name, getConfig);\n}\n\n/**\n * Look up a feature claim. Returns the registered config getter, or\n * `undefined` if no directive owns this feature on this element.\n * @internal\n * @since 1.4.0\n */\nexport function getFeatureClaim(grid: HTMLElement, name: FeatureName): FeatureConfigGetter | undefined {\n return featureClaims.get(grid)?.get(name);\n}\n\n/**\n * Drop a feature claim. Called by a feature directive's `ngOnDestroy` so\n * that, if the directive is removed (e.g. via `*ngIf`) but the host\n * `<tbw-grid>` survives, {@link Grid}'s deprecated input takes back over.\n * @internal\n * @since 1.4.0\n */\nexport function unregisterFeatureClaim(grid: HTMLElement, name: FeatureName): void {\n featureClaims.get(grid)?.delete(name);\n}\n\n/**\n * Mark an event as owned by a feature directive. {@link Grid}'s\n * `setupEventListeners` skips wiring its own deprecated `output()` for any\n * claimed event — the directive owns the listener and the emit.\n * @internal\n * @since 1.4.0\n */\nexport function claimEvent(grid: HTMLElement, eventName: ClaimableEventName): void {\n let set = eventClaims.get(grid);\n if (!set) {\n set = new Set();\n eventClaims.set(grid, set);\n }\n set.add(eventName);\n}\n\n/**\n * Returns true if a directive has claimed this event on this grid element.\n * @internal\n * @since 1.4.0\n */\nexport function isEventClaimed(grid: HTMLElement, eventName: ClaimableEventName): boolean {\n return eventClaims.get(grid)?.has(eventName) ?? false;\n}\n\n/**\n * Drop an event claim. Pair with {@link claimEvent} in a directive's\n * `ngOnDestroy`.\n * @internal\n * @since 1.4.0\n */\nexport function unclaimEvent(grid: HTMLElement, eventName: ClaimableEventName): void {\n eventClaims.get(grid)?.delete(eventName);\n}\n","export interface RowUpdate {\n id: string;\n changes: Record<string, unknown>;\n}\n\n/**\n * Computes the minimal set of row updates needed when only values have changed\n * (same row count, same row IDs in the same order).\n *\n * Returns an array of updates (possibly empty) when the diff is value-only, or\n * `null` when a structural change is detected (different count, different IDs\n * in sequence, or initial load from an empty snapshot).\n *\n * Called by the Angular `Grid` directive's rows effect to decide whether to\n * call `grid.updateRows()` (value-only, fast path) or `grid.rows =` (full\n * replace). Kept as a pure helper so it can be unit-tested without Angular.\n */\nexport function computeRowDiff<T>(next: T[], prev: T[], getId: (row: T) => string): RowUpdate[] | null {\n if (prev.length === 0 || next.length !== prev.length) return null;\n\n const updates: RowUpdate[] = [];\n for (let i = 0; i < next.length; i++) {\n const nextRow = next[i];\n const prevRow = prev[i];\n const nextId = getId(nextRow);\n const prevId = getId(prevRow);\n if (nextId !== prevId) return null;\n if (prevRow !== nextRow) {\n updates.push({ id: nextId, changes: nextRow as Record<string, unknown> });\n }\n }\n return updates;\n}\n","import {\n AfterContentInit,\n ApplicationRef,\n Directive,\n effect,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n OnDestroy,\n OnInit,\n output,\n untracked,\n ViewContainerRef,\n} from '@angular/core';\nimport type {\n ColumnConfig as BaseColumnConfig,\n CellActivateDetail,\n CellChangeDetail,\n CellClickDetail,\n ColumnConfigMap,\n ColumnInferenceMode,\n ColumnResizeDetail,\n FitMode,\n GridColumnState,\n DataGridElement as GridElement,\n RowClickDetail,\n SortChangeDetail,\n TbwScrollDetail,\n} from '@toolbox-web/grid';\nimport { DataGridElement as GridElementClass } from '@toolbox-web/grid';\n// Import editing event types from the editing plugin\n// Import plugin config types only. Specific plugin classes are intentionally\n// not imported here — feature-specific bridging lives in the feature secondary\n// entries (see `internal/feature-extensions.ts`).\nimport type { ColumnResizeResetDetail, DataChangeDetail, DataGridEventMap, RenderDetail } from '@toolbox-web/grid/all';\nimport type { ColumnConfig, GridConfig } from '../angular-column-config';\nimport { GridAdapter } from '../angular-grid-adapter';\nimport { applyColumnDefaults, type ColumnShorthand, normalizeColumns } from '../column-shorthand';\nimport { createPluginFromFeature, type FeatureName } from '../feature-registry';\nimport { GridIconRegistry } from '../grid-icon-registry';\nimport { getFeatureClaim, isEventClaimed } from '../internal/feature-claims';\nimport { getFeatureConfigPreprocessor, runTemplateBridges } from '../internal/feature-extensions';\nimport { computeRowDiff } from './row-diff';\n\n/**\n * Event detail for cell commit events.\n * @since 0.1.1\n */\nexport interface CellCommitEvent<TRow = unknown, TValue = unknown> {\n /** The row data object */\n row: TRow;\n /** The field name of the edited column */\n field: string;\n /** The new value after edit */\n value: TValue;\n /** The row index in the data array */\n rowIndex: number;\n /** Array of all rows that have been modified */\n changedRows: TRow[];\n /** Set of row indices that have been modified */\n changedRowIndices: Set<number>;\n /** Whether this is the first modification to this row */\n firstTimeForRow: boolean;\n}\n\n/**\n * Event detail for row commit events (bulk editing).\n * @since 0.1.1\n */\nexport interface RowCommitEvent<TRow = unknown> {\n /** The row data object */\n row: TRow;\n /** The row index in the data array */\n rowIndex: number;\n /** Array of all rows that have been modified */\n changedRows: TRow[];\n /** Set of row indices that have been modified */\n changedRowIndices: Set<number>;\n /** Whether this is the first modification to this row */\n firstTimeForRow: boolean;\n}\n\n/**\n * Directive that automatically registers the Angular adapter with tbw-grid elements.\n *\n * This directive eliminates the need to manually register the adapter in your component\n * constructor. Simply import this directive and it will handle adapter registration.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-root',\n * imports: [Grid],\n * template: `\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\" [customStyles]=\"myStyles\">\n * <!-- column templates -->\n * </tbw-grid>\n * `\n * })\n * export class AppComponent {\n * rows = [...];\n * config = {...};\n * myStyles = `.my-class { color: red; }`;\n * }\n * ```\n *\n * The directive automatically:\n * - Creates a GridAdapter instance\n * - Registers it with the GridElement\n * - Injects custom styles into the grid\n * - Handles cleanup on destruction\n *\n * ## Multi-version coexistence\n *\n * In single-version apps the directive matches the bare `<tbw-grid>` tag. When\n * two different grid versions share a page, the second-loaded bundle registers\n * under a version-suffixed tag (e.g. `<tbw-grid-v2-15-0>`). Because Angular\n * matches selectors at compile time, a runtime-only tag cannot be matched by\n * tag name. The directive therefore also matches the stable `[data-tbw-grid]`\n * attribute, so a suffixed grid can opt in by adding it literally:\n *\n * ```html\n * <tbw-grid-v2-15-0 data-tbw-grid [rows]=\"rows\" [gridConfig]=\"config\"></tbw-grid-v2-15-0>\n * ```\n *\n * Read the concrete tag from `DataGridElement.activeTag` of the bundle you\n * imported. See the multi-version coexistence guide.\n *\n * @category Directive\n * @since 0.1.0\n */\n@Directive({ selector: 'tbw-grid,[data-tbw-grid]' })\nexport class Grid implements OnInit, AfterContentInit, OnDestroy {\n private elementRef = inject(ElementRef<GridElement>);\n private injector = inject(EnvironmentInjector);\n private appRef = inject(ApplicationRef);\n private viewContainerRef = inject(ViewContainerRef);\n private iconRegistry = inject(GridIconRegistry, { optional: true });\n\n private adapter: GridAdapter | null = null;\n\n /**\n * Previous rows snapshot for in-place diffing — kept in sync by the rows\n * effect. Plain field so Angular's signal tracking ignores it.\n */\n private prevRows: unknown[] = [];\n\n constructor() {\n // Effect to process gridConfig and apply to grid\n // This merges feature input plugins with the user's config plugins\n effect(() => {\n const userGridConfig = this.gridConfig();\n\n const angularCfg = userGridConfig;\n if (!this.adapter) return;\n\n // Create plugins from feature inputs\n const featurePlugins = this.createFeaturePlugins();\n\n // Build core config overrides from individual inputs\n const sortableValue = this.sortable();\n const filterableValue = this.filterable();\n const selectableValue = this.selectable();\n const coreConfigOverrides: Record<string, unknown> = {};\n if (sortableValue !== undefined) {\n coreConfigOverrides['sortable'] = sortableValue;\n }\n if (filterableValue !== undefined) {\n coreConfigOverrides['filterable'] = filterableValue;\n }\n if (selectableValue !== undefined) {\n coreConfigOverrides['selectable'] = selectableValue;\n }\n\n const grid = this.elementRef.nativeElement;\n\n // Merge icon overrides from registry with any existing icons\n // Registry icons are base, config.icons override them\n const registryIcons = this.iconRegistry?.getAll();\n if (registryIcons && Object.keys(registryIcons).length > 0) {\n const existingIcons = angularCfg?.icons || {};\n coreConfigOverrides['icons'] = { ...registryIcons, ...existingIcons };\n }\n\n // Nothing to do if there's no config input and no feature inputs\n const hasFeaturePlugins = featurePlugins.length > 0;\n const hasConfigOverrides = Object.keys(coreConfigOverrides).length > 0;\n\n if (!angularCfg && !hasFeaturePlugins && !hasConfigOverrides) {\n return;\n }\n\n const userConfig = angularCfg || {};\n\n // Merge feature-input plugins with the user's own plugins\n const configPlugins = userConfig.plugins || [];\n const mergedPlugins = [...featurePlugins, ...configPlugins];\n\n // The interceptor on element.gridConfig (installed in ngOnInit)\n // handles converting component classes → functions via processGridConfig,\n // so we can pass the raw Angular config through. The interceptor is\n // idempotent, making this safe even if the config is already processed.\n grid.gridConfig = {\n ...userConfig,\n ...coreConfigOverrides,\n plugins: mergedPlugins.length > 0 ? mergedPlugins : userConfig.plugins,\n };\n });\n\n // Effect to sync loading state to the grid element\n effect(() => {\n const loadingValue = this.loading();\n if (loadingValue === undefined) return;\n\n const grid = this.elementRef.nativeElement;\n grid.loading = loadingValue;\n });\n\n // Effect to sync rows to the grid element\n //\n // Smart diff: when getRowId is configured and the same rows appear in the\n // same order with only their values changed, route through updateRows() to\n // patch in-place. This triggers only RenderPhase.VIRTUALIZATION instead of\n // the heavier ROWS phase, which rebuilds the row model and re-applies\n // sort/filter. Mirrors the React and Vue adapters.\n effect(() => {\n const rowsValue = this.rows();\n if (rowsValue === undefined) return;\n\n const grid = this.elementRef.nativeElement;\n const prev = this.prevRows;\n // Read getRowId without registering as a signal dependency so this effect\n // only re-runs on rows changes, not on every gridConfig change.\n const getId = untracked(() => this.gridConfig()?.getRowId) as ((row: unknown) => string) | undefined;\n this.prevRows = rowsValue;\n\n if (getId) {\n const diff = computeRowDiff(rowsValue, prev, getId);\n if (diff !== null) {\n if (diff.length > 0) {\n // 'sync' source: authoritative host data, not a user edit — editing\n // plugin skips dirty marking / undo history for it.\n try {\n grid.updateRows(diff, 'sync');\n } catch {\n // getRowId changed alongside rows (grid still resolving ids with\n // the previous resolver) or an id vanished — fall back to a full\n // replace, which reapplies the whole array under the current resolver.\n grid.rows = rowsValue;\n }\n }\n return;\n }\n }\n\n // Structural change (adds/removes/reorder), no getRowId, or initial load — full replace.\n grid.rows = rowsValue;\n });\n\n // Effect to sync columns to the grid element\n effect(() => {\n const columnsValue = this.columns();\n if (columnsValue === undefined) return;\n\n const grid = this.elementRef.nativeElement;\n // First normalize any shorthand strings to ColumnConfig objects, then\n // merge in any per-grid column defaults. Individual column props always win.\n // Note: Angular ColumnConfig allows component classes for renderer/editor,\n // which the adapter normalizes via processColumn below; we widen to `any`\n // here so the shorthand helpers (typed against the core ColumnConfig) accept\n // the Angular-flavoured payload unchanged.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const normalized = applyColumnDefaults<any>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n normalizeColumns<any>(columnsValue as ColumnShorthand<any>[]),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.columnDefaults() as any,\n );\n // Process columns through the adapter to convert Angular component classes\n // (renderer/editor) to functions — the grid's columns setter does NOT call\n // processConfig, unlike gridConfig. Without this, raw component classes\n // would be invoked without `new`, causing runtime errors.\n const processed = this.adapter\n ? (normalized as ColumnConfig[]).map((col) => this.adapter!.processColumn(col))\n : normalized;\n grid.columns = processed as BaseColumnConfig[] | ColumnConfigMap;\n });\n\n // Effect to sync fitMode to the grid element\n effect(() => {\n const fitModeValue = this.fitMode();\n if (fitModeValue === undefined) return;\n\n const grid = this.elementRef.nativeElement;\n grid.fitMode = fitModeValue;\n });\n\n // Effect to sync columnInference to the grid element\n effect(() => {\n const columnInferenceValue = this.columnInference();\n const grid = this.elementRef.nativeElement;\n grid.columnInference = columnInferenceValue;\n });\n }\n\n /**\n * Custom CSS styles to inject into the grid.\n * Use this to style custom cell renderers, editors, or detail panels.\n *\n * @example\n * ```typescript\n * // In your component\n * customStyles = `\n * .my-detail-panel { padding: 16px; }\n * .my-status-badge { border-radius: 4px; }\n * `;\n * ```\n *\n * ```html\n * <tbw-grid [customStyles]=\"customStyles\">...</tbw-grid>\n * ```\n */\n customStyles = input<string>();\n\n /**\n * Grid-wide sorting toggle.\n * When false, disables sorting for all columns regardless of their individual `sortable` setting.\n * When true (default), columns with `sortable: true` can be sorted.\n *\n * This is a core grid config property, not a plugin feature.\n * For multi-column sorting, also add the `[multiSort]` feature.\n *\n * @default true\n *\n * @example\n * ```html\n * <!-- Disable all sorting -->\n * <tbw-grid [sortable]=\"false\" />\n *\n * <!-- Enable sorting (default) - columns still need sortable: true -->\n * <tbw-grid [sortable]=\"true\" />\n *\n * <!-- Enable multi-column sorting -->\n * <tbw-grid [sortable]=\"true\" [multiSort]=\"true\" />\n * ```\n */\n sortable = input<boolean>();\n\n /**\n * Grid-wide filtering toggle.\n * When false, disables filtering for all columns regardless of their individual `filterable` setting.\n * When true (default), columns with `filterable: true` can be filtered.\n *\n * Requires the FilteringPlugin to be loaded.\n *\n * @default true\n *\n * @example\n * ```html\n * <!-- Disable all filtering -->\n * <tbw-grid [filterable]=\"false\" [filtering]=\"true\" />\n *\n * <!-- Enable filtering (default) -->\n * <tbw-grid [filterable]=\"true\" [filtering]=\"true\" />\n * ```\n */\n filterable = input<boolean>();\n\n /**\n * Grid-wide selection toggle.\n * When false, disables selection for all rows/cells.\n * When true (default), selection is enabled based on plugin mode.\n *\n * Requires the SelectionPlugin to be loaded.\n *\n * @default true\n *\n * @example\n * ```html\n * <!-- Disable all selection -->\n * <tbw-grid [selectable]=\"false\" [selection]=\"'range'\" />\n *\n * <!-- Enable selection (default) -->\n * <tbw-grid [selectable]=\"true\" [selection]=\"'range'\" />\n * ```\n */\n selectable = input<boolean>();\n\n /**\n * Show a loading overlay on the grid.\n * Use this during initial data fetch or refresh operations.\n *\n * For row/cell loading states, access the grid element directly:\n * - `grid.setRowLoading(rowId, true/false)`\n * - `grid.setCellLoading(rowId, field, true/false)`\n *\n * @default false\n *\n * @example\n * ```html\n * <!-- Show loading during data fetch -->\n * <tbw-grid [loading]=\"isLoading\" [rows]=\"rows\" />\n * ```\n *\n * ```typescript\n * isLoading = true;\n *\n * ngOnInit() {\n * this.dataService.fetchData().subscribe(data => {\n * this.rows = data;\n * this.isLoading = false;\n * });\n * }\n * ```\n */\n loading = input<boolean>();\n\n /**\n * The data rows to display in the grid.\n *\n * Accepts an array of data objects. Each object represents one row.\n * The grid reads property values for each column's `field` from these objects.\n *\n * @example\n * ```html\n * <tbw-grid [rows]=\"employees()\" [gridConfig]=\"config\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rows = input<any[]>();\n\n /**\n * Column configuration array.\n *\n * Accepts either full `ColumnConfig` objects or shorthand strings such as\n * `'name'` or `'salary:number'`. Shorthands auto-generate human-readable\n * headers from the field name.\n *\n * Shorthand for setting columns without wrapping them in a full `gridConfig`.\n * If both `columns` and `gridConfig.columns` are set, `columns` takes precedence\n * (see configuration precedence system).\n *\n * @example\n * ```html\n * <tbw-grid [rows]=\"data\" [columns]=\"['id:number', 'name', { field: 'status', editable: true }]\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n columns = input<ColumnShorthand<any>[]>();\n\n /**\n * Default column properties applied to every column in `columns`.\n * Individual column properties override these defaults.\n *\n * @example\n * ```html\n * <tbw-grid\n * [columnDefaults]=\"{ sortable: true, resizable: true }\"\n * [columns]=\"[{ field: 'id', sortable: false }, { field: 'name' }]\"\n * />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n columnDefaults = input<Partial<ColumnConfig<any>>>();\n\n /**\n * Column sizing strategy.\n *\n * - `'stretch'` (default) — columns stretch to fill available width\n * - `'fixed'` — columns use their declared widths; enables horizontal scrolling\n * - `'auto-fit'` — columns auto-size to content, then stretch to fill\n *\n * @default 'stretch'\n *\n * @example\n * ```html\n * <tbw-grid [rows]=\"data\" fitMode=\"fixed\" />\n * <tbw-grid [rows]=\"data\" [fitMode]=\"dynamicMode()\" />\n * ```\n */\n fitMode = input<FitMode>();\n\n /**\n * How automatic column inference combines with explicitly provided columns.\n *\n * - `'auto'` (default): infer only when no columns are provided.\n * - `'merge'`: always infer from data, then overlay provided columns by `field`.\n *\n * @example\n * ```html\n * <tbw-grid [rows]=\"data\" columnInference=\"merge\" />\n * <tbw-grid [rows]=\"data\" [columnInference]=\"mode()\" />\n * ```\n */\n columnInference = input<ColumnInferenceMode>();\n\n /**\n * Grid configuration object with optional Angular-specific extensions.\n *\n * Accepts Angular-augmented `GridConfig` from `@toolbox-web/grid-angular`.\n * You can specify Angular component classes directly for renderers and editors.\n *\n * Component classes must implement the appropriate interfaces:\n * - Renderers: `CellRenderer<TRow, TValue>` - requires `value()` and `row()` signal inputs\n * - Editors: `CellEditor<TRow, TValue>` - adds `commit` and `cancel` outputs\n *\n * @example\n * ```typescript\n * // Simple config with plain renderers\n * config: GridConfig = {\n * columns: [\n * { field: 'name', header: 'Name' },\n * { field: 'active', type: 'boolean' }\n * ],\n * typeDefaults: {\n * boolean: { renderer: (ctx) => ctx.value ? '✓' : '✗' }\n * }\n * };\n *\n * // Config with component classes\n * config: GridConfig<Employee> = {\n * columns: [\n * { field: 'name', header: 'Name' },\n * { field: 'bonus', header: 'Bonus', editable: true, editor: BonusEditorComponent }\n * ]\n * };\n * ```\n *\n * ```html\n * <tbw-grid [gridConfig]=\"config\" [rows]=\"employees\"></tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n gridConfig = input<GridConfig<any>>();\n\n // ═══════════════════════════════════════════════════════════════════════════\n // EVENT OUTPUTS - All grid events\n // ═══════════════════════════════════════════════════════════════════════════\n\n /**\n * Emitted when a cell is clicked.\n *\n * @example\n * ```html\n * <tbw-grid (cellClick)=\"onCellClick($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cellClick = output<CellClickDetail<any>>();\n\n /**\n * Emitted when a row is clicked.\n *\n * @example\n * ```html\n * <tbw-grid (rowClick)=\"onRowClick($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rowClick = output<RowClickDetail<any>>();\n\n /**\n * Emitted when a cell is activated (Enter key or double-click).\n *\n * @example\n * ```html\n * <tbw-grid (cellActivate)=\"onCellActivate($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cellActivate = output<CellActivateDetail<any>>();\n\n /**\n * Emitted when a cell value changes (before commit).\n *\n * @example\n * ```html\n * <tbw-grid (cellChange)=\"onCellChange($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cellChange = output<CellChangeDetail<any>>();\n\n /**\n * Emitted when row data is replaced (e.g. via the `rows` setter).\n *\n * @example\n * ```html\n * <tbw-grid (dataChange)=\"onDataChange($event)\">...</tbw-grid>\n * ```\n */\n dataChange = output<DataChangeDetail>();\n\n /**\n * Emitted when sort state changes.\n *\n * @example\n * ```html\n * <tbw-grid (sortChange)=\"onSortChange($event)\">...</tbw-grid>\n * ```\n */\n sortChange = output<SortChangeDetail>();\n\n /**\n * Emitted when a column is resized.\n *\n * @example\n * ```html\n * <tbw-grid (columnResize)=\"onColumnResize($event)\">...</tbw-grid>\n * ```\n */\n columnResize = output<ColumnResizeDetail>();\n\n /**\n * Emitted when a column's width is reset (double-click on the resize handle).\n *\n * @example\n * ```html\n * <tbw-grid (columnResizeReset)=\"onColumnResizeReset($event)\">...</tbw-grid>\n * ```\n */\n columnResizeReset = output<ColumnResizeResetDetail>();\n\n /**\n * Emitted when column state changes (resize, reorder, visibility).\n *\n * @example\n * ```html\n * <tbw-grid (columnStateChange)=\"onColumnStateChange($event)\">...</tbw-grid>\n * ```\n */\n columnStateChange = output<GridColumnState>();\n\n /**\n * Emitted (rAF-batched) when the grid's viewport is scrolled vertically.\n *\n * For server-side pagination of large datasets prefer `ServerSidePlugin`\n * — this event is the lower-level primitive for custom load-more triggers,\n * deferring heavy cell content, dismissing overlays, etc.\n *\n * Named `tbwScroll` (not `scroll`) to avoid collision with the native DOM\n * scroll event that bubbles from focusable internals.\n *\n * @example\n * ```html\n * <tbw-grid (tbwScroll)=\"onScroll($event)\">...</tbw-grid>\n * ```\n */\n tbwScroll = output<TbwScrollDetail>();\n\n /**\n * Emitted once at the end of every render-scheduler flush, after all\n * plugin `afterRender` hooks have run and `ready()` has resolved.\n *\n * Use this to act on the rendered DOM after a programmatic mutation\n * (e.g. focus the first input of a freshly added row in full-grid edit\n * mode) without `setTimeout` or double-`requestAnimationFrame` hacks.\n * The `render` event fires on every flush — including scroll-driven\n * virtual-window updates — so prefer subscribing once and unsubscribing\n * (or gating on `detail.phase >= RenderPhase.ROWS`) when you only care\n * about a specific mutation.\n *\n * @example\n * ```html\n * <tbw-grid (render)=\"onRender($event)\">...</tbw-grid>\n * ```\n */\n render = output<RenderDetail>();\n\n // Map of output names to event names for automatic wiring.\n //\n // The `satisfies` clause enforces compile-time sync against\n // `DataGridEventMap`: every value must be a real event name (typos and\n // stale entries pointing at non-existent events fail to compile).\n // Plugin event augmentations of `DataGridEventMap` flow through\n // automatically via the `/all` import.\n private readonly eventOutputMap = {\n cellClick: 'cell-click',\n rowClick: 'row-click',\n cellActivate: 'cell-activate',\n cellChange: 'cell-change',\n dataChange: 'data-change',\n sortChange: 'sort-change',\n columnResize: 'column-resize',\n columnResizeReset: 'column-resize-reset',\n columnStateChange: 'column-state-change',\n tbwScroll: 'tbw-scroll',\n render: 'render',\n } as const satisfies Readonly<Record<string, keyof DataGridEventMap<unknown>>>;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Forward-only event coverage guard.\n //\n // Mirrors the React adapter's `_AssertFeaturePropsCoverCore` pattern. If a\n // new event is added to core's `DataGridEventMap` (via plugin module\n // augmentation in `/all`) but no `eventOutputMap` entry covers it, this\n // type fails to evaluate to `true` and the build breaks. Adapter consumers\n // never see a silently-dropped event.\n //\n // Reverse direction (extra `eventOutputMap` entries pointing at non-existent\n // events) is already enforced by the `satisfies` clause above.\n //\n // To consciously omit an event from the `Grid` directive surface, add it to\n // the `_intentionallyOmittedEvents` union below with a comment explaining why.\n // ─────────────────────────────────────────────────────────────────────────\n /**\n * Events deliberately not exposed as outputs on the `Grid` directive.\n *\n * Every entry here is a **feature-owned** event surfaced by its per-feature\n * directive instead (e.g. `GridEditingDirective` declares `(cellCommit)`,\n * `GridSelectionDirective` declares `(selectionChange)`). The directive\n * claims the DOM event via `claimEvent` so it is the sole emitter. The v1.x\n * shims that forwarded these events from `Grid` were removed in v3.0.0 —\n * consumers must import the relevant feature directive.\n */\n declare private _intentionallyOmittedEvents:\n | 'cell-commit'\n | 'cell-cancel'\n | 'row-commit'\n | 'changed-rows-reset'\n | 'edit-open'\n | 'before-edit-close'\n | 'edit-close'\n | 'dirty-change'\n | 'filter-change'\n | 'column-move'\n | 'column-visibility'\n | 'selection-change'\n | 'row-move'\n | 'row-drag-start'\n | 'row-drag-end'\n | 'row-drop'\n | 'row-transfer'\n | 'group-toggle'\n | 'group-expand'\n | 'group-collapse'\n | 'tree-expand'\n | 'detail-expand'\n | 'responsive-change'\n | 'context-menu-open'\n | 'copy'\n | 'paste'\n | 'paste-rejected'\n | 'undo'\n | 'redo'\n | 'export-complete'\n | 'print-start'\n | 'print-complete';\n declare private _assertEventOutputMapCoversCore: [\n Exclude<\n keyof DataGridEventMap<unknown>,\n | (typeof Grid.prototype.eventOutputMap)[keyof typeof Grid.prototype.eventOutputMap]\n | Grid['_intentionallyOmittedEvents']\n >,\n ] extends [never]\n ? true\n : [\n 'Missing Angular outputs for core grid events:',\n Exclude<\n keyof DataGridEventMap<unknown>,\n | (typeof Grid.prototype.eventOutputMap)[keyof typeof Grid.prototype.eventOutputMap]\n | Grid['_intentionallyOmittedEvents']\n >,\n ];\n\n // Store event listeners for cleanup\n private eventListeners: Map<string, (e: Event) => void> = new Map();\n\n ngOnInit(): void {\n // Create and register the adapter\n this.adapter = new GridAdapter(this.injector, this.appRef, this.viewContainerRef);\n GridElementClass.registerAdapter(this.adapter);\n\n const grid = this.elementRef.nativeElement;\n\n // Register adapter on the grid element so processConfig is called\n // automatically by the grid's set gridConfig setter, and so\n // MasterDetailPlugin can use it via the __frameworkAdapter hook during attach()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (grid as any).__frameworkAdapter = this.adapter;\n\n // Wire up all event listeners based on eventOutputMap\n this.setupEventListeners(grid);\n }\n\n /**\n * Sets up event listeners for the core outputs in `eventOutputMap`.\n *\n * Feature-owned events (e.g. `cell-commit`, `selection-change`) are not in\n * `eventOutputMap` — they are surfaced by their per-feature directive, which\n * claims the DOM event via `claimEvent`. Events still claimed here are\n * skipped so the claiming directive's `output()` is the sole emitter.\n */\n private setupEventListeners(grid: GridElement): void {\n // Wire up all event listeners\n for (const [outputName, eventName] of Object.entries(this.eventOutputMap)) {\n if (isEventClaimed(grid, eventName)) continue;\n const listener = (e: Event) => {\n const detail = (e as CustomEvent).detail;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any)[outputName].emit(detail);\n };\n grid.addEventListener(eventName, listener);\n this.eventListeners.set(eventName, listener);\n }\n }\n\n /**\n * Creates plugins from the per-feature directive claims.\n * Uses the feature registry to allow tree-shaking - only imported features are bundled.\n * Per-feature config bridging (e.g. converting Angular component classes inside\n * `groupingColumns` / `groupingRows` / `pinnedRows` configs to renderer functions)\n * runs via `getFeatureConfigPreprocessor`, populated by feature secondary entries.\n *\n * v3 ownership: feature configuration is owned entirely by the per-feature\n * attribute-selector directives (e.g. `GridFilteringDirective`). When such a\n * directive is present on the same `<tbw-grid>` element it claims its feature\n * in `feature-claims.ts`; we read the claim's config getter — which\n * transitively reads the directive's input signal, establishing reactive\n * dependency tracking. The deprecated per-feature inputs that previously\n * lived on this directive were removed in v3.0.0.\n *\n * Returns the array of created plugins (doesn't modify grid).\n */\n private createFeaturePlugins(): unknown[] {\n const plugins: unknown[] = [];\n const adapter = this.adapter;\n const grid = this.elementRef.nativeElement;\n\n // Helper to add a plugin when its per-feature directive claims the feature.\n const addPlugin = (name: FeatureName) => {\n // Reading the claim's getter registers the directive's input signal as a\n // dependency, so changes to e.g. `[filtering]` on the directive\n // re-trigger this effect.\n const claim = getFeatureClaim(grid, name);\n const config = claim ? claim() : undefined;\n if (config === undefined || config === null || config === false) return;\n // Apply per-feature config preprocessor (registered by feature secondary entries)\n // to bridge Angular component classes embedded in the config before instantiation.\n let finalConfig: unknown = config;\n if (adapter && config !== true && typeof config === 'object') {\n const preprocess = getFeatureConfigPreprocessor(name);\n if (preprocess) finalConfig = preprocess(config, adapter);\n }\n const plugin = createPluginFromFeature(name, finalConfig);\n if (plugin) plugins.push(plugin);\n };\n\n addPlugin('selection');\n addPlugin('editing');\n addPlugin('clipboard');\n addPlugin('contextMenu');\n addPlugin('multiSort');\n addPlugin('filtering');\n addPlugin('reorderColumns');\n addPlugin('visibility');\n addPlugin('pinnedColumns');\n addPlugin('groupingColumns');\n addPlugin('columnVirtualization');\n addPlugin('rowDragDrop');\n addPlugin('groupingRows');\n addPlugin('pinnedRows');\n addPlugin('tree');\n addPlugin('masterDetail');\n addPlugin('responsive');\n addPlugin('undoRedo');\n addPlugin('export');\n addPlugin('print');\n addPlugin('pivot');\n addPlugin('serverSide');\n addPlugin('stickyRows');\n addPlugin('tooltip');\n\n return plugins;\n }\n\n ngAfterContentInit(): void {\n // After Angular child directives have initialized (GridColumnView, GridColumnEditor, GridDetailView, GridToolPanel),\n // force the grid to re-parse light DOM columns so adapters can create renderers/editors\n const grid = this.elementRef.nativeElement;\n if (grid && typeof (grid as any).refreshColumns === 'function') {\n // Use setTimeout to ensure Angular effects have run (template registration)\n setTimeout(() => {\n (grid as any).refreshColumns();\n\n // Run feature-registered template bridges. Each bridge wires a specific\n // light-DOM slot element (<tbw-grid-detail>, <tbw-grid-responsive-card>, ...)\n // to its plugin. Bridges are registered by feature secondary entries\n // (e.g. `import '@toolbox-web/grid-angular/features/master-detail';`).\n if (this.adapter) {\n runTemplateBridges({ grid, adapter: this.adapter });\n }\n\n // Refresh shell header to pick up tool panel templates\n // This allows Angular templates to be used in tool panels\n if (typeof (grid as any).refreshShellHeader === 'function') {\n (grid as any).refreshShellHeader();\n }\n\n // Register custom styles if provided\n this.registerCustomStyles(grid);\n }, 0);\n }\n }\n\n /**\n * Registers custom styles into the grid.\n * Uses the grid's registerStyles() API for clean encapsulation.\n */\n private registerCustomStyles(grid: GridElement): void {\n const styles = this.customStyles();\n if (!styles) return;\n\n // Wait for grid to be ready before registering styles\n grid.ready?.().then(() => {\n grid.registerStyles?.('angular-custom-styles', styles);\n });\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n\n // Cleanup all event listeners\n if (grid) {\n for (const [eventName, listener] of this.eventListeners) {\n grid.removeEventListener(eventName, listener);\n }\n this.eventListeners.clear();\n }\n\n // Cleanup custom styles\n if (grid && this.customStyles()) {\n grid.unregisterStyles?.('angular-custom-styles');\n }\n\n // Cleanup adapter if needed\n if (this.adapter) {\n this.adapter.destroy?.();\n this.adapter = null;\n }\n }\n}\n","/**\n * Combined provider helper for grid type defaults and icons.\n *\n * Convenience function that combines `provideGridTypeDefaults` and\n * `provideGridIcons` into a single call for application bootstrap.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * import { ApplicationConfig } from '@angular/core';\n * import { provideGrid } from '@toolbox-web/grid-angular';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGrid({\n * typeDefaults: {\n * country: { renderer: CountryCellComponent },\n * },\n * icons: {\n * sortAsc: '↑',\n * sortDesc: '↓',\n * },\n * }),\n * ],\n * };\n * ```\n */\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport type { GridIcons } from '@toolbox-web/grid';\nimport { provideGridIcons } from './grid-icon-registry';\nimport { provideGridTypeDefaults, type TypeDefaultRegistration } from './grid-type-registry';\n\n/**\n * Options for {@link provideGrid}.\n * @since 1.4.0\n */\nexport interface ProvideGridOptions {\n /** Type defaults to register globally. Equivalent to `provideGridTypeDefaults`. */\n typeDefaults?: Record<string, TypeDefaultRegistration>;\n /** Icon overrides to register globally. Equivalent to `provideGridIcons`. */\n icons?: Partial<GridIcons>;\n}\n\n/**\n * Combined provider for grid type defaults and icons.\n *\n * Returns environment providers that can be added to your `ApplicationConfig`\n * `providers` array. Either field is optional — only the registries you\n * supply are wired up.\n *\n * Equivalent to calling `provideGridTypeDefaults(options.typeDefaults)` and\n * `provideGridIcons(options.icons)` separately.\n * @since 1.4.0\n */\nexport function provideGrid(options: ProvideGridOptions = {}): EnvironmentProviders {\n const providers: EnvironmentProviders[] = [];\n if (options.typeDefaults) {\n providers.push(provideGridTypeDefaults(options.typeDefaults));\n }\n if (options.icons) {\n providers.push(provideGridIcons(options.icons));\n }\n return makeEnvironmentProviders(providers);\n}\n","/**\n * @packageDocumentation\n * @toolbox-web/grid-angular - Angular adapter for @toolbox-web/grid.\n *\n * Provides directives for seamless Angular integration with the grid component.\n */\n\n// Primary export\nexport {\n GridAdapter,\n makeFlushFocusedInput,\n registerDetailRendererBridge,\n registerEditorMountHook,\n registerEditorSpecBridge,\n registerFilterPanelTypeDefaultBridge,\n registerResponsiveCardRendererBridge,\n registerToolPanelRendererBridge,\n} from './lib/angular-grid-adapter';\nexport type {\n EditorMountHook,\n EditorSpecBridge,\n FilterPanelTypeDefaultBridge,\n RowRendererBridge,\n ToolPanelRendererBridge,\n} from './lib/angular-grid-adapter';\n\n// Configuration types\nexport { isComponentClass } from './lib/angular-column-config';\nexport type {\n CellEditor,\n CellRenderer,\n ColumnConfig,\n FilterPanel,\n GridConfig,\n TypeDefault,\n} from './lib/angular-column-config';\n\n// Field-key types for nested dotted-path columns (issue #438)\nexport type { ColumnFieldKey, NestedPaths } from '@toolbox-web/grid';\n\n// Type registry for application-wide type defaults\nexport { GRID_TYPE_DEFAULTS, GridTypeRegistry, provideGridTypeDefaults } from './lib/grid-type-registry';\nexport type { TypeDefaultRegistration } from './lib/grid-type-registry';\n\n// Icon registry for application-wide icon overrides\nexport { GRID_ICONS, GridIconRegistry, provideGridIcons } from './lib/grid-icon-registry';\n\n// Inject function for programmatic grid access\nexport { injectGrid } from './lib/inject-grid';\nexport type { InjectGridReturn } from './lib/inject-grid';\n\n// Feature registry for tree-shakeable plugin registration\nexport {\n clearFeatureRegistry,\n createPluginFromFeature,\n getFeatureFactory,\n getRegisteredFeatures,\n isFeatureRegistered,\n registerFeature,\n} from './lib/feature-registry';\nexport type { FeatureName, PluginFactory } from './lib/feature-registry';\n\n// Core directives. Feature-owned directives (editors, filter panels,\n// master-detail, responsive cards, shell) live in their `features/<feature>`\n// secondary entries, not here.\nexport { GridColumnView } from './lib/directives/grid-column-view.directive';\nexport type { GridCellContext } from './lib/directives/grid-column-view.directive';\nexport { TbwGridColumn } from './lib/directives/grid-column.directive';\nexport { TbwGridHeader } from './lib/directives/grid-header.directive';\nexport { TbwGridToolButtons } from './lib/directives/grid-tool-buttons.directive';\nexport { TbwGridType } from './lib/directives/grid-type.directive';\nexport { Grid } from './lib/directives/grid.directive';\nexport type { CellCommitEvent, RowCommitEvent } from './lib/directives/grid.directive';\n\n// Structural directives for cleaner template syntax. `TbwRenderer` stays in the\n// main entry (editor-agnostic). `TbwEditor` lives in the `features/editing`\n// secondary entry.\nexport { TbwRenderer } from './lib/directives/structural-directives';\nexport type { StructuralCellContext } from './lib/directives/structural-directives';\n\n// Column shorthand utilities (parity with grid-react / grid-vue)\nexport {\n applyColumnDefaults,\n hasColumnShorthands,\n normalizeColumns,\n parseColumnShorthand,\n} from './lib/column-shorthand';\nexport type { ColumnShorthand } from './lib/column-shorthand';\n\n// Combined provider helper (parity with grid-vue's GridProvider component)\nexport { provideGrid } from './lib/grid-provider';\nexport type { ProvideGridOptions } from './lib/grid-provider';\n\n// Internal extension points used by feature secondary entries to plug into the\n// core Grid directive (template bridges + per-feature config preprocessors).\n// These are public for cross-entry-point use; not part of the supported API.\nexport {\n getFeatureConfigPreprocessor,\n registerFeatureConfigPreprocessor,\n registerTemplateBridge,\n runTemplateBridges,\n} from './lib/internal/feature-extensions';\nexport type {\n FeatureConfigPreprocessor,\n TemplateBridge,\n TemplateBridgeContext,\n} from './lib/internal/feature-extensions';\n\n// Per-grid claims registry used by feature-attribute directives to take\n// ownership of inputs/outputs that are otherwise handled by the central\n// `Grid` directive. Public for cross-entry-point use; not part of the\n// supported API. See `internal/feature-claims.ts` for the design rationale.\nexport {\n claimEvent,\n getFeatureClaim,\n isEventClaimed,\n registerFeatureClaim,\n unclaimEvent,\n unregisterFeatureClaim,\n} from './lib/internal/feature-claims';\nexport type { FeatureConfigGetter } from './lib/internal/feature-claims';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["GridElementClass"],"mappings":";;;;;;;AAmRA;AAEA;AACA;;;;;;;;;;AAUG;AACG,SAAU,gBAAgB,CAAC,KAAc,EAAA;IAC7C,IAAI,OAAO,KAAK,KAAK,UAAU,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE;AAChE,QAAA,OAAO,KAAK;IACd;;IAGA,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE;AAC9G,QAAA,OAAO,IAAI;IACb;;;AAIA,IAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AACxD,IAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;AACvE;AACA;;AC9RA;AACA,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA6C;AAE7E;;;AAGG;AACG,SAAU,eAAe,CAAC,OAAoB,EAAA;AAClD,IAAA,OAAO,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC;AACtC;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;MAEU,cAAc,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAEpD;;AAEG;AACH,IAAA,QAAQ,GAAG,YAAY,EAAC,WAA4B;iFAAC;;AAG7C,IAAA,kBAAkB,GAAG,MAAM,CAAC,MAAK;AACvC,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE;QAChC,IAAI,QAAQ,EAAE;;YAEZ,gBAAgB,CAAC,GAA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;AACA,IAAA,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjD;AACA,IAAA,OAAO,wBAAwB,CAAC,SAAS,CAAC;AAC5C;;AC/DA;;;;;AAKG;AAEH;;ACPA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"toolbox-web-grid-angular.mjs","sources":["../../../../libs/grid-angular/src/lib/angular-column-config.ts","../../../../libs/grid-angular/src/lib/directives/grid-column-view.directive.ts","../../../../libs/grid-angular/src/lib/directives/structural-directives.ts","../../../../libs/grid-angular/src/lib/editor-mount-hooks.ts","../../../../libs/grid-angular/src/lib/editor-wiring.ts","../../../../libs/grid-angular/src/lib/grid-type-registry.ts","../../../../libs/grid-angular/src/lib/internal/feature-bridges.ts","../../../../libs/grid-angular/src/lib/internal/feature-extensions.ts","../../../../libs/grid-angular/src/lib/angular-grid-adapter.ts","../../../../libs/grid-angular/src/lib/grid-icon-registry.ts","../../../../libs/grid-angular/src/lib/inject-grid.ts","../../../../libs/grid-angular/src/lib/internal/feature-augmentations.ts","../../../../libs/grid-angular/src/lib/feature-registry.ts","../../../../libs/grid-angular/src/lib/directives/grid-column.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-header.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-tool-buttons.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-type.directive.ts","../../../../libs/grid-angular/src/lib/column-shorthand.ts","../../../../libs/grid-angular/src/lib/internal/feature-claims.ts","../../../../libs/grid-angular/src/lib/directives/row-diff.ts","../../../../libs/grid-angular/src/lib/directives/grid.directive.ts","../../../../libs/grid-angular/src/lib/grid-provider.ts","../../../../libs/grid-angular/src/index.ts","../../../../libs/grid-angular/src/toolbox-web-grid-angular.ts"],"sourcesContent":["/**\n * Angular-specific column configuration types.\n *\n * These types extend the base grid column config to allow Angular component\n * classes to be used directly as renderers and editors.\n */\nimport type { Type } from '@angular/core';\nimport type { ColumnConfig as BaseColumnConfig, GridConfig as BaseGridConfig, ColumnFieldKey } from '@toolbox-web/grid';\nimport type { FilterPanelParams, FilterPanelRenderer } from '@toolbox-web/grid/plugins/filtering';\n\n// #region CellRenderer Interface\n/**\n * Interface for cell renderer components.\n *\n * Renderer components receive the cell value, row data, and column config as inputs.\n * Use Angular signal inputs for reactive updates.\n *\n * @example\n * ```typescript\n * import { Component, input } from '@angular/core';\n * import type { CellRenderer } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-status-badge',\n * template: `<span [class]=\"'badge-' + value()\">{{ value() }}</span>`\n * })\n * export class StatusBadgeComponent implements CellRenderer<Employee, string> {\n * value = input.required<string>();\n * row = input.required<Employee>();\n * column = input<unknown>();\n * }\n * ```\n * @since 0.11.0\n */\nexport interface CellRenderer<TRow = unknown, TValue = unknown> {\n /** The cell value - use `input<TValue>()` or `input.required<TValue>()` */\n value: { (): TValue | undefined };\n /** The full row data - use `input<TRow>()` or `input.required<TRow>()` */\n row: { (): TRow | undefined };\n /** The column configuration (optional) - use `input<unknown>()` */\n column?: { (): unknown };\n}\n\n// #endregion\n\n// #region CellEditor Interface\n/**\n * Interface for cell editor components.\n *\n * Editor components receive the cell value, row data, and column config as inputs,\n * plus must emit `commit` and `cancel` outputs.\n *\n * @example\n * ```typescript\n * import { Component, input, output } from '@angular/core';\n * import type { CellEditor } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-status-editor',\n * template: `\n * <select [value]=\"value()\" (change)=\"commit.emit($any($event.target).value)\">\n * <option value=\"active\">Active</option>\n * <option value=\"inactive\">Inactive</option>\n * </select>\n * `\n * })\n * export class StatusEditorComponent implements CellEditor<Employee, string> {\n * value = input.required<string>();\n * row = input.required<Employee>();\n * column = input<unknown>();\n * commit = output<string>();\n * cancel = output<void>();\n * }\n * ```\n * @since 0.11.0\n */\nexport interface CellEditor<TRow = unknown, TValue = unknown> extends CellRenderer<TRow, TValue> {\n /** Emit to commit the new value - use `output<TValue>()` */\n commit: { emit(value: TValue): void; subscribe?(fn: (value: TValue) => void): { unsubscribe(): void } };\n /** Emit to cancel editing - use `output<void>()` */\n cancel: { emit(): void; subscribe?(fn: () => void): { unsubscribe(): void } };\n}\n\n// #endregion\n\n// #region FilterPanel Interface\n/**\n * Interface for filter panel components.\n *\n * Filter panel components receive the full `FilterPanelParams` as a single input,\n * providing access to field info, unique values, and filter action methods.\n *\n * @example\n * ```typescript\n * import { Component, input } from '@angular/core';\n * import type { FilterPanel } from '@toolbox-web/grid-angular';\n * import type { FilterPanelParams } from '@toolbox-web/grid/plugins/filtering';\n *\n * @Component({\n * selector: 'app-custom-filter',\n * template: `\n * <div>\n * <input (input)=\"onSearch($event)\" />\n * <button (click)=\"params().clearFilter()\">Clear</button>\n * </div>\n * `\n * })\n * export class CustomFilterComponent implements FilterPanel {\n * params = input.required<FilterPanelParams>();\n * }\n * ```\n * @since 0.12.0\n */\nexport interface FilterPanel {\n /** The filter panel parameters — use `input.required<FilterPanelParams>()` */\n params: { (): FilterPanelParams };\n}\n// #endregion\n\n// #region TypeDefault Interface\n/**\n * Type default configuration.\n *\n * Allows Angular component classes for renderers and editors in typeDefaults.\n *\n * @example\n * ```typescript\n * import type { GridConfig, TypeDefault } from '@toolbox-web/grid-angular';\n *\n * const config: GridConfig<Employee> = {\n * typeDefaults: {\n * boolean: {\n * renderer: (ctx) => { ... }, // vanilla JS renderer\n * editor: CheckboxEditorComponent, // Angular component\n * },\n * date: {\n * editor: DatePickerComponent, // Angular component\n * }\n * }\n * };\n * ```\n * @since 0.10.0\n */\nexport interface TypeDefault<TRow = unknown> {\n /** Format function for cell display */\n format?: (value: unknown, row: TRow) => string;\n /** Cell renderer - can be vanilla JS function or Angular component */\n renderer?: BaseColumnConfig<TRow>['renderer'] | Type<CellRenderer<TRow, unknown>>;\n /** Cell editor - can be vanilla JS function or Angular component */\n editor?: BaseColumnConfig<TRow>['editor'] | Type<CellEditor<TRow, unknown>>;\n /** Default editor parameters */\n editorParams?: Record<string, unknown>;\n /**\n * Custom filter panel renderer for this type. Requires FilteringPlugin.\n *\n * Can be:\n * - A vanilla `FilterPanelRenderer` function `(container, params) => void`\n * - An Angular component class implementing `FilterPanel`\n *\n * @example Using an Angular component\n * ```typescript\n * typeDefaults: {\n * date: {\n * filterPanelRenderer: DateFilterPanelComponent,\n * }\n * }\n * ```\n */\n filterPanelRenderer?: FilterPanelRenderer | Type<FilterPanel>;\n}\n\n// #endregion\n\n// #region ColumnConfig Interface\n/**\n * Column configuration for Angular applications.\n *\n * Extends the base ColumnConfig to allow Angular component classes\n * to be used directly as renderers and editors.\n *\n * @example\n * ```typescript\n * import type { ColumnConfig } from '@toolbox-web/grid-angular';\n * import { StatusBadgeComponent, StatusEditorComponent } from './components';\n *\n * const columns: ColumnConfig<Employee>[] = [\n * { field: 'name', header: 'Name' },\n * {\n * field: 'status',\n * header: 'Status',\n * editable: true,\n * renderer: StatusBadgeComponent,\n * editor: StatusEditorComponent,\n * },\n * ];\n * ```\n * @since 0.3.0\n */\nexport interface ColumnConfig<TRow = unknown, TField extends string = ColumnFieldKey<TRow>> extends Omit<\n BaseColumnConfig<TRow, TField>,\n 'renderer' | 'editor' | 'headerRenderer' | 'headerLabelRenderer'\n> {\n /**\n * Cell renderer - can be:\n * - A function `(ctx) => HTMLElement | string`\n * - An Angular component class implementing CellRenderer\n */\n renderer?: BaseColumnConfig<TRow>['renderer'] | Type<CellRenderer<TRow, unknown>>;\n\n /**\n * Cell editor - can be:\n * - A function `(ctx) => HTMLElement`\n * - An Angular component class implementing CellEditor\n */\n editor?: BaseColumnConfig<TRow>['editor'] | Type<CellEditor<TRow, unknown>>;\n\n /**\n * Header cell renderer - can be:\n * - A function `(ctx: HeaderCellContext) => Node | string | void | null`\n * - An Angular component class with column, value, sortState, filterActive, renderSortIcon, renderFilterButton inputs\n */\n headerRenderer?: BaseColumnConfig<TRow>['headerRenderer'] | Type<unknown>;\n\n /**\n * Header label renderer - can be:\n * - A function `(ctx: HeaderLabelContext) => Node | string | void | null`\n * - An Angular component class with column and value inputs\n */\n headerLabelRenderer?: BaseColumnConfig<TRow>['headerLabelRenderer'] | Type<unknown>;\n}\n\n// #endregion\n\n// #region GridConfig Interface\n/**\n * Grid configuration for Angular applications.\n *\n * Extends the base GridConfig to use Angular-augmented ColumnConfig and TypeDefault.\n * This allows component classes as renderers/editors.\n *\n * @example\n * ```typescript\n * import type { GridConfig, ColumnConfig } from '@toolbox-web/grid-angular';\n *\n * const config: GridConfig<Employee> = {\n * columns: [...],\n * plugins: [...],\n * };\n * ```\n * @since 0.3.0\n */\nexport interface GridConfig<TRow = unknown, TField extends string = ColumnFieldKey<TRow>> extends Omit<\n BaseGridConfig<TRow, TField>,\n 'columns' | 'typeDefaults' | 'loadingRenderer' | 'emptyRenderer'\n> {\n columns?: ColumnConfig<TRow, TField>[];\n /** Type-level defaults that can use Angular component classes */\n typeDefaults?: Record<string, TypeDefault<TRow>>;\n /**\n * Custom loading renderer - can be:\n * - A function `(ctx: LoadingContext) => HTMLElement | string`\n * - An Angular component class with a `size` input\n */\n loadingRenderer?: BaseGridConfig<TRow>['loadingRenderer'] | Type<unknown>;\n /**\n * Custom empty-state renderer shown when the grid has no rows and is not\n * loading. Can be:\n * - A function `(ctx: EmptyContext) => HTMLElement | string`\n * - An Angular component class with `sourceRowCount` and `filteredOut` inputs\n *\n * Set explicitly to `null` to suppress the built-in default message.\n */\n emptyRenderer?: BaseGridConfig<TRow>['emptyRenderer'] | Type<unknown>;\n}\n\n// #endregion\n\n// #region Utilities\n/**\n * Type guard to check if a value is an Angular component class.\n *\n * Detects Angular components by checking for internal Angular markers:\n * - ɵcmp (component definition)\n * - ɵfac (factory function)\n *\n * Also checks if it's an ES6 class (vs function) by inspecting the\n * string representation.\n * @since 0.3.0\n */\nexport function isComponentClass(value: unknown): value is Type<unknown> {\n if (typeof value !== 'function' || value.prototype === undefined) {\n return false;\n }\n\n // Check for Angular component markers (AOT compiled)\n if (Object.prototype.hasOwnProperty.call(value, 'ɵcmp') || Object.prototype.hasOwnProperty.call(value, 'ɵfac')) {\n return true;\n }\n\n // Check if it's an ES6 class (vs regular function)\n // Class definitions start with \"class\" in their toString()\n const fnString = Function.prototype.toString.call(value);\n return fnString.startsWith('class ') || fnString.startsWith('class{');\n}\n// #endregion\n","import { contentChild, Directive, effect, ElementRef, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context object passed to the cell renderer template.\n * Contains the cell value, row data, and column configuration.\n * @since 0.1.0\n */\nexport interface GridCellContext<TValue = unknown, TRow = unknown> {\n /** The cell value for this column */\n $implicit: TValue;\n /** The cell value (explicit binding) */\n value: TValue;\n /** The full row data object */\n row: TRow;\n /** The column configuration */\n column: unknown;\n}\n\n// Global registry mapping DOM elements to their templates\nconst templateRegistry = new Map<HTMLElement, TemplateRef<GridCellContext>>();\n\n/**\n * Gets the template registered for a given element.\n * Used by AngularGridAdapter to retrieve templates at render time.\n */\nexport function getViewTemplate(element: HTMLElement): TemplateRef<GridCellContext> | undefined {\n return templateRegistry.get(element);\n}\n\n/**\n * Directive that captures an `<ng-template>` for use as a cell renderer.\n *\n * This enables declarative Angular component usage with proper input bindings\n * that satisfy Angular's AOT compiler.\n *\n * ## Usage\n *\n * ```html\n * <tbw-grid-column field=\"status\">\n * <tbw-grid-column-view>\n * <ng-template let-value let-row=\"row\">\n * <app-status-badge [value]=\"value\" [row]=\"row\" />\n * </ng-template>\n * </tbw-grid-column-view>\n * </tbw-grid-column>\n * ```\n *\n * The template context provides:\n * - `$implicit` / `value`: The cell value\n * - `row`: The full row data object\n * - `column`: The column configuration\n *\n * Import the directive in your component:\n *\n * ```typescript\n * import { GridColumnView } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [GridColumnView],\n * // ...\n * })\n * ```\n *\n * @category Directive\n * @since 0.1.0\n */\n@Directive({ selector: 'tbw-grid-column-view' })\nexport class GridColumnView {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * Query for the ng-template content child.\n */\n template = contentChild(TemplateRef<GridCellContext>);\n\n /** Effect that triggers when the template is available */\n private onTemplateReceived = effect(() => {\n const template = this.template();\n if (template) {\n // Register the template for this element\n templateRegistry.set(this.elementRef.nativeElement, template);\n }\n });\n\n /**\n * Static type guard for template context.\n * Enables type inference in templates.\n */\n static ngTemplateContextGuard(dir: GridColumnView, ctx: unknown): ctx is GridCellContext {\n return true;\n }\n}\n","import { Directive, effect, ElementRef, inject, OnDestroy, TemplateRef } from '@angular/core';\nimport { getViewTemplate } from './grid-column-view.directive';\n\n/**\n * Context type for structural directives with `any` defaults.\n * This provides better ergonomics in templates without requiring explicit type annotations.\n *\n * @internal Use `GridCellContext` in application code for stricter typing.\n * @since 0.1.1\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface StructuralCellContext<TValue = any, TRow = any> {\n /** The cell value for this column */\n $implicit: TValue;\n /** The cell value (explicit binding) */\n value: TValue;\n /** The full row data object */\n row: TRow;\n /** The column configuration */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n column: any;\n}\n\n// Registry for structural view templates\nconst structuralViewRegistry = new Map<HTMLElement, TemplateRef<StructuralCellContext>>();\n\n/**\n * Gets the view template registered by the structural directive for a given column element.\n * Falls back to the non-structural directive registry.\n */\nexport function getStructuralViewTemplate(columnElement: HTMLElement): TemplateRef<StructuralCellContext> | undefined {\n // First check structural directive registry\n const template = structuralViewRegistry.get(columnElement);\n if (template) return template;\n\n // Fall back to the nested element registry\n const viewEl = columnElement.querySelector('tbw-grid-column-view');\n if (viewEl) {\n return getViewTemplate(viewEl as HTMLElement) as TemplateRef<StructuralCellContext> | undefined;\n }\n return undefined;\n}\n\n/**\n * Structural directive for cell view rendering.\n *\n * This provides a cleaner syntax for defining custom cell renderers without\n * the nested `<tbw-grid-column-view>` and `<ng-template>` boilerplate.\n *\n * ## Usage\n *\n * ```html\n * <!-- Instead of this verbose syntax: -->\n * <tbw-grid-column field=\"status\">\n * <tbw-grid-column-view>\n * <ng-template let-value let-row=\"row\">\n * <app-status-badge [value]=\"value\" />\n * </ng-template>\n * </tbw-grid-column-view>\n * </tbw-grid-column>\n *\n * <!-- Use this cleaner syntax: -->\n * <tbw-grid-column field=\"status\">\n * <app-status-badge *tbwRenderer=\"let value; row as row\" [value]=\"value\" />\n * </tbw-grid-column>\n * ```\n *\n * ## Template Context\n *\n * The structural directive provides the same context as `GridColumnView`:\n * - `$implicit` / `value`: The cell value (use `let value` or `let-value`)\n * - `row`: The full row data object (use `row as row` or `let-row=\"row\"`)\n * - `column`: The column configuration\n *\n * ## Import\n *\n * ```typescript\n * import { TbwRenderer } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [TbwRenderer],\n * // ...\n * })\n * ```\n *\n * @example\n * ```html\n * <tbw-grid-column field=\"status\">\n * <app-status-badge *tbwRenderer=\"let value; row as row\" [value]=\"value\" />\n * </tbw-grid-column>\n * ```\n *\n * @category Directive\n * @since 0.1.1\n */\n@Directive({ selector: '[tbwRenderer]' })\nexport class TbwRenderer implements OnDestroy {\n private template = inject(TemplateRef<StructuralCellContext>);\n private elementRef = inject(ElementRef<HTMLElement>);\n private columnElement: HTMLElement | null = null;\n\n constructor() {\n // Angular structural directives wrap the host element in a comment node.\n // We need to find the parent tbw-grid-column element.\n // Since we're injected into the template, we use an effect to register once the DOM is stable.\n effect(() => {\n this.registerTemplate();\n });\n }\n\n private registerTemplate(): void {\n // Find the parent tbw-grid-column or tbw-grid-type element\n // The template's host element may not be in the DOM yet, so we traverse from the comment node\n let parent = this.elementRef.nativeElement?.parentElement;\n while (parent && parent.tagName !== 'TBW-GRID-COLUMN' && parent.tagName !== 'TBW-GRID-TYPE') {\n parent = parent.parentElement;\n }\n\n if (parent) {\n this.columnElement = parent;\n structuralViewRegistry.set(parent, this.template);\n }\n }\n\n ngOnDestroy(): void {\n if (this.columnElement) {\n structuralViewRegistry.delete(this.columnElement);\n }\n }\n\n /**\n * Static type guard for template context.\n * Uses `any` defaults for ergonomic template usage.\n */\n static ngTemplateContextGuard(dir: TbwRenderer, ctx: unknown): ctx is StructuralCellContext {\n return true;\n }\n}\n","/**\n * Editor mount hook registry — append-only hooks called when an Angular-managed\n * editor host is mounted into the DOM with a known owner grid.\n *\n * This is the augmentation point that lets feature secondary entries\n * (e.g. `@toolbox-web/grid-angular/features/editing`) install per-editor\n * lifecycle behaviour (such as the `before-edit-close` blur bridge)\n * without coupling the central adapter file to the editing feature.\n * Mirrors React's and Vue's `editor-mount-hooks` and how core grid plugins\n * augment the grid via `registerPlugin()`.\n *\n * @packageDocumentation\n * @internal\n */\n\n/**\n * Hook called when an editor host is mounted. Returning a function\n * registers a teardown that runs when the editor is released.\n * @since 1.4.0\n */\nexport type EditorMountHook = (ctx: { container: HTMLElement; gridEl: HTMLElement }) => (() => void) | void;\n\nconst editorMountHooks: EditorMountHook[] = [];\n\n/**\n * Install an editor-mount hook. Called by feature secondary entries\n * (e.g. `features/editing`) on import.\n *\n * @internal Plugin API\n * @since 1.4.0\n */\nexport function registerEditorMountHook(hook: EditorMountHook): void {\n editorMountHooks.push(hook);\n}\n\n/**\n * Run all registered editor-mount hooks for a freshly mounted editor.\n * Returns a combined teardown that invokes each hook's teardown in\n * registration order.\n *\n * @internal Adapter use only.\n */\nexport function notifyEditorMounted(container: HTMLElement, gridEl: HTMLElement): () => void {\n const teardowns: Array<() => void> = [];\n for (const hook of editorMountHooks) {\n const teardown = hook({ container, gridEl });\n if (teardown) teardowns.push(teardown);\n }\n return () => {\n for (const teardown of teardowns) teardown();\n };\n}\n\n/**\n * Returns a function that, when invoked, blurs the focused input/textarea/select\n * inside `host` (if any). Used by the `before-edit-close` bridge installed by\n * `@toolbox-web/grid-angular/features/editing` so editors that commit on\n * `(blur)` flush their pending value before the cell DOM is torn down by Tab /\n * programmatic row exit.\n * @internal\n * @since 1.4.0\n */\nexport function makeFlushFocusedInput(host: HTMLElement): () => void {\n return () => {\n const focused = host.ownerDocument.activeElement as HTMLElement | null;\n if (\n focused &&\n host.contains(focused) &&\n (focused instanceof HTMLInputElement ||\n focused instanceof HTMLTextAreaElement ||\n focused instanceof HTMLSelectElement)\n ) {\n focused.blur();\n }\n };\n}\n","/**\n * Editor Wiring Helpers\n *\n * Pure functions for wiring up commit/cancel handlers on editor components.\n * Extracted from GridAdapter to enable unit testing without Angular DI.\n *\n * @internal\n */\n\n// #region subscribeToOutput\n\n/**\n * Subscribes to an Angular output on a component instance.\n * Works with both EventEmitter and OutputEmitterRef (signal outputs).\n *\n * @param instance - The component instance (as a plain record)\n * @param outputName - Name of the output property\n * @param callback - Callback to invoke when the output emits\n * @returns `true` if the output was found and subscribed, `false` otherwise\n * @internal\n */\nexport function subscribeToOutput<T>(\n instance: Record<string, unknown>,\n outputName: string,\n callback: (value: T) => void,\n): boolean {\n const output = instance[outputName];\n if (!output) return false;\n\n // Check if it's an Observable-like (EventEmitter or OutputEmitterRef)\n if (typeof (output as { subscribe?: unknown }).subscribe === 'function') {\n (output as { subscribe: (fn: (v: T) => void) => void }).subscribe(callback);\n return true;\n }\n return false;\n}\n\n// #endregion\n\n// #region wireEditorCallbacks\n\n/**\n * Wire up commit/cancel handlers for an editor component.\n *\n * Supports both Angular outputs and DOM CustomEvents. When both fire\n * (the BaseGridEditor pattern), a per-action flag prevents the callback\n * from running twice.\n *\n * @param hostElement - The host DOM element for the editor\n * @param instance - The component instance (as a plain record)\n * @param commit - Callback to invoke when committing a value\n * @param cancel - Callback to invoke when cancelling the edit\n * @internal\n */\nexport function wireEditorCallbacks<TValue>(\n hostElement: HTMLElement,\n instance: Record<string, unknown>,\n commit: (value: TValue) => void,\n cancel: () => void,\n): void {\n // Guard: when both Angular output AND DOM event fire (BaseGridEditor.commitValue\n // emits both), only the first should call commit/cancel(). The flags prevent\n // double-fires that cause redundant cell-commit events and extra dirty-tracking work.\n let commitHandledByOutput = false;\n let cancelHandledByOutput = false;\n\n subscribeToOutput(instance, 'commit', (value: TValue) => {\n commitHandledByOutput = true;\n commit(value);\n });\n subscribeToOutput(instance, 'cancel', () => {\n cancelHandledByOutput = true;\n cancel();\n });\n\n // Also listen for DOM CustomEvents as a fallback for editors that don't\n // have Angular commit/cancel outputs (e.g., third-party web components).\n hostElement.addEventListener('commit', (e: Event) => {\n e.stopPropagation();\n if (commitHandledByOutput) {\n // Already handled by the Angular output subscription — reset and skip.\n commitHandledByOutput = false;\n return;\n }\n const customEvent = e as CustomEvent<TValue>;\n commit(customEvent.detail);\n });\n hostElement.addEventListener('cancel', (e: Event) => {\n e.stopPropagation();\n if (cancelHandledByOutput) {\n cancelHandledByOutput = false;\n return;\n }\n cancel();\n });\n}\n\n// #endregion\n","/**\n * Type-level default registry for Angular applications.\n *\n * Provides application-wide type defaults for renderers and editors\n * that all grids inherit automatically.\n */\nimport {\n EnvironmentProviders,\n inject,\n Injectable,\n InjectionToken,\n makeEnvironmentProviders,\n Type,\n} from '@angular/core';\nimport type { TypeDefault } from '@toolbox-web/grid';\nimport type { FilterPanelRenderer } from '@toolbox-web/grid/plugins/filtering';\n\n/**\n * Type default registration configuration.\n * Uses Angular component types for renderers/editors.\n *\n * @example\n * ```typescript\n * const defaults: Record<string, TypeDefaultRegistration> = {\n * country: {\n * renderer: CountryCellComponent,\n * editor: CountryEditorComponent,\n * },\n * };\n * ```\n * @since 0.11.0\n */\nexport interface TypeDefaultRegistration<_TRow = unknown> {\n /** Angular component class for rendering cells of this type */\n renderer?: Type<any>;\n /** Angular component class for editing cells of this type */\n editor?: Type<any>;\n /** Default editorParams for this type */\n editorParams?: Record<string, unknown>;\n /**\n * Custom filter panel for this type.\n *\n * Accepts either:\n * - An Angular component class implementing `FilterPanel` (has a `params` signal input)\n * - A vanilla imperative function `(container, params) => void`\n */\n filterPanelRenderer?: FilterPanelRenderer | Type<any>;\n}\n\n/**\n * Injection token for providing type defaults at app level.\n * @since 0.3.0\n */\nexport const GRID_TYPE_DEFAULTS = new InjectionToken<Record<string, TypeDefaultRegistration>>('GRID_TYPE_DEFAULTS');\n\n/**\n * Injectable service for managing type-level defaults.\n *\n * Use `provideGridTypeDefaults()` in your app config to set up defaults,\n * or inject this service for dynamic registration.\n *\n * @example\n * ```typescript\n * // App-level setup (app.config.ts)\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridTypeDefaults({\n * country: {\n * renderer: CountryCellComponent,\n * editor: CountryEditorComponent\n * },\n * status: {\n * renderer: StatusBadgeComponent\n * }\n * })\n * ]\n * };\n *\n * // Dynamic registration\n * @Component({ ... })\n * export class AppComponent {\n * private registry = inject(GridTypeRegistry);\n *\n * ngOnInit() {\n * this.registry.register('currency', {\n * renderer: CurrencyCellComponent\n * });\n * }\n * }\n * ```\n * @since 0.3.0\n */\n@Injectable({ providedIn: 'root' })\nexport class GridTypeRegistry {\n private readonly defaults = new Map<string, TypeDefaultRegistration>();\n\n constructor() {\n // Merge any initial defaults from provider\n const initial = inject(GRID_TYPE_DEFAULTS, { optional: true });\n if (initial) {\n for (const [type, config] of Object.entries(initial)) {\n this.defaults.set(type, config);\n }\n }\n }\n\n /**\n * Register type-level defaults for a custom type.\n *\n * @param type - The type name (e.g., 'country', 'currency')\n * @param defaults - Renderer/editor configuration\n */\n register<T = unknown>(type: string, defaults: TypeDefaultRegistration<T>): void {\n this.defaults.set(type, defaults);\n }\n\n /**\n * Get type defaults for a given type.\n */\n get(type: string): TypeDefaultRegistration | undefined {\n return this.defaults.get(type);\n }\n\n /**\n * Remove type defaults for a type.\n */\n unregister(type: string): void {\n this.defaults.delete(type);\n }\n\n /**\n * Check if a type has registered defaults.\n */\n has(type: string): boolean {\n return this.defaults.has(type);\n }\n\n /**\n * Get all registered type names.\n */\n getRegisteredTypes(): string[] {\n return Array.from(this.defaults.keys());\n }\n\n /**\n * Convert to TypeDefault for use with grid's typeDefaults.\n * This is used internally by the adapter.\n *\n * @internal\n */\n getAsTypeDefault(type: string): TypeDefault | undefined {\n const config = this.defaults.get(type);\n if (!config) return undefined;\n\n // Note: The actual renderer/editor functions are created by the adapter\n // when it calls getTypeDefault() - we just return the config here\n return {\n editorParams: config.editorParams,\n // renderer and editor are handled by the adapter which creates\n // the actual functions that instantiate Angular components\n };\n }\n}\n\n/**\n * Provides application-level type defaults for all grids.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * import { provideGridTypeDefaults } from '@toolbox-web/grid-angular';\n * import { CountryCellComponent, StatusBadgeComponent } from './components';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridTypeDefaults({\n * country: { renderer: CountryCellComponent },\n * status: { renderer: StatusBadgeComponent },\n * date: { editor: DatePickerComponent }\n * })\n * ]\n * };\n * ```\n * @since 0.3.0\n */\nexport function provideGridTypeDefaults(defaults: Record<string, TypeDefaultRegistration>): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: GRID_TYPE_DEFAULTS, useValue: defaults }]);\n}\n","/**\n * Append-only bridge registries used by `@toolbox-web/grid-angular`.\n *\n * These let feature secondary entries plug into the central `GridAdapter`\n * without the adapter needing to know about them. Mirrors React's and Vue's\n * `register*Bridge` modules and how core grid plugins augment the grid via\n * `registerPlugin()`.\n *\n * This module is deliberately framework-free: it holds plain module-level\n * `let` state and never imports from `@angular/core` or from\n * `@toolbox-web/grid/plugins/...`. Feature subpaths import the setters via\n * the `@toolbox-web/grid-angular` package barrel (relative imports outside\n * a secondary entry's `rootDir` are forbidden by ng-packagr).\n *\n * @internal\n */\n\nimport type { TypeDefault as BaseTypeDefault, ColumnEditorSpec } from '@toolbox-web/grid';\nimport type { GridAdapter } from '../angular-grid-adapter';\n\n/**\n * Installer signature: given a grid element + adapter, returns the row-renderer\n * the adapter should expose, or undefined if no Angular template is registered\n * for that grid. Used by `features/master-detail` and `features/responsive`.\n * @internal\n * @since 1.4.0\n */\nexport type RowRendererBridge = <TRow = unknown>(\n gridElement: HTMLElement,\n adapter: GridAdapter,\n) => ((row: TRow, rowIndex: number) => HTMLElement) | undefined;\n\n/**\n * Installer signature for the type-default `filterPanelRenderer` wrapper.\n * Receives the user-supplied component class loosely typed as `unknown`\n * (so the adapter does not depend on filtering types) and returns the\n * imperative `(container, params) => void` form required by core.\n * @internal\n * @since 1.4.0\n */\nexport type FilterPanelTypeDefaultBridge = (\n rendererValue: unknown,\n adapter: GridAdapter,\n) => NonNullable<BaseTypeDefault['filterPanelRenderer']> | undefined;\n\n/**\n * Installer signature for the template-based cell editor. Given a column/editor\n * light-DOM element + adapter, returns the `ColumnEditorSpec` the grid should\n * use, or undefined if no Angular editor template (`*tbwEditor` /\n * `<tbw-grid-column-editor>`) is registered for that element. Installed by\n * `@toolbox-web/grid-angular/features/editing`; without it, template-based\n * editors are not resolved (component-class editors are unaffected).\n * @internal\n * @since 3.0.0\n */\nexport type EditorSpecBridge = <TRow = unknown, TValue = unknown>(\n element: HTMLElement,\n adapter: GridAdapter,\n) => ColumnEditorSpec<TRow, TValue> | undefined;\n\n/**\n * Installer signature for the tool-panel renderer. Given a tool-panel\n * light-DOM element + adapter, returns the imperative renderer the grid should\n * use, or undefined if no Angular tool-panel template is registered. Installed\n * by `@toolbox-web/grid-angular/features/shell`.\n * @internal\n * @since 3.0.0\n */\nexport type ToolPanelRendererBridge = (\n element: HTMLElement,\n adapter: GridAdapter,\n) => ((container: HTMLElement) => void | (() => void)) | undefined;\n\nlet detailRendererBridge: RowRendererBridge | null = null;\nlet responsiveCardRendererBridge: RowRendererBridge | null = null;\nlet filterPanelTypeDefaultBridge: FilterPanelTypeDefaultBridge | null = null;\nlet editorSpecBridge: EditorSpecBridge | null = null;\nlet toolPanelRendererBridge: ToolPanelRendererBridge | null = null;\n\n/**\n * Install the master-detail row-renderer bridge. Called once on import by\n * `@toolbox-web/grid-angular/features/master-detail`.\n * @internal Plugin API\n * @since 1.4.0\n */\nexport function registerDetailRendererBridge(bridge: RowRendererBridge): void {\n detailRendererBridge = bridge;\n}\n\n/**\n * Install the responsive-card row-renderer bridge. Called once on import by\n * `@toolbox-web/grid-angular/features/responsive`.\n * @internal Plugin API\n * @since 1.4.0\n */\nexport function registerResponsiveCardRendererBridge(bridge: RowRendererBridge): void {\n responsiveCardRendererBridge = bridge;\n}\n\n/**\n * Install the type-default `filterPanelRenderer` wrapper. Called once on import\n * by `@toolbox-web/grid-angular/features/filtering`. Without this bridge,\n * type-default and grid-config-level component-class filterPanelRenderers are\n * silently dropped — same precondition as the FilteringPlugin (TBW031).\n * @internal Plugin API\n * @since 1.4.0\n */\nexport function registerFilterPanelTypeDefaultBridge(bridge: FilterPanelTypeDefaultBridge): void {\n filterPanelTypeDefaultBridge = bridge;\n}\n\n/** @internal Adapter use only. */\nexport function getDetailRendererBridge(): RowRendererBridge | null {\n return detailRendererBridge;\n}\n\n/** @internal Adapter use only. */\nexport function getResponsiveCardRendererBridge(): RowRendererBridge | null {\n return responsiveCardRendererBridge;\n}\n\n/** @internal Adapter use only. */\nexport function getFilterPanelTypeDefaultBridge(): FilterPanelTypeDefaultBridge | null {\n return filterPanelTypeDefaultBridge;\n}\n\n/**\n * Install the template-based editor bridge. Called once on import by\n * `@toolbox-web/grid-angular/features/editing`.\n * @internal Plugin API\n * @since 3.0.0\n */\nexport function registerEditorSpecBridge(bridge: EditorSpecBridge): void {\n editorSpecBridge = bridge;\n}\n\n/** @internal Adapter use only. */\nexport function getEditorSpecBridge(): EditorSpecBridge | null {\n return editorSpecBridge;\n}\n\n/**\n * Install the tool-panel renderer bridge. Called once on import by\n * `@toolbox-web/grid-angular/features/shell`.\n * @internal Plugin API\n * @since 3.0.0\n */\nexport function registerToolPanelRendererBridge(bridge: ToolPanelRendererBridge): void {\n toolPanelRendererBridge = bridge;\n}\n\n/** @internal Adapter use only. */\nexport function getToolPanelRendererBridge(): ToolPanelRendererBridge | null {\n return toolPanelRendererBridge;\n}\n","/**\n * Internal registries used by `@toolbox-web/grid-angular`.\n *\n * Two extension points are exposed so individual feature secondary entries\n * (e.g. `@toolbox-web/grid-angular/features/master-detail`) can plug into\n * the core `Grid` directive without the directive needing to know about them.\n *\n * - {@link registerTemplateBridge} — runs in `ngAfterContentInit` once Angular\n * templates inside the grid have been registered. Used to discover light-DOM\n * slot elements (`<tbw-grid-detail>`, `<tbw-grid-responsive-card>`, …) and\n * wire them to the corresponding plugin's renderer setter.\n * - {@link registerFeatureConfigPreprocessor} — runs inside the directive's\n * feature-plugin builder before `createPluginFromFeature` is called. Lets a\n * feature transform its config object (e.g. to convert Angular component\n * classes embedded in `customPanels` to renderer functions).\n *\n * Both registries are append-only and module-scoped: they are populated by\n * side-effect imports of feature secondary entries and consumed by the core\n * `Grid` directive. Order is insertion order.\n *\n * @internal — public for cross-entry-point use; not part of the supported API.\n */\n\nimport type { GridAdapter } from '../angular-grid-adapter';\nimport type { FeatureName } from '../feature-registry';\n\n/**\n * Context passed to template bridges.\n *\n * @internal\n * @since 1.4.0\n */\nexport interface TemplateBridgeContext {\n /** The `<tbw-grid>` element this directive is attached to. */\n grid: HTMLElement;\n /** The Angular `GridAdapter` instance for this grid. */\n adapter: GridAdapter;\n}\n\n/**\n * A template bridge runs once per grid in `ngAfterContentInit`, after the\n * grid has refreshed its columns and Angular content templates have been\n * registered. Bridges may be async; the directive does not await them\n * sequentially — they run concurrently.\n *\n * @internal\n * @since 1.4.0\n */\nexport type TemplateBridge = (ctx: TemplateBridgeContext) => void | Promise<void>;\n\nconst templateBridges: TemplateBridge[] = [];\n\n/**\n * Register a template bridge. Called by feature secondary entries at module\n * load (e.g. `import '@toolbox-web/grid-angular/features/master-detail'`).\n *\n * Bridges are append-only and never deduplicated; calling registration twice\n * for the same feature module is safe because module imports are deduplicated\n * by the JS loader.\n *\n * @internal\n * @since 1.4.0\n */\nexport function registerTemplateBridge(bridge: TemplateBridge): void {\n templateBridges.push(bridge);\n}\n\n/**\n * Run all registered template bridges for a grid. The directive calls this\n * from `ngAfterContentInit` after `refreshColumns()`. Bridges run concurrently;\n * errors thrown by one bridge do not stop the others.\n *\n * @internal\n * @since 1.4.0\n */\nexport function runTemplateBridges(ctx: TemplateBridgeContext): void {\n for (const bridge of templateBridges) {\n try {\n const result = bridge(ctx);\n if (result && typeof (result as Promise<void>).catch === 'function') {\n (result as Promise<void>).catch((err) => {\n console.error('[tbw-grid-angular] template bridge threw:', err);\n });\n }\n } catch (err) {\n console.error('[tbw-grid-angular] template bridge threw:', err);\n }\n }\n}\n\n/**\n * A feature config preprocessor receives the user-supplied config for a\n * specific feature input and returns a transformed config that the core\n * plugin factory can consume. Used to bridge Angular component classes\n * embedded in feature configs (e.g. `customPanels`, `groupHeaderRenderer`)\n * to plain renderer functions.\n *\n * Receives the typed config and the directive's adapter. Returning the same\n * reference is fine — preprocessors typically clone-and-augment.\n *\n * @internal\n * @since 1.4.0\n */\nexport type FeatureConfigPreprocessor = (config: unknown, adapter: GridAdapter) => unknown;\n\nconst featureConfigPreprocessors = new Map<FeatureName, FeatureConfigPreprocessor>();\n\n/**\n * Register a feature config preprocessor. Last registration wins (subsequent\n * imports of the same feature module re-register the same function, which is\n * a no-op).\n *\n * @internal\n * @since 1.4.0\n */\nexport function registerFeatureConfigPreprocessor(name: FeatureName, fn: FeatureConfigPreprocessor): void {\n featureConfigPreprocessors.set(name, fn);\n}\n\n/**\n * Look up the preprocessor for a feature, if any.\n *\n * @internal\n * @since 1.4.0\n */\nexport function getFeatureConfigPreprocessor(name: FeatureName): FeatureConfigPreprocessor | undefined {\n return featureConfigPreprocessors.get(name);\n}\n","import {\n ApplicationRef,\n ComponentRef,\n createComponent,\n EmbeddedViewRef,\n EnvironmentInjector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport type {\n ColumnConfig as BaseColumnConfig,\n GridConfig as BaseGridConfig,\n TypeDefault as BaseTypeDefault,\n CellRenderContext,\n ColumnEditorContext,\n ColumnEditorSpec,\n ColumnViewRenderer,\n EmptyContext,\n FrameworkAdapter,\n HeaderCellContext,\n HeaderLabelContext,\n LoadingContext,\n} from '@toolbox-web/grid';\nimport { isComponentClass, type ColumnConfig, type GridConfig, type TypeDefault } from './angular-column-config';\nimport { getViewTemplate, GridCellContext } from './directives/grid-column-view.directive';\nimport { getStructuralViewTemplate } from './directives/structural-directives';\nimport { notifyEditorMounted, registerEditorMountHook, type EditorMountHook } from './editor-mount-hooks';\nimport { wireEditorCallbacks } from './editor-wiring';\nimport type { FeatureName } from './feature-registry';\nimport { GridTypeRegistry } from './grid-type-registry';\nimport {\n getDetailRendererBridge,\n getEditorSpecBridge,\n getFilterPanelTypeDefaultBridge,\n getResponsiveCardRendererBridge,\n getToolPanelRendererBridge,\n} from './internal/feature-bridges';\nimport { getFeatureConfigPreprocessor } from './internal/feature-extensions';\n\n// Re-export so feature secondary entries can install editor-mount hooks via\n// `import { registerEditorMountHook } from '@toolbox-web/grid-angular'`.\nexport { makeFlushFocusedInput } from './editor-mount-hooks';\nexport {\n registerDetailRendererBridge,\n registerEditorSpecBridge,\n registerFilterPanelTypeDefaultBridge,\n registerResponsiveCardRendererBridge,\n registerToolPanelRendererBridge,\n} from './internal/feature-bridges';\nexport type {\n EditorSpecBridge,\n FilterPanelTypeDefaultBridge,\n RowRendererBridge,\n ToolPanelRendererBridge,\n} from './internal/feature-bridges';\nexport { registerEditorMountHook, type EditorMountHook };\n\n// #region Feature bridge registries\n// (Storage lives in `./internal/feature-bridges` so feature subpaths can\n// install bridges without pulling Angular runtime into specs that mock\n// `@angular/core` — see filtering feature spec.)\n// #endregion\n\n/**\n * Helper to get view template from either structural directive or nested directive.\n */\nfunction getAnyViewTemplate(element: HTMLElement): TemplateRef<GridCellContext> | undefined {\n // First check structural directive registry (for *tbwRenderer syntax)\n const structuralTemplate = getStructuralViewTemplate(element);\n if (structuralTemplate) return structuralTemplate as unknown as TemplateRef<GridCellContext>;\n\n // Fall back to nested directive (for <tbw-grid-column-view> syntax)\n return getViewTemplate(element);\n}\n\n/**\n * Framework adapter that enables zero-boilerplate integration of Angular components\n * with the grid's light DOM configuration API.\n *\n * ## Usage\n *\n * **One-time setup in your app:**\n * ```typescript\n * import { Component, inject, EnvironmentInjector, ApplicationRef, ViewContainerRef } from '@angular/core';\n * import { GridElement } from '@toolbox-web/grid';\n * import { GridAdapter } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-root',\n * // ...\n * })\n * export class AppComponent {\n * constructor() {\n * const injector = inject(EnvironmentInjector);\n * const appRef = inject(ApplicationRef);\n * const viewContainerRef = inject(ViewContainerRef);\n * GridElement.registerAdapter(new GridAdapter(injector, appRef, viewContainerRef));\n * }\n * }\n * ```\n *\n * **Declarative configuration in templates (structural directive - recommended):**\n * ```html\n * <tbw-grid>\n * <tbw-grid-column field=\"status\">\n * <app-status-badge *tbwRenderer=\"let value; row as row\" [value]=\"value\" />\n * <app-status-editor *tbwEditor=\"let value\" [value]=\"value\" />\n * </tbw-grid-column>\n * </tbw-grid>\n * ```\n *\n * **Declarative configuration in templates (nested directive - legacy):**\n * ```html\n * <tbw-grid>\n * <tbw-grid-column field=\"status\">\n * <tbw-grid-column-view>\n * <ng-template let-value let-row=\"row\">\n * <app-status-badge [value]=\"value\" [row]=\"row\" />\n * </ng-template>\n * </tbw-grid-column-view>\n * <tbw-grid-column-editor>\n * <ng-template let-value let-onCommit=\"onCommit\" let-onCancel=\"onCancel\">\n * <app-status-select [value]=\"value\" (commit)=\"onCommit($event)\" (cancel)=\"onCancel()\" />\n * </ng-template>\n * </tbw-grid-column-editor>\n * </tbw-grid-column>\n * </tbw-grid>\n * ```\n *\n * The adapter automatically:\n * - Detects Angular templates registered by directives (both structural and nested)\n * - Creates embedded views with cell context (value, row, column)\n * - Handles editor callbacks (onCommit/onCancel)\n * - Manages view lifecycle and change detection\n */\n\n/**\n * Synchronize an embedded view's rootNodes into a stable container element.\n *\n * Angular's control flow blocks (@if, @for, @switch) can dynamically add or\n * remove rootNodes during `detectChanges()`. This helper ensures the container\n * always reflects the current set of rootNodes, preventing orphaned or stale\n * nodes when the template's DOM structure changes between renders.\n */\nfunction syncRootNodes(viewRef: EmbeddedViewRef<unknown>, container: HTMLElement): void {\n // Fast path: if the container already holds exactly the right nodes, skip DOM mutations.\n const rootNodes: Node[] = viewRef.rootNodes;\n const children = container.childNodes;\n\n let needsSync = children.length !== rootNodes.length;\n if (!needsSync) {\n for (let i = 0; i < rootNodes.length; i++) {\n if (children[i] !== rootNodes[i]) {\n needsSync = true;\n break;\n }\n }\n }\n\n if (needsSync) {\n // Clear and re-append. replaceChildren is efficient (single reflow).\n container.replaceChildren(...rootNodes);\n }\n}\n\n/** @since 0.11.0 */\nexport class GridAdapter implements FrameworkAdapter {\n private viewRefs: EmbeddedViewRef<unknown>[] = [];\n private componentRefs: ComponentRef<unknown>[] = [];\n /** Editor-specific view refs tracked separately for per-cell cleanup via releaseCell. */\n private editorViewRefs: EmbeddedViewRef<unknown>[] = [];\n /** Editor-specific component refs tracked separately for per-cell cleanup via releaseCell. */\n private editorComponentRefs: ComponentRef<unknown>[] = [];\n /**\n * Per-editor mount-hook teardown functions, keyed by editor host element.\n *\n * Populated by {@link runEditorMountHooks} (which invokes\n * {@link notifyEditorMounted}) and torn down per-cell from\n * {@link releaseCell}, with full sweep on {@link destroy}. The actual\n * lifecycle behaviour is supplied by feature secondary entries (e.g.\n * `@toolbox-web/grid-angular/features/editing` installs the\n * `before-edit-close` blur bridge).\n */\n private editorMountTeardowns: Map<HTMLElement, () => void> = new Map();\n private typeRegistry: GridTypeRegistry | null = null;\n\n constructor(\n private injector: EnvironmentInjector,\n private appRef: ApplicationRef,\n private viewContainerRef: ViewContainerRef,\n ) {\n // Register globally for directive access\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).__ANGULAR_GRID_ADAPTER__ = this;\n\n // Try to get the type registry from the injector\n try {\n this.typeRegistry = this.injector.get(GridTypeRegistry, null);\n } catch {\n // GridTypeRegistry not available - type defaults won't be resolved\n }\n }\n\n /**\n * Processes an Angular grid configuration, converting component class references\n * to actual renderer/editor functions.\n *\n * Call this method on your gridConfig before passing it to the grid.\n *\n * @example\n * ```typescript\n * import { GridAdapter, type GridConfig } from '@toolbox-web/grid-angular';\n *\n * const config: GridConfig<Employee> = {\n * columns: [\n * { field: 'status', renderer: StatusBadgeComponent, editor: StatusEditorComponent },\n * ],\n * };\n *\n * // In component\n * constructor() {\n * const adapter = inject(GridAdapter); // or create new instance\n * this.processedConfig = adapter.processGridConfig(config);\n * }\n * ```\n *\n * @param config - Angular grid configuration with possible component class references\n * @returns Processed GridConfig with actual renderer/editor functions\n */\n processGridConfig<TRow = unknown>(config: GridConfig<TRow>): BaseGridConfig<TRow> {\n return this.processConfig(config as BaseGridConfig<TRow>);\n }\n\n /**\n * FrameworkAdapter.processConfig implementation.\n * Called automatically by the grid's `set gridConfig` setter.\n */\n processConfig<TRow = unknown>(config: BaseGridConfig<TRow>): BaseGridConfig<TRow> {\n // Cast to Angular's extended GridConfig since the config may contain\n // Angular component classes as renderers/editors at runtime\n const angularConfig = config as unknown as GridConfig<TRow>;\n const result = { ...angularConfig };\n\n // Process columns\n if (angularConfig.columns) {\n result.columns = angularConfig.columns.map((col) => this.processColumn(col));\n }\n\n // Process typeDefaults - convert Angular component classes to renderer/editor functions\n if (angularConfig.typeDefaults) {\n result.typeDefaults = this.processTypeDefaults(angularConfig.typeDefaults) as typeof angularConfig.typeDefaults;\n }\n\n // Process feature configs - bridge Angular component classes embedded in\n // `gridConfig.features.<name>` (e.g. `groupingColumns.groupHeaderRenderer`,\n // per-group `renderer`) to plain renderer functions via the per-feature\n // preprocessors registered by the feature secondary entries. Without this,\n // component-class renderers supplied through `gridConfig.features` reach the\n // core plugin factory raw and are invoked without `new` at render time.\n // (The directive-input path bridges these in `createFeaturePlugins`; this\n // covers the equivalent `gridConfig.features` path.)\n if (angularConfig.features && typeof angularConfig.features === 'object') {\n const features = angularConfig.features as Record<string, unknown>;\n const processedFeatures: Record<string, unknown> = { ...features };\n let featuresChanged = false;\n for (const [name, featureConfig] of Object.entries(features)) {\n if (!featureConfig || typeof featureConfig !== 'object') continue;\n const preprocess = getFeatureConfigPreprocessor(name as FeatureName);\n if (!preprocess) continue;\n const processedFeature = preprocess(featureConfig, this);\n if (processedFeature !== featureConfig) {\n processedFeatures[name] = processedFeature;\n featuresChanged = true;\n }\n }\n if (featuresChanged) {\n (result as { features?: unknown }).features = processedFeatures;\n }\n }\n\n // Process loadingRenderer - convert Angular component class to function\n if (angularConfig.loadingRenderer && isComponentClass(angularConfig.loadingRenderer)) {\n (result as BaseGridConfig<TRow>).loadingRenderer = this.createComponentLoadingRenderer(\n angularConfig.loadingRenderer,\n ) as unknown as BaseGridConfig<TRow>['loadingRenderer'];\n }\n\n // Process emptyRenderer - convert Angular component class to function.\n // `null` is a valid opt-out value (suppresses the built-in default message);\n // non-component values (vanilla functions, null) are forwarded unchanged.\n if (angularConfig.emptyRenderer && isComponentClass(angularConfig.emptyRenderer)) {\n (result as BaseGridConfig<TRow>).emptyRenderer = this.createComponentEmptyRenderer(\n angularConfig.emptyRenderer,\n ) as unknown as BaseGridConfig<TRow>['emptyRenderer'];\n }\n\n return result as BaseGridConfig<TRow>;\n }\n\n /**\n * Processes typeDefaults configuration, converting component class references\n * to actual renderer/editor functions.\n *\n * @param typeDefaults - Angular type defaults with possible component class references\n * @returns Processed TypeDefault record\n */\n processTypeDefaults<TRow = unknown>(\n typeDefaults: Record<string, TypeDefault<TRow>>,\n ): Record<string, BaseTypeDefault<TRow>> {\n const processed: Record<string, BaseTypeDefault<TRow>> = {};\n\n for (const [type, config] of Object.entries(typeDefaults)) {\n const processedConfig: BaseTypeDefault<TRow> = { ...config } as BaseTypeDefault<TRow>;\n\n // Convert renderer component class to function\n if (config.renderer && isComponentClass(config.renderer)) {\n processedConfig.renderer = this.createComponentRenderer(config.renderer);\n }\n\n // Convert editor component class to function\n if (config.editor && isComponentClass(config.editor)) {\n (processedConfig as any).editor = this.createComponentEditor(config.editor);\n }\n\n // Convert filterPanelRenderer component class to function via the\n // filtering feature bridge. Without `@toolbox-web/grid-angular/features/filtering`\n // imported, component-class filterPanelRenderers are dropped silently.\n if (config.filterPanelRenderer && isComponentClass(config.filterPanelRenderer)) {\n const wrapped = getFilterPanelTypeDefaultBridge()?.(config.filterPanelRenderer, this);\n if (wrapped) processedConfig.filterPanelRenderer = wrapped;\n }\n\n processed[type] = processedConfig;\n }\n\n return processed;\n }\n\n /**\n * Processes a single column configuration, converting component class references\n * to actual renderer/editor functions.\n *\n * @param column - Angular column configuration\n * @returns Processed ColumnConfig\n */\n processColumn<TRow = unknown>(column: ColumnConfig<TRow>): BaseColumnConfig<TRow> {\n const processed = { ...column } as BaseColumnConfig<TRow>;\n\n // Convert renderer component class to function\n if (column.renderer && isComponentClass(column.renderer)) {\n processed.renderer = this.createComponentRenderer(column.renderer);\n }\n\n // Convert editor component class to function\n if (column.editor && isComponentClass(column.editor)) {\n processed.editor = this.createComponentEditor(column.editor);\n }\n\n // Convert headerRenderer component class to function\n if (column.headerRenderer && isComponentClass(column.headerRenderer)) {\n processed.headerRenderer = this.createComponentHeaderRenderer(column.headerRenderer) as any;\n }\n\n // Convert headerLabelRenderer component class to function\n if (column.headerLabelRenderer && isComponentClass(column.headerLabelRenderer)) {\n processed.headerLabelRenderer = this.createComponentHeaderLabelRenderer(column.headerLabelRenderer) as any;\n }\n\n return processed;\n }\n\n /**\n * Determines if this adapter can handle the given element.\n * Checks if a template is registered for this element (structural or nested\n * view template, or a template-based editor resolved by the editing feature).\n */\n canHandle(element: HTMLElement): boolean {\n return getAnyViewTemplate(element) !== undefined || getEditorSpecBridge()?.(element, this) !== undefined;\n }\n\n /**\n * Creates a view renderer function that creates an embedded view\n * from the registered template and returns its DOM element.\n *\n * Returns undefined if no template is registered for this element,\n * allowing the grid to use its default rendering.\n */\n createRenderer<TRow = unknown, TValue = unknown>(element: HTMLElement): ColumnViewRenderer<TRow, TValue> | undefined {\n const template = getAnyViewTemplate(element) as TemplateRef<GridCellContext<TValue, TRow>> | undefined;\n\n if (!template) {\n // Return undefined so the grid uses default rendering\n // This is important when only an editor template is provided (no view template)\n return undefined;\n }\n\n // Cell cache for this column - maps cell element to its view ref and container.\n // When the grid recycles pool elements during scroll, the same cellEl is reused\n // for different row data. By caching per cellEl, we reuse the Angular view and\n // just update its context instead of creating a new embedded view every time.\n // This matches what React and Vue adapters do with their cell caches.\n //\n // IMPORTANT: We always use a stable wrapper container (display:contents) rather\n // than caching individual rootNodes. This is critical because Angular's control\n // flow (@if, @for, @switch) can dynamically add/remove rootNodes during\n // detectChanges(). If we cached a single rootNode, newly created nodes (e.g.,\n // from an @if becoming true) would be orphaned outside the grid cell.\n const cellCache = new WeakMap<\n HTMLElement,\n { viewRef: EmbeddedViewRef<GridCellContext<TValue, TRow>>; container: HTMLElement }\n >();\n\n return (ctx: CellRenderContext<TRow, TValue>) => {\n // Skip rendering if the cell is in editing mode\n // This prevents the renderer from overwriting the editor when the grid re-renders\n if (ctx.cellEl?.classList.contains('editing')) {\n return null;\n }\n\n const cellEl = ctx.cellEl as HTMLElement | undefined;\n\n if (cellEl) {\n const cached = cellCache.get(cellEl);\n if (cached) {\n // Reuse existing view - just update context and re-run change detection\n cached.viewRef.context.$implicit = ctx.value;\n cached.viewRef.context.value = ctx.value;\n cached.viewRef.context.row = ctx.row;\n cached.viewRef.context.column = ctx.column;\n cached.viewRef.detectChanges();\n // Re-sync rootNodes into the container. Angular's control flow (@if/@for)\n // may have added or removed nodes during detectChanges().\n syncRootNodes(cached.viewRef, cached.container);\n return cached.container;\n }\n }\n\n // Create the context for the template\n const context: GridCellContext<TValue, TRow> = {\n $implicit: ctx.value,\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n };\n\n // Create embedded view from template\n const viewRef = this.viewContainerRef.createEmbeddedView(template, context);\n this.viewRefs.push(viewRef);\n\n // Trigger change detection\n viewRef.detectChanges();\n\n // Always use a stable wrapper container so Angular can freely add/remove\n // rootNodes (via @if, @for, etc.) without orphaning them outside the grid cell.\n const container = document.createElement('span');\n container.style.display = 'contents';\n syncRootNodes(viewRef, container);\n\n // Cache for reuse on scroll recycles\n if (cellEl) {\n cellCache.set(cellEl, { viewRef, container });\n }\n\n return container;\n };\n }\n\n /**\n * Creates an editor spec that creates an embedded view.\n *\n * **Auto-wiring**: The adapter automatically listens for `commit` and `cancel`\n * CustomEvents on the rendered component. If the component emits these events,\n * the adapter will call the grid's commit/cancel functions automatically.\n *\n * This means templates can be simplified from:\n * ```html\n * <app-editor *tbwEditor=\"let value; onCommit as onCommit\"\n * [value]=\"value\" (commit)=\"onCommit($event)\" />\n * ```\n * To just:\n * ```html\n * <app-editor *tbwEditor=\"let value\" [value]=\"value\" />\n * ```\n * As long as the component emits `(commit)` with the new value.\n */\n createEditor<TRow = unknown, TValue = unknown>(element: HTMLElement): ColumnEditorSpec<TRow, TValue> | undefined {\n // Template-based editors (`*tbwEditor` / `<tbw-grid-column-editor>`) are\n // owned by `@toolbox-web/grid-angular/features/editing`. Delegate to its\n // bridge, which returns undefined when the feature is not imported or no\n // editor template is registered for this element. Component-class editors\n // (column `editor` / type-default `editor`) are handled separately and do\n // not require the editing feature import.\n return getEditorSpecBridge()?.<TRow, TValue>(element, this);\n }\n\n /**\n * Creates a detail renderer function for MasterDetailPlugin. Delegates to\n * the bridge installed by `@toolbox-web/grid-angular/features/master-detail`.\n * Returns undefined if the feature is not imported or no `<tbw-grid-detail>`\n * template is registered for this grid.\n */\n createDetailRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow) => HTMLElement) | undefined {\n return getDetailRendererBridge()?.<TRow>(gridElement, this) as ((row: TRow) => HTMLElement) | undefined;\n }\n\n /**\n * FrameworkAdapter hook called by MasterDetailPlugin during attach(). Delegates\n * to {@link createDetailRenderer} (bridge installed by master-detail feature).\n */\n parseDetailElement<TRow = unknown>(\n detailElement: Element,\n ): ((row: TRow, rowIndex: number) => HTMLElement | string) | undefined {\n const gridElement = detailElement.closest('tbw-grid, [data-tbw-grid]') as HTMLElement | null;\n if (!gridElement) return undefined;\n return getDetailRendererBridge()?.<TRow>(gridElement, this);\n }\n\n /**\n * Creates a responsive card renderer function for ResponsivePlugin. Delegates\n * to the bridge installed by `@toolbox-web/grid-angular/features/responsive`.\n */\n createResponsiveCardRenderer<TRow = unknown>(\n gridElement: HTMLElement,\n ): ((row: TRow, rowIndex: number) => HTMLElement) | undefined {\n return getResponsiveCardRendererBridge()?.<TRow>(gridElement, this);\n }\n\n /**\n * FrameworkAdapter hook called by ResponsivePlugin during attach(). Delegates\n * to {@link createResponsiveCardRenderer} (bridge installed by responsive feature).\n */\n parseResponsiveCardElement<TRow = unknown>(\n cardElement: Element,\n ): ((row: TRow, rowIndex: number) => HTMLElement) | undefined {\n const gridElement = cardElement.closest('tbw-grid, [data-tbw-grid]') as HTMLElement | null;\n if (!gridElement) return undefined;\n return getResponsiveCardRendererBridge()?.<TRow>(gridElement, this);\n }\n\n /**\n * Creates a tool panel renderer from a light DOM element. Tool-panel\n * templates are owned by `@toolbox-web/grid-angular/features/shell`; delegate\n * to its bridge, which returns undefined when the feature is not imported or\n * no tool-panel template is registered for this element.\n */\n createToolPanelRenderer(element: HTMLElement): ((container: HTMLElement) => void | (() => void)) | undefined {\n return getToolPanelRendererBridge()?.(element, this);\n }\n\n /**\n * Gets type-level defaults from the application's GridTypeRegistry.\n *\n * This enables application-wide type defaults configured via `provideGridTypeDefaults()`.\n * The returned TypeDefault contains renderer/editor functions that instantiate\n * Angular components dynamically.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridTypeDefaults({\n * country: {\n * renderer: CountryCellComponent,\n * editor: CountryEditorComponent\n * }\n * })\n * ]\n * };\n *\n * // Any grid with type: 'country' columns will use these components\n * gridConfig = {\n * columns: [{ field: 'country', type: 'country' }]\n * };\n * ```\n */\n getTypeDefault<TRow = unknown>(type: string, _gridEl?: HTMLElement): BaseTypeDefault<TRow> | undefined {\n if (!this.typeRegistry) {\n return undefined;\n }\n\n const config = this.typeRegistry.get(type);\n if (!config) {\n return undefined;\n }\n\n const typeDefault: BaseTypeDefault<TRow> = {\n editorParams: config.editorParams,\n };\n\n // Create renderer function that instantiates the Angular component\n if (config.renderer) {\n typeDefault.renderer = this.createComponentRenderer<TRow, unknown>(config.renderer);\n }\n\n // Create editor function that instantiates the Angular component\n if (config.editor) {\n // Type assertion needed: adapter bridges TRow to core's unknown\n typeDefault.editor = this.createComponentEditor<TRow, unknown>(config.editor) as BaseTypeDefault['editor'];\n }\n\n // Create filterPanelRenderer function that instantiates the Angular component\n // via the filtering feature bridge. Drop silently if the feature is not imported.\n if (config.filterPanelRenderer && isComponentClass(config.filterPanelRenderer)) {\n const wrapped = getFilterPanelTypeDefaultBridge()?.(config.filterPanelRenderer, this);\n if (wrapped) typeDefault.filterPanelRenderer = wrapped;\n } else if (config.filterPanelRenderer) {\n typeDefault.filterPanelRenderer = config.filterPanelRenderer as BaseTypeDefault['filterPanelRenderer'];\n }\n\n return typeDefault;\n }\n\n /**\n * Generalized component-mount primitive. All `createComponent*Renderer` methods\n * are thin wrappers around this. Returns a function `(ctx) => { hostElement, componentRef }`\n * so callers that need the `componentRef` (editor wiring, value-change subscription)\n * still have it; callers that only need the host element use `.hostElement`.\n *\n * Public so feature secondary entries can compose their own component renderers\n * without re-implementing the mount/track plumbing.\n *\n * @param componentClass Angular component class to instantiate per call.\n * @param mapInputs Maps the renderer context to a `setInput()` bag.\n * @param pool Which `componentRefs[]` array tracks the instance for cleanup.\n * `'render'` (default) is the long-lived pool cleared at `dispose()`.\n * `'editor'` is the per-cell pool swept by `releaseCell()`.\n * @internal\n */\n mountComponentRenderer<TCtx>(\n componentClass: Type<unknown>,\n mapInputs: (ctx: TCtx) => Record<string, unknown>,\n pool: 'render' | 'editor' = 'render',\n ): (ctx: TCtx) => { hostElement: HTMLSpanElement; componentRef: ComponentRef<unknown> } {\n return (ctx: TCtx) => {\n const hostElement = document.createElement('span');\n hostElement.style.display = 'contents';\n const componentRef = createComponent(componentClass, {\n environmentInjector: this.injector,\n hostElement,\n });\n this.setComponentInputs(componentRef, mapInputs(ctx));\n this.appRef.attachView(componentRef.hostView);\n (pool === 'editor' ? this.editorComponentRefs : this.componentRefs).push(componentRef);\n componentRef.changeDetectorRef.detectChanges();\n return { hostElement, componentRef };\n };\n }\n\n /**\n * Creates a renderer function from an Angular component class.\n * Wraps {@link mountComponentRenderer} with a per-cell `WeakMap` cache so\n * scroll-recycled cells reuse the existing component (just refresh inputs)\n * instead of mounting a fresh one.\n * @internal\n */\n private createComponentRenderer<TRow = unknown, TValue = unknown>(\n componentClass: Type<unknown>,\n ): ColumnViewRenderer<TRow, TValue> {\n const cellCache = new WeakMap<HTMLElement, { componentRef: ComponentRef<unknown>; hostElement: HTMLSpanElement }>();\n const mount = this.mountComponentRenderer<CellRenderContext<TRow, TValue>>(componentClass, (ctx) => ({\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n }));\n\n return (ctx: CellRenderContext<TRow, TValue>) => {\n const cellEl = ctx.cellEl as HTMLElement | undefined;\n\n if (cellEl) {\n const cached = cellCache.get(cellEl);\n if (cached) {\n // Reuse existing component - just update inputs.\n this.setComponentInputs(cached.componentRef, {\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n });\n cached.componentRef.changeDetectorRef.detectChanges();\n return cached.hostElement;\n }\n }\n\n const { hostElement, componentRef } = mount(ctx);\n if (cellEl) cellCache.set(cellEl, { componentRef, hostElement });\n return hostElement;\n };\n }\n\n /**\n * Creates an editor function from an Angular component class.\n * Wraps {@link mountComponentRenderer} (using the `'editor'` pool for per-cell\n * cleanup) plus editor-specific wiring: callback bridge, mount-hook fan-out\n * (see {@link runEditorMountHooks}), and external value-change subscription.\n * @internal\n */\n private createComponentEditor<TRow = unknown, TValue = unknown>(\n componentClass: Type<unknown>,\n ): ColumnEditorSpec<TRow, TValue> {\n const mount = this.mountComponentRenderer<ColumnEditorContext<TRow, TValue>>(\n componentClass,\n (ctx) => ({ value: ctx.value, row: ctx.row, column: ctx.column }),\n 'editor',\n );\n\n return (ctx: ColumnEditorContext<TRow, TValue>) => {\n const { hostElement, componentRef } = mount(ctx);\n\n wireEditorCallbacks<TValue>(\n hostElement,\n componentRef.instance as Record<string, unknown>,\n (value) => ctx.commit(value),\n () => ctx.cancel(),\n );\n this.runEditorMountHooks(hostElement);\n\n // Auto-update editor when value changes externally (e.g., via updateRow cascade\n // or Escape-revert). Update the component input and run detectChanges() —\n // the component's own template handles rendering regardless of editor type.\n ctx.onValueChange?.((newVal: unknown) => {\n try {\n // Notify the editor so it can clear stale internal state (e.g., searchText\n // in autocomplete editors) before the value input updates.\n const instance = componentRef.instance;\n if (typeof (instance as Record<string, unknown>)['onExternalValueChange'] === 'function') {\n (instance as { onExternalValueChange: (v: unknown) => void }).onExternalValueChange(newVal);\n }\n componentRef.setInput('value', newVal);\n componentRef.changeDetectorRef.detectChanges();\n } catch {\n // Component is destroyed — nothing to update.\n }\n });\n\n return hostElement;\n };\n }\n\n /**\n * Creates a header renderer function from an Angular component class.\n * Mounts the component with full header context (column, value, sortState, etc.).\n * @internal\n */\n private createComponentHeaderRenderer<TRow = unknown>(\n componentClass: Type<unknown>,\n ): (ctx: HeaderCellContext<TRow>) => HTMLElement {\n const mount = this.mountComponentRenderer<HeaderCellContext<TRow>>(componentClass, (ctx) => ({\n column: ctx.column,\n value: ctx.value,\n sortState: ctx.sortState,\n filterActive: ctx.filterActive,\n renderSortIcon: ctx.renderSortIcon,\n renderFilterButton: ctx.renderFilterButton,\n }));\n return (ctx) => mount(ctx).hostElement;\n }\n\n /**\n * Creates a header label renderer function from an Angular component class.\n * Mounts the component with label context (column, value).\n * @internal\n */\n private createComponentHeaderLabelRenderer<TRow = unknown>(\n componentClass: Type<unknown>,\n ): (ctx: HeaderLabelContext<TRow>) => HTMLElement {\n const mount = this.mountComponentRenderer<HeaderLabelContext<TRow>>(componentClass, (ctx) => ({\n column: ctx.column,\n value: ctx.value,\n }));\n return (ctx) => mount(ctx).hostElement;\n }\n\n /**\n * Creates a loading renderer function from an Angular component class.\n *\n * The component should accept a `size` input ('large' | 'small').\n * @internal\n */\n private createComponentLoadingRenderer(componentClass: Type<unknown>): (ctx: LoadingContext) => HTMLElement {\n const mount = this.mountComponentRenderer<LoadingContext>(componentClass, (ctx) => ({ size: ctx.size }));\n return (ctx) => mount(ctx).hostElement;\n }\n\n /**\n * Creates an empty-state renderer function from an Angular component class.\n *\n * The component receives `sourceRowCount` and `filteredOut` inputs.\n * @internal\n */\n private createComponentEmptyRenderer(componentClass: Type<unknown>): (ctx: EmptyContext) => HTMLElement {\n const mount = this.mountComponentRenderer<EmptyContext>(componentClass, (ctx) => ({\n sourceRowCount: ctx.sourceRowCount,\n filteredOut: ctx.filteredOut,\n }));\n return (ctx) => mount(ctx).hostElement;\n }\n\n /**\n * Create an embedded view from a `TemplateRef` and append-track it on the\n * adapter's view-ref pool so it is cleaned up on `destroy()` / `unmount()`.\n * Public so feature secondary entries can mount Angular templates (e.g.\n * master-detail rows, responsive cards) without reaching into the adapter's\n * private `viewContainerRef` / `viewRefs`.\n * @internal\n */\n createTrackedEmbeddedView<TCtx>(template: TemplateRef<TCtx>, context: TCtx): EmbeddedViewRef<TCtx> {\n const viewRef = this.viewContainerRef.createEmbeddedView(template, context);\n this.viewRefs.push(viewRef);\n viewRef.detectChanges();\n return viewRef;\n }\n\n /**\n * Create an editor embedded view from a `TemplateRef`: tracks it in the\n * per-cell editor pool (swept by `releaseCell()` when the grid recycles the\n * cell), wraps its root nodes in a stable `display:contents` span, and runs\n * the registered editor-mount hooks against that span. Public so the editing\n * feature secondary entry can mount `*tbwEditor` / `<tbw-grid-column-editor>`\n * templates without reaching into the adapter's private view pools or\n * mount-hook fan-out.\n * @internal\n * @since 3.0.0\n */\n createEditorTemplateView<TCtx>(\n template: TemplateRef<TCtx>,\n context: TCtx,\n ): { container: HTMLElement; viewRef: EmbeddedViewRef<TCtx> } {\n const viewRef = this.viewContainerRef.createEmbeddedView(template, context);\n // Track in editor-specific pool for per-cell cleanup via releaseCell().\n this.editorViewRefs.push(viewRef);\n viewRef.detectChanges();\n // Stable wrapper so Angular's rootNodes (which may include comment\n // placeholders from <ng-container>/control flow) live inside one element.\n const container = document.createElement('span');\n container.style.display = 'contents';\n syncRootNodes(viewRef, container);\n this.runEditorMountHooks(container);\n return { container, viewRef };\n }\n\n /**\n * Re-sync an editor embedded view's root nodes into its `display:contents`\n * container after an external `detectChanges()` (Angular control flow may\n * have added/removed nodes). Public for the editing feature's external\n * value-change handler.\n * @internal\n * @since 3.0.0\n */\n syncEditorTemplateView(viewRef: EmbeddedViewRef<unknown>, container: HTMLElement): void {\n syncRootNodes(viewRef, container);\n }\n\n /**\n * Processes a GroupingColumnsConfig. Delegates to the feature config\n * preprocessor installed by `@toolbox-web/grid-angular/features/grouping-columns`,\n * which handles converting Angular component class references to actual\n * renderer functions. Returns the input config unchanged if the feature\n * is not imported.\n */\n processGroupingColumnsConfig<TConfig>(config: TConfig): TConfig {\n return this.applyFeatureConfigPreprocessor('groupingColumns', config);\n }\n\n /**\n * Processes a GroupingRowsConfig. Delegates to the feature config preprocessor\n * installed by `@toolbox-web/grid-angular/features/grouping-rows`.\n */\n processGroupingRowsConfig<TConfig>(config: TConfig): TConfig {\n return this.applyFeatureConfigPreprocessor('groupingRows', config);\n }\n\n /**\n * Processes a PinnedRowsConfig. Delegates to the feature config preprocessor\n * installed by `@toolbox-web/grid-angular/features/pinned-rows`.\n */\n processPinnedRowsConfig<TConfig>(config: TConfig): TConfig {\n return this.applyFeatureConfigPreprocessor('pinnedRows', config);\n }\n\n /**\n * Run a registered feature-config preprocessor against `config`, returning\n * the original config unchanged when the feature is not imported.\n * @internal\n */\n private applyFeatureConfigPreprocessor<TConfig>(name: FeatureName, config: TConfig): TConfig {\n if (!config || typeof config !== 'object') return config;\n const preprocessor = getFeatureConfigPreprocessor(name);\n if (!preprocessor) return config;\n return preprocessor(config, this) as TConfig;\n }\n\n /**\n * Sets component inputs using Angular's setInput API.\n * @internal\n */\n private setComponentInputs(componentRef: ComponentRef<unknown>, inputs: Record<string, unknown>): void {\n for (const [key, value] of Object.entries(inputs)) {\n try {\n componentRef.setInput(key, value);\n } catch {\n // Input doesn't exist on component - that's okay, some inputs are optional\n }\n }\n }\n\n /**\n * Called when a cell's content is about to be wiped (e.g., exiting edit mode,\n * scroll-recycling a row, or rebuilding a row).\n *\n * Destroys any editor embedded views or component refs whose DOM is\n * inside the given cell element. This prevents memory leaks from\n * orphaned Angular views that would otherwise stay in the change\n * detection tree indefinitely.\n */\n releaseCell(cellEl: HTMLElement): void {\n // Release editor embedded views whose root nodes are inside this cell\n for (let i = this.editorViewRefs.length - 1; i >= 0; i--) {\n const ref = this.editorViewRefs[i];\n if (ref.rootNodes.some((n: Node) => cellEl.contains(n))) {\n ref.destroy();\n this.editorViewRefs.splice(i, 1);\n }\n }\n // Release editor component refs whose host element is inside this cell\n for (let i = this.editorComponentRefs.length - 1; i >= 0; i--) {\n const ref = this.editorComponentRefs[i];\n if (cellEl.contains(ref.location.nativeElement)) {\n ref.destroy();\n this.editorComponentRefs.splice(i, 1);\n }\n }\n // Detach editor-mount hook teardowns for editor hosts inside this cell.\n for (const [hostEl, unsub] of this.editorMountTeardowns) {\n if (cellEl.contains(hostEl)) {\n unsub();\n this.editorMountTeardowns.delete(hostEl);\n }\n }\n }\n\n /**\n * Open a teardown batch. No-op for the Angular adapter — `viewRef.destroy()`\n * and `componentRef.destroy()` are synchronous DOM operations with no\n * deferred-commit warning analogous to React's `flushSync`. Implemented\n * for {@link FrameworkAdapter} parity so grid core's bulk-teardown\n * wrappers work uniformly across adapters.\n */\n beginBatch(_gridEl?: HTMLElement): void {\n // intentionally empty\n }\n\n /**\n * Close a teardown batch opened by {@link beginBatch}. No-op for Angular —\n * see {@link beginBatch}.\n */\n endBatch(_gridEl?: HTMLElement): void {\n // intentionally empty\n }\n\n /**\n * Unmount a specific container (e.g., detail panel, tool panel).\n * Finds the matching view or component ref whose DOM nodes are inside\n * the container and properly destroys it to prevent memory leaks.\n */\n unmount(container: HTMLElement): void {\n for (let i = this.viewRefs.length - 1; i >= 0; i--) {\n const ref = this.viewRefs[i];\n if (ref.rootNodes.some((n: Node) => container.contains(n))) {\n ref.destroy();\n this.viewRefs.splice(i, 1);\n return;\n }\n }\n for (let i = this.componentRefs.length - 1; i >= 0; i--) {\n const ref = this.componentRefs[i];\n if (container.contains(ref.location.nativeElement)) {\n ref.destroy();\n this.componentRefs.splice(i, 1);\n return;\n }\n }\n }\n\n /**\n * Clean up all view references and component references.\n * Call this when your app/component is destroyed.\n */\n destroy(): void {\n this.viewRefs.forEach((ref) => ref.destroy());\n this.viewRefs = [];\n this.editorViewRefs.forEach((ref) => ref.destroy());\n this.editorViewRefs = [];\n this.componentRefs.forEach((ref) => ref.destroy());\n this.componentRefs = [];\n this.editorComponentRefs.forEach((ref) => ref.destroy());\n this.editorComponentRefs = [];\n this.editorMountTeardowns.forEach((unsub) => unsub());\n this.editorMountTeardowns.clear();\n }\n\n /**\n * Runs every registered {@link EditorMountHook} against a freshly mounted\n * editor host once it has been parented to the grid. The grid is resolved\n * lazily via `queueMicrotask` because the host is appended to the cell\n * *after* the editor wrapper returns. Mirror of Vue's\n * `attachBeforeEditCloseFlush` and React's `wrapReactEditor`\n * queueMicrotask bridge.\n *\n * Without any feature imports the hook list is empty and this is a no-op\n * — `before-edit-close` blur handling lives in\n * `@toolbox-web/grid-angular/features/editing`.\n * @internal\n */\n private runEditorMountHooks(host: HTMLElement): void {\n queueMicrotask(() => {\n const gridEl = host.closest('tbw-grid, [data-tbw-grid]') as HTMLElement | null;\n if (!gridEl) return;\n this.editorMountTeardowns.set(host, notifyEditorMounted(host, gridEl));\n });\n }\n}\n","/**\n * Icon configuration registry for Angular applications.\n *\n * Provides application-wide icon overrides for all grids via\n * Angular's dependency injection.\n */\nimport { EnvironmentProviders, inject, Injectable, InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport type { GridIcons } from '@toolbox-web/grid';\n\n/**\n * Injection token for providing icon overrides at app level.\n * @since 0.8.0\n */\nexport const GRID_ICONS = new InjectionToken<Partial<GridIcons>>('GRID_ICONS');\n\n/**\n * Injectable service for managing grid icons.\n *\n * Use `provideGridIcons()` in your app config to set up icons,\n * or inject this service for dynamic registration.\n *\n * @example\n * ```typescript\n * // App-level setup (app.config.ts)\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridIcons({\n * expand: '➕',\n * collapse: '➖',\n * sortAsc: '↑',\n * sortDesc: '↓',\n * })\n * ]\n * };\n *\n * // Dynamic registration\n * @Component({ ... })\n * export class AppComponent {\n * private registry = inject(GridIconRegistry);\n *\n * ngOnInit() {\n * this.registry.set('filter', '<svg>...</svg>');\n * }\n * }\n * ```\n * @since 0.8.0\n */\n@Injectable({ providedIn: 'root' })\nexport class GridIconRegistry {\n private readonly icons = new Map<keyof GridIcons, GridIcons[keyof GridIcons]>();\n\n constructor() {\n // Merge any initial icons from provider\n const initial = inject(GRID_ICONS, { optional: true });\n if (initial) {\n for (const [key, value] of Object.entries(initial)) {\n this.icons.set(key as keyof GridIcons, value);\n }\n }\n }\n\n /**\n * Set an icon override.\n *\n * @param name - The icon name (e.g., 'expand', 'collapse', 'filter')\n * @param value - The icon value (string text or SVG markup)\n */\n set<K extends keyof GridIcons>(name: K, value: GridIcons[K]): void {\n this.icons.set(name, value);\n }\n\n /**\n * Get an icon value.\n */\n get<K extends keyof GridIcons>(name: K): GridIcons[K] | undefined {\n return this.icons.get(name) as GridIcons[K] | undefined;\n }\n\n /**\n * Remove an icon override.\n */\n remove(name: keyof GridIcons): void {\n this.icons.delete(name);\n }\n\n /**\n * Check if an icon has an override.\n */\n has(name: keyof GridIcons): boolean {\n return this.icons.has(name);\n }\n\n /**\n * Get all icon overrides as a GridIcons partial.\n * Used internally by the adapter.\n *\n * @internal\n */\n getAll(): Partial<GridIcons> {\n const result: Partial<GridIcons> = {};\n for (const [key, value] of this.icons) {\n (result as Record<keyof GridIcons, GridIcons[keyof GridIcons]>)[key] = value;\n }\n return result;\n }\n\n /**\n * Get all registered icon names.\n */\n getRegisteredIcons(): (keyof GridIcons)[] {\n return Array.from(this.icons.keys());\n }\n}\n\n/**\n * Provides application-level icon overrides for all grids.\n *\n * Available icons to override:\n * - `expand` - Expand icon for collapsed items (trees, groups, details)\n * - `collapse` - Collapse icon for expanded items\n * - `sortAsc` - Sort ascending indicator\n * - `sortDesc` - Sort descending indicator\n * - `sortNone` - Sort neutral/unsorted indicator\n * - `submenuArrow` - Submenu arrow for context menus\n * - `dragHandle` - Drag handle icon for reordering\n * - `toolPanel` - Tool panel toggle icon in toolbar\n * - `filter` - Filter icon in column headers\n * - `filterActive` - Filter icon when filter is active\n * - `print` - Print icon for print button\n *\n * @example\n * ```typescript\n * // app.config.ts\n * import { provideGridIcons } from '@toolbox-web/grid-angular';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGridIcons({\n * expand: '➕',\n * collapse: '➖',\n * sortAsc: '↑',\n * sortDesc: '↓',\n * filter: '<svg viewBox=\"0 0 16 16\">...</svg>',\n * })\n * ]\n * };\n * ```\n * @since 0.8.0\n */\nexport function provideGridIcons(icons: Partial<GridIcons>): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: GRID_ICONS, useValue: icons }]);\n}\n","import { afterNextRender, computed, DestroyRef, ElementRef, inject, type Signal, signal } from '@angular/core';\nimport type { ColumnConfig, DataGridElement, GridConfig } from '@toolbox-web/grid';\n\n/**\n * Return type for injectGrid function.\n * @since 0.6.0\n */\nexport interface InjectGridReturn<TRow = unknown> {\n /** Direct access to the typed grid element */\n element: Signal<DataGridElement<TRow> | null>;\n /** Whether the grid is ready */\n isReady: Signal<boolean>;\n /** Current grid configuration */\n config: Signal<GridConfig<TRow> | null>;\n /** Get the effective configuration */\n getConfig: () => Promise<GridConfig<TRow> | null>;\n /** Force a layout recalculation */\n forceLayout: () => Promise<void>;\n /** Toggle a group row */\n toggleGroup: (key: string) => Promise<void>;\n /** Register custom styles */\n registerStyles: (id: string, css: string) => void;\n /** Unregister custom styles */\n unregisterStyles: (id: string) => void;\n /** Get current visible columns */\n visibleColumns: Signal<ColumnConfig<TRow>[]>;\n /**\n * Look up a plugin instance by its class constructor.\n * Returns `undefined` if the plugin is not registered or the grid is not yet ready.\n */\n getPlugin: <T>(pluginClass: new (...args: unknown[]) => T) => T | undefined;\n /**\n * Look up a plugin instance by its registered name (e.g. `'tooltip'`, `'undoRedo'`).\n * Returns `undefined` if the plugin is not registered or the grid is not yet ready.\n */\n getPluginByName: DataGridElement<TRow>['getPluginByName'];\n}\n\n/**\n * Angular inject function for programmatic access to a grid instance.\n *\n * This function should be called in the constructor or as a field initializer\n * of an Angular component that contains a `<tbw-grid>` element.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid, injectGrid } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * template: `\n * <button (click)=\"handleResize()\">Force Layout</button>\n * <button (click)=\"handleExport()\" [disabled]=\"!grid.isReady()\">Export</button>\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\"></tbw-grid>\n * `\n * })\n * export class MyGridComponent {\n * grid = injectGrid<Employee>();\n *\n * async handleResize() {\n * await this.grid.forceLayout();\n * }\n *\n * async handleExport() {\n * const config = await this.grid.getConfig();\n * console.log('Exporting with columns:', config?.columns);\n * }\n * }\n * ```\n *\n * @param selector - Optional CSS selector to target a specific grid element.\n * Defaults to `'tbw-grid'` (first grid in the component). Use when the\n * component contains multiple grids, e.g. `'tbw-grid.primary'` or `'#my-grid'`.\n * @returns Object with grid access methods and state signals\n * @since 0.6.0\n */\nexport function injectGrid<TRow = unknown>(selector = 'tbw-grid'): InjectGridReturn<TRow> {\n const elementRef = inject(ElementRef);\n const destroyRef = inject(DestroyRef);\n\n // Reactive signals\n const isReady = signal(false);\n const config = signal<GridConfig<TRow> | null>(null);\n const element = signal<DataGridElement<TRow> | null>(null);\n\n // Track destruction so async work doesn't touch signals after teardown\n let destroyed = false;\n destroyRef.onDestroy(() => {\n destroyed = true;\n });\n\n // Initialize after render\n afterNextRender(() => {\n const gridElement = elementRef.nativeElement.querySelector(selector) as DataGridElement<TRow>;\n if (!gridElement) {\n console.warn('[injectGrid] No tbw-grid element found in component');\n return;\n }\n\n element.set(gridElement);\n\n // Wait for grid to be ready. Use Promise.resolve to guard against\n // gridElement.ready being undefined (would otherwise throw on .then).\n Promise.resolve(gridElement.ready?.())\n .then(async () => {\n if (destroyed) return;\n isReady.set(true);\n const effectiveConfig = await gridElement.getConfig?.();\n if (destroyed) return;\n if (effectiveConfig) {\n config.set(effectiveConfig as GridConfig<TRow>);\n }\n })\n .catch((err) => {\n console.error('[injectGrid] Error waiting for grid to be ready:', err);\n });\n });\n\n // Computed visible columns\n const visibleColumns = computed<ColumnConfig<TRow>[]>(() => {\n const currentConfig = config();\n if (!currentConfig?.columns) return [];\n return currentConfig.columns.filter((col) => !col.hidden);\n });\n\n // ═══════════════════════════════════════════════════════════════════\n // CORE METHODS\n // ═══════════════════════════════════════════════════════════════════\n\n const getConfig = async (): Promise<GridConfig<TRow> | null> => {\n const gridElement = element();\n if (!gridElement) return null;\n const effectiveConfig = gridElement.getConfig?.();\n return (effectiveConfig as GridConfig<TRow>) ?? null;\n };\n\n const forceLayout = async (): Promise<void> => {\n const gridElement = element();\n if (!gridElement) return;\n await gridElement.forceLayout?.();\n };\n\n const toggleGroup = async (key: string): Promise<void> => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n if (!gridElement) return;\n await gridElement.toggleGroup?.(key);\n };\n\n const registerStyles = (id: string, css: string): void => {\n element()?.registerStyles?.(id, css);\n };\n\n const unregisterStyles = (id: string): void => {\n element()?.unregisterStyles?.(id);\n };\n\n const getPlugin = <T>(pluginClass: new (...args: unknown[]) => T): T | undefined => {\n return element()?.getPlugin?.(pluginClass);\n };\n\n const getPluginByName = ((name: string) => {\n return element()?.getPluginByName?.(name);\n }) as DataGridElement<TRow>['getPluginByName'];\n\n return {\n element,\n isReady,\n config,\n visibleColumns,\n getConfig,\n forceLayout,\n toggleGroup,\n registerStyles,\n unregisterStyles,\n getPlugin,\n getPluginByName,\n };\n}\n","// @internal Types-only barrel: pulls core feature modules onto ng-packagr's type\n// graph so FeatureConfig augmentations merge before emit. See\n// .github/knowledge/adapters-angular.md (\"FeatureName derivation\"). Use `//` not\n// `/** */` — terser preserves JSDoc in the fesm bundle (~1.5 KiB cost).\n//\n// Each line re-exports the core feature's `_Augmentation` anchor type under a\n// unique local name. This is functionally equivalent to\n// `import type {} from '@toolbox-web/grid/features/<name>'` but survives\n// Prettier / organize-imports, which strip empty-brace imports as unused.\n// The re-exports are type-only (zero runtime cost) and stay internal because\n// `feature-registry.ts` consumes this file with a bare side-effect import\n// (`import './internal/feature-augmentations'`), not a re-export.\n// Append a new line whenever a core feature is added.\n\nexport type { _Augmentation as _ClipboardAugmentation } from '@toolbox-web/grid/features/clipboard';\nexport type { _Augmentation as _ColumnVirtualizationAugmentation } from '@toolbox-web/grid/features/column-virtualization';\nexport type { _Augmentation as _ContextMenuAugmentation } from '@toolbox-web/grid/features/context-menu';\nexport type { _Augmentation as _EditingAugmentation } from '@toolbox-web/grid/features/editing';\nexport type { _Augmentation as _ExportAugmentation } from '@toolbox-web/grid/features/export';\nexport type { _Augmentation as _FilteringAugmentation } from '@toolbox-web/grid/features/filtering';\nexport type { _Augmentation as _GroupingColumnsAugmentation } from '@toolbox-web/grid/features/grouping-columns';\nexport type { _Augmentation as _GroupingRowsAugmentation } from '@toolbox-web/grid/features/grouping-rows';\nexport type { _Augmentation as _MasterDetailAugmentation } from '@toolbox-web/grid/features/master-detail';\nexport type { _Augmentation as _MultiSortAugmentation } from '@toolbox-web/grid/features/multi-sort';\nexport type { _Augmentation as _PinnedColumnsAugmentation } from '@toolbox-web/grid/features/pinned-columns';\nexport type { _Augmentation as _PinnedRowsAugmentation } from '@toolbox-web/grid/features/pinned-rows';\nexport type { _Augmentation as _PivotAugmentation } from '@toolbox-web/grid/features/pivot';\nexport type { _Augmentation as _PrintAugmentation } from '@toolbox-web/grid/features/print';\nexport type { _Augmentation as _ReorderColumnsAugmentation } from '@toolbox-web/grid/features/reorder-columns';\nexport type { _Augmentation as _ResponsiveAugmentation } from '@toolbox-web/grid/features/responsive';\nexport type { _Augmentation as _RowDragDropAugmentation } from '@toolbox-web/grid/features/row-drag-drop';\nexport type { _Augmentation as _SelectionAugmentation } from '@toolbox-web/grid/features/selection';\nexport type { _Augmentation as _ServerSideAugmentation } from '@toolbox-web/grid/features/server-side';\nexport type { _Augmentation as _ShellAugmentation } from '@toolbox-web/grid/features/shell';\nexport type { _Augmentation as _StickyRowsAugmentation } from '@toolbox-web/grid/features/sticky-rows';\nexport type { _Augmentation as _TooltipAugmentation } from '@toolbox-web/grid/features/tooltip';\nexport type { _Augmentation as _TreeAugmentation } from '@toolbox-web/grid/features/tree';\nexport type { _Augmentation as _UndoRedoAugmentation } from '@toolbox-web/grid/features/undo-redo';\nexport type { _Augmentation as _VisibilityAugmentation } from '@toolbox-web/grid/features/visibility';\n","/**\n * Feature Registry for @toolbox-web/grid-angular\n *\n * Delegates to the core registry at `@toolbox-web/grid/features/registry`.\n * This module re-exports core functions so existing feature modules continue\n * to work without changing their import paths.\n *\n * @example\n * ```typescript\n * // Import features you need (side-effect imports)\n * import '@toolbox-web/grid-angular/features/selection';\n * import '@toolbox-web/grid-angular/features/filtering';\n *\n * // Inputs work automatically - no async loading, no HTTP requests\n * <tbw-grid [selection]=\"'range'\" [filtering]=\"{ debounceMs: 200 }\" />\n * ```\n */\n\n// Re-export core registry — all adapters share the same registry Map\nexport {\n clearFeatureRegistry,\n createPluginFromFeature,\n getFeatureFactory,\n getRegisteredFeatures,\n isFeatureRegistered,\n registerFeature,\n} from '@toolbox-web/grid/features/registry';\n\nexport type { PluginFactory } from '@toolbox-web/grid/features/registry';\n\nimport type { FeatureConfig } from '@toolbox-web/grid';\n// Anchor every core feature module on the type graph so its `FeatureConfig`\n// augmentation is visible to ng-packagr's partial compilation when emitting\n// the `keyof FeatureConfig` below — see `internal/feature-augmentations.ts`\n// header for the full rationale (gh #356 phase 6).\nimport './internal/feature-augmentations';\n\n/**\n * Feature names supported by the Grid directive, derived from the core\n * augmentable `FeatureConfig` interface — stays in lockstep with core: any\n * feature that augments `FeatureConfig` (via `declare module\n * '@toolbox-web/grid'`) is automatically a member of this union, including\n * third-party features.\n *\n * The `__brand` sentinel declared on core's `FeatureConfig` (to keep the\n * interface non-empty for excess-property checks) is filtered out — it is\n * not a real feature name.\n *\n * The `feature-registry.spec.ts` superset check enforces the strict\n * additive contract (gh #356 §7): every previously-accepted name must stay\n * assignable to the derived union.\n *\n * @since 0.6.0\n */\ntype DerivedFeatureName = Exclude<keyof FeatureConfig, '__brand'>;\n\n// Defensive fallback for dist-linked builds where external FeatureConfig\n// augmentations fail to load under ng-packagr and `keyof FeatureConfig`\n// collapses to just `__brand`.\nexport type FeatureName = [DerivedFeatureName] extends [never] ? string : DerivedFeatureName;\n","import { Directive } from '@angular/core';\n\n/**\n * Directive that registers `<tbw-grid-column>` as a known Angular element.\n *\n * This directive exists so that Angular's template compiler recognises\n * `<tbw-grid-column>` without requiring `CUSTOM_ELEMENTS_SCHEMA`.\n * The underlying web component reads its attributes (`field`, `header`,\n * `type`, `width`, etc.) directly from the DOM, so no `@Input()` forwarding\n * is needed — Angular's standard property/attribute binding handles it.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid, TbwGridColumn, TbwRenderer } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [Grid, TbwGridColumn, TbwRenderer],\n * template: `\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-column field=\"status\">\n * <app-status-badge *tbwRenderer=\"let value\" [value]=\"value\" />\n * </tbw-grid-column>\n * </tbw-grid>\n * `\n * })\n * export class MyComponent { }\n * ```\n *\n * @category Directive\n * @since 0.13.0\n */\n@Directive({\n selector: 'tbw-grid-column',\n})\nexport class TbwGridColumn {}\n","import { Directive } from '@angular/core';\n\n/**\n * Directive that registers `<tbw-grid-header>` as a known Angular element.\n *\n * This directive exists so that Angular's template compiler recognises\n * `<tbw-grid-header>` without requiring `CUSTOM_ELEMENTS_SCHEMA`.\n * The grid's `config-manager` reads attributes like `title` directly\n * from the DOM element.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid, TbwGridHeader } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [Grid, TbwGridHeader],\n * template: `\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-header title=\"My Grid Title\"></tbw-grid-header>\n * </tbw-grid>\n * `\n * })\n * export class MyComponent { }\n * ```\n *\n * @category Directive\n * @since 0.13.0\n */\n@Directive({\n selector: 'tbw-grid-header',\n})\nexport class TbwGridHeader {}\n","import { Directive } from '@angular/core';\n\n/**\n * Directive that registers `<tbw-grid-tool-buttons>` as a known Angular element.\n *\n * This directive exists so that Angular's template compiler recognises\n * `<tbw-grid-tool-buttons>` without requiring `CUSTOM_ELEMENTS_SCHEMA`.\n * The grid's shell reads toolbar buttons directly from the DOM.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid, TbwGridToolButtons } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [Grid, TbwGridToolButtons],\n * template: `\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-tool-buttons>\n * <button (click)=\"doSomething()\">Action</button>\n * </tbw-grid-tool-buttons>\n * </tbw-grid>\n * `\n * })\n * export class MyComponent { }\n * ```\n *\n * @category Directive\n * @since 0.13.0\n */\n@Directive({\n selector: 'tbw-grid-tool-buttons',\n})\nexport class TbwGridToolButtons {}\n","import { Directive } from '@angular/core';\n\n/**\n * Directive that registers `<tbw-grid-type>` as a known Angular element.\n *\n * This keeps Angular template compilation happy without requiring\n * `CUSTOM_ELEMENTS_SCHEMA` and mirrors the existing `TbwGridColumn` directive.\n *\n * @category Directive\n * @since 2.0.0\n */\n@Directive({\n selector: 'tbw-grid-type',\n})\nexport class TbwGridType {}\n","/**\n * Column shorthand parsing for `@toolbox-web/grid-angular`.\n *\n * The parser, header generation and defaults helpers live in `@toolbox-web/grid`\n * core (issue #276). This module re-exports them so the adapter's public import\n * path is unchanged while the implementation stays in one place. Angular's\n * shorthand API types against core's `ColumnConfig` (these helpers take no\n * component-typed override), so a direct re-export is type-identical.\n */\nexport { applyColumnDefaults, hasColumnShorthands, normalizeColumns, parseColumnShorthand } from '@toolbox-web/grid';\nexport type { ColumnShorthand } from '@toolbox-web/grid';\n","/**\n * Per-grid-element claims registry used by the hybrid feature-directive\n * refactor (v1.4 → v2).\n *\n * Background: historically every plugin's input/output (e.g. `[filtering]`,\n * `(filterChange)`) was declared on the central {@link Grid} directive. That\n * pulled the typed surface for every {@link FeatureName} into the core\n * bundle — even for apps that only used a few. The new approach gives every\n * feature a thin **attribute-selector** directive (e.g.\n * `GridFilteringDirective` with selector `tbw-grid[filtering], tbw-grid[filterChange]`)\n * that lives in the feature secondary entry, so the plugin's typed surface\n * is only paid for when the feature is actually imported.\n *\n * To stay non-breaking in v1.x, the deprecated inputs/outputs remain on\n * {@link Grid}. When a feature directive is present on the same `<tbw-grid>`\n * element it **claims** its feature here; {@link Grid} consults the registry\n * and lets the directive own the input + event so we never produce duplicate\n * plugins or double-emit events.\n *\n * This module is deliberately framework-free (plain {@link WeakMap} state, no\n * `@angular/core` imports) so feature secondary entries can import it through\n * the package barrel without introducing circular module graphs. The\n * {@link FeatureName} and {@link DataGridEventMap} type imports are\n * type-only, so no runtime dependency leaks.\n *\n * @internal\n */\nimport type { DataGridEventMap } from '@toolbox-web/grid';\nimport type { FeatureName } from '../feature-registry';\n\n/** Event names that can be claimed by a feature directive. */\ntype ClaimableEventName = keyof DataGridEventMap<unknown>;\n\n/**\n * Reads the directive-owned config value for a feature. The function is\n * called during {@link Grid}'s `createFeaturePlugins` effect, so reading a\n * signal inside it establishes reactive dependency tracking — the effect\n * re-runs when the directive's input changes.\n * @internal\n * @since 1.4.0\n */\nexport type FeatureConfigGetter = () => unknown;\n\n/** Per-element map of claimed feature names → config getter. */\nconst featureClaims = new WeakMap<HTMLElement, Map<FeatureName, FeatureConfigGetter>>();\n\n/** Per-element set of claimed event names (matches `keyof DataGridEventMap`). */\nconst eventClaims = new WeakMap<HTMLElement, Set<ClaimableEventName>>();\n\n/**\n * Register a feature claim. Called by a feature directive's constructor;\n * the {@link Grid} directive will then use {@link getFeatureClaim} during\n * plugin creation instead of reading its own deprecated input.\n * @internal\n * @since 1.4.0\n */\nexport function registerFeatureClaim(grid: HTMLElement, name: FeatureName, getConfig: FeatureConfigGetter): void {\n let map = featureClaims.get(grid);\n if (!map) {\n map = new Map<FeatureName, FeatureConfigGetter>();\n featureClaims.set(grid, map);\n }\n map.set(name, getConfig);\n}\n\n/**\n * Look up a feature claim. Returns the registered config getter, or\n * `undefined` if no directive owns this feature on this element.\n * @internal\n * @since 1.4.0\n */\nexport function getFeatureClaim(grid: HTMLElement, name: FeatureName): FeatureConfigGetter | undefined {\n return featureClaims.get(grid)?.get(name);\n}\n\n/**\n * Drop a feature claim. Called by a feature directive's `ngOnDestroy` so\n * that, if the directive is removed (e.g. via `*ngIf`) but the host\n * `<tbw-grid>` survives, {@link Grid}'s deprecated input takes back over.\n * @internal\n * @since 1.4.0\n */\nexport function unregisterFeatureClaim(grid: HTMLElement, name: FeatureName): void {\n featureClaims.get(grid)?.delete(name);\n}\n\n/**\n * Mark an event as owned by a feature directive. {@link Grid}'s\n * `setupEventListeners` skips wiring its own deprecated `output()` for any\n * claimed event — the directive owns the listener and the emit.\n * @internal\n * @since 1.4.0\n */\nexport function claimEvent(grid: HTMLElement, eventName: ClaimableEventName): void {\n let set = eventClaims.get(grid);\n if (!set) {\n set = new Set();\n eventClaims.set(grid, set);\n }\n set.add(eventName);\n}\n\n/**\n * Returns true if a directive has claimed this event on this grid element.\n * @internal\n * @since 1.4.0\n */\nexport function isEventClaimed(grid: HTMLElement, eventName: ClaimableEventName): boolean {\n return eventClaims.get(grid)?.has(eventName) ?? false;\n}\n\n/**\n * Drop an event claim. Pair with {@link claimEvent} in a directive's\n * `ngOnDestroy`.\n * @internal\n * @since 1.4.0\n */\nexport function unclaimEvent(grid: HTMLElement, eventName: ClaimableEventName): void {\n eventClaims.get(grid)?.delete(eventName);\n}\n","export interface RowUpdate {\n id: string;\n changes: Record<string, unknown>;\n}\n\n/**\n * Computes the minimal set of row updates needed when only values have changed\n * (same row count, same row IDs in the same order).\n *\n * Returns an array of updates (possibly empty) when the diff is value-only, or\n * `null` when a structural change is detected (different count, different IDs\n * in sequence, or initial load from an empty snapshot).\n *\n * Called by the Angular `Grid` directive's rows effect to decide whether to\n * call `grid.updateRows()` (value-only, fast path) or `grid.rows =` (full\n * replace). Kept as a pure helper so it can be unit-tested without Angular.\n */\nexport function computeRowDiff<T>(next: T[], prev: T[], getId: (row: T) => string): RowUpdate[] | null {\n if (prev.length === 0 || next.length !== prev.length) return null;\n\n const updates: RowUpdate[] = [];\n for (let i = 0; i < next.length; i++) {\n const nextRow = next[i];\n const prevRow = prev[i];\n const nextId = getId(nextRow);\n const prevId = getId(prevRow);\n if (nextId !== prevId) return null;\n if (prevRow !== nextRow) {\n updates.push({ id: nextId, changes: nextRow as Record<string, unknown> });\n }\n }\n return updates;\n}\n","import {\n AfterContentInit,\n ApplicationRef,\n Directive,\n effect,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n OnDestroy,\n OnInit,\n output,\n untracked,\n ViewContainerRef,\n} from '@angular/core';\nimport type {\n ColumnConfig as BaseColumnConfig,\n CellActivateDetail,\n CellChangeDetail,\n CellClickDetail,\n ColumnConfigMap,\n ColumnInferenceMode,\n ColumnResizeDetail,\n FitMode,\n GridColumnState,\n DataGridElement as GridElement,\n RowClickDetail,\n SortChangeDetail,\n TbwScrollDetail,\n} from '@toolbox-web/grid';\nimport { DataGridElement as GridElementClass } from '@toolbox-web/grid';\n// Import editing event types from the editing plugin\n// Import plugin config types only. Specific plugin classes are intentionally\n// not imported here — feature-specific bridging lives in the feature secondary\n// entries (see `internal/feature-extensions.ts`).\nimport type { ColumnResizeResetDetail, DataChangeDetail, DataGridEventMap, RenderDetail } from '@toolbox-web/grid/all';\nimport type { ColumnConfig, GridConfig } from '../angular-column-config';\nimport { GridAdapter } from '../angular-grid-adapter';\nimport { applyColumnDefaults, type ColumnShorthand, normalizeColumns } from '../column-shorthand';\nimport { createPluginFromFeature, type FeatureName } from '../feature-registry';\nimport { GridIconRegistry } from '../grid-icon-registry';\nimport { getFeatureClaim, isEventClaimed } from '../internal/feature-claims';\nimport { getFeatureConfigPreprocessor, runTemplateBridges } from '../internal/feature-extensions';\nimport { computeRowDiff } from './row-diff';\n\n/**\n * Event detail for cell commit events.\n * @since 0.1.1\n */\nexport interface CellCommitEvent<TRow = unknown, TValue = unknown> {\n /** The row data object */\n row: TRow;\n /** The field name of the edited column */\n field: string;\n /** The new value after edit */\n value: TValue;\n /** The row index in the data array */\n rowIndex: number;\n /** Array of all rows that have been modified */\n changedRows: TRow[];\n /** Set of row indices that have been modified */\n changedRowIndices: Set<number>;\n /** Whether this is the first modification to this row */\n firstTimeForRow: boolean;\n}\n\n/**\n * Event detail for row commit events (bulk editing).\n * @since 0.1.1\n */\nexport interface RowCommitEvent<TRow = unknown> {\n /** The row data object */\n row: TRow;\n /** The row index in the data array */\n rowIndex: number;\n /** Array of all rows that have been modified */\n changedRows: TRow[];\n /** Set of row indices that have been modified */\n changedRowIndices: Set<number>;\n /** Whether this is the first modification to this row */\n firstTimeForRow: boolean;\n}\n\n/**\n * Directive that automatically registers the Angular adapter with tbw-grid elements.\n *\n * This directive eliminates the need to manually register the adapter in your component\n * constructor. Simply import this directive and it will handle adapter registration.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { Grid } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-root',\n * imports: [Grid],\n * template: `\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\" [customStyles]=\"myStyles\">\n * <!-- column templates -->\n * </tbw-grid>\n * `\n * })\n * export class AppComponent {\n * rows = [...];\n * config = {...};\n * myStyles = `.my-class { color: red; }`;\n * }\n * ```\n *\n * The directive automatically:\n * - Creates a GridAdapter instance\n * - Registers it with the GridElement\n * - Injects custom styles into the grid\n * - Handles cleanup on destruction\n *\n * ## Multi-version coexistence\n *\n * In single-version apps the directive matches the bare `<tbw-grid>` tag. When\n * two different grid versions share a page, the second-loaded bundle registers\n * under a version-suffixed tag (e.g. `<tbw-grid-v2-15-0>`). Because Angular\n * matches selectors at compile time, a runtime-only tag cannot be matched by\n * tag name. The directive therefore also matches the stable `[data-tbw-grid]`\n * attribute, so a suffixed grid can opt in by adding it literally:\n *\n * ```html\n * <tbw-grid-v2-15-0 data-tbw-grid [rows]=\"rows\" [gridConfig]=\"config\"></tbw-grid-v2-15-0>\n * ```\n *\n * Read the concrete tag from `DataGridElement.activeTag` of the bundle you\n * imported. See the multi-version coexistence guide.\n *\n * @category Directive\n * @since 0.1.0\n */\n@Directive({ selector: 'tbw-grid,[data-tbw-grid]' })\nexport class Grid implements OnInit, AfterContentInit, OnDestroy {\n private elementRef = inject(ElementRef<GridElement>);\n private injector = inject(EnvironmentInjector);\n private appRef = inject(ApplicationRef);\n private viewContainerRef = inject(ViewContainerRef);\n private iconRegistry = inject(GridIconRegistry, { optional: true });\n\n private adapter: GridAdapter | null = null;\n\n /**\n * Previous rows snapshot for in-place diffing — kept in sync by the rows\n * effect. Plain field so Angular's signal tracking ignores it.\n */\n private prevRows: unknown[] = [];\n\n constructor() {\n // Effect to process gridConfig and apply to grid\n // This merges feature input plugins with the user's config plugins\n effect(() => {\n const userGridConfig = this.gridConfig();\n\n const angularCfg = userGridConfig;\n if (!this.adapter) return;\n\n // Create plugins from feature inputs\n const featurePlugins = this.createFeaturePlugins();\n\n // Build core config overrides from individual inputs\n const sortableValue = this.sortable();\n const filterableValue = this.filterable();\n const selectableValue = this.selectable();\n const coreConfigOverrides: Record<string, unknown> = {};\n if (sortableValue !== undefined) {\n coreConfigOverrides['sortable'] = sortableValue;\n }\n if (filterableValue !== undefined) {\n coreConfigOverrides['filterable'] = filterableValue;\n }\n if (selectableValue !== undefined) {\n coreConfigOverrides['selectable'] = selectableValue;\n }\n\n const grid = this.elementRef.nativeElement;\n\n // Merge icon overrides from registry with any existing icons\n // Registry icons are base, config.icons override them\n const registryIcons = this.iconRegistry?.getAll();\n if (registryIcons && Object.keys(registryIcons).length > 0) {\n const existingIcons = angularCfg?.icons || {};\n coreConfigOverrides['icons'] = { ...registryIcons, ...existingIcons };\n }\n\n // Nothing to do if there's no config input and no feature inputs\n const hasFeaturePlugins = featurePlugins.length > 0;\n const hasConfigOverrides = Object.keys(coreConfigOverrides).length > 0;\n\n if (!angularCfg && !hasFeaturePlugins && !hasConfigOverrides) {\n return;\n }\n\n const userConfig = angularCfg || {};\n\n // Merge feature-input plugins with the user's own plugins\n const configPlugins = userConfig.plugins || [];\n const mergedPlugins = [...featurePlugins, ...configPlugins];\n\n // The interceptor on element.gridConfig (installed in ngOnInit)\n // handles converting component classes → functions via processGridConfig,\n // so we can pass the raw Angular config through. The interceptor is\n // idempotent, making this safe even if the config is already processed.\n grid.gridConfig = {\n ...userConfig,\n ...coreConfigOverrides,\n plugins: mergedPlugins.length > 0 ? mergedPlugins : userConfig.plugins,\n };\n });\n\n // Effect to sync loading state to the grid element\n effect(() => {\n const loadingValue = this.loading();\n if (loadingValue === undefined) return;\n\n const grid = this.elementRef.nativeElement;\n grid.loading = loadingValue;\n });\n\n // Effect to sync rows to the grid element\n //\n // Smart diff: when getRowId is configured and the same rows appear in the\n // same order with only their values changed, route through updateRows() to\n // patch in-place. This triggers only RenderPhase.VIRTUALIZATION instead of\n // the heavier ROWS phase, which rebuilds the row model and re-applies\n // sort/filter. Mirrors the React and Vue adapters.\n effect(() => {\n const rowsValue = this.rows();\n if (rowsValue === undefined) return;\n\n const grid = this.elementRef.nativeElement;\n const prev = this.prevRows;\n // Read getRowId without registering as a signal dependency so this effect\n // only re-runs on rows changes, not on every gridConfig change.\n const getId = untracked(() => this.gridConfig()?.getRowId) as ((row: unknown) => string) | undefined;\n this.prevRows = rowsValue;\n\n if (getId) {\n const diff = computeRowDiff(rowsValue, prev, getId);\n if (diff !== null) {\n if (diff.length > 0) {\n // 'sync' source: authoritative host data, not a user edit — editing\n // plugin skips dirty marking / undo history for it.\n try {\n grid.updateRows(diff, 'sync');\n } catch {\n // getRowId changed alongside rows (grid still resolving ids with\n // the previous resolver) or an id vanished — fall back to a full\n // replace, which reapplies the whole array under the current resolver.\n grid.rows = rowsValue;\n }\n }\n return;\n }\n }\n\n // Structural change (adds/removes/reorder), no getRowId, or initial load — full replace.\n grid.rows = rowsValue;\n });\n\n // Effect to sync columns to the grid element\n effect(() => {\n const columnsValue = this.columns();\n if (columnsValue === undefined) return;\n\n const grid = this.elementRef.nativeElement;\n // First normalize any shorthand strings to ColumnConfig objects, then\n // merge in any per-grid column defaults. Individual column props always win.\n // Note: Angular ColumnConfig allows component classes for renderer/editor,\n // which the adapter normalizes via processColumn below; we widen to `any`\n // here so the shorthand helpers (typed against the core ColumnConfig) accept\n // the Angular-flavoured payload unchanged.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const normalized = applyColumnDefaults<any>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n normalizeColumns<any>(columnsValue as ColumnShorthand<any>[]),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.columnDefaults() as any,\n );\n // Process columns through the adapter to convert Angular component classes\n // (renderer/editor) to functions — the grid's columns setter does NOT call\n // processConfig, unlike gridConfig. Without this, raw component classes\n // would be invoked without `new`, causing runtime errors.\n const processed = this.adapter\n ? (normalized as ColumnConfig[]).map((col) => this.adapter!.processColumn(col))\n : normalized;\n grid.columns = processed as BaseColumnConfig[] | ColumnConfigMap;\n });\n\n // Effect to sync fitMode to the grid element\n effect(() => {\n const fitModeValue = this.fitMode();\n if (fitModeValue === undefined) return;\n\n const grid = this.elementRef.nativeElement;\n grid.fitMode = fitModeValue;\n });\n\n // Effect to sync columnInference to the grid element\n effect(() => {\n const columnInferenceValue = this.columnInference();\n const grid = this.elementRef.nativeElement;\n grid.columnInference = columnInferenceValue;\n });\n }\n\n /**\n * Custom CSS styles to inject into the grid.\n * Use this to style custom cell renderers, editors, or detail panels.\n *\n * @example\n * ```typescript\n * // In your component\n * customStyles = `\n * .my-detail-panel { padding: 16px; }\n * .my-status-badge { border-radius: 4px; }\n * `;\n * ```\n *\n * ```html\n * <tbw-grid [customStyles]=\"customStyles\">...</tbw-grid>\n * ```\n */\n customStyles = input<string>();\n\n /**\n * Grid-wide sorting toggle.\n * When false, disables sorting for all columns regardless of their individual `sortable` setting.\n * When true (default), columns with `sortable: true` can be sorted.\n *\n * This is a core grid config property, not a plugin feature.\n * For multi-column sorting, also add the `[multiSort]` feature.\n *\n * @default true\n *\n * @example\n * ```html\n * <!-- Disable all sorting -->\n * <tbw-grid [sortable]=\"false\" />\n *\n * <!-- Enable sorting (default) - columns still need sortable: true -->\n * <tbw-grid [sortable]=\"true\" />\n *\n * <!-- Enable multi-column sorting -->\n * <tbw-grid [sortable]=\"true\" [multiSort]=\"true\" />\n * ```\n */\n sortable = input<boolean>();\n\n /**\n * Grid-wide filtering toggle.\n * When false, disables filtering for all columns regardless of their individual `filterable` setting.\n * When true (default), columns with `filterable: true` can be filtered.\n *\n * Requires the FilteringPlugin to be loaded.\n *\n * @default true\n *\n * @example\n * ```html\n * <!-- Disable all filtering -->\n * <tbw-grid [filterable]=\"false\" [filtering]=\"true\" />\n *\n * <!-- Enable filtering (default) -->\n * <tbw-grid [filterable]=\"true\" [filtering]=\"true\" />\n * ```\n */\n filterable = input<boolean>();\n\n /**\n * Grid-wide selection toggle.\n * When false, disables selection for all rows/cells.\n * When true (default), selection is enabled based on plugin mode.\n *\n * Requires the SelectionPlugin to be loaded.\n *\n * @default true\n *\n * @example\n * ```html\n * <!-- Disable all selection -->\n * <tbw-grid [selectable]=\"false\" [selection]=\"'range'\" />\n *\n * <!-- Enable selection (default) -->\n * <tbw-grid [selectable]=\"true\" [selection]=\"'range'\" />\n * ```\n */\n selectable = input<boolean>();\n\n /**\n * Show a loading overlay on the grid.\n * Use this during initial data fetch or refresh operations.\n *\n * For row/cell loading states, access the grid element directly:\n * - `grid.setRowLoading(rowId, true/false)`\n * - `grid.setCellLoading(rowId, field, true/false)`\n *\n * @default false\n *\n * @example\n * ```html\n * <!-- Show loading during data fetch -->\n * <tbw-grid [loading]=\"isLoading\" [rows]=\"rows\" />\n * ```\n *\n * ```typescript\n * isLoading = true;\n *\n * ngOnInit() {\n * this.dataService.fetchData().subscribe(data => {\n * this.rows = data;\n * this.isLoading = false;\n * });\n * }\n * ```\n */\n loading = input<boolean>();\n\n /**\n * The data rows to display in the grid.\n *\n * Accepts an array of data objects. Each object represents one row.\n * The grid reads property values for each column's `field` from these objects.\n *\n * @example\n * ```html\n * <tbw-grid [rows]=\"employees()\" [gridConfig]=\"config\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rows = input<any[]>();\n\n /**\n * Column configuration array.\n *\n * Accepts either full `ColumnConfig` objects or shorthand strings such as\n * `'name'` or `'salary:number'`. Shorthands auto-generate human-readable\n * headers from the field name.\n *\n * Shorthand for setting columns without wrapping them in a full `gridConfig`.\n * If both `columns` and `gridConfig.columns` are set, `columns` takes precedence\n * (see configuration precedence system).\n *\n * @example\n * ```html\n * <tbw-grid [rows]=\"data\" [columns]=\"['id:number', 'name', { field: 'status', editable: true }]\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n columns = input<ColumnShorthand<any>[]>();\n\n /**\n * Default column properties applied to every column in `columns`.\n * Individual column properties override these defaults.\n *\n * @example\n * ```html\n * <tbw-grid\n * [columnDefaults]=\"{ sortable: true, resizable: true }\"\n * [columns]=\"[{ field: 'id', sortable: false }, { field: 'name' }]\"\n * />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n columnDefaults = input<Partial<ColumnConfig<any>>>();\n\n /**\n * Column sizing strategy.\n *\n * - `'stretch'` (default) — columns stretch to fill available width\n * - `'fixed'` — columns use their declared widths; enables horizontal scrolling\n * - `'auto-fit'` — columns auto-size to content, then stretch to fill\n *\n * @default 'stretch'\n *\n * @example\n * ```html\n * <tbw-grid [rows]=\"data\" fitMode=\"fixed\" />\n * <tbw-grid [rows]=\"data\" [fitMode]=\"dynamicMode()\" />\n * ```\n */\n fitMode = input<FitMode>();\n\n /**\n * How automatic column inference combines with explicitly provided columns.\n *\n * - `'auto'` (default): infer only when no columns are provided.\n * - `'merge'`: always infer from data, then overlay provided columns by `field`.\n *\n * @example\n * ```html\n * <tbw-grid [rows]=\"data\" columnInference=\"merge\" />\n * <tbw-grid [rows]=\"data\" [columnInference]=\"mode()\" />\n * ```\n */\n columnInference = input<ColumnInferenceMode>();\n\n /**\n * Grid configuration object with optional Angular-specific extensions.\n *\n * Accepts Angular-augmented `GridConfig` from `@toolbox-web/grid-angular`.\n * You can specify Angular component classes directly for renderers and editors.\n *\n * Component classes must implement the appropriate interfaces:\n * - Renderers: `CellRenderer<TRow, TValue>` - requires `value()` and `row()` signal inputs\n * - Editors: `CellEditor<TRow, TValue>` - adds `commit` and `cancel` outputs\n *\n * @example\n * ```typescript\n * // Simple config with plain renderers\n * config: GridConfig = {\n * columns: [\n * { field: 'name', header: 'Name' },\n * { field: 'active', type: 'boolean' }\n * ],\n * typeDefaults: {\n * boolean: { renderer: (ctx) => ctx.value ? '✓' : '✗' }\n * }\n * };\n *\n * // Config with component classes\n * config: GridConfig<Employee> = {\n * columns: [\n * { field: 'name', header: 'Name' },\n * { field: 'bonus', header: 'Bonus', editable: true, editor: BonusEditorComponent }\n * ]\n * };\n * ```\n *\n * ```html\n * <tbw-grid [gridConfig]=\"config\" [rows]=\"employees\"></tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n gridConfig = input<GridConfig<any>>();\n\n // ═══════════════════════════════════════════════════════════════════════════\n // EVENT OUTPUTS - All grid events\n // ═══════════════════════════════════════════════════════════════════════════\n\n /**\n * Emitted when a cell is clicked.\n *\n * @example\n * ```html\n * <tbw-grid (cellClick)=\"onCellClick($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cellClick = output<CellClickDetail<any>>();\n\n /**\n * Emitted when a row is clicked.\n *\n * @example\n * ```html\n * <tbw-grid (rowClick)=\"onRowClick($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rowClick = output<RowClickDetail<any>>();\n\n /**\n * Emitted when a cell is activated (Enter key or double-click).\n *\n * @example\n * ```html\n * <tbw-grid (cellActivate)=\"onCellActivate($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cellActivate = output<CellActivateDetail<any>>();\n\n /**\n * Emitted when a cell value changes (before commit).\n *\n * @example\n * ```html\n * <tbw-grid (cellChange)=\"onCellChange($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cellChange = output<CellChangeDetail<any>>();\n\n /**\n * Emitted when row data is replaced (e.g. via the `rows` setter).\n *\n * @example\n * ```html\n * <tbw-grid (dataChange)=\"onDataChange($event)\">...</tbw-grid>\n * ```\n */\n dataChange = output<DataChangeDetail>();\n\n /**\n * Emitted when sort state changes.\n *\n * @example\n * ```html\n * <tbw-grid (sortChange)=\"onSortChange($event)\">...</tbw-grid>\n * ```\n */\n sortChange = output<SortChangeDetail>();\n\n /**\n * Emitted when a column is resized.\n *\n * @example\n * ```html\n * <tbw-grid (columnResize)=\"onColumnResize($event)\">...</tbw-grid>\n * ```\n */\n columnResize = output<ColumnResizeDetail>();\n\n /**\n * Emitted when a column's width is reset (double-click on the resize handle).\n *\n * @example\n * ```html\n * <tbw-grid (columnResizeReset)=\"onColumnResizeReset($event)\">...</tbw-grid>\n * ```\n */\n columnResizeReset = output<ColumnResizeResetDetail>();\n\n /**\n * Emitted when column state changes (resize, reorder, visibility).\n *\n * @example\n * ```html\n * <tbw-grid (columnStateChange)=\"onColumnStateChange($event)\">...</tbw-grid>\n * ```\n */\n columnStateChange = output<GridColumnState>();\n\n /**\n * Emitted (rAF-batched) when the grid's viewport is scrolled vertically.\n *\n * For server-side pagination of large datasets prefer `ServerSidePlugin`\n * — this event is the lower-level primitive for custom load-more triggers,\n * deferring heavy cell content, dismissing overlays, etc.\n *\n * Named `tbwScroll` (not `scroll`) to avoid collision with the native DOM\n * scroll event that bubbles from focusable internals.\n *\n * @example\n * ```html\n * <tbw-grid (tbwScroll)=\"onScroll($event)\">...</tbw-grid>\n * ```\n */\n tbwScroll = output<TbwScrollDetail>();\n\n /**\n * Emitted once at the end of every render-scheduler flush, after all\n * plugin `afterRender` hooks have run and `ready()` has resolved.\n *\n * Use this to act on the rendered DOM after a programmatic mutation\n * (e.g. focus the first input of a freshly added row in full-grid edit\n * mode) without `setTimeout` or double-`requestAnimationFrame` hacks.\n * The `render` event fires on every flush — including scroll-driven\n * virtual-window updates — so prefer subscribing once and unsubscribing\n * (or gating on `detail.phase >= RenderPhase.ROWS`) when you only care\n * about a specific mutation.\n *\n * @example\n * ```html\n * <tbw-grid (render)=\"onRender($event)\">...</tbw-grid>\n * ```\n */\n render = output<RenderDetail>();\n\n // Map of output names to event names for automatic wiring.\n //\n // The `satisfies` clause enforces compile-time sync against\n // `DataGridEventMap`: every value must be a real event name (typos and\n // stale entries pointing at non-existent events fail to compile).\n // Plugin event augmentations of `DataGridEventMap` flow through\n // automatically via the `/all` import.\n private readonly eventOutputMap = {\n cellClick: 'cell-click',\n rowClick: 'row-click',\n cellActivate: 'cell-activate',\n cellChange: 'cell-change',\n dataChange: 'data-change',\n sortChange: 'sort-change',\n columnResize: 'column-resize',\n columnResizeReset: 'column-resize-reset',\n columnStateChange: 'column-state-change',\n tbwScroll: 'tbw-scroll',\n render: 'render',\n } as const satisfies Readonly<Record<string, keyof DataGridEventMap<unknown>>>;\n\n // ─────────────────────────────────────────────────────────────────────────\n // Forward-only event coverage guard.\n //\n // Mirrors the React adapter's `_AssertFeaturePropsCoverCore` pattern. If a\n // new event is added to core's `DataGridEventMap` (via plugin module\n // augmentation in `/all`) but no `eventOutputMap` entry covers it, this\n // type fails to evaluate to `true` and the build breaks. Adapter consumers\n // never see a silently-dropped event.\n //\n // Reverse direction (extra `eventOutputMap` entries pointing at non-existent\n // events) is already enforced by the `satisfies` clause above.\n //\n // To consciously omit an event from the `Grid` directive surface, add it to\n // the `_intentionallyOmittedEvents` union below with a comment explaining why.\n // ─────────────────────────────────────────────────────────────────────────\n /**\n * Events deliberately not exposed as outputs on the `Grid` directive.\n *\n * Every entry here is a **feature-owned** event surfaced by its per-feature\n * directive instead (e.g. `GridEditingDirective` declares `(cellCommit)`,\n * `GridSelectionDirective` declares `(selectionChange)`). The directive\n * claims the DOM event via `claimEvent` so it is the sole emitter. The v1.x\n * shims that forwarded these events from `Grid` were removed in v3.0.0 —\n * consumers must import the relevant feature directive.\n */\n declare private _intentionallyOmittedEvents:\n | 'cell-commit'\n | 'cell-cancel'\n | 'row-commit'\n | 'changed-rows-reset'\n | 'edit-open'\n | 'before-edit-close'\n | 'edit-close'\n | 'dirty-change'\n | 'filter-change'\n | 'column-move'\n | 'column-visibility'\n | 'selection-change'\n | 'row-move'\n | 'row-drag-start'\n | 'row-drag-end'\n | 'row-drop'\n | 'row-transfer'\n | 'group-toggle'\n | 'group-expand'\n | 'group-collapse'\n | 'tree-expand'\n | 'tree-load-start'\n | 'tree-load-end'\n | 'tree-load-error'\n | 'detail-expand'\n | 'responsive-change'\n | 'context-menu-open'\n | 'copy'\n | 'paste'\n | 'paste-rejected'\n | 'undo'\n | 'redo'\n | 'export-complete'\n | 'print-start'\n | 'print-complete'\n // Feature-owned, surfaced by `GridEditingDirective` as `(baselinesCaptured)`.\n | 'baselines-captured'\n // Internal plumbing — never consumer-facing. `mount-external-*` is how core\n // asks the adapter to mount a framework component; the adapter itself is the\n // sole listener. `column-reorder-request` is an inter-plugin request that\n // VisibilityPlugin emits for ReorderPlugin to service.\n | 'mount-external-editor'\n | 'mount-external-view'\n | 'column-reorder-request';\n /**\n * Compile-time assertion — assigning `true` only type-checks while the\n * conditional below resolves to `true`. Do not turn this back into a\n * `declare`d property: a bare declaration is never checked, which silently\n * disabled this guard for several releases.\n */\n private readonly _assertEventOutputMapCoversCore: [\n Exclude<\n keyof DataGridEventMap<unknown>,\n | (typeof Grid.prototype.eventOutputMap)[keyof typeof Grid.prototype.eventOutputMap]\n | Grid['_intentionallyOmittedEvents']\n >,\n ] extends [never]\n ? true\n : [\n 'Missing Angular outputs for core grid events:',\n Exclude<\n keyof DataGridEventMap<unknown>,\n | (typeof Grid.prototype.eventOutputMap)[keyof typeof Grid.prototype.eventOutputMap]\n | Grid['_intentionallyOmittedEvents']\n >,\n ] = true;\n\n // Store event listeners for cleanup\n private eventListeners: Map<string, (e: Event) => void> = new Map();\n\n ngOnInit(): void {\n // Create and register the adapter\n this.adapter = new GridAdapter(this.injector, this.appRef, this.viewContainerRef);\n GridElementClass.registerAdapter(this.adapter);\n\n const grid = this.elementRef.nativeElement;\n\n // Register adapter on the grid element so processConfig is called\n // automatically by the grid's set gridConfig setter, and so\n // MasterDetailPlugin can use it via the __frameworkAdapter hook during attach()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (grid as any).__frameworkAdapter = this.adapter;\n\n // Wire up all event listeners based on eventOutputMap\n this.setupEventListeners(grid);\n }\n\n /**\n * Sets up event listeners for the core outputs in `eventOutputMap`.\n *\n * Feature-owned events (e.g. `cell-commit`, `selection-change`) are not in\n * `eventOutputMap` — they are surfaced by their per-feature directive, which\n * claims the DOM event via `claimEvent`. Events still claimed here are\n * skipped so the claiming directive's `output()` is the sole emitter.\n */\n private setupEventListeners(grid: GridElement): void {\n // Wire up all event listeners\n for (const [outputName, eventName] of Object.entries(this.eventOutputMap)) {\n if (isEventClaimed(grid, eventName)) continue;\n const listener = (e: Event) => {\n const detail = (e as CustomEvent).detail;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any)[outputName].emit(detail);\n };\n grid.addEventListener(eventName, listener);\n this.eventListeners.set(eventName, listener);\n }\n }\n\n /**\n * Creates plugins from the per-feature directive claims.\n * Uses the feature registry to allow tree-shaking - only imported features are bundled.\n * Per-feature config bridging (e.g. converting Angular component classes inside\n * `groupingColumns` / `groupingRows` / `pinnedRows` configs to renderer functions)\n * runs via `getFeatureConfigPreprocessor`, populated by feature secondary entries.\n *\n * v3 ownership: feature configuration is owned entirely by the per-feature\n * attribute-selector directives (e.g. `GridFilteringDirective`). When such a\n * directive is present on the same `<tbw-grid>` element it claims its feature\n * in `feature-claims.ts`; we read the claim's config getter — which\n * transitively reads the directive's input signal, establishing reactive\n * dependency tracking. The deprecated per-feature inputs that previously\n * lived on this directive were removed in v3.0.0.\n *\n * Returns the array of created plugins (doesn't modify grid).\n */\n private createFeaturePlugins(): unknown[] {\n const plugins: unknown[] = [];\n const adapter = this.adapter;\n const grid = this.elementRef.nativeElement;\n\n // Helper to add a plugin when its per-feature directive claims the feature.\n const addPlugin = (name: FeatureName) => {\n // Reading the claim's getter registers the directive's input signal as a\n // dependency, so changes to e.g. `[filtering]` on the directive\n // re-trigger this effect.\n const claim = getFeatureClaim(grid, name);\n const config = claim ? claim() : undefined;\n if (config === undefined || config === null || config === false) return;\n // Apply per-feature config preprocessor (registered by feature secondary entries)\n // to bridge Angular component classes embedded in the config before instantiation.\n let finalConfig: unknown = config;\n if (adapter && config !== true && typeof config === 'object') {\n const preprocess = getFeatureConfigPreprocessor(name);\n if (preprocess) finalConfig = preprocess(config, adapter);\n }\n const plugin = createPluginFromFeature(name, finalConfig);\n if (plugin) plugins.push(plugin);\n };\n\n addPlugin('selection');\n addPlugin('editing');\n addPlugin('clipboard');\n addPlugin('contextMenu');\n addPlugin('multiSort');\n addPlugin('filtering');\n addPlugin('reorderColumns');\n addPlugin('visibility');\n addPlugin('pinnedColumns');\n addPlugin('groupingColumns');\n addPlugin('columnVirtualization');\n addPlugin('rowDragDrop');\n addPlugin('groupingRows');\n addPlugin('pinnedRows');\n addPlugin('tree');\n addPlugin('masterDetail');\n addPlugin('responsive');\n addPlugin('undoRedo');\n addPlugin('export');\n addPlugin('print');\n addPlugin('pivot');\n addPlugin('serverSide');\n addPlugin('stickyRows');\n addPlugin('tooltip');\n\n return plugins;\n }\n\n ngAfterContentInit(): void {\n // After Angular child directives have initialized (GridColumnView, GridColumnEditor, GridDetailView, GridToolPanel),\n // force the grid to re-parse light DOM columns so adapters can create renderers/editors\n const grid = this.elementRef.nativeElement;\n if (grid && typeof (grid as any).refreshColumns === 'function') {\n // Use setTimeout to ensure Angular effects have run (template registration)\n setTimeout(() => {\n (grid as any).refreshColumns();\n\n // Run feature-registered template bridges. Each bridge wires a specific\n // light-DOM slot element (<tbw-grid-detail>, <tbw-grid-responsive-card>, ...)\n // to its plugin. Bridges are registered by feature secondary entries\n // (e.g. `import '@toolbox-web/grid-angular/features/master-detail';`).\n if (this.adapter) {\n runTemplateBridges({ grid, adapter: this.adapter });\n }\n\n // Refresh shell header to pick up tool panel templates\n // This allows Angular templates to be used in tool panels\n if (typeof (grid as any).refreshShellHeader === 'function') {\n (grid as any).refreshShellHeader();\n }\n\n // Register custom styles if provided\n this.registerCustomStyles(grid);\n }, 0);\n }\n }\n\n /**\n * Registers custom styles into the grid.\n * Uses the grid's registerStyles() API for clean encapsulation.\n */\n private registerCustomStyles(grid: GridElement): void {\n const styles = this.customStyles();\n if (!styles) return;\n\n // Wait for grid to be ready before registering styles\n grid.ready?.().then(() => {\n grid.registerStyles?.('angular-custom-styles', styles);\n });\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n\n // Cleanup all event listeners\n if (grid) {\n for (const [eventName, listener] of this.eventListeners) {\n grid.removeEventListener(eventName, listener);\n }\n this.eventListeners.clear();\n }\n\n // Cleanup custom styles\n if (grid && this.customStyles()) {\n grid.unregisterStyles?.('angular-custom-styles');\n }\n\n // Cleanup adapter if needed\n if (this.adapter) {\n this.adapter.destroy?.();\n this.adapter = null;\n }\n }\n}\n","/**\n * Combined provider helper for grid type defaults and icons.\n *\n * Convenience function that combines `provideGridTypeDefaults` and\n * `provideGridIcons` into a single call for application bootstrap.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * import { ApplicationConfig } from '@angular/core';\n * import { provideGrid } from '@toolbox-web/grid-angular';\n *\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideGrid({\n * typeDefaults: {\n * country: { renderer: CountryCellComponent },\n * },\n * icons: {\n * sortAsc: '↑',\n * sortDesc: '↓',\n * },\n * }),\n * ],\n * };\n * ```\n */\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport type { GridIcons } from '@toolbox-web/grid';\nimport { provideGridIcons } from './grid-icon-registry';\nimport { provideGridTypeDefaults, type TypeDefaultRegistration } from './grid-type-registry';\n\n/**\n * Options for {@link provideGrid}.\n * @since 1.4.0\n */\nexport interface ProvideGridOptions {\n /** Type defaults to register globally. Equivalent to `provideGridTypeDefaults`. */\n typeDefaults?: Record<string, TypeDefaultRegistration>;\n /** Icon overrides to register globally. Equivalent to `provideGridIcons`. */\n icons?: Partial<GridIcons>;\n}\n\n/**\n * Combined provider for grid type defaults and icons.\n *\n * Returns environment providers that can be added to your `ApplicationConfig`\n * `providers` array. Either field is optional — only the registries you\n * supply are wired up.\n *\n * Equivalent to calling `provideGridTypeDefaults(options.typeDefaults)` and\n * `provideGridIcons(options.icons)` separately.\n * @since 1.4.0\n */\nexport function provideGrid(options: ProvideGridOptions = {}): EnvironmentProviders {\n const providers: EnvironmentProviders[] = [];\n if (options.typeDefaults) {\n providers.push(provideGridTypeDefaults(options.typeDefaults));\n }\n if (options.icons) {\n providers.push(provideGridIcons(options.icons));\n }\n return makeEnvironmentProviders(providers);\n}\n","/**\n * @packageDocumentation\n * @toolbox-web/grid-angular - Angular adapter for @toolbox-web/grid.\n *\n * Provides directives for seamless Angular integration with the grid component.\n */\n\n// Primary export\nexport {\n GridAdapter,\n makeFlushFocusedInput,\n registerDetailRendererBridge,\n registerEditorMountHook,\n registerEditorSpecBridge,\n registerFilterPanelTypeDefaultBridge,\n registerResponsiveCardRendererBridge,\n registerToolPanelRendererBridge,\n} from './lib/angular-grid-adapter';\nexport type {\n EditorMountHook,\n EditorSpecBridge,\n FilterPanelTypeDefaultBridge,\n RowRendererBridge,\n ToolPanelRendererBridge,\n} from './lib/angular-grid-adapter';\n\n// Configuration types\nexport { isComponentClass } from './lib/angular-column-config';\nexport type {\n CellEditor,\n CellRenderer,\n ColumnConfig,\n FilterPanel,\n GridConfig,\n TypeDefault,\n} from './lib/angular-column-config';\n\n// Field-key types for nested dotted-path columns (issue #438)\nexport type { ColumnFieldKey, NestedPaths } from '@toolbox-web/grid';\n\n// Type registry for application-wide type defaults\nexport { GRID_TYPE_DEFAULTS, GridTypeRegistry, provideGridTypeDefaults } from './lib/grid-type-registry';\nexport type { TypeDefaultRegistration } from './lib/grid-type-registry';\n\n// Icon registry for application-wide icon overrides\nexport { GRID_ICONS, GridIconRegistry, provideGridIcons } from './lib/grid-icon-registry';\n\n// Inject function for programmatic grid access\nexport { injectGrid } from './lib/inject-grid';\nexport type { InjectGridReturn } from './lib/inject-grid';\n\n// Feature registry for tree-shakeable plugin registration\nexport {\n clearFeatureRegistry,\n createPluginFromFeature,\n getFeatureFactory,\n getRegisteredFeatures,\n isFeatureRegistered,\n registerFeature,\n} from './lib/feature-registry';\nexport type { FeatureName, PluginFactory } from './lib/feature-registry';\n\n// Core directives. Feature-owned directives (editors, filter panels,\n// master-detail, responsive cards, shell) live in their `features/<feature>`\n// secondary entries, not here.\nexport { GridColumnView } from './lib/directives/grid-column-view.directive';\nexport type { GridCellContext } from './lib/directives/grid-column-view.directive';\nexport { TbwGridColumn } from './lib/directives/grid-column.directive';\nexport { TbwGridHeader } from './lib/directives/grid-header.directive';\nexport { TbwGridToolButtons } from './lib/directives/grid-tool-buttons.directive';\nexport { TbwGridType } from './lib/directives/grid-type.directive';\nexport { Grid } from './lib/directives/grid.directive';\nexport type { CellCommitEvent, RowCommitEvent } from './lib/directives/grid.directive';\n\n// Structural directives for cleaner template syntax. `TbwRenderer` stays in the\n// main entry (editor-agnostic). `TbwEditor` lives in the `features/editing`\n// secondary entry.\nexport { TbwRenderer } from './lib/directives/structural-directives';\nexport type { StructuralCellContext } from './lib/directives/structural-directives';\n\n// Column shorthand utilities (parity with grid-react / grid-vue)\nexport {\n applyColumnDefaults,\n hasColumnShorthands,\n normalizeColumns,\n parseColumnShorthand,\n} from './lib/column-shorthand';\nexport type { ColumnShorthand } from './lib/column-shorthand';\n\n// Combined provider helper (parity with grid-vue's GridProvider component)\nexport { provideGrid } from './lib/grid-provider';\nexport type { ProvideGridOptions } from './lib/grid-provider';\n\n// Internal extension points used by feature secondary entries to plug into the\n// core Grid directive (template bridges + per-feature config preprocessors).\n// These are public for cross-entry-point use; not part of the supported API.\nexport {\n getFeatureConfigPreprocessor,\n registerFeatureConfigPreprocessor,\n registerTemplateBridge,\n runTemplateBridges,\n} from './lib/internal/feature-extensions';\nexport type {\n FeatureConfigPreprocessor,\n TemplateBridge,\n TemplateBridgeContext,\n} from './lib/internal/feature-extensions';\n\n// Per-grid claims registry used by feature-attribute directives to take\n// ownership of inputs/outputs that are otherwise handled by the central\n// `Grid` directive. Public for cross-entry-point use; not part of the\n// supported API. See `internal/feature-claims.ts` for the design rationale.\nexport {\n claimEvent,\n getFeatureClaim,\n isEventClaimed,\n registerFeatureClaim,\n unclaimEvent,\n unregisterFeatureClaim,\n} from './lib/internal/feature-claims';\nexport type { FeatureConfigGetter } from './lib/internal/feature-claims';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["GridElementClass"],"mappings":";;;;;;;AAmRA;AAEA;AACA;;;;;;;;;;AAUG;AACG,SAAU,gBAAgB,CAAC,KAAc,EAAA;IAC7C,IAAI,OAAO,KAAK,KAAK,UAAU,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE;AAChE,QAAA,OA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