diff --git a/docs/src/pages/demos/tables/EnhancedTable.js b/docs/src/pages/demos/tables/EnhancedTable.js index e96c03f5342e81..8106c1d501733a 100644 --- a/docs/src/pages/demos/tables/EnhancedTable.js +++ b/docs/src/pages/demos/tables/EnhancedTable.js @@ -82,7 +82,7 @@ class RawEnhancedTableHead extends React.Component { {({ height, width }) => ( - +
{columns.map(({ cellContentRenderer = null, className, dataKey, ...other }, index) => { let renderer; if (cellContentRenderer != null) { diff --git a/packages/material-ui/src/Table/Table.d.ts b/packages/material-ui/src/Table/Table.d.ts index 149442b0e7e327..bd0ed3bf07e200 100644 --- a/packages/material-ui/src/Table/Table.d.ts +++ b/packages/material-ui/src/Table/Table.d.ts @@ -9,7 +9,7 @@ export interface TableProps extends StandardProps export type TableBaseProps = React.TableHTMLAttributes; -export type Padding = 'normal' | 'checkbox' | 'none'; +export type Padding = 'default' | 'checkbox' | 'none'; export type Size = 'normal' | 'small'; diff --git a/packages/material-ui/src/Table/Table.js b/packages/material-ui/src/Table/Table.js index 887f584d821ee1..006970bde03e0e 100644 --- a/packages/material-ui/src/Table/Table.js +++ b/packages/material-ui/src/Table/Table.js @@ -47,7 +47,7 @@ Table.propTypes = { /** * Allows TableCells to inherit padding of the Table. */ - padding: PropTypes.oneOf(['normal', 'checkbox', 'none']), + padding: PropTypes.oneOf(['default', 'checkbox', 'none']), /** * Allows TableCells to inherit size of the Table. */ @@ -56,7 +56,7 @@ Table.propTypes = { Table.defaultProps = { component: 'table', - padding: 'normal', + padding: 'default', size: 'normal', }; diff --git a/packages/material-ui/src/Table/Table.test.js b/packages/material-ui/src/Table/Table.test.js index 8f9fd3297aa1ff..ea6941976dacfe 100644 --- a/packages/material-ui/src/Table/Table.test.js +++ b/packages/material-ui/src/Table/Table.test.js @@ -72,7 +72,7 @@ describe('
', () => { assert.deepStrictEqual(context, { size: 'normal', - padding: 'normal', + padding: 'default', }); }); }); diff --git a/packages/material-ui/src/TableCell/TableCell.js b/packages/material-ui/src/TableCell/TableCell.js index fffe0dcffdb29c..46647eec94fe07 100644 --- a/packages/material-ui/src/TableCell/TableCell.js +++ b/packages/material-ui/src/TableCell/TableCell.js @@ -128,7 +128,7 @@ function TableCell(props) { if (!scope && tablelvl2 && tablelvl2.variant === 'head') { scope = 'col'; } - const padding = paddingProp || (table && table.padding ? table.padding : 'normal'); + const padding = paddingProp || (table && table.padding ? table.padding : 'default'); const size = sizeProp || (table && table.size ? table.size : 'normal'); let ariaSort = null; @@ -147,7 +147,7 @@ function TableCell(props) { ? variant === 'footer' : tablelvl2 && tablelvl2.variant === 'footer', [classes[`align${capitalize(align)}`]]: align !== 'inherit', - [classes[`padding${capitalize(padding)}`]]: padding !== 'normal', + [classes[`padding${capitalize(padding)}`]]: padding !== 'default', [classes[`size${capitalize(size)}`]]: size !== 'normal', }, className, @@ -191,14 +191,14 @@ TableCell.propTypes = { * Sets the padding applied to the cell. * By default, the Table parent component set the value. */ - padding: PropTypes.oneOf(['normal', 'checkbox', 'none']), + padding: PropTypes.oneOf(['default', 'checkbox', 'none']), /** * Set scope attribute. */ scope: PropTypes.string, /** * Specify the size of the cell. - * By default, the Table parent component set the value. + * By default, the Table parent component set the value (`normal`). */ size: PropTypes.oneOf(['normal', 'small']), /** diff --git a/packages/material-ui/src/TableRow/TableRow.test.js b/packages/material-ui/src/TableRow/TableRow.test.js index 25dbc4ce5a852b..32a69b14295cfb 100644 --- a/packages/material-ui/src/TableRow/TableRow.test.js +++ b/packages/material-ui/src/TableRow/TableRow.test.js @@ -2,7 +2,6 @@ import React from 'react'; import { assert } from 'chai'; import { createMount, findOutermostIntrinsic, getClasses } from '@material-ui/core/test-utils'; import TableRow from './TableRow'; -import TableContext from '../Table/TableContext'; describe('', () => { let mount; @@ -46,15 +45,6 @@ describe('', () => { assert.strictEqual(findOutermostIntrinsic(wrapper).hasClass(classes.root), true); }); - it('should render with the dense class in dense tables', () => { - const wrapper = mountInTable( - - - , - ); - assert.strictEqual(findOutermostIntrinsic(wrapper).hasClass(classes.dense), true); - }); - it('should render children', () => { const children =
; const wrapper = mountInTable({children}); diff --git a/pages/api/table-cell.md b/pages/api/table-cell.md index 627b6a5f4865a6..d8eedd1da3b039 100644 --- a/pages/api/table-cell.md +++ b/pages/api/table-cell.md @@ -28,13 +28,17 @@ import TableCell from '@material-ui/core/TableCell'; ======= | component | element type |   | The component used for the root node. Either a string to use a DOM element or a component. | <<<<<<< HEAD +<<<<<<< HEAD | padding | enum: 'normal', 'checkbox', 'dense', 'denseCheckbox', 'none'
|   | Sets the padding applied to the cell. By default, the Table parent component set the value. | >>>>>>> Update docs ======= | padding | enum: 'normal' |
 'checkbox' |
 'none'
|   | Sets the padding applied to the cell. By default, the Table parent component set the value. | >>>>>>> Add a size prop the Table and drop denseCheckbox padding +======= +| padding | enum: 'default' |
 'checkbox' |
 'none'
|   | Sets the padding applied to the cell. By default, the Table parent component set the value. | +>>>>>>> reduce amount of breaking change | scope | string |   | Set scope attribute. | -| size | enum: 'normal' |
 'small'
|   | Specify the size of the cell. By default, the Table parent component set the value. | +| size | enum: 'normal' |
 'small'
|   | Specify the size of the cell. By default, the Table parent component set the value (`normal`). | | sortDirection | enum: 'asc' |
 'desc' |
 false
|   | Set aria-sort direction. | | variant | enum: 'head' |
 'body' |
 'footer'
|   | Specify the cell type. By default, the TableHead, TableBody or TableFooter parent component set the value. | diff --git a/pages/api/table.md b/pages/api/table.md index cfebb08ef235f8..415d54827f126b 100644 --- a/pages/api/table.md +++ b/pages/api/table.md @@ -26,10 +26,14 @@ import Table from '@material-ui/core/Table'; ======= | component | element type | 'table' | The component used for the root node. Either a string to use a DOM element or a component. | <<<<<<< HEAD +<<<<<<< HEAD | padding | enum: 'normal', 'checkbox', 'dense', 'none', 'denseCheckbox'
| 'normal' | Allows TableCells to inherit padding of the Table. | >>>>>>> Update docs ======= | padding | enum: 'normal' |
 'checkbox' |
 'none'
| 'normal' | Allows TableCells to inherit padding of the Table. | +======= +| padding | enum: 'default' |
 'checkbox' |
 'none'
| 'default' | Allows TableCells to inherit padding of the Table. | +>>>>>>> reduce amount of breaking change | size | enum: 'normal' |
 'small'
| 'normal' | Allows TableCells to inherit size of the Table. | >>>>>>> Add a size prop the Table and drop denseCheckbox padding diff --git a/test/regressions/tests/Table/PaddingTable.js b/test/regressions/tests/Table/PaddingTable.js index d5211edb40fb5f..4e473611ea3256 100644 --- a/test/regressions/tests/Table/PaddingTable.js +++ b/test/regressions/tests/Table/PaddingTable.js @@ -43,7 +43,7 @@ function PaddingTable() {
- +