@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
|
@@ -280,8 +280,8 @@ function () {
|
|
|
280
280
|
}
|
|
281
281
|
return Exp.string(unescapeValue(text()), location());
|
|
282
282
|
},
|
|
283
|
-
peg$c67 = /^[\-_
|
|
284
|
-
peg$c68 = peg$classExpectation(["-", "_", "*", ":", "/"], false, false),
|
|
283
|
+
peg$c67 = /^[\-_*:\/@]/,
|
|
284
|
+
peg$c68 = peg$classExpectation(["-", "_", "*", ":", "/", "@"], false, false),
|
|
285
285
|
peg$c69 = /^[\xC0-\uFFFF]/,
|
|
286
286
|
peg$c70 = peg$classExpectation([["\xC0", "\uFFFF"]], false, false),
|
|
287
287
|
peg$c71 = /^[\-:\\()]/,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getMatchingOptions = void 0;
|
|
6
|
+
exports.getMatchingOptions = exports.createPartialStringEqualityOptionMatcher = void 0;
|
|
7
7
|
/*
|
|
8
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
9
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -23,7 +23,14 @@ var getSelectedOptionForSearchValue = function getSelectedOptionForSearchValue(s
|
|
|
23
23
|
return getSearchableLabel(option) === normalizedSearchValue;
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
var collectMatchingOption = function collectMatchingOption(
|
|
26
|
+
var collectMatchingOption = function collectMatchingOption(_ref) {
|
|
27
|
+
var selectedOptions = _ref.selectedOptions,
|
|
28
|
+
isPreFiltered = _ref.isPreFiltered,
|
|
29
|
+
option = _ref.option,
|
|
30
|
+
accumulator = _ref.accumulator,
|
|
31
|
+
searchValue = _ref.searchValue,
|
|
32
|
+
normalizedSearchValue = _ref.normalizedSearchValue,
|
|
33
|
+
optionMatcher = _ref.optionMatcher;
|
|
27
34
|
// Don't show options that have already been requested if
|
|
28
35
|
// the selectedOptions list exists
|
|
29
36
|
if (selectedOptions) {
|
|
@@ -43,17 +50,49 @@ var collectMatchingOption = function collectMatchingOption(accumulator, option,
|
|
|
43
50
|
accumulator.push(option);
|
|
44
51
|
return;
|
|
45
52
|
}
|
|
46
|
-
var
|
|
47
|
-
|
|
53
|
+
var isMatching = optionMatcher({
|
|
54
|
+
option: option,
|
|
55
|
+
searchValue: searchValue,
|
|
56
|
+
normalizedSearchValue: normalizedSearchValue
|
|
57
|
+
});
|
|
58
|
+
if (isMatching) {
|
|
48
59
|
accumulator.push(option);
|
|
49
60
|
}
|
|
50
61
|
};
|
|
51
|
-
var getMatchingOptions = function getMatchingOptions(
|
|
62
|
+
var getMatchingOptions = function getMatchingOptions(_ref2) {
|
|
63
|
+
var searchValue = _ref2.searchValue,
|
|
64
|
+
options = _ref2.options,
|
|
65
|
+
isPreFiltered = _ref2.isPreFiltered,
|
|
66
|
+
_ref2$selectedOptions = _ref2.selectedOptions,
|
|
67
|
+
selectedOptions = _ref2$selectedOptions === void 0 ? [] : _ref2$selectedOptions,
|
|
68
|
+
optionMatcher = _ref2.optionMatcher;
|
|
52
69
|
var normalizedSearchValue = searchValue.toLowerCase();
|
|
53
70
|
var matchingOptions = [];
|
|
54
71
|
options.forEach(function (option) {
|
|
55
|
-
collectMatchingOption(
|
|
72
|
+
collectMatchingOption({
|
|
73
|
+
accumulator: matchingOptions,
|
|
74
|
+
option: option,
|
|
75
|
+
searchValue: searchValue,
|
|
76
|
+
normalizedSearchValue: normalizedSearchValue,
|
|
77
|
+
isPreFiltered: isPreFiltered,
|
|
78
|
+
selectedOptions: selectedOptions,
|
|
79
|
+
optionMatcher: optionMatcher
|
|
80
|
+
});
|
|
56
81
|
});
|
|
57
82
|
return matchingOptions;
|
|
58
83
|
};
|
|
59
|
-
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Partial string equality option matcher for EuiSelectable
|
|
87
|
+
* It matches all options with labels including the searched string.
|
|
88
|
+
*/
|
|
89
|
+
exports.getMatchingOptions = getMatchingOptions;
|
|
90
|
+
var createPartialStringEqualityOptionMatcher = function createPartialStringEqualityOptionMatcher() {
|
|
91
|
+
return function (_ref3) {
|
|
92
|
+
var option = _ref3.option,
|
|
93
|
+
normalizedSearchValue = _ref3.normalizedSearchValue;
|
|
94
|
+
var normalizedOption = getSearchableLabel(option);
|
|
95
|
+
return normalizedOption.includes(normalizedSearchValue);
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
exports.createPartialStringEqualityOptionMatcher = createPartialStringEqualityOptionMatcher;
|
|
@@ -17,7 +17,7 @@ var _services = require("../../services");
|
|
|
17
17
|
var _accessibility = require("../accessibility");
|
|
18
18
|
var _i18n = require("../i18n");
|
|
19
19
|
var _react2 = require("@emotion/react");
|
|
20
|
-
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"],
|
|
20
|
+
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"],
|
|
21
21
|
_excluded2 = ["aria-label", "aria-describedby", "onChange", "defaultValue", "inputRef"],
|
|
22
22
|
_excluded3 = ["aria-label", "aria-describedby", "isVirtualized", "rowHeight"];
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -239,9 +239,16 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
239
239
|
_defineProperty(_assertThisInitialized(_this), "onOptionClick", function (options, event, clickedOption) {
|
|
240
240
|
var _this$props = _this.props,
|
|
241
241
|
isPreFiltered = _this$props.isPreFiltered,
|
|
242
|
-
onChange = _this$props.onChange
|
|
242
|
+
onChange = _this$props.onChange,
|
|
243
|
+
optionMatcher = _this$props.optionMatcher;
|
|
243
244
|
var searchValue = _this.state.searchValue;
|
|
244
|
-
var visibleOptions = (0, _matching_options.getMatchingOptions)(
|
|
245
|
+
var visibleOptions = (0, _matching_options.getMatchingOptions)({
|
|
246
|
+
options: options,
|
|
247
|
+
searchValue: searchValue !== null && searchValue !== void 0 ? searchValue : '',
|
|
248
|
+
isPreFiltered: !!isPreFiltered,
|
|
249
|
+
selectedOptions: [],
|
|
250
|
+
optionMatcher: optionMatcher
|
|
251
|
+
});
|
|
245
252
|
_this.setState({
|
|
246
253
|
visibleOptions: visibleOptions
|
|
247
254
|
});
|
|
@@ -266,7 +273,13 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
266
273
|
_isPreFiltered = props.isPreFiltered,
|
|
267
274
|
searchProps = props.searchProps;
|
|
268
275
|
var initialSearchValue = (searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) || String((searchProps === null || searchProps === void 0 ? void 0 : searchProps.defaultValue) || '');
|
|
269
|
-
var _visibleOptions = (0, _matching_options.getMatchingOptions)(
|
|
276
|
+
var _visibleOptions = (0, _matching_options.getMatchingOptions)({
|
|
277
|
+
options: _options,
|
|
278
|
+
searchValue: initialSearchValue,
|
|
279
|
+
isPreFiltered: !!_isPreFiltered,
|
|
280
|
+
selectedOptions: [],
|
|
281
|
+
optionMatcher: props.optionMatcher
|
|
282
|
+
});
|
|
270
283
|
searchProps === null || searchProps === void 0 ? void 0 : (_searchProps$onChange = searchProps.onChange) === null || _searchProps$onChange === void 0 ? void 0 : _searchProps$onChange.call(searchProps, initialSearchValue, _visibleOptions);
|
|
271
284
|
|
|
272
285
|
// ensure that the currently selected single option is active if it is in the visibleOptions
|
|
@@ -322,6 +335,7 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
322
335
|
errorMessage = _this$props3.errorMessage,
|
|
323
336
|
selectableScreenReaderText = _this$props3.selectableScreenReaderText,
|
|
324
337
|
isPreFiltered = _this$props3.isPreFiltered,
|
|
338
|
+
optionMatcher = _this$props3.optionMatcher,
|
|
325
339
|
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
326
340
|
var _this$state = this.state,
|
|
327
341
|
searchValue = _this$state.searchValue,
|
|
@@ -460,7 +474,8 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
460
474
|
"aria-activedescendant": _this2.makeOptionId(activeOptionIndex) // the current faux-focused option
|
|
461
475
|
,
|
|
462
476
|
placeholder: placeholderName,
|
|
463
|
-
isPreFiltered: isPreFiltered
|
|
477
|
+
isPreFiltered: !!isPreFiltered,
|
|
478
|
+
optionMatcher: optionMatcher,
|
|
464
479
|
inputRef: function inputRef(node) {
|
|
465
480
|
var _searchProps$inputRef;
|
|
466
481
|
_this2.inputRef = node;
|
|
@@ -504,6 +519,7 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
504
519
|
options: options,
|
|
505
520
|
visibleOptions: visibleOptions,
|
|
506
521
|
searchValue: searchValue,
|
|
522
|
+
isPreFiltered: isPreFiltered,
|
|
507
523
|
activeOptionIndex: activeOptionIndex,
|
|
508
524
|
setActiveOptionIndex: function setActiveOptionIndex(index, cb) {
|
|
509
525
|
_this2.setState({
|
|
@@ -538,7 +554,8 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
538
554
|
var _stateUpdate$searchVa;
|
|
539
555
|
var options = nextProps.options,
|
|
540
556
|
isPreFiltered = nextProps.isPreFiltered,
|
|
541
|
-
searchProps = nextProps.searchProps
|
|
557
|
+
searchProps = nextProps.searchProps,
|
|
558
|
+
optionMatcher = nextProps.optionMatcher;
|
|
542
559
|
var activeOptionIndex = prevState.activeOptionIndex,
|
|
543
560
|
searchValue = prevState.searchValue;
|
|
544
561
|
var stateUpdate = {
|
|
@@ -548,7 +565,13 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
548
565
|
if ((searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) != null && searchProps.value !== searchValue) {
|
|
549
566
|
stateUpdate.searchValue = searchProps.value;
|
|
550
567
|
}
|
|
551
|
-
stateUpdate.visibleOptions = (0, _matching_options.getMatchingOptions)(
|
|
568
|
+
stateUpdate.visibleOptions = (0, _matching_options.getMatchingOptions)({
|
|
569
|
+
options: options,
|
|
570
|
+
searchValue: (_stateUpdate$searchVa = stateUpdate.searchValue) !== null && _stateUpdate$searchVa !== void 0 ? _stateUpdate$searchVa : '',
|
|
571
|
+
isPreFiltered: !!isPreFiltered,
|
|
572
|
+
selectedOptions: [],
|
|
573
|
+
optionMatcher: optionMatcher
|
|
574
|
+
});
|
|
552
575
|
if (activeOptionIndex != null && activeOptionIndex >= stateUpdate.visibleOptions.length) {
|
|
553
576
|
stateUpdate.activeOptionIndex = -1;
|
|
554
577
|
}
|
|
@@ -562,7 +585,8 @@ _defineProperty(EuiSelectable, "defaultProps", {
|
|
|
562
585
|
options: [],
|
|
563
586
|
singleSelection: false,
|
|
564
587
|
searchable: false,
|
|
565
|
-
isPreFiltered: false
|
|
588
|
+
isPreFiltered: false,
|
|
589
|
+
optionMatcher: (0, _matching_options.createPartialStringEqualityOptionMatcher)()
|
|
566
590
|
});
|
|
567
591
|
EuiSelectable.propTypes = {
|
|
568
592
|
className: _propTypes.default.string,
|
|
@@ -713,14 +737,32 @@ EuiSelectable.propTypes = {
|
|
|
713
737
|
*/
|
|
714
738
|
errorMessage: _propTypes.default.oneOfType([_propTypes.default.element.isRequired, _propTypes.default.string.isRequired, _propTypes.default.oneOf([null])]),
|
|
715
739
|
/**
|
|
716
|
-
* Control whether or not options get filtered internally
|
|
717
|
-
*
|
|
740
|
+
* Control whether or not options get filtered internally (i.e., whether filtering is
|
|
741
|
+
* handled by EUI or by you, the consumer).
|
|
742
|
+
* If set to `true`, all passed `options` will be displayed regardless of the user's
|
|
743
|
+
* search input.
|
|
744
|
+
*
|
|
745
|
+
* Additionally allows passing a configuration object which enables turning off
|
|
746
|
+
* search highlighting if needed.
|
|
747
|
+
*
|
|
748
|
+
* @default false
|
|
718
749
|
*/
|
|
719
|
-
isPreFiltered: _propTypes.default.bool,
|
|
750
|
+
isPreFiltered: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.shape({
|
|
751
|
+
highlightSearch: _propTypes.default.bool
|
|
752
|
+
}).isRequired]),
|
|
720
753
|
/**
|
|
721
754
|
* Optional screen reader instructions to announce upon focus/interaction. This text is read out
|
|
722
755
|
* after the `EuiSelectable` label and a brief pause, but before the default keyboard instructions for
|
|
723
756
|
* interacting with a selectable are read out.
|
|
724
757
|
*/
|
|
725
|
-
selectableScreenReaderText: _propTypes.default.string
|
|
758
|
+
selectableScreenReaderText: _propTypes.default.string,
|
|
759
|
+
/**
|
|
760
|
+
* Optional custom option matcher function
|
|
761
|
+
*
|
|
762
|
+
* @example
|
|
763
|
+
* const exactEqualityMatcher: EuiSelectableOptionMatcher = ({ option, searchValue }) => {
|
|
764
|
+
* return option.label === searchValue;
|
|
765
|
+
* }
|
|
766
|
+
*/
|
|
767
|
+
optionMatcher: _propTypes.default.func
|
|
726
768
|
};
|
|
@@ -16,13 +16,13 @@ var _selectable_list_item = require("./selectable_list_item");
|
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
17
|
var _excluded = ["data"],
|
|
18
18
|
_excluded2 = ["label", "isGroupLabel", "checked", "disabled", "prepend", "append", "ref", "key", "searchableLabel", "data", "truncationProps"],
|
|
19
|
-
_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"];
|
|
19
|
+
_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"];
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
24
23
|
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; }
|
|
25
24
|
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; }
|
|
25
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
26
26
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
27
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -141,6 +141,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
141
141
|
setActiveOptionIndex = _this$props2.setActiveOptionIndex,
|
|
142
142
|
searchable = _this$props2.searchable,
|
|
143
143
|
searchValue = _this$props2.searchValue,
|
|
144
|
+
isPreFiltered = _this$props2.isPreFiltered,
|
|
144
145
|
isVirtualized = _this$props2.isVirtualized;
|
|
145
146
|
if (isGroupLabel) {
|
|
146
147
|
return (0, _react2.jsx)("li", _extends({
|
|
@@ -153,13 +154,17 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
153
154
|
var id = makeOptionId(index);
|
|
154
155
|
var isFocused = activeOptionIndex === index;
|
|
155
156
|
|
|
157
|
+
// Search highlighting
|
|
158
|
+
var hasSearch = !!searchValue;
|
|
159
|
+
var highlightSearch = hasSearch && (_typeof(isPreFiltered) === 'object' ? isPreFiltered.highlightSearch !== false : true);
|
|
160
|
+
|
|
156
161
|
// Text wrapping
|
|
157
162
|
var canWrap = !isVirtualized;
|
|
158
163
|
var _textWrap = (_option$textWrap = option.textWrap) !== null && _option$textWrap !== void 0 ? _option$textWrap : _this.props.textWrap;
|
|
159
164
|
var textWrap = canWrap ? _textWrap : 'truncate';
|
|
160
165
|
|
|
161
166
|
// Truncation config (if any). If none, CSS truncation is used
|
|
162
|
-
var truncationProps = textWrap === 'truncate' ? _this.getTruncationProps(option, isFocused) : undefined;
|
|
167
|
+
var truncationProps = textWrap === 'truncate' ? _this.getTruncationProps(option, highlightSearch, isFocused) : undefined;
|
|
163
168
|
return (0, _react2.jsx)(_selectable_list_item.EuiSelectableListItem, _extends({
|
|
164
169
|
key: id,
|
|
165
170
|
id: id,
|
|
@@ -187,7 +192,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
187
192
|
searchable: searchable,
|
|
188
193
|
textWrap: textWrap
|
|
189
194
|
}, optionRest), renderOption ? renderOption( // @ts-ignore complex
|
|
190
|
-
_objectSpread(_objectSpread({}, _option), optionData), searchValue) :
|
|
195
|
+
_objectSpread(_objectSpread({}, _option), optionData), searchValue) : highlightSearch ? _this.renderSearchedText(label, truncationProps) : truncationProps ? _this.renderTruncatedText(label, truncationProps) : label);
|
|
191
196
|
}, _reactWindow.areEqual));
|
|
192
197
|
_defineProperty(_assertThisInitialized(_this), "renderVirtualizedList", function () {
|
|
193
198
|
if (!_this.props.isVirtualized) return null;
|
|
@@ -285,12 +290,12 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
285
290
|
}
|
|
286
291
|
});
|
|
287
292
|
});
|
|
288
|
-
_defineProperty(_assertThisInitialized(_this), "getTruncationProps", function (option, isFocused) {
|
|
293
|
+
_defineProperty(_assertThisInitialized(_this), "getTruncationProps", function (option, highlightSearch, isFocused) {
|
|
289
294
|
// Individual truncation settings should override component-wide settings
|
|
290
295
|
var truncationProps = _objectSpread(_objectSpread({}, _this.props.truncationProps), option.truncationProps);
|
|
291
296
|
|
|
292
297
|
// If we're not actually using EuiTextTruncate, no need to continue
|
|
293
|
-
var hasComplexTruncation =
|
|
298
|
+
var hasComplexTruncation = highlightSearch || Object.keys(truncationProps).length > 0;
|
|
294
299
|
if (!hasComplexTruncation) return undefined;
|
|
295
300
|
|
|
296
301
|
// Determine whether we can use the optimized default option width
|
|
@@ -492,6 +497,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
492
497
|
ariaLabelledby = _this$props10['aria-labelledby'],
|
|
493
498
|
ariaDescribedby = _this$props10['aria-describedby'],
|
|
494
499
|
role = _this$props10.role,
|
|
500
|
+
isPreFiltered = _this$props10.isPreFiltered,
|
|
495
501
|
isVirtualized = _this$props10.isVirtualized,
|
|
496
502
|
textWrap = _this$props10.textWrap,
|
|
497
503
|
truncationProps = _this$props10.truncationProps,
|
|
@@ -743,6 +749,9 @@ EuiSelectableList.propTypes = {
|
|
|
743
749
|
*/
|
|
744
750
|
allowExclusions: _propTypes.default.bool,
|
|
745
751
|
searchable: _propTypes.default.bool,
|
|
752
|
+
isPreFiltered: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.shape({
|
|
753
|
+
highlightSearch: _propTypes.default.bool
|
|
754
|
+
}).isRequired]),
|
|
746
755
|
makeOptionId: _propTypes.default.func.isRequired,
|
|
747
756
|
listId: _propTypes.default.string.isRequired,
|
|
748
757
|
setActiveOptionIndex: _propTypes.default.func.isRequired
|
|
@@ -10,7 +10,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _form = require("../../form");
|
|
11
11
|
var _matching_options = require("../matching_options");
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
|
-
var _excluded = ["onChange", "options", "value", "placeholder", "isPreFiltered", "listId", "className"];
|
|
13
|
+
var _excluded = ["onChange", "options", "value", "placeholder", "isPreFiltered", "listId", "className", "optionMatcher"];
|
|
14
14
|
/*
|
|
15
15
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
16
16
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -32,12 +32,18 @@ var EuiSelectableSearch = function EuiSelectableSearch(_ref) {
|
|
|
32
32
|
isPreFiltered = _ref.isPreFiltered,
|
|
33
33
|
listId = _ref.listId,
|
|
34
34
|
className = _ref.className,
|
|
35
|
+
optionMatcher = _ref.optionMatcher,
|
|
35
36
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
37
|
var onChange = (0, _react.useCallback)(function (e) {
|
|
37
38
|
var searchValue = e.target.value;
|
|
38
|
-
var matchingOptions = (0, _matching_options.getMatchingOptions)(
|
|
39
|
+
var matchingOptions = (0, _matching_options.getMatchingOptions)({
|
|
40
|
+
options: options,
|
|
41
|
+
searchValue: searchValue,
|
|
42
|
+
isPreFiltered: isPreFiltered,
|
|
43
|
+
optionMatcher: optionMatcher
|
|
44
|
+
});
|
|
39
45
|
onChangeCallback(searchValue, matchingOptions);
|
|
40
|
-
}, [options, isPreFiltered, onChangeCallback]);
|
|
46
|
+
}, [options, isPreFiltered, onChangeCallback, optionMatcher]);
|
|
41
47
|
var classes = (0, _classnames.default)('euiSelectableSearch', className);
|
|
42
48
|
var ariaPropsIfListIsPresent = listId ? {
|
|
43
49
|
role: 'combobox',
|
|
@@ -84,6 +84,7 @@ var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
84
84
|
if (!disabled) onClick(event);
|
|
85
85
|
};
|
|
86
86
|
return (0, _react2.jsx)("button", _extends({
|
|
87
|
+
"aria-disabled": status === 'disabled' ? true : undefined,
|
|
87
88
|
className: classes,
|
|
88
89
|
title: titleAttr,
|
|
89
90
|
onClick: onStepClick,
|
|
@@ -56,7 +56,7 @@ var euiTableRowCellStyles = function euiTableRowCellStyles(euiThemeContext) {
|
|
|
56
56
|
var hasIcons = "line-height: 1;";
|
|
57
57
|
return {
|
|
58
58
|
euiTableRowCell: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.text, ";;label:euiTableRowCell;"),
|
|
59
|
-
rowHeader: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.regular, ";;label:rowHeader;"),
|
|
59
|
+
rowHeader: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.regular, ";", (0, _global_styling.logicalTextAlignCSS)('left'), ";;label:rowHeader;"),
|
|
60
60
|
isExpander: /*#__PURE__*/(0, _react.css)(hasIcons, ";;label:isExpander;"),
|
|
61
61
|
hasActions: /*#__PURE__*/(0, _react.css)(hasIcons, ";;label:hasActions;"),
|
|
62
62
|
// valign
|
|
@@ -46,17 +46,6 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
46
46
|
var _this$props$onToggle, _this$props;
|
|
47
47
|
var nextState = !_this.isOpen;
|
|
48
48
|
(_this$props$onToggle = (_this$props = _this.props).onToggle) === null || _this$props$onToggle === void 0 ? void 0 : _this$props$onToggle.call(_this$props, nextState);
|
|
49
|
-
|
|
50
|
-
// If the accordion should theoretically be opened, wait a tick (allows
|
|
51
|
-
// consumer state to update) and attempt to focus the child content.
|
|
52
|
-
// NOTE: Even if the accordion does not actually open, this is fine -
|
|
53
|
-
// the `inert` property on the hidden children will prevent focus
|
|
54
|
-
if (nextState === true) {
|
|
55
|
-
requestAnimationFrame(function () {
|
|
56
|
-
var _this$accordionChildr;
|
|
57
|
-
(_this$accordionChildr = _this.accordionChildrenEl) === null || _this$accordionChildr === void 0 ? void 0 : _this$accordionChildr.focus();
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
49
|
} else {
|
|
61
50
|
_this.setState(function (prevState) {
|
|
62
51
|
return {
|
|
@@ -65,21 +54,9 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
65
54
|
}, function () {
|
|
66
55
|
var _this$props$onToggle2, _this$props2;
|
|
67
56
|
(_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);
|
|
68
|
-
|
|
69
|
-
// If the accordion is open, programmatically move focus
|
|
70
|
-
// from the accordion trigger to the child content
|
|
71
|
-
if (_this.state.isOpen) {
|
|
72
|
-
var _this$accordionChildr2;
|
|
73
|
-
(_this$accordionChildr2 = _this.accordionChildrenEl) === null || _this$accordionChildr2 === void 0 ? void 0 : _this$accordionChildr2.focus();
|
|
74
|
-
}
|
|
75
57
|
});
|
|
76
58
|
}
|
|
77
59
|
});
|
|
78
|
-
// Used to focus the accordion children on user trigger click only (vs controlled/programmatic open)
|
|
79
|
-
_defineProperty(_assertThisInitialized(_this), "accordionChildrenEl", null);
|
|
80
|
-
_defineProperty(_assertThisInitialized(_this), "accordionChildrenRef", function (node) {
|
|
81
|
-
_this.accordionChildrenEl = node;
|
|
82
|
-
});
|
|
83
60
|
_defineProperty(_assertThisInitialized(_this), "generatedId", htmlIdGenerator()());
|
|
84
61
|
return _this;
|
|
85
62
|
}
|
|
@@ -148,8 +125,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
148
125
|
paddingSize: paddingSize,
|
|
149
126
|
isLoading: isLoading,
|
|
150
127
|
isLoadingMessage: isLoadingMessage,
|
|
151
|
-
isOpen: this.isOpen
|
|
152
|
-
accordionChildrenRef: this.accordionChildrenRef
|
|
128
|
+
isOpen: this.isOpen
|
|
153
129
|
}, children));
|
|
154
130
|
}
|
|
155
131
|
}]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["role", "children", "
|
|
4
|
+
var _excluded = ["role", "children", "paddingSize", "isLoading", "isLoadingMessage", "isOpen"];
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -20,7 +20,6 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
20
20
|
export var EuiAccordionChildren = function EuiAccordionChildren(_ref) {
|
|
21
21
|
var role = _ref.role,
|
|
22
22
|
children = _ref.children,
|
|
23
|
-
accordionChildrenRef = _ref.accordionChildrenRef,
|
|
24
23
|
paddingSize = _ref.paddingSize,
|
|
25
24
|
isLoading = _ref.isLoading,
|
|
26
25
|
isLoadingMessage = _ref.isLoadingMessage,
|
|
@@ -63,9 +62,7 @@ export var EuiAccordionChildren = function EuiAccordionChildren(_ref) {
|
|
|
63
62
|
className: "euiAccordion__childWrapper",
|
|
64
63
|
css: wrapperCssStyles,
|
|
65
64
|
style: heightInlineStyle,
|
|
66
|
-
|
|
67
|
-
role: role,
|
|
68
|
-
tabIndex: -1
|
|
65
|
+
role: role
|
|
69
66
|
// @ts-expect-error - inert property not yet available in React TS defs. TODO: Remove this once https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60822 is merged
|
|
70
67
|
,
|
|
71
68
|
inert: !isOpen ? '' : undefined // Can't pass a boolean currently, Jest throws errors
|
|
@@ -625,7 +625,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
625
625
|
content = items.map(function (item, index) {
|
|
626
626
|
// if there's pagination the item's index must be adjusted to the where it is in the whole dataset
|
|
627
627
|
var tableItemIndex = hasPagination(_this4.props) && _this4.pageSize > 0 ? _this4.props.pagination.pageIndex * _this4.pageSize + index : index;
|
|
628
|
-
return _this4.renderItemRow(item, tableItemIndex);
|
|
628
|
+
return _this4.renderItemRow(item, tableItemIndex, index);
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
631
|
return ___EmotionJSX(RenderWithEuiTheme, null, function (theme) {
|
|
@@ -667,7 +667,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
667
667
|
}
|
|
668
668
|
}, {
|
|
669
669
|
key: "renderItemRow",
|
|
670
|
-
value: function renderItemRow(item, rowIndex) {
|
|
670
|
+
value: function renderItemRow(item, rowIndex, displayedRowIndex) {
|
|
671
671
|
var _this5 = this;
|
|
672
672
|
var _this$props10 = this.props,
|
|
673
673
|
columns = _this$props10.columns,
|
|
@@ -682,7 +682,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
682
682
|
});
|
|
683
683
|
var rowSelectionDisabled = false;
|
|
684
684
|
if (selection) {
|
|
685
|
-
var _this$renderItemSelec = this.renderItemSelectionCell(itemId, item, selected),
|
|
685
|
+
var _this$renderItemSelec = this.renderItemSelectionCell(itemId, item, selected, displayedRowIndex),
|
|
686
686
|
_this$renderItemSelec2 = _slicedToArray(_this$renderItemSelec, 2),
|
|
687
687
|
checkboxCell = _this$renderItemSelec2[0],
|
|
688
688
|
isDisabled = _this$renderItemSelec2[1];
|
|
@@ -743,7 +743,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
743
743
|
}
|
|
744
744
|
}, {
|
|
745
745
|
key: "renderItemSelectionCell",
|
|
746
|
-
value: function renderItemSelectionCell(itemId, item, selected) {
|
|
746
|
+
value: function renderItemSelectionCell(itemId, item, selected, displayedRowIndex) {
|
|
747
747
|
var _this6 = this;
|
|
748
748
|
var selection = this.props.selection;
|
|
749
749
|
var key = "_selection_column_".concat(itemId);
|
|
@@ -767,7 +767,10 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
767
767
|
key: key
|
|
768
768
|
}, ___EmotionJSX(EuiI18n, {
|
|
769
769
|
token: "euiBasicTable.selectThisRow",
|
|
770
|
-
default: "Select
|
|
770
|
+
default: "Select row {index}",
|
|
771
|
+
values: {
|
|
772
|
+
index: displayedRowIndex + 1
|
|
773
|
+
}
|
|
771
774
|
}, function (selectThisRow) {
|
|
772
775
|
return ___EmotionJSX(EuiCheckbox, {
|
|
773
776
|
id: "".concat(_this6.tableId).concat(key, "-checkbox"),
|