From f872b4f331c336145380ca7ab3bfc8015b4d1a16 Mon Sep 17 00:00:00 2001 From: Dave Snider Date: Mon, 24 Sep 2018 13:58:54 -0700 Subject: [PATCH 1/3] flex grid accepts 1 column --- src-docs/src/views/flex/flex_example.js | 2 +- src/components/flex/__snapshots__/flex_grid.test.js.snap | 6 ++++++ src/components/flex/_flex_grid.scss | 1 + src/components/flex/flex_grid.js | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src-docs/src/views/flex/flex_example.js b/src-docs/src/views/flex/flex_example.js index 4ea7b44a29e..d3930c5394d 100644 --- a/src-docs/src/views/flex/flex_example.js +++ b/src-docs/src/views/flex/flex_example.js @@ -294,7 +294,7 @@ export const FlexExample = { text: (

You can set a columns prop to specify - anywhere between 2-4 columns. Any more would likely break on laptop screens. + anywhere between 1-4 columns. Any more would likely break on laptop screens.

), demo:
, diff --git a/src/components/flex/__snapshots__/flex_grid.test.js.snap b/src/components/flex/__snapshots__/flex_grid.test.js.snap index 9e07144d73b..2cd971c11da 100644 --- a/src/components/flex/__snapshots__/flex_grid.test.js.snap +++ b/src/components/flex/__snapshots__/flex_grid.test.js.snap @@ -18,6 +18,12 @@ exports[`EuiFlexGrid props columns 0 is rendered 1`] = ` /> `; +exports[`EuiFlexGrid props columns 1 is rendered 1`] = ` +
+`; + exports[`EuiFlexGrid props columns 2 is rendered 1`] = `
Date: Mon, 24 Sep 2018 13:59:44 -0700 Subject: [PATCH 2/3] autodocs --- src/components/flex/flex_grid.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/flex/flex_grid.js b/src/components/flex/flex_grid.js index c590d5d4c79..20e4c0c2615 100644 --- a/src/components/flex/flex_grid.js +++ b/src/components/flex/flex_grid.js @@ -47,6 +47,9 @@ EuiFlexGrid.propTypes = { children: PropTypes.node, className: PropTypes.string, gutterSize: PropTypes.oneOf(GUTTER_SIZES), + /** + * Number of columns to show in the grid. Up to 4. + */ columns: PropTypes.oneOf(COLUMNS).isRequired, /** * Allow grid items display at block level on small screens From c983412b8553329f406b4c462ecfb38edf0ac4f8 Mon Sep 17 00:00:00 2001 From: Dave Snider Date: Mon, 24 Sep 2018 14:37:22 -0700 Subject: [PATCH 3/3] cl --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9a765b53e6..6aa6c8580c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `4.2.0`. +- Added `1` as a valid value for the `columns` prop in `EuiFlexGrid` ([#1210](https://github.com/elastic/eui/pull/1210)) ## [`4.2.0`](https://github.com/elastic/eui/tree/v4.2.0)