import { FocusMonitor } from '@angular/cdk/a11y'; import { Clipboard } from '@angular/cdk/clipboard'; import { SelectionModel } from '@angular/cdk/collections'; import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, IterableDiffer, IterableDiffers, OnDestroy, QueryList, ViewContainerRef } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { FocusKeyManager } from '@koobiq/cdk/a11y'; import { MultipleMode } from '@koobiq/components/core'; import { Observable } from 'rxjs'; import { AsyncScheduler } from 'rxjs/internal/scheduler/AsyncScheduler'; import { FlatTreeControl } from './control/flat-tree-control'; import { KbqTreeNodeOutlet } from './outlet'; import { KbqTreeBase } from './tree-base'; import { KbqTreeOption, KbqTreeOptionEvent } from './tree-option.component'; import * as i0 from "@angular/core"; export declare const KBQ_SELECTION_TREE_VALUE_ACCESSOR: any; export declare class KbqTreeSelectAllEvent { source: KbqTreeSelection; options: T[]; constructor(source: KbqTreeSelection, options: T[]); } /** * Event class that occurs when copying an item from the KbqTreeSelection. * Used to pass data about the copied item and copy context. * * @param source - instance of KbqTreeSelection * @param option - instance of KbqTreeOption * @param event - original keyboard event (optional) that triggered the copy */ export declare class KbqTreeCopyEvent { source: KbqTreeSelection; option: T; event?: KeyboardEvent | undefined; constructor(source: KbqTreeSelection, option: T, event?: KeyboardEvent | undefined); } export declare class KbqTreeNavigationChange { source: KbqTreeSelection; option: T; constructor(source: KbqTreeSelection, option: T); } export declare class KbqTreeSelectionChange { source: KbqTreeSelection; option: T; options?: T[] | undefined; constructor(source: KbqTreeSelection, option: T, options?: T[] | undefined); } interface SelectionModelOption { id: number | string; value: string; } export declare class KbqTreeSelection extends KbqTreeBase implements ControlValueAccessor, AfterContentInit, AfterViewInit, OnDestroy { private elementRef; private scheduler; private clipboard; protected readonly focusMonitor: FocusMonitor; /** Indicates whether this component is placed inside a KbqFormField component. */ protected readonly inSelect: boolean; renderedOptions: QueryList; keyManager: FocusKeyManager; selectionModel: SelectionModel; resetFocusedItemOnBlur: boolean; multipleMode: MultipleMode | null; userTabIndex: number | null; optionShouldHoldFocusOnBlur: boolean; nodeOutlet: KbqTreeNodeOutlet; unorderedOptions: QueryList; treeControl: FlatTreeControl; readonly navigationChange: EventEmitter>; readonly selectionChange: EventEmitter>; readonly onSelectAll: EventEmitter>; readonly onCopy: EventEmitter>; private sortedNodes; private lastSyncedDataNodes; get autoSelect(): boolean; set autoSelect(value: boolean); private _autoSelect; get optionFocusChanges(): Observable; get optionBlurChanges(): Observable; get multiple(): boolean; get noUnselectLast(): boolean; set noUnselectLast(value: boolean); private _noUnselectLast; get disabled(): boolean; set disabled(rawValue: boolean); private _disabled; get tabIndex(): any; set tabIndex(value: any); private _tabIndex; get showCheckbox(): boolean; get isEmpty(): boolean; private optionFocusSubscription; private optionBlurSubscription; constructor(elementRef: ElementRef, scheduler: AsyncScheduler, differs: IterableDiffers, changeDetectorRef: ChangeDetectorRef, multiple: MultipleMode, clipboard: Clipboard); ngAfterContentInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; focus($event: any): void; highlightSelectedOption(): void; blur(): void; onKeyDown(event: KeyboardEvent): void; updateScrollSize(): void; setSelectedOptionsByKey(option: KbqTreeOption, shiftKey: boolean, ctrlKey: boolean): void; setSelectedOptionsByClick(option: KbqTreeOption, shiftKey: boolean, ctrlKey: boolean): void; selectActiveOptions(): void; setFocusedOption(option: KbqTreeOption): void; toggleFocusedOption(): void; renderNodeChanges(data: KbqTreeOption[], dataDiffer?: IterableDiffer, viewContainer?: ViewContainerRef, parentData?: KbqTreeOption): void; emitNavigationEvent(option: KbqTreeOption): void; emitChangeEvent(option: KbqTreeOption): void; selectAllOptions(): void; copyActiveOption(event: KeyboardEvent): void; writeValue(value: any): void; /** `View -> model callback called when value changes` */ onChange: (value: any) => void; registerOnChange(fn: (value: any) => void): void; /** `View -> model callback called when select has been touched` */ onTouched: () => void; registerOnTouched(fn: () => {}): void; /** * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor. */ setDisabledState(isDisabled: boolean): void; setOptionsFromValues(values: any[]): void; /** * Rebinds orphan node references in selectionModel to current treeControl.dataNodes by value. * Needed after dataSource.data is replaced — selectionModel holds references to old node * objects, but options render with new ones, so toggle()/isSelected() break on identity. */ private syncSelectionModelToDataNodes; getSelectedValues(): any[]; getItemHeight(): number; setStateChildren(option: KbqTreeOption, state: boolean): void; private onCopyDefaultHandler; private getHeight; private updateTabIndex; private updateRenderedOptions; private getSortedNodes; private allowFocusEscape; private resetOptions; private dropSubscriptions; private listenToOptionsFocus; /** * 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; /** Checks whether any of the options is focused. */ private hasFocusedOption; private markOptionsForCheck; private updateOptionsFocus; private canDeselectLast; private isFocusReceivedFromNestedOption; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};