@@ -3,31 +3,31 @@ import { AfterContentInit, AfterViewInit, Component, ContentChild, ContentChildr
33 ViewEncapsulation } from '@angular/core' ;
44import { NgControl } from '@angular/forms' ;
55import { MDCRipple } from '@material/ripple' ;
6- import { MDCTextfieldFoundation } from '@material/textfield' ;
7- import { MdcTextfieldAdapter } from './mdc.textfield .adapter' ;
6+ import { MDCTextFieldFoundation } from '@material/textfield' ;
7+ import { MdcTextFieldAdapter } from './mdc.text-field .adapter' ;
88import { AbstractMdcInput } from '../abstract/abstract.mdc.input' ;
99import { AbstractMdcLabel } from '../abstract/abstract.mdc.label' ;
1010import { asBoolean } from '../../utils/value.utils' ;
1111import { AbstractMdcRipple } from '../ripple/abstract.mdc.ripple' ;
1212import { MdcEventRegistry } from '../../utils/mdc.event.registry' ;
1313
14- const CLASS_BOTTOM_LINE = 'mdc-textfield__bottom -line' ;
14+ const CLASS_BOTTOM_LINE = 'mdc-text-field__bottom -line' ;
1515
1616let nextId = 1 ;
1717
1818@Directive ( {
19- selector : 'input[mdcTextfieldInput ], textarea[mdcTextfieldInput ]' ,
20- providers : [ { provide : AbstractMdcInput , useExisting : forwardRef ( ( ) => MdcTextfieldInputDirective ) } ]
19+ selector : 'input[mdcTextFieldInput ], textarea[mdcTextFieldInput ]' ,
20+ providers : [ { provide : AbstractMdcInput , useExisting : forwardRef ( ( ) => MdcTextFieldInputDirective ) } ]
2121} )
22- export class MdcTextfieldInputDirective extends AbstractMdcInput implements OnInit {
22+ export class MdcTextFieldInputDirective extends AbstractMdcInput implements OnInit {
2323 _onChange = ( value ) => { } ;
2424 private _id : string ;
2525 private _type = 'text' ;
2626 private _disabled = false ;
2727 private _required = false ;
2828 private cachedId : string ;
2929 _focused = false ;
30- @HostBinding ( 'class.mdc-textfield__input ' ) _hostClass = true ;
30+ @HostBinding ( 'class.mdc-text-field__input ' ) _hostClass = true ;
3131
3232 constructor ( public _elm : ElementRef , private renderer : Renderer2 , @Optional ( ) @Self ( ) public _cntr : NgControl ) {
3333 super ( ) ;
@@ -136,37 +136,37 @@ export class MdcTextfieldInputDirective extends AbstractMdcInput implements OnIn
136136}
137137
138138@Directive ( {
139- selector : '[mdcTextfieldIcon ]'
139+ selector : '[mdcTextFieldIcon ]'
140140} )
141- export class MdcTextfieldIconDirective {
142- @HostBinding ( 'class.mdc-textfield__icon ' ) _cls = true ;
141+ export class MdcTextFieldIconDirective {
142+ @HostBinding ( 'class.mdc-text-field__icon ' ) _cls = true ;
143143
144144 constructor ( public _el : ElementRef ) {
145145 }
146146}
147147
148148@Directive ( {
149- selector : 'label[mdcTextfieldLabel ]' ,
150- providers : [ { provide : AbstractMdcLabel , useExisting : forwardRef ( ( ) => MdcTextfieldLabelDirective ) } ]
149+ selector : 'label[mdcTextFieldLabel ]' ,
150+ providers : [ { provide : AbstractMdcLabel , useExisting : forwardRef ( ( ) => MdcTextFieldLabelDirective ) } ]
151151} )
152- export class MdcTextfieldLabelDirective extends AbstractMdcLabel {
152+ export class MdcTextFieldLabelDirective extends AbstractMdcLabel {
153153 /** @docs -private */
154154 @HostBinding ( ) for : string ;
155- @HostBinding ( 'class.mdc-textfield__label ' ) _cls = true ;
155+ @HostBinding ( 'class.mdc-text-field__label ' ) _cls = true ;
156156
157157 constructor ( public _elm : ElementRef ) {
158158 super ( ) ;
159159 }
160160}
161161
162162@Directive ( {
163- selector : '[mdcTextfieldHelptext ]' ,
163+ selector : '[mdcTextFieldHelptext ]' ,
164164 exportAs : 'mdcHelptext'
165165} )
166- export class MdcTextfieldHelptextDirective {
167- @HostBinding ( 'class.mdc-textfield -helptext' ) _cls = true ;
168- @HostBinding ( 'class.mdc-textfield -helptext--validation-msg' ) _isValidation = false ;
169- @HostBinding ( 'class.mdc-textfield -helptext--persistent' ) _isPersistent = false ;
166+ export class MdcTextFieldHelptextDirective {
167+ @HostBinding ( 'class.mdc-text-field -helptext' ) _cls = true ;
168+ @HostBinding ( 'class.mdc-text-field -helptext--validation-msg' ) _isValidation = false ;
169+ @HostBinding ( 'class.mdc-text-field -helptext--persistent' ) _isPersistent = false ;
170170 @Input ( ) forceShow = false ; // TODO boolean coercion
171171
172172 constructor ( public _elm : ElementRef ) {
@@ -182,22 +182,22 @@ export class MdcTextfieldHelptextDirective {
182182}
183183
184184@Directive ( {
185- selector : '[mdcTextfield ]' ,
186- providers : [ { provide : AbstractMdcRipple , useExisting : forwardRef ( ( ) => MdcTextfieldDirective ) } ]
185+ selector : '[mdcTextField ]' ,
186+ providers : [ { provide : AbstractMdcRipple , useExisting : forwardRef ( ( ) => MdcTextFieldDirective ) } ]
187187} )
188- export class MdcTextfieldDirective extends AbstractMdcRipple implements AfterContentInit , OnDestroy {
189- @HostBinding ( 'class.mdc-textfield ' ) _cls = true ;
190- @ContentChild ( MdcTextfieldIconDirective ) _icon : MdcTextfieldIconDirective ;
191- @ContentChild ( MdcTextfieldInputDirective ) _input : MdcTextfieldInputDirective ;
192- @ContentChild ( MdcTextfieldLabelDirective ) _label : MdcTextfieldLabelDirective ;
188+ export class MdcTextFieldDirective extends AbstractMdcRipple implements AfterContentInit , OnDestroy {
189+ @HostBinding ( 'class.mdc-text-field ' ) _cls = true ;
190+ @ContentChild ( MdcTextFieldIconDirective ) _icon : MdcTextFieldIconDirective ;
191+ @ContentChild ( MdcTextFieldInputDirective ) _input : MdcTextFieldInputDirective ;
192+ @ContentChild ( MdcTextFieldLabelDirective ) _label : MdcTextFieldLabelDirective ;
193193 @ContentChildren ( 'label' , { descendants : true , read : ElementRef } ) _labels : QueryList < ElementRef > ;
194- @Input ( ) helptext : MdcTextfieldHelptextDirective ;
194+ @Input ( ) helptext : MdcTextFieldHelptextDirective ;
195195 private _initialized = false ;
196196 private _box = false ;
197197 private _dense = false ;
198198 private _bottomLineElm : HTMLElement = null ;
199199 private valid : boolean = null ;
200- private mdcAdapter : MdcTextfieldAdapter = {
200+ private mdcAdapter : MdcTextFieldAdapter = {
201201 addClass : ( className : string ) => {
202202 this . renderer . addClass ( this . root . nativeElement , className ) ;
203203 } ,
@@ -289,7 +289,7 @@ export class MdcTextfieldDirective extends AbstractMdcRipple implements AfterCon
289289 useCustomValidityChecking_ : boolean ,
290290 setValid ( isValid : boolean ) ,
291291 changeValidity_ ( isValid : boolean )
292- } = new MDCTextfieldFoundation ( this . mdcAdapter ) ;
292+ } = new MDCTextFieldFoundation ( this . mdcAdapter ) ;
293293
294294 constructor ( private renderer : Renderer2 , private root : ElementRef , private registry : MdcEventRegistry ) {
295295 super ( root , renderer , registry ) ;
@@ -311,9 +311,9 @@ export class MdcTextfieldDirective extends AbstractMdcRipple implements AfterCon
311311 // programmatic changes to the input value are not seen by the foundation,
312312 // but some states should be updated with the new value:
313313 if ( value == null || value . toString ( ) . length === 0 )
314- this . mdcAdapter . removeClassFromLabel ( 'mdc-textfield__label --float-above' ) ;
314+ this . mdcAdapter . removeClassFromLabel ( 'mdc-text-field__label --float-above' ) ;
315315 else
316- this . mdcAdapter . addClassToLabel ( 'mdc-textfield__label --float-above' ) ;
316+ this . mdcAdapter . addClassToLabel ( 'mdc-text-field__label --float-above' ) ;
317317 }
318318 }
319319 }
@@ -337,11 +337,11 @@ export class MdcTextfieldDirective extends AbstractMdcRipple implements AfterCon
337337 * When binding to 'isValid', the value will determine the valid state of the input,
338338 * instead of it being managed by the underlying input element directly.
339339 * For most use cases this is not needed. When the input/textarea is an ngControl,
340- * the mdcTextfield is already aware of that, and is already using the 'valid'
340+ * the mdcTextField is already aware of that, and is already using the 'valid'
341341 * property of that control.
342342 * <p>
343343 * However, in some specific cases, binding to isValid can help. Example:
344- * When you want the mdcTextfield to go to 'invalid' state only when the underlying
344+ * When you want the mdcTextField to go to 'invalid' state only when the underlying
345345 * control is invalid AND that control is touched, you can bind as follows:
346346 * <code>isValid="myControl.valid || !myControl.touched"</code>.
347347 */
@@ -356,20 +356,20 @@ export class MdcTextfieldDirective extends AbstractMdcRipple implements AfterCon
356356 }
357357 }
358358
359- @HostBinding ( 'class.mdc-textfield --textarea' ) get _textArea ( ) : boolean {
359+ @HostBinding ( 'class.mdc-text-field --textarea' ) get _textArea ( ) : boolean {
360360 return this . _input . _isTextarea ( ) ;
361361 }
362362
363- @HostBinding ( 'class.mdc-textfield --box' ) @Input ( )
363+ @HostBinding ( 'class.mdc-text-field --box' ) @Input ( )
364364 get boxed ( ) {
365365 return this . _box ;
366366 }
367367
368- @HostBinding ( 'class.mdc-textfield --with-leading-icon' ) get _leadingIcon ( ) : boolean {
368+ @HostBinding ( 'class.mdc-text-field --with-leading-icon' ) get _leadingIcon ( ) : boolean {
369369 return this . _icon && ! this . _icon . _el . nativeElement . previousElementSibling ;
370370 }
371371
372- @HostBinding ( 'class.mdc-textfield --with-trailing-icon' ) get _trailingIcon ( ) : boolean {
372+ @HostBinding ( 'class.mdc-text-field --with-trailing-icon' ) get _trailingIcon ( ) : boolean {
373373 return this . _icon && this . _icon . _el . nativeElement . previousElementSibling ;
374374 }
375375
@@ -378,7 +378,7 @@ export class MdcTextfieldDirective extends AbstractMdcRipple implements AfterCon
378378 this . initBox ( ) ;
379379 }
380380
381- @HostBinding ( 'class.mdc-textfield --dense' ) @Input ( )
381+ @HostBinding ( 'class.mdc-text-field --dense' ) @Input ( )
382382 get dense ( ) {
383383 return this . _dense ;
384384 }
0 commit comments