/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component, Input, ElementRef } from '@angular/core';
import { BaseWidget } from '../../../BaseWidget/BaseWidget.component';
import { DisplayStateService } from '../../../../../services/DisplayStateService';
import { AppStateService } from '../../../../../services/AppStateService';
import { WebPlatformApiService } from '../../../../../services/WebPlatformApiService';
import { ClientSettingsService } from '../../../../../services/ClientSettingsService';
var NameValueEditorComponent = /** @class */ (function (_super) {
    tslib_1.__extends(NameValueEditorComponent, _super);
    function NameValueEditorComponent(element, clientSettingsService, displayStateService, appStateService, webPlatformApiService) {
        var _this = _super.call(this, element, clientSettingsService, displayStateService, appStateService, webPlatformApiService) || this;
        _this.element = element;
        _this.clientSettingsService = clientSettingsService;
        _this.displayStateService = displayStateService;
        _this.appStateService = appStateService;
        _this.webPlatformApiService = webPlatformApiService;
        return _this;
    }
    /**
     * @return {?}
     */
    NameValueEditorComponent.prototype.Add = /**
     * @return {?}
     */
    function () {
        this.nvArray.push({ name: '', value: '' });
    };
    /**
     * @param {?} idx
     * @return {?}
     */
    NameValueEditorComponent.prototype.DeleteByIndex = /**
     * @param {?} idx
     * @return {?}
     */
    function (idx) {
        this.nvArray.splice(idx, 1);
    };
    NameValueEditorComponent.decorators = [
        { type: Component, args: [{
                    selector: 'app-name-value-editor',
                    template: "<div class=\"form-group row\">\r\n    <label class=\"col-sm-6 tightPad col-form-label\">{{nameDisplay}}</label>\r\n    <label class=\"col-sm-5 col-form-label\">{{valueDisplay}}</label>\r\n</div>\r\n<div class=\"form-group row\" *ngFor=\"let nv of nvArray; let idx = index\">\r\n\r\n    <div *ngIf=\"nameEnum; else nonameEnum\" class=\"col-sm-3\">\r\n        <select class=\"form-control\" [(ngModel)]=\"nv.name\" id=\"nvName\">\r\n        <option *ngFor=\"let name of nameEnum\" [ngValue]=\"name\">\r\n                {{name}}\r\n        </option>\r\n      </select>\r\n    </div>\r\n    <ng-template #nonameEnum>\r\n        <div class=\"col-sm-3\">\r\n            <input type=\"text\" class=\"form-control\" [(ngModel)]=\"nv.name\" name=\"name\">\r\n        </div>\r\n    </ng-template>\r\n\r\n    <div *ngIf=\"valueEnum; else novalueEnum\" class=\"col-sm-5 tightPad\">\r\n\r\n        <select class=\"form-control\" [(ngModel)]=\"nv.value\" id=\"nvValue\">\r\n        <option *ngFor=\"let value of valueEnum\" [ngValue]=\"value\">\r\n                {{value}}\r\n        </option>\r\n      </select>\r\n    </div>\r\n\r\n    <ng-template #novalueEnum>\r\n        <div class=\"col-sm-5 tightPad\">\r\n            <input type=\"text\" class=\"form-control\" [(ngModel)]=\"nv.value\" name=\"value\">\r\n        </div>\r\n    </ng-template>\r\n\r\n    <div class=\"col-sm-1 tightPad\">\r\n        <button type=\"button\" class=\"btn btn-danger btn-sm\" (click)=\"DeleteByIndex(idx)\">\r\n            <i class=\"fa fa-times\"></i>\r\n        </button>\r\n    </div>\r\n</div>\r\n<button type=\"button\" class=\"btn btn-sm btn-outline-primary\" (click)=\"Add()\">Add</button>",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    NameValueEditorComponent.ctorParameters = function () { return [
        { type: ElementRef },
        { type: ClientSettingsService },
        { type: DisplayStateService },
        { type: AppStateService },
        { type: WebPlatformApiService }
    ]; };
    NameValueEditorComponent.propDecorators = {
        nvArray: [{ type: Input }],
        nameDisplay: [{ type: Input }],
        valueDisplay: [{ type: Input }],
        nameEnum: [{ type: Input }],
        valueEnum: [{ type: Input }]
    };
    return NameValueEditorComponent;
}(BaseWidget));
export { NameValueEditorComponent };
if (false) {
    /** @type {?} */
    NameValueEditorComponent.prototype.nvArray;
    /** @type {?} */
    NameValueEditorComponent.prototype.nameDisplay;
    /** @type {?} */
    NameValueEditorComponent.prototype.valueDisplay;
    /** @type {?} */
    NameValueEditorComponent.prototype.nameEnum;
    /** @type {?} */
    NameValueEditorComponent.prototype.valueEnum;
    /** @type {?} */
    NameValueEditorComponent.prototype.element;
    /** @type {?} */
    NameValueEditorComponent.prototype.clientSettingsService;
    /** @type {?} */
    NameValueEditorComponent.prototype.displayStateService;
    /** @type {?} */
    NameValueEditorComponent.prototype.appStateService;
    /** @type {?} */
    NameValueEditorComponent.prototype.webPlatformApiService;
}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmFtZS12YWx1ZS1lZGl0b3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vd2ViLXBsYXRmb3JtLWxpYnJhcnkvIiwic291cmNlcyI6WyJjb21wb25lbnRzL3dpZGdldHMvYWRtaW4vRWRpdG9ycy9uYW1lLXZhbHVlLWVkaXRvci9uYW1lLXZhbHVlLWVkaXRvci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFN0QsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLDBDQUEwQyxDQUFDO0FBRXRFLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDZDQUE2QyxDQUFDO0FBQ2xGLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUMxRSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSwrQ0FBK0MsQ0FBQztBQUN0RixPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSwrQ0FBK0MsQ0FBQzs7SUFPeEMsb0RBQVU7SUFRdEQsa0NBQ1ksT0FBbUIsRUFDbkIscUJBQTRDLEVBQzVDLG1CQUF3QyxFQUN4QyxlQUFnQyxFQUNoQyxxQkFBNEM7UUFMeEQsWUFNSSxrQkFBTSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsbUJBQW1CLEVBQUUsZUFBZSxFQUFFLHFCQUFxQixDQUFDLFNBQ25HO1FBTlMsYUFBTyx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