@ag-grid-community/client-side-row-model
Advanced tools
Comparing version 26.1.0 to 26.2.0
@@ -34,3 +34,2 @@ import { ColumnApi, ColumnModel, EventService, GridApi, GridOptionsWrapper, RowDataTransaction, RowNode, RowNodeTransaction, SelectionService, Beans } from "@ag-grid-community/core"; | ||
private lookupRowNode; | ||
private recursiveFunction; | ||
private createNode; | ||
@@ -37,0 +36,0 @@ private setMasterForRow; |
@@ -49,19 +49,33 @@ "use strict"; | ||
ClientSideNodeManager.prototype.setRowData = function (rowData) { | ||
this.rootNode.childrenAfterFilter = null; | ||
this.rootNode.childrenAfterGroup = null; | ||
this.rootNode.childrenAfterSort = null; | ||
this.rootNode.childrenMapped = null; | ||
this.rootNode.updateHasChildren(); | ||
var _this = this; | ||
if (typeof rowData === 'string') { | ||
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'); | ||
return; | ||
} | ||
var rootNode = this.rootNode; | ||
var sibling = this.rootNode.sibling; | ||
rootNode.childrenAfterFilter = null; | ||
rootNode.childrenAfterGroup = null; | ||
rootNode.childrenAfterSort = null; | ||
rootNode.childrenMapped = null; | ||
rootNode.updateHasChildren(); | ||
this.nextId = 0; | ||
this.allNodesMap = {}; | ||
if (!rowData) { | ||
this.rootNode.allLeafChildren = []; | ||
this.rootNode.childrenAfterGroup = []; | ||
return; | ||
if (rowData) { | ||
// we use rootNode as the parent, however if using ag-grid-enterprise, the grouping stage | ||
// sets the parent node on each row (even if we are not grouping). so setting parent node | ||
// here is for benefit of ag-grid-community users | ||
rootNode.allLeafChildren = rowData.map(function (dataItem) { return _this.createNode(dataItem, _this.rootNode, ClientSideNodeManager.TOP_LEVEL); }); | ||
} | ||
// kick off recursion | ||
// we add rootNode as the parent, however if using ag-grid-enterprise, the grouping stage | ||
// sets the parent node on each row (even if we are not grouping). so setting parent node | ||
// here is for benefit of ag-grid-community users | ||
this.rootNode.allLeafChildren = this.recursiveFunction(rowData, this.rootNode, ClientSideNodeManager.TOP_LEVEL); | ||
else { | ||
rootNode.allLeafChildren = []; | ||
rootNode.childrenAfterGroup = []; | ||
} | ||
if (sibling) { | ||
sibling.childrenAfterFilter = rootNode.childrenAfterFilter; | ||
sibling.childrenAfterGroup = rootNode.childrenAfterGroup; | ||
sibling.childrenAfterSort = rootNode.childrenAfterSort; | ||
sibling.childrenMapped = rootNode.childrenMapped; | ||
sibling.allLeafChildren = rootNode.allLeafChildren; | ||
} | ||
}; | ||
@@ -126,2 +140,5 @@ ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) { | ||
} | ||
if (this.rootNode.sibling) { | ||
this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren; | ||
} | ||
// add new row nodes to the transaction add items | ||
@@ -157,2 +174,5 @@ rowNodeTransaction.add = newNodes; | ||
this.rootNode.allLeafChildren = this.rootNode.allLeafChildren.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; }); | ||
if (this.rootNode.sibling) { | ||
this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren; | ||
} | ||
}; | ||
@@ -201,16 +221,2 @@ ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) { | ||
}; | ||
ClientSideNodeManager.prototype.recursiveFunction = function (rowData, parent, level) { | ||
var _this = this; | ||
// make sure the rowData is an array and not a string of json - this was a commonly reported problem on the forum | ||
if (typeof rowData === 'string') { | ||
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'); | ||
return; | ||
} | ||
var rowNodes = []; | ||
rowData.forEach(function (dataItem) { | ||
var node = _this.createNode(dataItem, parent, level); | ||
rowNodes.push(node); | ||
}); | ||
return rowNodes; | ||
}; | ||
ClientSideNodeManager.prototype.createNode = function (dataItem, parent, level) { | ||
@@ -217,0 +223,0 @@ var node = new core_1.RowNode(this.beans); |
@@ -573,2 +573,5 @@ "use strict"; | ||
this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren; | ||
if (this.rootNode.sibling) { | ||
this.rootNode.sibling.childrenAfterGroup = this.rootNode.childrenAfterGroup; | ||
} | ||
this.rootNode.updateHasChildren(); | ||
@@ -575,0 +578,0 @@ } |
@@ -64,2 +64,5 @@ "use strict"; | ||
} | ||
if (rowNode.sibling) { | ||
rowNode.sibling.childrenAfterFilter = rowNode.childrenAfterFilter; | ||
} | ||
}; | ||
@@ -66,0 +69,0 @@ if (this.doingTreeDataFiltering()) { |
@@ -34,2 +34,3 @@ "use strict"; | ||
var groupMaintainOrder = this.gridOptionsWrapper.isGroupMaintainOrder(); | ||
var groupColumnsPresent = core_1._.some(this.columnModel.getAllGridColumns(), function (c) { return c.isRowGroupActive(); }); | ||
var callback = function (rowNode) { | ||
@@ -43,5 +44,5 @@ // we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
// when 'groupMaintainOrder' is enabled we skip sorting groups unless we are sorting on group columns | ||
var skipSortingGroups = groupMaintainOrder && !rowNode.leafGroup && !sortContainsGroupColumns; | ||
var skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns; | ||
if (skipSortingGroups) { | ||
rowNode.childrenAfterSort = rowNode.childrenAfterSort.slice(0); | ||
rowNode.childrenAfterSort = rowNode.childrenAfterFilter.slice(0); | ||
} | ||
@@ -55,5 +56,7 @@ else { | ||
else { | ||
rowNode.childrenAfterSort = groupMaintainOrder && rowNode.childrenAfterSort ? | ||
rowNode.childrenAfterSort.slice(0) : rowNode.childrenAfterFilter.slice(0); | ||
rowNode.childrenAfterSort = rowNode.childrenAfterFilter.slice(0); | ||
} | ||
if (rowNode.sibling) { | ||
rowNode.sibling.childrenAfterSort = rowNode.childrenAfterSort; | ||
} | ||
_this.updateChildIndexes(rowNode); | ||
@@ -60,0 +63,0 @@ if (_this.postSortFunc) { |
/** | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0 | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0 | ||
* @link http://www.ag-grid.com/ | ||
@@ -8,6 +8,6 @@ ' * @license MIT | ||
/** | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0 | ||
* @ag-grid-community/client-side-row-model - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0 | ||
* @link http://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(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<o;t++)for(var n=arguments[t],s=0,a=n.length;s<a;s++,i++)r[i]=n[s];return r},i=function(){function e(t,o,r,i,n,s,a,d){this.nextId=0,this.allNodesMap={},this.rootNode=t,this.gridOptionsWrapper=o,this.eventService=r,this.columnModel=i,this.gridApi=n,this.columnApi=s,this.beans=d,this.selectionService=a,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterFilter=[],this.postConstruct()}return e.prototype.postConstruct=function(){this.suppressParentsInRowNodes=this.gridOptionsWrapper.isSuppressParentsInRowNodes(),this.isRowMasterFunc=this.gridOptionsWrapper.getIsRowMasterFunc(),this.doingTreeData=this.gridOptionsWrapper.isTreeData(),this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},e.prototype.getCopyOfNodesMap=function(){return o._.cloneObject(this.allNodesMap)},e.prototype.getRowNode=function(e){return this.allNodesMap[e]},e.prototype.setRowData=function(t){if(this.rootNode.childrenAfterFilter=null,this.rootNode.childrenAfterGroup=null,this.rootNode.childrenAfterSort=null,this.rootNode.childrenMapped=null,this.rootNode.updateHasChildren(),this.nextId=0,this.allNodesMap={},!t)return this.rootNode.allLeafChildren=[],void(this.rootNode.childrenAfterGroup=[]);this.rootNode.allLeafChildren=this.recursiveFunction(t,this.rootNode,e.TOP_LEVEL)},e.prototype.updateRowData=function(e,t){var r={remove:[],update:[],add:[]},i=[];return this.executeRemove(e,r,i),this.executeUpdate(e,r,i),this.executeAdd(e,r),this.updateSelection(i),t&&o._.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),r},e.prototype.updateSelection=function(e){var t=e.length>0;if(t&&e.forEach((function(e){e.setSelected(!1,!1,!0)})),this.selectionService.updateGroupsFromChildrenSelections(),t){var r={type:o.Events.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)}},e.prototype.executeAdd=function(t,i){var n=this,s=t.add,a=t.addIndex;if(!o._.missingOrEmpty(s)){var d=s.map((function(t){return n.createNode(t,n.rootNode,e.TOP_LEVEL)}));if("number"==typeof a&&a>=0){var p=this.rootNode.allLeafChildren,l=p.slice(0,a),h=p.slice(a,p.length);this.rootNode.allLeafChildren=r(l,d,h)}else this.rootNode.allLeafChildren=r(this.rootNode.allLeafChildren,d);i.add=d}},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]}))}},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,r=this.gridOptionsWrapper.getRowNodeIdFunc();if(o._.exists(r)){var i=r(e);if(!(t=this.allNodesMap[i]))return console.error("AG Grid: could not find row id="+i+", data item was not found for this id"),null}else if(!(t=o._.find(this.rootNode.allLeafChildren,(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 getRowNodeId to help the Grid find matching row data"),null;return t},e.prototype.recursiveFunction=function(e,t,o){var r=this;if("string"!=typeof e){var i=[];return e.forEach((function(e){var n=r.createNode(e,t,o);i.push(n)})),i}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.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 getRowNodeId callback, this could cause issues in your grid."),this.allNodesMap[i.id]=i,this.nextId++,i},e.prototype.setMasterForRow=function(e,t,o,r){if(this.doingTreeData)e.setMaster(!1),r&&(e.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?e.setMaster(this.isRowMasterFunc(t)):e.setMaster(!0):e.setMaster(!1),r){var i=this.columnModel.getRowGroupColumns(),n=o+(i?i.length:0);e.expanded=!!e.master&&this.isExpanded(n)}},e.prototype.isExpanded=function(e){var t=this.gridOptionsWrapper.getGroupDefaultExpanded();return-1===t||e<t},e.TOP_LEVEL=0,e.ROOT_NODE_ID="ROOT_NODE_ID",e}(),n=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),s=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};!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 a=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.init=function(){var e=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING}),t=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:!0});this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,t),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.PIVOT})),this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,e);var r=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:!0});this.addManagedListener(this.gridOptionsWrapper,o.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN,r),this.addManagedListener(this.gridOptionsWrapper,o.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,r),this.rootNode=new o.RowNode(this.beans),this.nodeManager=new i(this.rootNode,this.gridOptionsWrapper,this.eventService,this.columnModel,this.gridApi,this.columnApi,this.selectionService,this.beans)},r.prototype.start=function(){var e=this.gridOptionsWrapper.getRowData();e&&this.setRowData(e)},r.prototype.ensureRowHeightsValid=function(e,t,o,r){var i,n=!1;do{i=!1;for(var s=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),d=Math.max(s,o),p=Math.min(a,r),l=d;l<=p;l++){var h=this.getRow(l);if(h.rowHeightEstimated){var u=this.gridOptionsWrapper.getRowHeightForNode(h);h.setRowHeight(u.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n},r.prototype.setRowTopAndRowIndex=function(){for(var e=this.gridOptionsWrapper.getDefaultRowHeight(),t=0,r=new Set,i=this.gridOptionsWrapper.getDomLayout()===o.Constants.DOM_LAYOUT_NORMAL,n=0;n<this.rowsToDisplay.length;n++){var s=this.rowsToDisplay[n];if(null!=s.id&&r.add(s.id),null==s.rowHeight){var a=this.gridOptionsWrapper.getRowHeightForNode(s,i,e);s.setRowHeight(a.height,a.estimated)}s.setRowTop(t),s.setRowIndex(n),t+=s.rowHeight}return r},r.prototype.clearRowTopAndRowIndex=function(e,t){var o=e.isActive(),r=function(e){e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},i=function(e){if(r(e),r(e.detailNode),r(e.sibling),e.hasChildren()&&e.childrenAfterGroup){var t=-1==e.level;o&&!t&&!e.expanded||e.childrenAfterGroup.forEach(i)}};i(this.rootNode)},r.prototype.ensureRowsAtPixel=function(e,t,r){var i=this;void 0===r&&(r=0);var n=this.getRowIndexAtPixel(t);return this.getRow(n)!==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,animate:!0,keepEditingRows:!0}),!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(){return this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode?1:this.rootNode.childrenAfterFilter?this.rootNode.childrenAfterFilter.length:0},r.prototype.getTopLevelRowDisplayedIndex=function(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;var t=this.rootNode.childrenAfterSort[e];if(this.gridOptionsWrapper.isGroupHideOpenParents())for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},r.prototype.getRowBounds=function(e){if(o._.missing(this.rowsToDisplay))return null;var t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null},r.prototype.onRowGroupOpened=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})},r.prototype.onFilterChanged=function(e){if(!e.afterDataChange){var t=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.FILTER,keepRenderedRows:!0,animate:t})}},r.prototype.onSortChanged=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})},r.prototype.getType=function(){return o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE},r.prototype.onValueChanged=function(){this.columnModel.isPivotActive()?this.refreshModel({step:o.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:o.ClientSideRowModelSteps.AGGREGATE})},r.prototype.createChangePath=function(e){var t=o._.missingOrEmpty(e),r=new o.ChangedPath(!1,this.rootNode);return(t||this.gridOptionsWrapper.isTreeData())&&r.setInactive(),r},r.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(e){if(!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction())return!1;if(null==e.rowNodeTransactions)return!1;var t=o._.filter(e.rowNodeTransactions,(function(e){return null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0}));return null==t||0==t.length},r.prototype.refreshModel=function(e){var t=this;if(!this.isSuppressModelUpdateAfterUpdateTransaction(e)){var r=this.createChangePath(e.rowNodeTransactions);switch(e.step){case o.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(e.groupState,e.rowNodeTransactions,e.rowNodeOrder,r,!!e.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.SORT:this.doSort(e.rowNodeTransactions,r);case o.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}var i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(r,i);var n={type:o.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1};this.eventService.dispatchEvent(n),this.$scope&&window.setTimeout((function(){t.$scope.$apply()}),0)}},r.prototype.isEmpty=function(){var e=o._.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return o._.missing(this.rootNode)||e||!this.columnModel.isReady()},r.prototype.isRowsToRender=function(){return o._.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0},r.prototype.getNodesInRangeForSelection=function(e,t){var o,r=!t,i=!1,n=[],s=this.gridOptionsWrapper.isGroupSelectsChildren();return this.forEachNodeAfterFilterAndSort((function(a){var d=r&&!i;if(r||a!==t&&a!==e||(r=!0),!(a.group&&s)){var p=r&&!i,l=a.isParentOfNode(o);(p||l)&&n.push(a)}d&&(a!==t&&a!==e||(i=!0,o=a===t?t:e))})),n},r.prototype.setDatasource=function(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")},r.prototype.getTopLevelNodes=function(){return this.rootNode?this.rootNode.childrenAfterGroup:null},r.prototype.getRootNode=function(){return this.rootNode},r.prototype.getRow=function(e){return this.rowsToDisplay[e]},r.prototype.isRowPresent=function(e){return this.rowsToDisplay.indexOf(e)>=0},r.prototype.getRowIndexAtPixel=function(e){if(this.isEmpty())return-1;var t=0,r=this.rowsToDisplay.length-1;if(e<=0)return 0;if(o._.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;for(;;){var i=Math.floor((t+r)/2),n=this.rowsToDisplay[i];if(this.isRowInPixel(n,e))return i;n.rowTop<e?t=i+1:n.rowTop>e&&(r=i-1)}},r.prototype.isRowInPixel=function(e,t){var o=e.rowTop,r=e.rowTop+e.rowHeight;return o<=t&&r>t},r.prototype.forEachLeafNode=function(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((function(t,o){return e(t,o)}))},r.prototype.forEachNode=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup,e,t.Normal,0)},r.prototype.forEachNodeAfterFilter=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterFilter,e,t.AfterFilter,0)},r.prototype.forEachNodeAfterFilterAndSort=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort,e,t.AfterFilterAndSort,0)},r.prototype.forEachPivotNode=function(e){this.recursivelyWalkNodesAndCallback([this.rootNode],e,t.PivotNodes,0)},r.prototype.recursivelyWalkNodesAndCallback=function(e,o,r,i){if(!e)return i;for(var n=0;n<e.length;n++){var s=e[n];if(o(s,i++),s.hasChildren()){var a=null;switch(r){case t.Normal:a=s.childrenAfterGroup;break;case t.AfterFilter:a=s.childrenAfterFilter;break;case t.AfterFilterAndSort:a=s.childrenAfterSort;break;case t.PivotNodes:a=s.leafGroup?null:s.childrenAfterSort}a&&(i=this.recursivelyWalkNodesAndCallback(a,o,r,i))}}return i},r.prototype.doAggregate=function(e){this.aggregationStage&&this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.expandOrCollapseAll=function(e){var t=this.gridOptionsWrapper.isTreeData();this.rootNode&&function r(i){if(!i)return;i.forEach((function(i){(t?o._.exists(i.childrenAfterGroup):i.group)&&(i.expanded=e,r(i.childrenAfterGroup))}))}(this.rootNode.childrenAfterGroup),this.refreshModel({step:o.ClientSideRowModelSteps.MAP});var r=e?"expandAll":"collapseAll",i={api:this.gridApi,columnApi:this.columnApi,type:o.Events.EVENT_EXPAND_COLLAPSE_ALL,source:r};this.eventService.dispatchEvent(i)},r.prototype.doSort=function(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})},r.prototype.doRowGrouping=function(e,t,o,r,i){this.groupStage?(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:o,changedPath:r}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:r,afterColumnsChanged:i}),this.restoreGroupState(e)),this.gridOptionsWrapper.isGroupSelectsChildren()&&this.selectionService.updateGroupsFromChildrenSelections(r)):(this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.updateHasChildren())},r.prototype.restoreGroupState=function(e){e&&o._.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(t,o){"boolean"==typeof e[o]&&(t.expanded=e[o])}))},r.prototype.doFilter=function(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.doPivot=function(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.getGroupState=function(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsWrapper.isRememberGroupStateWhenNewData())return null;var e={};return o._.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(t,o){return e[o]=t.expanded})),e},r.prototype.getCopyOfNodesMap=function(){return this.nodeManager.getCopyOfNodesMap()},r.prototype.getRowNode=function(e){if("string"==typeof e&&0==e.indexOf(o.RowNode.ID_PREFIX_ROW_GROUP)){var t=void 0;return this.forEachNode((function(o){o.id===e&&(t=o)})),t}return this.nodeManager.getRowNode(e)},r.prototype.setRowData=function(e){var t=this.getGroupState();this.nodeManager.setRowData(e);var r={type:o.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,groupState:t,newData:!0})},r.prototype.batchUpdateRowData=function(e,t){var o=this;if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];var r=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((function(){o.executeBatchUpdateRowData()}),r)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})},r.prototype.flushAsyncTransactions=function(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())},r.prototype.executeBatchUpdateRowData=function(){var e=this;this.valueCache.onDataChanged();var t=[],r=[],i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((function(o){var n=e.nodeManager.updateRowData(o.rowDataTransaction,void 0);r.push(n),o.callback&&t.push(o.callback.bind(null,n)),"number"==typeof o.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(r,void 0,i),t.length>0&&window.setTimeout((function(){t.forEach((function(e){return e()}))}),0),r.length>0){var n={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:o.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:r};this.eventService.dispatchEvent(n)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0},r.prototype.updateRowData=function(e,t){this.valueCache.onDataChanged();var o=this.nodeManager.updateRowData(e,t),r="number"==typeof e.addIndex;return this.commonUpdateRowData([o],t,r),o},r.prototype.createRowNodeOrder=function(){if(!this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()){var e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(var t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}},r.prototype.commonUpdateRowData=function(e,t,r){r&&(t=this.createRowNodeOrder()),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,animate:!0,keepEditingRows:!0});var i={type:o.Events.EVENT_ROW_DATA_UPDATED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(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})},r.prototype.resetRowHeights=function(){var e=!1;this.forEachNode((function(t){t.setRowHeight(t.rowHeight,!0);var o=t.detailNode;o&&o.setRowHeight(o.rowHeight,!0),e=!0})),e&&this.onRowHeightChanged()},s([o.Autowired("columnModel")],r.prototype,"columnModel",void 0),s([o.Autowired("$scope")],r.prototype,"$scope",void 0),s([o.Autowired("selectionService")],r.prototype,"selectionService",void 0),s([o.Autowired("valueCache")],r.prototype,"valueCache",void 0),s([o.Autowired("columnApi")],r.prototype,"columnApi",void 0),s([o.Autowired("gridApi")],r.prototype,"gridApi",void 0),s([o.Autowired("animationFrameService")],r.prototype,"animationFrameService",void 0),s([o.Autowired("beans")],r.prototype,"beans",void 0),s([o.Autowired("filterStage")],r.prototype,"filterStage",void 0),s([o.Autowired("sortStage")],r.prototype,"sortStage",void 0),s([o.Autowired("flattenStage")],r.prototype,"flattenStage",void 0),s([o.Optional("groupStage")],r.prototype,"groupStage",void 0),s([o.Optional("aggregationStage")],r.prototype,"aggregationStage",void 0),s([o.Optional("pivotStage")],r.prototype,"pivotStage",void 0),s([o.PostConstruct],r.prototype,"init",null),r=s([o.Bean("rowModel")],r)}(o.BeanStub),d=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),p=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.execute=function(e){var t=e.rowNode,o=e.changedPath;this.filterService.filter(o),this.selectableService.updateSelectableAfterFiltering(t)},p([o.Autowired("selectableService")],t.prototype,"selectableService",void 0),p([o.Autowired("filterService")],t.prototype,"filterService",void 0),t=p([o.Bean("filterStage")],t)}(o.BeanStub),h=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),u=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 h(t,e),t.prototype.execute=function(e){var t=this.sortController.getSortOptions(),r=o._.exists(t)&&t.length>0,i=r&&o._.exists(e.rowNodeTransactions)&&this.gridOptionsWrapper.isDeltaSort(),n=i?this.calculateDirtyNodes(e.rowNodeTransactions):null,s=o._.missingOrEmpty(this.columnModel.getValueColumns()),a=o._.some(t,(function(e){return!!e.column.getColDef().showRowGroup}));this.sortService.sort(t,r,i,n,e.changedPath,s,a)},t.prototype.calculateDirtyNodes=function(e){var t={},o=function(e){e&&e.forEach((function(e){return t[e.id]=!0}))};return e&&e.forEach((function(e){o(e.add),o(e.update),o(e.remove)})),t},u([o.Autowired("sortService")],t.prototype,"sortService",void 0),u([o.Autowired("sortController")],t.prototype,"sortController",void 0),u([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=u([o.Bean("sortStage")],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)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),g=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.execute=function(e){var t=e.rowNode,o=[],r={value:0},i=this.columnModel.isPivotMode(),n=i&&t.leafGroup,s=n?[t]:t.childrenAfterSort;return this.recursivelyAddToRowsToDisplay(s,o,r,i,0),!n&&o.length>0&&this.gridOptionsWrapper.isGroupIncludeTotalFooter()&&(this.ensureFooterNodeExists(t),this.addRowNodeToRowsToDisplay(t.sibling,o,r,0)),o},t.prototype.recursivelyAddToRowsToDisplay=function(e,t,r,i,n){if(!o._.missingOrEmpty(e))for(var s=this.gridOptionsWrapper.isGroupHideOpenParents(),a=this.gridOptionsWrapper.isGroupRemoveSingleChildren(),d=!a&&this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren(),p=0;p<e.length;p++){var l=e[p],h=l.hasChildren(),u=i&&!h,c=a&&h&&1===l.childrenAfterGroup.length,f=d&&h&&l.leafGroup&&1===l.childrenAfterGroup.length,g=i&&l.leafGroup,w=s&&l.expanded&&!g;if(!(u||w||c||f)&&this.addRowNodeToRowsToDisplay(l,t,r,n),!i||!l.leafGroup)if(h){var v=c||f;if(l.expanded||v){var y=v?n:n+1;this.recursivelyAddToRowsToDisplay(l.childrenAfterSort,t,r,i,y),this.gridOptionsWrapper.isGroupIncludeFooter()&&(this.ensureFooterNodeExists(l),this.addRowNodeToRowsToDisplay(l.sibling,t,r,n))}}else if(l.master&&l.expanded){var R=this.createDetailNode(l);this.addRowNodeToRowsToDisplay(R,t,r,n)}}},t.prototype.addRowNodeToRowsToDisplay=function(e,t,o,r){var i=this.gridOptionsWrapper.isGroupMultiAutoColumn();t.push(e),e.setUiLevel(i?0:r)},t.prototype.ensureFooterNodeExists=function(e){if(!o._.exists(e.sibling)){var t=new o.RowNode(this.beans);Object.keys(e).forEach((function(o){t[o]=e[o]})),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,o._.exists(t.id)&&(t.id="rowGroupFooter_"+t.id),t.sibling=e,e.sibling=t}},t.prototype.createDetailNode=function(e){if(o._.exists(e.detailNode))return e.detailNode;var t=new o.RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,o._.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t},g([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),g([o.Autowired("beans")],t.prototype,"beans",void 0),t=g([o.Bean("flattenStage")],t)}(o.BeanStub),v=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),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},R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.prototype.init=function(){this.postSortFunc=this.gridOptionsWrapper.getPostSortFunc()},t.prototype.sort=function(e,t,o,r,i,n,s){var a=this,d=this.gridOptionsWrapper.isGroupMaintainOrder();i&&i.forEachChangedNodeDepthFirst((function(p){if(a.pullDownGroupDataForHideOpenParents(p.childrenAfterFilter,!0),t){var l=d&&!p.leafGroup&&!s;p.childrenAfterSort=l?p.childrenAfterSort.slice(0):o?a.doDeltaSort(p,e,r,i,n):a.rowNodeSorter.doFullSort(p.childrenAfterFilter,e)}else p.childrenAfterSort=d&&p.childrenAfterSort?p.childrenAfterSort.slice(0):p.childrenAfterFilter.slice(0);a.updateChildIndexes(p),a.postSortFunc&&a.postSortFunc(p.childrenAfterSort)})),this.updateGroupDataForHideOpenParents(i)},t.prototype.mapNodeToSortedNode=function(e,t){return{currentPos:t,rowNode:e}},t.prototype.doDeltaSort=function(e,t,o,r,i){var n=e.childrenAfterSort.filter((function(e){var t=!o[e.id],n=i||r&&r.canSkip(e);return t&&n})).map(this.mapNodeToSortedNode.bind(this)),s={};n.forEach((function(e){return s[e.rowNode.id]=e.rowNode}));var a=e.childrenAfterFilter.filter((function(e){return!s[e.id]})).map(this.mapNodeToSortedNode.bind(this));return a.sort(this.rowNodeSorter.compareRowNodes.bind(this,t)),(0===a.length?n:0===n.length?a:this.mergeSortedArrays(t,n,a)).map((function(e){return e.rowNode}))},t.prototype.mergeSortedArrays=function(e,t,o){for(var r=[],i=0,n=0;i<t.length&&n<o.length;){this.rowNodeSorter.compareRowNodes(e,t[i],o[n])<0?r.push(t[i++]):r.push(o[n++])}for(;i<t.length;)r.push(t[i++]);for(;n<o.length;)r.push(o[n++]);return r},t.prototype.updateChildIndexes=function(e){if(!o._.missing(e.childrenAfterSort))for(var t=e.childrenAfterSort,r=0;r<t.length;r++){var i=t[r],n=0===r,s=r===e.childrenAfterSort.length-1;i.setFirstChild(n),i.setLastChild(s),i.setChildIndex(r)}},t.prototype.updateGroupDataForHideOpenParents=function(e){var t=this;if(this.gridOptionsWrapper.isGroupHideOpenParents()){if(this.gridOptionsWrapper.isTreeData()){return o._.doOnce((function(){return console.warn("AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level).")}),"sortService.hideOpenParentsWithTreeData"),!1}var r=function(e){t.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((function(e){e.hasChildren()&&r(e)}))};e&&e.executeFromRootNode((function(e){return r(e)}))}},t.prototype.pullDownGroupDataForHideOpenParents=function(e,t){var r=this;this.gridOptionsWrapper.isGroupHideOpenParents()&&!o._.missing(e)&&e.forEach((function(e){r.columnModel.getGroupDisplayColumns().forEach((function(o){var i=o.getColDef().showRowGroup;if("string"==typeof i){var n=i,s=r.columnModel.getPrimaryColumn(n);if(!(s===e.rowGroupColumn))if(t)e.setGroupValue(o.getId(),void 0);else{var a=e.getFirstChildOfFirstChild(s);a&&e.setGroupValue(o.getId(),a.key)}}else console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup")}))}))},y([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),y([o.Autowired("rowNodeSorter")],t.prototype,"rowNodeSorter",void 0),y([o.PostConstruct],t.prototype,"init",null),t=y([o.Bean("sortService")],t)}(o.BeanStub),N=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),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},S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return N(t,e),t.prototype.postConstruct=function(){this.doingTreeData=this.gridOptionsWrapper.isTreeData()},t.prototype.filter=function(e){var t=this.filterManager.isAnyFilterPresent();this.filterNodes(t,e)},t.prototype.filterNodes=function(e,t){var o=this,r=function(t,r){t.hasChildren()?(t.childrenAfterFilter=e&&!r?t.childrenAfterGroup.filter((function(e){var t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,r=e.data&&o.filterManager.doesRowPassFilter({rowNode:e});return t||r})):t.childrenAfterGroup,o.setAllChildrenCount(t)):(t.childrenAfterFilter=t.childrenAfterGroup,t.setAllChildrenCount(null))};if(this.doingTreeDataFiltering()){var i=function(e,t){if(e.childrenAfterGroup)for(var n=0;n<e.childrenAfterGroup.length;n++){var s=e.childrenAfterGroup[n],a=t||o.filterManager.doesRowPassFilter({rowNode:s});s.childrenAfterGroup?i(e.childrenAfterGroup[n],a):r(s,a)}r(e,t)};t.executeFromRootNode((function(e){return i(e,!1)}))}else{t.forEachChangedNodeDepthFirst((function(e){return r(e,!1)}),!0)}},t.prototype.setAllChildrenCountTreeData=function(e){var t=0;e.childrenAfterFilter.forEach((function(e){t++,t+=e.allChildrenCount})),e.setAllChildrenCount(t)},t.prototype.setAllChildrenCountGridGrouping=function(e){var t=0;e.childrenAfterFilter.forEach((function(e){e.group?t+=e.allChildrenCount:t++})),e.setAllChildrenCount(t)},t.prototype.setAllChildrenCount=function(e){this.doingTreeData?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e)},t.prototype.doingTreeDataFiltering=function(){return this.gridOptionsWrapper.isTreeData()&&!this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering()},A([o.Autowired("filterManager")],t.prototype,"filterManager",void 0),A([o.PostConstruct],t.prototype,"postConstruct",null),t=A([o.Bean("filterService")],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)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),T=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.postConstruct=function(){this.rowModel.getType()===o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel)},t.prototype.createTransactionForRowData=function(e){if(o._.missing(this.clientSideRowModel))console.error("AG Grid: ImmutableService only works with ClientSideRowModel");else{var t=this.gridOptionsWrapper.getRowNodeIdFunc();if(t&&!o._.missing(t)){var r={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()?null:{};return o._.exists(e)&&e.forEach((function(e,o){var s=t(e),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 getRowNodeId() callback to be implemented, your row data need IDs!")}},T([o.Autowired("rowModel")],t.prototype,"rowModel",void 0),T([o.PostConstruct],t.prototype,"postConstruct",null),t=T([o.Bean("immutableService")],t)}(o.BeanStub),m={moduleName:o.ModuleNames.ClientSideRowModelModule,beans:[l,c,w,R,S,C],rowModels:{clientSide:a}};exports.ClientSideRowModelModule=m; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),r=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<o;t++)for(var n=arguments[t],s=0,a=n.length;s<a;s++,i++)r[i]=n[s];return r},i=function(){function e(t,o,r,i,n,s,a,d){this.nextId=0,this.allNodesMap={},this.rootNode=t,this.gridOptionsWrapper=o,this.eventService=r,this.columnModel=i,this.gridApi=n,this.columnApi=s,this.beans=d,this.selectionService=a,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterFilter=[],this.postConstruct()}return e.prototype.postConstruct=function(){this.suppressParentsInRowNodes=this.gridOptionsWrapper.isSuppressParentsInRowNodes(),this.isRowMasterFunc=this.gridOptionsWrapper.getIsRowMasterFunc(),this.doingTreeData=this.gridOptionsWrapper.isTreeData(),this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},e.prototype.getCopyOfNodesMap=function(){return o._.cloneObject(this.allNodesMap)},e.prototype.getRowNode=function(e){return this.allNodesMap[e]},e.prototype.setRowData=function(t){var o=this;if("string"!=typeof t){var r=this.rootNode,i=this.rootNode.sibling;r.childrenAfterFilter=null,r.childrenAfterGroup=null,r.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.childrenAfterSort=r.childrenAfterSort,i.childrenMapped=r.childrenMapped,i.allLeafChildren=r.allLeafChildren)}else console.warn("AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first")},e.prototype.updateRowData=function(e,t){var r={remove:[],update:[],add:[]},i=[];return this.executeRemove(e,r,i),this.executeUpdate(e,r,i),this.executeAdd(e,r),this.updateSelection(i),t&&o._.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),r},e.prototype.updateSelection=function(e){var t=e.length>0;if(t&&e.forEach((function(e){e.setSelected(!1,!1,!0)})),this.selectionService.updateGroupsFromChildrenSelections(),t){var r={type:o.Events.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r)}},e.prototype.executeAdd=function(t,i){var n=this,s=t.add,a=t.addIndex;if(!o._.missingOrEmpty(s)){var d=s.map((function(t){return n.createNode(t,n.rootNode,e.TOP_LEVEL)}));if("number"==typeof a&&a>=0){var l=this.rootNode.allLeafChildren,p=l.slice(0,a),h=l.slice(a,l.length);this.rootNode.allLeafChildren=r(p,d,h)}else this.rootNode.allLeafChildren=r(this.rootNode.allLeafChildren,d);this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),i.add=d}},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,r=this.gridOptionsWrapper.getRowNodeIdFunc();if(o._.exists(r)){var i=r(e);if(!(t=this.allNodesMap[i]))return console.error("AG Grid: could not find row id="+i+", data item was not found for this id"),null}else if(!(t=o._.find(this.rootNode.allLeafChildren,(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 getRowNodeId to help the Grid find matching row data"),null;return t},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 getRowNodeId callback, this could cause issues in your grid."),this.allNodesMap[i.id]=i,this.nextId++,i},e.prototype.setMasterForRow=function(e,t,o,r){if(this.doingTreeData)e.setMaster(!1),r&&(e.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?e.setMaster(this.isRowMasterFunc(t)):e.setMaster(!0):e.setMaster(!1),r){var i=this.columnModel.getRowGroupColumns(),n=o+(i?i.length:0);e.expanded=!!e.master&&this.isExpanded(n)}},e.prototype.isExpanded=function(e){var t=this.gridOptionsWrapper.getGroupDefaultExpanded();return-1===t||e<t},e.TOP_LEVEL=0,e.ROOT_NODE_ID="ROOT_NODE_ID",e}(),n=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),s=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};!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 a=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.init=function(){var e=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING}),t=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:!0});this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,t),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.PIVOT})),this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,e);var r=this.refreshModel.bind(this,{step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:!0});this.addManagedListener(this.gridOptionsWrapper,o.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN,r),this.addManagedListener(this.gridOptionsWrapper,o.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,r),this.rootNode=new o.RowNode(this.beans),this.nodeManager=new i(this.rootNode,this.gridOptionsWrapper,this.eventService,this.columnModel,this.gridApi,this.columnApi,this.selectionService,this.beans)},r.prototype.start=function(){var e=this.gridOptionsWrapper.getRowData();e&&this.setRowData(e)},r.prototype.ensureRowHeightsValid=function(e,t,o,r){var i,n=!1;do{i=!1;for(var s=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),d=Math.max(s,o),l=Math.min(a,r),p=d;p<=l;p++){var h=this.getRow(p);if(h.rowHeightEstimated){var u=this.gridOptionsWrapper.getRowHeightForNode(h);h.setRowHeight(u.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n},r.prototype.setRowTopAndRowIndex=function(){for(var e=this.gridOptionsWrapper.getDefaultRowHeight(),t=0,r=new Set,i=this.gridOptionsWrapper.getDomLayout()===o.Constants.DOM_LAYOUT_NORMAL,n=0;n<this.rowsToDisplay.length;n++){var s=this.rowsToDisplay[n];if(null!=s.id&&r.add(s.id),null==s.rowHeight){var a=this.gridOptionsWrapper.getRowHeightForNode(s,i,e);s.setRowHeight(a.height,a.estimated)}s.setRowTop(t),s.setRowIndex(n),t+=s.rowHeight}return r},r.prototype.clearRowTopAndRowIndex=function(e,t){var o=e.isActive(),r=function(e){e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},i=function(e){if(r(e),r(e.detailNode),r(e.sibling),e.hasChildren()&&e.childrenAfterGroup){var t=-1==e.level;o&&!t&&!e.expanded||e.childrenAfterGroup.forEach(i)}};i(this.rootNode)},r.prototype.ensureRowsAtPixel=function(e,t,r){var i=this;void 0===r&&(r=0);var n=this.getRowIndexAtPixel(t);return this.getRow(n)!==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,animate:!0,keepEditingRows:!0}),!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(){return this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode?1:this.rootNode.childrenAfterFilter?this.rootNode.childrenAfterFilter.length:0},r.prototype.getTopLevelRowDisplayedIndex=function(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;var t=this.rootNode.childrenAfterSort[e];if(this.gridOptionsWrapper.isGroupHideOpenParents())for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},r.prototype.getRowBounds=function(e){if(o._.missing(this.rowsToDisplay))return null;var t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null},r.prototype.onRowGroupOpened=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})},r.prototype.onFilterChanged=function(e){if(!e.afterDataChange){var t=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.FILTER,keepRenderedRows:!0,animate:t})}},r.prototype.onSortChanged=function(){var e=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:o.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})},r.prototype.getType=function(){return o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE},r.prototype.onValueChanged=function(){this.columnModel.isPivotActive()?this.refreshModel({step:o.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:o.ClientSideRowModelSteps.AGGREGATE})},r.prototype.createChangePath=function(e){var t=o._.missingOrEmpty(e),r=new o.ChangedPath(!1,this.rootNode);return(t||this.gridOptionsWrapper.isTreeData())&&r.setInactive(),r},r.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(e){if(!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction())return!1;if(null==e.rowNodeTransactions)return!1;var t=o._.filter(e.rowNodeTransactions,(function(e){return null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0}));return null==t||0==t.length},r.prototype.refreshModel=function(e){var t=this;if(!this.isSuppressModelUpdateAfterUpdateTransaction(e)){var r=this.createChangePath(e.rowNodeTransactions);switch(e.step){case o.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(e.groupState,e.rowNodeTransactions,e.rowNodeOrder,r,!!e.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.SORT:this.doSort(e.rowNodeTransactions,r);case o.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}var i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(r,i);var n={type:o.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1};this.eventService.dispatchEvent(n),this.$scope&&window.setTimeout((function(){t.$scope.$apply()}),0)}},r.prototype.isEmpty=function(){var e=o._.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return o._.missing(this.rootNode)||e||!this.columnModel.isReady()},r.prototype.isRowsToRender=function(){return o._.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0},r.prototype.getNodesInRangeForSelection=function(e,t){var o,r=!t,i=!1,n=[],s=this.gridOptionsWrapper.isGroupSelectsChildren();return this.forEachNodeAfterFilterAndSort((function(a){var d=r&&!i;if(r||a!==t&&a!==e||(r=!0),!(a.group&&s)){var l=r&&!i,p=a.isParentOfNode(o);(l||p)&&n.push(a)}d&&(a!==t&&a!==e||(i=!0,o=a===t?t:e))})),n},r.prototype.setDatasource=function(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")},r.prototype.getTopLevelNodes=function(){return this.rootNode?this.rootNode.childrenAfterGroup:null},r.prototype.getRootNode=function(){return this.rootNode},r.prototype.getRow=function(e){return this.rowsToDisplay[e]},r.prototype.isRowPresent=function(e){return this.rowsToDisplay.indexOf(e)>=0},r.prototype.getRowIndexAtPixel=function(e){if(this.isEmpty())return-1;var t=0,r=this.rowsToDisplay.length-1;if(e<=0)return 0;if(o._.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;for(;;){var i=Math.floor((t+r)/2),n=this.rowsToDisplay[i];if(this.isRowInPixel(n,e))return i;n.rowTop<e?t=i+1:n.rowTop>e&&(r=i-1)}},r.prototype.isRowInPixel=function(e,t){var o=e.rowTop,r=e.rowTop+e.rowHeight;return o<=t&&r>t},r.prototype.forEachLeafNode=function(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((function(t,o){return e(t,o)}))},r.prototype.forEachNode=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup,e,t.Normal,0)},r.prototype.forEachNodeAfterFilter=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterFilter,e,t.AfterFilter,0)},r.prototype.forEachNodeAfterFilterAndSort=function(e){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort,e,t.AfterFilterAndSort,0)},r.prototype.forEachPivotNode=function(e){this.recursivelyWalkNodesAndCallback([this.rootNode],e,t.PivotNodes,0)},r.prototype.recursivelyWalkNodesAndCallback=function(e,o,r,i){if(!e)return i;for(var n=0;n<e.length;n++){var s=e[n];if(o(s,i++),s.hasChildren()){var a=null;switch(r){case t.Normal:a=s.childrenAfterGroup;break;case t.AfterFilter:a=s.childrenAfterFilter;break;case t.AfterFilterAndSort:a=s.childrenAfterSort;break;case t.PivotNodes:a=s.leafGroup?null:s.childrenAfterSort}a&&(i=this.recursivelyWalkNodesAndCallback(a,o,r,i))}}return i},r.prototype.doAggregate=function(e){this.aggregationStage&&this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.expandOrCollapseAll=function(e){var t=this.gridOptionsWrapper.isTreeData();this.rootNode&&function r(i){if(!i)return;i.forEach((function(i){(t?o._.exists(i.childrenAfterGroup):i.group)&&(i.expanded=e,r(i.childrenAfterGroup))}))}(this.rootNode.childrenAfterGroup),this.refreshModel({step:o.ClientSideRowModelSteps.MAP});var r=e?"expandAll":"collapseAll",i={api:this.gridApi,columnApi:this.columnApi,type:o.Events.EVENT_EXPAND_COLLAPSE_ALL,source:r};this.eventService.dispatchEvent(i)},r.prototype.doSort=function(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})},r.prototype.doRowGrouping=function(e,t,o,r,i){this.groupStage?(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:o,changedPath:r}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:r,afterColumnsChanged:i}),this.restoreGroupState(e)),this.gridOptionsWrapper.isGroupSelectsChildren()&&this.selectionService.updateGroupsFromChildrenSelections(r)):(this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren())},r.prototype.restoreGroupState=function(e){e&&o._.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(t,o){"boolean"==typeof e[o]&&(t.expanded=e[o])}))},r.prototype.doFilter=function(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.doPivot=function(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})},r.prototype.getGroupState=function(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsWrapper.isRememberGroupStateWhenNewData())return null;var e={};return o._.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(function(t,o){return e[o]=t.expanded})),e},r.prototype.getCopyOfNodesMap=function(){return this.nodeManager.getCopyOfNodesMap()},r.prototype.getRowNode=function(e){if("string"==typeof e&&0==e.indexOf(o.RowNode.ID_PREFIX_ROW_GROUP)){var t=void 0;return this.forEachNode((function(o){o.id===e&&(t=o)})),t}return this.nodeManager.getRowNode(e)},r.prototype.setRowData=function(e){var t=this.getGroupState();this.nodeManager.setRowData(e);var r={type:o.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(r),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,groupState:t,newData:!0})},r.prototype.batchUpdateRowData=function(e,t){var o=this;if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];var r=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((function(){o.executeBatchUpdateRowData()}),r)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})},r.prototype.flushAsyncTransactions=function(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())},r.prototype.executeBatchUpdateRowData=function(){var e=this;this.valueCache.onDataChanged();var t=[],r=[],i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((function(o){var n=e.nodeManager.updateRowData(o.rowDataTransaction,void 0);r.push(n),o.callback&&t.push(o.callback.bind(null,n)),"number"==typeof o.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(r,void 0,i),t.length>0&&window.setTimeout((function(){t.forEach((function(e){return e()}))}),0),r.length>0){var n={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:o.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:r};this.eventService.dispatchEvent(n)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0},r.prototype.updateRowData=function(e,t){this.valueCache.onDataChanged();var o=this.nodeManager.updateRowData(e,t),r="number"==typeof e.addIndex;return this.commonUpdateRowData([o],t,r),o},r.prototype.createRowNodeOrder=function(){if(!this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()){var e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(var t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}},r.prototype.commonUpdateRowData=function(e,t,r){r&&(t=this.createRowNodeOrder()),this.refreshModel({step:o.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,animate:!0,keepEditingRows:!0});var i={type:o.Events.EVENT_ROW_DATA_UPDATED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(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})},r.prototype.resetRowHeights=function(){var e=!1;this.forEachNode((function(t){t.setRowHeight(t.rowHeight,!0);var o=t.detailNode;o&&o.setRowHeight(o.rowHeight,!0),e=!0})),e&&this.onRowHeightChanged()},s([o.Autowired("columnModel")],r.prototype,"columnModel",void 0),s([o.Autowired("$scope")],r.prototype,"$scope",void 0),s([o.Autowired("selectionService")],r.prototype,"selectionService",void 0),s([o.Autowired("valueCache")],r.prototype,"valueCache",void 0),s([o.Autowired("columnApi")],r.prototype,"columnApi",void 0),s([o.Autowired("gridApi")],r.prototype,"gridApi",void 0),s([o.Autowired("animationFrameService")],r.prototype,"animationFrameService",void 0),s([o.Autowired("beans")],r.prototype,"beans",void 0),s([o.Autowired("filterStage")],r.prototype,"filterStage",void 0),s([o.Autowired("sortStage")],r.prototype,"sortStage",void 0),s([o.Autowired("flattenStage")],r.prototype,"flattenStage",void 0),s([o.Optional("groupStage")],r.prototype,"groupStage",void 0),s([o.Optional("aggregationStage")],r.prototype,"aggregationStage",void 0),s([o.Optional("pivotStage")],r.prototype,"pivotStage",void 0),s([o.PostConstruct],r.prototype,"init",null),r=s([o.Bean("rowModel")],r)}(o.BeanStub),d=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),l=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},p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t.prototype.execute=function(e){var t=e.rowNode,o=e.changedPath;this.filterService.filter(o),this.selectableService.updateSelectableAfterFiltering(t)},l([o.Autowired("selectableService")],t.prototype,"selectableService",void 0),l([o.Autowired("filterService")],t.prototype,"filterService",void 0),t=l([o.Bean("filterStage")],t)}(o.BeanStub),h=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),u=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 h(t,e),t.prototype.execute=function(e){var t=this.sortController.getSortOptions(),r=o._.exists(t)&&t.length>0,i=r&&o._.exists(e.rowNodeTransactions)&&this.gridOptionsWrapper.isDeltaSort(),n=i?this.calculateDirtyNodes(e.rowNodeTransactions):null,s=o._.missingOrEmpty(this.columnModel.getValueColumns()),a=o._.some(t,(function(e){return!!e.column.getColDef().showRowGroup}));this.sortService.sort(t,r,i,n,e.changedPath,s,a)},t.prototype.calculateDirtyNodes=function(e){var t={},o=function(e){e&&e.forEach((function(e){return t[e.id]=!0}))};return e&&e.forEach((function(e){o(e.add),o(e.update),o(e.remove)})),t},u([o.Autowired("sortService")],t.prototype,"sortService",void 0),u([o.Autowired("sortController")],t.prototype,"sortController",void 0),u([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=u([o.Bean("sortStage")],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)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),g=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.execute=function(e){var t=e.rowNode,o=[],r={value:0},i=this.columnModel.isPivotMode(),n=i&&t.leafGroup,s=n?[t]:t.childrenAfterSort;return this.recursivelyAddToRowsToDisplay(s,o,r,i,0),!n&&o.length>0&&this.gridOptionsWrapper.isGroupIncludeTotalFooter()&&(this.ensureFooterNodeExists(t),this.addRowNodeToRowsToDisplay(t.sibling,o,r,0)),o},t.prototype.recursivelyAddToRowsToDisplay=function(e,t,r,i,n){if(!o._.missingOrEmpty(e))for(var s=this.gridOptionsWrapper.isGroupHideOpenParents(),a=this.gridOptionsWrapper.isGroupRemoveSingleChildren(),d=!a&&this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren(),l=0;l<e.length;l++){var p=e[l],h=p.hasChildren(),u=i&&!h,c=a&&h&&1===p.childrenAfterGroup.length,f=d&&h&&p.leafGroup&&1===p.childrenAfterGroup.length,g=i&&p.leafGroup,w=s&&p.expanded&&!g;if(!(u||w||c||f)&&this.addRowNodeToRowsToDisplay(p,t,r,n),!i||!p.leafGroup)if(h){var v=c||f;if(p.expanded||v){var y=v?n:n+1;this.recursivelyAddToRowsToDisplay(p.childrenAfterSort,t,r,i,y),this.gridOptionsWrapper.isGroupIncludeFooter()&&(this.ensureFooterNodeExists(p),this.addRowNodeToRowsToDisplay(p.sibling,t,r,n))}}else if(p.master&&p.expanded){var R=this.createDetailNode(p);this.addRowNodeToRowsToDisplay(R,t,r,n)}}},t.prototype.addRowNodeToRowsToDisplay=function(e,t,o,r){var i=this.gridOptionsWrapper.isGroupMultiAutoColumn();t.push(e),e.setUiLevel(i?0:r)},t.prototype.ensureFooterNodeExists=function(e){if(!o._.exists(e.sibling)){var t=new o.RowNode(this.beans);Object.keys(e).forEach((function(o){t[o]=e[o]})),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,o._.exists(t.id)&&(t.id="rowGroupFooter_"+t.id),t.sibling=e,e.sibling=t}},t.prototype.createDetailNode=function(e){if(o._.exists(e.detailNode))return e.detailNode;var t=new o.RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,o._.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t},g([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),g([o.Autowired("beans")],t.prototype,"beans",void 0),t=g([o.Bean("flattenStage")],t)}(o.BeanStub),v=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),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},R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.prototype.init=function(){this.postSortFunc=this.gridOptionsWrapper.getPostSortFunc()},t.prototype.sort=function(e,t,r,i,n,s,a){var d=this,l=this.gridOptionsWrapper.isGroupMaintainOrder(),p=o._.some(this.columnModel.getAllGridColumns(),(function(e){return e.isRowGroupActive()}));n&&n.forEachChangedNodeDepthFirst((function(o){if(d.pullDownGroupDataForHideOpenParents(o.childrenAfterFilter,!0),t){var h=l&&p&&!o.leafGroup&&!a;o.childrenAfterSort=h?o.childrenAfterFilter.slice(0):r?d.doDeltaSort(o,e,i,n,s):d.rowNodeSorter.doFullSort(o.childrenAfterFilter,e)}else o.childrenAfterSort=o.childrenAfterFilter.slice(0);o.sibling&&(o.sibling.childrenAfterSort=o.childrenAfterSort),d.updateChildIndexes(o),d.postSortFunc&&d.postSortFunc(o.childrenAfterSort)})),this.updateGroupDataForHideOpenParents(n)},t.prototype.mapNodeToSortedNode=function(e,t){return{currentPos:t,rowNode:e}},t.prototype.doDeltaSort=function(e,t,o,r,i){var n=e.childrenAfterSort.filter((function(e){var t=!o[e.id],n=i||r&&r.canSkip(e);return t&&n})).map(this.mapNodeToSortedNode.bind(this)),s={};n.forEach((function(e){return s[e.rowNode.id]=e.rowNode}));var a=e.childrenAfterFilter.filter((function(e){return!s[e.id]})).map(this.mapNodeToSortedNode.bind(this));return a.sort(this.rowNodeSorter.compareRowNodes.bind(this,t)),(0===a.length?n:0===n.length?a:this.mergeSortedArrays(t,n,a)).map((function(e){return e.rowNode}))},t.prototype.mergeSortedArrays=function(e,t,o){for(var r=[],i=0,n=0;i<t.length&&n<o.length;){this.rowNodeSorter.compareRowNodes(e,t[i],o[n])<0?r.push(t[i++]):r.push(o[n++])}for(;i<t.length;)r.push(t[i++]);for(;n<o.length;)r.push(o[n++]);return r},t.prototype.updateChildIndexes=function(e){if(!o._.missing(e.childrenAfterSort))for(var t=e.childrenAfterSort,r=0;r<t.length;r++){var i=t[r],n=0===r,s=r===e.childrenAfterSort.length-1;i.setFirstChild(n),i.setLastChild(s),i.setChildIndex(r)}},t.prototype.updateGroupDataForHideOpenParents=function(e){var t=this;if(this.gridOptionsWrapper.isGroupHideOpenParents()){if(this.gridOptionsWrapper.isTreeData()){return o._.doOnce((function(){return console.warn("AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level).")}),"sortService.hideOpenParentsWithTreeData"),!1}var r=function(e){t.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((function(e){e.hasChildren()&&r(e)}))};e&&e.executeFromRootNode((function(e){return r(e)}))}},t.prototype.pullDownGroupDataForHideOpenParents=function(e,t){var r=this;this.gridOptionsWrapper.isGroupHideOpenParents()&&!o._.missing(e)&&e.forEach((function(e){r.columnModel.getGroupDisplayColumns().forEach((function(o){var i=o.getColDef().showRowGroup;if("string"==typeof i){var n=i,s=r.columnModel.getPrimaryColumn(n);if(!(s===e.rowGroupColumn))if(t)e.setGroupValue(o.getId(),void 0);else{var a=e.getFirstChildOfFirstChild(s);a&&e.setGroupValue(o.getId(),a.key)}}else console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup")}))}))},y([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),y([o.Autowired("rowNodeSorter")],t.prototype,"rowNodeSorter",void 0),y([o.PostConstruct],t.prototype,"init",null),t=y([o.Bean("sortService")],t)}(o.BeanStub),N=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),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},S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return N(t,e),t.prototype.postConstruct=function(){this.doingTreeData=this.gridOptionsWrapper.isTreeData()},t.prototype.filter=function(e){var t=this.filterManager.isAnyFilterPresent();this.filterNodes(t,e)},t.prototype.filterNodes=function(e,t){var o=this,r=function(t,r){t.hasChildren()?(t.childrenAfterFilter=e&&!r?t.childrenAfterGroup.filter((function(e){var t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,r=e.data&&o.filterManager.doesRowPassFilter({rowNode:e});return t||r})):t.childrenAfterGroup,o.setAllChildrenCount(t)):(t.childrenAfterFilter=t.childrenAfterGroup,t.setAllChildrenCount(null)),t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){var i=function(e,t){if(e.childrenAfterGroup)for(var n=0;n<e.childrenAfterGroup.length;n++){var s=e.childrenAfterGroup[n],a=t||o.filterManager.doesRowPassFilter({rowNode:s});s.childrenAfterGroup?i(e.childrenAfterGroup[n],a):r(s,a)}r(e,t)};t.executeFromRootNode((function(e){return i(e,!1)}))}else{t.forEachChangedNodeDepthFirst((function(e){return r(e,!1)}),!0)}},t.prototype.setAllChildrenCountTreeData=function(e){var t=0;e.childrenAfterFilter.forEach((function(e){t++,t+=e.allChildrenCount})),e.setAllChildrenCount(t)},t.prototype.setAllChildrenCountGridGrouping=function(e){var t=0;e.childrenAfterFilter.forEach((function(e){e.group?t+=e.allChildrenCount:t++})),e.setAllChildrenCount(t)},t.prototype.setAllChildrenCount=function(e){this.doingTreeData?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e)},t.prototype.doingTreeDataFiltering=function(){return this.gridOptionsWrapper.isTreeData()&&!this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering()},A([o.Autowired("filterManager")],t.prototype,"filterManager",void 0),A([o.PostConstruct],t.prototype,"postConstruct",null),t=A([o.Bean("filterService")],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)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),C=function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.postConstruct=function(){this.rowModel.getType()===o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel)},t.prototype.createTransactionForRowData=function(e){if(o._.missing(this.clientSideRowModel))console.error("AG Grid: ImmutableService only works with ClientSideRowModel");else{var t=this.gridOptionsWrapper.getRowNodeIdFunc();if(t&&!o._.missing(t)){var r={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder()?null:{};return o._.exists(e)&&e.forEach((function(e,o){var s=t(e),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 getRowNodeId() callback to be implemented, your row data need IDs!")}},C([o.Autowired("rowModel")],t.prototype,"rowModel",void 0),C([o.PostConstruct],t.prototype,"postConstruct",null),t=C([o.Bean("immutableService")],t)}(o.BeanStub),m={moduleName:o.ModuleNames.ClientSideRowModelModule,beans:[p,c,w,R,S,T],rowModels:{clientSide:a}};exports.ClientSideRowModelModule=m; |
@@ -34,3 +34,2 @@ import { ColumnApi, ColumnModel, EventService, GridApi, GridOptionsWrapper, RowDataTransaction, RowNode, RowNodeTransaction, SelectionService, Beans } from "@ag-grid-community/core"; | ||
private lookupRowNode; | ||
private recursiveFunction; | ||
private createNode; | ||
@@ -37,0 +36,0 @@ private setMasterForRow; |
@@ -47,19 +47,33 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
ClientSideNodeManager.prototype.setRowData = function (rowData) { | ||
this.rootNode.childrenAfterFilter = null; | ||
this.rootNode.childrenAfterGroup = null; | ||
this.rootNode.childrenAfterSort = null; | ||
this.rootNode.childrenMapped = null; | ||
this.rootNode.updateHasChildren(); | ||
var _this = this; | ||
if (typeof rowData === 'string') { | ||
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'); | ||
return; | ||
} | ||
var rootNode = this.rootNode; | ||
var sibling = this.rootNode.sibling; | ||
rootNode.childrenAfterFilter = null; | ||
rootNode.childrenAfterGroup = null; | ||
rootNode.childrenAfterSort = null; | ||
rootNode.childrenMapped = null; | ||
rootNode.updateHasChildren(); | ||
this.nextId = 0; | ||
this.allNodesMap = {}; | ||
if (!rowData) { | ||
this.rootNode.allLeafChildren = []; | ||
this.rootNode.childrenAfterGroup = []; | ||
return; | ||
if (rowData) { | ||
// we use rootNode as the parent, however if using ag-grid-enterprise, the grouping stage | ||
// sets the parent node on each row (even if we are not grouping). so setting parent node | ||
// here is for benefit of ag-grid-community users | ||
rootNode.allLeafChildren = rowData.map(function (dataItem) { return _this.createNode(dataItem, _this.rootNode, ClientSideNodeManager.TOP_LEVEL); }); | ||
} | ||
// kick off recursion | ||
// we add rootNode as the parent, however if using ag-grid-enterprise, the grouping stage | ||
// sets the parent node on each row (even if we are not grouping). so setting parent node | ||
// here is for benefit of ag-grid-community users | ||
this.rootNode.allLeafChildren = this.recursiveFunction(rowData, this.rootNode, ClientSideNodeManager.TOP_LEVEL); | ||
else { | ||
rootNode.allLeafChildren = []; | ||
rootNode.childrenAfterGroup = []; | ||
} | ||
if (sibling) { | ||
sibling.childrenAfterFilter = rootNode.childrenAfterFilter; | ||
sibling.childrenAfterGroup = rootNode.childrenAfterGroup; | ||
sibling.childrenAfterSort = rootNode.childrenAfterSort; | ||
sibling.childrenMapped = rootNode.childrenMapped; | ||
sibling.allLeafChildren = rootNode.allLeafChildren; | ||
} | ||
}; | ||
@@ -124,2 +138,5 @@ ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) { | ||
} | ||
if (this.rootNode.sibling) { | ||
this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren; | ||
} | ||
// add new row nodes to the transaction add items | ||
@@ -155,2 +172,5 @@ rowNodeTransaction.add = newNodes; | ||
this.rootNode.allLeafChildren = this.rootNode.allLeafChildren.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; }); | ||
if (this.rootNode.sibling) { | ||
this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren; | ||
} | ||
}; | ||
@@ -199,16 +219,2 @@ ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) { | ||
}; | ||
ClientSideNodeManager.prototype.recursiveFunction = function (rowData, parent, level) { | ||
var _this = this; | ||
// make sure the rowData is an array and not a string of json - this was a commonly reported problem on the forum | ||
if (typeof rowData === 'string') { | ||
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'); | ||
return; | ||
} | ||
var rowNodes = []; | ||
rowData.forEach(function (dataItem) { | ||
var node = _this.createNode(dataItem, parent, level); | ||
rowNodes.push(node); | ||
}); | ||
return rowNodes; | ||
}; | ||
ClientSideNodeManager.prototype.createNode = function (dataItem, parent, level) { | ||
@@ -215,0 +221,0 @@ var node = new RowNode(this.beans); |
@@ -571,2 +571,5 @@ var __extends = (this && this.__extends) || (function () { | ||
this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren; | ||
if (this.rootNode.sibling) { | ||
this.rootNode.sibling.childrenAfterGroup = this.rootNode.childrenAfterGroup; | ||
} | ||
this.rootNode.updateHasChildren(); | ||
@@ -573,0 +576,0 @@ } |
@@ -62,2 +62,5 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
if (rowNode.sibling) { | ||
rowNode.sibling.childrenAfterFilter = rowNode.childrenAfterFilter; | ||
} | ||
}; | ||
@@ -64,0 +67,0 @@ if (this.doingTreeDataFiltering()) { |
@@ -32,2 +32,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var groupMaintainOrder = this.gridOptionsWrapper.isGroupMaintainOrder(); | ||
var groupColumnsPresent = _.some(this.columnModel.getAllGridColumns(), function (c) { return c.isRowGroupActive(); }); | ||
var callback = function (rowNode) { | ||
@@ -41,5 +42,5 @@ // we clear out the 'pull down open parents' first, as the values mix up the sorting | ||
// when 'groupMaintainOrder' is enabled we skip sorting groups unless we are sorting on group columns | ||
var skipSortingGroups = groupMaintainOrder && !rowNode.leafGroup && !sortContainsGroupColumns; | ||
var skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns; | ||
if (skipSortingGroups) { | ||
rowNode.childrenAfterSort = rowNode.childrenAfterSort.slice(0); | ||
rowNode.childrenAfterSort = rowNode.childrenAfterFilter.slice(0); | ||
} | ||
@@ -53,5 +54,7 @@ else { | ||
else { | ||
rowNode.childrenAfterSort = groupMaintainOrder && rowNode.childrenAfterSort ? | ||
rowNode.childrenAfterSort.slice(0) : rowNode.childrenAfterFilter.slice(0); | ||
rowNode.childrenAfterSort = rowNode.childrenAfterFilter.slice(0); | ||
} | ||
if (rowNode.sibling) { | ||
rowNode.sibling.childrenAfterSort = rowNode.childrenAfterSort; | ||
} | ||
_this.updateChildIndexes(rowNode); | ||
@@ -58,0 +61,0 @@ if (_this.postSortFunc) { |
{ | ||
"name": "@ag-grid-community/client-side-row-model", | ||
"version": "26.1.0", | ||
"version": "26.2.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -45,3 +45,3 @@ "main": "./dist/cjs/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~26.1.0" | ||
"@ag-grid-community/core": "~26.2.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is 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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3923202
57009
1
+ Added@ag-grid-community/core@26.2.1(transitive)
- Removed@ag-grid-community/core@26.1.0(transitive)