From 9630eea750d968a4c4c81d6bfba62b256a412a29 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Fri, 18 Oct 2019 17:53:28 +0200 Subject: [PATCH] handle TypeScript side --- .../tables/CustomPaginationActionsTable.tsx | 2 +- docs/src/pages/components/tables/tables.md | 21 +++++++++++++++---- .../src/TablePagination/TablePagination.d.ts | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx b/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx index 78a4cd0d011a22..4f7fd311f73735 100644 --- a/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx +++ b/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx @@ -159,7 +159,7 @@ export default function CustomPaginationActionsTable() { + ``` +- **objects**, the `value` and `label` keys will be used respectively for the value and label of the option (useful for language strings such as 'All'). -Custom options in the `Rows per page:` menu can be shown by using a JS object with the `label` key denoting the display string, such as `"All"`, and the `value` key defining the number of rows to be shown. The following example demonstrates the same. + ```jsx + + ``` +### Custom pagination actions + +The `Action` property of the `TablePagination` component allows the implementation of +custom actions. {{"demo": "pages/components/tables/CustomPaginationActionsTable.js"}} diff --git a/packages/material-ui/src/TablePagination/TablePagination.d.ts b/packages/material-ui/src/TablePagination/TablePagination.d.ts index 05f2f460539921..44418d1a5b5760 100644 --- a/packages/material-ui/src/TablePagination/TablePagination.d.ts +++ b/packages/material-ui/src/TablePagination/TablePagination.d.ts @@ -26,7 +26,7 @@ export interface TablePaginationTypeMap { onChangeRowsPerPage?: React.ChangeEventHandler; page: number; rowsPerPage: number; - rowsPerPageOptions?: number[]; + rowsPerPageOptions?: (number | { value: number; label: string })[]; SelectProps?: Partial; }; defaultComponent: D;