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

@ag-grid-enterprise/viewport-row-model

Package Overview
Dependencies
Maintainers
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/viewport-row-model - npm Package Compare versions

Comparing version 27.2.1 to 27.3.0

4

dist/viewport-row-model.cjs.js
/**
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1
* @link http://www.ag-grid.com/
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0
* @link https://www.ag-grid.com/
* @license Commercial

@@ -5,0 +5,0 @@ */

/**
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1
* @link http://www.ag-grid.com/
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0
* @link https://www.ag-grid.com/
* @license Commercial
*/
/**
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1
* @link http://www.ag-grid.com/
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0
* @link https://www.ag-grid.com/
* @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,o=require("@ag-grid-community/core"),e=require("@ag-grid-enterprise/core"),r=(t=function(o,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)o.hasOwnProperty(e)&&(t[e]=o[e])})(o,e)},function(o,e){function r(){this.constructor=o}t(o,e),o.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=function(t,o,e,r){var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,o,e,r);else for(var p=t.length-1;p>=0;p--)(i=t[p])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s},n=function(t){function e(){var o=null!==t&&t.apply(this,arguments)||this;return o.firstRow=-1,o.lastRow=-1,o.rowCount=-1,o.rowNodesByIndex={},o}return r(e,t),e.prototype.ensureRowHeightsValid=function(t,o,e,r){return!1},e.prototype.init=function(){this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber(),this.addManagedListener(this.eventService,o.Events.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this))},e.prototype.start=function(){this.gridOptionsWrapper.getViewportDatasource()&&this.setViewportDatasource(this.gridOptionsWrapper.getViewportDatasource())},e.prototype.isLastRowIndexKnown=function(){return!0},e.prototype.destroyDatasource=function(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)},e.prototype.calculateFirstRow=function(t){var o=this.gridOptionsWrapper.getViewportRowModelBufferSize(),e=this.gridOptionsWrapper.getViewportRowModelPageSize(),r=t-o;return r<0?0:Math.floor(r/e)*e},e.prototype.calculateLastRow=function(t){if(-1===t)return t;var o=this.gridOptionsWrapper.getViewportRowModelBufferSize(),e=this.gridOptionsWrapper.getViewportRowModelPageSize(),r=t+o,i=Math.ceil(r/e)*e,n=this.rowCount-1;return Math.min(i,n)},e.prototype.onViewportChanged=function(t){var o=this.calculateFirstRow(t.firstRow),e=this.calculateLastRow(t.lastRow);this.firstRow===o&&this.lastRow===e||(this.firstRow=o,this.lastRow=e,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))},e.prototype.purgeRowsNotInViewport=function(){var t=this;Object.keys(this.rowNodesByIndex).forEach((function(o){var e=parseInt(o,10);(e<t.firstRow||e>t.lastRow)&&delete t.rowNodesByIndex[e]}))},e.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.")},e.prototype.getType=function(){return o.Constants.ROW_MODEL_TYPE_VIEWPORT},e.prototype.getRow=function(t){return this.rowNodesByIndex[t]||(this.rowNodesByIndex[t]=this.createBlankRowNode(t)),this.rowNodesByIndex[t]},e.prototype.getRowNode=function(t){var o;return this.forEachNode((function(e){e.id===t&&(o=e)})),o},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowIndexAtPixel=function(t){return 0!==this.rowHeight?Math.floor(t/this.rowHeight):0},e.prototype.getRowBounds=function(t){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*t}},e.prototype.getTopLevelRowCount=function(){return this.getRowCount()},e.prototype.getTopLevelRowDisplayedIndex=function(t){return t},e.prototype.isEmpty=function(){return this.rowCount>0},e.prototype.isRowsToRender=function(){return this.rowCount>0},e.prototype.getNodesInRangeForSelection=function(t,e){var r=o._.missing(t)?0:t.rowIndex,i=e.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,w=r<=i?r:i;w<=a;w++)p.push(this.rowNodesByIndex[w]);return p},e.prototype.forEachNode=function(t){var o=this,e=0;Object.keys(this.rowNodesByIndex).forEach((function(r){var i=parseInt(r,10),n=o.rowNodesByIndex[i];t(n,e),e++}))},e.prototype.setRowData=function(t){var e=this;o._.iterateObject(t,(function(t,r){var i=parseInt(t,10);if(i>=e.firstRow&&i<=e.lastRow){var n=e.rowNodesByIndex[i];o._.missing(n)&&(n=e.createBlankRowNode(i),e.rowNodesByIndex[i]=n),n.setDataAndId(r,i.toString())}}))},e.prototype.createBlankRowNode=function(t){var e=new o.RowNode(this.beans);return e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*t),e.setRowIndex(t),e},e.prototype.setRowCount=function(t,e){if(void 0===e&&(e=!1),t!==this.rowCount){this.rowCount=t;var r={type:o.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,newData:!1,newPage:!1,keepRenderedRows:e,animate:!1};this.eventService.dispatchEvent(r)}},e.prototype.isRowPresent=function(t){return!1},i([o.Autowired("gridApi")],e.prototype,"gridApi",void 0),i([o.Autowired("columnApi")],e.prototype,"columnApi",void 0),i([o.Autowired("rowRenderer")],e.prototype,"rowRenderer",void 0),i([o.Autowired("beans")],e.prototype,"beans",void 0),i([o.PostConstruct],e.prototype,"init",null),i([o.PreDestroy],e.prototype,"destroyDatasource",null),e=i([o.Bean("rowModel")],e)}(o.BeanStub),s={moduleName:o.ModuleNames.ViewportRowModelModule,rowModels:{viewport:n},dependantModules:[e.EnterpriseCoreModule]};exports.ViewportRowModelModule=s;
/**
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1
* @link http://www.ag-grid.com/
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0
* @link https://www.ag-grid.com/
* @license Commercial

@@ -5,0 +5,0 @@ */

/**
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1
* @link http://www.ag-grid.com/
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0
* @link https://www.ag-grid.com/
* @license Commercial
*/
/**
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.2.1
* @link http://www.ag-grid.com/
* @ag-grid-enterprise/viewport-row-model - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0
* @link https://www.ag-grid.com/
* @license Commercial
*/
import{Events as t,Constants as o,_ as e,RowNode as r,Autowired as i,PostConstruct as n,PreDestroy as s,Bean as p,BeanStub as a,ModuleNames as w}from"@ag-grid-community/core";import{EnterpriseCoreModule as u}from"@ag-grid-enterprise/core";var h,c=(h=function(t,o){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)o.hasOwnProperty(e)&&(t[e]=o[e])})(t,o)},function(t,o){function e(){this.constructor=t}h(t,o),t.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}),d=function(t,o,e,r){var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,o,e,r);else for(var p=t.length-1;p>=0;p--)(i=t[p])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s},f=function(a){function w(){var t=null!==a&&a.apply(this,arguments)||this;return t.firstRow=-1,t.lastRow=-1,t.rowCount=-1,t.rowNodesByIndex={},t}return c(w,a),w.prototype.ensureRowHeightsValid=function(t,o,e,r){return!1},w.prototype.init=function(){this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber(),this.addManagedListener(this.eventService,t.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this))},w.prototype.start=function(){this.gridOptionsWrapper.getViewportDatasource()&&this.setViewportDatasource(this.gridOptionsWrapper.getViewportDatasource())},w.prototype.isLastRowIndexKnown=function(){return!0},w.prototype.destroyDatasource=function(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)},w.prototype.calculateFirstRow=function(t){var o=this.gridOptionsWrapper.getViewportRowModelBufferSize(),e=this.gridOptionsWrapper.getViewportRowModelPageSize(),r=t-o;return r<0?0:Math.floor(r/e)*e},w.prototype.calculateLastRow=function(t){if(-1===t)return t;var o=this.gridOptionsWrapper.getViewportRowModelBufferSize(),e=this.gridOptionsWrapper.getViewportRowModelPageSize(),r=t+o,i=Math.ceil(r/e)*e,n=this.rowCount-1;return Math.min(i,n)},w.prototype.onViewportChanged=function(t){var o=this.calculateFirstRow(t.firstRow),e=this.calculateLastRow(t.lastRow);this.firstRow===o&&this.lastRow===e||(this.firstRow=o,this.lastRow=e,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))},w.prototype.purgeRowsNotInViewport=function(){var t=this;Object.keys(this.rowNodesByIndex).forEach((function(o){var e=parseInt(o,10);(e<t.firstRow||e>t.lastRow)&&delete t.rowNodesByIndex[e]}))},w.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.")},w.prototype.getType=function(){return o.ROW_MODEL_TYPE_VIEWPORT},w.prototype.getRow=function(t){return this.rowNodesByIndex[t]||(this.rowNodesByIndex[t]=this.createBlankRowNode(t)),this.rowNodesByIndex[t]},w.prototype.getRowNode=function(t){var o;return this.forEachNode((function(e){e.id===t&&(o=e)})),o},w.prototype.getRowCount=function(){return this.rowCount},w.prototype.getRowIndexAtPixel=function(t){return 0!==this.rowHeight?Math.floor(t/this.rowHeight):0},w.prototype.getRowBounds=function(t){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*t}},w.prototype.getTopLevelRowCount=function(){return this.getRowCount()},w.prototype.getTopLevelRowDisplayedIndex=function(t){return t},w.prototype.isEmpty=function(){return this.rowCount>0},w.prototype.isRowsToRender=function(){return this.rowCount>0},w.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,w=r<=i?r:i;w<=a;w++)p.push(this.rowNodesByIndex[w]);return p},w.prototype.forEachNode=function(t){var o=this,e=0;Object.keys(this.rowNodesByIndex).forEach((function(r){var i=parseInt(r,10),n=o.rowNodesByIndex[i];t(n,e),e++}))},w.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())}}))},w.prototype.createBlankRowNode=function(t){var o=new r(this.beans);return o.setRowHeight(this.rowHeight),o.setRowTop(this.rowHeight*t),o.setRowIndex(t),o},w.prototype.setRowCount=function(o,e){if(void 0===e&&(e=!1),o!==this.rowCount){this.rowCount=o;var r={type:t.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,newData:!1,newPage:!1,keepRenderedRows:e,animate:!1};this.eventService.dispatchEvent(r)}},w.prototype.isRowPresent=function(t){return!1},d([i("gridApi")],w.prototype,"gridApi",void 0),d([i("columnApi")],w.prototype,"columnApi",void 0),d([i("rowRenderer")],w.prototype,"rowRenderer",void 0),d([i("beans")],w.prototype,"beans",void 0),d([n],w.prototype,"init",null),d([s],w.prototype,"destroyDatasource",null),w=d([p("rowModel")],w)}(a),R={moduleName:w.ViewportRowModelModule,rowModels:{viewport:f},dependantModules:[u]};export{R as ViewportRowModelModule};
{
"name": "@ag-grid-enterprise/viewport-row-model",
"version": "27.2.1",
"version": "27.3.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -12,4 +12,7 @@ "main": "./dist/cjs/es5/main.js",

"build-esm": "npx tsc -p tsconfig.esm.es5.json && npx tsc -p tsconfig.esm.es6.json",
"build-cjs-prod": "npx tsc -p tsconfig.cjs.es5.json --sourceMap false && npx tsc -p tsconfig.cjs.es6.json --sourceMap false",
"build-esm-prod": "npx tsc -p tsconfig.esm.es5.json --sourceMap false && npx tsc -p tsconfig.esm.es6.json --sourceMap false",
"package": "node ../../module-build/rollup/build.js",
"build": "npm run build-cjs && npm run build-esm && npm run hash",
"build-prod": "npm run build-cjs-prod && npm run build-esm-prod && npm run hash",
"hash": "sh ../../scripts/hashDirectory.sh > .hash"

@@ -46,6 +49,6 @@ },

],
"homepage": "http://www.ag-grid.com/",
"homepage": "https://www.ag-grid.com/",
"dependencies": {
"@ag-grid-community/core": "~27.2.0",
"@ag-grid-enterprise/core": "~27.2.0"
"@ag-grid-community/core": "~27.3.0",
"@ag-grid-enterprise/core": "~27.3.0"
},

@@ -59,2 +62,2 @@ "devDependencies": {

}
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc