/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
export class DataGroupingEditorComponent {
    constructor() {
        this.operations = ['mean', 'median', 'stddev', 'sum', 'min', 'max', 'count'];
    }
    /**
     * @return {?}
     */
    AddGroupBy() {
        this.dataGrouping.groupBy.push(this.newGroupByColum);
    }
    /**
     * @param {?} col
     * @return {?}
     */
    RemoveGroupBy(col) {
        this.dataGrouping.groupBy = this.dataGrouping.groupBy.filter(s => s !== col);
    }
    /**
     * @return {?}
     */
    AddAggregate() {
        this.dataGrouping.aggregations.push({ name: '', operation: '', rename: '' });
    }
    /**
     * @param {?} i
     * @return {?}
     */
    RemoveAggregate(i) {
        this.dataGrouping.aggregations.splice(i, 1);
    }
    /**
     * @return {?}
     */
    ngOnInit() {
    }
}
DataGroupingEditorComponent.decorators = [
    { type: Component, args: [{
                selector: 'app-data-grouping-editor',
                template: "<label class=\"col-sm-2 col-form-label\">Server side filtering</label>\r\n<input type=\"text\" class=\"form-control\" [(ngModel)]=\"dataGrouping.serverSide\" name=\"serverSide\">\r\n\r\n<table>\r\n    <thead>\r\n        <th>Group By Column</th>\r\n        <th></th>\r\n    </thead>\r\n    <tbody>\r\n        <tr *ngFor=\"let col of dataGrouping.groupBy\">\r\n            <td>{{col}}</td>\r\n            <button type=\"button\" class=\"btn btn-sm btn-secondary\" (click)=\"RemoveGroupBy(col)\"><i _ngcontent-c24=\"\" class=\"fa fa-times\"></i></button>\r\n        </tr>\r\n        <tr>\r\n            <td>\r\n                <input type=\"text\" class=\"form-control\" [(ngModel)]=\"newGroupByColum\" name=\"newGroupByColum\">\r\n            </td>\r\n            <td>\r\n                <button type=\"button\" class=\"btn btn-sm btn-outline-primary\" (click)=\"AddGroupBy()\"> New </button>\r\n            </td>\r\n        </tr>\r\n    </tbody>\r\n</table>\r\n\r\n\r\n<div class=\"form-group row\">\r\n    <label class=\"col-sm-3 col-form-label\">name</label>\r\n    <label class=\"col-sm-2 col-form-label\">operation</label>\r\n    <label class=\"col-sm-2 col-form-label\">rename</label>\r\n</div>\r\n\r\n<div class=\"form-group row\" *ngFor=\"let agg of dataGrouping.aggregations; let i = index\">\r\n    <div class=\"col-sm-3\">\r\n        <input type=\"text\" class=\"form-control\" [(ngModel)]=\"agg.name\" name=\"column\">\r\n    </div>\r\n    <div class=\"col-sm-2\">\r\n        <select class=\"form-control\" [(ngModel)]=\"agg.operation\" id=\"fRuleOperator\">\r\n        <option *ngFor=\"let op of operations\" [ngValue]=\"op\">\r\n                {{op}}\r\n        </option>\r\n    </select>\r\n    </div>\r\n\r\n    <div class=\"col-sm-2\">\r\n        <input type=\"text\" class=\"form-control\" [(ngModel)]=\"agg.rename\" name=\"aggRename\">\r\n    </div>\r\n    <div class=\"col-sm-2\">\r\n        <button type=\"button\" class=\"btn btn-sm btn-secondary\" (click)=\"RemoveAggregate(i)\"><i _ngcontent-c24=\"\" class=\"fa fa-times\"></i></button>\r\n    </div>\r\n</div>\r\n<button type=\"button\" class=\"btn btn-sm btn-outline-primary\" (click)=\"AddAggregate()\"> New Aggregate </button>",
                styles: [""]
            }] }
];
/** @nocollapse */
DataGroupingEditorComponent.ctorParameters = () => [];
DataGroupingEditorComponent.propDecorators = {
    dataGrouping: [{ type: Input }],
    columns: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    DataGroupingEditorComponent.prototype.dataGrouping;
    /** @type {?} */
    DataGroupingEditorComponent.prototype.columns;
    /** @type {?} */
    DataGroupingEditorComponent.prototype.newGroupByColum;
    /** @type {?} */
    DataGroupingEditorComponent.prototype.operations;
}

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