@ag-grid-community/client-side-row-model
Advanced tools
Comparing version 27.2.1 to 27.3.0
import { ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
export declare class FilterService extends BeanStub { | ||
private filterManager; | ||
private doingTreeData; | ||
private postConstruct; | ||
filter(changedPath: ChangedPath): void; | ||
private filterNodes; | ||
private setAllChildrenCountTreeData; | ||
private setAllChildrenCountGridGrouping; | ||
private setAllChildrenCount; | ||
private doingTreeDataFiltering; | ||
} |
@@ -28,5 +28,2 @@ "use strict"; | ||
} | ||
FilterService.prototype.postConstruct = function () { | ||
this.doingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
}; | ||
FilterService.prototype.filter = function (changedPath) { | ||
@@ -61,7 +58,5 @@ var filterActive = this.filterManager.isColumnFilterPresent() | ||
} | ||
_this.setAllChildrenCount(rowNode); | ||
} | ||
else { | ||
rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; | ||
rowNode.setAllChildrenCount(null); | ||
} | ||
@@ -100,34 +95,2 @@ if (rowNode.sibling) { | ||
}; | ||
FilterService.prototype.setAllChildrenCountTreeData = function (rowNode) { | ||
// for tree data, we include all children, groups and leafs | ||
var allChildrenCount = 0; | ||
rowNode.childrenAfterFilter.forEach(function (child) { | ||
// include child itself | ||
allChildrenCount++; | ||
// include children of children | ||
allChildrenCount += child.allChildrenCount; | ||
}); | ||
rowNode.setAllChildrenCount(allChildrenCount); | ||
}; | ||
FilterService.prototype.setAllChildrenCountGridGrouping = function (rowNode) { | ||
// for grid data, we only count the leafs | ||
var allChildrenCount = 0; | ||
rowNode.childrenAfterFilter.forEach(function (child) { | ||
if (child.group) { | ||
allChildrenCount += child.allChildrenCount; | ||
} | ||
else { | ||
allChildrenCount++; | ||
} | ||
}); | ||
rowNode.setAllChildrenCount(allChildrenCount); | ||
}; | ||
FilterService.prototype.setAllChildrenCount = function (rowNode) { | ||
if (this.doingTreeData) { | ||
this.setAllChildrenCountTreeData(rowNode); | ||
} | ||
else { | ||
this.setAllChildrenCountGridGrouping(rowNode); | ||
} | ||
}; | ||
FilterService.prototype.doingTreeDataFiltering = function () { | ||
@@ -139,5 +102,2 @@ return this.gridOptionsWrapper.isTreeData() && !this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering(); | ||
], FilterService.prototype, "filterManager", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
], FilterService.prototype, "postConstruct", null); | ||
FilterService = __decorate([ | ||
@@ -144,0 +104,0 @@ core_1.Bean("filterService") |
@@ -77,3 +77,3 @@ "use strict"; | ||
var neverAllowToExpand = skipLeafNodes && rowNode.leafGroup; | ||
var isHiddenOpenParent = hideOpenParents && rowNode.expanded && (!neverAllowToExpand); | ||
var isHiddenOpenParent = hideOpenParents && rowNode.expanded && !rowNode.master && (!neverAllowToExpand); | ||
var thisRowShouldBeRendered = !isSkippedLeafNode && !isHiddenOpenParent && | ||
@@ -80,0 +80,0 @@ !isRemovedSingleChildrenGroup && !isRemovedLowestSingleChildrenGroup; |
@@ -1,2 +0,2 @@ | ||
import { SortOption, ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
import { SortOption, ChangedPath, BeanStub, RowNodeTransaction } from "@ag-grid-community/core"; | ||
export declare class SortService extends BeanStub { | ||
@@ -7,6 +7,4 @@ private columnModel; | ||
init(): void; | ||
sort(sortOptions: SortOption[], sortActive: boolean, deltaSort: boolean, dirtyLeafNodes: { | ||
[nodeId: string]: boolean; | ||
} | null, changedPath: ChangedPath | undefined, noAggregations: boolean, sortContainsGroupColumns: boolean): void; | ||
private mapNodeToSortedNode; | ||
sort(sortOptions: SortOption[], sortActive: boolean, useDeltaSort: boolean, rowNodeTransactions: RowNodeTransaction[] | null | undefined, changedPath: ChangedPath | undefined, sortContainsGroupColumns: boolean): void; | ||
private calculateDirtyNodes; | ||
private doDeltaSort; | ||
@@ -13,0 +11,0 @@ private mergeSortedArrays; |
@@ -31,9 +31,16 @@ "use strict"; | ||
}; | ||
SortService.prototype.sort = function (sortOptions, sortActive, deltaSort, dirtyLeafNodes, changedPath, noAggregations, sortContainsGroupColumns) { | ||
SortService.prototype.sort = function (sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) { | ||
var _this = this; | ||
var groupMaintainOrder = this.gridOptionsWrapper.isGroupMaintainOrder(); | ||
var groupColumnsPresent = this.columnModel.getAllGridColumns().some(function (c) { return c.isRowGroupActive(); }); | ||
var allDirtyNodes = {}; | ||
if (useDeltaSort && rowNodeTransactions) { | ||
allDirtyNodes = this.calculateDirtyNodes(rowNodeTransactions); | ||
} | ||
var isPivotMode = this.columnModel.isPivotMode(); | ||
var callback = function (rowNode) { | ||
// we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
_this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterAggFilter, true); | ||
// It's pointless to sort rows which aren't being displayed. in pivot mode we don't need to sort the leaf group children. | ||
var skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup; | ||
// Javascript sort is non deterministic when all the array items are equals, ie Comparator always returns 0, | ||
@@ -43,3 +50,3 @@ // so to ensure the array keeps its order, add an additional sorting condition manually, in this case we | ||
var skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns; | ||
if (!sortActive || skipSortingGroups) { | ||
if (!sortActive || skipSortingGroups || skipSortingPivotLeafs) { | ||
// when 'groupMaintainOrder' is enabled we skip sorting groups unless we are sorting on group columns | ||
@@ -56,6 +63,7 @@ var childrenToBeSorted = rowNode.childrenAfterAggFilter.slice(0); | ||
} | ||
else if (useDeltaSort) { | ||
rowNode.childrenAfterSort = _this.doDeltaSort(rowNode, allDirtyNodes, changedPath, sortOptions); | ||
} | ||
else { | ||
rowNode.childrenAfterSort = deltaSort ? | ||
_this.doDeltaSort(rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) | ||
: _this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); | ||
rowNode.childrenAfterSort = _this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); | ||
} | ||
@@ -76,48 +84,45 @@ if (rowNode.sibling) { | ||
}; | ||
SortService.prototype.mapNodeToSortedNode = function (rowNode, pos) { | ||
return { currentPos: pos, rowNode: rowNode }; | ||
SortService.prototype.calculateDirtyNodes = function (rowNodeTransactions) { | ||
var dirtyNodes = {}; | ||
var addNodesFunc = function (rowNodes) { | ||
if (rowNodes) { | ||
rowNodes.forEach(function (rowNode) { return dirtyNodes[rowNode.id] = true; }); | ||
} | ||
}; | ||
// all leaf level nodes in the transaction were impacted | ||
if (rowNodeTransactions) { | ||
rowNodeTransactions.forEach(function (tran) { | ||
addNodesFunc(tran.add); | ||
addNodesFunc(tran.update); | ||
addNodesFunc(tran.remove); | ||
}); | ||
} | ||
return dirtyNodes; | ||
}; | ||
SortService.prototype.doDeltaSort = function (rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) { | ||
// clean nodes will be a list of all row nodes that remain in the set | ||
// and ordered. we start with the old sorted set and take out any nodes | ||
// that were removed or changed (but not added, added doesn't make sense, | ||
// if a node was added, there is no way it could be here from last time). | ||
var cleanNodes = rowNode.childrenAfterSort | ||
.filter(function (node) { | ||
// take out all nodes that were changed as part of the current transaction. | ||
// a changed node could a) be in a different sort position or b) may | ||
// no longer be in this set as the changed node may not pass filtering, | ||
// or be in a different group. | ||
var passesDirtyNodesCheck = !dirtyLeafNodes[node.id]; | ||
// also remove group nodes in the changed path, as they can have different aggregate | ||
// values which could impact the sort order. | ||
// note: changed path is not active if a) no value columns or b) no transactions. it is never | ||
// (b) in deltaSort as we only do deltaSort for transactions. for (a) if no value columns, then | ||
// there is no value in the group that could of changed (ie no aggregate values) | ||
var passesChangedPathCheck = noAggregations || (changedPath && changedPath.canSkip(node)); | ||
return passesDirtyNodesCheck && passesChangedPathCheck; | ||
}) | ||
.map(this.mapNodeToSortedNode.bind(this)); | ||
// for fast access below, we map them | ||
var cleanNodesMapped = {}; | ||
cleanNodes.forEach(function (sortedRowNode) { return cleanNodesMapped[sortedRowNode.rowNode.id] = sortedRowNode.rowNode; }); | ||
// these are all nodes that need to be placed | ||
var changedNodes = rowNode.childrenAfterAggFilter | ||
// ignore nodes in the clean list | ||
.filter(function (node) { return !cleanNodesMapped[node.id]; }) | ||
.map(this.mapNodeToSortedNode.bind(this)); | ||
// sort changed nodes. note that we don't need to sort cleanNodes as they are | ||
// already sorted from last time. | ||
changedNodes.sort(this.rowNodeSorter.compareRowNodes.bind(this, sortOptions)); | ||
var result; | ||
if (changedNodes.length === 0) { | ||
result = cleanNodes; | ||
SortService.prototype.doDeltaSort = function (rowNode, allTouchedNodes, changedPath, sortOptions) { | ||
var _this = this; | ||
var unsortedRows = rowNode.childrenAfterAggFilter; | ||
var oldSortedRows = rowNode.childrenAfterSort; | ||
if (!oldSortedRows) { | ||
return this.rowNodeSorter.doFullSort(unsortedRows, sortOptions); | ||
} | ||
else if (cleanNodes.length === 0) { | ||
result = changedNodes; | ||
} | ||
else { | ||
result = this.mergeSortedArrays(sortOptions, cleanNodes, changedNodes); | ||
} | ||
return result.map(function (item) { return item.rowNode; }); | ||
var untouchedRowsMap = {}; | ||
var touchedRows = []; | ||
unsortedRows.forEach(function (row) { | ||
if (allTouchedNodes[row.id] || !changedPath.canSkip(row)) { | ||
touchedRows.push(row); | ||
} | ||
else { | ||
untouchedRowsMap[row.id] = true; | ||
} | ||
}); | ||
var sortedUntouchedRows = oldSortedRows.filter(function (child) { return untouchedRowsMap[child.id]; }); | ||
var mapNodeToSortedNode = function (rowNode, pos) { return ({ currentPos: pos, rowNode: rowNode }); }; | ||
var sortedChangedRows = touchedRows | ||
.map(mapNodeToSortedNode) | ||
.sort(function (a, b) { return _this.rowNodeSorter.compareRowNodes(sortOptions, a, b); }); | ||
return this.mergeSortedArrays(sortOptions, sortedChangedRows, sortedUntouchedRows.map(mapNodeToSortedNode)).map(function (_a) { | ||
var rowNode = _a.rowNode; | ||
return rowNode; | ||
}); | ||
}; | ||
@@ -124,0 +129,0 @@ // Merge two sorted arrays into each other |
@@ -7,3 +7,2 @@ import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
execute(params: StageExecuteParams): void; | ||
private calculateDirtyNodes; | ||
} |
@@ -38,25 +38,5 @@ "use strict"; | ||
&& this.gridOptionsWrapper.isDeltaSort(); | ||
// we only need dirty nodes if doing delta sort | ||
var dirtyLeafNodes = deltaSort ? this.calculateDirtyNodes(params.rowNodeTransactions) : null; | ||
var noAggregations = core_1._.missingOrEmpty(this.columnModel.getValueColumns()); | ||
var sortContainsGroupColumns = sortOptions.some(function (opt) { return !!opt.column.getColDef().showRowGroup; }); | ||
this.sortService.sort(sortOptions, sortActive, deltaSort, dirtyLeafNodes, params.changedPath, noAggregations, sortContainsGroupColumns); | ||
this.sortService.sort(sortOptions, sortActive, deltaSort, params.rowNodeTransactions, params.changedPath, sortContainsGroupColumns); | ||
}; | ||
SortStage.prototype.calculateDirtyNodes = function (rowNodeTransactions) { | ||
var dirtyNodes = {}; | ||
var addNodesFunc = function (rowNodes) { | ||
if (rowNodes) { | ||
rowNodes.forEach(function (rowNode) { return dirtyNodes[rowNode.id] = true; }); | ||
} | ||
}; | ||
// all leaf level nodes in the transaction were impacted | ||
if (rowNodeTransactions) { | ||
rowNodeTransactions.forEach(function (tran) { | ||
addNodesFunc(tran.add); | ||
addNodesFunc(tran.update); | ||
addNodesFunc(tran.remove); | ||
}); | ||
} | ||
return dirtyNodes; | ||
}; | ||
__decorate([ | ||
@@ -63,0 +43,0 @@ core_1.Autowired('sortService') |
import { ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
export declare class FilterService extends BeanStub { | ||
private filterManager; | ||
private doingTreeData; | ||
private postConstruct; | ||
filter(changedPath: ChangedPath): void; | ||
private filterNodes; | ||
private setAllChildrenCountTreeData; | ||
private setAllChildrenCountGridGrouping; | ||
private setAllChildrenCount; | ||
private doingTreeDataFiltering; | ||
} |
@@ -11,5 +11,2 @@ "use strict"; | ||
let FilterService = class FilterService extends core_1.BeanStub { | ||
postConstruct() { | ||
this.doingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
} | ||
filter(changedPath) { | ||
@@ -43,7 +40,5 @@ const filterActive = this.filterManager.isColumnFilterPresent() | ||
} | ||
this.setAllChildrenCount(rowNode); | ||
} | ||
else { | ||
rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; | ||
rowNode.setAllChildrenCount(null); | ||
} | ||
@@ -82,34 +77,2 @@ if (rowNode.sibling) { | ||
} | ||
setAllChildrenCountTreeData(rowNode) { | ||
// for tree data, we include all children, groups and leafs | ||
let allChildrenCount = 0; | ||
rowNode.childrenAfterFilter.forEach((child) => { | ||
// include child itself | ||
allChildrenCount++; | ||
// include children of children | ||
allChildrenCount += child.allChildrenCount; | ||
}); | ||
rowNode.setAllChildrenCount(allChildrenCount); | ||
} | ||
setAllChildrenCountGridGrouping(rowNode) { | ||
// for grid data, we only count the leafs | ||
let allChildrenCount = 0; | ||
rowNode.childrenAfterFilter.forEach((child) => { | ||
if (child.group) { | ||
allChildrenCount += child.allChildrenCount; | ||
} | ||
else { | ||
allChildrenCount++; | ||
} | ||
}); | ||
rowNode.setAllChildrenCount(allChildrenCount); | ||
} | ||
setAllChildrenCount(rowNode) { | ||
if (this.doingTreeData) { | ||
this.setAllChildrenCountTreeData(rowNode); | ||
} | ||
else { | ||
this.setAllChildrenCountGridGrouping(rowNode); | ||
} | ||
} | ||
doingTreeDataFiltering() { | ||
@@ -122,5 +85,2 @@ return this.gridOptionsWrapper.isTreeData() && !this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering(); | ||
], FilterService.prototype, "filterManager", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
], FilterService.prototype, "postConstruct", null); | ||
FilterService = __decorate([ | ||
@@ -127,0 +87,0 @@ core_1.Bean("filterService") |
@@ -60,3 +60,3 @@ "use strict"; | ||
const neverAllowToExpand = skipLeafNodes && rowNode.leafGroup; | ||
const isHiddenOpenParent = hideOpenParents && rowNode.expanded && (!neverAllowToExpand); | ||
const isHiddenOpenParent = hideOpenParents && rowNode.expanded && !rowNode.master && (!neverAllowToExpand); | ||
const thisRowShouldBeRendered = !isSkippedLeafNode && !isHiddenOpenParent && | ||
@@ -63,0 +63,0 @@ !isRemovedSingleChildrenGroup && !isRemovedLowestSingleChildrenGroup; |
@@ -1,2 +0,2 @@ | ||
import { SortOption, ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
import { SortOption, ChangedPath, BeanStub, RowNodeTransaction } from "@ag-grid-community/core"; | ||
export declare class SortService extends BeanStub { | ||
@@ -7,6 +7,4 @@ private columnModel; | ||
init(): void; | ||
sort(sortOptions: SortOption[], sortActive: boolean, deltaSort: boolean, dirtyLeafNodes: { | ||
[nodeId: string]: boolean; | ||
} | null, changedPath: ChangedPath | undefined, noAggregations: boolean, sortContainsGroupColumns: boolean): void; | ||
private mapNodeToSortedNode; | ||
sort(sortOptions: SortOption[], sortActive: boolean, useDeltaSort: boolean, rowNodeTransactions: RowNodeTransaction[] | null | undefined, changedPath: ChangedPath | undefined, sortContainsGroupColumns: boolean): void; | ||
private calculateDirtyNodes; | ||
private doDeltaSort; | ||
@@ -13,0 +11,0 @@ private mergeSortedArrays; |
@@ -14,8 +14,15 @@ "use strict"; | ||
} | ||
sort(sortOptions, sortActive, deltaSort, dirtyLeafNodes, changedPath, noAggregations, sortContainsGroupColumns) { | ||
sort(sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) { | ||
const groupMaintainOrder = this.gridOptionsWrapper.isGroupMaintainOrder(); | ||
const groupColumnsPresent = this.columnModel.getAllGridColumns().some(c => c.isRowGroupActive()); | ||
let allDirtyNodes = {}; | ||
if (useDeltaSort && rowNodeTransactions) { | ||
allDirtyNodes = this.calculateDirtyNodes(rowNodeTransactions); | ||
} | ||
const isPivotMode = this.columnModel.isPivotMode(); | ||
const callback = (rowNode) => { | ||
// we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterAggFilter, true); | ||
// It's pointless to sort rows which aren't being displayed. in pivot mode we don't need to sort the leaf group children. | ||
const skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup; | ||
// Javascript sort is non deterministic when all the array items are equals, ie Comparator always returns 0, | ||
@@ -25,3 +32,3 @@ // so to ensure the array keeps its order, add an additional sorting condition manually, in this case we | ||
let skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns; | ||
if (!sortActive || skipSortingGroups) { | ||
if (!sortActive || skipSortingGroups || skipSortingPivotLeafs) { | ||
// when 'groupMaintainOrder' is enabled we skip sorting groups unless we are sorting on group columns | ||
@@ -38,6 +45,7 @@ const childrenToBeSorted = rowNode.childrenAfterAggFilter.slice(0); | ||
} | ||
else if (useDeltaSort) { | ||
rowNode.childrenAfterSort = this.doDeltaSort(rowNode, allDirtyNodes, changedPath, sortOptions); | ||
} | ||
else { | ||
rowNode.childrenAfterSort = deltaSort ? | ||
this.doDeltaSort(rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) | ||
: this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); | ||
rowNode.childrenAfterSort = this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); | ||
} | ||
@@ -58,48 +66,41 @@ if (rowNode.sibling) { | ||
} | ||
mapNodeToSortedNode(rowNode, pos) { | ||
return { currentPos: pos, rowNode: rowNode }; | ||
calculateDirtyNodes(rowNodeTransactions) { | ||
const dirtyNodes = {}; | ||
const addNodesFunc = (rowNodes) => { | ||
if (rowNodes) { | ||
rowNodes.forEach(rowNode => dirtyNodes[rowNode.id] = true); | ||
} | ||
}; | ||
// all leaf level nodes in the transaction were impacted | ||
if (rowNodeTransactions) { | ||
rowNodeTransactions.forEach(tran => { | ||
addNodesFunc(tran.add); | ||
addNodesFunc(tran.update); | ||
addNodesFunc(tran.remove); | ||
}); | ||
} | ||
return dirtyNodes; | ||
} | ||
doDeltaSort(rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) { | ||
// clean nodes will be a list of all row nodes that remain in the set | ||
// and ordered. we start with the old sorted set and take out any nodes | ||
// that were removed or changed (but not added, added doesn't make sense, | ||
// if a node was added, there is no way it could be here from last time). | ||
const cleanNodes = rowNode.childrenAfterSort | ||
.filter(node => { | ||
// take out all nodes that were changed as part of the current transaction. | ||
// a changed node could a) be in a different sort position or b) may | ||
// no longer be in this set as the changed node may not pass filtering, | ||
// or be in a different group. | ||
const passesDirtyNodesCheck = !dirtyLeafNodes[node.id]; | ||
// also remove group nodes in the changed path, as they can have different aggregate | ||
// values which could impact the sort order. | ||
// note: changed path is not active if a) no value columns or b) no transactions. it is never | ||
// (b) in deltaSort as we only do deltaSort for transactions. for (a) if no value columns, then | ||
// there is no value in the group that could of changed (ie no aggregate values) | ||
const passesChangedPathCheck = noAggregations || (changedPath && changedPath.canSkip(node)); | ||
return passesDirtyNodesCheck && passesChangedPathCheck; | ||
}) | ||
.map(this.mapNodeToSortedNode.bind(this)); | ||
// for fast access below, we map them | ||
const cleanNodesMapped = {}; | ||
cleanNodes.forEach(sortedRowNode => cleanNodesMapped[sortedRowNode.rowNode.id] = sortedRowNode.rowNode); | ||
// these are all nodes that need to be placed | ||
const changedNodes = rowNode.childrenAfterAggFilter | ||
// ignore nodes in the clean list | ||
.filter(node => !cleanNodesMapped[node.id]) | ||
.map(this.mapNodeToSortedNode.bind(this)); | ||
// sort changed nodes. note that we don't need to sort cleanNodes as they are | ||
// already sorted from last time. | ||
changedNodes.sort(this.rowNodeSorter.compareRowNodes.bind(this, sortOptions)); | ||
let result; | ||
if (changedNodes.length === 0) { | ||
result = cleanNodes; | ||
doDeltaSort(rowNode, allTouchedNodes, changedPath, sortOptions) { | ||
const unsortedRows = rowNode.childrenAfterAggFilter; | ||
const oldSortedRows = rowNode.childrenAfterSort; | ||
if (!oldSortedRows) { | ||
return this.rowNodeSorter.doFullSort(unsortedRows, sortOptions); | ||
} | ||
else if (cleanNodes.length === 0) { | ||
result = changedNodes; | ||
} | ||
else { | ||
result = this.mergeSortedArrays(sortOptions, cleanNodes, changedNodes); | ||
} | ||
return result.map(item => item.rowNode); | ||
const untouchedRowsMap = {}; | ||
const touchedRows = []; | ||
unsortedRows.forEach(row => { | ||
if (allTouchedNodes[row.id] || !changedPath.canSkip(row)) { | ||
touchedRows.push(row); | ||
} | ||
else { | ||
untouchedRowsMap[row.id] = true; | ||
} | ||
}); | ||
const sortedUntouchedRows = oldSortedRows.filter(child => untouchedRowsMap[child.id]); | ||
const mapNodeToSortedNode = (rowNode, pos) => ({ currentPos: pos, rowNode: rowNode }); | ||
const sortedChangedRows = touchedRows | ||
.map(mapNodeToSortedNode) | ||
.sort((a, b) => this.rowNodeSorter.compareRowNodes(sortOptions, a, b)); | ||
return this.mergeSortedArrays(sortOptions, sortedChangedRows, sortedUntouchedRows.map(mapNodeToSortedNode)).map(({ rowNode }) => rowNode); | ||
} | ||
@@ -106,0 +107,0 @@ // Merge two sorted arrays into each other |
@@ -7,3 +7,2 @@ import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
execute(params: StageExecuteParams): void; | ||
private calculateDirtyNodes; | ||
} |
@@ -21,25 +21,5 @@ "use strict"; | ||
&& this.gridOptionsWrapper.isDeltaSort(); | ||
// we only need dirty nodes if doing delta sort | ||
const dirtyLeafNodes = deltaSort ? this.calculateDirtyNodes(params.rowNodeTransactions) : null; | ||
const noAggregations = core_1._.missingOrEmpty(this.columnModel.getValueColumns()); | ||
const sortContainsGroupColumns = sortOptions.some(opt => !!opt.column.getColDef().showRowGroup); | ||
this.sortService.sort(sortOptions, sortActive, deltaSort, dirtyLeafNodes, params.changedPath, noAggregations, sortContainsGroupColumns); | ||
this.sortService.sort(sortOptions, sortActive, deltaSort, params.rowNodeTransactions, params.changedPath, sortContainsGroupColumns); | ||
} | ||
calculateDirtyNodes(rowNodeTransactions) { | ||
const dirtyNodes = {}; | ||
const addNodesFunc = (rowNodes) => { | ||
if (rowNodes) { | ||
rowNodes.forEach(rowNode => dirtyNodes[rowNode.id] = true); | ||
} | ||
}; | ||
// all leaf level nodes in the transaction were impacted | ||
if (rowNodeTransactions) { | ||
rowNodeTransactions.forEach(tran => { | ||
addNodesFunc(tran.add); | ||
addNodesFunc(tran.update); | ||
addNodesFunc(tran.remove); | ||
}); | ||
} | ||
return dirtyNodes; | ||
} | ||
}; | ||
@@ -46,0 +26,0 @@ __decorate([ |
/** | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1 | ||
* @link http://www.ag-grid.com/ | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 | ||
* @link https://www.ag-grid.com/ | ||
* @license MIT | ||
*/ | ||
/** | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1 | ||
* @link http://www.ag-grid.com/ | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 | ||
* @link https://www.ag-grid.com/ | ||
* @license MIT | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),r=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return s},i=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},n=function(){function e(t,o,r,i,n,s,a,d){this.nextId=0,this.allNodesMap={},this.rootNode=t,this.gridOptionsWrapper=o,this.eventService=r,this.columnModel=i,this.gridApi=n,this.columnApi=s,this.beans=d,this.selectionService=a,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[],this.postConstruct()}return e.prototype.postConstruct=function(){this.suppressParentsInRowNodes=this.gridOptionsWrapper.isSuppressParentsInRowNodes(),this.isRowMasterFunc=this.gridOptionsWrapper.getIsRowMasterFunc(),this.doingTreeData=this.gridOptionsWrapper.isTreeData(),this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},e.prototype.getCopyOfNodesMap=function(){return o._.cloneObject(this.allNodesMap)},e.prototype.getRowNode=function(e){return this.allNodesMap[e]},e.prototype.setRowData=function(t){var o=this;if("string"!=typeof t){var r=this.rootNode,i=this.rootNode.sibling;r.childrenAfterFilter=null,r.childrenAfterGroup=null,r.childrenAfterAggFilter=null,r.childrenAfterSort=null,r.childrenMapped=null,r.updateHasChildren(),this.nextId=0,this.allNodesMap={},t?r.allLeafChildren=t.map((function(t){return o.createNode(t,o.rootNode,e.TOP_LEVEL)})):(r.allLeafChildren=[],r.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=r.childrenAfterFilter,i.childrenAfterGroup=r.childrenAfterGroup,i.childrenAfterAggFilter=r.childrenAfterAggFilter,i.childrenAfterSort=r.childrenAfterSort,i.childrenMapped=r.childrenMapped,i.allLeafChildren=r.allLeafChildren)}else console.warn("AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first")},e.prototype.updateRowData=function(e,t){var r={remove:[],update:[],add:[]},i=[];return this.executeRemove(e,r,i),this.executeUpdate(e,r,i),this.executeAdd(e,r),this.updateSelection(i),t&&o._.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),r},e.prototype.updateSelection=function(e){var t=e.length>0;if(t&&e.forEach((function(e){e.setSelected(!1,!1,!0)})),this.selectionService.updateGroupsFromChildrenSelections(),t){var r={type:o.Events.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)}},e.prototype.executeAdd=function(t,r){var n=this,s=t.add,a=t.addIndex;if(!o._.missingOrEmpty(s)){var d,l,p=s.map((function(t){return n.createNode(t,n.rootNode,e.TOP_LEVEL)}));if("number"==typeof a&&a>=0){var h=this.rootNode.allLeafChildren,u=0===a?0:h.reduce((function(e,t,o){var r,i=t.rowIndex,n=null===(r=h[e])||void 0===r?void 0:r.rowIndex;return null!=i&&null!=n&&i<a&&i>n?o:e}),0)+1;d=h.slice(0,u),l=h.slice(u,h.length)}else d=this.rootNode.allLeafChildren,l=[];this.rootNode.allLeafChildren=i(d,p,l),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),r.add=p}},e.prototype.executeRemove=function(e,t,r){var i=this,n=e.remove;if(!o._.missingOrEmpty(n)){var s={};n.forEach((function(e){var o=i.lookupRowNode(e);o&&(o.isSelected()&&r.push(o),o.clearRowTopAndRowIndex(),s[o.id]=!0,delete i.allNodesMap[o.id],t.remove.push(o))})),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter((function(e){return!s[e.id]})),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}},e.prototype.executeUpdate=function(t,r,i){var n=this,s=t.update;o._.missingOrEmpty(s)||s.forEach((function(t){var o=n.lookupRowNode(t);o&&(o.updateData(t),!o.selectable&&o.isSelected()&&i.push(o),n.setMasterForRow(o,t,e.TOP_LEVEL,!1),r.update.push(o))}))},e.prototype.lookupRowNode=function(e){var t,o=this.gridOptionsWrapper.getRowIdFunc();if(o){var r=o({data:e,level:0});if(!(t=this.allNodesMap[r]))return console.error("AG Grid: could not find row id="+r+", data item was not found for this id"),null}else if(!(t=this.rootNode.allLeafChildren.find((function(t){return t.data===e}))))return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return t||null},e.prototype.createNode=function(e,t,r){var i=new o.RowNode(this.beans);return i.group=!1,this.setMasterForRow(i,e,r,!0),t&&!this.suppressParentsInRowNodes&&(i.parent=t),i.level=r,i.setDataAndId(e,this.nextId.toString()),this.allNodesMap[i.id]&&console.warn("AG Grid: duplicate node id '"+i.id+"' detected from getRowId callback, this could cause issues in your grid."),this.allNodesMap[i.id]=i,this.nextId++,i},e.prototype.setMasterForRow=function(e,t,o,r){if(this.doingTreeData)e.setMaster(!1),r&&(e.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?e.setMaster(this.isRowMasterFunc(t)):e.setMaster(!0):e.setMaster(!1),r){var i=this.columnModel.getRowGroupColumns(),n=o+(i?i.length:0);e.expanded=!!e.master&&this.isExpanded(n)}},e.prototype.isExpanded=function(e){var t=this.gridOptionsWrapper.getGroupDefaultExpanded();return-1===t||e<t},e.TOP_LEVEL=0,e.ROOT_NODE_ID="ROOT_NODE_ID",e}(),s=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),a=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};!function(e){e[e.Normal=0]="Normal",e[e.AfterFilter=1]="AfterFilter",e[e.AfterFilterAndSort=2]="AfterFilterAndSort",e[e.PivotNodes=3]="PivotNodes"}(t||(t={}));var d=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return s(r,e),r.prototype.init=function(){var e=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING}),t=!this.gridOptionsWrapper.isSuppressAnimationFrame(),r=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,r),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.PIVOT})),this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,e);var i=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:t});this.addManagedListener(this.gridOptionsWrapper,o.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN,i),this.addManagedListener(this.gridOptionsWrapper,o.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,i),this.rootNode=new o.RowNode(this.beans),this.nodeManager=new n(this.rootNode,this.gridOptionsWrapper,this.eventService,this.columnModel,this.gridApi,this.columnApi,this.selectionService,this.beans)},r.prototype.start=function(){var e=this.gridOptionsWrapper.getRowData();e&&this.setRowData(e)},r.prototype.ensureRowHeightsValid=function(e,t,o,r){var i,n=!1;do{i=!1;for(var s=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),d=Math.max(s,o),l=Math.min(a,r),p=d;p<=l;p++){var h=this.getRow(p);if(h.rowHeightEstimated){var u=this.gridOptionsWrapper.getRowHeightForNode(h);h.setRowHeight(u.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n},r.prototype.setRowTopAndRowIndex=function(){for(var e=this.gridOptionsWrapper.getDefaultRowHeight(),t=0,r=new Set,i=this.gridOptionsWrapper.getDomLayout()===o.Constants.DOM_LAYOUT_NORMAL,n=0;n<this.rowsToDisplay.length;n++){var s=this.rowsToDisplay[n];if(null!=s.id&&r.add(s.id),null==s.rowHeight){var a=this.gridOptionsWrapper.getRowHeightForNode(s,i,e);s.setRowHeight(a.height,a.estimated)}s.setRowTop(t),s.setRowIndex(n),t+=s.rowHeight}return r},r.prototype.clearRowTopAndRowIndex=function(e,t){var o=e.isActive(),r=function(e){e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},i=function(e){if(r(e),r(e.detailNode),r(e.sibling),e.hasChildren()&&e.childrenAfterGroup){var t=-1==e.level;o&&!t&&!e.expanded||e.childrenAfterGroup.forEach(i)}};i(this.rootNode)},r.prototype.ensureRowsAtPixel=function(e,t,r){var i=this;void 0===r&&(r=0);var n=this.getRowIndexAtPixel(t),s=this.getRow(n),a=!this.gridOptionsWrapper.isSuppressAnimationFrame();return s!==e[0]&&(e.forEach((function(e){o._.removeFromArray(i.rootNode.allLeafChildren,e)})),e.forEach((function(e,t){o._.insertIntoArray(i.rootNode.allLeafChildren,e,Math.max(n+r,0)+t)})),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:a}),!0)},r.prototype.highlightRowAtPixel=function(e,t){var o=null!=t?this.getRowIndexAtPixel(t):null,r=null!=o?this.getRow(o):null;if(r&&e&&r!==e&&null!=t){var i=this.getHighlightPosition(t,r);this.lastHighlightedRow&&this.lastHighlightedRow!==r&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),r.setHighlighted(i),this.lastHighlightedRow=r}else this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null)},r.prototype.getHighlightPosition=function(e,t){if(!t){var r=this.getRowIndexAtPixel(e);if(!(t=this.getRow(r||0)))return o.RowHighlightPosition.Below}return e-t.rowTop<t.rowHeight/2?o.RowHighlightPosition.Above:o.RowHighlightPosition.Below},r.prototype.getLastHighlightedRowNode=function(){return this.lastHighlightedRow},r.prototype.isLastRowIndexKnown=function(){return!0},r.prototype.getRowCount=function(){return this.rowsToDisplay?this.rowsToDisplay.length:0},r.prototype.getTopLevelRowCount=function(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;var e=this.rootNode.childrenAfterAggFilter;return e?e.length:0},r.prototype.getTopLevelRowDisplayedIndex=function(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;var t=this.rootNode.childrenAfterSort[e];if(this.gridOptionsWrapper.isGroupHideOpenParents())for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},r.prototype.getRowBounds=function(e){if(o._.missing(this.rowsToDisplay))return null;var t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null},r.prototype.onRowGroupOpened=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})},r.prototype.onFilterChanged=function(e){if(!e.afterDataChange){var t=this.gridOptionsWrapper.isAnimateRows(),r=0===e.columns.length||e.columns.some((function(e){return e.isPrimary()}))?o.ClientSideRowModelSteps.FILTER:o.ClientSideRowModelSteps.FILTER_AGGREGATES;this.refreshModel({step:r,keepRenderedRows:!0,animate:t})}},r.prototype.onSortChanged=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})},r.prototype.getType=function(){return o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE},r.prototype.onValueChanged=function(){this.columnModel.isPivotActive()?this.refreshModel({step:o.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:o.ClientSideRowModelSteps.AGGREGATE})},r.prototype.createChangePath=function(e){var t=o._.missingOrEmpty(e),r=new o.ChangedPath(!1,this.rootNode);return(t||this.gridOptionsWrapper.isTreeData())&&r.setInactive(),r},r.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(e){if(!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction())return!1;if(null==e.rowNodeTransactions)return!1;var t=e.rowNodeTransactions.filter((function(e){return null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0}));return null==t||0==t.length},r.prototype.refreshModel=function(e){if(!this.isSuppressModelUpdateAfterUpdateTransaction(e)){var t=this.createChangePath(e.rowNodeTransactions);switch(e.step){case o.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(e.groupState,e.rowNodeTransactions,e.rowNodeOrder,t,!!e.afterColumnsChanged);case o.ClientSideRowModelSteps.FILTER:this.doFilter(t);case o.ClientSideRowModelSteps.PIVOT:this.doPivot(t);case o.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(t);case o.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(t);case o.ClientSideRowModelSteps.SORT:this.doSort(e.rowNodeTransactions,t);case o.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}var r=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(t,r);var i={type:o.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1};this.eventService.dispatchEvent(i)}},r.prototype.isEmpty=function(){var e=o._.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return o._.missing(this.rootNode)||e||!this.columnModel.isReady()},r.prototype.isRowsToRender=function(){return o._.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0},r.prototype.getNodesInRangeForSelection=function(e,t){var o,r=!t,i=!1,n=[],s=this.gridOptionsWrapper.isGroupSelectsChildren();return this.forEachNodeAfterFilterAndSort((function(a){var d=r&&!i;if(r||a!==t&&a!==e||(r=!0),!(a.group&&s)){var l=r&&!i,p=a.isParentOfNode(o);(l||p)&&n.push(a)}d&&(a!==t&&a!==e||(i=!0,o=a===t?t:e))})),n},r.prototype.setDatasource=function(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")},r.prototype.getTopLevelNodes=function(){return this.rootNode?this.rootNode.childrenAfterGroup:null},r.prototype.getRootNode=function(){return this.rootNode},r.prototype.getRow=function(e){return this.rowsToDisplay[e]},r.prototype.isRowPresent=function(e){return this.rowsToDisplay.indexOf(e)>=0},r.prototype.getRowIndexAtPixel=function(e){if(this.isEmpty())return-1;var t=0,r=this.rowsToDisplay.length-1;if(e<=0)return 0;if(o._.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;for(;;){var i=Math.floor((t+r)/2),n=this.rowsToDisplay[i];if(this.isRowInPixel(n,e))return i;n.rowTop<e?t=i+1:n.rowTop>e&&(r=i-1)}},r.prototype.isRowInPixel=function(e,t){var o=e.rowTop,r=e.rowTop+e.rowHeight;return o<=t&&r>t},r.prototype.forEachLeafNode=function(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((function(t,o){return e(t,o)}))},r.prototype.forEachNode=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup,e,t.Normal,0)},r.prototype.forEachNodeAfterFilter=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterAggFilter,e,t.AfterFilter,0)},r.prototype.forEachNodeAfterFilterAndSort=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort,e,t.AfterFilterAndSort,0)},r.prototype.forEachPivotNode=function(e){this.recursivelyWalkNodesAndCallback([this.rootNode],e,t.PivotNodes,0)},r.prototype.recursivelyWalkNodesAndCallback=function(e,o,r,i){if(!e)return i;for(var n=0;n<e.length;n++){var s=e[n];if(o(s,i++),s.hasChildren()){var a=null;switch(r){case t.Normal:a=s.childrenAfterGroup;break;case t.AfterFilter:a=s.childrenAfterAggFilter;break;case t.AfterFilterAndSort:a=s.childrenAfterSort;break;case t.PivotNodes:a=s.leafGroup?null:s.childrenAfterSort}a&&(i=this.recursivelyWalkNodesAndCallback(a,o,r,i))}}return i},r.prototype.doAggregate=function(e){this.aggregationStage&&this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.doFilterAggregates=function(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter},r.prototype.expandOrCollapseAll=function(e){var t=this.gridOptionsWrapper.isTreeData(),r=this.columnModel.isPivotActive(),i=function(n){n&&n.forEach((function(n){var s=function(){n.expanded=e,i(n.childrenAfterGroup)};t?o._.exists(n.childrenAfterGroup)&&s():r?!n.leafGroup&&s():n.group&&s()}))};this.rootNode&&i(this.rootNode.childrenAfterGroup),this.refreshModel({step:o.ClientSideRowModelSteps.MAP});var n=e?"expandAll":"collapseAll",s={api:this.gridApi,columnApi:this.columnApi,type:o.Events.EVENT_EXPAND_COLLAPSE_ALL,source:n};this.eventService.dispatchEvent(s)},r.prototype.doSort=function(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})},r.prototype.doRowGrouping=function(e,t,o,r,i){this.groupStage?(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:o,changedPath:r}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:r,afterColumnsChanged:i}),this.restoreGroupState(e)),this.gridOptionsWrapper.isGroupSelectsChildren()&&this.selectionService.updateGroupsFromChildrenSelections(r)):(this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren())},r.prototype.restoreGroupState=function(e){e&&o._.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(t,o){"boolean"==typeof e[o]&&(t.expanded=e[o])}))},r.prototype.doFilter=function(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.doPivot=function(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.getGroupState=function(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsWrapper.isRememberGroupStateWhenNewData())return null;var e={};return o._.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(t,o){return e[o]=t.expanded})),e},r.prototype.getCopyOfNodesMap=function(){return this.nodeManager.getCopyOfNodesMap()},r.prototype.getRowNode=function(e){if("string"==typeof e&&0==e.indexOf(o.RowNode.ID_PREFIX_ROW_GROUP)){var t=void 0;return this.forEachNode((function(o){o.id===e&&(t=o)})),t}return this.nodeManager.getRowNode(e)},r.prototype.setRowData=function(e){var t=this.getGroupState();this.nodeManager.setRowData(e),this.selectionService.reset(),this.filterManager.onNewRowsLoaded("rowDataUpdated");var r={type:o.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,groupState:t,newData:!0})},r.prototype.batchUpdateRowData=function(e,t){var o=this;if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];var r=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((function(){o.executeBatchUpdateRowData()}),r)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})},r.prototype.flushAsyncTransactions=function(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())},r.prototype.executeBatchUpdateRowData=function(){var e=this;this.valueCache.onDataChanged();var t=[],r=[],i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((function(o){var n=e.nodeManager.updateRowData(o.rowDataTransaction,void 0);r.push(n),o.callback&&t.push(o.callback.bind(null,n)),"number"==typeof o.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(r,void 0,i),t.length>0&&window.setTimeout((function(){t.forEach((function(e){return e()}))}),0),r.length>0){var n={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:o.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:r};this.eventService.dispatchEvent(n)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0},r.prototype.updateRowData=function(e,t){this.valueCache.onDataChanged();var o=this.nodeManager.updateRowData(e,t),r="number"==typeof e.addIndex;return this.commonUpdateRowData([o],t,r),o},r.prototype.createRowNodeOrder=function(){if(!this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()){var e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(var t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}},r.prototype.commonUpdateRowData=function(e,t,r){var i=!this.gridOptionsWrapper.isSuppressAnimationFrame();r&&(t=this.createRowNodeOrder()),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:i});var n={type:o.Events.EVENT_ROW_DATA_UPDATED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(n)},r.prototype.doRowsToDisplay=function(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})},r.prototype.onRowHeightChanged=function(){this.refreshModel({step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,keepEditingRows:!0})},r.prototype.resetRowHeights=function(){var e=!1;this.forEachNode((function(t){t.setRowHeight(t.rowHeight,!0);var o=t.detailNode;o&&o.setRowHeight(o.rowHeight,!0),e=!0})),e&&this.onRowHeightChanged()},a([o.Autowired("columnModel")],r.prototype,"columnModel",void 0),a([o.Autowired("selectionService")],r.prototype,"selectionService",void 0),a([o.Autowired("filterManager")],r.prototype,"filterManager",void 0),a([o.Autowired("valueCache")],r.prototype,"valueCache",void 0),a([o.Autowired("columnApi")],r.prototype,"columnApi",void 0),a([o.Autowired("gridApi")],r.prototype,"gridApi",void 0),a([o.Autowired("animationFrameService")],r.prototype,"animationFrameService",void 0),a([o.Autowired("beans")],r.prototype,"beans",void 0),a([o.Autowired("filterStage")],r.prototype,"filterStage",void 0),a([o.Autowired("sortStage")],r.prototype,"sortStage",void 0),a([o.Autowired("flattenStage")],r.prototype,"flattenStage",void 0),a([o.Optional("groupStage")],r.prototype,"groupStage",void 0),a([o.Optional("aggregationStage")],r.prototype,"aggregationStage",void 0),a([o.Optional("pivotStage")],r.prototype,"pivotStage",void 0),a([o.Optional("filterAggregatesStage")],r.prototype,"filterAggregatesStage",void 0),a([o.PostConstruct],r.prototype,"init",null),r=a([o.Bean("rowModel")],r)}(o.BeanStub),l=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),p=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.execute=function(e){var t=e.changedPath;this.filterService.filter(t)},p([o.Autowired("filterService")],t.prototype,"filterService",void 0),t=p([o.Bean("filterStage")],t)}(o.BeanStub),u=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),c=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.execute=function(e){var t=this.sortController.getSortOptions(),r=o._.exists(t)&&t.length>0,i=r&&o._.exists(e.rowNodeTransactions)&&this.gridOptionsWrapper.isDeltaSort(),n=i?this.calculateDirtyNodes(e.rowNodeTransactions):null,s=o._.missingOrEmpty(this.columnModel.getValueColumns()),a=t.some((function(e){return!!e.column.getColDef().showRowGroup}));this.sortService.sort(t,r,i,n,e.changedPath,s,a)},t.prototype.calculateDirtyNodes=function(e){var t={},o=function(e){e&&e.forEach((function(e){return t[e.id]=!0}))};return e&&e.forEach((function(e){o(e.add),o(e.update),o(e.remove)})),t},c([o.Autowired("sortService")],t.prototype,"sortService",void 0),c([o.Autowired("sortController")],t.prototype,"sortController",void 0),c([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=c([o.Bean("sortStage")],t)}(o.BeanStub),g=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),w=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.execute=function(e){var t=e.rowNode,o=[],r={value:0},i=this.columnModel.isPivotMode(),n=i&&t.leafGroup,s=n?[t]:t.childrenAfterSort;return this.recursivelyAddToRowsToDisplay(s,o,r,i,0),!n&&o.length>0&&this.gridOptionsWrapper.isGroupIncludeTotalFooter()&&(this.ensureFooterNodeExists(t),this.addRowNodeToRowsToDisplay(t.sibling,o,r,0)),o},t.prototype.recursivelyAddToRowsToDisplay=function(e,t,r,i,n){if(!o._.missingOrEmpty(e))for(var s=this.gridOptionsWrapper.isGroupHideOpenParents(),a=this.gridOptionsWrapper.isGroupRemoveSingleChildren(),d=!a&&this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren(),l=0;l<e.length;l++){var p=e[l],h=p.hasChildren(),u=i&&!h,c=a&&h&&1===p.childrenAfterGroup.length,f=d&&h&&p.leafGroup&&1===p.childrenAfterGroup.length,g=i&&p.leafGroup,w=s&&p.expanded&&!g;if(!(u||w||c||f)&&this.addRowNodeToRowsToDisplay(p,t,r,n),!i||!p.leafGroup)if(h){var v=c||f;if(p.expanded||v){var y=v?n:n+1;this.recursivelyAddToRowsToDisplay(p.childrenAfterSort,t,r,i,y),this.gridOptionsWrapper.isGroupIncludeFooter()&&(this.ensureFooterNodeExists(p),this.addRowNodeToRowsToDisplay(p.sibling,t,r,n))}}else if(p.master&&p.expanded){var A=this.createDetailNode(p);this.addRowNodeToRowsToDisplay(A,t,r,n)}}},t.prototype.addRowNodeToRowsToDisplay=function(e,t,o,r){var i=this.gridOptionsWrapper.isGroupMultiAutoColumn();t.push(e),e.setUiLevel(i?0:r)},t.prototype.ensureFooterNodeExists=function(e){if(!o._.exists(e.sibling)){var t=new o.RowNode(this.beans);Object.keys(e).forEach((function(o){t[o]=e[o]})),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,o._.exists(t.id)&&(t.id="rowGroupFooter_"+t.id),t.sibling=e,e.sibling=t}},t.prototype.createDetailNode=function(e){if(o._.exists(e.detailNode))return e.detailNode;var t=new o.RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,o._.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t},w([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),w([o.Autowired("beans")],t.prototype,"beans",void 0),t=w([o.Bean("flattenStage")],t)}(o.BeanStub),y=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),A=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.init=function(){this.postSortFunc=this.gridOptionsWrapper.getPostSortFunc()},t.prototype.sort=function(e,t,o,r,i,n,s){var a=this,d=this.gridOptionsWrapper.isGroupMaintainOrder(),l=this.columnModel.getAllGridColumns().some((function(e){return e.isRowGroupActive()}));i&&i.forEachChangedNodeDepthFirst((function(p){a.pullDownGroupDataForHideOpenParents(p.childrenAfterAggFilter,!0);var h=d&&l&&!p.leafGroup&&!s;if(!t||h){var u=p.childrenAfterAggFilter.slice(0);if(d&&p.childrenAfterSort){var c=p.childrenAfterSort.reduce((function(e,t,o){return e[t.id]=o,e}),{});u.sort((function(e,t){return(c[e.id]||0)-(c[t.id]||0)}))}p.childrenAfterSort=u}else p.childrenAfterSort=o?a.doDeltaSort(p,e,r,i,n):a.rowNodeSorter.doFullSort(p.childrenAfterAggFilter,e);if(p.sibling&&(p.sibling.childrenAfterSort=p.childrenAfterSort),a.updateChildIndexes(p),a.postSortFunc){var f={nodes:p.childrenAfterSort};a.postSortFunc(f)}})),this.updateGroupDataForHideOpenParents(i)},t.prototype.mapNodeToSortedNode=function(e,t){return{currentPos:t,rowNode:e}},t.prototype.doDeltaSort=function(e,t,o,r,i){var n=e.childrenAfterSort.filter((function(e){var t=!o[e.id],n=i||r&&r.canSkip(e);return t&&n})).map(this.mapNodeToSortedNode.bind(this)),s={};n.forEach((function(e){return s[e.rowNode.id]=e.rowNode}));var a=e.childrenAfterAggFilter.filter((function(e){return!s[e.id]})).map(this.mapNodeToSortedNode.bind(this));return a.sort(this.rowNodeSorter.compareRowNodes.bind(this,t)),(0===a.length?n:0===n.length?a:this.mergeSortedArrays(t,n,a)).map((function(e){return e.rowNode}))},t.prototype.mergeSortedArrays=function(e,t,o){for(var r=[],i=0,n=0;i<t.length&&n<o.length;){this.rowNodeSorter.compareRowNodes(e,t[i],o[n])<0?r.push(t[i++]):r.push(o[n++])}for(;i<t.length;)r.push(t[i++]);for(;n<o.length;)r.push(o[n++]);return r},t.prototype.updateChildIndexes=function(e){if(!o._.missing(e.childrenAfterSort))for(var t=e.childrenAfterSort,r=0;r<t.length;r++){var i=t[r],n=0===r,s=r===e.childrenAfterSort.length-1;i.setFirstChild(n),i.setLastChild(s),i.setChildIndex(r)}},t.prototype.updateGroupDataForHideOpenParents=function(e){var t=this;if(this.gridOptionsWrapper.isGroupHideOpenParents()){if(this.gridOptionsWrapper.isTreeData()){return o._.doOnce((function(){return console.warn("AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level).")}),"sortService.hideOpenParentsWithTreeData"),!1}var r=function(e){t.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((function(e){e.hasChildren()&&r(e)}))};e&&e.executeFromRootNode((function(e){return r(e)}))}},t.prototype.pullDownGroupDataForHideOpenParents=function(e,t){var r=this;this.gridOptionsWrapper.isGroupHideOpenParents()&&!o._.missing(e)&&e.forEach((function(e){r.columnModel.getGroupDisplayColumns().forEach((function(o){var i=o.getColDef().showRowGroup;if("string"==typeof i){var n=i,s=r.columnModel.getPrimaryColumn(n);if(!(s===e.rowGroupColumn))if(t)e.setGroupValue(o.getId(),void 0);else{var a=e.getFirstChildOfFirstChild(s);a&&e.setGroupValue(o.getId(),a.key)}}else console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup")}))}))},A([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),A([o.Autowired("rowNodeSorter")],t.prototype,"rowNodeSorter",void 0),A([o.PostConstruct],t.prototype,"init",null),t=A([o.Bean("sortService")],t)}(o.BeanStub),N=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),S=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return N(t,e),t.prototype.postConstruct=function(){this.doingTreeData=this.gridOptionsWrapper.isTreeData()},t.prototype.filter=function(e){var t=this.filterManager.isColumnFilterPresent()||this.filterManager.isQuickFilterPresent()||this.gridOptionsWrapper.isExternalFilterPresent();this.filterNodes(t,e)},t.prototype.filterNodes=function(e,t){var o=this,r=function(t,r){t.hasChildren()?(t.childrenAfterFilter=e&&!r?t.childrenAfterGroup.filter((function(e){var t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,r=e.data&&o.filterManager.doesRowPassFilter({rowNode:e});return t||r})):t.childrenAfterGroup,o.setAllChildrenCount(t)):(t.childrenAfterFilter=t.childrenAfterGroup,t.setAllChildrenCount(null)),t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){var i=function(e,t){if(e.childrenAfterGroup)for(var n=0;n<e.childrenAfterGroup.length;n++){var s=e.childrenAfterGroup[n],a=t||o.filterManager.doesRowPassFilter({rowNode:s});s.childrenAfterGroup?i(e.childrenAfterGroup[n],a):r(s,a)}r(e,t)};t.executeFromRootNode((function(e){return i(e,!1)}))}else{t.forEachChangedNodeDepthFirst((function(e){return r(e,!1)}),!0)}},t.prototype.setAllChildrenCountTreeData=function(e){var t=0;e.childrenAfterFilter.forEach((function(e){t++,t+=e.allChildrenCount})),e.setAllChildrenCount(t)},t.prototype.setAllChildrenCountGridGrouping=function(e){var t=0;e.childrenAfterFilter.forEach((function(e){e.group?t+=e.allChildrenCount:t++})),e.setAllChildrenCount(t)},t.prototype.setAllChildrenCount=function(e){this.doingTreeData?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e)},t.prototype.doingTreeDataFiltering=function(){return this.gridOptionsWrapper.isTreeData()&&!this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering()},S([o.Autowired("filterManager")],t.prototype,"filterManager",void 0),S([o.PostConstruct],t.prototype,"postConstruct",null),t=S([o.Bean("filterService")],t)}(o.BeanStub),m=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),C=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},T=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return s},E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t.prototype.postConstruct=function(){this.rowModel.getType()===o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel)},t.prototype.isActive=function(){return this.gridOptionsWrapper.isImmutableData()},t.prototype.setRowData=function(e){var t=this.createTransactionForRowData(e);if(t){var r=T(t,2),i=r[0],n=r[1],s=this.clientSideRowModel.updateRowData(i,n);s&&this.rowRenderer.refreshFullWidthRows(s.update);var a={type:o.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(a)}},t.prototype.createTransactionForRowData=function(e){if(o._.missing(this.clientSideRowModel))console.error("AG Grid: ImmutableService only works with ClientSideRowModel");else{var t=this.gridOptionsWrapper.getRowIdFunc();if(null!=t){var r={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()?void 0:{};return o._.exists(e)&&e.forEach((function(e,o){var s=t({data:e,level:0}),a=i[s];(n&&(n[s]=o),a)?(a.data!==e&&r.update.push(e),i[s]=void 0):r.add.push(e)})),o._.iterateObject(i,(function(e,t){t&&r.remove.push(t.data)})),[r,n]}console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!")}},C([o.Autowired("rowModel")],t.prototype,"rowModel",void 0),C([o.Autowired("rowRenderer")],t.prototype,"rowRenderer",void 0),C([o.Autowired("columnApi")],t.prototype,"columnApi",void 0),C([o.Autowired("gridApi")],t.prototype,"gridApi",void 0),C([o.PostConstruct],t.prototype,"postConstruct",null),t=C([o.Bean("immutableService")],t)}(o.BeanStub),_={moduleName:o.ModuleNames.ClientSideRowModelModule,beans:[h,f,v,R,O,E],rowModels:{clientSide:d}};exports.ClientSideRowModelModule=_; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),r=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return s},i=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},n=function(){function e(t,o,r,i,n,s,a,d){this.nextId=0,this.allNodesMap={},this.rootNode=t,this.gridOptionsWrapper=o,this.eventService=r,this.columnModel=i,this.gridApi=n,this.columnApi=s,this.beans=d,this.selectionService=a,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[],this.postConstruct()}return e.prototype.postConstruct=function(){this.suppressParentsInRowNodes=this.gridOptionsWrapper.isSuppressParentsInRowNodes(),this.isRowMasterFunc=this.gridOptionsWrapper.getIsRowMasterFunc(),this.doingTreeData=this.gridOptionsWrapper.isTreeData(),this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},e.prototype.getCopyOfNodesMap=function(){return o._.cloneObject(this.allNodesMap)},e.prototype.getRowNode=function(e){return this.allNodesMap[e]},e.prototype.setRowData=function(t){var o=this;if("string"!=typeof t){var r=this.rootNode,i=this.rootNode.sibling;r.childrenAfterFilter=null,r.childrenAfterGroup=null,r.childrenAfterAggFilter=null,r.childrenAfterSort=null,r.childrenMapped=null,r.updateHasChildren(),this.nextId=0,this.allNodesMap={},t?r.allLeafChildren=t.map((function(t){return o.createNode(t,o.rootNode,e.TOP_LEVEL)})):(r.allLeafChildren=[],r.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=r.childrenAfterFilter,i.childrenAfterGroup=r.childrenAfterGroup,i.childrenAfterAggFilter=r.childrenAfterAggFilter,i.childrenAfterSort=r.childrenAfterSort,i.childrenMapped=r.childrenMapped,i.allLeafChildren=r.allLeafChildren)}else console.warn("AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first")},e.prototype.updateRowData=function(e,t){var r={remove:[],update:[],add:[]},i=[];return this.executeRemove(e,r,i),this.executeUpdate(e,r,i),this.executeAdd(e,r),this.updateSelection(i),t&&o._.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),r},e.prototype.updateSelection=function(e){var t=e.length>0;if(t&&e.forEach((function(e){e.setSelected(!1,!1,!0)})),this.selectionService.updateGroupsFromChildrenSelections(),t){var r={type:o.Events.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)}},e.prototype.executeAdd=function(t,r){var n=this,s=t.add,a=t.addIndex;if(!o._.missingOrEmpty(s)){var d,l,p=s.map((function(t){return n.createNode(t,n.rootNode,e.TOP_LEVEL)}));if("number"==typeof a&&a>=0){var h=this.rootNode.allLeafChildren,u=0===a?0:h.reduce((function(e,t,o){var r,i=t.rowIndex,n=null===(r=h[e])||void 0===r?void 0:r.rowIndex;return null!=i&&null!=n&&i<a&&i>n?o:e}),0)+1;d=h.slice(0,u),l=h.slice(u,h.length)}else d=this.rootNode.allLeafChildren,l=[];this.rootNode.allLeafChildren=i(d,p,l),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),r.add=p}},e.prototype.executeRemove=function(e,t,r){var i=this,n=e.remove;if(!o._.missingOrEmpty(n)){var s={};n.forEach((function(e){var o=i.lookupRowNode(e);o&&(o.isSelected()&&r.push(o),o.clearRowTopAndRowIndex(),s[o.id]=!0,delete i.allNodesMap[o.id],t.remove.push(o))})),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter((function(e){return!s[e.id]})),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}},e.prototype.executeUpdate=function(t,r,i){var n=this,s=t.update;o._.missingOrEmpty(s)||s.forEach((function(t){var o=n.lookupRowNode(t);o&&(o.updateData(t),!o.selectable&&o.isSelected()&&i.push(o),n.setMasterForRow(o,t,e.TOP_LEVEL,!1),r.update.push(o))}))},e.prototype.lookupRowNode=function(e){var t,o=this.gridOptionsWrapper.getRowIdFunc();if(o){var r=o({data:e,level:0});if(!(t=this.allNodesMap[r]))return console.error("AG Grid: could not find row id="+r+", data item was not found for this id"),null}else if(!(t=this.rootNode.allLeafChildren.find((function(t){return t.data===e}))))return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return t||null},e.prototype.createNode=function(e,t,r){var i=new o.RowNode(this.beans);return i.group=!1,this.setMasterForRow(i,e,r,!0),t&&!this.suppressParentsInRowNodes&&(i.parent=t),i.level=r,i.setDataAndId(e,this.nextId.toString()),this.allNodesMap[i.id]&&console.warn("AG Grid: duplicate node id '"+i.id+"' detected from getRowId callback, this could cause issues in your grid."),this.allNodesMap[i.id]=i,this.nextId++,i},e.prototype.setMasterForRow=function(e,t,o,r){if(this.doingTreeData)e.setMaster(!1),r&&(e.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?e.setMaster(this.isRowMasterFunc(t)):e.setMaster(!0):e.setMaster(!1),r){var i=this.columnModel.getRowGroupColumns(),n=o+(i?i.length:0);e.expanded=!!e.master&&this.isExpanded(n)}},e.prototype.isExpanded=function(e){var t=this.gridOptionsWrapper.getGroupDefaultExpanded();return-1===t||e<t},e.TOP_LEVEL=0,e.ROOT_NODE_ID="ROOT_NODE_ID",e}(),s=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),a=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};!function(e){e[e.Normal=0]="Normal",e[e.AfterFilter=1]="AfterFilter",e[e.AfterFilterAndSort=2]="AfterFilterAndSort",e[e.PivotNodes=3]="PivotNodes"}(t||(t={}));var d=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return s(r,e),r.prototype.init=function(){var e=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING}),t=!this.gridOptionsWrapper.isSuppressAnimationFrame(),r=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,r),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.PIVOT})),this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,e);var i=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:t});this.addManagedListener(this.gridOptionsWrapper,o.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN,i),this.addManagedListener(this.gridOptionsWrapper,o.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,i),this.rootNode=new o.RowNode(this.beans),this.nodeManager=new n(this.rootNode,this.gridOptionsWrapper,this.eventService,this.columnModel,this.gridApi,this.columnApi,this.selectionService,this.beans)},r.prototype.start=function(){var e=this.gridOptionsWrapper.getRowData();e&&this.setRowData(e)},r.prototype.ensureRowHeightsValid=function(e,t,o,r){var i,n=!1;do{i=!1;for(var s=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),d=Math.max(s,o),l=Math.min(a,r),p=d;p<=l;p++){var h=this.getRow(p);if(h.rowHeightEstimated){var u=this.gridOptionsWrapper.getRowHeightForNode(h);h.setRowHeight(u.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n},r.prototype.setRowTopAndRowIndex=function(){for(var e=this.gridOptionsWrapper.getDefaultRowHeight(),t=0,r=new Set,i=this.gridOptionsWrapper.getDomLayout()===o.Constants.DOM_LAYOUT_NORMAL,n=0;n<this.rowsToDisplay.length;n++){var s=this.rowsToDisplay[n];if(null!=s.id&&r.add(s.id),null==s.rowHeight){var a=this.gridOptionsWrapper.getRowHeightForNode(s,i,e);s.setRowHeight(a.height,a.estimated)}s.setRowTop(t),s.setRowIndex(n),t+=s.rowHeight}return r},r.prototype.clearRowTopAndRowIndex=function(e,t){var o=e.isActive(),r=function(e){e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},i=function(e){if(r(e),r(e.detailNode),r(e.sibling),e.hasChildren()&&e.childrenAfterGroup){var t=-1==e.level;o&&!t&&!e.expanded||e.childrenAfterGroup.forEach(i)}};i(this.rootNode)},r.prototype.ensureRowsAtPixel=function(e,t,r){var i=this;void 0===r&&(r=0);var n=this.getRowIndexAtPixel(t),s=this.getRow(n),a=!this.gridOptionsWrapper.isSuppressAnimationFrame();return s!==e[0]&&(e.forEach((function(e){o._.removeFromArray(i.rootNode.allLeafChildren,e)})),e.forEach((function(e,t){o._.insertIntoArray(i.rootNode.allLeafChildren,e,Math.max(n+r,0)+t)})),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:a}),!0)},r.prototype.highlightRowAtPixel=function(e,t){var o=null!=t?this.getRowIndexAtPixel(t):null,r=null!=o?this.getRow(o):null;if(r&&e&&r!==e&&null!=t){var i=this.getHighlightPosition(t,r);this.lastHighlightedRow&&this.lastHighlightedRow!==r&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),r.setHighlighted(i),this.lastHighlightedRow=r}else this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null)},r.prototype.getHighlightPosition=function(e,t){if(!t){var r=this.getRowIndexAtPixel(e);if(!(t=this.getRow(r||0)))return o.RowHighlightPosition.Below}return e-t.rowTop<t.rowHeight/2?o.RowHighlightPosition.Above:o.RowHighlightPosition.Below},r.prototype.getLastHighlightedRowNode=function(){return this.lastHighlightedRow},r.prototype.isLastRowIndexKnown=function(){return!0},r.prototype.getRowCount=function(){return this.rowsToDisplay?this.rowsToDisplay.length:0},r.prototype.getTopLevelRowCount=function(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;var e=this.rootNode.childrenAfterAggFilter;return e?e.length:0},r.prototype.getTopLevelRowDisplayedIndex=function(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;var t=this.rootNode.childrenAfterSort[e];if(this.gridOptionsWrapper.isGroupHideOpenParents())for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},r.prototype.getRowBounds=function(e){if(o._.missing(this.rowsToDisplay))return null;var t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null},r.prototype.onRowGroupOpened=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})},r.prototype.onFilterChanged=function(e){if(!e.afterDataChange){var t=this.gridOptionsWrapper.isAnimateRows(),r=0===e.columns.length||e.columns.some((function(e){return e.isPrimary()}))?o.ClientSideRowModelSteps.FILTER:o.ClientSideRowModelSteps.FILTER_AGGREGATES;this.refreshModel({step:r,keepRenderedRows:!0,animate:t})}},r.prototype.onSortChanged=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})},r.prototype.getType=function(){return o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE},r.prototype.onValueChanged=function(){this.columnModel.isPivotActive()?this.refreshModel({step:o.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:o.ClientSideRowModelSteps.AGGREGATE})},r.prototype.createChangePath=function(e){var t=o._.missingOrEmpty(e),r=new o.ChangedPath(!1,this.rootNode);return(t||this.gridOptionsWrapper.isTreeData())&&r.setInactive(),r},r.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(e){if(!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction())return!1;if(null==e.rowNodeTransactions)return!1;var t=e.rowNodeTransactions.filter((function(e){return null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0}));return null==t||0==t.length},r.prototype.refreshModel=function(e){if(!this.isSuppressModelUpdateAfterUpdateTransaction(e)){var t=this.createChangePath(e.rowNodeTransactions);switch(e.step){case o.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(e.groupState,e.rowNodeTransactions,e.rowNodeOrder,t,!!e.afterColumnsChanged);case o.ClientSideRowModelSteps.FILTER:this.doFilter(t);case o.ClientSideRowModelSteps.PIVOT:this.doPivot(t);case o.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(t);case o.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(t);case o.ClientSideRowModelSteps.SORT:this.doSort(e.rowNodeTransactions,t);case o.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}var r=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(t,r);var i={type:o.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1};this.eventService.dispatchEvent(i)}},r.prototype.isEmpty=function(){var e=o._.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return o._.missing(this.rootNode)||e||!this.columnModel.isReady()},r.prototype.isRowsToRender=function(){return o._.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0},r.prototype.getNodesInRangeForSelection=function(e,t){var o,r=!t,i=!1,n=[],s=this.gridOptionsWrapper.isGroupSelectsChildren();return this.forEachNodeAfterFilterAndSort((function(a){var d=r&&!i;if(r||a!==t&&a!==e||(r=!0),!(a.group&&s)){var l=r&&!i,p=a.isParentOfNode(o);(l||p)&&n.push(a)}d&&(a!==t&&a!==e||(i=!0,o=a===t?t:e))})),n},r.prototype.setDatasource=function(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")},r.prototype.getTopLevelNodes=function(){return this.rootNode?this.rootNode.childrenAfterGroup:null},r.prototype.getRootNode=function(){return this.rootNode},r.prototype.getRow=function(e){return this.rowsToDisplay[e]},r.prototype.isRowPresent=function(e){return this.rowsToDisplay.indexOf(e)>=0},r.prototype.getRowIndexAtPixel=function(e){if(this.isEmpty())return-1;var t=0,r=this.rowsToDisplay.length-1;if(e<=0)return 0;if(o._.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;for(;;){var i=Math.floor((t+r)/2),n=this.rowsToDisplay[i];if(this.isRowInPixel(n,e))return i;n.rowTop<e?t=i+1:n.rowTop>e&&(r=i-1)}},r.prototype.isRowInPixel=function(e,t){var o=e.rowTop,r=e.rowTop+e.rowHeight;return o<=t&&r>t},r.prototype.forEachLeafNode=function(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((function(t,o){return e(t,o)}))},r.prototype.forEachNode=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup,e,t.Normal,0)},r.prototype.forEachNodeAfterFilter=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterAggFilter,e,t.AfterFilter,0)},r.prototype.forEachNodeAfterFilterAndSort=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort,e,t.AfterFilterAndSort,0)},r.prototype.forEachPivotNode=function(e){this.recursivelyWalkNodesAndCallback([this.rootNode],e,t.PivotNodes,0)},r.prototype.recursivelyWalkNodesAndCallback=function(e,o,r,i){if(!e)return i;for(var n=0;n<e.length;n++){var s=e[n];if(o(s,i++),s.hasChildren()){var a=null;switch(r){case t.Normal:a=s.childrenAfterGroup;break;case t.AfterFilter:a=s.childrenAfterAggFilter;break;case t.AfterFilterAndSort:a=s.childrenAfterSort;break;case t.PivotNodes:a=s.leafGroup?null:s.childrenAfterSort}a&&(i=this.recursivelyWalkNodesAndCallback(a,o,r,i))}}return i},r.prototype.doAggregate=function(e){this.aggregationStage&&this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.doFilterAggregates=function(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter},r.prototype.expandOrCollapseAll=function(e){var t=this.gridOptionsWrapper.isTreeData(),r=this.columnModel.isPivotActive(),i=function(n){n&&n.forEach((function(n){var s=function(){n.expanded=e,i(n.childrenAfterGroup)};t?o._.exists(n.childrenAfterGroup)&&s():r?!n.leafGroup&&s():n.group&&s()}))};this.rootNode&&i(this.rootNode.childrenAfterGroup),this.refreshModel({step:o.ClientSideRowModelSteps.MAP});var n=e?"expandAll":"collapseAll",s={api:this.gridApi,columnApi:this.columnApi,type:o.Events.EVENT_EXPAND_COLLAPSE_ALL,source:n};this.eventService.dispatchEvent(s)},r.prototype.doSort=function(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})},r.prototype.doRowGrouping=function(e,t,o,r,i){this.groupStage?(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:o,changedPath:r}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:r,afterColumnsChanged:i}),this.restoreGroupState(e)),this.gridOptionsWrapper.isGroupSelectsChildren()&&this.selectionService.updateGroupsFromChildrenSelections(r)):(this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren())},r.prototype.restoreGroupState=function(e){e&&o._.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(t,o){"boolean"==typeof e[o]&&(t.expanded=e[o])}))},r.prototype.doFilter=function(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.doPivot=function(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.getGroupState=function(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsWrapper.isRememberGroupStateWhenNewData())return null;var e={};return o._.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(t,o){return e[o]=t.expanded})),e},r.prototype.getCopyOfNodesMap=function(){return this.nodeManager.getCopyOfNodesMap()},r.prototype.getRowNode=function(e){if("string"==typeof e&&0==e.indexOf(o.RowNode.ID_PREFIX_ROW_GROUP)){var t=void 0;return this.forEachNode((function(o){o.id===e&&(t=o)})),t}return this.nodeManager.getRowNode(e)},r.prototype.setRowData=function(e){var t=this.getGroupState();this.nodeManager.setRowData(e),this.selectionService.reset(),this.filterManager.onNewRowsLoaded("rowDataUpdated");var r={type:o.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,groupState:t,newData:!0})},r.prototype.batchUpdateRowData=function(e,t){var o=this;if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];var r=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((function(){o.executeBatchUpdateRowData()}),r)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})},r.prototype.flushAsyncTransactions=function(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())},r.prototype.executeBatchUpdateRowData=function(){var e=this;this.valueCache.onDataChanged();var t=[],r=[],i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((function(o){var n=e.nodeManager.updateRowData(o.rowDataTransaction,void 0);r.push(n),o.callback&&t.push(o.callback.bind(null,n)),"number"==typeof o.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(r,void 0,i),t.length>0&&window.setTimeout((function(){t.forEach((function(e){return e()}))}),0),r.length>0){var n={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:o.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:r};this.eventService.dispatchEvent(n)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0},r.prototype.updateRowData=function(e,t){this.valueCache.onDataChanged();var o=this.nodeManager.updateRowData(e,t),r="number"==typeof e.addIndex;return this.commonUpdateRowData([o],t,r),o},r.prototype.createRowNodeOrder=function(){if(!this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()){var e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(var t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}},r.prototype.commonUpdateRowData=function(e,t,r){var i=!this.gridOptionsWrapper.isSuppressAnimationFrame();r&&(t=this.createRowNodeOrder()),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:i});var n={type:o.Events.EVENT_ROW_DATA_UPDATED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(n)},r.prototype.doRowsToDisplay=function(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})},r.prototype.onRowHeightChanged=function(){this.refreshModel({step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,keepEditingRows:!0})},r.prototype.resetRowHeights=function(){var e=!1;this.forEachNode((function(t){t.setRowHeight(t.rowHeight,!0);var o=t.detailNode;o&&o.setRowHeight(o.rowHeight,!0),e=!0})),e&&this.onRowHeightChanged()},a([o.Autowired("columnModel")],r.prototype,"columnModel",void 0),a([o.Autowired("selectionService")],r.prototype,"selectionService",void 0),a([o.Autowired("filterManager")],r.prototype,"filterManager",void 0),a([o.Autowired("valueCache")],r.prototype,"valueCache",void 0),a([o.Autowired("columnApi")],r.prototype,"columnApi",void 0),a([o.Autowired("gridApi")],r.prototype,"gridApi",void 0),a([o.Autowired("animationFrameService")],r.prototype,"animationFrameService",void 0),a([o.Autowired("beans")],r.prototype,"beans",void 0),a([o.Autowired("filterStage")],r.prototype,"filterStage",void 0),a([o.Autowired("sortStage")],r.prototype,"sortStage",void 0),a([o.Autowired("flattenStage")],r.prototype,"flattenStage",void 0),a([o.Optional("groupStage")],r.prototype,"groupStage",void 0),a([o.Optional("aggregationStage")],r.prototype,"aggregationStage",void 0),a([o.Optional("pivotStage")],r.prototype,"pivotStage",void 0),a([o.Optional("filterAggregatesStage")],r.prototype,"filterAggregatesStage",void 0),a([o.PostConstruct],r.prototype,"init",null),r=a([o.Bean("rowModel")],r)}(o.BeanStub),l=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),p=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.execute=function(e){var t=e.changedPath;this.filterService.filter(t)},p([o.Autowired("filterService")],t.prototype,"filterService",void 0),t=p([o.Bean("filterStage")],t)}(o.BeanStub),u=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),c=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.execute=function(e){var t=this.sortController.getSortOptions(),r=o._.exists(t)&&t.length>0,i=r&&o._.exists(e.rowNodeTransactions)&&this.gridOptionsWrapper.isDeltaSort(),n=t.some((function(e){return!!e.column.getColDef().showRowGroup}));this.sortService.sort(t,r,i,e.rowNodeTransactions,e.changedPath,n)},c([o.Autowired("sortService")],t.prototype,"sortService",void 0),c([o.Autowired("sortController")],t.prototype,"sortController",void 0),c([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=c([o.Bean("sortStage")],t)}(o.BeanStub),g=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),w=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.execute=function(e){var t=e.rowNode,o=[],r={value:0},i=this.columnModel.isPivotMode(),n=i&&t.leafGroup,s=n?[t]:t.childrenAfterSort;return this.recursivelyAddToRowsToDisplay(s,o,r,i,0),!n&&o.length>0&&this.gridOptionsWrapper.isGroupIncludeTotalFooter()&&(this.ensureFooterNodeExists(t),this.addRowNodeToRowsToDisplay(t.sibling,o,r,0)),o},t.prototype.recursivelyAddToRowsToDisplay=function(e,t,r,i,n){if(!o._.missingOrEmpty(e))for(var s=this.gridOptionsWrapper.isGroupHideOpenParents(),a=this.gridOptionsWrapper.isGroupRemoveSingleChildren(),d=!a&&this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren(),l=0;l<e.length;l++){var p=e[l],h=p.hasChildren(),u=i&&!h,c=a&&h&&1===p.childrenAfterGroup.length,f=d&&h&&p.leafGroup&&1===p.childrenAfterGroup.length,g=i&&p.leafGroup,w=s&&p.expanded&&!p.master&&!g;if(!(u||w||c||f)&&this.addRowNodeToRowsToDisplay(p,t,r,n),!i||!p.leafGroup)if(h){var v=c||f;if(p.expanded||v){var y=v?n:n+1;this.recursivelyAddToRowsToDisplay(p.childrenAfterSort,t,r,i,y),this.gridOptionsWrapper.isGroupIncludeFooter()&&(this.ensureFooterNodeExists(p),this.addRowNodeToRowsToDisplay(p.sibling,t,r,n))}}else if(p.master&&p.expanded){var A=this.createDetailNode(p);this.addRowNodeToRowsToDisplay(A,t,r,n)}}},t.prototype.addRowNodeToRowsToDisplay=function(e,t,o,r){var i=this.gridOptionsWrapper.isGroupMultiAutoColumn();t.push(e),e.setUiLevel(i?0:r)},t.prototype.ensureFooterNodeExists=function(e){if(!o._.exists(e.sibling)){var t=new o.RowNode(this.beans);Object.keys(e).forEach((function(o){t[o]=e[o]})),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,o._.exists(t.id)&&(t.id="rowGroupFooter_"+t.id),t.sibling=e,e.sibling=t}},t.prototype.createDetailNode=function(e){if(o._.exists(e.detailNode))return e.detailNode;var t=new o.RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,o._.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t},w([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),w([o.Autowired("beans")],t.prototype,"beans",void 0),t=w([o.Bean("flattenStage")],t)}(o.BeanStub),y=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),A=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return y(t,e),t.prototype.init=function(){this.postSortFunc=this.gridOptionsWrapper.getPostSortFunc()},t.prototype.sort=function(e,t,o,r,i,n){var s=this,a=this.gridOptionsWrapper.isGroupMaintainOrder(),d=this.columnModel.getAllGridColumns().some((function(e){return e.isRowGroupActive()})),l={};o&&r&&(l=this.calculateDirtyNodes(r));var p=this.columnModel.isPivotMode();i&&i.forEachChangedNodeDepthFirst((function(r){s.pullDownGroupDataForHideOpenParents(r.childrenAfterAggFilter,!0);var h=p&&r.leafGroup,u=a&&d&&!r.leafGroup&&!n;if(!t||u||h){var c=r.childrenAfterAggFilter.slice(0);if(a&&r.childrenAfterSort){var f=r.childrenAfterSort.reduce((function(e,t,o){return e[t.id]=o,e}),{});c.sort((function(e,t){return(f[e.id]||0)-(f[t.id]||0)}))}r.childrenAfterSort=c}else r.childrenAfterSort=o?s.doDeltaSort(r,l,i,e):s.rowNodeSorter.doFullSort(r.childrenAfterAggFilter,e);if(r.sibling&&(r.sibling.childrenAfterSort=r.childrenAfterSort),s.updateChildIndexes(r),s.postSortFunc){var g={nodes:r.childrenAfterSort};s.postSortFunc(g)}})),this.updateGroupDataForHideOpenParents(i)},t.prototype.calculateDirtyNodes=function(e){var t={},o=function(e){e&&e.forEach((function(e){return t[e.id]=!0}))};return e&&e.forEach((function(e){o(e.add),o(e.update),o(e.remove)})),t},t.prototype.doDeltaSort=function(e,t,o,r){var i=this,n=e.childrenAfterAggFilter,s=e.childrenAfterSort;if(!s)return this.rowNodeSorter.doFullSort(n,r);var a={},d=[];n.forEach((function(e){t[e.id]||!o.canSkip(e)?d.push(e):a[e.id]=!0}));var l=s.filter((function(e){return a[e.id]})),p=function(e,t){return{currentPos:t,rowNode:e}},h=d.map(p).sort((function(e,t){return i.rowNodeSorter.compareRowNodes(r,e,t)}));return this.mergeSortedArrays(r,h,l.map(p)).map((function(e){return e.rowNode}))},t.prototype.mergeSortedArrays=function(e,t,o){for(var r=[],i=0,n=0;i<t.length&&n<o.length;){this.rowNodeSorter.compareRowNodes(e,t[i],o[n])<0?r.push(t[i++]):r.push(o[n++])}for(;i<t.length;)r.push(t[i++]);for(;n<o.length;)r.push(o[n++]);return r},t.prototype.updateChildIndexes=function(e){if(!o._.missing(e.childrenAfterSort))for(var t=e.childrenAfterSort,r=0;r<t.length;r++){var i=t[r],n=0===r,s=r===e.childrenAfterSort.length-1;i.setFirstChild(n),i.setLastChild(s),i.setChildIndex(r)}},t.prototype.updateGroupDataForHideOpenParents=function(e){var t=this;if(this.gridOptionsWrapper.isGroupHideOpenParents()){if(this.gridOptionsWrapper.isTreeData()){return o._.doOnce((function(){return console.warn("AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level).")}),"sortService.hideOpenParentsWithTreeData"),!1}var r=function(e){t.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((function(e){e.hasChildren()&&r(e)}))};e&&e.executeFromRootNode((function(e){return r(e)}))}},t.prototype.pullDownGroupDataForHideOpenParents=function(e,t){var r=this;this.gridOptionsWrapper.isGroupHideOpenParents()&&!o._.missing(e)&&e.forEach((function(e){r.columnModel.getGroupDisplayColumns().forEach((function(o){var i=o.getColDef().showRowGroup;if("string"==typeof i){var n=i,s=r.columnModel.getPrimaryColumn(n);if(!(s===e.rowGroupColumn))if(t)e.setGroupValue(o.getId(),void 0);else{var a=e.getFirstChildOfFirstChild(s);a&&e.setGroupValue(o.getId(),a.key)}}else console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup")}))}))},A([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),A([o.Autowired("rowNodeSorter")],t.prototype,"rowNodeSorter",void 0),A([o.PostConstruct],t.prototype,"init",null),t=A([o.Bean("sortService")],t)}(o.BeanStub),N=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),S=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return N(t,e),t.prototype.filter=function(e){var t=this.filterManager.isColumnFilterPresent()||this.filterManager.isQuickFilterPresent()||this.gridOptionsWrapper.isExternalFilterPresent();this.filterNodes(t,e)},t.prototype.filterNodes=function(e,t){var o=this,r=function(t,r){t.hasChildren()?t.childrenAfterFilter=e&&!r?t.childrenAfterGroup.filter((function(e){var t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,r=e.data&&o.filterManager.doesRowPassFilter({rowNode:e});return t||r})):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){var i=function(e,t){if(e.childrenAfterGroup)for(var n=0;n<e.childrenAfterGroup.length;n++){var s=e.childrenAfterGroup[n],a=t||o.filterManager.doesRowPassFilter({rowNode:s});s.childrenAfterGroup?i(e.childrenAfterGroup[n],a):r(s,a)}r(e,t)};t.executeFromRootNode((function(e){return i(e,!1)}))}else{t.forEachChangedNodeDepthFirst((function(e){return r(e,!1)}),!0)}},t.prototype.doingTreeDataFiltering=function(){return this.gridOptionsWrapper.isTreeData()&&!this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering()},S([o.Autowired("filterManager")],t.prototype,"filterManager",void 0),t=S([o.Bean("filterService")],t)}(o.BeanStub),m=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),T=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},E=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return s},_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t.prototype.postConstruct=function(){this.rowModel.getType()===o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel)},t.prototype.isActive=function(){return this.gridOptionsWrapper.isImmutableData()},t.prototype.setRowData=function(e){var t=this.createTransactionForRowData(e);if(t){var r=E(t,2),i=r[0],n=r[1],s=this.clientSideRowModel.updateRowData(i,n);s&&this.rowRenderer.refreshFullWidthRows(s.update);var a={type:o.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(a)}},t.prototype.createTransactionForRowData=function(e){if(o._.missing(this.clientSideRowModel))console.error("AG Grid: ImmutableService only works with ClientSideRowModel");else{var t=this.gridOptionsWrapper.getRowIdFunc();if(null!=t){var r={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()?void 0:{};return o._.exists(e)&&e.forEach((function(e,o){var s=t({data:e,level:0}),a=i[s];(n&&(n[s]=o),a)?(a.data!==e&&r.update.push(e),i[s]=void 0):r.add.push(e)})),o._.iterateObject(i,(function(e,t){t&&r.remove.push(t.data)})),[r,n]}console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!")}},T([o.Autowired("rowModel")],t.prototype,"rowModel",void 0),T([o.Autowired("rowRenderer")],t.prototype,"rowRenderer",void 0),T([o.Autowired("columnApi")],t.prototype,"columnApi",void 0),T([o.Autowired("gridApi")],t.prototype,"gridApi",void 0),T([o.PostConstruct],t.prototype,"postConstruct",null),t=T([o.Bean("immutableService")],t)}(o.BeanStub),C={moduleName:o.ModuleNames.ClientSideRowModelModule,beans:[h,f,v,R,O,_],rowModels:{clientSide:d}};exports.ClientSideRowModelModule=C; |
/** | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1 | ||
* @link http://www.ag-grid.com/ | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 | ||
* @link https://www.ag-grid.com/ | ||
* @license MIT | ||
*/ | ||
/** | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1 | ||
* @link http://www.ag-grid.com/ | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 | ||
* @link https://www.ag-grid.com/ | ||
* @license MIT | ||
*/ | ||
import{_ as e,Events as t,RowNode as o,ClientSideRowModelSteps as r,GridOptionsWrapper as i,Constants as n,RowHighlightPosition as s,ChangedPath as a,Autowired as l,Optional as d,PostConstruct as p,Bean as h,BeanStub as c,ModuleNames as u}from"@ag-grid-community/core";var f,g,y=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return s},v=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e},w=function(){function r(e,t,o,i,n,s,a,l){this.nextId=0,this.allNodesMap={},this.rootNode=e,this.gridOptionsWrapper=t,this.eventService=o,this.columnModel=i,this.gridApi=n,this.columnApi=s,this.beans=l,this.selectionService=a,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=r.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[],this.postConstruct()}return r.prototype.postConstruct=function(){this.suppressParentsInRowNodes=this.gridOptionsWrapper.isSuppressParentsInRowNodes(),this.isRowMasterFunc=this.gridOptionsWrapper.getIsRowMasterFunc(),this.doingTreeData=this.gridOptionsWrapper.isTreeData(),this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},r.prototype.getCopyOfNodesMap=function(){return e.cloneObject(this.allNodesMap)},r.prototype.getRowNode=function(e){return this.allNodesMap[e]},r.prototype.setRowData=function(e){var t=this;if("string"!=typeof e){var o=this.rootNode,i=this.rootNode.sibling;o.childrenAfterFilter=null,o.childrenAfterGroup=null,o.childrenAfterAggFilter=null,o.childrenAfterSort=null,o.childrenMapped=null,o.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?o.allLeafChildren=e.map((function(e){return t.createNode(e,t.rootNode,r.TOP_LEVEL)})):(o.allLeafChildren=[],o.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=o.childrenAfterFilter,i.childrenAfterGroup=o.childrenAfterGroup,i.childrenAfterAggFilter=o.childrenAfterAggFilter,i.childrenAfterSort=o.childrenAfterSort,i.childrenMapped=o.childrenMapped,i.allLeafChildren=o.allLeafChildren)}else console.warn("AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first")},r.prototype.updateRowData=function(t,o){var r={remove:[],update:[],add:[]},i=[];return this.executeRemove(t,r,i),this.executeUpdate(t,r,i),this.executeAdd(t,r),this.updateSelection(i),o&&e.sortRowNodesByOrder(this.rootNode.allLeafChildren,o),r},r.prototype.updateSelection=function(e){var o=e.length>0;if(o&&e.forEach((function(e){e.setSelected(!1,!1,!0)})),this.selectionService.updateGroupsFromChildrenSelections(),o){var r={type:t.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)}},r.prototype.executeAdd=function(t,o){var i=this,n=t.add,s=t.addIndex;if(!e.missingOrEmpty(n)){var a,l,d=n.map((function(e){return i.createNode(e,i.rootNode,r.TOP_LEVEL)}));if("number"==typeof s&&s>=0){var p=this.rootNode.allLeafChildren,h=0===s?0:p.reduce((function(e,t,o){var r,i=t.rowIndex,n=null===(r=p[e])||void 0===r?void 0:r.rowIndex;return null!=i&&null!=n&&i<s&&i>n?o:e}),0)+1;a=p.slice(0,h),l=p.slice(h,p.length)}else a=this.rootNode.allLeafChildren,l=[];this.rootNode.allLeafChildren=v(a,d,l),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),o.add=d}},r.prototype.executeRemove=function(t,o,r){var i=this,n=t.remove;if(!e.missingOrEmpty(n)){var s={};n.forEach((function(e){var t=i.lookupRowNode(e);t&&(t.isSelected()&&r.push(t),t.clearRowTopAndRowIndex(),s[t.id]=!0,delete i.allNodesMap[t.id],o.remove.push(t))})),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter((function(e){return!s[e.id]})),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}},r.prototype.executeUpdate=function(t,o,i){var n=this,s=t.update;e.missingOrEmpty(s)||s.forEach((function(e){var t=n.lookupRowNode(e);t&&(t.updateData(e),!t.selectable&&t.isSelected()&&i.push(t),n.setMasterForRow(t,e,r.TOP_LEVEL,!1),o.update.push(t))}))},r.prototype.lookupRowNode=function(e){var t,o=this.gridOptionsWrapper.getRowIdFunc();if(o){var r=o({data:e,level:0});if(!(t=this.allNodesMap[r]))return console.error("AG Grid: could not find row id="+r+", data item was not found for this id"),null}else if(!(t=this.rootNode.allLeafChildren.find((function(t){return t.data===e}))))return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return t||null},r.prototype.createNode=function(e,t,r){var i=new o(this.beans);return i.group=!1,this.setMasterForRow(i,e,r,!0),t&&!this.suppressParentsInRowNodes&&(i.parent=t),i.level=r,i.setDataAndId(e,this.nextId.toString()),this.allNodesMap[i.id]&&console.warn("AG Grid: duplicate node id '"+i.id+"' detected from getRowId callback, this could cause issues in your grid."),this.allNodesMap[i.id]=i,this.nextId++,i},r.prototype.setMasterForRow=function(e,t,o,r){if(this.doingTreeData)e.setMaster(!1),r&&(e.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?e.setMaster(this.isRowMasterFunc(t)):e.setMaster(!0):e.setMaster(!1),r){var i=this.columnModel.getRowGroupColumns(),n=o+(i?i.length:0);e.expanded=!!e.master&&this.isExpanded(n)}},r.prototype.isExpanded=function(e){var t=this.gridOptionsWrapper.getGroupDefaultExpanded();return-1===t||e<t},r.TOP_LEVEL=0,r.ROOT_NODE_ID="ROOT_NODE_ID",r}(),A=(f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)},function(e,t){function o(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),N=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};!function(e){e[e.Normal=0]="Normal",e[e.AfterFilter=1]="AfterFilter",e[e.AfterFilterAndSort=2]="AfterFilterAndSort",e[e.PivotNodes=3]="PivotNodes"}(g||(g={}));var R=function(c){function u(){return null!==c&&c.apply(this,arguments)||this}return A(u,c),u.prototype.init=function(){var e=this.refreshModel.bind(this,{step:r.EVERYTHING}),n=!this.gridOptionsWrapper.isSuppressAnimationFrame(),s=this.refreshModel.bind(this,{step:r.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:n});this.addManagedListener(this.eventService,t.EVENT_NEW_COLUMNS_LOADED,s),this.addManagedListener(this.eventService,t.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,t.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,t.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:r.PIVOT})),this.addManagedListener(this.eventService,t.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,t.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,t.EVENT_COLUMN_PIVOT_MODE_CHANGED,e);var a=this.refreshModel.bind(this,{step:r.MAP,keepRenderedRows:!0,animate:n});this.addManagedListener(this.gridOptionsWrapper,i.PROP_GROUP_REMOVE_SINGLE_CHILDREN,a),this.addManagedListener(this.gridOptionsWrapper,i.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,a),this.rootNode=new o(this.beans),this.nodeManager=new w(this.rootNode,this.gridOptionsWrapper,this.eventService,this.columnModel,this.gridApi,this.columnApi,this.selectionService,this.beans)},u.prototype.start=function(){var e=this.gridOptionsWrapper.getRowData();e&&this.setRowData(e)},u.prototype.ensureRowHeightsValid=function(e,t,o,r){var i,n=!1;do{i=!1;for(var s=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(s,o),d=Math.min(a,r),p=l;p<=d;p++){var h=this.getRow(p);if(h.rowHeightEstimated){var c=this.gridOptionsWrapper.getRowHeightForNode(h);h.setRowHeight(c.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n},u.prototype.setRowTopAndRowIndex=function(){for(var e=this.gridOptionsWrapper.getDefaultRowHeight(),t=0,o=new Set,r=this.gridOptionsWrapper.getDomLayout()===n.DOM_LAYOUT_NORMAL,i=0;i<this.rowsToDisplay.length;i++){var s=this.rowsToDisplay[i];if(null!=s.id&&o.add(s.id),null==s.rowHeight){var a=this.gridOptionsWrapper.getRowHeightForNode(s,r,e);s.setRowHeight(a.height,a.estimated)}s.setRowTop(t),s.setRowIndex(i),t+=s.rowHeight}return o},u.prototype.clearRowTopAndRowIndex=function(e,t){var o=e.isActive(),r=function(e){e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},i=function(e){if(r(e),r(e.detailNode),r(e.sibling),e.hasChildren()&&e.childrenAfterGroup){var t=-1==e.level;o&&!t&&!e.expanded||e.childrenAfterGroup.forEach(i)}};i(this.rootNode)},u.prototype.ensureRowsAtPixel=function(t,o,i){var n=this;void 0===i&&(i=0);var s=this.getRowIndexAtPixel(o),a=this.getRow(s),l=!this.gridOptionsWrapper.isSuppressAnimationFrame();return a!==t[0]&&(t.forEach((function(t){e.removeFromArray(n.rootNode.allLeafChildren,t)})),t.forEach((function(t,o){e.insertIntoArray(n.rootNode.allLeafChildren,t,Math.max(s+i,0)+o)})),this.refreshModel({step:r.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:l}),!0)},u.prototype.highlightRowAtPixel=function(e,t){var o=null!=t?this.getRowIndexAtPixel(t):null,r=null!=o?this.getRow(o):null;if(r&&e&&r!==e&&null!=t){var i=this.getHighlightPosition(t,r);this.lastHighlightedRow&&this.lastHighlightedRow!==r&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),r.setHighlighted(i),this.lastHighlightedRow=r}else this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null)},u.prototype.getHighlightPosition=function(e,t){if(!t){var o=this.getRowIndexAtPixel(e);if(!(t=this.getRow(o||0)))return s.Below}return e-t.rowTop<t.rowHeight/2?s.Above:s.Below},u.prototype.getLastHighlightedRowNode=function(){return this.lastHighlightedRow},u.prototype.isLastRowIndexKnown=function(){return!0},u.prototype.getRowCount=function(){return this.rowsToDisplay?this.rowsToDisplay.length:0},u.prototype.getTopLevelRowCount=function(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;var e=this.rootNode.childrenAfterAggFilter;return e?e.length:0},u.prototype.getTopLevelRowDisplayedIndex=function(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;var t=this.rootNode.childrenAfterSort[e];if(this.gridOptionsWrapper.isGroupHideOpenParents())for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},u.prototype.getRowBounds=function(t){if(e.missing(this.rowsToDisplay))return null;var o=this.rowsToDisplay[t];return o?{rowTop:o.rowTop,rowHeight:o.rowHeight}:null},u.prototype.onRowGroupOpened=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:r.MAP,keepRenderedRows:!0,animate:e})},u.prototype.onFilterChanged=function(e){if(!e.afterDataChange){var t=this.gridOptionsWrapper.isAnimateRows(),o=0===e.columns.length||e.columns.some((function(e){return e.isPrimary()}))?r.FILTER:r.FILTER_AGGREGATES;this.refreshModel({step:o,keepRenderedRows:!0,animate:t})}},u.prototype.onSortChanged=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:r.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})},u.prototype.getType=function(){return n.ROW_MODEL_TYPE_CLIENT_SIDE},u.prototype.onValueChanged=function(){this.columnModel.isPivotActive()?this.refreshModel({step:r.PIVOT}):this.refreshModel({step:r.AGGREGATE})},u.prototype.createChangePath=function(t){var o=e.missingOrEmpty(t),r=new a(!1,this.rootNode);return(o||this.gridOptionsWrapper.isTreeData())&&r.setInactive(),r},u.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(e){if(!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction())return!1;if(null==e.rowNodeTransactions)return!1;var t=e.rowNodeTransactions.filter((function(e){return null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0}));return null==t||0==t.length},u.prototype.refreshModel=function(e){if(!this.isSuppressModelUpdateAfterUpdateTransaction(e)){var o=this.createChangePath(e.rowNodeTransactions);switch(e.step){case r.EVERYTHING:this.doRowGrouping(e.groupState,e.rowNodeTransactions,e.rowNodeOrder,o,!!e.afterColumnsChanged);case r.FILTER:this.doFilter(o);case r.PIVOT:this.doPivot(o);case r.AGGREGATE:this.doAggregate(o);case r.FILTER_AGGREGATES:this.doFilterAggregates(o);case r.SORT:this.doSort(e.rowNodeTransactions,o);case r.MAP:this.doRowsToDisplay()}var i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(o,i);var n={type:t.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1};this.eventService.dispatchEvent(n)}},u.prototype.isEmpty=function(){var t=e.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return e.missing(this.rootNode)||t||!this.columnModel.isReady()},u.prototype.isRowsToRender=function(){return e.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0},u.prototype.getNodesInRangeForSelection=function(e,t){var o,r=!t,i=!1,n=[],s=this.gridOptionsWrapper.isGroupSelectsChildren();return this.forEachNodeAfterFilterAndSort((function(a){var l=r&&!i;if(r||a!==t&&a!==e||(r=!0),!(a.group&&s)){var d=r&&!i,p=a.isParentOfNode(o);(d||p)&&n.push(a)}l&&(a!==t&&a!==e||(i=!0,o=a===t?t:e))})),n},u.prototype.setDatasource=function(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")},u.prototype.getTopLevelNodes=function(){return this.rootNode?this.rootNode.childrenAfterGroup:null},u.prototype.getRootNode=function(){return this.rootNode},u.prototype.getRow=function(e){return this.rowsToDisplay[e]},u.prototype.isRowPresent=function(e){return this.rowsToDisplay.indexOf(e)>=0},u.prototype.getRowIndexAtPixel=function(t){if(this.isEmpty())return-1;var o=0,r=this.rowsToDisplay.length-1;if(t<=0)return 0;if(e.last(this.rowsToDisplay).rowTop<=t)return this.rowsToDisplay.length-1;for(;;){var i=Math.floor((o+r)/2),n=this.rowsToDisplay[i];if(this.isRowInPixel(n,t))return i;n.rowTop<t?o=i+1:n.rowTop>t&&(r=i-1)}},u.prototype.isRowInPixel=function(e,t){var o=e.rowTop,r=e.rowTop+e.rowHeight;return o<=t&&r>t},u.prototype.forEachLeafNode=function(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((function(t,o){return e(t,o)}))},u.prototype.forEachNode=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup,e,g.Normal,0)},u.prototype.forEachNodeAfterFilter=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterAggFilter,e,g.AfterFilter,0)},u.prototype.forEachNodeAfterFilterAndSort=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort,e,g.AfterFilterAndSort,0)},u.prototype.forEachPivotNode=function(e){this.recursivelyWalkNodesAndCallback([this.rootNode],e,g.PivotNodes,0)},u.prototype.recursivelyWalkNodesAndCallback=function(e,t,o,r){if(!e)return r;for(var i=0;i<e.length;i++){var n=e[i];if(t(n,r++),n.hasChildren()){var s=null;switch(o){case g.Normal:s=n.childrenAfterGroup;break;case g.AfterFilter:s=n.childrenAfterAggFilter;break;case g.AfterFilterAndSort:s=n.childrenAfterSort;break;case g.PivotNodes:s=n.leafGroup?null:n.childrenAfterSort}s&&(r=this.recursivelyWalkNodesAndCallback(s,t,o,r))}}return r},u.prototype.doAggregate=function(e){this.aggregationStage&&this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})},u.prototype.doFilterAggregates=function(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter},u.prototype.expandOrCollapseAll=function(o){var i=this.gridOptionsWrapper.isTreeData(),n=this.columnModel.isPivotActive(),s=function(t){t&&t.forEach((function(t){var r=function(){t.expanded=o,s(t.childrenAfterGroup)};i?e.exists(t.childrenAfterGroup)&&r():n?!t.leafGroup&&r():t.group&&r()}))};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:r.MAP});var a=o?"expandAll":"collapseAll",l={api:this.gridApi,columnApi:this.columnApi,type:t.EVENT_EXPAND_COLLAPSE_ALL,source:a};this.eventService.dispatchEvent(l)},u.prototype.doSort=function(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})},u.prototype.doRowGrouping=function(e,t,o,r,i){this.groupStage?(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:o,changedPath:r}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:r,afterColumnsChanged:i}),this.restoreGroupState(e)),this.gridOptionsWrapper.isGroupSelectsChildren()&&this.selectionService.updateGroupsFromChildrenSelections(r)):(this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren())},u.prototype.restoreGroupState=function(t){t&&e.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(e,o){"boolean"==typeof t[o]&&(e.expanded=t[o])}))},u.prototype.doFilter=function(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})},u.prototype.doPivot=function(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})},u.prototype.getGroupState=function(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsWrapper.isRememberGroupStateWhenNewData())return null;var t={};return e.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(e,o){return t[o]=e.expanded})),t},u.prototype.getCopyOfNodesMap=function(){return this.nodeManager.getCopyOfNodesMap()},u.prototype.getRowNode=function(e){if("string"==typeof e&&0==e.indexOf(o.ID_PREFIX_ROW_GROUP)){var t=void 0;return this.forEachNode((function(o){o.id===e&&(t=o)})),t}return this.nodeManager.getRowNode(e)},u.prototype.setRowData=function(e){var o=this.getGroupState();this.nodeManager.setRowData(e),this.selectionService.reset(),this.filterManager.onNewRowsLoaded("rowDataUpdated");var i={type:t.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(i),this.refreshModel({step:r.EVERYTHING,groupState:o,newData:!0})},u.prototype.batchUpdateRowData=function(e,t){var o=this;if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];var r=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((function(){o.executeBatchUpdateRowData()}),r)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})},u.prototype.flushAsyncTransactions=function(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())},u.prototype.executeBatchUpdateRowData=function(){var e=this;this.valueCache.onDataChanged();var o=[],r=[],i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((function(t){var n=e.nodeManager.updateRowData(t.rowDataTransaction,void 0);r.push(n),t.callback&&o.push(t.callback.bind(null,n)),"number"==typeof t.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(r,void 0,i),o.length>0&&window.setTimeout((function(){o.forEach((function(e){return e()}))}),0),r.length>0){var n={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:t.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:r};this.eventService.dispatchEvent(n)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0},u.prototype.updateRowData=function(e,t){this.valueCache.onDataChanged();var o=this.nodeManager.updateRowData(e,t),r="number"==typeof e.addIndex;return this.commonUpdateRowData([o],t,r),o},u.prototype.createRowNodeOrder=function(){if(!this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()){var e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(var t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}},u.prototype.commonUpdateRowData=function(e,o,i){var n=!this.gridOptionsWrapper.isSuppressAnimationFrame();i&&(o=this.createRowNodeOrder()),this.refreshModel({step:r.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:o,keepRenderedRows:!0,keepEditingRows:!0,animate:n});var s={type:t.EVENT_ROW_DATA_UPDATED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(s)},u.prototype.doRowsToDisplay=function(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})},u.prototype.onRowHeightChanged=function(){this.refreshModel({step:r.MAP,keepRenderedRows:!0,keepEditingRows:!0})},u.prototype.resetRowHeights=function(){var e=!1;this.forEachNode((function(t){t.setRowHeight(t.rowHeight,!0);var o=t.detailNode;o&&o.setRowHeight(o.rowHeight,!0),e=!0})),e&&this.onRowHeightChanged()},N([l("columnModel")],u.prototype,"columnModel",void 0),N([l("selectionService")],u.prototype,"selectionService",void 0),N([l("filterManager")],u.prototype,"filterManager",void 0),N([l("valueCache")],u.prototype,"valueCache",void 0),N([l("columnApi")],u.prototype,"columnApi",void 0),N([l("gridApi")],u.prototype,"gridApi",void 0),N([l("animationFrameService")],u.prototype,"animationFrameService",void 0),N([l("beans")],u.prototype,"beans",void 0),N([l("filterStage")],u.prototype,"filterStage",void 0),N([l("sortStage")],u.prototype,"sortStage",void 0),N([l("flattenStage")],u.prototype,"flattenStage",void 0),N([d("groupStage")],u.prototype,"groupStage",void 0),N([d("aggregationStage")],u.prototype,"aggregationStage",void 0),N([d("pivotStage")],u.prototype,"pivotStage",void 0),N([d("filterAggregatesStage")],u.prototype,"filterAggregatesStage",void 0),N([p],u.prototype,"init",null),u=N([h("rowModel")],u)}(c),O=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),m=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.execute=function(e){var t=e.changedPath;this.filterService.filter(t)},m([l("filterService")],t.prototype,"filterService",void 0),t=m([h("filterStage")],t)}(c),T=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),D=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},E=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return T(o,t),o.prototype.execute=function(t){var o=this.sortController.getSortOptions(),r=e.exists(o)&&o.length>0,i=r&&e.exists(t.rowNodeTransactions)&&this.gridOptionsWrapper.isDeltaSort(),n=i?this.calculateDirtyNodes(t.rowNodeTransactions):null,s=e.missingOrEmpty(this.columnModel.getValueColumns()),a=o.some((function(e){return!!e.column.getColDef().showRowGroup}));this.sortService.sort(o,r,i,n,t.changedPath,s,a)},o.prototype.calculateDirtyNodes=function(e){var t={},o=function(e){e&&e.forEach((function(e){return t[e.id]=!0}))};return e&&e.forEach((function(e){o(e.add),o(e.update),o(e.remove)})),t},D([l("sortService")],o.prototype,"sortService",void 0),D([l("sortController")],o.prototype,"sortController",void 0),D([l("columnModel")],o.prototype,"columnModel",void 0),o=D([h("sortStage")],o)}(c),C=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),G=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},_=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return C(r,t),r.prototype.execute=function(e){var t=e.rowNode,o=[],r={value:0},i=this.columnModel.isPivotMode(),n=i&&t.leafGroup,s=n?[t]:t.childrenAfterSort;return this.recursivelyAddToRowsToDisplay(s,o,r,i,0),!n&&o.length>0&&this.gridOptionsWrapper.isGroupIncludeTotalFooter()&&(this.ensureFooterNodeExists(t),this.addRowNodeToRowsToDisplay(t.sibling,o,r,0)),o},r.prototype.recursivelyAddToRowsToDisplay=function(t,o,r,i,n){if(!e.missingOrEmpty(t))for(var s=this.gridOptionsWrapper.isGroupHideOpenParents(),a=this.gridOptionsWrapper.isGroupRemoveSingleChildren(),l=!a&&this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren(),d=0;d<t.length;d++){var p=t[d],h=p.hasChildren(),c=i&&!h,u=a&&h&&1===p.childrenAfterGroup.length,f=l&&h&&p.leafGroup&&1===p.childrenAfterGroup.length,g=i&&p.leafGroup,y=s&&p.expanded&&!g;if(!(c||y||u||f)&&this.addRowNodeToRowsToDisplay(p,o,r,n),!i||!p.leafGroup)if(h){var v=u||f;if(p.expanded||v){var w=v?n:n+1;this.recursivelyAddToRowsToDisplay(p.childrenAfterSort,o,r,i,w),this.gridOptionsWrapper.isGroupIncludeFooter()&&(this.ensureFooterNodeExists(p),this.addRowNodeToRowsToDisplay(p.sibling,o,r,n))}}else if(p.master&&p.expanded){var A=this.createDetailNode(p);this.addRowNodeToRowsToDisplay(A,o,r,n)}}},r.prototype.addRowNodeToRowsToDisplay=function(e,t,o,r){var i=this.gridOptionsWrapper.isGroupMultiAutoColumn();t.push(e),e.setUiLevel(i?0:r)},r.prototype.ensureFooterNodeExists=function(t){if(!e.exists(t.sibling)){var r=new o(this.beans);Object.keys(t).forEach((function(e){r[e]=t[e]})),r.footer=!0,r.setRowTop(null),r.setRowIndex(null),r.oldRowTop=null,e.exists(r.id)&&(r.id="rowGroupFooter_"+r.id),r.sibling=t,t.sibling=r}},r.prototype.createDetailNode=function(t){if(e.exists(t.detailNode))return t.detailNode;var r=new o(this.beans);return r.detail=!0,r.selectable=!1,r.parent=t,e.exists(t.id)&&(r.id="detail_"+t.id),r.data=t.data,r.level=t.level+1,t.detailNode=r,r},G([l("columnModel")],r.prototype,"columnModel",void 0),G([l("beans")],r.prototype,"beans",void 0),r=G([h("flattenStage")],r)}(c),M=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),P=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},b=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return M(o,t),o.prototype.init=function(){this.postSortFunc=this.gridOptionsWrapper.getPostSortFunc()},o.prototype.sort=function(e,t,o,r,i,n,s){var a=this,l=this.gridOptionsWrapper.isGroupMaintainOrder(),d=this.columnModel.getAllGridColumns().some((function(e){return e.isRowGroupActive()}));i&&i.forEachChangedNodeDepthFirst((function(p){a.pullDownGroupDataForHideOpenParents(p.childrenAfterAggFilter,!0);var h=l&&d&&!p.leafGroup&&!s;if(!t||h){var c=p.childrenAfterAggFilter.slice(0);if(l&&p.childrenAfterSort){var u=p.childrenAfterSort.reduce((function(e,t,o){return e[t.id]=o,e}),{});c.sort((function(e,t){return(u[e.id]||0)-(u[t.id]||0)}))}p.childrenAfterSort=c}else p.childrenAfterSort=o?a.doDeltaSort(p,e,r,i,n):a.rowNodeSorter.doFullSort(p.childrenAfterAggFilter,e);if(p.sibling&&(p.sibling.childrenAfterSort=p.childrenAfterSort),a.updateChildIndexes(p),a.postSortFunc){var f={nodes:p.childrenAfterSort};a.postSortFunc(f)}})),this.updateGroupDataForHideOpenParents(i)},o.prototype.mapNodeToSortedNode=function(e,t){return{currentPos:t,rowNode:e}},o.prototype.doDeltaSort=function(e,t,o,r,i){var n=e.childrenAfterSort.filter((function(e){var t=!o[e.id],n=i||r&&r.canSkip(e);return t&&n})).map(this.mapNodeToSortedNode.bind(this)),s={};n.forEach((function(e){return s[e.rowNode.id]=e.rowNode}));var a=e.childrenAfterAggFilter.filter((function(e){return!s[e.id]})).map(this.mapNodeToSortedNode.bind(this));return a.sort(this.rowNodeSorter.compareRowNodes.bind(this,t)),(0===a.length?n:0===n.length?a:this.mergeSortedArrays(t,n,a)).map((function(e){return e.rowNode}))},o.prototype.mergeSortedArrays=function(e,t,o){for(var r=[],i=0,n=0;i<t.length&&n<o.length;){this.rowNodeSorter.compareRowNodes(e,t[i],o[n])<0?r.push(t[i++]):r.push(o[n++])}for(;i<t.length;)r.push(t[i++]);for(;n<o.length;)r.push(o[n++]);return r},o.prototype.updateChildIndexes=function(t){if(!e.missing(t.childrenAfterSort))for(var o=t.childrenAfterSort,r=0;r<o.length;r++){var i=o[r],n=0===r,s=r===t.childrenAfterSort.length-1;i.setFirstChild(n),i.setLastChild(s),i.setChildIndex(r)}},o.prototype.updateGroupDataForHideOpenParents=function(t){var o=this;if(this.gridOptionsWrapper.isGroupHideOpenParents()){if(this.gridOptionsWrapper.isTreeData()){return e.doOnce((function(){return console.warn("AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level).")}),"sortService.hideOpenParentsWithTreeData"),!1}var r=function(e){o.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((function(e){e.hasChildren()&&r(e)}))};t&&t.executeFromRootNode((function(e){return r(e)}))}},o.prototype.pullDownGroupDataForHideOpenParents=function(t,o){var r=this;this.gridOptionsWrapper.isGroupHideOpenParents()&&!e.missing(t)&&t.forEach((function(e){r.columnModel.getGroupDisplayColumns().forEach((function(t){var i=t.getColDef().showRowGroup;if("string"==typeof i){var n=i,s=r.columnModel.getPrimaryColumn(n);if(!(s===e.rowGroupColumn))if(o)e.setGroupValue(t.getId(),void 0);else{var a=e.getFirstChildOfFirstChild(s);a&&e.setGroupValue(t.getId(),a.key)}}else console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup")}))}))},P([l("columnModel")],o.prototype,"columnModel",void 0),P([l("rowNodeSorter")],o.prototype,"rowNodeSorter",void 0),P([p],o.prototype,"init",null),o=P([h("sortService")],o)}(c),F=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),x=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),t.prototype.postConstruct=function(){this.doingTreeData=this.gridOptionsWrapper.isTreeData()},t.prototype.filter=function(e){var t=this.filterManager.isColumnFilterPresent()||this.filterManager.isQuickFilterPresent()||this.gridOptionsWrapper.isExternalFilterPresent();this.filterNodes(t,e)},t.prototype.filterNodes=function(e,t){var o=this,r=function(t,r){t.hasChildren()?(t.childrenAfterFilter=e&&!r?t.childrenAfterGroup.filter((function(e){var t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,r=e.data&&o.filterManager.doesRowPassFilter({rowNode:e});return t||r})):t.childrenAfterGroup,o.setAllChildrenCount(t)):(t.childrenAfterFilter=t.childrenAfterGroup,t.setAllChildrenCount(null)),t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){var i=function(e,t){if(e.childrenAfterGroup)for(var n=0;n<e.childrenAfterGroup.length;n++){var s=e.childrenAfterGroup[n],a=t||o.filterManager.doesRowPassFilter({rowNode:s});s.childrenAfterGroup?i(e.childrenAfterGroup[n],a):r(s,a)}r(e,t)};t.executeFromRootNode((function(e){return i(e,!1)}))}else{t.forEachChangedNodeDepthFirst((function(e){return r(e,!1)}),!0)}},t.prototype.setAllChildrenCountTreeData=function(e){var t=0;e.childrenAfterFilter.forEach((function(e){t++,t+=e.allChildrenCount})),e.setAllChildrenCount(t)},t.prototype.setAllChildrenCountGridGrouping=function(e){var t=0;e.childrenAfterFilter.forEach((function(e){e.group?t+=e.allChildrenCount:t++})),e.setAllChildrenCount(t)},t.prototype.setAllChildrenCount=function(e){this.doingTreeData?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e)},t.prototype.doingTreeDataFiltering=function(){return this.gridOptionsWrapper.isTreeData()&&!this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering()},x([l("filterManager")],t.prototype,"filterManager",void 0),x([p],t.prototype,"postConstruct",null),t=x([h("filterService")],t)}(c),L=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),W=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},H=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return s},k=function(o){function r(){return null!==o&&o.apply(this,arguments)||this}return L(r,o),r.prototype.postConstruct=function(){this.rowModel.getType()===n.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel)},r.prototype.isActive=function(){return this.gridOptionsWrapper.isImmutableData()},r.prototype.setRowData=function(e){var o=this.createTransactionForRowData(e);if(o){var r=H(o,2),i=r[0],n=r[1],s=this.clientSideRowModel.updateRowData(i,n);s&&this.rowRenderer.refreshFullWidthRows(s.update);var a={type:t.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(a)}},r.prototype.createTransactionForRowData=function(t){if(e.missing(this.clientSideRowModel))console.error("AG Grid: ImmutableService only works with ClientSideRowModel");else{var o=this.gridOptionsWrapper.getRowIdFunc();if(null!=o){var r={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()?void 0:{};return e.exists(t)&&t.forEach((function(e,t){var s=o({data:e,level:0}),a=i[s];(n&&(n[s]=t),a)?(a.data!==e&&r.update.push(e),i[s]=void 0):r.add.push(e)})),e.iterateObject(i,(function(e,t){t&&r.remove.push(t.data)})),[r,n]}console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!")}},W([l("rowModel")],r.prototype,"rowModel",void 0),W([l("rowRenderer")],r.prototype,"rowRenderer",void 0),W([l("columnApi")],r.prototype,"columnApi",void 0),W([l("gridApi")],r.prototype,"gridApi",void 0),W([p],r.prototype,"postConstruct",null),r=W([h("immutableService")],r)}(c),j={moduleName:u.ClientSideRowModelModule,beans:[S,E,_,b,I,k],rowModels:{clientSide:R}};export{j as ClientSideRowModelModule}; | ||
import{_ as e,Events as t,RowNode as o,ClientSideRowModelSteps as r,GridOptionsWrapper as i,Constants as n,RowHighlightPosition as s,ChangedPath as a,Autowired as d,Optional as p,PostConstruct as l,Bean as h,BeanStub as c,ModuleNames as u}from"@ag-grid-community/core";var f,g,v=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return s},y=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e},w=function(){function r(e,t,o,i,n,s,a,d){this.nextId=0,this.allNodesMap={},this.rootNode=e,this.gridOptionsWrapper=t,this.eventService=o,this.columnModel=i,this.gridApi=n,this.columnApi=s,this.beans=d,this.selectionService=a,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=r.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[],this.postConstruct()}return r.prototype.postConstruct=function(){this.suppressParentsInRowNodes=this.gridOptionsWrapper.isSuppressParentsInRowNodes(),this.isRowMasterFunc=this.gridOptionsWrapper.getIsRowMasterFunc(),this.doingTreeData=this.gridOptionsWrapper.isTreeData(),this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},r.prototype.getCopyOfNodesMap=function(){return e.cloneObject(this.allNodesMap)},r.prototype.getRowNode=function(e){return this.allNodesMap[e]},r.prototype.setRowData=function(e){var t=this;if("string"!=typeof e){var o=this.rootNode,i=this.rootNode.sibling;o.childrenAfterFilter=null,o.childrenAfterGroup=null,o.childrenAfterAggFilter=null,o.childrenAfterSort=null,o.childrenMapped=null,o.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?o.allLeafChildren=e.map((function(e){return t.createNode(e,t.rootNode,r.TOP_LEVEL)})):(o.allLeafChildren=[],o.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=o.childrenAfterFilter,i.childrenAfterGroup=o.childrenAfterGroup,i.childrenAfterAggFilter=o.childrenAfterAggFilter,i.childrenAfterSort=o.childrenAfterSort,i.childrenMapped=o.childrenMapped,i.allLeafChildren=o.allLeafChildren)}else console.warn("AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first")},r.prototype.updateRowData=function(t,o){var r={remove:[],update:[],add:[]},i=[];return this.executeRemove(t,r,i),this.executeUpdate(t,r,i),this.executeAdd(t,r),this.updateSelection(i),o&&e.sortRowNodesByOrder(this.rootNode.allLeafChildren,o),r},r.prototype.updateSelection=function(e){var o=e.length>0;if(o&&e.forEach((function(e){e.setSelected(!1,!1,!0)})),this.selectionService.updateGroupsFromChildrenSelections(),o){var r={type:t.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)}},r.prototype.executeAdd=function(t,o){var i=this,n=t.add,s=t.addIndex;if(!e.missingOrEmpty(n)){var a,d,p=n.map((function(e){return i.createNode(e,i.rootNode,r.TOP_LEVEL)}));if("number"==typeof s&&s>=0){var l=this.rootNode.allLeafChildren,h=0===s?0:l.reduce((function(e,t,o){var r,i=t.rowIndex,n=null===(r=l[e])||void 0===r?void 0:r.rowIndex;return null!=i&&null!=n&&i<s&&i>n?o:e}),0)+1;a=l.slice(0,h),d=l.slice(h,l.length)}else a=this.rootNode.allLeafChildren,d=[];this.rootNode.allLeafChildren=y(a,p,d),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),o.add=p}},r.prototype.executeRemove=function(t,o,r){var i=this,n=t.remove;if(!e.missingOrEmpty(n)){var s={};n.forEach((function(e){var t=i.lookupRowNode(e);t&&(t.isSelected()&&r.push(t),t.clearRowTopAndRowIndex(),s[t.id]=!0,delete i.allNodesMap[t.id],o.remove.push(t))})),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter((function(e){return!s[e.id]})),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}},r.prototype.executeUpdate=function(t,o,i){var n=this,s=t.update;e.missingOrEmpty(s)||s.forEach((function(e){var t=n.lookupRowNode(e);t&&(t.updateData(e),!t.selectable&&t.isSelected()&&i.push(t),n.setMasterForRow(t,e,r.TOP_LEVEL,!1),o.update.push(t))}))},r.prototype.lookupRowNode=function(e){var t,o=this.gridOptionsWrapper.getRowIdFunc();if(o){var r=o({data:e,level:0});if(!(t=this.allNodesMap[r]))return console.error("AG Grid: could not find row id="+r+", data item was not found for this id"),null}else if(!(t=this.rootNode.allLeafChildren.find((function(t){return t.data===e}))))return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return t||null},r.prototype.createNode=function(e,t,r){var i=new o(this.beans);return i.group=!1,this.setMasterForRow(i,e,r,!0),t&&!this.suppressParentsInRowNodes&&(i.parent=t),i.level=r,i.setDataAndId(e,this.nextId.toString()),this.allNodesMap[i.id]&&console.warn("AG Grid: duplicate node id '"+i.id+"' detected from getRowId callback, this could cause issues in your grid."),this.allNodesMap[i.id]=i,this.nextId++,i},r.prototype.setMasterForRow=function(e,t,o,r){if(this.doingTreeData)e.setMaster(!1),r&&(e.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?e.setMaster(this.isRowMasterFunc(t)):e.setMaster(!0):e.setMaster(!1),r){var i=this.columnModel.getRowGroupColumns(),n=o+(i?i.length:0);e.expanded=!!e.master&&this.isExpanded(n)}},r.prototype.isExpanded=function(e){var t=this.gridOptionsWrapper.getGroupDefaultExpanded();return-1===t||e<t},r.TOP_LEVEL=0,r.ROOT_NODE_ID="ROOT_NODE_ID",r}(),A=(f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)},function(e,t){function o(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),R=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};!function(e){e[e.Normal=0]="Normal",e[e.AfterFilter=1]="AfterFilter",e[e.AfterFilterAndSort=2]="AfterFilterAndSort",e[e.PivotNodes=3]="PivotNodes"}(g||(g={}));var N=function(c){function u(){return null!==c&&c.apply(this,arguments)||this}return A(u,c),u.prototype.init=function(){var e=this.refreshModel.bind(this,{step:r.EVERYTHING}),n=!this.gridOptionsWrapper.isSuppressAnimationFrame(),s=this.refreshModel.bind(this,{step:r.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:n});this.addManagedListener(this.eventService,t.EVENT_NEW_COLUMNS_LOADED,s),this.addManagedListener(this.eventService,t.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,t.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,t.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:r.PIVOT})),this.addManagedListener(this.eventService,t.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,t.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,t.EVENT_COLUMN_PIVOT_MODE_CHANGED,e);var a=this.refreshModel.bind(this,{step:r.MAP,keepRenderedRows:!0,animate:n});this.addManagedListener(this.gridOptionsWrapper,i.PROP_GROUP_REMOVE_SINGLE_CHILDREN,a),this.addManagedListener(this.gridOptionsWrapper,i.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,a),this.rootNode=new o(this.beans),this.nodeManager=new w(this.rootNode,this.gridOptionsWrapper,this.eventService,this.columnModel,this.gridApi,this.columnApi,this.selectionService,this.beans)},u.prototype.start=function(){var e=this.gridOptionsWrapper.getRowData();e&&this.setRowData(e)},u.prototype.ensureRowHeightsValid=function(e,t,o,r){var i,n=!1;do{i=!1;for(var s=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),d=Math.max(s,o),p=Math.min(a,r),l=d;l<=p;l++){var h=this.getRow(l);if(h.rowHeightEstimated){var c=this.gridOptionsWrapper.getRowHeightForNode(h);h.setRowHeight(c.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n},u.prototype.setRowTopAndRowIndex=function(){for(var e=this.gridOptionsWrapper.getDefaultRowHeight(),t=0,o=new Set,r=this.gridOptionsWrapper.getDomLayout()===n.DOM_LAYOUT_NORMAL,i=0;i<this.rowsToDisplay.length;i++){var s=this.rowsToDisplay[i];if(null!=s.id&&o.add(s.id),null==s.rowHeight){var a=this.gridOptionsWrapper.getRowHeightForNode(s,r,e);s.setRowHeight(a.height,a.estimated)}s.setRowTop(t),s.setRowIndex(i),t+=s.rowHeight}return o},u.prototype.clearRowTopAndRowIndex=function(e,t){var o=e.isActive(),r=function(e){e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},i=function(e){if(r(e),r(e.detailNode),r(e.sibling),e.hasChildren()&&e.childrenAfterGroup){var t=-1==e.level;o&&!t&&!e.expanded||e.childrenAfterGroup.forEach(i)}};i(this.rootNode)},u.prototype.ensureRowsAtPixel=function(t,o,i){var n=this;void 0===i&&(i=0);var s=this.getRowIndexAtPixel(o),a=this.getRow(s),d=!this.gridOptionsWrapper.isSuppressAnimationFrame();return a!==t[0]&&(t.forEach((function(t){e.removeFromArray(n.rootNode.allLeafChildren,t)})),t.forEach((function(t,o){e.insertIntoArray(n.rootNode.allLeafChildren,t,Math.max(s+i,0)+o)})),this.refreshModel({step:r.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:d}),!0)},u.prototype.highlightRowAtPixel=function(e,t){var o=null!=t?this.getRowIndexAtPixel(t):null,r=null!=o?this.getRow(o):null;if(r&&e&&r!==e&&null!=t){var i=this.getHighlightPosition(t,r);this.lastHighlightedRow&&this.lastHighlightedRow!==r&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),r.setHighlighted(i),this.lastHighlightedRow=r}else this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null)},u.prototype.getHighlightPosition=function(e,t){if(!t){var o=this.getRowIndexAtPixel(e);if(!(t=this.getRow(o||0)))return s.Below}return e-t.rowTop<t.rowHeight/2?s.Above:s.Below},u.prototype.getLastHighlightedRowNode=function(){return this.lastHighlightedRow},u.prototype.isLastRowIndexKnown=function(){return!0},u.prototype.getRowCount=function(){return this.rowsToDisplay?this.rowsToDisplay.length:0},u.prototype.getTopLevelRowCount=function(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;var e=this.rootNode.childrenAfterAggFilter;return e?e.length:0},u.prototype.getTopLevelRowDisplayedIndex=function(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;var t=this.rootNode.childrenAfterSort[e];if(this.gridOptionsWrapper.isGroupHideOpenParents())for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},u.prototype.getRowBounds=function(t){if(e.missing(this.rowsToDisplay))return null;var o=this.rowsToDisplay[t];return o?{rowTop:o.rowTop,rowHeight:o.rowHeight}:null},u.prototype.onRowGroupOpened=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:r.MAP,keepRenderedRows:!0,animate:e})},u.prototype.onFilterChanged=function(e){if(!e.afterDataChange){var t=this.gridOptionsWrapper.isAnimateRows(),o=0===e.columns.length||e.columns.some((function(e){return e.isPrimary()}))?r.FILTER:r.FILTER_AGGREGATES;this.refreshModel({step:o,keepRenderedRows:!0,animate:t})}},u.prototype.onSortChanged=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:r.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})},u.prototype.getType=function(){return n.ROW_MODEL_TYPE_CLIENT_SIDE},u.prototype.onValueChanged=function(){this.columnModel.isPivotActive()?this.refreshModel({step:r.PIVOT}):this.refreshModel({step:r.AGGREGATE})},u.prototype.createChangePath=function(t){var o=e.missingOrEmpty(t),r=new a(!1,this.rootNode);return(o||this.gridOptionsWrapper.isTreeData())&&r.setInactive(),r},u.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(e){if(!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction())return!1;if(null==e.rowNodeTransactions)return!1;var t=e.rowNodeTransactions.filter((function(e){return null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0}));return null==t||0==t.length},u.prototype.refreshModel=function(e){if(!this.isSuppressModelUpdateAfterUpdateTransaction(e)){var o=this.createChangePath(e.rowNodeTransactions);switch(e.step){case r.EVERYTHING:this.doRowGrouping(e.groupState,e.rowNodeTransactions,e.rowNodeOrder,o,!!e.afterColumnsChanged);case r.FILTER:this.doFilter(o);case r.PIVOT:this.doPivot(o);case r.AGGREGATE:this.doAggregate(o);case r.FILTER_AGGREGATES:this.doFilterAggregates(o);case r.SORT:this.doSort(e.rowNodeTransactions,o);case r.MAP:this.doRowsToDisplay()}var i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(o,i);var n={type:t.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1};this.eventService.dispatchEvent(n)}},u.prototype.isEmpty=function(){var t=e.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return e.missing(this.rootNode)||t||!this.columnModel.isReady()},u.prototype.isRowsToRender=function(){return e.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0},u.prototype.getNodesInRangeForSelection=function(e,t){var o,r=!t,i=!1,n=[],s=this.gridOptionsWrapper.isGroupSelectsChildren();return this.forEachNodeAfterFilterAndSort((function(a){var d=r&&!i;if(r||a!==t&&a!==e||(r=!0),!(a.group&&s)){var p=r&&!i,l=a.isParentOfNode(o);(p||l)&&n.push(a)}d&&(a!==t&&a!==e||(i=!0,o=a===t?t:e))})),n},u.prototype.setDatasource=function(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")},u.prototype.getTopLevelNodes=function(){return this.rootNode?this.rootNode.childrenAfterGroup:null},u.prototype.getRootNode=function(){return this.rootNode},u.prototype.getRow=function(e){return this.rowsToDisplay[e]},u.prototype.isRowPresent=function(e){return this.rowsToDisplay.indexOf(e)>=0},u.prototype.getRowIndexAtPixel=function(t){if(this.isEmpty())return-1;var o=0,r=this.rowsToDisplay.length-1;if(t<=0)return 0;if(e.last(this.rowsToDisplay).rowTop<=t)return this.rowsToDisplay.length-1;for(;;){var i=Math.floor((o+r)/2),n=this.rowsToDisplay[i];if(this.isRowInPixel(n,t))return i;n.rowTop<t?o=i+1:n.rowTop>t&&(r=i-1)}},u.prototype.isRowInPixel=function(e,t){var o=e.rowTop,r=e.rowTop+e.rowHeight;return o<=t&&r>t},u.prototype.forEachLeafNode=function(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((function(t,o){return e(t,o)}))},u.prototype.forEachNode=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup,e,g.Normal,0)},u.prototype.forEachNodeAfterFilter=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterAggFilter,e,g.AfterFilter,0)},u.prototype.forEachNodeAfterFilterAndSort=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort,e,g.AfterFilterAndSort,0)},u.prototype.forEachPivotNode=function(e){this.recursivelyWalkNodesAndCallback([this.rootNode],e,g.PivotNodes,0)},u.prototype.recursivelyWalkNodesAndCallback=function(e,t,o,r){if(!e)return r;for(var i=0;i<e.length;i++){var n=e[i];if(t(n,r++),n.hasChildren()){var s=null;switch(o){case g.Normal:s=n.childrenAfterGroup;break;case g.AfterFilter:s=n.childrenAfterAggFilter;break;case g.AfterFilterAndSort:s=n.childrenAfterSort;break;case g.PivotNodes:s=n.leafGroup?null:n.childrenAfterSort}s&&(r=this.recursivelyWalkNodesAndCallback(s,t,o,r))}}return r},u.prototype.doAggregate=function(e){this.aggregationStage&&this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})},u.prototype.doFilterAggregates=function(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter},u.prototype.expandOrCollapseAll=function(o){var i=this.gridOptionsWrapper.isTreeData(),n=this.columnModel.isPivotActive(),s=function(t){t&&t.forEach((function(t){var r=function(){t.expanded=o,s(t.childrenAfterGroup)};i?e.exists(t.childrenAfterGroup)&&r():n?!t.leafGroup&&r():t.group&&r()}))};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:r.MAP});var a=o?"expandAll":"collapseAll",d={api:this.gridApi,columnApi:this.columnApi,type:t.EVENT_EXPAND_COLLAPSE_ALL,source:a};this.eventService.dispatchEvent(d)},u.prototype.doSort=function(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})},u.prototype.doRowGrouping=function(e,t,o,r,i){this.groupStage?(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:o,changedPath:r}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:r,afterColumnsChanged:i}),this.restoreGroupState(e)),this.gridOptionsWrapper.isGroupSelectsChildren()&&this.selectionService.updateGroupsFromChildrenSelections(r)):(this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren())},u.prototype.restoreGroupState=function(t){t&&e.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(e,o){"boolean"==typeof t[o]&&(e.expanded=t[o])}))},u.prototype.doFilter=function(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})},u.prototype.doPivot=function(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})},u.prototype.getGroupState=function(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsWrapper.isRememberGroupStateWhenNewData())return null;var t={};return e.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(e,o){return t[o]=e.expanded})),t},u.prototype.getCopyOfNodesMap=function(){return this.nodeManager.getCopyOfNodesMap()},u.prototype.getRowNode=function(e){if("string"==typeof e&&0==e.indexOf(o.ID_PREFIX_ROW_GROUP)){var t=void 0;return this.forEachNode((function(o){o.id===e&&(t=o)})),t}return this.nodeManager.getRowNode(e)},u.prototype.setRowData=function(e){var o=this.getGroupState();this.nodeManager.setRowData(e),this.selectionService.reset(),this.filterManager.onNewRowsLoaded("rowDataUpdated");var i={type:t.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(i),this.refreshModel({step:r.EVERYTHING,groupState:o,newData:!0})},u.prototype.batchUpdateRowData=function(e,t){var o=this;if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];var r=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((function(){o.executeBatchUpdateRowData()}),r)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})},u.prototype.flushAsyncTransactions=function(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())},u.prototype.executeBatchUpdateRowData=function(){var e=this;this.valueCache.onDataChanged();var o=[],r=[],i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((function(t){var n=e.nodeManager.updateRowData(t.rowDataTransaction,void 0);r.push(n),t.callback&&o.push(t.callback.bind(null,n)),"number"==typeof t.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(r,void 0,i),o.length>0&&window.setTimeout((function(){o.forEach((function(e){return e()}))}),0),r.length>0){var n={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:t.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:r};this.eventService.dispatchEvent(n)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0},u.prototype.updateRowData=function(e,t){this.valueCache.onDataChanged();var o=this.nodeManager.updateRowData(e,t),r="number"==typeof e.addIndex;return this.commonUpdateRowData([o],t,r),o},u.prototype.createRowNodeOrder=function(){if(!this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()){var e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(var t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}},u.prototype.commonUpdateRowData=function(e,o,i){var n=!this.gridOptionsWrapper.isSuppressAnimationFrame();i&&(o=this.createRowNodeOrder()),this.refreshModel({step:r.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:o,keepRenderedRows:!0,keepEditingRows:!0,animate:n});var s={type:t.EVENT_ROW_DATA_UPDATED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(s)},u.prototype.doRowsToDisplay=function(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})},u.prototype.onRowHeightChanged=function(){this.refreshModel({step:r.MAP,keepRenderedRows:!0,keepEditingRows:!0})},u.prototype.resetRowHeights=function(){var e=!1;this.forEachNode((function(t){t.setRowHeight(t.rowHeight,!0);var o=t.detailNode;o&&o.setRowHeight(o.rowHeight,!0),e=!0})),e&&this.onRowHeightChanged()},R([d("columnModel")],u.prototype,"columnModel",void 0),R([d("selectionService")],u.prototype,"selectionService",void 0),R([d("filterManager")],u.prototype,"filterManager",void 0),R([d("valueCache")],u.prototype,"valueCache",void 0),R([d("columnApi")],u.prototype,"columnApi",void 0),R([d("gridApi")],u.prototype,"gridApi",void 0),R([d("animationFrameService")],u.prototype,"animationFrameService",void 0),R([d("beans")],u.prototype,"beans",void 0),R([d("filterStage")],u.prototype,"filterStage",void 0),R([d("sortStage")],u.prototype,"sortStage",void 0),R([d("flattenStage")],u.prototype,"flattenStage",void 0),R([p("groupStage")],u.prototype,"groupStage",void 0),R([p("aggregationStage")],u.prototype,"aggregationStage",void 0),R([p("pivotStage")],u.prototype,"pivotStage",void 0),R([p("filterAggregatesStage")],u.prototype,"filterAggregatesStage",void 0),R([l],u.prototype,"init",null),u=R([h("rowModel")],u)}(c),O=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),m=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.execute=function(e){var t=e.changedPath;this.filterService.filter(t)},m([d("filterService")],t.prototype,"filterService",void 0),t=m([h("filterStage")],t)}(c),T=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),E=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},D=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return T(o,t),o.prototype.execute=function(t){var o=this.sortController.getSortOptions(),r=e.exists(o)&&o.length>0,i=r&&e.exists(t.rowNodeTransactions)&&this.gridOptionsWrapper.isDeltaSort(),n=o.some((function(e){return!!e.column.getColDef().showRowGroup}));this.sortService.sort(o,r,i,t.rowNodeTransactions,t.changedPath,n)},E([d("sortService")],o.prototype,"sortService",void 0),E([d("sortController")],o.prototype,"sortController",void 0),E([d("columnModel")],o.prototype,"columnModel",void 0),o=E([h("sortStage")],o)}(c),M=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),_=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},G=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return M(r,t),r.prototype.execute=function(e){var t=e.rowNode,o=[],r={value:0},i=this.columnModel.isPivotMode(),n=i&&t.leafGroup,s=n?[t]:t.childrenAfterSort;return this.recursivelyAddToRowsToDisplay(s,o,r,i,0),!n&&o.length>0&&this.gridOptionsWrapper.isGroupIncludeTotalFooter()&&(this.ensureFooterNodeExists(t),this.addRowNodeToRowsToDisplay(t.sibling,o,r,0)),o},r.prototype.recursivelyAddToRowsToDisplay=function(t,o,r,i,n){if(!e.missingOrEmpty(t))for(var s=this.gridOptionsWrapper.isGroupHideOpenParents(),a=this.gridOptionsWrapper.isGroupRemoveSingleChildren(),d=!a&&this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren(),p=0;p<t.length;p++){var l=t[p],h=l.hasChildren(),c=i&&!h,u=a&&h&&1===l.childrenAfterGroup.length,f=d&&h&&l.leafGroup&&1===l.childrenAfterGroup.length,g=i&&l.leafGroup,v=s&&l.expanded&&!l.master&&!g;if(!(c||v||u||f)&&this.addRowNodeToRowsToDisplay(l,o,r,n),!i||!l.leafGroup)if(h){var y=u||f;if(l.expanded||y){var w=y?n:n+1;this.recursivelyAddToRowsToDisplay(l.childrenAfterSort,o,r,i,w),this.gridOptionsWrapper.isGroupIncludeFooter()&&(this.ensureFooterNodeExists(l),this.addRowNodeToRowsToDisplay(l.sibling,o,r,n))}}else if(l.master&&l.expanded){var A=this.createDetailNode(l);this.addRowNodeToRowsToDisplay(A,o,r,n)}}},r.prototype.addRowNodeToRowsToDisplay=function(e,t,o,r){var i=this.gridOptionsWrapper.isGroupMultiAutoColumn();t.push(e),e.setUiLevel(i?0:r)},r.prototype.ensureFooterNodeExists=function(t){if(!e.exists(t.sibling)){var r=new o(this.beans);Object.keys(t).forEach((function(e){r[e]=t[e]})),r.footer=!0,r.setRowTop(null),r.setRowIndex(null),r.oldRowTop=null,e.exists(r.id)&&(r.id="rowGroupFooter_"+r.id),r.sibling=t,t.sibling=r}},r.prototype.createDetailNode=function(t){if(e.exists(t.detailNode))return t.detailNode;var r=new o(this.beans);return r.detail=!0,r.selectable=!1,r.parent=t,e.exists(t.id)&&(r.id="detail_"+t.id),r.data=t.data,r.level=t.level+1,t.detailNode=r,r},_([d("columnModel")],r.prototype,"columnModel",void 0),_([d("beans")],r.prototype,"beans",void 0),r=_([h("flattenStage")],r)}(c),C=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),P=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},b=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return C(o,t),o.prototype.init=function(){this.postSortFunc=this.gridOptionsWrapper.getPostSortFunc()},o.prototype.sort=function(e,t,o,r,i,n){var s=this,a=this.gridOptionsWrapper.isGroupMaintainOrder(),d=this.columnModel.getAllGridColumns().some((function(e){return e.isRowGroupActive()})),p={};o&&r&&(p=this.calculateDirtyNodes(r));var l=this.columnModel.isPivotMode();i&&i.forEachChangedNodeDepthFirst((function(r){s.pullDownGroupDataForHideOpenParents(r.childrenAfterAggFilter,!0);var h=l&&r.leafGroup,c=a&&d&&!r.leafGroup&&!n;if(!t||c||h){var u=r.childrenAfterAggFilter.slice(0);if(a&&r.childrenAfterSort){var f=r.childrenAfterSort.reduce((function(e,t,o){return e[t.id]=o,e}),{});u.sort((function(e,t){return(f[e.id]||0)-(f[t.id]||0)}))}r.childrenAfterSort=u}else r.childrenAfterSort=o?s.doDeltaSort(r,p,i,e):s.rowNodeSorter.doFullSort(r.childrenAfterAggFilter,e);if(r.sibling&&(r.sibling.childrenAfterSort=r.childrenAfterSort),s.updateChildIndexes(r),s.postSortFunc){var g={nodes:r.childrenAfterSort};s.postSortFunc(g)}})),this.updateGroupDataForHideOpenParents(i)},o.prototype.calculateDirtyNodes=function(e){var t={},o=function(e){e&&e.forEach((function(e){return t[e.id]=!0}))};return e&&e.forEach((function(e){o(e.add),o(e.update),o(e.remove)})),t},o.prototype.doDeltaSort=function(e,t,o,r){var i=this,n=e.childrenAfterAggFilter,s=e.childrenAfterSort;if(!s)return this.rowNodeSorter.doFullSort(n,r);var a={},d=[];n.forEach((function(e){t[e.id]||!o.canSkip(e)?d.push(e):a[e.id]=!0}));var p=s.filter((function(e){return a[e.id]})),l=function(e,t){return{currentPos:t,rowNode:e}},h=d.map(l).sort((function(e,t){return i.rowNodeSorter.compareRowNodes(r,e,t)}));return this.mergeSortedArrays(r,h,p.map(l)).map((function(e){return e.rowNode}))},o.prototype.mergeSortedArrays=function(e,t,o){for(var r=[],i=0,n=0;i<t.length&&n<o.length;){this.rowNodeSorter.compareRowNodes(e,t[i],o[n])<0?r.push(t[i++]):r.push(o[n++])}for(;i<t.length;)r.push(t[i++]);for(;n<o.length;)r.push(o[n++]);return r},o.prototype.updateChildIndexes=function(t){if(!e.missing(t.childrenAfterSort))for(var o=t.childrenAfterSort,r=0;r<o.length;r++){var i=o[r],n=0===r,s=r===t.childrenAfterSort.length-1;i.setFirstChild(n),i.setLastChild(s),i.setChildIndex(r)}},o.prototype.updateGroupDataForHideOpenParents=function(t){var o=this;if(this.gridOptionsWrapper.isGroupHideOpenParents()){if(this.gridOptionsWrapper.isTreeData()){return e.doOnce((function(){return console.warn("AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level).")}),"sortService.hideOpenParentsWithTreeData"),!1}var r=function(e){o.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((function(e){e.hasChildren()&&r(e)}))};t&&t.executeFromRootNode((function(e){return r(e)}))}},o.prototype.pullDownGroupDataForHideOpenParents=function(t,o){var r=this;this.gridOptionsWrapper.isGroupHideOpenParents()&&!e.missing(t)&&t.forEach((function(e){r.columnModel.getGroupDisplayColumns().forEach((function(t){var i=t.getColDef().showRowGroup;if("string"==typeof i){var n=i,s=r.columnModel.getPrimaryColumn(n);if(!(s===e.rowGroupColumn))if(o)e.setGroupValue(t.getId(),void 0);else{var a=e.getFirstChildOfFirstChild(s);a&&e.setGroupValue(t.getId(),a.key)}}else console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup")}))}))},P([d("columnModel")],o.prototype,"columnModel",void 0),P([d("rowNodeSorter")],o.prototype,"rowNodeSorter",void 0),P([l],o.prototype,"init",null),o=P([h("sortService")],o)}(c),F=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),x=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return F(t,e),t.prototype.filter=function(e){var t=this.filterManager.isColumnFilterPresent()||this.filterManager.isQuickFilterPresent()||this.gridOptionsWrapper.isExternalFilterPresent();this.filterNodes(t,e)},t.prototype.filterNodes=function(e,t){var o=this,r=function(t,r){t.hasChildren()?t.childrenAfterFilter=e&&!r?t.childrenAfterGroup.filter((function(e){var t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,r=e.data&&o.filterManager.doesRowPassFilter({rowNode:e});return t||r})):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){var i=function(e,t){if(e.childrenAfterGroup)for(var n=0;n<e.childrenAfterGroup.length;n++){var s=e.childrenAfterGroup[n],a=t||o.filterManager.doesRowPassFilter({rowNode:s});s.childrenAfterGroup?i(e.childrenAfterGroup[n],a):r(s,a)}r(e,t)};t.executeFromRootNode((function(e){return i(e,!1)}))}else{t.forEachChangedNodeDepthFirst((function(e){return r(e,!1)}),!0)}},t.prototype.doingTreeDataFiltering=function(){return this.gridOptionsWrapper.isTreeData()&&!this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering()},x([d("filterManager")],t.prototype,"filterManager",void 0),t=x([h("filterService")],t)}(c),L=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),W=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},H=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return s},k=function(o){function r(){return null!==o&&o.apply(this,arguments)||this}return L(r,o),r.prototype.postConstruct=function(){this.rowModel.getType()===n.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel)},r.prototype.isActive=function(){return this.gridOptionsWrapper.isImmutableData()},r.prototype.setRowData=function(e){var o=this.createTransactionForRowData(e);if(o){var r=H(o,2),i=r[0],n=r[1],s=this.clientSideRowModel.updateRowData(i,n);s&&this.rowRenderer.refreshFullWidthRows(s.update);var a={type:t.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(a)}},r.prototype.createTransactionForRowData=function(t){if(e.missing(this.clientSideRowModel))console.error("AG Grid: ImmutableService only works with ClientSideRowModel");else{var o=this.gridOptionsWrapper.getRowIdFunc();if(null!=o){var r={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()?void 0:{};return e.exists(t)&&t.forEach((function(e,t){var s=o({data:e,level:0}),a=i[s];(n&&(n[s]=t),a)?(a.data!==e&&r.update.push(e),i[s]=void 0):r.add.push(e)})),e.iterateObject(i,(function(e,t){t&&r.remove.push(t.data)})),[r,n]}console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!")}},W([d("rowModel")],r.prototype,"rowModel",void 0),W([d("rowRenderer")],r.prototype,"rowRenderer",void 0),W([d("columnApi")],r.prototype,"columnApi",void 0),W([d("gridApi")],r.prototype,"gridApi",void 0),W([l],r.prototype,"postConstruct",null),r=W([h("immutableService")],r)}(c),j={moduleName:u.ClientSideRowModelModule,beans:[S,D,G,b,I,k],rowModels:{clientSide:N}};export{j as ClientSideRowModelModule}; |
import { ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
export declare class FilterService extends BeanStub { | ||
private filterManager; | ||
private doingTreeData; | ||
private postConstruct; | ||
filter(changedPath: ChangedPath): void; | ||
private filterNodes; | ||
private setAllChildrenCountTreeData; | ||
private setAllChildrenCountGridGrouping; | ||
private setAllChildrenCount; | ||
private doingTreeDataFiltering; | ||
} |
@@ -20,3 +20,3 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
import { Autowired, Bean, PostConstruct, BeanStub } from "@ag-grid-community/core"; | ||
import { Autowired, Bean, BeanStub } from "@ag-grid-community/core"; | ||
var FilterService = /** @class */ (function (_super) { | ||
@@ -27,5 +27,2 @@ __extends(FilterService, _super); | ||
} | ||
FilterService.prototype.postConstruct = function () { | ||
this.doingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
}; | ||
FilterService.prototype.filter = function (changedPath) { | ||
@@ -60,7 +57,5 @@ var filterActive = this.filterManager.isColumnFilterPresent() | ||
} | ||
_this.setAllChildrenCount(rowNode); | ||
} | ||
else { | ||
rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; | ||
rowNode.setAllChildrenCount(null); | ||
} | ||
@@ -99,34 +94,2 @@ if (rowNode.sibling) { | ||
}; | ||
FilterService.prototype.setAllChildrenCountTreeData = function (rowNode) { | ||
// for tree data, we include all children, groups and leafs | ||
var allChildrenCount = 0; | ||
rowNode.childrenAfterFilter.forEach(function (child) { | ||
// include child itself | ||
allChildrenCount++; | ||
// include children of children | ||
allChildrenCount += child.allChildrenCount; | ||
}); | ||
rowNode.setAllChildrenCount(allChildrenCount); | ||
}; | ||
FilterService.prototype.setAllChildrenCountGridGrouping = function (rowNode) { | ||
// for grid data, we only count the leafs | ||
var allChildrenCount = 0; | ||
rowNode.childrenAfterFilter.forEach(function (child) { | ||
if (child.group) { | ||
allChildrenCount += child.allChildrenCount; | ||
} | ||
else { | ||
allChildrenCount++; | ||
} | ||
}); | ||
rowNode.setAllChildrenCount(allChildrenCount); | ||
}; | ||
FilterService.prototype.setAllChildrenCount = function (rowNode) { | ||
if (this.doingTreeData) { | ||
this.setAllChildrenCountTreeData(rowNode); | ||
} | ||
else { | ||
this.setAllChildrenCountGridGrouping(rowNode); | ||
} | ||
}; | ||
FilterService.prototype.doingTreeDataFiltering = function () { | ||
@@ -138,5 +101,2 @@ return this.gridOptionsWrapper.isTreeData() && !this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering(); | ||
], FilterService.prototype, "filterManager", void 0); | ||
__decorate([ | ||
PostConstruct | ||
], FilterService.prototype, "postConstruct", null); | ||
FilterService = __decorate([ | ||
@@ -143,0 +103,0 @@ Bean("filterService") |
@@ -75,3 +75,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var neverAllowToExpand = skipLeafNodes && rowNode.leafGroup; | ||
var isHiddenOpenParent = hideOpenParents && rowNode.expanded && (!neverAllowToExpand); | ||
var isHiddenOpenParent = hideOpenParents && rowNode.expanded && !rowNode.master && (!neverAllowToExpand); | ||
var thisRowShouldBeRendered = !isSkippedLeafNode && !isHiddenOpenParent && | ||
@@ -78,0 +78,0 @@ !isRemovedSingleChildrenGroup && !isRemovedLowestSingleChildrenGroup; |
@@ -1,2 +0,2 @@ | ||
import { SortOption, ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
import { SortOption, ChangedPath, BeanStub, RowNodeTransaction } from "@ag-grid-community/core"; | ||
export declare class SortService extends BeanStub { | ||
@@ -7,6 +7,4 @@ private columnModel; | ||
init(): void; | ||
sort(sortOptions: SortOption[], sortActive: boolean, deltaSort: boolean, dirtyLeafNodes: { | ||
[nodeId: string]: boolean; | ||
} | null, changedPath: ChangedPath | undefined, noAggregations: boolean, sortContainsGroupColumns: boolean): void; | ||
private mapNodeToSortedNode; | ||
sort(sortOptions: SortOption[], sortActive: boolean, useDeltaSort: boolean, rowNodeTransactions: RowNodeTransaction[] | null | undefined, changedPath: ChangedPath | undefined, sortContainsGroupColumns: boolean): void; | ||
private calculateDirtyNodes; | ||
private doDeltaSort; | ||
@@ -13,0 +11,0 @@ private mergeSortedArrays; |
@@ -29,9 +29,16 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
SortService.prototype.sort = function (sortOptions, sortActive, deltaSort, dirtyLeafNodes, changedPath, noAggregations, sortContainsGroupColumns) { | ||
SortService.prototype.sort = function (sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) { | ||
var _this = this; | ||
var groupMaintainOrder = this.gridOptionsWrapper.isGroupMaintainOrder(); | ||
var groupColumnsPresent = this.columnModel.getAllGridColumns().some(function (c) { return c.isRowGroupActive(); }); | ||
var allDirtyNodes = {}; | ||
if (useDeltaSort && rowNodeTransactions) { | ||
allDirtyNodes = this.calculateDirtyNodes(rowNodeTransactions); | ||
} | ||
var isPivotMode = this.columnModel.isPivotMode(); | ||
var callback = function (rowNode) { | ||
// we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
_this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterAggFilter, true); | ||
// It's pointless to sort rows which aren't being displayed. in pivot mode we don't need to sort the leaf group children. | ||
var skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup; | ||
// Javascript sort is non deterministic when all the array items are equals, ie Comparator always returns 0, | ||
@@ -41,3 +48,3 @@ // so to ensure the array keeps its order, add an additional sorting condition manually, in this case we | ||
var skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns; | ||
if (!sortActive || skipSortingGroups) { | ||
if (!sortActive || skipSortingGroups || skipSortingPivotLeafs) { | ||
// when 'groupMaintainOrder' is enabled we skip sorting groups unless we are sorting on group columns | ||
@@ -54,6 +61,7 @@ var childrenToBeSorted = rowNode.childrenAfterAggFilter.slice(0); | ||
} | ||
else if (useDeltaSort) { | ||
rowNode.childrenAfterSort = _this.doDeltaSort(rowNode, allDirtyNodes, changedPath, sortOptions); | ||
} | ||
else { | ||
rowNode.childrenAfterSort = deltaSort ? | ||
_this.doDeltaSort(rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) | ||
: _this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); | ||
rowNode.childrenAfterSort = _this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); | ||
} | ||
@@ -74,48 +82,45 @@ if (rowNode.sibling) { | ||
}; | ||
SortService.prototype.mapNodeToSortedNode = function (rowNode, pos) { | ||
return { currentPos: pos, rowNode: rowNode }; | ||
SortService.prototype.calculateDirtyNodes = function (rowNodeTransactions) { | ||
var dirtyNodes = {}; | ||
var addNodesFunc = function (rowNodes) { | ||
if (rowNodes) { | ||
rowNodes.forEach(function (rowNode) { return dirtyNodes[rowNode.id] = true; }); | ||
} | ||
}; | ||
// all leaf level nodes in the transaction were impacted | ||
if (rowNodeTransactions) { | ||
rowNodeTransactions.forEach(function (tran) { | ||
addNodesFunc(tran.add); | ||
addNodesFunc(tran.update); | ||
addNodesFunc(tran.remove); | ||
}); | ||
} | ||
return dirtyNodes; | ||
}; | ||
SortService.prototype.doDeltaSort = function (rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) { | ||
// clean nodes will be a list of all row nodes that remain in the set | ||
// and ordered. we start with the old sorted set and take out any nodes | ||
// that were removed or changed (but not added, added doesn't make sense, | ||
// if a node was added, there is no way it could be here from last time). | ||
var cleanNodes = rowNode.childrenAfterSort | ||
.filter(function (node) { | ||
// take out all nodes that were changed as part of the current transaction. | ||
// a changed node could a) be in a different sort position or b) may | ||
// no longer be in this set as the changed node may not pass filtering, | ||
// or be in a different group. | ||
var passesDirtyNodesCheck = !dirtyLeafNodes[node.id]; | ||
// also remove group nodes in the changed path, as they can have different aggregate | ||
// values which could impact the sort order. | ||
// note: changed path is not active if a) no value columns or b) no transactions. it is never | ||
// (b) in deltaSort as we only do deltaSort for transactions. for (a) if no value columns, then | ||
// there is no value in the group that could of changed (ie no aggregate values) | ||
var passesChangedPathCheck = noAggregations || (changedPath && changedPath.canSkip(node)); | ||
return passesDirtyNodesCheck && passesChangedPathCheck; | ||
}) | ||
.map(this.mapNodeToSortedNode.bind(this)); | ||
// for fast access below, we map them | ||
var cleanNodesMapped = {}; | ||
cleanNodes.forEach(function (sortedRowNode) { return cleanNodesMapped[sortedRowNode.rowNode.id] = sortedRowNode.rowNode; }); | ||
// these are all nodes that need to be placed | ||
var changedNodes = rowNode.childrenAfterAggFilter | ||
// ignore nodes in the clean list | ||
.filter(function (node) { return !cleanNodesMapped[node.id]; }) | ||
.map(this.mapNodeToSortedNode.bind(this)); | ||
// sort changed nodes. note that we don't need to sort cleanNodes as they are | ||
// already sorted from last time. | ||
changedNodes.sort(this.rowNodeSorter.compareRowNodes.bind(this, sortOptions)); | ||
var result; | ||
if (changedNodes.length === 0) { | ||
result = cleanNodes; | ||
SortService.prototype.doDeltaSort = function (rowNode, allTouchedNodes, changedPath, sortOptions) { | ||
var _this = this; | ||
var unsortedRows = rowNode.childrenAfterAggFilter; | ||
var oldSortedRows = rowNode.childrenAfterSort; | ||
if (!oldSortedRows) { | ||
return this.rowNodeSorter.doFullSort(unsortedRows, sortOptions); | ||
} | ||
else if (cleanNodes.length === 0) { | ||
result = changedNodes; | ||
} | ||
else { | ||
result = this.mergeSortedArrays(sortOptions, cleanNodes, changedNodes); | ||
} | ||
return result.map(function (item) { return item.rowNode; }); | ||
var untouchedRowsMap = {}; | ||
var touchedRows = []; | ||
unsortedRows.forEach(function (row) { | ||
if (allTouchedNodes[row.id] || !changedPath.canSkip(row)) { | ||
touchedRows.push(row); | ||
} | ||
else { | ||
untouchedRowsMap[row.id] = true; | ||
} | ||
}); | ||
var sortedUntouchedRows = oldSortedRows.filter(function (child) { return untouchedRowsMap[child.id]; }); | ||
var mapNodeToSortedNode = function (rowNode, pos) { return ({ currentPos: pos, rowNode: rowNode }); }; | ||
var sortedChangedRows = touchedRows | ||
.map(mapNodeToSortedNode) | ||
.sort(function (a, b) { return _this.rowNodeSorter.compareRowNodes(sortOptions, a, b); }); | ||
return this.mergeSortedArrays(sortOptions, sortedChangedRows, sortedUntouchedRows.map(mapNodeToSortedNode)).map(function (_a) { | ||
var rowNode = _a.rowNode; | ||
return rowNode; | ||
}); | ||
}; | ||
@@ -122,0 +127,0 @@ // Merge two sorted arrays into each other |
@@ -7,3 +7,2 @@ import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
execute(params: StageExecuteParams): void; | ||
private calculateDirtyNodes; | ||
} |
@@ -36,25 +36,5 @@ var __extends = (this && this.__extends) || (function () { | ||
&& this.gridOptionsWrapper.isDeltaSort(); | ||
// we only need dirty nodes if doing delta sort | ||
var dirtyLeafNodes = deltaSort ? this.calculateDirtyNodes(params.rowNodeTransactions) : null; | ||
var noAggregations = _.missingOrEmpty(this.columnModel.getValueColumns()); | ||
var sortContainsGroupColumns = sortOptions.some(function (opt) { return !!opt.column.getColDef().showRowGroup; }); | ||
this.sortService.sort(sortOptions, sortActive, deltaSort, dirtyLeafNodes, params.changedPath, noAggregations, sortContainsGroupColumns); | ||
this.sortService.sort(sortOptions, sortActive, deltaSort, params.rowNodeTransactions, params.changedPath, sortContainsGroupColumns); | ||
}; | ||
SortStage.prototype.calculateDirtyNodes = function (rowNodeTransactions) { | ||
var dirtyNodes = {}; | ||
var addNodesFunc = function (rowNodes) { | ||
if (rowNodes) { | ||
rowNodes.forEach(function (rowNode) { return dirtyNodes[rowNode.id] = true; }); | ||
} | ||
}; | ||
// all leaf level nodes in the transaction were impacted | ||
if (rowNodeTransactions) { | ||
rowNodeTransactions.forEach(function (tran) { | ||
addNodesFunc(tran.add); | ||
addNodesFunc(tran.update); | ||
addNodesFunc(tran.remove); | ||
}); | ||
} | ||
return dirtyNodes; | ||
}; | ||
__decorate([ | ||
@@ -61,0 +41,0 @@ Autowired('sortService') |
import { ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
export declare class FilterService extends BeanStub { | ||
private filterManager; | ||
private doingTreeData; | ||
private postConstruct; | ||
filter(changedPath: ChangedPath): void; | ||
private filterNodes; | ||
private setAllChildrenCountTreeData; | ||
private setAllChildrenCountGridGrouping; | ||
private setAllChildrenCount; | ||
private doingTreeDataFiltering; | ||
} |
@@ -7,7 +7,4 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
import { Autowired, Bean, PostConstruct, BeanStub } from "@ag-grid-community/core"; | ||
import { Autowired, Bean, BeanStub } from "@ag-grid-community/core"; | ||
let FilterService = class FilterService extends BeanStub { | ||
postConstruct() { | ||
this.doingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
} | ||
filter(changedPath) { | ||
@@ -41,7 +38,5 @@ const filterActive = this.filterManager.isColumnFilterPresent() | ||
} | ||
this.setAllChildrenCount(rowNode); | ||
} | ||
else { | ||
rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; | ||
rowNode.setAllChildrenCount(null); | ||
} | ||
@@ -80,34 +75,2 @@ if (rowNode.sibling) { | ||
} | ||
setAllChildrenCountTreeData(rowNode) { | ||
// for tree data, we include all children, groups and leafs | ||
let allChildrenCount = 0; | ||
rowNode.childrenAfterFilter.forEach((child) => { | ||
// include child itself | ||
allChildrenCount++; | ||
// include children of children | ||
allChildrenCount += child.allChildrenCount; | ||
}); | ||
rowNode.setAllChildrenCount(allChildrenCount); | ||
} | ||
setAllChildrenCountGridGrouping(rowNode) { | ||
// for grid data, we only count the leafs | ||
let allChildrenCount = 0; | ||
rowNode.childrenAfterFilter.forEach((child) => { | ||
if (child.group) { | ||
allChildrenCount += child.allChildrenCount; | ||
} | ||
else { | ||
allChildrenCount++; | ||
} | ||
}); | ||
rowNode.setAllChildrenCount(allChildrenCount); | ||
} | ||
setAllChildrenCount(rowNode) { | ||
if (this.doingTreeData) { | ||
this.setAllChildrenCountTreeData(rowNode); | ||
} | ||
else { | ||
this.setAllChildrenCountGridGrouping(rowNode); | ||
} | ||
} | ||
doingTreeDataFiltering() { | ||
@@ -120,5 +83,2 @@ return this.gridOptionsWrapper.isTreeData() && !this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering(); | ||
], FilterService.prototype, "filterManager", void 0); | ||
__decorate([ | ||
PostConstruct | ||
], FilterService.prototype, "postConstruct", null); | ||
FilterService = __decorate([ | ||
@@ -125,0 +85,0 @@ Bean("filterService") |
@@ -58,3 +58,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
const neverAllowToExpand = skipLeafNodes && rowNode.leafGroup; | ||
const isHiddenOpenParent = hideOpenParents && rowNode.expanded && (!neverAllowToExpand); | ||
const isHiddenOpenParent = hideOpenParents && rowNode.expanded && !rowNode.master && (!neverAllowToExpand); | ||
const thisRowShouldBeRendered = !isSkippedLeafNode && !isHiddenOpenParent && | ||
@@ -61,0 +61,0 @@ !isRemovedSingleChildrenGroup && !isRemovedLowestSingleChildrenGroup; |
@@ -1,2 +0,2 @@ | ||
import { SortOption, ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
import { SortOption, ChangedPath, BeanStub, RowNodeTransaction } from "@ag-grid-community/core"; | ||
export declare class SortService extends BeanStub { | ||
@@ -7,6 +7,4 @@ private columnModel; | ||
init(): void; | ||
sort(sortOptions: SortOption[], sortActive: boolean, deltaSort: boolean, dirtyLeafNodes: { | ||
[nodeId: string]: boolean; | ||
} | null, changedPath: ChangedPath | undefined, noAggregations: boolean, sortContainsGroupColumns: boolean): void; | ||
private mapNodeToSortedNode; | ||
sort(sortOptions: SortOption[], sortActive: boolean, useDeltaSort: boolean, rowNodeTransactions: RowNodeTransaction[] | null | undefined, changedPath: ChangedPath | undefined, sortContainsGroupColumns: boolean): void; | ||
private calculateDirtyNodes; | ||
private doDeltaSort; | ||
@@ -13,0 +11,0 @@ private mergeSortedArrays; |
@@ -12,8 +12,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
} | ||
sort(sortOptions, sortActive, deltaSort, dirtyLeafNodes, changedPath, noAggregations, sortContainsGroupColumns) { | ||
sort(sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) { | ||
const groupMaintainOrder = this.gridOptionsWrapper.isGroupMaintainOrder(); | ||
const groupColumnsPresent = this.columnModel.getAllGridColumns().some(c => c.isRowGroupActive()); | ||
let allDirtyNodes = {}; | ||
if (useDeltaSort && rowNodeTransactions) { | ||
allDirtyNodes = this.calculateDirtyNodes(rowNodeTransactions); | ||
} | ||
const isPivotMode = this.columnModel.isPivotMode(); | ||
const callback = (rowNode) => { | ||
// we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterAggFilter, true); | ||
// It's pointless to sort rows which aren't being displayed. in pivot mode we don't need to sort the leaf group children. | ||
const skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup; | ||
// Javascript sort is non deterministic when all the array items are equals, ie Comparator always returns 0, | ||
@@ -23,3 +30,3 @@ // so to ensure the array keeps its order, add an additional sorting condition manually, in this case we | ||
let skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns; | ||
if (!sortActive || skipSortingGroups) { | ||
if (!sortActive || skipSortingGroups || skipSortingPivotLeafs) { | ||
// when 'groupMaintainOrder' is enabled we skip sorting groups unless we are sorting on group columns | ||
@@ -36,6 +43,7 @@ const childrenToBeSorted = rowNode.childrenAfterAggFilter.slice(0); | ||
} | ||
else if (useDeltaSort) { | ||
rowNode.childrenAfterSort = this.doDeltaSort(rowNode, allDirtyNodes, changedPath, sortOptions); | ||
} | ||
else { | ||
rowNode.childrenAfterSort = deltaSort ? | ||
this.doDeltaSort(rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) | ||
: this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); | ||
rowNode.childrenAfterSort = this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); | ||
} | ||
@@ -56,48 +64,41 @@ if (rowNode.sibling) { | ||
} | ||
mapNodeToSortedNode(rowNode, pos) { | ||
return { currentPos: pos, rowNode: rowNode }; | ||
calculateDirtyNodes(rowNodeTransactions) { | ||
const dirtyNodes = {}; | ||
const addNodesFunc = (rowNodes) => { | ||
if (rowNodes) { | ||
rowNodes.forEach(rowNode => dirtyNodes[rowNode.id] = true); | ||
} | ||
}; | ||
// all leaf level nodes in the transaction were impacted | ||
if (rowNodeTransactions) { | ||
rowNodeTransactions.forEach(tran => { | ||
addNodesFunc(tran.add); | ||
addNodesFunc(tran.update); | ||
addNodesFunc(tran.remove); | ||
}); | ||
} | ||
return dirtyNodes; | ||
} | ||
doDeltaSort(rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) { | ||
// clean nodes will be a list of all row nodes that remain in the set | ||
// and ordered. we start with the old sorted set and take out any nodes | ||
// that were removed or changed (but not added, added doesn't make sense, | ||
// if a node was added, there is no way it could be here from last time). | ||
const cleanNodes = rowNode.childrenAfterSort | ||
.filter(node => { | ||
// take out all nodes that were changed as part of the current transaction. | ||
// a changed node could a) be in a different sort position or b) may | ||
// no longer be in this set as the changed node may not pass filtering, | ||
// or be in a different group. | ||
const passesDirtyNodesCheck = !dirtyLeafNodes[node.id]; | ||
// also remove group nodes in the changed path, as they can have different aggregate | ||
// values which could impact the sort order. | ||
// note: changed path is not active if a) no value columns or b) no transactions. it is never | ||
// (b) in deltaSort as we only do deltaSort for transactions. for (a) if no value columns, then | ||
// there is no value in the group that could of changed (ie no aggregate values) | ||
const passesChangedPathCheck = noAggregations || (changedPath && changedPath.canSkip(node)); | ||
return passesDirtyNodesCheck && passesChangedPathCheck; | ||
}) | ||
.map(this.mapNodeToSortedNode.bind(this)); | ||
// for fast access below, we map them | ||
const cleanNodesMapped = {}; | ||
cleanNodes.forEach(sortedRowNode => cleanNodesMapped[sortedRowNode.rowNode.id] = sortedRowNode.rowNode); | ||
// these are all nodes that need to be placed | ||
const changedNodes = rowNode.childrenAfterAggFilter | ||
// ignore nodes in the clean list | ||
.filter(node => !cleanNodesMapped[node.id]) | ||
.map(this.mapNodeToSortedNode.bind(this)); | ||
// sort changed nodes. note that we don't need to sort cleanNodes as they are | ||
// already sorted from last time. | ||
changedNodes.sort(this.rowNodeSorter.compareRowNodes.bind(this, sortOptions)); | ||
let result; | ||
if (changedNodes.length === 0) { | ||
result = cleanNodes; | ||
doDeltaSort(rowNode, allTouchedNodes, changedPath, sortOptions) { | ||
const unsortedRows = rowNode.childrenAfterAggFilter; | ||
const oldSortedRows = rowNode.childrenAfterSort; | ||
if (!oldSortedRows) { | ||
return this.rowNodeSorter.doFullSort(unsortedRows, sortOptions); | ||
} | ||
else if (cleanNodes.length === 0) { | ||
result = changedNodes; | ||
} | ||
else { | ||
result = this.mergeSortedArrays(sortOptions, cleanNodes, changedNodes); | ||
} | ||
return result.map(item => item.rowNode); | ||
const untouchedRowsMap = {}; | ||
const touchedRows = []; | ||
unsortedRows.forEach(row => { | ||
if (allTouchedNodes[row.id] || !changedPath.canSkip(row)) { | ||
touchedRows.push(row); | ||
} | ||
else { | ||
untouchedRowsMap[row.id] = true; | ||
} | ||
}); | ||
const sortedUntouchedRows = oldSortedRows.filter(child => untouchedRowsMap[child.id]); | ||
const mapNodeToSortedNode = (rowNode, pos) => ({ currentPos: pos, rowNode: rowNode }); | ||
const sortedChangedRows = touchedRows | ||
.map(mapNodeToSortedNode) | ||
.sort((a, b) => this.rowNodeSorter.compareRowNodes(sortOptions, a, b)); | ||
return this.mergeSortedArrays(sortOptions, sortedChangedRows, sortedUntouchedRows.map(mapNodeToSortedNode)).map(({ rowNode }) => rowNode); | ||
} | ||
@@ -104,0 +105,0 @@ // Merge two sorted arrays into each other |
@@ -7,3 +7,2 @@ import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
execute(params: StageExecuteParams): void; | ||
private calculateDirtyNodes; | ||
} |
@@ -19,25 +19,5 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
&& this.gridOptionsWrapper.isDeltaSort(); | ||
// we only need dirty nodes if doing delta sort | ||
const dirtyLeafNodes = deltaSort ? this.calculateDirtyNodes(params.rowNodeTransactions) : null; | ||
const noAggregations = _.missingOrEmpty(this.columnModel.getValueColumns()); | ||
const sortContainsGroupColumns = sortOptions.some(opt => !!opt.column.getColDef().showRowGroup); | ||
this.sortService.sort(sortOptions, sortActive, deltaSort, dirtyLeafNodes, params.changedPath, noAggregations, sortContainsGroupColumns); | ||
this.sortService.sort(sortOptions, sortActive, deltaSort, params.rowNodeTransactions, params.changedPath, sortContainsGroupColumns); | ||
} | ||
calculateDirtyNodes(rowNodeTransactions) { | ||
const dirtyNodes = {}; | ||
const addNodesFunc = (rowNodes) => { | ||
if (rowNodes) { | ||
rowNodes.forEach(rowNode => dirtyNodes[rowNode.id] = true); | ||
} | ||
}; | ||
// all leaf level nodes in the transaction were impacted | ||
if (rowNodeTransactions) { | ||
rowNodeTransactions.forEach(tran => { | ||
addNodesFunc(tran.add); | ||
addNodesFunc(tran.update); | ||
addNodesFunc(tran.remove); | ||
}); | ||
} | ||
return dirtyNodes; | ||
} | ||
}; | ||
@@ -44,0 +24,0 @@ __decorate([ |
{ | ||
"name": "@ag-grid-community/client-side-row-model", | ||
"version": "27.2.1", | ||
"version": "27.3.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -12,4 +12,7 @@ "main": "./dist/cjs/es5/main.js", | ||
"build-esm": "npx tsc -p tsconfig.esm.es5.json && npx tsc -p tsconfig.esm.es6.json", | ||
"build-cjs-prod": "npx tsc -p tsconfig.cjs.es5.json --sourceMap false && npx tsc -p tsconfig.cjs.es6.json --sourceMap false", | ||
"build-esm-prod": "npx tsc -p tsconfig.esm.es5.json --sourceMap false && npx tsc -p tsconfig.esm.es6.json --sourceMap false", | ||
"package": "node ../../module-build/rollup/build.js", | ||
"build": "npm run build-cjs && npm run build-esm && npm run hash", | ||
"build-prod": "npm run build-cjs-prod && npm run build-esm-prod && npm run hash", | ||
"hash": "sh ../../scripts/hashDirectory.sh > .hash" | ||
@@ -46,5 +49,5 @@ }, | ||
], | ||
"homepage": "http://www.ag-grid.com/", | ||
"homepage": "https://www.ag-grid.com/", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~27.2.0" | ||
"@ag-grid-community/core": "~27.3.0" | ||
}, | ||
@@ -58,2 +61,2 @@ "devDependencies": { | ||
} | ||
} | ||
} |
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 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 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 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 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
1244810
11963
+ Added@ag-grid-community/core@27.3.0(transitive)
- Removed@ag-grid-community/core@27.2.1(transitive)