import { FocusMonitor } from '@angular/cdk/a11y'; import { Clipboard } from '@angular/cdk/clipboard'; import { SelectionModel } from '@angular/cdk/collections'; import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, QueryList } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { FocusKeyManager, IFocusableOption } from '@koobiq/cdk/a11y'; import { KbqOptgroup, KbqOptionActionComponent, KbqPseudoCheckbox, KbqTitleTextRef, MultipleMode } from '@koobiq/components/core'; import { KbqDropdownTrigger } from '@koobiq/components/dropdown'; import { KbqTooltipTrigger } from '@koobiq/components/tooltip'; import { Observable, Subject } from 'rxjs'; import * as i0 from "@angular/core"; export interface KbqOptionEvent { option: KbqListOption; } export declare const KBQ_SELECTION_LIST_VALUE_ACCESSOR: any; export declare class KbqListSelectionChange { source: KbqListSelection; option: KbqListOption; constructor(source: KbqListSelection, option: KbqListOption); } export declare class KbqListSelectAllEvent { source: KbqListSelection; options: T[]; constructor(source: KbqListSelection, options: T[]); } /** * Event class that occurs when copying an item from the KbqListSelection. * Used to pass data about the copied item and copy context. * * @param source - instance of KbqListSelection * @param option - instance of KbqListOption * @param event - original keyboard event (optional) that triggered the copy */ export declare class KbqListCopyEvent { source: KbqListSelection; option: T; event?: KeyboardEvent | undefined; constructor(source: KbqListSelection, option: T, event?: KeyboardEvent | undefined); } export declare class KbqListSelection implements AfterContentInit, AfterViewInit, OnDestroy, ControlValueAccessor { private elementRef; private changeDetectorRef; private clipboard; protected readonly focusMonitor: FocusMonitor; keyManager: FocusKeyManager; options: QueryList; readonly onSelectAll: EventEmitter>; readonly onCopy: EventEmitter>; get autoSelect(): boolean; set autoSelect(value: boolean); private _autoSelect; get noUnselectLast(): boolean; set noUnselectLast(value: boolean); private _noUnselectLast; multipleMode: MultipleMode | null; get multiple(): boolean; horizontal: boolean; get tabIndex(): any; set tabIndex(value: any); private _tabIndex; get disabled(): boolean; set disabled(value: boolean); private _disabled; /** * Function used for comparing an option against the selected value when determining which * options should appear as selected. The first argument is the value of an options. The second * one is a value from the selected value. A boolean must be returned. */ compareWith: (o1: any, o2: any) => boolean; userTabIndex: number | null; get showCheckbox(): boolean; readonly selectionChange: EventEmitter; selectionModel: SelectionModel; get optionFocusChanges(): Observable; get optionBlurChanges(): Observable; _value: string[] | null; private readonly destroyRef; private optionFocusSubscription; private optionBlurSubscription; constructor(elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef, multiple: MultipleMode, clipboard: Clipboard); ngAfterContentInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; focus(): void; blur(): void; selectAll(): void; deselectAll(): void; updateScrollSize(): void; setSelectedOptionsByClick(option: KbqListOption, shiftKey: boolean, ctrlKey: boolean): void; setSelectedOptionsByKey(option: KbqListOption, shiftKey: boolean, ctrlKey: boolean): void; selectActiveOptions(): void; writeValue(values: string[]): void; registerOnChange(fn: (value: any) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; getSelectedOptionValues(): string[]; toggleFocusedOption(): void; canDeselectLast(listOption: KbqListOption): boolean; /** @docs-private */ getHeight(): number; onTouched: () => void; removeOptionFromList(option: KbqListOption): void; /** Handles keydown events on the list. */ onKeyDown(event: KeyboardEvent): void; reportValueChange(): void; emitChangeEvent(option: KbqListOption): void; private initializeSelection; protected updateTabIndex(): void; private onCopyDefaultHandler; private resetOptions; private dropSubscriptions; private listenToOptionsFocus; /** Checks whether any of the options is focused. */ private hasFocusedOption; private getOptionByValue; private setOptionsFromValues; /** * Utility to ensure all indexes are valid. * @param index The index to be checked. * @returns True if the index is valid for our list of options. */ private isValidIndex; private getOptionIndex; private onChange; private selectAllOptions; private copyActiveOption; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_horizontal: unknown; static ngAcceptInputType_disabled: unknown; } export declare class KbqListOptionCaption { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Component for list-options of selection-list. Each list-option can automatically * generate a checkbox and can put current item into the selectionModel of selection-list * if the current item is selected. */ export declare class KbqListOption implements OnDestroy, OnInit, IFocusableOption, KbqTitleTextRef { private elementRef; private changeDetector; private ngZone; listSelection: KbqListSelection; readonly group: KbqOptgroup; hasFocus: boolean; preventBlur: boolean; readonly onFocus: Subject; readonly onBlur: Subject; actionButton: KbqOptionActionComponent; tooltipTrigger: KbqTooltipTrigger; dropdownTrigger: KbqDropdownTrigger; pseudoCheckbox: KbqPseudoCheckbox; text: ElementRef; textElement: ElementRef; checkboxPosition: 'before' | 'after'; /** * This is set to true after the first OnChanges cycle so we don't clear the value of `selected` * in the first cycle. */ private inputsInitialized; get value(): any; set value(newValue: any); private _value; /** Whether list is disabled. */ get disabled(): boolean; set disabled(value: boolean); private _disabled; get showCheckbox(): any; set showCheckbox(value: any); private _showCheckbox; get selected(): boolean; set selected(value: boolean); private _selected; get tabIndex(): any; get externalPseudoCheckbox(): boolean; constructor(elementRef: ElementRef, changeDetector: ChangeDetectorRef, ngZone: NgZone, listSelection: KbqListSelection, group: KbqOptgroup); ngOnInit(): void; ngOnDestroy(): void; toggle(): void; getLabel(): any; setSelected(selected: boolean): void; /** @docs-private */ getHeight(): number; /** Handles click events on the list option. */ handleClick($event: MouseEvent): void; onKeydown($event: any): void; focus(): void; blur(): void; getHostElement(): HTMLElement; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_selected: unknown; }