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

41 lines (40 loc) 1.14 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ class g { 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; } } export { g as RowHeightService };