/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
import { PrivateConstants } from '../../constants';
import { PrivateDynamicFromService, DynamicFormService } from '../../services';
var TextareaControllComponent = /** @class */ (function () {
    function TextareaControllComponent(_privateDynamicFromService, _dynamicFormService) {
        this._privateDynamicFromService = _privateDynamicFromService;
        this._dynamicFormService = _dynamicFormService;
        this.privateConstants = PrivateConstants;
    }
    /**
     * @return {?}
     */
    TextareaControllComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () { };
    /**
     * @param {?} errorListObj
     * @param {?} fieldObj
     * @return {?}
     */
    TextareaControllComponent.prototype.errorList = /**
     * @param {?} errorListObj
     * @param {?} fieldObj
     * @return {?}
     */
    function (errorListObj, fieldObj) {
        return this._privateDynamicFromService.errorList(errorListObj, fieldObj);
    };
    /**
     * @param {?} validations
     * @return {?}
     */
    TextareaControllComponent.prototype.showRequired = /**
     * @param {?} validations
     * @return {?}
     */
    function (validations) {
        return this._privateDynamicFromService.showRequired(validations);
    };
    /**
     * @param {?} event
     * @return {?}
     */
    TextareaControllComponent.prototype.changeEvent = /**
     * @param {?} event
     * @return {?}
     */
    function (event) {
        var _this = this;
        this._privateDynamicFromService.changeEvent(event).subscribe((/**
         * @param {?} resp
         * @return {?}
         */
        function (resp) {
            if (resp && resp.length) {
                resp.forEach((/**
                 * @param {?} updateForm
                 * @return {?}
                 */
                function (updateForm) {
                    _this._dynamicFormService.updateFormAttr(updateForm);
                }));
            }
        }));
    };
    TextareaControllComponent.decorators = [
        { type: Component, args: [{
                    selector: 'textarea-controll',
                    template: "<div class=\"form-group {{(field.class) ? field.class : ''}}\" [formGroup]=\"parentFormGroup\">\n    <show-label [class]=\"'col-form-label'\" [labelName]=\"field.label\" [labelId]=\"field.name + '-' + (i + '' + j)\"\n        [isrequired]=\"showRequired(field.validations)\">\n    </show-label>\n\n    <textarea class=\"form-control input-underline input-lg ml-0\"\n        [ngClass]=\"{'readonly-text-color': (field.attr && field.attr.readonly), 'border border-danger': (errorList(parentFormGroup.controls[field.name], field).length > 0)}\"\n        (change)=\"changeEvent($event)\" [formControlName]=\"field.name\"\n        [readonly]=\"((field.attr && field.attr.readonly) ? true : false)\" name=\"{{field.name}}\"\n        [placeholder]=\"((field.attr && field.attr.placeholder) ? field.attr.placeholder : '')\"\n        id=\"{{field.name + '-' + (i + '' + j)}}\"></textarea>\n\n    <show-error [errorList]=\"errorList(parentFormGroup.controls[field.name], field)\"></show-error>\n</div>",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    TextareaControllComponent.ctorParameters = function () { return [
        { type: PrivateDynamicFromService },
        { type: DynamicFormService }
    ]; };
    TextareaControllComponent.propDecorators = {
        rowField: [{ type: Input }],
        field: [{ type: Input }],
        parentFormGroup: [{ type: Input }],
        i: [{ type: Input }],
        j: [{ type: Input }]
    };
    return TextareaControllComponent;
}());
export { TextareaControllComponent };
if (false) {
    /** @type {?} */
    TextareaControllComponent.prototype.rowField;
    /** @type {?} */
    TextareaControllComponent.prototype.field;
    /** @type {?} */
    TextareaControllComponent.prototype.parentFormGroup;
    /** @type {?} */
    TextareaControllComponent.prototype.i;
    /** @type {?} */
    TextareaControllComponent.prototype.j;
    /** @type {?} */
    TextareaControllComponent.prototype.privateConstants;
    /**
     * @type {?}
     * @private
     */
    TextareaControllComponent.prototype._privateDynamicFromService;
    /**
     * @type {?}
     * @private
     */
    TextareaControllComponent.prototype._dynamicFormService;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGFyZWEtY29udHJvbGwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vYW5ndWxhci1yZWFjdGl2ZS1keW5hbWljLWZvcm1zLyIsInNvdXJjZXMiOlsibGliL2NvbXBvbmVudHMvdGV4dGFyZWEtY29udHJvbGwvdGV4dGFyZWEtY29udHJvbGwuY29tcG9uZW50L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