@@ -23,14 +23,15 @@ import {useScrollBasedChunks} from './useScrollBasedChunks';
2323
2424import './PaginatedTable.scss' ;
2525
26- export interface PaginatedTableProps < T , F > {
26+ export interface PaginatedTableProps < EntityType , Filters , DataFieldType > {
2727 limit : number ;
2828 initialEntitiesCount ?: number ;
29- fetchData : FetchData < T , F > ;
30- filters ?: F ;
29+ fetchData : FetchData < EntityType , Filters , DataFieldType > ;
30+ filters ?: Filters ;
31+ dataFieldsRequired ?: DataFieldType [ ] ;
3132 tableName : string ;
32- columns : Column < T > [ ] ;
33- getRowClassName ?: GetRowClassName < T > ;
33+ columns : Column < EntityType > [ ] ;
34+ getRowClassName ?: GetRowClassName < EntityType > ;
3435 rowHeight ?: number ;
3536 parentRef ?: React . RefObject < HTMLElement > ;
3637 initialSortParams ?: SortParams ;
@@ -41,11 +42,12 @@ export interface PaginatedTableProps<T, F> {
4142 containerClassName ?: string ;
4243}
4344
44- export const PaginatedTable = < T , F > ( {
45+ export const PaginatedTable = < EntityType , Filters , DataFieldType > ( {
4546 limit,
4647 initialEntitiesCount,
4748 fetchData,
4849 filters,
50+ dataFieldsRequired,
4951 tableName,
5052 columns,
5153 getRowClassName,
@@ -57,7 +59,7 @@ export const PaginatedTable = <T, F>({
5759 renderErrorMessage,
5860 renderEmptyDataMessage,
5961 containerClassName,
60- } : PaginatedTableProps < T , F > ) => {
62+ } : PaginatedTableProps < EntityType , Filters , DataFieldType > ) => {
6163 const initialTotal = initialEntitiesCount || limit ;
6264 const initialFound = initialEntitiesCount || 0 ;
6365
@@ -108,7 +110,7 @@ export const PaginatedTable = <T, F>({
108110 const chunksCount = Math . ceil ( totalLength / limit ) ;
109111
110112 return getArray ( chunksCount ) . map ( ( value ) => (
111- < TableChunk < T , F >
113+ < TableChunk < EntityType , Filters , DataFieldType >
112114 key = { value }
113115 id = { value }
114116 limit = { limit }
@@ -117,6 +119,7 @@ export const PaginatedTable = <T, F>({
117119 columns = { columns }
118120 fetchData = { fetchData }
119121 filters = { filters }
122+ dataFieldsRequired = { dataFieldsRequired }
120123 tableName = { tableName }
121124 sortParams = { sortParams }
122125 getRowClassName = { getRowClassName }
0 commit comments