import { EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core'; import { ColumnDefinition, ColumnValueOption } from 'verben-ng-ui/src/lib/components/data-table'; import { FilterOperator, FilterOperatorType, FilterCondition } from './data-filter.types'; import * as i0 from "@angular/core"; /** A filter chip in the panel's list: a condition plus its active state. */ type SavedFilter = FilterCondition & { selected: boolean; }; export declare class DataFilterComponent implements OnInit, OnChanges { columns: ColumnDefinition[]; data: T[]; /** * Optional restored filters: the panel opens pre-populated with these as * selected filter chips. Applied once (the first time a non-empty value * arrives) so it never clobbers the user's in-progress edits afterwards. */ initialFilters?: FilterCondition[]; filterApplied: EventEmitter; resetFilter: EventEmitter; filterableColumns: ColumnDefinition[]; availableOperators: FilterOperator[]; savedFilters: SavedFilter[]; currentFilter: Partial; showAllFilters: boolean; maxVisibleItems: number; currentColumnType: FilterOperatorType | null; /** * Options for the value dropdown when the selected column is bool or enum. * Always normalised to `{ label, value }` so the template binds one shape. */ valueOptions: ColumnValueOption[]; /** * Held as strings rather than booleans: `verben-drop-down` gates its selected * label on a truthiness check, so an option valued `false` would render as * though nothing were picked. Coerced back to a boolean in `addFilter`. */ private readonly boolOptions; private userTouched; /** * The saved filter currently loaded into the operation row, if any. Held by * reference rather than by index so deleting or reordering another filter * cannot retarget the write-back. */ private editingFilter; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; /** * Seed the saved-filter chips from the restored filters. Skipped once the user * has touched the panel so it never overwrites their in-progress edits. */ private hydrateSavedFilters; /** Marks the panel as user-edited (called from template interactions). */ markTouched(): void; private initializeFilterableColumns; onColumnSelect(columnId: string): void; /** * Derives the value control, operators and options for a column without * touching the operator or value already in the operation row — `editFilter` * depends on those surviving, where `onColumnSelect` clears them first. */ private applyColumnContext; addFilter(): void; /** Loads a saved filter back into the operation row for correction. */ editFilter(filter: SavedFilter): void; /** * Converts a stored value back into what the value control expects: bools are * held as real booleans but the dropdown's options are the strings * 'true'/'false' (see `boolOptions`), and the native date input needs * 'YYYY-MM-DD' rather than a `Date` a host may have restored. */ private toEditableValue; /** Removes a saved filter. Required filters cannot be removed. */ deleteFilter(filter: SavedFilter): void; /** Empties the operation row, abandoning any edit in progress. */ clearCurrentFilter(): void; /** True when the filter's column is declared `isRequiredFilter`. */ isRequired(filter: FilterCondition): boolean; private isRequiredColumn; isEditing(filter: SavedFilter): boolean; /** * Locks the property dropdown while a required filter is being edited — * switching it to another column would drop the required filter entirely. */ get isEditingRequired(): boolean; getFilterDescription(filter: FilterCondition): string; /** Renders a stored filter value the way it was chosen, not as raw data. */ private getValueLabel; private getOperatorLabel; /** * Prefers the type declared on the column, falling back to inspecting the data * only when the host has not declared one. */ private resolveColumnType; private mapValueType; /** * Best-effort type detection for columns that declare no `valueType`. Falls * back to 'string' rather than null so the value field always renders. */ private inferColumnType; /** * Scans rows for the first usable sample — sampling only the first row misses * the type whenever that row happens to hold a null or undefined value. */ private firstNonEmptyValue; private readValue; /** * Dates usually arrive from an API as ISO strings, which would otherwise be * typed as plain text. Anchored to ISO-ish input so ordinary strings that * `Date` happens to parse (e.g. "March") are not misread as dates. */ private isDateString; /** Accepts either supported `valueOptions` shape and returns one of them. */ private normalizeValueOptions; private resetCurrentFilter; resetAll(): void; applyFilters(): void; getColumnLabel(columnId: string): string; /** * Required filters pinned to the top so the collapsed list can never hide one * behind "Show More". */ get orderedFilters(): SavedFilter[]; get visibleFilters(): SavedFilter[]; get activeFilterCount(): number; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "lib-data-filter", never, { "columns": { "alias": "columns"; "required": false; }; "data": { "alias": "data"; "required": false; }; "initialFilters": { "alias": "initialFilters"; "required": false; }; }, { "filterApplied": "filterApplied"; "resetFilter": "resetFilter"; }, never, never, false, never>; } export {};