( props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-ListBoxSection' )
| 444 | } |
| 445 | |
| 446 | function ListBoxSectionInner<T>( |
| 447 | props: ListBoxSectionProps<T>, |
| 448 | ref: ForwardedRef<HTMLElement>, |
| 449 | section: Node<T>, |
| 450 | className = 'react-aria-ListBoxSection' |
| 451 | ) { |
| 452 | let state = useContext(ListStateContext)!; |
| 453 | let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!; |
| 454 | let {CollectionBranch} = useContext(CollectionRendererContext); |
| 455 | let [headingRef, heading] = useSlot(); |
| 456 | let {headingProps, groupProps} = useListBoxSection({ |
| 457 | heading, |
| 458 | 'aria-label': props['aria-label'] ?? undefined |
| 459 | }); |
| 460 | let renderProps = useRenderProps({ |
| 461 | ...props, |
| 462 | id: undefined, |
| 463 | children: undefined, |
| 464 | defaultClassName: className, |
| 465 | values: undefined |
| 466 | }); |
| 467 | |
| 468 | let DOMProps = filterDOMProps(props as any, {global: true}); |
| 469 | delete DOMProps.id; |
| 470 | |
| 471 | return ( |
| 472 | <dom.section {...mergeProps(DOMProps, renderProps, groupProps)} ref={ref}> |
| 473 | <HeaderContext.Provider value={{...headingProps, ref: headingRef}}> |
| 474 | <CollectionBranch |
| 475 | collection={state.collection} |
| 476 | parent={section} |
| 477 | renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} |
| 478 | /> |
| 479 | </HeaderContext.Provider> |
| 480 | </dom.section> |
| 481 | ); |
| 482 | } |
| 483 | |
| 484 | /** |
| 485 | * A ListBoxSection represents a section within a ListBox. |
nothing calls this directly
no test coverage detected