From 387c736581ddae6706e60c5e9be24fd765940c3c Mon Sep 17 00:00:00 2001 From: Caroline Horn <549577+cchaos@users.noreply.github.com> Date: Thu, 16 Aug 2018 16:20:04 -0400 Subject: [PATCH] EuiSuperSelect (#921) --- CHANGELOG.md | 1 + src-docs/src/routes.js | 4 + .../form_controls/form_controls_example.js | 8 + .../src/views/super_select/super_select.js | 91 ++ .../views/super_select/super_select_basic.js | 65 + .../super_select/super_select_complex.js | 78 ++ .../super_select/super_select_example.js | 95 ++ .../collapsed_item_actions.test.js.snap | 3 + .../in_memory_table.test.js.snap | 1 + src/components/combo_box/_combo_box.scss | 1 + .../_combo_box_options_list.scss | 10 +- .../context_menu_panel.test.js.snap | 16 +- .../context_menu/_context_menu.scss | 5 - .../context_menu/_context_menu_item.scss | 16 + .../context_menu/context_menu_item.js | 18 +- src/components/form/_index.scss | 1 + src/components/form/index.js | 4 + .../__snapshots__/super_select.test.js.snap | 1092 +++++++++++++++++ .../super_select_control.test.js.snap | 362 ++++++ src/components/form/super_select/_index.scss | 2 + .../form/super_select/_super_select.scss | 32 + .../super_select/_super_select_control.scss | 30 + src/components/form/super_select/index.js | 7 + .../form/super_select/super_select.js | 277 +++++ .../form/super_select/super_select.test.js | 116 ++ .../form/super_select/super_select_control.js | 117 ++ .../super_select/super_select_control.test.js | 77 ++ src/components/index.js | 2 + .../__snapshots__/popover.test.js.snap | 20 +- src/components/popover/_popover.scss | 31 +- src/components/popover/index.d.ts | 1 + src/components/popover/popover.js | 14 +- .../field_value_selection_filter.test.js.snap | 4 + src/components/text/_text.scss | 3 +- 34 files changed, 2560 insertions(+), 44 deletions(-) create mode 100644 src-docs/src/views/super_select/super_select.js create mode 100644 src-docs/src/views/super_select/super_select_basic.js create mode 100644 src-docs/src/views/super_select/super_select_complex.js create mode 100644 src-docs/src/views/super_select/super_select_example.js create mode 100644 src/components/form/super_select/__snapshots__/super_select.test.js.snap create mode 100644 src/components/form/super_select/__snapshots__/super_select_control.test.js.snap create mode 100644 src/components/form/super_select/_index.scss create mode 100644 src/components/form/super_select/_super_select.scss create mode 100644 src/components/form/super_select/_super_select_control.scss create mode 100644 src/components/form/super_select/index.js create mode 100644 src/components/form/super_select/super_select.js create mode 100644 src/components/form/super_select/super_select.test.js create mode 100644 src/components/form/super_select/super_select_control.js create mode 100644 src/components/form/super_select/super_select_control.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 53ae5696121..3d21fee81f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) - Added `zIndexAdjustment` to `EuiPopover` which allows tweaking the popover content's `z-index` ([#1097](https://github.com/elastic/eui/pull/1097)) +- Added new `EuiSuperSelect` component and `hasArrow` prop to `EuiPopover` ([#921](https://github.com/elastic/eui/pull/921)) ## [`3.6.1`](https://github.com/elastic/eui/tree/v3.6.1) diff --git a/src-docs/src/routes.js b/src-docs/src/routes.js index 2f76fc32321..b5286e43229 100644 --- a/src-docs/src/routes.js +++ b/src-docs/src/routes.js @@ -237,6 +237,9 @@ import { XYChartLineExample } import { Changelog } from './views/package/changelog'; +import { SuperSelectExample } + from './views/super_select/super_select_example'; + /** * Lowercases input and replaces spaces with hyphens: * e.g. 'GridView Example' -> 'gridview-example' @@ -356,6 +359,7 @@ const navigation = [{ FormLayoutsExample, FormControlsExample, FormValidationExample, + SuperSelectExample, ComboBoxExample, ColorPickerExample, CodeEditorExample, diff --git a/src-docs/src/views/form_controls/form_controls_example.js b/src-docs/src/views/form_controls/form_controls_example.js index 8df657ecc55..cf3d4f0115a 100644 --- a/src-docs/src/views/form_controls/form_controls_example.js +++ b/src-docs/src/views/form_controls/form_controls_example.js @@ -182,6 +182,14 @@ export const FormControlsExample = { type: GuideSectionTypes.HTML, code: selectHtml, }], + text: ( +
+ This component renders a basic HTML <select>
element. If you need more customization
+ for how the options and/or selected values render, use the
Has a short description giving more detail to the option.
+Has a short description giving more detail to the option.
+Has a short description giving more detail to the option.
+
+ This is a simple replacement component for
+ … and the component will create a select styled button + that triggers a popover of selectable items. +
+
+ Both
+ You can pass the same props as you normally would to