import * as _spartan_ng_brain_forms from '@spartan-ng/brain/forms'; import { ControlState, ChangeFn, TouchFn } from '@spartan-ng/brain/forms'; import * as _angular_core from '@angular/core'; import { InputSignal, ModelSignal, Signal, InjectionToken, Type, ExistingProvider, ValueProvider } from '@angular/core'; import { Highlightable, ActiveDescendantKeyManager } from '@angular/cdk/a11y'; import { BooleanInput } from '@angular/cdk/coercion'; import { ControlValueAccessor } from '@angular/forms'; import * as i1 from '@spartan-ng/brain/field'; declare class BrnAutocompleteInput { private static _id; private readonly _el; private readonly _autocomplete; /** The id of the autocomplete list, used for aria-controls. */ protected readonly _autocompleteListId: _angular_core.Signal; /** The id of the autocomplete input */ readonly id: _angular_core.InputSignal; /** The autocomplete purpose token. */ readonly autocomplete: _angular_core.InputSignal; /** Manual override for aria-invalid. When not set, auto-detects from the parent autocomplete error state. */ readonly ariaInvalidInput: _angular_core.InputSignalWithTransform; /** Forces the invalid state visually, regardless of form control state. */ readonly forceInvalid: _angular_core.InputSignalWithTransform; readonly disabled: _angular_core.Signal; /** Whether the autocomplete panel is expanded */ protected readonly _isExpanded: _angular_core.Signal; protected readonly _activeDescendant: _angular_core.WritableSignal; /** Computed aria-invalid: uses the manual override if provided, otherwise the error state matcher result. */ protected readonly _ariaInvalid: _angular_core.Signal; protected readonly _invalid: _angular_core.Signal; protected readonly _spartanInvalid: _angular_core.Signal; protected readonly _touched: _angular_core.Signal; protected readonly _dirty: _angular_core.Signal; private readonly _hasValue; constructor(); protected onInput(event: Event): void; protected onKeyDown(event: KeyboardEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "input[brnAutocompleteInput]", ["brnAutocompleteInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "ariaInvalidInput": { "alias": "aria-invalid"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class BrnAutocompleteItem implements Highlightable { private static _id; private readonly _platform; private readonly _elementRef; /** Access the autocomplete component */ private readonly _autocomplete; /** A unique id for the item */ readonly id: _angular_core.InputSignal; /** The value this item represents. */ readonly value: _angular_core.InputSignal; readonly _disabled: _angular_core.InputSignalWithTransform; /** Expose disabled as a value - used by the Highlightable interface */ get disabled(): boolean; /** Whether the item is selected. */ readonly active: _angular_core.Signal; protected readonly _highlighted: _angular_core.WritableSignal; private _activatedByPointer; setActiveStyles(): void; setInactiveStyles(): void; getLabel(): string; protected select(): void; protected activate(): void; /** Prevent the press from moving DOM focus off the trigger (aria-activedescendant model). */ protected onMouseDown(event: MouseEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[brnAutocompleteItem]", ["brnAutocompleteItem"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "_disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class BrnAutocompleteList { private static _id; private readonly _autocomplete; /** Determine if the autocomplete has any visible items */ protected readonly _visibleItems: _angular_core.Signal; /** The id of the autocomplete list */ readonly id: _angular_core.InputSignal; /** Optional accessible name for the listbox. Usually not needed as the autocomplete names the widget. */ readonly ariaLabel: _angular_core.InputSignal; /** Optional id of the element that labels the listbox. */ readonly ariaLabelledby: _angular_core.InputSignal; private readonly _label; protected readonly _ariaLabelledBy: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface BrnAutocompleteBase { itemToString: InputSignal | undefined>; search: ModelSignal; disabled: Signal; disabledState: Signal; keyManager: ActiveDescendantKeyManager>; value: ModelSignal | ModelSignal; visibleItems: Signal; isExpanded: Signal; searchInputWrapperWidth: Signal; controlState: Signal | undefined; listId: Signal; updateSearch: (value: string) => void; isSelected: (itemValue: T) => boolean; select: (itemValue: T) => void; open: () => void; close: () => void; resetValue: () => void; /** Select the active item with Enter key. */ selectActiveItem: () => void; registerAutocompleteInput: (input: BrnAutocompleteInput) => void; registerAutocompleteList: (list: BrnAutocompleteList) => void; updateInputWidth: (width: number | null) => void; } declare const BrnAutocompleteBaseToken: InjectionToken>; declare function provideBrnAutocompleteBase(autocomplete: Type>): ExistingProvider; declare function injectBrnAutocompleteBase(): BrnAutocompleteBase; type AutocompleteItemEqualToValue = (itemValue: T, selectedValue: T | undefined | null) => boolean; type AutocompleteItemToString = (itemValue: T) => string; interface BrnAutocompleteConfig { isItemEqualToValue: AutocompleteItemEqualToValue; itemToString?: AutocompleteItemToString; autoHighlight: boolean; } declare function provideBrnAutocompleteConfig(config: Partial>): ValueProvider; declare function injectBrnAutocompleteConfig(): BrnAutocompleteConfig; declare const BRN_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR: { provide: _angular_core.InjectionToken; useExisting: _angular_core.Type; multi: boolean; }; declare class BrnAutocomplete implements BrnAutocompleteBase, ControlValueAccessor { private readonly _injector; private readonly _fieldControl; private readonly _config; /** Access the popover if present */ private readonly _brnPopover; /** Whether the autocomplete is disabled */ readonly disabled: _angular_core.InputSignalWithTransform; protected readonly _disabled: _angular_core.WritableSignal; /** @internal The disabled state as a readonly signal */ readonly disabledState: _angular_core.Signal; /** A function to compare an item with the selected value. */ readonly isItemEqualToValue: _angular_core.InputSignal>; /** A function to convert an item to a string for display. */ readonly itemToString: _angular_core.InputSignal | undefined>; /** Whether to auto-highlight the first matching item. */ readonly autoHighlight: _angular_core.InputSignalWithTransform; /** The selected value of the autocomplete. */ readonly value: _angular_core.ModelSignal; /** The current search query. */ readonly search: _angular_core.ModelSignal; private readonly _inputWidth; /** @internal The width of the search input wrapper */ readonly searchInputWrapperWidth: _angular_core.Signal; /** @internal Access all the items within the autocomplete */ readonly items: _angular_core.Signal[]>; /** Determine if the autocomplete has any visible items */ readonly visibleItems: _angular_core.Signal; /** @internal The key manager for managing active descendant */ readonly keyManager: ActiveDescendantKeyManager>; /** @internal Whether the autocomplete is expanded */ readonly isExpanded: _angular_core.Signal; private readonly _activeDescendantId; /** @internal The id of the active option. */ readonly activeDescendantId: _angular_core.Signal; private readonly _autocompleteInput; private readonly _autocompleteList; /** @internal The id of the autocomplete list, registered by BrnAutocompleteList. Used by the input for aria-controls. */ readonly listId: _angular_core.Signal; protected _onChange?: ChangeFn; protected _onTouched?: TouchFn; readonly labelableId: _angular_core.Signal; readonly controlState: _angular_core.Signal<_spartan_ng_brain_forms.ControlState | null> | undefined; constructor(); registerAutocompleteInput(input: BrnAutocompleteInput): void; /** @internal Register the autocomplete list. Called by BrnAutocompleteList in its constructor. */ registerAutocompleteList(list: BrnAutocompleteList): void; updateInputWidth(width: number | null): void; updateSearch(value: string): void; isSelected(itemValue: T): boolean; select(itemValue: T): void; /** Select the active item with Enter key. */ selectActiveItem(): void; resetValue(): void; open(): void; close(): void; toggle(): void; /** CONTROL VALUE ACCESSOR */ writeValue(value: T | undefined | null): void; registerOnChange(fn: ChangeFn): void; registerOnTouched(fn: TouchFn): void; setDisabledState(isDisabled: boolean): void; protected _onFocusOut(event: FocusEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[brnAutocomplete]", ["brnAutocomplete"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "isItemEqualToValue": { "alias": "isItemEqualToValue"; "required": false; "isSignal": true; }; "itemToString": { "alias": "itemToString"; "required": false; "isSignal": true; }; "autoHighlight": { "alias": "autoHighlight"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "search": "searchChange"; }, ["items"], never, true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>; } declare class BrnAutocompleteAnchor { private readonly _host; private readonly _brnOverlay; private readonly _autocomplete; private readonly _elementSize; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnAutocompleteClear { private readonly _autocomplete; private readonly _renderer; private readonly _templateRef; private readonly _viewContainerRef; /** Determine if the autocomplete has a value or search text */ private readonly _shouldShowClear; constructor(); clear(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnAutocompleteContent { private readonly _autocomplete; /** Determine if the autocomplete has any visible items */ protected readonly _visibleItems: _angular_core.Signal; protected readonly _autocompleteWidth: _angular_core.Signal; protected readonly _dataState: _angular_core.Signal<"closed" | "open">; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnAutocompleteEmpty { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnAutocompleteGroup { /** Get the items in the group */ private readonly _items; /** Determine if there are any visible items in the group */ protected readonly _visible: _angular_core.Signal; /** Get the label associated with the group */ private readonly _label; protected readonly _labelledBy: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnAutocompleteLabel { private static _id; /** The id of the autocomplete label */ readonly id: _angular_core.InputSignal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare const BRN_AUTOCOMPLETE_SEARCH_VALUE_ACCESSOR: { provide: _angular_core.InjectionToken; useExisting: _angular_core.Type; multi: boolean; }; declare class BrnAutocompleteSearch implements BrnAutocompleteBase, ControlValueAccessor { private readonly _injector; private readonly _fieldControl; private readonly _config; /** Access the popover if present */ private readonly _brnPopover; readonly controlState: _angular_core.Signal<_spartan_ng_brain_forms.ControlState | null> | undefined; /** Whether the autocomplete is disabled */ readonly disabled: _angular_core.InputSignalWithTransform; protected readonly _disabled: _angular_core.WritableSignal; /** @internal The disabled state as a readonly signal */ readonly disabledState: _angular_core.Signal; /** A function to convert an item to a string for display. */ readonly itemToString: _angular_core.InputSignal | undefined>; /** Whether to auto-highlight the first matching item. */ readonly autoHighlight: _angular_core.InputSignalWithTransform; /** The selected value of the autocomplete. */ readonly value: _angular_core.ModelSignal; /** The current search query. */ readonly search: _angular_core.ModelSignal; private readonly _inputWidth; /** @internal The width of the search input wrapper */ readonly searchInputWrapperWidth: _angular_core.Signal; /** @internal Access all the items within the autocomplete */ readonly items: _angular_core.Signal[]>; /** Determine if the autocomplete has any visible items */ readonly visibleItems: _angular_core.Signal; /** @internal The key manager for managing active descendant */ readonly keyManager: ActiveDescendantKeyManager>; /** @internal Whether the autocomplete is expanded */ readonly isExpanded: _angular_core.Signal; private readonly _autocompleteInput; private readonly _autocompleteList; /** @internal The id of the autocomplete list, registered by BrnAutocompleteList. Used by the input for aria-controls. */ readonly listId: _angular_core.Signal; protected _onChange?: ChangeFn; protected _onTouched?: TouchFn; readonly labelableId: _angular_core.Signal; constructor(); registerAutocompleteInput(input: BrnAutocompleteInput): void; /** @internal Register the autocomplete list. Called by BrnAutocompleteList in its constructor. */ registerAutocompleteList(list: BrnAutocompleteList): void; updateInputWidth(width: number | null): void; updateSearch(value: string): void; isSelected(itemValue: T): boolean; select(itemValue: T): void; /** Select the active item with Enter key. */ selectActiveItem(): void; resetValue(): void; open(): void; close(): void; toggle(): void; /** CONTROL VALUE ACCESSOR */ writeValue(value: string | undefined | null): void; registerOnChange(fn: ChangeFn): void; registerOnTouched(fn: TouchFn): void; setDisabledState(isDisabled: boolean): void; protected _onFocusOut(event: FocusEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[brnAutocomplete]", ["brnAutocompleteSearch"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "itemToString": { "alias": "itemToString"; "required": false; "isSignal": true; }; "autoHighlight": { "alias": "autoHighlight"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "search": "searchChange"; }, ["items"], never, true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>; } declare class BrnAutocompleteSeparator { readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnAutocompleteStatus { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare const BrnAutocompleteItemToken: InjectionToken>; declare function provideBrnAutocompleteItem(autocomplete: Type>): ExistingProvider; declare const BrnAutocompleteImports: readonly [typeof BrnAutocomplete, typeof BrnAutocompleteAnchor, typeof BrnAutocompleteClear, typeof BrnAutocompleteContent, typeof BrnAutocompleteEmpty, typeof BrnAutocompleteGroup, typeof BrnAutocompleteInput, typeof BrnAutocompleteItem, typeof BrnAutocompleteLabel, typeof BrnAutocompleteList, typeof BrnAutocompleteSearch, typeof BrnAutocompleteSeparator, typeof BrnAutocompleteStatus]; export { BRN_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR, BRN_AUTOCOMPLETE_SEARCH_VALUE_ACCESSOR, BrnAutocomplete, BrnAutocompleteAnchor, BrnAutocompleteBaseToken, BrnAutocompleteClear, BrnAutocompleteContent, BrnAutocompleteEmpty, BrnAutocompleteGroup, BrnAutocompleteImports, BrnAutocompleteInput, BrnAutocompleteItem, BrnAutocompleteItemToken, BrnAutocompleteLabel, BrnAutocompleteList, BrnAutocompleteSearch, BrnAutocompleteSeparator, BrnAutocompleteStatus, injectBrnAutocompleteBase, injectBrnAutocompleteConfig, provideBrnAutocompleteBase, provideBrnAutocompleteConfig, provideBrnAutocompleteItem }; export type { AutocompleteItemEqualToValue, AutocompleteItemToString, BrnAutocompleteBase, BrnAutocompleteConfig };