@toolbox-web/grid-angular 0.9.0 → 0.10.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.
@@ -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-editor.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-column-view.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-detail-view.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-form-array.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-responsive-card.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-tool-panel.directive.ts","../../../../libs/grid-angular/src/lib/directives/structural-directives.ts","../../../../libs/grid-angular/src/lib/grid-type-registry.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/feature-registry.ts","../../../../libs/grid-angular/src/lib/base-grid-editor.ts","../../../../libs/grid-angular/src/lib/directives/grid.directive.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, GridConfig } from '@toolbox-web/grid';\n\n/**\n * Interface for Angular 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 { AngularCellRenderer } 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 AngularCellRenderer<Employee, string> {\n * value = input.required<string>();\n * row = input.required<Employee>();\n * column = input<unknown>();\n * }\n * ```\n */\nexport interface AngularCellRenderer<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/**\n * Interface for Angular 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 { AngularCellEditor } 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 AngularCellEditor<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 */\nexport interface AngularCellEditor<TRow = unknown, TValue = unknown> extends AngularCellRenderer<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/**\n * Angular-specific column configuration.\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 { AngularColumnConfig } from '@toolbox-web/grid-angular';\n * import { StatusBadgeComponent, StatusEditorComponent } from './components';\n *\n * const columns: AngularColumnConfig<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 */\nexport interface AngularColumnConfig<TRow = unknown> extends Omit<ColumnConfig<TRow>, 'renderer' | 'editor'> {\n /**\n * Cell renderer - can be:\n * - A function `(ctx) => HTMLElement | string`\n * - An Angular component class implementing AngularCellRenderer\n */\n renderer?: ColumnConfig<TRow>['renderer'] | Type<AngularCellRenderer<TRow, unknown>>;\n\n /**\n * Cell editor - can be:\n * - A function `(ctx) => HTMLElement`\n * - An Angular component class implementing AngularCellEditor\n */\n editor?: ColumnConfig<TRow>['editor'] | Type<AngularCellEditor<TRow, unknown>>;\n}\n\n/**\n * Angular-specific grid configuration.\n *\n * Extends the base GridConfig to use AngularColumnConfig.\n */\nexport interface AngularGridConfig<TRow = unknown> extends Omit<GridConfig<TRow>, 'columns'> {\n columns?: AngularColumnConfig<TRow>[];\n}\n\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 */\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","import { contentChild, Directive, effect, ElementRef, EventEmitter, inject, TemplateRef } from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\n\n/**\n * Context object passed to the cell editor template.\n * Contains the cell value, row data, column configuration, and commit/cancel functions.\n */\nexport interface GridEditorContext<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 * Callback function to commit the edited value.\n * Use with Angular event binding: `(commit)=\"onCommit($event)\"`\n */\n onCommit: (value: TValue) => void;\n /**\n * Callback function to cancel editing.\n * Use with Angular event binding: `(cancel)=\"onCancel()\"`\n */\n onCancel: () => void;\n /**\n * The FormControl for this cell, if the grid is bound to a FormArray with FormGroups.\n *\n * This allows custom editors to bind directly to the control for validation display:\n * ```html\n * <input *tbwEditor=\"let value; control as ctrl\"\n * [formControl]=\"ctrl\"\n * [class.is-invalid]=\"ctrl?.invalid && ctrl?.touched\" />\n * ```\n *\n * Returns `undefined` if:\n * - The grid is not bound to a FormArray\n * - The FormArray doesn't contain FormGroups\n * - The field doesn't exist in the FormGroup\n */\n control?: AbstractControl;\n /**\n * @deprecated Use `onCommit` callback function instead. Will be removed in v2.0.\n * EventEmitter for commit - requires `.emit()` call.\n */\n commit: EventEmitter<TValue>;\n /**\n * @deprecated Use `onCancel` callback function instead. Will be removed in v2.0.\n * EventEmitter for cancel - requires `.emit()` call.\n */\n cancel: EventEmitter<void>;\n}\n\n// Global registry mapping DOM elements to their templates\nconst editorTemplateRegistry = new Map<HTMLElement, TemplateRef<GridEditorContext>>();\n\n/**\n * Gets the editor template registered for a given element.\n * Used by AngularGridAdapter to retrieve templates at render time.\n */\nexport function getEditorTemplate(element: HTMLElement): TemplateRef<GridEditorContext> | undefined {\n return editorTemplateRegistry.get(element);\n}\n\n/**\n * Directive that captures an `<ng-template>` for use as a cell editor.\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\" editable>\n * <tbw-grid-column-editor>\n * <ng-template let-value let-row=\"row\" let-onCommit=\"onCommit\" let-onCancel=\"onCancel\">\n * <app-status-select\n * [value]=\"value\"\n * [row]=\"row\"\n * (commit)=\"onCommit($event)\"\n * (cancel)=\"onCancel()\"\n * />\n * </ng-template>\n * </tbw-grid-column-editor>\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 * - `onCommit`: Callback function to commit the new value\n * - `onCancel`: Callback function to cancel editing\n *\n * Import the directive in your component:\n *\n * ```typescript\n * import { GridColumnEditor } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [GridColumnEditor],\n * // ...\n * })\n * ```\n */\n@Directive({ selector: 'tbw-grid-column-editor' })\nexport class GridColumnEditor {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * Query for the ng-template content child.\n */\n template = contentChild(TemplateRef<GridEditorContext>);\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 editorTemplateRegistry.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: GridColumnEditor, ctx: unknown): ctx is GridEditorContext {\n return true;\n }\n}\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 */\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@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 { contentChild, Directive, effect, ElementRef, inject, input, TemplateRef } from '@angular/core';\nimport type { ExpandCollapseAnimation } from '@toolbox-web/grid';\n\n/**\n * Context object passed to the detail renderer template.\n * Contains the row data for the expanded detail view.\n */\nexport interface GridDetailContext<TRow = unknown> {\n /** The row data (implicit binding for let-row) */\n $implicit: TRow;\n /** The row data (explicit binding) */\n row: TRow;\n}\n\n// Global registry mapping DOM elements to their templates\nconst detailTemplateRegistry = new Map<HTMLElement, TemplateRef<GridDetailContext>>();\n\n/**\n * Gets the detail template registered for a given grid element.\n * Used by AngularGridAdapter to retrieve templates at render time.\n */\nexport function getDetailTemplate(gridElement: HTMLElement): TemplateRef<GridDetailContext> | undefined {\n // Look for tbw-grid-detail child and get its template\n const detailElement = gridElement.querySelector('tbw-grid-detail');\n if (detailElement) {\n return detailTemplateRegistry.get(detailElement as HTMLElement);\n }\n return undefined;\n}\n\n/**\n * Gets the configuration for the detail view.\n */\nexport function getDetailConfig(\n gridElement: HTMLElement,\n): { showExpandColumn?: boolean; animation?: ExpandCollapseAnimation } | undefined {\n const detailElement = gridElement.querySelector('tbw-grid-detail');\n if (detailElement) {\n const animationAttr = detailElement.getAttribute('animation');\n let animation: ExpandCollapseAnimation = 'slide';\n if (animationAttr === 'false') {\n animation = false;\n } else if (animationAttr === 'fade') {\n animation = 'fade';\n }\n return {\n showExpandColumn: detailElement.getAttribute('showExpandColumn') !== 'false',\n animation,\n };\n }\n return undefined;\n}\n\n/**\n * Directive that captures an `<ng-template>` for use as a master-detail row renderer.\n *\n * This enables declarative Angular component usage for expandable detail rows\n * that appear below the main row when expanded.\n *\n * ## Usage\n *\n * ```html\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-detail [showExpandColumn]=\"true\" animation=\"slide\">\n * <ng-template let-row>\n * <app-detail-panel [employee]=\"row\" />\n * </ng-template>\n * </tbw-grid-detail>\n * </tbw-grid>\n * ```\n *\n * The template context provides:\n * - `$implicit` / `row`: The full row data object\n *\n * Import the directive in your component:\n *\n * ```typescript\n * import { GridDetailView } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [GridDetailView],\n * // ...\n * })\n * ```\n */\n@Directive({ selector: 'tbw-grid-detail' })\nexport class GridDetailView {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /** Whether to show the expand/collapse column. Default: true */\n showExpandColumn = input<boolean>(true);\n\n /** Animation style for expand/collapse. Default: 'slide' */\n animation = input<ExpandCollapseAnimation>('slide');\n\n /**\n * Query for the ng-template content child.\n */\n template = contentChild(TemplateRef<GridDetailContext>);\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 detailTemplateRegistry.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: GridDetailView, ctx: unknown): ctx is GridDetailContext {\n return true;\n }\n}\n","import { Directive, effect, ElementRef, inject, input, OnDestroy, OnInit } from '@angular/core';\nimport { AbstractControl, FormArray, FormGroup } from '@angular/forms';\nimport type { BaseGridPlugin, DataGridElement as GridElement } from '@toolbox-web/grid';\n\n/**\n * Interface for EditingPlugin validation methods.\n * We use a minimal interface to avoid importing the full EditingPlugin class.\n */\ninterface EditingPluginValidation {\n setInvalid(rowId: string, field: string, message?: string): void;\n clearInvalid(rowId: string, field: string): void;\n clearRowInvalid(rowId: string): void;\n}\n\n/**\n * Context provided to the grid containing form-related information.\n * This can be accessed by other directives to get form controls.\n */\nexport interface FormArrayContext {\n /** Get the row data at a specific index */\n getRow<T = unknown>(rowIndex: number): T | null;\n /** Update a field value at a specific row */\n updateField(rowIndex: number, field: string, value: unknown): void;\n /** Get the current form value (all rows) */\n getValue<T = unknown>(): T[];\n /**\n * Get the FormControl for a specific cell.\n * Only available when using FormArray with FormGroup rows.\n *\n * @param rowIndex - The row index\n * @param field - The field name\n * @returns The AbstractControl for the cell, or undefined if not available\n */\n getControl(rowIndex: number, field: string): AbstractControl | undefined;\n /**\n * Whether the grid is backed by a FormArray of FormGroups.\n * When true, `getControl()` will return cell-level controls.\n */\n hasFormGroups: boolean;\n /**\n * Get the FormGroup for a specific row.\n * Only available when using FormArray with FormGroup rows.\n *\n * @param rowIndex - The row index\n * @returns The FormGroup for the row, or undefined if not available\n */\n getRowFormGroup(rowIndex: number): FormGroup | undefined;\n /**\n * Check if a row is valid (all controls in the FormGroup are valid).\n * Returns true if not using FormArray or if the row doesn't exist.\n *\n * @param rowIndex - The row index\n * @returns true if the row is valid, false if any control is invalid\n */\n isRowValid(rowIndex: number): boolean;\n /**\n * Check if a row has been touched (any control in the FormGroup is touched).\n * Returns false if not using FormArray or if the row doesn't exist.\n *\n * @param rowIndex - The row index\n * @returns true if any control in the row is touched\n */\n isRowTouched(rowIndex: number): boolean;\n /**\n * Check if a row is dirty (any control in the FormGroup is dirty).\n * Returns false if not using FormArray or if the row doesn't exist.\n *\n * @param rowIndex - The row index\n * @returns true if any control in the row is dirty\n */\n isRowDirty(rowIndex: number): boolean;\n /**\n * Get validation errors for a specific row.\n * Aggregates errors from all controls in the FormGroup.\n *\n * @param rowIndex - The row index\n * @returns Object with field names as keys and their errors, or null if no errors\n */\n getRowErrors(rowIndex: number): Record<string, unknown> | null;\n}\n\n// Symbol for storing form context on the grid element\nconst FORM_ARRAY_CONTEXT = Symbol('formArrayContext');\n\n/**\n * Gets the FormArrayContext from a grid element, if present.\n * @internal\n */\nexport function getFormArrayContext(gridElement: HTMLElement): FormArrayContext | undefined {\n return (gridElement as unknown as Record<symbol, FormArrayContext>)[FORM_ARRAY_CONTEXT];\n}\n\n/**\n * Directive that binds a FormArray directly to the grid.\n *\n * This is the recommended way to integrate tbw-grid with Angular Reactive Forms.\n * Use a FormArray of FormGroups for row-level validation and cell-level control access.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component, inject } from '@angular/core';\n * import { FormBuilder, ReactiveFormsModule } from '@angular/forms';\n * import { Grid, GridFormArray } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [Grid, GridFormArray, ReactiveFormsModule],\n * template: \\`\n * <form [formGroup]=\"form\">\n * <tbw-grid [formArray]=\"form.controls.rows\" [columns]=\"columns\" />\n * </form>\n * \\`\n * })\n * export class MyComponent {\n * private fb = inject(FormBuilder);\n *\n * form = this.fb.group({\n * rows: this.fb.array([\n * this.fb.group({ name: 'Alice', age: 30 }),\n * this.fb.group({ name: 'Bob', age: 25 }),\n * ])\n * });\n *\n * columns = [\n * { field: 'name', header: 'Name', editable: true },\n * { field: 'age', header: 'Age', editable: true }\n * ];\n * }\n * ```\n *\n * ## How It Works\n *\n * - **FormArray → Grid**: The grid displays the FormArray's value as rows\n * - **Grid → FormArray**: When a cell is edited, the corresponding FormControl is updated\n * - FormArrayContext is available for accessing cell-level controls\n *\n * ## Features\n *\n * - Works naturally with FormArray inside a FormGroup\n * - Provides cell-level FormControl access for validation\n * - Supports row-level validation state aggregation\n * - Automatically syncs FormArray changes to the grid\n */\n@Directive({\n selector: 'tbw-grid[formArray]',\n})\nexport class GridFormArray implements OnInit, OnDestroy {\n private elementRef = inject(ElementRef<GridElement>);\n private cellCommitListener: ((e: Event) => void) | null = null;\n private rowCommitListener: ((e: Event) => void) | null = null;\n private touchListener: ((e: Event) => void) | null = null;\n\n /**\n * The FormArray to bind to the grid.\n */\n readonly formArray = input.required<FormArray>();\n\n /**\n * Whether to automatically sync Angular validation state to grid's visual invalid styling.\n *\n * When enabled:\n * - After a cell commit, if the FormControl is invalid, the cell is marked with `setInvalid()`\n * - When a FormControl becomes valid, `clearInvalid()` is called\n * - On `row-commit`, if the row's FormGroup has invalid controls, the commit is prevented\n *\n * @default true\n */\n readonly syncValidation = input<boolean>(true);\n\n /**\n * Effect that syncs the FormArray value to the grid rows.\n */\n private syncFormArrayToGrid = effect(() => {\n const formArray = this.formArray();\n const grid = this.elementRef.nativeElement;\n if (grid && formArray) {\n // Get the raw value (including disabled controls)\n grid.rows = formArray.getRawValue();\n }\n });\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n if (!grid) return;\n\n // Store the form context on the grid element for other directives to access\n this.#storeFormContext(grid);\n\n // Intercept cell-commit events to update the FormArray\n this.cellCommitListener = (e: Event) => {\n const detail = (e as CustomEvent).detail;\n this.#handleCellCommit(detail);\n };\n grid.addEventListener('cell-commit', this.cellCommitListener);\n\n // Intercept row-commit events to prevent if FormGroup is invalid\n this.rowCommitListener = (e: Event) => {\n if (!this.syncValidation()) return;\n const detail = (e as CustomEvent).detail as { rowIndex: number };\n this.#handleRowCommit(e, detail);\n };\n grid.addEventListener('row-commit', this.rowCommitListener);\n\n // Mark FormArray as touched on first interaction\n this.touchListener = () => {\n this.formArray().markAsTouched();\n // Remove after first touch\n if (this.touchListener) {\n grid.removeEventListener('click', this.touchListener);\n this.touchListener = null;\n }\n };\n grid.addEventListener('click', this.touchListener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (!grid) return;\n\n if (this.cellCommitListener) {\n grid.removeEventListener('cell-commit', this.cellCommitListener);\n }\n if (this.rowCommitListener) {\n grid.removeEventListener('row-commit', this.rowCommitListener);\n }\n if (this.touchListener) {\n grid.removeEventListener('click', this.touchListener);\n }\n\n this.#clearFormContext(grid);\n }\n\n /**\n * Checks if the FormArray contains FormGroups.\n */\n #isFormArrayOfFormGroups(): boolean {\n const formArray = this.formArray();\n if (formArray.length === 0) return false;\n return formArray.at(0) instanceof FormGroup;\n }\n\n /**\n * Gets the FormGroup at a specific row index.\n */\n #getRowFormGroup(rowIndex: number): FormGroup | undefined {\n const formArray = this.formArray();\n const rowControl = formArray.at(rowIndex);\n return rowControl instanceof FormGroup ? rowControl : undefined;\n }\n\n /**\n * Stores the FormArrayContext on the grid element.\n */\n #storeFormContext(grid: GridElement): void {\n const getRowFormGroup = (rowIndex: number) => this.#getRowFormGroup(rowIndex);\n\n const context: FormArrayContext = {\n getRow: <T>(rowIndex: number): T | null => {\n const formArray = this.formArray();\n const rowControl = formArray.at(rowIndex);\n return rowControl ? (rowControl.value as T) : null;\n },\n updateField: (rowIndex: number, field: string, value: unknown) => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (rowFormGroup) {\n const control = rowFormGroup.get(field);\n if (control) {\n control.setValue(value);\n control.markAsDirty();\n }\n }\n },\n getValue: <T>(): T[] => {\n return this.formArray().getRawValue() as T[];\n },\n hasFormGroups: this.#isFormArrayOfFormGroups(),\n getControl: (rowIndex: number, field: string): AbstractControl | undefined => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return undefined;\n return rowFormGroup.get(field) ?? undefined;\n },\n getRowFormGroup,\n isRowValid: (rowIndex: number): boolean => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return true;\n return rowFormGroup.valid;\n },\n isRowTouched: (rowIndex: number): boolean => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return false;\n return rowFormGroup.touched;\n },\n isRowDirty: (rowIndex: number): boolean => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return false;\n return rowFormGroup.dirty;\n },\n getRowErrors: (rowIndex: number): Record<string, unknown> | null => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return null;\n\n const errors: Record<string, unknown> = {};\n let hasErrors = false;\n\n Object.keys(rowFormGroup.controls).forEach((field) => {\n const control = rowFormGroup.get(field);\n if (control?.errors) {\n errors[field] = control.errors;\n hasErrors = true;\n }\n });\n\n if (rowFormGroup.errors) {\n errors['_group'] = rowFormGroup.errors;\n hasErrors = true;\n }\n\n return hasErrors ? errors : null;\n },\n };\n (grid as unknown as Record<symbol, FormArrayContext>)[FORM_ARRAY_CONTEXT] = context;\n }\n\n /**\n * Clears the FormArrayContext from the grid element.\n */\n #clearFormContext(grid: GridElement): void {\n delete (grid as unknown as Record<symbol, FormArrayContext>)[FORM_ARRAY_CONTEXT];\n }\n\n /**\n * Handles cell-commit events by updating the FormControl in the FormGroup.\n */\n #handleCellCommit(detail: { rowIndex: number; field: string; value: unknown; rowId: string }): void {\n const { rowIndex, field, value, rowId } = detail;\n\n const rowFormGroup = this.#getRowFormGroup(rowIndex);\n if (rowFormGroup) {\n const control = rowFormGroup.get(field);\n if (control) {\n control.setValue(value);\n control.markAsDirty();\n control.markAsTouched();\n\n // Sync Angular validation state to grid's visual invalid styling\n if (this.syncValidation() && rowId) {\n this.#syncControlValidationToGrid(rowId, field, control);\n }\n }\n }\n }\n\n /**\n * Handles row-commit events - prevents commit if FormGroup has invalid controls.\n */\n #handleRowCommit(event: Event, detail: { rowIndex: number }): void {\n const { rowIndex } = detail;\n const rowFormGroup = this.#getRowFormGroup(rowIndex);\n\n if (rowFormGroup && rowFormGroup.invalid) {\n // Prevent row commit if the FormGroup is invalid\n event.preventDefault();\n }\n }\n\n /**\n * Syncs a FormControl's validation state to the grid's visual invalid styling.\n */\n #syncControlValidationToGrid(rowId: string, field: string, control: AbstractControl): void {\n const grid = this.elementRef.nativeElement;\n if (!grid) return;\n\n // Get EditingPlugin via getPluginByName\n const editingPlugin = (grid as unknown as { getPluginByName?: (name: string) => BaseGridPlugin }).getPluginByName?.(\n 'editing',\n ) as EditingPluginValidation | undefined;\n\n if (!editingPlugin) return;\n\n if (control.invalid) {\n // Get first error message to display\n const errorMessage = this.#getFirstErrorMessage(control);\n editingPlugin.setInvalid(rowId, field, errorMessage);\n } else {\n editingPlugin.clearInvalid(rowId, field);\n }\n }\n\n /**\n * Gets a human-readable error message from the first validation error.\n */\n #getFirstErrorMessage(control: AbstractControl): string {\n const errors = control.errors;\n if (!errors) return '';\n\n const firstKey = Object.keys(errors)[0];\n const error = errors[firstKey];\n\n // Common Angular validators\n switch (firstKey) {\n case 'required':\n return 'This field is required';\n case 'minlength':\n return `Minimum length is ${error.requiredLength}`;\n case 'maxlength':\n return `Maximum length is ${error.requiredLength}`;\n case 'min':\n return `Minimum value is ${error.min}`;\n case 'max':\n return `Maximum value is ${error.max}`;\n case 'email':\n return 'Invalid email address';\n case 'pattern':\n return 'Invalid format';\n default:\n // Custom validators may provide a message property\n return typeof error === 'string' ? error : (error?.message ?? `Validation error: ${firstKey}`);\n }\n }\n}\n","import { contentChild, Directive, effect, ElementRef, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context object passed to the responsive card template.\n *\n * @template TRow - The type of row data\n *\n * @example\n * ```html\n * <tbw-grid-responsive-card>\n * <ng-template let-row let-index=\"index\">\n * <div class=\"card-content\">\n * <span>{{ row.name }}</span>\n * <span>Row #{{ index }}</span>\n * </div>\n * </ng-template>\n * </tbw-grid-responsive-card>\n * ```\n */\nexport interface GridResponsiveCardContext<TRow = unknown> {\n /**\n * The row data (available as `let-row` or `let-myVar`).\n */\n $implicit: TRow;\n\n /**\n * The row data (explicit access via `let-row=\"row\"`).\n */\n row: TRow;\n\n /**\n * The row index (zero-based).\n */\n index: number;\n}\n\n/**\n * Registry to store responsive card templates by grid element.\n * Used by AngularGridAdapter to create card renderers.\n */\nexport const responsiveCardTemplateRegistry = new Map<HTMLElement, TemplateRef<GridResponsiveCardContext>>();\n\n/**\n * Retrieves the responsive card template for a grid element.\n *\n * @param gridElement - The grid element to look up\n * @returns The template reference or undefined if not found\n */\nexport function getResponsiveCardTemplate(\n gridElement: HTMLElement,\n): TemplateRef<GridResponsiveCardContext> | undefined {\n // Find the tbw-grid-responsive-card element inside the grid\n const cardElement = gridElement.querySelector('tbw-grid-responsive-card');\n if (!cardElement) return undefined;\n return responsiveCardTemplateRegistry.get(cardElement as HTMLElement);\n}\n\n/**\n * Directive for providing custom Angular templates for responsive card layout.\n *\n * Use this directive to define how each row should render when the grid\n * is in responsive/mobile mode. The template receives the row data and index.\n *\n * ## Usage\n *\n * ```html\n * <tbw-grid [rows]=\"employees\">\n * <tbw-grid-responsive-card>\n * <ng-template let-employee let-idx=\"index\">\n * <div class=\"employee-card\">\n * <img [src]=\"employee.avatar\" alt=\"\">\n * <div class=\"info\">\n * <strong>{{ employee.name }}</strong>\n * <span>{{ employee.department }}</span>\n * </div>\n * </div>\n * </ng-template>\n * </tbw-grid-responsive-card>\n * </tbw-grid>\n * ```\n *\n * ## Important Notes\n *\n * - The ResponsivePlugin must be added to your grid config\n * - The Grid directive will automatically configure the plugin's cardRenderer\n * - Template context provides `$implicit` (row), `row`, and `index`\n *\n * @see ResponsivePlugin\n */\n@Directive({\n selector: 'tbw-grid-responsive-card',\n})\nexport class GridResponsiveCard<TRow = unknown> {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The ng-template containing the card content.\n */\n template = contentChild(TemplateRef<GridResponsiveCardContext<TRow>>);\n\n /**\n * Effect that registers the template when it becomes available.\n */\n private onTemplateReceived = effect(() => {\n const template = this.template();\n if (template) {\n responsiveCardTemplateRegistry.set(\n this.elementRef.nativeElement,\n template as TemplateRef<GridResponsiveCardContext>,\n );\n }\n });\n\n /**\n * Type guard for template context inference.\n */\n static ngTemplateContextGuard<T>(\n _directive: GridResponsiveCard<T>,\n context: unknown,\n ): context is GridResponsiveCardContext<T> {\n return true;\n }\n}\n","import { contentChild, Directive, effect, ElementRef, inject, input, TemplateRef } from '@angular/core';\n\n/**\n * Context object passed to the tool panel template.\n * Provides access to grid-related information for the panel content.\n */\nexport interface GridToolPanelContext {\n /** The grid element (implicit binding) */\n $implicit: HTMLElement;\n /** The grid element */\n grid: HTMLElement;\n}\n\n// Global registry mapping DOM elements to their templates\nconst toolPanelTemplateRegistry = new Map<HTMLElement, TemplateRef<GridToolPanelContext>>();\n\n/**\n * Gets the tool panel template registered for a given tool panel element.\n * Used by AngularGridAdapter to retrieve templates at render time.\n */\nexport function getToolPanelTemplate(panelElement: HTMLElement): TemplateRef<GridToolPanelContext> | undefined {\n return toolPanelTemplateRegistry.get(panelElement);\n}\n\n/**\n * Gets all tool panel elements with registered templates within a grid element.\n */\nexport function getToolPanelElements(gridElement: HTMLElement): HTMLElement[] {\n const panelElements = gridElement.querySelectorAll('tbw-grid-tool-panel');\n return Array.from(panelElements).filter((el) => toolPanelTemplateRegistry.has(el as HTMLElement)) as HTMLElement[];\n}\n\n/**\n * Directive that captures an `<ng-template>` for use as a custom tool panel.\n *\n * This enables declarative Angular component usage for tool panels\n * that appear in the grid's side panel.\n *\n * ## Usage\n *\n * ```html\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-tool-panel\n * id=\"quick-filters\"\n * title=\"Quick Filters\"\n * icon=\"🔍\"\n * tooltip=\"Apply quick filters\"\n * [order]=\"10\"\n * >\n * <ng-template let-grid>\n * <app-quick-filters [grid]=\"grid\" />\n * </ng-template>\n * </tbw-grid-tool-panel>\n * </tbw-grid>\n * ```\n *\n * The template context provides:\n * - `$implicit` / `grid`: The grid element reference\n *\n * ### Attributes\n *\n * - `id` (required): Unique identifier for the panel\n * - `title` (required): Panel title shown in accordion header\n * - `icon`: Icon for accordion section header (emoji or text)\n * - `tooltip`: Tooltip for accordion section header\n * - `order`: Panel order priority (lower = first, default: 100)\n *\n * Import the directive in your component:\n *\n * ```typescript\n * import { GridToolPanel } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [GridToolPanel],\n * // ...\n * })\n * ```\n */\n@Directive({ selector: 'tbw-grid-tool-panel' })\nexport class GridToolPanel {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /** Unique panel identifier (required) */\n id = input.required<string>({ alias: 'id' });\n\n /** Panel title shown in accordion header (required) */\n title = input.required<string>({ alias: 'title' });\n\n /** Icon for accordion section header (emoji or text) */\n icon = input<string>();\n\n /** Tooltip for accordion section header */\n tooltip = input<string>();\n\n /** Panel order priority (lower = first, default: 100) */\n order = input<number>(100);\n\n /**\n * Query for the ng-template content child.\n */\n template = contentChild(TemplateRef<GridToolPanelContext>);\n\n /** Effect that triggers when the template is available */\n private onTemplateReceived = effect(() => {\n const template = this.template();\n const element = this.elementRef.nativeElement;\n\n if (template) {\n // Set attributes from inputs (for light DOM parsing to read)\n element.setAttribute('id', this.id());\n element.setAttribute('title', this.title());\n\n const icon = this.icon();\n if (icon) element.setAttribute('icon', icon);\n\n const tooltip = this.tooltip();\n if (tooltip) element.setAttribute('tooltip', tooltip);\n\n element.setAttribute('order', String(this.order()));\n\n // Register the template for this element\n toolPanelTemplateRegistry.set(element, template);\n }\n });\n\n /**\n * Static type guard for template context.\n * Enables type inference in templates.\n */\n static ngTemplateContextGuard(dir: GridToolPanel, ctx: unknown): ctx is GridToolPanelContext {\n return true;\n }\n}\n","import { Directive, effect, ElementRef, inject, OnDestroy, TemplateRef } from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\nimport { getEditorTemplate } from './grid-column-editor.directive';\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 */\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/**\n * Context type for structural editor directives with `any` defaults.\n * This provides better ergonomics in templates without requiring explicit type annotations.\n *\n * @internal Use `GridEditorContext` in application code for stricter typing.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface StructuralEditorContext<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 * Callback function to commit the edited value.\n */\n onCommit: (value: TValue) => void;\n /**\n * Callback function to cancel editing.\n */\n onCancel: () => void;\n /**\n * The FormControl for this cell, if the grid is bound to a FormArray with FormGroups.\n *\n * Returns `undefined` if:\n * - The grid is not bound to a FormArray\n * - The FormArray doesn't contain FormGroups\n * - The field doesn't exist in the FormGroup\n */\n control?: AbstractControl;\n}\n\n// Registries for structural directive templates\nconst structuralViewRegistry = new Map<HTMLElement, TemplateRef<StructuralCellContext>>();\nconst structuralEditorRegistry = new Map<HTMLElement, TemplateRef<StructuralEditorContext>>();\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 * Gets the editor template registered by the structural directive for a given column element.\n * Falls back to the non-structural directive registry.\n */\nexport function getStructuralEditorTemplate(\n columnElement: HTMLElement,\n): TemplateRef<StructuralEditorContext> | undefined {\n // First check structural directive registry\n const template = structuralEditorRegistry.get(columnElement);\n if (template) return template;\n\n // Fall back to the nested element registry\n const editorEl = columnElement.querySelector('tbw-grid-column-editor');\n if (editorEl) {\n return getEditorTemplate(editorEl as HTMLElement) as TemplateRef<StructuralEditorContext> | 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@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 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') {\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/**\n * Structural directive for cell editor rendering.\n *\n * This provides a cleaner syntax for defining custom cell editors without\n * the nested `<tbw-grid-column-editor>` 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-editor>\n * <ng-template let-value let-onCommit=\"onCommit\" let-onCancel=\"onCancel\">\n * <app-status-editor [value]=\"value\" (commit)=\"onCommit($event)\" (cancel)=\"onCancel()\" />\n * </ng-template>\n * </tbw-grid-column-editor>\n * </tbw-grid-column>\n *\n * <!-- Use this cleaner syntax (with auto-wiring - no explicit bindings needed!): -->\n * <tbw-grid-column field=\"status\">\n * <app-status-editor *tbwEditor=\"let value\" [value]=\"value\" />\n * </tbw-grid-column>\n * ```\n *\n * ## Template Context\n *\n * The structural directive provides the same context as `GridColumnEditor`:\n * - `$implicit` / `value`: The cell value\n * - `row`: The full row data object\n * - `column`: The column configuration\n * - `onCommit`: Callback function to commit the new value (optional - auto-wired if component emits `commit` event)\n * - `onCancel`: Callback function to cancel editing (optional - auto-wired if component emits `cancel` event)\n *\n * ## Import\n *\n * ```typescript\n * import { TbwEditor } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [TbwEditor],\n * // ...\n * })\n * ```\n */\n@Directive({ selector: '[tbwEditor]' })\nexport class TbwEditor implements OnDestroy {\n private template = inject(TemplateRef<StructuralEditorContext>);\n private elementRef = inject(ElementRef<HTMLElement>);\n private columnElement: HTMLElement | null = null;\n\n constructor() {\n effect(() => {\n this.registerTemplate();\n });\n }\n\n private registerTemplate(): void {\n // Find the parent tbw-grid-column element\n let parent = this.elementRef.nativeElement?.parentElement;\n while (parent && parent.tagName !== 'TBW-GRID-COLUMN') {\n parent = parent.parentElement;\n }\n\n if (parent) {\n this.columnElement = parent;\n structuralEditorRegistry.set(parent, this.template);\n }\n }\n\n ngOnDestroy(): void {\n if (this.columnElement) {\n structuralEditorRegistry.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: TbwEditor, ctx: unknown): ctx is StructuralEditorContext {\n return true;\n }\n}\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';\n\n/**\n * Angular-specific type default configuration.\n * Uses Angular component types instead of function-based renderers/editors.\n */\nexport interface AngularTypeDefault<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\n/**\n * Injection token for providing type defaults at app level.\n */\nexport const GRID_TYPE_DEFAULTS = new InjectionToken<Record<string, AngularTypeDefault>>('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 */\n@Injectable({ providedIn: 'root' })\nexport class GridTypeRegistry {\n private readonly defaults = new Map<string, AngularTypeDefault>();\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: AngularTypeDefault<T>): void {\n this.defaults.set(type, defaults);\n }\n\n /**\n * Get type defaults for a given type.\n */\n get(type: string): AngularTypeDefault | 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 */\nexport function provideGridTypeDefaults(defaults: Record<string, AngularTypeDefault>): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: GRID_TYPE_DEFAULTS, useValue: defaults }]);\n}\n","import {\n ApplicationRef,\n ComponentRef,\n createComponent,\n EmbeddedViewRef,\n EnvironmentInjector,\n EventEmitter,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport type {\n CellRenderContext,\n ColumnConfig,\n ColumnEditorContext,\n ColumnEditorSpec,\n ColumnViewRenderer,\n FrameworkAdapter,\n GridConfig,\n TypeDefault,\n} from '@toolbox-web/grid';\nimport { isComponentClass, type AngularColumnConfig, type AngularGridConfig } from './angular-column-config';\nimport { getEditorTemplate, GridEditorContext } from './directives/grid-column-editor.directive';\nimport { getViewTemplate, GridCellContext } from './directives/grid-column-view.directive';\nimport { getDetailTemplate, GridDetailContext } from './directives/grid-detail-view.directive';\nimport { getFormArrayContext } from './directives/grid-form-array.directive';\nimport { getResponsiveCardTemplate, GridResponsiveCardContext } from './directives/grid-responsive-card.directive';\nimport { getToolPanelTemplate, GridToolPanelContext } from './directives/grid-tool-panel.directive';\nimport { getStructuralEditorTemplate, getStructuralViewTemplate } from './directives/structural-directives';\nimport { GridTypeRegistry } from './grid-type-registry';\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 * Helper to get editor template from either structural directive or nested directive.\n */\nfunction getAnyEditorTemplate(element: HTMLElement): TemplateRef<GridEditorContext> | undefined {\n // First check structural directive registry (for *tbwEditor syntax)\n // The structural context uses `any` types for better ergonomics, but is compatible with GridEditorContext\n const structuralTemplate = getStructuralEditorTemplate(element);\n if (structuralTemplate) return structuralTemplate as unknown as TemplateRef<GridEditorContext>;\n\n // Fall back to nested directive (for <tbw-grid-column-editor> syntax)\n return getEditorTemplate(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 { AngularGridAdapter } 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 AngularGridAdapter(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 */\nexport class AngularGridAdapter implements FrameworkAdapter {\n private viewRefs: EmbeddedViewRef<unknown>[] = [];\n private componentRefs: ComponentRef<unknown>[] = [];\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 { AngularGridAdapter, type AngularGridConfig } from '@toolbox-web/grid-angular';\n *\n * const config: AngularGridConfig<Employee> = {\n * columns: [\n * { field: 'status', renderer: StatusBadgeComponent, editor: StatusEditorComponent },\n * ],\n * };\n *\n * // In component\n * constructor() {\n * const adapter = inject(AngularGridAdapter); // 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: AngularGridConfig<TRow>): GridConfig<TRow> {\n if (!config.columns) {\n return config as GridConfig<TRow>;\n }\n\n const processedColumns = config.columns.map((col) => this.processColumn(col));\n\n return {\n ...config,\n columns: processedColumns,\n } as GridConfig<TRow>;\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: AngularColumnConfig<TRow>): ColumnConfig<TRow> {\n const processed = { ...column } as ColumnConfig<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 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 */\n canHandle(element: HTMLElement): boolean {\n return getAnyViewTemplate(element) !== undefined || getAnyEditorTemplate(element) !== 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> {\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 as unknown as ColumnViewRenderer<TRow, TValue>;\n }\n\n return (ctx: CellRenderContext<TRow, TValue>) => {\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 // Get the first root node (the component's host element)\n const rootNode = viewRef.rootNodes[0];\n return rootNode;\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> {\n const template = getAnyEditorTemplate(element) as TemplateRef<GridEditorContext<TValue, TRow>> | undefined;\n\n // Find the parent grid element for FormArray context access\n const gridElement = element.closest('tbw-grid') as HTMLElement | null;\n\n if (!template) {\n // No warning - this can happen during early initialization before Angular\n // registers structural directive templates. The grid will re-parse columns\n // after templates are registered.\n return () => document.createElement('div');\n }\n\n return (ctx: ColumnEditorContext<TRow, TValue>) => {\n // Create simple callback functions (preferred)\n const onCommit = (value: TValue) => ctx.commit(value);\n const onCancel = () => ctx.cancel();\n\n // Create EventEmitters for backwards compatibility (deprecated)\n const commitEmitter = new EventEmitter<TValue>();\n const cancelEmitter = new EventEmitter<void>();\n commitEmitter.subscribe((value: TValue) => ctx.commit(value));\n cancelEmitter.subscribe(() => ctx.cancel());\n\n // Try to get the FormControl from the FormArrayContext\n let control: GridEditorContext<TValue, TRow>['control'];\n if (gridElement) {\n const formContext = getFormArrayContext(gridElement);\n if (formContext?.hasFormGroups) {\n // Find the row index by looking up ctx.row in the grid's rows\n const gridRows = (gridElement as { rows?: TRow[] }).rows;\n if (gridRows) {\n const rowIndex = gridRows.indexOf(ctx.row);\n if (rowIndex >= 0) {\n control = formContext.getControl(rowIndex, ctx.field);\n }\n }\n }\n }\n\n // Create the context for the template\n const context: GridEditorContext<TValue, TRow> = {\n $implicit: ctx.value,\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n // Preferred: simple callback functions\n onCommit,\n onCancel,\n // FormControl from FormArray (if available)\n control,\n // Deprecated: EventEmitters (for backwards compatibility)\n commit: commitEmitter,\n cancel: cancelEmitter,\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 // Get the first root node (the component's host element)\n const rootNode = viewRef.rootNodes[0] as HTMLElement;\n\n // Auto-wire: Listen for commit/cancel events on the rendered component.\n // This allows components to just emit (commit) and (cancel) without\n // requiring explicit template bindings like (commit)=\"onCommit($event)\".\n if (rootNode && rootNode.addEventListener) {\n rootNode.addEventListener('commit', (e: Event) => {\n const customEvent = e as CustomEvent<TValue>;\n ctx.commit(customEvent.detail);\n });\n rootNode.addEventListener('cancel', () => {\n ctx.cancel();\n });\n }\n\n return rootNode;\n };\n }\n\n /**\n * Creates a detail renderer function for MasterDetailPlugin.\n * Renders Angular templates for expandable detail rows.\n */\n createDetailRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow) => HTMLElement) | undefined {\n const template = getDetailTemplate(gridElement) as TemplateRef<GridDetailContext<TRow>> | undefined;\n\n if (!template) {\n return undefined;\n }\n\n return (row: TRow) => {\n // Create the context for the template\n const context: GridDetailContext<TRow> = {\n $implicit: row,\n row: row,\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 // Create a container for the root nodes\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node) => container.appendChild(node));\n return container;\n };\n }\n\n /**\n * Framework adapter hook called by MasterDetailPlugin during attach().\n * Parses the <tbw-grid-detail> element and returns an Angular template-based renderer.\n *\n * This enables MasterDetailPlugin to automatically use Angular templates\n * without manual configuration in the Grid directive.\n */\n parseDetailElement<TRow = unknown>(\n detailElement: Element,\n ): ((row: TRow, rowIndex: number) => HTMLElement | string) | undefined {\n // Get the template from the registry for this detail element\n const template = getDetailTemplate(detailElement.closest('tbw-grid') as HTMLElement) as\n | TemplateRef<GridDetailContext<TRow>>\n | undefined;\n\n if (!template) {\n return undefined;\n }\n\n // Return a renderer function that creates embedded views\n // Note: rowIndex is part of the MasterDetailPlugin detailRenderer signature but not needed here\n return (row: TRow) => {\n const context: GridDetailContext<TRow> = {\n $implicit: row,\n row: row,\n };\n\n const viewRef = this.viewContainerRef.createEmbeddedView(template, context);\n this.viewRefs.push(viewRef);\n viewRef.detectChanges();\n\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node) => container.appendChild(node));\n return container;\n };\n }\n\n /**\n * Creates a responsive card renderer function for ResponsivePlugin.\n * Renders Angular templates for card layout in responsive mode.\n *\n * @param gridElement - The grid element to look up the template for\n * @returns A card renderer function or undefined if no template is found\n */\n createResponsiveCardRenderer<TRow = unknown>(\n gridElement: HTMLElement,\n ): ((row: TRow, rowIndex: number) => HTMLElement) | undefined {\n const template = getResponsiveCardTemplate(gridElement) as TemplateRef<GridResponsiveCardContext<TRow>> | undefined;\n\n if (!template) {\n return undefined;\n }\n\n return (row: TRow, rowIndex: number) => {\n // Create the context for the template\n const context: GridResponsiveCardContext<TRow> = {\n $implicit: row,\n row: row,\n index: rowIndex,\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 // Create a container for the root nodes\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node) => container.appendChild(node));\n return container;\n };\n }\n\n /**\n * Creates a tool panel renderer from a light DOM element.\n * The renderer creates an Angular template-based panel content.\n */\n createToolPanelRenderer(element: HTMLElement): ((container: HTMLElement) => void | (() => void)) | undefined {\n const template = getToolPanelTemplate(element) as TemplateRef<GridToolPanelContext> | undefined;\n\n if (!template) {\n return undefined;\n }\n\n // Find the parent grid element for context\n const gridElement = element.closest('tbw-grid') as HTMLElement | null;\n\n return (container: HTMLElement) => {\n // Create the context for the template\n const context: GridToolPanelContext = {\n $implicit: gridElement ?? container,\n grid: gridElement ?? container,\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 // Append all root nodes to the container\n viewRef.rootNodes.forEach((node) => container.appendChild(node));\n\n // Return cleanup function\n return () => {\n const index = this.viewRefs.indexOf(viewRef);\n if (index > -1) {\n this.viewRefs.splice(index, 1);\n }\n viewRef.destroy();\n };\n };\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): TypeDefault<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: TypeDefault<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 TypeDefault['editor'];\n }\n\n return typeDefault;\n }\n\n /**\n * Creates a renderer function from an Angular component class.\n * @internal\n */\n private createComponentRenderer<TRow = unknown, TValue = unknown>(\n componentClass: Type<unknown>,\n ): ColumnViewRenderer<TRow, TValue> {\n return (ctx: CellRenderContext<TRow, TValue>) => {\n // Create a host element for the component\n const hostElement = document.createElement('span');\n hostElement.style.display = 'contents';\n\n // Create the component dynamically\n const componentRef = createComponent(componentClass, {\n environmentInjector: this.injector,\n hostElement,\n });\n\n // Set inputs - components should have value, row, column inputs\n this.setComponentInputs(componentRef, {\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n });\n\n // Attach to app for change detection\n this.appRef.attachView(componentRef.hostView);\n this.componentRefs.push(componentRef);\n\n // Trigger change detection\n componentRef.changeDetectorRef.detectChanges();\n\n return hostElement;\n };\n }\n\n /**\n * Creates an editor function from an Angular component class.\n * @internal\n */\n private createComponentEditor<TRow = unknown, TValue = unknown>(\n componentClass: Type<unknown>,\n ): ColumnEditorSpec<TRow, TValue> {\n return (ctx: ColumnEditorContext<TRow, TValue>) => {\n // Create a host element for the component\n const hostElement = document.createElement('span');\n hostElement.style.display = 'contents';\n\n // Create the component dynamically\n const componentRef = createComponent(componentClass, {\n environmentInjector: this.injector,\n hostElement,\n });\n\n // Set inputs - components should have value, row, column inputs\n this.setComponentInputs(componentRef, {\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n });\n\n // Attach to app for change detection\n this.appRef.attachView(componentRef.hostView);\n this.componentRefs.push(componentRef);\n\n // Trigger change detection\n componentRef.changeDetectorRef.detectChanges();\n\n // Subscribe to Angular outputs (commit/cancel) on the component instance.\n // This works with Angular's output() signal API.\n const instance = componentRef.instance as Record<string, unknown>;\n this.subscribeToOutput(instance, 'commit', (value: TValue) => ctx.commit(value));\n this.subscribeToOutput(instance, 'cancel', () => ctx.cancel());\n\n // Also listen for DOM events as fallback (for components that dispatch CustomEvents)\n hostElement.addEventListener('commit', (e: Event) => {\n const customEvent = e as CustomEvent<TValue>;\n ctx.commit(customEvent.detail);\n });\n hostElement.addEventListener('cancel', () => {\n ctx.cancel();\n });\n\n return hostElement;\n };\n }\n\n /**\n * Subscribes to an Angular output on a component instance.\n * Works with both EventEmitter and OutputEmitterRef (signal outputs).\n * @internal\n */\n private subscribeToOutput<T>(\n instance: Record<string, unknown>,\n outputName: string,\n callback: (value: T) => void,\n ): void {\n const output = instance[outputName];\n if (!output) return;\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 }\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 * 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.componentRefs.forEach((ref) => ref.destroy());\n this.componentRefs = [];\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 */\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 */\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 */\nexport function provideGridIcons(icons: Partial<GridIcons>): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: GRID_ICONS, useValue: icons }]);\n}\n","import { afterNextRender, computed, ElementRef, inject, type Signal, signal } from '@angular/core';\nimport type { ColumnConfig, DataGridElement, GridConfig } from '@toolbox-web/grid';\n\n/**\n * Selection convenience methods returned from injectGrid.\n */\nexport interface SelectionMethods<TRow = unknown> {\n /**\n * Select all rows in the grid.\n * Requires SelectionPlugin with mode: 'row'.\n */\n selectAll: () => void;\n\n /**\n * Clear all selection.\n * Works with any SelectionPlugin mode.\n */\n clearSelection: () => void;\n\n /**\n * Get selected row indices.\n * Returns Set of selected row indices.\n */\n getSelectedIndices: () => Set<number>;\n\n /**\n * Get selected rows data.\n * Returns array of selected row objects.\n */\n getSelectedRows: () => TRow[];\n}\n\n/**\n * Export convenience methods returned from injectGrid.\n */\nexport interface ExportMethods {\n /**\n * Export grid data to CSV file.\n * Requires ExportPlugin to be loaded.\n *\n * @param filename - Optional filename (defaults to 'export.csv')\n */\n exportToCsv: (filename?: string) => void;\n\n /**\n * Export grid data to JSON file.\n * Requires ExportPlugin to be loaded.\n *\n * @param filename - Optional filename (defaults to 'export.json')\n */\n exportToJson: (filename?: string) => void;\n}\n\n/**\n * Return type for injectGrid function.\n */\nexport interface InjectGridReturn<TRow = unknown> extends SelectionMethods<TRow>, ExportMethods {\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\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, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n * import { Grid, injectGrid } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * schemas: [CUSTOM_ELEMENTS_SCHEMA],\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 * @returns Object with grid access methods and state signals\n */\nexport function injectGrid<TRow = unknown>(): InjectGridReturn<TRow> {\n const elementRef = inject(ElementRef);\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 // Initialize after render\n afterNextRender(() => {\n const gridElement = elementRef.nativeElement.querySelector('tbw-grid') 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\n gridElement.ready?.().then(async () => {\n isReady.set(true);\n const effectiveConfig = gridElement.getConfig?.();\n if (effectiveConfig) {\n config.set(effectiveConfig as GridConfig<TRow>);\n }\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 // ═══════════════════════════════════════════════════════════════════\n // SELECTION CONVENIENCE METHODS\n // ═══════════════════════════════════════════════════════════════════\n\n const selectAll = (): void => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('selection');\n if (!plugin) {\n console.warn('[injectGrid] selectAll requires SelectionPlugin');\n return;\n }\n // Row mode: select all row indices\n if (plugin.config?.mode === 'row') {\n const rows = gridElement?.rows ?? [];\n const allIndices = new Set<number>(rows.map((_: unknown, i: number) => i));\n plugin.selected = allIndices;\n plugin.requestAfterRender?.();\n }\n };\n\n const clearSelection = (): void => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('selection');\n if (!plugin) return;\n\n const mode = plugin.config?.mode;\n if (mode === 'row') {\n plugin.selected = new Set();\n } else if (mode === 'range' || mode === 'cell') {\n plugin.ranges = [];\n }\n plugin.requestAfterRender?.();\n };\n\n const getSelectedIndices = (): Set<number> => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('selection');\n if (!plugin) return new Set();\n\n if (plugin.config?.mode === 'row') {\n return new Set(plugin.selected ?? []);\n }\n // Range/cell mode: extract unique row indices from ranges\n const ranges = plugin.ranges ?? [];\n const indices = new Set<number>();\n for (const range of ranges) {\n for (let r = range.startRow; r <= range.endRow; r++) {\n indices.add(r);\n }\n }\n return indices;\n };\n\n const getSelectedRows = (): TRow[] => {\n const gridElement = element();\n if (!gridElement) return [];\n const rows = gridElement.rows ?? [];\n const indices = getSelectedIndices();\n return Array.from(indices)\n .filter((i) => i >= 0 && i < rows.length)\n .map((i) => rows[i]);\n };\n\n // ═══════════════════════════════════════════════════════════════════\n // EXPORT CONVENIENCE METHODS\n // ═══════════════════════════════════════════════════════════════════\n\n const exportToCsv = (filename?: string): void => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('export');\n if (!plugin) {\n console.warn('[injectGrid] exportToCsv requires ExportPlugin');\n return;\n }\n plugin.exportToCsv?.(filename);\n };\n\n const exportToJson = (filename?: string): void => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('export');\n if (!plugin) {\n console.warn('[injectGrid] exportToJson requires ExportPlugin');\n return;\n }\n plugin.exportToJson?.(filename);\n };\n\n return {\n element,\n isReady,\n config,\n visibleColumns,\n getConfig,\n forceLayout,\n toggleGroup,\n registerStyles,\n unregisterStyles,\n selectAll,\n clearSelection,\n getSelectedIndices,\n getSelectedRows,\n exportToCsv,\n exportToJson,\n };\n}\n","/**\n * Feature Registry for @toolbox-web/grid-angular\n *\n * This module provides a synchronous registry for plugin factories.\n * Features are registered via side-effect imports, enabling tree-shaking\n * while maintaining the clean input-based API.\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/**\n * Feature names supported by the Grid directive.\n */\nexport type FeatureName =\n | 'selection'\n | 'editing'\n | 'clipboard'\n | 'contextMenu'\n | 'multiSort'\n | 'sorting' // @deprecated - use 'multiSort' instead\n | 'filtering'\n | 'reorder'\n | 'visibility'\n | 'pinnedColumns'\n | 'groupingColumns'\n | 'columnVirtualization'\n | 'rowReorder'\n | 'groupingRows'\n | 'pinnedRows'\n | 'tree'\n | 'masterDetail'\n | 'responsive'\n | 'undoRedo'\n | 'export'\n | 'print'\n | 'pivot'\n | 'serverSide';\n\n/**\n * Plugin factory function type.\n * Takes configuration and returns a plugin instance.\n */\nexport type PluginFactory<TConfig = unknown> = (config: TConfig) => unknown;\n\n/**\n * Registry entry containing the factory and metadata.\n */\ninterface RegistryEntry {\n factory: PluginFactory;\n /** Feature name for debugging */\n name: string;\n}\n\n/**\n * Central registry mapping feature names to their plugin factories.\n * Populated by side-effect feature imports.\n */\nconst featureRegistry = new Map<FeatureName, RegistryEntry>();\n\n/**\n * Set of features that have been used without being registered.\n * Used to show helpful warnings only once per feature.\n */\nconst warnedFeatures = new Set<string>();\n\n/**\n * Register a feature's plugin factory.\n * Called by side-effect feature imports.\n *\n * @param name - The feature name (matches the input name on Grid directive)\n * @param factory - Function that creates the plugin instance\n *\n * @example\n * ```ts\n * // features/selection.ts\n * import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';\n * import { registerFeature } from '../lib/feature-registry';\n *\n * registerFeature('selection', (config) => new SelectionPlugin(config));\n * ```\n */\nexport function registerFeature<TConfig = unknown>(name: FeatureName, factory: PluginFactory<TConfig>): void {\n featureRegistry.set(name, {\n factory: factory as PluginFactory,\n name,\n });\n}\n\n/**\n * Check if a feature is registered.\n */\nexport function isFeatureRegistered(name: FeatureName): boolean {\n return featureRegistry.has(name);\n}\n\n/**\n * Get a registered feature's factory.\n * Returns undefined if not registered.\n */\nexport function getFeatureFactory(name: FeatureName): PluginFactory | undefined {\n return featureRegistry.get(name)?.factory;\n}\n\n/**\n * Get all registered feature names.\n * Useful for debugging.\n */\nexport function getRegisteredFeatures(): FeatureName[] {\n return Array.from(featureRegistry.keys());\n}\n\n/**\n * Create a plugin instance for a feature.\n * Shows a helpful warning if the feature is not registered.\n *\n * @param name - Feature name\n * @param config - Plugin configuration\n * @returns Plugin instance or undefined if not registered\n */\nexport function createPluginFromFeature<TConfig = unknown>(name: FeatureName, config: TConfig): unknown | undefined {\n const entry = featureRegistry.get(name);\n\n if (!entry) {\n // Show warning only once per feature in development\n const isDev =\n typeof window !== 'undefined' &&\n (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1');\n\n if (!warnedFeatures.has(name) && isDev) {\n warnedFeatures.add(name);\n console.warn(\n `[tbw-grid] Feature \"${name}\" input is set but the feature is not registered.\\n` +\n `Add this import to enable it:\\n\\n` +\n ` import '@toolbox-web/grid-angular/features/${toKebabCase(name)}';\\n`,\n );\n }\n return undefined;\n }\n\n return entry.factory(config);\n}\n\n/**\n * Convert camelCase to kebab-case for import paths.\n */\nfunction toKebabCase(str: string): string {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\n/**\n * Clear the registry. For testing only.\n * @internal\n */\nexport function clearFeatureRegistry(): void {\n featureRegistry.clear();\n warnedFeatures.clear();\n}\n","import { computed, Directive, ElementRef, inject, input, output } from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\nimport type { ColumnConfig } from '@toolbox-web/grid';\n\n/**\n * Base class for grid cell editors.\n *\n * Provides common functionality for Angular cell editors:\n * - Automatic value resolution from FormControl or value input\n * - Common inputs (value, row, column, control)\n * - Common outputs (commit, cancel)\n * - Validation state helpers\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { BaseGridEditor } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-my-editor',\n * template: \\`\n * <input\n * [value]=\"currentValue()\"\n * [class.is-invalid]=\"isInvalid()\"\n * (input)=\"commitValue($event.target.value)\"\n * (keydown.escape)=\"cancelEdit()\"\n * />\n * @if (hasErrors()) {\n * <div class=\"error\">{{ firstErrorMessage() }}</div>\n * }\n * \\`\n * })\n * export class MyEditorComponent extends BaseGridEditor<MyRow, string> {\n * // Override to customize error messages\n * protected override getErrorMessage(errorKey: string): string {\n * if (errorKey === 'required') return 'This field is required';\n * if (errorKey === 'minlength') return 'Too short';\n * return super.getErrorMessage(errorKey);\n * }\n * }\n * ```\n *\n * ## Template Syntax\n *\n * When using the base class, you only need to pass the control:\n *\n * ```html\n * <tbw-grid-column field=\"name\">\n * <app-my-editor *tbwEditor=\"let _; control as control\" [control]=\"control\" />\n * </tbw-grid-column>\n * ```\n *\n * Or without FormArray binding (fallback to value):\n *\n * ```html\n * <tbw-grid-column field=\"name\">\n * <app-my-editor *tbwEditor=\"let value\" [value]=\"value\" />\n * </tbw-grid-column>\n * ```\n *\n * @typeParam TRow - The row data type\n * @typeParam TValue - The cell value type\n */\n@Directive()\nexport abstract class BaseGridEditor<TRow = unknown, TValue = unknown> {\n private readonly elementRef = inject(ElementRef);\n\n // ============================================================================\n // Inputs\n // ============================================================================\n\n /**\n * The cell value. Used when FormControl is not available.\n * When a FormControl is provided, value is derived from control.value instead.\n */\n readonly value = input<TValue>();\n\n /**\n * The full row data object.\n */\n readonly row = input<TRow>();\n\n /**\n * The column configuration.\n */\n readonly column = input<ColumnConfig<TRow>>();\n\n /**\n * The FormControl for this cell, if the grid is bound to a FormArray.\n * When provided, the editor uses control.value instead of the value input.\n */\n readonly control = input<AbstractControl>();\n\n // ============================================================================\n // Outputs\n // ============================================================================\n\n /**\n * Emits when the user commits a new value.\n */\n readonly commit = output<TValue>();\n\n /**\n * Emits when the user cancels editing.\n */\n readonly cancel = output<void>();\n\n // ============================================================================\n // Computed State\n // ============================================================================\n\n /**\n * The current value, derived from FormControl if available, otherwise from value input.\n * This is the recommended way to get the current value in your editor template.\n */\n readonly currentValue = computed<TValue | undefined>(() => {\n const ctrl = this.control();\n if (ctrl) {\n return ctrl.value as TValue;\n }\n return this.value();\n });\n\n /**\n * Whether the control is invalid (has validation errors).\n * Returns false if no FormControl is available.\n */\n readonly isInvalid = computed(() => {\n return this.control()?.invalid ?? false;\n });\n\n /**\n * Whether the control is dirty (has been modified).\n * Returns false if no FormControl is available.\n */\n readonly isDirty = computed(() => {\n return this.control()?.dirty ?? false;\n });\n\n /**\n * Whether the control has been touched.\n * Returns false if no FormControl is available.\n */\n readonly isTouched = computed(() => {\n return this.control()?.touched ?? false;\n });\n\n /**\n * Whether the control has any validation errors.\n */\n readonly hasErrors = computed(() => {\n const ctrl = this.control();\n return ctrl?.errors != null && Object.keys(ctrl.errors).length > 0;\n });\n\n /**\n * The first error message from the control's validation errors.\n * Returns an empty string if no errors.\n */\n readonly firstErrorMessage = computed(() => {\n const ctrl = this.control();\n if (!ctrl?.errors) return '';\n\n const firstKey = Object.keys(ctrl.errors)[0];\n return this.getErrorMessage(firstKey, ctrl.errors[firstKey]);\n });\n\n /**\n * All error messages from the control's validation errors.\n */\n readonly allErrorMessages = computed(() => {\n const ctrl = this.control();\n if (!ctrl?.errors) return [];\n\n return Object.entries(ctrl.errors).map(([key, value]) => this.getErrorMessage(key, value));\n });\n\n // ============================================================================\n // Methods\n // ============================================================================\n\n /**\n * Commit a new value. Emits the commit output AND dispatches a DOM event.\n * The DOM event enables the grid's auto-wiring to catch the commit.\n * Call this when the user confirms their edit.\n */\n commitValue(newValue: TValue): void {\n // Emit Angular output for template bindings\n this.commit.emit(newValue);\n\n // Dispatch DOM CustomEvent for grid's auto-wiring\n // This allows the adapter to catch commits without explicit (commit)=\"...\" bindings\n this.elementRef.nativeElement.dispatchEvent(new CustomEvent('commit', { detail: newValue, bubbles: true }));\n }\n\n /**\n * Cancel editing. Emits the cancel output AND dispatches a DOM event.\n * Call this when the user cancels (e.g., presses Escape).\n */\n cancelEdit(): void {\n // Emit Angular output for template bindings\n this.cancel.emit();\n\n // Dispatch DOM CustomEvent for grid's auto-wiring\n this.elementRef.nativeElement.dispatchEvent(new CustomEvent('cancel', { bubbles: true }));\n }\n\n /**\n * Get a human-readable error message for a validation error.\n * Override this method to customize error messages for your editor.\n *\n * @param errorKey - The validation error key (e.g., 'required', 'minlength')\n * @param errorValue - The error value (e.g., { requiredLength: 5, actualLength: 3 })\n * @returns A human-readable error message\n */\n protected getErrorMessage(errorKey: string, errorValue?: unknown): string {\n switch (errorKey) {\n case 'required':\n return 'This field is required';\n case 'minlength': {\n const err = errorValue as { requiredLength?: number };\n return `Minimum length is ${err?.requiredLength ?? 'unknown'}`;\n }\n case 'maxlength': {\n const err = errorValue as { requiredLength?: number };\n return `Maximum length is ${err?.requiredLength ?? 'unknown'}`;\n }\n case 'min': {\n const err = errorValue as { min?: number };\n return `Minimum value is ${err?.min ?? 'unknown'}`;\n }\n case 'max': {\n const err = errorValue as { max?: number };\n return `Maximum value is ${err?.max ?? 'unknown'}`;\n }\n case 'email':\n return 'Invalid email address';\n case 'pattern':\n return 'Invalid format';\n default:\n return `Invalid value (${errorKey})`;\n }\n }\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 ViewContainerRef,\n} from '@angular/core';\nimport type {\n CellActivateDetail,\n CellChangeDetail,\n CellClickDetail,\n ColumnResizeDetail,\n GridColumnState,\n DataGridElement as GridElement,\n RowClickDetail,\n SortChangeDetail,\n} from '@toolbox-web/grid';\nimport { DataGridElement as GridElementClass } from '@toolbox-web/grid';\n// Import editing event types from the editing plugin\nimport type { ChangedRowsResetDetail } from '@toolbox-web/grid/plugins/editing';\n// Import plugin types and the two plugins always needed for Angular template integration\nimport type {\n ClipboardConfig,\n ColumnMoveDetail,\n ColumnVirtualizationConfig,\n ColumnVisibilityDetail,\n ContextMenuConfig,\n CopyDetail,\n DetailExpandDetail,\n ExportCompleteDetail,\n ExportConfig,\n FilterChangeDetail,\n FilterConfig,\n GroupingColumnsConfig,\n GroupingRowsConfig,\n GroupToggleDetail,\n MasterDetailConfig,\n MasterDetailPlugin,\n MultiSortConfig,\n PasteDetail,\n PinnedRowsConfig,\n PivotConfig,\n PrintCompleteDetail,\n PrintConfig,\n PrintStartDetail,\n ReorderConfig,\n ResponsiveChangeDetail,\n ResponsivePlugin,\n ResponsivePluginConfig,\n RowMoveDetail,\n RowReorderConfig,\n SelectionChangeDetail,\n SelectionConfig,\n ServerSideConfig,\n TreeConfig,\n TreeExpandDetail,\n UndoRedoConfig,\n UndoRedoDetail,\n VisibilityConfig,\n} from '@toolbox-web/grid/all';\nimport type { AngularGridConfig } from '../angular-column-config';\nimport { AngularGridAdapter } from '../angular-grid-adapter';\nimport { createPluginFromFeature, type FeatureName } from '../feature-registry';\nimport { GridIconRegistry } from '../grid-icon-registry';\n\n/**\n * Event detail for cell commit events.\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 */\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, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n * import { Grid } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-root',\n * imports: [Grid],\n * schemas: [CUSTOM_ELEMENTS_SCHEMA],\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 an AngularGridAdapter instance\n * - Registers it with the GridElement\n * - Injects custom styles into the grid\n * - Handles cleanup on destruction\n */\n@Directive({ selector: '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: AngularGridAdapter | null = null;\n\n constructor() {\n // Effect to process angularConfig and apply to grid\n // This merges feature input plugins with the user's config plugins\n effect(() => {\n const config = this.angularConfig();\n if (!this.adapter) return;\n\n // Process the config to convert component classes to actual renderer/editor functions\n const processedConfig = config ? this.adapter.processGridConfig(config) : {};\n\n // Create plugins from feature inputs and merge with config plugins\n const featurePlugins = this.createFeaturePlugins();\n const configPlugins = processedConfig.plugins || [];\n\n // Merge: feature plugins first, then config plugins\n const mergedPlugins = [...featurePlugins, ...configPlugins];\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 // Merge icon overrides from registry with any existing icons in config\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 = processedConfig?.icons || config?.icons || {};\n coreConfigOverrides['icons'] = { ...registryIcons, ...existingIcons };\n }\n\n // Apply to the grid element\n const grid = this.elementRef.nativeElement;\n grid.gridConfig = {\n ...processedConfig,\n ...coreConfigOverrides,\n plugins: mergedPlugins.length > 0 ? mergedPlugins : undefined,\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\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 * Angular-specific grid configuration that supports component classes for renderers/editors.\n *\n * Use this input when you want to specify Angular component classes directly in column configs.\n * Components must implement the appropriate interfaces:\n * - Renderers: `AngularCellRenderer<TRow, TValue>` - requires `value()` and `row()` signal inputs\n * - Editors: `AngularCellEditor<TRow, TValue>` - adds `commit` and `cancel` outputs\n *\n * The directive automatically processes component classes and converts them to grid-compatible\n * renderer/editor functions before applying to the grid.\n *\n * @example\n * ```typescript\n * // Component that implements AngularCellEditor\n * @Component({...})\n * export class BonusEditorComponent implements AngularCellEditor<Employee, number> {\n * value = input.required<number>();\n * row = input.required<Employee>();\n * commit = output<number>();\n * cancel = output<void>();\n * }\n *\n * // In your grid config\n * config: AngularGridConfig<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 [angularConfig]=\"config\" [rows]=\"employees\"></tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n angularConfig = input<AngularGridConfig<any>>();\n\n // ═══════════════════════════════════════════════════════════════════════════\n // FEATURE INPUTS - Declarative plugin configuration\n // ═══════════════════════════════════════════════════════════════════════════\n\n /**\n * Enable cell/row/range selection.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/selection';\n * ```\n *\n * @example\n * ```html\n * <!-- Shorthand - just the mode -->\n * <tbw-grid [selection]=\"'range'\" />\n *\n * <!-- Full config object -->\n * <tbw-grid [selection]=\"{ mode: 'range', checkbox: true }\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n selection = input<'cell' | 'row' | 'range' | SelectionConfig<any>>();\n\n /**\n * Enable inline cell editing.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/editing';\n * ```\n *\n * @example\n * ```html\n * <!-- Enable with default trigger (dblclick) -->\n * <tbw-grid [editing]=\"true\" />\n *\n * <!-- Specify trigger -->\n * <tbw-grid [editing]=\"'click'\" />\n * <tbw-grid [editing]=\"'dblclick'\" />\n * <tbw-grid [editing]=\"'manual'\" />\n * ```\n */\n editing = input<boolean | 'click' | 'dblclick' | 'manual'>();\n\n /**\n * Enable clipboard copy/paste. Requires selection to be enabled.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/clipboard';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [selection]=\"'range'\" [clipboard]=\"true\" />\n * ```\n */\n clipboard = input<boolean | ClipboardConfig>();\n\n /**\n * Enable right-click context menu.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/context-menu';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [contextMenu]=\"true\" />\n * ```\n */\n contextMenu = input<boolean | ContextMenuConfig>();\n\n /**\n * Enable multi-column sorting.\n *\n * Multi-sort allows users to sort by multiple columns simultaneously.\n * For basic single-column sorting, columns with `sortable: true` work without this plugin.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/multi-sort';\n * ```\n *\n * @example\n * ```html\n * <!-- Enable multi-column sorting -->\n * <tbw-grid [multiSort]=\"true\" />\n *\n * <!-- Limit to single column (uses plugin but restricts to 1 column) -->\n * <tbw-grid [multiSort]=\"'single'\" />\n *\n * <!-- Full config -->\n * <tbw-grid [multiSort]=\"{ maxSortColumns: 3 }\" />\n * ```\n */\n multiSort = input<boolean | 'single' | 'multi' | MultiSortConfig>();\n\n /**\n * @deprecated Use `[multiSort]` instead. Will be removed in a future version.\n *\n * Enable column sorting. This is an alias for `[multiSort]`.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/multi-sort';\n * ```\n */\n sorting = input<boolean | 'single' | 'multi' | MultiSortConfig>();\n\n /**\n * Enable column filtering.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/filtering';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [filtering]=\"true\" />\n * <tbw-grid [filtering]=\"{ debounceMs: 200 }\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n filtering = input<boolean | FilterConfig<any>>();\n\n /**\n * Enable column drag-to-reorder.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/reorder';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [reorder]=\"true\" />\n * ```\n */\n reorder = input<boolean | ReorderConfig>();\n\n /**\n * Enable column visibility toggle panel.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/visibility';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [visibility]=\"true\" />\n * ```\n */\n visibility = input<boolean | VisibilityConfig>();\n\n /**\n * Enable pinned/sticky columns.\n * Columns are pinned via the `sticky` column property.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pinned-columns';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [pinnedColumns]=\"true\" [columns]=\"[\n * { field: 'id', sticky: 'left' },\n * { field: 'name' },\n * { field: 'actions', sticky: 'right' }\n * ]\" />\n * ```\n */\n pinnedColumns = input<boolean>();\n\n /**\n * Enable multi-level column headers (column groups).\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-columns';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [groupingColumns]=\"{ columnGroups: [...] }\" />\n * ```\n */\n groupingColumns = input<boolean | GroupingColumnsConfig>();\n\n /**\n * Enable horizontal column virtualization for wide grids.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/column-virtualization';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [columnVirtualization]=\"true\" />\n * ```\n */\n columnVirtualization = input<boolean | ColumnVirtualizationConfig>();\n\n /**\n * Enable row drag-to-reorder.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/row-reorder';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [rowReorder]=\"true\" />\n * ```\n */\n rowReorder = input<boolean | RowReorderConfig>();\n\n /**\n * Enable row grouping by field values.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-rows';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [groupingRows]=\"{ groupBy: ['department'] }\" />\n * ```\n */\n groupingRows = input<GroupingRowsConfig>();\n\n /**\n * Enable pinned rows (aggregation/status bar).\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pinned-rows';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [pinnedRows]=\"{ bottom: [{ type: 'aggregation' }] }\" />\n * ```\n */\n pinnedRows = input<boolean | PinnedRowsConfig>();\n\n /**\n * Enable hierarchical tree view.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/tree';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [tree]=\"{ childrenField: 'children' }\" />\n * ```\n */\n tree = input<boolean | TreeConfig>();\n\n /**\n * Enable master-detail expandable rows.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/master-detail';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [masterDetail]=\"{ detailRenderer: detailFn }\" />\n * ```\n */\n masterDetail = input<MasterDetailConfig>();\n\n /**\n * Enable responsive card layout for narrow viewports.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/responsive';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [responsive]=\"{ breakpoint: 768 }\" />\n * ```\n */\n responsive = input<boolean | ResponsivePluginConfig>();\n\n /**\n * Enable undo/redo for cell edits. Requires editing to be enabled.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/undo-redo';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [editing]=\"'dblclick'\" [undoRedo]=\"true\" />\n * ```\n */\n undoRedo = input<boolean | UndoRedoConfig>();\n\n /**\n * Enable CSV/JSON export functionality.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/export';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [export]=\"true\" />\n * <tbw-grid [export]=\"{ filename: 'data.csv' }\" />\n * ```\n */\n exportFeature = input<boolean | ExportConfig>();\n\n /**\n * Enable print functionality.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/print';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [print]=\"true\" />\n * ```\n */\n print = input<boolean | PrintConfig>();\n\n /**\n * Enable pivot table functionality.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pivot';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [pivot]=\"{ rowFields: ['category'], valueField: 'sales' }\" />\n * ```\n */\n pivot = input<PivotConfig>();\n\n /**\n * Enable server-side data operations.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/server-side';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [serverSide]=\"{ dataSource: fetchDataFn }\" />\n * ```\n */\n serverSide = input<ServerSideConfig>();\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 a cell value is committed (inline editing).\n * Provides the row, field, new value, and change tracking information.\n *\n * @example\n * ```html\n * <tbw-grid (cellCommit)=\"onCellCommit($event)\">...</tbw-grid>\n * ```\n *\n * ```typescript\n * onCellCommit(event: CellCommitEvent) {\n * console.log(`Changed ${event.field} to ${event.value} in row ${event.rowIndex}`);\n * }\n * ```\n */\n cellCommit = output<CellCommitEvent>();\n\n /**\n * Emitted when a row's values are committed (bulk/row editing).\n * Provides the row data and change tracking information.\n *\n * @example\n * ```html\n * <tbw-grid (rowCommit)=\"onRowCommit($event)\">...</tbw-grid>\n * ```\n */\n rowCommit = output<RowCommitEvent>();\n\n /**\n * Emitted when the changed rows are reset.\n *\n * @example\n * ```html\n * <tbw-grid (changedRowsReset)=\"onChangedRowsReset($event)\">...</tbw-grid>\n * ```\n */\n changedRowsReset = output<ChangedRowsResetDetail>();\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 filter values change.\n *\n * @example\n * ```html\n * <tbw-grid (filterChange)=\"onFilterChange($event)\">...</tbw-grid>\n * ```\n */\n filterChange = output<FilterChangeDetail>();\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 is moved via drag-and-drop.\n *\n * @example\n * ```html\n * <tbw-grid (columnMove)=\"onColumnMove($event)\">...</tbw-grid>\n * ```\n */\n columnMove = output<ColumnMoveDetail>();\n\n /**\n * Emitted when column visibility changes.\n *\n * @example\n * ```html\n * <tbw-grid (columnVisibility)=\"onColumnVisibility($event)\">...</tbw-grid>\n * ```\n */\n columnVisibility = output<ColumnVisibilityDetail>();\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 when selection changes.\n *\n * @example\n * ```html\n * <tbw-grid (selectionChange)=\"onSelectionChange($event)\">...</tbw-grid>\n * ```\n */\n selectionChange = output<SelectionChangeDetail>();\n\n /**\n * Emitted when a row is moved via drag-and-drop.\n *\n * @example\n * ```html\n * <tbw-grid (rowMove)=\"onRowMove($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rowMove = output<RowMoveDetail<any>>();\n\n /**\n * Emitted when a group is expanded or collapsed.\n *\n * @example\n * ```html\n * <tbw-grid (groupToggle)=\"onGroupToggle($event)\">...</tbw-grid>\n * ```\n */\n groupToggle = output<GroupToggleDetail>();\n\n /**\n * Emitted when a tree node is expanded.\n *\n * @example\n * ```html\n * <tbw-grid (treeExpand)=\"onTreeExpand($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n treeExpand = output<TreeExpandDetail<any>>();\n\n /**\n * Emitted when a detail panel is expanded or collapsed.\n *\n * @example\n * ```html\n * <tbw-grid (detailExpand)=\"onDetailExpand($event)\">...</tbw-grid>\n * ```\n */\n detailExpand = output<DetailExpandDetail>();\n\n /**\n * Emitted when responsive mode changes (table ↔ card).\n *\n * @example\n * ```html\n * <tbw-grid (responsiveChange)=\"onResponsiveChange($event)\">...</tbw-grid>\n * ```\n */\n responsiveChange = output<ResponsiveChangeDetail>();\n\n /**\n * Emitted when cells are copied to clipboard.\n *\n * @example\n * ```html\n * <tbw-grid (copy)=\"onCopy($event)\">...</tbw-grid>\n * ```\n */\n copy = output<CopyDetail>();\n\n /**\n * Emitted when cells are pasted from clipboard.\n *\n * @example\n * ```html\n * <tbw-grid (paste)=\"onPaste($event)\">...</tbw-grid>\n * ```\n */\n paste = output<PasteDetail>();\n\n /**\n * Emitted when undo/redo is performed.\n *\n * @example\n * ```html\n * <tbw-grid (undoRedoAction)=\"onUndoRedo($event)\">...</tbw-grid>\n * ```\n */\n undoRedoAction = output<UndoRedoDetail>();\n\n /**\n * Emitted when export completes.\n *\n * @example\n * ```html\n * <tbw-grid (exportComplete)=\"onExportComplete($event)\">...</tbw-grid>\n * ```\n */\n exportComplete = output<ExportCompleteDetail>();\n\n /**\n * Emitted when print starts.\n *\n * @example\n * ```html\n * <tbw-grid (printStart)=\"onPrintStart($event)\">...</tbw-grid>\n * ```\n */\n printStart = output<PrintStartDetail>();\n\n /**\n * Emitted when print completes.\n *\n * @example\n * ```html\n * <tbw-grid (printComplete)=\"onPrintComplete($event)\">...</tbw-grid>\n * ```\n */\n printComplete = output<PrintCompleteDetail>();\n\n // Map of output names to event names for automatic wiring\n private readonly eventOutputMap = {\n cellClick: 'cell-click',\n rowClick: 'row-click',\n cellActivate: 'cell-activate',\n cellChange: 'cell-change',\n cellCommit: 'cell-commit',\n rowCommit: 'row-commit',\n changedRowsReset: 'changed-rows-reset',\n sortChange: 'sort-change',\n filterChange: 'filter-change',\n columnResize: 'column-resize',\n columnMove: 'column-move',\n columnVisibility: 'column-visibility',\n columnStateChange: 'column-state-change',\n selectionChange: 'selection-change',\n rowMove: 'row-move',\n groupToggle: 'group-toggle',\n treeExpand: 'tree-expand',\n detailExpand: 'detail-expand',\n responsiveChange: 'responsive-change',\n copy: 'copy',\n paste: 'paste',\n undoRedoAction: 'undo-redo',\n exportComplete: 'export-complete',\n printStart: 'print-start',\n printComplete: 'print-complete',\n } as const;\n\n // Store event listeners for cleanup\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private eventListeners: Map<string, (e: Event) => void> = new Map();\n\n ngOnInit(): void {\n // Create and register the adapter\n this.adapter = new AngularGridAdapter(this.injector, this.appRef, this.viewContainerRef);\n GridElementClass.registerAdapter(this.adapter);\n\n const grid = this.elementRef.nativeElement;\n\n // Wire up all event listeners based on eventOutputMap\n this.setupEventListeners(grid);\n\n // Register adapter on the grid element so MasterDetailPlugin can use it\n // 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\n /**\n * Sets up event listeners for all outputs using the eventOutputMap.\n */\n private setupEventListeners(grid: GridElement): void {\n // Wire up all event listeners\n for (const [outputName, eventName] of Object.entries(this.eventOutputMap)) {\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 feature inputs.\n * Uses the feature registry to allow tree-shaking - only imported features are bundled.\n * Returns the array of created plugins (doesn't modify grid).\n */\n private createFeaturePlugins(): unknown[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const plugins: unknown[] = [];\n\n // Helper to add plugin if feature is registered\n const addPlugin = (name: FeatureName, config: unknown) => {\n if (config === undefined || config === null || config === false) return;\n const plugin = createPluginFromFeature(name, config);\n if (plugin) plugins.push(plugin);\n };\n\n // Add plugins for each feature input\n addPlugin('selection', this.selection());\n addPlugin('editing', this.editing());\n addPlugin('clipboard', this.clipboard());\n addPlugin('contextMenu', this.contextMenu());\n // multiSort is the primary input; sorting is a deprecated alias\n addPlugin('multiSort', this.multiSort() ?? this.sorting());\n addPlugin('filtering', this.filtering());\n addPlugin('reorder', this.reorder());\n addPlugin('visibility', this.visibility());\n addPlugin('pinnedColumns', this.pinnedColumns());\n addPlugin('groupingColumns', this.groupingColumns());\n addPlugin('columnVirtualization', this.columnVirtualization());\n addPlugin('rowReorder', this.rowReorder());\n addPlugin('groupingRows', this.groupingRows());\n addPlugin('pinnedRows', this.pinnedRows());\n addPlugin('tree', this.tree());\n addPlugin('masterDetail', this.masterDetail());\n addPlugin('responsive', this.responsive());\n addPlugin('undoRedo', this.undoRedo());\n addPlugin('export', this.exportFeature());\n addPlugin('print', this.print());\n addPlugin('pivot', this.pivot());\n addPlugin('serverSide', this.serverSide());\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 // Configure MasterDetailPlugin after Angular templates are registered\n this.configureMasterDetail(grid);\n\n // Configure ResponsivePlugin card renderer if template is present\n this.configureResponsiveCard(grid);\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 /**\n * Configures the MasterDetailPlugin after Angular templates are registered.\n * - If plugin exists: refresh its detail renderer\n * - If plugin doesn't exist but <tbw-grid-detail> is present: dynamically import and add the plugin\n */\n private async configureMasterDetail(grid: GridElement): Promise<void> {\n if (!this.adapter) return;\n\n // Check for existing plugin by name to avoid importing the class\n const existingPlugin = grid.gridConfig?.plugins?.find((p) => (p as { name?: string }).name === 'masterDetail') as\n | MasterDetailPlugin\n | undefined;\n\n if (existingPlugin && typeof existingPlugin.refreshDetailRenderer === 'function') {\n // Plugin exists - just refresh the renderer to pick up Angular templates\n existingPlugin.refreshDetailRenderer();\n return;\n }\n\n // Check if <tbw-grid-detail> is present in light DOM\n const detailElement = (grid as unknown as Element).querySelector('tbw-grid-detail');\n if (!detailElement) return;\n\n // Create detail renderer from Angular template\n const detailRenderer = this.adapter.createDetailRenderer(grid as unknown as HTMLElement);\n if (!detailRenderer) return;\n\n // Parse configuration from attributes\n const animationAttr = detailElement.getAttribute('animation');\n let animation: 'slide' | 'fade' | false = 'slide';\n if (animationAttr === 'false') {\n animation = false;\n } else if (animationAttr === 'fade') {\n animation = 'fade';\n }\n\n const showExpandColumn = detailElement.getAttribute('showExpandColumn') !== 'false';\n\n // Dynamically import the plugin to avoid bundling it when not used\n const { MasterDetailPlugin } = await import('@toolbox-web/grid/plugins/master-detail');\n\n // Create and add the plugin\n const plugin = new MasterDetailPlugin({\n detailRenderer: detailRenderer,\n showExpandColumn,\n animation,\n });\n\n const currentConfig = grid.gridConfig || {};\n const existingPlugins = currentConfig.plugins || [];\n grid.gridConfig = {\n ...currentConfig,\n plugins: [...existingPlugins, plugin],\n };\n }\n\n /**\n * Configures the ResponsivePlugin with Angular template-based card renderer.\n * - If plugin exists: updates its cardRenderer configuration\n * - If plugin doesn't exist but <tbw-grid-responsive-card> is present: logs a warning\n */\n private configureResponsiveCard(grid: GridElement): void {\n if (!this.adapter) return;\n\n // Check if <tbw-grid-responsive-card> is present in light DOM\n const cardElement = (grid as unknown as Element).querySelector('tbw-grid-responsive-card');\n if (!cardElement) return;\n\n // Create card renderer from Angular template\n const cardRenderer = this.adapter.createResponsiveCardRenderer(grid as unknown as HTMLElement);\n if (!cardRenderer) return;\n\n // Find existing plugin by name to avoid importing the class\n const existingPlugin = grid.gridConfig?.plugins?.find((p) => (p as { name?: string }).name === 'responsive') as\n | ResponsivePlugin\n | undefined;\n\n if (existingPlugin && typeof existingPlugin.setCardRenderer === 'function') {\n // Plugin exists - update its cardRenderer\n existingPlugin.setCardRenderer(cardRenderer);\n return;\n }\n\n // Plugin doesn't exist - log a warning\n console.warn(\n '[tbw-grid-angular] <tbw-grid-responsive-card> found but ResponsivePlugin is not configured.\\n' +\n 'Add ResponsivePlugin to your gridConfig.plugins array:\\n\\n' +\n ' import { ResponsivePlugin } from \"@toolbox-web/grid/plugins/responsive\";\\n' +\n ' gridConfig = {\\n' +\n ' plugins: [new ResponsivePlugin({ breakpoint: 600 })]\\n' +\n ' };',\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 * @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\nexport { AngularGridAdapter } from './lib/angular-grid-adapter';\n\n// Angular-specific column/grid config types (for component-based renderers/editors)\nexport { isComponentClass } from './lib/angular-column-config';\nexport type {\n AngularCellEditor,\n AngularCellRenderer,\n AngularColumnConfig,\n AngularGridConfig,\n} from './lib/angular-column-config';\n\n// Type registry for application-wide type defaults\nexport { GRID_TYPE_DEFAULTS, GridTypeRegistry, provideGridTypeDefaults } from './lib/grid-type-registry';\nexport type { AngularTypeDefault } 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 { ExportMethods, InjectGridReturn, SelectionMethods } 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// Directives and context types\nexport { BaseGridEditor } from './lib/base-grid-editor';\nexport { GridColumnEditor } from './lib/directives/grid-column-editor.directive';\nexport type { GridEditorContext } from './lib/directives/grid-column-editor.directive';\nexport { GridColumnView } from './lib/directives/grid-column-view.directive';\nexport type { GridCellContext } from './lib/directives/grid-column-view.directive';\nexport { GridDetailView } from './lib/directives/grid-detail-view.directive';\nexport type { GridDetailContext } from './lib/directives/grid-detail-view.directive';\nexport { GridFormArray, getFormArrayContext } from './lib/directives/grid-form-array.directive';\nexport type { FormArrayContext } from './lib/directives/grid-form-array.directive';\nexport { GridResponsiveCard } from './lib/directives/grid-responsive-card.directive';\nexport type { GridResponsiveCardContext } from './lib/directives/grid-responsive-card.directive';\nexport { GridToolPanel } from './lib/directives/grid-tool-panel.directive';\nexport type { GridToolPanelContext } from './lib/directives/grid-tool-panel.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\nexport { TbwEditor, TbwRenderer } from './lib/directives/structural-directives';\nexport type { StructuralCellContext, StructuralEditorContext } from './lib/directives/structural-directives';\n\n// Backwards compatibility aliases (deprecated)\nexport { TbwEditor as TbwCellEditor, TbwRenderer as TbwCellView } from './lib/directives/structural-directives';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["GridElementClass"],"mappings":";;;;;AA4HA;;;;;;;;;AASG;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;;AC9FA;AACA,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAA+C;AAErF;;;AAGG;AACG,SAAU,iBAAiB,CAAC,OAAoB,EAAA;AACpD,IAAA,OAAO,sBAAsB,CAAC,GAAG,CAAC,OAAO,CAAC;AAC5C;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;MAEU,gBAAgB,CAAA;AACnB,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAEpD;;AAEG;AACH,IAAA,QAAQ,GAAG,YAAY,EAAC,WAA8B,qDAAC;;AAG/C,IAAA,kBAAkB,GAAG,MAAM,CAAC,MAAK;AACvC,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE;QAChC,IAAI,QAAQ,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AAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA,OAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,YAAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAJ,IAAI,EAAA,UAAA,EAAA,CAAA;kBADhB,SAAS;mBAAC,EAAE,QAAQ,EAAE,UAAU,EAAE;;;AC/InC;;;;;AAKG;;ACLH;;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-editor.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-column-view.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-detail-view.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-form-array.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-responsive-card.directive.ts","../../../../libs/grid-angular/src/lib/directives/grid-tool-panel.directive.ts","../../../../libs/grid-angular/src/lib/directives/structural-directives.ts","../../../../libs/grid-angular/src/lib/grid-type-registry.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/feature-registry.ts","../../../../libs/grid-angular/src/lib/base-grid-editor.ts","../../../../libs/grid-angular/src/lib/directives/grid.directive.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, GridConfig } from '@toolbox-web/grid';\n\n/**\n * Interface for Angular 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 { AngularCellRenderer } 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 AngularCellRenderer<Employee, string> {\n * value = input.required<string>();\n * row = input.required<Employee>();\n * column = input<unknown>();\n * }\n * ```\n */\nexport interface AngularCellRenderer<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/**\n * Interface for Angular 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 { AngularCellEditor } 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 AngularCellEditor<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 */\nexport interface AngularCellEditor<TRow = unknown, TValue = unknown> extends AngularCellRenderer<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/**\n * Angular-specific column configuration.\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 { AngularColumnConfig } from '@toolbox-web/grid-angular';\n * import { StatusBadgeComponent, StatusEditorComponent } from './components';\n *\n * const columns: AngularColumnConfig<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 */\nexport interface AngularColumnConfig<TRow = unknown> extends Omit<ColumnConfig<TRow>, 'renderer' | 'editor'> {\n /**\n * Cell renderer - can be:\n * - A function `(ctx) => HTMLElement | string`\n * - An Angular component class implementing AngularCellRenderer\n */\n renderer?: ColumnConfig<TRow>['renderer'] | Type<AngularCellRenderer<TRow, unknown>>;\n\n /**\n * Cell editor - can be:\n * - A function `(ctx) => HTMLElement`\n * - An Angular component class implementing AngularCellEditor\n */\n editor?: ColumnConfig<TRow>['editor'] | Type<AngularCellEditor<TRow, unknown>>;\n}\n\n/**\n * Angular-specific type default configuration.\n *\n * Extends the base TypeDefault to allow Angular component classes\n * for renderers and editors in typeDefaults.\n *\n * @example\n * ```typescript\n * const config: AngularGridConfig<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 */\nexport interface AngularTypeDefault<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?: ColumnConfig<TRow>['renderer'] | Type<AngularCellRenderer<TRow, unknown>>;\n /** Cell editor - can be vanilla JS function or Angular component */\n editor?: ColumnConfig<TRow>['editor'] | Type<AngularCellEditor<TRow, unknown>>;\n /** Default editor parameters */\n editorParams?: Record<string, unknown>;\n}\n\n/**\n * Angular-specific grid configuration.\n *\n * Extends the base GridConfig to use AngularColumnConfig and AngularTypeDefault.\n */\nexport interface AngularGridConfig<TRow = unknown> extends Omit<GridConfig<TRow>, 'columns' | 'typeDefaults'> {\n columns?: AngularColumnConfig<TRow>[];\n /** Type-level defaults that can use Angular component classes */\n typeDefaults?: Record<string, AngularTypeDefault<TRow>>;\n}\n\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 */\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","import { contentChild, Directive, effect, ElementRef, EventEmitter, inject, TemplateRef } from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\n\n/**\n * Context object passed to the cell editor template.\n * Contains the cell value, row data, column configuration, and commit/cancel functions.\n */\nexport interface GridEditorContext<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 * Callback function to commit the edited value.\n * Use with Angular event binding: `(commit)=\"onCommit($event)\"`\n */\n onCommit: (value: TValue) => void;\n /**\n * Callback function to cancel editing.\n * Use with Angular event binding: `(cancel)=\"onCancel()\"`\n */\n onCancel: () => void;\n /**\n * The FormControl for this cell, if the grid is bound to a FormArray with FormGroups.\n *\n * This allows custom editors to bind directly to the control for validation display:\n * ```html\n * <input *tbwEditor=\"let value; control as ctrl\"\n * [formControl]=\"ctrl\"\n * [class.is-invalid]=\"ctrl?.invalid && ctrl?.touched\" />\n * ```\n *\n * Returns `undefined` if:\n * - The grid is not bound to a FormArray\n * - The FormArray doesn't contain FormGroups\n * - The field doesn't exist in the FormGroup\n */\n control?: AbstractControl;\n /**\n * @deprecated Use `onCommit` callback function instead. Will be removed in v2.0.\n * EventEmitter for commit - requires `.emit()` call.\n */\n commit: EventEmitter<TValue>;\n /**\n * @deprecated Use `onCancel` callback function instead. Will be removed in v2.0.\n * EventEmitter for cancel - requires `.emit()` call.\n */\n cancel: EventEmitter<void>;\n}\n\n// Global registry mapping DOM elements to their templates\nconst editorTemplateRegistry = new Map<HTMLElement, TemplateRef<GridEditorContext>>();\n\n/**\n * Gets the editor template registered for a given element.\n * Used by AngularGridAdapter to retrieve templates at render time.\n */\nexport function getEditorTemplate(element: HTMLElement): TemplateRef<GridEditorContext> | undefined {\n return editorTemplateRegistry.get(element);\n}\n\n/**\n * Directive that captures an `<ng-template>` for use as a cell editor.\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\" editable>\n * <tbw-grid-column-editor>\n * <ng-template let-value let-row=\"row\" let-onCommit=\"onCommit\" let-onCancel=\"onCancel\">\n * <app-status-select\n * [value]=\"value\"\n * [row]=\"row\"\n * (commit)=\"onCommit($event)\"\n * (cancel)=\"onCancel()\"\n * />\n * </ng-template>\n * </tbw-grid-column-editor>\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 * - `onCommit`: Callback function to commit the new value\n * - `onCancel`: Callback function to cancel editing\n *\n * Import the directive in your component:\n *\n * ```typescript\n * import { GridColumnEditor } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [GridColumnEditor],\n * // ...\n * })\n * ```\n */\n@Directive({ selector: 'tbw-grid-column-editor' })\nexport class GridColumnEditor {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * Query for the ng-template content child.\n */\n template = contentChild(TemplateRef<GridEditorContext>);\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 editorTemplateRegistry.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: GridColumnEditor, ctx: unknown): ctx is GridEditorContext {\n return true;\n }\n}\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 */\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@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 { contentChild, Directive, effect, ElementRef, inject, input, TemplateRef } from '@angular/core';\nimport type { ExpandCollapseAnimation } from '@toolbox-web/grid';\n\n/**\n * Context object passed to the detail renderer template.\n * Contains the row data for the expanded detail view.\n */\nexport interface GridDetailContext<TRow = unknown> {\n /** The row data (implicit binding for let-row) */\n $implicit: TRow;\n /** The row data (explicit binding) */\n row: TRow;\n}\n\n// Global registry mapping DOM elements to their templates\nconst detailTemplateRegistry = new Map<HTMLElement, TemplateRef<GridDetailContext>>();\n\n/**\n * Gets the detail template registered for a given grid element.\n * Used by AngularGridAdapter to retrieve templates at render time.\n */\nexport function getDetailTemplate(gridElement: HTMLElement): TemplateRef<GridDetailContext> | undefined {\n // Look for tbw-grid-detail child and get its template\n const detailElement = gridElement.querySelector('tbw-grid-detail');\n if (detailElement) {\n return detailTemplateRegistry.get(detailElement as HTMLElement);\n }\n return undefined;\n}\n\n/**\n * Gets the configuration for the detail view.\n */\nexport function getDetailConfig(\n gridElement: HTMLElement,\n): { showExpandColumn?: boolean; animation?: ExpandCollapseAnimation } | undefined {\n const detailElement = gridElement.querySelector('tbw-grid-detail');\n if (detailElement) {\n const animationAttr = detailElement.getAttribute('animation');\n let animation: ExpandCollapseAnimation = 'slide';\n if (animationAttr === 'false') {\n animation = false;\n } else if (animationAttr === 'fade') {\n animation = 'fade';\n }\n return {\n showExpandColumn: detailElement.getAttribute('showExpandColumn') !== 'false',\n animation,\n };\n }\n return undefined;\n}\n\n/**\n * Directive that captures an `<ng-template>` for use as a master-detail row renderer.\n *\n * This enables declarative Angular component usage for expandable detail rows\n * that appear below the main row when expanded.\n *\n * ## Usage\n *\n * ```html\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-detail [showExpandColumn]=\"true\" animation=\"slide\">\n * <ng-template let-row>\n * <app-detail-panel [employee]=\"row\" />\n * </ng-template>\n * </tbw-grid-detail>\n * </tbw-grid>\n * ```\n *\n * The template context provides:\n * - `$implicit` / `row`: The full row data object\n *\n * Import the directive in your component:\n *\n * ```typescript\n * import { GridDetailView } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [GridDetailView],\n * // ...\n * })\n * ```\n */\n@Directive({ selector: 'tbw-grid-detail' })\nexport class GridDetailView {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /** Whether to show the expand/collapse column. Default: true */\n showExpandColumn = input<boolean>(true);\n\n /** Animation style for expand/collapse. Default: 'slide' */\n animation = input<ExpandCollapseAnimation>('slide');\n\n /**\n * Query for the ng-template content child.\n */\n template = contentChild(TemplateRef<GridDetailContext>);\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 detailTemplateRegistry.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: GridDetailView, ctx: unknown): ctx is GridDetailContext {\n return true;\n }\n}\n","import { DestroyRef, Directive, effect, ElementRef, inject, input, OnDestroy, OnInit } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { AbstractControl, FormArray, FormGroup } from '@angular/forms';\nimport type { BaseGridPlugin, DataGridElement as GridElement } from '@toolbox-web/grid';\nimport { Subscription } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\n\n/**\n * Interface for EditingPlugin validation methods.\n * We use a minimal interface to avoid importing the full EditingPlugin class.\n */\ninterface EditingPluginValidation {\n setInvalid(rowId: string, field: string, message?: string): void;\n clearInvalid(rowId: string, field: string): void;\n clearRowInvalid(rowId: string): void;\n}\n\n/**\n * Context provided to the grid containing form-related information.\n * This can be accessed by other directives to get form controls.\n */\nexport interface FormArrayContext {\n /** Get the row data at a specific index */\n getRow<T = unknown>(rowIndex: number): T | null;\n /** Update a field value at a specific row */\n updateField(rowIndex: number, field: string, value: unknown): void;\n /** Get the current form value (all rows) */\n getValue<T = unknown>(): T[];\n /**\n * Get the FormControl for a specific cell.\n * Only available when using FormArray with FormGroup rows.\n *\n * @param rowIndex - The row index\n * @param field - The field name\n * @returns The AbstractControl for the cell, or undefined if not available\n */\n getControl(rowIndex: number, field: string): AbstractControl | undefined;\n /**\n * Whether the grid is backed by a FormArray of FormGroups.\n * When true, `getControl()` will return cell-level controls.\n */\n hasFormGroups: boolean;\n /**\n * Get the FormGroup for a specific row.\n * Only available when using FormArray with FormGroup rows.\n *\n * @param rowIndex - The row index\n * @returns The FormGroup for the row, or undefined if not available\n */\n getRowFormGroup(rowIndex: number): FormGroup | undefined;\n /**\n * Check if a row is valid (all controls in the FormGroup are valid).\n * Returns true if not using FormArray or if the row doesn't exist.\n *\n * @param rowIndex - The row index\n * @returns true if the row is valid, false if any control is invalid\n */\n isRowValid(rowIndex: number): boolean;\n /**\n * Check if a row has been touched (any control in the FormGroup is touched).\n * Returns false if not using FormArray or if the row doesn't exist.\n *\n * @param rowIndex - The row index\n * @returns true if any control in the row is touched\n */\n isRowTouched(rowIndex: number): boolean;\n /**\n * Check if a row is dirty (any control in the FormGroup is dirty).\n * Returns false if not using FormArray or if the row doesn't exist.\n *\n * @param rowIndex - The row index\n * @returns true if any control in the row is dirty\n */\n isRowDirty(rowIndex: number): boolean;\n /**\n * Get validation errors for a specific row.\n * Aggregates errors from all controls in the FormGroup.\n *\n * @param rowIndex - The row index\n * @returns Object with field names as keys and their errors, or null if no errors\n */\n getRowErrors(rowIndex: number): Record<string, unknown> | null;\n}\n\n// Symbol for storing form context on the grid element\nconst FORM_ARRAY_CONTEXT = Symbol('formArrayContext');\n\n/**\n * Gets the FormArrayContext from a grid element, if present.\n * @internal\n */\nexport function getFormArrayContext(gridElement: HTMLElement): FormArrayContext | undefined {\n return (gridElement as unknown as Record<symbol, FormArrayContext>)[FORM_ARRAY_CONTEXT];\n}\n\n/**\n * Directive that binds a FormArray directly to the grid.\n *\n * This is the recommended way to integrate tbw-grid with Angular Reactive Forms.\n * Use a FormArray of FormGroups for row-level validation and cell-level control access.\n *\n * ## Usage\n *\n * ```typescript\n * import { Component, inject } from '@angular/core';\n * import { FormBuilder, ReactiveFormsModule } from '@angular/forms';\n * import { Grid, GridFormArray } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [Grid, GridFormArray, ReactiveFormsModule],\n * template: \\`\n * <form [formGroup]=\"form\">\n * <tbw-grid [formArray]=\"form.controls.rows\" [columns]=\"columns\" />\n * </form>\n * \\`\n * })\n * export class MyComponent {\n * private fb = inject(FormBuilder);\n *\n * form = this.fb.group({\n * rows: this.fb.array([\n * this.fb.group({ name: 'Alice', age: 30 }),\n * this.fb.group({ name: 'Bob', age: 25 }),\n * ])\n * });\n *\n * columns = [\n * { field: 'name', header: 'Name', editable: true },\n * { field: 'age', header: 'Age', editable: true }\n * ];\n * }\n * ```\n *\n * ## How It Works\n *\n * - **FormArray → Grid**: The grid displays the FormArray's value as rows\n * - **Grid → FormArray**: When a cell is edited, the corresponding FormControl is updated\n * - FormArrayContext is available for accessing cell-level controls\n *\n * ## Features\n *\n * - Works naturally with FormArray inside a FormGroup\n * - Provides cell-level FormControl access for validation\n * - Supports row-level validation state aggregation\n * - Automatically syncs FormArray changes to the grid\n */\n@Directive({\n selector: 'tbw-grid[formArray]',\n})\nexport class GridFormArray implements OnInit, OnDestroy {\n private readonly destroyRef = inject(DestroyRef);\n private elementRef = inject(ElementRef<GridElement>);\n private cellCommitListener: ((e: Event) => void) | null = null;\n private rowCommitListener: ((e: Event) => void) | null = null;\n private touchListener: ((e: Event) => void) | null = null;\n private valueChangesSubscription: Subscription | null = null;\n\n /**\n * The FormArray to bind to the grid.\n */\n readonly formArray = input.required<FormArray>();\n\n /**\n * Whether to automatically sync Angular validation state to grid's visual invalid styling.\n *\n * When enabled:\n * - After a cell commit, if the FormControl is invalid, the cell is marked with `setInvalid()`\n * - When a FormControl becomes valid, `clearInvalid()` is called\n * - On `row-commit`, if the row's FormGroup has invalid controls, the commit is prevented\n *\n * @default true\n */\n readonly syncValidation = input<boolean>(true);\n\n /**\n * Effect that sets up valueChanges subscription when FormArray changes.\n * This handles both initial binding and when the FormArray reference changes.\n */\n private syncFormArrayToGrid = effect(() => {\n const formArray = this.formArray();\n const grid = this.elementRef.nativeElement;\n if (!grid || !formArray) return;\n\n // Unsubscribe from previous FormArray if any\n this.valueChangesSubscription?.unsubscribe();\n\n // Subscribe to valueChanges to sync grid rows when FormArray content changes.\n // Use startWith to immediately sync the current value.\n // Note: We use getRawValue() to include disabled controls.\n this.valueChangesSubscription = formArray.valueChanges\n .pipe(startWith(formArray.getRawValue()), takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n grid.rows = formArray.getRawValue();\n });\n });\n\n ngOnInit(): void {\n const grid = this.elementRef.nativeElement;\n if (!grid) return;\n\n // Store the form context on the grid element for other directives to access\n this.#storeFormContext(grid);\n\n // Intercept cell-commit events to update the FormArray\n this.cellCommitListener = (e: Event) => {\n const detail = (e as CustomEvent).detail;\n this.#handleCellCommit(detail);\n };\n grid.addEventListener('cell-commit', this.cellCommitListener);\n\n // Intercept row-commit events to prevent if FormGroup is invalid\n this.rowCommitListener = (e: Event) => {\n if (!this.syncValidation()) return;\n const detail = (e as CustomEvent).detail as { rowIndex: number };\n this.#handleRowCommit(e, detail);\n };\n grid.addEventListener('row-commit', this.rowCommitListener);\n\n // Mark FormArray as touched on first interaction\n this.touchListener = () => {\n this.formArray().markAsTouched();\n // Remove after first touch\n if (this.touchListener) {\n grid.removeEventListener('click', this.touchListener);\n this.touchListener = null;\n }\n };\n grid.addEventListener('click', this.touchListener);\n }\n\n ngOnDestroy(): void {\n const grid = this.elementRef.nativeElement;\n if (!grid) return;\n\n if (this.cellCommitListener) {\n grid.removeEventListener('cell-commit', this.cellCommitListener);\n }\n if (this.rowCommitListener) {\n grid.removeEventListener('row-commit', this.rowCommitListener);\n }\n if (this.touchListener) {\n grid.removeEventListener('click', this.touchListener);\n }\n if (this.valueChangesSubscription) {\n this.valueChangesSubscription.unsubscribe();\n }\n\n this.#clearFormContext(grid);\n }\n\n /**\n * Checks if the FormArray contains FormGroups.\n */\n #isFormArrayOfFormGroups(): boolean {\n const formArray = this.formArray();\n if (formArray.length === 0) return false;\n return formArray.at(0) instanceof FormGroup;\n }\n\n /**\n * Gets the FormGroup at a specific row index.\n */\n #getRowFormGroup(rowIndex: number): FormGroup | undefined {\n const formArray = this.formArray();\n const rowControl = formArray.at(rowIndex);\n return rowControl instanceof FormGroup ? rowControl : undefined;\n }\n\n /**\n * Stores the FormArrayContext on the grid element.\n */\n #storeFormContext(grid: GridElement): void {\n const getRowFormGroup = (rowIndex: number) => this.#getRowFormGroup(rowIndex);\n\n const context: FormArrayContext = {\n getRow: <T>(rowIndex: number): T | null => {\n const formArray = this.formArray();\n const rowControl = formArray.at(rowIndex);\n return rowControl ? (rowControl.value as T) : null;\n },\n updateField: (rowIndex: number, field: string, value: unknown) => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (rowFormGroup) {\n const control = rowFormGroup.get(field);\n if (control) {\n control.setValue(value);\n control.markAsDirty();\n }\n }\n },\n getValue: <T>(): T[] => {\n return this.formArray().getRawValue() as T[];\n },\n hasFormGroups: this.#isFormArrayOfFormGroups(),\n getControl: (rowIndex: number, field: string): AbstractControl | undefined => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return undefined;\n return rowFormGroup.get(field) ?? undefined;\n },\n getRowFormGroup,\n isRowValid: (rowIndex: number): boolean => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return true;\n return rowFormGroup.valid;\n },\n isRowTouched: (rowIndex: number): boolean => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return false;\n return rowFormGroup.touched;\n },\n isRowDirty: (rowIndex: number): boolean => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return false;\n return rowFormGroup.dirty;\n },\n getRowErrors: (rowIndex: number): Record<string, unknown> | null => {\n const rowFormGroup = getRowFormGroup(rowIndex);\n if (!rowFormGroup) return null;\n\n const errors: Record<string, unknown> = {};\n let hasErrors = false;\n\n Object.keys(rowFormGroup.controls).forEach((field) => {\n const control = rowFormGroup.get(field);\n if (control?.errors) {\n errors[field] = control.errors;\n hasErrors = true;\n }\n });\n\n if (rowFormGroup.errors) {\n errors['_group'] = rowFormGroup.errors;\n hasErrors = true;\n }\n\n return hasErrors ? errors : null;\n },\n };\n (grid as unknown as Record<symbol, FormArrayContext>)[FORM_ARRAY_CONTEXT] = context;\n }\n\n /**\n * Clears the FormArrayContext from the grid element.\n */\n #clearFormContext(grid: GridElement): void {\n delete (grid as unknown as Record<symbol, FormArrayContext>)[FORM_ARRAY_CONTEXT];\n }\n\n /**\n * Handles cell-commit events by updating the FormControl in the FormGroup.\n */\n #handleCellCommit(detail: { rowIndex: number; field: string; value: unknown; rowId: string }): void {\n const { rowIndex, field, value, rowId } = detail;\n\n const rowFormGroup = this.#getRowFormGroup(rowIndex);\n if (rowFormGroup) {\n const control = rowFormGroup.get(field);\n if (control) {\n control.setValue(value);\n control.markAsDirty();\n control.markAsTouched();\n\n // Sync Angular validation state to grid's visual invalid styling\n if (this.syncValidation() && rowId) {\n this.#syncControlValidationToGrid(rowId, field, control);\n }\n }\n }\n }\n\n /**\n * Handles row-commit events - prevents commit if FormGroup has invalid controls.\n */\n #handleRowCommit(event: Event, detail: { rowIndex: number }): void {\n const { rowIndex } = detail;\n const rowFormGroup = this.#getRowFormGroup(rowIndex);\n\n if (rowFormGroup && rowFormGroup.invalid) {\n // Prevent row commit if the FormGroup is invalid\n event.preventDefault();\n }\n }\n\n /**\n * Syncs a FormControl's validation state to the grid's visual invalid styling.\n */\n #syncControlValidationToGrid(rowId: string, field: string, control: AbstractControl): void {\n const grid = this.elementRef.nativeElement;\n if (!grid) return;\n\n // Get EditingPlugin via getPluginByName\n const editingPlugin = (grid as unknown as { getPluginByName?: (name: string) => BaseGridPlugin }).getPluginByName?.(\n 'editing',\n ) as EditingPluginValidation | undefined;\n\n if (!editingPlugin) return;\n\n if (control.invalid) {\n // Get first error message to display\n const errorMessage = this.#getFirstErrorMessage(control);\n editingPlugin.setInvalid(rowId, field, errorMessage);\n } else {\n editingPlugin.clearInvalid(rowId, field);\n }\n }\n\n /**\n * Gets a human-readable error message from the first validation error.\n */\n #getFirstErrorMessage(control: AbstractControl): string {\n const errors = control.errors;\n if (!errors) return '';\n\n const firstKey = Object.keys(errors)[0];\n const error = errors[firstKey];\n\n // Common Angular validators\n switch (firstKey) {\n case 'required':\n return 'This field is required';\n case 'minlength':\n return `Minimum length is ${error.requiredLength}`;\n case 'maxlength':\n return `Maximum length is ${error.requiredLength}`;\n case 'min':\n return `Minimum value is ${error.min}`;\n case 'max':\n return `Maximum value is ${error.max}`;\n case 'email':\n return 'Invalid email address';\n case 'pattern':\n return 'Invalid format';\n default:\n // Custom validators may provide a message property\n return typeof error === 'string' ? error : (error?.message ?? `Validation error: ${firstKey}`);\n }\n }\n}\n","import { contentChild, Directive, effect, ElementRef, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context object passed to the responsive card template.\n *\n * @template TRow - The type of row data\n *\n * @example\n * ```html\n * <tbw-grid-responsive-card>\n * <ng-template let-row let-index=\"index\">\n * <div class=\"card-content\">\n * <span>{{ row.name }}</span>\n * <span>Row #{{ index }}</span>\n * </div>\n * </ng-template>\n * </tbw-grid-responsive-card>\n * ```\n */\nexport interface GridResponsiveCardContext<TRow = unknown> {\n /**\n * The row data (available as `let-row` or `let-myVar`).\n */\n $implicit: TRow;\n\n /**\n * The row data (explicit access via `let-row=\"row\"`).\n */\n row: TRow;\n\n /**\n * The row index (zero-based).\n */\n index: number;\n}\n\n/**\n * Registry to store responsive card templates by grid element.\n * Used by AngularGridAdapter to create card renderers.\n */\nexport const responsiveCardTemplateRegistry = new Map<HTMLElement, TemplateRef<GridResponsiveCardContext>>();\n\n/**\n * Retrieves the responsive card template for a grid element.\n *\n * @param gridElement - The grid element to look up\n * @returns The template reference or undefined if not found\n */\nexport function getResponsiveCardTemplate(\n gridElement: HTMLElement,\n): TemplateRef<GridResponsiveCardContext> | undefined {\n // Find the tbw-grid-responsive-card element inside the grid\n const cardElement = gridElement.querySelector('tbw-grid-responsive-card');\n if (!cardElement) return undefined;\n return responsiveCardTemplateRegistry.get(cardElement as HTMLElement);\n}\n\n/**\n * Directive for providing custom Angular templates for responsive card layout.\n *\n * Use this directive to define how each row should render when the grid\n * is in responsive/mobile mode. The template receives the row data and index.\n *\n * ## Usage\n *\n * ```html\n * <tbw-grid [rows]=\"employees\">\n * <tbw-grid-responsive-card>\n * <ng-template let-employee let-idx=\"index\">\n * <div class=\"employee-card\">\n * <img [src]=\"employee.avatar\" alt=\"\">\n * <div class=\"info\">\n * <strong>{{ employee.name }}</strong>\n * <span>{{ employee.department }}</span>\n * </div>\n * </div>\n * </ng-template>\n * </tbw-grid-responsive-card>\n * </tbw-grid>\n * ```\n *\n * ## Important Notes\n *\n * - The ResponsivePlugin must be added to your grid config\n * - The Grid directive will automatically configure the plugin's cardRenderer\n * - Template context provides `$implicit` (row), `row`, and `index`\n *\n * @see ResponsivePlugin\n */\n@Directive({\n selector: 'tbw-grid-responsive-card',\n})\nexport class GridResponsiveCard<TRow = unknown> {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The ng-template containing the card content.\n */\n template = contentChild(TemplateRef<GridResponsiveCardContext<TRow>>);\n\n /**\n * Effect that registers the template when it becomes available.\n */\n private onTemplateReceived = effect(() => {\n const template = this.template();\n if (template) {\n responsiveCardTemplateRegistry.set(\n this.elementRef.nativeElement,\n template as TemplateRef<GridResponsiveCardContext>,\n );\n }\n });\n\n /**\n * Type guard for template context inference.\n */\n static ngTemplateContextGuard<T>(\n _directive: GridResponsiveCard<T>,\n context: unknown,\n ): context is GridResponsiveCardContext<T> {\n return true;\n }\n}\n","import { contentChild, Directive, effect, ElementRef, inject, input, TemplateRef } from '@angular/core';\n\n/**\n * Context object passed to the tool panel template.\n * Provides access to grid-related information for the panel content.\n */\nexport interface GridToolPanelContext {\n /** The grid element (implicit binding) */\n $implicit: HTMLElement;\n /** The grid element */\n grid: HTMLElement;\n}\n\n// Global registry mapping DOM elements to their templates\nconst toolPanelTemplateRegistry = new Map<HTMLElement, TemplateRef<GridToolPanelContext>>();\n\n/**\n * Gets the tool panel template registered for a given tool panel element.\n * Used by AngularGridAdapter to retrieve templates at render time.\n */\nexport function getToolPanelTemplate(panelElement: HTMLElement): TemplateRef<GridToolPanelContext> | undefined {\n return toolPanelTemplateRegistry.get(panelElement);\n}\n\n/**\n * Gets all tool panel elements with registered templates within a grid element.\n */\nexport function getToolPanelElements(gridElement: HTMLElement): HTMLElement[] {\n const panelElements = gridElement.querySelectorAll('tbw-grid-tool-panel');\n return Array.from(panelElements).filter((el) => toolPanelTemplateRegistry.has(el as HTMLElement)) as HTMLElement[];\n}\n\n/**\n * Directive that captures an `<ng-template>` for use as a custom tool panel.\n *\n * This enables declarative Angular component usage for tool panels\n * that appear in the grid's side panel.\n *\n * ## Usage\n *\n * ```html\n * <tbw-grid [rows]=\"rows\" [gridConfig]=\"config\">\n * <tbw-grid-tool-panel\n * id=\"quick-filters\"\n * title=\"Quick Filters\"\n * icon=\"🔍\"\n * tooltip=\"Apply quick filters\"\n * [order]=\"10\"\n * >\n * <ng-template let-grid>\n * <app-quick-filters [grid]=\"grid\" />\n * </ng-template>\n * </tbw-grid-tool-panel>\n * </tbw-grid>\n * ```\n *\n * The template context provides:\n * - `$implicit` / `grid`: The grid element reference\n *\n * ### Attributes\n *\n * - `id` (required): Unique identifier for the panel\n * - `title` (required): Panel title shown in accordion header\n * - `icon`: Icon for accordion section header (emoji or text)\n * - `tooltip`: Tooltip for accordion section header\n * - `order`: Panel order priority (lower = first, default: 100)\n *\n * Import the directive in your component:\n *\n * ```typescript\n * import { GridToolPanel } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [GridToolPanel],\n * // ...\n * })\n * ```\n */\n@Directive({ selector: 'tbw-grid-tool-panel' })\nexport class GridToolPanel {\n private elementRef = inject(ElementRef<HTMLElement>);\n\n /** Unique panel identifier (required) */\n id = input.required<string>({ alias: 'id' });\n\n /** Panel title shown in accordion header (required) */\n title = input.required<string>({ alias: 'title' });\n\n /** Icon for accordion section header (emoji or text) */\n icon = input<string>();\n\n /** Tooltip for accordion section header */\n tooltip = input<string>();\n\n /** Panel order priority (lower = first, default: 100) */\n order = input<number>(100);\n\n /**\n * Query for the ng-template content child.\n */\n template = contentChild(TemplateRef<GridToolPanelContext>);\n\n /** Effect that triggers when the template is available */\n private onTemplateReceived = effect(() => {\n const template = this.template();\n const element = this.elementRef.nativeElement;\n\n if (template) {\n // Set attributes from inputs (for light DOM parsing to read)\n element.setAttribute('id', this.id());\n element.setAttribute('title', this.title());\n\n const icon = this.icon();\n if (icon) element.setAttribute('icon', icon);\n\n const tooltip = this.tooltip();\n if (tooltip) element.setAttribute('tooltip', tooltip);\n\n element.setAttribute('order', String(this.order()));\n\n // Register the template for this element\n toolPanelTemplateRegistry.set(element, template);\n }\n });\n\n /**\n * Static type guard for template context.\n * Enables type inference in templates.\n */\n static ngTemplateContextGuard(dir: GridToolPanel, ctx: unknown): ctx is GridToolPanelContext {\n return true;\n }\n}\n","import { Directive, effect, ElementRef, inject, OnDestroy, TemplateRef } from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\nimport { getEditorTemplate } from './grid-column-editor.directive';\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 */\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/**\n * Context type for structural editor directives with `any` defaults.\n * This provides better ergonomics in templates without requiring explicit type annotations.\n *\n * @internal Use `GridEditorContext` in application code for stricter typing.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface StructuralEditorContext<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 * Callback function to commit the edited value.\n */\n onCommit: (value: TValue) => void;\n /**\n * Callback function to cancel editing.\n */\n onCancel: () => void;\n /**\n * The FormControl for this cell, if the grid is bound to a FormArray with FormGroups.\n *\n * Returns `undefined` if:\n * - The grid is not bound to a FormArray\n * - The FormArray doesn't contain FormGroups\n * - The field doesn't exist in the FormGroup\n */\n control?: AbstractControl;\n}\n\n// Registries for structural directive templates\nconst structuralViewRegistry = new Map<HTMLElement, TemplateRef<StructuralCellContext>>();\nconst structuralEditorRegistry = new Map<HTMLElement, TemplateRef<StructuralEditorContext>>();\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 * Gets the editor template registered by the structural directive for a given column element.\n * Falls back to the non-structural directive registry.\n */\nexport function getStructuralEditorTemplate(\n columnElement: HTMLElement,\n): TemplateRef<StructuralEditorContext> | undefined {\n // First check structural directive registry\n const template = structuralEditorRegistry.get(columnElement);\n if (template) return template;\n\n // Fall back to the nested element registry\n const editorEl = columnElement.querySelector('tbw-grid-column-editor');\n if (editorEl) {\n return getEditorTemplate(editorEl as HTMLElement) as TemplateRef<StructuralEditorContext> | 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@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 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') {\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/**\n * Structural directive for cell editor rendering.\n *\n * This provides a cleaner syntax for defining custom cell editors without\n * the nested `<tbw-grid-column-editor>` 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-editor>\n * <ng-template let-value let-onCommit=\"onCommit\" let-onCancel=\"onCancel\">\n * <app-status-editor [value]=\"value\" (commit)=\"onCommit($event)\" (cancel)=\"onCancel()\" />\n * </ng-template>\n * </tbw-grid-column-editor>\n * </tbw-grid-column>\n *\n * <!-- Use this cleaner syntax (with auto-wiring - no explicit bindings needed!): -->\n * <tbw-grid-column field=\"status\">\n * <app-status-editor *tbwEditor=\"let value\" [value]=\"value\" />\n * </tbw-grid-column>\n * ```\n *\n * ## Template Context\n *\n * The structural directive provides the same context as `GridColumnEditor`:\n * - `$implicit` / `value`: The cell value\n * - `row`: The full row data object\n * - `column`: The column configuration\n * - `onCommit`: Callback function to commit the new value (optional - auto-wired if component emits `commit` event)\n * - `onCancel`: Callback function to cancel editing (optional - auto-wired if component emits `cancel` event)\n *\n * ## Import\n *\n * ```typescript\n * import { TbwEditor } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * imports: [TbwEditor],\n * // ...\n * })\n * ```\n */\n@Directive({ selector: '[tbwEditor]' })\nexport class TbwEditor implements OnDestroy {\n private template = inject(TemplateRef<StructuralEditorContext>);\n private elementRef = inject(ElementRef<HTMLElement>);\n private columnElement: HTMLElement | null = null;\n\n constructor() {\n effect(() => {\n this.registerTemplate();\n });\n }\n\n private registerTemplate(): void {\n // Find the parent tbw-grid-column element\n let parent = this.elementRef.nativeElement?.parentElement;\n while (parent && parent.tagName !== 'TBW-GRID-COLUMN') {\n parent = parent.parentElement;\n }\n\n if (parent) {\n this.columnElement = parent;\n structuralEditorRegistry.set(parent, this.template);\n }\n }\n\n ngOnDestroy(): void {\n if (this.columnElement) {\n structuralEditorRegistry.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: TbwEditor, ctx: unknown): ctx is StructuralEditorContext {\n return true;\n }\n}\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';\n\n/**\n * Angular-specific type default configuration.\n * Uses Angular component types instead of function-based renderers/editors.\n */\nexport interface AngularTypeDefault<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\n/**\n * Injection token for providing type defaults at app level.\n */\nexport const GRID_TYPE_DEFAULTS = new InjectionToken<Record<string, AngularTypeDefault>>('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 */\n@Injectable({ providedIn: 'root' })\nexport class GridTypeRegistry {\n private readonly defaults = new Map<string, AngularTypeDefault>();\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: AngularTypeDefault<T>): void {\n this.defaults.set(type, defaults);\n }\n\n /**\n * Get type defaults for a given type.\n */\n get(type: string): AngularTypeDefault | 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 */\nexport function provideGridTypeDefaults(defaults: Record<string, AngularTypeDefault>): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: GRID_TYPE_DEFAULTS, useValue: defaults }]);\n}\n","import {\n ApplicationRef,\n ComponentRef,\n createComponent,\n EmbeddedViewRef,\n EnvironmentInjector,\n EventEmitter,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport type {\n CellRenderContext,\n ColumnConfig,\n ColumnEditorContext,\n ColumnEditorSpec,\n ColumnViewRenderer,\n FrameworkAdapter,\n GridConfig,\n TypeDefault,\n} from '@toolbox-web/grid';\nimport { isComponentClass, type AngularColumnConfig, type AngularGridConfig } from './angular-column-config';\nimport { getEditorTemplate, GridEditorContext } from './directives/grid-column-editor.directive';\nimport { getViewTemplate, GridCellContext } from './directives/grid-column-view.directive';\nimport { getDetailTemplate, GridDetailContext } from './directives/grid-detail-view.directive';\nimport { getFormArrayContext } from './directives/grid-form-array.directive';\nimport { getResponsiveCardTemplate, GridResponsiveCardContext } from './directives/grid-responsive-card.directive';\nimport { getToolPanelTemplate, GridToolPanelContext } from './directives/grid-tool-panel.directive';\nimport { getStructuralEditorTemplate, getStructuralViewTemplate } from './directives/structural-directives';\nimport { GridTypeRegistry } from './grid-type-registry';\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 * Helper to get editor template from either structural directive or nested directive.\n */\nfunction getAnyEditorTemplate(element: HTMLElement): TemplateRef<GridEditorContext> | undefined {\n // First check structural directive registry (for *tbwEditor syntax)\n // The structural context uses `any` types for better ergonomics, but is compatible with GridEditorContext\n const structuralTemplate = getStructuralEditorTemplate(element);\n if (structuralTemplate) return structuralTemplate as unknown as TemplateRef<GridEditorContext>;\n\n // Fall back to nested directive (for <tbw-grid-column-editor> syntax)\n return getEditorTemplate(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 { AngularGridAdapter } 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 AngularGridAdapter(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 */\nexport class AngularGridAdapter implements FrameworkAdapter {\n private viewRefs: EmbeddedViewRef<unknown>[] = [];\n private componentRefs: ComponentRef<unknown>[] = [];\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 { AngularGridAdapter, type AngularGridConfig } from '@toolbox-web/grid-angular';\n *\n * const config: AngularGridConfig<Employee> = {\n * columns: [\n * { field: 'status', renderer: StatusBadgeComponent, editor: StatusEditorComponent },\n * ],\n * };\n *\n * // In component\n * constructor() {\n * const adapter = inject(AngularGridAdapter); // 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: AngularGridConfig<TRow>): GridConfig<TRow> {\n const result = { ...config } as GridConfig<TRow>;\n\n // Process columns\n if (config.columns) {\n result.columns = config.columns.map((col) => this.processColumn(col));\n }\n\n // Process typeDefaults - convert Angular component classes to renderer/editor functions\n if (config.typeDefaults) {\n result.typeDefaults = this.processTypeDefaults(config.typeDefaults);\n }\n\n return result;\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, import('./angular-column-config').AngularTypeDefault<TRow>>,\n ): Record<string, import('@toolbox-web/grid').TypeDefault<TRow>> {\n const processed: Record<string, import('@toolbox-web/grid').TypeDefault<TRow>> = {};\n\n for (const [type, config] of Object.entries(typeDefaults)) {\n const processedConfig: import('@toolbox-web/grid').TypeDefault<TRow> = { ...config } as any;\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 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: AngularColumnConfig<TRow>): ColumnConfig<TRow> {\n const processed = { ...column } as ColumnConfig<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 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 */\n canHandle(element: HTMLElement): boolean {\n return getAnyViewTemplate(element) !== undefined || getAnyEditorTemplate(element) !== 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> {\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 as unknown as ColumnViewRenderer<TRow, TValue>;\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 // 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 // Get the first root node (the component's host element)\n const rootNode = viewRef.rootNodes[0];\n return rootNode;\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 const template = getAnyEditorTemplate(element) as TemplateRef<GridEditorContext<TValue, TRow>> | undefined;\n\n // Find the parent grid element for FormArray context access\n const gridElement = element.closest('tbw-grid') as HTMLElement | null;\n\n if (!template) {\n // No template registered - return undefined to let the grid use its default editor.\n // This allows columns with only *tbwRenderer (no *tbwEditor) to still be editable\n // using the built-in text/number/boolean editors.\n return undefined;\n }\n\n return (ctx: ColumnEditorContext<TRow, TValue>) => {\n // Create simple callback functions (preferred)\n const onCommit = (value: TValue) => ctx.commit(value);\n const onCancel = () => ctx.cancel();\n\n // Create EventEmitters for backwards compatibility (deprecated)\n const commitEmitter = new EventEmitter<TValue>();\n const cancelEmitter = new EventEmitter<void>();\n commitEmitter.subscribe((value: TValue) => ctx.commit(value));\n cancelEmitter.subscribe(() => ctx.cancel());\n\n // Try to get the FormControl from the FormArrayContext\n let control: GridEditorContext<TValue, TRow>['control'];\n if (gridElement) {\n const formContext = getFormArrayContext(gridElement);\n if (formContext?.hasFormGroups) {\n // Find the row index by looking up ctx.row in the grid's rows\n const gridRows = (gridElement as { rows?: TRow[] }).rows;\n if (gridRows) {\n const rowIndex = gridRows.indexOf(ctx.row);\n if (rowIndex >= 0) {\n control = formContext.getControl(rowIndex, ctx.field);\n }\n }\n }\n }\n\n // Create the context for the template\n const context: GridEditorContext<TValue, TRow> = {\n $implicit: ctx.value,\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n // Preferred: simple callback functions\n onCommit,\n onCancel,\n // FormControl from FormArray (if available)\n control,\n // Deprecated: EventEmitters (for backwards compatibility)\n commit: commitEmitter,\n cancel: cancelEmitter,\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 // Get the first root node (the component's host element)\n const rootNode = viewRef.rootNodes[0] as HTMLElement;\n\n // Auto-wire: Listen for commit/cancel events on the rendered component.\n // This allows components to just emit (commit) and (cancel) without\n // requiring explicit template bindings like (commit)=\"onCommit($event)\".\n if (rootNode && rootNode.addEventListener) {\n rootNode.addEventListener('commit', (e: Event) => {\n const customEvent = e as CustomEvent<TValue>;\n ctx.commit(customEvent.detail);\n });\n rootNode.addEventListener('cancel', () => {\n ctx.cancel();\n });\n }\n\n return rootNode;\n };\n }\n\n /**\n * Creates a detail renderer function for MasterDetailPlugin.\n * Renders Angular templates for expandable detail rows.\n */\n createDetailRenderer<TRow = unknown>(gridElement: HTMLElement): ((row: TRow) => HTMLElement) | undefined {\n const template = getDetailTemplate(gridElement) as TemplateRef<GridDetailContext<TRow>> | undefined;\n\n if (!template) {\n return undefined;\n }\n\n return (row: TRow) => {\n // Create the context for the template\n const context: GridDetailContext<TRow> = {\n $implicit: row,\n row: row,\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 // Create a container for the root nodes\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node) => container.appendChild(node));\n return container;\n };\n }\n\n /**\n * Framework adapter hook called by MasterDetailPlugin during attach().\n * Parses the <tbw-grid-detail> element and returns an Angular template-based renderer.\n *\n * This enables MasterDetailPlugin to automatically use Angular templates\n * without manual configuration in the Grid directive.\n */\n parseDetailElement<TRow = unknown>(\n detailElement: Element,\n ): ((row: TRow, rowIndex: number) => HTMLElement | string) | undefined {\n // Get the template from the registry for this detail element\n const template = getDetailTemplate(detailElement.closest('tbw-grid') as HTMLElement) as\n | TemplateRef<GridDetailContext<TRow>>\n | undefined;\n\n if (!template) {\n return undefined;\n }\n\n // Return a renderer function that creates embedded views\n // Note: rowIndex is part of the MasterDetailPlugin detailRenderer signature but not needed here\n return (row: TRow) => {\n const context: GridDetailContext<TRow> = {\n $implicit: row,\n row: row,\n };\n\n const viewRef = this.viewContainerRef.createEmbeddedView(template, context);\n this.viewRefs.push(viewRef);\n viewRef.detectChanges();\n\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node) => container.appendChild(node));\n return container;\n };\n }\n\n /**\n * Creates a responsive card renderer function for ResponsivePlugin.\n * Renders Angular templates for card layout in responsive mode.\n *\n * @param gridElement - The grid element to look up the template for\n * @returns A card renderer function or undefined if no template is found\n */\n createResponsiveCardRenderer<TRow = unknown>(\n gridElement: HTMLElement,\n ): ((row: TRow, rowIndex: number) => HTMLElement) | undefined {\n const template = getResponsiveCardTemplate(gridElement) as TemplateRef<GridResponsiveCardContext<TRow>> | undefined;\n\n if (!template) {\n return undefined;\n }\n\n return (row: TRow, rowIndex: number) => {\n // Create the context for the template\n const context: GridResponsiveCardContext<TRow> = {\n $implicit: row,\n row: row,\n index: rowIndex,\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 // Create a container for the root nodes\n const container = document.createElement('div');\n viewRef.rootNodes.forEach((node) => container.appendChild(node));\n return container;\n };\n }\n\n /**\n * Creates a tool panel renderer from a light DOM element.\n * The renderer creates an Angular template-based panel content.\n */\n createToolPanelRenderer(element: HTMLElement): ((container: HTMLElement) => void | (() => void)) | undefined {\n const template = getToolPanelTemplate(element) as TemplateRef<GridToolPanelContext> | undefined;\n\n if (!template) {\n return undefined;\n }\n\n // Find the parent grid element for context\n const gridElement = element.closest('tbw-grid') as HTMLElement | null;\n\n return (container: HTMLElement) => {\n // Create the context for the template\n const context: GridToolPanelContext = {\n $implicit: gridElement ?? container,\n grid: gridElement ?? container,\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 // Append all root nodes to the container\n viewRef.rootNodes.forEach((node) => container.appendChild(node));\n\n // Return cleanup function\n return () => {\n const index = this.viewRefs.indexOf(viewRef);\n if (index > -1) {\n this.viewRefs.splice(index, 1);\n }\n viewRef.destroy();\n };\n };\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): TypeDefault<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: TypeDefault<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 TypeDefault['editor'];\n }\n\n return typeDefault;\n }\n\n /**\n * Creates and mounts an Angular component dynamically.\n * Shared logic between renderer and editor component creation.\n * @internal\n */\n private mountComponent<TRow, TValue>(\n componentClass: Type<unknown>,\n inputs: { value: TValue; row: TRow; column: ColumnConfig<TRow> },\n ): { hostElement: HTMLSpanElement; componentRef: ComponentRef<unknown> } {\n // Create a host element for the component\n const hostElement = document.createElement('span');\n hostElement.style.display = 'contents';\n\n // Create the component dynamically\n const componentRef = createComponent(componentClass, {\n environmentInjector: this.injector,\n hostElement,\n });\n\n // Set inputs - components should have value, row, column inputs\n this.setComponentInputs(componentRef, inputs);\n\n // Attach to app for change detection\n this.appRef.attachView(componentRef.hostView);\n this.componentRefs.push(componentRef);\n\n // Trigger change detection\n componentRef.changeDetectorRef.detectChanges();\n\n return { hostElement, componentRef };\n }\n\n /**\n * Wires up commit/cancel handlers for an editor component.\n * Supports both Angular outputs and DOM CustomEvents.\n * @internal\n */\n private wireEditorCallbacks<TValue>(\n hostElement: HTMLElement,\n componentRef: ComponentRef<unknown>,\n commit: (value: TValue) => void,\n cancel: () => void,\n ): void {\n // Subscribe to Angular outputs (commit/cancel) on the component instance.\n // This works with Angular's output() signal API.\n const instance = componentRef.instance as Record<string, unknown>;\n this.subscribeToOutput(instance, 'commit', commit);\n this.subscribeToOutput(instance, 'cancel', cancel);\n\n // Also listen for DOM events as fallback (for components that dispatch CustomEvents)\n hostElement.addEventListener('commit', (e: Event) => {\n const customEvent = e as CustomEvent<TValue>;\n commit(customEvent.detail);\n });\n hostElement.addEventListener('cancel', () => cancel());\n }\n\n /**\n * Creates a renderer function from an Angular component class.\n * @internal\n */\n private createComponentRenderer<TRow = unknown, TValue = unknown>(\n componentClass: Type<unknown>,\n ): ColumnViewRenderer<TRow, TValue> {\n return (ctx: CellRenderContext<TRow, TValue>) => {\n const { hostElement } = this.mountComponent<TRow, TValue>(componentClass, {\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n });\n return hostElement;\n };\n }\n\n /**\n * Creates an editor function from an Angular component class.\n * @internal\n */\n private createComponentEditor<TRow = unknown, TValue = unknown>(\n componentClass: Type<unknown>,\n ): ColumnEditorSpec<TRow, TValue> {\n return (ctx: ColumnEditorContext<TRow, TValue>) => {\n const { hostElement, componentRef } = this.mountComponent<TRow, TValue>(componentClass, {\n value: ctx.value,\n row: ctx.row,\n column: ctx.column,\n });\n\n this.wireEditorCallbacks<TValue>(\n hostElement,\n componentRef,\n (value) => ctx.commit(value),\n () => ctx.cancel(),\n );\n\n return hostElement;\n };\n }\n\n /**\n * Subscribes to an Angular output on a component instance.\n * Works with both EventEmitter and OutputEmitterRef (signal outputs).\n * @internal\n */\n private subscribeToOutput<T>(\n instance: Record<string, unknown>,\n outputName: string,\n callback: (value: T) => void,\n ): void {\n const output = instance[outputName];\n if (!output) return;\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 }\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 * 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.componentRefs.forEach((ref) => ref.destroy());\n this.componentRefs = [];\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 */\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 */\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 */\nexport function provideGridIcons(icons: Partial<GridIcons>): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: GRID_ICONS, useValue: icons }]);\n}\n","import { afterNextRender, computed, ElementRef, inject, type Signal, signal } from '@angular/core';\nimport type { ColumnConfig, DataGridElement, GridConfig } from '@toolbox-web/grid';\n\n/**\n * Selection convenience methods returned from injectGrid.\n */\nexport interface SelectionMethods<TRow = unknown> {\n /**\n * Select all rows in the grid.\n * Requires SelectionPlugin with mode: 'row'.\n */\n selectAll: () => void;\n\n /**\n * Clear all selection.\n * Works with any SelectionPlugin mode.\n */\n clearSelection: () => void;\n\n /**\n * Get selected row indices.\n * Returns Set of selected row indices.\n */\n getSelectedIndices: () => Set<number>;\n\n /**\n * Get selected rows data.\n * Returns array of selected row objects.\n */\n getSelectedRows: () => TRow[];\n}\n\n/**\n * Export convenience methods returned from injectGrid.\n */\nexport interface ExportMethods {\n /**\n * Export grid data to CSV file.\n * Requires ExportPlugin to be loaded.\n *\n * @param filename - Optional filename (defaults to 'export.csv')\n */\n exportToCsv: (filename?: string) => void;\n\n /**\n * Export grid data to JSON file.\n * Requires ExportPlugin to be loaded.\n *\n * @param filename - Optional filename (defaults to 'export.json')\n */\n exportToJson: (filename?: string) => void;\n}\n\n/**\n * Return type for injectGrid function.\n */\nexport interface InjectGridReturn<TRow = unknown> extends SelectionMethods<TRow>, ExportMethods {\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\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, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n * import { Grid, injectGrid } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-my-grid',\n * imports: [Grid],\n * schemas: [CUSTOM_ELEMENTS_SCHEMA],\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 * @returns Object with grid access methods and state signals\n */\nexport function injectGrid<TRow = unknown>(): InjectGridReturn<TRow> {\n const elementRef = inject(ElementRef);\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 // Initialize after render\n afterNextRender(() => {\n const gridElement = elementRef.nativeElement.querySelector('tbw-grid') 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\n gridElement.ready?.().then(async () => {\n isReady.set(true);\n const effectiveConfig = gridElement.getConfig?.();\n if (effectiveConfig) {\n config.set(effectiveConfig as GridConfig<TRow>);\n }\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 // ═══════════════════════════════════════════════════════════════════\n // SELECTION CONVENIENCE METHODS\n // ═══════════════════════════════════════════════════════════════════\n\n const selectAll = (): void => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('selection');\n if (!plugin) {\n console.warn('[injectGrid] selectAll requires SelectionPlugin');\n return;\n }\n // Row mode: select all row indices\n if (plugin.config?.mode === 'row') {\n const rows = gridElement?.rows ?? [];\n const allIndices = new Set<number>(rows.map((_: unknown, i: number) => i));\n plugin.selected = allIndices;\n plugin.requestAfterRender?.();\n }\n };\n\n const clearSelection = (): void => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('selection');\n if (!plugin) return;\n\n const mode = plugin.config?.mode;\n if (mode === 'row') {\n plugin.selected = new Set();\n } else if (mode === 'range' || mode === 'cell') {\n plugin.ranges = [];\n }\n plugin.requestAfterRender?.();\n };\n\n const getSelectedIndices = (): Set<number> => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('selection');\n if (!plugin) return new Set();\n\n if (plugin.config?.mode === 'row') {\n return new Set(plugin.selected ?? []);\n }\n // Range/cell mode: extract unique row indices from ranges\n const ranges = plugin.ranges ?? [];\n const indices = new Set<number>();\n for (const range of ranges) {\n for (let r = range.startRow; r <= range.endRow; r++) {\n indices.add(r);\n }\n }\n return indices;\n };\n\n const getSelectedRows = (): TRow[] => {\n const gridElement = element();\n if (!gridElement) return [];\n const rows = gridElement.rows ?? [];\n const indices = getSelectedIndices();\n return Array.from(indices)\n .filter((i) => i >= 0 && i < rows.length)\n .map((i) => rows[i]);\n };\n\n // ═══════════════════════════════════════════════════════════════════\n // EXPORT CONVENIENCE METHODS\n // ═══════════════════════════════════════════════════════════════════\n\n const exportToCsv = (filename?: string): void => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('export');\n if (!plugin) {\n console.warn('[injectGrid] exportToCsv requires ExportPlugin');\n return;\n }\n plugin.exportToCsv?.(filename);\n };\n\n const exportToJson = (filename?: string): void => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const gridElement = element() as any;\n const plugin = gridElement?.getPluginByName?.('export');\n if (!plugin) {\n console.warn('[injectGrid] exportToJson requires ExportPlugin');\n return;\n }\n plugin.exportToJson?.(filename);\n };\n\n return {\n element,\n isReady,\n config,\n visibleColumns,\n getConfig,\n forceLayout,\n toggleGroup,\n registerStyles,\n unregisterStyles,\n selectAll,\n clearSelection,\n getSelectedIndices,\n getSelectedRows,\n exportToCsv,\n exportToJson,\n };\n}\n","/**\n * Feature Registry for @toolbox-web/grid-angular\n *\n * This module provides a synchronous registry for plugin factories.\n * Features are registered via side-effect imports, enabling tree-shaking\n * while maintaining the clean input-based API.\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/**\n * Feature names supported by the Grid directive.\n */\nexport type FeatureName =\n | 'selection'\n | 'editing'\n | 'clipboard'\n | 'contextMenu'\n | 'multiSort'\n | 'sorting' // @deprecated - use 'multiSort' instead\n | 'filtering'\n | 'reorder'\n | 'visibility'\n | 'pinnedColumns'\n | 'groupingColumns'\n | 'columnVirtualization'\n | 'rowReorder'\n | 'groupingRows'\n | 'pinnedRows'\n | 'tree'\n | 'masterDetail'\n | 'responsive'\n | 'undoRedo'\n | 'export'\n | 'print'\n | 'pivot'\n | 'serverSide';\n\n/**\n * Plugin factory function type.\n * Takes configuration and returns a plugin instance.\n */\nexport type PluginFactory<TConfig = unknown> = (config: TConfig) => unknown;\n\n/**\n * Registry entry containing the factory and metadata.\n */\ninterface RegistryEntry {\n factory: PluginFactory;\n /** Feature name for debugging */\n name: string;\n}\n\n/**\n * Central registry mapping feature names to their plugin factories.\n * Populated by side-effect feature imports.\n */\nconst featureRegistry = new Map<FeatureName, RegistryEntry>();\n\n/**\n * Set of features that have been used without being registered.\n * Used to show helpful warnings only once per feature.\n */\nconst warnedFeatures = new Set<string>();\n\n/**\n * Register a feature's plugin factory.\n * Called by side-effect feature imports.\n *\n * @param name - The feature name (matches the input name on Grid directive)\n * @param factory - Function that creates the plugin instance\n *\n * @example\n * ```ts\n * // features/selection.ts\n * import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';\n * import { registerFeature } from '../lib/feature-registry';\n *\n * registerFeature('selection', (config) => new SelectionPlugin(config));\n * ```\n */\nexport function registerFeature<TConfig = unknown>(name: FeatureName, factory: PluginFactory<TConfig>): void {\n featureRegistry.set(name, {\n factory: factory as PluginFactory,\n name,\n });\n}\n\n/**\n * Check if a feature is registered.\n */\nexport function isFeatureRegistered(name: FeatureName): boolean {\n return featureRegistry.has(name);\n}\n\n/**\n * Get a registered feature's factory.\n * Returns undefined if not registered.\n */\nexport function getFeatureFactory(name: FeatureName): PluginFactory | undefined {\n return featureRegistry.get(name)?.factory;\n}\n\n/**\n * Get all registered feature names.\n * Useful for debugging.\n */\nexport function getRegisteredFeatures(): FeatureName[] {\n return Array.from(featureRegistry.keys());\n}\n\n/**\n * Create a plugin instance for a feature.\n * Shows a helpful warning if the feature is not registered.\n *\n * @param name - Feature name\n * @param config - Plugin configuration\n * @returns Plugin instance or undefined if not registered\n */\nexport function createPluginFromFeature<TConfig = unknown>(name: FeatureName, config: TConfig): unknown | undefined {\n const entry = featureRegistry.get(name);\n\n if (!entry) {\n // Show warning only once per feature in development\n const isDev =\n typeof window !== 'undefined' &&\n (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1');\n\n if (!warnedFeatures.has(name) && isDev) {\n warnedFeatures.add(name);\n console.warn(\n `[tbw-grid] Feature \"${name}\" input is set but the feature is not registered.\\n` +\n `Add this import to enable it:\\n\\n` +\n ` import '@toolbox-web/grid-angular/features/${toKebabCase(name)}';\\n`,\n );\n }\n return undefined;\n }\n\n return entry.factory(config);\n}\n\n/**\n * Convert camelCase to kebab-case for import paths.\n */\nfunction toKebabCase(str: string): string {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\n/**\n * Clear the registry. For testing only.\n * @internal\n */\nexport function clearFeatureRegistry(): void {\n featureRegistry.clear();\n warnedFeatures.clear();\n}\n","import { computed, Directive, ElementRef, inject, input, output } from '@angular/core';\nimport type { AbstractControl } from '@angular/forms';\nimport type { ColumnConfig } from '@toolbox-web/grid';\n\n/**\n * Base class for grid cell editors.\n *\n * Provides common functionality for Angular cell editors:\n * - Automatic value resolution from FormControl or value input\n * - Common inputs (value, row, column, control)\n * - Common outputs (commit, cancel)\n * - Validation state helpers\n *\n * ## Usage\n *\n * ```typescript\n * import { Component } from '@angular/core';\n * import { BaseGridEditor } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-my-editor',\n * template: \\`\n * <input\n * [value]=\"currentValue()\"\n * [class.is-invalid]=\"isInvalid()\"\n * (input)=\"commitValue($event.target.value)\"\n * (keydown.escape)=\"cancelEdit()\"\n * />\n * @if (hasErrors()) {\n * <div class=\"error\">{{ firstErrorMessage() }}</div>\n * }\n * \\`\n * })\n * export class MyEditorComponent extends BaseGridEditor<MyRow, string> {\n * // Override to customize error messages\n * protected override getErrorMessage(errorKey: string): string {\n * if (errorKey === 'required') return 'This field is required';\n * if (errorKey === 'minlength') return 'Too short';\n * return super.getErrorMessage(errorKey);\n * }\n * }\n * ```\n *\n * ## Template Syntax\n *\n * When using the base class, you only need to pass the control:\n *\n * ```html\n * <tbw-grid-column field=\"name\">\n * <app-my-editor *tbwEditor=\"let _; control as control\" [control]=\"control\" />\n * </tbw-grid-column>\n * ```\n *\n * Or without FormArray binding (fallback to value):\n *\n * ```html\n * <tbw-grid-column field=\"name\">\n * <app-my-editor *tbwEditor=\"let value\" [value]=\"value\" />\n * </tbw-grid-column>\n * ```\n *\n * @typeParam TRow - The row data type\n * @typeParam TValue - The cell value type\n */\n@Directive()\nexport abstract class BaseGridEditor<TRow = unknown, TValue = unknown> {\n private readonly elementRef = inject(ElementRef);\n\n // ============================================================================\n // Inputs\n // ============================================================================\n\n /**\n * The cell value. Used when FormControl is not available.\n * When a FormControl is provided, value is derived from control.value instead.\n */\n readonly value = input<TValue>();\n\n /**\n * The full row data object.\n */\n readonly row = input<TRow>();\n\n /**\n * The column configuration.\n */\n readonly column = input<ColumnConfig<TRow>>();\n\n /**\n * The FormControl for this cell, if the grid is bound to a FormArray.\n * When provided, the editor uses control.value instead of the value input.\n */\n readonly control = input<AbstractControl>();\n\n // ============================================================================\n // Outputs\n // ============================================================================\n\n /**\n * Emits when the user commits a new value.\n */\n readonly commit = output<TValue>();\n\n /**\n * Emits when the user cancels editing.\n */\n readonly cancel = output<void>();\n\n // ============================================================================\n // Computed State\n // ============================================================================\n\n /**\n * The current value, derived from FormControl if available, otherwise from value input.\n * This is the recommended way to get the current value in your editor template.\n */\n readonly currentValue = computed<TValue | undefined>(() => {\n const ctrl = this.control();\n if (ctrl) {\n return ctrl.value as TValue;\n }\n return this.value();\n });\n\n /**\n * Whether the control is invalid (has validation errors).\n * Returns false if no FormControl is available.\n */\n readonly isInvalid = computed(() => {\n return this.control()?.invalid ?? false;\n });\n\n /**\n * Whether the control is dirty (has been modified).\n * Returns false if no FormControl is available.\n */\n readonly isDirty = computed(() => {\n return this.control()?.dirty ?? false;\n });\n\n /**\n * Whether the control has been touched.\n * Returns false if no FormControl is available.\n */\n readonly isTouched = computed(() => {\n return this.control()?.touched ?? false;\n });\n\n /**\n * Whether the control has any validation errors.\n */\n readonly hasErrors = computed(() => {\n const ctrl = this.control();\n return ctrl?.errors != null && Object.keys(ctrl.errors).length > 0;\n });\n\n /**\n * The first error message from the control's validation errors.\n * Returns an empty string if no errors.\n */\n readonly firstErrorMessage = computed(() => {\n const ctrl = this.control();\n if (!ctrl?.errors) return '';\n\n const firstKey = Object.keys(ctrl.errors)[0];\n return this.getErrorMessage(firstKey, ctrl.errors[firstKey]);\n });\n\n /**\n * All error messages from the control's validation errors.\n */\n readonly allErrorMessages = computed(() => {\n const ctrl = this.control();\n if (!ctrl?.errors) return [];\n\n return Object.entries(ctrl.errors).map(([key, value]) => this.getErrorMessage(key, value));\n });\n\n // ============================================================================\n // Methods\n // ============================================================================\n\n /**\n * Commit a new value. Emits the commit output AND dispatches a DOM event.\n * The DOM event enables the grid's auto-wiring to catch the commit.\n * Call this when the user confirms their edit.\n */\n commitValue(newValue: TValue): void {\n // Emit Angular output for template bindings\n this.commit.emit(newValue);\n\n // Dispatch DOM CustomEvent for grid's auto-wiring\n // This allows the adapter to catch commits without explicit (commit)=\"...\" bindings\n this.elementRef.nativeElement.dispatchEvent(new CustomEvent('commit', { detail: newValue, bubbles: true }));\n }\n\n /**\n * Cancel editing. Emits the cancel output AND dispatches a DOM event.\n * Call this when the user cancels (e.g., presses Escape).\n */\n cancelEdit(): void {\n // Emit Angular output for template bindings\n this.cancel.emit();\n\n // Dispatch DOM CustomEvent for grid's auto-wiring\n this.elementRef.nativeElement.dispatchEvent(new CustomEvent('cancel', { bubbles: true }));\n }\n\n /**\n * Get a human-readable error message for a validation error.\n * Override this method to customize error messages for your editor.\n *\n * @param errorKey - The validation error key (e.g., 'required', 'minlength')\n * @param errorValue - The error value (e.g., { requiredLength: 5, actualLength: 3 })\n * @returns A human-readable error message\n */\n protected getErrorMessage(errorKey: string, errorValue?: unknown): string {\n switch (errorKey) {\n case 'required':\n return 'This field is required';\n case 'minlength': {\n const err = errorValue as { requiredLength?: number };\n return `Minimum length is ${err?.requiredLength ?? 'unknown'}`;\n }\n case 'maxlength': {\n const err = errorValue as { requiredLength?: number };\n return `Maximum length is ${err?.requiredLength ?? 'unknown'}`;\n }\n case 'min': {\n const err = errorValue as { min?: number };\n return `Minimum value is ${err?.min ?? 'unknown'}`;\n }\n case 'max': {\n const err = errorValue as { max?: number };\n return `Maximum value is ${err?.max ?? 'unknown'}`;\n }\n case 'email':\n return 'Invalid email address';\n case 'pattern':\n return 'Invalid format';\n default:\n return `Invalid value (${errorKey})`;\n }\n }\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 ViewContainerRef,\n} from '@angular/core';\nimport type {\n CellActivateDetail,\n CellChangeDetail,\n CellClickDetail,\n ColumnResizeDetail,\n GridColumnState,\n DataGridElement as GridElement,\n RowClickDetail,\n SortChangeDetail,\n} from '@toolbox-web/grid';\nimport { DataGridElement as GridElementClass } from '@toolbox-web/grid';\n// Import editing event types from the editing plugin\nimport type { ChangedRowsResetDetail, EditingConfig } from '@toolbox-web/grid/plugins/editing';\n// Import plugin types and the two plugins always needed for Angular template integration\nimport type {\n ClipboardConfig,\n ColumnMoveDetail,\n ColumnVirtualizationConfig,\n ColumnVisibilityDetail,\n ContextMenuConfig,\n CopyDetail,\n DetailExpandDetail,\n ExportCompleteDetail,\n ExportConfig,\n FilterChangeDetail,\n FilterConfig,\n GroupingColumnsConfig,\n GroupingRowsConfig,\n GroupToggleDetail,\n MasterDetailConfig,\n MasterDetailPlugin,\n MultiSortConfig,\n PasteDetail,\n PinnedRowsConfig,\n PivotConfig,\n PrintCompleteDetail,\n PrintConfig,\n PrintStartDetail,\n ReorderConfig,\n ResponsiveChangeDetail,\n ResponsivePlugin,\n ResponsivePluginConfig,\n RowMoveDetail,\n RowReorderConfig,\n SelectionChangeDetail,\n SelectionConfig,\n ServerSideConfig,\n TreeConfig,\n TreeExpandDetail,\n UndoRedoConfig,\n UndoRedoDetail,\n VisibilityConfig,\n} from '@toolbox-web/grid/all';\nimport type { AngularGridConfig } from '../angular-column-config';\nimport { AngularGridAdapter } from '../angular-grid-adapter';\nimport { createPluginFromFeature, type FeatureName } from '../feature-registry';\nimport { GridIconRegistry } from '../grid-icon-registry';\n\n/**\n * Event detail for cell commit events.\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 */\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, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n * import { Grid } from '@toolbox-web/grid-angular';\n *\n * @Component({\n * selector: 'app-root',\n * imports: [Grid],\n * schemas: [CUSTOM_ELEMENTS_SCHEMA],\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 an AngularGridAdapter instance\n * - Registers it with the GridElement\n * - Injects custom styles into the grid\n * - Handles cleanup on destruction\n */\n@Directive({ selector: '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: AngularGridAdapter | null = null;\n\n constructor() {\n // Effect to process angularConfig and apply to grid\n // This merges feature input plugins with the user's config plugins\n effect(() => {\n const angularCfg = this.angularConfig();\n const userGridConfig = this.gridConfig();\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 || userGridConfig?.icons || {};\n coreConfigOverrides['icons'] = { ...registryIcons, ...existingIcons };\n }\n\n // If angularConfig is provided, process it (converts component classes to renderer functions)\n const processedConfig = angularCfg ? this.adapter.processGridConfig(angularCfg) : null;\n\n // IMPORTANT: If user is NOT using angularConfig input, and there are no feature plugins\n // or config overrides to merge, do NOT overwrite grid.gridConfig.\n // This allows [gridConfig]=\"myConfig\" binding to work correctly without the directive\n // creating a new object that strips properties like typeDefaults.\n const hasFeaturePlugins = featurePlugins.length > 0;\n const hasConfigOverrides = Object.keys(coreConfigOverrides).length > 0;\n\n // Use the gridConfig input signal (preferred) or fallback to what's on the grid element\n // The input signal gives us reactive tracking of the user's config\n const existingConfig = userGridConfig || {};\n\n if (!processedConfig && !hasFeaturePlugins && !hasConfigOverrides && !userGridConfig) {\n // Nothing to merge and no config input - let the user's DOM binding work directly\n return;\n }\n\n // Merge: existing config (from [gridConfig] input) < processed angularConfig < feature plugins\n const configPlugins = processedConfig?.plugins || existingConfig.plugins || [];\n const mergedPlugins = [...featurePlugins, ...configPlugins];\n\n // Build the final config, preserving ALL existing properties (including typeDefaults)\n const baseConfig = processedConfig || existingConfig;\n grid.gridConfig = {\n ...existingConfig, // Start with existing config to preserve all properties (including typeDefaults)\n ...baseConfig, // Then apply processed/angular config\n ...coreConfigOverrides,\n plugins: mergedPlugins.length > 0 ? mergedPlugins : baseConfig.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\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 * Core grid configuration object.\n *\n * Use this input for the base GridConfig (typeDefaults, getRowId, etc.).\n * This is the same as binding directly to the web component's gridConfig property,\n * but allows the directive to properly merge feature plugins and config overrides.\n *\n * For Angular-specific features (component class renderers/editors), use `angularConfig` instead.\n *\n * @example\n * ```typescript\n * config: GridConfig = {\n * typeDefaults: {\n * boolean: { renderer: (ctx) => ctx.value ? '✓' : '✗' }\n * }\n * };\n * columns = [\n * { field: 'active', type: 'boolean' }\n * ];\n * ```\n *\n * ```html\n * <tbw-grid [gridConfig]=\"config\" [columns]=\"columns\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n gridConfig = input<any>();\n\n /**\n * Angular-specific grid configuration that supports component classes for renderers/editors.\n *\n * Use this input when you want to specify Angular component classes directly in column configs.\n * Components must implement the appropriate interfaces:\n * - Renderers: `AngularCellRenderer<TRow, TValue>` - requires `value()` and `row()` signal inputs\n * - Editors: `AngularCellEditor<TRow, TValue>` - adds `commit` and `cancel` outputs\n *\n * The directive automatically processes component classes and converts them to grid-compatible\n * renderer/editor functions before applying to the grid.\n *\n * @example\n * ```typescript\n * // Component that implements AngularCellEditor\n * @Component({...})\n * export class BonusEditorComponent implements AngularCellEditor<Employee, number> {\n * value = input.required<number>();\n * row = input.required<Employee>();\n * commit = output<number>();\n * cancel = output<void>();\n * }\n *\n * // In your grid config\n * config: AngularGridConfig<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 [angularConfig]=\"config\" [rows]=\"employees\"></tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n angularConfig = input<AngularGridConfig<any>>();\n\n // ═══════════════════════════════════════════════════════════════════════════\n // FEATURE INPUTS - Declarative plugin configuration\n // ═══════════════════════════════════════════════════════════════════════════\n\n /**\n * Enable cell/row/range selection.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/selection';\n * ```\n *\n * @example\n * ```html\n * <!-- Shorthand - just the mode -->\n * <tbw-grid [selection]=\"'range'\" />\n *\n * <!-- Full config object -->\n * <tbw-grid [selection]=\"{ mode: 'range', checkbox: true }\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n selection = input<'cell' | 'row' | 'range' | SelectionConfig<any>>();\n\n /**\n * Enable inline cell editing.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/editing';\n * ```\n *\n * @example\n * ```html\n * <!-- Enable with default trigger (dblclick) -->\n * <tbw-grid [editing]=\"true\" />\n *\n * <!-- Specify trigger -->\n * <tbw-grid [editing]=\"'click'\" />\n * <tbw-grid [editing]=\"'dblclick'\" />\n * <tbw-grid [editing]=\"'manual'\" />\n *\n * <!-- Full config with callbacks -->\n * <tbw-grid [editing]=\"{ editOn: 'dblclick', onBeforeEditClose: myCallback }\" />\n * ```\n */\n editing = input<boolean | 'click' | 'dblclick' | 'manual' | EditingConfig>();\n\n /**\n * Enable clipboard copy/paste. Requires selection to be enabled.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/clipboard';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [selection]=\"'range'\" [clipboard]=\"true\" />\n * ```\n */\n clipboard = input<boolean | ClipboardConfig>();\n\n /**\n * Enable right-click context menu.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/context-menu';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [contextMenu]=\"true\" />\n * ```\n */\n contextMenu = input<boolean | ContextMenuConfig>();\n\n /**\n * Enable multi-column sorting.\n *\n * Multi-sort allows users to sort by multiple columns simultaneously.\n * For basic single-column sorting, columns with `sortable: true` work without this plugin.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/multi-sort';\n * ```\n *\n * @example\n * ```html\n * <!-- Enable multi-column sorting -->\n * <tbw-grid [multiSort]=\"true\" />\n *\n * <!-- Limit to single column (uses plugin but restricts to 1 column) -->\n * <tbw-grid [multiSort]=\"'single'\" />\n *\n * <!-- Full config -->\n * <tbw-grid [multiSort]=\"{ maxSortColumns: 3 }\" />\n * ```\n */\n multiSort = input<boolean | 'single' | 'multi' | MultiSortConfig>();\n\n /**\n * @deprecated Use `[multiSort]` instead. Will be removed in a future version.\n *\n * Enable column sorting. This is an alias for `[multiSort]`.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/multi-sort';\n * ```\n */\n sorting = input<boolean | 'single' | 'multi' | MultiSortConfig>();\n\n /**\n * Enable column filtering.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/filtering';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [filtering]=\"true\" />\n * <tbw-grid [filtering]=\"{ debounceMs: 200 }\" />\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n filtering = input<boolean | FilterConfig<any>>();\n\n /**\n * Enable column drag-to-reorder.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/reorder';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [reorder]=\"true\" />\n * ```\n */\n reorder = input<boolean | ReorderConfig>();\n\n /**\n * Enable column visibility toggle panel.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/visibility';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [visibility]=\"true\" />\n * ```\n */\n visibility = input<boolean | VisibilityConfig>();\n\n /**\n * Enable pinned/sticky columns.\n * Columns are pinned via the `sticky` column property.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pinned-columns';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [pinnedColumns]=\"true\" [columns]=\"[\n * { field: 'id', sticky: 'left' },\n * { field: 'name' },\n * { field: 'actions', sticky: 'right' }\n * ]\" />\n * ```\n */\n pinnedColumns = input<boolean>();\n\n /**\n * Enable multi-level column headers (column groups).\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-columns';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [groupingColumns]=\"{ columnGroups: [...] }\" />\n * ```\n */\n groupingColumns = input<boolean | GroupingColumnsConfig>();\n\n /**\n * Enable horizontal column virtualization for wide grids.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/column-virtualization';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [columnVirtualization]=\"true\" />\n * ```\n */\n columnVirtualization = input<boolean | ColumnVirtualizationConfig>();\n\n /**\n * Enable row drag-to-reorder.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/row-reorder';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [rowReorder]=\"true\" />\n * ```\n */\n rowReorder = input<boolean | RowReorderConfig>();\n\n /**\n * Enable row grouping by field values.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/grouping-rows';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [groupingRows]=\"{ groupBy: ['department'] }\" />\n * ```\n */\n groupingRows = input<GroupingRowsConfig>();\n\n /**\n * Enable pinned rows (aggregation/status bar).\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pinned-rows';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [pinnedRows]=\"{ bottom: [{ type: 'aggregation' }] }\" />\n * ```\n */\n pinnedRows = input<boolean | PinnedRowsConfig>();\n\n /**\n * Enable hierarchical tree view.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/tree';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [tree]=\"{ childrenField: 'children' }\" />\n * ```\n */\n tree = input<boolean | TreeConfig>();\n\n /**\n * Enable master-detail expandable rows.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/master-detail';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [masterDetail]=\"{ detailRenderer: detailFn }\" />\n * ```\n */\n masterDetail = input<MasterDetailConfig>();\n\n /**\n * Enable responsive card layout for narrow viewports.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/responsive';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [responsive]=\"{ breakpoint: 768 }\" />\n * ```\n */\n responsive = input<boolean | ResponsivePluginConfig>();\n\n /**\n * Enable undo/redo for cell edits. Requires editing to be enabled.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/undo-redo';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [editing]=\"'dblclick'\" [undoRedo]=\"true\" />\n * ```\n */\n undoRedo = input<boolean | UndoRedoConfig>();\n\n /**\n * Enable CSV/JSON export functionality.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/export';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [export]=\"true\" />\n * <tbw-grid [export]=\"{ filename: 'data.csv' }\" />\n * ```\n */\n exportFeature = input<boolean | ExportConfig>();\n\n /**\n * Enable print functionality.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/print';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [print]=\"true\" />\n * ```\n */\n print = input<boolean | PrintConfig>();\n\n /**\n * Enable pivot table functionality.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/pivot';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [pivot]=\"{ rowFields: ['category'], valueField: 'sales' }\" />\n * ```\n */\n pivot = input<PivotConfig>();\n\n /**\n * Enable server-side data operations.\n *\n * **Requires feature import:**\n * ```typescript\n * import '@toolbox-web/grid-angular/features/server-side';\n * ```\n *\n * @example\n * ```html\n * <tbw-grid [serverSide]=\"{ dataSource: fetchDataFn }\" />\n * ```\n */\n serverSide = input<ServerSideConfig>();\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 a cell value is committed (inline editing).\n * Provides the row, field, new value, and change tracking information.\n *\n * @example\n * ```html\n * <tbw-grid (cellCommit)=\"onCellCommit($event)\">...</tbw-grid>\n * ```\n *\n * ```typescript\n * onCellCommit(event: CellCommitEvent) {\n * console.log(`Changed ${event.field} to ${event.value} in row ${event.rowIndex}`);\n * }\n * ```\n */\n cellCommit = output<CellCommitEvent>();\n\n /**\n * Emitted when a row's values are committed (bulk/row editing).\n * Provides the row data and change tracking information.\n *\n * @example\n * ```html\n * <tbw-grid (rowCommit)=\"onRowCommit($event)\">...</tbw-grid>\n * ```\n */\n rowCommit = output<RowCommitEvent>();\n\n /**\n * Emitted when the changed rows are reset.\n *\n * @example\n * ```html\n * <tbw-grid (changedRowsReset)=\"onChangedRowsReset($event)\">...</tbw-grid>\n * ```\n */\n changedRowsReset = output<ChangedRowsResetDetail>();\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 filter values change.\n *\n * @example\n * ```html\n * <tbw-grid (filterChange)=\"onFilterChange($event)\">...</tbw-grid>\n * ```\n */\n filterChange = output<FilterChangeDetail>();\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 is moved via drag-and-drop.\n *\n * @example\n * ```html\n * <tbw-grid (columnMove)=\"onColumnMove($event)\">...</tbw-grid>\n * ```\n */\n columnMove = output<ColumnMoveDetail>();\n\n /**\n * Emitted when column visibility changes.\n *\n * @example\n * ```html\n * <tbw-grid (columnVisibility)=\"onColumnVisibility($event)\">...</tbw-grid>\n * ```\n */\n columnVisibility = output<ColumnVisibilityDetail>();\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 when selection changes.\n *\n * @example\n * ```html\n * <tbw-grid (selectionChange)=\"onSelectionChange($event)\">...</tbw-grid>\n * ```\n */\n selectionChange = output<SelectionChangeDetail>();\n\n /**\n * Emitted when a row is moved via drag-and-drop.\n *\n * @example\n * ```html\n * <tbw-grid (rowMove)=\"onRowMove($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rowMove = output<RowMoveDetail<any>>();\n\n /**\n * Emitted when a group is expanded or collapsed.\n *\n * @example\n * ```html\n * <tbw-grid (groupToggle)=\"onGroupToggle($event)\">...</tbw-grid>\n * ```\n */\n groupToggle = output<GroupToggleDetail>();\n\n /**\n * Emitted when a tree node is expanded.\n *\n * @example\n * ```html\n * <tbw-grid (treeExpand)=\"onTreeExpand($event)\">...</tbw-grid>\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n treeExpand = output<TreeExpandDetail<any>>();\n\n /**\n * Emitted when a detail panel is expanded or collapsed.\n *\n * @example\n * ```html\n * <tbw-grid (detailExpand)=\"onDetailExpand($event)\">...</tbw-grid>\n * ```\n */\n detailExpand = output<DetailExpandDetail>();\n\n /**\n * Emitted when responsive mode changes (table ↔ card).\n *\n * @example\n * ```html\n * <tbw-grid (responsiveChange)=\"onResponsiveChange($event)\">...</tbw-grid>\n * ```\n */\n responsiveChange = output<ResponsiveChangeDetail>();\n\n /**\n * Emitted when cells are copied to clipboard.\n *\n * @example\n * ```html\n * <tbw-grid (copy)=\"onCopy($event)\">...</tbw-grid>\n * ```\n */\n copy = output<CopyDetail>();\n\n /**\n * Emitted when cells are pasted from clipboard.\n *\n * @example\n * ```html\n * <tbw-grid (paste)=\"onPaste($event)\">...</tbw-grid>\n * ```\n */\n paste = output<PasteDetail>();\n\n /**\n * Emitted when undo/redo is performed.\n *\n * @example\n * ```html\n * <tbw-grid (undoRedoAction)=\"onUndoRedo($event)\">...</tbw-grid>\n * ```\n */\n undoRedoAction = output<UndoRedoDetail>();\n\n /**\n * Emitted when export completes.\n *\n * @example\n * ```html\n * <tbw-grid (exportComplete)=\"onExportComplete($event)\">...</tbw-grid>\n * ```\n */\n exportComplete = output<ExportCompleteDetail>();\n\n /**\n * Emitted when print starts.\n *\n * @example\n * ```html\n * <tbw-grid (printStart)=\"onPrintStart($event)\">...</tbw-grid>\n * ```\n */\n printStart = output<PrintStartDetail>();\n\n /**\n * Emitted when print completes.\n *\n * @example\n * ```html\n * <tbw-grid (printComplete)=\"onPrintComplete($event)\">...</tbw-grid>\n * ```\n */\n printComplete = output<PrintCompleteDetail>();\n\n // Map of output names to event names for automatic wiring\n private readonly eventOutputMap = {\n cellClick: 'cell-click',\n rowClick: 'row-click',\n cellActivate: 'cell-activate',\n cellChange: 'cell-change',\n cellCommit: 'cell-commit',\n rowCommit: 'row-commit',\n changedRowsReset: 'changed-rows-reset',\n sortChange: 'sort-change',\n filterChange: 'filter-change',\n columnResize: 'column-resize',\n columnMove: 'column-move',\n columnVisibility: 'column-visibility',\n columnStateChange: 'column-state-change',\n selectionChange: 'selection-change',\n rowMove: 'row-move',\n groupToggle: 'group-toggle',\n treeExpand: 'tree-expand',\n detailExpand: 'detail-expand',\n responsiveChange: 'responsive-change',\n copy: 'copy',\n paste: 'paste',\n undoRedoAction: 'undo-redo',\n exportComplete: 'export-complete',\n printStart: 'print-start',\n printComplete: 'print-complete',\n } as const;\n\n // Store event listeners for cleanup\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private eventListeners: Map<string, (e: Event) => void> = new Map();\n\n ngOnInit(): void {\n // Create and register the adapter\n this.adapter = new AngularGridAdapter(this.injector, this.appRef, this.viewContainerRef);\n GridElementClass.registerAdapter(this.adapter);\n\n const grid = this.elementRef.nativeElement;\n\n // Wire up all event listeners based on eventOutputMap\n this.setupEventListeners(grid);\n\n // Register adapter on the grid element so MasterDetailPlugin can use it\n // 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\n /**\n * Sets up event listeners for all outputs using the eventOutputMap.\n */\n private setupEventListeners(grid: GridElement): void {\n // Wire up all event listeners\n for (const [outputName, eventName] of Object.entries(this.eventOutputMap)) {\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 feature inputs.\n * Uses the feature registry to allow tree-shaking - only imported features are bundled.\n * Returns the array of created plugins (doesn't modify grid).\n */\n private createFeaturePlugins(): unknown[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const plugins: unknown[] = [];\n\n // Helper to add plugin if feature is registered\n const addPlugin = (name: FeatureName, config: unknown) => {\n if (config === undefined || config === null || config === false) return;\n const plugin = createPluginFromFeature(name, config);\n if (plugin) plugins.push(plugin);\n };\n\n // Add plugins for each feature input\n addPlugin('selection', this.selection());\n addPlugin('editing', this.editing());\n addPlugin('clipboard', this.clipboard());\n addPlugin('contextMenu', this.contextMenu());\n // multiSort is the primary input; sorting is a deprecated alias\n addPlugin('multiSort', this.multiSort() ?? this.sorting());\n addPlugin('filtering', this.filtering());\n addPlugin('reorder', this.reorder());\n addPlugin('visibility', this.visibility());\n addPlugin('pinnedColumns', this.pinnedColumns());\n addPlugin('groupingColumns', this.groupingColumns());\n addPlugin('columnVirtualization', this.columnVirtualization());\n addPlugin('rowReorder', this.rowReorder());\n addPlugin('groupingRows', this.groupingRows());\n addPlugin('pinnedRows', this.pinnedRows());\n addPlugin('tree', this.tree());\n addPlugin('masterDetail', this.masterDetail());\n addPlugin('responsive', this.responsive());\n addPlugin('undoRedo', this.undoRedo());\n addPlugin('export', this.exportFeature());\n addPlugin('print', this.print());\n addPlugin('pivot', this.pivot());\n addPlugin('serverSide', this.serverSide());\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 // Configure MasterDetailPlugin after Angular templates are registered\n this.configureMasterDetail(grid);\n\n // Configure ResponsivePlugin card renderer if template is present\n this.configureResponsiveCard(grid);\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 /**\n * Configures the MasterDetailPlugin after Angular templates are registered.\n * - If plugin exists: refresh its detail renderer\n * - If plugin doesn't exist but <tbw-grid-detail> is present: dynamically import and add the plugin\n */\n private async configureMasterDetail(grid: GridElement): Promise<void> {\n if (!this.adapter) return;\n\n // Check for existing plugin by name to avoid importing the class\n const existingPlugin = grid.gridConfig?.plugins?.find((p) => (p as { name?: string }).name === 'masterDetail') as\n | MasterDetailPlugin\n | undefined;\n\n if (existingPlugin && typeof existingPlugin.refreshDetailRenderer === 'function') {\n // Plugin exists - just refresh the renderer to pick up Angular templates\n existingPlugin.refreshDetailRenderer();\n return;\n }\n\n // Check if <tbw-grid-detail> is present in light DOM\n const detailElement = (grid as unknown as Element).querySelector('tbw-grid-detail');\n if (!detailElement) return;\n\n // Create detail renderer from Angular template\n const detailRenderer = this.adapter.createDetailRenderer(grid as unknown as HTMLElement);\n if (!detailRenderer) return;\n\n // Parse configuration from attributes\n const animationAttr = detailElement.getAttribute('animation');\n let animation: 'slide' | 'fade' | false = 'slide';\n if (animationAttr === 'false') {\n animation = false;\n } else if (animationAttr === 'fade') {\n animation = 'fade';\n }\n\n const showExpandColumn = detailElement.getAttribute('showExpandColumn') !== 'false';\n\n // Dynamically import the plugin to avoid bundling it when not used\n const { MasterDetailPlugin } = await import('@toolbox-web/grid/plugins/master-detail');\n\n // Create and add the plugin\n const plugin = new MasterDetailPlugin({\n detailRenderer: detailRenderer,\n showExpandColumn,\n animation,\n });\n\n const currentConfig = grid.gridConfig || {};\n const existingPlugins = currentConfig.plugins || [];\n grid.gridConfig = {\n ...currentConfig,\n plugins: [...existingPlugins, plugin],\n };\n }\n\n /**\n * Configures the ResponsivePlugin with Angular template-based card renderer.\n * - If plugin exists: updates its cardRenderer configuration\n * - If plugin doesn't exist but <tbw-grid-responsive-card> is present: logs a warning\n */\n private configureResponsiveCard(grid: GridElement): void {\n if (!this.adapter) return;\n\n // Check if <tbw-grid-responsive-card> is present in light DOM\n const cardElement = (grid as unknown as Element).querySelector('tbw-grid-responsive-card');\n if (!cardElement) return;\n\n // Create card renderer from Angular template\n const cardRenderer = this.adapter.createResponsiveCardRenderer(grid as unknown as HTMLElement);\n if (!cardRenderer) return;\n\n // Find existing plugin by name to avoid importing the class\n const existingPlugin = grid.gridConfig?.plugins?.find((p) => (p as { name?: string }).name === 'responsive') as\n | ResponsivePlugin\n | undefined;\n\n if (existingPlugin && typeof existingPlugin.setCardRenderer === 'function') {\n // Plugin exists - update its cardRenderer\n existingPlugin.setCardRenderer(cardRenderer);\n return;\n }\n\n // Plugin doesn't exist - log a warning\n console.warn(\n '[tbw-grid-angular] <tbw-grid-responsive-card> found but ResponsivePlugin is not configured.\\n' +\n 'Add ResponsivePlugin to your gridConfig.plugins array:\\n\\n' +\n ' import { ResponsivePlugin } from \"@toolbox-web/grid/plugins/responsive\";\\n' +\n ' gridConfig = {\\n' +\n ' plugins: [new ResponsivePlugin({ breakpoint: 600 })]\\n' +\n ' };',\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 * @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\nexport { AngularGridAdapter } from './lib/angular-grid-adapter';\n\n// Angular-specific column/grid config types (for component-based renderers/editors)\nexport { isComponentClass } from './lib/angular-column-config';\nexport type {\n AngularCellEditor,\n AngularCellRenderer,\n AngularColumnConfig,\n AngularGridConfig,\n AngularTypeDefault,\n} from './lib/angular-column-config';\n\n// Type registry for application-wide type defaults\nexport { GRID_TYPE_DEFAULTS, GridTypeRegistry, provideGridTypeDefaults } 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 { ExportMethods, InjectGridReturn, SelectionMethods } 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// Directives and context types\nexport { BaseGridEditor } from './lib/base-grid-editor';\nexport { GridColumnEditor } from './lib/directives/grid-column-editor.directive';\nexport type { GridEditorContext } from './lib/directives/grid-column-editor.directive';\nexport { GridColumnView } from './lib/directives/grid-column-view.directive';\nexport type { GridCellContext } from './lib/directives/grid-column-view.directive';\nexport { GridDetailView } from './lib/directives/grid-detail-view.directive';\nexport type { GridDetailContext } from './lib/directives/grid-detail-view.directive';\nexport { GridFormArray, getFormArrayContext } from './lib/directives/grid-form-array.directive';\nexport type { FormArrayContext } from './lib/directives/grid-form-array.directive';\nexport { GridResponsiveCard } from './lib/directives/grid-responsive-card.directive';\nexport type { GridResponsiveCardContext } from './lib/directives/grid-responsive-card.directive';\nexport { GridToolPanel } from './lib/directives/grid-tool-panel.directive';\nexport type { GridToolPanelContext } from './lib/directives/grid-tool-panel.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\nexport { TbwEditor, TbwRenderer } from './lib/directives/structural-directives';\nexport type { StructuralCellContext, StructuralEditorContext } from './lib/directives/structural-directives';\n\n// Backwards compatibility aliases (deprecated)\nexport { TbwEditor as TbwCellEditor, TbwRenderer as TbwCellView } from './lib/directives/structural-directives';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["GridElementClass"],"mappings":";;;;;;;AA8JA;;;;;;;;;AASG;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,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