@ag-grid-enterprise/viewport-row-model
Advanced tools
Comparing version 28.2.1 to 29.0.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ViewportRowModelModule = void 0; | ||
var viewportRowModelModule_1 = require("./viewportRowModelModule"); | ||
exports.ViewportRowModelModule = viewportRowModelModule_1.ViewportRowModelModule; | ||
Object.defineProperty(exports, "ViewportRowModelModule", { enumerable: true, get: function () { return viewportRowModelModule_1.ViewportRowModelModule; } }); |
@@ -1,2 +0,2 @@ | ||
import { BeanStub, IRowModel, IViewportDatasource, RowBounds, RowNode } from "@ag-grid-community/core"; | ||
import { BeanStub, IRowModel, IViewportDatasource, RowBounds, RowNode, RowModelType } from "@ag-grid-community/core"; | ||
export declare class ViewportRowModel extends BeanStub implements IRowModel { | ||
@@ -17,2 +17,4 @@ private rowRenderer; | ||
private destroyDatasource; | ||
private getViewportRowModelPageSize; | ||
private getViewportRowModelBufferSize; | ||
private calculateFirstRow; | ||
@@ -24,3 +26,3 @@ private calculateLastRow; | ||
setViewportDatasource(viewportDatasource: IViewportDatasource): void; | ||
getType(): string; | ||
getType(): RowModelType; | ||
getRow(rowIndex: number): RowNode; | ||
@@ -27,0 +29,0 @@ getRowNode(id: string): RowNode | undefined; |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __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]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -23,3 +23,6 @@ }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ViewportRowModel = void 0; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5; | ||
var DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5; | ||
var ViewportRowModel = /** @class */ (function (_super) { | ||
@@ -40,8 +43,8 @@ __extends(ViewportRowModel, _super); | ||
ViewportRowModel.prototype.init = function () { | ||
this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber(); | ||
this.rowHeight = this.gridOptionsService.getRowHeightAsNumber(); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)); | ||
}; | ||
ViewportRowModel.prototype.start = function () { | ||
if (this.gridOptionsWrapper.getViewportDatasource()) { | ||
this.setViewportDatasource(this.gridOptionsWrapper.getViewportDatasource()); | ||
if (this.gridOptionsService.get('viewportDatasource')) { | ||
this.setViewportDatasource(this.gridOptionsService.get('viewportDatasource')); | ||
} | ||
@@ -63,5 +66,11 @@ }; | ||
}; | ||
ViewportRowModel.prototype.getViewportRowModelPageSize = function () { | ||
return core_1._.oneOrGreater(this.gridOptionsService.getNum('viewportRowModelPageSize'), DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE); | ||
}; | ||
ViewportRowModel.prototype.getViewportRowModelBufferSize = function () { | ||
return core_1._.zeroOrGreater(this.gridOptionsService.getNum('viewportRowModelBufferSize'), DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE); | ||
}; | ||
ViewportRowModel.prototype.calculateFirstRow = function (firstRenderedRow) { | ||
var bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
var pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
var bufferSize = this.getViewportRowModelBufferSize(); | ||
var pageSize = this.getViewportRowModelPageSize(); | ||
var afterBuffer = firstRenderedRow - bufferSize; | ||
@@ -77,4 +86,4 @@ if (afterBuffer < 0) { | ||
} | ||
var bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
var pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
var bufferSize = this.getViewportRowModelBufferSize(); | ||
var pageSize = this.getViewportRowModelPageSize(); | ||
var afterBuffer = lastRenderedRow + bufferSize; | ||
@@ -136,3 +145,3 @@ var result = Math.ceil(afterBuffer / pageSize) * pageSize; | ||
ViewportRowModel.prototype.getType = function () { | ||
return core_1.Constants.ROW_MODEL_TYPE_VIEWPORT; | ||
return 'viewport'; | ||
}; | ||
@@ -139,0 +148,0 @@ ViewportRowModel.prototype.getRow = function (rowIndex) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ViewportRowModelModule = void 0; | ||
var core_1 = require("@ag-grid-community/core"); | ||
var core_2 = require("@ag-grid-enterprise/core"); | ||
var version_1 = require("./version"); | ||
var viewportRowModel_1 = require("./viewportRowModel/viewportRowModel"); | ||
exports.ViewportRowModelModule = { | ||
version: version_1.VERSION, | ||
moduleName: core_1.ModuleNames.ViewportRowModelModule, | ||
@@ -8,0 +11,0 @@ rowModels: { viewport: viewportRowModel_1.ViewportRowModel }, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ViewportRowModelModule = void 0; | ||
var viewportRowModelModule_1 = require("./viewportRowModelModule"); | ||
exports.ViewportRowModelModule = viewportRowModelModule_1.ViewportRowModelModule; | ||
Object.defineProperty(exports, "ViewportRowModelModule", { enumerable: true, get: function () { return viewportRowModelModule_1.ViewportRowModelModule; } }); |
@@ -1,2 +0,2 @@ | ||
import { BeanStub, IRowModel, IViewportDatasource, RowBounds, RowNode } from "@ag-grid-community/core"; | ||
import { BeanStub, IRowModel, IViewportDatasource, RowBounds, RowNode, RowModelType } from "@ag-grid-community/core"; | ||
export declare class ViewportRowModel extends BeanStub implements IRowModel { | ||
@@ -17,2 +17,4 @@ private rowRenderer; | ||
private destroyDatasource; | ||
private getViewportRowModelPageSize; | ||
private getViewportRowModelBufferSize; | ||
private calculateFirstRow; | ||
@@ -24,3 +26,3 @@ private calculateLastRow; | ||
setViewportDatasource(viewportDatasource: IViewportDatasource): void; | ||
getType(): string; | ||
getType(): RowModelType; | ||
getRow(rowIndex: number): RowNode; | ||
@@ -27,0 +29,0 @@ getRowNode(id: string): RowNode | undefined; |
@@ -9,3 +9,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ViewportRowModel = void 0; | ||
const core_1 = require("@ag-grid-community/core"); | ||
const DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5; | ||
const DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5; | ||
let ViewportRowModel = class ViewportRowModel extends core_1.BeanStub { | ||
@@ -24,8 +27,8 @@ constructor() { | ||
init() { | ||
this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber(); | ||
this.rowHeight = this.gridOptionsService.getRowHeightAsNumber(); | ||
this.addManagedListener(this.eventService, core_1.Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)); | ||
} | ||
start() { | ||
if (this.gridOptionsWrapper.getViewportDatasource()) { | ||
this.setViewportDatasource(this.gridOptionsWrapper.getViewportDatasource()); | ||
if (this.gridOptionsService.get('viewportDatasource')) { | ||
this.setViewportDatasource(this.gridOptionsService.get('viewportDatasource')); | ||
} | ||
@@ -47,5 +50,11 @@ } | ||
} | ||
getViewportRowModelPageSize() { | ||
return core_1._.oneOrGreater(this.gridOptionsService.getNum('viewportRowModelPageSize'), DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE); | ||
} | ||
getViewportRowModelBufferSize() { | ||
return core_1._.zeroOrGreater(this.gridOptionsService.getNum('viewportRowModelBufferSize'), DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE); | ||
} | ||
calculateFirstRow(firstRenderedRow) { | ||
const bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
const pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
const bufferSize = this.getViewportRowModelBufferSize(); | ||
const pageSize = this.getViewportRowModelPageSize(); | ||
const afterBuffer = firstRenderedRow - bufferSize; | ||
@@ -61,4 +70,4 @@ if (afterBuffer < 0) { | ||
} | ||
const bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
const pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
const bufferSize = this.getViewportRowModelBufferSize(); | ||
const pageSize = this.getViewportRowModelPageSize(); | ||
const afterBuffer = lastRenderedRow + bufferSize; | ||
@@ -119,3 +128,3 @@ const result = Math.ceil(afterBuffer / pageSize) * pageSize; | ||
getType() { | ||
return core_1.Constants.ROW_MODEL_TYPE_VIEWPORT; | ||
return 'viewport'; | ||
} | ||
@@ -122,0 +131,0 @@ getRow(rowIndex) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ViewportRowModelModule = void 0; | ||
const core_1 = require("@ag-grid-community/core"); | ||
const core_2 = require("@ag-grid-enterprise/core"); | ||
const version_1 = require("./version"); | ||
const viewportRowModel_1 = require("./viewportRowModel/viewportRowModel"); | ||
exports.ViewportRowModelModule = { | ||
version: version_1.VERSION, | ||
moduleName: core_1.ModuleNames.ViewportRowModelModule, | ||
@@ -8,0 +11,0 @@ rowModels: { viewport: viewportRowModel_1.ViewportRowModel }, |
@@ -1,2 +0,2 @@ | ||
import { BeanStub, IRowModel, IViewportDatasource, RowBounds, RowNode } from "@ag-grid-community/core"; | ||
import { BeanStub, IRowModel, IViewportDatasource, RowBounds, RowNode, RowModelType } from "@ag-grid-community/core"; | ||
export declare class ViewportRowModel extends BeanStub implements IRowModel { | ||
@@ -17,2 +17,4 @@ private rowRenderer; | ||
private destroyDatasource; | ||
private getViewportRowModelPageSize; | ||
private getViewportRowModelBufferSize; | ||
private calculateFirstRow; | ||
@@ -24,3 +26,3 @@ private calculateLastRow; | ||
setViewportDatasource(viewportDatasource: IViewportDatasource): void; | ||
getType(): string; | ||
getType(): RowModelType; | ||
getRow(rowIndex: number): RowNode; | ||
@@ -27,0 +29,0 @@ getRowNode(id: string): RowNode | undefined; |
@@ -5,3 +5,3 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __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]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -21,3 +21,5 @@ }; | ||
}; | ||
import { _, Autowired, Bean, BeanStub, Constants, Events, PostConstruct, PreDestroy, RowNode } from "@ag-grid-community/core"; | ||
import { _, Autowired, Bean, BeanStub, Events, PostConstruct, PreDestroy, RowNode } from "@ag-grid-community/core"; | ||
var DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5; | ||
var DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5; | ||
var ViewportRowModel = /** @class */ (function (_super) { | ||
@@ -38,8 +40,8 @@ __extends(ViewportRowModel, _super); | ||
ViewportRowModel.prototype.init = function () { | ||
this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber(); | ||
this.rowHeight = this.gridOptionsService.getRowHeightAsNumber(); | ||
this.addManagedListener(this.eventService, Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)); | ||
}; | ||
ViewportRowModel.prototype.start = function () { | ||
if (this.gridOptionsWrapper.getViewportDatasource()) { | ||
this.setViewportDatasource(this.gridOptionsWrapper.getViewportDatasource()); | ||
if (this.gridOptionsService.get('viewportDatasource')) { | ||
this.setViewportDatasource(this.gridOptionsService.get('viewportDatasource')); | ||
} | ||
@@ -61,5 +63,11 @@ }; | ||
}; | ||
ViewportRowModel.prototype.getViewportRowModelPageSize = function () { | ||
return _.oneOrGreater(this.gridOptionsService.getNum('viewportRowModelPageSize'), DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE); | ||
}; | ||
ViewportRowModel.prototype.getViewportRowModelBufferSize = function () { | ||
return _.zeroOrGreater(this.gridOptionsService.getNum('viewportRowModelBufferSize'), DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE); | ||
}; | ||
ViewportRowModel.prototype.calculateFirstRow = function (firstRenderedRow) { | ||
var bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
var pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
var bufferSize = this.getViewportRowModelBufferSize(); | ||
var pageSize = this.getViewportRowModelPageSize(); | ||
var afterBuffer = firstRenderedRow - bufferSize; | ||
@@ -75,4 +83,4 @@ if (afterBuffer < 0) { | ||
} | ||
var bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
var pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
var bufferSize = this.getViewportRowModelBufferSize(); | ||
var pageSize = this.getViewportRowModelPageSize(); | ||
var afterBuffer = lastRenderedRow + bufferSize; | ||
@@ -134,3 +142,3 @@ var result = Math.ceil(afterBuffer / pageSize) * pageSize; | ||
ViewportRowModel.prototype.getType = function () { | ||
return Constants.ROW_MODEL_TYPE_VIEWPORT; | ||
return 'viewport'; | ||
}; | ||
@@ -137,0 +145,0 @@ ViewportRowModel.prototype.getRow = function (rowIndex) { |
import { ModuleNames } from "@ag-grid-community/core"; | ||
import { EnterpriseCoreModule } from "@ag-grid-enterprise/core"; | ||
import { VERSION } from "./version"; | ||
import { ViewportRowModel } from "./viewportRowModel/viewportRowModel"; | ||
export var ViewportRowModelModule = { | ||
version: VERSION, | ||
moduleName: ModuleNames.ViewportRowModelModule, | ||
@@ -6,0 +8,0 @@ rowModels: { viewport: ViewportRowModel }, |
@@ -1,2 +0,2 @@ | ||
import { BeanStub, IRowModel, IViewportDatasource, RowBounds, RowNode } from "@ag-grid-community/core"; | ||
import { BeanStub, IRowModel, IViewportDatasource, RowBounds, RowNode, RowModelType } from "@ag-grid-community/core"; | ||
export declare class ViewportRowModel extends BeanStub implements IRowModel { | ||
@@ -17,2 +17,4 @@ private rowRenderer; | ||
private destroyDatasource; | ||
private getViewportRowModelPageSize; | ||
private getViewportRowModelBufferSize; | ||
private calculateFirstRow; | ||
@@ -24,3 +26,3 @@ private calculateLastRow; | ||
setViewportDatasource(viewportDatasource: IViewportDatasource): void; | ||
getType(): string; | ||
getType(): RowModelType; | ||
getRow(rowIndex: number): RowNode; | ||
@@ -27,0 +29,0 @@ getRowNode(id: string): RowNode | undefined; |
@@ -7,3 +7,5 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
import { _, Autowired, Bean, BeanStub, Constants, Events, PostConstruct, PreDestroy, RowNode } from "@ag-grid-community/core"; | ||
import { _, Autowired, Bean, BeanStub, Events, PostConstruct, PreDestroy, RowNode } from "@ag-grid-community/core"; | ||
const DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5; | ||
const DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5; | ||
let ViewportRowModel = class ViewportRowModel extends BeanStub { | ||
@@ -22,8 +24,8 @@ constructor() { | ||
init() { | ||
this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber(); | ||
this.rowHeight = this.gridOptionsService.getRowHeightAsNumber(); | ||
this.addManagedListener(this.eventService, Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)); | ||
} | ||
start() { | ||
if (this.gridOptionsWrapper.getViewportDatasource()) { | ||
this.setViewportDatasource(this.gridOptionsWrapper.getViewportDatasource()); | ||
if (this.gridOptionsService.get('viewportDatasource')) { | ||
this.setViewportDatasource(this.gridOptionsService.get('viewportDatasource')); | ||
} | ||
@@ -45,5 +47,11 @@ } | ||
} | ||
getViewportRowModelPageSize() { | ||
return _.oneOrGreater(this.gridOptionsService.getNum('viewportRowModelPageSize'), DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE); | ||
} | ||
getViewportRowModelBufferSize() { | ||
return _.zeroOrGreater(this.gridOptionsService.getNum('viewportRowModelBufferSize'), DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE); | ||
} | ||
calculateFirstRow(firstRenderedRow) { | ||
const bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
const pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
const bufferSize = this.getViewportRowModelBufferSize(); | ||
const pageSize = this.getViewportRowModelPageSize(); | ||
const afterBuffer = firstRenderedRow - bufferSize; | ||
@@ -59,4 +67,4 @@ if (afterBuffer < 0) { | ||
} | ||
const bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
const pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
const bufferSize = this.getViewportRowModelBufferSize(); | ||
const pageSize = this.getViewportRowModelPageSize(); | ||
const afterBuffer = lastRenderedRow + bufferSize; | ||
@@ -117,3 +125,3 @@ const result = Math.ceil(afterBuffer / pageSize) * pageSize; | ||
getType() { | ||
return Constants.ROW_MODEL_TYPE_VIEWPORT; | ||
return 'viewport'; | ||
} | ||
@@ -120,0 +128,0 @@ getRow(rowIndex) { |
import { ModuleNames } from "@ag-grid-community/core"; | ||
import { EnterpriseCoreModule } from "@ag-grid-enterprise/core"; | ||
import { VERSION } from "./version"; | ||
import { ViewportRowModel } from "./viewportRowModel/viewportRowModel"; | ||
export const ViewportRowModelModule = { | ||
version: VERSION, | ||
moduleName: ModuleNames.ViewportRowModelModule, | ||
@@ -6,0 +8,0 @@ rowModels: { viewport: ViewportRowModel }, |
/** | ||
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1 | ||
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.0.0 | ||
* @link https://www.ag-grid.com/ | ||
@@ -13,2 +13,5 @@ * @license Commercial | ||
// DO NOT UPDATE MANUALLY: Generated from script during build time | ||
var VERSION = '29.0.0'; | ||
var __extends = (undefined && undefined.__extends) || (function () { | ||
@@ -18,3 +21,3 @@ var extendStatics = function (d, b) { | ||
({ __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]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -34,2 +37,4 @@ }; | ||
}; | ||
var DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5; | ||
var DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5; | ||
var ViewportRowModel = /** @class */ (function (_super) { | ||
@@ -50,8 +55,8 @@ __extends(ViewportRowModel, _super); | ||
ViewportRowModel.prototype.init = function () { | ||
this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber(); | ||
this.rowHeight = this.gridOptionsService.getRowHeightAsNumber(); | ||
this.addManagedListener(this.eventService, core.Events.EVENT_VIEWPORT_CHANGED, this.onViewportChanged.bind(this)); | ||
}; | ||
ViewportRowModel.prototype.start = function () { | ||
if (this.gridOptionsWrapper.getViewportDatasource()) { | ||
this.setViewportDatasource(this.gridOptionsWrapper.getViewportDatasource()); | ||
if (this.gridOptionsService.get('viewportDatasource')) { | ||
this.setViewportDatasource(this.gridOptionsService.get('viewportDatasource')); | ||
} | ||
@@ -73,5 +78,11 @@ }; | ||
}; | ||
ViewportRowModel.prototype.getViewportRowModelPageSize = function () { | ||
return core._.oneOrGreater(this.gridOptionsService.getNum('viewportRowModelPageSize'), DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE); | ||
}; | ||
ViewportRowModel.prototype.getViewportRowModelBufferSize = function () { | ||
return core._.zeroOrGreater(this.gridOptionsService.getNum('viewportRowModelBufferSize'), DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE); | ||
}; | ||
ViewportRowModel.prototype.calculateFirstRow = function (firstRenderedRow) { | ||
var bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
var pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
var bufferSize = this.getViewportRowModelBufferSize(); | ||
var pageSize = this.getViewportRowModelPageSize(); | ||
var afterBuffer = firstRenderedRow - bufferSize; | ||
@@ -87,4 +98,4 @@ if (afterBuffer < 0) { | ||
} | ||
var bufferSize = this.gridOptionsWrapper.getViewportRowModelBufferSize(); | ||
var pageSize = this.gridOptionsWrapper.getViewportRowModelPageSize(); | ||
var bufferSize = this.getViewportRowModelBufferSize(); | ||
var pageSize = this.getViewportRowModelPageSize(); | ||
var afterBuffer = lastRenderedRow + bufferSize; | ||
@@ -146,3 +157,3 @@ var result = Math.ceil(afterBuffer / pageSize) * pageSize; | ||
ViewportRowModel.prototype.getType = function () { | ||
return core.Constants.ROW_MODEL_TYPE_VIEWPORT; | ||
return 'viewport'; | ||
}; | ||
@@ -287,2 +298,3 @@ ViewportRowModel.prototype.getRow = function (rowIndex) { | ||
var ViewportRowModelModule = { | ||
version: VERSION, | ||
moduleName: core.ModuleNames.ViewportRowModelModule, | ||
@@ -289,0 +301,0 @@ rowModels: { viewport: ViewportRowModel }, |
/** | ||
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1 | ||
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.0.0 | ||
* @link https://www.ag-grid.com/ | ||
@@ -7,6 +7,6 @@ * @license Commercial | ||
/** | ||
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1 | ||
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.0.0 | ||
* @link https://www.ag-grid.com/ | ||
* @license Commercial | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),r=(t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)},function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),i=function(t,e,o,r){var i,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var p=t.length-1;p>=0;p--)(i=t[p])&&(s=(n<3?i(s):n>3?i(e,o,s):i(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s},n=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.firstRow=-1,e.lastRow=-1,e.rowCount=-1,e.rowNodesByIndex={},e}return r(o,t),o.prototype.ensureRowHeightsValid=function(t,e,o,r){return!1},o.prototype.init=function(){this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber(),this.addManagedListener(this.eventService,e.Events.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this))},o.prototype.start=function(){this.gridOptionsWrapper.getViewportDatasource()&&this.setViewportDatasource(this.gridOptionsWrapper.getViewportDatasource())},o.prototype.isLastRowIndexKnown=function(){return!0},o.prototype.destroyDatasource=function(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)},o.prototype.calculateFirstRow=function(t){var e=this.gridOptionsWrapper.getViewportRowModelBufferSize(),o=this.gridOptionsWrapper.getViewportRowModelPageSize(),r=t-e;return r<0?0:Math.floor(r/o)*o},o.prototype.calculateLastRow=function(t){if(-1===t)return t;var e=this.gridOptionsWrapper.getViewportRowModelBufferSize(),o=this.gridOptionsWrapper.getViewportRowModelPageSize(),r=t+e,i=Math.ceil(r/o)*o,n=this.rowCount-1;return Math.min(i,n)},o.prototype.onViewportChanged=function(t){var e=this.calculateFirstRow(t.firstRow),o=this.calculateLastRow(t.lastRow);this.firstRow===e&&this.lastRow===o||(this.firstRow=e,this.lastRow=o,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))},o.prototype.purgeRowsNotInViewport=function(){var t=this;Object.keys(this.rowNodesByIndex).forEach((function(e){var o=parseInt(e,10);if(o<t.firstRow||o>t.lastRow){if(t.isRowFocused(o))return;delete t.rowNodesByIndex[o]}}))},o.prototype.isRowFocused=function(t){var e=this.focusService.getFocusCellToUseAfterRefresh();return!!e&&(null==e.rowPinned&&e.rowIndex===t)},o.prototype.setViewportDatasource=function(t){this.destroyDatasource(),this.viewportDatasource=t,this.rowCount=0,t.init?t.init({setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)}):console.warn("AG Grid: viewport is missing init method.")},o.prototype.getType=function(){return e.Constants.ROW_MODEL_TYPE_VIEWPORT},o.prototype.getRow=function(t){return this.rowNodesByIndex[t]||(this.rowNodesByIndex[t]=this.createBlankRowNode(t)),this.rowNodesByIndex[t]},o.prototype.getRowNode=function(t){var e;return this.forEachNode((function(o){o.id===t&&(e=o)})),e},o.prototype.getRowCount=function(){return this.rowCount},o.prototype.getRowIndexAtPixel=function(t){return 0!==this.rowHeight?Math.floor(t/this.rowHeight):0},o.prototype.getRowBounds=function(t){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*t}},o.prototype.getTopLevelRowCount=function(){return this.getRowCount()},o.prototype.getTopLevelRowDisplayedIndex=function(t){return t},o.prototype.isEmpty=function(){return this.rowCount>0},o.prototype.isRowsToRender=function(){return this.rowCount>0},o.prototype.getNodesInRangeForSelection=function(t,o){var r=e._.missing(t)?0:t.rowIndex,i=o.rowIndex,n=r<this.firstRow||r>this.lastRow,s=i<this.firstRow||i>this.lastRow;if(n||s)return[];for(var p=[],a=r<=i?i:r,u=r<=i?r:i;u<=a;u++)p.push(this.rowNodesByIndex[u]);return p},o.prototype.forEachNode=function(t){var e=this,o=0;Object.keys(this.rowNodesByIndex).forEach((function(r){var i=parseInt(r,10),n=e.rowNodesByIndex[i];t(n,o),o++}))},o.prototype.setRowData=function(t){var o=this;e._.iterateObject(t,(function(t,r){var i=parseInt(t,10);if(i>=o.firstRow&&i<=o.lastRow){var n=o.rowNodesByIndex[i];e._.missing(n)&&(n=o.createBlankRowNode(i),o.rowNodesByIndex[i]=n),n.setDataAndId(r,i.toString())}}))},o.prototype.createBlankRowNode=function(t){var o=new e.RowNode(this.beans);return o.setRowHeight(this.rowHeight),o.setRowTop(this.rowHeight*t),o.setRowIndex(t),o},o.prototype.setRowCount=function(t,o){if(void 0===o&&(o=!1),t!==this.rowCount){this.rowCount=t;var r={type:e.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:o,animate:!1};this.eventService.dispatchEvent(r)}},o.prototype.isRowPresent=function(t){return!!this.getRowNode(t.id)},i([e.Autowired("rowRenderer")],o.prototype,"rowRenderer",void 0),i([e.Autowired("focusService")],o.prototype,"focusService",void 0),i([e.Autowired("beans")],o.prototype,"beans",void 0),i([e.PostConstruct],o.prototype,"init",null),i([e.PreDestroy],o.prototype,"destroyDatasource",null),o=i([e.Bean("rowModel")],o)}(e.BeanStub),s={moduleName:e.ModuleNames.ViewportRowModelModule,rowModels:{viewport:n},dependantModules:[o.EnterpriseCoreModule]};exports.ViewportRowModelModule=s; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),r=(t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(e,o)},function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),i=function(t,e,o,r){var i,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var w=t.length-1;w>=0;w--)(i=t[w])&&(s=(n<3?i(s):n>3?i(e,o,s):i(e,o))||s);return n>3&&s&&Object.defineProperty(e,o,s),s},n=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.firstRow=-1,e.lastRow=-1,e.rowCount=-1,e.rowNodesByIndex={},e}return r(o,t),o.prototype.ensureRowHeightsValid=function(t,e,o,r){return!1},o.prototype.init=function(){this.rowHeight=this.gridOptionsService.getRowHeightAsNumber(),this.addManagedListener(this.eventService,e.Events.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this))},o.prototype.start=function(){this.gridOptionsService.get("viewportDatasource")&&this.setViewportDatasource(this.gridOptionsService.get("viewportDatasource"))},o.prototype.isLastRowIndexKnown=function(){return!0},o.prototype.destroyDatasource=function(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)},o.prototype.getViewportRowModelPageSize=function(){return e._.oneOrGreater(this.gridOptionsService.getNum("viewportRowModelPageSize"),5)},o.prototype.getViewportRowModelBufferSize=function(){return e._.zeroOrGreater(this.gridOptionsService.getNum("viewportRowModelBufferSize"),5)},o.prototype.calculateFirstRow=function(t){var e=this.getViewportRowModelBufferSize(),o=this.getViewportRowModelPageSize(),r=t-e;return r<0?0:Math.floor(r/o)*o},o.prototype.calculateLastRow=function(t){if(-1===t)return t;var e=this.getViewportRowModelBufferSize(),o=this.getViewportRowModelPageSize(),r=t+e,i=Math.ceil(r/o)*o,n=this.rowCount-1;return Math.min(i,n)},o.prototype.onViewportChanged=function(t){var e=this.calculateFirstRow(t.firstRow),o=this.calculateLastRow(t.lastRow);this.firstRow===e&&this.lastRow===o||(this.firstRow=e,this.lastRow=o,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))},o.prototype.purgeRowsNotInViewport=function(){var t=this;Object.keys(this.rowNodesByIndex).forEach((function(e){var o=parseInt(e,10);if(o<t.firstRow||o>t.lastRow){if(t.isRowFocused(o))return;delete t.rowNodesByIndex[o]}}))},o.prototype.isRowFocused=function(t){var e=this.focusService.getFocusCellToUseAfterRefresh();return!!e&&(null==e.rowPinned&&e.rowIndex===t)},o.prototype.setViewportDatasource=function(t){this.destroyDatasource(),this.viewportDatasource=t,this.rowCount=0,t.init?t.init({setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)}):console.warn("AG Grid: viewport is missing init method.")},o.prototype.getType=function(){return"viewport"},o.prototype.getRow=function(t){return this.rowNodesByIndex[t]||(this.rowNodesByIndex[t]=this.createBlankRowNode(t)),this.rowNodesByIndex[t]},o.prototype.getRowNode=function(t){var e;return this.forEachNode((function(o){o.id===t&&(e=o)})),e},o.prototype.getRowCount=function(){return this.rowCount},o.prototype.getRowIndexAtPixel=function(t){return 0!==this.rowHeight?Math.floor(t/this.rowHeight):0},o.prototype.getRowBounds=function(t){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*t}},o.prototype.getTopLevelRowCount=function(){return this.getRowCount()},o.prototype.getTopLevelRowDisplayedIndex=function(t){return t},o.prototype.isEmpty=function(){return this.rowCount>0},o.prototype.isRowsToRender=function(){return this.rowCount>0},o.prototype.getNodesInRangeForSelection=function(t,o){var r=e._.missing(t)?0:t.rowIndex,i=o.rowIndex,n=r<this.firstRow||r>this.lastRow,s=i<this.firstRow||i>this.lastRow;if(n||s)return[];for(var w=[],u=r<=i?i:r,p=r<=i?r:i;p<=u;p++)w.push(this.rowNodesByIndex[p]);return w},o.prototype.forEachNode=function(t){var e=this,o=0;Object.keys(this.rowNodesByIndex).forEach((function(r){var i=parseInt(r,10),n=e.rowNodesByIndex[i];t(n,o),o++}))},o.prototype.setRowData=function(t){var o=this;e._.iterateObject(t,(function(t,r){var i=parseInt(t,10);if(i>=o.firstRow&&i<=o.lastRow){var n=o.rowNodesByIndex[i];e._.missing(n)&&(n=o.createBlankRowNode(i),o.rowNodesByIndex[i]=n),n.setDataAndId(r,i.toString())}}))},o.prototype.createBlankRowNode=function(t){var o=new e.RowNode(this.beans);return o.setRowHeight(this.rowHeight),o.setRowTop(this.rowHeight*t),o.setRowIndex(t),o},o.prototype.setRowCount=function(t,o){if(void 0===o&&(o=!1),t!==this.rowCount){this.rowCount=t;var r={type:e.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:o,animate:!1};this.eventService.dispatchEvent(r)}},o.prototype.isRowPresent=function(t){return!!this.getRowNode(t.id)},i([e.Autowired("rowRenderer")],o.prototype,"rowRenderer",void 0),i([e.Autowired("focusService")],o.prototype,"focusService",void 0),i([e.Autowired("beans")],o.prototype,"beans",void 0),i([e.PostConstruct],o.prototype,"init",null),i([e.PreDestroy],o.prototype,"destroyDatasource",null),o=i([e.Bean("rowModel")],o)}(e.BeanStub),s={version:"29.0.0",moduleName:e.ModuleNames.ViewportRowModelModule,rowModels:{viewport:n},dependantModules:[o.EnterpriseCoreModule]};exports.ViewportRowModelModule=s; |
{ | ||
"name": "@ag-grid-enterprise/viewport-row-model", | ||
"version": "28.2.1", | ||
"version": "29.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -50,7 +50,7 @@ "main": "./dist/cjs/es5/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~28.2.1", | ||
"@ag-grid-enterprise/core": "~28.2.1" | ||
"@ag-grid-community/core": "~29.0.0", | ||
"@ag-grid-enterprise/core": "~29.0.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "~3.7.7", | ||
"typescript": "~4.0.8", | ||
"rimraf": "3.0.2" | ||
@@ -57,0 +57,0 @@ }, |
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
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
47
3378882
53154
+ Added@ag-grid-community/core@29.0.0(transitive)
+ Added@ag-grid-enterprise/core@29.0.0(transitive)
- Removed@ag-grid-community/core@28.2.1(transitive)
- Removed@ag-grid-enterprise/core@28.2.1(transitive)