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

Function TreeViewItemContent

packages/@react-spectrum/s2/src/TreeView.tsx:608–712  ·  view source on GitHub ↗
(props: TreeViewItemContentProps)

Source from the content-addressed store, hash-verified

606}
607
608export const TreeViewItemContent = (props: TreeViewItemContentProps): ReactNode => {
609 let {children} = props;
610 let scale = useScale();
611
612 let {selectionStyle} = useContext(InternalTreeViewContext);
613
614 return (
615 <TreeItemContent>
616 {({
617 isExpanded,
618 hasChildItems,
619 selectionMode,
620 selectionBehavior,
621 isDisabled,
622 isSelected,
623 id,
624 state,
625 isHovered,
626 isFocusVisible,
627 isFocusVisibleWithin,
628 allowsDragging,
629 isDropTarget
630 }) => {
631 return (
632 <div
633 className={treeCellGrid({
634 isDisabled,
635 isNextSelected: isNextSelected(id, state),
636 isSelected,
637 selectionStyle
638 })}>
639 <div
640 className={treeRowBackground({
641 isHovered,
642 isFocusVisible,
643 isSelected,
644 selectionStyle,
645 isNextSelected: isNextSelected(id, state),
646 isPreviousSelected: isPrevSelected(id, state),
647 isDropTarget
648 })}
649 />
650 {isFocusVisible && (
651 <div
652 className={treeRowFocusRing({
653 isFocusVisible,
654 selectionStyle,
655 isSelected,
656 isNextSelected: isNextSelected(id, state),
657 isFirstItem: isFirstItem(id, state)
658 })}
659 />
660 )}
661 {allowsDragging && (
662 <div className={treeDragButtonContainer}>
663 {!isDisabled && <DragHandleButton isFocusVisibleWithin={isFocusVisibleWithin} />}
664 </div>
665 )}

Callers

nothing calls this directly

Calls 7

useScaleFunction · 0.90
centerBaselineFunction · 0.90
isNextSelectedFunction · 0.70
isPrevSelectedFunction · 0.70
isFirstItemFunction · 0.70
canSelectItemMethod · 0.65
hasMethod · 0.65

Tested by

no test coverage detected