/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component, ChangeDetectorRef } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';
import { FVAbstractControl } from '../../../shared/abstract-control.component';
import { ProcessService } from '../../../../services/process.service';
var FVControlsListFieldComponent = /** @class */ (function (_super) {
    tslib_1.__extends(FVControlsListFieldComponent, _super);
    function FVControlsListFieldComponent(ref, process) {
        var _this = _super.call(this, process) || this;
        _this.ref = ref;
        _this.options = [];
        return _this;
    }
    /**
     * @return {?}
     */
    FVControlsListFieldComponent.prototype.ngAfterViewInit = /**
     * @return {?}
     */
    function () {
        _super.prototype.AfterViewInit.call(this);
        this.loadOptions();
    };
    /**
     * @return {?}
     */
    FVControlsListFieldComponent.prototype.loadOptions = /**
     * @return {?}
     */
    function () {
        var _this = this;
        /** @type {?} */
        var componentConfig = this.task.componentConfig;
        /** @type {?} */
        var getControlsOptions = function (referenceName) {
            /** @type {?} */
            var ref = _this.controlRef(referenceName);
            return ref && ref.options;
        };
        /** @type {?} */
        var refName = this.control.referenceName;
        this.options = (this.task && componentConfig)
            && (this.control.options || getControlsOptions(refName) || [])
            || [];
        this.ref.detectChanges();
    };
    FVControlsListFieldComponent.decorators = [
        { type: Component, args: [{
                    selector: 'fv-controls-list-field',
                    template: "<div *ngIf=\"control\" class=\"controlBox\" [attr.id]=\"'control-' + control.referenceName\">\n  <i *ngIf=\"buttonsDebug\" (click)=\"debugStatus =! debugStatus\" class=\"fa fa-stethoscope\"></i>\n  <ng-container *ngIf=\"!hideLabel\">\n    <span class=\"controlName\" [attr.id]=\"'label-' + control.referenceName\">{{ control?.label | ltranslate }}</span>\n    <span *ngIf=\"control?.isRequired\" class=\"required\">*</span>\n    <i *ngIf=\"tooltip\" class=\"fa fa-question-circle\" [tooltip]=\"tooltip | ltranslate\" container=\"body\" placement=\"top\"></i>\n  </ng-container>\n  <div *ngIf=\"debugStatus\" [innerText]=\"debugText()\"></div>\n  <div class=\"input-group\">\n    <select type=\"text\" [attr.id]=\"'select-' + control.referenceName\" [name]=\"control?.key\" ngModel [disabled]=\"disabled || isReadOnly\"\n      [required]=\"control?.isRequired ? true : null\" [attr.multiple]=\"control?.isMultiple ? true : null\">\n      <option *ngFor=\"let option of options\" [value]=\"option.value\" [innerText]=\"option.label | ltranslate\"></option>\n    </select>\n  </div>\n  <fv-controls-validator *ngIf=\"group?.controls[control.key]\" [FVFormControl]=\"group?.controls[control.key]\" [group]=\"group\"\n    [control]=\"control\" [task]=\"task\" [tabIndex]=\"tabIndex\"></fv-controls-validator>\n</div>",
                    viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
                    styles: [".col{display:inline-flex;flex-basis:0;flex-grow:1;max-width:100%;min-width:50%}.col fv-form-tab{padding:0 5px;display:block;width:100%}.col fv-form-tab .controls-row{margin:0;padding:0}.col fv-form-tab div{max-width:100%}.columns-0,.columns-1{width:100%;min-width:100%;max-width:100%}.columns-2{width:50%;min-width:50%;max-width:50%}.columns-3{width:33.33%;max-width:33.33%;min-width:33.33%}.columns-4{width:25%;max-width:25%;min-width:25%}.controlBox .input-group{display:inline-flex;width:100%;margin-top:5px}.controlBox>.input-group>button:not(.input-group-addon),.controlBox>.input-group>input,.controlBox>.input-group>select{height:40px!important;width:100%;padding:10px}.controlBox .input-group button.input-group-addon{position:relative;width:35px;height:40px}.controlBox .input-group span.controlName{color:red}.controlBox .input-group button.input-group-addon i{position:absolute;top:10px;bottom:0;left:0;right:0}.has-text-centered,.table,.table thead th{text-align:center}.gridForm{width:100%;padding:0;margin:0 0 10px}.gridForm .input-group>.form-control{max-width:50%;border-radius:unset;margin-right:10px;min-width:80px;min-height:45px}.gridForm .input-group>.addon{background:0 0;border:none;color:#36c}.grid-table tbody>tr>td{vertical-align:middle}.modal-dialog>.modal-content{max-height:100vh}.modal-content>.modal-body{max-height:85vh;overflow-y:auto;padding-bottom:40px}.modal-content fv-navigator{display:block;height:50px;position:fixed;bottom:0;left:0;right:0;padding:0 3rem;background-color:#fdfdfd9e;border-bottom-right-radius:10px;border-bottom-left-radius:10px;margin:0 2px;z-index:999}.modal-content fv-navigator .docked-buttons{width:auto}.modal-content fv-navigator .btn-col:not(.bottom){max-width:unset;padding:6px!important}span.required{color:red}form:not(.ng-untouched) .ng-invalid{border:1px solid red},form:not(.ng-untouched) .ng-invalid.input-group-addon{border-left:none!important}span.error-block{color:red}@media screen and (max-width:426px){.columns-2,.columns-3,.columns-4{width:100%;max-width:100%;min-width:100%}}.tree:last-of-type(.accordion){margin:0}select:disabled{background:#eee}navigator-bot,navigator-top{display:flex}fv-menu-folder:last-of-type>accordion:last-of-type{margin:0;padding:0}.button-group>button:not(:last-child):not(:first-child){margin-left:0!important;padding-left:0!important;margin-right:0!important;padding-right:0!important}.fv_container,.fv_container>*,navigator-after,navigator-before{all:inherit!important;padding:0!important}.lookup-form .gridInputs{width:100%}.lookup-form .gridInputs select{width:40%}.lookup-form .gridInputs input{width:60%}.lookup-form .gridInputs,.lookup-form .gridInputs input,.lookup-form .gridInputs select{max-width:100%}.noMarginY{margin-top:0!important;margin-bottom:0!important}.placeholder,ng-select input:-moz-placeholder,ng-select input:-ms-input-placeholder,ng-select input:-webkit-input-placeholder,ng-select input:placeholder{color:#a9a9a9}select-dropdown>div{position:relative!important;top:0!important}select-dropdown div.options{text-align:left}.modal-dialog .modal-header .pull-right span{font-size:inherit!important}bs-datepicker-navigation-view{display:block;width:100%;text-align:center}.bs-datepicker-head .previous{float:left}.bs-datepicker-head .next{float:right}textarea{min-height:45px;min-width:100%}"]
                }] }
    ];
    /** @nocollapse */
    FVControlsListFieldComponent.ctorParameters = function () { return [
        { type: ChangeDetectorRef },
        { type: ProcessService }
    ]; };
    return FVControlsListFieldComponent;
}(FVAbstractControl));
export { FVControlsListFieldComponent };
if (false) {
    /** @type {?} */
    FVControlsListFieldComponent.prototype.options;
    /** @type {?} */
    FVControlsListFieldComponent.prototype.ref;
}

//# sourceMappingURL=data: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