@memobit/libs 1.0.38 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.d.ts +33 -0
- package/dist/index.esm.js +3100 -3021
- package/dist/version.json +4 -4
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -2887,6 +2887,39 @@ export declare interface VinValidationResult {
|
|
|
2887
2887
|
error?: string;
|
|
2888
2888
|
}
|
|
2889
2889
|
|
|
2890
|
+
/**
|
|
2891
|
+
* Renders only the rows in view, so a list of tens of thousands of items costs
|
|
2892
|
+
* the same handful of DOM nodes and React fibers as a short one. The rows that
|
|
2893
|
+
* are not mounted are held open by spacer elements, which keeps the scrollbar,
|
|
2894
|
+
* scroll offsets and wheel behaviour identical to a fully rendered list.
|
|
2895
|
+
*
|
|
2896
|
+
* Rows must all be the SAME HEIGHT — the list measures one and multiplies. Give
|
|
2897
|
+
* variable-length content a fixed height in CSS (a line clamp on text, a fixed
|
|
2898
|
+
* thumbnail size) or rows will drift out of step with the spacers.
|
|
2899
|
+
*/
|
|
2900
|
+
export declare function VirtualList<T>({ items, renderItem, getKey, rowHeight, overscan, maxHeight, empty, className, rowClassName, }: VirtualListProps<T>): JSX.Element | null;
|
|
2901
|
+
|
|
2902
|
+
export declare interface VirtualListProps<T> {
|
|
2903
|
+
items: T[];
|
|
2904
|
+
/** Content of a single row. The row element itself is provided by the list. */
|
|
2905
|
+
renderItem: (item: T, index: number) => ReactNode;
|
|
2906
|
+
getKey: (item: T, index: number) => string | number;
|
|
2907
|
+
/**
|
|
2908
|
+
* Row stride in pixels (row height plus the gap below it). Leave unset to
|
|
2909
|
+
* measure it from the first rendered rows, which keeps it in step with the
|
|
2910
|
+
* active theme's font sizes.
|
|
2911
|
+
*/
|
|
2912
|
+
rowHeight?: number;
|
|
2913
|
+
/** Rows kept mounted above and below the viewport. Defaults to 6. */
|
|
2914
|
+
overscan?: number;
|
|
2915
|
+
/** Height cap for the scroller. Defaults to the value in the stylesheet. */
|
|
2916
|
+
maxHeight?: number | string;
|
|
2917
|
+
/** Rendered in place of the list when `items` is empty. */
|
|
2918
|
+
empty?: ReactNode;
|
|
2919
|
+
className?: string;
|
|
2920
|
+
rowClassName?: string;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2890
2923
|
export declare const WHtR: default_2.FC<WHtRProps>;
|
|
2891
2924
|
|
|
2892
2925
|
declare interface WHtRProps {
|