|
@ -148,9 +148,11 @@ function Table<RecordType extends object = any>(props: TableProps<RecordType>) { |
|
|
const tableProps = omit(props, ['className', 'style', 'columns']) as TableProps<RecordType>; |
|
|
const tableProps = omit(props, ['className', 'style', 'columns']) as TableProps<RecordType>; |
|
|
|
|
|
|
|
|
const size = React.useContext(SizeContext); |
|
|
const size = React.useContext(SizeContext); |
|
|
const { locale: contextLocale = defaultLocale, renderEmpty, direction } = React.useContext( |
|
|
const { |
|
|
ConfigContext, |
|
|
locale: contextLocale = defaultLocale, |
|
|
); |
|
|
renderEmpty, |
|
|
|
|
|
direction, |
|
|
|
|
|
} = React.useContext(ConfigContext); |
|
|
const mergedSize = customizeSize || size; |
|
|
const mergedSize = customizeSize || size; |
|
|
const tableLocale = { ...contextLocale.Table, ...locale } as TableLocale; |
|
|
const tableLocale = { ...contextLocale.Table, ...locale } as TableLocale; |
|
|
const rawData: readonly RecordType[] = dataSource || EMPTY_LIST; |
|
|
const rawData: readonly RecordType[] = dataSource || EMPTY_LIST; |
|
@ -263,10 +265,10 @@ function Table<RecordType extends object = any>(props: TableProps<RecordType>) { |
|
|
tableLocale, |
|
|
tableLocale, |
|
|
showSorterTooltip, |
|
|
showSorterTooltip, |
|
|
}); |
|
|
}); |
|
|
const sortedData = React.useMemo(() => getSortData(rawData, sortStates, childrenColumnName), [ |
|
|
const sortedData = React.useMemo( |
|
|
rawData, |
|
|
() => getSortData(rawData, sortStates, childrenColumnName), |
|
|
sortStates, |
|
|
[rawData, sortStates], |
|
|
]); |
|
|
); |
|
|
|
|
|
|
|
|
changeEventInfo.sorter = getSorters(); |
|
|
changeEventInfo.sorter = getSorters(); |
|
|
changeEventInfo.sorterStates = sortStates; |
|
|
changeEventInfo.sorterStates = sortStates; |
|
@ -432,8 +434,11 @@ function Table<RecordType extends object = any>(props: TableProps<RecordType>) { |
|
|
|
|
|
|
|
|
const renderPagination = (position: string) => ( |
|
|
const renderPagination = (position: string) => ( |
|
|
<Pagination |
|
|
<Pagination |
|
|
className={`${prefixCls}-pagination ${prefixCls}-pagination-${position}`} |
|
|
|
|
|
{...mergedPagination} |
|
|
{...mergedPagination} |
|
|
|
|
|
className={classNames( |
|
|
|
|
|
`${prefixCls}-pagination ${prefixCls}-pagination-${position}`, |
|
|
|
|
|
mergedPagination.className, |
|
|
|
|
|
)} |
|
|
size={paginationSize} |
|
|
size={paginationSize} |
|
|
/> |
|
|
/> |
|
|
); |
|
|
); |
|
|