/**
 * @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 TextboxControllComponent = /** @class */ (function () {
    function TextboxControllComponent(_privateDynamicFromService, _dynamicFormService) {
        this._privateDynamicFromService = _privateDynamicFromService;
        this._dynamicFormService = _dynamicFormService;
        this.privateConstants = PrivateConstants;
    }
    /**
     * @return {?}
     */
    TextboxControllComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () { };
    /**
     * @param {?} errorListObj
     * @param {?} fieldObj
     * @return {?}
     */
    TextboxControllComponent.prototype.errorList = /**
     * @param {?} errorListObj
     * @param {?} fieldObj
     * @return {?}
     */
    function (errorListObj, fieldObj) {
        return this._privateDynamicFromService.errorList(errorListObj, fieldObj);
    };
    /**
     * @param {?} validations
     * @return {?}
     */
    TextboxControllComponent.prototype.showRequired = /**
     * @param {?} validations
     * @return {?}
     */
    function (validations) {
        return this._privateDynamicFromService.showRequired(validations);
    };
    /**
     * @param {?} event
     * @return {?}
     */
    TextboxControllComponent.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);
                }));
            }
        }));
    };
    TextboxControllComponent.decorators = [
        { type: Component, args: [{
                    selector: 'textbox-controll',
                    template: "<div class=\"form-group {{(field.class) ? field.class : ''}}\"\n    [formGroup]=\"parentFormGroup\">\n    <show-label [class]=\"'col-form-label'\" [labelName]=\"field.label\" [labelId]=\"field.name + '-' + (i + '' + j)\"\n        [isrequired]=\"showRequired(field.validations)\"></show-label>\n\n    <input type=\"text\" class=\"form-control input-underline input-lg ml-0\" [formControlName]=\"field.name\"\n        (change)=\"changeEvent($event)\" [readonly]=\"((field.attr && field.attr.readonly) ? true : false)\"\n        data-name=\"{{field.name}}\"\n        [placeholder]=\"((field.attr && field.attr.placeholder) ? field.attr.placeholder : '')\"\n        id=\"{{field.name + '-' + (i + '' + j)}}\"\n        [ngClass]=\"{ 'border border-danger': (errorList(parentFormGroup.controls[field.name], field).length > 0) }\">\n\n    <show-error [errorList]=\"errorList(parentFormGroup.controls[field.name], field)\"></show-error>\n</div>",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    TextboxControllComponent.ctorParameters = function () { return [
        { type: PrivateDynamicFromService },
        { type: DynamicFormService }
    ]; };
    TextboxControllComponent.propDecorators = {
        rowField: [{ type: Input }],
        field: [{ type: Input }],
        parentFormGroup: [{ type: Input }],
        i: [{ type: Input }],
        j: [{ type: Input }]
    };
    return TextboxControllComponent;
}());
export { TextboxControllComponent };
if (false) {
    /** @type {?} */
    TextboxControllComponent.prototype.rowField;
    /** @type {?} */
    TextboxControllComponent.prototype.field;
    /** @type {?} */
    TextboxControllComponent.prototype.parentFormGroup;
    /** @type {?} */
    TextboxControllComponent.prototype.i;
    /** @type {?} */
    TextboxControllComponent.prototype.j;
    /** @type {?} */
    TextboxControllComponent.prototype.privateConstants;
    /**
     * @type {?}
     * @private
     */
    TextboxControllComponent.prototype._privateDynamicFromService;
    /**
     * @type {?}
     * @private
     */
    TextboxControllComponent.prototype._dynamicFormService;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGJveC1jb250cm9sbC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9hbmd1bGFyLXJlYWN0aXZlLWR5bmFtaWMtZm9ybXMvIiwic291cmNlcyI6WyJsaWIvY29tcG9uZW50cy90ZXh0Ym94LWNvbnRyb2xsL3RleHRib3gtY29udHJvbGwuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibW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