Skip to content

Commit 67e9308

Browse files
committed
address comments
1 parent d2cdca8 commit 67e9308

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/lib/form-field/form-field.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
*/
88

99
import {coerceBooleanProperty} from '@angular/cdk/coercion';
10-
import {take} from 'rxjs/operators/take';
11-
import {startWith} from 'rxjs/operators/startWith';
1210
import {
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';
3028
import {fromEvent} from 'rxjs/observable/fromEvent';
29+
import {startWith} from 'rxjs/operators/startWith';
30+
import {take} from 'rxjs/operators/take';
3131
import {MatError} from './error';
32+
import {matFormFieldAnimations} from './form-field-animations';
3233
import {MatFormFieldControl} from './form-field-control';
3334
import {
3435
getMatFormFieldDuplicatedHintError,
3536
getMatFormFieldMissingControlError,
3637
getMatFormFieldPlaceholderConflictError,
3738
} from './form-field-errors';
3839
import {MatHint} from './hint';
39-
import {MatPlaceholder} from './placeholder';
4040
import {MatLabel} from './label';
41+
import {MatPlaceholder} from './placeholder';
4142
import {MatPrefix} from './prefix';
4243
import {MatSuffix} from './suffix';
43-
import {matFormFieldAnimations} from './form-field-animations';
4444

4545

4646
let 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

Comments
 (0)