@@ -278,7 +278,7 @@ export const ResizableTableContainer = forwardRef(function ResizableTableContain
278
278
) ;
279
279
} ) ;
280
280
281
- export const TableContext = createContext < ContextValue < TableProps , HTMLTableElement > > ( null ) ;
281
+ export const TableContext = createContext < ContextValue < TableProps , HTMLTableElement | HTMLDivElement > > ( null ) ;
282
282
export const TableStateContext = createContext < TableState < any > | null > ( null ) ;
283
283
export const TableColumnResizeStateContext = createContext < TableColumnResizeState < unknown > | null > ( null ) ;
284
284
@@ -327,7 +327,7 @@ export interface TableProps extends Omit<SharedTableProps<any>, 'children'>, Sty
327
327
* A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys,
328
328
* and optionally supports row selection and sorting.
329
329
*/
330
- export const Table = forwardRef ( function Table ( props : TableProps , ref : ForwardedRef < HTMLTableElement > ) {
330
+ export const Table = forwardRef ( function Table ( props : TableProps , ref : ForwardedRef < HTMLTableElement | HTMLDivElement > ) {
331
331
[ props , ref ] = useContextProps ( props , ref , TableContext ) ;
332
332
333
333
// Separate selection state so we have access to it from collection components via useTableOptions.
@@ -349,7 +349,7 @@ export const Table = forwardRef(function Table(props: TableProps, ref: Forwarded
349
349
350
350
return (
351
351
< CollectionBuilder content = { content } createCollection = { ( ) => new TableCollection < any > ( ) } >
352
- { collection => < TableInner props = { props } forwardedRef = { ref } selectionState = { selectionState } collection = { collection } /> }
352
+ { collection => < TableInner props = { props } forwardedRef = { ref as any } selectionState = { selectionState } collection = { collection } /> }
353
353
</ CollectionBuilder >
354
354
) ;
355
355
} ) ;
@@ -549,7 +549,7 @@ export interface TableHeaderProps<T> extends StyleRenderProps<TableHeaderRenderP
549
549
*/
550
550
export const TableHeader = /*#__PURE__*/ createBranchComponent (
551
551
'tableheader' ,
552
- < T extends object > ( props : TableHeaderProps < T > , ref : ForwardedRef < HTMLTableSectionElement > ) => {
552
+ < T extends object > ( props : TableHeaderProps < T > , ref : ForwardedRef < HTMLTableSectionElement | HTMLDivElement > ) => {
553
553
let collection = useContext ( TableStateContext ) ! . collection as TableCollection < unknown > ;
554
554
let headerRows = useCachedChildren ( {
555
555
items : collection . headerRows ,
@@ -584,7 +584,7 @@ export const TableHeader = /*#__PURE__*/ createBranchComponent(
584
584
< THead
585
585
{ ...mergeProps ( filterDOMProps ( props , { global : true } ) , rowGroupProps , hoverProps ) }
586
586
{ ...renderProps }
587
- ref = { ref }
587
+ ref = { ref as any }
588
588
data-hovered = { isHovered || undefined } >
589
589
{ headerRows }
590
590
</ THead >
@@ -684,8 +684,8 @@ export interface ColumnProps extends RenderProps<ColumnRenderProps>, GlobalDOMAt
684
684
/**
685
685
* A column within a `<Table>`.
686
686
*/
687
- export const Column = /*#__PURE__*/ createLeafComponent ( 'column' , ( props : ColumnProps , forwardedRef : ForwardedRef < HTMLTableCellElement > , column : GridNode < unknown > ) => {
688
- let ref = useObjectRef < HTMLTableHeaderCellElement > ( forwardedRef ) ;
687
+ export const Column = /*#__PURE__*/ createLeafComponent ( 'column' , ( props : ColumnProps , forwardedRef : ForwardedRef < HTMLTableCellElement | HTMLDivElement > , column : GridNode < unknown > ) => {
688
+ let ref = useObjectRef < HTMLTableCellElement | HTMLDivElement > ( forwardedRef ) ;
689
689
let state = useContext ( TableStateContext ) ! ;
690
690
let { isVirtualized} = useContext ( CollectionRendererContext ) ;
691
691
let { columnHeaderProps} = useTableColumnHeader (
@@ -750,7 +750,7 @@ export const Column = /*#__PURE__*/ createLeafComponent('column', (props: Column
750
750
{ ...mergeProps ( DOMProps , columnHeaderProps , focusProps , hoverProps ) }
751
751
{ ...renderProps }
752
752
style = { style }
753
- ref = { ref }
753
+ ref = { ref as any }
754
754
data-hovered = { isHovered || undefined }
755
755
data-focused = { isFocused || undefined }
756
756
data-focus-visible = { isFocusVisible || undefined }
@@ -919,7 +919,7 @@ export interface TableBodyProps<T> extends Omit<CollectionProps<T>, 'disabledKey
919
919
/**
920
920
* The body of a `<Table>`, containing the table rows.
921
921
*/
922
- export const TableBody = /*#__PURE__*/ createBranchComponent ( 'tablebody' , < T extends object > ( props : TableBodyProps < T > , ref : ForwardedRef < HTMLTableSectionElement > ) => {
922
+ export const TableBody = /*#__PURE__*/ createBranchComponent ( 'tablebody' , < T extends object > ( props : TableBodyProps < T > , ref : ForwardedRef < HTMLTableSectionElement | HTMLDivElement > ) => {
923
923
let state = useContext ( TableStateContext ) ! ;
924
924
let { isVirtualized} = useContext ( CollectionRendererContext ) ;
925
925
let collection = state . collection ;
@@ -976,7 +976,7 @@ export const TableBody = /*#__PURE__*/ createBranchComponent('tablebody', <T ext
976
976
return (
977
977
< TBody
978
978
{ ...mergeProps ( DOMProps , renderProps , rowGroupProps ) }
979
- ref = { ref }
979
+ ref = { ref as any }
980
980
data-empty = { isEmpty || undefined } >
981
981
{ isDroppable && < RootDropIndicator /> }
982
982
< CollectionBranch
@@ -1022,8 +1022,8 @@ export interface RowProps<T> extends StyleRenderProps<RowRenderProps>, LinkDOMPr
1022
1022
*/
1023
1023
export const Row = /*#__PURE__*/ createBranchComponent (
1024
1024
'item' ,
1025
- < T extends object > ( props : RowProps < T > , forwardedRef : ForwardedRef < HTMLTableRowElement > , item : GridNode < T > ) => {
1026
- let ref = useObjectRef < HTMLTableRowElement > ( forwardedRef ) ;
1025
+ < T extends object > ( props : RowProps < T > , forwardedRef : ForwardedRef < HTMLTableRowElement | HTMLDivElement > , item : GridNode < T > ) => {
1026
+ let ref = useObjectRef < HTMLTableRowElement | HTMLDivElement > ( forwardedRef ) ;
1027
1027
let state = useContext ( TableStateContext ) ! ;
1028
1028
let { dragAndDropHooks, dragState, dropState} = useContext ( DragAndDropContext ) ;
1029
1029
let { isVirtualized, CollectionBranch} = useContext ( CollectionRendererContext ) ;
@@ -1113,7 +1113,7 @@ export const Row = /*#__PURE__*/ createBranchComponent(
1113
1113
) }
1114
1114
< TR
1115
1115
{ ...mergeProps ( DOMProps , renderProps , rowProps , focusProps , hoverProps , draggableItem ?. dragProps , focusWithinProps ) }
1116
- ref = { ref }
1116
+ ref = { ref as any }
1117
1117
data-disabled = { states . isDisabled || undefined }
1118
1118
data-selected = { states . isSelected || undefined }
1119
1119
data-hovered = { isHovered || undefined }
@@ -1204,8 +1204,8 @@ export interface CellProps extends RenderProps<CellRenderProps>, GlobalDOMAttrib
1204
1204
/**
1205
1205
* A cell within a table row.
1206
1206
*/
1207
- export const Cell = /*#__PURE__*/ createLeafComponent ( 'cell' , ( props : CellProps , forwardedRef : ForwardedRef < HTMLTableCellElement > , cell : GridNode < unknown > ) => {
1208
- let ref = useObjectRef < HTMLTableCellElement > ( forwardedRef ) ;
1207
+ export const Cell = /*#__PURE__*/ createLeafComponent ( 'cell' , ( props : CellProps , forwardedRef : ForwardedRef < HTMLTableCellElement | HTMLDivElement > , cell : GridNode < unknown > ) => {
1208
+ let ref = useObjectRef < HTMLTableCellElement | HTMLDivElement > ( forwardedRef ) ;
1209
1209
let state = useContext ( TableStateContext ) ! ;
1210
1210
let { dragState} = useContext ( DragAndDropContext ) ;
1211
1211
let { isVirtualized} = useContext ( CollectionRendererContext ) ;
@@ -1240,7 +1240,7 @@ export const Cell = /*#__PURE__*/ createLeafComponent('cell', (props: CellProps,
1240
1240
return (
1241
1241
< TD
1242
1242
{ ...mergeProps ( DOMProps , renderProps , gridCellProps , focusProps , hoverProps ) }
1243
- ref = { ref }
1243
+ ref = { ref as any }
1244
1244
data-focused = { isFocused || undefined }
1245
1245
data-focus-visible = { isFocusVisible || undefined }
1246
1246
data-pressed = { isPressed || undefined } >
@@ -1411,7 +1411,7 @@ export const TableLoadMoreItem = createLeafComponent('loader', function TableLoa
1411
1411
{ ...mergeProps ( filterDOMProps ( props , { global : true } ) , rowProps ) }
1412
1412
{ ...renderProps }
1413
1413
role = "row"
1414
- ref = { ref } >
1414
+ ref = { ref as any } >
1415
1415
< TD role = "rowheader" { ...rowHeaderProps } style = { style } >
1416
1416
{ renderProps . children }
1417
1417
</ TD >
0 commit comments