({props, forwardedRef: ref, selectionState, collection}: TableInnerProps)
| 690 | }; |
| 691 | |
| 692 | function TableInner({props, forwardedRef: ref, selectionState, collection}: TableInnerProps) { |
| 693 | [props, ref] = useContextProps(props, ref, SelectableCollectionContext); |
| 694 | // eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 695 | let {shouldUseVirtualFocus, disallowTypeAhead, filter, ...DOMCollectionProps} = props; |
| 696 | let tableContainerContext = useContext(ResizableTableContainerContext); |
| 697 | ref = useObjectRef( |
| 698 | useMemo( |
| 699 | () => mergeRefs(ref, tableContainerContext?.tableRef), |
| 700 | [ref, tableContainerContext?.tableRef] |
| 701 | ) |
| 702 | ); |
| 703 | let [expandedKeys, setExpandedKeys] = useControlledState( |
| 704 | props.expandedKeys ? new Set(props.expandedKeys) : undefined, |
| 705 | props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : new Set(), |
| 706 | props.onExpandedChange |
| 707 | ); |
| 708 | collection = useMemo(() => collection.withExpandedKeys(expandedKeys), [collection, expandedKeys]); |
| 709 | |
| 710 | let tableState = useTableState({ |
| 711 | ...DOMCollectionProps, |
| 712 | collection, |
| 713 | children: undefined, |
| 714 | UNSAFE_selectionState: selectionState, |
| 715 | expandedKeys, |
| 716 | onExpandedChange: setExpandedKeys |
| 717 | }); |
| 718 | |
| 719 | let filteredState = UNSTABLE_useFilteredTableState(tableState, filter); |
| 720 | let { |
| 721 | isVirtualized, |
| 722 | layoutDelegate, |
| 723 | dropTargetDelegate: ctxDropTargetDelegate, |
| 724 | CollectionRoot |
| 725 | } = useContext(CollectionRendererContext); |
| 726 | let {dragAndDropHooks} = props; |
| 727 | let {gridProps} = useTable( |
| 728 | { |
| 729 | ...DOMCollectionProps, |
| 730 | layoutDelegate, |
| 731 | isVirtualized |
| 732 | }, |
| 733 | filteredState, |
| 734 | ref |
| 735 | ); |
| 736 | let selectionManager = filteredState.selectionManager; |
| 737 | let hasDragHooks = !!dragAndDropHooks?.useDraggableCollectionState; |
| 738 | let hasDropHooks = !!dragAndDropHooks?.useDroppableCollectionState; |
| 739 | let dragHooksProvided = useRef(hasDragHooks); |
| 740 | let dropHooksProvided = useRef(hasDropHooks); |
| 741 | useEffect(() => { |
| 742 | if (process.env.NODE_ENV === 'production') { |
| 743 | return; |
| 744 | } |
| 745 | if (dragHooksProvided.current !== hasDragHooks) { |
| 746 | console.warn( |
| 747 | 'Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.' |
| 748 | ); |
| 749 | } |
nothing calls this directly
no test coverage detected