@@ -20,7 +20,7 @@ import {
2020 MdInputContainerUnsupportedTypeError ,
2121 MdInputContainerPlaceholderConflictError ,
2222 MdInputContainerDuplicatedHintError ,
23- MdInputContainerMissingMdInputError , MdInputContainerFloatingPlaceholderInvalidError
23+ MdInputContainerMissingMdInputError
2424} from './input-container-errors' ;
2525
2626
@@ -38,9 +38,8 @@ const MD_INPUT_INVALID_TYPES = [
3838 'submit'
3939] ;
4040
41- /** Valid options for the floatingPlaceholder input binding. */
42- export type MD_INPUT_PLACEHOLDER_TYPES = 'always' | 'never' | 'auto' ;
43- const MD_INPUT_PLACEHOLDER_VALUES = [ 'always' , 'never' , 'auto' ] ;
41+ /** Type for the available floatPlaceholder values. */
42+ export type FloatPlaceholderType = 'always' | 'never' | 'auto' ;
4443
4544let nextUniqueId = 0 ;
4645
@@ -248,10 +247,10 @@ export class MdInputContainer implements AfterContentInit {
248247 @Input ( ) dividerColor : 'primary' | 'accent' | 'warn' = 'primary' ;
249248
250249 /** Whether the floating label should always float or not. */
251- get _shouldAlwaysFloat ( ) { return this . _floatingPlaceholder === 'always' ; } ;
250+ get _shouldAlwaysFloat ( ) { return this . _floatPlaceholder === 'always' ; } ;
252251
253252 /** Whether the placeholder can float or not. */
254- get _canPlaceholderFloat ( ) { return this . _floatingPlaceholder !== 'never' ; }
253+ get _canPlaceholderFloat ( ) { return this . _floatPlaceholder !== 'never' ; }
255254
256255 /** Text for the input hint. */
257256 @Input ( )
@@ -264,14 +263,11 @@ export class MdInputContainer implements AfterContentInit {
264263
265264 /** Whether the placeholder should always float, never float or float as the user types. */
266265 @Input ( )
267- get floatingPlaceholder ( ) { return this . _floatingPlaceholder ; }
268- set floatingPlaceholder ( value : MD_INPUT_PLACEHOLDER_TYPES ) {
269- if ( value && MD_INPUT_PLACEHOLDER_VALUES . indexOf ( value ) === - 1 ) {
270- throw new MdInputContainerFloatingPlaceholderInvalidError ( value ) ;
271- }
272- this . _floatingPlaceholder = value || 'auto' ;
266+ get floatPlaceholder ( ) { return this . _floatPlaceholder ; }
267+ set floatPlaceholder ( value : FloatPlaceholderType ) {
268+ this . _floatPlaceholder = value || 'auto' ;
273269 }
274- private _floatingPlaceholder : MD_INPUT_PLACEHOLDER_TYPES = 'auto' ;
270+ private _floatPlaceholder : FloatPlaceholderType = 'auto' ;
275271
276272 @ContentChild ( MdInputDirective ) _mdInputChild : MdInputDirective ;
277273
0 commit comments