Skip to content
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

[TablePaginationUnstyled] Define ownerState and slot props' types #32905

Merged

Conversation

michaldudak
Copy link
Member

Defined types for TablePaginationUnstyledownerState and its slots.
Also renamed types and files according to #31415

@michaldudak michaldudak added typescript package: base-ui Specific to @mui/base component: TablePagination The React component. labels May 25, 2022
@michaldudak michaldudak requested a review from mnajdova May 25, 2022 15:14
@mui-bot
Copy link

mui-bot commented May 25, 2022

Details of bundle changes

Generated by 🚫 dangerJS against 4486f2b

},
"name": null
},
"styles": { "classes": [], "globalClasses": {}, "name": null },
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to find a new way of how to document the global classes for the unstyled components?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, since the unstyled components don't have the classes prop, we'll have to figure out something else. Perhaps the solution will appear when we allow customizing/disabling the default classes.

return <div data-rows-per-page={ownerState.rowsPerPage} {...other} />;
}

function Button(props: TablePaginationActionsUnstyledButtonSlotProps) {
Copy link
Member

Choose a reason for hiding this comment

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

This is a long name 😅

<NextButton
onClick={handleNextButtonClick}
disabled={count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false}
color="inherit"
Copy link
Member

Choose a reason for hiding this comment

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

Oops nice catch :)

@michaldudak michaldudak merged commit e81d6ee into mui:master Jun 3, 2022
@michaldudak michaldudak deleted the ownerstate-types/table-pagination branch June 3, 2022 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: TablePagination The React component. package: base-ui Specific to @mui/base typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants