135 lines
15 KiB
JavaScript
135 lines
15 KiB
JavaScript
import { NgModule, Directive, HostListener, Input, Output, EventEmitter, Optional, booleanAttribute } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
import * as i0 from "@angular/core";
|
|
import * as i1 from "@angular/forms";
|
|
import * as i2 from "primeng/api";
|
|
/**
|
|
* InputTextarea adds styling and autoResize functionality to standard textarea element.
|
|
* @group Components
|
|
*/
|
|
export class InputTextarea {
|
|
el;
|
|
ngModel;
|
|
control;
|
|
cd;
|
|
config;
|
|
/**
|
|
* When present, textarea size changes as being typed.
|
|
* @group Props
|
|
*/
|
|
autoResize;
|
|
/**
|
|
* Specifies the input variant of the component.
|
|
* @group Props
|
|
*/
|
|
variant = 'outlined';
|
|
/**
|
|
* Callback to invoke on textarea resize.
|
|
* @param {(Event | {})} event - Custom resize event.
|
|
* @group Emits
|
|
*/
|
|
onResize = new EventEmitter();
|
|
filled;
|
|
cachedScrollHeight;
|
|
ngModelSubscription;
|
|
ngControlSubscription;
|
|
constructor(el, ngModel, control, cd, config) {
|
|
this.el = el;
|
|
this.ngModel = ngModel;
|
|
this.control = control;
|
|
this.cd = cd;
|
|
this.config = config;
|
|
}
|
|
ngOnInit() {
|
|
if (this.ngModel) {
|
|
this.ngModelSubscription = this.ngModel.valueChanges.subscribe(() => {
|
|
this.updateState();
|
|
});
|
|
}
|
|
if (this.control) {
|
|
this.ngControlSubscription = this.control.valueChanges.subscribe(() => {
|
|
this.updateState();
|
|
});
|
|
}
|
|
}
|
|
ngAfterViewInit() {
|
|
if (this.autoResize)
|
|
this.resize();
|
|
this.updateFilledState();
|
|
this.cd.detectChanges();
|
|
}
|
|
onInput(e) {
|
|
this.updateState();
|
|
}
|
|
updateFilledState() {
|
|
this.filled = this.el.nativeElement.value && this.el.nativeElement.value.length;
|
|
}
|
|
resize(event) {
|
|
this.el.nativeElement.style.height = 'auto';
|
|
this.el.nativeElement.style.height = this.el.nativeElement.scrollHeight + 'px';
|
|
if (parseFloat(this.el.nativeElement.style.height) >= parseFloat(this.el.nativeElement.style.maxHeight)) {
|
|
this.el.nativeElement.style.overflowY = 'scroll';
|
|
this.el.nativeElement.style.height = this.el.nativeElement.style.maxHeight;
|
|
}
|
|
else {
|
|
this.el.nativeElement.style.overflow = 'hidden';
|
|
}
|
|
this.onResize.emit(event || {});
|
|
}
|
|
updateState() {
|
|
this.updateFilledState();
|
|
if (this.autoResize) {
|
|
this.resize();
|
|
}
|
|
}
|
|
ngOnDestroy() {
|
|
if (this.ngModelSubscription) {
|
|
this.ngModelSubscription.unsubscribe();
|
|
}
|
|
if (this.ngControlSubscription) {
|
|
this.ngControlSubscription.unsubscribe();
|
|
}
|
|
}
|
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputTextarea, deps: [{ token: i0.ElementRef }, { token: i1.NgModel, optional: true }, { token: i1.NgControl, optional: true }, { token: i0.ChangeDetectorRef }, { token: i2.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Directive });
|
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.3.7", type: InputTextarea, selector: "[pInputTextarea]", inputs: { autoResize: ["autoResize", "autoResize", booleanAttribute], variant: "variant" }, outputs: { onResize: "onResize" }, host: { listeners: { "input": "onInput($event)" }, properties: { "class.p-filled": "filled", "class.p-inputtextarea-resizable": "autoResize", "class.p-variant-filled": "variant === \"filled\" || config.inputStyle() === \"filled\"" }, classAttribute: "p-inputtextarea p-inputtext p-component p-element" }, ngImport: i0 });
|
|
}
|
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputTextarea, decorators: [{
|
|
type: Directive,
|
|
args: [{
|
|
selector: '[pInputTextarea]',
|
|
host: {
|
|
class: 'p-inputtextarea p-inputtext p-component p-element',
|
|
'[class.p-filled]': 'filled',
|
|
'[class.p-inputtextarea-resizable]': 'autoResize',
|
|
'[class.p-variant-filled]': 'variant === "filled" || config.inputStyle() === "filled"'
|
|
}
|
|
}]
|
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.NgModel, decorators: [{
|
|
type: Optional
|
|
}] }, { type: i1.NgControl, decorators: [{
|
|
type: Optional
|
|
}] }, { type: i0.ChangeDetectorRef }, { type: i2.PrimeNGConfig }], propDecorators: { autoResize: [{
|
|
type: Input,
|
|
args: [{ transform: booleanAttribute }]
|
|
}], variant: [{
|
|
type: Input
|
|
}], onResize: [{
|
|
type: Output
|
|
}], onInput: [{
|
|
type: HostListener,
|
|
args: ['input', ['$event']]
|
|
}] } });
|
|
export class InputTextareaModule {
|
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputTextareaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: InputTextareaModule, declarations: [InputTextarea], imports: [CommonModule], exports: [InputTextarea] });
|
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputTextareaModule, imports: [CommonModule] });
|
|
}
|
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputTextareaModule, decorators: [{
|
|
type: NgModule,
|
|
args: [{
|
|
imports: [CommonModule],
|
|
exports: [InputTextarea],
|
|
declarations: [InputTextarea]
|
|
}]
|
|
}] });
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXR0ZXh0YXJlYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy9pbnB1dHRleHRhcmVhL2lucHV0dGV4dGFyZWEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFB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