@ag-grid-community/client-side-row-model
Advanced tools
Comparing version 30.2.1 to 31.0.0
@@ -12,8 +12,5 @@ import { Beans, ColumnModel, EventService, RowDataTransaction, RowNode, RowNodeTransaction, GridOptionsService, ISelectionService } from "@ag-grid-community/core"; | ||
private static ROOT_NODE_ID; | ||
private isRowMasterFunc?; | ||
private suppressParentsInRowNodes; | ||
private doingMasterDetail; | ||
private allNodesMap; | ||
private dataLoaded; | ||
constructor(rootNode: RowNode, gridOptionsService: GridOptionsService, eventService: EventService, columnModel: ColumnModel, selectionService: ISelectionService, beans: Beans); | ||
postConstruct(): void; | ||
getCopyOfNodesMap(): { | ||
@@ -27,2 +24,3 @@ [id: string]: RowNode; | ||
} | null | undefined): RowNodeTransaction; | ||
hasData(): boolean; | ||
private dispatchRowDataUpdateStartedEvent; | ||
@@ -29,0 +27,0 @@ private updateSelection; |
@@ -18,6 +18,10 @@ "use strict"; | ||
}; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
@@ -32,2 +36,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
this.allNodesMap = {}; | ||
this.dataLoaded = false; | ||
this.rootNode = rootNode; | ||
@@ -47,12 +52,3 @@ this.gridOptionsService = gridOptionsService; | ||
this.rootNode.childrenAfterFilter = []; | ||
// if we make this class a bean, then can annotate postConstruct | ||
this.postConstruct(); | ||
} | ||
// @PostConstruct - this is not a bean, so postConstruct called by constructor | ||
ClientSideNodeManager.prototype.postConstruct = function () { | ||
// func below doesn't have 'this' pointer, so need to pull out these bits | ||
this.suppressParentsInRowNodes = this.gridOptionsService.is('suppressParentsInRowNodes'); | ||
this.isRowMasterFunc = this.gridOptionsService.get('isRowMaster'); | ||
this.doingMasterDetail = this.gridOptionsService.is('masterDetail'); | ||
}; | ||
ClientSideNodeManager.prototype.getCopyOfNodesMap = function () { | ||
@@ -70,2 +66,3 @@ return core_1._.cloneObject(this.allNodesMap); | ||
} | ||
this.dataLoaded = true; | ||
this.dispatchRowDataUpdateStartedEvent(rowData); | ||
@@ -102,2 +99,3 @@ var rootNode = this.rootNode; | ||
ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) { | ||
this.dataLoaded = true; | ||
this.dispatchRowDataUpdateStartedEvent(rowDataTran.add); | ||
@@ -119,2 +117,5 @@ var rowNodeTransaction = { | ||
}; | ||
ClientSideNodeManager.prototype.hasData = function () { | ||
return this.dataLoaded; | ||
}; | ||
ClientSideNodeManager.prototype.dispatchRowDataUpdateStartedEvent = function (rowData) { | ||
@@ -165,3 +166,3 @@ var event = { | ||
var normalisedAddIndex = addIndex; | ||
var isTreeData = this.gridOptionsService.is('treeData'); | ||
var isTreeData = this.gridOptionsService.get('treeData'); | ||
if (isTreeData && addIndex > 0 && len > 0) { | ||
@@ -177,6 +178,6 @@ for (var i = 0; i < len; i++) { | ||
var nodesAfterIndex = allLeafChildren.slice(normalisedAddIndex, allLeafChildren.length); | ||
this.rootNode.allLeafChildren = __spreadArray(__spreadArray(__spreadArray([], __read(nodesBeforeIndex)), __read(newNodes)), __read(nodesAfterIndex)); | ||
this.rootNode.allLeafChildren = __spreadArray(__spreadArray(__spreadArray([], __read(nodesBeforeIndex), false), __read(newNodes), false), __read(nodesAfterIndex), false); | ||
} | ||
else { | ||
this.rootNode.allLeafChildren = __spreadArray(__spreadArray([], __read(this.rootNode.allLeafChildren)), __read(newNodes)); | ||
this.rootNode.allLeafChildren = __spreadArray(__spreadArray([], __read(this.rootNode.allLeafChildren), false), __read(newNodes), false); | ||
} | ||
@@ -247,3 +248,3 @@ if (this.rootNode.sibling) { | ||
if (!rowNode) { | ||
console.error("AG Grid: could not find row id=" + id + ", data item was not found for this id"); | ||
console.error("AG Grid: could not find row id=".concat(id, ", data item was not found for this id")); | ||
return null; | ||
@@ -267,3 +268,4 @@ } | ||
this.setMasterForRow(node, dataItem, level, true); | ||
if (parent && !this.suppressParentsInRowNodes) { | ||
var suppressParentsInRowNodes = this.gridOptionsService.get('suppressParentsInRowNodes'); | ||
if (parent && !suppressParentsInRowNodes) { | ||
node.parent = parent; | ||
@@ -274,3 +276,3 @@ } | ||
if (this.allNodesMap[node.id]) { | ||
console.warn("AG Grid: duplicate node id '" + node.id + "' detected from getRowId callback, this could cause issues in your grid."); | ||
console.warn("AG Grid: duplicate node id '".concat(node.id, "' detected from getRowId callback, this could cause issues in your grid.")); | ||
} | ||
@@ -282,3 +284,3 @@ this.allNodesMap[node.id] = node; | ||
ClientSideNodeManager.prototype.setMasterForRow = function (rowNode, data, level, setExpanded) { | ||
var isTreeData = this.gridOptionsService.is('treeData'); | ||
var isTreeData = this.gridOptionsService.get('treeData'); | ||
if (isTreeData) { | ||
@@ -291,8 +293,10 @@ rowNode.setMaster(false); | ||
else { | ||
var masterDetail = this.gridOptionsService.get('masterDetail'); | ||
// this is the default, for when doing grid data | ||
if (this.doingMasterDetail) { | ||
if (masterDetail) { | ||
// if we are doing master detail, then the | ||
// default is that everything can be a Master Row. | ||
if (this.isRowMasterFunc) { | ||
rowNode.setMaster(this.isRowMasterFunc(data)); | ||
var isRowMasterFunc = this.gridOptionsService.get('isRowMaster'); | ||
if (isRowMasterFunc) { | ||
rowNode.setMaster(isRowMasterFunc(data)); | ||
} | ||
@@ -316,3 +320,3 @@ else { | ||
ClientSideNodeManager.prototype.isExpanded = function (level) { | ||
var expandByDefault = this.gridOptionsService.getNum('groupDefaultExpanded'); | ||
var expandByDefault = this.gridOptionsService.get('groupDefaultExpanded'); | ||
if (expandByDefault === -1) { | ||
@@ -319,0 +323,0 @@ return true; |
@@ -29,4 +29,10 @@ import { BeanStub, ChangedPath, IClientSideRowModel, RefreshModelParams, ClientSideRowModelStep, RowBounds, RowDataTransaction, RowNode, RowHighlightPosition, RowNodeTransaction, RowModelType } from "@ag-grid-community/core"; | ||
private applyAsyncTransactionsTimeout; | ||
/** Has the start method been called */ | ||
private hasStarted; | ||
/** E.g. data has been set into the node manager already */ | ||
private shouldSkipSettingDataOnStart; | ||
init(): void; | ||
private addPropertyListeners; | ||
start(): void; | ||
private setInitialData; | ||
ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean; | ||
@@ -74,6 +80,4 @@ private setRowTopAndRowIndex; | ||
private doRowGrouping; | ||
private restoreGroupState; | ||
private doFilter; | ||
private doPivot; | ||
private getGroupState; | ||
getCopyOfNodesMap(): { | ||
@@ -84,2 +88,3 @@ [id: string]: RowNode; | ||
setRowData(rowData: any[]): void; | ||
private dispatchUpdateEventsAndRefresh; | ||
batchUpdateRowData(rowDataTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void; | ||
@@ -105,2 +110,4 @@ flushAsyncTransactions(): void; | ||
private onGridStylesChanges; | ||
private onGridReady; | ||
isRowDataLoaded(): boolean; | ||
} |
@@ -39,6 +39,10 @@ "use strict"; | ||
}; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
@@ -62,2 +66,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
_this.rowsToDisplay = []; // the rows mapped to rows to display | ||
/** Has the start method been called */ | ||
_this.hasStarted = false; | ||
/** E.g. data has been set into the node manager already */ | ||
_this.shouldSkipSettingDataOnStart = false; | ||
return _this; | ||
@@ -68,3 +76,3 @@ } | ||
var refreshEverythingFunc = this.refreshModel.bind(this, { step: core_1.ClientSideRowModelSteps.EVERYTHING }); | ||
var animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
var animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { | ||
@@ -84,29 +92,118 @@ step: core_1.ClientSideRowModelSteps.EVERYTHING, | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_GRID_STYLES_CHANGED, this.onGridStylesChanges.bind(this)); | ||
var refreshMapListener = this.refreshModel.bind(this, { | ||
step: core_1.ClientSideRowModelSteps.MAP, | ||
keepRenderedRows: true, | ||
animate: animate | ||
}); | ||
this.addManagedPropertyListeners([ | ||
'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', | ||
'groupIncludeFooter', | ||
], refreshMapListener); | ||
var refreshAggListener = this.refreshModel.bind(this, { | ||
step: core_1.ClientSideRowModelSteps.AGGREGATE, | ||
keepRenderedRows: true, | ||
animate: animate | ||
}); | ||
this.addManagedPropertyListeners([ | ||
'groupIncludeTotalFooter', | ||
], refreshAggListener); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_GRID_READY, function () { return _this.onGridReady(); }); | ||
// doesn't need done if doing full reset | ||
// Property listeners which call `refreshModel` at different stages | ||
this.addPropertyListeners(); | ||
this.rootNode = new core_1.RowNode(this.beans); | ||
this.nodeManager = new clientSideNodeManager_1.ClientSideNodeManager(this.rootNode, this.gridOptionsService, this.eventService, this.columnModel, this.selectionService, this.beans); | ||
this.addManagedPropertyListener('treeData', function () { | ||
// Shotgun reset all node state. This is used by treeData reactivity to ensure nodes don't include any group state | ||
_this.setRowData(_this.rootNode.allLeafChildren.map(function (child) { return child.data; })); | ||
}; | ||
ClientSideRowModel.prototype.addPropertyListeners = function () { | ||
// Omitted Properties | ||
// | ||
// We do not act reactively on all functional properties, as it's possible the application is React and | ||
// has not memoised the property and it's getting set every render. | ||
// | ||
// ** LIST OF NON REACTIVE, NO ARGUMENT | ||
// | ||
// getDataPath, getRowId, isRowMaster -- these are called once for each Node when the Node is created. | ||
// -- these are immutable Node properties (ie a Node ID cannot be changed) | ||
// | ||
// getRowHeight - this is called once when Node is created, if a new getRowHeight function is provided, | ||
// - we do not revisit the heights of each node. | ||
// | ||
// pivotDefaultExpanded - relevant for initial pivot column creation, no impact on existing pivot columns. | ||
// | ||
// deltaSort - this changes the type of algorithm used only, it doesn't change the sort order. so no point | ||
// - in doing the sort again as the same result will be got. the new Prop will be used next time we sort. | ||
// | ||
// ** LIST OF NON REACTIVE, SOME ARGUMENT | ||
// ** For these, they could be reactive, but not convinced the business argument is strong enough, | ||
// ** so leaving as non-reactive for now, and see if anyone complains. | ||
// | ||
// processPivotResultColDef, processPivotResultColGroupDef | ||
// - there is an argument for having these reactive, that if the application changes | ||
// - these props, we should re-create the Pivot Columns, however it's highly unlikely | ||
// - the application would change these functions, far more likely the functions were | ||
// - non memoised correctly. | ||
var _this = this; | ||
var resetProps = new Set([ | ||
'treeData', 'masterDetail', | ||
]); | ||
var groupStageRefreshProps = new Set([ | ||
'suppressParentsInRowNodes', 'groupDefaultExpanded', | ||
'groupAllowUnbalanced', 'initialGroupOrderComparator', | ||
'groupHideOpenParents', 'groupDisplayType', | ||
]); | ||
var filterStageRefreshProps = new Set([ | ||
'excludeChildrenWhenTreeDataFiltering', | ||
]); | ||
var pivotStageRefreshProps = new Set([ | ||
'removePivotHeaderRowWhenSingleValueColumn', 'pivotRowTotals', 'pivotColumnGroupTotals', 'suppressExpandablePivotGroups', | ||
]); | ||
var aggregateStageRefreshProps = new Set([ | ||
'getGroupRowAgg', 'alwaysAggregateAtRootLevel', 'groupIncludeTotalFooter', 'suppressAggFilteredOnly', | ||
]); | ||
var sortStageRefreshProps = new Set([ | ||
'postSortRows', 'groupDisplayType', 'accentedSort', | ||
]); | ||
var filterAggStageRefreshProps = new Set([]); | ||
var flattenStageRefreshProps = new Set([ | ||
'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', 'groupIncludeFooter', | ||
]); | ||
var allProps = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(resetProps), false), __read(groupStageRefreshProps), false), __read(filterStageRefreshProps), false), __read(pivotStageRefreshProps), false), __read(pivotStageRefreshProps), false), __read(aggregateStageRefreshProps), false), __read(sortStageRefreshProps), false), __read(filterAggStageRefreshProps), false), __read(flattenStageRefreshProps), false); | ||
this.addManagedPropertyListeners(allProps, function (params) { | ||
var _a; | ||
var properties = (_a = params.changeSet) === null || _a === void 0 ? void 0 : _a.properties; | ||
if (!properties) { | ||
return; | ||
} | ||
; | ||
var arePropertiesImpacted = function (propSet) { return (properties.some(function (prop) { return propSet.has(prop); })); }; | ||
if (arePropertiesImpacted(resetProps)) { | ||
_this.setRowData(_this.rootNode.allLeafChildren.map(function (child) { return child.data; })); | ||
return; | ||
} | ||
if (arePropertiesImpacted(groupStageRefreshProps)) { | ||
_this.refreshModel({ step: core_1.ClientSideRowModelSteps.EVERYTHING }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(filterStageRefreshProps)) { | ||
_this.refreshModel({ step: core_1.ClientSideRowModelSteps.FILTER }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(pivotStageRefreshProps)) { | ||
_this.refreshModel({ step: core_1.ClientSideRowModelSteps.PIVOT }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(aggregateStageRefreshProps)) { | ||
_this.refreshModel({ step: core_1.ClientSideRowModelSteps.AGGREGATE }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(sortStageRefreshProps)) { | ||
_this.refreshModel({ step: core_1.ClientSideRowModelSteps.SORT }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(filterAggStageRefreshProps)) { | ||
_this.refreshModel({ step: core_1.ClientSideRowModelSteps.FILTER_AGGREGATES }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(flattenStageRefreshProps)) { | ||
_this.refreshModel({ step: core_1.ClientSideRowModelSteps.MAP }); | ||
} | ||
}); | ||
this.addManagedPropertyListener('rowHeight', function () { return _this.resetRowHeights(); }); | ||
}; | ||
ClientSideRowModel.prototype.start = function () { | ||
this.hasStarted = true; | ||
if (this.shouldSkipSettingDataOnStart) { | ||
this.dispatchUpdateEventsAndRefresh(); | ||
} | ||
else { | ||
this.setInitialData(); | ||
} | ||
}; | ||
ClientSideRowModel.prototype.setInitialData = function () { | ||
var rowData = this.gridOptionsService.get('rowData'); | ||
if (rowData) { | ||
this.shouldSkipSettingDataOnStart = true; | ||
this.setRowData(rowData); | ||
@@ -204,3 +301,3 @@ } | ||
var rowNodeAtPixelNow = this.getRow(indexAtPixelNow); | ||
var animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
var animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
if (rowNodeAtPixelNow === rowNodes[0]) { | ||
@@ -278,3 +375,3 @@ return false; | ||
var rowNode = this.rootNode.childrenAfterSort[topLevelIndex]; | ||
if (this.gridOptionsService.is('groupHideOpenParents')) { | ||
if (this.gridOptionsService.get('groupHideOpenParents')) { | ||
// if hideOpenParents, and this row open, then this row is now displayed at this index, first child is | ||
@@ -338,3 +435,3 @@ while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) { | ||
var changedPath = new core_1.ChangedPath(false, this.rootNode); | ||
if (noTransactions || this.gridOptionsService.is('treeData')) { | ||
if (noTransactions || this.gridOptionsService.get('treeData')) { | ||
changedPath.setInactive(); | ||
@@ -345,3 +442,3 @@ } | ||
ClientSideRowModel.prototype.isSuppressModelUpdateAfterUpdateTransaction = function (params) { | ||
if (!this.gridOptionsService.is('suppressModelUpdateAfterUpdateTransaction')) { | ||
if (!this.gridOptionsService.get('suppressModelUpdateAfterUpdateTransaction')) { | ||
return false; | ||
@@ -374,6 +471,6 @@ } | ||
if (core_1._.missing(paramsStep)) { | ||
console.error("AG Grid: invalid step " + step + ", available steps are " + Object.keys(stepsMapped).join(', ')); | ||
console.error("AG Grid: invalid step ".concat(step, ", available steps are ").concat(Object.keys(stepsMapped).join(', '))); | ||
return undefined; | ||
} | ||
var animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
var animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
var modelParams = { | ||
@@ -388,2 +485,5 @@ step: paramsStep, | ||
ClientSideRowModel.prototype.refreshModel = function (paramsOrStep) { | ||
if (!this.hasStarted) { | ||
return; | ||
} | ||
var params = typeof paramsOrStep === 'object' && "step" in paramsOrStep ? paramsOrStep : this.buildRefreshModelParams(paramsOrStep); | ||
@@ -409,3 +509,3 @@ if (!params) { | ||
case core_1.ClientSideRowModelSteps.EVERYTHING: | ||
this.doRowGrouping(params.groupState, params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged); | ||
this.doRowGrouping(params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged); | ||
case core_1.ClientSideRowModelSteps.FILTER: | ||
@@ -451,3 +551,3 @@ this.doFilter(changedPath); | ||
var result = []; | ||
var groupsSelectChildren = this.gridOptionsService.is('groupSelectsChildren'); | ||
var groupsSelectChildren = this.gridOptionsService.get('groupSelectsChildren'); | ||
this.forEachNodeAfterFilterAndSort(function (rowNode) { | ||
@@ -465,3 +565,3 @@ // range has been closed, skip till end | ||
if (rowNode.group && groupsSelectChildren) { | ||
result.push.apply(result, __spreadArray([], __read(rowNode.allLeafChildren))); | ||
result.push.apply(result, __spreadArray([], __read(rowNode.allLeafChildren), false)); | ||
return; | ||
@@ -559,3 +659,3 @@ } | ||
this.recursivelyWalkNodesAndCallback({ | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterGroup || []))), | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterGroup || [])), false), | ||
callback: callback, | ||
@@ -570,3 +670,3 @@ recursionType: RecursionType.Normal, | ||
this.recursivelyWalkNodesAndCallback({ | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterAggFilter || []))), | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterAggFilter || [])), false), | ||
callback: callback, | ||
@@ -581,3 +681,3 @@ recursionType: RecursionType.AfterFilter, | ||
this.recursivelyWalkNodesAndCallback({ | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterSort || []))), | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterSort || [])), false), | ||
callback: callback, | ||
@@ -632,3 +732,3 @@ recursionType: RecursionType.AfterFilterAndSort, | ||
index = this.recursivelyWalkNodesAndCallback({ | ||
nodes: __spreadArray([], __read(nodeChildren)), | ||
nodes: __spreadArray([], __read(nodeChildren), false), | ||
callback: callback, | ||
@@ -647,3 +747,3 @@ recursionType: recursionType, | ||
if (isRootNode) { | ||
var totalFooters = this.gridOptionsService.is('groupIncludeTotalFooter'); | ||
var totalFooters = this.gridOptionsService.get('groupIncludeTotalFooter'); | ||
if (!totalFooters) | ||
@@ -680,3 +780,3 @@ return index; | ||
ClientSideRowModel.prototype.expandOrCollapseAll = function (expand) { | ||
var usingTreeData = this.gridOptionsService.is('treeData'); | ||
var usingTreeData = this.gridOptionsService.get('treeData'); | ||
var usingPivotMode = this.columnModel.isPivotActive(); | ||
@@ -730,3 +830,3 @@ var recursiveExpandOrCollapse = function (rowNodes) { | ||
}; | ||
ClientSideRowModel.prototype.doRowGrouping = function (groupState, rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) { | ||
ClientSideRowModel.prototype.doRowGrouping = function (rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) { | ||
if (this.groupStage) { | ||
@@ -747,6 +847,4 @@ if (rowNodeTransactions) { | ||
}); | ||
// set open/closed state on groups | ||
this.restoreGroupState(groupState); | ||
} | ||
if (this.gridOptionsService.is('groupSelectsChildren')) { | ||
if (this.gridOptionsService.get('groupSelectsChildren')) { | ||
var selectionChanged = this.selectionService.updateGroupsFromChildrenSelections('rowGroupChanged', changedPath); | ||
@@ -769,14 +867,4 @@ if (selectionChanged) { | ||
} | ||
}; | ||
ClientSideRowModel.prototype.restoreGroupState = function (groupState) { | ||
if (!groupState) { | ||
return; | ||
} | ||
core_1._.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { | ||
// if the group was open last time, then open it this time. however | ||
// if was not open last time, then don't touch the group, so the 'groupDefaultExpanded' | ||
// setting will take effect. | ||
if (typeof groupState[key] === 'boolean') { | ||
node.expanded = groupState[key]; | ||
} | ||
this.eventService.dispatchEventOnce({ | ||
type: core_1.Events.EVENT_ROW_COUNT_READY | ||
}); | ||
@@ -792,10 +880,2 @@ }; | ||
}; | ||
ClientSideRowModel.prototype.getGroupState = function () { | ||
if (!this.rootNode.childrenAfterGroup || !this.gridOptionsService.is('rememberGroupStateWhenNewData')) { | ||
return null; | ||
} | ||
var result = {}; | ||
core_1._.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { return result[key] = node.expanded; }); | ||
return result; | ||
}; | ||
ClientSideRowModel.prototype.getCopyOfNodesMap = function () { | ||
@@ -826,9 +906,10 @@ return this.nodeManager.getCopyOfNodesMap(); | ||
// so new rowNodes means the cache is wiped anyway. | ||
// remember group state, so we can expand groups that should be expanded | ||
var groupState = this.getGroupState(); | ||
// - clears selection, done before we set row data to ensure it isn't readded via `selectionService.syncInOldRowNode` | ||
this.selectionService.reset('rowDataChanged'); | ||
this.nodeManager.setRowData(rowData); | ||
// - clears selection | ||
this.selectionService.reset(); | ||
// - updates filters | ||
this.filterManager.onNewRowsLoaded('rowDataUpdated'); | ||
if (this.hasStarted) { | ||
this.dispatchUpdateEventsAndRefresh(); | ||
} | ||
}; | ||
ClientSideRowModel.prototype.dispatchUpdateEventsAndRefresh = function () { | ||
// this event kicks off: | ||
@@ -842,4 +923,3 @@ // - shows 'no rows' overlay if needed | ||
step: core_1.ClientSideRowModelSteps.EVERYTHING, | ||
groupState: groupState, | ||
newData: true | ||
newData: true, | ||
}); | ||
@@ -912,3 +992,3 @@ }; | ||
ClientSideRowModel.prototype.createRowNodeOrder = function () { | ||
var suppressSortOrder = this.gridOptionsService.is('suppressMaintainUnsortedOrder'); | ||
var suppressSortOrder = this.gridOptionsService.get('suppressMaintainUnsortedOrder'); | ||
if (suppressSortOrder) { | ||
@@ -928,6 +1008,13 @@ return; | ||
ClientSideRowModel.prototype.commonUpdateRowData = function (rowNodeTrans, rowNodeOrder, forceRowNodeOrder) { | ||
var animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
if (!this.hasStarted) { | ||
return; | ||
} | ||
var animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
if (forceRowNodeOrder) { | ||
rowNodeOrder = this.createRowNodeOrder(); | ||
} | ||
var event = { | ||
type: core_1.Events.EVENT_ROW_DATA_UPDATED | ||
}; | ||
this.eventService.dispatchEvent(event); | ||
this.refreshModel({ | ||
@@ -941,8 +1028,2 @@ step: core_1.ClientSideRowModelSteps.EVERYTHING, | ||
}); | ||
// - updates filters | ||
this.filterManager.onNewRowsLoaded('rowDataUpdated'); | ||
var event = { | ||
type: core_1.Events.EVENT_ROW_DATA_UPDATED | ||
}; | ||
this.eventService.dispatchEvent(event); | ||
}; | ||
@@ -1000,37 +1081,47 @@ ClientSideRowModel.prototype.doRowsToDisplay = function () { | ||
}; | ||
ClientSideRowModel.prototype.onGridReady = function () { | ||
if (this.hasStarted) { | ||
return; | ||
} | ||
// App can start using API to add transactions, so need to add data into the node manager if not started | ||
this.setInitialData(); | ||
}; | ||
ClientSideRowModel.prototype.isRowDataLoaded = function () { | ||
return this.nodeManager.hasData(); | ||
}; | ||
__decorate([ | ||
core_1.Autowired('columnModel') | ||
(0, core_1.Autowired)('columnModel') | ||
], ClientSideRowModel.prototype, "columnModel", void 0); | ||
__decorate([ | ||
core_1.Autowired('selectionService') | ||
(0, core_1.Autowired)('selectionService') | ||
], ClientSideRowModel.prototype, "selectionService", void 0); | ||
__decorate([ | ||
core_1.Autowired('filterManager') | ||
(0, core_1.Autowired)('filterManager') | ||
], ClientSideRowModel.prototype, "filterManager", void 0); | ||
__decorate([ | ||
core_1.Autowired('valueCache') | ||
(0, core_1.Autowired)('valueCache') | ||
], ClientSideRowModel.prototype, "valueCache", void 0); | ||
__decorate([ | ||
core_1.Autowired('beans') | ||
(0, core_1.Autowired)('beans') | ||
], ClientSideRowModel.prototype, "beans", void 0); | ||
__decorate([ | ||
core_1.Autowired('filterStage') | ||
(0, core_1.Autowired)('filterStage') | ||
], ClientSideRowModel.prototype, "filterStage", void 0); | ||
__decorate([ | ||
core_1.Autowired('sortStage') | ||
(0, core_1.Autowired)('sortStage') | ||
], ClientSideRowModel.prototype, "sortStage", void 0); | ||
__decorate([ | ||
core_1.Autowired('flattenStage') | ||
(0, core_1.Autowired)('flattenStage') | ||
], ClientSideRowModel.prototype, "flattenStage", void 0); | ||
__decorate([ | ||
core_1.Optional('groupStage') | ||
(0, core_1.Optional)('groupStage') | ||
], ClientSideRowModel.prototype, "groupStage", void 0); | ||
__decorate([ | ||
core_1.Optional('aggregationStage') | ||
(0, core_1.Optional)('aggregationStage') | ||
], ClientSideRowModel.prototype, "aggregationStage", void 0); | ||
__decorate([ | ||
core_1.Optional('pivotStage') | ||
(0, core_1.Optional)('pivotStage') | ||
], ClientSideRowModel.prototype, "pivotStage", void 0); | ||
__decorate([ | ||
core_1.Optional('filterAggregatesStage') | ||
(0, core_1.Optional)('filterAggregatesStage') | ||
], ClientSideRowModel.prototype, "filterAggregatesStage", void 0); | ||
@@ -1041,3 +1132,3 @@ __decorate([ | ||
ClientSideRowModel = __decorate([ | ||
core_1.Bean('rowModel') | ||
(0, core_1.Bean)('rowModel') | ||
], ClientSideRowModel); | ||
@@ -1044,0 +1135,0 @@ return ClientSideRowModel; |
@@ -95,9 +95,9 @@ "use strict"; | ||
FilterService.prototype.doingTreeDataFiltering = function () { | ||
return this.gridOptionsService.is('treeData') && !this.gridOptionsService.is('excludeChildrenWhenTreeDataFiltering'); | ||
return this.gridOptionsService.get('treeData') && !this.gridOptionsService.get('excludeChildrenWhenTreeDataFiltering'); | ||
}; | ||
__decorate([ | ||
core_1.Autowired('filterManager') | ||
(0, core_1.Autowired)('filterManager') | ||
], FilterService.prototype, "filterManager", void 0); | ||
FilterService = __decorate([ | ||
core_1.Bean("filterService") | ||
(0, core_1.Bean)("filterService") | ||
], FilterService); | ||
@@ -104,0 +104,0 @@ return FilterService; |
@@ -36,6 +36,6 @@ "use strict"; | ||
__decorate([ | ||
core_1.Autowired('filterService') | ||
(0, core_1.Autowired)('filterService') | ||
], FilterStage.prototype, "filterService", void 0); | ||
FilterStage = __decorate([ | ||
core_1.Bean('filterStage') | ||
(0, core_1.Bean)('filterStage') | ||
], FilterStage); | ||
@@ -42,0 +42,0 @@ return FilterStage; |
@@ -57,4 +57,4 @@ "use strict"; | ||
// these two are mutually exclusive, so if first set, we don't set the second | ||
var groupRemoveSingleChildren = this.gridOptionsService.is('groupRemoveSingleChildren'); | ||
var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsService.is('groupRemoveLowestSingleChildren'); | ||
var groupRemoveSingleChildren = this.gridOptionsService.get('groupRemoveSingleChildren'); | ||
var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsService.get('groupRemoveLowestSingleChildren'); | ||
return { | ||
@@ -64,4 +64,4 @@ groupRemoveLowestSingleChildren: groupRemoveLowestSingleChildren, | ||
isGroupMultiAutoColumn: this.gridOptionsService.isGroupMultiAutoColumn(), | ||
hideOpenParents: this.gridOptionsService.is('groupHideOpenParents'), | ||
groupIncludeTotalFooter: this.gridOptionsService.is('groupIncludeTotalFooter'), | ||
hideOpenParents: this.gridOptionsService.get('groupHideOpenParents'), | ||
groupIncludeTotalFooter: this.gridOptionsService.get('groupIncludeTotalFooter'), | ||
getGroupIncludeFooter: this.gridOptionsService.getGroupIncludeFooter(), | ||
@@ -147,9 +147,9 @@ }; | ||
__decorate([ | ||
core_1.Autowired('columnModel') | ||
(0, core_1.Autowired)('columnModel') | ||
], FlattenStage.prototype, "columnModel", void 0); | ||
__decorate([ | ||
core_1.Autowired('beans') | ||
(0, core_1.Autowired)('beans') | ||
], FlattenStage.prototype, "beans", void 0); | ||
FlattenStage = __decorate([ | ||
core_1.Bean('flattenStage') | ||
(0, core_1.Bean)('flattenStage') | ||
], FlattenStage); | ||
@@ -156,0 +156,0 @@ return FlattenStage; |
@@ -5,2 +5,3 @@ import { BeanStub, IImmutableService } from "@ag-grid-community/core"; | ||
private rowRenderer; | ||
private selectionService; | ||
private clientSideRowModel; | ||
@@ -11,2 +12,3 @@ private postConstruct; | ||
private createTransactionForRowData; | ||
private onRowDataUpdated; | ||
} |
@@ -48,4 +48,6 @@ "use strict"; | ||
ImmutableService.prototype.postConstruct = function () { | ||
var _this = this; | ||
if (this.rowModel.getType() === 'clientSide') { | ||
this.clientSideRowModel = this.rowModel; | ||
this.addManagedPropertyListener('rowData', function () { return _this.onRowDataUpdated(); }); | ||
} | ||
@@ -57,3 +59,3 @@ }; | ||
// the old behaviour of Row ID's but NOT Immutable Data. | ||
var resetRowDataOnUpdate = this.gridOptionsService.is('resetRowDataOnUpdate'); | ||
var resetRowDataOnUpdate = this.gridOptionsService.get('resetRowDataOnUpdate'); | ||
if (resetRowDataOnUpdate) { | ||
@@ -90,3 +92,3 @@ return false; | ||
var existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap(); | ||
var suppressSortOrder = this.gridOptionsService.is('suppressMaintainUnsortedOrder'); | ||
var suppressSortOrder = this.gridOptionsService.get('suppressMaintainUnsortedOrder'); | ||
var orderMap = suppressSortOrder ? undefined : {}; | ||
@@ -126,13 +128,29 @@ if (core_1._.exists(rowData)) { | ||
}; | ||
ImmutableService.prototype.onRowDataUpdated = function () { | ||
var rowData = this.gridOptionsService.get('rowData'); | ||
if (!rowData) { | ||
return; | ||
} | ||
if (this.isActive()) { | ||
this.setRowData(rowData); | ||
} | ||
else { | ||
this.selectionService.reset('rowDataChanged'); | ||
this.clientSideRowModel.setRowData(rowData); | ||
} | ||
}; | ||
__decorate([ | ||
core_1.Autowired('rowModel') | ||
(0, core_1.Autowired)('rowModel') | ||
], ImmutableService.prototype, "rowModel", void 0); | ||
__decorate([ | ||
core_1.Autowired('rowRenderer') | ||
(0, core_1.Autowired)('rowRenderer') | ||
], ImmutableService.prototype, "rowRenderer", void 0); | ||
__decorate([ | ||
(0, core_1.Autowired)('selectionService') | ||
], ImmutableService.prototype, "selectionService", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
], ImmutableService.prototype, "postConstruct", null); | ||
ImmutableService = __decorate([ | ||
core_1.Bean('immutableService') | ||
(0, core_1.Bean)('immutableService') | ||
], ImmutableService); | ||
@@ -139,0 +157,0 @@ return ImmutableService; |
@@ -5,4 +5,2 @@ import { SortOption, ChangedPath, BeanStub, RowNodeTransaction } from "@ag-grid-community/core"; | ||
private rowNodeSorter; | ||
private postSortFunc; | ||
init(): void; | ||
sort(sortOptions: SortOption[], sortActive: boolean, useDeltaSort: boolean, rowNodeTransactions: RowNodeTransaction[] | null | undefined, changedPath: ChangedPath | undefined, sortContainsGroupColumns: boolean): void; | ||
@@ -9,0 +7,0 @@ private calculateDirtyNodes; |
@@ -31,8 +31,5 @@ "use strict"; | ||
} | ||
SortService.prototype.init = function () { | ||
this.postSortFunc = this.gridOptionsService.getCallback('postSortRows'); | ||
}; | ||
SortService.prototype.sort = function (sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) { | ||
var _this = this; | ||
var groupMaintainOrder = this.gridOptionsService.is('groupMaintainOrder'); | ||
var groupMaintainOrder = this.gridOptionsService.get('groupMaintainOrder'); | ||
var groupColumnsPresent = this.columnModel.getAllGridColumns().some(function (c) { return c.isRowGroupActive(); }); | ||
@@ -44,2 +41,3 @@ var allDirtyNodes = {}; | ||
var isPivotMode = this.columnModel.isPivotMode(); | ||
var postSortFunc = this.gridOptionsService.getCallback('postSortRows'); | ||
var callback = function (rowNode) { | ||
@@ -79,5 +77,5 @@ // we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
_this.updateChildIndexes(rowNode); | ||
if (_this.postSortFunc) { | ||
if (postSortFunc) { | ||
var params = { nodes: rowNode.childrenAfterSort }; | ||
_this.postSortFunc(params); | ||
postSortFunc(params); | ||
} | ||
@@ -180,8 +178,7 @@ }; | ||
var _this = this; | ||
if (!this.gridOptionsService.is('groupHideOpenParents')) { | ||
if (!this.gridOptionsService.get('groupHideOpenParents')) { | ||
return; | ||
} | ||
if (this.gridOptionsService.is('treeData')) { | ||
var msg_1 = "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)."; | ||
core_1._.doOnce(function () { return console.warn(msg_1); }, 'sortService.hideOpenParentsWithTreeData'); | ||
if (this.gridOptionsService.get('treeData')) { | ||
core_1._.warnOnce("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."); | ||
return false; | ||
@@ -204,3 +201,3 @@ } | ||
var _this = this; | ||
if (!this.gridOptionsService.is('groupHideOpenParents') || core_1._.missing(rowNodes)) { | ||
if (!this.gridOptionsService.get('groupHideOpenParents') || core_1._.missing(rowNodes)) { | ||
return; | ||
@@ -237,12 +234,9 @@ } | ||
__decorate([ | ||
core_1.Autowired('columnModel') | ||
(0, core_1.Autowired)('columnModel') | ||
], SortService.prototype, "columnModel", void 0); | ||
__decorate([ | ||
core_1.Autowired('rowNodeSorter') | ||
(0, core_1.Autowired)('rowNodeSorter') | ||
], SortService.prototype, "rowNodeSorter", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
], SortService.prototype, "init", null); | ||
SortService = __decorate([ | ||
core_1.Bean('sortService') | ||
(0, core_1.Bean)('sortService') | ||
], SortService); | ||
@@ -249,0 +243,0 @@ return SortService; |
@@ -1,7 +0,6 @@ | ||
import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub { | ||
import { StageExecuteParams, BeanStub, IRowNodeStage } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub implements IRowNodeStage { | ||
private sortService; | ||
private sortController; | ||
private columnModel; | ||
execute(params: StageExecuteParams): void; | ||
} |
@@ -41,3 +41,3 @@ "use strict"; | ||
// rolling out to everyone. | ||
&& this.gridOptionsService.is('deltaSort'); | ||
&& this.gridOptionsService.get('deltaSort'); | ||
var sortContainsGroupColumns = sortOptions.some(function (opt) { | ||
@@ -53,12 +53,9 @@ var isSortingCoupled = _this.gridOptionsService.isColumnsSortingCoupledToGroup(); | ||
__decorate([ | ||
core_1.Autowired('sortService') | ||
(0, core_1.Autowired)('sortService') | ||
], SortStage.prototype, "sortService", void 0); | ||
__decorate([ | ||
core_1.Autowired('sortController') | ||
(0, core_1.Autowired)('sortController') | ||
], SortStage.prototype, "sortController", void 0); | ||
__decorate([ | ||
core_1.Autowired('columnModel') | ||
], SortStage.prototype, "columnModel", void 0); | ||
SortStage = __decorate([ | ||
core_1.Bean('sortStage') | ||
(0, core_1.Bean)('sortStage') | ||
], SortStage); | ||
@@ -65,0 +62,0 @@ return SortStage; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "30.2.1"; | ||
export declare const VERSION = "31.0.0"; |
@@ -5,2 +5,2 @@ "use strict"; | ||
// DO NOT UPDATE MANUALLY: Generated from script during build time | ||
exports.VERSION = '30.2.1'; | ||
exports.VERSION = '31.0.0'; |
@@ -12,8 +12,5 @@ import { Beans, ColumnModel, EventService, RowDataTransaction, RowNode, RowNodeTransaction, GridOptionsService, ISelectionService } from "@ag-grid-community/core"; | ||
private static ROOT_NODE_ID; | ||
private isRowMasterFunc?; | ||
private suppressParentsInRowNodes; | ||
private doingMasterDetail; | ||
private allNodesMap; | ||
private dataLoaded; | ||
constructor(rootNode: RowNode, gridOptionsService: GridOptionsService, eventService: EventService, columnModel: ColumnModel, selectionService: ISelectionService, beans: Beans); | ||
postConstruct(): void; | ||
getCopyOfNodesMap(): { | ||
@@ -27,2 +24,3 @@ [id: string]: RowNode; | ||
} | null | undefined): RowNodeTransaction; | ||
hasData(): boolean; | ||
private dispatchRowDataUpdateStartedEvent; | ||
@@ -29,0 +27,0 @@ private updateSelection; |
@@ -10,2 +10,3 @@ "use strict"; | ||
this.allNodesMap = {}; | ||
this.dataLoaded = false; | ||
this.rootNode = rootNode; | ||
@@ -25,12 +26,3 @@ this.gridOptionsService = gridOptionsService; | ||
this.rootNode.childrenAfterFilter = []; | ||
// if we make this class a bean, then can annotate postConstruct | ||
this.postConstruct(); | ||
} | ||
// @PostConstruct - this is not a bean, so postConstruct called by constructor | ||
postConstruct() { | ||
// func below doesn't have 'this' pointer, so need to pull out these bits | ||
this.suppressParentsInRowNodes = this.gridOptionsService.is('suppressParentsInRowNodes'); | ||
this.isRowMasterFunc = this.gridOptionsService.get('isRowMaster'); | ||
this.doingMasterDetail = this.gridOptionsService.is('masterDetail'); | ||
} | ||
getCopyOfNodesMap() { | ||
@@ -47,2 +39,3 @@ return core_1._.cloneObject(this.allNodesMap); | ||
} | ||
this.dataLoaded = true; | ||
this.dispatchRowDataUpdateStartedEvent(rowData); | ||
@@ -79,2 +72,3 @@ const rootNode = this.rootNode; | ||
updateRowData(rowDataTran, rowNodeOrder) { | ||
this.dataLoaded = true; | ||
this.dispatchRowDataUpdateStartedEvent(rowDataTran.add); | ||
@@ -96,2 +90,5 @@ const rowNodeTransaction = { | ||
} | ||
hasData() { | ||
return this.dataLoaded; | ||
} | ||
dispatchRowDataUpdateStartedEvent(rowData) { | ||
@@ -141,3 +138,3 @@ const event = { | ||
let normalisedAddIndex = addIndex; | ||
const isTreeData = this.gridOptionsService.is('treeData'); | ||
const isTreeData = this.gridOptionsService.get('treeData'); | ||
if (isTreeData && addIndex > 0 && len > 0) { | ||
@@ -239,3 +236,4 @@ for (let i = 0; i < len; i++) { | ||
this.setMasterForRow(node, dataItem, level, true); | ||
if (parent && !this.suppressParentsInRowNodes) { | ||
const suppressParentsInRowNodes = this.gridOptionsService.get('suppressParentsInRowNodes'); | ||
if (parent && !suppressParentsInRowNodes) { | ||
node.parent = parent; | ||
@@ -253,3 +251,3 @@ } | ||
setMasterForRow(rowNode, data, level, setExpanded) { | ||
const isTreeData = this.gridOptionsService.is('treeData'); | ||
const isTreeData = this.gridOptionsService.get('treeData'); | ||
if (isTreeData) { | ||
@@ -262,8 +260,10 @@ rowNode.setMaster(false); | ||
else { | ||
const masterDetail = this.gridOptionsService.get('masterDetail'); | ||
// this is the default, for when doing grid data | ||
if (this.doingMasterDetail) { | ||
if (masterDetail) { | ||
// if we are doing master detail, then the | ||
// default is that everything can be a Master Row. | ||
if (this.isRowMasterFunc) { | ||
rowNode.setMaster(this.isRowMasterFunc(data)); | ||
const isRowMasterFunc = this.gridOptionsService.get('isRowMaster'); | ||
if (isRowMasterFunc) { | ||
rowNode.setMaster(isRowMasterFunc(data)); | ||
} | ||
@@ -287,3 +287,3 @@ else { | ||
isExpanded(level) { | ||
const expandByDefault = this.gridOptionsService.getNum('groupDefaultExpanded'); | ||
const expandByDefault = this.gridOptionsService.get('groupDefaultExpanded'); | ||
if (expandByDefault === -1) { | ||
@@ -290,0 +290,0 @@ return true; |
@@ -29,4 +29,10 @@ import { BeanStub, ChangedPath, IClientSideRowModel, RefreshModelParams, ClientSideRowModelStep, RowBounds, RowDataTransaction, RowNode, RowHighlightPosition, RowNodeTransaction, RowModelType } from "@ag-grid-community/core"; | ||
private applyAsyncTransactionsTimeout; | ||
/** Has the start method been called */ | ||
private hasStarted; | ||
/** E.g. data has been set into the node manager already */ | ||
private shouldSkipSettingDataOnStart; | ||
init(): void; | ||
private addPropertyListeners; | ||
start(): void; | ||
private setInitialData; | ||
ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean; | ||
@@ -74,6 +80,4 @@ private setRowTopAndRowIndex; | ||
private doRowGrouping; | ||
private restoreGroupState; | ||
private doFilter; | ||
private doPivot; | ||
private getGroupState; | ||
getCopyOfNodesMap(): { | ||
@@ -84,2 +88,3 @@ [id: string]: RowNode; | ||
setRowData(rowData: any[]): void; | ||
private dispatchUpdateEventsAndRefresh; | ||
batchUpdateRowData(rowDataTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void; | ||
@@ -105,2 +110,4 @@ flushAsyncTransactions(): void; | ||
private onGridStylesChanges; | ||
private onGridReady; | ||
isRowDataLoaded(): boolean; | ||
} |
@@ -24,6 +24,10 @@ "use strict"; | ||
this.rowsToDisplay = []; // the rows mapped to rows to display | ||
/** Has the start method been called */ | ||
this.hasStarted = false; | ||
/** E.g. data has been set into the node manager already */ | ||
this.shouldSkipSettingDataOnStart = false; | ||
} | ||
init() { | ||
const refreshEverythingFunc = this.refreshModel.bind(this, { step: core_1.ClientSideRowModelSteps.EVERYTHING }); | ||
const animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
const animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
const refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { | ||
@@ -43,29 +47,121 @@ step: core_1.ClientSideRowModelSteps.EVERYTHING, | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_GRID_STYLES_CHANGED, this.onGridStylesChanges.bind(this)); | ||
const refreshMapListener = this.refreshModel.bind(this, { | ||
step: core_1.ClientSideRowModelSteps.MAP, | ||
keepRenderedRows: true, | ||
animate | ||
}); | ||
this.addManagedPropertyListeners([ | ||
'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', | ||
'groupIncludeFooter', | ||
], refreshMapListener); | ||
const refreshAggListener = this.refreshModel.bind(this, { | ||
step: core_1.ClientSideRowModelSteps.AGGREGATE, | ||
keepRenderedRows: true, | ||
animate | ||
}); | ||
this.addManagedPropertyListeners([ | ||
'groupIncludeTotalFooter', | ||
], refreshAggListener); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_GRID_READY, () => this.onGridReady()); | ||
// doesn't need done if doing full reset | ||
// Property listeners which call `refreshModel` at different stages | ||
this.addPropertyListeners(); | ||
this.rootNode = new core_1.RowNode(this.beans); | ||
this.nodeManager = new clientSideNodeManager_1.ClientSideNodeManager(this.rootNode, this.gridOptionsService, this.eventService, this.columnModel, this.selectionService, this.beans); | ||
this.addManagedPropertyListener('treeData', () => { | ||
// Shotgun reset all node state. This is used by treeData reactivity to ensure nodes don't include any group state | ||
this.setRowData(this.rootNode.allLeafChildren.map(child => child.data)); | ||
} | ||
addPropertyListeners() { | ||
// Omitted Properties | ||
// | ||
// We do not act reactively on all functional properties, as it's possible the application is React and | ||
// has not memoised the property and it's getting set every render. | ||
// | ||
// ** LIST OF NON REACTIVE, NO ARGUMENT | ||
// | ||
// getDataPath, getRowId, isRowMaster -- these are called once for each Node when the Node is created. | ||
// -- these are immutable Node properties (ie a Node ID cannot be changed) | ||
// | ||
// getRowHeight - this is called once when Node is created, if a new getRowHeight function is provided, | ||
// - we do not revisit the heights of each node. | ||
// | ||
// pivotDefaultExpanded - relevant for initial pivot column creation, no impact on existing pivot columns. | ||
// | ||
// deltaSort - this changes the type of algorithm used only, it doesn't change the sort order. so no point | ||
// - in doing the sort again as the same result will be got. the new Prop will be used next time we sort. | ||
// | ||
// ** LIST OF NON REACTIVE, SOME ARGUMENT | ||
// ** For these, they could be reactive, but not convinced the business argument is strong enough, | ||
// ** so leaving as non-reactive for now, and see if anyone complains. | ||
// | ||
// processPivotResultColDef, processPivotResultColGroupDef | ||
// - there is an argument for having these reactive, that if the application changes | ||
// - these props, we should re-create the Pivot Columns, however it's highly unlikely | ||
// - the application would change these functions, far more likely the functions were | ||
// - non memoised correctly. | ||
const resetProps = new Set([ | ||
'treeData', 'masterDetail', | ||
]); | ||
const groupStageRefreshProps = new Set([ | ||
'suppressParentsInRowNodes', 'groupDefaultExpanded', | ||
'groupAllowUnbalanced', 'initialGroupOrderComparator', | ||
'groupHideOpenParents', 'groupDisplayType', | ||
]); | ||
const filterStageRefreshProps = new Set([ | ||
'excludeChildrenWhenTreeDataFiltering', | ||
]); | ||
const pivotStageRefreshProps = new Set([ | ||
'removePivotHeaderRowWhenSingleValueColumn', 'pivotRowTotals', 'pivotColumnGroupTotals', 'suppressExpandablePivotGroups', | ||
]); | ||
const aggregateStageRefreshProps = new Set([ | ||
'getGroupRowAgg', 'alwaysAggregateAtRootLevel', 'groupIncludeTotalFooter', 'suppressAggFilteredOnly', | ||
]); | ||
const sortStageRefreshProps = new Set([ | ||
'postSortRows', 'groupDisplayType', 'accentedSort', | ||
]); | ||
const filterAggStageRefreshProps = new Set([]); | ||
const flattenStageRefreshProps = new Set([ | ||
'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', 'groupIncludeFooter', | ||
]); | ||
const allProps = [ | ||
...resetProps, ...groupStageRefreshProps, ...filterStageRefreshProps, ...pivotStageRefreshProps, | ||
...pivotStageRefreshProps, ...aggregateStageRefreshProps, ...sortStageRefreshProps, ...filterAggStageRefreshProps, | ||
...flattenStageRefreshProps, | ||
]; | ||
this.addManagedPropertyListeners(allProps, params => { | ||
var _a; | ||
const properties = (_a = params.changeSet) === null || _a === void 0 ? void 0 : _a.properties; | ||
if (!properties) { | ||
return; | ||
} | ||
; | ||
const arePropertiesImpacted = (propSet) => (properties.some(prop => propSet.has(prop))); | ||
if (arePropertiesImpacted(resetProps)) { | ||
this.setRowData(this.rootNode.allLeafChildren.map(child => child.data)); | ||
return; | ||
} | ||
if (arePropertiesImpacted(groupStageRefreshProps)) { | ||
this.refreshModel({ step: core_1.ClientSideRowModelSteps.EVERYTHING }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(filterStageRefreshProps)) { | ||
this.refreshModel({ step: core_1.ClientSideRowModelSteps.FILTER }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(pivotStageRefreshProps)) { | ||
this.refreshModel({ step: core_1.ClientSideRowModelSteps.PIVOT }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(aggregateStageRefreshProps)) { | ||
this.refreshModel({ step: core_1.ClientSideRowModelSteps.AGGREGATE }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(sortStageRefreshProps)) { | ||
this.refreshModel({ step: core_1.ClientSideRowModelSteps.SORT }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(filterAggStageRefreshProps)) { | ||
this.refreshModel({ step: core_1.ClientSideRowModelSteps.FILTER_AGGREGATES }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(flattenStageRefreshProps)) { | ||
this.refreshModel({ step: core_1.ClientSideRowModelSteps.MAP }); | ||
} | ||
}); | ||
this.addManagedPropertyListener('rowHeight', () => this.resetRowHeights()); | ||
} | ||
start() { | ||
this.hasStarted = true; | ||
if (this.shouldSkipSettingDataOnStart) { | ||
this.dispatchUpdateEventsAndRefresh(); | ||
} | ||
else { | ||
this.setInitialData(); | ||
} | ||
} | ||
setInitialData() { | ||
const rowData = this.gridOptionsService.get('rowData'); | ||
if (rowData) { | ||
this.shouldSkipSettingDataOnStart = true; | ||
this.setRowData(rowData); | ||
@@ -161,3 +257,3 @@ } | ||
const rowNodeAtPixelNow = this.getRow(indexAtPixelNow); | ||
const animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
const animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
if (rowNodeAtPixelNow === rowNodes[0]) { | ||
@@ -235,3 +331,3 @@ return false; | ||
let rowNode = this.rootNode.childrenAfterSort[topLevelIndex]; | ||
if (this.gridOptionsService.is('groupHideOpenParents')) { | ||
if (this.gridOptionsService.get('groupHideOpenParents')) { | ||
// if hideOpenParents, and this row open, then this row is now displayed at this index, first child is | ||
@@ -295,3 +391,3 @@ while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) { | ||
const changedPath = new core_1.ChangedPath(false, this.rootNode); | ||
if (noTransactions || this.gridOptionsService.is('treeData')) { | ||
if (noTransactions || this.gridOptionsService.get('treeData')) { | ||
changedPath.setInactive(); | ||
@@ -302,3 +398,3 @@ } | ||
isSuppressModelUpdateAfterUpdateTransaction(params) { | ||
if (!this.gridOptionsService.is('suppressModelUpdateAfterUpdateTransaction')) { | ||
if (!this.gridOptionsService.get('suppressModelUpdateAfterUpdateTransaction')) { | ||
return false; | ||
@@ -332,3 +428,3 @@ } | ||
} | ||
const animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
const animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
const modelParams = { | ||
@@ -343,2 +439,5 @@ step: paramsStep, | ||
refreshModel(paramsOrStep) { | ||
if (!this.hasStarted) { | ||
return; | ||
} | ||
let params = typeof paramsOrStep === 'object' && "step" in paramsOrStep ? paramsOrStep : this.buildRefreshModelParams(paramsOrStep); | ||
@@ -364,3 +463,3 @@ if (!params) { | ||
case core_1.ClientSideRowModelSteps.EVERYTHING: | ||
this.doRowGrouping(params.groupState, params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged); | ||
this.doRowGrouping(params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged); | ||
case core_1.ClientSideRowModelSteps.FILTER: | ||
@@ -406,3 +505,3 @@ this.doFilter(changedPath); | ||
const result = []; | ||
const groupsSelectChildren = this.gridOptionsService.is('groupSelectsChildren'); | ||
const groupsSelectChildren = this.gridOptionsService.get('groupSelectsChildren'); | ||
this.forEachNodeAfterFilterAndSort(rowNode => { | ||
@@ -593,3 +692,3 @@ // range has been closed, skip till end | ||
if (isRootNode) { | ||
const totalFooters = this.gridOptionsService.is('groupIncludeTotalFooter'); | ||
const totalFooters = this.gridOptionsService.get('groupIncludeTotalFooter'); | ||
if (!totalFooters) | ||
@@ -626,3 +725,3 @@ return index; | ||
expandOrCollapseAll(expand) { | ||
const usingTreeData = this.gridOptionsService.is('treeData'); | ||
const usingTreeData = this.gridOptionsService.get('treeData'); | ||
const usingPivotMode = this.columnModel.isPivotActive(); | ||
@@ -676,3 +775,3 @@ const recursiveExpandOrCollapse = (rowNodes) => { | ||
} | ||
doRowGrouping(groupState, rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) { | ||
doRowGrouping(rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) { | ||
if (this.groupStage) { | ||
@@ -693,6 +792,4 @@ if (rowNodeTransactions) { | ||
}); | ||
// set open/closed state on groups | ||
this.restoreGroupState(groupState); | ||
} | ||
if (this.gridOptionsService.is('groupSelectsChildren')) { | ||
if (this.gridOptionsService.get('groupSelectsChildren')) { | ||
const selectionChanged = this.selectionService.updateGroupsFromChildrenSelections('rowGroupChanged', changedPath); | ||
@@ -715,14 +812,4 @@ if (selectionChanged) { | ||
} | ||
} | ||
restoreGroupState(groupState) { | ||
if (!groupState) { | ||
return; | ||
} | ||
core_1._.traverseNodesWithKey(this.rootNode.childrenAfterGroup, (node, key) => { | ||
// if the group was open last time, then open it this time. however | ||
// if was not open last time, then don't touch the group, so the 'groupDefaultExpanded' | ||
// setting will take effect. | ||
if (typeof groupState[key] === 'boolean') { | ||
node.expanded = groupState[key]; | ||
} | ||
this.eventService.dispatchEventOnce({ | ||
type: core_1.Events.EVENT_ROW_COUNT_READY | ||
}); | ||
@@ -738,10 +825,2 @@ } | ||
} | ||
getGroupState() { | ||
if (!this.rootNode.childrenAfterGroup || !this.gridOptionsService.is('rememberGroupStateWhenNewData')) { | ||
return null; | ||
} | ||
const result = {}; | ||
core_1._.traverseNodesWithKey(this.rootNode.childrenAfterGroup, (node, key) => result[key] = node.expanded); | ||
return result; | ||
} | ||
getCopyOfNodesMap() { | ||
@@ -772,9 +851,10 @@ return this.nodeManager.getCopyOfNodesMap(); | ||
// so new rowNodes means the cache is wiped anyway. | ||
// remember group state, so we can expand groups that should be expanded | ||
const groupState = this.getGroupState(); | ||
// - clears selection, done before we set row data to ensure it isn't readded via `selectionService.syncInOldRowNode` | ||
this.selectionService.reset('rowDataChanged'); | ||
this.nodeManager.setRowData(rowData); | ||
// - clears selection | ||
this.selectionService.reset(); | ||
// - updates filters | ||
this.filterManager.onNewRowsLoaded('rowDataUpdated'); | ||
if (this.hasStarted) { | ||
this.dispatchUpdateEventsAndRefresh(); | ||
} | ||
} | ||
dispatchUpdateEventsAndRefresh() { | ||
// this event kicks off: | ||
@@ -788,4 +868,3 @@ // - shows 'no rows' overlay if needed | ||
step: core_1.ClientSideRowModelSteps.EVERYTHING, | ||
groupState: groupState, | ||
newData: true | ||
newData: true, | ||
}); | ||
@@ -856,3 +935,3 @@ } | ||
createRowNodeOrder() { | ||
const suppressSortOrder = this.gridOptionsService.is('suppressMaintainUnsortedOrder'); | ||
const suppressSortOrder = this.gridOptionsService.get('suppressMaintainUnsortedOrder'); | ||
if (suppressSortOrder) { | ||
@@ -872,6 +951,13 @@ return; | ||
commonUpdateRowData(rowNodeTrans, rowNodeOrder, forceRowNodeOrder) { | ||
const animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
if (!this.hasStarted) { | ||
return; | ||
} | ||
const animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
if (forceRowNodeOrder) { | ||
rowNodeOrder = this.createRowNodeOrder(); | ||
} | ||
const event = { | ||
type: core_1.Events.EVENT_ROW_DATA_UPDATED | ||
}; | ||
this.eventService.dispatchEvent(event); | ||
this.refreshModel({ | ||
@@ -885,8 +971,2 @@ step: core_1.ClientSideRowModelSteps.EVERYTHING, | ||
}); | ||
// - updates filters | ||
this.filterManager.onNewRowsLoaded('rowDataUpdated'); | ||
const event = { | ||
type: core_1.Events.EVENT_ROW_DATA_UPDATED | ||
}; | ||
this.eventService.dispatchEvent(event); | ||
} | ||
@@ -944,38 +1024,48 @@ doRowsToDisplay() { | ||
} | ||
onGridReady() { | ||
if (this.hasStarted) { | ||
return; | ||
} | ||
// App can start using API to add transactions, so need to add data into the node manager if not started | ||
this.setInitialData(); | ||
} | ||
isRowDataLoaded() { | ||
return this.nodeManager.hasData(); | ||
} | ||
}; | ||
__decorate([ | ||
core_1.Autowired('columnModel') | ||
(0, core_1.Autowired)('columnModel') | ||
], ClientSideRowModel.prototype, "columnModel", void 0); | ||
__decorate([ | ||
core_1.Autowired('selectionService') | ||
(0, core_1.Autowired)('selectionService') | ||
], ClientSideRowModel.prototype, "selectionService", void 0); | ||
__decorate([ | ||
core_1.Autowired('filterManager') | ||
(0, core_1.Autowired)('filterManager') | ||
], ClientSideRowModel.prototype, "filterManager", void 0); | ||
__decorate([ | ||
core_1.Autowired('valueCache') | ||
(0, core_1.Autowired)('valueCache') | ||
], ClientSideRowModel.prototype, "valueCache", void 0); | ||
__decorate([ | ||
core_1.Autowired('beans') | ||
(0, core_1.Autowired)('beans') | ||
], ClientSideRowModel.prototype, "beans", void 0); | ||
__decorate([ | ||
core_1.Autowired('filterStage') | ||
(0, core_1.Autowired)('filterStage') | ||
], ClientSideRowModel.prototype, "filterStage", void 0); | ||
__decorate([ | ||
core_1.Autowired('sortStage') | ||
(0, core_1.Autowired)('sortStage') | ||
], ClientSideRowModel.prototype, "sortStage", void 0); | ||
__decorate([ | ||
core_1.Autowired('flattenStage') | ||
(0, core_1.Autowired)('flattenStage') | ||
], ClientSideRowModel.prototype, "flattenStage", void 0); | ||
__decorate([ | ||
core_1.Optional('groupStage') | ||
(0, core_1.Optional)('groupStage') | ||
], ClientSideRowModel.prototype, "groupStage", void 0); | ||
__decorate([ | ||
core_1.Optional('aggregationStage') | ||
(0, core_1.Optional)('aggregationStage') | ||
], ClientSideRowModel.prototype, "aggregationStage", void 0); | ||
__decorate([ | ||
core_1.Optional('pivotStage') | ||
(0, core_1.Optional)('pivotStage') | ||
], ClientSideRowModel.prototype, "pivotStage", void 0); | ||
__decorate([ | ||
core_1.Optional('filterAggregatesStage') | ||
(0, core_1.Optional)('filterAggregatesStage') | ||
], ClientSideRowModel.prototype, "filterAggregatesStage", void 0); | ||
@@ -986,4 +1076,4 @@ __decorate([ | ||
ClientSideRowModel = __decorate([ | ||
core_1.Bean('rowModel') | ||
(0, core_1.Bean)('rowModel') | ||
], ClientSideRowModel); | ||
exports.ClientSideRowModel = ClientSideRowModel; |
@@ -75,11 +75,11 @@ "use strict"; | ||
doingTreeDataFiltering() { | ||
return this.gridOptionsService.is('treeData') && !this.gridOptionsService.is('excludeChildrenWhenTreeDataFiltering'); | ||
return this.gridOptionsService.get('treeData') && !this.gridOptionsService.get('excludeChildrenWhenTreeDataFiltering'); | ||
} | ||
}; | ||
__decorate([ | ||
core_1.Autowired('filterManager') | ||
(0, core_1.Autowired)('filterManager') | ||
], FilterService.prototype, "filterManager", void 0); | ||
FilterService = __decorate([ | ||
core_1.Bean("filterService") | ||
(0, core_1.Bean)("filterService") | ||
], FilterService); | ||
exports.FilterService = FilterService; |
@@ -18,7 +18,7 @@ "use strict"; | ||
__decorate([ | ||
core_1.Autowired('filterService') | ||
(0, core_1.Autowired)('filterService') | ||
], FilterStage.prototype, "filterService", void 0); | ||
FilterStage = __decorate([ | ||
core_1.Bean('filterStage') | ||
(0, core_1.Bean)('filterStage') | ||
], FilterStage); | ||
exports.FilterStage = FilterStage; |
@@ -38,4 +38,4 @@ "use strict"; | ||
// these two are mutually exclusive, so if first set, we don't set the second | ||
const groupRemoveSingleChildren = this.gridOptionsService.is('groupRemoveSingleChildren'); | ||
const groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsService.is('groupRemoveLowestSingleChildren'); | ||
const groupRemoveSingleChildren = this.gridOptionsService.get('groupRemoveSingleChildren'); | ||
const groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsService.get('groupRemoveLowestSingleChildren'); | ||
return { | ||
@@ -45,4 +45,4 @@ groupRemoveLowestSingleChildren, | ||
isGroupMultiAutoColumn: this.gridOptionsService.isGroupMultiAutoColumn(), | ||
hideOpenParents: this.gridOptionsService.is('groupHideOpenParents'), | ||
groupIncludeTotalFooter: this.gridOptionsService.is('groupIncludeTotalFooter'), | ||
hideOpenParents: this.gridOptionsService.get('groupHideOpenParents'), | ||
groupIncludeTotalFooter: this.gridOptionsService.get('groupIncludeTotalFooter'), | ||
getGroupIncludeFooter: this.gridOptionsService.getGroupIncludeFooter(), | ||
@@ -129,10 +129,10 @@ }; | ||
__decorate([ | ||
core_1.Autowired('columnModel') | ||
(0, core_1.Autowired)('columnModel') | ||
], FlattenStage.prototype, "columnModel", void 0); | ||
__decorate([ | ||
core_1.Autowired('beans') | ||
(0, core_1.Autowired)('beans') | ||
], FlattenStage.prototype, "beans", void 0); | ||
FlattenStage = __decorate([ | ||
core_1.Bean('flattenStage') | ||
(0, core_1.Bean)('flattenStage') | ||
], FlattenStage); | ||
exports.FlattenStage = FlattenStage; |
@@ -5,2 +5,3 @@ import { BeanStub, IImmutableService } from "@ag-grid-community/core"; | ||
private rowRenderer; | ||
private selectionService; | ||
private clientSideRowModel; | ||
@@ -11,2 +12,3 @@ private postConstruct; | ||
private createTransactionForRowData; | ||
private onRowDataUpdated; | ||
} |
@@ -15,2 +15,3 @@ "use strict"; | ||
this.clientSideRowModel = this.rowModel; | ||
this.addManagedPropertyListener('rowData', () => this.onRowDataUpdated()); | ||
} | ||
@@ -22,3 +23,3 @@ } | ||
// the old behaviour of Row ID's but NOT Immutable Data. | ||
const resetRowDataOnUpdate = this.gridOptionsService.is('resetRowDataOnUpdate'); | ||
const resetRowDataOnUpdate = this.gridOptionsService.get('resetRowDataOnUpdate'); | ||
if (resetRowDataOnUpdate) { | ||
@@ -55,3 +56,3 @@ return false; | ||
const existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap(); | ||
const suppressSortOrder = this.gridOptionsService.is('suppressMaintainUnsortedOrder'); | ||
const suppressSortOrder = this.gridOptionsService.get('suppressMaintainUnsortedOrder'); | ||
const orderMap = suppressSortOrder ? undefined : {}; | ||
@@ -91,15 +92,31 @@ if (core_1._.exists(rowData)) { | ||
} | ||
onRowDataUpdated() { | ||
const rowData = this.gridOptionsService.get('rowData'); | ||
if (!rowData) { | ||
return; | ||
} | ||
if (this.isActive()) { | ||
this.setRowData(rowData); | ||
} | ||
else { | ||
this.selectionService.reset('rowDataChanged'); | ||
this.clientSideRowModel.setRowData(rowData); | ||
} | ||
} | ||
}; | ||
__decorate([ | ||
core_1.Autowired('rowModel') | ||
(0, core_1.Autowired)('rowModel') | ||
], ImmutableService.prototype, "rowModel", void 0); | ||
__decorate([ | ||
core_1.Autowired('rowRenderer') | ||
(0, core_1.Autowired)('rowRenderer') | ||
], ImmutableService.prototype, "rowRenderer", void 0); | ||
__decorate([ | ||
(0, core_1.Autowired)('selectionService') | ||
], ImmutableService.prototype, "selectionService", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
], ImmutableService.prototype, "postConstruct", null); | ||
ImmutableService = __decorate([ | ||
core_1.Bean('immutableService') | ||
(0, core_1.Bean)('immutableService') | ||
], ImmutableService); | ||
exports.ImmutableService = ImmutableService; |
@@ -5,4 +5,2 @@ import { SortOption, ChangedPath, BeanStub, RowNodeTransaction } from "@ag-grid-community/core"; | ||
private rowNodeSorter; | ||
private postSortFunc; | ||
init(): void; | ||
sort(sortOptions: SortOption[], sortActive: boolean, useDeltaSort: boolean, rowNodeTransactions: RowNodeTransaction[] | null | undefined, changedPath: ChangedPath | undefined, sortContainsGroupColumns: boolean): void; | ||
@@ -9,0 +7,0 @@ private calculateDirtyNodes; |
@@ -12,7 +12,4 @@ "use strict"; | ||
let SortService = class SortService extends core_1.BeanStub { | ||
init() { | ||
this.postSortFunc = this.gridOptionsService.getCallback('postSortRows'); | ||
} | ||
sort(sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) { | ||
const groupMaintainOrder = this.gridOptionsService.is('groupMaintainOrder'); | ||
const groupMaintainOrder = this.gridOptionsService.get('groupMaintainOrder'); | ||
const groupColumnsPresent = this.columnModel.getAllGridColumns().some(c => c.isRowGroupActive()); | ||
@@ -24,2 +21,3 @@ let allDirtyNodes = {}; | ||
const isPivotMode = this.columnModel.isPivotMode(); | ||
const postSortFunc = this.gridOptionsService.getCallback('postSortRows'); | ||
const callback = (rowNode) => { | ||
@@ -59,5 +57,5 @@ // we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
this.updateChildIndexes(rowNode); | ||
if (this.postSortFunc) { | ||
if (postSortFunc) { | ||
const params = { nodes: rowNode.childrenAfterSort }; | ||
this.postSortFunc(params); | ||
postSortFunc(params); | ||
} | ||
@@ -155,8 +153,7 @@ }; | ||
updateGroupDataForHideOpenParents(changedPath) { | ||
if (!this.gridOptionsService.is('groupHideOpenParents')) { | ||
if (!this.gridOptionsService.get('groupHideOpenParents')) { | ||
return; | ||
} | ||
if (this.gridOptionsService.is('treeData')) { | ||
const msg = `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).`; | ||
core_1._.doOnce(() => console.warn(msg), 'sortService.hideOpenParentsWithTreeData'); | ||
if (this.gridOptionsService.get('treeData')) { | ||
core_1._.warnOnce(`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.`); | ||
return false; | ||
@@ -178,3 +175,3 @@ } | ||
pullDownGroupDataForHideOpenParents(rowNodes, clearOperation) { | ||
if (!this.gridOptionsService.is('groupHideOpenParents') || core_1._.missing(rowNodes)) { | ||
if (!this.gridOptionsService.get('groupHideOpenParents') || core_1._.missing(rowNodes)) { | ||
return; | ||
@@ -212,13 +209,10 @@ } | ||
__decorate([ | ||
core_1.Autowired('columnModel') | ||
(0, core_1.Autowired)('columnModel') | ||
], SortService.prototype, "columnModel", void 0); | ||
__decorate([ | ||
core_1.Autowired('rowNodeSorter') | ||
(0, core_1.Autowired)('rowNodeSorter') | ||
], SortService.prototype, "rowNodeSorter", void 0); | ||
__decorate([ | ||
core_1.PostConstruct | ||
], SortService.prototype, "init", null); | ||
SortService = __decorate([ | ||
core_1.Bean('sortService') | ||
(0, core_1.Bean)('sortService') | ||
], SortService); | ||
exports.SortService = SortService; |
@@ -1,7 +0,6 @@ | ||
import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub { | ||
import { StageExecuteParams, BeanStub, IRowNodeStage } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub implements IRowNodeStage { | ||
private sortService; | ||
private sortController; | ||
private columnModel; | ||
execute(params: StageExecuteParams): void; | ||
} |
@@ -21,3 +21,3 @@ "use strict"; | ||
// rolling out to everyone. | ||
&& this.gridOptionsService.is('deltaSort'); | ||
&& this.gridOptionsService.get('deltaSort'); | ||
const sortContainsGroupColumns = sortOptions.some(opt => { | ||
@@ -34,13 +34,10 @@ const isSortingCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup(); | ||
__decorate([ | ||
core_1.Autowired('sortService') | ||
(0, core_1.Autowired)('sortService') | ||
], SortStage.prototype, "sortService", void 0); | ||
__decorate([ | ||
core_1.Autowired('sortController') | ||
(0, core_1.Autowired)('sortController') | ||
], SortStage.prototype, "sortController", void 0); | ||
__decorate([ | ||
core_1.Autowired('columnModel') | ||
], SortStage.prototype, "columnModel", void 0); | ||
SortStage = __decorate([ | ||
core_1.Bean('sortStage') | ||
(0, core_1.Bean)('sortStage') | ||
], SortStage); | ||
exports.SortStage = SortStage; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "30.2.1"; | ||
export declare const VERSION = "31.0.0"; |
@@ -5,2 +5,2 @@ "use strict"; | ||
// DO NOT UPDATE MANUALLY: Generated from script during build time | ||
exports.VERSION = '30.2.1'; | ||
exports.VERSION = '31.0.0'; |
/** | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1 | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.0 | ||
* @link https://www.ag-grid.com/ | ||
@@ -7,6 +7,6 @@ * @license MIT | ||
/** | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1 | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.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(e,t){for(var o=0,r=t.length,i=e.length;o<r;o++,i++)e[i]=t[o];return e},n=function(){function e(t,o,r,i,n,s){this.nextId=0,this.allNodesMap={},this.rootNode=t,this.gridOptionsService=o,this.eventService=r,this.columnModel=i,this.beans=s,this.selectionService=n,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.gridOptionsService.is("suppressParentsInRowNodes"),this.isRowMasterFunc=this.gridOptionsService.get("isRowMaster"),this.doingMasterDetail=this.gridOptionsService.is("masterDetail")},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){this.dispatchRowDataUpdateStartedEvent(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){this.dispatchRowDataUpdateStartedEvent(e.add);var r={remove:[],update:[],add:[]},i=[];return this.executeRemove(e,r,i),this.executeUpdate(e,r,i),this.executeAdd(e,r),this.updateSelection(i,"rowDataChanged"),t&&o._.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),r},e.prototype.dispatchRowDataUpdateStartedEvent=function(e){var t={type:o.Events.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:(null==e?void 0:e.length)?e[0]:null};this.eventService.dispatchEvent(t)},e.prototype.updateSelection=function(e,t){var r=e.length>0;if(r&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),r){var i={type:o.Events.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(i)}},e.prototype.executeAdd=function(t,n){var s,a=this,l=t.add,d=t.addIndex;if(!o._.missingOrEmpty(l)){var p=l.map((function(t){return a.createNode(t,a.rootNode,e.TOP_LEVEL)}));if("number"==typeof d&&d>=0){var c=this.rootNode.allLeafChildren,h=c.length,u=d;if(this.gridOptionsService.is("treeData")&&d>0&&h>0)for(var f=0;f<h;f++)if((null===(s=c[f])||void 0===s?void 0:s.rowIndex)==d-1){u=f+1;break}var g=c.slice(0,u),v=c.slice(u,c.length);this.rootNode.allLeafChildren=i(i(i([],r(g)),r(p)),r(v))}else this.rootNode.allLeafChildren=i(i([],r(this.rootNode.allLeafChildren)),r(p));this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),n.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.gridOptionsService.getCallback("getRowId");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.gridOptionsService.is("treeData"))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.gridOptionsService.getNum("groupDefaultExpanded");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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},l=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},d=function(e,t){for(var o=0,r=t.length,i=e.length;o<r;o++,i++)e[i]=t[o];return e};!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 p=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.onRowHeightChanged_debounced=o._.debounce(t.onRowHeightChanged.bind(t),100),t.rowsToDisplay=[],t}return s(r,e),r.prototype.init=function(){var e=this,t=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING}),r=!this.gridOptionsService.is("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:r});this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t),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,t),this.addManagedListener(this.eventService,o.Events.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this));var s=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:r});this.addManagedPropertyListeners(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter"],s);var a=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.AGGREGATE,keepRenderedRows:!0,animate:r});this.addManagedPropertyListeners(["groupIncludeTotalFooter"],a),this.rootNode=new o.RowNode(this.beans),this.nodeManager=new n(this.rootNode,this.gridOptionsService,this.eventService,this.columnModel,this.selectionService,this.beans),this.addManagedPropertyListener("treeData",(function(){e.setRowData(e.rootNode.allLeafChildren.map((function(e){return e.data})))}))},r.prototype.start=function(){var e=this.gridOptionsService.get("rowData");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),l=Math.max(s,o),d=Math.min(a,r),p=l;p<=d;p++){var c=this.getRow(p);if(c.rowHeightEstimated){var h=this.gridOptionsService.getRowHeightForNode(c);c.setRowHeight(h.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n},r.prototype.setRowTopAndRowIndex=function(){for(var e=this.environment.getDefaultRowHeight(),t=0,o=new Set,r=this.gridOptionsService.isDomLayout("normal"),i=0;i<this.rowsToDisplay.length;i++){var n=this.rowsToDisplay[i];if(null!=n.id&&o.add(n.id),null==n.rowHeight){var s=this.gridOptionsService.getRowHeightForNode(n,r,e);n.setRowHeight(s.height,s.estimated)}n.setRowTop(t),n.setRowIndex(i),t+=n.rowHeight}return o},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.gridOptionsService.is("suppressAnimationFrame");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.gridOptionsService.is("groupHideOpenParents"))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.gridOptionsService.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})},r.prototype.onFilterChanged=function(e){if(!e.afterDataChange){var t=this.gridOptionsService.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.gridOptionsService.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})},r.prototype.getType=function(){return"clientSide"},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.gridOptionsService.is("treeData"))&&r.setInactive(),r},r.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(e){if(!this.gridOptionsService.is("suppressModelUpdateAfterUpdateTransaction"))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.buildRefreshModelParams=function(e){var t=o.ClientSideRowModelSteps.EVERYTHING,r={everything:o.ClientSideRowModelSteps.EVERYTHING,group:o.ClientSideRowModelSteps.EVERYTHING,filter:o.ClientSideRowModelSteps.FILTER,map:o.ClientSideRowModelSteps.MAP,aggregate:o.ClientSideRowModelSteps.AGGREGATE,sort:o.ClientSideRowModelSteps.SORT,pivot:o.ClientSideRowModelSteps.PIVOT};if(o._.exists(e)&&(t=r[e]),!o._.missing(t))return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gridOptionsService.is("suppressAnimationFrame")};console.error("AG Grid: invalid step "+e+", available steps are "+Object.keys(r).join(", "))},r.prototype.refreshModel=function(e){var t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(t&&!this.isSuppressModelUpdateAfterUpdateTransaction(t)){var r=this.createChangePath(t.rowNodeTransactions);switch(t.step){case o.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(t.groupState,t.rowNodeTransactions,t.rowNodeOrder,r,!!t.afterColumnsChanged);case o.ClientSideRowModelSteps.FILTER:this.doFilter(r);case o.ClientSideRowModelSteps.PIVOT:this.doPivot(r);case o.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(r);case o.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(r);case o.ClientSideRowModelSteps.SORT:this.doSort(t.rowNodeTransactions,r);case o.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}var i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(r,i);var n={type:o.Events.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(n)}},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=!t,r=!1,i=[],n=this.gridOptionsService.is("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort((function(s){if(!r)if(o&&(s===t||s===e)&&(r=!0,s.group&&n))i.push.apply(i,d([],l(s.allLeafChildren)));else{if(!o){if(s!==t&&s!==e)return;o=!0}(!s.group||!n)&&i.push(s)}})),i},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()||0===this.rowsToDisplay.length)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=-1,n=-1;;){var s=Math.floor((t+r)/2),a=this.rowsToDisplay[s];if(this.isRowInPixel(a,e))return s;if(a.rowTop<e?t=s+1:a.rowTop>e&&(r=s-1),i===t&&n===r)return s;i=t,n=r}},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,o){void 0===o&&(o=!1),this.recursivelyWalkNodesAndCallback({nodes:d([],l(this.rootNode.childrenAfterGroup||[])),callback:e,recursionType:t.Normal,index:0,includeFooterNodes:o})},r.prototype.forEachNodeAfterFilter=function(e,o){void 0===o&&(o=!1),this.recursivelyWalkNodesAndCallback({nodes:d([],l(this.rootNode.childrenAfterAggFilter||[])),callback:e,recursionType:t.AfterFilter,index:0,includeFooterNodes:o})},r.prototype.forEachNodeAfterFilterAndSort=function(e,o){void 0===o&&(o=!1),this.recursivelyWalkNodesAndCallback({nodes:d([],l(this.rootNode.childrenAfterSort||[])),callback:e,recursionType:t.AfterFilterAndSort,index:0,includeFooterNodes:o})},r.prototype.forEachPivotNode=function(e,o){void 0===o&&(o=!1),this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:t.PivotNodes,index:0,includeFooterNodes:o})},r.prototype.recursivelyWalkNodesAndCallback=function(e){for(var o,r=e.nodes,i=e.callback,n=e.recursionType,s=e.includeFooterNodes,a=e.index,p=0;p<r.length;p++){var c=r[p];if(i(c,a++),c.hasChildren()&&!c.footer){var h=null;switch(n){case t.Normal:h=c.childrenAfterGroup;break;case t.AfterFilter:h=c.childrenAfterAggFilter;break;case t.AfterFilterAndSort:h=c.childrenAfterSort;break;case t.PivotNodes:h=c.leafGroup?null:c.childrenAfterSort}h&&(a=this.recursivelyWalkNodesAndCallback({nodes:d([],l(h)),callback:i,recursionType:n,index:a,includeFooterNodes:s}))}}var u=null===(o=r[0])||void 0===o?void 0:o.parent;if(!s||!u)return a;if(u===this.rootNode){if(!this.gridOptionsService.is("groupIncludeTotalFooter"))return a}else if(!this.gridOptionsService.getGroupIncludeFooter()({node:u}))return a;return u.createFooter(),i(u.sibling,a++),a},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.gridOptionsService.is("treeData"),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={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,r,i,n){if(this.groupStage){if(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:r,changedPath:i}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:n}),this.restoreGroupState(e)),this.gridOptionsService.is("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){var s={type:o.Events.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(s)}}else 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.gridOptionsService.is("rememberGroupStateWhenNewData"))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_UPDATED};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.gridOptionsService.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={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.gridOptionsService.is("suppressMaintainUnsortedOrder")){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.gridOptionsService.is("suppressAnimationFrame");r&&(t=this.createRowNodeOrder()),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:i}),this.filterManager.onNewRowsLoaded("rowDataUpdated");var n={type:o.Events.EVENT_ROW_DATA_UPDATED};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,keepUndoRedoStack:!0})},r.prototype.onRowHeightChangedDebounced=function(){this.onRowHeightChanged_debounced()},r.prototype.resetRowHeights=function(){var e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()},r.prototype.resetRowHeightsForAllRowNodes=function(){var e=!1;return this.forEachNode((function(t){t.setRowHeight(t.rowHeight,!0);var o=t.detailNode;o&&o.setRowHeight(o.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0})),e},r.prototype.onGridStylesChanges=function(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()},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("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),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),h=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},u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.execute=function(e){var t=e.changedPath;this.filterService.filter(t)},h([o.Autowired("filterService")],t.prototype,"filterService",void 0),t=h([o.Bean("filterStage")],t)}(o.BeanStub),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.execute=function(e){var t=this,r=this.sortController.getSortOptions(),i=o._.exists(r)&&r.length>0,n=i&&o._.exists(e.rowNodeTransactions)&&this.gridOptionsService.is("deltaSort"),s=r.some((function(e){return t.gridOptionsService.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup}));this.sortService.sort(r,i,n,e.rowNodeTransactions,e.changedPath,s)},g([o.Autowired("sortService")],t.prototype,"sortService",void 0),g([o.Autowired("sortController")],t.prototype,"sortController",void 0),g([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=g([o.Bean("sortStage")],t)}(o.BeanStub),w=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),y=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 w(t,e),t.prototype.execute=function(e){var t=e.rowNode,o=[],r=this.columnModel.isPivotMode(),i=r&&t.leafGroup,n=i?[t]:t.childrenAfterSort,s=this.getFlattenDetails();return this.recursivelyAddToRowsToDisplay(s,n,o,r,0),!i&&o.length>0&&s.groupIncludeTotalFooter&&(t.createFooter(),this.addRowNodeToRowsToDisplay(s,t.sibling,o,0)),o},t.prototype.getFlattenDetails=function(){var e=this.gridOptionsService.is("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gridOptionsService.is("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gridOptionsService.isGroupMultiAutoColumn(),hideOpenParents:this.gridOptionsService.is("groupHideOpenParents"),groupIncludeTotalFooter:this.gridOptionsService.is("groupIncludeTotalFooter"),getGroupIncludeFooter:this.gridOptionsService.getGroupIncludeFooter()}},t.prototype.recursivelyAddToRowsToDisplay=function(e,t,r,i,n){if(!o._.missingOrEmpty(t))for(var s=0;s<t.length;s++){var a=t[s],l=a.hasChildren(),d=i&&!l,p=e.groupRemoveSingleChildren&&l&&1===a.childrenAfterGroup.length,c=e.groupRemoveLowestSingleChildren&&l&&a.leafGroup&&1===a.childrenAfterGroup.length,h=i&&a.leafGroup,u=e.hideOpenParents&&a.expanded&&!a.master&&!h;if(!(d||u||p||c)&&this.addRowNodeToRowsToDisplay(e,a,r,n),!i||!a.leafGroup)if(l){var f=p||c;if(a.expanded||f){var g=f?n:n+1;this.recursivelyAddToRowsToDisplay(e,a.childrenAfterSort,r,i,g),e.getGroupIncludeFooter({node:a})?(a.createFooter(),this.addRowNodeToRowsToDisplay(e,a.sibling,r,g)):a.destroyFooter()}}else if(a.master&&a.expanded){var v=this.createDetailNode(a);this.addRowNodeToRowsToDisplay(e,v,r,n)}}},t.prototype.addRowNodeToRowsToDisplay=function(e,t,o,r){o.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:r)},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},y([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),y([o.Autowired("beans")],t.prototype,"beans",void 0),t=y([o.Bean("flattenStage")],t)}(o.BeanStub),R=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},N=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return R(t,e),t.prototype.init=function(){this.postSortFunc=this.gridOptionsService.getCallback("postSortRows")},t.prototype.sort=function(e,t,o,r,i,n){var s=this,a=this.gridOptionsService.is("groupMaintainOrder"),l=this.columnModel.getAllGridColumns().some((function(e){return e.isRowGroupActive()})),d={};o&&r&&(d=this.calculateDirtyNodes(r));var p=this.columnModel.isPivotMode();i&&i.forEachChangedNodeDepthFirst((function(r){s.pullDownGroupDataForHideOpenParents(r.childrenAfterAggFilter,!0);var c=p&&r.leafGroup;if(a&&l&&!r.leafGroup&&!n){var h=r.childrenAfterAggFilter.slice(0);if(r.childrenAfterSort){var u={};r.childrenAfterSort.forEach((function(e,t){u[e.id]=t})),h.sort((function(e,t){var o,r;return(null!==(o=u[e.id])&&void 0!==o?o:0)-(null!==(r=u[t.id])&&void 0!==r?r:0)}))}r.childrenAfterSort=h}else r.childrenAfterSort=!t||c?r.childrenAfterAggFilter.slice(0):o?s.doDeltaSort(r,d,i,e):s.rowNodeSorter.doFullSort(r.childrenAfterAggFilter,e);if(r.sibling&&(r.sibling.childrenAfterSort=r.childrenAfterSort),s.updateChildIndexes(r),s.postSortFunc){var f={nodes:r.childrenAfterSort};s.postSortFunc(f)}})),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={},l=[];n.forEach((function(e){t[e.id]||!o.canSkip(e)?l.push(e):a[e.id]=!0}));var d=s.filter((function(e){return a[e.id]})),p=function(e,t){return{currentPos:t,rowNode:e}},c=l.map(p).sort((function(e,t){return i.rowNodeSorter.compareRowNodes(r,e,t)}));return this.mergeSortedArrays(r,c,d.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.gridOptionsService.is("groupHideOpenParents")){if(this.gridOptionsService.is("treeData")){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.gridOptionsService.is("groupHideOpenParents")&&!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),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.filter=function(e){var t=this.filterManager.isChildFilterPresent();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.gridOptionsService.is("treeData")&&!this.gridOptionsService.is("excludeChildrenWhenTreeDataFiltering")},T([o.Autowired("filterManager")],t.prototype,"filterManager",void 0),t=T([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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},M=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},D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t.prototype.postConstruct=function(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)},t.prototype.isActive=function(){var e=this.gridOptionsService.exists("getRowId");return!this.gridOptionsService.is("resetRowDataOnUpdate")&&e},t.prototype.setRowData=function(e){var t=this.createTransactionForRowData(e);if(t){var o=M(t,2),r=o[0],i=o[1];this.clientSideRowModel.updateRowData(r,i)}},t.prototype.createTransactionForRowData=function(e){if(o._.missing(this.clientSideRowModel))console.error("AG Grid: ImmutableService only works with ClientSideRowModel");else{var t=this.gridOptionsService.getCallback("getRowId");if(null!=t){var r={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsService.is("suppressMaintainUnsortedOrder")?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!")}},E([o.Autowired("rowModel")],t.prototype,"rowModel",void 0),E([o.Autowired("rowRenderer")],t.prototype,"rowRenderer",void 0),E([o.PostConstruct],t.prototype,"postConstruct",null),t=E([o.Bean("immutableService")],t)}(o.BeanStub),_={version:"30.2.1",moduleName:o.ModuleNames.ClientSideRowModelModule,rowModel:"clientSide",beans:[p,u,v,S,N,C,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(e,t,o){if(o||2===arguments.length)for(var r,i=0,n=t.length;i<n;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},n=function(){function e(t,o,r,i,n,s){this.nextId=0,this.allNodesMap={},this.dataLoaded=!1,this.rootNode=t,this.gridOptionsService=o,this.eventService=r,this.columnModel=i,this.beans=s,this.selectionService=n,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=[]}return 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){this.dataLoaded=!0,this.dispatchRowDataUpdateStartedEvent(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){this.dataLoaded=!0,this.dispatchRowDataUpdateStartedEvent(e.add);var r={remove:[],update:[],add:[]},i=[];return this.executeRemove(e,r,i),this.executeUpdate(e,r,i),this.executeAdd(e,r),this.updateSelection(i,"rowDataChanged"),t&&o._.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),r},e.prototype.hasData=function(){return this.dataLoaded},e.prototype.dispatchRowDataUpdateStartedEvent=function(e){var t={type:o.Events.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:(null==e?void 0:e.length)?e[0]:null};this.eventService.dispatchEvent(t)},e.prototype.updateSelection=function(e,t){var r=e.length>0;if(r&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),r){var i={type:o.Events.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(i)}},e.prototype.executeAdd=function(t,n){var s,a=this,l=t.add,d=t.addIndex;if(!o._.missingOrEmpty(l)){var p=l.map((function(t){return a.createNode(t,a.rootNode,e.TOP_LEVEL)}));if("number"==typeof d&&d>=0){var c=this.rootNode.allLeafChildren,h=c.length,u=d;if(this.gridOptionsService.get("treeData")&&d>0&&h>0)for(var f=0;f<h;f++)if((null===(s=c[f])||void 0===s?void 0:s.rowIndex)==d-1){u=f+1;break}var g=c.slice(0,u),v=c.slice(u,c.length);this.rootNode.allLeafChildren=i(i(i([],r(g),!1),r(p),!1),r(v),!1)}else this.rootNode.allLeafChildren=i(i([],r(this.rootNode.allLeafChildren),!1),r(p),!1);this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),n.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.gridOptionsService.getCallback("getRowId");if(o){var r=o({data:e,level:0});if(!(t=this.allNodesMap[r]))return console.error("AG Grid: could not find row id=".concat(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);i.group=!1,this.setMasterForRow(i,e,r,!0);var n=this.gridOptionsService.get("suppressParentsInRowNodes");return t&&!n&&(i.parent=t),i.level=r,i.setDataAndId(e,this.nextId.toString()),this.allNodesMap[i.id]&&console.warn("AG Grid: duplicate node id '".concat(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.gridOptionsService.get("treeData"))e.setMaster(!1),r&&(e.expanded=!1);else{if(this.gridOptionsService.get("masterDetail")){var i=this.gridOptionsService.get("isRowMaster");i?e.setMaster(i(t)):e.setMaster(!0)}else e.setMaster(!1);if(r){var n=this.columnModel.getRowGroupColumns(),s=o+(n?n.length:0);e.expanded=!!e.master&&this.isExpanded(s)}}},e.prototype.isExpanded=function(e){var t=this.gridOptionsService.get("groupDefaultExpanded");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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},l=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},d=function(e,t,o){if(o||2===arguments.length)for(var r,i=0,n=t.length;i<n;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};!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 p=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.onRowHeightChanged_debounced=o._.debounce(t.onRowHeightChanged.bind(t),100),t.rowsToDisplay=[],t.hasStarted=!1,t.shouldSkipSettingDataOnStart=!1,t}return s(r,e),r.prototype.init=function(){var e=this,t=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING}),r=!this.gridOptionsService.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:r});this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t),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,t),this.addManagedListener(this.eventService,o.Events.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_GRID_READY,(function(){return e.onGridReady()})),this.addPropertyListeners(),this.rootNode=new o.RowNode(this.beans),this.nodeManager=new n(this.rootNode,this.gridOptionsService,this.eventService,this.columnModel,this.selectionService,this.beans)},r.prototype.addPropertyListeners=function(){var e=this,t=new Set(["treeData","masterDetail"]),r=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),n=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),s=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly"]),a=new Set(["postSortRows","groupDisplayType","accentedSort"]),p=new Set([]),c=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter"]),h=d(d(d(d(d(d(d(d(d([],l(t),!1),l(r),!1),l(i),!1),l(n),!1),l(n),!1),l(s),!1),l(a),!1),l(p),!1),l(c),!1);this.addManagedPropertyListeners(h,(function(l){var d,h=null===(d=l.changeSet)||void 0===d?void 0:d.properties;if(h){var u=function(e){return h.some((function(t){return e.has(t)}))};u(t)?e.setRowData(e.rootNode.allLeafChildren.map((function(e){return e.data}))):u(r)?e.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING}):u(i)?e.refreshModel({step:o.ClientSideRowModelSteps.FILTER}):u(n)?e.refreshModel({step:o.ClientSideRowModelSteps.PIVOT}):u(s)?e.refreshModel({step:o.ClientSideRowModelSteps.AGGREGATE}):u(a)?e.refreshModel({step:o.ClientSideRowModelSteps.SORT}):u(p)?e.refreshModel({step:o.ClientSideRowModelSteps.FILTER_AGGREGATES}):u(c)&&e.refreshModel({step:o.ClientSideRowModelSteps.MAP})}})),this.addManagedPropertyListener("rowHeight",(function(){return e.resetRowHeights()}))},r.prototype.start=function(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()},r.prototype.setInitialData=function(){var e=this.gridOptionsService.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,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),l=Math.max(s,o),d=Math.min(a,r),p=l;p<=d;p++){var c=this.getRow(p);if(c.rowHeightEstimated){var h=this.gridOptionsService.getRowHeightForNode(c);c.setRowHeight(h.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n},r.prototype.setRowTopAndRowIndex=function(){for(var e=this.environment.getDefaultRowHeight(),t=0,o=new Set,r=this.gridOptionsService.isDomLayout("normal"),i=0;i<this.rowsToDisplay.length;i++){var n=this.rowsToDisplay[i];if(null!=n.id&&o.add(n.id),null==n.rowHeight){var s=this.gridOptionsService.getRowHeightForNode(n,r,e);n.setRowHeight(s.height,s.estimated)}n.setRowTop(t),n.setRowIndex(i),t+=n.rowHeight}return o},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.gridOptionsService.get("suppressAnimationFrame");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.gridOptionsService.get("groupHideOpenParents"))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.gridOptionsService.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})},r.prototype.onFilterChanged=function(e){if(!e.afterDataChange){var t=this.gridOptionsService.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.gridOptionsService.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})},r.prototype.getType=function(){return"clientSide"},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.gridOptionsService.get("treeData"))&&r.setInactive(),r},r.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(e){if(!this.gridOptionsService.get("suppressModelUpdateAfterUpdateTransaction"))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.buildRefreshModelParams=function(e){var t=o.ClientSideRowModelSteps.EVERYTHING,r={everything:o.ClientSideRowModelSteps.EVERYTHING,group:o.ClientSideRowModelSteps.EVERYTHING,filter:o.ClientSideRowModelSteps.FILTER,map:o.ClientSideRowModelSteps.MAP,aggregate:o.ClientSideRowModelSteps.AGGREGATE,sort:o.ClientSideRowModelSteps.SORT,pivot:o.ClientSideRowModelSteps.PIVOT};if(o._.exists(e)&&(t=r[e]),!o._.missing(t))return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gridOptionsService.get("suppressAnimationFrame")};console.error("AG Grid: invalid step ".concat(e,", available steps are ").concat(Object.keys(r).join(", ")))},r.prototype.refreshModel=function(e){if(this.hasStarted){var t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(t&&!this.isSuppressModelUpdateAfterUpdateTransaction(t)){var r=this.createChangePath(t.rowNodeTransactions);switch(t.step){case o.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,r,!!t.afterColumnsChanged);case o.ClientSideRowModelSteps.FILTER:this.doFilter(r);case o.ClientSideRowModelSteps.PIVOT:this.doPivot(r);case o.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(r);case o.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(r);case o.ClientSideRowModelSteps.SORT:this.doSort(t.rowNodeTransactions,r);case o.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}var i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(r,i);var n={type:o.Events.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(n)}}},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=!t,r=!1,i=[],n=this.gridOptionsService.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort((function(s){if(!r)if(o&&(s===t||s===e)&&(r=!0,s.group&&n))i.push.apply(i,d([],l(s.allLeafChildren),!1));else{if(!o){if(s!==t&&s!==e)return;o=!0}(!s.group||!n)&&i.push(s)}})),i},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()||0===this.rowsToDisplay.length)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=-1,n=-1;;){var s=Math.floor((t+r)/2),a=this.rowsToDisplay[s];if(this.isRowInPixel(a,e))return s;if(a.rowTop<e?t=s+1:a.rowTop>e&&(r=s-1),i===t&&n===r)return s;i=t,n=r}},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,o){void 0===o&&(o=!1),this.recursivelyWalkNodesAndCallback({nodes:d([],l(this.rootNode.childrenAfterGroup||[]),!1),callback:e,recursionType:t.Normal,index:0,includeFooterNodes:o})},r.prototype.forEachNodeAfterFilter=function(e,o){void 0===o&&(o=!1),this.recursivelyWalkNodesAndCallback({nodes:d([],l(this.rootNode.childrenAfterAggFilter||[]),!1),callback:e,recursionType:t.AfterFilter,index:0,includeFooterNodes:o})},r.prototype.forEachNodeAfterFilterAndSort=function(e,o){void 0===o&&(o=!1),this.recursivelyWalkNodesAndCallback({nodes:d([],l(this.rootNode.childrenAfterSort||[]),!1),callback:e,recursionType:t.AfterFilterAndSort,index:0,includeFooterNodes:o})},r.prototype.forEachPivotNode=function(e,o){void 0===o&&(o=!1),this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:t.PivotNodes,index:0,includeFooterNodes:o})},r.prototype.recursivelyWalkNodesAndCallback=function(e){for(var o,r=e.nodes,i=e.callback,n=e.recursionType,s=e.includeFooterNodes,a=e.index,p=0;p<r.length;p++){var c=r[p];if(i(c,a++),c.hasChildren()&&!c.footer){var h=null;switch(n){case t.Normal:h=c.childrenAfterGroup;break;case t.AfterFilter:h=c.childrenAfterAggFilter;break;case t.AfterFilterAndSort:h=c.childrenAfterSort;break;case t.PivotNodes:h=c.leafGroup?null:c.childrenAfterSort}h&&(a=this.recursivelyWalkNodesAndCallback({nodes:d([],l(h),!1),callback:i,recursionType:n,index:a,includeFooterNodes:s}))}}var u=null===(o=r[0])||void 0===o?void 0:o.parent;if(!s||!u)return a;if(u===this.rootNode){if(!this.gridOptionsService.get("groupIncludeTotalFooter"))return a}else if(!this.gridOptionsService.getGroupIncludeFooter()({node:u}))return a;return u.createFooter(),i(u.sibling,a++),a},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.gridOptionsService.get("treeData"),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={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,r,i){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:r}):this.groupStage.execute({rowNode:this.rootNode,changedPath:r,afterColumnsChanged:i}),this.gridOptionsService.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",r)){var n={type:o.Events.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(n)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.eventService.dispatchEventOnce({type:o.Events.EVENT_ROW_COUNT_READY})},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.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){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()},r.prototype.dispatchUpdateEventsAndRefresh=function(){var e={type:o.Events.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(e),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,newData:!0})},r.prototype.batchUpdateRowData=function(e,t){var o=this;if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];var r=this.gridOptionsService.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={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.gridOptionsService.get("suppressMaintainUnsortedOrder")){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){if(this.hasStarted){var i=!this.gridOptionsService.get("suppressAnimationFrame");r&&(t=this.createRowNodeOrder());var n={type:o.Events.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(n),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:i})}},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,keepUndoRedoStack:!0})},r.prototype.onRowHeightChangedDebounced=function(){this.onRowHeightChanged_debounced()},r.prototype.resetRowHeights=function(){var e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()},r.prototype.resetRowHeightsForAllRowNodes=function(){var e=!1;return this.forEachNode((function(t){t.setRowHeight(t.rowHeight,!0);var o=t.detailNode;o&&o.setRowHeight(o.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0})),e},r.prototype.onGridStylesChanges=function(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()},r.prototype.onGridReady=function(){this.hasStarted||this.setInitialData()},r.prototype.isRowDataLoaded=function(){return this.nodeManager.hasData()},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("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),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),h=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},u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.execute=function(e){var t=e.changedPath;this.filterService.filter(t)},h([o.Autowired("filterService")],t.prototype,"filterService",void 0),t=h([o.Bean("filterStage")],t)}(o.BeanStub),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.execute=function(e){var t=this,r=this.sortController.getSortOptions(),i=o._.exists(r)&&r.length>0,n=i&&o._.exists(e.rowNodeTransactions)&&this.gridOptionsService.get("deltaSort"),s=r.some((function(e){return t.gridOptionsService.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup}));this.sortService.sort(r,i,n,e.rowNodeTransactions,e.changedPath,s)},g([o.Autowired("sortService")],t.prototype,"sortService",void 0),g([o.Autowired("sortController")],t.prototype,"sortController",void 0),t=g([o.Bean("sortStage")],t)}(o.BeanStub),w=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),y=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 w(t,e),t.prototype.execute=function(e){var t=e.rowNode,o=[],r=this.columnModel.isPivotMode(),i=r&&t.leafGroup,n=i?[t]:t.childrenAfterSort,s=this.getFlattenDetails();return this.recursivelyAddToRowsToDisplay(s,n,o,r,0),!i&&o.length>0&&s.groupIncludeTotalFooter&&(t.createFooter(),this.addRowNodeToRowsToDisplay(s,t.sibling,o,0)),o},t.prototype.getFlattenDetails=function(){var e=this.gridOptionsService.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gridOptionsService.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gridOptionsService.isGroupMultiAutoColumn(),hideOpenParents:this.gridOptionsService.get("groupHideOpenParents"),groupIncludeTotalFooter:this.gridOptionsService.get("groupIncludeTotalFooter"),getGroupIncludeFooter:this.gridOptionsService.getGroupIncludeFooter()}},t.prototype.recursivelyAddToRowsToDisplay=function(e,t,r,i,n){if(!o._.missingOrEmpty(t))for(var s=0;s<t.length;s++){var a=t[s],l=a.hasChildren(),d=i&&!l,p=e.groupRemoveSingleChildren&&l&&1===a.childrenAfterGroup.length,c=e.groupRemoveLowestSingleChildren&&l&&a.leafGroup&&1===a.childrenAfterGroup.length,h=i&&a.leafGroup,u=e.hideOpenParents&&a.expanded&&!a.master&&!h;if(!(d||u||p||c)&&this.addRowNodeToRowsToDisplay(e,a,r,n),!i||!a.leafGroup)if(l){var f=p||c;if(a.expanded||f){var g=f?n:n+1;this.recursivelyAddToRowsToDisplay(e,a.childrenAfterSort,r,i,g),e.getGroupIncludeFooter({node:a})?(a.createFooter(),this.addRowNodeToRowsToDisplay(e,a.sibling,r,g)):a.destroyFooter()}}else if(a.master&&a.expanded){var v=this.createDetailNode(a);this.addRowNodeToRowsToDisplay(e,v,r,n)}}},t.prototype.addRowNodeToRowsToDisplay=function(e,t,o,r){o.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:r)},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},y([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),y([o.Autowired("beans")],t.prototype,"beans",void 0),t=y([o.Bean("flattenStage")],t)}(o.BeanStub),R=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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},N=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return R(t,e),t.prototype.sort=function(e,t,o,r,i,n){var s=this,a=this.gridOptionsService.get("groupMaintainOrder"),l=this.columnModel.getAllGridColumns().some((function(e){return e.isRowGroupActive()})),d={};o&&r&&(d=this.calculateDirtyNodes(r));var p=this.columnModel.isPivotMode(),c=this.gridOptionsService.getCallback("postSortRows");i&&i.forEachChangedNodeDepthFirst((function(r){s.pullDownGroupDataForHideOpenParents(r.childrenAfterAggFilter,!0);var h=p&&r.leafGroup;if(a&&l&&!r.leafGroup&&!n){var u=r.childrenAfterAggFilter.slice(0);if(r.childrenAfterSort){var f={};r.childrenAfterSort.forEach((function(e,t){f[e.id]=t})),u.sort((function(e,t){var o,r;return(null!==(o=f[e.id])&&void 0!==o?o:0)-(null!==(r=f[t.id])&&void 0!==r?r:0)}))}r.childrenAfterSort=u}else r.childrenAfterSort=!t||h?r.childrenAfterAggFilter.slice(0):o?s.doDeltaSort(r,d,i,e):s.rowNodeSorter.doFullSort(r.childrenAfterAggFilter,e);if(r.sibling&&(r.sibling.childrenAfterSort=r.childrenAfterSort),s.updateChildIndexes(r),c){var g={nodes:r.childrenAfterSort};c(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={},l=[];n.forEach((function(e){t[e.id]||!o.canSkip(e)?l.push(e):a[e.id]=!0}));var d=s.filter((function(e){return a[e.id]})),p=function(e,t){return{currentPos:t,rowNode:e}},c=l.map(p).sort((function(e,t){return i.rowNodeSorter.compareRowNodes(r,e,t)}));return this.mergeSortedArrays(r,c,d.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.gridOptionsService.get("groupHideOpenParents")){if(this.gridOptionsService.get("treeData"))return o._.warnOnce("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."),!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.gridOptionsService.get("groupHideOpenParents")&&!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),t=A([o.Bean("sortService")],t)}(o.BeanStub),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.filter=function(e){var t=this.filterManager.isChildFilterPresent();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.gridOptionsService.get("treeData")&&!this.gridOptionsService.get("excludeChildrenWhenTreeDataFiltering")},T([o.Autowired("filterManager")],t.prototype,"filterManager",void 0),t=T([o.Bean("filterService")],t)}(o.BeanStub),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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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},D=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},M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t.prototype.postConstruct=function(){var e=this;"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",(function(){return e.onRowDataUpdated()})))},t.prototype.isActive=function(){var e=this.gridOptionsService.exists("getRowId");return!this.gridOptionsService.get("resetRowDataOnUpdate")&&e},t.prototype.setRowData=function(e){var t=this.createTransactionForRowData(e);if(t){var o=D(t,2),r=o[0],i=o[1];this.clientSideRowModel.updateRowData(r,i)}},t.prototype.createTransactionForRowData=function(e){if(o._.missing(this.clientSideRowModel))console.error("AG Grid: ImmutableService only works with ClientSideRowModel");else{var t=this.gridOptionsService.getCallback("getRowId");if(null!=t){var r={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsService.get("suppressMaintainUnsortedOrder")?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.prototype.onRowDataUpdated=function(){var e=this.gridOptionsService.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))},m([o.Autowired("rowModel")],t.prototype,"rowModel",void 0),m([o.Autowired("rowRenderer")],t.prototype,"rowRenderer",void 0),m([o.Autowired("selectionService")],t.prototype,"selectionService",void 0),m([o.PostConstruct],t.prototype,"postConstruct",null),t=m([o.Bean("immutableService")],t)}(o.BeanStub),_={version:"31.0.0",moduleName:o.ModuleNames.ClientSideRowModelModule,rowModel:"clientSide",beans:[p,u,v,S,N,E,M]};exports.ClientSideRowModelModule=_; |
@@ -12,8 +12,5 @@ import { Beans, ColumnModel, EventService, RowDataTransaction, RowNode, RowNodeTransaction, GridOptionsService, ISelectionService } from "@ag-grid-community/core"; | ||
private static ROOT_NODE_ID; | ||
private isRowMasterFunc?; | ||
private suppressParentsInRowNodes; | ||
private doingMasterDetail; | ||
private allNodesMap; | ||
private dataLoaded; | ||
constructor(rootNode: RowNode, gridOptionsService: GridOptionsService, eventService: EventService, columnModel: ColumnModel, selectionService: ISelectionService, beans: Beans); | ||
postConstruct(): void; | ||
getCopyOfNodesMap(): { | ||
@@ -27,2 +24,3 @@ [id: string]: RowNode; | ||
} | null | undefined): RowNodeTransaction; | ||
hasData(): boolean; | ||
private dispatchRowDataUpdateStartedEvent; | ||
@@ -29,0 +27,0 @@ private updateSelection; |
@@ -17,6 +17,10 @@ var __read = (this && this.__read) || function (o, n) { | ||
}; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
@@ -29,2 +33,3 @@ import { Events, RowNode, _ } from "@ag-grid-community/core"; | ||
this.allNodesMap = {}; | ||
this.dataLoaded = false; | ||
this.rootNode = rootNode; | ||
@@ -44,12 +49,3 @@ this.gridOptionsService = gridOptionsService; | ||
this.rootNode.childrenAfterFilter = []; | ||
// if we make this class a bean, then can annotate postConstruct | ||
this.postConstruct(); | ||
} | ||
// @PostConstruct - this is not a bean, so postConstruct called by constructor | ||
ClientSideNodeManager.prototype.postConstruct = function () { | ||
// func below doesn't have 'this' pointer, so need to pull out these bits | ||
this.suppressParentsInRowNodes = this.gridOptionsService.is('suppressParentsInRowNodes'); | ||
this.isRowMasterFunc = this.gridOptionsService.get('isRowMaster'); | ||
this.doingMasterDetail = this.gridOptionsService.is('masterDetail'); | ||
}; | ||
ClientSideNodeManager.prototype.getCopyOfNodesMap = function () { | ||
@@ -67,2 +63,3 @@ return _.cloneObject(this.allNodesMap); | ||
} | ||
this.dataLoaded = true; | ||
this.dispatchRowDataUpdateStartedEvent(rowData); | ||
@@ -99,2 +96,3 @@ var rootNode = this.rootNode; | ||
ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) { | ||
this.dataLoaded = true; | ||
this.dispatchRowDataUpdateStartedEvent(rowDataTran.add); | ||
@@ -116,2 +114,5 @@ var rowNodeTransaction = { | ||
}; | ||
ClientSideNodeManager.prototype.hasData = function () { | ||
return this.dataLoaded; | ||
}; | ||
ClientSideNodeManager.prototype.dispatchRowDataUpdateStartedEvent = function (rowData) { | ||
@@ -162,3 +163,3 @@ var event = { | ||
var normalisedAddIndex = addIndex; | ||
var isTreeData = this.gridOptionsService.is('treeData'); | ||
var isTreeData = this.gridOptionsService.get('treeData'); | ||
if (isTreeData && addIndex > 0 && len > 0) { | ||
@@ -174,6 +175,6 @@ for (var i = 0; i < len; i++) { | ||
var nodesAfterIndex = allLeafChildren.slice(normalisedAddIndex, allLeafChildren.length); | ||
this.rootNode.allLeafChildren = __spreadArray(__spreadArray(__spreadArray([], __read(nodesBeforeIndex)), __read(newNodes)), __read(nodesAfterIndex)); | ||
this.rootNode.allLeafChildren = __spreadArray(__spreadArray(__spreadArray([], __read(nodesBeforeIndex), false), __read(newNodes), false), __read(nodesAfterIndex), false); | ||
} | ||
else { | ||
this.rootNode.allLeafChildren = __spreadArray(__spreadArray([], __read(this.rootNode.allLeafChildren)), __read(newNodes)); | ||
this.rootNode.allLeafChildren = __spreadArray(__spreadArray([], __read(this.rootNode.allLeafChildren), false), __read(newNodes), false); | ||
} | ||
@@ -244,3 +245,3 @@ if (this.rootNode.sibling) { | ||
if (!rowNode) { | ||
console.error("AG Grid: could not find row id=" + id + ", data item was not found for this id"); | ||
console.error("AG Grid: could not find row id=".concat(id, ", data item was not found for this id")); | ||
return null; | ||
@@ -264,3 +265,4 @@ } | ||
this.setMasterForRow(node, dataItem, level, true); | ||
if (parent && !this.suppressParentsInRowNodes) { | ||
var suppressParentsInRowNodes = this.gridOptionsService.get('suppressParentsInRowNodes'); | ||
if (parent && !suppressParentsInRowNodes) { | ||
node.parent = parent; | ||
@@ -271,3 +273,3 @@ } | ||
if (this.allNodesMap[node.id]) { | ||
console.warn("AG Grid: duplicate node id '" + node.id + "' detected from getRowId callback, this could cause issues in your grid."); | ||
console.warn("AG Grid: duplicate node id '".concat(node.id, "' detected from getRowId callback, this could cause issues in your grid.")); | ||
} | ||
@@ -279,3 +281,3 @@ this.allNodesMap[node.id] = node; | ||
ClientSideNodeManager.prototype.setMasterForRow = function (rowNode, data, level, setExpanded) { | ||
var isTreeData = this.gridOptionsService.is('treeData'); | ||
var isTreeData = this.gridOptionsService.get('treeData'); | ||
if (isTreeData) { | ||
@@ -288,8 +290,10 @@ rowNode.setMaster(false); | ||
else { | ||
var masterDetail = this.gridOptionsService.get('masterDetail'); | ||
// this is the default, for when doing grid data | ||
if (this.doingMasterDetail) { | ||
if (masterDetail) { | ||
// if we are doing master detail, then the | ||
// default is that everything can be a Master Row. | ||
if (this.isRowMasterFunc) { | ||
rowNode.setMaster(this.isRowMasterFunc(data)); | ||
var isRowMasterFunc = this.gridOptionsService.get('isRowMaster'); | ||
if (isRowMasterFunc) { | ||
rowNode.setMaster(isRowMasterFunc(data)); | ||
} | ||
@@ -313,3 +317,3 @@ else { | ||
ClientSideNodeManager.prototype.isExpanded = function (level) { | ||
var expandByDefault = this.gridOptionsService.getNum('groupDefaultExpanded'); | ||
var expandByDefault = this.gridOptionsService.get('groupDefaultExpanded'); | ||
if (expandByDefault === -1) { | ||
@@ -316,0 +320,0 @@ return true; |
@@ -29,4 +29,10 @@ import { BeanStub, ChangedPath, IClientSideRowModel, RefreshModelParams, ClientSideRowModelStep, RowBounds, RowDataTransaction, RowNode, RowHighlightPosition, RowNodeTransaction, RowModelType } from "@ag-grid-community/core"; | ||
private applyAsyncTransactionsTimeout; | ||
/** Has the start method been called */ | ||
private hasStarted; | ||
/** E.g. data has been set into the node manager already */ | ||
private shouldSkipSettingDataOnStart; | ||
init(): void; | ||
private addPropertyListeners; | ||
start(): void; | ||
private setInitialData; | ||
ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean; | ||
@@ -74,6 +80,4 @@ private setRowTopAndRowIndex; | ||
private doRowGrouping; | ||
private restoreGroupState; | ||
private doFilter; | ||
private doPivot; | ||
private getGroupState; | ||
getCopyOfNodesMap(): { | ||
@@ -84,2 +88,3 @@ [id: string]: RowNode; | ||
setRowData(rowData: any[]): void; | ||
private dispatchUpdateEventsAndRefresh; | ||
batchUpdateRowData(rowDataTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void; | ||
@@ -105,2 +110,4 @@ flushAsyncTransactions(): void; | ||
private onGridStylesChanges; | ||
private onGridReady; | ||
isRowDataLoaded(): boolean; | ||
} |
@@ -38,6 +38,10 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
@@ -59,2 +63,6 @@ import { _, Autowired, Bean, BeanStub, ChangedPath, Events, Optional, PostConstruct, ClientSideRowModelSteps, RowNode, RowHighlightPosition, } from "@ag-grid-community/core"; | ||
_this.rowsToDisplay = []; // the rows mapped to rows to display | ||
/** Has the start method been called */ | ||
_this.hasStarted = false; | ||
/** E.g. data has been set into the node manager already */ | ||
_this.shouldSkipSettingDataOnStart = false; | ||
return _this; | ||
@@ -65,3 +73,3 @@ } | ||
var refreshEverythingFunc = this.refreshModel.bind(this, { step: ClientSideRowModelSteps.EVERYTHING }); | ||
var animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
var animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { | ||
@@ -81,29 +89,118 @@ step: ClientSideRowModelSteps.EVERYTHING, | ||
this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, this.onGridStylesChanges.bind(this)); | ||
var refreshMapListener = this.refreshModel.bind(this, { | ||
step: ClientSideRowModelSteps.MAP, | ||
keepRenderedRows: true, | ||
animate: animate | ||
}); | ||
this.addManagedPropertyListeners([ | ||
'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', | ||
'groupIncludeFooter', | ||
], refreshMapListener); | ||
var refreshAggListener = this.refreshModel.bind(this, { | ||
step: ClientSideRowModelSteps.AGGREGATE, | ||
keepRenderedRows: true, | ||
animate: animate | ||
}); | ||
this.addManagedPropertyListeners([ | ||
'groupIncludeTotalFooter', | ||
], refreshAggListener); | ||
this.addManagedListener(this.eventService, Events.EVENT_GRID_READY, function () { return _this.onGridReady(); }); | ||
// doesn't need done if doing full reset | ||
// Property listeners which call `refreshModel` at different stages | ||
this.addPropertyListeners(); | ||
this.rootNode = new RowNode(this.beans); | ||
this.nodeManager = new ClientSideNodeManager(this.rootNode, this.gridOptionsService, this.eventService, this.columnModel, this.selectionService, this.beans); | ||
this.addManagedPropertyListener('treeData', function () { | ||
// Shotgun reset all node state. This is used by treeData reactivity to ensure nodes don't include any group state | ||
_this.setRowData(_this.rootNode.allLeafChildren.map(function (child) { return child.data; })); | ||
}; | ||
ClientSideRowModel.prototype.addPropertyListeners = function () { | ||
// Omitted Properties | ||
// | ||
// We do not act reactively on all functional properties, as it's possible the application is React and | ||
// has not memoised the property and it's getting set every render. | ||
// | ||
// ** LIST OF NON REACTIVE, NO ARGUMENT | ||
// | ||
// getDataPath, getRowId, isRowMaster -- these are called once for each Node when the Node is created. | ||
// -- these are immutable Node properties (ie a Node ID cannot be changed) | ||
// | ||
// getRowHeight - this is called once when Node is created, if a new getRowHeight function is provided, | ||
// - we do not revisit the heights of each node. | ||
// | ||
// pivotDefaultExpanded - relevant for initial pivot column creation, no impact on existing pivot columns. | ||
// | ||
// deltaSort - this changes the type of algorithm used only, it doesn't change the sort order. so no point | ||
// - in doing the sort again as the same result will be got. the new Prop will be used next time we sort. | ||
// | ||
// ** LIST OF NON REACTIVE, SOME ARGUMENT | ||
// ** For these, they could be reactive, but not convinced the business argument is strong enough, | ||
// ** so leaving as non-reactive for now, and see if anyone complains. | ||
// | ||
// processPivotResultColDef, processPivotResultColGroupDef | ||
// - there is an argument for having these reactive, that if the application changes | ||
// - these props, we should re-create the Pivot Columns, however it's highly unlikely | ||
// - the application would change these functions, far more likely the functions were | ||
// - non memoised correctly. | ||
var _this = this; | ||
var resetProps = new Set([ | ||
'treeData', 'masterDetail', | ||
]); | ||
var groupStageRefreshProps = new Set([ | ||
'suppressParentsInRowNodes', 'groupDefaultExpanded', | ||
'groupAllowUnbalanced', 'initialGroupOrderComparator', | ||
'groupHideOpenParents', 'groupDisplayType', | ||
]); | ||
var filterStageRefreshProps = new Set([ | ||
'excludeChildrenWhenTreeDataFiltering', | ||
]); | ||
var pivotStageRefreshProps = new Set([ | ||
'removePivotHeaderRowWhenSingleValueColumn', 'pivotRowTotals', 'pivotColumnGroupTotals', 'suppressExpandablePivotGroups', | ||
]); | ||
var aggregateStageRefreshProps = new Set([ | ||
'getGroupRowAgg', 'alwaysAggregateAtRootLevel', 'groupIncludeTotalFooter', 'suppressAggFilteredOnly', | ||
]); | ||
var sortStageRefreshProps = new Set([ | ||
'postSortRows', 'groupDisplayType', 'accentedSort', | ||
]); | ||
var filterAggStageRefreshProps = new Set([]); | ||
var flattenStageRefreshProps = new Set([ | ||
'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', 'groupIncludeFooter', | ||
]); | ||
var allProps = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(resetProps), false), __read(groupStageRefreshProps), false), __read(filterStageRefreshProps), false), __read(pivotStageRefreshProps), false), __read(pivotStageRefreshProps), false), __read(aggregateStageRefreshProps), false), __read(sortStageRefreshProps), false), __read(filterAggStageRefreshProps), false), __read(flattenStageRefreshProps), false); | ||
this.addManagedPropertyListeners(allProps, function (params) { | ||
var _a; | ||
var properties = (_a = params.changeSet) === null || _a === void 0 ? void 0 : _a.properties; | ||
if (!properties) { | ||
return; | ||
} | ||
; | ||
var arePropertiesImpacted = function (propSet) { return (properties.some(function (prop) { return propSet.has(prop); })); }; | ||
if (arePropertiesImpacted(resetProps)) { | ||
_this.setRowData(_this.rootNode.allLeafChildren.map(function (child) { return child.data; })); | ||
return; | ||
} | ||
if (arePropertiesImpacted(groupStageRefreshProps)) { | ||
_this.refreshModel({ step: ClientSideRowModelSteps.EVERYTHING }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(filterStageRefreshProps)) { | ||
_this.refreshModel({ step: ClientSideRowModelSteps.FILTER }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(pivotStageRefreshProps)) { | ||
_this.refreshModel({ step: ClientSideRowModelSteps.PIVOT }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(aggregateStageRefreshProps)) { | ||
_this.refreshModel({ step: ClientSideRowModelSteps.AGGREGATE }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(sortStageRefreshProps)) { | ||
_this.refreshModel({ step: ClientSideRowModelSteps.SORT }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(filterAggStageRefreshProps)) { | ||
_this.refreshModel({ step: ClientSideRowModelSteps.FILTER_AGGREGATES }); | ||
return; | ||
} | ||
if (arePropertiesImpacted(flattenStageRefreshProps)) { | ||
_this.refreshModel({ step: ClientSideRowModelSteps.MAP }); | ||
} | ||
}); | ||
this.addManagedPropertyListener('rowHeight', function () { return _this.resetRowHeights(); }); | ||
}; | ||
ClientSideRowModel.prototype.start = function () { | ||
this.hasStarted = true; | ||
if (this.shouldSkipSettingDataOnStart) { | ||
this.dispatchUpdateEventsAndRefresh(); | ||
} | ||
else { | ||
this.setInitialData(); | ||
} | ||
}; | ||
ClientSideRowModel.prototype.setInitialData = function () { | ||
var rowData = this.gridOptionsService.get('rowData'); | ||
if (rowData) { | ||
this.shouldSkipSettingDataOnStart = true; | ||
this.setRowData(rowData); | ||
@@ -201,3 +298,3 @@ } | ||
var rowNodeAtPixelNow = this.getRow(indexAtPixelNow); | ||
var animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
var animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
if (rowNodeAtPixelNow === rowNodes[0]) { | ||
@@ -275,3 +372,3 @@ return false; | ||
var rowNode = this.rootNode.childrenAfterSort[topLevelIndex]; | ||
if (this.gridOptionsService.is('groupHideOpenParents')) { | ||
if (this.gridOptionsService.get('groupHideOpenParents')) { | ||
// if hideOpenParents, and this row open, then this row is now displayed at this index, first child is | ||
@@ -335,3 +432,3 @@ while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) { | ||
var changedPath = new ChangedPath(false, this.rootNode); | ||
if (noTransactions || this.gridOptionsService.is('treeData')) { | ||
if (noTransactions || this.gridOptionsService.get('treeData')) { | ||
changedPath.setInactive(); | ||
@@ -342,3 +439,3 @@ } | ||
ClientSideRowModel.prototype.isSuppressModelUpdateAfterUpdateTransaction = function (params) { | ||
if (!this.gridOptionsService.is('suppressModelUpdateAfterUpdateTransaction')) { | ||
if (!this.gridOptionsService.get('suppressModelUpdateAfterUpdateTransaction')) { | ||
return false; | ||
@@ -371,6 +468,6 @@ } | ||
if (_.missing(paramsStep)) { | ||
console.error("AG Grid: invalid step " + step + ", available steps are " + Object.keys(stepsMapped).join(', ')); | ||
console.error("AG Grid: invalid step ".concat(step, ", available steps are ").concat(Object.keys(stepsMapped).join(', '))); | ||
return undefined; | ||
} | ||
var animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
var animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
var modelParams = { | ||
@@ -385,2 +482,5 @@ step: paramsStep, | ||
ClientSideRowModel.prototype.refreshModel = function (paramsOrStep) { | ||
if (!this.hasStarted) { | ||
return; | ||
} | ||
var params = typeof paramsOrStep === 'object' && "step" in paramsOrStep ? paramsOrStep : this.buildRefreshModelParams(paramsOrStep); | ||
@@ -406,3 +506,3 @@ if (!params) { | ||
case ClientSideRowModelSteps.EVERYTHING: | ||
this.doRowGrouping(params.groupState, params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged); | ||
this.doRowGrouping(params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged); | ||
case ClientSideRowModelSteps.FILTER: | ||
@@ -448,3 +548,3 @@ this.doFilter(changedPath); | ||
var result = []; | ||
var groupsSelectChildren = this.gridOptionsService.is('groupSelectsChildren'); | ||
var groupsSelectChildren = this.gridOptionsService.get('groupSelectsChildren'); | ||
this.forEachNodeAfterFilterAndSort(function (rowNode) { | ||
@@ -462,3 +562,3 @@ // range has been closed, skip till end | ||
if (rowNode.group && groupsSelectChildren) { | ||
result.push.apply(result, __spreadArray([], __read(rowNode.allLeafChildren))); | ||
result.push.apply(result, __spreadArray([], __read(rowNode.allLeafChildren), false)); | ||
return; | ||
@@ -556,3 +656,3 @@ } | ||
this.recursivelyWalkNodesAndCallback({ | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterGroup || []))), | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterGroup || [])), false), | ||
callback: callback, | ||
@@ -567,3 +667,3 @@ recursionType: RecursionType.Normal, | ||
this.recursivelyWalkNodesAndCallback({ | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterAggFilter || []))), | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterAggFilter || [])), false), | ||
callback: callback, | ||
@@ -578,3 +678,3 @@ recursionType: RecursionType.AfterFilter, | ||
this.recursivelyWalkNodesAndCallback({ | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterSort || []))), | ||
nodes: __spreadArray([], __read((this.rootNode.childrenAfterSort || [])), false), | ||
callback: callback, | ||
@@ -629,3 +729,3 @@ recursionType: RecursionType.AfterFilterAndSort, | ||
index = this.recursivelyWalkNodesAndCallback({ | ||
nodes: __spreadArray([], __read(nodeChildren)), | ||
nodes: __spreadArray([], __read(nodeChildren), false), | ||
callback: callback, | ||
@@ -644,3 +744,3 @@ recursionType: recursionType, | ||
if (isRootNode) { | ||
var totalFooters = this.gridOptionsService.is('groupIncludeTotalFooter'); | ||
var totalFooters = this.gridOptionsService.get('groupIncludeTotalFooter'); | ||
if (!totalFooters) | ||
@@ -677,3 +777,3 @@ return index; | ||
ClientSideRowModel.prototype.expandOrCollapseAll = function (expand) { | ||
var usingTreeData = this.gridOptionsService.is('treeData'); | ||
var usingTreeData = this.gridOptionsService.get('treeData'); | ||
var usingPivotMode = this.columnModel.isPivotActive(); | ||
@@ -727,3 +827,3 @@ var recursiveExpandOrCollapse = function (rowNodes) { | ||
}; | ||
ClientSideRowModel.prototype.doRowGrouping = function (groupState, rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) { | ||
ClientSideRowModel.prototype.doRowGrouping = function (rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) { | ||
if (this.groupStage) { | ||
@@ -744,6 +844,4 @@ if (rowNodeTransactions) { | ||
}); | ||
// set open/closed state on groups | ||
this.restoreGroupState(groupState); | ||
} | ||
if (this.gridOptionsService.is('groupSelectsChildren')) { | ||
if (this.gridOptionsService.get('groupSelectsChildren')) { | ||
var selectionChanged = this.selectionService.updateGroupsFromChildrenSelections('rowGroupChanged', changedPath); | ||
@@ -766,14 +864,4 @@ if (selectionChanged) { | ||
} | ||
}; | ||
ClientSideRowModel.prototype.restoreGroupState = function (groupState) { | ||
if (!groupState) { | ||
return; | ||
} | ||
_.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { | ||
// if the group was open last time, then open it this time. however | ||
// if was not open last time, then don't touch the group, so the 'groupDefaultExpanded' | ||
// setting will take effect. | ||
if (typeof groupState[key] === 'boolean') { | ||
node.expanded = groupState[key]; | ||
} | ||
this.eventService.dispatchEventOnce({ | ||
type: Events.EVENT_ROW_COUNT_READY | ||
}); | ||
@@ -789,10 +877,2 @@ }; | ||
}; | ||
ClientSideRowModel.prototype.getGroupState = function () { | ||
if (!this.rootNode.childrenAfterGroup || !this.gridOptionsService.is('rememberGroupStateWhenNewData')) { | ||
return null; | ||
} | ||
var result = {}; | ||
_.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { return result[key] = node.expanded; }); | ||
return result; | ||
}; | ||
ClientSideRowModel.prototype.getCopyOfNodesMap = function () { | ||
@@ -823,9 +903,10 @@ return this.nodeManager.getCopyOfNodesMap(); | ||
// so new rowNodes means the cache is wiped anyway. | ||
// remember group state, so we can expand groups that should be expanded | ||
var groupState = this.getGroupState(); | ||
// - clears selection, done before we set row data to ensure it isn't readded via `selectionService.syncInOldRowNode` | ||
this.selectionService.reset('rowDataChanged'); | ||
this.nodeManager.setRowData(rowData); | ||
// - clears selection | ||
this.selectionService.reset(); | ||
// - updates filters | ||
this.filterManager.onNewRowsLoaded('rowDataUpdated'); | ||
if (this.hasStarted) { | ||
this.dispatchUpdateEventsAndRefresh(); | ||
} | ||
}; | ||
ClientSideRowModel.prototype.dispatchUpdateEventsAndRefresh = function () { | ||
// this event kicks off: | ||
@@ -839,4 +920,3 @@ // - shows 'no rows' overlay if needed | ||
step: ClientSideRowModelSteps.EVERYTHING, | ||
groupState: groupState, | ||
newData: true | ||
newData: true, | ||
}); | ||
@@ -909,3 +989,3 @@ }; | ||
ClientSideRowModel.prototype.createRowNodeOrder = function () { | ||
var suppressSortOrder = this.gridOptionsService.is('suppressMaintainUnsortedOrder'); | ||
var suppressSortOrder = this.gridOptionsService.get('suppressMaintainUnsortedOrder'); | ||
if (suppressSortOrder) { | ||
@@ -925,6 +1005,13 @@ return; | ||
ClientSideRowModel.prototype.commonUpdateRowData = function (rowNodeTrans, rowNodeOrder, forceRowNodeOrder) { | ||
var animate = !this.gridOptionsService.is('suppressAnimationFrame'); | ||
if (!this.hasStarted) { | ||
return; | ||
} | ||
var animate = !this.gridOptionsService.get('suppressAnimationFrame'); | ||
if (forceRowNodeOrder) { | ||
rowNodeOrder = this.createRowNodeOrder(); | ||
} | ||
var event = { | ||
type: Events.EVENT_ROW_DATA_UPDATED | ||
}; | ||
this.eventService.dispatchEvent(event); | ||
this.refreshModel({ | ||
@@ -938,8 +1025,2 @@ step: ClientSideRowModelSteps.EVERYTHING, | ||
}); | ||
// - updates filters | ||
this.filterManager.onNewRowsLoaded('rowDataUpdated'); | ||
var event = { | ||
type: Events.EVENT_ROW_DATA_UPDATED | ||
}; | ||
this.eventService.dispatchEvent(event); | ||
}; | ||
@@ -997,2 +1078,12 @@ ClientSideRowModel.prototype.doRowsToDisplay = function () { | ||
}; | ||
ClientSideRowModel.prototype.onGridReady = function () { | ||
if (this.hasStarted) { | ||
return; | ||
} | ||
// App can start using API to add transactions, so need to add data into the node manager if not started | ||
this.setInitialData(); | ||
}; | ||
ClientSideRowModel.prototype.isRowDataLoaded = function () { | ||
return this.nodeManager.hasData(); | ||
}; | ||
__decorate([ | ||
@@ -999,0 +1090,0 @@ Autowired('columnModel') |
@@ -92,3 +92,3 @@ var __extends = (this && this.__extends) || (function () { | ||
FilterService.prototype.doingTreeDataFiltering = function () { | ||
return this.gridOptionsService.is('treeData') && !this.gridOptionsService.is('excludeChildrenWhenTreeDataFiltering'); | ||
return this.gridOptionsService.get('treeData') && !this.gridOptionsService.get('excludeChildrenWhenTreeDataFiltering'); | ||
}; | ||
@@ -95,0 +95,0 @@ __decorate([ |
@@ -54,4 +54,4 @@ var __extends = (this && this.__extends) || (function () { | ||
// these two are mutually exclusive, so if first set, we don't set the second | ||
var groupRemoveSingleChildren = this.gridOptionsService.is('groupRemoveSingleChildren'); | ||
var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsService.is('groupRemoveLowestSingleChildren'); | ||
var groupRemoveSingleChildren = this.gridOptionsService.get('groupRemoveSingleChildren'); | ||
var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsService.get('groupRemoveLowestSingleChildren'); | ||
return { | ||
@@ -61,4 +61,4 @@ groupRemoveLowestSingleChildren: groupRemoveLowestSingleChildren, | ||
isGroupMultiAutoColumn: this.gridOptionsService.isGroupMultiAutoColumn(), | ||
hideOpenParents: this.gridOptionsService.is('groupHideOpenParents'), | ||
groupIncludeTotalFooter: this.gridOptionsService.is('groupIncludeTotalFooter'), | ||
hideOpenParents: this.gridOptionsService.get('groupHideOpenParents'), | ||
groupIncludeTotalFooter: this.gridOptionsService.get('groupIncludeTotalFooter'), | ||
getGroupIncludeFooter: this.gridOptionsService.getGroupIncludeFooter(), | ||
@@ -65,0 +65,0 @@ }; |
@@ -5,2 +5,3 @@ import { BeanStub, IImmutableService } from "@ag-grid-community/core"; | ||
private rowRenderer; | ||
private selectionService; | ||
private clientSideRowModel; | ||
@@ -11,2 +12,3 @@ private postConstruct; | ||
private createTransactionForRowData; | ||
private onRowDataUpdated; | ||
} |
@@ -45,4 +45,6 @@ var __extends = (this && this.__extends) || (function () { | ||
ImmutableService.prototype.postConstruct = function () { | ||
var _this = this; | ||
if (this.rowModel.getType() === 'clientSide') { | ||
this.clientSideRowModel = this.rowModel; | ||
this.addManagedPropertyListener('rowData', function () { return _this.onRowDataUpdated(); }); | ||
} | ||
@@ -54,3 +56,3 @@ }; | ||
// the old behaviour of Row ID's but NOT Immutable Data. | ||
var resetRowDataOnUpdate = this.gridOptionsService.is('resetRowDataOnUpdate'); | ||
var resetRowDataOnUpdate = this.gridOptionsService.get('resetRowDataOnUpdate'); | ||
if (resetRowDataOnUpdate) { | ||
@@ -87,3 +89,3 @@ return false; | ||
var existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap(); | ||
var suppressSortOrder = this.gridOptionsService.is('suppressMaintainUnsortedOrder'); | ||
var suppressSortOrder = this.gridOptionsService.get('suppressMaintainUnsortedOrder'); | ||
var orderMap = suppressSortOrder ? undefined : {}; | ||
@@ -123,2 +125,15 @@ if (_.exists(rowData)) { | ||
}; | ||
ImmutableService.prototype.onRowDataUpdated = function () { | ||
var rowData = this.gridOptionsService.get('rowData'); | ||
if (!rowData) { | ||
return; | ||
} | ||
if (this.isActive()) { | ||
this.setRowData(rowData); | ||
} | ||
else { | ||
this.selectionService.reset('rowDataChanged'); | ||
this.clientSideRowModel.setRowData(rowData); | ||
} | ||
}; | ||
__decorate([ | ||
@@ -131,2 +146,5 @@ Autowired('rowModel') | ||
__decorate([ | ||
Autowired('selectionService') | ||
], ImmutableService.prototype, "selectionService", void 0); | ||
__decorate([ | ||
PostConstruct | ||
@@ -133,0 +151,0 @@ ], ImmutableService.prototype, "postConstruct", null); |
@@ -5,4 +5,2 @@ import { SortOption, ChangedPath, BeanStub, RowNodeTransaction } from "@ag-grid-community/core"; | ||
private rowNodeSorter; | ||
private postSortFunc; | ||
init(): void; | ||
sort(sortOptions: SortOption[], sortActive: boolean, useDeltaSort: boolean, rowNodeTransactions: RowNodeTransaction[] | null | undefined, changedPath: ChangedPath | undefined, sortContainsGroupColumns: boolean): void; | ||
@@ -9,0 +7,0 @@ private calculateDirtyNodes; |
@@ -22,3 +22,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 SortService = /** @class */ (function (_super) { | ||
@@ -29,8 +29,5 @@ __extends(SortService, _super); | ||
} | ||
SortService.prototype.init = function () { | ||
this.postSortFunc = this.gridOptionsService.getCallback('postSortRows'); | ||
}; | ||
SortService.prototype.sort = function (sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) { | ||
var _this = this; | ||
var groupMaintainOrder = this.gridOptionsService.is('groupMaintainOrder'); | ||
var groupMaintainOrder = this.gridOptionsService.get('groupMaintainOrder'); | ||
var groupColumnsPresent = this.columnModel.getAllGridColumns().some(function (c) { return c.isRowGroupActive(); }); | ||
@@ -42,2 +39,3 @@ var allDirtyNodes = {}; | ||
var isPivotMode = this.columnModel.isPivotMode(); | ||
var postSortFunc = this.gridOptionsService.getCallback('postSortRows'); | ||
var callback = function (rowNode) { | ||
@@ -77,5 +75,5 @@ // we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
_this.updateChildIndexes(rowNode); | ||
if (_this.postSortFunc) { | ||
if (postSortFunc) { | ||
var params = { nodes: rowNode.childrenAfterSort }; | ||
_this.postSortFunc(params); | ||
postSortFunc(params); | ||
} | ||
@@ -178,8 +176,7 @@ }; | ||
var _this = this; | ||
if (!this.gridOptionsService.is('groupHideOpenParents')) { | ||
if (!this.gridOptionsService.get('groupHideOpenParents')) { | ||
return; | ||
} | ||
if (this.gridOptionsService.is('treeData')) { | ||
var msg_1 = "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)."; | ||
_.doOnce(function () { return console.warn(msg_1); }, 'sortService.hideOpenParentsWithTreeData'); | ||
if (this.gridOptionsService.get('treeData')) { | ||
_.warnOnce("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."); | ||
return false; | ||
@@ -202,3 +199,3 @@ } | ||
var _this = this; | ||
if (!this.gridOptionsService.is('groupHideOpenParents') || _.missing(rowNodes)) { | ||
if (!this.gridOptionsService.get('groupHideOpenParents') || _.missing(rowNodes)) { | ||
return; | ||
@@ -240,5 +237,2 @@ } | ||
], SortService.prototype, "rowNodeSorter", void 0); | ||
__decorate([ | ||
PostConstruct | ||
], SortService.prototype, "init", null); | ||
SortService = __decorate([ | ||
@@ -245,0 +239,0 @@ Bean('sortService') |
@@ -1,7 +0,6 @@ | ||
import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub { | ||
import { StageExecuteParams, BeanStub, IRowNodeStage } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub implements IRowNodeStage { | ||
private sortService; | ||
private sortController; | ||
private columnModel; | ||
execute(params: StageExecuteParams): void; | ||
} |
@@ -38,3 +38,3 @@ var __extends = (this && this.__extends) || (function () { | ||
// rolling out to everyone. | ||
&& this.gridOptionsService.is('deltaSort'); | ||
&& this.gridOptionsService.get('deltaSort'); | ||
var sortContainsGroupColumns = sortOptions.some(function (opt) { | ||
@@ -55,5 +55,2 @@ var isSortingCoupled = _this.gridOptionsService.isColumnsSortingCoupledToGroup(); | ||
], SortStage.prototype, "sortController", void 0); | ||
__decorate([ | ||
Autowired('columnModel') | ||
], SortStage.prototype, "columnModel", void 0); | ||
SortStage = __decorate([ | ||
@@ -60,0 +57,0 @@ Bean('sortStage') |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "30.2.1"; | ||
export declare const VERSION = "31.0.0"; |
// DO NOT UPDATE MANUALLY: Generated from script during build time | ||
export var VERSION = '30.2.1'; | ||
export var VERSION = '31.0.0'; |
@@ -12,8 +12,5 @@ import { Beans, ColumnModel, EventService, RowDataTransaction, RowNode, RowNodeTransaction, GridOptionsService, ISelectionService } from "@ag-grid-community/core"; | ||
private static ROOT_NODE_ID; | ||
private isRowMasterFunc?; | ||
private suppressParentsInRowNodes; | ||
private doingMasterDetail; | ||
private allNodesMap; | ||
private dataLoaded; | ||
constructor(rootNode: RowNode, gridOptionsService: GridOptionsService, eventService: EventService, columnModel: ColumnModel, selectionService: ISelectionService, beans: Beans); | ||
postConstruct(): void; | ||
getCopyOfNodesMap(): { | ||
@@ -27,2 +24,3 @@ [id: string]: RowNode; | ||
} | null | undefined): RowNodeTransaction; | ||
hasData(): boolean; | ||
private dispatchRowDataUpdateStartedEvent; | ||
@@ -29,0 +27,0 @@ private updateSelection; |
@@ -29,4 +29,10 @@ import { BeanStub, ChangedPath, IClientSideRowModel, RefreshModelParams, ClientSideRowModelStep, RowBounds, RowDataTransaction, RowNode, RowHighlightPosition, RowNodeTransaction, RowModelType } from "@ag-grid-community/core"; | ||
private applyAsyncTransactionsTimeout; | ||
/** Has the start method been called */ | ||
private hasStarted; | ||
/** E.g. data has been set into the node manager already */ | ||
private shouldSkipSettingDataOnStart; | ||
init(): void; | ||
private addPropertyListeners; | ||
start(): void; | ||
private setInitialData; | ||
ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean; | ||
@@ -74,6 +80,4 @@ private setRowTopAndRowIndex; | ||
private doRowGrouping; | ||
private restoreGroupState; | ||
private doFilter; | ||
private doPivot; | ||
private getGroupState; | ||
getCopyOfNodesMap(): { | ||
@@ -84,2 +88,3 @@ [id: string]: RowNode; | ||
setRowData(rowData: any[]): void; | ||
private dispatchUpdateEventsAndRefresh; | ||
batchUpdateRowData(rowDataTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void; | ||
@@ -105,2 +110,4 @@ flushAsyncTransactions(): void; | ||
private onGridStylesChanges; | ||
private onGridReady; | ||
isRowDataLoaded(): boolean; | ||
} |
@@ -5,2 +5,3 @@ import { BeanStub, IImmutableService } from "@ag-grid-community/core"; | ||
private rowRenderer; | ||
private selectionService; | ||
private clientSideRowModel; | ||
@@ -11,2 +12,3 @@ private postConstruct; | ||
private createTransactionForRowData; | ||
private onRowDataUpdated; | ||
} |
@@ -5,4 +5,2 @@ import { SortOption, ChangedPath, BeanStub, RowNodeTransaction } from "@ag-grid-community/core"; | ||
private rowNodeSorter; | ||
private postSortFunc; | ||
init(): void; | ||
sort(sortOptions: SortOption[], sortActive: boolean, useDeltaSort: boolean, rowNodeTransactions: RowNodeTransaction[] | null | undefined, changedPath: ChangedPath | undefined, sortContainsGroupColumns: boolean): void; | ||
@@ -9,0 +7,0 @@ private calculateDirtyNodes; |
@@ -1,7 +0,6 @@ | ||
import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub { | ||
import { StageExecuteParams, BeanStub, IRowNodeStage } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub implements IRowNodeStage { | ||
private sortService; | ||
private sortController; | ||
private columnModel; | ||
execute(params: StageExecuteParams): void; | ||
} |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "30.2.1"; | ||
export declare const VERSION = "31.0.0"; |
{ | ||
"name": "@ag-grid-community/client-side-row-model", | ||
"version": "30.2.1", | ||
"version": "31.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -9,3 +9,3 @@ "main": "./dist/esm/es6/main.mjs", | ||
"scripts": { | ||
"clean": "rimraf dist .hash", | ||
"clean": "rimraf dist", | ||
"build-cjs": "rimraf dist/tsconfig.cjs.es5.docs.tsbuildinfo && npx tsc -p tsconfig.cjs.es5.json && npx tsc -p tsconfig.cjs.es6.json", | ||
@@ -51,6 +51,6 @@ "build-esm": "npx tsc -p tsconfig.esm.es5.json && npx tsc -p tsconfig.esm.es6.json", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~30.2.1" | ||
"@ag-grid-community/core": "~31.0.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "~4.3.5", | ||
"typescript": "~4.7.4", | ||
"rimraf": "3.0.2", | ||
@@ -57,0 +57,0 @@ "jest": "^29.5.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4153317
65526
+ Added@ag-grid-community/core@31.0.3(transitive)
- Removed@ag-grid-community/core@30.2.1(transitive)