-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TablePaginationActions types and tests
- Loading branch information
1 parent
0ca8948
commit 4486f2b
Showing
4 changed files
with
113 additions
and
37 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
packages/mui-base/src/TablePaginationUnstyled/TablePaginationActionsUnstyled.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as React from 'react'; | ||
import { TablePaginationActionsUnstyled } from '@mui/base/TablePaginationUnstyled'; | ||
import { | ||
TablePaginationActionsUnstyledButtonSlotProps, | ||
TablePaginationActionsUnstyledRootSlotProps, | ||
} from './TablePaginationActionsUnstyled.types'; | ||
|
||
function Root(props: TablePaginationActionsUnstyledRootSlotProps) { | ||
const { ownerState, ...other } = props; | ||
return <div data-rows-per-page={ownerState.rowsPerPage} {...other} />; | ||
} | ||
|
||
function Button(props: TablePaginationActionsUnstyledButtonSlotProps) { | ||
const { ownerState, ...other } = props; | ||
return <button type="button" data-rows-per-page={ownerState.rowsPerPage} {...other} />; | ||
} | ||
|
||
const styledTablePaginationActions = ( | ||
<TablePaginationActionsUnstyled | ||
components={{ | ||
Root, | ||
BackButton: Button, | ||
NextButton: Button, | ||
FirstButton: Button, | ||
LastButton: Button, | ||
}} | ||
count={10} | ||
getItemAriaLabel={() => ''} | ||
onPageChange={() => {}} | ||
page={0} | ||
rowsPerPage={10} | ||
showFirstButton | ||
showLastButton | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
export { default } from './TablePaginationUnstyled'; | ||
export * from './TablePaginationUnstyled.types'; | ||
|
||
export { default as TablePaginationActionsUnstyled } from './TablePaginationActionsUnstyled'; | ||
export type { TablePaginationActionsUnstyledProps } from './TablePaginationActionsUnstyled.types'; | ||
|
||
export { default as tablePaginationUnstyledClasses } from './tablePaginationUnstyledClasses'; | ||
export * from './tablePaginationUnstyledClasses'; |