@@ -278,7 +278,7 @@ export const ResizableTableContainer = forwardRef(function ResizableTableContain
278278 ) ;
279279} ) ;
280280
281- export const TableContext = createContext < ContextValue < TableProps , HTMLTableElement > > ( null ) ;
281+ export const TableContext = createContext < ContextValue < TableProps , HTMLTableElement | HTMLDivElement > > ( null ) ;
282282export const TableStateContext = createContext < TableState < any > | null > ( null ) ;
283283export const TableColumnResizeStateContext = createContext < TableColumnResizeState < unknown > | null > ( null ) ;
284284
@@ -327,7 +327,7 @@ export interface TableProps extends Omit<SharedTableProps<any>, 'children'>, Sty
327327 * A table displays data in rows and columns and enables a user to navigate its contents via directional navigation keys,
328328 * and optionally supports row selection and sorting.
329329 */
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 > ) {
331331 [ props , ref ] = useContextProps ( props , ref , TableContext ) ;
332332
333333 // 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
349349
350350 return (
351351 < 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 } /> }
353353 </ CollectionBuilder >
354354 ) ;
355355} ) ;
@@ -549,7 +549,7 @@ export interface TableHeaderProps<T> extends StyleRenderProps<TableHeaderRenderP
549549 */
550550export const TableHeader = /*#__PURE__*/ createBranchComponent (
551551 'tableheader' ,
552- < T extends object > ( props : TableHeaderProps < T > , ref : ForwardedRef < HTMLTableSectionElement > ) => {
552+ < T extends object > ( props : TableHeaderProps < T > , ref : ForwardedRef < HTMLTableSectionElement | HTMLDivElement > ) => {
553553 let collection = useContext ( TableStateContext ) ! . collection as TableCollection < unknown > ;
554554 let headerRows = useCachedChildren ( {
555555 items : collection . headerRows ,
@@ -584,7 +584,7 @@ export const TableHeader = /*#__PURE__*/ createBranchComponent(
584584 < THead
585585 { ...mergeProps ( filterDOMProps ( props , { global : true } ) , rowGroupProps , hoverProps ) }
586586 { ...renderProps }
587- ref = { ref }
587+ ref = { ref as any }
588588 data-hovered = { isHovered || undefined } >
589589 { headerRows }
590590 </ THead >
@@ -684,8 +684,8 @@ export interface ColumnProps extends RenderProps<ColumnRenderProps>, GlobalDOMAt
684684/**
685685 * A column within a `<Table>`.
686686 */
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 ) ;
689689 let state = useContext ( TableStateContext ) ! ;
690690 let { isVirtualized} = useContext ( CollectionRendererContext ) ;
691691 let { columnHeaderProps} = useTableColumnHeader (
@@ -750,7 +750,7 @@ export const Column = /*#__PURE__*/ createLeafComponent('column', (props: Column
750750 { ...mergeProps ( DOMProps , columnHeaderProps , focusProps , hoverProps ) }
751751 { ...renderProps }
752752 style = { style }
753- ref = { ref }
753+ ref = { ref as any }
754754 data-hovered = { isHovered || undefined }
755755 data-focused = { isFocused || undefined }
756756 data-focus-visible = { isFocusVisible || undefined }
@@ -919,7 +919,7 @@ export interface TableBodyProps<T> extends Omit<CollectionProps<T>, 'disabledKey
919919/**
920920 * The body of a `<Table>`, containing the table rows.
921921 */
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 > ) => {
923923 let state = useContext ( TableStateContext ) ! ;
924924 let { isVirtualized} = useContext ( CollectionRendererContext ) ;
925925 let collection = state . collection ;
@@ -976,7 +976,7 @@ export const TableBody = /*#__PURE__*/ createBranchComponent('tablebody', <T ext
976976 return (
977977 < TBody
978978 { ...mergeProps ( DOMProps , renderProps , rowGroupProps ) }
979- ref = { ref }
979+ ref = { ref as any }
980980 data-empty = { isEmpty || undefined } >
981981 { isDroppable && < RootDropIndicator /> }
982982 < CollectionBranch
@@ -1022,8 +1022,8 @@ export interface RowProps<T> extends StyleRenderProps<RowRenderProps>, LinkDOMPr
10221022 */
10231023export const Row = /*#__PURE__*/ createBranchComponent (
10241024 '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 ) ;
10271027 let state = useContext ( TableStateContext ) ! ;
10281028 let { dragAndDropHooks, dragState, dropState} = useContext ( DragAndDropContext ) ;
10291029 let { isVirtualized, CollectionBranch} = useContext ( CollectionRendererContext ) ;
@@ -1113,7 +1113,7 @@ export const Row = /*#__PURE__*/ createBranchComponent(
11131113 ) }
11141114 < TR
11151115 { ...mergeProps ( DOMProps , renderProps , rowProps , focusProps , hoverProps , draggableItem ?. dragProps , focusWithinProps ) }
1116- ref = { ref }
1116+ ref = { ref as any }
11171117 data-disabled = { states . isDisabled || undefined }
11181118 data-selected = { states . isSelected || undefined }
11191119 data-hovered = { isHovered || undefined }
@@ -1204,8 +1204,8 @@ export interface CellProps extends RenderProps<CellRenderProps>, GlobalDOMAttrib
12041204/**
12051205 * A cell within a table row.
12061206 */
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 ) ;
12091209 let state = useContext ( TableStateContext ) ! ;
12101210 let { dragState} = useContext ( DragAndDropContext ) ;
12111211 let { isVirtualized} = useContext ( CollectionRendererContext ) ;
@@ -1240,7 +1240,7 @@ export const Cell = /*#__PURE__*/ createLeafComponent('cell', (props: CellProps,
12401240 return (
12411241 < TD
12421242 { ...mergeProps ( DOMProps , renderProps , gridCellProps , focusProps , hoverProps ) }
1243- ref = { ref }
1243+ ref = { ref as any }
12441244 data-focused = { isFocused || undefined }
12451245 data-focus-visible = { isFocusVisible || undefined }
12461246 data-pressed = { isPressed || undefined } >
@@ -1411,7 +1411,7 @@ export const TableLoadMoreItem = createLeafComponent('loader', function TableLoa
14111411 { ...mergeProps ( filterDOMProps ( props , { global : true } ) , rowProps ) }
14121412 { ...renderProps }
14131413 role = "row"
1414- ref = { ref } >
1414+ ref = { ref as any } >
14151415 < TD role = "rowheader" { ...rowHeaderProps } style = { style } >
14161416 { renderProps . children }
14171417 </ TD >
0 commit comments