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

[material-ui][Pagination] Update getItemAriaLabel page param type #43399

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/material-ui/api/pagination.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"getItemAriaLabel": {
"type": { "name": "func" },
"signature": {
"type": "function(type: string, page: number, selected: bool) => string",
"type": "function(type: string, page: number | null, selected: boolean) => string",
"describedArgs": ["type", "page", "selected"]
}
},
Expand Down
10 changes: 7 additions & 3 deletions packages/mui-material/src/Pagination/Pagination.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ export interface PaginationProps
*
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
* @param {string} type The link or button type to format ('page' | 'first' | 'last' | 'next' | 'previous' | 'start-ellipsis' | 'end-ellipsis'). Defaults to 'page'.
* @param {number} page The page number to format.
* @param {bool} selected If true, the current page is selected.
* @param {number | null} page The page number to format.
* @param {boolean} selected If true, the current page is selected.
* @returns {string}
*/
getItemAriaLabel?: (type: UsePaginationItem['type'], page: number, selected: boolean) => string;
getItemAriaLabel?: (
type: UsePaginationItem['type'],
page: UsePaginationItem['page'],
selected: UsePaginationItem['selected'],
) => string;

/**
* Render the item.
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material/src/Pagination/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ Pagination.propTypes /* remove-proptypes */ = {
*
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
* @param {string} type The link or button type to format ('page' | 'first' | 'last' | 'next' | 'previous' | 'start-ellipsis' | 'end-ellipsis'). Defaults to 'page'.
* @param {number} page The page number to format.
* @param {bool} selected If true, the current page is selected.
* @param {number | null} page The page number to format.
* @param {boolean} selected If true, the current page is selected.
* @returns {string}
*/
getItemAriaLabel: PropTypes.func,
Expand Down