Skip to content

Commit

Permalink
[material-ui][Pagination] Update getItemAriaLabel page param type (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sydneyjodon-wk authored Aug 23, 2024
1 parent 7b72eb3 commit 9f4b846
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
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

0 comments on commit 9f4b846

Please sign in to comment.