/**
 * @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';
export class NumberControllComponent {
    /**
     * @param {?} _privateDynamicFromService
     * @param {?} _dynamicFormService
     */
    constructor(_privateDynamicFromService, _dynamicFormService) {
        this._privateDynamicFromService = _privateDynamicFromService;
        this._dynamicFormService = _dynamicFormService;
        this.privateConstants = PrivateConstants;
    }
    /**
     * @return {?}
     */
    ngOnInit() { }
    /**
     * @param {?} errorListObj
     * @param {?} fieldObj
     * @return {?}
     */
    errorList(errorListObj, fieldObj) {
        return this._privateDynamicFromService.errorList(errorListObj, fieldObj);
    }
    /**
     * @param {?} validations
     * @return {?}
     */
    showRequired(validations) {
        return this._privateDynamicFromService.showRequired(validations);
    }
    /**
     * @param {?} event
     * @return {?}
     */
    changeEvent(event) {
        this._privateDynamicFromService.changeEvent(event).subscribe((/**
         * @param {?} resp
         * @return {?}
         */
        resp => {
            if (resp && resp.length) {
                resp.forEach((/**
                 * @param {?} updateForm
                 * @return {?}
                 */
                updateForm => {
                    this._dynamicFormService.updateFormAttr(updateForm);
                }));
            }
        }));
    }
}
NumberControllComponent.decorators = [
    { type: Component, args: [{
                selector: 'number-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    <input type=\"number\" class=\"form-control input-underline input-lg ml-0\" (change)=\"changeEvent($event)\"\n        [formControlName]=\"field.name\" [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 */
NumberControllComponent.ctorParameters = () => [
    { type: PrivateDynamicFromService },
    { type: DynamicFormService }
];
NumberControllComponent.propDecorators = {
    rowField: [{ type: Input }],
    field: [{ type: Input }],
    parentFormGroup: [{ type: Input }],
    i: [{ type: Input }],
    j: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    NumberControllComponent.prototype.rowField;
    /** @type {?} */
    NumberControllComponent.prototype.field;
    /** @type {?} */
    NumberControllComponent.prototype.parentFormGroup;
    /** @type {?} */
    NumberControllComponent.prototype.i;
    /** @type {?} */
    NumberControllComponent.prototype.j;
    /** @type {?} */
    NumberControllComponent.prototype.privateConstants;
    /**
     * @type {?}
     * @private
     */
    NumberControllComponent.prototype._privateDynamicFromService;
    /**
     * @type {?}
     * @private
     */
    NumberControllComponent.prototype._dynamicFormService;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVtYmVyLWNvbnRyb2xsLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL2FuZ3VsYXItcmVhY3RpdmUtZHluYW1pYy1mb3Jtcy8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL251bWJlci1jb250cm9sbC9udW1iZXItY29udHJvbGwuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFVLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUV6RCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUNuRCxPQUFPLEVBQUUseUJBQXlCLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxnQkFBZ0IsQ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