Browse Source
fix: Table pagination position ts typo (#23681)
* fix: Table pagination postion ts typo
* fix
pull/23690/head
Tom Xu
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
17 additions and
18 deletions
-
components/pagination/Pagination.tsx
-
components/table/hooks/usePagination.ts
-
components/table/interface.tsx
|
|
@ -45,19 +45,10 @@ export interface PaginationProps { |
|
|
|
showLessItems?: boolean; |
|
|
|
} |
|
|
|
|
|
|
|
export type PaginationPosition = |
|
|
|
| 'top' |
|
|
|
| 'bottom' |
|
|
|
| 'both' |
|
|
|
| 'topLeft' |
|
|
|
| 'topCenter' |
|
|
|
| 'topRight' |
|
|
|
| 'bottomLeft' |
|
|
|
| 'bottomCenter' |
|
|
|
| 'bottomRight'; |
|
|
|
export type PaginationPosition = 'top' | 'bottom' | 'both'; |
|
|
|
|
|
|
|
export interface PaginationConfig extends PaginationProps { |
|
|
|
position?: PaginationPosition[] | PaginationPosition; |
|
|
|
position?: PaginationPosition; |
|
|
|
} |
|
|
|
|
|
|
|
export type PaginationLocale = any; |
|
|
@ -68,7 +59,7 @@ export default class Pagination extends React.Component<PaginationProps, {}> { |
|
|
|
private inferredSmall: boolean = false; |
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
this.token = ResponsiveObserve.subscribe((screens) => { |
|
|
|
this.token = ResponsiveObserve.subscribe(screens => { |
|
|
|
const { xs } = screens; |
|
|
|
const { size, responsive } = this.props; |
|
|
|
const inferredSmall = !!(xs && !size && responsive); |
|
|
|
|
|
@ -1,12 +1,12 @@ |
|
|
|
import { useState } from 'react'; |
|
|
|
import { PaginationProps, PaginationConfig } from '../../pagination'; |
|
|
|
import { PaginationProps } from '../../pagination'; |
|
|
|
import { TablePaginationConfig } from '../interface'; |
|
|
|
|
|
|
|
export const DEFAULT_PAGE_SIZE = 10; |
|
|
|
|
|
|
|
export function getPaginationParam( |
|
|
|
pagination: PaginationConfig | boolean | undefined, |
|
|
|
mergedPagination: PaginationConfig, |
|
|
|
pagination: TablePaginationConfig | boolean | undefined, |
|
|
|
mergedPagination: TablePaginationConfig, |
|
|
|
) { |
|
|
|
const param: any = { |
|
|
|
current: mergedPagination.current, |
|
|
|
|
|
@ -5,7 +5,7 @@ import { |
|
|
|
ExpandableConfig, |
|
|
|
} from 'rc-table/lib/interface'; |
|
|
|
import { CheckboxProps } from '../checkbox'; |
|
|
|
import { PaginationConfig } from '../pagination'; |
|
|
|
import { PaginationProps } from '../pagination'; |
|
|
|
import { INTERNAL_SELECTION_ITEM } from './hooks/useSelection'; |
|
|
|
|
|
|
|
export { GetRowKey, ExpandableConfig }; |
|
|
@ -161,6 +161,14 @@ export interface SorterResult<RecordType> { |
|
|
|
|
|
|
|
export type GetPopupContainer = (triggerNode: HTMLElement) => HTMLElement; |
|
|
|
|
|
|
|
export interface TablePaginationConfig extends PaginationConfig { |
|
|
|
// position?: 'top' | 'bottom' | 'both';
|
|
|
|
type TablePaginationPosition = |
|
|
|
| 'topLeft' |
|
|
|
| 'topCenter' |
|
|
|
| 'topRight' |
|
|
|
| 'bottomLeft' |
|
|
|
| 'bottomCenter' |
|
|
|
| 'bottomRight'; |
|
|
|
|
|
|
|
export interface TablePaginationConfig extends PaginationProps { |
|
|
|
position?: TablePaginationPosition[]; |
|
|
|
} |
|
|
|