{"version":3,"sources":["../../src/app/components/inputtext/inputtext.ts"],"names":["InputText","el","ngModel","this","prototype","ngDoCheck","updateFilledState","onInput","e","filled","nativeElement","value","length","model","Directive","args","selector","host","[class.p-inputtext]","[class.p-component]","[class.p-filled]","ElementRef","NgModel","decorators","type","Optional","HostListener","NgModule","imports","CommonModule","exports","declarations"],"mappings":"geAgBI,SAAAA,EAAmBC,EAAmCC,GAAnCC,KAAAF,GAAAA,EAAmCE,KAAAD,QAAAA,SAEtDF,EAAAI,UAAAC,UAAA,WACIF,KAAKG,qBAITN,EAAAI,UAAAG,QAAA,SAAQC,GACJL,KAAKG,qBAGTN,EAAAI,UAAAE,kBAAA,WACIH,KAAKM,OAAUN,KAAKF,GAAGS,cAAcC,OAASR,KAAKF,GAAGS,cAAcC,MAAMC,QACzDT,KAAKD,SAAWC,KAAKD,QAAQW,gCAzBrDC,EAAAA,UAASC,KAAA,CAAC,CACPC,SAAU,eACVC,KAAM,CACFC,sBAAuB,OACvBC,sBAAuB,OACvBC,mBAAoB,uDATDC,EAAAA,kBACnBC,EAAAA,QAAOC,WAAA,CAAA,CAAAC,KAeyBC,EAAAA,+CAMnCC,EAAAA,aAAYX,KAAA,CAAC,QAAS,CAAC,oBAgB5B,iCALCY,EAAAA,SAAQZ,KAAA,CAAC,CACNa,QAAS,CAACC,EAAAA,cACVC,QAAS,CAAC9B,GACV+B,aAAc,CAAC/B","sourcesContent":["import {NgModule,Directive,ElementRef,HostListener,DoCheck,Optional} from '@angular/core';\nimport {NgModel} from '@angular/forms';\nimport {CommonModule} from '@angular/common';\n\n@Directive({\n selector: '[pInputText]',\n host: {\n '[class.p-inputtext]': 'true',\n '[class.p-component]': 'true',\n '[class.p-filled]': 'filled'\n }\n})\nexport class InputText implements DoCheck {\n\n filled: boolean;\n\n constructor(public el: ElementRef, @Optional() public ngModel: NgModel) {}\n \n ngDoCheck() {\n this.updateFilledState();\n }\n \n @HostListener('input', ['$event']) \n onInput(e) {\n this.updateFilledState();\n }\n \n updateFilledState() {\n this.filled = (this.el.nativeElement.value && this.el.nativeElement.value.length) ||\n (this.ngModel && this.ngModel.model);\n }\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [InputText],\n declarations: [InputText]\n})\nexport class InputTextModule { }"]}