diff --git a/src/components/Table/EditableTable.jsx b/src/components/Table/EditableTable.jsx index 9bdc333..568309a 100644 --- a/src/components/Table/EditableTable.jsx +++ b/src/components/Table/EditableTable.jsx @@ -5,7 +5,7 @@ import { EditableCell } from './EditableCell' const newRowKeyValue = 'newRow' -const tryAddKeys = (items) => { +export const tryAddKeys = (items) => { if(!items?.length || !items[0]) return [] if(items[0].key) diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index e726d2e..2d8f0a4 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -1,7 +1,8 @@ import { ReactNode } from 'react' +import { Table as RawTable } from 'antd' +import { tryAddKeys } from './EditableTable' import { makeNumericSorter, makeStringSorter} from './sorters' export { makeDateSorter, makeNumericSorter, makeStringSorter} from './sorters' -export { Table } from 'antd' export { EditableTable } from './EditableTable' export { DatePickerWrapper } from './DatePickerWrapper' export { SelectFromDictionary } from './SelectFromDictionary' @@ -186,3 +187,12 @@ export const makePaginationObject = (paginationContainer:PaginationContainer, .. current: page, } } + +interface TableContainer { + dataSource: any[]; + children?: any; +} + +export const Table = ({dataSource, children, ...other}: TableContainer) => { + return {children} +}