@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
|
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
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"];
|
|
10
|
+
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"];
|
|
11
11
|
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; }
|
|
12
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -26,9 +26,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
26
26
|
*/
|
|
27
27
|
import React, { Component } from 'react';
|
|
28
28
|
import classNames from 'classnames';
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import { EuiPortal } from '../portal';
|
|
29
|
+
import { htmlIdGenerator, keys } from '../../services';
|
|
30
|
+
import { EuiInputPopover } from '../popover';
|
|
32
31
|
import { EuiI18n } from '../i18n';
|
|
33
32
|
import { getMatchingOptions, flattenOptionGroups, getSelectedOptionForSearchValue, transformForCaseSensitivity } from './matching_options';
|
|
34
33
|
import { EuiComboBoxInput } from './combo_box_input/combo_box_input';
|
|
@@ -58,9 +57,6 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
58
57
|
activeOptionIndex: -1,
|
|
59
58
|
hasFocus: false,
|
|
60
59
|
isListOpen: false,
|
|
61
|
-
listElement: null,
|
|
62
|
-
listPosition: 'bottom',
|
|
63
|
-
listZIndex: undefined,
|
|
64
60
|
matchingOptions: getMatchingOptions({
|
|
65
61
|
options: _this.props.options,
|
|
66
62
|
selectedOptions: _this.props.selectedOptions,
|
|
@@ -70,118 +66,43 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
70
66
|
showPrevSelected: Boolean(_this.props.singleSelection),
|
|
71
67
|
sortMatchesBy: _this.props.sortMatchesBy
|
|
72
68
|
}),
|
|
73
|
-
searchValue: initialSearchValue
|
|
74
|
-
width: 0
|
|
69
|
+
searchValue: initialSearchValue
|
|
75
70
|
});
|
|
76
|
-
_defineProperty(_assertThisInitialized(_this), "_isMounted", false);
|
|
77
71
|
_defineProperty(_assertThisInitialized(_this), "rootId", htmlIdGenerator());
|
|
78
72
|
// Refs
|
|
79
73
|
_defineProperty(_assertThisInitialized(_this), "comboBoxRefInstance", null);
|
|
80
74
|
_defineProperty(_assertThisInitialized(_this), "comboBoxRefCallback", function (ref) {
|
|
81
75
|
_this.comboBoxRefInstance = ref;
|
|
82
|
-
if (_this.comboBoxRefInstance) {
|
|
83
|
-
var comboBoxBounds = _this.comboBoxRefInstance.getBoundingClientRect();
|
|
84
|
-
_this.setState({
|
|
85
|
-
width: comboBoxBounds.width
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
76
|
});
|
|
89
77
|
_defineProperty(_assertThisInitialized(_this), "searchInputRefInstance", null);
|
|
90
78
|
_defineProperty(_assertThisInitialized(_this), "searchInputRefCallback", function (ref) {
|
|
79
|
+
var _this$props$inputRef, _this$props;
|
|
91
80
|
_this.searchInputRefInstance = ref;
|
|
92
|
-
|
|
81
|
+
(_this$props$inputRef = (_this$props = _this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, ref);
|
|
93
82
|
});
|
|
94
83
|
_defineProperty(_assertThisInitialized(_this), "listRefInstance", null);
|
|
95
84
|
_defineProperty(_assertThisInitialized(_this), "listRefCallback", function (ref) {
|
|
96
|
-
if (_this.comboBoxRefInstance) {
|
|
97
|
-
// find the zIndex of the combobox relative to the page body
|
|
98
|
-
// and use that to depth-position the list box
|
|
99
|
-
// adds an extra `100` to provide some defense around neighboring elements' positioning
|
|
100
|
-
var listZIndex = getElementZIndex(_this.comboBoxRefInstance, document.body) + 100;
|
|
101
|
-
_this.setState({
|
|
102
|
-
listZIndex: listZIndex
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
85
|
_this.listRefInstance = ref;
|
|
106
86
|
});
|
|
107
|
-
_defineProperty(_assertThisInitialized(_this), "toggleButtonRefInstance", null);
|
|
108
|
-
_defineProperty(_assertThisInitialized(_this), "toggleButtonRefCallback", function (ref) {
|
|
109
|
-
_this.toggleButtonRefInstance = ref;
|
|
110
|
-
});
|
|
111
|
-
_defineProperty(_assertThisInitialized(_this), "optionsRefInstances", []);
|
|
112
|
-
_defineProperty(_assertThisInitialized(_this), "optionRefCallback", function (index, ref) {
|
|
113
|
-
_this.optionsRefInstances[index] = ref;
|
|
114
|
-
});
|
|
115
87
|
_defineProperty(_assertThisInitialized(_this), "openList", function () {
|
|
116
88
|
_this.setState({
|
|
117
89
|
isListOpen: true
|
|
118
90
|
});
|
|
119
91
|
});
|
|
120
|
-
_defineProperty(_assertThisInitialized(_this), "closeList", function (
|
|
121
|
-
if (event && event.target === _this.searchInputRefInstance) {
|
|
122
|
-
// really long search values / custom entries triggers a scroll event on the input
|
|
123
|
-
// which the EuiComboBoxOptionsList passes through here
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
92
|
+
_defineProperty(_assertThisInitialized(_this), "closeList", function () {
|
|
126
93
|
_this.clearActiveOption();
|
|
127
94
|
_this.setState({
|
|
128
|
-
listZIndex: undefined,
|
|
129
95
|
isListOpen: false
|
|
130
96
|
});
|
|
131
97
|
});
|
|
132
|
-
_defineProperty(_assertThisInitialized(_this), "updatePosition", function () {
|
|
133
|
-
var listElement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.listElement;
|
|
134
|
-
if (!_this._isMounted) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (!_this.state.isListOpen) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if (!listElement) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// it's possible that updateListPosition is called when listElement is becoming visible, but isn't yet
|
|
145
|
-
var listElementBounds = listElement.getBoundingClientRect();
|
|
146
|
-
if (listElementBounds.width === 0 || listElementBounds.height === 0) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (!_this.comboBoxRefInstance) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
var comboBoxBounds = _this.comboBoxRefInstance.getBoundingClientRect();
|
|
153
|
-
var _ref = findPopoverPosition({
|
|
154
|
-
allowCrossAxis: false,
|
|
155
|
-
anchor: _this.comboBoxRefInstance,
|
|
156
|
-
popover: listElement,
|
|
157
|
-
position: 'bottom'
|
|
158
|
-
}),
|
|
159
|
-
position = _ref.position,
|
|
160
|
-
top = _ref.top;
|
|
161
|
-
if (_this.listRefInstance) {
|
|
162
|
-
_this.listRefInstance.style.top = "".concat(top, "px");
|
|
163
|
-
// listElement doesn't have its width set until after updating the position
|
|
164
|
-
// which means the popover service won't know about the correct width
|
|
165
|
-
// however, we already know where to position the element
|
|
166
|
-
_this.listRefInstance.style.left = "".concat(comboBoxBounds.left + window.pageXOffset, "px");
|
|
167
|
-
_this.listRefInstance.style.width = "".concat(comboBoxBounds.width, "px");
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// Cache for future calls.
|
|
171
|
-
_this.setState({
|
|
172
|
-
listElement: listElement,
|
|
173
|
-
listPosition: position,
|
|
174
|
-
width: comboBoxBounds.width
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
98
|
_defineProperty(_assertThisInitialized(_this), "incrementActiveOptionIndex", function (amount) {
|
|
178
99
|
// If there are no options available, do nothing.
|
|
179
100
|
if (!_this.state.matchingOptions.length) {
|
|
180
101
|
return;
|
|
181
102
|
}
|
|
182
|
-
_this.setState(function (
|
|
183
|
-
var activeOptionIndex =
|
|
184
|
-
matchingOptions =
|
|
103
|
+
_this.setState(function (_ref) {
|
|
104
|
+
var activeOptionIndex = _ref.activeOptionIndex,
|
|
105
|
+
matchingOptions = _ref.matchingOptions;
|
|
185
106
|
var nextActiveOptionIndex;
|
|
186
107
|
if (activeOptionIndex < 0) {
|
|
187
108
|
// If this is the beginning of the user's keyboard navigation of the menu, then we'll focus
|
|
@@ -224,12 +145,12 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
224
145
|
_this.onSearchChange('');
|
|
225
146
|
});
|
|
226
147
|
_defineProperty(_assertThisInitialized(_this), "addCustomOption", function (isContainerBlur, searchValue) {
|
|
227
|
-
var _this$
|
|
228
|
-
isCaseSensitive = _this$
|
|
229
|
-
onCreateOption = _this$
|
|
230
|
-
options = _this$
|
|
231
|
-
selectedOptions = _this$
|
|
232
|
-
singleSelection = _this$
|
|
148
|
+
var _this$props2 = _this.props,
|
|
149
|
+
isCaseSensitive = _this$props2.isCaseSensitive,
|
|
150
|
+
onCreateOption = _this$props2.onCreateOption,
|
|
151
|
+
options = _this$props2.options,
|
|
152
|
+
selectedOptions = _this$props2.selectedOptions,
|
|
153
|
+
singleSelection = _this$props2.singleSelection;
|
|
233
154
|
var matchingOptions = _this.state.matchingOptions;
|
|
234
155
|
if (_this.doesSearchMatchOnlyOption()) {
|
|
235
156
|
_this.onAddOption(matchingOptions[0], isContainerBlur);
|
|
@@ -276,11 +197,11 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
276
197
|
return normalizedSearchSubject === normalizedSearchValue;
|
|
277
198
|
});
|
|
278
199
|
_defineProperty(_assertThisInitialized(_this), "areAllOptionsSelected", function () {
|
|
279
|
-
var _this$
|
|
280
|
-
options = _this$
|
|
281
|
-
selectedOptions = _this$
|
|
282
|
-
async = _this$
|
|
283
|
-
isCaseSensitive = _this$
|
|
200
|
+
var _this$props3 = _this.props,
|
|
201
|
+
options = _this$props3.options,
|
|
202
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
203
|
+
async = _this$props3.async,
|
|
204
|
+
isCaseSensitive = _this$props3.isCaseSensitive;
|
|
284
205
|
// Assume if this is async then there could be infinite options.
|
|
285
206
|
if (async) {
|
|
286
207
|
return false;
|
|
@@ -291,8 +212,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
291
212
|
});
|
|
292
213
|
});
|
|
293
214
|
var numberOfSelectedOptions = 0;
|
|
294
|
-
selectedOptions.forEach(function (
|
|
295
|
-
var label =
|
|
215
|
+
selectedOptions.forEach(function (_ref2) {
|
|
216
|
+
var label = _ref2.label;
|
|
296
217
|
var trimmedLabel = transformForCaseSensitivity(label.trim(), isCaseSensitive);
|
|
297
218
|
if (flattenOptions.findIndex(function (option) {
|
|
298
219
|
return option.label === trimmedLabel;
|
|
@@ -301,9 +222,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
301
222
|
return flattenOptions.length === numberOfSelectedOptions;
|
|
302
223
|
});
|
|
303
224
|
_defineProperty(_assertThisInitialized(_this), "onComboBoxFocus", function (event) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
225
|
+
var _this$props$onFocus, _this$props4;
|
|
226
|
+
(_this$props$onFocus = (_this$props4 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props4, event);
|
|
307
227
|
_this.openList();
|
|
308
228
|
_this.setState({
|
|
309
229
|
hasFocus: true
|
|
@@ -326,10 +246,9 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
326
246
|
var focusedInOptionsList = relatedTarget && _this.listRefInstance && _this.listRefInstance.contains(relatedTarget);
|
|
327
247
|
var focusedInInput = relatedTarget && _this.comboBoxRefInstance && _this.comboBoxRefInstance.contains(relatedTarget);
|
|
328
248
|
if (!focusedInOptionsList && !focusedInInput) {
|
|
249
|
+
var _this$props$onBlur, _this$props5;
|
|
250
|
+
(_this$props$onBlur = (_this$props5 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props5, event);
|
|
329
251
|
_this.closeList();
|
|
330
|
-
if (_this.props.onBlur) {
|
|
331
|
-
_this.props.onBlur(event);
|
|
332
|
-
}
|
|
333
252
|
_this.setState({
|
|
334
253
|
hasFocus: false
|
|
335
254
|
});
|
|
@@ -352,7 +271,9 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
352
271
|
}
|
|
353
272
|
});
|
|
354
273
|
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
|
|
274
|
+
var _this$props$onKeyDown, _this$props6;
|
|
355
275
|
if (_this.props.isDisabled) return;
|
|
276
|
+
event.persist(); // TODO: Remove once React 16 support is dropped
|
|
356
277
|
switch (event.key) {
|
|
357
278
|
case keys.ARROW_UP:
|
|
358
279
|
event.preventDefault();
|
|
@@ -396,9 +317,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
396
317
|
}
|
|
397
318
|
break;
|
|
398
319
|
default:
|
|
399
|
-
|
|
400
|
-
_this.props.onKeyDown(event);
|
|
401
|
-
}
|
|
320
|
+
(_this$props$onKeyDown = (_this$props6 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props6, event);
|
|
402
321
|
}
|
|
403
322
|
});
|
|
404
323
|
_defineProperty(_assertThisInitialized(_this), "onOptionEnterKey", function (option) {
|
|
@@ -411,21 +330,18 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
411
330
|
if (addedOption.disabled) {
|
|
412
331
|
return;
|
|
413
332
|
}
|
|
414
|
-
var _this$
|
|
415
|
-
onChange = _this$
|
|
416
|
-
selectedOptions = _this$
|
|
417
|
-
singleSelectionProp = _this$
|
|
333
|
+
var _this$props7 = _this.props,
|
|
334
|
+
onChange = _this$props7.onChange,
|
|
335
|
+
selectedOptions = _this$props7.selectedOptions,
|
|
336
|
+
singleSelectionProp = _this$props7.singleSelection;
|
|
418
337
|
var singleSelection = Boolean(singleSelectionProp);
|
|
419
338
|
var changeOptions = singleSelection ? [addedOption] : selectedOptions.concat(addedOption);
|
|
420
|
-
|
|
421
|
-
onChange(changeOptions);
|
|
422
|
-
}
|
|
339
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(changeOptions);
|
|
423
340
|
_this.clearSearchValue();
|
|
424
341
|
_this.clearActiveOption();
|
|
425
342
|
if (!isContainerBlur) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}
|
|
343
|
+
var _this$searchInputRefI2;
|
|
344
|
+
(_this$searchInputRefI2 = _this.searchInputRefInstance) === null || _this$searchInputRefI2 === void 0 ? void 0 : _this$searchInputRefI2.focus();
|
|
429
345
|
}
|
|
430
346
|
if (singleSelection) {
|
|
431
347
|
requestAnimationFrame(function () {
|
|
@@ -438,36 +354,29 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
438
354
|
}
|
|
439
355
|
});
|
|
440
356
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption) {
|
|
441
|
-
var _this$
|
|
442
|
-
onChange = _this$
|
|
443
|
-
selectedOptions = _this$
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}));
|
|
448
|
-
}
|
|
357
|
+
var _this$props8 = _this.props,
|
|
358
|
+
onChange = _this$props8.onChange,
|
|
359
|
+
selectedOptions = _this$props8.selectedOptions;
|
|
360
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectedOptions.filter(function (option) {
|
|
361
|
+
return option !== removedOption;
|
|
362
|
+
}));
|
|
449
363
|
_this.clearActiveOption();
|
|
450
364
|
});
|
|
451
365
|
_defineProperty(_assertThisInitialized(_this), "clearSelectedOptions", function () {
|
|
452
|
-
var onChange
|
|
453
|
-
|
|
454
|
-
onChange([]);
|
|
455
|
-
}
|
|
366
|
+
var _this$props$onChange, _this$props9, _this$searchInputRefI3;
|
|
367
|
+
(_this$props$onChange = (_this$props9 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props9, []);
|
|
456
368
|
|
|
457
369
|
// Clicking the clear button will also cause it to disappear. This would result in focus
|
|
458
370
|
// shifting unexpectedly to the body element so we set it to the input which is more reasonable,
|
|
459
|
-
|
|
460
|
-
_this.searchInputRefInstance.focus();
|
|
461
|
-
}
|
|
371
|
+
(_this$searchInputRefI3 = _this.searchInputRefInstance) === null || _this$searchInputRefI3 === void 0 ? void 0 : _this$searchInputRefI3.focus();
|
|
462
372
|
if (!_this.state.isListOpen) {
|
|
463
373
|
_this.openList();
|
|
464
374
|
}
|
|
465
375
|
});
|
|
466
376
|
_defineProperty(_assertThisInitialized(_this), "onComboBoxClick", function () {
|
|
377
|
+
var _this$searchInputRefI4;
|
|
467
378
|
// When the user clicks anywhere on the box, enter the interaction state.
|
|
468
|
-
|
|
469
|
-
_this.searchInputRefInstance.focus();
|
|
470
|
-
}
|
|
379
|
+
(_this$searchInputRefI4 = _this.searchInputRefInstance) === null || _this$searchInputRefI4 === void 0 ? void 0 : _this$searchInputRefI4.focus();
|
|
471
380
|
|
|
472
381
|
// If the user does this from a state in which an option has focus, then we need to reset it or clear it.
|
|
473
382
|
if (Boolean(_this.props.singleSelection) && _this.props.selectedOptions.length === 1) {
|
|
@@ -482,25 +391,20 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
482
391
|
}
|
|
483
392
|
});
|
|
484
393
|
_defineProperty(_assertThisInitialized(_this), "onOpenListClick", function () {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
394
|
+
var _this$searchInputRefI5;
|
|
395
|
+
(_this$searchInputRefI5 = _this.searchInputRefInstance) === null || _this$searchInputRefI5 === void 0 ? void 0 : _this$searchInputRefI5.focus();
|
|
488
396
|
if (!_this.state.isListOpen) {
|
|
489
397
|
_this.openList();
|
|
490
398
|
}
|
|
491
399
|
});
|
|
492
400
|
_defineProperty(_assertThisInitialized(_this), "onOptionListScroll", function () {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
_defineProperty(_assertThisInitialized(_this), "onCloseListClick", function () {
|
|
498
|
-
_this.closeList();
|
|
401
|
+
var _this$searchInputRefI6;
|
|
402
|
+
(_this$searchInputRefI6 = _this.searchInputRefInstance) === null || _this$searchInputRefI6 === void 0 ? void 0 : _this$searchInputRefI6.focus();
|
|
499
403
|
});
|
|
500
404
|
_defineProperty(_assertThisInitialized(_this), "onSearchChange", function (searchValue) {
|
|
501
|
-
var _this$
|
|
502
|
-
onSearchChange = _this$
|
|
503
|
-
delimiter = _this$
|
|
405
|
+
var _this$props10 = _this.props,
|
|
406
|
+
onSearchChange = _this$props10.onSearchChange,
|
|
407
|
+
delimiter = _this$props10.delimiter;
|
|
504
408
|
if (onSearchChange) {
|
|
505
409
|
var _hasMatchingOptions = _this.state.matchingOptions.length > 0;
|
|
506
410
|
onSearchChange(searchValue, _hasMatchingOptions);
|
|
@@ -514,126 +418,53 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
514
418
|
_this.setCustomOptions(false);
|
|
515
419
|
}
|
|
516
420
|
});
|
|
517
|
-
_defineProperty(_assertThisInitialized(_this), "updateMatchingOptionsIfDifferent", function (newMatchingOptions) {
|
|
518
|
-
var _this$state = _this.state,
|
|
519
|
-
matchingOptions = _this$state.matchingOptions,
|
|
520
|
-
activeOptionIndex = _this$state.activeOptionIndex;
|
|
521
|
-
var _this$props6 = _this.props,
|
|
522
|
-
singleSelection = _this$props6.singleSelection,
|
|
523
|
-
selectedOptions = _this$props6.selectedOptions;
|
|
524
|
-
var areOptionsDifferent = false;
|
|
525
|
-
if (matchingOptions.length !== newMatchingOptions.length) {
|
|
526
|
-
areOptionsDifferent = true;
|
|
527
|
-
} else {
|
|
528
|
-
for (var i = 0; i < matchingOptions.length; i++) {
|
|
529
|
-
if (matchingOptions[i].label !== newMatchingOptions[i].label) {
|
|
530
|
-
areOptionsDifferent = true;
|
|
531
|
-
break;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
if (areOptionsDifferent) {
|
|
536
|
-
_this.optionsRefInstances = [];
|
|
537
|
-
var nextActiveOptionIndex = activeOptionIndex;
|
|
538
|
-
// ensure that the currently selected single option is active if it is in the matchingOptions
|
|
539
|
-
if (Boolean(singleSelection) && selectedOptions.length === 1) {
|
|
540
|
-
if (newMatchingOptions.includes(selectedOptions[0])) {
|
|
541
|
-
nextActiveOptionIndex = newMatchingOptions.indexOf(selectedOptions[0]);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
_this.setState({
|
|
545
|
-
matchingOptions: newMatchingOptions,
|
|
546
|
-
activeOptionIndex: nextActiveOptionIndex
|
|
547
|
-
});
|
|
548
|
-
if (!newMatchingOptions.length) {
|
|
549
|
-
// Prevent endless setState -> componentWillUpdate -> setState loop.
|
|
550
|
-
if (_this.hasActiveOption()) {
|
|
551
|
-
_this.clearActiveOption();
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
421
|
return _this;
|
|
557
422
|
}
|
|
558
423
|
_createClass(EuiComboBox, [{
|
|
559
|
-
key: "componentDidMount",
|
|
560
|
-
value: function componentDidMount() {
|
|
561
|
-
this._isMounted = true;
|
|
562
|
-
}
|
|
563
|
-
}, {
|
|
564
|
-
key: "componentDidUpdate",
|
|
565
|
-
value: function componentDidUpdate() {
|
|
566
|
-
var _this$props7 = this.props,
|
|
567
|
-
options = _this$props7.options,
|
|
568
|
-
selectedOptions = _this$props7.selectedOptions,
|
|
569
|
-
singleSelection = _this$props7.singleSelection,
|
|
570
|
-
sortMatchesBy = _this$props7.sortMatchesBy;
|
|
571
|
-
var searchValue = this.state.searchValue;
|
|
572
|
-
|
|
573
|
-
// React 16.3 has a bug (fixed in 16.4) where getDerivedStateFromProps
|
|
574
|
-
// isn't called after a state change, and we track `searchValue` in state
|
|
575
|
-
// instead we need to react to a change in searchValue here
|
|
576
|
-
this.updateMatchingOptionsIfDifferent(getMatchingOptions({
|
|
577
|
-
options: options,
|
|
578
|
-
selectedOptions: selectedOptions,
|
|
579
|
-
searchValue: searchValue,
|
|
580
|
-
isCaseSensitive: this.props.isCaseSensitive,
|
|
581
|
-
isPreFiltered: this.props.async,
|
|
582
|
-
showPrevSelected: Boolean(singleSelection),
|
|
583
|
-
sortMatchesBy: sortMatchesBy
|
|
584
|
-
}));
|
|
585
|
-
}
|
|
586
|
-
}, {
|
|
587
|
-
key: "componentWillUnmount",
|
|
588
|
-
value: function componentWillUnmount() {
|
|
589
|
-
this._isMounted = false;
|
|
590
|
-
}
|
|
591
|
-
}, {
|
|
592
424
|
key: "render",
|
|
593
425
|
value: function render() {
|
|
594
426
|
var _this2 = this;
|
|
595
|
-
var _this$
|
|
596
|
-
dataTestSubj = _this$
|
|
597
|
-
async = _this$
|
|
598
|
-
className = _this$
|
|
599
|
-
compressed = _this$
|
|
600
|
-
customOptionText = _this$
|
|
601
|
-
fullWidth = _this$
|
|
602
|
-
id = _this$
|
|
603
|
-
inputRef = _this$
|
|
604
|
-
isCaseSensitive = _this$
|
|
605
|
-
isClearable = _this$
|
|
606
|
-
isDisabled = _this$
|
|
607
|
-
isInvalid = _this$
|
|
608
|
-
isLoading = _this$
|
|
609
|
-
noSuggestions = _this$
|
|
610
|
-
onBlur = _this$
|
|
611
|
-
onChange = _this$
|
|
612
|
-
onCreateOption = _this$
|
|
613
|
-
onSearchChange = _this$
|
|
614
|
-
options = _this$
|
|
615
|
-
placeholder = _this$
|
|
616
|
-
renderOption = _this$
|
|
617
|
-
rowHeight = _this$
|
|
618
|
-
selectedOptions = _this$
|
|
619
|
-
singleSelection = _this$
|
|
620
|
-
prepend = _this$
|
|
621
|
-
sortMatchesBy = _this$
|
|
622
|
-
delimiter = _this$
|
|
623
|
-
append = _this$
|
|
624
|
-
autoFocus = _this$
|
|
625
|
-
truncationProps = _this$
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
searchValue = _this$
|
|
635
|
-
|
|
636
|
-
matchingOptions = _this$state2.matchingOptions;
|
|
427
|
+
var _this$props11 = this.props,
|
|
428
|
+
dataTestSubj = _this$props11['data-test-subj'],
|
|
429
|
+
async = _this$props11.async,
|
|
430
|
+
className = _this$props11.className,
|
|
431
|
+
compressed = _this$props11.compressed,
|
|
432
|
+
customOptionText = _this$props11.customOptionText,
|
|
433
|
+
fullWidth = _this$props11.fullWidth,
|
|
434
|
+
id = _this$props11.id,
|
|
435
|
+
inputRef = _this$props11.inputRef,
|
|
436
|
+
isCaseSensitive = _this$props11.isCaseSensitive,
|
|
437
|
+
isClearable = _this$props11.isClearable,
|
|
438
|
+
isDisabled = _this$props11.isDisabled,
|
|
439
|
+
isInvalid = _this$props11.isInvalid,
|
|
440
|
+
isLoading = _this$props11.isLoading,
|
|
441
|
+
noSuggestions = _this$props11.noSuggestions,
|
|
442
|
+
onBlur = _this$props11.onBlur,
|
|
443
|
+
onChange = _this$props11.onChange,
|
|
444
|
+
onCreateOption = _this$props11.onCreateOption,
|
|
445
|
+
onSearchChange = _this$props11.onSearchChange,
|
|
446
|
+
options = _this$props11.options,
|
|
447
|
+
placeholder = _this$props11.placeholder,
|
|
448
|
+
renderOption = _this$props11.renderOption,
|
|
449
|
+
rowHeight = _this$props11.rowHeight,
|
|
450
|
+
selectedOptions = _this$props11.selectedOptions,
|
|
451
|
+
singleSelection = _this$props11.singleSelection,
|
|
452
|
+
prepend = _this$props11.prepend,
|
|
453
|
+
sortMatchesBy = _this$props11.sortMatchesBy,
|
|
454
|
+
delimiter = _this$props11.delimiter,
|
|
455
|
+
append = _this$props11.append,
|
|
456
|
+
autoFocus = _this$props11.autoFocus,
|
|
457
|
+
truncationProps = _this$props11.truncationProps,
|
|
458
|
+
inputPopoverProps = _this$props11.inputPopoverProps,
|
|
459
|
+
ariaLabel = _this$props11['aria-label'],
|
|
460
|
+
ariaLabelledby = _this$props11['aria-labelledby'],
|
|
461
|
+
rest = _objectWithoutProperties(_this$props11, _excluded);
|
|
462
|
+
var _this$state = this.state,
|
|
463
|
+
activeOptionIndex = _this$state.activeOptionIndex,
|
|
464
|
+
hasFocus = _this$state.hasFocus,
|
|
465
|
+
isListOpen = _this$state.isListOpen,
|
|
466
|
+
searchValue = _this$state.searchValue,
|
|
467
|
+
matchingOptions = _this$state.matchingOptions;
|
|
637
468
|
|
|
638
469
|
// Make sure we have a valid ID if users don't pass one as a prop
|
|
639
470
|
var inputId = id !== null && id !== void 0 ? id : this.rootId('_eui-combobox-id');
|
|
@@ -657,12 +488,11 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
657
488
|
var optionsList;
|
|
658
489
|
if (!noSuggestions && isListOpen) {
|
|
659
490
|
var optionsListDataTestSubj = dataTestSubj ? "".concat(dataTestSubj, "-optionsList") : undefined;
|
|
660
|
-
optionsList = ___EmotionJSX(
|
|
491
|
+
optionsList = ___EmotionJSX(EuiI18n, {
|
|
661
492
|
token: "euiComboBox.listboxAriaLabel",
|
|
662
493
|
default: "Choose from the following options"
|
|
663
494
|
}, function (listboxAriaLabel) {
|
|
664
495
|
return ___EmotionJSX(EuiComboBoxOptionsList, {
|
|
665
|
-
zIndex: _this2.state.listZIndex,
|
|
666
496
|
activeOptionIndex: _this2.state.activeOptionIndex,
|
|
667
497
|
areAllOptionsSelected: _this2.areAllOptionsSelected(),
|
|
668
498
|
customOptionText: customOptionText,
|
|
@@ -677,9 +507,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
677
507
|
onOptionClick: _this2.onOptionClick,
|
|
678
508
|
onOptionEnterKey: _this2.onOptionEnterKey,
|
|
679
509
|
onScroll: _this2.onOptionListScroll,
|
|
680
|
-
optionRef: _this2.optionRefCallback,
|
|
681
510
|
options: options,
|
|
682
|
-
position: listPosition,
|
|
683
511
|
singleSelection: singleSelection,
|
|
684
512
|
renderOption: renderOption,
|
|
685
513
|
rootId: _this2.rootId,
|
|
@@ -687,14 +515,12 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
687
515
|
scrollToIndex: activeOptionIndex,
|
|
688
516
|
searchValue: searchValue,
|
|
689
517
|
selectedOptions: selectedOptions,
|
|
690
|
-
updatePosition: _this2.updatePosition,
|
|
691
|
-
width: width,
|
|
692
518
|
delimiter: delimiter,
|
|
693
519
|
getSelectedOptionForSearchValue: getSelectedOptionForSearchValue,
|
|
694
520
|
listboxAriaLabel: listboxAriaLabel,
|
|
695
521
|
truncationProps: truncationProps
|
|
696
522
|
});
|
|
697
|
-
})
|
|
523
|
+
});
|
|
698
524
|
}
|
|
699
525
|
return (
|
|
700
526
|
/**
|
|
@@ -710,39 +536,46 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
710
536
|
onKeyDown: this.onKeyDown,
|
|
711
537
|
onBlur: this.onContainerBlur,
|
|
712
538
|
ref: this.comboBoxRefCallback
|
|
713
|
-
}), ___EmotionJSX(
|
|
714
|
-
compressed: compressed,
|
|
715
|
-
focusedOptionId: this.hasActiveOption() ? this.rootId("_option-".concat(this.state.activeOptionIndex)) : undefined,
|
|
539
|
+
}), ___EmotionJSX(EuiInputPopover, _extends({
|
|
716
540
|
fullWidth: fullWidth,
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
541
|
+
panelPaddingSize: "none",
|
|
542
|
+
disableFocusTrap: true,
|
|
543
|
+
closeOnScroll: true
|
|
544
|
+
}, inputPopoverProps, {
|
|
545
|
+
isOpen: isListOpen,
|
|
546
|
+
closePopover: this.closeList,
|
|
547
|
+
input: ___EmotionJSX(EuiComboBoxInput, {
|
|
548
|
+
compressed: compressed,
|
|
549
|
+
focusedOptionId: this.hasActiveOption() ? this.rootId("_option-".concat(this.state.activeOptionIndex)) : undefined,
|
|
550
|
+
fullWidth: fullWidth,
|
|
551
|
+
hasSelectedOptions: selectedOptions.length > 0,
|
|
552
|
+
id: inputId,
|
|
553
|
+
inputRef: this.searchInputRefCallback,
|
|
554
|
+
isDisabled: isDisabled,
|
|
555
|
+
isListOpen: isListOpen,
|
|
556
|
+
noIcon: !!noSuggestions,
|
|
557
|
+
onChange: this.onSearchChange,
|
|
558
|
+
onClear: isClearable && !isDisabled ? this.clearSelectedOptions : undefined,
|
|
559
|
+
onClick: this.onComboBoxClick,
|
|
560
|
+
onCloseListClick: this.closeList,
|
|
561
|
+
onFocus: this.onComboBoxFocus,
|
|
562
|
+
onOpenListClick: this.onOpenListClick,
|
|
563
|
+
onRemoveOption: this.onRemoveOption,
|
|
564
|
+
placeholder: placeholder,
|
|
565
|
+
rootId: this.rootId,
|
|
566
|
+
searchValue: searchValue,
|
|
567
|
+
selectedOptions: selectedOptions,
|
|
568
|
+
singleSelection: singleSelection,
|
|
569
|
+
value: value,
|
|
570
|
+
append: singleSelection ? append : undefined,
|
|
571
|
+
prepend: singleSelection ? prepend : undefined,
|
|
572
|
+
isLoading: isLoading,
|
|
573
|
+
isInvalid: markAsInvalid,
|
|
574
|
+
autoFocus: autoFocus,
|
|
575
|
+
"aria-label": ariaLabel,
|
|
576
|
+
"aria-labelledby": ariaLabelledby
|
|
577
|
+
})
|
|
578
|
+
}), optionsList))
|
|
746
579
|
);
|
|
747
580
|
}
|
|
748
581
|
}], [{
|