From 9f4b846be96ee18733b6bd77eba2f54b1ceb9b04 Mon Sep 17 00:00:00 2001 From: sydneyjodon-wk <51122966+sydneyjodon-wk@users.noreply.github.com> Date: Fri, 23 Aug 2024 02:09:38 -0700 Subject: [PATCH] [material-ui][Pagination] Update `getItemAriaLabel` page param type (#43399) --- docs/pages/material-ui/api/pagination.json | 2 +- packages/mui-material/src/Pagination/Pagination.d.ts | 10 +++++++--- packages/mui-material/src/Pagination/Pagination.js | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/pages/material-ui/api/pagination.json b/docs/pages/material-ui/api/pagination.json index a59b2a71efc024..b07c43f7fada33 100644 --- a/docs/pages/material-ui/api/pagination.json +++ b/docs/pages/material-ui/api/pagination.json @@ -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"] } }, diff --git a/packages/mui-material/src/Pagination/Pagination.d.ts b/packages/mui-material/src/Pagination/Pagination.d.ts index a20361d6b56e20..752661d0c34015 100644 --- a/packages/mui-material/src/Pagination/Pagination.d.ts +++ b/packages/mui-material/src/Pagination/Pagination.d.ts @@ -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. diff --git a/packages/mui-material/src/Pagination/Pagination.js b/packages/mui-material/src/Pagination/Pagination.js index 56e2610ee2b4e9..97fd340dad5f1a 100644 --- a/packages/mui-material/src/Pagination/Pagination.js +++ b/packages/mui-material/src/Pagination/Pagination.js @@ -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,