UNPKG

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