1 | import { NgModule, Directive, HostListener, Input, Output, EventEmitter, Optional } from '@angular/core';
|
---|
2 | import { CommonModule } from '@angular/common';
|
---|
3 | import * as i0 from "@angular/core";
|
---|
4 | import * as i1 from "@angular/forms";
|
---|
5 | export class InputTextarea {
|
---|
6 | constructor(el, ngModel, control, cd) {
|
---|
7 | this.el = el;
|
---|
8 | this.ngModel = ngModel;
|
---|
9 | this.control = control;
|
---|
10 | this.cd = cd;
|
---|
11 | this.onResize = new EventEmitter();
|
---|
12 | }
|
---|
13 | ngOnInit() {
|
---|
14 | if (this.ngModel) {
|
---|
15 | this.ngModelSubscription = this.ngModel.valueChanges.subscribe(() => {
|
---|
16 | this.updateState();
|
---|
17 | });
|
---|
18 | }
|
---|
19 | if (this.control) {
|
---|
20 | this.ngControlSubscription = this.control.valueChanges.subscribe(() => {
|
---|
21 | this.updateState();
|
---|
22 | });
|
---|
23 | }
|
---|
24 | }
|
---|
25 | ngAfterViewInit() {
|
---|
26 | if (this.autoResize)
|
---|
27 | this.resize();
|
---|
28 | this.updateFilledState();
|
---|
29 | this.cd.detectChanges();
|
---|
30 | }
|
---|
31 | onInput(e) {
|
---|
32 | this.updateState();
|
---|
33 | }
|
---|
34 | updateFilledState() {
|
---|
35 | this.filled = this.el.nativeElement.value && this.el.nativeElement.value.length;
|
---|
36 | }
|
---|
37 | onFocus(e) {
|
---|
38 | if (this.autoResize) {
|
---|
39 | this.resize(e);
|
---|
40 | }
|
---|
41 | }
|
---|
42 | onBlur(e) {
|
---|
43 | if (this.autoResize) {
|
---|
44 | this.resize(e);
|
---|
45 | }
|
---|
46 | }
|
---|
47 | resize(event) {
|
---|
48 | this.el.nativeElement.style.height = 'auto';
|
---|
49 | this.el.nativeElement.style.height = this.el.nativeElement.scrollHeight + 'px';
|
---|
50 | if (parseFloat(this.el.nativeElement.style.height) >= parseFloat(this.el.nativeElement.style.maxHeight)) {
|
---|
51 | this.el.nativeElement.style.overflowY = "scroll";
|
---|
52 | this.el.nativeElement.style.height = this.el.nativeElement.style.maxHeight;
|
---|
53 | }
|
---|
54 | else {
|
---|
55 | this.el.nativeElement.style.overflow = "hidden";
|
---|
56 | }
|
---|
57 | this.onResize.emit(event || {});
|
---|
58 | }
|
---|
59 | updateState() {
|
---|
60 | this.updateFilledState();
|
---|
61 | if (this.autoResize) {
|
---|
62 | this.resize();
|
---|
63 | }
|
---|
64 | }
|
---|
65 | ngOnDestroy() {
|
---|
66 | if (this.ngModelSubscription) {
|
---|
67 | this.ngModelSubscription.unsubscribe();
|
---|
68 | }
|
---|
69 | if (this.ngControlSubscription) {
|
---|
70 | this.ngControlSubscription.unsubscribe();
|
---|
71 | }
|
---|
72 | }
|
---|
73 | }
|
---|
74 | InputTextarea.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextarea, deps: [{ token: i0.ElementRef }, { token: i1.NgModel, optional: true }, { token: i1.NgControl, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
---|
75 | InputTextarea.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0", type: InputTextarea, selector: "[pInputTextarea]", inputs: { autoResize: "autoResize" }, outputs: { onResize: "onResize" }, host: { listeners: { "input": "onInput($event)", "focus": "onFocus($event)", "blur": "onBlur($event)" }, properties: { "class.p-filled": "filled", "class.p-inputtextarea-resizable": "autoResize" }, classAttribute: "p-inputtextarea p-inputtext p-component p-element" }, ngImport: i0 });
|
---|
76 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextarea, decorators: [{
|
---|
77 | type: Directive,
|
---|
78 | args: [{
|
---|
79 | selector: '[pInputTextarea]',
|
---|
80 | host: {
|
---|
81 | 'class': 'p-inputtextarea p-inputtext p-component p-element',
|
---|
82 | '[class.p-filled]': 'filled',
|
---|
83 | '[class.p-inputtextarea-resizable]': 'autoResize'
|
---|
84 | }
|
---|
85 | }]
|
---|
86 | }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.NgModel, decorators: [{
|
---|
87 | type: Optional
|
---|
88 | }] }, { type: i1.NgControl, decorators: [{
|
---|
89 | type: Optional
|
---|
90 | }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { autoResize: [{
|
---|
91 | type: Input
|
---|
92 | }], onResize: [{
|
---|
93 | type: Output
|
---|
94 | }], onInput: [{
|
---|
95 | type: HostListener,
|
---|
96 | args: ['input', ['$event']]
|
---|
97 | }], onFocus: [{
|
---|
98 | type: HostListener,
|
---|
99 | args: ['focus', ['$event']]
|
---|
100 | }], onBlur: [{
|
---|
101 | type: HostListener,
|
---|
102 | args: ['blur', ['$event']]
|
---|
103 | }] } });
|
---|
104 | export class InputTextareaModule {
|
---|
105 | }
|
---|
106 | InputTextareaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextareaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
---|
107 | InputTextareaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextareaModule, declarations: [InputTextarea], imports: [CommonModule], exports: [InputTextarea] });
|
---|
108 | InputTextareaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextareaModule, imports: [[CommonModule]] });
|
---|
109 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: InputTextareaModule, decorators: [{
|
---|
110 | type: NgModule,
|
---|
111 | args: [{
|
---|
112 | imports: [CommonModule],
|
---|
113 | exports: [InputTextarea],
|
---|
114 | declarations: [InputTextarea]
|
---|
115 | }]
|
---|
116 | }] });
|
---|
117 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXR0ZXh0YXJlYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJ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