[59329aa] | 1 | import * as i0 from '@angular/core';
|
---|
| 2 | import { Directive, Optional, HostListener, NgModule } from '@angular/core';
|
---|
| 3 | import { CommonModule } from '@angular/common';
|
---|
| 4 | import * as i1 from '@angular/forms';
|
---|
| 5 |
|
---|
| 6 | class InputText {
|
---|
| 7 | constructor(el, ngModel, cd) {
|
---|
| 8 | this.el = el;
|
---|
| 9 | this.ngModel = ngModel;
|
---|
| 10 | this.cd = cd;
|
---|
| 11 | }
|
---|
| 12 | ngAfterViewInit() {
|
---|
| 13 | this.updateFilledState();
|
---|
| 14 | this.cd.detectChanges();
|
---|
| 15 | }
|
---|
| 16 | ngDoCheck() {
|
---|
| 17 | this.updateFilledState();
|
---|
| 18 | }
|
---|
| 19 | onInput(e) {
|
---|
| 20 | this.updateFilledState();
|
---|
| 21 | }
|
---|
| 22 | updateFilledState() {
|
---|
| 23 | this.filled = (this.el.nativeElement.value && this.el.nativeElement.value.length) ||
|
---|
| 24 | (this.ngModel && this.ngModel.model);
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
| 27 | InputText.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputText, deps: [{ token: i0.ElementRef }, { token: i1.NgModel, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
---|
| 28 | InputText.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0", type: InputText, selector: "[pInputText]", host: { listeners: { "input": "onInput($event)" }, properties: { "class.p-filled": "filled" }, classAttribute: "p-inputtext p-component p-element" }, ngImport: i0 });
|
---|
| 29 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputText, decorators: [{
|
---|
| 30 | type: Directive,
|
---|
| 31 | args: [{
|
---|
| 32 | selector: '[pInputText]',
|
---|
| 33 | host: {
|
---|
| 34 | 'class': 'p-inputtext p-component p-element',
|
---|
| 35 | '[class.p-filled]': 'filled'
|
---|
| 36 | }
|
---|
| 37 | }]
|
---|
| 38 | }], ctorParameters: function () {
|
---|
| 39 | return [{ type: i0.ElementRef }, { type: i1.NgModel, decorators: [{
|
---|
| 40 | type: Optional
|
---|
| 41 | }] }, { type: i0.ChangeDetectorRef }];
|
---|
| 42 | }, propDecorators: { onInput: [{
|
---|
| 43 | type: HostListener,
|
---|
| 44 | args: ['input', ['$event']]
|
---|
| 45 | }] } });
|
---|
| 46 | class InputTextModule {
|
---|
| 47 | }
|
---|
| 48 | InputTextModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
---|
| 49 | InputTextModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextModule, declarations: [InputText], imports: [CommonModule], exports: [InputText] });
|
---|
| 50 | InputTextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextModule, imports: [[CommonModule]] });
|
---|
| 51 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextModule, decorators: [{
|
---|
| 52 | type: NgModule,
|
---|
| 53 | args: [{
|
---|
| 54 | imports: [CommonModule],
|
---|
| 55 | exports: [InputText],
|
---|
| 56 | declarations: [InputText]
|
---|
| 57 | }]
|
---|
| 58 | }] });
|
---|
| 59 |
|
---|
| 60 | /**
|
---|
| 61 | * Generated bundle index. Do not edit.
|
---|
| 62 | */
|
---|
| 63 |
|
---|
| 64 | export { InputText, InputTextModule };
|
---|