UNPKG

@progress/kendo-react-common

Version:

React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package

9 lines (8 loc) 994 B
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{constructor(t=0,s,r,h){this.total=t,this.offsets=[],this.heights=[];let i=0;for(let e=0;e<t;e++){this.offsets.push(i);const f=h&&h[e].expanded&&h[e].rowType==="data"?r:s;i+=f,this.heights.push(f)}}height(t){return this.heights[t]}index(t){for(let s=0;s<this.offsets.length;s++){if(t===this.offsets[s])return s;if(t<this.offsets[s])return s-1}return this.total-1}offset(t){return this.offsets[t]}totalHeight(){const t=this.offsets[this.offsets.length-1],s=this.heights[this.heights.length-1];return t+s}}exports.RowHeightService=o;