1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { BooleanInput } from '@angular/cdk/coercion';
|
---|
9 | import { AfterContentInit, ElementRef, EventEmitter, OnChanges, OnDestroy } from '@angular/core';
|
---|
10 | import { MatChipsDefaultOptions } from './chip-default-options';
|
---|
11 | import { MatChipList } from './chip-list';
|
---|
12 | import { MatChipTextControl } from './chip-text-control';
|
---|
13 | /** Represents an input event on a `matChipInput`. */
|
---|
14 | import * as ɵngcc0 from '@angular/core';
|
---|
15 | export interface MatChipInputEvent {
|
---|
16 | /**
|
---|
17 | * The native `<input>` element that the event is being fired for.
|
---|
18 | * @deprecated Use `MatChipInputEvent#chipInput.inputElement` instead.
|
---|
19 | * @breaking-change 13.0.0 This property will be removed.
|
---|
20 | */
|
---|
21 | input: HTMLInputElement;
|
---|
22 | /** The value of the input. */
|
---|
23 | value: string;
|
---|
24 | /**
|
---|
25 | * Reference to the chip input that emitted the event.
|
---|
26 | * @breaking-change 13.0.0 This property will be made required.
|
---|
27 | */
|
---|
28 | chipInput?: MatChipInput;
|
---|
29 | }
|
---|
30 | /**
|
---|
31 | * Directive that adds chip-specific behaviors to an input element inside `<mat-form-field>`.
|
---|
32 | * May be placed inside or outside of an `<mat-chip-list>`.
|
---|
33 | */
|
---|
34 | export declare class MatChipInput implements MatChipTextControl, OnChanges, OnDestroy, AfterContentInit {
|
---|
35 | protected _elementRef: ElementRef<HTMLInputElement>;
|
---|
36 | private _defaultOptions;
|
---|
37 | /** Used to prevent focus moving to chips while user is holding backspace */
|
---|
38 | private _focusLastChipOnBackspace;
|
---|
39 | /** Whether the control is focused. */
|
---|
40 | focused: boolean;
|
---|
41 | _chipList: MatChipList;
|
---|
42 | /** Register input for chip list */
|
---|
43 | set chipList(value: MatChipList);
|
---|
44 | /**
|
---|
45 | * Whether or not the chipEnd event will be emitted when the input is blurred.
|
---|
46 | */
|
---|
47 | get addOnBlur(): boolean;
|
---|
48 | set addOnBlur(value: boolean);
|
---|
49 | _addOnBlur: boolean;
|
---|
50 | /**
|
---|
51 | * The list of key codes that will trigger a chipEnd event.
|
---|
52 | *
|
---|
53 | * Defaults to `[ENTER]`.
|
---|
54 | */
|
---|
55 | separatorKeyCodes: readonly number[] | ReadonlySet<number>;
|
---|
56 | /** Emitted when a chip is to be added. */
|
---|
57 | readonly chipEnd: EventEmitter<MatChipInputEvent>;
|
---|
58 | /** The input's placeholder text. */
|
---|
59 | placeholder: string;
|
---|
60 | /** Unique id for the input. */
|
---|
61 | id: string;
|
---|
62 | /** Whether the input is disabled. */
|
---|
63 | get disabled(): boolean;
|
---|
64 | set disabled(value: boolean);
|
---|
65 | private _disabled;
|
---|
66 | /** Whether the input is empty. */
|
---|
67 | get empty(): boolean;
|
---|
68 | /** The native input element to which this directive is attached. */
|
---|
69 | readonly inputElement: HTMLInputElement;
|
---|
70 | constructor(_elementRef: ElementRef<HTMLInputElement>, _defaultOptions: MatChipsDefaultOptions);
|
---|
71 | ngOnChanges(): void;
|
---|
72 | ngOnDestroy(): void;
|
---|
73 | ngAfterContentInit(): void;
|
---|
74 | /** Utility method to make host definition/tests more clear. */
|
---|
75 | _keydown(event?: KeyboardEvent): void;
|
---|
76 | /**
|
---|
77 | * Pass events to the keyboard manager. Available here for tests.
|
---|
78 | */
|
---|
79 | _keyup(event: KeyboardEvent): void;
|
---|
80 | /** Checks to see if the blur should emit the (chipEnd) event. */
|
---|
81 | _blur(): void;
|
---|
82 | _focus(): void;
|
---|
83 | /** Checks to see if the (chipEnd) event needs to be emitted. */
|
---|
84 | _emitChipEnd(event?: KeyboardEvent): void;
|
---|
85 | _onInput(): void;
|
---|
86 | /** Focuses the input. */
|
---|
87 | focus(options?: FocusOptions): void;
|
---|
88 | /** Clears the input */
|
---|
89 | clear(): void;
|
---|
90 | /** Checks whether a keycode is one of the configured separators. */
|
---|
91 | private _isSeparatorKey;
|
---|
92 | static ngAcceptInputType_addOnBlur: BooleanInput;
|
---|
93 | static ngAcceptInputType_disabled: BooleanInput;
|
---|
94 | static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<MatChipInput, never>;
|
---|
95 | static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<MatChipInput, "input[matChipInputFor]", ["matChipInput", "matChipInputFor"], { "separatorKeyCodes": "matChipInputSeparatorKeyCodes"; "placeholder": "placeholder"; "id": "id"; "chipList": "matChipInputFor"; "addOnBlur": "matChipInputAddOnBlur"; "disabled": "disabled"; }, { "chipEnd": "matChipInputTokenEnd"; }, never>;
|
---|
96 | }
|
---|
97 |
|
---|
98 | //# sourceMappingURL=chip-input.d.ts.map |
---|