From 7c325c310b385a771da3892ddf5bcfd4b018f3b1 Mon Sep 17 00:00:00 2001 From: arkwright <1445684+arkwright@users.noreply.github.com> Date: Wed, 14 Mar 2018 13:21:20 -0400 Subject: [PATCH] Add ability to force open EuiSideNav items. --- CHANGELOG.md | 2 +- .../src/views/side_nav/side_nav_example.js | 25 +- .../src/views/side_nav/side_nav_force_open.js | 94 +++++++ .../__snapshots__/side_nav.test.js.snap | 164 +++++++++++- src/components/side_nav/_side_nav_item.scss | 14 +- src/components/side_nav/side_nav.js | 36 +++ src/components/side_nav/side_nav.test.js | 248 ++++++++++-------- src/components/side_nav/side_nav_item.js | 3 +- 8 files changed, 453 insertions(+), 133 deletions(-) create mode 100644 src-docs/src/views/side_nav/side_nav_force_open.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 95ad47c7adf9..afb1669e2fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `0.0.29`. +- Add ability to force `EuiSideNav` items open by setting `item.forceOpen`. ([#515](https://github.com/elastic/eui/pull/515)) # [`0.0.29`](https://github.com/elastic/eui/tree/v0.0.29) diff --git a/src-docs/src/views/side_nav/side_nav_example.js b/src-docs/src/views/side_nav/side_nav_example.js index 0496fb5949ac..ad269d8e6502 100644 --- a/src-docs/src/views/side_nav/side_nav_example.js +++ b/src-docs/src/views/side_nav/side_nav_example.js @@ -19,6 +19,10 @@ import SideNavComplex from './side_nav_complex'; const sideNavComplexSource = require('!!raw-loader!./side_nav_complex'); const sideNavComplexHtml = renderToHtml(SideNavComplex); +import SideNavForceOpen from './side_nav_force_open'; +const sideNavForceOpenSource = require('!!raw-loader!./side_nav_force_open'); +const sideNavForceOpenHtml = renderToHtml(SideNavForceOpen); + export const SideNavExample = { title: 'Side Nav', sections: [{ @@ -33,13 +37,13 @@ export const SideNavExample = {
Configure the content of a
+