/**
 * @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 SelectOptionControllComponent = /** @class */ (function () {
    function SelectOptionControllComponent(_privateDynamicFromService, _dynamicFormService) {
        this._privateDynamicFromService = _privateDynamicFromService;
        this._dynamicFormService = _dynamicFormService;
        this.privateConstants = privateConstants;
    }
    /**
     * @return {?}
     */
    SelectOptionControllComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () { };
    /**
     * @param {?} errorListObj
     * @param {?} fieldObj
     * @return {?}
     */
    SelectOptionControllComponent.prototype.errorList = /**
     * @param {?} errorListObj
     * @param {?} fieldObj
     * @return {?}
     */
    function (errorListObj, fieldObj) {
        return this._privateDynamicFromService.errorList(errorListObj, fieldObj);
    };
    /**
     * @param {?} validations
     * @return {?}
     */
    SelectOptionControllComponent.prototype.showRequired = /**
     * @param {?} validations
     * @return {?}
     */
    function (validations) {
        return this._privateDynamicFromService.showRequired(validations);
    };
    /**
     * @param {?} event
     * @return {?}
     */
    SelectOptionControllComponent.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);
                }));
            }
        }));
    };
    SelectOptionControllComponent.decorators = [
        { type: Component, args: [{
                    selector: 'select-option-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    <select class=\"form-control\" [formControlName]=\"field.name\" (change)=\"changeEvent($event)\"\n        [ngClass]=\"{ 'border border-danger': (errorList(parentFormGroup.controls[field.name], field).length > 0) }\"\n        [multiple]=\"((field.attr && field.attr.multiple) ? true : false)\">\n        <option value=\"\" *ngIf=\"!(field.value && field.value.length)\">\n            {{((field.attr && field.attr.placeholder) ? field.attr.placeholder : privateConstants.applicationMsg.selectDefaultOption)}}\n        </option>\n        <option *ngFor=\"let option of field.otherOptions\" [value]=\"option.value\"\n            [disabled]=\"((field.attr && field.attr.readonly) ? true : false)\">{{option.label}}\n        </option>\n    </select>\n\n    <show-error [errorList]=\"errorList(parentFormGroup.controls[field.name], field)\"></show-error>\n</div>",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    SelectOptionControllComponent.ctorParameters = function () { return [
        { type: PrivateDynamicFromService },
        { type: DynamicFormService }
    ]; };
    SelectOptionControllComponent.propDecorators = {
        rowField: [{ type: Input }],
        field: [{ type: Input }],
        parentFormGroup: [{ type: Input }],
        i: [{ type: Input }],
        j: [{ type: Input }]
    };
    return SelectOptionControllComponent;
}());
export { SelectOptionControllComponent };
if (false) {
    /** @type {?} */
    SelectOptionControllComponent.prototype.rowField;
    /** @type {?} */
    SelectOptionControllComponent.prototype.field;
    /** @type {?} */
    SelectOptionControllComponent.prototype.parentFormGroup;
    /** @type {?} */
    SelectOptionControllComponent.prototype.i;
    /** @type {?} */
    SelectOptionControllComponent.prototype.j;
    /** @type {?} */
    SelectOptionControllComponent.prototype.privateConstants;
    /**
     * @type {?}
     * @private
     */
    SelectOptionControllComponent.prototype._privateDynamicFromService;
    /**
     * @type {?}
     * @private
     */
    SelectOptionControllComponent.prototype._dynamicFormService;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0LW9wdGlvbi1jb250cm9sbC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9hbmd1bGFyLXJlYWN0aXZlLWR5bmFtaWMt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