UNPKG

2.88 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Akveo. All Rights Reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
5 */
6import { ChangeDetectorRef, ElementRef, EventEmitter, QueryList, AfterContentInit, OnDestroy } from '@angular/core';
7import { NgClass } from '@angular/common';
8import { Subject } from 'rxjs';
9import { NbComponentSize } from '../component-size';
10import { NbPosition } from '../cdk/overlay/overlay-position';
11import { NbOptionComponent } from '../option/option.component';
12import { NbPortalDirective } from '../cdk/overlay/mapping';
13/**
14 * The `NbAutocompleteComponent` overlay component.
15 * Provides an `NbOptionList` overlay component.
16 * */
17export declare class NbAutocompleteComponent<T> implements AfterContentInit, OnDestroy {
18 protected cd: ChangeDetectorRef;
19 protected destroy$: Subject<void>;
20 /**
21 * HTML input reference to which autocomplete connected.
22 * */
23 hostRef: ElementRef;
24 /**
25 * Component scoped id for aria attributes.
26 * */
27 id: string;
28 /**
29 * @docs-private
30 * Current overlay position because of we have to toggle overlayPosition
31 * in [ngClass] direction.
32 */
33 _overlayPosition: NbPosition;
34 get overlayPosition(): NbPosition;
35 set overlayPosition(value: NbPosition);
36 /**
37 * Returns width of the input.
38 * */
39 get hostWidth(): number;
40 /**
41 * Function passed as input to process each string option value before render.
42 * */
43 handleDisplayFn: ((value: any) => string);
44 /**
45 * Autocomplete size, available sizes:
46 * `tiny`, `small`, `medium` (default), `large`, `giant`
47 */
48 size: NbComponentSize;
49 /**
50 * Flag passed as input to always make first option active.
51 * */
52 activeFirst: boolean;
53 /**
54 * Specifies class to be set on `nb-option`s container (`nb-option-list`)
55 * */
56 optionsListClass: NgClass['ngClass'];
57 /**
58 * Specifies class for the overlay panel with options
59 * */
60 optionsPanelClass: string | string[];
61 /**
62 * Will be emitted when selected value changes.
63 * */
64 selectedChange: EventEmitter<T>;
65 /**
66 * List of `NbOptionComponent`'s components passed as content.
67 * */
68 options: QueryList<NbOptionComponent<T>>;
69 /**
70 * NbOptionList with options content.
71 * */
72 portal: NbPortalDirective;
73 constructor(cd: ChangeDetectorRef);
74 ngAfterContentInit(): void;
75 ngOnDestroy(): void;
76 /**
77 * Autocomplete knows nothing about host html input element.
78 * So, attach method set input hostRef for styling.
79 * */
80 setHost(hostRef: ElementRef): void;
81 /**
82 * Propagate selected value.
83 * */
84 emitSelected(selected: T): void;
85 get tiny(): boolean;
86 get small(): boolean;
87 get medium(): boolean;
88 get large(): boolean;
89 get giant(): boolean;
90}
91
\No newline at end of file