Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compressed props on basic/memory tables #687

Merged
merged 2 commits into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- `EuiForm` and `EuiFormRow` now accept nodes for `errors` prop ([#685](https://github.com/elastic/eui/pull/685))
- Removed the default `max-width` from `EuiText`. This can still be applied by setting `grow={false}` ([#683](https://github.com/elastic/eui/pull/683))
- Added support for text alignment with `EuiTextAlign` ([#683](https://github.com/elastic/eui/pull/683))
- `EuiBasicTable` added the `compressed` prop to allow for tables with smaller fonts and padding. ([#687](https://github.com/elastic/eui/pull/687))

**Breaking changes**

Expand Down
4 changes: 4 additions & 0 deletions src-docs/src/views/tables/basic/props_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export const propsInfo = {
required: true,
type: { name: 'object[]' }
},
compressed: {
description: 'Makes the font and padding smaller for the entire table',
type: { name: 'bool' }
},
columns: {
description: 'Defines the table columns',
required: true,
Expand Down
3 changes: 2 additions & 1 deletion src/components/basic_table/basic_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ const BasicTablePropTypes = {
error: PropTypes.string,
loading: PropTypes.bool,
noItemsMessage: PropTypes.node,
className: PropTypes.string
className: PropTypes.string,
compressed: PropTypes.bool,
};

export class EuiBasicTable extends Component {
Expand Down
3 changes: 3 additions & 0 deletions src/components/basic_table/in_memory_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const InMemoryTablePropTypes = {
loading: PropTypes.bool,
message: PropTypes.node,
error: PropTypes.string,
compressed: PropTypes.bool,
search: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
defaultQuery: QueryType,
box: PropTypes.shape({
Expand Down Expand Up @@ -255,6 +256,7 @@ export class EuiInMemoryTable extends Component {
selection,
isSelectable,
hasActions,
compressed,
pagination: hasPagination,
sorting: hasSorting,
} = this.props;
Expand Down Expand Up @@ -302,6 +304,7 @@ export class EuiInMemoryTable extends Component {
error={error}
loading={loading}
noItemsMessage={message}
compressed={compressed}
/>
);

Expand Down