UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

19 lines (18 loc) 591 B
"use client"; import { useVirtualizer as a, notUndefined as r } from "@tanstack/react-virtual"; const g = ({ rowsCount: n, scrollRef: o, cellHeight: i, overscan: l }) => { const e = a({ count: n, getScrollElement: () => o.current, estimateSize: () => i, overscan: l }), t = e.getVirtualItems(), [s, u] = t.length > 0 ? [ r(t[0]).start - e.options.scrollMargin, e.getTotalSize() - r(t[t.length - 1]).end ] : [0, 0]; return { virtualizer: e, virtualRows: t, before: s, after: u }; }; export { g as useVirtualRows }; //# sourceMappingURL=useVirtualRows.js.map