diff --git a/docs/src/pages/demos/tables/EnhancedTable.js b/docs/src/pages/demos/tables/EnhancedTable.js index a950851d6aa18d..a3b658d5ee1983 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 a911f0bcf22295..fddd068d843759 100644 --- a/pages/api/table-cell.md +++ b/pages/api/table-cell.md @@ -22,9 +22,9 @@ import TableCell from '@material-ui/core/TableCell'; | children | node |   | The table cell contents. | | classes | object |   | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | | component | element type |   | The component used for the root node. Either a string to use a DOM element or a component. | -| padding | enum: 'normal' |
 'checkbox' |
 'none'
|   | Sets the padding applied to the cell. By default, the Table parent component set the value. | +| padding | enum: 'default' |
 'checkbox' |
 'none'
|   | Sets the padding applied to the cell. By default, the Table parent component set the value. | | 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 5db700b5dad0a2..34ea892f7c669b 100644 --- a/pages/api/table.md +++ b/pages/api/table.md @@ -21,7 +21,7 @@ import Table from '@material-ui/core/Table'; | children * | node |   | The content of the table, normally `TableHead` and `TableBody`. | | classes | object |   | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | | component | element type | 'table' | The component used for the root node. Either a string to use a DOM element or a component. | -| 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. | | size | enum: 'normal' |
 'small'
| 'normal' | Allows TableCells to inherit size of the Table. | Any other properties supplied will be spread to the root element (native element). 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() {
- +