@@ -20,6 +20,7 @@ import {
20
20
Table ,
21
21
TableCellProps ,
22
22
TableCellRenderer ,
23
+ TableProps ,
23
24
} from 'react-virtualized'
24
25
import { ColumnSetting , ContentListBaseProps } from './content-list-base-props'
25
26
import { ActionsCell , DateCell , ReferenceCell , RowCheckbox , VirtualDefaultCell , VirtualDisplayNameCell } from '.'
@@ -77,6 +78,39 @@ interface ExtendedGenericContent extends GenericContent {
77
78
ColumnSettings ?: string
78
79
}
79
80
81
+ interface snTableProps extends Partial < TableProps > {
82
+ /**
83
+ * Number of rows in table.
84
+ */
85
+ rowCount : number
86
+ /**
87
+ * Callback responsible for returning a data row given an index.
88
+ * ({ index: number }): any
89
+ */
90
+ rowHeight : number | ( ( params : Index ) => number )
91
+ /** Fixed height of header row */
92
+ headerHeight : number
93
+ /**
94
+ * Callback responsible for returning a data row given an index.
95
+ * ({ index: number }): any
96
+ */
97
+ rowGetter : ( info : Index ) => any
98
+ /**
99
+ * Callback invoked when a user clicks on a table row.
100
+ * ({ index: number }): void
101
+ */
102
+ onRowClick ?: ( info : RowMouseEventHandlerParams ) => void
103
+ /**
104
+ * Callback invoked when a user double-clicks on a table row.
105
+ * ({ index: number }): void
106
+ */
107
+ onRowDoubleClick ?: ( info : RowMouseEventHandlerParams ) => void
108
+ /**
109
+ * Disable rendering the header at all
110
+ */
111
+ disableHeader ?: boolean
112
+ }
113
+
80
114
interface VirtualizedTableProps < T extends GenericContent > extends ContentListBaseProps < T > {
81
115
/**
82
116
* Contains custom cell template components
@@ -94,43 +128,7 @@ interface VirtualizedTableProps<T extends GenericContent> extends ContentListBas
94
128
95
129
handleColumnSettingsClick ?: ( ) => void
96
130
97
- tableProps : {
98
- autoHeight ?: boolean
99
-
100
- containerStyle ?: React . CSSProperties
101
-
102
-
103
- /**
104
- * Number of rows in table.
105
- */
106
- rowCount : number
107
- /**
108
- * Callback responsible for returning a data row given an index.
109
- * ({ index: number }): any
110
- */
111
- rowHeight : number | ( ( params : Index ) => number )
112
- /** Fixed height of header row */
113
- headerHeight : number
114
- /**
115
- * Callback responsible for returning a data row given an index.
116
- * ({ index: number }): any
117
- */
118
- rowGetter : ( info : Index ) => any
119
- /**
120
- * Callback invoked when a user clicks on a table row.
121
- * ({ index: number }): void
122
- */
123
- onRowClick ?: ( info : RowMouseEventHandlerParams ) => void
124
- /**
125
- * Callback invoked when a user double-clicks on a table row.
126
- * ({ index: number }): void
127
- */
128
- onRowDoubleClick ?: ( info : RowMouseEventHandlerParams ) => void
129
- /**
130
- * Disable rendering the header at all
131
- */
132
- disableHeader ?: boolean
133
- }
131
+ tableProps : snTableProps
134
132
}
135
133
136
134
const minColumnWith = ( field : keyof ExtendedGenericContent ) => {
@@ -386,14 +384,14 @@ export const VirtualizedTable = <T extends GenericContent = GenericContent>(prop
386
384
{ ( { height, width } ) => (
387
385
< >
388
386
< Table
387
+ { ...tableProps }
389
388
className = { classes . root }
390
389
height = { height }
391
390
width = { width }
392
391
gridStyle = { {
393
392
direction : 'inherit' ,
394
393
outline : 'none' ,
395
394
} }
396
- { ...tableProps }
397
395
rowClassName = { getRowClassName } >
398
396
{ currentFieldsToDisplay . map ( ( field ) => {
399
397
const currentField = field . field
0 commit comments