@progress/kendo-react-treelist
Version:
React TreeList enables the display of self-referencing tabular data. KendoReact TreeList package
9 lines (8 loc) • 1.39 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(o){return o!==void 0&&(typeof o=="number"||/px$/i.test(String(o)))}function u(o,e,c){const l=Array.from(o.tHead&&o.tHead.rows||[]),r=[e],h=c||(t=>window.getComputedStyle(t).height||void 0);l.forEach(t=>{const s=h(t);r.push(g(s)?parseFloat(String(s)):t.offsetHeight)});for(let t=0;t<l.length;t++){const s=r.slice(0,t+1).reduce((i,n)=>i+n,0);Array.from(l[t].cells).forEach(i=>i.style.top=s+"px")}}const a=1e6;function d(o){const{rows:e,tableViewPortHeight:c,scrollTop:l}=o;if(e.length===0)return[];const r=e[0].height,h=Math.min(Math.round(l/r),e.length),t=Math.round(c/r),s=Math.max(0,h-t),i=Math.min(e.length,h+2*t),n=e.slice(s,i),f=n[n.length-1];return s>0&&n.unshift({dataItem:{},level:[a],offsetTop:0,height:n[0].offsetTop,levelCount:0}),i<e.length-1&&n.push({dataItem:{},level:[a,a],offsetTop:f.offsetTop+f.height,height:(e.length-i)*r,levelCount:0}),n}exports.setHeaderRowsTop=u;exports.tableRowsVirtualization=d;