import * as _bootkit_ng1_localization from '@bootkit/ng1/localization'; import * as _bootkit_ng1_common from '@bootkit/ng1/common'; import * as _angular_core from '@angular/core'; import { ElementRef, TemplateRef, EventEmitter } from '@angular/core'; import { DataSource, DataSourceLike } from '@bootkit/ng1/data'; import { ControlValueAccessor } from '@angular/forms'; import { ScrollStrategy, ConnectedPosition } from '@angular/cdk/overlay'; import { ListItemSelectEvent } from '@bootkit/ng1/components/list'; /** * Select component that allows users to choose an option from a dropdown list. */ declare class SelectComponent implements ControlValueAccessor { private _viewpoerRulerSubscription?; private readonly _injector; private _filterElementRef?; private _listComponent?; private _changeCallback; private _touchCallback; protected readonly _sourceItems: _angular_core.WritableSignal; protected readonly _selectedItems: Set; protected readonly _isDisabled: _angular_core.WritableSignal; protected _scrollStrategy: ScrollStrategy; protected _positions: ConnectedPosition[]; private readonly _overlay; protected readonly _elementRef: ElementRef; protected readonly _filterValue: _angular_core.WritableSignal; private readonly _renderer; private readonly _viewportRuler; private readonly _changeDetectorRef; private readonly _value; /** * Template for rendering each item in the select component. */ itemTemplate?: TemplateRef; /** * The data source for the select component. * This can be an array of data, a function that returns an observable of data, * or an instance of DataSource. */ readonly source: _angular_core.InputSignalWithTransform, DataSourceLike>; /** * Indicates whether multi selection is enabled or not. */ readonly multiple: _angular_core.InputSignalWithTransform; /** * Indicates whether to show selection indicator (checkbox/radio) next to each item. * Default is false. */ readonly showSelectionIndicator: _angular_core.InputSignalWithTransform; /** * Indicates whether the dropdown is open or closed. */ readonly open: _angular_core.ModelSignal; /** * A comparer to compare items for selection. */ readonly compareBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.EqualityComparer, _bootkit_ng1_common.EqualityComparerLike>; /** * A fromatter to convert each item to a string for display. */ readonly formatBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_localization.ObjectFormatter, _bootkit_ng1_localization.ObjectFormatterLike>; /** * Custom value writer to extract the value of any object while writing values. */ readonly writeBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.ValueWriter, _bootkit_ng1_common.ValueWriterLike>; /** * Indicates whether the select component is filterable. */ readonly filterable: _angular_core.InputSignalWithTransform; /** * Custom filter function to filter items based on a filter value. * Default checks if the item contains the filter value (case-insensitive). */ readonly filterBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.FilterPredicate, _bootkit_ng1_common.FilterPredicateLike>; /** * Placeholder text for the filter input field. */ readonly filterPlaceholder: _angular_core.InputSignal; /** * CSS class or classes to apply to the items. */ readonly itemClass: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.CssClassGetter | undefined, _bootkit_ng1_common.CssClassLike>; /** * A function that generates unique ids for each item in the list. * If set to a function, it will be called with the item as an argument to generate the id. * If set to undefined, no ids will be generated for the items. * @default undefined */ readonly idGenerator: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.IdGenerator | undefined, _bootkit_ng1_common.IdGeneratorLike>; /** * Event emitted when the selected value changes. */ readonly itemSelect: EventEmitter; constructor(); /** * Indicates whether the given value is selected. * @param item * @returns */ isSelected(value: any): boolean; /** * Selects the given value. * @param item */ select(value: any): void; /** * Deselects the given value. * @param item */ deselect(value: any): void; /** * Toggles the selection state of the given value. * @param item */ toggle(value: any): void; writeValue(obj: any): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState?(isDisabled: boolean): void; private _findAndSelectItems; private _updateValue; protected _onOverlayAttach(): void; protected _onOverlayDetach(): void; protected _onListSelectionChange(e: ListItemSelectEvent): void; protected _filterPredicate: _angular_core.Signal<(item: any) => boolean>; protected _onFilterKeydown(e: KeyboardEvent): void; private _listenToResizeEvents; private _unlistenFromResizeEvents; protected _onHostKeydown(e: KeyboardEvent): void; protected _onHostClick(e: MouseEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * Event emitted when the selection state of the select component changes by user interaction. */ interface ItemSelectEvent { /** * The value of the item that was selected or deselected. */ value: any; /** * The select component that emitted the event. */ readonly select: SelectComponent; } /** * Select module. */ declare class SelectModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } export { SelectComponent, SelectModule }; export type { ItemSelectEvent };