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 { Signal, InputSignal, ModelSignal, 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 BrnSelectItem implements Highlightable { private static _id; private readonly _platform; private readonly _elementRef; /** Access the select component */ private readonly _select; /** 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, "[brnSelectItem]", ["brnSelectItem"], { "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 BrnSelectList { private static _id; private readonly _select; /** The id of the select list */ readonly id: _angular_core.InputSignal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnSelectTrigger { private static _id; private readonly _host; private readonly _brnOverlay; private readonly _select; private readonly _elementSize; readonly id: _angular_core.InputSignal; /** Whether to force the trigger into an invalid state. */ readonly forceInvalid: _angular_core.InputSignalWithTransform; /** Manual override for aria-invalid. When not set, auto-detects from the parent autocomplete error state. */ readonly ariaInvalidInput: _angular_core.InputSignalWithTransform; protected readonly _activeDescendant: _angular_core.WritableSignal; /** Whether the combobox panel is expanded */ protected readonly _isExpanded: _angular_core.Signal; /** The id of the select list, used for aria-controls. */ protected readonly _listId: _angular_core.Signal; protected readonly _disabled: _angular_core.Signal; protected readonly _isPlaceholder: _angular_core.Signal; /** Computed aria-invalid: uses the manual override if provided, otherwise the error state matcher result. */ protected readonly _ariaInvalid: _angular_core.Signal; protected readonly _touched: _angular_core.Signal; protected readonly _dirty: _angular_core.Signal; protected readonly _spartanInvalid: _angular_core.Signal; constructor(); protected toggle(): void; protected open(): void; /** Listen for keydown events */ protected onKeyDown(event: KeyboardEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface BrnSelectBase { disabledState: Signal; itemToString: InputSignal | undefined>; keyManager: ActiveDescendantKeyManager>; value: ModelSignal | ModelSignal; hasValue: Signal; isExpanded: Signal; triggerWidth: Signal; controlState?: Signal; listId: Signal; isSelected: (itemValue: T) => boolean; select: (itemValue: T) => void; /** Select the active item via keyboard (Enter or Space while expanded). */ selectActiveItem: () => void; open: () => void; close: () => void; toggle: () => void; registerSelectTrigger: (input: BrnSelectTrigger) => void; /** Register the select list component so the trigger can reference its id via aria-controls */ registerSelectList: (list: BrnSelectList) => void; updateTriggerWidth: (width: number | null) => void; } declare const BrnSelectBaseToken: InjectionToken>; declare function provideBrnSelectBase(instance: Type>): ExistingProvider; /** * Inject the select component. */ declare function injectBrnSelectBase(): BrnSelectBase; type SelectItemEqualToValue = (itemValue: T, selectedValue: T | undefined | null) => boolean; type SelectItemToString = (itemValue: T) => string; interface BrnSelectConfig { isItemEqualToValue: SelectItemEqualToValue; /** * Determines whether a single value is present (i.e., has been selected). * Considers `undefined`, `null`, and empty string as "not present". * Only used by {@link BrnSelectComponent} (single select), ignored by the multiple select variant. */ isSingleValuePresent: (value: T | undefined | null) => boolean; itemToString?: SelectItemToString; } declare function provideBrnSelectConfig(config: Partial>): ValueProvider; declare function injectBrnSelectConfig(): BrnSelectConfig; declare const BRN_SELECT_VALUE_ACCESSOR: { provide: _angular_core.InjectionToken; useExisting: _angular_core.Type; multi: boolean; }; declare class BrnSelect implements BrnSelectBase, ControlValueAccessor { private readonly _injector; private readonly _fieldControl; private readonly _config; readonly controlState: _angular_core.Signal<_spartan_ng_brain_forms.ControlState | null> | undefined; /** Access the popover if present */ private readonly _brnPopover; /** Whether the select 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; /** The selected value of the select. */ readonly value: _angular_core.ModelSignal; /** * Determines whether a single value is present (i.e., has been selected). * Considers `undefined`, `null`, and empty string as "not present". * Only used by single select, ignored by the multiple select variant. */ readonly isSingleValuePresent: _angular_core.InputSignal<(value: T | undefined | null) => boolean>; readonly hasValue: _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>; private readonly _triggerWidth; /** @internal The width of the trigger wrapper */ readonly triggerWidth: _angular_core.Signal; /** @internal Access all the items within the select */ readonly items: _angular_core.Signal[]>; /** @internal The key manager for managing active descendant */ readonly keyManager: ActiveDescendantKeyManager>; /** @internal Whether the select is expanded */ readonly isExpanded: _angular_core.Signal; private readonly _selectTrigger; readonly labelableId: _angular_core.Signal; private readonly _selectList; /** @internal The id of the select list, registered by BrnSelectList. Used by the trigger for aria-controls. */ readonly listId: _angular_core.Signal; protected _onChange?: ChangeFn; protected _onTouched?: TouchFn; constructor(); registerSelectTrigger(input: BrnSelectTrigger): void; /** @internal Register the select list. Called by BrnSelectList in its constructor. */ registerSelectList(list: BrnSelectList): void; updateTriggerWidth(width: number | null): void; isSelected(itemValue: T): boolean; select(itemValue: T): void; /** Select the active item via keyboard (Enter or Space while expanded). */ selectActiveItem(): 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; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[brnSelect]", ["brnSelect"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "isSingleValuePresent": { "alias": "isSingleValuePresent"; "required": false; "isSignal": true; }; "isItemEqualToValue": { "alias": "isItemEqualToValue"; "required": false; "isSignal": true; }; "itemToString": { "alias": "itemToString"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["items"], never, true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>; } declare class BrnSelectContent { private readonly _select; protected readonly _selectWidth: _angular_core.Signal; private readonly _elementRef; private readonly _scrollUp; readonly showScrollUp: _angular_core.Signal; private readonly _scrollDown; readonly showScrollDown: _angular_core.Signal; protected readonly _dataState: _angular_core.Signal<"closed" | "open">; constructor(); handleScroll(): void; private _checkScroll; scrollDown(stop: () => void): void; scrollUp(stop: () => void): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnSelectGroup { private readonly _selectLabel; protected readonly _labelledby: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnSelectLabel { private static _id; readonly id: _angular_core.InputSignal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare const BRN_SELECT_MULTIPLE_VALUE_ACCESSOR: { provide: _angular_core.InjectionToken; useExisting: _angular_core.Type; multi: boolean; }; declare class BrnSelectMultiple implements BrnSelectBase, ControlValueAccessor { private readonly _injector; private readonly _fieldControl; private readonly _config; readonly controlState: _angular_core.Signal<_spartan_ng_brain_forms.ControlState | null> | undefined; /** Access the popover if present */ private readonly _brnPopover; /** Whether the combobox 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; /** The selected value of the select. */ readonly value: _angular_core.ModelSignal; readonly hasValue: _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>; private readonly _triggerWidth; /** @internal The width of the trigger wrapper */ readonly triggerWidth: _angular_core.Signal; /** @internal Access all the items within the select */ readonly items: _angular_core.Signal[]>; /** @internal The key manager for managing active descendant */ readonly keyManager: ActiveDescendantKeyManager>; /** @internal Whether the select is expanded */ readonly isExpanded: _angular_core.Signal; private readonly _selectTrigger; readonly labelableId: _angular_core.Signal; private readonly _selectList; /** @internal The id of the select list, registered by BrnSelectList. Used by the trigger for aria-controls. */ readonly listId: _angular_core.Signal; protected _onChange?: ChangeFn; protected _onTouched?: TouchFn; constructor(); registerSelectTrigger(input: BrnSelectTrigger): void; /** @internal Register the select list. Called by BrnSelectList in its constructor. */ registerSelectList(list: BrnSelectList): void; updateTriggerWidth(width: number | null): void; isSelected(itemValue: T): boolean; select(itemValue: T): void; /** Select the active item via keyboard (Enter or Space while expanded). */ selectActiveItem(): 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; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[brnSelectMultiple]", ["brnSelectMultiple"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "isItemEqualToValue": { "alias": "isItemEqualToValue"; "required": false; "isSignal": true; }; "itemToString": { "alias": "itemToString"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["items"], never, true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>; } declare class BrnSelectPlaceholder { private readonly _select; protected readonly _hasValue: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnSelectScrollDown { private readonly _el; private readonly _destroyRef; private readonly _selectContent; protected readonly _showScrollDown: _angular_core.Signal; private readonly _endReached; protected _scrollDown(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnSelectScrollUp { private readonly _el; private readonly _destroyRef; private readonly _selectContent; protected readonly _showScrollUp: _angular_core.Signal; private readonly _endReached; protected _scrollUp(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnSelectSeparator { readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnSelectValue { private readonly _select; readonly placeholder: _angular_core.InputSignal; protected readonly _isPlaceholder: _angular_core.Signal; readonly hidden: _angular_core.Signal; protected readonly _value: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[brnSelectValue]", ["brnSelectValue"], { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class BrnSelectValueTemplate { private readonly _templateRef; private readonly _viewContainerRef; private readonly _select; protected readonly _value: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[brnSelectValueTemplate]", ["brnSelectValueTemplate"], {}, {}, never, never, true, never>; } declare class BrnSelectValues { private readonly _templateRef; private readonly _viewContainerRef; private readonly _select; protected readonly _values: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[brnSelectValues]", ["brnSelectValues"], {}, {}, never, never, true, never>; } declare const BrnSelectItemToken: InjectionToken>; declare function provideBrnSelectItem(selectItem: Type>): ExistingProvider; declare const BrnSelectImports: readonly [typeof BrnSelect, typeof BrnSelectContent, typeof BrnSelectGroup, typeof BrnSelectItem, typeof BrnSelectLabel, typeof BrnSelectList, typeof BrnSelectMultiple, typeof BrnSelectPlaceholder, typeof BrnSelectScrollUp, typeof BrnSelectScrollDown, typeof BrnSelectSeparator, typeof BrnSelectTrigger, typeof BrnSelectValue, typeof BrnSelectValueTemplate, typeof BrnSelectValues]; export { BRN_SELECT_MULTIPLE_VALUE_ACCESSOR, BRN_SELECT_VALUE_ACCESSOR, BrnSelect, BrnSelectBaseToken, BrnSelectContent, BrnSelectGroup, BrnSelectImports, BrnSelectItem, BrnSelectItemToken, BrnSelectLabel, BrnSelectList, BrnSelectMultiple, BrnSelectPlaceholder, BrnSelectScrollDown, BrnSelectScrollUp, BrnSelectSeparator, BrnSelectTrigger, BrnSelectValue, BrnSelectValueTemplate, BrnSelectValues, injectBrnSelectBase, injectBrnSelectConfig, provideBrnSelectBase, provideBrnSelectConfig, provideBrnSelectItem }; export type { BrnSelectBase, BrnSelectConfig, SelectItemEqualToValue, SelectItemToString };