( props: AriaTableCellProps, state: TableState<T>, ref: RefObject<FocusableElement | null> )
| 50 | * @param ref - The ref attached to the cell element. |
| 51 | */ |
| 52 | export function useTableCell<T>( |
| 53 | props: AriaTableCellProps, |
| 54 | state: TableState<T>, |
| 55 | ref: RefObject<FocusableElement | null> |
| 56 | ): TableCellAria { |
| 57 | let {gridCellProps, isPressed} = useGridCell(props, state, ref); |
| 58 | let columnKey = props.node.column?.key; |
| 59 | if (columnKey != null && state.collection.rowHeaderColumnKeys.has(columnKey)) { |
| 60 | gridCellProps.role = 'rowheader'; |
| 61 | gridCellProps.id = getCellId(state, props.node.parentKey!, columnKey); |
| 62 | } |
| 63 | |
| 64 | return { |
| 65 | gridCellProps, |
| 66 | isPressed |
| 67 | }; |
| 68 | } |
no test coverage detected