77 */
88
99import { coerceBooleanProperty } from '@angular/cdk/coercion' ;
10- import { take } from 'rxjs/operators/take' ;
11- import { startWith } from 'rxjs/operators/startWith' ;
1210import {
1311 AfterContentChecked ,
1412 AfterContentInit ,
@@ -26,26 +24,31 @@ import {
2624 ViewChild ,
2725 ViewEncapsulation ,
2826} 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' ;
3028import { fromEvent } from 'rxjs/observable/fromEvent' ;
29+ import { startWith } from 'rxjs/operators/startWith' ;
30+ import { take } from 'rxjs/operators/take' ;
3131import { MatError } from './error' ;
32+ import { matFormFieldAnimations } from './form-field-animations' ;
3233import { MatFormFieldControl } from './form-field-control' ;
3334import {
3435 getMatFormFieldDuplicatedHintError ,
3536 getMatFormFieldMissingControlError ,
3637 getMatFormFieldPlaceholderConflictError ,
3738} from './form-field-errors' ;
3839import { MatHint } from './hint' ;
39- import { MatPlaceholder } from './placeholder' ;
4040import { MatLabel } from './label' ;
41+ import { MatPlaceholder } from './placeholder' ;
4142import { MatPrefix } from './prefix' ;
4243import { MatSuffix } from './suffix' ;
43- import { matFormFieldAnimations } from './form-field-animations' ;
4444
4545
4646let nextUniqueId = 0 ;
4747
4848
49+ export type MatFormFieldVariant = 'legacy' | 'standard' | 'box' ;
50+
51+
4952/** Container for form controls that applies Material Design styling and behavior. */
5053@Component ( {
5154 moduleId : module . id ,
@@ -96,7 +99,7 @@ export class MatFormField implements AfterViewInit, AfterContentInit, AfterConte
9699 private _labelOptions : LabelOptions ;
97100
98101 /** The form-field style variant. */
99- @Input ( ) variant : 'legacy' | 'standard' | 'box' = 'legacy' ;
102+ @Input ( ) variant : MatFormFieldVariant = 'legacy' ;
100103
101104 /** Color of the form field underline, based on the theme. */
102105 @Input ( ) color : 'primary' | 'accent' | 'warn' = 'primary' ;
0 commit comments