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