import * as i0 from '@angular/core'; import { TemplateRef, InputSignal, Signal, InputSignalWithTransform, TrackByFunction, InjectionToken, OutputEmitterRef } from '@angular/core'; import { VariantProps } from 'class-variance-authority'; /** * Structural directive that captures the template for a header cell. * * Use with the star syntax inside a `comColumnDef` container. * * @tokens none * * @example * ```html * * Name * {{ row.name }} * * ``` */ declare class ComHeaderCellDef { readonly templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** Template context for body cell definitions. */ interface CellDefContext { $implicit: T; index: number; } /** * Structural directive that captures the template for a body cell. * * Use with the star syntax inside a `comColumnDef` container. * * @tokens none * * @example * ```html * * Name * {{ row.name }} * * ``` */ declare class ComCellDef { readonly templateRef: TemplateRef>; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[comCellDef]", never, {}, {}, never, never, true, never>; } /** * Structural directive that captures the template for a footer cell. * * Use with the star syntax inside a `comColumnDef` container. * * @tokens none * * @example * ```html * * Amount * {{ row.amount | currency }} * {{ total() | currency }} * * ``` */ declare class ComFooterCellDef { readonly templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Defines a single column in a `com-table`. * * Contains a header cell template, a body cell template, and an optional footer cell template. * * @tokens none * * @example * ```html * * Name * {{ row.name }} * * ``` */ declare class ComColumnDef { /** The column name — used to match header/row column lists. */ readonly name: InputSignal; /** @internal Header cell template for this column. */ readonly headerCellDef: Signal; /** @internal Body cell template for this column. */ readonly cellDef: Signal; /** @internal Optional footer cell template for this column. */ readonly footerCellDef: Signal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Defines which columns appear in the header row and their order. * * @tokens none * * @example * ```html * * ``` * * @example Sticky header row * ```html * * ``` * * @example Custom class on header row * ```html * * ``` */ declare class ComHeaderRowDef { /** Ordered list of column names to display. */ readonly columns: InputSignal; /** Makes this header row sticky (alternative to table-level `stickyHeader`). */ readonly sticky: InputSignalWithTransform; /** Additional CSS classes to merge onto the header ``. */ readonly headerRowClass: InputSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Defines which columns appear in each body row and their order. * * @tokens none * * @example * ```html * * ``` * * @example Custom class on body rows * ```html * * ``` */ declare class ComRowDef { /** Ordered list of column names to display per body row. */ readonly columns: InputSignal; /** Additional CSS classes to merge onto each body ``. */ readonly rowClass: InputSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Defines which columns appear in the footer row and their order. * * @tokens none * * @example * ```html * * ``` * * @example Custom class on footer row * ```html * * ``` */ declare class ComFooterRowDef { /** Ordered list of column names in the footer. */ readonly columns: InputSignal; /** Additional CSS classes to merge onto the footer ``. */ readonly footerRowClass: InputSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Structural directive for the empty-state row shown when the data source is empty. * * Place inside `com-table`. The template receives the column count for colspan. * * @tokens none * * @example * ```html * * * * * * No results found. * * * * ``` */ declare class ComNoDataRow { readonly templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Abstract data source for ComTable. * * Implement `connect()` to provide a signal of data, and `disconnect()` to clean up. * The table calls `connect()` on init and `disconnect()` on destroy. * * @example Signal-based data source * ```typescript * class MyDataSource extends ComDataSource { * private readonly data = signal([]); * * connect(): Signal { * return this.data.asReadonly(); * } * * disconnect(): void { * // cleanup if needed * } * * setData(users: User[]): void { * this.data.set(users); * } * } * ``` */ declare abstract class ComDataSource { /** Returns a signal of the current data set. Called once when the table initializes. */ abstract connect(): Signal; /** Cleanup resources. Called when the table is destroyed. */ abstract disconnect(): void; } /** * Simple array-backed data source. * * Wraps a plain array in a writable signal so it can be used with ComTable's DataSource API. */ declare class ComArrayDataSource extends ComDataSource { private readonly data; constructor(initialData?: T[]); connect(): Signal; disconnect(): void; /** Replace the entire data set. */ setData(data: T[]): void; } /** * Type guard to check if a value is a ComDataSource instance. */ declare function isDataSource(value: unknown): value is ComDataSource; /** The types that ComTable accepts for its dataSource input. */ type ComTableDataSourceInput = T[] | ComDataSource; type TableVariant = 'default' | 'striped'; type TableDensity = 'compact' | 'default' | 'comfortable'; type HeaderVariant = 'default' | 'muted'; /** * CVA variants for the table container wrapper. */ declare const tableContainerVariants: (props?: Record) => string; type TableContainerVariants = VariantProps; /** * CVA variants for the `` element. * * @tokens `--color-foreground` */ declare const tableVariants: (props?: Record) => string; type TableVariants = VariantProps; /** * CVA variants for the `` element. * * @tokens `--color-background`, `--color-muted`, `--color-muted-foreground`, `--color-border` */ declare const tableHeaderVariants: (props?: { sticky?: boolean; headerVariant?: HeaderVariant; }) => string; type TableHeaderVariants = VariantProps; /** * CVA variants for the header `` — applies base styles to child `` rows — includes row-level styles and child `` — applies base styles to child `
` cells via child selectors. * * @tokens `--color-muted-foreground` */ declare const tableHeaderRowVariants: (props?: { density?: TableDensity; }) => string; type TableHeaderRowVariants = VariantProps; /** * CVA variants for `
` cell styles. * * @tokens `--color-border-subtle`, `--color-muted`, `--color-muted-hover` */ declare const tableRowVariants: (props?: { variant?: TableVariant; density?: TableDensity; }) => string; type TableRowVariants = VariantProps; /** * CVA variants for the footer `
` cells via child selectors. * * @tokens `--color-foreground`, `--color-border` */ declare const tableFooterRowVariants: (props?: { density?: TableDensity; }) => string; type TableFooterRowVariants = VariantProps; /** @deprecated Use `tableHeaderRowVariants` instead. */ declare const tableHeaderCellVariants: typeof tableHeaderRowVariants; /** @deprecated Use `tableHeaderRowVariants` instead. */ type TableHeaderCellVariants = TableHeaderRowVariants; /** @deprecated Body cell styles are now part of `tableRowVariants`. */ declare const tableBodyCellVariants: typeof tableRowVariants; /** @deprecated Body cell styles are now part of `tableRowVariants`. */ type TableBodyCellVariants = TableRowVariants; /** @deprecated Use `tableFooterRowVariants` instead. */ declare const tableFooterCellVariants: typeof tableFooterRowVariants; /** @deprecated Use `tableFooterRowVariants` instead. */ type TableFooterCellVariants = TableFooterRowVariants; /** * Declarative data table component using native HTML `` semantics. * * Define columns via `comColumnDef` with `*comHeaderCellDef` and `*comCellDef`, * then declare row structure via `comHeaderRowDef` and `comRowDef`. * * Accepts either a plain `T[]` or a `ComDataSource` for the data source. * * @tokens `--color-background`, `--color-foreground`, `--color-muted`, `--color-muted-foreground`, * `--color-muted-hover`, `--color-border`, `--color-border-subtle` * * @example Basic table * ```html * * * * * * * * * * * * * * * ``` * * @example With DataSource * ```typescript * class UserDataSource extends ComDataSource { * private data = signal([]); * connect() { return this.data.asReadonly(); } * disconnect() {} * setData(users: User[]) { this.data.set(users); } * } * ``` * ```html * * ... * * ``` */ declare class ComTable { private readonly destroyRef; private readonly rowClickRef; /** The data to render — accepts a plain array or a ComDataSource. */ readonly dataSource: InputSignal>; /** Track function for `@for`. Defaults to tracking by index. */ readonly trackByFn: InputSignal>; /** Visual treatment of body rows. */ readonly variant: InputSignal; /** Row height / cell padding. */ readonly density: InputSignal; /** Whether the header row sticks on scroll. */ readonly stickyHeader: InputSignalWithTransform; /** Shows a loading overlay with spinner. */ readonly loading: InputSignalWithTransform; /** Accessible label for the table element. */ readonly ariaLabel: InputSignal; /** Additional CSS classes to merge onto the host element. */ readonly userClass: InputSignal; /** Additional CSS classes to merge onto the container `
`. */ readonly containerClass: InputSignal; /** Additional CSS classes to merge onto the `
Name{{ row.name }}Email{{ row.email }}
` element. */ readonly tableClass: InputSignal; /** Additional CSS classes to merge onto the `` element. */ readonly theadClass: InputSignal; /** Visual treatment of the header — `'muted'` adds a filled background. */ readonly headerVariant: InputSignal; /** @internal All column definitions projected into the table. */ readonly columnDefs: Signal; /** @internal Header row definition. */ readonly headerRowDef: Signal; /** @internal Body row definition. */ readonly rowDef: Signal; /** @internal Optional footer row definition. */ readonly footerRowDef: Signal; /** @internal Optional no-data row template. */ readonly noDataRow: Signal; /** @internal Map of column name → column definition for O(1) lookup. */ protected readonly columnDefMap: Signal>; /** @internal Resolved render data — handles both array and DataSource inputs. */ readonly renderData: Signal; /** @internal Header column names. */ protected readonly headerColumns: Signal; /** @internal Body column names — public for ComRowClick event delegation. */ readonly bodyColumns: Signal; /** @internal Footer column names. */ protected readonly footerColumns: Signal; /** @internal Whether the header should be sticky. */ private readonly isSticky; /** @internal Whether body rows are clickable (ComRowClick directive is active). */ protected readonly isRowClickable: Signal; protected readonly hostClass: Signal; protected readonly containerClasses: Signal; protected readonly tableClasses: Signal; protected readonly theadClasses: Signal; protected readonly headerTrClasses: Signal; protected readonly trClasses: Signal; protected readonly footerTrClasses: Signal; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "com-table", ["comTable"], { "dataSource": { "alias": "dataSource"; "required": false; "isSignal": true; }; "trackByFn": { "alias": "trackByFn"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "containerClass": { "alias": "containerClass"; "required": false; "isSignal": true; }; "tableClass": { "alias": "tableClass"; "required": false; "isSignal": true; }; "theadClass": { "alias": "theadClass"; "required": false; "isSignal": true; }; "headerVariant": { "alias": "headerVariant"; "required": false; "isSignal": true; }; }, {}, ["columnDefs", "headerRowDef", "rowDef", "footerRowDef", "noDataRow"], never, true, never>; } /** Data context that ComTable pushes to ComRowClick to avoid circular DI. */ interface ComRowClickContext { readonly renderData: Signal; readonly bodyColumns: Signal; } /** Minimal interface that ComTable reads to detect an active row-click directive. */ interface ComRowClickRef { /** Whether row-click behavior is currently active (exists and not disabled). */ readonly isActive: Signal; /** Called by ComTable to provide data context — avoids circular injection. */ _setContext(ctx: ComRowClickContext): void; } /** * Injection token used by ComTable to optionally detect a ComRowClick directive. * Breaks the circular dependency between ComTable and ComRowClick. */ declare const COM_ROW_CLICK: InjectionToken; /** * Attribute directive that enables click-to-act on `` body rows. * * Uses event delegation — a single click/keydown listener on the `
` element — * rather than per-row bindings. When a user clicks or presses Enter/Space on a body row, * the directive resolves the row data and emits it, unless the click originated from an * excluded column's cell. * * @tokens `--color-ring` * * @example Basic * ```html * * ... * * ``` * * @example With column exclusion * ```html * * ... * * ``` */ declare class ComRowClick implements ComRowClickRef { private readonly elementRef; private readonly renderer; private readonly destroyRef; private readonly document; /** @internal Context pushed by ComTable — avoids circular DI. */ private context; /** Column names whose cells do NOT trigger the row click output. */ readonly comRowClickExclude: InputSignal; /** Disables all row click behavior — removes cursor, tabindex, and event handling. */ readonly comRowClickDisabled: InputSignalWithTransform; /** Emits the row data object when a non-excluded cell is clicked or activated via keyboard. */ readonly comRowClick: OutputEmitterRef; /** Whether row-click behavior is currently active. */ readonly isActive: Signal; /** @internal Called by ComTable to provide data context. */ _setContext(ctx: ComRowClickContext): void; constructor(); private handleEvent; private emitRow; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "com-table[comRowClick]", ["comRowClick"], { "comRowClickExclude": { "alias": "comRowClickExclude"; "required": false; "isSignal": true; }; "comRowClickDisabled": { "alias": "comRowClickDisabled"; "required": false; "isSignal": true; }; }, { "comRowClick": "comRowClick"; }, never, never, true, never>; } export { COM_ROW_CLICK, ComArrayDataSource, ComCellDef, ComColumnDef, ComDataSource, ComFooterCellDef, ComFooterRowDef, ComHeaderCellDef, ComHeaderRowDef, ComNoDataRow, ComRowClick, ComRowDef, ComTable, isDataSource, tableBodyCellVariants, tableContainerVariants, tableFooterCellVariants, tableFooterRowVariants, tableHeaderCellVariants, tableHeaderRowVariants, tableHeaderVariants, tableRowVariants, tableVariants }; export type { CellDefContext, ComRowClickRef, ComTableDataSourceInput, HeaderVariant, TableBodyCellVariants, TableContainerVariants, TableDensity, TableFooterCellVariants, TableFooterRowVariants, TableHeaderCellVariants, TableHeaderRowVariants, TableHeaderVariants, TableRowVariants, TableVariant, TableVariants };