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 () { return [{ type: i0.ElementRef }, { type: i1.NgModel, decorators: [{
|
---|
39 | type: Optional
|
---|
40 | }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { onInput: [{
|
---|
41 | type: HostListener,
|
---|
42 | args: ['input', ['$event']]
|
---|
43 | }] } });
|
---|
44 | class InputTextModule {
|
---|
45 | }
|
---|
46 | InputTextModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
---|
47 | InputTextModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextModule, declarations: [InputText], imports: [CommonModule], exports: [InputText] });
|
---|
48 | InputTextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextModule, imports: [[CommonModule]] });
|
---|
49 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextModule, decorators: [{
|
---|
50 | type: NgModule,
|
---|
51 | args: [{
|
---|
52 | imports: [CommonModule],
|
---|
53 | exports: [InputText],
|
---|
54 | declarations: [InputText]
|
---|
55 | }]
|
---|
56 | }] });
|
---|
57 |
|
---|
58 | /**
|
---|
59 | * Generated bundle index. Do not edit.
|
---|
60 | */
|
---|
61 |
|
---|
62 | export { InputText, InputTextModule };
|
---|