Skip to content

[material-ui][TablePaginationActions] export TablePaginationActions as new component #46149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
May 19, 2025

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented May 15, 2025

closes #46140

Api docs: https://deploy-preview-46149--material-ui.netlify.app/material-ui/api/table-pagination-actions/

Now users can do import {TablePaginationActionsProps} from @mui/material/TablePaginationAction, proof: https://stackblitz.com/edit/ueff8vmm?file=src%2FDemo.tsx

@sai6855 sai6855 added new feature New feature or request docs Improvements or additions to the documentation package: material-ui Specific to @mui/material component: TablePagination The React component. labels May 15, 2025
@sai6855 sai6855 changed the title [material-ui][TablePaginationActions] export TablePagination Actions as new component [material-ui][TablePaginationActions] export TablePaginationActions as new component May 15, 2025
@mui-bot
Copy link

mui-bot commented May 15, 2025

Netlify deploy preview

@mui/material/TablePaginationActions: parsed: +Infinity% , gzip: +Infinity%
@mui/material: parsed: +0.07% , gzip: +0.04%
@mui/material/TablePagination: parsed: +0.18% , gzip: +0.09%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 9ab211d

@sai6855 sai6855 marked this pull request as draft May 15, 2025 07:26
@sai6855 sai6855 requested a review from siriwatknp May 15, 2025 10:13
@sai6855 sai6855 marked this pull request as ready for review May 15, 2025 10:13
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sai6855 Well done.

My last request, can you turn the root div in TablePaginationActions to a styled component, so that it is themable? It's for consistency with other components

const Root = styled('div', {
  name: 'MuiTablePaginationActions',
  slot: 'Root',
})

Also, need to update several files related to theme components types.

Copy link
Contributor Author

@sai6855 sai6855 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siriwatknp converted component to styled component and added component to theme files wherever applicable. This PR is ready for review now

classes,
muiName: 'MuiTablePaginationActions',
refInstanceof: window.HTMLDivElement,
skip: ['componentsProp', 'componentProp', 'themeVariants'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed classesRoot, themeDefaultProps, and themeStyleOverrides. This test serves as proof that applying the root class and setting props from the theme are working correctly.

{
createTheme({
components: {
MuiTablePaginationActions: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts test for presence of MuiTablePaginationActions in theme

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good. push a commit for updating the upgrade-to-v7 guide.

@siriwatknp siriwatknp merged commit 6bf0fbe into mui:master May 19, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: TablePagination The React component. docs Improvements or additions to the documentation new feature New feature or request package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TablePaginationActionsProps] Import type no longer available
3 participants