7
7
*/
8
8
9
9
import { coerceBooleanProperty } from '@angular/cdk/coercion' ;
10
- import { take } from 'rxjs/operators/take' ;
11
- import { startWith } from 'rxjs/operators/startWith' ;
12
10
import {
13
11
AfterContentChecked ,
14
12
AfterContentInit ,
@@ -26,26 +24,31 @@ import {
26
24
ViewChild ,
27
25
ViewEncapsulation ,
28
26
} from '@angular/core' ;
29
- import { FloatLabelType , MAT_LABEL_GLOBAL_OPTIONS , LabelOptions } from '@angular/material/core' ;
27
+ import { FloatLabelType , LabelOptions , MAT_LABEL_GLOBAL_OPTIONS } from '@angular/material/core' ;
30
28
import { fromEvent } from 'rxjs/observable/fromEvent' ;
29
+ import { startWith } from 'rxjs/operators/startWith' ;
30
+ import { take } from 'rxjs/operators/take' ;
31
31
import { MatError } from './error' ;
32
+ import { matFormFieldAnimations } from './form-field-animations' ;
32
33
import { MatFormFieldControl } from './form-field-control' ;
33
34
import {
34
35
getMatFormFieldDuplicatedHintError ,
35
36
getMatFormFieldMissingControlError ,
36
37
getMatFormFieldPlaceholderConflictError ,
37
38
} from './form-field-errors' ;
38
39
import { MatHint } from './hint' ;
39
- import { MatPlaceholder } from './placeholder' ;
40
40
import { MatLabel } from './label' ;
41
+ import { MatPlaceholder } from './placeholder' ;
41
42
import { MatPrefix } from './prefix' ;
42
43
import { MatSuffix } from './suffix' ;
43
- import { matFormFieldAnimations } from './form-field-animations' ;
44
44
45
45
46
46
let nextUniqueId = 0 ;
47
47
48
48
49
+ export type MatFormFieldVariant = 'legacy' | 'standard' | 'box' ;
50
+
51
+
49
52
/** Container for form controls that applies Material Design styling and behavior. */
50
53
@Component ( {
51
54
moduleId : module . id ,
@@ -96,7 +99,7 @@ export class MatFormField implements AfterViewInit, AfterContentInit, AfterConte
96
99
private _labelOptions : LabelOptions ;
97
100
98
101
/** The form-field style variant. */
99
- @Input ( ) variant : 'legacy' | 'standard' | 'box' = 'legacy' ;
102
+ @Input ( ) variant : MatFormFieldVariant = 'legacy' ;
100
103
101
104
/** Color of the form field underline, based on the theme. */
102
105
@Input ( ) color : 'primary' | 'accent' | 'warn' = 'primary' ;
0 commit comments