({state: inputState, props, listBoxRef}: ListBoxInnerProps<T>)
| 237 | } |
| 238 | |
| 239 | function ListBoxInner<T>({state: inputState, props, listBoxRef}: ListBoxInnerProps<T>) { |
| 240 | [props, listBoxRef] = useContextProps(props, listBoxRef, SelectableCollectionContext); |
| 241 | let {dragAndDropHooks, layout = 'stack', orientation = 'vertical', filter} = props; |
| 242 | let state = UNSTABLE_useFilteredListState(inputState, filter); |
| 243 | let {collection, selectionManager} = state; |
| 244 | let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState; |
| 245 | let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState; |
| 246 | let {direction} = useLocale(); |
| 247 | let {disabledBehavior, disabledKeys} = selectionManager; |
| 248 | let collator = useCollator({usage: 'search', sensitivity: 'base'}); |
| 249 | let { |
| 250 | isVirtualized, |
| 251 | layoutDelegate, |
| 252 | dropTargetDelegate: ctxDropTargetDelegate, |
| 253 | CollectionRoot |
| 254 | } = useContext(CollectionRendererContext); |
| 255 | let keyboardDelegate = useMemo( |
| 256 | () => |
| 257 | props.keyboardDelegate || |
| 258 | new ListKeyboardDelegate({ |
| 259 | collection, |
| 260 | collator, |
| 261 | ref: listBoxRef, |
| 262 | disabledKeys, |
| 263 | disabledBehavior, |
| 264 | layout, |
| 265 | orientation, |
| 266 | direction, |
| 267 | layoutDelegate |
| 268 | }), |
| 269 | [ |
| 270 | collection, |
| 271 | collator, |
| 272 | listBoxRef, |
| 273 | disabledBehavior, |
| 274 | disabledKeys, |
| 275 | orientation, |
| 276 | direction, |
| 277 | props.keyboardDelegate, |
| 278 | layout, |
| 279 | layoutDelegate |
| 280 | ] |
| 281 | ); |
| 282 | |
| 283 | let {listBoxProps} = useListBox( |
| 284 | { |
| 285 | ...props, |
| 286 | shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp, |
| 287 | keyboardDelegate, |
| 288 | isVirtualized |
| 289 | }, |
| 290 | state, |
| 291 | listBoxRef |
| 292 | ); |
| 293 | |
| 294 | let dragHooksProvided = useRef(isListDraggable); |
| 295 | let dropHooksProvided = useRef(isListDroppable); |
| 296 | useEffect(() => { |
nothing calls this directly
no test coverage detected