From d09a1b34d6eba474128de8702dfed768ebec766b Mon Sep 17 00:00:00 2001 From: muhammadalsattar Date: Sun, 5 Nov 2023 13:13:52 +0200 Subject: [PATCH 1/2] fix typos and update ar locale --- packages/material-react-table/src/locales/ar.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/material-react-table/src/locales/ar.ts b/packages/material-react-table/src/locales/ar.ts index 4cffe1ab6..41662bc1d 100644 --- a/packages/material-react-table/src/locales/ar.ts +++ b/packages/material-react-table/src/locales/ar.ts @@ -62,7 +62,7 @@ export const MRT_Localization_AR: MRT_Localization = { pin: 'تثبيت', pinToLeft: 'تثبيت جهة اليسار', pinToRight: 'تثبيت على اليمين', - resetColumnSize: 'Reset column size', + resetColumnSize: 'إعادة تعيين حجم العمود', resetOrder: 'إعادة تعيين', rowActions: 'إجراءات الصف', rowNumber: '#', @@ -72,7 +72,7 @@ export const MRT_Localization_AR: MRT_Localization = { search: 'بحث', selectedCountOfRowCountRowsSelected: '{selectedCount} ل {rowCount} row(s) المحدد', - select: 'اخيار', + select: 'اختيار', showAll: 'عرض الكل', showAllColumns: 'إظهار كافة الأعمدة', showHideColumns: 'إظهار / إخفاء الأعمدة', @@ -85,7 +85,7 @@ export const MRT_Localization_AR: MRT_Localization = { thenBy: ', ثم بواسطة ', toggleDensity: 'تبديل الكثافة', toggleFullScreen: 'ملء الشاشة', - toggleSelectAll: 'تبديل حدد الكل', + toggleSelectAll: 'تبديل تحديد الكل', toggleSelectRow: 'تبديل تحديد الصف', toggleVisibility: 'تبديل الرؤية', ungroupByColumn: 'فك التجميع حسب {column}', From d511111358eab7a752e4ba8fce4f9bb1042b4004 Mon Sep 17 00:00:00 2001 From: muhammadalsattar Date: Mon, 6 Nov 2023 22:19:02 +0200 Subject: [PATCH 2/2] fix/rows-per-page-options --- .../src/toolbar/MRT_TablePagination.tsx | 18 ++++++++++++------ packages/material-react-table/src/types.ts | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/material-react-table/src/toolbar/MRT_TablePagination.tsx b/packages/material-react-table/src/toolbar/MRT_TablePagination.tsx index b6964933c..92ed4870a 100644 --- a/packages/material-react-table/src/toolbar/MRT_TablePagination.tsx +++ b/packages/material-react-table/src/toolbar/MRT_TablePagination.tsx @@ -14,7 +14,7 @@ const defaultRowsPerPage = [5, 10, 15, 20, 25, 30, 50, 100]; interface Props extends Partial< PaginationProps & { - rowsPerPageOptions?: number[]; + rowsPerPageOptions?: { label: string; value: number }[] | number[]; showRowsPerPage?: boolean; } > { @@ -103,11 +103,17 @@ export const MRT_TablePagination = ({ value={pageSize} variant="standard" > - {rowsPerPageOptions.map((value) => ( - - {value} - - ))} + {rowsPerPageOptions.map((option) => + typeof option === 'number' ? ( + + {option} + + ) : ( + + {option.label} + + ), + )} )} diff --git a/packages/material-react-table/src/types.ts b/packages/material-react-table/src/types.ts index f075716e6..69be915b2 100644 --- a/packages/material-react-table/src/types.ts +++ b/packages/material-react-table/src/types.ts @@ -904,13 +904,13 @@ export type MRT_TableOptions = Omit< muiPaginationProps?: | ((props: { table: MRT_TableInstance }) => Partial< PaginationProps & { - rowsPerPageOptions?: number[]; + rowsPerPageOptions?: {label: string; value: number}[] | number[]; showRowsPerPage?: boolean; } >) | Partial< PaginationProps & { - rowsPerPageOptions?: number[]; + rowsPerPageOptions?: {label: string; value: number;}[] | number[]; showRowsPerPage?: boolean; } >;