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, QueryList, EventEmitter } from '@angular/core'; import { DataSource, DataSourceLike } from '@bootkit/ng1/data'; import { ControlValueAccessor } from '@angular/forms'; /** * ListItem represents an individual item within a ListComponent. */ declare class ListItem { /** * The value associated with the item. This can be of any type. */ readonly value: _angular_core.InputSignal; /** * The id of the item. */ readonly id: _angular_core.InputSignal; /** * Reference to the parent list component */ readonly list: ListComponent; /** * Reference to the host element */ readonly elementRef: ElementRef; /** * Indicates whether the item is active. * @returns True if the item is active, false otherwise. */ isActive(): boolean; /** * Indicates whether the item is selected. * @returns True if the item is selected, false otherwise. */ isSelected(): boolean; /** * Selects the item. * @returns */ select(): void; /** * Deselects the item. * @returns */ deselect(): void; /** * Toggles the selection state of the item. * @returns void */ toggle(): void; /** * Scrolls the item into view within its parent container. * @param position The vertical alignment of the item after scrolling. * Can be 'start', 'center', 'end', or 'nearest'. * Default is 'nearest'. * @param behavior The scrolling behavior. */ scrollIntoView(position?: ScrollLogicalPosition, behavior?: ScrollBehavior): void; /** * Sets focus on the item. */ focus(): void; protected _getTabIndex(): 0 | -1 | undefined; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * ListComponent is a versatile component that displays a list of items with support for single or multiple selection, * custom item templates, filtering, and keyboard navigation. */ declare class ListComponent implements ControlValueAccessor { private _localizationService; private _changeDetector; private _injector; private _changeCallback?; private _touchCallback?; private readonly _selectedItems; protected readonly _sourceItems: _angular_core.WritableSignal; protected _itemTemplate?: TemplateRef; protected readonly _activeItem: _angular_core.WritableSignal; protected readonly _isDisabled: _angular_core.WritableSignal; private readonly _value; private _renderer; /** * A list of all visible list items. */ readonly listItems?: QueryList; /** * Reference to the host element */ elementRef: ElementRef; /** * 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; /** * A comparer to compare items for selection. * Default uses strict equality (===). */ readonly compareBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.EqualityComparer, _bootkit_ng1_common.EqualityComparerLike>; /** * A fromatter to convert each item to a string for display. * Default converts the item to a string using its toString method. */ 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>; /** * Custom filter function to filter items. * Default is a noop filter that does not filter any items. */ readonly filterBy: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.FilterPredicate, _bootkit_ng1_common.FilterPredicateLike>; /** * A function that uniquely identifies each item in the list. * If set to a function, it will be called with the index and item as arguments to generate the unique id. * If set to a string, it will be used as the property name to extract the unique id from each item. * Two predifined trackBy options are available: * - '@index': uses the index of the item as its unique id. * - '@item': uses the item itself as its unique id. * @example * trackBy="@index" * trackBy="@item" * trackBy="objectFieldName" * [trackBy]="customTrackByFunction" * @default trackByIndex */ readonly trackBy: _angular_core.InputSignalWithTransform<_angular_core.TrackByFunction, _bootkit_ng1_common.TrackByLike>; /** * CSS class or classes to apply to the list container. * Default is undefined. */ readonly itemClass: _angular_core.InputSignalWithTransform<_bootkit_ng1_common.CssClassGetter | undefined, _bootkit_ng1_common.CssClassLike>; /** * Defines the focus behavior of the list component. * - 'none': No keyboard interaction is possible. The list cannot be focused. * - 'roving': Roving tabindex is enabled. The list can be focused and the active item is tabbable. * - 'activeDescendant': The list can be focused, but no item is tabbable. The active item is indicated using aria-activedescendant. * @default 'activeDescendant'. */ readonly focusMode: _angular_core.InputSignal<"none" | "roving" | "activeDescendant">; /** * 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 selection state of an item changes by user interaction. */ readonly itemSelect: EventEmitter; /** * The template to use for each item in the list. */ readonly itemTemplate: _angular_core.InputSignal | undefined>; constructor(); /** * Indicates whether an item is active. * @param item * @returns */ isActive(item: ListItem): boolean; /** * 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; /** * Deselects all items in the list. */ deselectAll(): void; /** * Selects all items in the list. Only applicable in multiple selection mode. */ selectAll(): void; /** * Gets the current value(s) of the list. */ get value(): ReadonlyArray; /** * Gets the current items in the list. */ get items(): ReadonlyArray; writeValue(value: any): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState?(isDisabled: boolean): void; protected _handleUserSelection(item: ListItem, index: number): void; protected _showLoadingSppiner: _angular_core.Signal; private _updateSelectedItems; private _activateFirstSelectedItem; private _updateValue; protected _hostAriaActiveDescendant: _angular_core.Signal; protected _hostTabIndex: _angular_core.Signal<0 | undefined>; protected _onHostBlur(): void; protected _onKeydown(e: KeyboardEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * Event emitted when the selection state of the list changes by user interaction. */ interface ListItemSelectEvent { /** * The value of the item that was selected or deselected. */ value: any; /** * The item that was selected or deselected. */ readonly item: ListItem; /** * The list component that emitted the event. */ readonly list: ListComponent; } /** * List module. */ declare class ListModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } export { ListComponent, ListModule }; export type { ListItemSelectEvent };