@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) • 1.08 kB
JavaScript
/**
* @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 f{constructor(t=0,s){this.total=t,this.offsets=[],this.heights=[];let h=0;for(let e=0;e<t;e++)this.offsets.push(h),h+=s,this.heights.push(s)}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}update(t,s){let h=this.offsets[t];for(let e=t;e<this.heights.length;e++){this.offsets[e]=h;const i=s[e-t]||this.heights[e];h+=i,this.heights[e]=i}}}exports.RowHeightService=f;