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

Function TreeViewItemContent

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected