@elastic/eui 88.5.4 → 89.0.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 +26 -526
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +26 -526
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +7 -2
- package/es/components/basic_table/in_memory_table.js +7 -2
- package/es/components/collapsible_nav/collapsible_nav.js +5 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
- package/es/components/color_picker/index.js +0 -4
- package/es/components/combo_box/combo_box.js +142 -304
- package/es/components/combo_box/combo_box_input/combo_box_input.js +0 -13
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +34 -118
- package/es/components/context_menu/context_menu_panel.js +6 -6
- package/es/components/flex/flex_grid.styles.js +1 -1
- package/es/components/flex/flex_group.styles.js +1 -1
- package/es/components/flyout/flyout.js +32 -33
- package/es/components/flyout/flyout.styles.js +13 -3
- package/es/components/form/range/dual_range.js +4 -0
- package/es/components/form/range/range.js +4 -0
- package/es/components/index.js +0 -1
- package/es/components/popover/input_popover.js +47 -3
- package/es/components/popover/popover.js +2 -2
- package/es/components/table/table_row_cell.js +27 -9
- package/es/components/text_truncate/index.js +1 -0
- package/es/components/text_truncate/text_block_truncate.js +78 -0
- package/es/global_styling/reset/global_styles.js +16 -2
- package/es/services/accessibility/index.js +0 -3
- package/es/services/index.js +1 -1
- package/es/test/rtl/component_helpers.d.ts +2 -0
- package/es/test/rtl/component_helpers.js +29 -1
- package/eui.d.ts +375 -667
- package/i18ntokens.json +52 -286
- package/lib/components/basic_table/basic_table.js +7 -2
- package/lib/components/basic_table/in_memory_table.js +7 -2
- package/lib/components/collapsible_nav/collapsible_nav.js +5 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
- package/lib/components/color_picker/index.js +0 -7
- package/lib/components/combo_box/combo_box.js +141 -303
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +0 -13
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +34 -118
- package/lib/components/context_menu/context_menu_panel.js +5 -5
- package/lib/components/flex/flex_grid.styles.js +1 -1
- package/lib/components/flex/flex_group.styles.js +1 -1
- package/lib/components/flyout/flyout.js +31 -32
- package/lib/components/flyout/flyout.styles.js +19 -10
- package/lib/components/form/range/dual_range.js +4 -0
- package/lib/components/index.js +0 -11
- package/lib/components/popover/input_popover.js +48 -3
- package/lib/components/popover/popover.js +1 -1
- package/lib/components/table/table_row_cell.js +26 -8
- package/lib/components/text_truncate/index.js +7 -0
- package/lib/components/text_truncate/text_block_truncate.js +85 -0
- package/lib/global_styling/reset/global_styles.js +16 -2
- package/lib/services/accessibility/index.js +0 -21
- package/lib/services/index.js +0 -21
- package/lib/test/rtl/component_helpers.d.ts +2 -0
- package/lib/test/rtl/component_helpers.js +31 -2
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
- package/optimize/es/components/color_picker/index.js +0 -4
- package/optimize/es/components/combo_box/combo_box.js +137 -304
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +0 -12
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +28 -107
- package/optimize/es/components/context_menu/context_menu_panel.js +6 -6
- package/optimize/es/components/flex/flex_grid.styles.js +1 -1
- package/optimize/es/components/flex/flex_group.styles.js +1 -1
- package/optimize/es/components/flyout/flyout.js +32 -33
- package/optimize/es/components/flyout/flyout.styles.js +13 -3
- package/optimize/es/components/index.js +0 -1
- package/optimize/es/components/popover/input_popover.js +43 -3
- package/optimize/es/components/popover/popover.js +2 -2
- package/optimize/es/components/table/table_row_cell.js +13 -5
- package/optimize/es/components/text_truncate/index.js +1 -0
- package/optimize/es/components/text_truncate/text_block_truncate.js +58 -0
- package/optimize/es/global_styling/reset/global_styles.js +13 -2
- package/optimize/es/services/accessibility/index.js +0 -3
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/test/rtl/component_helpers.d.ts +2 -0
- package/optimize/es/test/rtl/component_helpers.js +29 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
- package/optimize/lib/components/color_picker/index.js +0 -7
- package/optimize/lib/components/combo_box/combo_box.js +136 -303
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +0 -12
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +28 -107
- package/optimize/lib/components/context_menu/context_menu_panel.js +5 -5
- package/optimize/lib/components/flex/flex_grid.styles.js +1 -1
- package/optimize/lib/components/flex/flex_group.styles.js +1 -1
- package/optimize/lib/components/flyout/flyout.js +31 -32
- package/optimize/lib/components/flyout/flyout.styles.js +19 -10
- package/optimize/lib/components/index.js +0 -11
- package/optimize/lib/components/popover/input_popover.js +44 -3
- package/optimize/lib/components/popover/popover.js +1 -1
- package/optimize/lib/components/table/table_row_cell.js +12 -4
- package/optimize/lib/components/text_truncate/index.js +7 -0
- package/optimize/lib/components/text_truncate/text_block_truncate.js +66 -0
- package/optimize/lib/global_styling/reset/global_styles.js +19 -10
- package/optimize/lib/services/accessibility/index.js +0 -21
- package/optimize/lib/services/index.js +0 -21
- package/optimize/lib/test/rtl/component_helpers.d.ts +2 -0
- package/optimize/lib/test/rtl/component_helpers.js +31 -2
- package/package.json +1 -1
- package/src/components/combo_box/combo_box_options_list/_combo_box_options_list.scss +5 -15
- package/src/components/context_menu/_context_menu_panel.scss +4 -0
- package/src/components/index.scss +0 -1
- package/src/global_styling/mixins/_index.scss +0 -1
- package/src/global_styling/variables/_index.scss +0 -1
- package/src/test/README.md +0 -15
- package/src/themes/amsterdam/global_styling/mixins/_index.scss +0 -1
- package/test-env/components/basic_table/basic_table.js +7 -2
- package/test-env/components/basic_table/in_memory_table.js +7 -2
- package/test-env/components/collapsible_nav/collapsible_nav.js +5 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
- package/test-env/components/color_picker/index.js +0 -7
- package/test-env/components/combo_box/combo_box.js +141 -303
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +0 -13
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +33 -117
- package/test-env/components/context_menu/context_menu_panel.js +5 -5
- package/test-env/components/flex/flex_grid.styles.js +1 -1
- package/test-env/components/flex/flex_group.styles.js +1 -1
- package/test-env/components/flyout/flyout.styles.js +19 -10
- package/test-env/components/form/range/dual_range.js +4 -0
- package/test-env/components/index.js +0 -11
- package/test-env/components/popover/input_popover.js +48 -3
- package/test-env/components/popover/popover.js +1 -1
- package/test-env/components/table/table_row_cell.js +26 -8
- package/test-env/components/text_truncate/index.js +7 -0
- package/test-env/components/text_truncate/text_block_truncate.js +82 -0
- package/test-env/global_styling/reset/global_styles.js +19 -10
- package/test-env/services/accessibility/index.js +0 -21
- package/test-env/services/index.js +0 -21
- package/test-env/test/rtl/component_helpers.js +31 -2
- package/es/components/color_picker/color_stops/color_stop_thumb.js +0 -371
- package/es/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -55
- package/es/components/color_picker/color_stops/color_stops.js +0 -499
- package/es/components/color_picker/color_stops/color_stops.styles.js +0 -61
- package/es/components/color_picker/color_stops/index.js +0 -9
- package/es/components/color_picker/color_stops/utils.js +0 -95
- package/es/components/suggest/index.js +0 -10
- package/es/components/suggest/suggest.a11y.js +0 -70
- package/es/components/suggest/suggest.js +0 -347
- package/es/components/suggest/suggest_item.js +0 -123
- package/es/components/suggest/types.js +0 -9
- package/es/services/accessibility/accessible_click_keys.js +0 -17
- package/es/services/accessibility/cascading_menu_keys.js +0 -28
- package/es/services/accessibility/combo_box_keys.js +0 -25
- package/lib/components/color_picker/color_stops/color_stop_thumb.js +0 -380
- package/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -62
- package/lib/components/color_picker/color_stops/color_stops.js +0 -505
- package/lib/components/color_picker/color_stops/color_stops.styles.js +0 -67
- package/lib/components/color_picker/color_stops/index.js +0 -12
- package/lib/components/color_picker/color_stops/utils.js +0 -108
- package/lib/components/suggest/index.js +0 -19
- package/lib/components/suggest/suggest.a11y.js +0 -73
- package/lib/components/suggest/suggest.js +0 -356
- package/lib/components/suggest/suggest_item.js +0 -130
- package/lib/components/suggest/types.js +0 -16
- package/lib/services/accessibility/accessible_click_keys.js +0 -21
- package/lib/services/accessibility/cascading_menu_keys.js +0 -35
- package/lib/services/accessibility/combo_box_keys.js +0 -32
- package/optimize/es/components/color_picker/color_stops/color_stop_thumb.js +0 -329
- package/optimize/es/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -55
- package/optimize/es/components/color_picker/color_stops/color_stops.js +0 -444
- package/optimize/es/components/color_picker/color_stops/color_stops.styles.js +0 -61
- package/optimize/es/components/color_picker/color_stops/index.js +0 -9
- package/optimize/es/components/color_picker/color_stops/utils.js +0 -90
- package/optimize/es/components/suggest/index.js +0 -10
- package/optimize/es/components/suggest/suggest.a11y.js +0 -70
- package/optimize/es/components/suggest/suggest.js +0 -256
- package/optimize/es/components/suggest/suggest_item.js +0 -89
- package/optimize/es/components/suggest/types.js +0 -9
- package/optimize/es/services/accessibility/accessible_click_keys.js +0 -14
- package/optimize/es/services/accessibility/cascading_menu_keys.js +0 -28
- package/optimize/es/services/accessibility/combo_box_keys.js +0 -25
- package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.js +0 -339
- package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -62
- package/optimize/lib/components/color_picker/color_stops/color_stops.js +0 -451
- package/optimize/lib/components/color_picker/color_stops/color_stops.styles.js +0 -67
- package/optimize/lib/components/color_picker/color_stops/index.js +0 -12
- package/optimize/lib/components/color_picker/color_stops/utils.js +0 -106
- package/optimize/lib/components/suggest/index.js +0 -19
- package/optimize/lib/components/suggest/suggest.a11y.js +0 -73
- package/optimize/lib/components/suggest/suggest.js +0 -266
- package/optimize/lib/components/suggest/suggest_item.js +0 -96
- package/optimize/lib/components/suggest/types.js +0 -16
- package/optimize/lib/services/accessibility/accessible_click_keys.js +0 -20
- package/optimize/lib/services/accessibility/cascading_menu_keys.js +0 -35
- package/optimize/lib/services/accessibility/combo_box_keys.js +0 -32
- package/src/components/suggest/_index.scss +0 -5
- package/src/components/suggest/_suggest_input.scss +0 -4
- package/src/components/suggest/_suggest_item.scss +0 -103
- package/src/components/suggest/_variables.scss +0 -13
- package/src/global_styling/mixins/_header.scss +0 -29
- package/src/global_styling/variables/_header.scss +0 -3
- package/test-env/components/color_picker/color_stops/color_stop_thumb.js +0 -372
- package/test-env/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -62
- package/test-env/components/color_picker/color_stops/color_stops.js +0 -494
- package/test-env/components/color_picker/color_stops/color_stops.styles.js +0 -67
- package/test-env/components/color_picker/color_stops/index.js +0 -12
- package/test-env/components/color_picker/color_stops/utils.js +0 -106
- package/test-env/components/suggest/index.js +0 -19
- package/test-env/components/suggest/suggest.a11y.js +0 -73
- package/test-env/components/suggest/suggest.js +0 -348
- package/test-env/components/suggest/suggest_item.js +0 -129
- package/test-env/components/suggest/types.js +0 -16
- package/test-env/services/accessibility/accessible_click_keys.js +0 -20
- package/test-env/services/accessibility/cascading_menu_keys.js +0 -35
- package/test-env/services/accessibility/combo_box_keys.js +0 -32
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["data-test-subj", "async", "className", "compressed", "customOptionText", "fullWidth", "id", "inputRef", "isCaseSensitive", "isClearable", "isDisabled", "isInvalid", "isLoading", "noSuggestions", "onBlur", "onChange", "onCreateOption", "onSearchChange", "options", "placeholder", "renderOption", "rowHeight", "selectedOptions", "singleSelection", "prepend", "sortMatchesBy", "delimiter", "append", "autoFocus", "truncationProps", "aria-label", "aria-labelledby"];
|
|
1
|
+
var _excluded = ["data-test-subj", "async", "className", "compressed", "customOptionText", "fullWidth", "id", "inputRef", "isCaseSensitive", "isClearable", "isDisabled", "isInvalid", "isLoading", "noSuggestions", "onBlur", "onChange", "onCreateOption", "onSearchChange", "options", "placeholder", "renderOption", "rowHeight", "selectedOptions", "singleSelection", "prepend", "sortMatchesBy", "delimiter", "append", "autoFocus", "truncationProps", "inputPopoverProps", "aria-label", "aria-labelledby"];
|
|
2
2
|
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); }
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
@@ -33,9 +33,8 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
33
33
|
import React, { Component } from 'react';
|
|
34
34
|
import PropTypes from "prop-types";
|
|
35
35
|
import classNames from 'classnames';
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import { EuiPortal } from '../portal';
|
|
36
|
+
import { htmlIdGenerator, keys } from '../../services';
|
|
37
|
+
import { EuiInputPopover } from '../popover';
|
|
39
38
|
import { EuiI18n } from '../i18n';
|
|
40
39
|
import { getMatchingOptions, flattenOptionGroups, getSelectedOptionForSearchValue, transformForCaseSensitivity } from './matching_options';
|
|
41
40
|
import { EuiComboBoxInput } from './combo_box_input/combo_box_input';
|
|
@@ -65,9 +64,6 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
65
64
|
activeOptionIndex: -1,
|
|
66
65
|
hasFocus: false,
|
|
67
66
|
isListOpen: false,
|
|
68
|
-
listElement: null,
|
|
69
|
-
listPosition: 'bottom',
|
|
70
|
-
listZIndex: undefined,
|
|
71
67
|
matchingOptions: getMatchingOptions({
|
|
72
68
|
options: _this.props.options,
|
|
73
69
|
selectedOptions: _this.props.selectedOptions,
|
|
@@ -77,118 +73,43 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
77
73
|
showPrevSelected: Boolean(_this.props.singleSelection),
|
|
78
74
|
sortMatchesBy: _this.props.sortMatchesBy
|
|
79
75
|
}),
|
|
80
|
-
searchValue: initialSearchValue
|
|
81
|
-
width: 0
|
|
76
|
+
searchValue: initialSearchValue
|
|
82
77
|
});
|
|
83
|
-
_defineProperty(_assertThisInitialized(_this), "_isMounted", false);
|
|
84
78
|
_defineProperty(_assertThisInitialized(_this), "rootId", htmlIdGenerator());
|
|
85
79
|
// Refs
|
|
86
80
|
_defineProperty(_assertThisInitialized(_this), "comboBoxRefInstance", null);
|
|
87
81
|
_defineProperty(_assertThisInitialized(_this), "comboBoxRefCallback", function (ref) {
|
|
88
82
|
_this.comboBoxRefInstance = ref;
|
|
89
|
-
if (_this.comboBoxRefInstance) {
|
|
90
|
-
var comboBoxBounds = _this.comboBoxRefInstance.getBoundingClientRect();
|
|
91
|
-
_this.setState({
|
|
92
|
-
width: comboBoxBounds.width
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
83
|
});
|
|
96
84
|
_defineProperty(_assertThisInitialized(_this), "searchInputRefInstance", null);
|
|
97
85
|
_defineProperty(_assertThisInitialized(_this), "searchInputRefCallback", function (ref) {
|
|
86
|
+
var _this$props$inputRef, _this$props;
|
|
98
87
|
_this.searchInputRefInstance = ref;
|
|
99
|
-
|
|
88
|
+
(_this$props$inputRef = (_this$props = _this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, ref);
|
|
100
89
|
});
|
|
101
90
|
_defineProperty(_assertThisInitialized(_this), "listRefInstance", null);
|
|
102
91
|
_defineProperty(_assertThisInitialized(_this), "listRefCallback", function (ref) {
|
|
103
|
-
if (_this.comboBoxRefInstance) {
|
|
104
|
-
// find the zIndex of the combobox relative to the page body
|
|
105
|
-
// and use that to depth-position the list box
|
|
106
|
-
// adds an extra `100` to provide some defense around neighboring elements' positioning
|
|
107
|
-
var listZIndex = getElementZIndex(_this.comboBoxRefInstance, document.body) + 100;
|
|
108
|
-
_this.setState({
|
|
109
|
-
listZIndex: listZIndex
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
92
|
_this.listRefInstance = ref;
|
|
113
93
|
});
|
|
114
|
-
_defineProperty(_assertThisInitialized(_this), "toggleButtonRefInstance", null);
|
|
115
|
-
_defineProperty(_assertThisInitialized(_this), "toggleButtonRefCallback", function (ref) {
|
|
116
|
-
_this.toggleButtonRefInstance = ref;
|
|
117
|
-
});
|
|
118
|
-
_defineProperty(_assertThisInitialized(_this), "optionsRefInstances", []);
|
|
119
|
-
_defineProperty(_assertThisInitialized(_this), "optionRefCallback", function (index, ref) {
|
|
120
|
-
_this.optionsRefInstances[index] = ref;
|
|
121
|
-
});
|
|
122
94
|
_defineProperty(_assertThisInitialized(_this), "openList", function () {
|
|
123
95
|
_this.setState({
|
|
124
96
|
isListOpen: true
|
|
125
97
|
});
|
|
126
98
|
});
|
|
127
|
-
_defineProperty(_assertThisInitialized(_this), "closeList", function (
|
|
128
|
-
if (event && event.target === _this.searchInputRefInstance) {
|
|
129
|
-
// really long search values / custom entries triggers a scroll event on the input
|
|
130
|
-
// which the EuiComboBoxOptionsList passes through here
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
99
|
+
_defineProperty(_assertThisInitialized(_this), "closeList", function () {
|
|
133
100
|
_this.clearActiveOption();
|
|
134
101
|
_this.setState({
|
|
135
|
-
listZIndex: undefined,
|
|
136
102
|
isListOpen: false
|
|
137
103
|
});
|
|
138
104
|
});
|
|
139
|
-
_defineProperty(_assertThisInitialized(_this), "updatePosition", function () {
|
|
140
|
-
var listElement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.listElement;
|
|
141
|
-
if (!_this._isMounted) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (!_this.state.isListOpen) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (!listElement) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// it's possible that updateListPosition is called when listElement is becoming visible, but isn't yet
|
|
152
|
-
var listElementBounds = listElement.getBoundingClientRect();
|
|
153
|
-
if (listElementBounds.width === 0 || listElementBounds.height === 0) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
if (!_this.comboBoxRefInstance) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
var comboBoxBounds = _this.comboBoxRefInstance.getBoundingClientRect();
|
|
160
|
-
var _ref = findPopoverPosition({
|
|
161
|
-
allowCrossAxis: false,
|
|
162
|
-
anchor: _this.comboBoxRefInstance,
|
|
163
|
-
popover: listElement,
|
|
164
|
-
position: 'bottom'
|
|
165
|
-
}),
|
|
166
|
-
position = _ref.position,
|
|
167
|
-
top = _ref.top;
|
|
168
|
-
if (_this.listRefInstance) {
|
|
169
|
-
_this.listRefInstance.style.top = "".concat(top, "px");
|
|
170
|
-
// listElement doesn't have its width set until after updating the position
|
|
171
|
-
// which means the popover service won't know about the correct width
|
|
172
|
-
// however, we already know where to position the element
|
|
173
|
-
_this.listRefInstance.style.left = "".concat(comboBoxBounds.left + window.pageXOffset, "px");
|
|
174
|
-
_this.listRefInstance.style.width = "".concat(comboBoxBounds.width, "px");
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Cache for future calls.
|
|
178
|
-
_this.setState({
|
|
179
|
-
listElement: listElement,
|
|
180
|
-
listPosition: position,
|
|
181
|
-
width: comboBoxBounds.width
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
105
|
_defineProperty(_assertThisInitialized(_this), "incrementActiveOptionIndex", function (amount) {
|
|
185
106
|
// If there are no options available, do nothing.
|
|
186
107
|
if (!_this.state.matchingOptions.length) {
|
|
187
108
|
return;
|
|
188
109
|
}
|
|
189
|
-
_this.setState(function (
|
|
190
|
-
var activeOptionIndex =
|
|
191
|
-
matchingOptions =
|
|
110
|
+
_this.setState(function (_ref) {
|
|
111
|
+
var activeOptionIndex = _ref.activeOptionIndex,
|
|
112
|
+
matchingOptions = _ref.matchingOptions;
|
|
192
113
|
var nextActiveOptionIndex;
|
|
193
114
|
if (activeOptionIndex < 0) {
|
|
194
115
|
// If this is the beginning of the user's keyboard navigation of the menu, then we'll focus
|
|
@@ -231,12 +152,12 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
231
152
|
_this.onSearchChange('');
|
|
232
153
|
});
|
|
233
154
|
_defineProperty(_assertThisInitialized(_this), "addCustomOption", function (isContainerBlur, searchValue) {
|
|
234
|
-
var _this$
|
|
235
|
-
isCaseSensitive = _this$
|
|
236
|
-
onCreateOption = _this$
|
|
237
|
-
options = _this$
|
|
238
|
-
selectedOptions = _this$
|
|
239
|
-
singleSelection = _this$
|
|
155
|
+
var _this$props2 = _this.props,
|
|
156
|
+
isCaseSensitive = _this$props2.isCaseSensitive,
|
|
157
|
+
onCreateOption = _this$props2.onCreateOption,
|
|
158
|
+
options = _this$props2.options,
|
|
159
|
+
selectedOptions = _this$props2.selectedOptions,
|
|
160
|
+
singleSelection = _this$props2.singleSelection;
|
|
240
161
|
var matchingOptions = _this.state.matchingOptions;
|
|
241
162
|
if (_this.doesSearchMatchOnlyOption()) {
|
|
242
163
|
_this.onAddOption(matchingOptions[0], isContainerBlur);
|
|
@@ -283,11 +204,11 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
283
204
|
return normalizedSearchSubject === normalizedSearchValue;
|
|
284
205
|
});
|
|
285
206
|
_defineProperty(_assertThisInitialized(_this), "areAllOptionsSelected", function () {
|
|
286
|
-
var _this$
|
|
287
|
-
options = _this$
|
|
288
|
-
selectedOptions = _this$
|
|
289
|
-
async = _this$
|
|
290
|
-
isCaseSensitive = _this$
|
|
207
|
+
var _this$props3 = _this.props,
|
|
208
|
+
options = _this$props3.options,
|
|
209
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
210
|
+
async = _this$props3.async,
|
|
211
|
+
isCaseSensitive = _this$props3.isCaseSensitive;
|
|
291
212
|
// Assume if this is async then there could be infinite options.
|
|
292
213
|
if (async) {
|
|
293
214
|
return false;
|
|
@@ -298,8 +219,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
298
219
|
});
|
|
299
220
|
});
|
|
300
221
|
var numberOfSelectedOptions = 0;
|
|
301
|
-
selectedOptions.forEach(function (
|
|
302
|
-
var label =
|
|
222
|
+
selectedOptions.forEach(function (_ref2) {
|
|
223
|
+
var label = _ref2.label;
|
|
303
224
|
var trimmedLabel = transformForCaseSensitivity(label.trim(), isCaseSensitive);
|
|
304
225
|
if (flattenOptions.findIndex(function (option) {
|
|
305
226
|
return option.label === trimmedLabel;
|
|
@@ -308,9 +229,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
308
229
|
return flattenOptions.length === numberOfSelectedOptions;
|
|
309
230
|
});
|
|
310
231
|
_defineProperty(_assertThisInitialized(_this), "onComboBoxFocus", function (event) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
232
|
+
var _this$props$onFocus, _this$props4;
|
|
233
|
+
(_this$props$onFocus = (_this$props4 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props4, event);
|
|
314
234
|
_this.openList();
|
|
315
235
|
_this.setState({
|
|
316
236
|
hasFocus: true
|
|
@@ -333,10 +253,9 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
333
253
|
var focusedInOptionsList = relatedTarget && _this.listRefInstance && _this.listRefInstance.contains(relatedTarget);
|
|
334
254
|
var focusedInInput = relatedTarget && _this.comboBoxRefInstance && _this.comboBoxRefInstance.contains(relatedTarget);
|
|
335
255
|
if (!focusedInOptionsList && !focusedInInput) {
|
|
256
|
+
var _this$props$onBlur, _this$props5;
|
|
257
|
+
(_this$props$onBlur = (_this$props5 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props5, event);
|
|
336
258
|
_this.closeList();
|
|
337
|
-
if (_this.props.onBlur) {
|
|
338
|
-
_this.props.onBlur(event);
|
|
339
|
-
}
|
|
340
259
|
_this.setState({
|
|
341
260
|
hasFocus: false
|
|
342
261
|
});
|
|
@@ -359,7 +278,9 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
359
278
|
}
|
|
360
279
|
});
|
|
361
280
|
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
|
|
281
|
+
var _this$props$onKeyDown, _this$props6;
|
|
362
282
|
if (_this.props.isDisabled) return;
|
|
283
|
+
event.persist(); // TODO: Remove once React 16 support is dropped
|
|
363
284
|
switch (event.key) {
|
|
364
285
|
case keys.ARROW_UP:
|
|
365
286
|
event.preventDefault();
|
|
@@ -403,9 +324,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
403
324
|
}
|
|
404
325
|
break;
|
|
405
326
|
default:
|
|
406
|
-
|
|
407
|
-
_this.props.onKeyDown(event);
|
|
408
|
-
}
|
|
327
|
+
(_this$props$onKeyDown = (_this$props6 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props6, event);
|
|
409
328
|
}
|
|
410
329
|
});
|
|
411
330
|
_defineProperty(_assertThisInitialized(_this), "onOptionEnterKey", function (option) {
|
|
@@ -418,21 +337,18 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
418
337
|
if (addedOption.disabled) {
|
|
419
338
|
return;
|
|
420
339
|
}
|
|
421
|
-
var _this$
|
|
422
|
-
onChange = _this$
|
|
423
|
-
selectedOptions = _this$
|
|
424
|
-
singleSelectionProp = _this$
|
|
340
|
+
var _this$props7 = _this.props,
|
|
341
|
+
onChange = _this$props7.onChange,
|
|
342
|
+
selectedOptions = _this$props7.selectedOptions,
|
|
343
|
+
singleSelectionProp = _this$props7.singleSelection;
|
|
425
344
|
var singleSelection = Boolean(singleSelectionProp);
|
|
426
345
|
var changeOptions = singleSelection ? [addedOption] : selectedOptions.concat(addedOption);
|
|
427
|
-
|
|
428
|
-
onChange(changeOptions);
|
|
429
|
-
}
|
|
346
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(changeOptions);
|
|
430
347
|
_this.clearSearchValue();
|
|
431
348
|
_this.clearActiveOption();
|
|
432
349
|
if (!isContainerBlur) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
}
|
|
350
|
+
var _this$searchInputRefI2;
|
|
351
|
+
(_this$searchInputRefI2 = _this.searchInputRefInstance) === null || _this$searchInputRefI2 === void 0 ? void 0 : _this$searchInputRefI2.focus();
|
|
436
352
|
}
|
|
437
353
|
if (singleSelection) {
|
|
438
354
|
requestAnimationFrame(function () {
|
|
@@ -445,36 +361,29 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
445
361
|
}
|
|
446
362
|
});
|
|
447
363
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption) {
|
|
448
|
-
var _this$
|
|
449
|
-
onChange = _this$
|
|
450
|
-
selectedOptions = _this$
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}));
|
|
455
|
-
}
|
|
364
|
+
var _this$props8 = _this.props,
|
|
365
|
+
onChange = _this$props8.onChange,
|
|
366
|
+
selectedOptions = _this$props8.selectedOptions;
|
|
367
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectedOptions.filter(function (option) {
|
|
368
|
+
return option !== removedOption;
|
|
369
|
+
}));
|
|
456
370
|
_this.clearActiveOption();
|
|
457
371
|
});
|
|
458
372
|
_defineProperty(_assertThisInitialized(_this), "clearSelectedOptions", function () {
|
|
459
|
-
var onChange
|
|
460
|
-
|
|
461
|
-
onChange([]);
|
|
462
|
-
}
|
|
373
|
+
var _this$props$onChange, _this$props9, _this$searchInputRefI3;
|
|
374
|
+
(_this$props$onChange = (_this$props9 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props9, []);
|
|
463
375
|
|
|
464
376
|
// Clicking the clear button will also cause it to disappear. This would result in focus
|
|
465
377
|
// shifting unexpectedly to the body element so we set it to the input which is more reasonable,
|
|
466
|
-
|
|
467
|
-
_this.searchInputRefInstance.focus();
|
|
468
|
-
}
|
|
378
|
+
(_this$searchInputRefI3 = _this.searchInputRefInstance) === null || _this$searchInputRefI3 === void 0 ? void 0 : _this$searchInputRefI3.focus();
|
|
469
379
|
if (!_this.state.isListOpen) {
|
|
470
380
|
_this.openList();
|
|
471
381
|
}
|
|
472
382
|
});
|
|
473
383
|
_defineProperty(_assertThisInitialized(_this), "onComboBoxClick", function () {
|
|
384
|
+
var _this$searchInputRefI4;
|
|
474
385
|
// When the user clicks anywhere on the box, enter the interaction state.
|
|
475
|
-
|
|
476
|
-
_this.searchInputRefInstance.focus();
|
|
477
|
-
}
|
|
386
|
+
(_this$searchInputRefI4 = _this.searchInputRefInstance) === null || _this$searchInputRefI4 === void 0 ? void 0 : _this$searchInputRefI4.focus();
|
|
478
387
|
|
|
479
388
|
// If the user does this from a state in which an option has focus, then we need to reset it or clear it.
|
|
480
389
|
if (Boolean(_this.props.singleSelection) && _this.props.selectedOptions.length === 1) {
|
|
@@ -489,25 +398,20 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
489
398
|
}
|
|
490
399
|
});
|
|
491
400
|
_defineProperty(_assertThisInitialized(_this), "onOpenListClick", function () {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
}
|
|
401
|
+
var _this$searchInputRefI5;
|
|
402
|
+
(_this$searchInputRefI5 = _this.searchInputRefInstance) === null || _this$searchInputRefI5 === void 0 ? void 0 : _this$searchInputRefI5.focus();
|
|
495
403
|
if (!_this.state.isListOpen) {
|
|
496
404
|
_this.openList();
|
|
497
405
|
}
|
|
498
406
|
});
|
|
499
407
|
_defineProperty(_assertThisInitialized(_this), "onOptionListScroll", function () {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
_defineProperty(_assertThisInitialized(_this), "onCloseListClick", function () {
|
|
505
|
-
_this.closeList();
|
|
408
|
+
var _this$searchInputRefI6;
|
|
409
|
+
(_this$searchInputRefI6 = _this.searchInputRefInstance) === null || _this$searchInputRefI6 === void 0 ? void 0 : _this$searchInputRefI6.focus();
|
|
506
410
|
});
|
|
507
411
|
_defineProperty(_assertThisInitialized(_this), "onSearchChange", function (searchValue) {
|
|
508
|
-
var _this$
|
|
509
|
-
onSearchChange = _this$
|
|
510
|
-
delimiter = _this$
|
|
412
|
+
var _this$props10 = _this.props,
|
|
413
|
+
onSearchChange = _this$props10.onSearchChange,
|
|
414
|
+
delimiter = _this$props10.delimiter;
|
|
511
415
|
if (onSearchChange) {
|
|
512
416
|
var _hasMatchingOptions = _this.state.matchingOptions.length > 0;
|
|
513
417
|
onSearchChange(searchValue, _hasMatchingOptions);
|
|
@@ -521,126 +425,53 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
521
425
|
_this.setCustomOptions(false);
|
|
522
426
|
}
|
|
523
427
|
});
|
|
524
|
-
_defineProperty(_assertThisInitialized(_this), "updateMatchingOptionsIfDifferent", function (newMatchingOptions) {
|
|
525
|
-
var _this$state = _this.state,
|
|
526
|
-
matchingOptions = _this$state.matchingOptions,
|
|
527
|
-
activeOptionIndex = _this$state.activeOptionIndex;
|
|
528
|
-
var _this$props6 = _this.props,
|
|
529
|
-
singleSelection = _this$props6.singleSelection,
|
|
530
|
-
selectedOptions = _this$props6.selectedOptions;
|
|
531
|
-
var areOptionsDifferent = false;
|
|
532
|
-
if (matchingOptions.length !== newMatchingOptions.length) {
|
|
533
|
-
areOptionsDifferent = true;
|
|
534
|
-
} else {
|
|
535
|
-
for (var i = 0; i < matchingOptions.length; i++) {
|
|
536
|
-
if (matchingOptions[i].label !== newMatchingOptions[i].label) {
|
|
537
|
-
areOptionsDifferent = true;
|
|
538
|
-
break;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
if (areOptionsDifferent) {
|
|
543
|
-
_this.optionsRefInstances = [];
|
|
544
|
-
var nextActiveOptionIndex = activeOptionIndex;
|
|
545
|
-
// ensure that the currently selected single option is active if it is in the matchingOptions
|
|
546
|
-
if (Boolean(singleSelection) && selectedOptions.length === 1) {
|
|
547
|
-
if (newMatchingOptions.includes(selectedOptions[0])) {
|
|
548
|
-
nextActiveOptionIndex = newMatchingOptions.indexOf(selectedOptions[0]);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
_this.setState({
|
|
552
|
-
matchingOptions: newMatchingOptions,
|
|
553
|
-
activeOptionIndex: nextActiveOptionIndex
|
|
554
|
-
});
|
|
555
|
-
if (!newMatchingOptions.length) {
|
|
556
|
-
// Prevent endless setState -> componentWillUpdate -> setState loop.
|
|
557
|
-
if (_this.hasActiveOption()) {
|
|
558
|
-
_this.clearActiveOption();
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
});
|
|
563
428
|
return _this;
|
|
564
429
|
}
|
|
565
430
|
_createClass(EuiComboBox, [{
|
|
566
|
-
key: "componentDidMount",
|
|
567
|
-
value: function componentDidMount() {
|
|
568
|
-
this._isMounted = true;
|
|
569
|
-
}
|
|
570
|
-
}, {
|
|
571
|
-
key: "componentDidUpdate",
|
|
572
|
-
value: function componentDidUpdate() {
|
|
573
|
-
var _this$props7 = this.props,
|
|
574
|
-
options = _this$props7.options,
|
|
575
|
-
selectedOptions = _this$props7.selectedOptions,
|
|
576
|
-
singleSelection = _this$props7.singleSelection,
|
|
577
|
-
sortMatchesBy = _this$props7.sortMatchesBy;
|
|
578
|
-
var searchValue = this.state.searchValue;
|
|
579
|
-
|
|
580
|
-
// React 16.3 has a bug (fixed in 16.4) where getDerivedStateFromProps
|
|
581
|
-
// isn't called after a state change, and we track `searchValue` in state
|
|
582
|
-
// instead we need to react to a change in searchValue here
|
|
583
|
-
this.updateMatchingOptionsIfDifferent(getMatchingOptions({
|
|
584
|
-
options: options,
|
|
585
|
-
selectedOptions: selectedOptions,
|
|
586
|
-
searchValue: searchValue,
|
|
587
|
-
isCaseSensitive: this.props.isCaseSensitive,
|
|
588
|
-
isPreFiltered: this.props.async,
|
|
589
|
-
showPrevSelected: Boolean(singleSelection),
|
|
590
|
-
sortMatchesBy: sortMatchesBy
|
|
591
|
-
}));
|
|
592
|
-
}
|
|
593
|
-
}, {
|
|
594
|
-
key: "componentWillUnmount",
|
|
595
|
-
value: function componentWillUnmount() {
|
|
596
|
-
this._isMounted = false;
|
|
597
|
-
}
|
|
598
|
-
}, {
|
|
599
431
|
key: "render",
|
|
600
432
|
value: function render() {
|
|
601
433
|
var _this2 = this;
|
|
602
|
-
var _this$
|
|
603
|
-
dataTestSubj = _this$
|
|
604
|
-
async = _this$
|
|
605
|
-
className = _this$
|
|
606
|
-
compressed = _this$
|
|
607
|
-
customOptionText = _this$
|
|
608
|
-
fullWidth = _this$
|
|
609
|
-
id = _this$
|
|
610
|
-
inputRef = _this$
|
|
611
|
-
isCaseSensitive = _this$
|
|
612
|
-
isClearable = _this$
|
|
613
|
-
isDisabled = _this$
|
|
614
|
-
isInvalid = _this$
|
|
615
|
-
isLoading = _this$
|
|
616
|
-
noSuggestions = _this$
|
|
617
|
-
onBlur = _this$
|
|
618
|
-
onChange = _this$
|
|
619
|
-
onCreateOption = _this$
|
|
620
|
-
onSearchChange = _this$
|
|
621
|
-
options = _this$
|
|
622
|
-
placeholder = _this$
|
|
623
|
-
renderOption = _this$
|
|
624
|
-
rowHeight = _this$
|
|
625
|
-
selectedOptions = _this$
|
|
626
|
-
singleSelection = _this$
|
|
627
|
-
prepend = _this$
|
|
628
|
-
sortMatchesBy = _this$
|
|
629
|
-
delimiter = _this$
|
|
630
|
-
append = _this$
|
|
631
|
-
autoFocus = _this$
|
|
632
|
-
truncationProps = _this$
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
searchValue = _this$
|
|
642
|
-
|
|
643
|
-
matchingOptions = _this$state2.matchingOptions;
|
|
434
|
+
var _this$props11 = this.props,
|
|
435
|
+
dataTestSubj = _this$props11['data-test-subj'],
|
|
436
|
+
async = _this$props11.async,
|
|
437
|
+
className = _this$props11.className,
|
|
438
|
+
compressed = _this$props11.compressed,
|
|
439
|
+
customOptionText = _this$props11.customOptionText,
|
|
440
|
+
fullWidth = _this$props11.fullWidth,
|
|
441
|
+
id = _this$props11.id,
|
|
442
|
+
inputRef = _this$props11.inputRef,
|
|
443
|
+
isCaseSensitive = _this$props11.isCaseSensitive,
|
|
444
|
+
isClearable = _this$props11.isClearable,
|
|
445
|
+
isDisabled = _this$props11.isDisabled,
|
|
446
|
+
isInvalid = _this$props11.isInvalid,
|
|
447
|
+
isLoading = _this$props11.isLoading,
|
|
448
|
+
noSuggestions = _this$props11.noSuggestions,
|
|
449
|
+
onBlur = _this$props11.onBlur,
|
|
450
|
+
onChange = _this$props11.onChange,
|
|
451
|
+
onCreateOption = _this$props11.onCreateOption,
|
|
452
|
+
onSearchChange = _this$props11.onSearchChange,
|
|
453
|
+
options = _this$props11.options,
|
|
454
|
+
placeholder = _this$props11.placeholder,
|
|
455
|
+
renderOption = _this$props11.renderOption,
|
|
456
|
+
rowHeight = _this$props11.rowHeight,
|
|
457
|
+
selectedOptions = _this$props11.selectedOptions,
|
|
458
|
+
singleSelection = _this$props11.singleSelection,
|
|
459
|
+
prepend = _this$props11.prepend,
|
|
460
|
+
sortMatchesBy = _this$props11.sortMatchesBy,
|
|
461
|
+
delimiter = _this$props11.delimiter,
|
|
462
|
+
append = _this$props11.append,
|
|
463
|
+
autoFocus = _this$props11.autoFocus,
|
|
464
|
+
truncationProps = _this$props11.truncationProps,
|
|
465
|
+
inputPopoverProps = _this$props11.inputPopoverProps,
|
|
466
|
+
ariaLabel = _this$props11['aria-label'],
|
|
467
|
+
ariaLabelledby = _this$props11['aria-labelledby'],
|
|
468
|
+
rest = _objectWithoutProperties(_this$props11, _excluded);
|
|
469
|
+
var _this$state = this.state,
|
|
470
|
+
activeOptionIndex = _this$state.activeOptionIndex,
|
|
471
|
+
hasFocus = _this$state.hasFocus,
|
|
472
|
+
isListOpen = _this$state.isListOpen,
|
|
473
|
+
searchValue = _this$state.searchValue,
|
|
474
|
+
matchingOptions = _this$state.matchingOptions;
|
|
644
475
|
|
|
645
476
|
// Make sure we have a valid ID if users don't pass one as a prop
|
|
646
477
|
var inputId = id !== null && id !== void 0 ? id : this.rootId('_eui-combobox-id');
|
|
@@ -664,12 +495,11 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
664
495
|
var optionsList;
|
|
665
496
|
if (!noSuggestions && isListOpen) {
|
|
666
497
|
var optionsListDataTestSubj = dataTestSubj ? "".concat(dataTestSubj, "-optionsList") : undefined;
|
|
667
|
-
optionsList = ___EmotionJSX(
|
|
498
|
+
optionsList = ___EmotionJSX(EuiI18n, {
|
|
668
499
|
token: "euiComboBox.listboxAriaLabel",
|
|
669
500
|
default: "Choose from the following options"
|
|
670
501
|
}, function (listboxAriaLabel) {
|
|
671
502
|
return ___EmotionJSX(EuiComboBoxOptionsList, {
|
|
672
|
-
zIndex: _this2.state.listZIndex,
|
|
673
503
|
activeOptionIndex: _this2.state.activeOptionIndex,
|
|
674
504
|
areAllOptionsSelected: _this2.areAllOptionsSelected(),
|
|
675
505
|
customOptionText: customOptionText,
|
|
@@ -684,9 +514,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
684
514
|
onOptionClick: _this2.onOptionClick,
|
|
685
515
|
onOptionEnterKey: _this2.onOptionEnterKey,
|
|
686
516
|
onScroll: _this2.onOptionListScroll,
|
|
687
|
-
optionRef: _this2.optionRefCallback,
|
|
688
517
|
options: options,
|
|
689
|
-
position: listPosition,
|
|
690
518
|
singleSelection: singleSelection,
|
|
691
519
|
renderOption: renderOption,
|
|
692
520
|
rootId: _this2.rootId,
|
|
@@ -694,14 +522,12 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
694
522
|
scrollToIndex: activeOptionIndex,
|
|
695
523
|
searchValue: searchValue,
|
|
696
524
|
selectedOptions: selectedOptions,
|
|
697
|
-
updatePosition: _this2.updatePosition,
|
|
698
|
-
width: width,
|
|
699
525
|
delimiter: delimiter,
|
|
700
526
|
getSelectedOptionForSearchValue: getSelectedOptionForSearchValue,
|
|
701
527
|
listboxAriaLabel: listboxAriaLabel,
|
|
702
528
|
truncationProps: truncationProps
|
|
703
529
|
});
|
|
704
|
-
})
|
|
530
|
+
});
|
|
705
531
|
}
|
|
706
532
|
return (
|
|
707
533
|
/**
|
|
@@ -717,39 +543,46 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
717
543
|
onKeyDown: this.onKeyDown,
|
|
718
544
|
onBlur: this.onContainerBlur,
|
|
719
545
|
ref: this.comboBoxRefCallback
|
|
720
|
-
}), ___EmotionJSX(
|
|
721
|
-
compressed: compressed,
|
|
722
|
-
focusedOptionId: this.hasActiveOption() ? this.rootId("_option-".concat(this.state.activeOptionIndex)) : undefined,
|
|
546
|
+
}), ___EmotionJSX(EuiInputPopover, _extends({
|
|
723
547
|
fullWidth: fullWidth,
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
548
|
+
panelPaddingSize: "none",
|
|
549
|
+
disableFocusTrap: true,
|
|
550
|
+
closeOnScroll: true
|
|
551
|
+
}, inputPopoverProps, {
|
|
552
|
+
isOpen: isListOpen,
|
|
553
|
+
closePopover: this.closeList,
|
|
554
|
+
input: ___EmotionJSX(EuiComboBoxInput, {
|
|
555
|
+
compressed: compressed,
|
|
556
|
+
focusedOptionId: this.hasActiveOption() ? this.rootId("_option-".concat(this.state.activeOptionIndex)) : undefined,
|
|
557
|
+
fullWidth: fullWidth,
|
|
558
|
+
hasSelectedOptions: selectedOptions.length > 0,
|
|
559
|
+
id: inputId,
|
|
560
|
+
inputRef: this.searchInputRefCallback,
|
|
561
|
+
isDisabled: isDisabled,
|
|
562
|
+
isListOpen: isListOpen,
|
|
563
|
+
noIcon: !!noSuggestions,
|
|
564
|
+
onChange: this.onSearchChange,
|
|
565
|
+
onClear: isClearable && !isDisabled ? this.clearSelectedOptions : undefined,
|
|
566
|
+
onClick: this.onComboBoxClick,
|
|
567
|
+
onCloseListClick: this.closeList,
|
|
568
|
+
onFocus: this.onComboBoxFocus,
|
|
569
|
+
onOpenListClick: this.onOpenListClick,
|
|
570
|
+
onRemoveOption: this.onRemoveOption,
|
|
571
|
+
placeholder: placeholder,
|
|
572
|
+
rootId: this.rootId,
|
|
573
|
+
searchValue: searchValue,
|
|
574
|
+
selectedOptions: selectedOptions,
|
|
575
|
+
singleSelection: singleSelection,
|
|
576
|
+
value: value,
|
|
577
|
+
append: singleSelection ? append : undefined,
|
|
578
|
+
prepend: singleSelection ? prepend : undefined,
|
|
579
|
+
isLoading: isLoading,
|
|
580
|
+
isInvalid: markAsInvalid,
|
|
581
|
+
autoFocus: autoFocus,
|
|
582
|
+
"aria-label": ariaLabel,
|
|
583
|
+
"aria-labelledby": ariaLabelledby
|
|
584
|
+
})
|
|
585
|
+
}), optionsList))
|
|
753
586
|
);
|
|
754
587
|
}
|
|
755
588
|
}], [{
|
|
@@ -904,5 +737,10 @@ EuiComboBox.propTypes = {
|
|
|
904
737
|
* text will always take precedence.
|
|
905
738
|
*/
|
|
906
739
|
truncationProps: PropTypes.any,
|
|
740
|
+
/**
|
|
741
|
+
* Allows customizing the underlying EuiInputPopover component
|
|
742
|
+
* (except for props that control state).
|
|
743
|
+
*/
|
|
744
|
+
inputPopoverProps: PropTypes.any,
|
|
907
745
|
css: PropTypes.any
|
|
908
746
|
};
|