UNPKG

2.07 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 { AfterViewInit, ElementRef, EventEmitter, NgZone, Renderer2 } from '@angular/core';
7import { Subject } from 'rxjs';
8import { NbStatusService } from '../../services/status.service';
9import { NbFocusMonitor } from '../cdk/a11y/a11y.module';
10import { NbInputDirective } from '../input/input.directive';
11export interface NbTagInputAddEvent {
12 input: ElementRef<HTMLInputElement>;
13 value: string;
14}
15/**
16 *
17 * `[nbTagInput]` directive connects input with a `nb-tag-list` component.
18 *
19 * @stacked-example(Tag Input, tag/tag-input.component)
20 *
21 * @additional-example(Tag Input with Autocomplete, tag/tag-input-with-autocomplete.component)
22 *
23 * @styles
24 *
25 * tag-list-tiny-tag-offset:
26 * tag-list-small-tag-offset:
27 * tag-list-medium-tag-offset:
28 * tag-list-large-tag-offset:
29 * tag-list-giant-tag-offset:
30 * tag-list-with-input-tiny-padding:
31 * tag-list-with-input-small-padding:
32 * tag-list-with-input-medium-padding:
33 * tag-list-with-input-large-padding:
34 * tag-list-with-input-giant-padding:
35 */
36export declare class NbTagInputDirective extends NbInputDirective implements AfterViewInit {
37 _hostElement: ElementRef<HTMLInputElement>;
38 protected focusMonitor: NbFocusMonitor;
39 protected renderer: Renderer2;
40 protected zone: NgZone;
41 protected statusService: NbStatusService;
42 protected readonly keyDown$: Subject<KeyboardEvent>;
43 get _value(): string;
44 /**
45 * Controls which keys should trigger tag add event.
46 */
47 separatorKeys: number[];
48 /**
49 * Emits when a tag need to be added.
50 */
51 tagAdd: EventEmitter<NbTagInputAddEvent>;
52 readonly nbTagInputClass = true;
53 _onKeydown(event: KeyboardEvent): void;
54 constructor(_hostElement: ElementRef<HTMLInputElement>, focusMonitor: NbFocusMonitor, renderer: Renderer2, zone: NgZone, statusService: NbStatusService);
55 ngAfterViewInit(): void;
56 protected isSeparatorKey(keyCode: number): boolean;
57}