",
- "styledComponent": false,
+ "styledComponent": true,
"cssComponent": false
}
diff --git a/docs/translations/api-docs/table-pagination/table-pagination.json b/docs/translations/api-docs/table-pagination/table-pagination.json
index 8e89ce9e1a643a..052666ae29709a 100644
--- a/docs/translations/api-docs/table-pagination/table-pagination.json
+++ b/docs/translations/api-docs/table-pagination/table-pagination.json
@@ -17,7 +17,8 @@
"rowsPerPageOptions": "Customizes the options of the rows per page select field. If less than two options are available, no select field will be displayed.",
"SelectProps": "Props applied to the rows per page Select element.",
"showFirstButton": "If true, show the first-page button.",
- "showLastButton": "If true, show the last-page button."
+ "showLastButton": "If true, show the last-page button.",
+ "sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details."
},
"classDescriptions": {
"root": { "description": "Styles applied to the root element." },
@@ -35,7 +36,7 @@
},
"selectRoot": {
"description": "Styles applied to {{nodeName}}.",
- "nodeName": "the Select component root element"
+ "nodeName": "the Select component `root` element"
},
"select": {
"description": "Styles applied to {{nodeName}}.",
@@ -47,7 +48,7 @@
},
"input": {
"description": "Styles applied to {{nodeName}}.",
- "nodeName": "the InputBase component"
+ "nodeName": "the Select component `root` element"
},
"menuItem": {
"description": "Styles applied to {{nodeName}}.",
diff --git a/packages/material-ui/src/TablePagination/TablePagination.d.ts b/packages/material-ui/src/TablePagination/TablePagination.d.ts
index 20ff5b3695448a..e4560b24274200 100644
--- a/packages/material-ui/src/TablePagination/TablePagination.d.ts
+++ b/packages/material-ui/src/TablePagination/TablePagination.d.ts
@@ -1,4 +1,6 @@
import * as React from 'react';
+import { SxProps } from '@material-ui/system';
+import { Theme } from '../styles';
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
import { TablePaginationActionsProps } from './TablePaginationActions';
import { TableCellProps } from '../TableCell';
@@ -37,13 +39,13 @@ export interface TablePaginationTypeMap
{
spacer?: string;
/** Styles applied to the select label Typography element. */
selectLabel?: string;
- /** Styles applied to the Select component root element. */
+ /** Styles applied to the Select component `root` element. */
selectRoot?: string;
/** Styles applied to the Select component `select` class. */
select?: string;
/** Styles applied to the Select component `icon` class. */
selectIcon?: string;
- /** Styles applied to the InputBase component. */
+ /** Styles applied to the Select component `root` element. */
input?: string;
/** Styles applied to the MenuItem component. */
menuItem?: string;
@@ -135,6 +137,10 @@ export interface TablePaginationTypeMap
@@ -41,10 +40,12 @@ describe('', () => {
);
return wrapper.find('tr').childAt(0);
},
-
+ muiName: 'MuiTablePagination',
refInstanceof: window.HTMLTableCellElement,
- // can only use `td` in a tr so we just fake a different component
- testComponentPropWith: (props) =>
,
+ testComponentPropWith: 'td',
+ testComponentsRootPropWith: 'td',
+ testDeepOverrides: { slotName: 'toolbar', slotClassName: classes.toolbar },
+ skip: ['themeVariants', 'componentsProps'],
}),
);
@@ -360,7 +361,7 @@ describe('', () => {
it('should raise a warning if the page prop is out of range', () => {
expect(() => {
PropTypes.checkPropTypes(
- TablePagination.Naked.propTypes,
+ TablePagination.propTypes,
{
classes: {},
page: 2,
diff --git a/packages/material-ui/src/TablePagination/index.d.ts b/packages/material-ui/src/TablePagination/index.d.ts
index 317abad03391f0..2df08ab13db13f 100644
--- a/packages/material-ui/src/TablePagination/index.d.ts
+++ b/packages/material-ui/src/TablePagination/index.d.ts
@@ -1,2 +1,5 @@
export { default } from './TablePagination';
export * from './TablePagination';
+
+export { default as tablePaginationClasses } from './tablePaginationClasses';
+export * from './tablePaginationClasses';
diff --git a/packages/material-ui/src/TablePagination/index.js b/packages/material-ui/src/TablePagination/index.js
index 9bb978387b1b36..a331f1abcf6e48 100644
--- a/packages/material-ui/src/TablePagination/index.js
+++ b/packages/material-ui/src/TablePagination/index.js
@@ -1 +1,4 @@
export { default } from './TablePagination';
+
+export { default as tablePaginationClasses } from './tablePaginationClasses';
+export * from './tablePaginationClasses';
diff --git a/packages/material-ui/src/TablePagination/tablePaginationClasses.d.ts b/packages/material-ui/src/TablePagination/tablePaginationClasses.d.ts
new file mode 100644
index 00000000000000..bf9438c53585ed
--- /dev/null
+++ b/packages/material-ui/src/TablePagination/tablePaginationClasses.d.ts
@@ -0,0 +1,9 @@
+import { TablePaginationClassKey } from './TablePagination';
+
+export type TablePaginationClasses = Record;
+
+declare const tablePaginationClasses: TablePaginationClasses;
+
+export function getTablePaginationUtilityClass(slot: string): string;
+
+export default tablePaginationClasses;
diff --git a/packages/material-ui/src/TablePagination/tablePaginationClasses.js b/packages/material-ui/src/TablePagination/tablePaginationClasses.js
new file mode 100644
index 00000000000000..a5df1bd63abcf7
--- /dev/null
+++ b/packages/material-ui/src/TablePagination/tablePaginationClasses.js
@@ -0,0 +1,21 @@
+import { generateUtilityClass, generateUtilityClasses } from '@material-ui/unstyled';
+
+export function getTablePaginationUtilityClass(slot) {
+ return generateUtilityClass('MuiTablePagination', slot);
+}
+
+const tablePaginationClasses = generateUtilityClasses('MuiTablePagination', [
+ 'root',
+ 'toolbar',
+ 'spacer',
+ 'selectLabel',
+ 'selectRoot',
+ 'select',
+ 'selectIcon',
+ 'input',
+ 'menuItem',
+ 'displayedRows',
+ 'actions',
+]);
+
+export default tablePaginationClasses;