forked from ddrilling/asb_cloud_front
Улучшена типизация компонента Table
This commit is contained in:
parent
89835f7f00
commit
41515fdb7e
@ -13,7 +13,7 @@ import '@styles/index.css'
|
||||
export type BaseTableColumn<T> = ColumnGroupType<T> | ColumnType<T>
|
||||
export type TableColumns<T> = OmitExtends<BaseTableColumn<T>, TableColumnSettings>[]
|
||||
|
||||
export type TableContainer<T> = TableProps<T> & {
|
||||
export type TableContainer<T> = Omit<TableProps<T>, 'columns'> & {
|
||||
columns: TableColumns<T>
|
||||
tableName?: string
|
||||
showSettingsChanger?: boolean
|
||||
@ -45,9 +45,9 @@ const _Table = <T extends object>({ columns, dataSource, tableName, showSettings
|
||||
}), [settings, columns, onSettingsChanged, showSettingsChanger, tableName])
|
||||
|
||||
return (
|
||||
<RawTable
|
||||
<RawTable<T>
|
||||
columns={newColumns}
|
||||
dataSource={tryAddKeys(dataSource)}
|
||||
dataSource={tryAddKeys<T>(dataSource as any)}
|
||||
{...other}
|
||||
/>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user