/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
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';
export class NameValueEditorComponent extends BaseWidget {
    /**
     * @param {?} element
     * @param {?} clientSettingsService
     * @param {?} displayStateService
     * @param {?} appStateService
     * @param {?} webPlatformApiService
     */
    constructor(element, clientSettingsService, displayStateService, appStateService, webPlatformApiService) {
        super(element, clientSettingsService, displayStateService, appStateService, webPlatformApiService);
        this.element = element;
        this.clientSettingsService = clientSettingsService;
        this.displayStateService = displayStateService;
        this.appStateService = appStateService;
        this.webPlatformApiService = webPlatformApiService;
    }
    /**
     * @return {?}
     */
    Add() {
        this.nvArray.push({ name: '', value: '' });
    }
    /**
     * @param {?} idx
     * @return {?}
     */
    DeleteByIndex(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 = () => [
    { 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 }]
};
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;
}

//# sour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