UNPKG

4.89 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 { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, QueryList, Renderer2 } from '@angular/core';
7import { Subject } from 'rxjs';
8import { NbLayoutDirectionService } from '../../services/direction.service';
9import { NbStatusService } from '../../services/status.service';
10import { NbFocusMonitor } from '../cdk/a11y/a11y.module';
11import { NbActiveDescendantKeyManager, NbActiveDescendantKeyManagerFactoryService } from '../cdk/a11y/descendant-key-manager';
12import { NbBooleanInput } from '../helpers';
13import { NbComponentSize } from '../component-size';
14import { NbAutocompleteDirective } from '../autocomplete/autocomplete.directive';
15import { NbTagComponent } from './tag.component';
16import { NbTagInputDirective } from './tag-input.directive';
17import * as i0 from "@angular/core";
18/**
19 *
20 * `nb-tag-list` component displays a list of `nb-tag` components.
21 *
22 * @stacked-example(Tag List Showcase, tag/tag-showcase.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 * tag-list-with-input-rectangle-border-radius:
37 * tag-list-with-input-semi-round-border-radius:
38 * tag-list-with-input-round-border-radius:
39 */
40export declare class NbTagListComponent implements OnInit, AfterContentInit, AfterViewInit, OnDestroy {
41 protected hostElement: ElementRef<HTMLElement>;
42 protected cd: ChangeDetectorRef;
43 protected renderer: Renderer2;
44 protected zone: NgZone;
45 protected focusMonitor: NbFocusMonitor;
46 protected activeDescendantKeyManagerFactory: NbActiveDescendantKeyManagerFactoryService<NbTagComponent>;
47 protected directionService: NbLayoutDirectionService;
48 protected statusService: NbStatusService;
49 protected readonly destroy$: Subject<void>;
50 protected readonly keyDown$: Subject<KeyboardEvent>;
51 protected readonly tagClick$: Subject<NbTagComponent>;
52 protected focused: boolean;
53 protected keyManager: NbActiveDescendantKeyManager<NbTagComponent>;
54 tags: QueryList<NbTagComponent>;
55 tagInput: NbTagInputDirective;
56 autocompleteDirective: NbAutocompleteDirective<any>;
57 /**
58 * Controls tags offset.
59 */
60 size: NbComponentSize;
61 tabIndex: number;
62 role: string;
63 get multiple(): boolean;
64 set multiple(value: boolean);
65 protected _multiple: boolean;
66 static ngAcceptInputType_multiple: NbBooleanInput;
67 activeTagId: string | null;
68 /**
69 * Emits when tag need to be removed (whether because of click on the remove button
70 * or when `delete` or `backspace` key pressed).
71 */
72 readonly tagRemove: EventEmitter<NbTagComponent>;
73 get _hasInput(): boolean;
74 get _isFocused(): boolean;
75 get _isFullWidth(): boolean;
76 get _inputClasses(): string[];
77 _onKeydown(event: KeyboardEvent): void;
78 _onClick({ target }: MouseEvent): void;
79 constructor(hostElement: ElementRef<HTMLElement>, cd: ChangeDetectorRef, renderer: Renderer2, zone: NgZone, focusMonitor: NbFocusMonitor, activeDescendantKeyManagerFactory: NbActiveDescendantKeyManagerFactoryService<NbTagComponent>, directionService: NbLayoutDirectionService, statusService: NbStatusService);
80 ngOnInit(): void;
81 ngAfterContentInit(): void;
82 ngAfterViewInit(): void;
83 ngOnDestroy(): void;
84 protected initKeyManager(): void;
85 protected listenToLayoutDirectionChange(): void;
86 protected listenListKeyDown(): void;
87 protected listenInputKeyDown(): void;
88 protected listenTagClick(): void;
89 protected listenTagRemove(): void;
90 protected listenTagDestroy(): void;
91 protected listenNoTags(): void;
92 protected listenActiveTagChange(): void;
93 protected onFocusChange(isFocused: boolean): void;
94 protected isBackspaceOrDelete(keyCode: number): boolean;
95 protected setAutocompleteCustomHost(): void;
96 protected toggleTag(tagToToggle: NbTagComponent): void;
97 protected focusInput(): void;
98 protected focusInputIfActive(): void;
99 static ɵfac: i0.ɵɵFactoryDeclaration<NbTagListComponent, never>;
100 static ɵcmp: i0.ɵɵComponentDeclaration<NbTagListComponent, "nb-tag-list", ["nbTagList"], { "size": { "alias": "size"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "role": { "alias": "role"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; }, { "tagRemove": "tagRemove"; }, ["tagInput", "autocompleteDirective", "tags"], ["nb-tag, input[nbTagInput]"], false, never>;
101}