source: trip-planner-front/node_modules/primeng/fesm2015/primeng-inputtextarea.mjs@ 8d391a1

Last change on this file since 8d391a1 was 59329aa, checked in by Ema <ema_spirova@…>, 3 years ago

adding photos

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