Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ag-grid-enterprise/row-grouping

Package Overview
Dependencies
Maintainers
3
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/row-grouping - npm Package Compare versions

Comparing version 31.0.3 to 31.1.0

1

dist/cjs/es5/rowGrouping/aggFuncService.d.ts

@@ -20,3 +20,2 @@ import { BeanStub, Column, IAggFunc, IAggFuncService } from '@ag-grid-community/core';

}): void;
addAggFunc(key: string, aggFunc: IAggFunc): void;
getAggFunc(name: string): IAggFunc;

@@ -23,0 +22,0 @@ getFuncNames(column: Column): string[];

8

dist/cjs/es5/rowGrouping/aggFuncService.js

@@ -85,7 +85,7 @@ "use strict";

AggFuncService.prototype.addAggFuncs = function (aggFuncs) {
core_1._.iterateObject(aggFuncs, this.addAggFunc.bind(this));
};
AggFuncService.prototype.addAggFunc = function (key, aggFunc) {
var _this = this;
this.init();
this.aggFuncsMap[key] = aggFunc;
core_1._.iterateObject(aggFuncs, function (key, aggFunc) {
_this.aggFuncsMap[key] = aggFunc;
});
};

@@ -92,0 +92,0 @@ AggFuncService.prototype.getAggFunc = function (name) {

@@ -118,38 +118,38 @@ "use strict";

AggregationStage.prototype.aggregateRowNodeUsingValuesAndPivot = function (rowNode) {
var _this = this;
var _a;
var _a, _b;
var result = {};
var secondaryColumns = (_a = this.columnModel.getSecondaryColumns()) !== null && _a !== void 0 ? _a : [];
secondaryColumns.forEach(function (secondaryCol) {
var _a = secondaryCol.getColDef(), pivotValueColumn = _a.pivotValueColumn, pivotTotalColumnIds = _a.pivotTotalColumnIds, colId = _a.colId, pivotKeys = _a.pivotKeys;
if (core_1._.exists(pivotTotalColumnIds)) {
return;
var canSkipTotalColumns = true;
for (var i = 0; i < secondaryColumns.length; i++) {
var secondaryCol = secondaryColumns[i];
var colDef = secondaryCol.getColDef();
if (colDef.pivotTotalColumnIds != null) {
canSkipTotalColumns = false;
continue;
}
var keys = pivotKeys !== null && pivotKeys !== void 0 ? pivotKeys : [];
var values;
var keys = (_b = colDef.pivotKeys) !== null && _b !== void 0 ? _b : [];
var values = void 0;
if (rowNode.leafGroup) {
// lowest level group, get the values from the mapped set
values = _this.getValuesFromMappedSet(rowNode.childrenMapped, keys, pivotValueColumn);
values = this.getValuesFromMappedSet(rowNode.childrenMapped, keys, colDef.pivotValueColumn);
}
else {
// value columns and pivot columns, non-leaf group
values = _this.getValuesPivotNonLeaf(rowNode, colId);
values = this.getValuesPivotNonLeaf(rowNode, colDef.colId);
}
result[colId] = _this.aggregateValues(values, pivotValueColumn.getAggFunc(), pivotValueColumn, rowNode, secondaryCol);
});
secondaryColumns.forEach(function (secondaryCol) {
var _a = secondaryCol.getColDef(), pivotValueColumn = _a.pivotValueColumn, pivotTotalColumnIds = _a.pivotTotalColumnIds, colId = _a.colId;
if (!core_1._.exists(pivotTotalColumnIds)) {
return;
// bit of a memory drain storing null/undefined, but seems to speed up performance.
result[colDef.colId] = this.aggregateValues(values, colDef.pivotValueColumn.getAggFunc(), colDef.pivotValueColumn, rowNode, secondaryCol);
}
if (!canSkipTotalColumns) {
for (var i = 0; i < secondaryColumns.length; i++) {
var secondaryCol = secondaryColumns[i];
var colDef = secondaryCol.getColDef();
if (colDef.pivotTotalColumnIds == null || !colDef.pivotTotalColumnIds.length) {
continue;
}
var aggResults = colDef.pivotTotalColumnIds.map(function (currentColId) { return result[currentColId]; });
// bit of a memory drain storing null/undefined, but seems to speed up performance.
result[colDef.colId] = this.aggregateValues(aggResults, colDef.pivotValueColumn.getAggFunc(), colDef.pivotValueColumn, rowNode, secondaryCol);
}
var aggResults = [];
//retrieve results for colIds associated with this pivot total column
if (!pivotTotalColumnIds || !pivotTotalColumnIds.length) {
return;
}
pivotTotalColumnIds.forEach(function (currentColId) {
aggResults.push(result[currentColId]);
});
result[colId] = _this.aggregateValues(aggResults, pivotValueColumn.getAggFunc(), pivotValueColumn, rowNode, secondaryCol);
});
}
return result;

@@ -179,8 +179,3 @@ };

AggregationStage.prototype.getValuesPivotNonLeaf = function (rowNode, colId) {
var values = [];
rowNode.childrenAfterFilter.forEach(function (node) {
var value = node.aggData[colId];
values.push(value);
});
return values;
return rowNode.childrenAfterFilter.map(function (childNode) { return childNode.aggData[colId]; });
};

@@ -190,12 +185,10 @@ AggregationStage.prototype.getValuesFromMappedSet = function (mappedSet, keys, valueColumn) {

var mapPointer = mappedSet;
keys.forEach(function (key) { return (mapPointer = mapPointer ? mapPointer[key] : null); });
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
mapPointer = mapPointer ? mapPointer[key] : null;
}
if (!mapPointer) {
return [];
}
var values = [];
mapPointer.forEach(function (rowNode) {
var value = _this.valueService.getValue(valueColumn, rowNode);
values.push(value);
});
return values;
return mapPointer.map(function (rowNode) { return _this.valueService.getValue(valueColumn, rowNode); });
};

@@ -202,0 +195,0 @@ AggregationStage.prototype.getValuesNormal = function (rowNode, valueColumns, filteredOnly) {

@@ -58,3 +58,3 @@ import { Column, ColumnEventType, Component, Context, DragAndDropService, DraggingEvent, EventService, GridOptionsService, LoggerFactory } from "@ag-grid-community/core";

private onDragEnter;
setColumnsVisible(columns: Column[] | null | undefined, visible: boolean, source?: ColumnEventType): void;
setColumnsVisible(columns: Column[] | null | undefined, visible: boolean, source: ColumnEventType): void;
protected isPotentialDndColumns(): boolean;

@@ -61,0 +61,0 @@ private isRowGroupPanel;

@@ -242,3 +242,2 @@ "use strict";

BaseDropZonePanel.prototype.setColumnsVisible = function (columns, visible, source) {
if (source === void 0) { source = "api"; }
if (columns) {

@@ -245,0 +244,0 @@ var allowedCols = columns.filter(function (c) { return !c.getColDef().lockVisible; });

@@ -1,1 +0,1 @@

export declare const VERSION = "31.0.3";
export declare const VERSION = "31.1.0";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '31.0.3';
exports.VERSION = '31.1.0';

@@ -20,3 +20,2 @@ import { BeanStub, Column, IAggFunc, IAggFuncService } from '@ag-grid-community/core';

}): void;
addAggFunc(key: string, aggFunc: IAggFunc): void;
getAggFunc(name: string): IAggFunc;

@@ -23,0 +22,0 @@ getFuncNames(column: Column): string[];

@@ -68,7 +68,6 @@ "use strict";

addAggFuncs(aggFuncs) {
core_1._.iterateObject(aggFuncs, this.addAggFunc.bind(this));
}
addAggFunc(key, aggFunc) {
this.init();
this.aggFuncsMap[key] = aggFunc;
core_1._.iterateObject(aggFuncs, (key, aggFunc) => {
this.aggFuncsMap[key] = aggFunc;
});
}

@@ -75,0 +74,0 @@ getAggFunc(name) {

@@ -98,37 +98,38 @@ "use strict";

aggregateRowNodeUsingValuesAndPivot(rowNode) {
var _a;
var _a, _b;
const result = {};
const secondaryColumns = (_a = this.columnModel.getSecondaryColumns()) !== null && _a !== void 0 ? _a : [];
secondaryColumns.forEach(secondaryCol => {
const { pivotValueColumn, pivotTotalColumnIds, colId, pivotKeys } = secondaryCol.getColDef();
if (core_1._.exists(pivotTotalColumnIds)) {
return;
let canSkipTotalColumns = true;
for (let i = 0; i < secondaryColumns.length; i++) {
const secondaryCol = secondaryColumns[i];
const colDef = secondaryCol.getColDef();
if (colDef.pivotTotalColumnIds != null) {
canSkipTotalColumns = false;
continue;
}
const keys = pivotKeys !== null && pivotKeys !== void 0 ? pivotKeys : [];
const keys = (_b = colDef.pivotKeys) !== null && _b !== void 0 ? _b : [];
let values;
if (rowNode.leafGroup) {
// lowest level group, get the values from the mapped set
values = this.getValuesFromMappedSet(rowNode.childrenMapped, keys, pivotValueColumn);
values = this.getValuesFromMappedSet(rowNode.childrenMapped, keys, colDef.pivotValueColumn);
}
else {
// value columns and pivot columns, non-leaf group
values = this.getValuesPivotNonLeaf(rowNode, colId);
values = this.getValuesPivotNonLeaf(rowNode, colDef.colId);
}
result[colId] = this.aggregateValues(values, pivotValueColumn.getAggFunc(), pivotValueColumn, rowNode, secondaryCol);
});
secondaryColumns.forEach(secondaryCol => {
const { pivotValueColumn, pivotTotalColumnIds, colId } = secondaryCol.getColDef();
if (!core_1._.exists(pivotTotalColumnIds)) {
return;
// bit of a memory drain storing null/undefined, but seems to speed up performance.
result[colDef.colId] = this.aggregateValues(values, colDef.pivotValueColumn.getAggFunc(), colDef.pivotValueColumn, rowNode, secondaryCol);
}
if (!canSkipTotalColumns) {
for (let i = 0; i < secondaryColumns.length; i++) {
const secondaryCol = secondaryColumns[i];
const colDef = secondaryCol.getColDef();
if (colDef.pivotTotalColumnIds == null || !colDef.pivotTotalColumnIds.length) {
continue;
}
const aggResults = colDef.pivotTotalColumnIds.map((currentColId) => result[currentColId]);
// bit of a memory drain storing null/undefined, but seems to speed up performance.
result[colDef.colId] = this.aggregateValues(aggResults, colDef.pivotValueColumn.getAggFunc(), colDef.pivotValueColumn, rowNode, secondaryCol);
}
const aggResults = [];
//retrieve results for colIds associated with this pivot total column
if (!pivotTotalColumnIds || !pivotTotalColumnIds.length) {
return;
}
pivotTotalColumnIds.forEach((currentColId) => {
aggResults.push(result[currentColId]);
});
result[colId] = this.aggregateValues(aggResults, pivotValueColumn.getAggFunc(), pivotValueColumn, rowNode, secondaryCol);
});
}
return result;

@@ -157,21 +158,14 @@ }

getValuesPivotNonLeaf(rowNode, colId) {
const values = [];
rowNode.childrenAfterFilter.forEach((node) => {
const value = node.aggData[colId];
values.push(value);
});
return values;
return rowNode.childrenAfterFilter.map((childNode) => childNode.aggData[colId]);
}
getValuesFromMappedSet(mappedSet, keys, valueColumn) {
let mapPointer = mappedSet;
keys.forEach(key => (mapPointer = mapPointer ? mapPointer[key] : null));
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
mapPointer = mapPointer ? mapPointer[key] : null;
}
if (!mapPointer) {
return [];
}
const values = [];
mapPointer.forEach((rowNode) => {
const value = this.valueService.getValue(valueColumn, rowNode);
values.push(value);
});
return values;
return mapPointer.map((rowNode) => this.valueService.getValue(valueColumn, rowNode));
}

@@ -178,0 +172,0 @@ getValuesNormal(rowNode, valueColumns, filteredOnly) {

@@ -58,3 +58,3 @@ import { Column, ColumnEventType, Component, Context, DragAndDropService, DraggingEvent, EventService, GridOptionsService, LoggerFactory } from "@ag-grid-community/core";

private onDragEnter;
setColumnsVisible(columns: Column[] | null | undefined, visible: boolean, source?: ColumnEventType): void;
setColumnsVisible(columns: Column[] | null | undefined, visible: boolean, source: ColumnEventType): void;
protected isPotentialDndColumns(): boolean;

@@ -61,0 +61,0 @@ private isRowGroupPanel;

@@ -197,3 +197,3 @@ "use strict";

}
setColumnsVisible(columns, visible, source = "api") {
setColumnsVisible(columns, visible, source) {
if (columns) {

@@ -200,0 +200,0 @@ const allowedCols = columns.filter(c => !c.getColDef().lockVisible);

@@ -1,1 +0,1 @@

export declare const VERSION = "31.0.3";
export declare const VERSION = "31.1.0";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '31.0.3';
exports.VERSION = '31.1.0';

@@ -20,3 +20,2 @@ import { BeanStub, Column, IAggFunc, IAggFuncService } from '@ag-grid-community/core';

}): void;
addAggFunc(key: string, aggFunc: IAggFunc): void;
getAggFunc(name: string): IAggFunc;

@@ -23,0 +22,0 @@ getFuncNames(column: Column): string[];

@@ -82,7 +82,7 @@ var __extends = (this && this.__extends) || (function () {

AggFuncService.prototype.addAggFuncs = function (aggFuncs) {
_.iterateObject(aggFuncs, this.addAggFunc.bind(this));
};
AggFuncService.prototype.addAggFunc = function (key, aggFunc) {
var _this = this;
this.init();
this.aggFuncsMap[key] = aggFunc;
_.iterateObject(aggFuncs, function (key, aggFunc) {
_this.aggFuncsMap[key] = aggFunc;
});
};

@@ -89,0 +89,0 @@ AggFuncService.prototype.getAggFunc = function (name) {

@@ -115,38 +115,38 @@ var __extends = (this && this.__extends) || (function () {

AggregationStage.prototype.aggregateRowNodeUsingValuesAndPivot = function (rowNode) {
var _this = this;
var _a;
var _a, _b;
var result = {};
var secondaryColumns = (_a = this.columnModel.getSecondaryColumns()) !== null && _a !== void 0 ? _a : [];
secondaryColumns.forEach(function (secondaryCol) {
var _a = secondaryCol.getColDef(), pivotValueColumn = _a.pivotValueColumn, pivotTotalColumnIds = _a.pivotTotalColumnIds, colId = _a.colId, pivotKeys = _a.pivotKeys;
if (_.exists(pivotTotalColumnIds)) {
return;
var canSkipTotalColumns = true;
for (var i = 0; i < secondaryColumns.length; i++) {
var secondaryCol = secondaryColumns[i];
var colDef = secondaryCol.getColDef();
if (colDef.pivotTotalColumnIds != null) {
canSkipTotalColumns = false;
continue;
}
var keys = pivotKeys !== null && pivotKeys !== void 0 ? pivotKeys : [];
var values;
var keys = (_b = colDef.pivotKeys) !== null && _b !== void 0 ? _b : [];
var values = void 0;
if (rowNode.leafGroup) {
// lowest level group, get the values from the mapped set
values = _this.getValuesFromMappedSet(rowNode.childrenMapped, keys, pivotValueColumn);
values = this.getValuesFromMappedSet(rowNode.childrenMapped, keys, colDef.pivotValueColumn);
}
else {
// value columns and pivot columns, non-leaf group
values = _this.getValuesPivotNonLeaf(rowNode, colId);
values = this.getValuesPivotNonLeaf(rowNode, colDef.colId);
}
result[colId] = _this.aggregateValues(values, pivotValueColumn.getAggFunc(), pivotValueColumn, rowNode, secondaryCol);
});
secondaryColumns.forEach(function (secondaryCol) {
var _a = secondaryCol.getColDef(), pivotValueColumn = _a.pivotValueColumn, pivotTotalColumnIds = _a.pivotTotalColumnIds, colId = _a.colId;
if (!_.exists(pivotTotalColumnIds)) {
return;
// bit of a memory drain storing null/undefined, but seems to speed up performance.
result[colDef.colId] = this.aggregateValues(values, colDef.pivotValueColumn.getAggFunc(), colDef.pivotValueColumn, rowNode, secondaryCol);
}
if (!canSkipTotalColumns) {
for (var i = 0; i < secondaryColumns.length; i++) {
var secondaryCol = secondaryColumns[i];
var colDef = secondaryCol.getColDef();
if (colDef.pivotTotalColumnIds == null || !colDef.pivotTotalColumnIds.length) {
continue;
}
var aggResults = colDef.pivotTotalColumnIds.map(function (currentColId) { return result[currentColId]; });
// bit of a memory drain storing null/undefined, but seems to speed up performance.
result[colDef.colId] = this.aggregateValues(aggResults, colDef.pivotValueColumn.getAggFunc(), colDef.pivotValueColumn, rowNode, secondaryCol);
}
var aggResults = [];
//retrieve results for colIds associated with this pivot total column
if (!pivotTotalColumnIds || !pivotTotalColumnIds.length) {
return;
}
pivotTotalColumnIds.forEach(function (currentColId) {
aggResults.push(result[currentColId]);
});
result[colId] = _this.aggregateValues(aggResults, pivotValueColumn.getAggFunc(), pivotValueColumn, rowNode, secondaryCol);
});
}
return result;

@@ -176,8 +176,3 @@ };

AggregationStage.prototype.getValuesPivotNonLeaf = function (rowNode, colId) {
var values = [];
rowNode.childrenAfterFilter.forEach(function (node) {
var value = node.aggData[colId];
values.push(value);
});
return values;
return rowNode.childrenAfterFilter.map(function (childNode) { return childNode.aggData[colId]; });
};

@@ -187,12 +182,10 @@ AggregationStage.prototype.getValuesFromMappedSet = function (mappedSet, keys, valueColumn) {

var mapPointer = mappedSet;
keys.forEach(function (key) { return (mapPointer = mapPointer ? mapPointer[key] : null); });
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
mapPointer = mapPointer ? mapPointer[key] : null;
}
if (!mapPointer) {
return [];
}
var values = [];
mapPointer.forEach(function (rowNode) {
var value = _this.valueService.getValue(valueColumn, rowNode);
values.push(value);
});
return values;
return mapPointer.map(function (rowNode) { return _this.valueService.getValue(valueColumn, rowNode); });
};

@@ -199,0 +192,0 @@ AggregationStage.prototype.getValuesNormal = function (rowNode, valueColumns, filteredOnly) {

@@ -58,3 +58,3 @@ import { Column, ColumnEventType, Component, Context, DragAndDropService, DraggingEvent, EventService, GridOptionsService, LoggerFactory } from "@ag-grid-community/core";

private onDragEnter;
setColumnsVisible(columns: Column[] | null | undefined, visible: boolean, source?: ColumnEventType): void;
setColumnsVisible(columns: Column[] | null | undefined, visible: boolean, source: ColumnEventType): void;
protected isPotentialDndColumns(): boolean;

@@ -61,0 +61,0 @@ private isRowGroupPanel;

@@ -239,3 +239,2 @@ var __extends = (this && this.__extends) || (function () {

BaseDropZonePanel.prototype.setColumnsVisible = function (columns, visible, source) {
if (source === void 0) { source = "api"; }
if (columns) {

@@ -242,0 +241,0 @@ var allowedCols = columns.filter(function (c) { return !c.getColDef().lockVisible; });

@@ -1,1 +0,1 @@

export declare const VERSION = "31.0.3";
export declare const VERSION = "31.1.0";
// DO NOT UPDATE MANUALLY: Generated from script during build time
export var VERSION = '31.0.3';
export var VERSION = '31.1.0';

@@ -20,3 +20,2 @@ import { BeanStub, Column, IAggFunc, IAggFuncService } from '@ag-grid-community/core';

}): void;
addAggFunc(key: string, aggFunc: IAggFunc): void;
getAggFunc(name: string): IAggFunc;

@@ -23,0 +22,0 @@ getFuncNames(column: Column): string[];

@@ -58,3 +58,3 @@ import { Column, ColumnEventType, Component, Context, DragAndDropService, DraggingEvent, EventService, GridOptionsService, LoggerFactory } from "@ag-grid-community/core";

private onDragEnter;
setColumnsVisible(columns: Column[] | null | undefined, visible: boolean, source?: ColumnEventType): void;
setColumnsVisible(columns: Column[] | null | undefined, visible: boolean, source: ColumnEventType): void;
protected isPotentialDndColumns(): boolean;

@@ -61,0 +61,0 @@ private isRowGroupPanel;

@@ -1,1 +0,1 @@

export declare const VERSION = "31.0.3";
export declare const VERSION = "31.1.0";
{
"name": "@ag-grid-enterprise/row-grouping",
"version": "31.0.3",
"version": "31.1.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -50,4 +50,4 @@ "main": "./dist/esm/es6/main.mjs",

"dependencies": {
"@ag-grid-community/core": "~31.0.3",
"@ag-grid-enterprise/core": "~31.0.3"
"@ag-grid-community/core": "~31.1.0",
"@ag-grid-enterprise/core": "~31.1.0"
},

@@ -57,3 +57,3 @@ "devDependencies": {

"@types/jest": "^29.5.0",
"@types/node": "12.20.20",
"@types/node": "18.19.10",
"jest": "^29.5.0",

@@ -60,0 +60,0 @@ "rimraf": "3.0.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc