(props: TreeViewItemContentProps)
| 624 | } |
| 625 | |
| 626 | export 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 && ( |
nothing calls this directly
no test coverage detected