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

Function TreeViewItemContent

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

Source from the content-addressed store, hash-verified

624}
625
626export const TreeViewItemContent = (props: TreeViewItemContentProps): ReactNode => {
627 let {children} = props;
628 let scale = useScale();
629
630 let {selectionStyle} = useContext(InternalTreeViewContext);
631
632 return (
633 <TreeItemContent>
634 {({
635 isExpanded,
636 hasChildItems,
637 selectionMode,
638 selectionBehavior,
639 isDisabled,
640 isSelected,
641 id,
642 state,
643 isHovered,
644 isFocusVisible,
645 isFocusVisibleWithin,
646 allowsDragging,
647 isDropTarget
648 }) => {
649 let hasCheckbox =
650 selectionMode !== 'none' &&
651 selectionBehavior === 'toggle' &&
652 selectionStyle !== 'highlight';
653 return (
654 <div
655 className={treeCellGrid({
656 isDisabled,
657 isNextSelected: isNextSelected(id, state),
658 isSelected,
659 selectionStyle
660 })}>
661 <div
662 className={treeRowBackground({
663 isHovered,
664 isFocusVisible,
665 isSelected,
666 selectionStyle,
667 isNextSelected: isNextSelected(id, state),
668 isPreviousSelected: isPrevSelected(id, state),
669 isDropTarget
670 })}
671 />
672 {isFocusVisible && (
673 <div
674 className={treeRowFocusRing({
675 isFocusVisible,
676 selectionStyle,
677 isSelected,
678 isNextSelected: isNextSelected(id, state),
679 isFirstItem: isFirstItem(id, state)
680 })}
681 />
682 )}
683 {allowsDragging && (

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