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 31.3.1 to 31.3.2

2

dist/package/main.cjs.js

@@ -40,3 +40,3 @@ var __defProp = Object.defineProperty;

// enterprise-modules/viewport-row-model/src/version.ts
var VERSION = "31.3.1";
var VERSION = "31.3.2";

@@ -43,0 +43,0 @@ // enterprise-modules/viewport-row-model/src/viewportRowModel/viewportRowModel.ts

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

var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of __getOwnPropNames(t))!__hasOwnProp.call(e,r)&&r!==o&&__defProp(e,r,{get:()=>t[r],enumerable:!(s=__getOwnPropDesc(t,r))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,o,s)=>{for(var r=s>1?void 0:s?__getOwnPropDesc(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(s?n(t,o,r):n(r))||r);return s&&r&&__defProp(t,o,r),r},main_exports={};__export(main_exports,{ViewportRowModelModule:()=>ViewportRowModelModule}),module.exports=__toCommonJS(main_exports);var import_core2=require("@ag-grid-community/core"),import_core3=require("@ag-grid-enterprise/core"),VERSION="31.3.1",import_core=require("@ag-grid-community/core"),ViewportRowModel=class extends import_core.BeanStub{constructor(){super(...arguments),this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={}}ensureRowHeightsValid(e,t,o,s){return!1}init(){this.rowHeight=this.gos.getRowHeightAsNumber(),this.addManagedListener(this.eventService,import_core.Events.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this)),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroyDatasource(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){const e=this.gos.get("viewportDatasource");e&&this.setViewportDatasource(e)}getViewportRowModelPageSize(){return this.gos.get("viewportRowModelPageSize")}getViewportRowModelBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(e){const t=this.getViewportRowModelBufferSize(),o=this.getViewportRowModelPageSize(),s=e-t;return s<0?0:Math.floor(s/o)*o}calculateLastRow(e){if(e===-1)return e;const t=this.getViewportRowModelBufferSize(),o=this.getViewportRowModelPageSize(),s=e+t,r=Math.ceil(s/o)*o,i=this.rowCount-1;return Math.min(r,i)}onViewportChanged(e){const t=this.calculateFirstRow(e.firstRow),o=this.calculateLastRow(e.lastRow);(this.firstRow!==t||this.lastRow!==o)&&(this.firstRow=t,this.lastRow=o,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))}purgeRowsNotInViewport(){Object.keys(this.rowNodesByIndex).forEach(e=>{const t=parseInt(e,10);if(t<this.firstRow||t>this.lastRow){if(this.isRowFocused(t))return;delete this.rowNodesByIndex[t]}})}isRowFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();return!t||t.rowPinned!=null?!1:t.rowIndex===e}setViewportDatasource(e){this.destroyDatasource(),this.viewportDatasource=e,this.rowCount=-1,e.init?e.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.")}getType(){return"viewport"}getRow(e){return this.rowNodesByIndex[e]||(this.rowNodesByIndex[e]=this.createBlankRowNode(e)),this.rowNodesByIndex[e]}getRowNode(e){let t;return this.forEachNode(o=>{o.id===e&&(t=o)}),t}getRowCount(){return this.rowCount===-1?0:this.rowCount}getRowIndexAtPixel(e){return this.rowHeight!==0?Math.floor(e/this.rowHeight):0}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}updateRowHeights(){this.forEachNode(t=>{t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*t.rowIndex)});const e={type:import_core.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1};this.eventService.dispatchEvent(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){const o=import_core._.missing(e)?0:e.rowIndex,s=t.rowIndex,r=o<this.firstRow||o>this.lastRow,i=s<this.firstRow||s>this.lastRow;if(r||i)return[];const n=[],w=o<=s?o:s,h=o<=s?s:o;for(let a=w;a<=h;a++)n.push(this.rowNodesByIndex[a]);return n}forEachNode(e){let t=0;Object.keys(this.rowNodesByIndex).forEach(o=>{const s=parseInt(o,10),r=this.rowNodesByIndex[s];e(r,t),t++})}setRowData(e){import_core._.iterateObject(e,(t,o)=>{const s=parseInt(t,10);if(s>=this.firstRow&&s<=this.lastRow){let r=this.rowNodesByIndex[s];import_core._.missing(r)&&(r=this.createBlankRowNode(s),this.rowNodesByIndex[s]=r),r.setDataAndId(o,s.toString())}})}createBlankRowNode(e){const t=new import_core.RowNode(this.beans);return t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e,this.eventService.dispatchEventOnce({type:import_core.Events.EVENT_ROW_COUNT_READY});const o={type:import_core.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:t,animate:!1};this.eventService.dispatchEvent(o)}isRowPresent(e){return!!this.getRowNode(e.id)}};__decorateClass([(0,import_core.Autowired)("rowRenderer")],ViewportRowModel.prototype,"rowRenderer",2),__decorateClass([(0,import_core.Autowired)("focusService")],ViewportRowModel.prototype,"focusService",2),__decorateClass([(0,import_core.Autowired)("beans")],ViewportRowModel.prototype,"beans",2),__decorateClass([import_core.PostConstruct],ViewportRowModel.prototype,"init",1),__decorateClass([import_core.PreDestroy],ViewportRowModel.prototype,"destroyDatasource",1),ViewportRowModel=__decorateClass([(0,import_core.Bean)("rowModel")],ViewportRowModel);var ViewportRowModelModule={version:VERSION,moduleName:import_core2.ModuleNames.ViewportRowModelModule,rowModel:"viewport",beans:[ViewportRowModel],dependantModules:[import_core3.EnterpriseCoreModule]};
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of __getOwnPropNames(t))!__hasOwnProp.call(e,r)&&r!==o&&__defProp(e,r,{get:()=>t[r],enumerable:!(s=__getOwnPropDesc(t,r))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,o,s)=>{for(var r=s>1?void 0:s?__getOwnPropDesc(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(s?n(t,o,r):n(r))||r);return s&&r&&__defProp(t,o,r),r},main_exports={};__export(main_exports,{ViewportRowModelModule:()=>ViewportRowModelModule}),module.exports=__toCommonJS(main_exports);var import_core2=require("@ag-grid-community/core"),import_core3=require("@ag-grid-enterprise/core"),VERSION="31.3.2",import_core=require("@ag-grid-community/core"),ViewportRowModel=class extends import_core.BeanStub{constructor(){super(...arguments),this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={}}ensureRowHeightsValid(e,t,o,s){return!1}init(){this.rowHeight=this.gos.getRowHeightAsNumber(),this.addManagedListener(this.eventService,import_core.Events.EVENT_VIEWPORT_CHANGED,this.onViewportChanged.bind(this)),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroyDatasource(){this.viewportDatasource&&(this.viewportDatasource.destroy&&this.viewportDatasource.destroy(),this.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){const e=this.gos.get("viewportDatasource");e&&this.setViewportDatasource(e)}getViewportRowModelPageSize(){return this.gos.get("viewportRowModelPageSize")}getViewportRowModelBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(e){const t=this.getViewportRowModelBufferSize(),o=this.getViewportRowModelPageSize(),s=e-t;return s<0?0:Math.floor(s/o)*o}calculateLastRow(e){if(e===-1)return e;const t=this.getViewportRowModelBufferSize(),o=this.getViewportRowModelPageSize(),s=e+t,r=Math.ceil(s/o)*o,i=this.rowCount-1;return Math.min(r,i)}onViewportChanged(e){const t=this.calculateFirstRow(e.firstRow),o=this.calculateLastRow(e.lastRow);(this.firstRow!==t||this.lastRow!==o)&&(this.firstRow=t,this.lastRow=o,this.purgeRowsNotInViewport(),this.viewportDatasource&&this.viewportDatasource.setViewportRange(this.firstRow,this.lastRow))}purgeRowsNotInViewport(){Object.keys(this.rowNodesByIndex).forEach(e=>{const t=parseInt(e,10);if(t<this.firstRow||t>this.lastRow){if(this.isRowFocused(t))return;delete this.rowNodesByIndex[t]}})}isRowFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();return!t||t.rowPinned!=null?!1:t.rowIndex===e}setViewportDatasource(e){this.destroyDatasource(),this.viewportDatasource=e,this.rowCount=-1,e.init?e.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.")}getType(){return"viewport"}getRow(e){return this.rowNodesByIndex[e]||(this.rowNodesByIndex[e]=this.createBlankRowNode(e)),this.rowNodesByIndex[e]}getRowNode(e){let t;return this.forEachNode(o=>{o.id===e&&(t=o)}),t}getRowCount(){return this.rowCount===-1?0:this.rowCount}getRowIndexAtPixel(e){return this.rowHeight!==0?Math.floor(e/this.rowHeight):0}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}updateRowHeights(){this.forEachNode(t=>{t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*t.rowIndex)});const e={type:import_core.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1};this.eventService.dispatchEvent(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){const o=import_core._.missing(e)?0:e.rowIndex,s=t.rowIndex,r=o<this.firstRow||o>this.lastRow,i=s<this.firstRow||s>this.lastRow;if(r||i)return[];const n=[],w=o<=s?o:s,h=o<=s?s:o;for(let a=w;a<=h;a++)n.push(this.rowNodesByIndex[a]);return n}forEachNode(e){let t=0;Object.keys(this.rowNodesByIndex).forEach(o=>{const s=parseInt(o,10),r=this.rowNodesByIndex[s];e(r,t),t++})}setRowData(e){import_core._.iterateObject(e,(t,o)=>{const s=parseInt(t,10);if(s>=this.firstRow&&s<=this.lastRow){let r=this.rowNodesByIndex[s];import_core._.missing(r)&&(r=this.createBlankRowNode(s),this.rowNodesByIndex[s]=r),r.setDataAndId(o,s.toString())}})}createBlankRowNode(e){const t=new import_core.RowNode(this.beans);return t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e,this.eventService.dispatchEventOnce({type:import_core.Events.EVENT_ROW_COUNT_READY});const o={type:import_core.Events.EVENT_MODEL_UPDATED,newData:!1,newPage:!1,keepRenderedRows:t,animate:!1};this.eventService.dispatchEvent(o)}isRowPresent(e){return!!this.getRowNode(e.id)}};__decorateClass([(0,import_core.Autowired)("rowRenderer")],ViewportRowModel.prototype,"rowRenderer",2),__decorateClass([(0,import_core.Autowired)("focusService")],ViewportRowModel.prototype,"focusService",2),__decorateClass([(0,import_core.Autowired)("beans")],ViewportRowModel.prototype,"beans",2),__decorateClass([import_core.PostConstruct],ViewportRowModel.prototype,"init",1),__decorateClass([import_core.PreDestroy],ViewportRowModel.prototype,"destroyDatasource",1),ViewportRowModel=__decorateClass([(0,import_core.Bean)("rowModel")],ViewportRowModel);var ViewportRowModelModule={version:VERSION,moduleName:import_core2.ModuleNames.ViewportRowModelModule,rowModel:"viewport",beans:[ViewportRowModel],dependantModules:[import_core3.EnterpriseCoreModule]};
{
"name": "@ag-grid-enterprise/viewport-row-model",
"version": "31.3.1",
"version": "31.3.2",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -15,4 +15,4 @@ "main": "./dist/package/main.cjs.js",

"dependencies": {
"@ag-grid-community/core": "31.3.1",
"@ag-grid-enterprise/core": "31.3.1"
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2"
},

@@ -19,0 +19,0 @@ "devDependencies": {

{
"name": "@ag-grid-enterprise/viewport-row-model",
"version": "31.3.1",
"version": "31.3.2",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -15,4 +15,4 @@ "main": "./src/main.js",

"dependencies": {
"@ag-grid-community/core": "31.3.1",
"@ag-grid-enterprise/core": "31.3.1"
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2"
},

@@ -19,0 +19,0 @@ "devDependencies": {

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

export declare const VERSION = "31.3.1";
export declare const VERSION = "31.3.2";
{
"name": "@ag-grid-enterprise/viewport-row-model",
"version": "31.3.1",
"version": "31.3.2",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -15,4 +15,4 @@ "main": "./dist/package/main.cjs.js",

"dependencies": {
"@ag-grid-community/core": "31.3.1",
"@ag-grid-enterprise/core": "31.3.1"
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2"
},

@@ -19,0 +19,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc