@@ -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
@@ -252,10 +251,10 @@ export class MdInputContainer implements AfterContentInit {
252251 @Input ( ) dividerColor : 'primary' | 'accent' | 'warn' = 'primary' ;
253252
254253 /** Whether the floating label should always float or not. */
255- get _shouldAlwaysFloat ( ) { return this . _floatingPlaceholder === 'always' ; } ;
254+ get _shouldAlwaysFloat ( ) { return this . _floatPlaceholder === 'always' ; } ;
256255
257256 /** Whether the placeholder can float or not. */
258- get _canPlaceholderFloat ( ) { return this . _floatingPlaceholder !== 'never' ; }
257+ get _canPlaceholderFloat ( ) { return this . _floatPlaceholder !== 'never' ; }
259258
260259 /** Text for the input hint. */
261260 @Input ( )
@@ -268,14 +267,11 @@ export class MdInputContainer implements AfterContentInit {
268267
269268 /** Whether the placeholder should always float, never float or float as the user types. */
270269 @Input ( )
271- get floatingPlaceholder ( ) { return this . _floatingPlaceholder ; }
272- set floatingPlaceholder ( value : MD_INPUT_PLACEHOLDER_TYPES ) {
273- if ( value && MD_INPUT_PLACEHOLDER_VALUES . indexOf ( value ) === - 1 ) {
274- throw new MdInputContainerFloatingPlaceholderInvalidError ( value ) ;
275- }
276- this . _floatingPlaceholder = value || 'auto' ;
270+ get floatPlaceholder ( ) { return this . _floatPlaceholder ; }
271+ set floatPlaceholder ( value : FloatPlaceholderType ) {
272+ this . _floatPlaceholder = value || 'auto' ;
277273 }
278- private _floatingPlaceholder : MD_INPUT_PLACEHOLDER_TYPES = 'auto' ;
274+ private _floatPlaceholder : FloatPlaceholderType = 'auto' ;
279275
280276 @ContentChild ( MdInputDirective ) _mdInputChild : MdInputDirective ;
281277
0 commit comments