@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
package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/ui_plugins.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.getDefaultEuiMarkdownUiPlugins = exports.defaultUiPlugins = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
10
|
var MarkdownTooltip = _interopRequireWildcard(require("../markdown_tooltip"));
|
|
9
11
|
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); }
|
|
10
12
|
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; }
|
|
@@ -16,12 +18,21 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
16
18
|
* Side Public License, v 1.
|
|
17
19
|
*/
|
|
18
20
|
|
|
21
|
+
var DEFAULT_UI_PLUGINS = {
|
|
22
|
+
tooltip: MarkdownTooltip.plugin
|
|
23
|
+
};
|
|
19
24
|
var getDefaultEuiMarkdownUiPlugins = function getDefaultEuiMarkdownUiPlugins() {
|
|
20
25
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
21
26
|
exclude = _ref.exclude;
|
|
22
|
-
var excludeSet = new Set(exclude);
|
|
23
27
|
var uiPlugins = [];
|
|
24
|
-
|
|
28
|
+
Object.entries(DEFAULT_UI_PLUGINS).forEach(function (_ref2) {
|
|
29
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
30
|
+
pluginName = _ref3[0],
|
|
31
|
+
plugin = _ref3[1];
|
|
32
|
+
if (!(exclude !== null && exclude !== void 0 && exclude.includes(pluginName))) {
|
|
33
|
+
uiPlugins.push(plugin);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
25
36
|
return uiPlugins;
|
|
26
37
|
};
|
|
27
38
|
exports.getDefaultEuiMarkdownUiPlugins = getDefaultEuiMarkdownUiPlugins;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports._EuiPageOuter = void 0;
|
|
7
|
+
exports._EuiPageOuter = exports.PAGE_DIRECTIONS = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -19,6 +19,8 @@ var _excluded = ["children", "grow", "direction", "responsive"];
|
|
|
19
19
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
20
20
|
* Side Public License, v 1.
|
|
21
21
|
*/
|
|
22
|
+
var PAGE_DIRECTIONS = ['row', 'column'];
|
|
23
|
+
exports.PAGE_DIRECTIONS = PAGE_DIRECTIONS;
|
|
22
24
|
var _EuiPageOuter = function _EuiPageOuter(_ref) {
|
|
23
25
|
var children = _ref.children,
|
|
24
26
|
_ref$grow = _ref.grow,
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports._EuiPageTemplate = exports.TemplateContext = exports.EuiPageTemplate = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -19,7 +20,7 @@ var _page = require("../page");
|
|
|
19
20
|
var _services = require("../../services");
|
|
20
21
|
var _global_styling = require("../../global_styling");
|
|
21
22
|
var _react2 = require("@emotion/react");
|
|
22
|
-
var _excluded = ["children", "responsive", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "component", "mainProps", "className", "minHeight"];
|
|
23
|
+
var _excluded = ["children", "responsive", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "component", "mainProps", "className", "minHeight", "style"];
|
|
23
24
|
/*
|
|
24
25
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
25
26
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -32,6 +33,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
32
33
|
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; }
|
|
33
34
|
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) { (0, _defineProperty2.default)(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; }
|
|
34
35
|
var TemplateContext = /*#__PURE__*/(0, _react.createContext)({
|
|
36
|
+
sidebar: {},
|
|
35
37
|
section: {},
|
|
36
38
|
header: {},
|
|
37
39
|
emptyPrompt: {},
|
|
@@ -61,9 +63,8 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
61
63
|
className = _ref.className,
|
|
62
64
|
_ref$minHeight = _ref.minHeight,
|
|
63
65
|
minHeight = _ref$minHeight === void 0 ? '460px' : _ref$minHeight,
|
|
66
|
+
style = _ref.style,
|
|
64
67
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
65
|
-
var templateContext = (0, _react.useContext)(TemplateContext);
|
|
66
|
-
|
|
67
68
|
// Used as a target to insert the bottom bar component
|
|
68
69
|
var pageInnerId = (0, _services.useGeneratedHtmlId)({
|
|
69
70
|
prefix: 'EuiPageTemplateInner',
|
|
@@ -71,70 +72,62 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
71
72
|
});
|
|
72
73
|
|
|
73
74
|
// Sections include page header
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} else {
|
|
80
|
-
return sidebar.length ? true : 'extended';
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
var getHeaderProps = function getHeaderProps() {
|
|
84
|
-
return {
|
|
85
|
-
restrictWidth: restrictWidth,
|
|
86
|
-
paddingSize: paddingSize,
|
|
87
|
-
bottomBorder: getBottomBorder()
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
var getSectionProps = function getSectionProps() {
|
|
91
|
-
return {
|
|
92
|
-
restrictWidth: restrictWidth,
|
|
93
|
-
paddingSize: paddingSize,
|
|
94
|
-
color: panelled === false ? 'transparent' : 'plain'
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
var getSideBarProps = function getSideBarProps() {
|
|
98
|
-
return {
|
|
99
|
-
paddingSize: paddingSize,
|
|
100
|
-
responsive: responsive
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
var getBottomBarProps = function getBottomBarProps() {
|
|
104
|
-
return {
|
|
105
|
-
restrictWidth: restrictWidth,
|
|
106
|
-
paddingSize: paddingSize,
|
|
107
|
-
// pageInnerId may contain colons that are parsed as pseudo-elements if not escaped
|
|
108
|
-
parent: "#".concat(pageInnerId.replaceAll(':', '\\:'))
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
var innerPanelled = function innerPanelled() {
|
|
112
|
-
return panelled !== null && panelled !== void 0 ? panelled : Boolean(sidebar.length > 0);
|
|
113
|
-
};
|
|
114
|
-
var innerBordered = function innerBordered() {
|
|
115
|
-
return contentBorder !== undefined ? contentBorder : Boolean(sidebar.length > 0);
|
|
116
|
-
};
|
|
117
|
-
_react.default.Children.toArray(children).forEach(function (child, index) {
|
|
118
|
-
if (! /*#__PURE__*/_react.default.isValidElement(child)) return; // Skip non-components
|
|
75
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
76
|
+
var sidebar = [];
|
|
77
|
+
var sections = [];
|
|
78
|
+
_react.default.Children.toArray(children).forEach(function (child) {
|
|
79
|
+
if (! /*#__PURE__*/_react.default.isValidElement(child)) return; // Skip non-components
|
|
119
80
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
81
|
+
if (child.type === _EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === _EuiPageSidebar) {
|
|
82
|
+
sidebar.push(child);
|
|
83
|
+
} else {
|
|
84
|
+
sections.push(child);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return [sidebar, sections];
|
|
88
|
+
}, [children]),
|
|
89
|
+
_useMemo2 = (0, _slicedToArray2.default)(_useMemo, 2),
|
|
90
|
+
sidebar = _useMemo2[0],
|
|
91
|
+
sections = _useMemo2[1];
|
|
129
92
|
var classes = (0, _classnames.default)('euiPageTemplate', className);
|
|
130
|
-
var pageStyle =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
93
|
+
var pageStyle = (0, _react.useMemo)(function () {
|
|
94
|
+
return (0, _global_styling.logicalStyles)(_objectSpread({
|
|
95
|
+
minHeight: grow ? "max(".concat(minHeight, ", 100vh)") : minHeight,
|
|
96
|
+
paddingTop: offset !== null && offset !== void 0 ? offset : 'var(--euiFixedHeadersOffset, 0)'
|
|
97
|
+
}, style));
|
|
98
|
+
}, [minHeight, grow, offset, style]);
|
|
99
|
+
var innerPanelled = panelled !== null && panelled !== void 0 ? panelled : Boolean(sidebar.length > 0);
|
|
100
|
+
var innerBordered = contentBorder !== null && contentBorder !== void 0 ? contentBorder : Boolean(sidebar.length > 0);
|
|
101
|
+
var headerBottomBorder = bottomBorder !== null && bottomBorder !== void 0 ? bottomBorder : sidebar.length ? true : 'extended';
|
|
102
|
+
var templateContext = (0, _react.useMemo)(function () {
|
|
103
|
+
return {
|
|
104
|
+
sidebar: {
|
|
105
|
+
paddingSize: paddingSize,
|
|
106
|
+
responsive: responsive
|
|
107
|
+
},
|
|
108
|
+
header: {
|
|
109
|
+
restrictWidth: restrictWidth,
|
|
110
|
+
paddingSize: paddingSize,
|
|
111
|
+
bottomBorder: headerBottomBorder
|
|
112
|
+
},
|
|
113
|
+
section: {
|
|
114
|
+
restrictWidth: restrictWidth,
|
|
115
|
+
paddingSize: paddingSize,
|
|
116
|
+
color: panelled === false ? 'transparent' : 'plain',
|
|
117
|
+
grow: true
|
|
118
|
+
},
|
|
119
|
+
emptyPrompt: {
|
|
120
|
+
panelled: innerPanelled ? true : panelled,
|
|
121
|
+
grow: true
|
|
122
|
+
},
|
|
123
|
+
bottomBar: {
|
|
124
|
+
restrictWidth: restrictWidth,
|
|
125
|
+
paddingSize: paddingSize,
|
|
126
|
+
// pageInnerId may contain colons that are parsed as pseudo-elements if not escaped
|
|
127
|
+
parent: "#".concat(pageInnerId.replaceAll(':', '\\:'))
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}, [pageInnerId, restrictWidth, responsive, paddingSize, panelled, innerPanelled, headerBottomBorder]);
|
|
138
131
|
return (0, _react2.jsx)(TemplateContext.Provider, {
|
|
139
132
|
value: templateContext
|
|
140
133
|
}, (0, _react2.jsx)(_outer._EuiPageOuter, (0, _extends2.default)({}, rest, {
|
|
@@ -144,33 +137,39 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
144
137
|
}), sidebar, (0, _react2.jsx)(_inner._EuiPageInner, (0, _extends2.default)({}, mainProps, {
|
|
145
138
|
component: component,
|
|
146
139
|
id: pageInnerId,
|
|
147
|
-
border: innerBordered
|
|
148
|
-
panelled: innerPanelled
|
|
140
|
+
border: innerBordered,
|
|
141
|
+
panelled: innerPanelled,
|
|
149
142
|
responsive: responsive
|
|
150
143
|
}), sections)));
|
|
151
144
|
};
|
|
152
145
|
exports._EuiPageTemplate = _EuiPageTemplate;
|
|
146
|
+
var _EuiPageSidebar = function _EuiPageSidebar(props) {
|
|
147
|
+
var _useContext = (0, _react.useContext)(TemplateContext),
|
|
148
|
+
sidebar = _useContext.sidebar;
|
|
149
|
+
return (0, _react2.jsx)(_page.EuiPageSidebar, (0, _extends2.default)({}, sidebar, props));
|
|
150
|
+
};
|
|
153
151
|
var _EuiPageSection = function _EuiPageSection(props) {
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}, props));
|
|
152
|
+
var _useContext2 = (0, _react.useContext)(TemplateContext),
|
|
153
|
+
section = _useContext2.section;
|
|
154
|
+
return (0, _react2.jsx)(_page.EuiPageSection, (0, _extends2.default)({}, section, props));
|
|
158
155
|
};
|
|
159
156
|
var _EuiPageHeader = function _EuiPageHeader(props) {
|
|
160
|
-
var
|
|
161
|
-
|
|
157
|
+
var _useContext3 = (0, _react.useContext)(TemplateContext),
|
|
158
|
+
header = _useContext3.header;
|
|
159
|
+
return (0, _react2.jsx)(_page.EuiPageHeader, (0, _extends2.default)({}, header, props));
|
|
162
160
|
};
|
|
163
161
|
var _EuiPageEmptyPrompt = function _EuiPageEmptyPrompt(props) {
|
|
164
|
-
var
|
|
165
|
-
|
|
162
|
+
var _useContext4 = (0, _react.useContext)(TemplateContext),
|
|
163
|
+
emptyPrompt = _useContext4.emptyPrompt;
|
|
164
|
+
return (0, _react2.jsx)(_page_empty_prompt._EuiPageEmptyPrompt, (0, _extends2.default)({}, emptyPrompt, props));
|
|
166
165
|
};
|
|
167
166
|
var _EuiPageBottomBar = function _EuiPageBottomBar(props) {
|
|
168
|
-
var
|
|
169
|
-
bottomBar =
|
|
167
|
+
var _useContext5 = (0, _react.useContext)(TemplateContext),
|
|
168
|
+
bottomBar = _useContext5.bottomBar;
|
|
170
169
|
return (0, _react2.jsx)(_page_bottom_bar._EuiPageBottomBar, (0, _extends2.default)({}, bottomBar, props));
|
|
171
170
|
};
|
|
172
171
|
var EuiPageTemplate = Object.assign(_EuiPageTemplate, {
|
|
173
|
-
Sidebar:
|
|
172
|
+
Sidebar: _EuiPageSidebar,
|
|
174
173
|
Header: _EuiPageHeader,
|
|
175
174
|
Section: _EuiPageSection,
|
|
176
175
|
BottomBar: _EuiPageBottomBar,
|
|
@@ -126,7 +126,9 @@ var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
126
126
|
panelPropsOnKeyDown === null || panelPropsOnKeyDown === void 0 ? void 0 : panelPropsOnKeyDown(event);
|
|
127
127
|
if (event.key === _services.keys.TAB) {
|
|
128
128
|
if (disableFocusTrap) {
|
|
129
|
-
|
|
129
|
+
if (!ownFocus) {
|
|
130
|
+
closePopover();
|
|
131
|
+
}
|
|
130
132
|
} else {
|
|
131
133
|
var tabbableItems = (0, _tabbable.tabbable)(event.currentTarget).filter(function (el) {
|
|
132
134
|
return !el.hasAttribute('data-focus-guard');
|
|
@@ -138,7 +140,7 @@ var EuiInputPopover = function EuiInputPopover(_ref) {
|
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
}, [disableFocusTrap, closePopover, panelPropsOnKeyDown]);
|
|
143
|
+
}, [disableFocusTrap, ownFocus, closePopover, panelPropsOnKeyDown]);
|
|
142
144
|
|
|
143
145
|
/**
|
|
144
146
|
* Optional close on scroll behavior
|
|
@@ -319,6 +319,11 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
319
319
|
this.onOpenPopover();
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
+
// ensure recalculation of panel position on prop updates
|
|
323
|
+
if (this.props.isOpen && (prevProps.anchorPosition !== this.props.anchorPosition || prevProps.buffer !== this.props.buffer || prevProps.offset !== this.props.offset || prevProps.panelPaddingSize !== this.props.panelPaddingSize)) {
|
|
324
|
+
this.positionPopoverFluid();
|
|
325
|
+
}
|
|
326
|
+
|
|
322
327
|
// update scroll listener
|
|
323
328
|
if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
|
|
324
329
|
if (this.props.repositionOnScroll) {
|
|
@@ -41,8 +41,6 @@ var defaults = {
|
|
|
41
41
|
config: {
|
|
42
42
|
multiSelect: true,
|
|
43
43
|
filterWith: 'prefix',
|
|
44
|
-
loadingMessage: 'Loading...',
|
|
45
|
-
noOptionsMessage: 'No options found',
|
|
46
44
|
searchThreshold: 10
|
|
47
45
|
}
|
|
48
46
|
};
|
|
@@ -329,10 +327,10 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
329
327
|
return option.view;
|
|
330
328
|
},
|
|
331
329
|
isLoading: (0, _predicate.isNil)(_this5.state.options),
|
|
332
|
-
loadingMessage: config.loadingMessage
|
|
333
|
-
emptyMessage: config.noOptionsMessage
|
|
330
|
+
loadingMessage: config.loadingMessage,
|
|
331
|
+
emptyMessage: config.noOptionsMessage,
|
|
334
332
|
errorMessage: _this5.state.error,
|
|
335
|
-
noMatchesMessage: config.noOptionsMessage
|
|
333
|
+
noMatchesMessage: config.noOptionsMessage,
|
|
336
334
|
listProps: {
|
|
337
335
|
isVirtualized: isOverSearchThreshold || false
|
|
338
336
|
},
|
|
@@ -273,8 +273,8 @@ function () {
|
|
|
273
273
|
}
|
|
274
274
|
return Exp.string(unescapeValue(text()), location());
|
|
275
275
|
},
|
|
276
|
-
peg$c67 = /^[\-_
|
|
277
|
-
peg$c68 = peg$classExpectation(["-", "_", "*", ":", "/"], false, false),
|
|
276
|
+
peg$c67 = /^[\-_*:\/@]/,
|
|
277
|
+
peg$c68 = peg$classExpectation(["-", "_", "*", ":", "/", "@"], false, false),
|
|
278
278
|
peg$c69 = /^[\xC0-\uFFFF]/,
|
|
279
279
|
peg$c70 = peg$classExpectation([["\xC0", "\uFFFF"]], false, false),
|
|
280
280
|
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;
|
|
@@ -28,7 +28,7 @@ var _services = require("../../services");
|
|
|
28
28
|
var _accessibility = require("../accessibility");
|
|
29
29
|
var _i18n = require("../i18n");
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
|
-
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"],
|
|
31
|
+
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"],
|
|
32
32
|
_excluded2 = ["aria-label", "aria-describedby", "onChange", "defaultValue", "inputRef"],
|
|
33
33
|
_excluded3 = ["aria-label", "aria-describedby", "isVirtualized", "rowHeight"];
|
|
34
34
|
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); }
|
|
@@ -228,9 +228,16 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
228
228
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOptionClick", function (options, event, clickedOption) {
|
|
229
229
|
var _this$props = _this.props,
|
|
230
230
|
isPreFiltered = _this$props.isPreFiltered,
|
|
231
|
-
onChange = _this$props.onChange
|
|
231
|
+
onChange = _this$props.onChange,
|
|
232
|
+
optionMatcher = _this$props.optionMatcher;
|
|
232
233
|
var searchValue = _this.state.searchValue;
|
|
233
|
-
var visibleOptions = (0, _matching_options.getMatchingOptions)(
|
|
234
|
+
var visibleOptions = (0, _matching_options.getMatchingOptions)({
|
|
235
|
+
options: options,
|
|
236
|
+
searchValue: searchValue !== null && searchValue !== void 0 ? searchValue : '',
|
|
237
|
+
isPreFiltered: !!isPreFiltered,
|
|
238
|
+
selectedOptions: [],
|
|
239
|
+
optionMatcher: optionMatcher
|
|
240
|
+
});
|
|
234
241
|
_this.setState({
|
|
235
242
|
visibleOptions: visibleOptions
|
|
236
243
|
});
|
|
@@ -255,7 +262,13 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
255
262
|
_isPreFiltered = props.isPreFiltered,
|
|
256
263
|
searchProps = props.searchProps;
|
|
257
264
|
var initialSearchValue = (searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) || String((searchProps === null || searchProps === void 0 ? void 0 : searchProps.defaultValue) || '');
|
|
258
|
-
var _visibleOptions = (0, _matching_options.getMatchingOptions)(
|
|
265
|
+
var _visibleOptions = (0, _matching_options.getMatchingOptions)({
|
|
266
|
+
options: _options,
|
|
267
|
+
searchValue: initialSearchValue,
|
|
268
|
+
isPreFiltered: !!_isPreFiltered,
|
|
269
|
+
selectedOptions: [],
|
|
270
|
+
optionMatcher: props.optionMatcher
|
|
271
|
+
});
|
|
259
272
|
searchProps === null || searchProps === void 0 ? void 0 : (_searchProps$onChange = searchProps.onChange) === null || _searchProps$onChange === void 0 ? void 0 : _searchProps$onChange.call(searchProps, initialSearchValue, _visibleOptions);
|
|
260
273
|
|
|
261
274
|
// ensure that the currently selected single option is active if it is in the visibleOptions
|
|
@@ -311,6 +324,7 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
311
324
|
errorMessage = _this$props3.errorMessage,
|
|
312
325
|
selectableScreenReaderText = _this$props3.selectableScreenReaderText,
|
|
313
326
|
isPreFiltered = _this$props3.isPreFiltered,
|
|
327
|
+
optionMatcher = _this$props3.optionMatcher,
|
|
314
328
|
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
315
329
|
var _this$state = this.state,
|
|
316
330
|
searchValue = _this$state.searchValue,
|
|
@@ -449,7 +463,8 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
449
463
|
"aria-activedescendant": _this2.makeOptionId(activeOptionIndex) // the current faux-focused option
|
|
450
464
|
,
|
|
451
465
|
placeholder: placeholderName,
|
|
452
|
-
isPreFiltered: isPreFiltered
|
|
466
|
+
isPreFiltered: !!isPreFiltered,
|
|
467
|
+
optionMatcher: optionMatcher,
|
|
453
468
|
inputRef: function inputRef(node) {
|
|
454
469
|
var _searchProps$inputRef;
|
|
455
470
|
_this2.inputRef = node;
|
|
@@ -493,6 +508,7 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
493
508
|
options: options,
|
|
494
509
|
visibleOptions: visibleOptions,
|
|
495
510
|
searchValue: searchValue,
|
|
511
|
+
isPreFiltered: isPreFiltered,
|
|
496
512
|
activeOptionIndex: activeOptionIndex,
|
|
497
513
|
setActiveOptionIndex: function setActiveOptionIndex(index, cb) {
|
|
498
514
|
_this2.setState({
|
|
@@ -527,7 +543,8 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
527
543
|
var _stateUpdate$searchVa;
|
|
528
544
|
var options = nextProps.options,
|
|
529
545
|
isPreFiltered = nextProps.isPreFiltered,
|
|
530
|
-
searchProps = nextProps.searchProps
|
|
546
|
+
searchProps = nextProps.searchProps,
|
|
547
|
+
optionMatcher = nextProps.optionMatcher;
|
|
531
548
|
var activeOptionIndex = prevState.activeOptionIndex,
|
|
532
549
|
searchValue = prevState.searchValue;
|
|
533
550
|
var stateUpdate = {
|
|
@@ -537,7 +554,13 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
537
554
|
if ((searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) != null && searchProps.value !== searchValue) {
|
|
538
555
|
stateUpdate.searchValue = searchProps.value;
|
|
539
556
|
}
|
|
540
|
-
stateUpdate.visibleOptions = (0, _matching_options.getMatchingOptions)(
|
|
557
|
+
stateUpdate.visibleOptions = (0, _matching_options.getMatchingOptions)({
|
|
558
|
+
options: options,
|
|
559
|
+
searchValue: (_stateUpdate$searchVa = stateUpdate.searchValue) !== null && _stateUpdate$searchVa !== void 0 ? _stateUpdate$searchVa : '',
|
|
560
|
+
isPreFiltered: !!isPreFiltered,
|
|
561
|
+
selectedOptions: [],
|
|
562
|
+
optionMatcher: optionMatcher
|
|
563
|
+
});
|
|
541
564
|
if (activeOptionIndex != null && activeOptionIndex >= stateUpdate.visibleOptions.length) {
|
|
542
565
|
stateUpdate.activeOptionIndex = -1;
|
|
543
566
|
}
|
|
@@ -551,5 +574,6 @@ exports.EuiSelectable = EuiSelectable;
|
|
|
551
574
|
options: [],
|
|
552
575
|
singleSelection: false,
|
|
553
576
|
searchable: false,
|
|
554
|
-
isPreFiltered: false
|
|
577
|
+
isPreFiltered: false,
|
|
578
|
+
optionMatcher: (0, _matching_options.createPartialStringEqualityOptionMatcher)()
|
|
555
579
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var
|
|
4
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.EuiSelectableList = void 0;
|
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -26,9 +27,9 @@ var _selectable_list_item = require("./selectable_list_item");
|
|
|
26
27
|
var _react2 = require("@emotion/react");
|
|
27
28
|
var _excluded = ["data"],
|
|
28
29
|
_excluded2 = ["label", "isGroupLabel", "checked", "disabled", "prepend", "append", "ref", "key", "searchableLabel", "data", "truncationProps"],
|
|
29
|
-
_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"];
|
|
30
|
+
_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"];
|
|
30
31
|
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); }
|
|
31
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
32
33
|
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; }
|
|
33
34
|
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) { (0, _defineProperty2.default)(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; }
|
|
34
35
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -135,6 +136,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
135
136
|
setActiveOptionIndex = _this$props2.setActiveOptionIndex,
|
|
136
137
|
searchable = _this$props2.searchable,
|
|
137
138
|
searchValue = _this$props2.searchValue,
|
|
139
|
+
isPreFiltered = _this$props2.isPreFiltered,
|
|
138
140
|
isVirtualized = _this$props2.isVirtualized;
|
|
139
141
|
if (isGroupLabel) {
|
|
140
142
|
return (0, _react2.jsx)("li", (0, _extends2.default)({
|
|
@@ -147,13 +149,17 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
147
149
|
var id = makeOptionId(index);
|
|
148
150
|
var isFocused = activeOptionIndex === index;
|
|
149
151
|
|
|
152
|
+
// Search highlighting
|
|
153
|
+
var hasSearch = !!searchValue;
|
|
154
|
+
var highlightSearch = hasSearch && ((0, _typeof2.default)(isPreFiltered) === 'object' ? isPreFiltered.highlightSearch !== false : true);
|
|
155
|
+
|
|
150
156
|
// Text wrapping
|
|
151
157
|
var canWrap = !isVirtualized;
|
|
152
158
|
var _textWrap = (_option$textWrap = option.textWrap) !== null && _option$textWrap !== void 0 ? _option$textWrap : _this.props.textWrap;
|
|
153
159
|
var textWrap = canWrap ? _textWrap : 'truncate';
|
|
154
160
|
|
|
155
161
|
// Truncation config (if any). If none, CSS truncation is used
|
|
156
|
-
var truncationProps = textWrap === 'truncate' ? _this.getTruncationProps(option, isFocused) : undefined;
|
|
162
|
+
var truncationProps = textWrap === 'truncate' ? _this.getTruncationProps(option, highlightSearch, isFocused) : undefined;
|
|
157
163
|
return (0, _react2.jsx)(_selectable_list_item.EuiSelectableListItem, (0, _extends2.default)({
|
|
158
164
|
key: id,
|
|
159
165
|
id: id,
|
|
@@ -181,7 +187,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
181
187
|
searchable: searchable,
|
|
182
188
|
textWrap: textWrap
|
|
183
189
|
}, optionRest), renderOption ? renderOption( // @ts-ignore complex
|
|
184
|
-
_objectSpread(_objectSpread({}, _option), optionData), searchValue) :
|
|
190
|
+
_objectSpread(_objectSpread({}, _option), optionData), searchValue) : highlightSearch ? _this.renderSearchedText(label, truncationProps) : truncationProps ? _this.renderTruncatedText(label, truncationProps) : label);
|
|
185
191
|
}, _reactWindow.areEqual));
|
|
186
192
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderVirtualizedList", function () {
|
|
187
193
|
if (!_this.props.isVirtualized) return null;
|
|
@@ -279,12 +285,12 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
279
285
|
}
|
|
280
286
|
});
|
|
281
287
|
});
|
|
282
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getTruncationProps", function (option, isFocused) {
|
|
288
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getTruncationProps", function (option, highlightSearch, isFocused) {
|
|
283
289
|
// Individual truncation settings should override component-wide settings
|
|
284
290
|
var truncationProps = _objectSpread(_objectSpread({}, _this.props.truncationProps), option.truncationProps);
|
|
285
291
|
|
|
286
292
|
// If we're not actually using EuiTextTruncate, no need to continue
|
|
287
|
-
var hasComplexTruncation =
|
|
293
|
+
var hasComplexTruncation = highlightSearch || Object.keys(truncationProps).length > 0;
|
|
288
294
|
if (!hasComplexTruncation) return undefined;
|
|
289
295
|
|
|
290
296
|
// Determine whether we can use the optimized default option width
|
|
@@ -486,6 +492,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
486
492
|
ariaLabelledby = _this$props10['aria-labelledby'],
|
|
487
493
|
ariaDescribedby = _this$props10['aria-describedby'],
|
|
488
494
|
role = _this$props10.role,
|
|
495
|
+
isPreFiltered = _this$props10.isPreFiltered,
|
|
489
496
|
isVirtualized = _this$props10.isVirtualized,
|
|
490
497
|
textWrap = _this$props10.textWrap,
|
|
491
498
|
truncationProps = _this$props10.truncationProps,
|
|
@@ -13,7 +13,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
var _form = require("../../form");
|
|
14
14
|
var _matching_options = require("../matching_options");
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["onChange", "options", "value", "placeholder", "isPreFiltered", "listId", "className"];
|
|
16
|
+
var _excluded = ["onChange", "options", "value", "placeholder", "isPreFiltered", "listId", "className", "optionMatcher"];
|
|
17
17
|
/*
|
|
18
18
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
19
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -31,12 +31,18 @@ var EuiSelectableSearch = function EuiSelectableSearch(_ref) {
|
|
|
31
31
|
isPreFiltered = _ref.isPreFiltered,
|
|
32
32
|
listId = _ref.listId,
|
|
33
33
|
className = _ref.className,
|
|
34
|
+
optionMatcher = _ref.optionMatcher,
|
|
34
35
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
35
36
|
var onChange = (0, _react.useCallback)(function (e) {
|
|
36
37
|
var searchValue = e.target.value;
|
|
37
|
-
var matchingOptions = (0, _matching_options.getMatchingOptions)(
|
|
38
|
+
var matchingOptions = (0, _matching_options.getMatchingOptions)({
|
|
39
|
+
options: options,
|
|
40
|
+
searchValue: searchValue,
|
|
41
|
+
isPreFiltered: isPreFiltered,
|
|
42
|
+
optionMatcher: optionMatcher
|
|
43
|
+
});
|
|
38
44
|
onChangeCallback(searchValue, matchingOptions);
|
|
39
|
-
}, [options, isPreFiltered, onChangeCallback]);
|
|
45
|
+
}, [options, isPreFiltered, onChangeCallback, optionMatcher]);
|
|
40
46
|
var classes = (0, _classnames.default)('euiSelectableSearch', className);
|
|
41
47
|
var ariaPropsIfListIsPresent = listId ? {
|
|
42
48
|
role: 'combobox',
|