@elastic/eui 94.1.0 → 94.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +6 -15
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +6 -15
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.js +1 -25
- package/es/components/accordion/accordion_children/accordion_children.js +3 -7
- package/es/components/basic_table/basic_table.js +8 -5
- package/es/components/breadcrumbs/_breadcrumb_content.js +1 -1
- package/es/components/breadcrumbs/breadcrumbs.js +1 -1
- package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +306 -0
- package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +56 -0
- package/{optimize/es/components/collapsible_nav_beta/collapsible_nav_group → es/components/collapsible_nav_beta/_kibana_solution}/index.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +12 -4
- package/es/components/color_picker/color_picker.js +9 -1
- package/es/components/combo_box/combo_box.js +19 -5
- package/es/components/combo_box/index.js +2 -1
- package/es/components/combo_box/matching_options.js +34 -5
- package/es/components/datagrid/body/cell/data_grid_cell.js +0 -46
- package/es/components/datagrid/body/data_grid_body.js +0 -28
- package/es/components/datagrid/body/data_grid_body_custom.js +0 -28
- package/es/components/datagrid/body/data_grid_body_virtualized.js +0 -28
- package/es/components/datagrid/body/header/column_actions.js +17 -5
- package/es/components/datagrid/body/header/data_grid_header_cell.js +3 -30
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
- package/es/components/datagrid/controls/column_sorting.js +0 -28
- package/es/components/datagrid/utils/in_memory.js +0 -28
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -84
- package/es/components/date_picker/super_date_picker/super_update_button.js +1 -62
- package/es/components/flex/flex_group.js +21 -35
- package/es/components/flex/flex_item.js +18 -18
- package/es/components/form/field_number/field_number.js +22 -7
- package/es/components/form/field_text/field_text.js +17 -7
- package/es/components/form/form_control_layout/_num_icons.js +7 -2
- package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/es/components/form/range/dual_range.js +2 -1
- package/es/components/form/range/range.js +12 -1
- package/es/components/form/range/range_slider.js +4 -1
- package/es/components/form/range/range_track.js +2 -1
- package/es/components/form/range/range_wrapper.styles.js +4 -4
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +27 -8
- package/es/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +32 -9
- package/es/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +17 -2
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/page_template/outer/page_outer.js +2 -1
- package/es/components/page_template/page_template.js +119 -81
- package/es/components/popover/input_popover.js +4 -2
- package/es/components/popover/popover.js +6 -1
- package/es/components/search_bar/filters/field_value_selection_filter.js +3 -5
- package/es/components/search_bar/query/default_syntax.js +2 -2
- package/es/components/selectable/matching_options.js +43 -5
- package/es/components/selectable/selectable.js +55 -13
- package/es/components/selectable/selectable_list/selectable_list.js +15 -6
- package/es/components/selectable/selectable_search/selectable_search.js +9 -3
- package/es/components/steps/step_horizontal.js +1 -0
- package/es/components/table/table_row_cell.styles.js +2 -2
- package/es/components/tour/tour_step.js +1 -1
- package/eui.d.ts +1416 -1177
- package/i18ntokens.json +202 -148
- package/lib/components/accordion/accordion.js +1 -25
- package/lib/components/accordion/accordion_children/accordion_children.js +3 -7
- package/lib/components/basic_table/basic_table.js +8 -5
- package/lib/components/breadcrumbs/_breadcrumb_content.js +1 -1
- package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +315 -0
- package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +61 -0
- package/lib/components/collapsible_nav_beta/_kibana_solution/index.js +12 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +11 -4
- package/lib/components/color_picker/color_picker.js +9 -1
- package/lib/components/combo_box/combo_box.js +18 -4
- package/lib/components/combo_box/index.js +10 -2
- package/lib/components/combo_box/matching_options.js +37 -7
- package/lib/components/datagrid/body/cell/data_grid_cell.js +0 -46
- package/lib/components/datagrid/body/data_grid_body.js +0 -28
- package/lib/components/datagrid/body/data_grid_body_custom.js +0 -28
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +0 -28
- package/lib/components/datagrid/body/header/column_actions.js +17 -5
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -30
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
- package/lib/components/datagrid/controls/column_sorting.js +0 -28
- package/lib/components/datagrid/utils/in_memory.js +0 -28
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -84
- package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -62
- package/lib/components/flex/flex_group.js +22 -37
- package/lib/components/flex/flex_item.js +17 -17
- package/lib/components/form/field_number/field_number.js +20 -6
- package/lib/components/form/field_text/field_text.js +16 -6
- package/lib/components/form/form_control_layout/_num_icons.js +9 -3
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +4 -3
- package/lib/components/form/range/dual_range.js +2 -1
- package/lib/components/form/range/range.js +12 -1
- package/lib/components/form/range/range_slider.js +4 -1
- package/lib/components/form/range/range_track.js +2 -1
- package/lib/components/form/range/range_wrapper.styles.js +4 -4
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +33 -18
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +38 -16
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +23 -10
- package/lib/components/page_template/outer/page_outer.js +4 -2
- package/lib/components/page_template/page_template.js +117 -79
- package/lib/components/popover/input_popover.js +4 -2
- package/lib/components/popover/popover.js +6 -1
- package/lib/components/search_bar/filters/field_value_selection_filter.js +3 -5
- package/lib/components/search_bar/query/default_syntax.js +2 -2
- package/lib/components/selectable/matching_options.js +46 -7
- package/lib/components/selectable/selectable.js +54 -12
- package/lib/components/selectable/selectable_list/selectable_list.js +15 -6
- package/lib/components/selectable/selectable_search/selectable_search.js +9 -3
- package/lib/components/steps/step_horizontal.js +1 -0
- package/lib/components/table/table_row_cell.styles.js +1 -1
- package/optimize/es/components/accordion/accordion.js +1 -25
- package/optimize/es/components/accordion/accordion_children/accordion_children.js +2 -5
- package/optimize/es/components/basic_table/basic_table.js +8 -5
- package/optimize/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +173 -0
- package/optimize/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +56 -0
- package/{es/components/collapsible_nav_beta/collapsible_nav_group → optimize/es/components/collapsible_nav_beta/_kibana_solution}/index.js +1 -1
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +9 -4
- package/optimize/es/components/color_picker/color_picker.js +9 -1
- package/optimize/es/components/combo_box/combo_box.js +10 -5
- package/optimize/es/components/combo_box/index.js +2 -1
- package/optimize/es/components/combo_box/matching_options.js +34 -5
- package/optimize/es/components/datagrid/body/header/column_actions.js +17 -5
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +3 -2
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/optimize/es/components/flex/flex_group.js +22 -22
- package/optimize/es/components/flex/flex_item.js +19 -6
- package/optimize/es/components/form/field_number/field_number.js +13 -6
- package/optimize/es/components/form/field_text/field_text.js +14 -7
- package/optimize/es/components/form/form_control_layout/_num_icons.js +7 -2
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/optimize/es/components/form/range/range.js +10 -0
- package/optimize/es/components/form/range/range_slider.js +3 -1
- package/optimize/es/components/form/range/range_wrapper.styles.js +4 -4
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +22 -8
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +24 -9
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +12 -2
- package/optimize/es/components/page_template/outer/page_outer.js +1 -0
- package/optimize/es/components/page_template/page_template.js +79 -80
- package/optimize/es/components/popover/input_popover.js +4 -2
- package/optimize/es/components/popover/popover.js +5 -0
- package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +3 -5
- package/optimize/es/components/search_bar/query/default_syntax.js +2 -2
- package/optimize/es/components/selectable/matching_options.js +43 -5
- package/optimize/es/components/selectable/selectable.js +33 -9
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +12 -5
- package/optimize/es/components/selectable/selectable_search/selectable_search.js +9 -3
- package/optimize/es/components/steps/step_horizontal.js +1 -0
- package/optimize/es/components/table/table_row_cell.styles.js +2 -2
- package/optimize/lib/components/accordion/accordion.js +1 -25
- package/optimize/lib/components/accordion/accordion_children/accordion_children.js +2 -5
- package/optimize/lib/components/basic_table/basic_table.js +8 -5
- package/optimize/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +182 -0
- package/optimize/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +61 -0
- package/optimize/lib/components/collapsible_nav_beta/_kibana_solution/index.js +12 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +9 -4
- package/optimize/lib/components/color_picker/color_picker.js +9 -1
- package/optimize/lib/components/combo_box/combo_box.js +9 -4
- package/optimize/lib/components/combo_box/index.js +10 -2
- package/optimize/lib/components/combo_box/matching_options.js +37 -7
- package/optimize/lib/components/datagrid/body/header/column_actions.js +17 -5
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/optimize/lib/components/flex/flex_group.js +22 -23
- package/optimize/lib/components/flex/flex_item.js +18 -5
- package/optimize/lib/components/form/field_number/field_number.js +12 -5
- package/optimize/lib/components/form/field_text/field_text.js +13 -6
- package/optimize/lib/components/form/form_control_layout/_num_icons.js +9 -3
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +4 -3
- package/optimize/lib/components/form/range/range.js +10 -0
- package/optimize/lib/components/form/range/range_slider.js +3 -1
- package/optimize/lib/components/form/range/range_wrapper.styles.js +4 -4
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +22 -8
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +30 -18
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +13 -2
- package/optimize/lib/components/page_template/outer/page_outer.js +3 -1
- package/optimize/lib/components/page_template/page_template.js +77 -78
- package/optimize/lib/components/popover/input_popover.js +4 -2
- package/optimize/lib/components/popover/popover.js +5 -0
- package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +3 -5
- package/optimize/lib/components/search_bar/query/default_syntax.js +2 -2
- package/optimize/lib/components/selectable/matching_options.js +46 -7
- package/optimize/lib/components/selectable/selectable.js +32 -8
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +14 -7
- package/optimize/lib/components/selectable/selectable_search/selectable_search.js +9 -3
- package/optimize/lib/components/steps/step_horizontal.js +1 -0
- package/optimize/lib/components/table/table_row_cell.styles.js +1 -1
- package/package.json +16 -13
- package/src/components/color_picker/_color_picker.scss +0 -16
- package/src/components/date_picker/super_date_picker/date_popover/_date_popover_content.scss +4 -7
- package/test-env/components/accordion/accordion.js +1 -25
- package/test-env/components/accordion/accordion_children/accordion_children.js +3 -7
- package/test-env/components/basic_table/basic_table.js +8 -5
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +1 -1
- package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +307 -0
- package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.styles.js +61 -0
- package/test-env/components/collapsible_nav_beta/_kibana_solution/index.js +12 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +3 -3
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +9 -4
- package/test-env/components/color_picker/color_picker.js +9 -1
- package/test-env/components/combo_box/combo_box.js +18 -4
- package/test-env/components/combo_box/index.js +10 -2
- package/test-env/components/combo_box/matching_options.js +37 -7
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +0 -46
- package/test-env/components/datagrid/body/data_grid_body.js +0 -28
- package/test-env/components/datagrid/body/data_grid_body_custom.js +0 -28
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +0 -28
- package/test-env/components/datagrid/body/header/column_actions.js +17 -5
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +3 -30
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -9
- package/test-env/components/datagrid/controls/column_sorting.js +0 -28
- package/test-env/components/datagrid/utils/in_memory.js +0 -28
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +6 -3
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -84
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -62
- package/test-env/components/flex/flex_group.js +22 -37
- package/test-env/components/flex/flex_item.js +17 -17
- package/test-env/components/form/field_number/field_number.js +18 -6
- package/test-env/components/form/field_text/field_text.js +13 -6
- package/test-env/components/form/form_control_layout/_num_icons.js +9 -3
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +4 -3
- package/test-env/components/form/range/dual_range.js +2 -1
- package/test-env/components/form/range/range.js +12 -1
- package/test-env/components/form/range/range_slider.js +4 -1
- package/test-env/components/form/range/range_track.js +2 -1
- package/test-env/components/form/range/range_wrapper.styles.js +4 -4
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +22 -8
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +30 -18
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js +13 -2
- package/test-env/components/page_template/outer/page_outer.js +4 -2
- package/test-env/components/page_template/page_template.js +112 -79
- package/test-env/components/popover/input_popover.js +4 -2
- package/test-env/components/popover/popover.js +6 -1
- package/test-env/components/search_bar/filters/field_value_selection_filter.js +3 -5
- package/test-env/components/search_bar/query/default_syntax.js +2 -2
- package/test-env/components/selectable/matching_options.js +46 -7
- package/test-env/components/selectable/selectable.js +54 -12
- package/test-env/components/selectable/selectable_list/selectable_list.js +17 -7
- package/test-env/components/selectable/selectable_search/selectable_search.js +9 -3
- package/test-env/components/steps/step_horizontal.js +1 -0
- package/test-env/components/table/table_row_cell.styles.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -74
- package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -19
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -84
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -26
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +0 -12
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -52
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -19
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -62
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -26
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +0 -12
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +0 -83
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +0 -26
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/index.js +0 -12
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "responsive", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "component", "mainProps", "className", "minHeight"];
|
|
5
|
+
var _excluded = ["children", "responsive", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "component", "mainProps", "className", "minHeight", "style"];
|
|
5
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
8
|
/*
|
|
@@ -12,7 +13,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
12
13
|
* Side Public License, v 1.
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
|
-
import React, { createContext, useContext } from 'react';
|
|
16
|
+
import React, { createContext, useContext, useMemo } from 'react';
|
|
16
17
|
import classNames from 'classnames';
|
|
17
18
|
import { _EuiPageOuter as EuiPageOuter } from './outer';
|
|
18
19
|
import { _EuiPageInner as EuiPageInner } from './inner';
|
|
@@ -20,9 +21,10 @@ import { _EuiPageBottomBar as EuiPageBottomBar } from './bottom_bar/page_bottom_
|
|
|
20
21
|
import { _EuiPageEmptyPrompt as EuiPageEmptyPrompt } from './empty_prompt/page_empty_prompt';
|
|
21
22
|
import { EuiPageHeader, EuiPageSection, EuiPageSidebar } from '../page';
|
|
22
23
|
import { useGeneratedHtmlId } from '../../services';
|
|
23
|
-
import {
|
|
24
|
+
import { logicalStyles } from '../../global_styling';
|
|
24
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
26
|
export var TemplateContext = /*#__PURE__*/createContext({
|
|
27
|
+
sidebar: {},
|
|
26
28
|
section: {},
|
|
27
29
|
header: {},
|
|
28
30
|
emptyPrompt: {},
|
|
@@ -51,9 +53,8 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
51
53
|
className = _ref.className,
|
|
52
54
|
_ref$minHeight = _ref.minHeight,
|
|
53
55
|
minHeight = _ref$minHeight === void 0 ? '460px' : _ref$minHeight,
|
|
56
|
+
style = _ref.style,
|
|
54
57
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
55
|
-
var templateContext = useContext(TemplateContext);
|
|
56
|
-
|
|
57
58
|
// Used as a target to insert the bottom bar component
|
|
58
59
|
var pageInnerId = useGeneratedHtmlId({
|
|
59
60
|
prefix: 'EuiPageTemplateInner',
|
|
@@ -61,70 +62,62 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
61
62
|
});
|
|
62
63
|
|
|
63
64
|
// Sections include page header
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} else {
|
|
70
|
-
return sidebar.length ? true : 'extended';
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
var getHeaderProps = function getHeaderProps() {
|
|
74
|
-
return {
|
|
75
|
-
restrictWidth: restrictWidth,
|
|
76
|
-
paddingSize: paddingSize,
|
|
77
|
-
bottomBorder: getBottomBorder()
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
var getSectionProps = function getSectionProps() {
|
|
81
|
-
return {
|
|
82
|
-
restrictWidth: restrictWidth,
|
|
83
|
-
paddingSize: paddingSize,
|
|
84
|
-
color: panelled === false ? 'transparent' : 'plain'
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
var getSideBarProps = function getSideBarProps() {
|
|
88
|
-
return {
|
|
89
|
-
paddingSize: paddingSize,
|
|
90
|
-
responsive: responsive
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
var getBottomBarProps = function getBottomBarProps() {
|
|
94
|
-
return {
|
|
95
|
-
restrictWidth: restrictWidth,
|
|
96
|
-
paddingSize: paddingSize,
|
|
97
|
-
// pageInnerId may contain colons that are parsed as pseudo-elements if not escaped
|
|
98
|
-
parent: "#".concat(pageInnerId.replaceAll(':', '\\:'))
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
var innerPanelled = function innerPanelled() {
|
|
102
|
-
return panelled !== null && panelled !== void 0 ? panelled : Boolean(sidebar.length > 0);
|
|
103
|
-
};
|
|
104
|
-
var innerBordered = function innerBordered() {
|
|
105
|
-
return contentBorder !== undefined ? contentBorder : Boolean(sidebar.length > 0);
|
|
106
|
-
};
|
|
107
|
-
React.Children.toArray(children).forEach(function (child, index) {
|
|
108
|
-
if (! /*#__PURE__*/React.isValidElement(child)) return; // Skip non-components
|
|
65
|
+
var _useMemo = useMemo(function () {
|
|
66
|
+
var sidebar = [];
|
|
67
|
+
var sections = [];
|
|
68
|
+
React.Children.toArray(children).forEach(function (child) {
|
|
69
|
+
if (! /*#__PURE__*/React.isValidElement(child)) return; // Skip non-components
|
|
109
70
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
71
|
+
if (child.type === _EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === _EuiPageSidebar) {
|
|
72
|
+
sidebar.push(child);
|
|
73
|
+
} else {
|
|
74
|
+
sections.push(child);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return [sidebar, sections];
|
|
78
|
+
}, [children]),
|
|
79
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
80
|
+
sidebar = _useMemo2[0],
|
|
81
|
+
sections = _useMemo2[1];
|
|
119
82
|
var classes = classNames('euiPageTemplate', className);
|
|
120
|
-
var pageStyle =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
83
|
+
var pageStyle = useMemo(function () {
|
|
84
|
+
return logicalStyles(_objectSpread({
|
|
85
|
+
minHeight: grow ? "max(".concat(minHeight, ", 100vh)") : minHeight,
|
|
86
|
+
paddingTop: offset !== null && offset !== void 0 ? offset : 'var(--euiFixedHeadersOffset, 0)'
|
|
87
|
+
}, style));
|
|
88
|
+
}, [minHeight, grow, offset, style]);
|
|
89
|
+
var innerPanelled = panelled !== null && panelled !== void 0 ? panelled : Boolean(sidebar.length > 0);
|
|
90
|
+
var innerBordered = contentBorder !== null && contentBorder !== void 0 ? contentBorder : Boolean(sidebar.length > 0);
|
|
91
|
+
var headerBottomBorder = bottomBorder !== null && bottomBorder !== void 0 ? bottomBorder : sidebar.length ? true : 'extended';
|
|
92
|
+
var templateContext = useMemo(function () {
|
|
93
|
+
return {
|
|
94
|
+
sidebar: {
|
|
95
|
+
paddingSize: paddingSize,
|
|
96
|
+
responsive: responsive
|
|
97
|
+
},
|
|
98
|
+
header: {
|
|
99
|
+
restrictWidth: restrictWidth,
|
|
100
|
+
paddingSize: paddingSize,
|
|
101
|
+
bottomBorder: headerBottomBorder
|
|
102
|
+
},
|
|
103
|
+
section: {
|
|
104
|
+
restrictWidth: restrictWidth,
|
|
105
|
+
paddingSize: paddingSize,
|
|
106
|
+
color: panelled === false ? 'transparent' : 'plain',
|
|
107
|
+
grow: true
|
|
108
|
+
},
|
|
109
|
+
emptyPrompt: {
|
|
110
|
+
panelled: innerPanelled ? true : panelled,
|
|
111
|
+
grow: true
|
|
112
|
+
},
|
|
113
|
+
bottomBar: {
|
|
114
|
+
restrictWidth: restrictWidth,
|
|
115
|
+
paddingSize: paddingSize,
|
|
116
|
+
// pageInnerId may contain colons that are parsed as pseudo-elements if not escaped
|
|
117
|
+
parent: "#".concat(pageInnerId.replaceAll(':', '\\:'))
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}, [pageInnerId, restrictWidth, responsive, paddingSize, panelled, innerPanelled, headerBottomBorder]);
|
|
128
121
|
return ___EmotionJSX(TemplateContext.Provider, {
|
|
129
122
|
value: templateContext
|
|
130
123
|
}, ___EmotionJSX(EuiPageOuter, _extends({}, rest, {
|
|
@@ -134,32 +127,38 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
134
127
|
}), sidebar, ___EmotionJSX(EuiPageInner, _extends({}, mainProps, {
|
|
135
128
|
component: component,
|
|
136
129
|
id: pageInnerId,
|
|
137
|
-
border: innerBordered
|
|
138
|
-
panelled: innerPanelled
|
|
130
|
+
border: innerBordered,
|
|
131
|
+
panelled: innerPanelled,
|
|
139
132
|
responsive: responsive
|
|
140
133
|
}), sections)));
|
|
141
134
|
};
|
|
135
|
+
var _EuiPageSidebar = function _EuiPageSidebar(props) {
|
|
136
|
+
var _useContext = useContext(TemplateContext),
|
|
137
|
+
sidebar = _useContext.sidebar;
|
|
138
|
+
return ___EmotionJSX(EuiPageSidebar, _extends({}, sidebar, props));
|
|
139
|
+
};
|
|
142
140
|
var _EuiPageSection = function _EuiPageSection(props) {
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}, props));
|
|
141
|
+
var _useContext2 = useContext(TemplateContext),
|
|
142
|
+
section = _useContext2.section;
|
|
143
|
+
return ___EmotionJSX(EuiPageSection, _extends({}, section, props));
|
|
147
144
|
};
|
|
148
145
|
var _EuiPageHeader = function _EuiPageHeader(props) {
|
|
149
|
-
var
|
|
150
|
-
|
|
146
|
+
var _useContext3 = useContext(TemplateContext),
|
|
147
|
+
header = _useContext3.header;
|
|
148
|
+
return ___EmotionJSX(EuiPageHeader, _extends({}, header, props));
|
|
151
149
|
};
|
|
152
150
|
var _EuiPageEmptyPrompt = function _EuiPageEmptyPrompt(props) {
|
|
153
|
-
var
|
|
154
|
-
|
|
151
|
+
var _useContext4 = useContext(TemplateContext),
|
|
152
|
+
emptyPrompt = _useContext4.emptyPrompt;
|
|
153
|
+
return ___EmotionJSX(EuiPageEmptyPrompt, _extends({}, emptyPrompt, props));
|
|
155
154
|
};
|
|
156
155
|
var _EuiPageBottomBar = function _EuiPageBottomBar(props) {
|
|
157
|
-
var
|
|
158
|
-
bottomBar =
|
|
156
|
+
var _useContext5 = useContext(TemplateContext),
|
|
157
|
+
bottomBar = _useContext5.bottomBar;
|
|
159
158
|
return ___EmotionJSX(EuiPageBottomBar, _extends({}, bottomBar, props));
|
|
160
159
|
};
|
|
161
160
|
export var EuiPageTemplate = Object.assign(_EuiPageTemplate, {
|
|
162
|
-
Sidebar:
|
|
161
|
+
Sidebar: _EuiPageSidebar,
|
|
163
162
|
Header: _EuiPageHeader,
|
|
164
163
|
Section: _EuiPageSection,
|
|
165
164
|
BottomBar: _EuiPageBottomBar,
|
|
@@ -117,7 +117,9 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
117
117
|
panelPropsOnKeyDown === null || panelPropsOnKeyDown === void 0 ? void 0 : panelPropsOnKeyDown(event);
|
|
118
118
|
if (event.key === keys.TAB) {
|
|
119
119
|
if (disableFocusTrap) {
|
|
120
|
-
|
|
120
|
+
if (!ownFocus) {
|
|
121
|
+
closePopover();
|
|
122
|
+
}
|
|
121
123
|
} else {
|
|
122
124
|
var tabbableItems = tabbable(event.currentTarget).filter(function (el) {
|
|
123
125
|
return !el.hasAttribute('data-focus-guard');
|
|
@@ -129,7 +131,7 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
|
-
}, [disableFocusTrap, closePopover, panelPropsOnKeyDown]);
|
|
134
|
+
}, [disableFocusTrap, ownFocus, closePopover, panelPropsOnKeyDown]);
|
|
133
135
|
|
|
134
136
|
/**
|
|
135
137
|
* Optional close on scroll behavior
|
|
@@ -308,6 +308,11 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
308
308
|
this.onOpenPopover();
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
// ensure recalculation of panel position on prop updates
|
|
312
|
+
if (this.props.isOpen && (prevProps.anchorPosition !== this.props.anchorPosition || prevProps.buffer !== this.props.buffer || prevProps.offset !== this.props.offset || prevProps.panelPaddingSize !== this.props.panelPaddingSize)) {
|
|
313
|
+
this.positionPopoverFluid();
|
|
314
|
+
}
|
|
315
|
+
|
|
311
316
|
// update scroll listener
|
|
312
317
|
if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
|
|
313
318
|
if (this.props.repositionOnScroll) {
|
|
@@ -33,8 +33,6 @@ var defaults = {
|
|
|
33
33
|
config: {
|
|
34
34
|
multiSelect: true,
|
|
35
35
|
filterWith: 'prefix',
|
|
36
|
-
loadingMessage: 'Loading...',
|
|
37
|
-
noOptionsMessage: 'No options found',
|
|
38
36
|
searchThreshold: 10
|
|
39
37
|
}
|
|
40
38
|
};
|
|
@@ -321,10 +319,10 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
321
319
|
return option.view;
|
|
322
320
|
},
|
|
323
321
|
isLoading: isNil(_this5.state.options),
|
|
324
|
-
loadingMessage: config.loadingMessage
|
|
325
|
-
emptyMessage: config.noOptionsMessage
|
|
322
|
+
loadingMessage: config.loadingMessage,
|
|
323
|
+
emptyMessage: config.noOptionsMessage,
|
|
326
324
|
errorMessage: _this5.state.error,
|
|
327
|
-
noMatchesMessage: config.noOptionsMessage
|
|
325
|
+
noMatchesMessage: config.noOptionsMessage,
|
|
328
326
|
listProps: {
|
|
329
327
|
isVirtualized: isOverSearchThreshold || false
|
|
330
328
|
},
|
|
@@ -269,8 +269,8 @@ function () {
|
|
|
269
269
|
}
|
|
270
270
|
return Exp.string(unescapeValue(text()), location());
|
|
271
271
|
},
|
|
272
|
-
peg$c67 = /^[\-_
|
|
273
|
-
peg$c68 = peg$classExpectation(["-", "_", "*", ":", "/"], false, false),
|
|
272
|
+
peg$c67 = /^[\-_*:\/@]/,
|
|
273
|
+
peg$c68 = peg$classExpectation(["-", "_", "*", ":", "/", "@"], false, false),
|
|
274
274
|
peg$c69 = /^[\xC0-\uFFFF]/,
|
|
275
275
|
peg$c70 = peg$classExpectation([["\xC0", "\uFFFF"]], false, false),
|
|
276
276
|
peg$c71 = /^[\-:\\()]/,
|
|
@@ -17,7 +17,14 @@ var getSelectedOptionForSearchValue = function getSelectedOptionForSearchValue(s
|
|
|
17
17
|
return getSearchableLabel(option) === normalizedSearchValue;
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
|
-
var collectMatchingOption = function collectMatchingOption(
|
|
20
|
+
var collectMatchingOption = function collectMatchingOption(_ref) {
|
|
21
|
+
var selectedOptions = _ref.selectedOptions,
|
|
22
|
+
isPreFiltered = _ref.isPreFiltered,
|
|
23
|
+
option = _ref.option,
|
|
24
|
+
accumulator = _ref.accumulator,
|
|
25
|
+
searchValue = _ref.searchValue,
|
|
26
|
+
normalizedSearchValue = _ref.normalizedSearchValue,
|
|
27
|
+
optionMatcher = _ref.optionMatcher;
|
|
21
28
|
// Don't show options that have already been requested if
|
|
22
29
|
// the selectedOptions list exists
|
|
23
30
|
if (selectedOptions) {
|
|
@@ -37,16 +44,47 @@ var collectMatchingOption = function collectMatchingOption(accumulator, option,
|
|
|
37
44
|
accumulator.push(option);
|
|
38
45
|
return;
|
|
39
46
|
}
|
|
40
|
-
var
|
|
41
|
-
|
|
47
|
+
var isMatching = optionMatcher({
|
|
48
|
+
option: option,
|
|
49
|
+
searchValue: searchValue,
|
|
50
|
+
normalizedSearchValue: normalizedSearchValue
|
|
51
|
+
});
|
|
52
|
+
if (isMatching) {
|
|
42
53
|
accumulator.push(option);
|
|
43
54
|
}
|
|
44
55
|
};
|
|
45
|
-
export var getMatchingOptions = function getMatchingOptions(
|
|
56
|
+
export var getMatchingOptions = function getMatchingOptions(_ref2) {
|
|
57
|
+
var searchValue = _ref2.searchValue,
|
|
58
|
+
options = _ref2.options,
|
|
59
|
+
isPreFiltered = _ref2.isPreFiltered,
|
|
60
|
+
_ref2$selectedOptions = _ref2.selectedOptions,
|
|
61
|
+
selectedOptions = _ref2$selectedOptions === void 0 ? [] : _ref2$selectedOptions,
|
|
62
|
+
optionMatcher = _ref2.optionMatcher;
|
|
46
63
|
var normalizedSearchValue = searchValue.toLowerCase();
|
|
47
64
|
var matchingOptions = [];
|
|
48
65
|
options.forEach(function (option) {
|
|
49
|
-
collectMatchingOption(
|
|
66
|
+
collectMatchingOption({
|
|
67
|
+
accumulator: matchingOptions,
|
|
68
|
+
option: option,
|
|
69
|
+
searchValue: searchValue,
|
|
70
|
+
normalizedSearchValue: normalizedSearchValue,
|
|
71
|
+
isPreFiltered: isPreFiltered,
|
|
72
|
+
selectedOptions: selectedOptions,
|
|
73
|
+
optionMatcher: optionMatcher
|
|
74
|
+
});
|
|
50
75
|
});
|
|
51
76
|
return matchingOptions;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Partial string equality option matcher for EuiSelectable
|
|
81
|
+
* It matches all options with labels including the searched string.
|
|
82
|
+
*/
|
|
83
|
+
export var createPartialStringEqualityOptionMatcher = function createPartialStringEqualityOptionMatcher() {
|
|
84
|
+
return function (_ref3) {
|
|
85
|
+
var option = _ref3.option,
|
|
86
|
+
normalizedSearchValue = _ref3.normalizedSearchValue;
|
|
87
|
+
var normalizedOption = getSearchableLabel(option);
|
|
88
|
+
return normalizedOption.includes(normalizedSearchValue);
|
|
89
|
+
};
|
|
52
90
|
};
|
|
@@ -8,7 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
8
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
-
var _excluded = ["children", "className", "options", "onChange", "onActiveOptionChange", "searchable", "searchProps", "singleSelection", "isLoading", "listProps", "renderOption", "height", "allowExclusions", "aria-label", "aria-describedby", "loadingMessage", "noMatchesMessage", "emptyMessage", "errorMessage", "selectableScreenReaderText", "isPreFiltered"],
|
|
11
|
+
var _excluded = ["children", "className", "options", "onChange", "onActiveOptionChange", "searchable", "searchProps", "singleSelection", "isLoading", "listProps", "renderOption", "height", "allowExclusions", "aria-label", "aria-describedby", "loadingMessage", "noMatchesMessage", "emptyMessage", "errorMessage", "selectableScreenReaderText", "isPreFiltered", "optionMatcher"],
|
|
12
12
|
_excluded2 = ["aria-label", "aria-describedby", "onChange", "defaultValue", "inputRef"],
|
|
13
13
|
_excluded3 = ["aria-label", "aria-describedby", "isVirtualized", "rowHeight"];
|
|
14
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -30,7 +30,7 @@ import { EuiSelectableMessage } from './selectable_message';
|
|
|
30
30
|
import { EuiSelectableList } from './selectable_list';
|
|
31
31
|
import { EuiLoadingSpinner } from '../loading';
|
|
32
32
|
import { EuiSpacer } from '../spacer';
|
|
33
|
-
import { getMatchingOptions } from './matching_options';
|
|
33
|
+
import { createPartialStringEqualityOptionMatcher, getMatchingOptions } from './matching_options';
|
|
34
34
|
import { keys, htmlIdGenerator } from '../../services';
|
|
35
35
|
import { EuiScreenReaderLive, EuiScreenReaderOnly } from '../accessibility';
|
|
36
36
|
import { EuiI18n } from '../i18n';
|
|
@@ -222,9 +222,16 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
222
222
|
_defineProperty(_assertThisInitialized(_this), "onOptionClick", function (options, event, clickedOption) {
|
|
223
223
|
var _this$props = _this.props,
|
|
224
224
|
isPreFiltered = _this$props.isPreFiltered,
|
|
225
|
-
onChange = _this$props.onChange
|
|
225
|
+
onChange = _this$props.onChange,
|
|
226
|
+
optionMatcher = _this$props.optionMatcher;
|
|
226
227
|
var searchValue = _this.state.searchValue;
|
|
227
|
-
var visibleOptions = getMatchingOptions(
|
|
228
|
+
var visibleOptions = getMatchingOptions({
|
|
229
|
+
options: options,
|
|
230
|
+
searchValue: searchValue !== null && searchValue !== void 0 ? searchValue : '',
|
|
231
|
+
isPreFiltered: !!isPreFiltered,
|
|
232
|
+
selectedOptions: [],
|
|
233
|
+
optionMatcher: optionMatcher
|
|
234
|
+
});
|
|
228
235
|
_this.setState({
|
|
229
236
|
visibleOptions: visibleOptions
|
|
230
237
|
});
|
|
@@ -249,7 +256,13 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
249
256
|
_isPreFiltered = props.isPreFiltered,
|
|
250
257
|
searchProps = props.searchProps;
|
|
251
258
|
var initialSearchValue = (searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) || String((searchProps === null || searchProps === void 0 ? void 0 : searchProps.defaultValue) || '');
|
|
252
|
-
var _visibleOptions = getMatchingOptions(
|
|
259
|
+
var _visibleOptions = getMatchingOptions({
|
|
260
|
+
options: _options,
|
|
261
|
+
searchValue: initialSearchValue,
|
|
262
|
+
isPreFiltered: !!_isPreFiltered,
|
|
263
|
+
selectedOptions: [],
|
|
264
|
+
optionMatcher: props.optionMatcher
|
|
265
|
+
});
|
|
253
266
|
searchProps === null || searchProps === void 0 ? void 0 : (_searchProps$onChange = searchProps.onChange) === null || _searchProps$onChange === void 0 ? void 0 : _searchProps$onChange.call(searchProps, initialSearchValue, _visibleOptions);
|
|
254
267
|
|
|
255
268
|
// ensure that the currently selected single option is active if it is in the visibleOptions
|
|
@@ -305,6 +318,7 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
305
318
|
errorMessage = _this$props3.errorMessage,
|
|
306
319
|
selectableScreenReaderText = _this$props3.selectableScreenReaderText,
|
|
307
320
|
isPreFiltered = _this$props3.isPreFiltered,
|
|
321
|
+
optionMatcher = _this$props3.optionMatcher,
|
|
308
322
|
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
309
323
|
var _this$state = this.state,
|
|
310
324
|
searchValue = _this$state.searchValue,
|
|
@@ -443,7 +457,8 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
443
457
|
"aria-activedescendant": _this2.makeOptionId(activeOptionIndex) // the current faux-focused option
|
|
444
458
|
,
|
|
445
459
|
placeholder: placeholderName,
|
|
446
|
-
isPreFiltered: isPreFiltered
|
|
460
|
+
isPreFiltered: !!isPreFiltered,
|
|
461
|
+
optionMatcher: optionMatcher,
|
|
447
462
|
inputRef: function inputRef(node) {
|
|
448
463
|
var _searchProps$inputRef;
|
|
449
464
|
_this2.inputRef = node;
|
|
@@ -487,6 +502,7 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
487
502
|
options: options,
|
|
488
503
|
visibleOptions: visibleOptions,
|
|
489
504
|
searchValue: searchValue,
|
|
505
|
+
isPreFiltered: isPreFiltered,
|
|
490
506
|
activeOptionIndex: activeOptionIndex,
|
|
491
507
|
setActiveOptionIndex: function setActiveOptionIndex(index, cb) {
|
|
492
508
|
_this2.setState({
|
|
@@ -521,7 +537,8 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
521
537
|
var _stateUpdate$searchVa;
|
|
522
538
|
var options = nextProps.options,
|
|
523
539
|
isPreFiltered = nextProps.isPreFiltered,
|
|
524
|
-
searchProps = nextProps.searchProps
|
|
540
|
+
searchProps = nextProps.searchProps,
|
|
541
|
+
optionMatcher = nextProps.optionMatcher;
|
|
525
542
|
var activeOptionIndex = prevState.activeOptionIndex,
|
|
526
543
|
searchValue = prevState.searchValue;
|
|
527
544
|
var stateUpdate = {
|
|
@@ -531,7 +548,13 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
531
548
|
if ((searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) != null && searchProps.value !== searchValue) {
|
|
532
549
|
stateUpdate.searchValue = searchProps.value;
|
|
533
550
|
}
|
|
534
|
-
stateUpdate.visibleOptions = getMatchingOptions(
|
|
551
|
+
stateUpdate.visibleOptions = getMatchingOptions({
|
|
552
|
+
options: options,
|
|
553
|
+
searchValue: (_stateUpdate$searchVa = stateUpdate.searchValue) !== null && _stateUpdate$searchVa !== void 0 ? _stateUpdate$searchVa : '',
|
|
554
|
+
isPreFiltered: !!isPreFiltered,
|
|
555
|
+
selectedOptions: [],
|
|
556
|
+
optionMatcher: optionMatcher
|
|
557
|
+
});
|
|
535
558
|
if (activeOptionIndex != null && activeOptionIndex >= stateUpdate.visibleOptions.length) {
|
|
536
559
|
stateUpdate.activeOptionIndex = -1;
|
|
537
560
|
}
|
|
@@ -544,5 +567,6 @@ _defineProperty(EuiSelectable, "defaultProps", {
|
|
|
544
567
|
options: [],
|
|
545
568
|
singleSelection: false,
|
|
546
569
|
searchable: false,
|
|
547
|
-
isPreFiltered: false
|
|
570
|
+
isPreFiltered: false,
|
|
571
|
+
optionMatcher: createPartialStringEqualityOptionMatcher()
|
|
548
572
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -9,7 +10,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
9
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
11
|
var _excluded = ["data"],
|
|
11
12
|
_excluded2 = ["label", "isGroupLabel", "checked", "disabled", "prepend", "append", "ref", "key", "searchableLabel", "data", "truncationProps"],
|
|
12
|
-
_excluded3 = ["className", "options", "searchValue", "onOptionClick", "renderOption", "height", "windowProps", "rowHeight", "activeOptionIndex", "makeOptionId", "showIcons", "singleSelection", "visibleOptions", "allowExclusions", "bordered", "paddingSize", "searchable", "onFocusBadge", "listId", "setActiveOptionIndex", "aria-label", "aria-labelledby", "aria-describedby", "role", "isVirtualized", "textWrap", "truncationProps"];
|
|
13
|
+
_excluded3 = ["className", "options", "searchValue", "onOptionClick", "renderOption", "height", "windowProps", "rowHeight", "activeOptionIndex", "makeOptionId", "showIcons", "singleSelection", "visibleOptions", "allowExclusions", "bordered", "paddingSize", "searchable", "onFocusBadge", "listId", "setActiveOptionIndex", "aria-label", "aria-labelledby", "aria-describedby", "role", "isPreFiltered", "isVirtualized", "textWrap", "truncationProps"];
|
|
13
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -129,6 +130,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
129
130
|
setActiveOptionIndex = _this$props2.setActiveOptionIndex,
|
|
130
131
|
searchable = _this$props2.searchable,
|
|
131
132
|
searchValue = _this$props2.searchValue,
|
|
133
|
+
isPreFiltered = _this$props2.isPreFiltered,
|
|
132
134
|
isVirtualized = _this$props2.isVirtualized;
|
|
133
135
|
if (isGroupLabel) {
|
|
134
136
|
return ___EmotionJSX("li", _extends({
|
|
@@ -141,13 +143,17 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
141
143
|
var id = makeOptionId(index);
|
|
142
144
|
var isFocused = activeOptionIndex === index;
|
|
143
145
|
|
|
146
|
+
// Search highlighting
|
|
147
|
+
var hasSearch = !!searchValue;
|
|
148
|
+
var highlightSearch = hasSearch && (_typeof(isPreFiltered) === 'object' ? isPreFiltered.highlightSearch !== false : true);
|
|
149
|
+
|
|
144
150
|
// Text wrapping
|
|
145
151
|
var canWrap = !isVirtualized;
|
|
146
152
|
var _textWrap = (_option$textWrap = option.textWrap) !== null && _option$textWrap !== void 0 ? _option$textWrap : _this.props.textWrap;
|
|
147
153
|
var textWrap = canWrap ? _textWrap : 'truncate';
|
|
148
154
|
|
|
149
155
|
// Truncation config (if any). If none, CSS truncation is used
|
|
150
|
-
var truncationProps = textWrap === 'truncate' ? _this.getTruncationProps(option, isFocused) : undefined;
|
|
156
|
+
var truncationProps = textWrap === 'truncate' ? _this.getTruncationProps(option, highlightSearch, isFocused) : undefined;
|
|
151
157
|
return ___EmotionJSX(EuiSelectableListItem, _extends({
|
|
152
158
|
key: id,
|
|
153
159
|
id: id,
|
|
@@ -175,7 +181,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
175
181
|
searchable: searchable,
|
|
176
182
|
textWrap: textWrap
|
|
177
183
|
}, optionRest), renderOption ? renderOption( // @ts-ignore complex
|
|
178
|
-
_objectSpread(_objectSpread({}, _option), optionData), searchValue) :
|
|
184
|
+
_objectSpread(_objectSpread({}, _option), optionData), searchValue) : highlightSearch ? _this.renderSearchedText(label, truncationProps) : truncationProps ? _this.renderTruncatedText(label, truncationProps) : label);
|
|
179
185
|
}, areEqual));
|
|
180
186
|
_defineProperty(_assertThisInitialized(_this), "renderVirtualizedList", function () {
|
|
181
187
|
if (!_this.props.isVirtualized) return null;
|
|
@@ -273,12 +279,12 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
273
279
|
}
|
|
274
280
|
});
|
|
275
281
|
});
|
|
276
|
-
_defineProperty(_assertThisInitialized(_this), "getTruncationProps", function (option, isFocused) {
|
|
282
|
+
_defineProperty(_assertThisInitialized(_this), "getTruncationProps", function (option, highlightSearch, isFocused) {
|
|
277
283
|
// Individual truncation settings should override component-wide settings
|
|
278
284
|
var truncationProps = _objectSpread(_objectSpread({}, _this.props.truncationProps), option.truncationProps);
|
|
279
285
|
|
|
280
286
|
// If we're not actually using EuiTextTruncate, no need to continue
|
|
281
|
-
var hasComplexTruncation =
|
|
287
|
+
var hasComplexTruncation = highlightSearch || Object.keys(truncationProps).length > 0;
|
|
282
288
|
if (!hasComplexTruncation) return undefined;
|
|
283
289
|
|
|
284
290
|
// Determine whether we can use the optimized default option width
|
|
@@ -480,6 +486,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
480
486
|
ariaLabelledby = _this$props10['aria-labelledby'],
|
|
481
487
|
ariaDescribedby = _this$props10['aria-describedby'],
|
|
482
488
|
role = _this$props10.role,
|
|
489
|
+
isPreFiltered = _this$props10.isPreFiltered,
|
|
483
490
|
isVirtualized = _this$props10.isVirtualized,
|
|
484
491
|
textWrap = _this$props10.textWrap,
|
|
485
492
|
truncationProps = _this$props10.truncationProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["onChange", "options", "value", "placeholder", "isPreFiltered", "listId", "className"];
|
|
3
|
+
var _excluded = ["onChange", "options", "value", "placeholder", "isPreFiltered", "listId", "className", "optionMatcher"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -22,12 +22,18 @@ export var EuiSelectableSearch = function EuiSelectableSearch(_ref) {
|
|
|
22
22
|
isPreFiltered = _ref.isPreFiltered,
|
|
23
23
|
listId = _ref.listId,
|
|
24
24
|
className = _ref.className,
|
|
25
|
+
optionMatcher = _ref.optionMatcher,
|
|
25
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
27
|
var onChange = useCallback(function (e) {
|
|
27
28
|
var searchValue = e.target.value;
|
|
28
|
-
var matchingOptions = getMatchingOptions(
|
|
29
|
+
var matchingOptions = getMatchingOptions({
|
|
30
|
+
options: options,
|
|
31
|
+
searchValue: searchValue,
|
|
32
|
+
isPreFiltered: isPreFiltered,
|
|
33
|
+
optionMatcher: optionMatcher
|
|
34
|
+
});
|
|
29
35
|
onChangeCallback(searchValue, matchingOptions);
|
|
30
|
-
}, [options, isPreFiltered, onChangeCallback]);
|
|
36
|
+
}, [options, isPreFiltered, onChangeCallback, optionMatcher]);
|
|
31
37
|
var classes = classNames('euiSelectableSearch', className);
|
|
32
38
|
var ariaPropsIfListIsPresent = listId ? {
|
|
33
39
|
role: 'combobox',
|
|
@@ -76,6 +76,7 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
76
76
|
if (!disabled) onClick(event);
|
|
77
77
|
};
|
|
78
78
|
return ___EmotionJSX("button", _extends({
|
|
79
|
+
"aria-disabled": status === 'disabled' ? true : undefined,
|
|
79
80
|
className: classes,
|
|
80
81
|
title: titleAttr,
|
|
81
82
|
onClick: onStepClick,
|
|
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { euiCanAnimate, euiFontSize, euiTextTruncate, logicalCSS } from '../../global_styling';
|
|
11
|
+
import { euiCanAnimate, euiFontSize, euiTextTruncate, logicalCSS, logicalTextAlignCSS } from '../../global_styling';
|
|
12
12
|
import { euiTableVariables } from './table.styles';
|
|
13
13
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
14
|
name: "1amvdy6-bottom",
|
|
@@ -52,7 +52,7 @@ export var euiTableRowCellStyles = function euiTableRowCellStyles(euiThemeContex
|
|
|
52
52
|
var hasIcons = "line-height: 1;";
|
|
53
53
|
return {
|
|
54
54
|
euiTableRowCell: /*#__PURE__*/css("color:", euiTheme.colors.text, ";;label:euiTableRowCell;"),
|
|
55
|
-
rowHeader: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.regular, ";;label:rowHeader;"),
|
|
55
|
+
rowHeader: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.regular, ";", logicalTextAlignCSS('left'), ";;label:rowHeader;"),
|
|
56
56
|
isExpander: /*#__PURE__*/css(hasIcons, ";;label:isExpander;"),
|
|
57
57
|
hasActions: /*#__PURE__*/css(hasIcons, ";;label:hasActions;"),
|
|
58
58
|
// valign
|
|
@@ -55,17 +55,6 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
55
55
|
var _this$props$onToggle, _this$props;
|
|
56
56
|
var nextState = !_this.isOpen;
|
|
57
57
|
(_this$props$onToggle = (_this$props = _this.props).onToggle) === null || _this$props$onToggle === void 0 ? void 0 : _this$props$onToggle.call(_this$props, nextState);
|
|
58
|
-
|
|
59
|
-
// If the accordion should theoretically be opened, wait a tick (allows
|
|
60
|
-
// consumer state to update) and attempt to focus the child content.
|
|
61
|
-
// NOTE: Even if the accordion does not actually open, this is fine -
|
|
62
|
-
// the `inert` property on the hidden children will prevent focus
|
|
63
|
-
if (nextState === true) {
|
|
64
|
-
requestAnimationFrame(function () {
|
|
65
|
-
var _this$accordionChildr;
|
|
66
|
-
(_this$accordionChildr = _this.accordionChildrenEl) === null || _this$accordionChildr === void 0 ? void 0 : _this$accordionChildr.focus();
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
58
|
} else {
|
|
70
59
|
_this.setState(function (prevState) {
|
|
71
60
|
return {
|
|
@@ -74,21 +63,9 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
74
63
|
}, function () {
|
|
75
64
|
var _this$props$onToggle2, _this$props2;
|
|
76
65
|
(_this$props$onToggle2 = (_this$props2 = _this.props).onToggle) === null || _this$props$onToggle2 === void 0 ? void 0 : _this$props$onToggle2.call(_this$props2, _this.state.isOpen);
|
|
77
|
-
|
|
78
|
-
// If the accordion is open, programmatically move focus
|
|
79
|
-
// from the accordion trigger to the child content
|
|
80
|
-
if (_this.state.isOpen) {
|
|
81
|
-
var _this$accordionChildr2;
|
|
82
|
-
(_this$accordionChildr2 = _this.accordionChildrenEl) === null || _this$accordionChildr2 === void 0 ? void 0 : _this$accordionChildr2.focus();
|
|
83
|
-
}
|
|
84
66
|
});
|
|
85
67
|
}
|
|
86
68
|
});
|
|
87
|
-
// Used to focus the accordion children on user trigger click only (vs controlled/programmatic open)
|
|
88
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "accordionChildrenEl", null);
|
|
89
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "accordionChildrenRef", function (node) {
|
|
90
|
-
_this.accordionChildrenEl = node;
|
|
91
|
-
});
|
|
92
69
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "generatedId", (0, _services.htmlIdGenerator)()());
|
|
93
70
|
return _this;
|
|
94
71
|
}
|
|
@@ -157,8 +134,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
157
134
|
paddingSize: paddingSize,
|
|
158
135
|
isLoading: isLoading,
|
|
159
136
|
isLoadingMessage: isLoadingMessage,
|
|
160
|
-
isOpen: this.isOpen
|
|
161
|
-
accordionChildrenRef: this.accordionChildrenRef
|
|
137
|
+
isOpen: this.isOpen
|
|
162
138
|
}, children));
|
|
163
139
|
}
|
|
164
140
|
}]);
|