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