@ag-grid-enterprise/viewport-row-model
Advanced tools
Comparing version 23.0.2 to 23.1.0
@@ -16,2 +16,3 @@ import { IRowModel, RowNode, IViewportDatasource, RowBounds } from "@ag-grid-community/core"; | ||
private viewportDatasource; | ||
private events; | ||
ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean; | ||
@@ -18,0 +19,0 @@ private init; |
@@ -18,2 +18,3 @@ "use strict"; | ||
this.rowNodesByIndex = {}; | ||
this.events = []; | ||
} | ||
@@ -24,3 +25,5 @@ // we don't implement as lazy row heights is not supported in this row model | ||
this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber(); | ||
this.eventService.addEventListener(core_1.Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)); | ||
this.events = [ | ||
this.eventService.addEventListener(core_1.Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)) | ||
]; | ||
}; | ||
@@ -36,10 +39,15 @@ ViewportRowModel.prototype.start = function () { | ||
ViewportRowModel.prototype.destroyDatasource = function () { | ||
if (this.viewportDatasource) { | ||
if (this.viewportDatasource.destroy) { | ||
this.viewportDatasource.destroy(); | ||
} | ||
this.rowRenderer.datasourceChanged(); | ||
this.firstRow = -1; | ||
this.lastRow = -1; | ||
if (!this.viewportDatasource) { | ||
return; | ||
} | ||
if (this.viewportDatasource.destroy) { | ||
this.viewportDatasource.destroy(); | ||
} | ||
this.rowRenderer.datasourceChanged(); | ||
this.firstRow = -1; | ||
this.lastRow = -1; | ||
if (this.events.length) { | ||
this.events.forEach(function (func) { return func(); }); | ||
this.events = []; | ||
} | ||
}; | ||
@@ -53,5 +61,3 @@ ViewportRowModel.prototype.calculateFirstRow = function (firstRenderedRow) { | ||
} | ||
else { | ||
return Math.floor(afterBuffer / pageSize) * pageSize; | ||
} | ||
return Math.floor(afterBuffer / pageSize) * pageSize; | ||
}; | ||
@@ -130,5 +136,3 @@ ViewportRowModel.prototype.calculateLastRow = function (lastRenderedRow) { | ||
} | ||
else { | ||
return 0; | ||
} | ||
return 0; | ||
}; | ||
@@ -214,15 +218,16 @@ ViewportRowModel.prototype.getRowBounds = function (index) { | ||
if (keepRenderedRows === void 0) { keepRenderedRows = false; } | ||
if (rowCount !== this.rowCount) { | ||
this.rowCount = rowCount; | ||
var event_1 = { | ||
type: core_1.Events.EVENT_MODEL_UPDATED, | ||
api: this.gridApi, | ||
columnApi: this.columnApi, | ||
newData: false, | ||
newPage: false, | ||
keepRenderedRows: keepRenderedRows, | ||
animate: false | ||
}; | ||
this.eventService.dispatchEvent(event_1); | ||
if (rowCount === this.rowCount) { | ||
return; | ||
} | ||
this.rowCount = rowCount; | ||
var event = { | ||
type: core_1.Events.EVENT_MODEL_UPDATED, | ||
api: this.gridApi, | ||
columnApi: this.columnApi, | ||
newData: false, | ||
newPage: false, | ||
keepRenderedRows: keepRenderedRows, | ||
animate: false | ||
}; | ||
this.eventService.dispatchEvent(event); | ||
}; | ||
@@ -229,0 +234,0 @@ ViewportRowModel.prototype.isRowPresent = function (rowNode) { |
@@ -16,2 +16,3 @@ import { IRowModel, RowNode, IViewportDatasource, RowBounds } from "@ag-grid-community/core"; | ||
private viewportDatasource; | ||
private events; | ||
ensureRowHeightsValid(startPixel: number, endPixel: number, startLimitIndex: number, endLimitIndex: number): boolean; | ||
@@ -18,0 +19,0 @@ private init; |
@@ -16,2 +16,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.rowNodesByIndex = {}; | ||
this.events = []; | ||
} | ||
@@ -22,3 +23,5 @@ // we don't implement as lazy row heights is not supported in this row model | ||
this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber(); | ||
this.eventService.addEventListener(Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)); | ||
this.events = [ | ||
this.eventService.addEventListener(Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)) | ||
]; | ||
}; | ||
@@ -34,10 +37,15 @@ ViewportRowModel.prototype.start = function () { | ||
ViewportRowModel.prototype.destroyDatasource = function () { | ||
if (this.viewportDatasource) { | ||
if (this.viewportDatasource.destroy) { | ||
this.viewportDatasource.destroy(); | ||
} | ||
this.rowRenderer.datasourceChanged(); | ||
this.firstRow = -1; | ||
this.lastRow = -1; | ||
if (!this.viewportDatasource) { | ||
return; | ||
} | ||
if (this.viewportDatasource.destroy) { | ||
this.viewportDatasource.destroy(); | ||
} | ||
this.rowRenderer.datasourceChanged(); | ||
this.firstRow = -1; | ||
this.lastRow = -1; | ||
if (this.events.length) { | ||
this.events.forEach(function (func) { return func(); }); | ||
this.events = []; | ||
} | ||
}; | ||
@@ -51,5 +59,3 @@ ViewportRowModel.prototype.calculateFirstRow = function (firstRenderedRow) { | ||
} | ||
else { | ||
return Math.floor(afterBuffer / pageSize) * pageSize; | ||
} | ||
return Math.floor(afterBuffer / pageSize) * pageSize; | ||
}; | ||
@@ -128,5 +134,3 @@ ViewportRowModel.prototype.calculateLastRow = function (lastRenderedRow) { | ||
} | ||
else { | ||
return 0; | ||
} | ||
return 0; | ||
}; | ||
@@ -212,15 +216,16 @@ ViewportRowModel.prototype.getRowBounds = function (index) { | ||
if (keepRenderedRows === void 0) { keepRenderedRows = false; } | ||
if (rowCount !== this.rowCount) { | ||
this.rowCount = rowCount; | ||
var event_1 = { | ||
type: Events.EVENT_MODEL_UPDATED, | ||
api: this.gridApi, | ||
columnApi: this.columnApi, | ||
newData: false, | ||
newPage: false, | ||
keepRenderedRows: keepRenderedRows, | ||
animate: false | ||
}; | ||
this.eventService.dispatchEvent(event_1); | ||
if (rowCount === this.rowCount) { | ||
return; | ||
} | ||
this.rowCount = rowCount; | ||
var event = { | ||
type: Events.EVENT_MODEL_UPDATED, | ||
api: this.gridApi, | ||
columnApi: this.columnApi, | ||
newData: false, | ||
newPage: false, | ||
keepRenderedRows: keepRenderedRows, | ||
animate: false | ||
}; | ||
this.eventService.dispatchEvent(event); | ||
}; | ||
@@ -227,0 +232,0 @@ ViewportRowModel.prototype.isRowPresent = function (rowNode) { |
{ | ||
"name": "@ag-grid-enterprise/viewport-row-model", | ||
"version": "23.0.2", | ||
"version": "23.1.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -12,3 +12,4 @@ "main": "./dist/cjs/main.js", | ||
"package": "node ../../module-build/rollup/build.js", | ||
"build": "npm run build-cjs && npm run build-es6" | ||
"build": "npm run build-cjs && npm run build-es6 && npm run hash", | ||
"hash": "sh ../../scripts/hashDirectory.sh > .hash" | ||
}, | ||
@@ -45,7 +46,7 @@ "repository": { | ||
"dependencies": { | ||
"@ag-grid-community/core": "~23.0.0", | ||
"@ag-grid-enterprise/core": "~23.0.0" | ||
"@ag-grid-community/core": "~23.1.0", | ||
"@ag-grid-enterprise/core": "~23.1.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^3.6.3" | ||
"typescript": "~3.6.5" | ||
}, | ||
@@ -52,0 +53,0 @@ "publishConfig": { |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5228517
25
83192
+ Added@ag-grid-community/core@23.1.1(transitive)
+ Added@ag-grid-enterprise/core@23.1.1(transitive)
- Removed@ag-grid-community/core@23.0.2(transitive)
- Removed@ag-grid-enterprise/core@23.0.2(transitive)