@ag-grid-community/client-side-row-model
Advanced tools
Comparing version 23.1.1 to 23.2.0
@@ -17,2 +17,3 @@ import { RowNode, GridOptionsWrapper, Context, EventService, ColumnController, GridApi, ColumnApi, SelectionController, RowDataTransaction, RowNodeTransaction } from "@ag-grid-community/core"; | ||
private doingLegacyTreeData; | ||
private doingTreeData; | ||
private doingMasterDetail; | ||
@@ -32,2 +33,3 @@ private allNodesMap; | ||
} | null | undefined): RowNodeTransaction | null; | ||
private updateSelection; | ||
private executeAdd; | ||
@@ -40,2 +42,3 @@ private executeRemove; | ||
private createNode; | ||
private setMasterForRow; | ||
private isExpanded; | ||
@@ -42,0 +45,0 @@ private setLeafChildren; |
@@ -34,3 +34,4 @@ "use strict"; | ||
this.isRowMasterFunc = this.gridOptionsWrapper.getIsRowMasterFunc(); | ||
this.doingLegacyTreeData = core_1._.exists(this.getNodeChildDetails); | ||
this.doingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
this.doingLegacyTreeData = !this.doingTreeData && core_1._.exists(this.getNodeChildDetails); | ||
this.doingMasterDetail = this.gridOptionsWrapper.isMasterDetail(); | ||
@@ -82,5 +83,7 @@ if (this.getNodeChildDetails) { | ||
}; | ||
var nodesToUnselect = []; | ||
this.executeAdd(rowDataTran, rowNodeTransaction); | ||
this.executeRemove(rowDataTran, rowNodeTransaction); | ||
this.executeUpdate(rowDataTran, rowNodeTransaction); | ||
this.executeRemove(rowDataTran, rowNodeTransaction, nodesToUnselect); | ||
this.executeUpdate(rowDataTran, rowNodeTransaction, nodesToUnselect); | ||
this.updateSelection(nodesToUnselect); | ||
if (rowNodeOrder) { | ||
@@ -91,2 +94,23 @@ core_1._.sortRowNodesByOrder(this.rootNode.allLeafChildren, rowNodeOrder); | ||
}; | ||
ClientSideNodeManager.prototype.updateSelection = function (nodesToUnselect) { | ||
var selectionChanged = nodesToUnselect.length > 0; | ||
if (selectionChanged) { | ||
nodesToUnselect.forEach(function (rowNode) { | ||
rowNode.setSelected(false, false, true); | ||
}); | ||
} | ||
// we do this regardless of nodes to unselect or not, as it's possible | ||
// a new node was inserted, so a parent that was previously selected (as all | ||
// children were selected) should not be tri-state (as new one unselected against | ||
// all other selected children). | ||
this.selectionController.updateGroupsFromChildrenSelections(); | ||
if (selectionChanged) { | ||
var event_1 = { | ||
type: core_1.Events.EVENT_SELECTION_CHANGED, | ||
api: this.gridApi, | ||
columnApi: this.columnApi | ||
}; | ||
this.eventService.dispatchEvent(event_1); | ||
} | ||
}; | ||
ClientSideNodeManager.prototype.executeAdd = function (rowDataTran, rowNodeTransaction) { | ||
@@ -113,3 +137,3 @@ var _this = this; | ||
}; | ||
ClientSideNodeManager.prototype.executeRemove = function (rowDataTran, rowNodeTransaction) { | ||
ClientSideNodeManager.prototype.executeRemove = function (rowDataTran, rowNodeTransaction, nodesToUnselect) { | ||
var _this = this; | ||
@@ -121,3 +145,2 @@ var remove = rowDataTran.remove; | ||
var rowIdsRemoved = {}; | ||
var anyNodesSelected = false; | ||
remove.forEach(function (item) { | ||
@@ -128,8 +151,7 @@ var rowNode = _this.lookupRowNode(item); | ||
} | ||
// do delete - setting 'suppressFinishActions = true' to ensure EVENT_SELECTION_CHANGED is not raised for | ||
// each row node updated, instead it is raised once by the calling code if any selected nodes exist. | ||
if (rowNode.isSelected()) { | ||
anyNodesSelected = true; | ||
nodesToUnselect.push(rowNode); | ||
} | ||
// do delete - setting 'tailingNodeInSequence = true' to ensure EVENT_SELECTION_CHANGED is not raised for | ||
// each row node updated, instead it is raised once by the calling code if any selected nodes exist. | ||
rowNode.setSelected(false, false, true); | ||
// so row renderer knows to fade row out (and not reposition it) | ||
@@ -145,13 +167,4 @@ rowNode.clearRowTop(); | ||
this.rootNode.allLeafChildren = this.rootNode.allLeafChildren.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; }); | ||
if (anyNodesSelected) { | ||
this.selectionController.updateGroupsFromChildrenSelections(); | ||
var event_1 = { | ||
type: core_1.Events.EVENT_SELECTION_CHANGED, | ||
api: this.gridApi, | ||
columnApi: this.columnApi | ||
}; | ||
this.eventService.dispatchEvent(event_1); | ||
} | ||
}; | ||
ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction) { | ||
ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) { | ||
var _this = this; | ||
@@ -168,2 +181,6 @@ var update = rowDataTran.update; | ||
rowNode.updateData(item); | ||
if (!rowNode.selectable && rowNode.isSelected()) { | ||
nodesToUnselect.push(rowNode); | ||
} | ||
_this.setMasterForRow(rowNode, item, ClientSideNodeManager.TOP_LEVEL, false); | ||
rowNodeTransaction.update.push(rowNode); | ||
@@ -220,6 +237,4 @@ }); | ||
var node = new core_1.RowNode(); | ||
this.context.wireBean(node); | ||
var doingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
var doingLegacyTreeData = !doingTreeData && core_1._.exists(this.getNodeChildDetails); | ||
var nodeChildDetails = doingLegacyTreeData ? this.getNodeChildDetails(dataItem) : null; | ||
this.context.createBean(node); | ||
var nodeChildDetails = this.doingLegacyTreeData ? this.getNodeChildDetails(dataItem) : null; | ||
if (nodeChildDetails && nodeChildDetails.group) { | ||
@@ -231,4 +246,2 @@ node.group = true; | ||
node.key = nodeChildDetails.key; | ||
/** @deprecated is now 'master' */ | ||
node.canFlower = node.master; | ||
// pull out all the leaf children and add to our node | ||
@@ -239,32 +252,6 @@ this.setLeafChildren(node); | ||
node.group = false; | ||
if (doingTreeData) { | ||
node.master = false; | ||
node.expanded = false; | ||
} | ||
else { | ||
// this is the default, for when doing grid data | ||
if (this.doesDataFlower) { | ||
node.master = this.doesDataFlower(dataItem); | ||
} | ||
else if (this.doingMasterDetail) { | ||
// if we are doing master detail, then the | ||
// default is that everything can flower. | ||
if (this.isRowMasterFunc) { | ||
node.master = this.isRowMasterFunc(dataItem); | ||
} | ||
else { | ||
node.master = true; | ||
} | ||
} | ||
else { | ||
node.master = false; | ||
} | ||
var rowGroupColumns = this.columnController.getRowGroupColumns(); | ||
var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0; | ||
// need to take row group into account when determining level | ||
var masterRowLevel = level + numRowGroupColumns; | ||
node.expanded = node.master ? this.isExpanded(masterRowLevel) : false; | ||
} | ||
this.setMasterForRow(node, dataItem, level, true); | ||
} | ||
// support for backwards compatibility, canFlow is now called 'master' | ||
/** @deprecated is now 'master' */ | ||
node.canFlower = node.master; | ||
@@ -283,2 +270,36 @@ if (parent && !this.suppressParentsInRowNodes) { | ||
}; | ||
ClientSideNodeManager.prototype.setMasterForRow = function (rowNode, data, level, setExpanded) { | ||
if (this.doingTreeData) { | ||
rowNode.setMaster(false); | ||
if (setExpanded) { | ||
rowNode.expanded = false; | ||
} | ||
} | ||
else { | ||
// this is the default, for when doing grid data | ||
if (this.doesDataFlower) { | ||
rowNode.setMaster(this.doesDataFlower(data)); | ||
} | ||
else if (this.doingMasterDetail) { | ||
// if we are doing master detail, then the | ||
// default is that everything can be a Master Row. | ||
if (this.isRowMasterFunc) { | ||
rowNode.setMaster(this.isRowMasterFunc(data)); | ||
} | ||
else { | ||
rowNode.setMaster(true); | ||
} | ||
} | ||
else { | ||
rowNode.setMaster(false); | ||
} | ||
if (setExpanded) { | ||
var rowGroupColumns = this.columnController.getRowGroupColumns(); | ||
var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0; | ||
// need to take row group into account when determining level | ||
var masterRowLevel = level + numRowGroupColumns; | ||
rowNode.expanded = rowNode.master ? this.isExpanded(masterRowLevel) : false; | ||
} | ||
} | ||
}; | ||
ClientSideNodeManager.prototype.isExpanded = function (level) { | ||
@@ -285,0 +306,0 @@ var expandByDefault = this.gridOptionsWrapper.getGroupDefaultExpanded(); |
@@ -1,2 +0,2 @@ | ||
import { ChangedPath, RefreshModelParams, RowBounds, RowDataTransaction, RowNode, RowNodeTransaction, IClientSideRowModel } from "@ag-grid-community/core"; | ||
import { ChangedPath, RefreshModelParams, RowBounds, RowDataTransaction, RowNode, RowNodeTransaction, IClientSideRowModel, BeanStub } from "@ag-grid-community/core"; | ||
export interface BatchTransactionItem { | ||
@@ -9,3 +9,3 @@ rowDataTransaction: RowDataTransaction; | ||
} | ||
export declare class ClientSideRowModel implements IClientSideRowModel { | ||
export declare class ClientSideRowModel extends BeanStub implements IClientSideRowModel { | ||
private gridOptionsWrapper; | ||
@@ -16,4 +16,2 @@ private columnController; | ||
private selectionController; | ||
private eventService; | ||
private context; | ||
private valueService; | ||
@@ -34,6 +32,3 @@ private valueCache; | ||
private lastHighlightedRow; | ||
private events; | ||
private refreshMapFunc; | ||
init(): void; | ||
destroy(): void; | ||
start(): void; | ||
@@ -40,0 +35,0 @@ ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -18,20 +31,19 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
})(RecursionType || (RecursionType = {})); | ||
var ClientSideRowModel = /** @class */ (function () { | ||
var ClientSideRowModel = /** @class */ (function (_super) { | ||
__extends(ClientSideRowModel, _super); | ||
function ClientSideRowModel() { | ||
this.events = []; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
ClientSideRowModel.prototype.init = function () { | ||
var refreshEverythingFunc = this.refreshModel.bind(this, { step: core_1.Constants.STEP_EVERYTHING }); | ||
var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { step: core_1.Constants.STEP_EVERYTHING, afterColumnsChanged: true }); | ||
this.events = [ | ||
this.eventService.addModalPriorityEventListener(core_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, refreshEverythingAfterColsChangedFunc), | ||
this.eventService.addModalPriorityEventListener(core_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc), | ||
this.eventService.addModalPriorityEventListener(core_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this)), | ||
this.eventService.addModalPriorityEventListener(core_1.Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: core_1.Constants.STEP_PIVOT })), | ||
this.eventService.addModalPriorityEventListener(core_1.Events.EVENT_ROW_GROUP_OPENED, this.onRowGroupOpened.bind(this)), | ||
this.eventService.addModalPriorityEventListener(core_1.Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this)), | ||
this.eventService.addModalPriorityEventListener(core_1.Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this)), | ||
this.eventService.addModalPriorityEventListener(core_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc) | ||
]; | ||
this.refreshMapFunc = this.refreshModel.bind(this, { | ||
var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { step: core_1.Constants.STEP_EVERYTHING, afterColumnsChanged: true, keepRenderedRows: true }); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, refreshEverythingAfterColsChangedFunc); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this)); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: core_1.Constants.STEP_PIVOT })); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_ROW_GROUP_OPENED, this.onRowGroupOpened.bind(this)); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this)); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this)); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc); | ||
var refreshMapListener = this.refreshModel.bind(this, { | ||
step: core_1.Constants.STEP_MAP, | ||
@@ -41,16 +53,8 @@ keepRenderedRows: true, | ||
}); | ||
this.gridOptionsWrapper.addEventListener(core_1.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, this.refreshMapFunc); | ||
this.gridOptionsWrapper.addEventListener(core_1.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, this.refreshMapFunc); | ||
this.addManagedListener(this.gridOptionsWrapper, core_1.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, refreshMapListener); | ||
this.addManagedListener(this.gridOptionsWrapper, core_1.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, refreshMapListener); | ||
this.rootNode = new core_1.RowNode(); | ||
this.nodeManager = new clientSideNodeManager_1.ClientSideNodeManager(this.rootNode, this.gridOptionsWrapper, this.context, this.eventService, this.columnController, this.gridApi, this.columnApi, this.selectionController); | ||
this.context.wireBean(this.rootNode); | ||
this.nodeManager = new clientSideNodeManager_1.ClientSideNodeManager(this.rootNode, this.gridOptionsWrapper, this.getContext(), this.eventService, this.columnController, this.gridApi, this.columnApi, this.selectionController); | ||
this.createBean(this.rootNode); | ||
}; | ||
ClientSideRowModel.prototype.destroy = function () { | ||
if (this.events.length) { | ||
this.events.forEach(function (func) { return func(); }); | ||
this.events = []; | ||
} | ||
this.gridOptionsWrapper.removeEventListener(core_1.GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, this.refreshMapFunc); | ||
this.gridOptionsWrapper.removeEventListener(core_1.GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, this.refreshMapFunc); | ||
}; | ||
ClientSideRowModel.prototype.start = function () { | ||
@@ -545,15 +549,5 @@ var rowData = this.gridOptionsWrapper.getRowData(); | ||
if (rowNodeTransactions) { | ||
var merged_1 = { | ||
add: [], | ||
remove: [], | ||
update: [] | ||
}; | ||
rowNodeTransactions.forEach(function (tran) { | ||
core_1._.pushAll(merged_1.add, tran.add); | ||
core_1._.pushAll(merged_1.remove, tran.remove); | ||
core_1._.pushAll(merged_1.update, tran.update); | ||
}); | ||
this.groupStage.execute({ | ||
rowNode: this.rootNode, | ||
rowNodeTransaction: merged_1, | ||
rowNodeTransactions: rowNodeTransactions, | ||
rowNodeOrder: rowNodeOrder, | ||
@@ -704,3 +698,10 @@ changedPath: changedPath | ||
ClientSideRowModel.prototype.resetRowHeights = function () { | ||
this.forEachNode(function (rowNode) { return rowNode.setRowHeight(null); }); | ||
this.forEachNode(function (rowNode) { | ||
rowNode.setRowHeight(null); | ||
// forEachNode doesn't go through detail rows, so need to check | ||
// for detail nodes explicitly. | ||
if (rowNode.detailNode) { | ||
rowNode.detailNode.setRowHeight(null); | ||
} | ||
}); | ||
this.onRowHeightChanged(); | ||
@@ -724,8 +725,2 @@ }; | ||
__decorate([ | ||
core_1.Autowired('eventService') | ||
], ClientSideRowModel.prototype, "eventService", void 0); | ||
__decorate([ | ||
core_1.Autowired('context') | ||
], ClientSideRowModel.prototype, "context", void 0); | ||
__decorate([ | ||
core_1.Autowired('valueService') | ||
@@ -763,5 +758,2 @@ ], ClientSideRowModel.prototype, "valueService", void 0); | ||
], ClientSideRowModel.prototype, "init", null); | ||
__decorate([ | ||
core_1.PreDestroy | ||
], ClientSideRowModel.prototype, "destroy", null); | ||
ClientSideRowModel = __decorate([ | ||
@@ -771,4 +763,4 @@ core_1.Bean('rowModel') | ||
return ClientSideRowModel; | ||
}()); | ||
}(core_1.BeanStub)); | ||
exports.ClientSideRowModel = ClientSideRowModel; | ||
//# sourceMappingURL=clientSideRowModel.js.map |
@@ -1,3 +0,3 @@ | ||
import { ChangedPath } from "@ag-grid-community/core"; | ||
export declare class FilterService { | ||
import { ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
export declare class FilterService extends BeanStub { | ||
private filterManager; | ||
@@ -4,0 +4,0 @@ private gridOptionsWrapper; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,4 +23,6 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var FilterService = /** @class */ (function () { | ||
var FilterService = /** @class */ (function (_super) { | ||
__extends(FilterService, _super); | ||
function FilterService() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -125,4 +140,4 @@ FilterService.prototype.postConstruct = function () { | ||
return FilterService; | ||
}()); | ||
}(core_1.BeanStub)); | ||
exports.FilterService = FilterService; | ||
//# sourceMappingURL=filterService.js.map |
@@ -1,3 +0,3 @@ | ||
import { IRowNodeStage, StageExecuteParams } from "@ag-grid-community/core"; | ||
export declare class FilterStage implements IRowNodeStage { | ||
import { IRowNodeStage, StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
export declare class FilterStage extends BeanStub implements IRowNodeStage { | ||
private gridOptionsWrapper; | ||
@@ -4,0 +4,0 @@ private selectableService; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,4 +23,6 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var FilterStage = /** @class */ (function () { | ||
var FilterStage = /** @class */ (function (_super) { | ||
__extends(FilterStage, _super); | ||
function FilterStage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -32,4 +47,4 @@ FilterStage.prototype.execute = function (params) { | ||
return FilterStage; | ||
}()); | ||
}(core_1.BeanStub)); | ||
exports.FilterStage = FilterStage; | ||
//# sourceMappingURL=filterStage.js.map |
@@ -1,7 +0,5 @@ | ||
import { IRowNodeStage, RowNode, StageExecuteParams } from "@ag-grid-community/core"; | ||
export declare class FlattenStage implements IRowNodeStage { | ||
import { BeanStub, IRowNodeStage, RowNode, StageExecuteParams } from "@ag-grid-community/core"; | ||
export declare class FlattenStage extends BeanStub implements IRowNodeStage { | ||
private gridOptionsWrapper; | ||
private selectionController; | ||
private eventService; | ||
private context; | ||
private columnController; | ||
@@ -8,0 +6,0 @@ execute(params: StageExecuteParams): RowNode[]; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,4 +23,6 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var FlattenStage = /** @class */ (function () { | ||
var FlattenStage = /** @class */ (function (_super) { | ||
__extends(FlattenStage, _super); | ||
function FlattenStage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -112,3 +127,3 @@ FlattenStage.prototype.execute = function (params) { | ||
var footerNode = new core_1.RowNode(); | ||
this.context.wireBean(footerNode); | ||
this.context.createBean(footerNode); | ||
Object.keys(groupNode).forEach(function (key) { | ||
@@ -134,3 +149,3 @@ footerNode[key] = groupNode[key]; | ||
var detailNode = new core_1.RowNode(); | ||
this.context.wireBean(detailNode); | ||
this.context.createBean(detailNode); | ||
detailNode.detail = true; | ||
@@ -157,8 +172,2 @@ detailNode.selectable = false; | ||
__decorate([ | ||
core_1.Autowired('eventService') | ||
], FlattenStage.prototype, "eventService", void 0); | ||
__decorate([ | ||
core_1.Autowired('context') | ||
], FlattenStage.prototype, "context", void 0); | ||
__decorate([ | ||
core_1.Autowired('columnController') | ||
@@ -170,4 +179,4 @@ ], FlattenStage.prototype, "columnController", void 0); | ||
return FlattenStage; | ||
}()); | ||
}(core_1.BeanStub)); | ||
exports.FlattenStage = FlattenStage; | ||
//# sourceMappingURL=flattenStage.js.map |
@@ -1,3 +0,3 @@ | ||
import { IImmutableService, RowDataTransaction } from "@ag-grid-community/core"; | ||
export declare class ImmutableService implements IImmutableService { | ||
import { IImmutableService, RowDataTransaction, BeanStub } from "@ag-grid-community/core"; | ||
export declare class ImmutableService extends BeanStub implements IImmutableService { | ||
private rowModel; | ||
@@ -4,0 +4,0 @@ private gridOptionsWrapper; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,4 +23,6 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var ImmutableService = /** @class */ (function () { | ||
var ImmutableService = /** @class */ (function (_super) { | ||
__extends(ImmutableService, _super); | ||
function ImmutableService() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -85,4 +100,4 @@ ImmutableService.prototype.postConstruct = function () { | ||
return ImmutableService; | ||
}()); | ||
}(core_1.BeanStub)); | ||
exports.ImmutableService = ImmutableService; | ||
//# sourceMappingURL=immutableService.js.map |
@@ -1,2 +0,2 @@ | ||
import { ChangedPath, Column, RowNode } from "@ag-grid-community/core"; | ||
import { ChangedPath, Column, RowNode, BeanStub } from "@ag-grid-community/core"; | ||
export interface SortOption { | ||
@@ -10,3 +10,3 @@ inverter: number; | ||
} | ||
export declare class SortService { | ||
export declare class SortService extends BeanStub { | ||
private sortController; | ||
@@ -13,0 +13,0 @@ private columnController; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,4 +23,6 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var SortService = /** @class */ (function () { | ||
var SortService = /** @class */ (function (_super) { | ||
__extends(SortService, _super); | ||
function SortService() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -237,4 +252,4 @@ SortService.prototype.init = function () { | ||
return SortService; | ||
}()); | ||
}(core_1.BeanStub)); | ||
exports.SortService = SortService; | ||
//# sourceMappingURL=sortService.js.map |
@@ -1,3 +0,3 @@ | ||
import { StageExecuteParams } from "@ag-grid-community/core"; | ||
export declare class SortStage { | ||
import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub { | ||
private gridOptionsWrapper; | ||
@@ -4,0 +4,0 @@ private sortService; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,4 +23,6 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var SortStage = /** @class */ (function () { | ||
var SortStage = /** @class */ (function (_super) { | ||
__extends(SortStage, _super); | ||
function SortStage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -61,4 +76,4 @@ SortStage.prototype.execute = function (params) { | ||
return SortStage; | ||
}()); | ||
}(core_1.BeanStub)); | ||
exports.SortStage = SortStage; | ||
//# sourceMappingURL=sortStage.js.map |
@@ -17,2 +17,3 @@ import { RowNode, GridOptionsWrapper, Context, EventService, ColumnController, GridApi, ColumnApi, SelectionController, RowDataTransaction, RowNodeTransaction } from "@ag-grid-community/core"; | ||
private doingLegacyTreeData; | ||
private doingTreeData; | ||
private doingMasterDetail; | ||
@@ -32,2 +33,3 @@ private allNodesMap; | ||
} | null | undefined): RowNodeTransaction | null; | ||
private updateSelection; | ||
private executeAdd; | ||
@@ -40,2 +42,3 @@ private executeRemove; | ||
private createNode; | ||
private setMasterForRow; | ||
private isExpanded; | ||
@@ -42,0 +45,0 @@ private setLeafChildren; |
@@ -32,3 +32,4 @@ import { RowNode, Events, _ } from "@ag-grid-community/core"; | ||
this.isRowMasterFunc = this.gridOptionsWrapper.getIsRowMasterFunc(); | ||
this.doingLegacyTreeData = _.exists(this.getNodeChildDetails); | ||
this.doingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
this.doingLegacyTreeData = !this.doingTreeData && _.exists(this.getNodeChildDetails); | ||
this.doingMasterDetail = this.gridOptionsWrapper.isMasterDetail(); | ||
@@ -80,5 +81,7 @@ if (this.getNodeChildDetails) { | ||
}; | ||
var nodesToUnselect = []; | ||
this.executeAdd(rowDataTran, rowNodeTransaction); | ||
this.executeRemove(rowDataTran, rowNodeTransaction); | ||
this.executeUpdate(rowDataTran, rowNodeTransaction); | ||
this.executeRemove(rowDataTran, rowNodeTransaction, nodesToUnselect); | ||
this.executeUpdate(rowDataTran, rowNodeTransaction, nodesToUnselect); | ||
this.updateSelection(nodesToUnselect); | ||
if (rowNodeOrder) { | ||
@@ -89,2 +92,23 @@ _.sortRowNodesByOrder(this.rootNode.allLeafChildren, rowNodeOrder); | ||
}; | ||
ClientSideNodeManager.prototype.updateSelection = function (nodesToUnselect) { | ||
var selectionChanged = nodesToUnselect.length > 0; | ||
if (selectionChanged) { | ||
nodesToUnselect.forEach(function (rowNode) { | ||
rowNode.setSelected(false, false, true); | ||
}); | ||
} | ||
// we do this regardless of nodes to unselect or not, as it's possible | ||
// a new node was inserted, so a parent that was previously selected (as all | ||
// children were selected) should not be tri-state (as new one unselected against | ||
// all other selected children). | ||
this.selectionController.updateGroupsFromChildrenSelections(); | ||
if (selectionChanged) { | ||
var event_1 = { | ||
type: Events.EVENT_SELECTION_CHANGED, | ||
api: this.gridApi, | ||
columnApi: this.columnApi | ||
}; | ||
this.eventService.dispatchEvent(event_1); | ||
} | ||
}; | ||
ClientSideNodeManager.prototype.executeAdd = function (rowDataTran, rowNodeTransaction) { | ||
@@ -111,3 +135,3 @@ var _this = this; | ||
}; | ||
ClientSideNodeManager.prototype.executeRemove = function (rowDataTran, rowNodeTransaction) { | ||
ClientSideNodeManager.prototype.executeRemove = function (rowDataTran, rowNodeTransaction, nodesToUnselect) { | ||
var _this = this; | ||
@@ -119,3 +143,2 @@ var remove = rowDataTran.remove; | ||
var rowIdsRemoved = {}; | ||
var anyNodesSelected = false; | ||
remove.forEach(function (item) { | ||
@@ -126,8 +149,7 @@ var rowNode = _this.lookupRowNode(item); | ||
} | ||
// do delete - setting 'suppressFinishActions = true' to ensure EVENT_SELECTION_CHANGED is not raised for | ||
// each row node updated, instead it is raised once by the calling code if any selected nodes exist. | ||
if (rowNode.isSelected()) { | ||
anyNodesSelected = true; | ||
nodesToUnselect.push(rowNode); | ||
} | ||
// do delete - setting 'tailingNodeInSequence = true' to ensure EVENT_SELECTION_CHANGED is not raised for | ||
// each row node updated, instead it is raised once by the calling code if any selected nodes exist. | ||
rowNode.setSelected(false, false, true); | ||
// so row renderer knows to fade row out (and not reposition it) | ||
@@ -143,13 +165,4 @@ rowNode.clearRowTop(); | ||
this.rootNode.allLeafChildren = this.rootNode.allLeafChildren.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; }); | ||
if (anyNodesSelected) { | ||
this.selectionController.updateGroupsFromChildrenSelections(); | ||
var event_1 = { | ||
type: Events.EVENT_SELECTION_CHANGED, | ||
api: this.gridApi, | ||
columnApi: this.columnApi | ||
}; | ||
this.eventService.dispatchEvent(event_1); | ||
} | ||
}; | ||
ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction) { | ||
ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) { | ||
var _this = this; | ||
@@ -166,2 +179,6 @@ var update = rowDataTran.update; | ||
rowNode.updateData(item); | ||
if (!rowNode.selectable && rowNode.isSelected()) { | ||
nodesToUnselect.push(rowNode); | ||
} | ||
_this.setMasterForRow(rowNode, item, ClientSideNodeManager.TOP_LEVEL, false); | ||
rowNodeTransaction.update.push(rowNode); | ||
@@ -218,6 +235,4 @@ }); | ||
var node = new RowNode(); | ||
this.context.wireBean(node); | ||
var doingTreeData = this.gridOptionsWrapper.isTreeData(); | ||
var doingLegacyTreeData = !doingTreeData && _.exists(this.getNodeChildDetails); | ||
var nodeChildDetails = doingLegacyTreeData ? this.getNodeChildDetails(dataItem) : null; | ||
this.context.createBean(node); | ||
var nodeChildDetails = this.doingLegacyTreeData ? this.getNodeChildDetails(dataItem) : null; | ||
if (nodeChildDetails && nodeChildDetails.group) { | ||
@@ -229,4 +244,2 @@ node.group = true; | ||
node.key = nodeChildDetails.key; | ||
/** @deprecated is now 'master' */ | ||
node.canFlower = node.master; | ||
// pull out all the leaf children and add to our node | ||
@@ -237,32 +250,6 @@ this.setLeafChildren(node); | ||
node.group = false; | ||
if (doingTreeData) { | ||
node.master = false; | ||
node.expanded = false; | ||
} | ||
else { | ||
// this is the default, for when doing grid data | ||
if (this.doesDataFlower) { | ||
node.master = this.doesDataFlower(dataItem); | ||
} | ||
else if (this.doingMasterDetail) { | ||
// if we are doing master detail, then the | ||
// default is that everything can flower. | ||
if (this.isRowMasterFunc) { | ||
node.master = this.isRowMasterFunc(dataItem); | ||
} | ||
else { | ||
node.master = true; | ||
} | ||
} | ||
else { | ||
node.master = false; | ||
} | ||
var rowGroupColumns = this.columnController.getRowGroupColumns(); | ||
var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0; | ||
// need to take row group into account when determining level | ||
var masterRowLevel = level + numRowGroupColumns; | ||
node.expanded = node.master ? this.isExpanded(masterRowLevel) : false; | ||
} | ||
this.setMasterForRow(node, dataItem, level, true); | ||
} | ||
// support for backwards compatibility, canFlow is now called 'master' | ||
/** @deprecated is now 'master' */ | ||
node.canFlower = node.master; | ||
@@ -281,2 +268,36 @@ if (parent && !this.suppressParentsInRowNodes) { | ||
}; | ||
ClientSideNodeManager.prototype.setMasterForRow = function (rowNode, data, level, setExpanded) { | ||
if (this.doingTreeData) { | ||
rowNode.setMaster(false); | ||
if (setExpanded) { | ||
rowNode.expanded = false; | ||
} | ||
} | ||
else { | ||
// this is the default, for when doing grid data | ||
if (this.doesDataFlower) { | ||
rowNode.setMaster(this.doesDataFlower(data)); | ||
} | ||
else if (this.doingMasterDetail) { | ||
// if we are doing master detail, then the | ||
// default is that everything can be a Master Row. | ||
if (this.isRowMasterFunc) { | ||
rowNode.setMaster(this.isRowMasterFunc(data)); | ||
} | ||
else { | ||
rowNode.setMaster(true); | ||
} | ||
} | ||
else { | ||
rowNode.setMaster(false); | ||
} | ||
if (setExpanded) { | ||
var rowGroupColumns = this.columnController.getRowGroupColumns(); | ||
var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0; | ||
// need to take row group into account when determining level | ||
var masterRowLevel = level + numRowGroupColumns; | ||
rowNode.expanded = rowNode.master ? this.isExpanded(masterRowLevel) : false; | ||
} | ||
} | ||
}; | ||
ClientSideNodeManager.prototype.isExpanded = function (level) { | ||
@@ -283,0 +304,0 @@ var expandByDefault = this.gridOptionsWrapper.getGroupDefaultExpanded(); |
@@ -1,2 +0,2 @@ | ||
import { ChangedPath, RefreshModelParams, RowBounds, RowDataTransaction, RowNode, RowNodeTransaction, IClientSideRowModel } from "@ag-grid-community/core"; | ||
import { ChangedPath, RefreshModelParams, RowBounds, RowDataTransaction, RowNode, RowNodeTransaction, IClientSideRowModel, BeanStub } from "@ag-grid-community/core"; | ||
export interface BatchTransactionItem { | ||
@@ -9,3 +9,3 @@ rowDataTransaction: RowDataTransaction; | ||
} | ||
export declare class ClientSideRowModel implements IClientSideRowModel { | ||
export declare class ClientSideRowModel extends BeanStub implements IClientSideRowModel { | ||
private gridOptionsWrapper; | ||
@@ -16,4 +16,2 @@ private columnController; | ||
private selectionController; | ||
private eventService; | ||
private context; | ||
private valueService; | ||
@@ -34,6 +32,3 @@ private valueCache; | ||
private lastHighlightedRow; | ||
private events; | ||
private refreshMapFunc; | ||
init(): void; | ||
destroy(): void; | ||
start(): void; | ||
@@ -40,0 +35,0 @@ ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean; |
@@ -0,1 +1,14 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,3 +20,3 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { _, Autowired, Bean, ChangedPath, Constants as constants, Constants, Events, GridOptionsWrapper, Optional, PostConstruct, RowNode, PreDestroy } from "@ag-grid-community/core"; | ||
import { Autowired, Bean, ChangedPath, Constants as constants, Constants, Events, GridOptionsWrapper, Optional, PostConstruct, RowNode, BeanStub, _ } from "@ag-grid-community/core"; | ||
import { ClientSideNodeManager } from "./clientSideNodeManager"; | ||
@@ -17,20 +30,19 @@ var RecursionType; | ||
})(RecursionType || (RecursionType = {})); | ||
var ClientSideRowModel = /** @class */ (function () { | ||
var ClientSideRowModel = /** @class */ (function (_super) { | ||
__extends(ClientSideRowModel, _super); | ||
function ClientSideRowModel() { | ||
this.events = []; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
ClientSideRowModel.prototype.init = function () { | ||
var refreshEverythingFunc = this.refreshModel.bind(this, { step: Constants.STEP_EVERYTHING }); | ||
var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { step: Constants.STEP_EVERYTHING, afterColumnsChanged: true }); | ||
this.events = [ | ||
this.eventService.addModalPriorityEventListener(Events.EVENT_COLUMN_EVERYTHING_CHANGED, refreshEverythingAfterColsChangedFunc), | ||
this.eventService.addModalPriorityEventListener(Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc), | ||
this.eventService.addModalPriorityEventListener(Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this)), | ||
this.eventService.addModalPriorityEventListener(Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: Constants.STEP_PIVOT })), | ||
this.eventService.addModalPriorityEventListener(Events.EVENT_ROW_GROUP_OPENED, this.onRowGroupOpened.bind(this)), | ||
this.eventService.addModalPriorityEventListener(Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this)), | ||
this.eventService.addModalPriorityEventListener(Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this)), | ||
this.eventService.addModalPriorityEventListener(Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc) | ||
]; | ||
this.refreshMapFunc = this.refreshModel.bind(this, { | ||
var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { step: Constants.STEP_EVERYTHING, afterColumnsChanged: true, keepRenderedRows: true }); | ||
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_EVERYTHING_CHANGED, refreshEverythingAfterColsChangedFunc); | ||
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc); | ||
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this)); | ||
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: Constants.STEP_PIVOT })); | ||
this.addManagedListener(this.eventService, Events.EVENT_ROW_GROUP_OPENED, this.onRowGroupOpened.bind(this)); | ||
this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this)); | ||
this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this)); | ||
this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc); | ||
var refreshMapListener = this.refreshModel.bind(this, { | ||
step: Constants.STEP_MAP, | ||
@@ -40,16 +52,8 @@ keepRenderedRows: true, | ||
}); | ||
this.gridOptionsWrapper.addEventListener(GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, this.refreshMapFunc); | ||
this.gridOptionsWrapper.addEventListener(GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, this.refreshMapFunc); | ||
this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, refreshMapListener); | ||
this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, refreshMapListener); | ||
this.rootNode = new RowNode(); | ||
this.nodeManager = new ClientSideNodeManager(this.rootNode, this.gridOptionsWrapper, this.context, this.eventService, this.columnController, this.gridApi, this.columnApi, this.selectionController); | ||
this.context.wireBean(this.rootNode); | ||
this.nodeManager = new ClientSideNodeManager(this.rootNode, this.gridOptionsWrapper, this.getContext(), this.eventService, this.columnController, this.gridApi, this.columnApi, this.selectionController); | ||
this.createBean(this.rootNode); | ||
}; | ||
ClientSideRowModel.prototype.destroy = function () { | ||
if (this.events.length) { | ||
this.events.forEach(function (func) { return func(); }); | ||
this.events = []; | ||
} | ||
this.gridOptionsWrapper.removeEventListener(GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, this.refreshMapFunc); | ||
this.gridOptionsWrapper.removeEventListener(GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, this.refreshMapFunc); | ||
}; | ||
ClientSideRowModel.prototype.start = function () { | ||
@@ -544,15 +548,5 @@ var rowData = this.gridOptionsWrapper.getRowData(); | ||
if (rowNodeTransactions) { | ||
var merged_1 = { | ||
add: [], | ||
remove: [], | ||
update: [] | ||
}; | ||
rowNodeTransactions.forEach(function (tran) { | ||
_.pushAll(merged_1.add, tran.add); | ||
_.pushAll(merged_1.remove, tran.remove); | ||
_.pushAll(merged_1.update, tran.update); | ||
}); | ||
this.groupStage.execute({ | ||
rowNode: this.rootNode, | ||
rowNodeTransaction: merged_1, | ||
rowNodeTransactions: rowNodeTransactions, | ||
rowNodeOrder: rowNodeOrder, | ||
@@ -703,3 +697,10 @@ changedPath: changedPath | ||
ClientSideRowModel.prototype.resetRowHeights = function () { | ||
this.forEachNode(function (rowNode) { return rowNode.setRowHeight(null); }); | ||
this.forEachNode(function (rowNode) { | ||
rowNode.setRowHeight(null); | ||
// forEachNode doesn't go through detail rows, so need to check | ||
// for detail nodes explicitly. | ||
if (rowNode.detailNode) { | ||
rowNode.detailNode.setRowHeight(null); | ||
} | ||
}); | ||
this.onRowHeightChanged(); | ||
@@ -723,8 +724,2 @@ }; | ||
__decorate([ | ||
Autowired('eventService') | ||
], ClientSideRowModel.prototype, "eventService", void 0); | ||
__decorate([ | ||
Autowired('context') | ||
], ClientSideRowModel.prototype, "context", void 0); | ||
__decorate([ | ||
Autowired('valueService') | ||
@@ -762,5 +757,2 @@ ], ClientSideRowModel.prototype, "valueService", void 0); | ||
], ClientSideRowModel.prototype, "init", null); | ||
__decorate([ | ||
PreDestroy | ||
], ClientSideRowModel.prototype, "destroy", null); | ||
ClientSideRowModel = __decorate([ | ||
@@ -770,3 +762,3 @@ Bean('rowModel') | ||
return ClientSideRowModel; | ||
}()); | ||
}(BeanStub)); | ||
export { ClientSideRowModel }; |
@@ -1,3 +0,3 @@ | ||
import { ChangedPath } from "@ag-grid-community/core"; | ||
export declare class FilterService { | ||
import { ChangedPath, BeanStub } from "@ag-grid-community/core"; | ||
export declare class FilterService extends BeanStub { | ||
private filterManager; | ||
@@ -4,0 +4,0 @@ private gridOptionsWrapper; |
@@ -0,1 +1,14 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,5 +20,7 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { Autowired, Bean, PostConstruct } from "@ag-grid-community/core"; | ||
var FilterService = /** @class */ (function () { | ||
import { Autowired, Bean, PostConstruct, BeanStub } from "@ag-grid-community/core"; | ||
var FilterService = /** @class */ (function (_super) { | ||
__extends(FilterService, _super); | ||
function FilterService() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -123,3 +138,3 @@ FilterService.prototype.postConstruct = function () { | ||
return FilterService; | ||
}()); | ||
}(BeanStub)); | ||
export { FilterService }; |
@@ -1,3 +0,3 @@ | ||
import { IRowNodeStage, StageExecuteParams } from "@ag-grid-community/core"; | ||
export declare class FilterStage implements IRowNodeStage { | ||
import { IRowNodeStage, StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
export declare class FilterStage extends BeanStub implements IRowNodeStage { | ||
private gridOptionsWrapper; | ||
@@ -4,0 +4,0 @@ private selectableService; |
@@ -0,1 +1,14 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,5 +20,7 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { Autowired, Bean } from "@ag-grid-community/core"; | ||
var FilterStage = /** @class */ (function () { | ||
import { Autowired, Bean, BeanStub } from "@ag-grid-community/core"; | ||
var FilterStage = /** @class */ (function (_super) { | ||
__extends(FilterStage, _super); | ||
function FilterStage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -30,3 +45,3 @@ FilterStage.prototype.execute = function (params) { | ||
return FilterStage; | ||
}()); | ||
}(BeanStub)); | ||
export { FilterStage }; |
@@ -1,7 +0,5 @@ | ||
import { IRowNodeStage, RowNode, StageExecuteParams } from "@ag-grid-community/core"; | ||
export declare class FlattenStage implements IRowNodeStage { | ||
import { BeanStub, IRowNodeStage, RowNode, StageExecuteParams } from "@ag-grid-community/core"; | ||
export declare class FlattenStage extends BeanStub implements IRowNodeStage { | ||
private gridOptionsWrapper; | ||
private selectionController; | ||
private eventService; | ||
private context; | ||
private columnController; | ||
@@ -8,0 +6,0 @@ execute(params: StageExecuteParams): RowNode[]; |
@@ -0,1 +1,14 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,5 +20,7 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { _, Autowired, Bean, RowNode } from "@ag-grid-community/core"; | ||
var FlattenStage = /** @class */ (function () { | ||
import { _, Autowired, Bean, BeanStub, RowNode } from "@ag-grid-community/core"; | ||
var FlattenStage = /** @class */ (function (_super) { | ||
__extends(FlattenStage, _super); | ||
function FlattenStage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -110,3 +125,3 @@ FlattenStage.prototype.execute = function (params) { | ||
var footerNode = new RowNode(); | ||
this.context.wireBean(footerNode); | ||
this.context.createBean(footerNode); | ||
Object.keys(groupNode).forEach(function (key) { | ||
@@ -132,3 +147,3 @@ footerNode[key] = groupNode[key]; | ||
var detailNode = new RowNode(); | ||
this.context.wireBean(detailNode); | ||
this.context.createBean(detailNode); | ||
detailNode.detail = true; | ||
@@ -155,8 +170,2 @@ detailNode.selectable = false; | ||
__decorate([ | ||
Autowired('eventService') | ||
], FlattenStage.prototype, "eventService", void 0); | ||
__decorate([ | ||
Autowired('context') | ||
], FlattenStage.prototype, "context", void 0); | ||
__decorate([ | ||
Autowired('columnController') | ||
@@ -168,3 +177,3 @@ ], FlattenStage.prototype, "columnController", void 0); | ||
return FlattenStage; | ||
}()); | ||
}(BeanStub)); | ||
export { FlattenStage }; |
@@ -1,3 +0,3 @@ | ||
import { IImmutableService, RowDataTransaction } from "@ag-grid-community/core"; | ||
export declare class ImmutableService implements IImmutableService { | ||
import { IImmutableService, RowDataTransaction, BeanStub } from "@ag-grid-community/core"; | ||
export declare class ImmutableService extends BeanStub implements IImmutableService { | ||
private rowModel; | ||
@@ -4,0 +4,0 @@ private gridOptionsWrapper; |
@@ -0,1 +1,14 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,5 +20,7 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { _, Autowired, Bean, Constants, PostConstruct } from "@ag-grid-community/core"; | ||
var ImmutableService = /** @class */ (function () { | ||
import { _, Autowired, Bean, Constants, PostConstruct, BeanStub } from "@ag-grid-community/core"; | ||
var ImmutableService = /** @class */ (function (_super) { | ||
__extends(ImmutableService, _super); | ||
function ImmutableService() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -83,3 +98,3 @@ ImmutableService.prototype.postConstruct = function () { | ||
return ImmutableService; | ||
}()); | ||
}(BeanStub)); | ||
export { ImmutableService }; |
@@ -1,2 +0,2 @@ | ||
import { ChangedPath, Column, RowNode } from "@ag-grid-community/core"; | ||
import { ChangedPath, Column, RowNode, BeanStub } from "@ag-grid-community/core"; | ||
export interface SortOption { | ||
@@ -10,3 +10,3 @@ inverter: number; | ||
} | ||
export declare class SortService { | ||
export declare class SortService extends BeanStub { | ||
private sortController; | ||
@@ -13,0 +13,0 @@ private columnController; |
@@ -0,1 +1,14 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,5 +20,7 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { _, Autowired, Bean, PostConstruct } from "@ag-grid-community/core"; | ||
var SortService = /** @class */ (function () { | ||
import { _, Autowired, Bean, PostConstruct, BeanStub } from "@ag-grid-community/core"; | ||
var SortService = /** @class */ (function (_super) { | ||
__extends(SortService, _super); | ||
function SortService() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -235,3 +250,3 @@ SortService.prototype.init = function () { | ||
return SortService; | ||
}()); | ||
}(BeanStub)); | ||
export { SortService }; |
@@ -1,3 +0,3 @@ | ||
import { StageExecuteParams } from "@ag-grid-community/core"; | ||
export declare class SortStage { | ||
import { StageExecuteParams, BeanStub } from "@ag-grid-community/core"; | ||
export declare class SortStage extends BeanStub { | ||
private gridOptionsWrapper; | ||
@@ -4,0 +4,0 @@ private sortService; |
@@ -0,1 +1,14 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -7,5 +20,7 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
import { _, Autowired, Bean } from "@ag-grid-community/core"; | ||
var SortStage = /** @class */ (function () { | ||
import { _, Autowired, Bean, BeanStub } from "@ag-grid-community/core"; | ||
var SortStage = /** @class */ (function (_super) { | ||
__extends(SortStage, _super); | ||
function SortStage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -59,3 +74,3 @@ SortStage.prototype.execute = function (params) { | ||
return SortStage; | ||
}()); | ||
}(BeanStub)); | ||
export { SortStage }; |
{ | ||
"name": "@ag-grid-community/client-side-row-model", | ||
"version": "23.1.1", | ||
"version": "23.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": "~23.1.0" | ||
"@ag-grid-community/core": "~23.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 not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
5959402
92808
+ Added@ag-grid-community/core@23.2.1(transitive)
- Removed@ag-grid-community/core@23.1.1(transitive)