import { Component, Input } from "@angular/core";
import { FormGroup } from "@angular/forms";
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
import * as i2 from "primeng/textarea";
import * as i3 from "primeng/keyfilter";
export class InlineEditTextAreaComponent {
    field;
    formGroup = new FormGroup({});
    tempValue = '';
    ngOnInit() {
        if (this.formGroup && this.field) {
            this.tempValue = this.formGroup.get(this.field.name)?.value || '';
        }
    }
    saveValue() {
        if (this.formGroup && this.field) {
            this.formGroup.get(this.field.name)?.setValue(this.tempValue);
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: InlineEditTextAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: InlineEditTextAreaComponent, selector: "ng-component", inputs: { field: "field", formGroup: "formGroup" }, ngImport: i0, template: "@if(field.keyFilter) {\n    <textarea\n        [id]=\"field.name\"\n        pTextarea\n        class=\"textarea-input\"\n        [rows]=\"field.rows\"\n        [cols]=\"field.cols\"\n        [readonly]=\"field.readonly ? field.readonly() : false\"\n        [(ngModel)]=\"tempValue\"\n        [pKeyFilter]=\"field.keyFilter\">\n    </textarea>\n}@else {\n    <textarea\n        [id]=\"field.name\"\n        pTextarea\n        class=\"textarea-input\"\n        [rows]=\"field.rows\"\n        [cols]=\"field.cols\"\n        [readonly]=\"field.readonly ? field.readonly() : false\"\n        [(ngModel)]=\"tempValue\">\n    </textarea>\n\n}\n", styles: [".textarea-input{resize:vertical}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.Textarea, selector: "[pTextarea]", inputs: ["autoResize", "variant", "fluid", "pSize"], outputs: ["onResize"] }, { kind: "directive", type: i3.KeyFilter, selector: "[pKeyFilter]", inputs: ["pValidateOnly", "pKeyFilter"], outputs: ["ngModelChange"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: InlineEditTextAreaComponent, decorators: [{
            type: Component,
            args: [{ template: "@if(field.keyFilter) {\n    <textarea\n        [id]=\"field.name\"\n        pTextarea\n        class=\"textarea-input\"\n        [rows]=\"field.rows\"\n        [cols]=\"field.cols\"\n        [readonly]=\"field.readonly ? field.readonly() : false\"\n        [(ngModel)]=\"tempValue\"\n        [pKeyFilter]=\"field.keyFilter\">\n    </textarea>\n}@else {\n    <textarea\n        [id]=\"field.name\"\n        pTextarea\n        class=\"textarea-input\"\n        [rows]=\"field.rows\"\n        [cols]=\"field.cols\"\n        [readonly]=\"field.readonly ? field.readonly() : false\"\n        [(ngModel)]=\"tempValue\">\n    </textarea>\n\n}\n", styles: [".textarea-input{resize:vertical}\n"] }]
        }], propDecorators: { field: [{
                type: Input,
                args: [{ required: true }]
            }], formGroup: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLWVkaXQtdGV4dC1hcmVhLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FuZ3VsYXItY29tcG9uZW50cy9pbmxpbmUtZWRpdC9zcmMvbGliL2lubGluZS1lZGl0L2NvbXBvbmVudHMvZmllbGRzL2lubGluZS1lZGl0LXRleHQtYXJlYS9pbmxpbmUtZWRpdC10ZXh0LWFyZWEuY29tcG9uZW50LnRzIiwiLi4vLi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