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

@ag-grid-community/client-side-row-model

Package Overview
Dependencies
Maintainers
3
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-community/client-side-row-model - npm Package Compare versions

Comparing version 31.3.2 to 31.3.3

2

dist/package/main.cjs.min.js

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

var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var o in e)__defProp(t,o,{get:e[o],enumerable:!0})},__copyProps=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of __getOwnPropNames(e))!__hasOwnProp.call(t,s)&&s!==o&&__defProp(t,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc(e,s))||i.enumerable});return t},__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),__decorateClass=(t,e,o,i)=>{for(var s=i>1?void 0:i?__getOwnPropDesc(e,o):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(s=(i?n(e,o,s):n(s))||s);return i&&s&&__defProp(e,o,s),s},main_exports={};__export(main_exports,{ClientSideRowModelModule:()=>ClientSideRowModelModule}),module.exports=__toCommonJS(main_exports);var import_core9=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),import_core=require("@ag-grid-community/core"),_ClientSideNodeManager=class w{constructor(e,o,i,s,r,n){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=o,this.eventService=i,this.columnModel=s,this.beans=n,this.selectionService=r,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=w.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return import_core._.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){console.warn("AG Grid: rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const o=this.rootNode,i=this.rootNode.sibling;o.childrenAfterFilter=null,o.childrenAfterGroup=null,o.childrenAfterAggFilter=null,o.childrenAfterSort=null,o.childrenMapped=null,o.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?o.allLeafChildren=e.map(s=>this.createNode(s,this.rootNode,w.TOP_LEVEL)):(o.allLeafChildren=[],o.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=o.childrenAfterFilter,i.childrenAfterGroup=o.childrenAfterGroup,i.childrenAfterAggFilter=o.childrenAfterAggFilter,i.childrenAfterSort=o.childrenAfterSort,i.childrenMapped=o.childrenMapped,i.allLeafChildren=o.allLeafChildren)}updateRowData(e,o){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),o&&import_core._.sortRowNodesByOrder(this.rootNode.allLeafChildren,o),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const o={type:import_core.Events.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:e?.length?e[0]:null};this.eventService.dispatchEvent(o)}updateSelection(e,o){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:o}),this.selectionService.updateGroupsFromChildrenSelections(o),i){const s={type:import_core.Events.EVENT_SELECTION_CHANGED,source:o};this.eventService.dispatchEvent(s)}}executeAdd(e,o){var i;const{add:s,addIndex:r}=e;if(import_core._.missingOrEmpty(s))return;const n=s.map(a=>this.createNode(a,this.rootNode,w.TOP_LEVEL));if(typeof r=="number"&&r>=0){const{allLeafChildren:a}=this.rootNode,d=a.length;let l=r;if(this.gos.get("treeData")&&r>0&&d>0){for(let p=0;p<d;p++)if(((i=a[p])==null?void 0:i.rowIndex)==r-1){l=p+1;break}}const c=a.slice(0,l),h=a.slice(l,a.length);this.rootNode.allLeafChildren=[...c,...n,...h]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...n];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),o.add=n}executeRemove(e,o,i){const{remove:s}=e;if(import_core._.missingOrEmpty(s))return;const r={};s.forEach(n=>{const a=this.lookupRowNode(n);a&&(a.isSelected()&&i.push(a),a.clearRowTopAndRowIndex(),r[a.id]=!0,delete this.allNodesMap[a.id],o.remove.push(a))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(n=>!r[n.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,o,i){const{update:s}=e;import_core._.missingOrEmpty(s)||s.forEach(r=>{const n=this.lookupRowNode(r);n&&(n.updateData(r),!n.selectable&&n.isSelected()&&i.push(n),this.setMasterForRow(n,r,w.TOP_LEVEL,!1),o.update.push(n))})}lookupRowNode(e){const o=this.gos.getCallback("getRowId");let i;if(o){const s=o({data:e,level:0});if(i=this.allNodesMap[s],!i)return console.error(`AG Grid: could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(s=>s.data===e),!i)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 i||null}createNode(e,o,i){const s=new import_core.RowNode(this.beans);s.group=!1,this.setMasterForRow(s,e,i,!0);const r=this.gos.get("suppressParentsInRowNodes");return o&&!r&&(s.parent=o),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&console.warn(`AG Grid: duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,o,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const a=this.gos.get("isRowMaster");a?e.setMaster(a(o)):e.setMaster(!0)}else e.setMaster(!1);if(s){const a=this.columnModel.getRowGroupColumns(),d=a?a.length:0,l=i+d;e.expanded=e.master?this.isExpanded(l):!1}}}isExpanded(e){const o=this.gos.get("groupDefaultExpanded");return o===-1?!0:e<o}};_ClientSideNodeManager.TOP_LEVEL=0,_ClientSideNodeManager.ROOT_NODE_ID="ROOT_NODE_ID";var ClientSideNodeManager=_ClientSideNodeManager,ClientSideRowModel=class extends import_core2.BeanStub{constructor(){super(...arguments),this.onRowHeightChanged_debounced=import_core2._.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const t=this.refreshModel.bind(this,{step:import_core2.ClientSideRowModelSteps.EVERYTHING}),e=!this.gos.get("suppressAnimationFrame"),o=this.refreshModel.bind(this,{step:import_core2.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:e});this.addManagedListener(this.eventService,import_core2.Events.EVENT_NEW_COLUMNS_LOADED,o),this.addManagedListener(this.eventService,import_core2.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t),this.addManagedListener(this.eventService,import_core2.Events.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,import_core2.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:import_core2.ClientSideRowModelSteps.PIVOT})),this.addManagedListener(this.eventService,import_core2.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,import_core2.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,import_core2.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.addManagedListener(this.eventService,import_core2.Events.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,import_core2.Events.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new import_core2.RowNode(this.beans),this.nodeManager=new ClientSideNodeManager(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const t=new Set(["treeData","masterDetail"]),e=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),o=new Set(["excludeChildrenWhenTreeDataFiltering"]),i=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),s=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),n=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),d=[...t,...e,...o,...i,...i,...s,...r,...n,...a];this.addManagedPropertyListeners(d,l=>{var u;const c=(u=l.changeSet)==null?void 0:u.properties;if(!c)return;const h=p=>c.some(g=>p.has(g));if(h(t)){this.setRowData(this.rootNode.allLeafChildren.map(p=>p.data));return}if(h(e)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.EVERYTHING});return}if(h(o)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.FILTER});return}if(h(i)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.PIVOT});return}if(h(s)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.AGGREGATE});return}if(h(r)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.SORT});return}if(h(n)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.FILTER_AGGREGATES});return}h(a)&&this.refreshModel({step:import_core2.ClientSideRowModelSteps.MAP})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const t=this.gos.get("rowData");t&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(t))}ensureRowHeightsValid(t,e,o,i){let s,r=!1;do{s=!1;const n=this.getRowIndexAtPixel(t),a=this.getRowIndexAtPixel(e),d=Math.max(n,o),l=Math.min(a,i);for(let u=d;u<=l;u++){const c=this.getRow(u);if(c.rowHeightEstimated){const h=this.gos.getRowHeightForNode(c);c.setRowHeight(h.height),s=!0,r=!0}}s&&this.setRowTopAndRowIndex()}while(s);return r}setRowTopAndRowIndex(){const t=this.environment.getDefaultRowHeight();let e=0;const o=new Set,i=this.gos.isDomLayout("normal");for(let s=0;s<this.rowsToDisplay.length;s++){const r=this.rowsToDisplay[s];if(r.id!=null&&o.add(r.id),r.rowHeight==null){const n=this.gos.getRowHeightForNode(r,i,t);r.setRowHeight(n.height,n.estimated)}r.setRowTop(e),r.setRowIndex(s),e+=r.rowHeight}return o}clearRowTopAndRowIndex(t,e){const o=t.isActive(),i=r=>{r&&r.id!=null&&!e.has(r.id)&&r.clearRowTopAndRowIndex()},s=r=>{if(i(r),i(r.detailNode),i(r.sibling),r.hasChildren()&&r.childrenAfterGroup){const n=r.level==-1;o&&!n&&!r.expanded||r.childrenAfterGroup.forEach(s)}};s(this.rootNode)}ensureRowsAtPixel(t,e,o=0){const i=this.getRowIndexAtPixel(e),s=this.getRow(i),r=!this.gos.get("suppressAnimationFrame");return s===t[0]?!1:(t.forEach(n=>{import_core2._.removeFromArray(this.rootNode.allLeafChildren,n)}),t.forEach((n,a)=>{import_core2._.insertIntoArray(this.rootNode.allLeafChildren,n,Math.max(i+o,0)+a)}),this.refreshModel({step:import_core2.ClientSideRowModelSteps.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(t,e){const o=e!=null?this.getRowIndexAtPixel(e):null,i=o!=null?this.getRow(o):null;if(!i||!t||i===t||e==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const s=this.getHighlightPosition(e,i);this.lastHighlightedRow&&this.lastHighlightedRow!==i&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),i.setHighlighted(s),this.lastHighlightedRow=i}getHighlightPosition(t,e){if(!e){const s=this.getRowIndexAtPixel(t);if(e=this.getRow(s||0),!e)return import_core2.RowHighlightPosition.Below}const{rowTop:o,rowHeight:i}=e;return t-o<i/2?import_core2.RowHighlightPosition.Above:import_core2.RowHighlightPosition.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.childrenAfterAggFilter;return e?e.length:0}getTopLevelRowDisplayedIndex(t){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return t;let o=this.rootNode.childrenAfterSort[t];if(this.gos.get("groupHideOpenParents"))for(;o.expanded&&o.childrenAfterSort&&o.childrenAfterSort.length>0;)o=o.childrenAfterSort[0];return o.rowIndex}getRowBounds(t){if(import_core2._.missing(this.rowsToDisplay))return null;const e=this.rowsToDisplay[t];return e?{rowTop:e.rowTop,rowHeight:e.rowHeight}:null}onRowGroupOpened(){const t=this.gos.isAnimateRows();this.refreshModel({step:import_core2.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:t})}onFilterChanged(t){if(t.afterDataChange)return;const e=this.gos.isAnimateRows(),i=t.columns.length===0||t.columns.some(s=>s.isPrimary())?import_core2.ClientSideRowModelSteps.FILTER:import_core2.ClientSideRowModelSteps.FILTER_AGGREGATES;this.refreshModel({step:i,keepRenderedRows:!0,animate:e})}onSortChanged(){const t=this.gos.isAnimateRows();this.refreshModel({step:import_core2.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:t,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:import_core2.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:import_core2.ClientSideRowModelSteps.AGGREGATE})}createChangePath(t){const e=import_core2._.missingOrEmpty(t),o=new import_core2.ChangedPath(!1,this.rootNode);return(e||this.gos.get("treeData"))&&o.setInactive(),o}isSuppressModelUpdateAfterUpdateTransaction(t){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||t.rowNodeTransactions==null)return!1;const e=t.rowNodeTransactions.filter(i=>i.add!=null&&i.add.length>0||i.remove!=null&&i.remove.length>0);return e==null||e.length==0}buildRefreshModelParams(t){let e=import_core2.ClientSideRowModelSteps.EVERYTHING;const o={everything:import_core2.ClientSideRowModelSteps.EVERYTHING,group:import_core2.ClientSideRowModelSteps.EVERYTHING,filter:import_core2.ClientSideRowModelSteps.FILTER,map:import_core2.ClientSideRowModelSteps.MAP,aggregate:import_core2.ClientSideRowModelSteps.AGGREGATE,sort:import_core2.ClientSideRowModelSteps.SORT,pivot:import_core2.ClientSideRowModelSteps.PIVOT};if(import_core2._.exists(t)&&(e=o[t]),import_core2._.missing(e)){console.error(`AG Grid: invalid step ${t}, available steps are ${Object.keys(o).join(", ")}`);return}const i=!this.gos.get("suppressAnimationFrame");return{step:e,keepRenderedRows:!0,keepEditingRows:!0,animate:i}}refreshModel(t){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let e=typeof t=="object"&&"step"in t?t:this.buildRefreshModelParams(t);if(!e||this.isSuppressModelUpdateAfterUpdateTransaction(e))return;const o=this.createChangePath(e.rowNodeTransactions);switch(this.isRefreshingModel=!0,e.step){case import_core2.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(e.rowNodeTransactions,e.rowNodeOrder,o,!!e.afterColumnsChanged);case import_core2.ClientSideRowModelSteps.FILTER:this.doFilter(o);case import_core2.ClientSideRowModelSteps.PIVOT:this.doPivot(o);case import_core2.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(o);case import_core2.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(o);case import_core2.ClientSideRowModelSteps.SORT:this.doSort(e.rowNodeTransactions,o);case import_core2.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}const i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(o,i),this.isRefreshingModel=!1;const s={type:import_core2.Events.EVENT_MODEL_UPDATED,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack};this.eventService.dispatchEvent(s)}isEmpty(){const t=import_core2._.missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return import_core2._.missing(this.rootNode)||t||!this.columnModel.isReady()}isRowsToRender(){return import_core2._.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(t,e){let o=!e,i=!1;const s=[],r=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(n=>{if(i)return;if(o&&(n===e||n===t)&&(i=!0,n.group&&r)){s.push(...n.allLeafChildren);return}if(!o){if(n!==e&&n!==t)return;o=!0}if(!n.group||!r){s.push(n);return}}),s}setDatasource(t){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(t){return this.rowsToDisplay[t]}isRowPresent(t){return this.rowsToDisplay.indexOf(t)>=0}getRowIndexAtPixel(t){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let e=0,o=this.rowsToDisplay.length-1;if(t<=0)return 0;if(import_core2._.last(this.rowsToDisplay).rowTop<=t)return this.rowsToDisplay.length-1;let s=-1,r=-1;for(;;){const n=Math.floor((e+o)/2),a=this.rowsToDisplay[n];if(this.isRowInPixel(a,t)||(a.rowTop<t?e=n+1:a.rowTop>t&&(o=n-1),s===e&&r===o))return n;s=e,r=o}}isRowInPixel(t,e){const o=t.rowTop,i=t.rowTop+t.rowHeight;return o<=e&&i>e}forEachLeafNode(t){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((e,o)=>t(e,o))}forEachNode(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:t,recursionType:0,index:0,includeFooterNodes:e})}forEachNodeAfterFilter(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:t,recursionType:1,index:0,includeFooterNodes:e})}forEachNodeAfterFilterAndSort(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:t,recursionType:2,index:0,includeFooterNodes:e})}forEachPivotNode(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:t,recursionType:3,index:0,includeFooterNodes:e})}recursivelyWalkNodesAndCallback(t){const{nodes:e,callback:o,recursionType:i,includeFooterNodes:s}=t;let{index:r}=t;const n=a=>{var d;const l=(d=e[0])==null?void 0:d.parent;if(!l)return;const u=s&&this.gos.getGrandTotalRow(),c=this.gos.getGroupTotalRowCallback(),h=s&&c({node:l});if(l===this.rootNode){u===a&&(l.createFooter(),o(l.sibling,r++));return}h===a&&(l.createFooter(),o(l.sibling,r++))};n("top");for(let a=0;a<e.length;a++){const d=e[a];if(o(d,r++),d.hasChildren()&&!d.footer){let l=null;switch(i){case 0:l=d.childrenAfterGroup;break;case 1:l=d.childrenAfterAggFilter;break;case 2:l=d.childrenAfterSort;break;case 3:l=d.leafGroup?null:d.childrenAfterSort;break}l&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...l],callback:o,recursionType:i,index:r,includeFooterNodes:s}))}}return n("bottom"),r}doAggregate(t){var e;(e=this.aggregationStage)==null||e.execute({rowNode:this.rootNode,changedPath:t})}doFilterAggregates(t){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:t}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(t){const e=this.gos.get("treeData"),o=this.columnModel.isPivotActive(),i=n=>{n&&n.forEach(a=>{const d=()=>{a.expanded=t,i(a.childrenAfterGroup)};if(e){import_core2._.exists(a.childrenAfterGroup)&&d();return}if(o){!a.leafGroup&&d();return}a.group&&d()})};this.rootNode&&i(this.rootNode.childrenAfterGroup),this.refreshModel({step:import_core2.ClientSideRowModelSteps.MAP});const s=t?"expandAll":"collapseAll",r={type:import_core2.Events.EVENT_EXPAND_COLLAPSE_ALL,source:s};this.eventService.dispatchEvent(r)}doSort(t,e){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,changedPath:e})}doRowGrouping(t,e,o,i){if(this.groupStage){if(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:e,changedPath:o}):this.groupStage.execute({rowNode:this.rootNode,changedPath:o,afterColumnsChanged:i}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",o)){const r={type:import_core2.Events.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(r)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:import_core2.Events.EVENT_ROW_COUNT_READY}))}doFilter(t){this.filterStage.execute({rowNode:this.rootNode,changedPath:t})}doPivot(t){var e;(e=this.pivotStage)==null||e.execute({rowNode:this.rootNode,changedPath:t})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(t){if(typeof t=="string"&&t.indexOf(import_core2.RowNode.ID_PREFIX_ROW_GROUP)==0){let o;return this.forEachNode(i=>{i.id===t&&(o=i)}),o}return this.nodeManager.getRowNode(t)}setRowData(t){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(t),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const t={type:import_core2.Events.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(t),this.refreshModel({step:import_core2.ClientSideRowModelSteps.EVERYTHING,newData:!0})}batchUpdateRowData(t,e){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const o=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},o)}this.rowDataTransactionBatch.push({rowDataTransaction:t,callback:e})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const t=[],e=[];let o=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(i=>{const s=this.nodeManager.updateRowData(i.rowDataTransaction,void 0);e.push(s),i.callback&&t.push(i.callback.bind(null,s)),typeof i.rowDataTransaction.addIndex=="number"&&(o=!0)}),this.commonUpdateRowData(e,void 0,o),t.length>0&&window.setTimeout(()=>{t.forEach(i=>i())},0),e.length>0){const i={type:import_core2.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:e};this.eventService.dispatchEvent(i)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(t,e){this.valueCache.onDataChanged();const o=this.nodeManager.updateRowData(t,e),i=typeof t.addIndex=="number";return this.commonUpdateRowData([o],e,i),o}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let o=0;o<this.rootNode.allLeafChildren.length;o++){const i=this.rootNode.allLeafChildren[o];e[i.id]=o}return e}commonUpdateRowData(t,e,o){if(!this.hasStarted)return;const i=!this.gos.get("suppressAnimationFrame");o&&(e=this.createRowNodeOrder());const s={type:import_core2.Events.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(s),this.refreshModel({step:import_core2.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:t,rowNodeOrder:e,keepRenderedRows:!0,keepEditingRows:!0,animate:i})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:import_core2.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const t=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let t=!1;return this.forEachNode(e=>{e.setRowHeight(e.rowHeight,!0);const o=e.detailNode;o&&o.setRowHeight(o.rowHeight,!0),e.sibling&&e.sibling.setRowHeight(e.sibling.rowHeight,!0),t=!0}),t}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};__decorateClass([(0,import_core2.Autowired)("columnModel")],ClientSideRowModel.prototype,"columnModel",2),__decorateClass([(0,import_core2.Autowired)("selectionService")],ClientSideRowModel.prototype,"selectionService",2),__decorateClass([(0,import_core2.Autowired)("valueCache")],ClientSideRowModel.prototype,"valueCache",2),__decorateClass([(0,import_core2.Autowired)("beans")],ClientSideRowModel.prototype,"beans",2),__decorateClass([(0,import_core2.Autowired)("filterStage")],ClientSideRowModel.prototype,"filterStage",2),__decorateClass([(0,import_core2.Autowired)("sortStage")],ClientSideRowModel.prototype,"sortStage",2),__decorateClass([(0,import_core2.Autowired)("flattenStage")],ClientSideRowModel.prototype,"flattenStage",2),__decorateClass([(0,import_core2.Optional)("groupStage")],ClientSideRowModel.prototype,"groupStage",2),__decorateClass([(0,import_core2.Optional)("aggregationStage")],ClientSideRowModel.prototype,"aggregationStage",2),__decorateClass([(0,import_core2.Optional)("pivotStage")],ClientSideRowModel.prototype,"pivotStage",2),__decorateClass([(0,import_core2.Optional)("filterAggregatesStage")],ClientSideRowModel.prototype,"filterAggregatesStage",2),__decorateClass([import_core2.PostConstruct],ClientSideRowModel.prototype,"init",1),ClientSideRowModel=__decorateClass([(0,import_core2.Bean)("rowModel")],ClientSideRowModel);var import_core3=require("@ag-grid-community/core"),FilterStage=class extends import_core3.BeanStub{execute(t){const{changedPath:e}=t;this.filterService.filter(e)}};__decorateClass([(0,import_core3.Autowired)("filterService")],FilterStage.prototype,"filterService",2),FilterStage=__decorateClass([(0,import_core3.Bean)("filterStage")],FilterStage);var import_core4=require("@ag-grid-community/core"),SortStage=class extends import_core4.BeanStub{execute(t){const e=this.sortController.getSortOptions(),o=import_core4._.exists(e)&&e.length>0,i=o&&import_core4._.exists(t.rowNodeTransactions)&&this.gos.get("deltaSort"),s=e.some(r=>this.gos.isColumnsSortingCoupledToGroup()?r.column.isPrimary()&&r.column.isRowGroupActive():!!r.column.getColDef().showRowGroup);this.sortService.sort(e,o,i,t.rowNodeTransactions,t.changedPath,s)}};__decorateClass([(0,import_core4.Autowired)("sortService")],SortStage.prototype,"sortService",2),__decorateClass([(0,import_core4.Autowired)("sortController")],SortStage.prototype,"sortController",2),SortStage=__decorateClass([(0,import_core4.Bean)("sortStage")],SortStage);var import_core5=require("@ag-grid-community/core"),FlattenStage=class extends import_core5.BeanStub{execute(t){const e=t.rowNode,o=[],i=this.beans.columnModel.isPivotMode(),s=i&&e.leafGroup,r=s?[e]:e.childrenAfterSort,n=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(n,r,o,i,0);const a=o.length>0;if(!s&&a&&n.grandTotalRow){e.createFooter();const l=n.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(n,e.sibling,o,0,l)}return o}getFlattenDetails(){const t=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!t&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:t,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(t,e,o,i,s){if(!import_core5._.missingOrEmpty(e))for(let r=0;r<e.length;r++){const n=e[r],a=n.hasChildren(),d=i&&!a,l=t.groupRemoveSingleChildren&&a&&n.childrenAfterGroup.length===1,u=t.groupRemoveLowestSingleChildren&&a&&n.leafGroup&&n.childrenAfterGroup.length===1,c=i&&n.leafGroup,h=t.hideOpenParents&&n.expanded&&!n.master&&!c;if(!d&&!h&&!l&&!u&&this.addRowNodeToRowsToDisplay(t,n,o,s),!(i&&n.leafGroup)){if(a){const g=l||u;if(n.expanded||g){const R=t.groupTotalRow({node:n});R||n.destroyFooter();const f=g?s:s+1;R==="top"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(t,n.sibling,o,f)),this.recursivelyAddToRowsToDisplay(t,n.childrenAfterSort,o,i,f),R==="bottom"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(t,n.sibling,o,f))}}else if(n.master&&n.expanded){const g=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(t,g,o,s)}}}}addRowNodeToRowsToDisplay(t,e,o,i,s){s?o.unshift(e):o.push(e),e.setUiLevel(t.isGroupMultiAutoColumn?0:i)}createDetailNode(t){if(import_core5._.exists(t.detailNode))return t.detailNode;const e=new import_core5.RowNode(this.beans);return e.detail=!0,e.selectable=!1,e.parent=t,import_core5._.exists(t.id)&&(e.id="detail_"+t.id),e.data=t.data,e.level=t.level+1,t.detailNode=e,e}};__decorateClass([(0,import_core5.Autowired)("beans")],FlattenStage.prototype,"beans",2),FlattenStage=__decorateClass([(0,import_core5.Bean)("flattenStage")],FlattenStage);var import_core6=require("@ag-grid-community/core"),SortService=class extends import_core6.BeanStub{sort(t,e,o,i,s,r){const n=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(h=>h.isRowGroupActive());let d={};o&&i&&(d=this.calculateDirtyNodes(i));const l=this.columnModel.isPivotMode(),u=this.gos.getCallback("postSortRows"),c=h=>{var p;this.pullDownGroupDataForHideOpenParents(h.childrenAfterAggFilter,!0);const g=l&&h.leafGroup;if(n&&a&&!h.leafGroup&&!r){const f=(p=this.columnModel.getRowGroupColumns())==null?void 0:p[h.level+1],E=f?.getSort()===null,C=h.childrenAfterAggFilter.slice(0);if(h.childrenAfterSort&&!E){const S={};h.childrenAfterSort.forEach((A,v)=>{S[A.id]=v}),C.sort((A,v)=>{var m,T;return((m=S[A.id])!=null?m:0)-((T=S[v.id])!=null?T:0)})}h.childrenAfterSort=C}else!e||g?h.childrenAfterSort=h.childrenAfterAggFilter.slice(0):o?h.childrenAfterSort=this.doDeltaSort(h,d,s,t):h.childrenAfterSort=this.rowNodeSorter.doFullSort(h.childrenAfterAggFilter,t);if(h.sibling&&(h.sibling.childrenAfterSort=h.childrenAfterSort),this.updateChildIndexes(h),u){const f={nodes:h.childrenAfterSort};u(f)}};s&&s.forEachChangedNodeDepthFirst(c),this.updateGroupDataForHideOpenParents(s)}calculateDirtyNodes(t){const e={},o=i=>{i&&i.forEach(s=>e[s.id]=!0)};return t&&t.forEach(i=>{o(i.add),o(i.update),o(i.remove)}),e}doDeltaSort(t,e,o,i){const s=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(s,i);const n={},a=[];s.forEach(c=>{e[c.id]||!o.canSkip(c)?a.push(c):n[c.id]=!0});const d=r.filter(c=>n[c.id]),l=(c,h)=>({currentPos:h,rowNode:c}),u=a.map(l).sort((c,h)=>this.rowNodeSorter.compareRowNodes(i,c,h));return this.mergeSortedArrays(i,u,d.map(l)).map(({rowNode:c})=>c)}mergeSortedArrays(t,e,o){const i=[];let s=0,r=0;for(;s<e.length&&r<o.length;)this.rowNodeSorter.compareRowNodes(t,e[s],o[r])<0?i.push(e[s++]):i.push(o[r++]);for(;s<e.length;)i.push(e[s++]);for(;r<o.length;)i.push(o[r++]);return i}updateChildIndexes(t){if(import_core6._.missing(t.childrenAfterSort))return;const e=t.childrenAfterSort;for(let o=0;o<e.length;o++){const i=e[o],s=o===0,r=o===t.childrenAfterSort.length-1;i.setFirstChild(s),i.setLastChild(r),i.setChildIndex(o)}}updateGroupDataForHideOpenParents(t){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return import_core6._.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;const e=o=>{this.pullDownGroupDataForHideOpenParents(o.childrenAfterSort,!1),o.childrenAfterSort.forEach(i=>{i.hasChildren()&&e(i)})};t&&t.executeFromRootNode(o=>e(o))}pullDownGroupDataForHideOpenParents(t,e){!this.gos.get("groupHideOpenParents")||import_core6._.missing(t)||t.forEach(o=>{this.columnModel.getGroupDisplayColumns().forEach(s=>{const r=s.getColDef().showRowGroup;if(typeof r!="string"){console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const n=r,a=this.columnModel.getPrimaryColumn(n);if(a!==o.rowGroupColumn)if(e)o.setGroupValue(s.getId(),void 0);else{const l=o.getFirstChildOfFirstChild(a);l&&o.setGroupValue(s.getId(),l.key)}})})}};__decorateClass([(0,import_core6.Autowired)("columnModel")],SortService.prototype,"columnModel",2),__decorateClass([(0,import_core6.Autowired)("rowNodeSorter")],SortService.prototype,"rowNodeSorter",2),SortService=__decorateClass([(0,import_core6.Bean)("sortService")],SortService);var import_core7=require("@ag-grid-community/core"),FilterService=class extends import_core7.BeanStub{filter(t){const e=this.filterManager.isChildFilterPresent();this.filterNodes(e,t)}filterNodes(t,e){const o=(i,s)=>{i.hasChildren()&&t&&!s?i.childrenAfterFilter=i.childrenAfterGroup.filter(r=>{const n=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return n||a}):i.childrenAfterFilter=i.childrenAfterGroup,i.sibling&&(i.sibling.childrenAfterFilter=i.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const i=(r,n)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const d=r.childrenAfterGroup[a],l=n||this.filterManager.doesRowPassFilter({rowNode:d});d.childrenAfterGroup?i(r.childrenAfterGroup[a],l):o(d,l)}o(r,n)},s=r=>i(r,!1);e.executeFromRootNode(s)}else{const i=s=>o(s,!1);e.forEachChangedNodeDepthFirst(i,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};__decorateClass([(0,import_core7.Autowired)("filterManager")],FilterService.prototype,"filterManager",2),FilterService=__decorateClass([(0,import_core7.Bean)("filterService")],FilterService);var import_core8=require("@ag-grid-community/core"),ImmutableService=class extends import_core8.BeanStub{postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const t=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:t}setRowData(t){const e=this.createTransactionForRowData(t);if(!e)return;const[o,i]=e;this.clientSideRowModel.updateRowData(o,i)}createTransactionForRowData(t){if(import_core8._.missing(this.clientSideRowModel)){console.error("AG Grid: ImmutableService only works with ClientSideRowModel");return}const e=this.gos.getCallback("getRowId");if(e==null){console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");return}const o={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),r=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return import_core8._.exists(t)&&t.forEach((n,a)=>{const d=e({data:n,level:0}),l=i[d];r&&(r[d]=a),l?(l.data!==n&&o.update.push(n),i[d]=void 0):o.add.push(n)}),import_core8._.iterateObject(i,(n,a)=>{a&&o.remove.push(a.data)}),[o,r]}onRowDataUpdated(){const t=this.gos.get("rowData");t&&(this.isActive()?this.setRowData(t):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(t)))}};__decorateClass([(0,import_core8.Autowired)("rowModel")],ImmutableService.prototype,"rowModel",2),__decorateClass([(0,import_core8.Autowired)("rowRenderer")],ImmutableService.prototype,"rowRenderer",2),__decorateClass([(0,import_core8.Autowired)("selectionService")],ImmutableService.prototype,"selectionService",2),__decorateClass([import_core8.PostConstruct],ImmutableService.prototype,"postConstruct",1),ImmutableService=__decorateClass([(0,import_core8.Bean)("immutableService")],ImmutableService);var VERSION="31.3.2",ClientSideRowModelModule={version:VERSION,moduleName:import_core9.ModuleNames.ClientSideRowModelModule,rowModel:"clientSide",beans:[ClientSideRowModel,FilterStage,SortStage,FlattenStage,SortService,FilterService,ImmutableService]};
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var o in e)__defProp(t,o,{get:e[o],enumerable:!0})},__copyProps=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of __getOwnPropNames(e))!__hasOwnProp.call(t,s)&&s!==o&&__defProp(t,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc(e,s))||i.enumerable});return t},__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),__decorateClass=(t,e,o,i)=>{for(var s=i>1?void 0:i?__getOwnPropDesc(e,o):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(s=(i?n(e,o,s):n(s))||s);return i&&s&&__defProp(e,o,s),s},main_exports={};__export(main_exports,{ClientSideRowModelModule:()=>ClientSideRowModelModule}),module.exports=__toCommonJS(main_exports);var import_core9=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),import_core=require("@ag-grid-community/core"),_ClientSideNodeManager=class w{constructor(e,o,i,s,r,n){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=o,this.eventService=i,this.columnModel=s,this.beans=n,this.selectionService=r,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=w.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return import_core._.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){console.warn("AG Grid: rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const o=this.rootNode,i=this.rootNode.sibling;o.childrenAfterFilter=null,o.childrenAfterGroup=null,o.childrenAfterAggFilter=null,o.childrenAfterSort=null,o.childrenMapped=null,o.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?o.allLeafChildren=e.map(s=>this.createNode(s,this.rootNode,w.TOP_LEVEL)):(o.allLeafChildren=[],o.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=o.childrenAfterFilter,i.childrenAfterGroup=o.childrenAfterGroup,i.childrenAfterAggFilter=o.childrenAfterAggFilter,i.childrenAfterSort=o.childrenAfterSort,i.childrenMapped=o.childrenMapped,i.allLeafChildren=o.allLeafChildren)}updateRowData(e,o){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),o&&import_core._.sortRowNodesByOrder(this.rootNode.allLeafChildren,o),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const o={type:import_core.Events.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:e?.length?e[0]:null};this.eventService.dispatchEvent(o)}updateSelection(e,o){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:o}),this.selectionService.updateGroupsFromChildrenSelections(o),i){const s={type:import_core.Events.EVENT_SELECTION_CHANGED,source:o};this.eventService.dispatchEvent(s)}}executeAdd(e,o){var i;const{add:s,addIndex:r}=e;if(import_core._.missingOrEmpty(s))return;const n=s.map(a=>this.createNode(a,this.rootNode,w.TOP_LEVEL));if(typeof r=="number"&&r>=0){const{allLeafChildren:a}=this.rootNode,d=a.length;let l=r;if(this.gos.get("treeData")&&r>0&&d>0){for(let p=0;p<d;p++)if(((i=a[p])==null?void 0:i.rowIndex)==r-1){l=p+1;break}}const c=a.slice(0,l),h=a.slice(l,a.length);this.rootNode.allLeafChildren=[...c,...n,...h]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...n];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),o.add=n}executeRemove(e,o,i){const{remove:s}=e;if(import_core._.missingOrEmpty(s))return;const r={};s.forEach(n=>{const a=this.lookupRowNode(n);a&&(a.isSelected()&&i.push(a),a.clearRowTopAndRowIndex(),r[a.id]=!0,delete this.allNodesMap[a.id],o.remove.push(a))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(n=>!r[n.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,o,i){const{update:s}=e;import_core._.missingOrEmpty(s)||s.forEach(r=>{const n=this.lookupRowNode(r);n&&(n.updateData(r),!n.selectable&&n.isSelected()&&i.push(n),this.setMasterForRow(n,r,w.TOP_LEVEL,!1),o.update.push(n))})}lookupRowNode(e){const o=this.gos.getCallback("getRowId");let i;if(o){const s=o({data:e,level:0});if(i=this.allNodesMap[s],!i)return console.error(`AG Grid: could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(s=>s.data===e),!i)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 i||null}createNode(e,o,i){const s=new import_core.RowNode(this.beans);s.group=!1,this.setMasterForRow(s,e,i,!0);const r=this.gos.get("suppressParentsInRowNodes");return o&&!r&&(s.parent=o),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&console.warn(`AG Grid: duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,o,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const a=this.gos.get("isRowMaster");a?e.setMaster(a(o)):e.setMaster(!0)}else e.setMaster(!1);if(s){const a=this.columnModel.getRowGroupColumns(),d=a?a.length:0,l=i+d;e.expanded=e.master?this.isExpanded(l):!1}}}isExpanded(e){const o=this.gos.get("groupDefaultExpanded");return o===-1?!0:e<o}};_ClientSideNodeManager.TOP_LEVEL=0,_ClientSideNodeManager.ROOT_NODE_ID="ROOT_NODE_ID";var ClientSideNodeManager=_ClientSideNodeManager,ClientSideRowModel=class extends import_core2.BeanStub{constructor(){super(...arguments),this.onRowHeightChanged_debounced=import_core2._.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const t=this.refreshModel.bind(this,{step:import_core2.ClientSideRowModelSteps.EVERYTHING}),e=!this.gos.get("suppressAnimationFrame"),o=this.refreshModel.bind(this,{step:import_core2.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:e});this.addManagedListener(this.eventService,import_core2.Events.EVENT_NEW_COLUMNS_LOADED,o),this.addManagedListener(this.eventService,import_core2.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t),this.addManagedListener(this.eventService,import_core2.Events.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,import_core2.Events.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:import_core2.ClientSideRowModelSteps.PIVOT})),this.addManagedListener(this.eventService,import_core2.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,import_core2.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,import_core2.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.addManagedListener(this.eventService,import_core2.Events.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,import_core2.Events.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new import_core2.RowNode(this.beans),this.nodeManager=new ClientSideNodeManager(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const t=new Set(["treeData","masterDetail"]),e=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),o=new Set(["excludeChildrenWhenTreeDataFiltering"]),i=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),s=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),n=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),d=[...t,...e,...o,...i,...i,...s,...r,...n,...a];this.addManagedPropertyListeners(d,l=>{var u;const c=(u=l.changeSet)==null?void 0:u.properties;if(!c)return;const h=p=>c.some(g=>p.has(g));if(h(t)){this.setRowData(this.rootNode.allLeafChildren.map(p=>p.data));return}if(h(e)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.EVERYTHING});return}if(h(o)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.FILTER});return}if(h(i)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.PIVOT});return}if(h(s)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.AGGREGATE});return}if(h(r)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.SORT});return}if(h(n)){this.refreshModel({step:import_core2.ClientSideRowModelSteps.FILTER_AGGREGATES});return}h(a)&&this.refreshModel({step:import_core2.ClientSideRowModelSteps.MAP})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const t=this.gos.get("rowData");t&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(t))}ensureRowHeightsValid(t,e,o,i){let s,r=!1;do{s=!1;const n=this.getRowIndexAtPixel(t),a=this.getRowIndexAtPixel(e),d=Math.max(n,o),l=Math.min(a,i);for(let u=d;u<=l;u++){const c=this.getRow(u);if(c.rowHeightEstimated){const h=this.gos.getRowHeightForNode(c);c.setRowHeight(h.height),s=!0,r=!0}}s&&this.setRowTopAndRowIndex()}while(s);return r}setRowTopAndRowIndex(){const t=this.environment.getDefaultRowHeight();let e=0;const o=new Set,i=this.gos.isDomLayout("normal");for(let s=0;s<this.rowsToDisplay.length;s++){const r=this.rowsToDisplay[s];if(r.id!=null&&o.add(r.id),r.rowHeight==null){const n=this.gos.getRowHeightForNode(r,i,t);r.setRowHeight(n.height,n.estimated)}r.setRowTop(e),r.setRowIndex(s),e+=r.rowHeight}return o}clearRowTopAndRowIndex(t,e){const o=t.isActive(),i=r=>{r&&r.id!=null&&!e.has(r.id)&&r.clearRowTopAndRowIndex()},s=r=>{if(i(r),i(r.detailNode),i(r.sibling),r.hasChildren()&&r.childrenAfterGroup){const n=r.level==-1;o&&!n&&!r.expanded||r.childrenAfterGroup.forEach(s)}};s(this.rootNode)}ensureRowsAtPixel(t,e,o=0){const i=this.getRowIndexAtPixel(e),s=this.getRow(i),r=!this.gos.get("suppressAnimationFrame");return s===t[0]?!1:(t.forEach(n=>{import_core2._.removeFromArray(this.rootNode.allLeafChildren,n)}),t.forEach((n,a)=>{import_core2._.insertIntoArray(this.rootNode.allLeafChildren,n,Math.max(i+o,0)+a)}),this.refreshModel({step:import_core2.ClientSideRowModelSteps.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(t,e){const o=e!=null?this.getRowIndexAtPixel(e):null,i=o!=null?this.getRow(o):null;if(!i||!t||i===t||e==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const s=this.getHighlightPosition(e,i);this.lastHighlightedRow&&this.lastHighlightedRow!==i&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),i.setHighlighted(s),this.lastHighlightedRow=i}getHighlightPosition(t,e){if(!e){const s=this.getRowIndexAtPixel(t);if(e=this.getRow(s||0),!e)return import_core2.RowHighlightPosition.Below}const{rowTop:o,rowHeight:i}=e;return t-o<i/2?import_core2.RowHighlightPosition.Above:import_core2.RowHighlightPosition.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.childrenAfterAggFilter;return e?e.length:0}getTopLevelRowDisplayedIndex(t){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return t;let o=this.rootNode.childrenAfterSort[t];if(this.gos.get("groupHideOpenParents"))for(;o.expanded&&o.childrenAfterSort&&o.childrenAfterSort.length>0;)o=o.childrenAfterSort[0];return o.rowIndex}getRowBounds(t){if(import_core2._.missing(this.rowsToDisplay))return null;const e=this.rowsToDisplay[t];return e?{rowTop:e.rowTop,rowHeight:e.rowHeight}:null}onRowGroupOpened(){const t=this.gos.isAnimateRows();this.refreshModel({step:import_core2.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:t})}onFilterChanged(t){if(t.afterDataChange)return;const e=this.gos.isAnimateRows(),i=t.columns.length===0||t.columns.some(s=>s.isPrimary())?import_core2.ClientSideRowModelSteps.FILTER:import_core2.ClientSideRowModelSteps.FILTER_AGGREGATES;this.refreshModel({step:i,keepRenderedRows:!0,animate:e})}onSortChanged(){const t=this.gos.isAnimateRows();this.refreshModel({step:import_core2.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:t,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:import_core2.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:import_core2.ClientSideRowModelSteps.AGGREGATE})}createChangePath(t){const e=import_core2._.missingOrEmpty(t),o=new import_core2.ChangedPath(!1,this.rootNode);return(e||this.gos.get("treeData"))&&o.setInactive(),o}isSuppressModelUpdateAfterUpdateTransaction(t){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||t.rowNodeTransactions==null)return!1;const e=t.rowNodeTransactions.filter(i=>i.add!=null&&i.add.length>0||i.remove!=null&&i.remove.length>0);return e==null||e.length==0}buildRefreshModelParams(t){let e=import_core2.ClientSideRowModelSteps.EVERYTHING;const o={everything:import_core2.ClientSideRowModelSteps.EVERYTHING,group:import_core2.ClientSideRowModelSteps.EVERYTHING,filter:import_core2.ClientSideRowModelSteps.FILTER,map:import_core2.ClientSideRowModelSteps.MAP,aggregate:import_core2.ClientSideRowModelSteps.AGGREGATE,sort:import_core2.ClientSideRowModelSteps.SORT,pivot:import_core2.ClientSideRowModelSteps.PIVOT};if(import_core2._.exists(t)&&(e=o[t]),import_core2._.missing(e)){console.error(`AG Grid: invalid step ${t}, available steps are ${Object.keys(o).join(", ")}`);return}const i=!this.gos.get("suppressAnimationFrame");return{step:e,keepRenderedRows:!0,keepEditingRows:!0,animate:i}}refreshModel(t){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let e=typeof t=="object"&&"step"in t?t:this.buildRefreshModelParams(t);if(!e||this.isSuppressModelUpdateAfterUpdateTransaction(e))return;const o=this.createChangePath(e.rowNodeTransactions);switch(this.isRefreshingModel=!0,e.step){case import_core2.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(e.rowNodeTransactions,e.rowNodeOrder,o,!!e.afterColumnsChanged);case import_core2.ClientSideRowModelSteps.FILTER:this.doFilter(o);case import_core2.ClientSideRowModelSteps.PIVOT:this.doPivot(o);case import_core2.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(o);case import_core2.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(o);case import_core2.ClientSideRowModelSteps.SORT:this.doSort(e.rowNodeTransactions,o);case import_core2.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}const i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(o,i),this.isRefreshingModel=!1;const s={type:import_core2.Events.EVENT_MODEL_UPDATED,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack};this.eventService.dispatchEvent(s)}isEmpty(){const t=import_core2._.missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return import_core2._.missing(this.rootNode)||t||!this.columnModel.isReady()}isRowsToRender(){return import_core2._.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(t,e){let o=!e,i=!1;const s=[],r=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(n=>{if(i)return;if(o&&(n===e||n===t)&&(i=!0,n.group&&r)){s.push(...n.allLeafChildren);return}if(!o){if(n!==e&&n!==t)return;o=!0}if(!n.group||!r){s.push(n);return}}),s}setDatasource(t){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(t){return this.rowsToDisplay[t]}isRowPresent(t){return this.rowsToDisplay.indexOf(t)>=0}getRowIndexAtPixel(t){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let e=0,o=this.rowsToDisplay.length-1;if(t<=0)return 0;if(import_core2._.last(this.rowsToDisplay).rowTop<=t)return this.rowsToDisplay.length-1;let s=-1,r=-1;for(;;){const n=Math.floor((e+o)/2),a=this.rowsToDisplay[n];if(this.isRowInPixel(a,t)||(a.rowTop<t?e=n+1:a.rowTop>t&&(o=n-1),s===e&&r===o))return n;s=e,r=o}}isRowInPixel(t,e){const o=t.rowTop,i=t.rowTop+t.rowHeight;return o<=e&&i>e}forEachLeafNode(t){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((e,o)=>t(e,o))}forEachNode(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:t,recursionType:0,index:0,includeFooterNodes:e})}forEachNodeAfterFilter(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:t,recursionType:1,index:0,includeFooterNodes:e})}forEachNodeAfterFilterAndSort(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:t,recursionType:2,index:0,includeFooterNodes:e})}forEachPivotNode(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:t,recursionType:3,index:0,includeFooterNodes:e})}recursivelyWalkNodesAndCallback(t){const{nodes:e,callback:o,recursionType:i,includeFooterNodes:s}=t;let{index:r}=t;const n=a=>{var d;const l=(d=e[0])==null?void 0:d.parent;if(!l)return;const u=s&&this.gos.getGrandTotalRow(),c=this.gos.getGroupTotalRowCallback(),h=s&&c({node:l});if(l===this.rootNode){u===a&&(l.createFooter(),o(l.sibling,r++));return}h===a&&(l.createFooter(),o(l.sibling,r++))};n("top");for(let a=0;a<e.length;a++){const d=e[a];if(o(d,r++),d.hasChildren()&&!d.footer){let l=null;switch(i){case 0:l=d.childrenAfterGroup;break;case 1:l=d.childrenAfterAggFilter;break;case 2:l=d.childrenAfterSort;break;case 3:l=d.leafGroup?null:d.childrenAfterSort;break}l&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...l],callback:o,recursionType:i,index:r,includeFooterNodes:s}))}}return n("bottom"),r}doAggregate(t){var e;(e=this.aggregationStage)==null||e.execute({rowNode:this.rootNode,changedPath:t})}doFilterAggregates(t){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:t}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(t){const e=this.gos.get("treeData"),o=this.columnModel.isPivotActive(),i=n=>{n&&n.forEach(a=>{const d=()=>{a.expanded=t,i(a.childrenAfterGroup)};if(e){import_core2._.exists(a.childrenAfterGroup)&&d();return}if(o){!a.leafGroup&&d();return}a.group&&d()})};this.rootNode&&i(this.rootNode.childrenAfterGroup),this.refreshModel({step:import_core2.ClientSideRowModelSteps.MAP});const s=t?"expandAll":"collapseAll",r={type:import_core2.Events.EVENT_EXPAND_COLLAPSE_ALL,source:s};this.eventService.dispatchEvent(r)}doSort(t,e){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,changedPath:e})}doRowGrouping(t,e,o,i){if(this.groupStage){if(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:e,changedPath:o}):this.groupStage.execute({rowNode:this.rootNode,changedPath:o,afterColumnsChanged:i}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",o)){const r={type:import_core2.Events.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(r)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:import_core2.Events.EVENT_ROW_COUNT_READY}))}doFilter(t){this.filterStage.execute({rowNode:this.rootNode,changedPath:t})}doPivot(t){var e;(e=this.pivotStage)==null||e.execute({rowNode:this.rootNode,changedPath:t})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(t){if(typeof t=="string"&&t.indexOf(import_core2.RowNode.ID_PREFIX_ROW_GROUP)==0){let o;return this.forEachNode(i=>{i.id===t&&(o=i)}),o}return this.nodeManager.getRowNode(t)}setRowData(t){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(t),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const t={type:import_core2.Events.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(t),this.refreshModel({step:import_core2.ClientSideRowModelSteps.EVERYTHING,newData:!0})}batchUpdateRowData(t,e){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const o=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},o)}this.rowDataTransactionBatch.push({rowDataTransaction:t,callback:e})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const t=[],e=[];let o=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(i=>{const s=this.nodeManager.updateRowData(i.rowDataTransaction,void 0);e.push(s),i.callback&&t.push(i.callback.bind(null,s)),typeof i.rowDataTransaction.addIndex=="number"&&(o=!0)}),this.commonUpdateRowData(e,void 0,o),t.length>0&&window.setTimeout(()=>{t.forEach(i=>i())},0),e.length>0){const i={type:import_core2.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:e};this.eventService.dispatchEvent(i)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(t,e){this.valueCache.onDataChanged();const o=this.nodeManager.updateRowData(t,e),i=typeof t.addIndex=="number";return this.commonUpdateRowData([o],e,i),o}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let o=0;o<this.rootNode.allLeafChildren.length;o++){const i=this.rootNode.allLeafChildren[o];e[i.id]=o}return e}commonUpdateRowData(t,e,o){if(!this.hasStarted)return;const i=!this.gos.get("suppressAnimationFrame");o&&(e=this.createRowNodeOrder());const s={type:import_core2.Events.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(s),this.refreshModel({step:import_core2.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:t,rowNodeOrder:e,keepRenderedRows:!0,keepEditingRows:!0,animate:i})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:import_core2.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const t=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let t=!1;return this.forEachNode(e=>{e.setRowHeight(e.rowHeight,!0);const o=e.detailNode;o&&o.setRowHeight(o.rowHeight,!0),e.sibling&&e.sibling.setRowHeight(e.sibling.rowHeight,!0),t=!0}),t}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};__decorateClass([(0,import_core2.Autowired)("columnModel")],ClientSideRowModel.prototype,"columnModel",2),__decorateClass([(0,import_core2.Autowired)("selectionService")],ClientSideRowModel.prototype,"selectionService",2),__decorateClass([(0,import_core2.Autowired)("valueCache")],ClientSideRowModel.prototype,"valueCache",2),__decorateClass([(0,import_core2.Autowired)("beans")],ClientSideRowModel.prototype,"beans",2),__decorateClass([(0,import_core2.Autowired)("filterStage")],ClientSideRowModel.prototype,"filterStage",2),__decorateClass([(0,import_core2.Autowired)("sortStage")],ClientSideRowModel.prototype,"sortStage",2),__decorateClass([(0,import_core2.Autowired)("flattenStage")],ClientSideRowModel.prototype,"flattenStage",2),__decorateClass([(0,import_core2.Optional)("groupStage")],ClientSideRowModel.prototype,"groupStage",2),__decorateClass([(0,import_core2.Optional)("aggregationStage")],ClientSideRowModel.prototype,"aggregationStage",2),__decorateClass([(0,import_core2.Optional)("pivotStage")],ClientSideRowModel.prototype,"pivotStage",2),__decorateClass([(0,import_core2.Optional)("filterAggregatesStage")],ClientSideRowModel.prototype,"filterAggregatesStage",2),__decorateClass([import_core2.PostConstruct],ClientSideRowModel.prototype,"init",1),ClientSideRowModel=__decorateClass([(0,import_core2.Bean)("rowModel")],ClientSideRowModel);var import_core3=require("@ag-grid-community/core"),FilterStage=class extends import_core3.BeanStub{execute(t){const{changedPath:e}=t;this.filterService.filter(e)}};__decorateClass([(0,import_core3.Autowired)("filterService")],FilterStage.prototype,"filterService",2),FilterStage=__decorateClass([(0,import_core3.Bean)("filterStage")],FilterStage);var import_core4=require("@ag-grid-community/core"),SortStage=class extends import_core4.BeanStub{execute(t){const e=this.sortController.getSortOptions(),o=import_core4._.exists(e)&&e.length>0,i=o&&import_core4._.exists(t.rowNodeTransactions)&&this.gos.get("deltaSort"),s=e.some(r=>this.gos.isColumnsSortingCoupledToGroup()?r.column.isPrimary()&&r.column.isRowGroupActive():!!r.column.getColDef().showRowGroup);this.sortService.sort(e,o,i,t.rowNodeTransactions,t.changedPath,s)}};__decorateClass([(0,import_core4.Autowired)("sortService")],SortStage.prototype,"sortService",2),__decorateClass([(0,import_core4.Autowired)("sortController")],SortStage.prototype,"sortController",2),SortStage=__decorateClass([(0,import_core4.Bean)("sortStage")],SortStage);var import_core5=require("@ag-grid-community/core"),FlattenStage=class extends import_core5.BeanStub{execute(t){const e=t.rowNode,o=[],i=this.beans.columnModel.isPivotMode(),s=i&&e.leafGroup,r=s?[e]:e.childrenAfterSort,n=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(n,r,o,i,0);const a=o.length>0;if(!s&&a&&n.grandTotalRow){e.createFooter();const l=n.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(n,e.sibling,o,0,l)}return o}getFlattenDetails(){const t=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!t&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:t,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(t,e,o,i,s){if(!import_core5._.missingOrEmpty(e))for(let r=0;r<e.length;r++){const n=e[r],a=n.hasChildren(),d=i&&!a,l=t.groupRemoveSingleChildren&&a&&n.childrenAfterGroup.length===1,u=t.groupRemoveLowestSingleChildren&&a&&n.leafGroup&&n.childrenAfterGroup.length===1,c=i&&n.leafGroup,h=t.hideOpenParents&&n.expanded&&!n.master&&!c;if(!d&&!h&&!l&&!u&&this.addRowNodeToRowsToDisplay(t,n,o,s),!(i&&n.leafGroup)){if(a){const g=l||u;if(n.expanded||g){const R=t.groupTotalRow({node:n});R||n.destroyFooter();const f=g?s:s+1;R==="top"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(t,n.sibling,o,f)),this.recursivelyAddToRowsToDisplay(t,n.childrenAfterSort,o,i,f),R==="bottom"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(t,n.sibling,o,f))}}else if(n.master&&n.expanded){const g=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(t,g,o,s)}}}}addRowNodeToRowsToDisplay(t,e,o,i,s){s?o.unshift(e):o.push(e),e.setUiLevel(t.isGroupMultiAutoColumn?0:i)}createDetailNode(t){if(import_core5._.exists(t.detailNode))return t.detailNode;const e=new import_core5.RowNode(this.beans);return e.detail=!0,e.selectable=!1,e.parent=t,import_core5._.exists(t.id)&&(e.id="detail_"+t.id),e.data=t.data,e.level=t.level+1,t.detailNode=e,e}};__decorateClass([(0,import_core5.Autowired)("beans")],FlattenStage.prototype,"beans",2),FlattenStage=__decorateClass([(0,import_core5.Bean)("flattenStage")],FlattenStage);var import_core6=require("@ag-grid-community/core"),SortService=class extends import_core6.BeanStub{sort(t,e,o,i,s,r){const n=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(h=>h.isRowGroupActive());let d={};o&&i&&(d=this.calculateDirtyNodes(i));const l=this.columnModel.isPivotMode(),u=this.gos.getCallback("postSortRows"),c=h=>{var p;this.pullDownGroupDataForHideOpenParents(h.childrenAfterAggFilter,!0);const g=l&&h.leafGroup;if(n&&a&&!h.leafGroup&&!r){const f=(p=this.columnModel.getRowGroupColumns())==null?void 0:p[h.level+1],E=f?.getSort()===null,C=h.childrenAfterAggFilter.slice(0);if(h.childrenAfterSort&&!E){const S={};h.childrenAfterSort.forEach((A,v)=>{S[A.id]=v}),C.sort((A,v)=>{var m,T;return((m=S[A.id])!=null?m:0)-((T=S[v.id])!=null?T:0)})}h.childrenAfterSort=C}else!e||g?h.childrenAfterSort=h.childrenAfterAggFilter.slice(0):o?h.childrenAfterSort=this.doDeltaSort(h,d,s,t):h.childrenAfterSort=this.rowNodeSorter.doFullSort(h.childrenAfterAggFilter,t);if(h.sibling&&(h.sibling.childrenAfterSort=h.childrenAfterSort),this.updateChildIndexes(h),u){const f={nodes:h.childrenAfterSort};u(f)}};s&&s.forEachChangedNodeDepthFirst(c),this.updateGroupDataForHideOpenParents(s)}calculateDirtyNodes(t){const e={},o=i=>{i&&i.forEach(s=>e[s.id]=!0)};return t&&t.forEach(i=>{o(i.add),o(i.update),o(i.remove)}),e}doDeltaSort(t,e,o,i){const s=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(s,i);const n={},a=[];s.forEach(c=>{e[c.id]||!o.canSkip(c)?a.push(c):n[c.id]=!0});const d=r.filter(c=>n[c.id]),l=(c,h)=>({currentPos:h,rowNode:c}),u=a.map(l).sort((c,h)=>this.rowNodeSorter.compareRowNodes(i,c,h));return this.mergeSortedArrays(i,u,d.map(l)).map(({rowNode:c})=>c)}mergeSortedArrays(t,e,o){const i=[];let s=0,r=0;for(;s<e.length&&r<o.length;)this.rowNodeSorter.compareRowNodes(t,e[s],o[r])<0?i.push(e[s++]):i.push(o[r++]);for(;s<e.length;)i.push(e[s++]);for(;r<o.length;)i.push(o[r++]);return i}updateChildIndexes(t){if(import_core6._.missing(t.childrenAfterSort))return;const e=t.childrenAfterSort;for(let o=0;o<e.length;o++){const i=e[o],s=o===0,r=o===t.childrenAfterSort.length-1;i.setFirstChild(s),i.setLastChild(r),i.setChildIndex(o)}}updateGroupDataForHideOpenParents(t){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return import_core6._.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;const e=o=>{this.pullDownGroupDataForHideOpenParents(o.childrenAfterSort,!1),o.childrenAfterSort.forEach(i=>{i.hasChildren()&&e(i)})};t&&t.executeFromRootNode(o=>e(o))}pullDownGroupDataForHideOpenParents(t,e){!this.gos.get("groupHideOpenParents")||import_core6._.missing(t)||t.forEach(o=>{this.columnModel.getGroupDisplayColumns().forEach(s=>{const r=s.getColDef().showRowGroup;if(typeof r!="string"){console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const n=r,a=this.columnModel.getPrimaryColumn(n);if(a!==o.rowGroupColumn)if(e)o.setGroupValue(s.getId(),void 0);else{const l=o.getFirstChildOfFirstChild(a);l&&o.setGroupValue(s.getId(),l.key)}})})}};__decorateClass([(0,import_core6.Autowired)("columnModel")],SortService.prototype,"columnModel",2),__decorateClass([(0,import_core6.Autowired)("rowNodeSorter")],SortService.prototype,"rowNodeSorter",2),SortService=__decorateClass([(0,import_core6.Bean)("sortService")],SortService);var import_core7=require("@ag-grid-community/core"),FilterService=class extends import_core7.BeanStub{filter(t){const e=this.filterManager.isChildFilterPresent();this.filterNodes(e,t)}filterNodes(t,e){const o=(i,s)=>{i.hasChildren()&&t&&!s?i.childrenAfterFilter=i.childrenAfterGroup.filter(r=>{const n=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return n||a}):i.childrenAfterFilter=i.childrenAfterGroup,i.sibling&&(i.sibling.childrenAfterFilter=i.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const i=(r,n)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const d=r.childrenAfterGroup[a],l=n||this.filterManager.doesRowPassFilter({rowNode:d});d.childrenAfterGroup?i(r.childrenAfterGroup[a],l):o(d,l)}o(r,n)},s=r=>i(r,!1);e.executeFromRootNode(s)}else{const i=s=>o(s,!1);e.forEachChangedNodeDepthFirst(i,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};__decorateClass([(0,import_core7.Autowired)("filterManager")],FilterService.prototype,"filterManager",2),FilterService=__decorateClass([(0,import_core7.Bean)("filterService")],FilterService);var import_core8=require("@ag-grid-community/core"),ImmutableService=class extends import_core8.BeanStub{postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const t=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:t}setRowData(t){const e=this.createTransactionForRowData(t);if(!e)return;const[o,i]=e;this.clientSideRowModel.updateRowData(o,i)}createTransactionForRowData(t){if(import_core8._.missing(this.clientSideRowModel)){console.error("AG Grid: ImmutableService only works with ClientSideRowModel");return}const e=this.gos.getCallback("getRowId");if(e==null){console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");return}const o={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),r=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return import_core8._.exists(t)&&t.forEach((n,a)=>{const d=e({data:n,level:0}),l=i[d];r&&(r[d]=a),l?(l.data!==n&&o.update.push(n),i[d]=void 0):o.add.push(n)}),import_core8._.iterateObject(i,(n,a)=>{a&&o.remove.push(a.data)}),[o,r]}onRowDataUpdated(){const t=this.gos.get("rowData");t&&(this.isActive()?this.setRowData(t):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(t)))}};__decorateClass([(0,import_core8.Autowired)("rowModel")],ImmutableService.prototype,"rowModel",2),__decorateClass([(0,import_core8.Autowired)("rowRenderer")],ImmutableService.prototype,"rowRenderer",2),__decorateClass([(0,import_core8.Autowired)("selectionService")],ImmutableService.prototype,"selectionService",2),__decorateClass([import_core8.PostConstruct],ImmutableService.prototype,"postConstruct",1),ImmutableService=__decorateClass([(0,import_core8.Bean)("immutableService")],ImmutableService);var VERSION="31.3.3",ClientSideRowModelModule={version:VERSION,moduleName:import_core9.ModuleNames.ClientSideRowModelModule,rowModel:"clientSide",beans:[ClientSideRowModel,FilterStage,SortStage,FlattenStage,SortService,FilterService,ImmutableService]};
{
"name": "@ag-grid-community/client-side-row-model",
"version": "31.3.2",
"version": "31.3.3",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
"dependencies": {
"tslib": "^2.3.0",
"@ag-grid-community/core": "31.3.2"
"@ag-grid-community/core": "31.3.3"
},

@@ -9,0 +9,0 @@ "main": "./dist/package/main.cjs.js",

{
"name": "@ag-grid-community/client-side-row-model",
"version": "31.3.2",
"version": "31.3.3",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
"dependencies": {
"tslib": "^2.3.0",
"@ag-grid-community/core": "31.3.2"
"@ag-grid-community/core": "31.3.3"
},

@@ -9,0 +9,0 @@ "main": "./src/main.js",

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

export declare const VERSION = "31.3.2";
export declare const VERSION = "31.3.3";
{
"name": "@ag-grid-community/client-side-row-model",
"version": "31.3.2",
"version": "31.3.3",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
"dependencies": {
"tslib": "^2.3.0",
"@ag-grid-community/core": "31.3.2"
"@ag-grid-community/core": "31.3.3"
},

@@ -9,0 +9,0 @@ "main": "./dist/package/main.cjs.js",

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc