react-virtualized-sticky-tree
Advanced tools
Comparing version 3.0.0-beta14 to 3.0.0-beta15
import React from 'react'; | ||
import StickyTree, { StickyTreeProps, TreeNode } from './StickyTree'; | ||
import StickyTree, { StickyTreeNode, StickyTreeProps, TreeNode } from './StickyTree'; | ||
declare type OmitProps = 'getChildren' | 'root' | 'renderRoot'; | ||
export declare type StickyListNode = TreeNode & Pick<StickyTreeNode, 'zIndex' | 'isSticky' | 'stickyTop' | 'height'>; | ||
export interface StickyListProps<TNodeType extends TreeNode = TreeNode, TMeta = any> extends Omit<StickyTreeProps<TNodeType, TMeta>, OmitProps> { | ||
@@ -9,3 +10,3 @@ items: TNodeType[]; | ||
} | ||
declare const StickyList: <TNodeType extends TreeNode = TreeNode, TMeta = any>({ items, rowRenderer, width, height, treeRef, getRowHeight, wrapAllLeafNodes, ...rest }: StickyListProps<TNodeType, TMeta>) => JSX.Element; | ||
declare const StickyList: <TNodeType extends StickyListNode = StickyListNode, TMeta = any>({ items, rowRenderer, width, height, treeRef, getRowHeight, wrapAllLeafNodes, ...rest }: StickyListProps<TNodeType, TMeta>) => JSX.Element; | ||
export default StickyList; |
@@ -47,4 +47,10 @@ "use strict"; | ||
if (node.id === 'root') { | ||
// If they don't specify a getHeight function, they must be using the rowHeight prop. | ||
return items.map((item) => ({ node: item, height: getRowHeight ? getRowHeight(item) : undefined })); | ||
return items.map((item) => ({ | ||
node: item, | ||
// If they don't specify a getHeight function, they must be using either a height on the node or the rowHeight prop to StickyList. | ||
height: getRowHeight ? getRowHeight(item) : item.height, | ||
isSticky: item.isSticky, | ||
stickyTop: item.stickyTop, | ||
zIndex: item.zIndex, | ||
})); | ||
} | ||
@@ -51,0 +57,0 @@ return undefined; |
{ | ||
"name": "react-virtualized-sticky-tree", | ||
"description": "A React component for efficiently rendering tree like structures with support for position: sticky", | ||
"version": "3.0.0-beta14", | ||
"version": "3.0.0-beta15", | ||
"author": "Marc McIntyre <marchaos@gmail.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
62023
1211