UNPKG

@alauda/ui

Version:

Angular UI components by Alauda Frontend Team.

84 lines (83 loc) 4.36 kB
import { AfterContentInit, AfterViewInit, ElementRef, EventEmitter, OnDestroy, QueryList } from '@angular/core'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; import { CommonFormControl } from '../form'; import { ComponentSize } from '../internal/types'; import { TooltipDirective } from '../tooltip'; import { OptionContentDirective } from './helper-directives'; import { OptionComponent } from './option/option.component'; import { OptionFilterFn, SelectFilterOption, TrackFn } from './select.types'; import * as i0 from "@angular/core"; export declare abstract class BaseSelect<T, V = T> extends CommonFormControl<V> implements AfterContentInit, AfterViewInit, OnDestroy { get size(): ComponentSize; set size(val: ComponentSize); filterable: boolean; clearable: boolean; filterFn: OptionFilterFn<T>; trackFn: TrackFn<T>; labelFn?: (value: T) => string; allowCreate: boolean; get allOptions(): OptionComponent<T>[]; get opened(): boolean; get inaction(): boolean; get filterString(): string; set filterString(val: string); loading: boolean; placeholder: string; defaultFirstOption: boolean; lazy: boolean; filterChange: EventEmitter<string>; show: EventEmitter<void>; hide: EventEmitter<void>; protected selectRef: ElementRef<HTMLElement>; protected tooltipRef: TooltipDirective; protected optionListRef: ElementRef<HTMLDivElement>; protected inputtingOption: OptionComponent<T>; protected optionContent?: OptionContentDirective; customOptions: QueryList<OptionComponent<T>>; contentOptions: QueryList<OptionComponent<T>>; isTemplateRef: (label: any) => label is import("@angular/core").TemplateRef<unknown>; isMulti: boolean; /** * Utility field to make sure the users always see the value as type array */ abstract readonly values$: Observable<T[]>; allOptions$: Observable<Array<OptionComponent<T>>>; protected focusedOption: OptionComponent<T>; private _size; private _filterString; protected destroy$$: Subject<void>; protected size$$: BehaviorSubject<ComponentSize>; private readonly filterString$$; size$: Observable<ComponentSize>; filterString$: Observable<string>; optionVisibles$: Observable<boolean[]>; hasVisibleOption$: Observable<boolean>; hasMatchedOption$: Observable<boolean>; customCreatedOptions$: Observable<Array<SelectFilterOption<T>>>; containerWidth: string; ngAfterContentInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; openOption(): void; closeOption(): void; onShowOptions(): void; onHideOptions(): void; onInput(event: Event): void; onKeyDown(event: KeyboardEvent): void; onOptionClick(option: OptionComponent<T>): void; protected autoFocusFirstOption(): void; protected focusOptionDir(dir: 'down' | 'up'): void; protected resetFocusedOption(focusedOption?: OptionComponent<T>): void; protected scrollToOption(option: OptionComponent<T>): void; protected selectFocusedOption(): void; protected escSelect(): void; private _trackFn; private _filterFn; abstract selectOption(option: OptionComponent<T>): void; abstract clearValue(event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration<BaseSelect<any, any>, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<BaseSelect<any, any>, never, never, { "size": { "alias": "size"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "filterFn": { "alias": "filterFn"; "required": false; }; "trackFn": { "alias": "trackFn"; "required": false; }; "labelFn": { "alias": "labelFn"; "required": false; }; "allowCreate": { "alias": "allowCreate"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "defaultFirstOption": { "alias": "defaultFirstOption"; "required": false; }; "lazy": { "alias": "lazy"; "required": false; }; }, { "filterChange": "filterChange"; "show": "show"; "hide": "hide"; }, ["optionContent", "contentOptions"], never, true, never>; static ngAcceptInputType_filterable: unknown; static ngAcceptInputType_clearable: unknown; static ngAcceptInputType_allowCreate: unknown; }