File tree 1 file changed +15
-5
lines changed
packages/main/src/components/AnalyticalTable 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ export interface ColumnConfiguration {
22
22
vAlign ?: VerticalAlign ;
23
23
canResize ?: boolean ;
24
24
minWidth ?: number ;
25
-
26
25
[ key : string ] : any ;
27
26
}
28
27
@@ -65,6 +64,11 @@ export interface TableProps extends CommonProps {
65
64
noDataText ?: string ;
66
65
stickyHeader ?: boolean ;
67
66
onSort ?: ( e ?: Event ) => void ;
67
+ /**
68
+ * additional options which will be passed to [react-table´s useTable hook](https://github.com/tannerlinsley/react-table/blob/master/docs/api.md#table-options)
69
+ */
70
+ reactTableOptions ?: object ;
71
+ tableHooks ?: Array < ( ) => any > ;
68
72
}
69
73
70
74
const useStyles = createUseStyles < JSSTheme , keyof ReturnType < typeof styles > > ( styles ) ;
@@ -100,7 +104,9 @@ export const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, re
100
104
selectable,
101
105
onRowSelected,
102
106
stickyHeader,
103
- onSort
107
+ onSort,
108
+ reactTableOptions,
109
+ tableHooks
104
110
} = props ;
105
111
106
112
const [ selectedRow , setSelectedRow ] = useState ( null ) ;
@@ -188,13 +194,15 @@ export const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, re
188
194
columns,
189
195
data,
190
196
defaultColumn,
191
- state : tableState
197
+ state : tableState ,
198
+ ...reactTableOptions
192
199
} ,
193
200
useFilters ,
194
201
useGroupBy ,
195
202
useSortBy ,
196
203
useExpanded ,
197
- useTableStyling
204
+ useTableStyling ,
205
+ ...tableHooks
198
206
) ;
199
207
200
208
const minimumRows = useMemo ( ( ) => {
@@ -333,5 +341,7 @@ AnalyticalTable.defaultProps = {
333
341
pivotBy : [ ] ,
334
342
NoDataComponent : DefaultNoDataComponent ,
335
343
noDataText : 'No Data' ,
336
- stickyHeader : true
344
+ stickyHeader : true ,
345
+ reactTableOptions : { } ,
346
+ tableHooks : [ ]
337
347
} ;
You can’t perform that action at this time.
0 commit comments