/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
var DataGroupingEditorComponent = /** @class */ (function () {
    function DataGroupingEditorComponent() {
        this.operations = ['mean', 'median', 'stddev', 'sum', 'min', 'max', 'count'];
    }
    /**
     * @return {?}
     */
    DataGroupingEditorComponent.prototype.AddGroupBy = /**
     * @return {?}
     */
    function () {
        this.dataGrouping.groupBy.push(this.newGroupByColum);
    };
    /**
     * @param {?} col
     * @return {?}
     */
    DataGroupingEditorComponent.prototype.RemoveGroupBy = /**
     * @param {?} col
     * @return {?}
     */
    function (col) {
        this.dataGrouping.groupBy = this.dataGrouping.groupBy.filter(function (s) { return s !== col; });
    };
    /**
     * @return {?}
     */
    DataGroupingEditorComponent.prototype.AddAggregate = /**
     * @return {?}
     */
    function () {
        this.dataGrouping.aggregations.push({ name: '', operation: '', rename: '' });
    };
    /**
     * @param {?} i
     * @return {?}
     */
    DataGroupingEditorComponent.prototype.RemoveAggregate = /**
     * @param {?} i
     * @return {?}
     */
    function (i) {
        this.dataGrouping.aggregations.splice(i, 1);
    };
    /**
     * @return {?}
     */
    DataGroupingEditorComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
    };
    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 = function () { return []; };
    DataGroupingEditorComponent.propDecorators = {
        dataGrouping: [{ type: Input }],
        columns: [{ type: Input }]
    };
    return DataGroupingEditorComponent;
}());
export { DataGroupingEditorComponent };
if (false) {
    /** @type {?} */
    DataGroupingEditorComponent.prototype.dataGrouping;
    /** @type {?} */
    DataGroupingEditorComponent.prototype.columns;
    /** @type {?} */
    DataGroupingEditorComponent.prototype.newGroupByColum;
    /** @type {?} */
    DataGroupingEditorComponent.prototype.operations;
}

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