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 type parameter of getItemAriaLabel prop #39390

Merged
merged 3 commits into from
Oct 11, 2023
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/translations/api-docs/pagination/pagination.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"getItemAriaLabel": {
"description": "Accepts a function which returns a string value that provides a user-friendly name for the current page. This is important for screen reader users.<br>For localization purposes, you can use the provided <a href=\"/material-ui/guides/localization/\">translations</a>.",
"typeDescriptions": {
"type": "The link or button type to format (&#39;page&#39; | &#39;first&#39; | &#39;last&#39; | &#39;next&#39; | &#39;previous&#39;). Defaults to &#39;page&#39;.",
"type": "The link or button type to format (&#39;page&#39; | &#39;first&#39; | &#39;last&#39; | &#39;next&#39; | &#39;previous&#39; | &#39;start-ellipsis&#39; | &#39;end-ellipsis&#39;). Defaults to &#39;page&#39;.",
"page": "The page number to format.",
"selected": "If true, the current page is selected."
}
Expand Down
9 changes: 3 additions & 6 deletions packages/mui-material/src/Pagination/Pagination.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,13 @@ export interface PaginationProps
* This is important for screen reader users.
*
* 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'). Defaults to 'page'.
* @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.
* @returns {string}
*/
getItemAriaLabel?: (
type: 'page' | 'first' | 'last' | 'next' | 'previous',
page: number,
selected: boolean,
) => string;
getItemAriaLabel?: (type: UsePaginationItem['type'], page: number, selected: boolean) => string;

/**
* Render the item.
* @param {PaginationRenderItemParams} params The props to spread on a PaginationItem.
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Pagination/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Pagination.propTypes /* remove-proptypes */ = {
* This is important for screen reader users.
*
* 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'). Defaults to 'page'.
* @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.
* @returns {string}
Expand Down
Loading