MCPcopy Create free account
hub / github.com/adobe/react-spectrum / DynamicTreeItem

Function DynamicTreeItem

packages/react-aria-components/test/Tree.test.tsx:268–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266];
267
268let DynamicTreeItem = props => {
269 return (
270 <TreeItem {...props}>
271 <TreeItemContent>
272 {({isExpanded, hasChildItems, selectionMode, selectionBehavior, allowsDragging}) => (
273 <>
274 {(selectionMode !== 'none' || props.href != null) && selectionBehavior === 'toggle' && (
275 <Checkbox slot="selection" />
276 )}
277 {allowsDragging && <Button slot="drag">≡</Button>}
278 {hasChildItems && <Button slot="chevron">{isExpanded ? '⏷' : '⏵'}</Button>}
279 {props.supportsDragging && <Button slot="drag">≡</Button>}
280 <Text>{props.title || props.children}</Text>
281 <Button aria-label="Info">ⓘ</Button>
282 <Button aria-label="Menu">☰</Button>
283 </>
284 )}
285 </TreeItemContent>
286 <Collection items={props.childItems}>
287 {(item: any) => (
288 <DynamicTreeItem
289 supportsDragging={props.supportsDragging}
290 childItems={item.childItems}
291 textValue={item.name}
292 href={props.href}>
293 {item.name}
294 </DynamicTreeItem>
295 )}
296 </Collection>
297 </TreeItem>
298 );
299};
300
301let DynamicTree = ({treeProps = {}, rowProps = {}}) => (
302 <Tree

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected