@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
|
@@ -8,14 +8,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _services = require("../../services");
|
|
11
|
-
var _popover = require("
|
|
12
|
-
var _portal = require("../portal");
|
|
11
|
+
var _popover = require("../popover");
|
|
13
12
|
var _i18n = require("../i18n");
|
|
14
13
|
var _matching_options = require("./matching_options");
|
|
15
14
|
var _combo_box_input = require("./combo_box_input/combo_box_input");
|
|
16
15
|
var _combo_box_options_list = require("./combo_box_options_list");
|
|
17
16
|
var _react2 = require("@emotion/react");
|
|
18
|
-
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"];
|
|
17
|
+
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"];
|
|
19
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
19
|
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); }
|
|
21
20
|
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; }
|
|
@@ -69,9 +68,6 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
69
68
|
activeOptionIndex: -1,
|
|
70
69
|
hasFocus: false,
|
|
71
70
|
isListOpen: false,
|
|
72
|
-
listElement: null,
|
|
73
|
-
listPosition: 'bottom',
|
|
74
|
-
listZIndex: undefined,
|
|
75
71
|
matchingOptions: (0, _matching_options.getMatchingOptions)({
|
|
76
72
|
options: _this.props.options,
|
|
77
73
|
selectedOptions: _this.props.selectedOptions,
|
|
@@ -81,118 +77,43 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
81
77
|
showPrevSelected: Boolean(_this.props.singleSelection),
|
|
82
78
|
sortMatchesBy: _this.props.sortMatchesBy
|
|
83
79
|
}),
|
|
84
|
-
searchValue: initialSearchValue
|
|
85
|
-
width: 0
|
|
80
|
+
searchValue: initialSearchValue
|
|
86
81
|
});
|
|
87
|
-
_defineProperty(_assertThisInitialized(_this), "_isMounted", false);
|
|
88
82
|
_defineProperty(_assertThisInitialized(_this), "rootId", (0, _services.htmlIdGenerator)());
|
|
89
83
|
// Refs
|
|
90
84
|
_defineProperty(_assertThisInitialized(_this), "comboBoxRefInstance", null);
|
|
91
85
|
_defineProperty(_assertThisInitialized(_this), "comboBoxRefCallback", function (ref) {
|
|
92
86
|
_this.comboBoxRefInstance = ref;
|
|
93
|
-
if (_this.comboBoxRefInstance) {
|
|
94
|
-
var comboBoxBounds = _this.comboBoxRefInstance.getBoundingClientRect();
|
|
95
|
-
_this.setState({
|
|
96
|
-
width: comboBoxBounds.width
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
87
|
});
|
|
100
88
|
_defineProperty(_assertThisInitialized(_this), "searchInputRefInstance", null);
|
|
101
89
|
_defineProperty(_assertThisInitialized(_this), "searchInputRefCallback", function (ref) {
|
|
90
|
+
var _this$props$inputRef, _this$props;
|
|
102
91
|
_this.searchInputRefInstance = ref;
|
|
103
|
-
|
|
92
|
+
(_this$props$inputRef = (_this$props = _this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, ref);
|
|
104
93
|
});
|
|
105
94
|
_defineProperty(_assertThisInitialized(_this), "listRefInstance", null);
|
|
106
95
|
_defineProperty(_assertThisInitialized(_this), "listRefCallback", function (ref) {
|
|
107
|
-
if (_this.comboBoxRefInstance) {
|
|
108
|
-
// find the zIndex of the combobox relative to the page body
|
|
109
|
-
// and use that to depth-position the list box
|
|
110
|
-
// adds an extra `100` to provide some defense around neighboring elements' positioning
|
|
111
|
-
var listZIndex = (0, _popover.getElementZIndex)(_this.comboBoxRefInstance, document.body) + 100;
|
|
112
|
-
_this.setState({
|
|
113
|
-
listZIndex: listZIndex
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
96
|
_this.listRefInstance = ref;
|
|
117
97
|
});
|
|
118
|
-
_defineProperty(_assertThisInitialized(_this), "toggleButtonRefInstance", null);
|
|
119
|
-
_defineProperty(_assertThisInitialized(_this), "toggleButtonRefCallback", function (ref) {
|
|
120
|
-
_this.toggleButtonRefInstance = ref;
|
|
121
|
-
});
|
|
122
|
-
_defineProperty(_assertThisInitialized(_this), "optionsRefInstances", []);
|
|
123
|
-
_defineProperty(_assertThisInitialized(_this), "optionRefCallback", function (index, ref) {
|
|
124
|
-
_this.optionsRefInstances[index] = ref;
|
|
125
|
-
});
|
|
126
98
|
_defineProperty(_assertThisInitialized(_this), "openList", function () {
|
|
127
99
|
_this.setState({
|
|
128
100
|
isListOpen: true
|
|
129
101
|
});
|
|
130
102
|
});
|
|
131
|
-
_defineProperty(_assertThisInitialized(_this), "closeList", function (
|
|
132
|
-
if (event && event.target === _this.searchInputRefInstance) {
|
|
133
|
-
// really long search values / custom entries triggers a scroll event on the input
|
|
134
|
-
// which the EuiComboBoxOptionsList passes through here
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
103
|
+
_defineProperty(_assertThisInitialized(_this), "closeList", function () {
|
|
137
104
|
_this.clearActiveOption();
|
|
138
105
|
_this.setState({
|
|
139
|
-
listZIndex: undefined,
|
|
140
106
|
isListOpen: false
|
|
141
107
|
});
|
|
142
108
|
});
|
|
143
|
-
_defineProperty(_assertThisInitialized(_this), "updatePosition", function () {
|
|
144
|
-
var listElement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.listElement;
|
|
145
|
-
if (!_this._isMounted) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (!_this.state.isListOpen) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
if (!listElement) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// it's possible that updateListPosition is called when listElement is becoming visible, but isn't yet
|
|
156
|
-
var listElementBounds = listElement.getBoundingClientRect();
|
|
157
|
-
if (listElementBounds.width === 0 || listElementBounds.height === 0) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
if (!_this.comboBoxRefInstance) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
var comboBoxBounds = _this.comboBoxRefInstance.getBoundingClientRect();
|
|
164
|
-
var _ref = (0, _services.findPopoverPosition)({
|
|
165
|
-
allowCrossAxis: false,
|
|
166
|
-
anchor: _this.comboBoxRefInstance,
|
|
167
|
-
popover: listElement,
|
|
168
|
-
position: 'bottom'
|
|
169
|
-
}),
|
|
170
|
-
position = _ref.position,
|
|
171
|
-
top = _ref.top;
|
|
172
|
-
if (_this.listRefInstance) {
|
|
173
|
-
_this.listRefInstance.style.top = "".concat(top, "px");
|
|
174
|
-
// listElement doesn't have its width set until after updating the position
|
|
175
|
-
// which means the popover service won't know about the correct width
|
|
176
|
-
// however, we already know where to position the element
|
|
177
|
-
_this.listRefInstance.style.left = "".concat(comboBoxBounds.left + window.pageXOffset, "px");
|
|
178
|
-
_this.listRefInstance.style.width = "".concat(comboBoxBounds.width, "px");
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// Cache for future calls.
|
|
182
|
-
_this.setState({
|
|
183
|
-
listElement: listElement,
|
|
184
|
-
listPosition: position,
|
|
185
|
-
width: comboBoxBounds.width
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
109
|
_defineProperty(_assertThisInitialized(_this), "incrementActiveOptionIndex", function (amount) {
|
|
189
110
|
// If there are no options available, do nothing.
|
|
190
111
|
if (!_this.state.matchingOptions.length) {
|
|
191
112
|
return;
|
|
192
113
|
}
|
|
193
|
-
_this.setState(function (
|
|
194
|
-
var activeOptionIndex =
|
|
195
|
-
matchingOptions =
|
|
114
|
+
_this.setState(function (_ref) {
|
|
115
|
+
var activeOptionIndex = _ref.activeOptionIndex,
|
|
116
|
+
matchingOptions = _ref.matchingOptions;
|
|
196
117
|
var nextActiveOptionIndex;
|
|
197
118
|
if (activeOptionIndex < 0) {
|
|
198
119
|
// If this is the beginning of the user's keyboard navigation of the menu, then we'll focus
|
|
@@ -235,12 +156,12 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
235
156
|
_this.onSearchChange('');
|
|
236
157
|
});
|
|
237
158
|
_defineProperty(_assertThisInitialized(_this), "addCustomOption", function (isContainerBlur, searchValue) {
|
|
238
|
-
var _this$
|
|
239
|
-
isCaseSensitive = _this$
|
|
240
|
-
onCreateOption = _this$
|
|
241
|
-
options = _this$
|
|
242
|
-
selectedOptions = _this$
|
|
243
|
-
singleSelection = _this$
|
|
159
|
+
var _this$props2 = _this.props,
|
|
160
|
+
isCaseSensitive = _this$props2.isCaseSensitive,
|
|
161
|
+
onCreateOption = _this$props2.onCreateOption,
|
|
162
|
+
options = _this$props2.options,
|
|
163
|
+
selectedOptions = _this$props2.selectedOptions,
|
|
164
|
+
singleSelection = _this$props2.singleSelection;
|
|
244
165
|
var matchingOptions = _this.state.matchingOptions;
|
|
245
166
|
if (_this.doesSearchMatchOnlyOption()) {
|
|
246
167
|
_this.onAddOption(matchingOptions[0], isContainerBlur);
|
|
@@ -287,11 +208,11 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
287
208
|
return normalizedSearchSubject === normalizedSearchValue;
|
|
288
209
|
});
|
|
289
210
|
_defineProperty(_assertThisInitialized(_this), "areAllOptionsSelected", function () {
|
|
290
|
-
var _this$
|
|
291
|
-
options = _this$
|
|
292
|
-
selectedOptions = _this$
|
|
293
|
-
async = _this$
|
|
294
|
-
isCaseSensitive = _this$
|
|
211
|
+
var _this$props3 = _this.props,
|
|
212
|
+
options = _this$props3.options,
|
|
213
|
+
selectedOptions = _this$props3.selectedOptions,
|
|
214
|
+
async = _this$props3.async,
|
|
215
|
+
isCaseSensitive = _this$props3.isCaseSensitive;
|
|
295
216
|
// Assume if this is async then there could be infinite options.
|
|
296
217
|
if (async) {
|
|
297
218
|
return false;
|
|
@@ -302,8 +223,8 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
302
223
|
});
|
|
303
224
|
});
|
|
304
225
|
var numberOfSelectedOptions = 0;
|
|
305
|
-
selectedOptions.forEach(function (
|
|
306
|
-
var label =
|
|
226
|
+
selectedOptions.forEach(function (_ref2) {
|
|
227
|
+
var label = _ref2.label;
|
|
307
228
|
var trimmedLabel = (0, _matching_options.transformForCaseSensitivity)(label.trim(), isCaseSensitive);
|
|
308
229
|
if (flattenOptions.findIndex(function (option) {
|
|
309
230
|
return option.label === trimmedLabel;
|
|
@@ -312,9 +233,8 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
312
233
|
return flattenOptions.length === numberOfSelectedOptions;
|
|
313
234
|
});
|
|
314
235
|
_defineProperty(_assertThisInitialized(_this), "onComboBoxFocus", function (event) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
236
|
+
var _this$props$onFocus, _this$props4;
|
|
237
|
+
(_this$props$onFocus = (_this$props4 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props4, event);
|
|
318
238
|
_this.openList();
|
|
319
239
|
_this.setState({
|
|
320
240
|
hasFocus: true
|
|
@@ -337,10 +257,9 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
337
257
|
var focusedInOptionsList = relatedTarget && _this.listRefInstance && _this.listRefInstance.contains(relatedTarget);
|
|
338
258
|
var focusedInInput = relatedTarget && _this.comboBoxRefInstance && _this.comboBoxRefInstance.contains(relatedTarget);
|
|
339
259
|
if (!focusedInOptionsList && !focusedInInput) {
|
|
260
|
+
var _this$props$onBlur, _this$props5;
|
|
261
|
+
(_this$props$onBlur = (_this$props5 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props5, event);
|
|
340
262
|
_this.closeList();
|
|
341
|
-
if (_this.props.onBlur) {
|
|
342
|
-
_this.props.onBlur(event);
|
|
343
|
-
}
|
|
344
263
|
_this.setState({
|
|
345
264
|
hasFocus: false
|
|
346
265
|
});
|
|
@@ -363,7 +282,9 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
363
282
|
}
|
|
364
283
|
});
|
|
365
284
|
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
|
|
285
|
+
var _this$props$onKeyDown, _this$props6;
|
|
366
286
|
if (_this.props.isDisabled) return;
|
|
287
|
+
event.persist(); // TODO: Remove once React 16 support is dropped
|
|
367
288
|
switch (event.key) {
|
|
368
289
|
case _services.keys.ARROW_UP:
|
|
369
290
|
event.preventDefault();
|
|
@@ -407,9 +328,7 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
407
328
|
}
|
|
408
329
|
break;
|
|
409
330
|
default:
|
|
410
|
-
|
|
411
|
-
_this.props.onKeyDown(event);
|
|
412
|
-
}
|
|
331
|
+
(_this$props$onKeyDown = (_this$props6 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props6, event);
|
|
413
332
|
}
|
|
414
333
|
});
|
|
415
334
|
_defineProperty(_assertThisInitialized(_this), "onOptionEnterKey", function (option) {
|
|
@@ -422,21 +341,18 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
422
341
|
if (addedOption.disabled) {
|
|
423
342
|
return;
|
|
424
343
|
}
|
|
425
|
-
var _this$
|
|
426
|
-
onChange = _this$
|
|
427
|
-
selectedOptions = _this$
|
|
428
|
-
singleSelectionProp = _this$
|
|
344
|
+
var _this$props7 = _this.props,
|
|
345
|
+
onChange = _this$props7.onChange,
|
|
346
|
+
selectedOptions = _this$props7.selectedOptions,
|
|
347
|
+
singleSelectionProp = _this$props7.singleSelection;
|
|
429
348
|
var singleSelection = Boolean(singleSelectionProp);
|
|
430
349
|
var changeOptions = singleSelection ? [addedOption] : selectedOptions.concat(addedOption);
|
|
431
|
-
|
|
432
|
-
onChange(changeOptions);
|
|
433
|
-
}
|
|
350
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(changeOptions);
|
|
434
351
|
_this.clearSearchValue();
|
|
435
352
|
_this.clearActiveOption();
|
|
436
353
|
if (!isContainerBlur) {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
354
|
+
var _this$searchInputRefI2;
|
|
355
|
+
(_this$searchInputRefI2 = _this.searchInputRefInstance) === null || _this$searchInputRefI2 === void 0 ? void 0 : _this$searchInputRefI2.focus();
|
|
440
356
|
}
|
|
441
357
|
if (singleSelection) {
|
|
442
358
|
requestAnimationFrame(function () {
|
|
@@ -449,36 +365,29 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
449
365
|
}
|
|
450
366
|
});
|
|
451
367
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption) {
|
|
452
|
-
var _this$
|
|
453
|
-
onChange = _this$
|
|
454
|
-
selectedOptions = _this$
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}));
|
|
459
|
-
}
|
|
368
|
+
var _this$props8 = _this.props,
|
|
369
|
+
onChange = _this$props8.onChange,
|
|
370
|
+
selectedOptions = _this$props8.selectedOptions;
|
|
371
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectedOptions.filter(function (option) {
|
|
372
|
+
return option !== removedOption;
|
|
373
|
+
}));
|
|
460
374
|
_this.clearActiveOption();
|
|
461
375
|
});
|
|
462
376
|
_defineProperty(_assertThisInitialized(_this), "clearSelectedOptions", function () {
|
|
463
|
-
var onChange
|
|
464
|
-
|
|
465
|
-
onChange([]);
|
|
466
|
-
}
|
|
377
|
+
var _this$props$onChange, _this$props9, _this$searchInputRefI3;
|
|
378
|
+
(_this$props$onChange = (_this$props9 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props9, []);
|
|
467
379
|
|
|
468
380
|
// Clicking the clear button will also cause it to disappear. This would result in focus
|
|
469
381
|
// shifting unexpectedly to the body element so we set it to the input which is more reasonable,
|
|
470
|
-
|
|
471
|
-
_this.searchInputRefInstance.focus();
|
|
472
|
-
}
|
|
382
|
+
(_this$searchInputRefI3 = _this.searchInputRefInstance) === null || _this$searchInputRefI3 === void 0 ? void 0 : _this$searchInputRefI3.focus();
|
|
473
383
|
if (!_this.state.isListOpen) {
|
|
474
384
|
_this.openList();
|
|
475
385
|
}
|
|
476
386
|
});
|
|
477
387
|
_defineProperty(_assertThisInitialized(_this), "onComboBoxClick", function () {
|
|
388
|
+
var _this$searchInputRefI4;
|
|
478
389
|
// When the user clicks anywhere on the box, enter the interaction state.
|
|
479
|
-
|
|
480
|
-
_this.searchInputRefInstance.focus();
|
|
481
|
-
}
|
|
390
|
+
(_this$searchInputRefI4 = _this.searchInputRefInstance) === null || _this$searchInputRefI4 === void 0 ? void 0 : _this$searchInputRefI4.focus();
|
|
482
391
|
|
|
483
392
|
// If the user does this from a state in which an option has focus, then we need to reset it or clear it.
|
|
484
393
|
if (Boolean(_this.props.singleSelection) && _this.props.selectedOptions.length === 1) {
|
|
@@ -493,25 +402,20 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
493
402
|
}
|
|
494
403
|
});
|
|
495
404
|
_defineProperty(_assertThisInitialized(_this), "onOpenListClick", function () {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
405
|
+
var _this$searchInputRefI5;
|
|
406
|
+
(_this$searchInputRefI5 = _this.searchInputRefInstance) === null || _this$searchInputRefI5 === void 0 ? void 0 : _this$searchInputRefI5.focus();
|
|
499
407
|
if (!_this.state.isListOpen) {
|
|
500
408
|
_this.openList();
|
|
501
409
|
}
|
|
502
410
|
});
|
|
503
411
|
_defineProperty(_assertThisInitialized(_this), "onOptionListScroll", function () {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
_defineProperty(_assertThisInitialized(_this), "onCloseListClick", function () {
|
|
509
|
-
_this.closeList();
|
|
412
|
+
var _this$searchInputRefI6;
|
|
413
|
+
(_this$searchInputRefI6 = _this.searchInputRefInstance) === null || _this$searchInputRefI6 === void 0 ? void 0 : _this$searchInputRefI6.focus();
|
|
510
414
|
});
|
|
511
415
|
_defineProperty(_assertThisInitialized(_this), "onSearchChange", function (searchValue) {
|
|
512
|
-
var _this$
|
|
513
|
-
onSearchChange = _this$
|
|
514
|
-
delimiter = _this$
|
|
416
|
+
var _this$props10 = _this.props,
|
|
417
|
+
onSearchChange = _this$props10.onSearchChange,
|
|
418
|
+
delimiter = _this$props10.delimiter;
|
|
515
419
|
if (onSearchChange) {
|
|
516
420
|
var _hasMatchingOptions = _this.state.matchingOptions.length > 0;
|
|
517
421
|
onSearchChange(searchValue, _hasMatchingOptions);
|
|
@@ -525,126 +429,53 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
525
429
|
_this.setCustomOptions(false);
|
|
526
430
|
}
|
|
527
431
|
});
|
|
528
|
-
_defineProperty(_assertThisInitialized(_this), "updateMatchingOptionsIfDifferent", function (newMatchingOptions) {
|
|
529
|
-
var _this$state = _this.state,
|
|
530
|
-
matchingOptions = _this$state.matchingOptions,
|
|
531
|
-
activeOptionIndex = _this$state.activeOptionIndex;
|
|
532
|
-
var _this$props6 = _this.props,
|
|
533
|
-
singleSelection = _this$props6.singleSelection,
|
|
534
|
-
selectedOptions = _this$props6.selectedOptions;
|
|
535
|
-
var areOptionsDifferent = false;
|
|
536
|
-
if (matchingOptions.length !== newMatchingOptions.length) {
|
|
537
|
-
areOptionsDifferent = true;
|
|
538
|
-
} else {
|
|
539
|
-
for (var i = 0; i < matchingOptions.length; i++) {
|
|
540
|
-
if (matchingOptions[i].label !== newMatchingOptions[i].label) {
|
|
541
|
-
areOptionsDifferent = true;
|
|
542
|
-
break;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
if (areOptionsDifferent) {
|
|
547
|
-
_this.optionsRefInstances = [];
|
|
548
|
-
var nextActiveOptionIndex = activeOptionIndex;
|
|
549
|
-
// ensure that the currently selected single option is active if it is in the matchingOptions
|
|
550
|
-
if (Boolean(singleSelection) && selectedOptions.length === 1) {
|
|
551
|
-
if (newMatchingOptions.includes(selectedOptions[0])) {
|
|
552
|
-
nextActiveOptionIndex = newMatchingOptions.indexOf(selectedOptions[0]);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
_this.setState({
|
|
556
|
-
matchingOptions: newMatchingOptions,
|
|
557
|
-
activeOptionIndex: nextActiveOptionIndex
|
|
558
|
-
});
|
|
559
|
-
if (!newMatchingOptions.length) {
|
|
560
|
-
// Prevent endless setState -> componentWillUpdate -> setState loop.
|
|
561
|
-
if (_this.hasActiveOption()) {
|
|
562
|
-
_this.clearActiveOption();
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
432
|
return _this;
|
|
568
433
|
}
|
|
569
434
|
_createClass(EuiComboBox, [{
|
|
570
|
-
key: "componentDidMount",
|
|
571
|
-
value: function componentDidMount() {
|
|
572
|
-
this._isMounted = true;
|
|
573
|
-
}
|
|
574
|
-
}, {
|
|
575
|
-
key: "componentDidUpdate",
|
|
576
|
-
value: function componentDidUpdate() {
|
|
577
|
-
var _this$props7 = this.props,
|
|
578
|
-
options = _this$props7.options,
|
|
579
|
-
selectedOptions = _this$props7.selectedOptions,
|
|
580
|
-
singleSelection = _this$props7.singleSelection,
|
|
581
|
-
sortMatchesBy = _this$props7.sortMatchesBy;
|
|
582
|
-
var searchValue = this.state.searchValue;
|
|
583
|
-
|
|
584
|
-
// React 16.3 has a bug (fixed in 16.4) where getDerivedStateFromProps
|
|
585
|
-
// isn't called after a state change, and we track `searchValue` in state
|
|
586
|
-
// instead we need to react to a change in searchValue here
|
|
587
|
-
this.updateMatchingOptionsIfDifferent((0, _matching_options.getMatchingOptions)({
|
|
588
|
-
options: options,
|
|
589
|
-
selectedOptions: selectedOptions,
|
|
590
|
-
searchValue: searchValue,
|
|
591
|
-
isCaseSensitive: this.props.isCaseSensitive,
|
|
592
|
-
isPreFiltered: this.props.async,
|
|
593
|
-
showPrevSelected: Boolean(singleSelection),
|
|
594
|
-
sortMatchesBy: sortMatchesBy
|
|
595
|
-
}));
|
|
596
|
-
}
|
|
597
|
-
}, {
|
|
598
|
-
key: "componentWillUnmount",
|
|
599
|
-
value: function componentWillUnmount() {
|
|
600
|
-
this._isMounted = false;
|
|
601
|
-
}
|
|
602
|
-
}, {
|
|
603
435
|
key: "render",
|
|
604
436
|
value: function render() {
|
|
605
437
|
var _this2 = this;
|
|
606
|
-
var _this$
|
|
607
|
-
dataTestSubj = _this$
|
|
608
|
-
async = _this$
|
|
609
|
-
className = _this$
|
|
610
|
-
compressed = _this$
|
|
611
|
-
customOptionText = _this$
|
|
612
|
-
fullWidth = _this$
|
|
613
|
-
id = _this$
|
|
614
|
-
inputRef = _this$
|
|
615
|
-
isCaseSensitive = _this$
|
|
616
|
-
isClearable = _this$
|
|
617
|
-
isDisabled = _this$
|
|
618
|
-
isInvalid = _this$
|
|
619
|
-
isLoading = _this$
|
|
620
|
-
noSuggestions = _this$
|
|
621
|
-
onBlur = _this$
|
|
622
|
-
onChange = _this$
|
|
623
|
-
onCreateOption = _this$
|
|
624
|
-
onSearchChange = _this$
|
|
625
|
-
options = _this$
|
|
626
|
-
placeholder = _this$
|
|
627
|
-
renderOption = _this$
|
|
628
|
-
rowHeight = _this$
|
|
629
|
-
selectedOptions = _this$
|
|
630
|
-
singleSelection = _this$
|
|
631
|
-
prepend = _this$
|
|
632
|
-
sortMatchesBy = _this$
|
|
633
|
-
delimiter = _this$
|
|
634
|
-
append = _this$
|
|
635
|
-
autoFocus = _this$
|
|
636
|
-
truncationProps = _this$
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
searchValue = _this$
|
|
646
|
-
|
|
647
|
-
matchingOptions = _this$state2.matchingOptions;
|
|
438
|
+
var _this$props11 = this.props,
|
|
439
|
+
dataTestSubj = _this$props11['data-test-subj'],
|
|
440
|
+
async = _this$props11.async,
|
|
441
|
+
className = _this$props11.className,
|
|
442
|
+
compressed = _this$props11.compressed,
|
|
443
|
+
customOptionText = _this$props11.customOptionText,
|
|
444
|
+
fullWidth = _this$props11.fullWidth,
|
|
445
|
+
id = _this$props11.id,
|
|
446
|
+
inputRef = _this$props11.inputRef,
|
|
447
|
+
isCaseSensitive = _this$props11.isCaseSensitive,
|
|
448
|
+
isClearable = _this$props11.isClearable,
|
|
449
|
+
isDisabled = _this$props11.isDisabled,
|
|
450
|
+
isInvalid = _this$props11.isInvalid,
|
|
451
|
+
isLoading = _this$props11.isLoading,
|
|
452
|
+
noSuggestions = _this$props11.noSuggestions,
|
|
453
|
+
onBlur = _this$props11.onBlur,
|
|
454
|
+
onChange = _this$props11.onChange,
|
|
455
|
+
onCreateOption = _this$props11.onCreateOption,
|
|
456
|
+
onSearchChange = _this$props11.onSearchChange,
|
|
457
|
+
options = _this$props11.options,
|
|
458
|
+
placeholder = _this$props11.placeholder,
|
|
459
|
+
renderOption = _this$props11.renderOption,
|
|
460
|
+
rowHeight = _this$props11.rowHeight,
|
|
461
|
+
selectedOptions = _this$props11.selectedOptions,
|
|
462
|
+
singleSelection = _this$props11.singleSelection,
|
|
463
|
+
prepend = _this$props11.prepend,
|
|
464
|
+
sortMatchesBy = _this$props11.sortMatchesBy,
|
|
465
|
+
delimiter = _this$props11.delimiter,
|
|
466
|
+
append = _this$props11.append,
|
|
467
|
+
autoFocus = _this$props11.autoFocus,
|
|
468
|
+
truncationProps = _this$props11.truncationProps,
|
|
469
|
+
inputPopoverProps = _this$props11.inputPopoverProps,
|
|
470
|
+
ariaLabel = _this$props11['aria-label'],
|
|
471
|
+
ariaLabelledby = _this$props11['aria-labelledby'],
|
|
472
|
+
rest = _objectWithoutProperties(_this$props11, _excluded);
|
|
473
|
+
var _this$state = this.state,
|
|
474
|
+
activeOptionIndex = _this$state.activeOptionIndex,
|
|
475
|
+
hasFocus = _this$state.hasFocus,
|
|
476
|
+
isListOpen = _this$state.isListOpen,
|
|
477
|
+
searchValue = _this$state.searchValue,
|
|
478
|
+
matchingOptions = _this$state.matchingOptions;
|
|
648
479
|
|
|
649
480
|
// Make sure we have a valid ID if users don't pass one as a prop
|
|
650
481
|
var inputId = id !== null && id !== void 0 ? id : this.rootId('_eui-combobox-id');
|
|
@@ -668,12 +499,11 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
668
499
|
var optionsList;
|
|
669
500
|
if (!noSuggestions && isListOpen) {
|
|
670
501
|
var optionsListDataTestSubj = dataTestSubj ? "".concat(dataTestSubj, "-optionsList") : undefined;
|
|
671
|
-
optionsList = (0, _react2.jsx)(
|
|
502
|
+
optionsList = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
672
503
|
token: "euiComboBox.listboxAriaLabel",
|
|
673
504
|
default: "Choose from the following options"
|
|
674
505
|
}, function (listboxAriaLabel) {
|
|
675
506
|
return (0, _react2.jsx)(_combo_box_options_list.EuiComboBoxOptionsList, {
|
|
676
|
-
zIndex: _this2.state.listZIndex,
|
|
677
507
|
activeOptionIndex: _this2.state.activeOptionIndex,
|
|
678
508
|
areAllOptionsSelected: _this2.areAllOptionsSelected(),
|
|
679
509
|
customOptionText: customOptionText,
|
|
@@ -688,9 +518,7 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
688
518
|
onOptionClick: _this2.onOptionClick,
|
|
689
519
|
onOptionEnterKey: _this2.onOptionEnterKey,
|
|
690
520
|
onScroll: _this2.onOptionListScroll,
|
|
691
|
-
optionRef: _this2.optionRefCallback,
|
|
692
521
|
options: options,
|
|
693
|
-
position: listPosition,
|
|
694
522
|
singleSelection: singleSelection,
|
|
695
523
|
renderOption: renderOption,
|
|
696
524
|
rootId: _this2.rootId,
|
|
@@ -698,14 +526,12 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
698
526
|
scrollToIndex: activeOptionIndex,
|
|
699
527
|
searchValue: searchValue,
|
|
700
528
|
selectedOptions: selectedOptions,
|
|
701
|
-
updatePosition: _this2.updatePosition,
|
|
702
|
-
width: width,
|
|
703
529
|
delimiter: delimiter,
|
|
704
530
|
getSelectedOptionForSearchValue: _matching_options.getSelectedOptionForSearchValue,
|
|
705
531
|
listboxAriaLabel: listboxAriaLabel,
|
|
706
532
|
truncationProps: truncationProps
|
|
707
533
|
});
|
|
708
|
-
})
|
|
534
|
+
});
|
|
709
535
|
}
|
|
710
536
|
return (
|
|
711
537
|
/**
|
|
@@ -721,39 +547,46 @@ var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
721
547
|
onKeyDown: this.onKeyDown,
|
|
722
548
|
onBlur: this.onContainerBlur,
|
|
723
549
|
ref: this.comboBoxRefCallback
|
|
724
|
-
}), (0, _react2.jsx)(
|
|
725
|
-
compressed: compressed,
|
|
726
|
-
focusedOptionId: this.hasActiveOption() ? this.rootId("_option-".concat(this.state.activeOptionIndex)) : undefined,
|
|
550
|
+
}), (0, _react2.jsx)(_popover.EuiInputPopover, _extends({
|
|
727
551
|
fullWidth: fullWidth,
|
|
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
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
552
|
+
panelPaddingSize: "none",
|
|
553
|
+
disableFocusTrap: true,
|
|
554
|
+
closeOnScroll: true
|
|
555
|
+
}, inputPopoverProps, {
|
|
556
|
+
isOpen: isListOpen,
|
|
557
|
+
closePopover: this.closeList,
|
|
558
|
+
input: (0, _react2.jsx)(_combo_box_input.EuiComboBoxInput, {
|
|
559
|
+
compressed: compressed,
|
|
560
|
+
focusedOptionId: this.hasActiveOption() ? this.rootId("_option-".concat(this.state.activeOptionIndex)) : undefined,
|
|
561
|
+
fullWidth: fullWidth,
|
|
562
|
+
hasSelectedOptions: selectedOptions.length > 0,
|
|
563
|
+
id: inputId,
|
|
564
|
+
inputRef: this.searchInputRefCallback,
|
|
565
|
+
isDisabled: isDisabled,
|
|
566
|
+
isListOpen: isListOpen,
|
|
567
|
+
noIcon: !!noSuggestions,
|
|
568
|
+
onChange: this.onSearchChange,
|
|
569
|
+
onClear: isClearable && !isDisabled ? this.clearSelectedOptions : undefined,
|
|
570
|
+
onClick: this.onComboBoxClick,
|
|
571
|
+
onCloseListClick: this.closeList,
|
|
572
|
+
onFocus: this.onComboBoxFocus,
|
|
573
|
+
onOpenListClick: this.onOpenListClick,
|
|
574
|
+
onRemoveOption: this.onRemoveOption,
|
|
575
|
+
placeholder: placeholder,
|
|
576
|
+
rootId: this.rootId,
|
|
577
|
+
searchValue: searchValue,
|
|
578
|
+
selectedOptions: selectedOptions,
|
|
579
|
+
singleSelection: singleSelection,
|
|
580
|
+
value: value,
|
|
581
|
+
append: singleSelection ? append : undefined,
|
|
582
|
+
prepend: singleSelection ? prepend : undefined,
|
|
583
|
+
isLoading: isLoading,
|
|
584
|
+
isInvalid: markAsInvalid,
|
|
585
|
+
autoFocus: autoFocus,
|
|
586
|
+
"aria-label": ariaLabel,
|
|
587
|
+
"aria-labelledby": ariaLabelledby
|
|
588
|
+
})
|
|
589
|
+
}), optionsList))
|
|
757
590
|
);
|
|
758
591
|
}
|
|
759
592
|
}], [{
|
|
@@ -909,5 +742,10 @@ EuiComboBox.propTypes = {
|
|
|
909
742
|
* text will always take precedence.
|
|
910
743
|
*/
|
|
911
744
|
truncationProps: _propTypes.default.any,
|
|
745
|
+
/**
|
|
746
|
+
* Allows customizing the underlying EuiInputPopover component
|
|
747
|
+
* (except for props that control state).
|
|
748
|
+
*/
|
|
749
|
+
inputPopoverProps: _propTypes.default.any,
|
|
912
750
|
css: _propTypes.default.any
|
|
913
751
|
};
|