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