({columns, children, ...otherProps}: TableHeaderProps<T>)
| 57 | } |
| 58 | |
| 59 | export function TableHeader<T>({columns, children, ...otherProps}: TableHeaderProps<T>) { |
| 60 | let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions(); |
| 61 | |
| 62 | return ( |
| 63 | <AriaTableHeader {...otherProps}> |
| 64 | {/* Add extra columns for drag and drop and selection. */} |
| 65 | {allowsDragging && ( |
| 66 | <AriaColumn |
| 67 | width={20} |
| 68 | minWidth={20} |
| 69 | style={{width: 20}} |
| 70 | className="react-aria-Column button-base" |
| 71 | /> |
| 72 | )} |
| 73 | {selectionBehavior === 'toggle' && ( |
| 74 | <AriaColumn |
| 75 | width={32} |
| 76 | minWidth={32} |
| 77 | style={{width: 32}} |
| 78 | className="react-aria-Column button-base"> |
| 79 | {selectionMode === 'multiple' && <Checkbox slot="selection" />} |
| 80 | </AriaColumn> |
| 81 | )} |
| 82 | <Collection items={columns}>{children}</Collection> |
| 83 | </AriaTableHeader> |
| 84 | ); |
| 85 | } |
| 86 | |
| 87 | export function Row<T>({id, columns, children, ...otherProps}: RowProps<T>) { |
| 88 | let {selectionBehavior, allowsDragging} = useTableOptions(); |
nothing calls this directly
no test coverage detected