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 { Platform } from '@angular/cdk/platform';
|
---|
10 | import { AutofillMonitor } from '@angular/cdk/text-field';
|
---|
11 | import { AfterViewInit, DoCheck, ElementRef, NgZone, OnChanges, OnDestroy } from '@angular/core';
|
---|
12 | import { FormGroupDirective, NgControl, NgForm } from '@angular/forms';
|
---|
13 | import { CanUpdateErrorState, ErrorStateMatcher } from '@angular/material/core';
|
---|
14 | import { MatFormFieldControl, MatFormField } from '@angular/material/form-field';
|
---|
15 | import { Subject } from 'rxjs';
|
---|
16 | /** @docs-private */
|
---|
17 | declare const _MatInputBase: import("@angular/material/core/common-behaviors/constructor").Constructor<CanUpdateErrorState> & import("@angular/material/core/common-behaviors/constructor").AbstractConstructor<CanUpdateErrorState> & {
|
---|
18 | new (_defaultErrorStateMatcher: ErrorStateMatcher, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, ngControl: NgControl): {
|
---|
19 | _defaultErrorStateMatcher: ErrorStateMatcher;
|
---|
20 | _parentForm: NgForm;
|
---|
21 | _parentFormGroup: FormGroupDirective;
|
---|
22 | /** @docs-private */
|
---|
23 | ngControl: NgControl;
|
---|
24 | };
|
---|
25 | };
|
---|
26 | /** Directive that allows a native input to work inside a `MatFormField`. */
|
---|
27 | export declare class MatInput extends _MatInputBase implements MatFormFieldControl<any>, OnChanges, OnDestroy, AfterViewInit, DoCheck, CanUpdateErrorState {
|
---|
28 | protected _elementRef: ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>;
|
---|
29 | protected _platform: Platform;
|
---|
30 | private _autofillMonitor;
|
---|
31 | private _formField?;
|
---|
32 | protected _uid: string;
|
---|
33 | protected _previousNativeValue: any;
|
---|
34 | private _inputValueAccessor;
|
---|
35 | private _previousPlaceholder;
|
---|
36 | /** Whether the component is being rendered on the server. */
|
---|
37 | readonly _isServer: boolean;
|
---|
38 | /** Whether the component is a native html select. */
|
---|
39 | readonly _isNativeSelect: boolean;
|
---|
40 | /** Whether the component is a textarea. */
|
---|
41 | readonly _isTextarea: boolean;
|
---|
42 | /** Whether the input is inside of a form field. */
|
---|
43 | readonly _isInFormField: boolean;
|
---|
44 | /**
|
---|
45 | * Implemented as part of MatFormFieldControl.
|
---|
46 | * @docs-private
|
---|
47 | */
|
---|
48 | focused: boolean;
|
---|
49 | /**
|
---|
50 | * Implemented as part of MatFormFieldControl.
|
---|
51 | * @docs-private
|
---|
52 | */
|
---|
53 | readonly stateChanges: Subject<void>;
|
---|
54 | /**
|
---|
55 | * Implemented as part of MatFormFieldControl.
|
---|
56 | * @docs-private
|
---|
57 | */
|
---|
58 | controlType: string;
|
---|
59 | /**
|
---|
60 | * Implemented as part of MatFormFieldControl.
|
---|
61 | * @docs-private
|
---|
62 | */
|
---|
63 | autofilled: boolean;
|
---|
64 | /**
|
---|
65 | * Implemented as part of MatFormFieldControl.
|
---|
66 | * @docs-private
|
---|
67 | */
|
---|
68 | get disabled(): boolean;
|
---|
69 | set disabled(value: boolean);
|
---|
70 | protected _disabled: boolean;
|
---|
71 | /**
|
---|
72 | * Implemented as part of MatFormFieldControl.
|
---|
73 | * @docs-private
|
---|
74 | */
|
---|
75 | get id(): string;
|
---|
76 | set id(value: string);
|
---|
77 | protected _id: string;
|
---|
78 | /**
|
---|
79 | * Implemented as part of MatFormFieldControl.
|
---|
80 | * @docs-private
|
---|
81 | */
|
---|
82 | placeholder: string;
|
---|
83 | /**
|
---|
84 | * Implemented as part of MatFormFieldControl.
|
---|
85 | * @docs-private
|
---|
86 | */
|
---|
87 | get required(): boolean;
|
---|
88 | set required(value: boolean);
|
---|
89 | protected _required: boolean;
|
---|
90 | /** Input type of the element. */
|
---|
91 | get type(): string;
|
---|
92 | set type(value: string);
|
---|
93 | protected _type: string;
|
---|
94 | /** An object used to control when error messages are shown. */
|
---|
95 | errorStateMatcher: ErrorStateMatcher;
|
---|
96 | /**
|
---|
97 | * Implemented as part of MatFormFieldControl.
|
---|
98 | * @docs-private
|
---|
99 | */
|
---|
100 | userAriaDescribedBy: string;
|
---|
101 | /**
|
---|
102 | * Implemented as part of MatFormFieldControl.
|
---|
103 | * @docs-private
|
---|
104 | */
|
---|
105 | get value(): string;
|
---|
106 | set value(value: string);
|
---|
107 | /** Whether the element is readonly. */
|
---|
108 | get readonly(): boolean;
|
---|
109 | set readonly(value: boolean);
|
---|
110 | private _readonly;
|
---|
111 | protected _neverEmptyInputTypes: string[];
|
---|
112 | constructor(_elementRef: ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>, _platform: Platform, ngControl: NgControl, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, _defaultErrorStateMatcher: ErrorStateMatcher, inputValueAccessor: any, _autofillMonitor: AutofillMonitor, ngZone: NgZone, _formField?: MatFormField | undefined);
|
---|
113 | ngAfterViewInit(): void;
|
---|
114 | ngOnChanges(): void;
|
---|
115 | ngOnDestroy(): void;
|
---|
116 | ngDoCheck(): void;
|
---|
117 | /** Focuses the input. */
|
---|
118 | focus(options?: FocusOptions): void;
|
---|
119 | /** Callback for the cases where the focused state of the input changes. */
|
---|
120 | _focusChanged(isFocused: boolean): void;
|
---|
121 | _onInput(): void;
|
---|
122 | /** Does some manual dirty checking on the native input `placeholder` attribute. */
|
---|
123 | private _dirtyCheckPlaceholder;
|
---|
124 | /** Does some manual dirty checking on the native input `value` property. */
|
---|
125 | protected _dirtyCheckNativeValue(): void;
|
---|
126 | /** Make sure the input is a supported type. */
|
---|
127 | protected _validateType(): void;
|
---|
128 | /** Checks whether the input type is one of the types that are never empty. */
|
---|
129 | protected _isNeverEmpty(): boolean;
|
---|
130 | /** Checks whether the input is invalid based on the native validation. */
|
---|
131 | protected _isBadInput(): boolean;
|
---|
132 | /**
|
---|
133 | * Implemented as part of MatFormFieldControl.
|
---|
134 | * @docs-private
|
---|
135 | */
|
---|
136 | get empty(): boolean;
|
---|
137 | /**
|
---|
138 | * Implemented as part of MatFormFieldControl.
|
---|
139 | * @docs-private
|
---|
140 | */
|
---|
141 | get shouldLabelFloat(): boolean;
|
---|
142 | /**
|
---|
143 | * Implemented as part of MatFormFieldControl.
|
---|
144 | * @docs-private
|
---|
145 | */
|
---|
146 | setDescribedByIds(ids: string[]): void;
|
---|
147 | /**
|
---|
148 | * Implemented as part of MatFormFieldControl.
|
---|
149 | * @docs-private
|
---|
150 | */
|
---|
151 | onContainerClick(): void;
|
---|
152 | /** Whether the form control is a native select that is displayed inline. */
|
---|
153 | _isInlineSelect(): boolean;
|
---|
154 | static ngAcceptInputType_disabled: BooleanInput;
|
---|
155 | static ngAcceptInputType_readonly: BooleanInput;
|
---|
156 | static ngAcceptInputType_required: BooleanInput;
|
---|
157 | static ngAcceptInputType_value: any;
|
---|
158 | }
|
---|
159 | export {};
|
---|