/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { PrivateConstants, FormConstants } from '../../constants';
import { PrivateDynamicFromService, DynamicFormService } from '../../services';
export class CheckboxControllComponent {
    /**
     * @param {?} _privateDynamicFromService
     * @param {?} _dynamicFormService
     */
    constructor(_privateDynamicFromService, _dynamicFormService) {
        this._privateDynamicFromService = _privateDynamicFromService;
        this._dynamicFormService = _dynamicFormService;
        this.clickEvent = new EventEmitter();
        this.formConstants = FormConstants;
        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);
                }));
            }
        }));
    }
    /**
     * @param {?} field
     * @return {?}
     */
    handleReadonlyAttr(field) {
        return this._privateDynamicFromService.handleReadonlyAttr(field);
    }
    /**
     * @param {?} event
     * @return {?}
     */
    clickCheckBox(event) {
        this.clickEvent.emit(event);
    }
    /**
     * @param {?} attrObj
     * @return {?}
     */
    handleReadonly(attrObj) {
        this._privateDynamicFromService.handleReadonly(attrObj);
    }
}
CheckboxControllComponent.decorators = [
    { type: Component, args: [{
                selector: 'checkbox-controll',
                template: "<div class=\"form-group {{(field.class) ? field.class : ''}}\" [formGroup]=\"parentFormGroup\">\n    <show-label [class]=\"'form-check-label col-12 pl-0 pt-2 pb-2'\" [labelName]=\"field.label\"\n        [isrequired]=\"showRequired(field.validations)\"></show-label>\n\n    <div class=\"form-button-style pt-1\" [formArrayName]=\"field.name\"\n        [ngClass]=\"{'readonly-text-color': handleReadonlyAttr(field), 'border border-danger': (errorList(parentFormGroup.controls[field.name].controls[formConstants.fieldType.checkBox], field).length > 0)}\">\n        <div [formArrayName]=\"formConstants.fieldType.checkBox\">\n            <label *ngFor=\"let checkboxItem of field.otherOptions; let r = index;\" (click)=\"clickCheckBox(field)\">\n                <input type=\"checkbox\" name=\"{{field.otherOptions[r].name}}\" (change)=\"changeEvent($event)\"\n                    (click)=\"handleReadonly(field)\" [formControlName]=\"r\" value=\"{{field.otherOptions[r].value}}\">\n                <span class=\"label-text checkbox-label\">{{field.otherOptions[r].label}}</span>\n            </label>\n        </div>\n    </div>\n\n    <show-error [errorList]=\"errorList(parentFormGroup.controls[field.name].controls[formConstants.fieldType.checkBox], field)\">\n    </show-error>\n</div>",
                styles: [".form-button-style .checkbox-label{font-size:1rem}.form-button-style input[type=checkbox]{position:absolute;right:9000px}.form-button-style input[type=checkbox]+.label-text:before{content:\"\\f096\";font-family:FontAwesome;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;width:1em;display:inline-block;margin-right:5px}.form-button-style input[type=checkbox]:checked+.label-text:before{content:\"\\f14a\";color:#2980b9;-webkit-animation:250ms ease-in effect;animation:250ms ease-in effect}.form-button-style input[type=checkbox]:disabled+.label-text{color:#aaa}.form-button-style input[type=checkbox]:disabled+.label-text:before{content:\"\\f0c8\";color:#ccc}@-webkit-keyframes effect{0%{-webkit-transform:scale(0);transform:scale(0)}25%{-webkit-transform:scale(1.3);transform:scale(1.3)}75%{-webkit-transform:scale(1.4);transform:scale(1.4)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes effect{0%{-webkit-transform:scale(0);transform:scale(0)}25%{-webkit-transform:scale(1.3);transform:scale(1.3)}75%{-webkit-transform:scale(1.4);transform:scale(1.4)}100%{-webkit-transform:scale(1);transform:scale(1)}}.form-button-style label{margin-right:.5rem}"]
            }] }
];
/** @nocollapse */
CheckboxControllComponent.ctorParameters = () => [
    { type: PrivateDynamicFromService },
    { type: DynamicFormService }
];
CheckboxControllComponent.propDecorators = {
    rowField: [{ type: Input }],
    field: [{ type: Input }],
    parentFormGroup: [{ type: Input }],
    clickEvent: [{ type: Output }]
};
if (false) {
    /** @type {?} */
    CheckboxControllComponent.prototype.rowField;
    /** @type {?} */
    CheckboxControllComponent.prototype.field;
    /** @type {?} */
    CheckboxControllComponent.prototype.parentFormGroup;
    /** @type {?} */
    CheckboxControllComponent.prototype.clickEvent;
    /** @type {?} */
    CheckboxControllComponent.prototype.formConstants;
    /** @type {?} */
    CheckboxControllComponent.prototype.privateConstants;
    /**
     * @type {?}
     * @private
     */
    CheckboxControllComponent.prototype._privateDynamicFromService;
    /**
     * @type {?}
     * @private
     */
    CheckboxControllComponent.prototype._dynamicFormService;
}
//# sourceMappingURL=data:application/json;base64, 