@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.
Files changed (206) hide show
  1. package/dist/eui_theme_dark.css +26 -526
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +26 -526
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/basic_table.js +7 -2
  6. package/es/components/basic_table/in_memory_table.js +7 -2
  7. package/es/components/collapsible_nav/collapsible_nav.js +5 -0
  8. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
  9. package/es/components/color_picker/index.js +0 -4
  10. package/es/components/combo_box/combo_box.js +142 -304
  11. package/es/components/combo_box/combo_box_input/combo_box_input.js +0 -13
  12. package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +34 -118
  13. package/es/components/context_menu/context_menu_panel.js +6 -6
  14. package/es/components/flex/flex_grid.styles.js +1 -1
  15. package/es/components/flex/flex_group.styles.js +1 -1
  16. package/es/components/flyout/flyout.js +32 -33
  17. package/es/components/flyout/flyout.styles.js +13 -3
  18. package/es/components/form/range/dual_range.js +4 -0
  19. package/es/components/form/range/range.js +4 -0
  20. package/es/components/index.js +0 -1
  21. package/es/components/popover/input_popover.js +47 -3
  22. package/es/components/popover/popover.js +2 -2
  23. package/es/components/table/table_row_cell.js +27 -9
  24. package/es/components/text_truncate/index.js +1 -0
  25. package/es/components/text_truncate/text_block_truncate.js +78 -0
  26. package/es/global_styling/reset/global_styles.js +16 -2
  27. package/es/services/accessibility/index.js +0 -3
  28. package/es/services/index.js +1 -1
  29. package/es/test/rtl/component_helpers.d.ts +2 -0
  30. package/es/test/rtl/component_helpers.js +29 -1
  31. package/eui.d.ts +375 -667
  32. package/i18ntokens.json +52 -286
  33. package/lib/components/basic_table/basic_table.js +7 -2
  34. package/lib/components/basic_table/in_memory_table.js +7 -2
  35. package/lib/components/collapsible_nav/collapsible_nav.js +5 -0
  36. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
  37. package/lib/components/color_picker/index.js +0 -7
  38. package/lib/components/combo_box/combo_box.js +141 -303
  39. package/lib/components/combo_box/combo_box_input/combo_box_input.js +0 -13
  40. package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +34 -118
  41. package/lib/components/context_menu/context_menu_panel.js +5 -5
  42. package/lib/components/flex/flex_grid.styles.js +1 -1
  43. package/lib/components/flex/flex_group.styles.js +1 -1
  44. package/lib/components/flyout/flyout.js +31 -32
  45. package/lib/components/flyout/flyout.styles.js +19 -10
  46. package/lib/components/form/range/dual_range.js +4 -0
  47. package/lib/components/index.js +0 -11
  48. package/lib/components/popover/input_popover.js +48 -3
  49. package/lib/components/popover/popover.js +1 -1
  50. package/lib/components/table/table_row_cell.js +26 -8
  51. package/lib/components/text_truncate/index.js +7 -0
  52. package/lib/components/text_truncate/text_block_truncate.js +85 -0
  53. package/lib/global_styling/reset/global_styles.js +16 -2
  54. package/lib/services/accessibility/index.js +0 -21
  55. package/lib/services/index.js +0 -21
  56. package/lib/test/rtl/component_helpers.d.ts +2 -0
  57. package/lib/test/rtl/component_helpers.js +31 -2
  58. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
  59. package/optimize/es/components/color_picker/index.js +0 -4
  60. package/optimize/es/components/combo_box/combo_box.js +137 -304
  61. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +0 -12
  62. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +28 -107
  63. package/optimize/es/components/context_menu/context_menu_panel.js +6 -6
  64. package/optimize/es/components/flex/flex_grid.styles.js +1 -1
  65. package/optimize/es/components/flex/flex_group.styles.js +1 -1
  66. package/optimize/es/components/flyout/flyout.js +32 -33
  67. package/optimize/es/components/flyout/flyout.styles.js +13 -3
  68. package/optimize/es/components/index.js +0 -1
  69. package/optimize/es/components/popover/input_popover.js +43 -3
  70. package/optimize/es/components/popover/popover.js +2 -2
  71. package/optimize/es/components/table/table_row_cell.js +13 -5
  72. package/optimize/es/components/text_truncate/index.js +1 -0
  73. package/optimize/es/components/text_truncate/text_block_truncate.js +58 -0
  74. package/optimize/es/global_styling/reset/global_styles.js +13 -2
  75. package/optimize/es/services/accessibility/index.js +0 -3
  76. package/optimize/es/services/index.js +1 -1
  77. package/optimize/es/test/rtl/component_helpers.d.ts +2 -0
  78. package/optimize/es/test/rtl/component_helpers.js +29 -1
  79. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
  80. package/optimize/lib/components/color_picker/index.js +0 -7
  81. package/optimize/lib/components/combo_box/combo_box.js +136 -303
  82. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +0 -12
  83. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +28 -107
  84. package/optimize/lib/components/context_menu/context_menu_panel.js +5 -5
  85. package/optimize/lib/components/flex/flex_grid.styles.js +1 -1
  86. package/optimize/lib/components/flex/flex_group.styles.js +1 -1
  87. package/optimize/lib/components/flyout/flyout.js +31 -32
  88. package/optimize/lib/components/flyout/flyout.styles.js +19 -10
  89. package/optimize/lib/components/index.js +0 -11
  90. package/optimize/lib/components/popover/input_popover.js +44 -3
  91. package/optimize/lib/components/popover/popover.js +1 -1
  92. package/optimize/lib/components/table/table_row_cell.js +12 -4
  93. package/optimize/lib/components/text_truncate/index.js +7 -0
  94. package/optimize/lib/components/text_truncate/text_block_truncate.js +66 -0
  95. package/optimize/lib/global_styling/reset/global_styles.js +19 -10
  96. package/optimize/lib/services/accessibility/index.js +0 -21
  97. package/optimize/lib/services/index.js +0 -21
  98. package/optimize/lib/test/rtl/component_helpers.d.ts +2 -0
  99. package/optimize/lib/test/rtl/component_helpers.js +31 -2
  100. package/package.json +1 -1
  101. package/src/components/combo_box/combo_box_options_list/_combo_box_options_list.scss +5 -15
  102. package/src/components/context_menu/_context_menu_panel.scss +4 -0
  103. package/src/components/index.scss +0 -1
  104. package/src/global_styling/mixins/_index.scss +0 -1
  105. package/src/global_styling/variables/_index.scss +0 -1
  106. package/src/test/README.md +0 -15
  107. package/src/themes/amsterdam/global_styling/mixins/_index.scss +0 -1
  108. package/test-env/components/basic_table/basic_table.js +7 -2
  109. package/test-env/components/basic_table/in_memory_table.js +7 -2
  110. package/test-env/components/collapsible_nav/collapsible_nav.js +5 -0
  111. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -2
  112. package/test-env/components/color_picker/index.js +0 -7
  113. package/test-env/components/combo_box/combo_box.js +141 -303
  114. package/test-env/components/combo_box/combo_box_input/combo_box_input.js +0 -13
  115. package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +33 -117
  116. package/test-env/components/context_menu/context_menu_panel.js +5 -5
  117. package/test-env/components/flex/flex_grid.styles.js +1 -1
  118. package/test-env/components/flex/flex_group.styles.js +1 -1
  119. package/test-env/components/flyout/flyout.styles.js +19 -10
  120. package/test-env/components/form/range/dual_range.js +4 -0
  121. package/test-env/components/index.js +0 -11
  122. package/test-env/components/popover/input_popover.js +48 -3
  123. package/test-env/components/popover/popover.js +1 -1
  124. package/test-env/components/table/table_row_cell.js +26 -8
  125. package/test-env/components/text_truncate/index.js +7 -0
  126. package/test-env/components/text_truncate/text_block_truncate.js +82 -0
  127. package/test-env/global_styling/reset/global_styles.js +19 -10
  128. package/test-env/services/accessibility/index.js +0 -21
  129. package/test-env/services/index.js +0 -21
  130. package/test-env/test/rtl/component_helpers.js +31 -2
  131. package/es/components/color_picker/color_stops/color_stop_thumb.js +0 -371
  132. package/es/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -55
  133. package/es/components/color_picker/color_stops/color_stops.js +0 -499
  134. package/es/components/color_picker/color_stops/color_stops.styles.js +0 -61
  135. package/es/components/color_picker/color_stops/index.js +0 -9
  136. package/es/components/color_picker/color_stops/utils.js +0 -95
  137. package/es/components/suggest/index.js +0 -10
  138. package/es/components/suggest/suggest.a11y.js +0 -70
  139. package/es/components/suggest/suggest.js +0 -347
  140. package/es/components/suggest/suggest_item.js +0 -123
  141. package/es/components/suggest/types.js +0 -9
  142. package/es/services/accessibility/accessible_click_keys.js +0 -17
  143. package/es/services/accessibility/cascading_menu_keys.js +0 -28
  144. package/es/services/accessibility/combo_box_keys.js +0 -25
  145. package/lib/components/color_picker/color_stops/color_stop_thumb.js +0 -380
  146. package/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -62
  147. package/lib/components/color_picker/color_stops/color_stops.js +0 -505
  148. package/lib/components/color_picker/color_stops/color_stops.styles.js +0 -67
  149. package/lib/components/color_picker/color_stops/index.js +0 -12
  150. package/lib/components/color_picker/color_stops/utils.js +0 -108
  151. package/lib/components/suggest/index.js +0 -19
  152. package/lib/components/suggest/suggest.a11y.js +0 -73
  153. package/lib/components/suggest/suggest.js +0 -356
  154. package/lib/components/suggest/suggest_item.js +0 -130
  155. package/lib/components/suggest/types.js +0 -16
  156. package/lib/services/accessibility/accessible_click_keys.js +0 -21
  157. package/lib/services/accessibility/cascading_menu_keys.js +0 -35
  158. package/lib/services/accessibility/combo_box_keys.js +0 -32
  159. package/optimize/es/components/color_picker/color_stops/color_stop_thumb.js +0 -329
  160. package/optimize/es/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -55
  161. package/optimize/es/components/color_picker/color_stops/color_stops.js +0 -444
  162. package/optimize/es/components/color_picker/color_stops/color_stops.styles.js +0 -61
  163. package/optimize/es/components/color_picker/color_stops/index.js +0 -9
  164. package/optimize/es/components/color_picker/color_stops/utils.js +0 -90
  165. package/optimize/es/components/suggest/index.js +0 -10
  166. package/optimize/es/components/suggest/suggest.a11y.js +0 -70
  167. package/optimize/es/components/suggest/suggest.js +0 -256
  168. package/optimize/es/components/suggest/suggest_item.js +0 -89
  169. package/optimize/es/components/suggest/types.js +0 -9
  170. package/optimize/es/services/accessibility/accessible_click_keys.js +0 -14
  171. package/optimize/es/services/accessibility/cascading_menu_keys.js +0 -28
  172. package/optimize/es/services/accessibility/combo_box_keys.js +0 -25
  173. package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.js +0 -339
  174. package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -62
  175. package/optimize/lib/components/color_picker/color_stops/color_stops.js +0 -451
  176. package/optimize/lib/components/color_picker/color_stops/color_stops.styles.js +0 -67
  177. package/optimize/lib/components/color_picker/color_stops/index.js +0 -12
  178. package/optimize/lib/components/color_picker/color_stops/utils.js +0 -106
  179. package/optimize/lib/components/suggest/index.js +0 -19
  180. package/optimize/lib/components/suggest/suggest.a11y.js +0 -73
  181. package/optimize/lib/components/suggest/suggest.js +0 -266
  182. package/optimize/lib/components/suggest/suggest_item.js +0 -96
  183. package/optimize/lib/components/suggest/types.js +0 -16
  184. package/optimize/lib/services/accessibility/accessible_click_keys.js +0 -20
  185. package/optimize/lib/services/accessibility/cascading_menu_keys.js +0 -35
  186. package/optimize/lib/services/accessibility/combo_box_keys.js +0 -32
  187. package/src/components/suggest/_index.scss +0 -5
  188. package/src/components/suggest/_suggest_input.scss +0 -4
  189. package/src/components/suggest/_suggest_item.scss +0 -103
  190. package/src/components/suggest/_variables.scss +0 -13
  191. package/src/global_styling/mixins/_header.scss +0 -29
  192. package/src/global_styling/variables/_header.scss +0 -3
  193. package/test-env/components/color_picker/color_stops/color_stop_thumb.js +0 -372
  194. package/test-env/components/color_picker/color_stops/color_stop_thumb.styles.js +0 -62
  195. package/test-env/components/color_picker/color_stops/color_stops.js +0 -494
  196. package/test-env/components/color_picker/color_stops/color_stops.styles.js +0 -67
  197. package/test-env/components/color_picker/color_stops/index.js +0 -12
  198. package/test-env/components/color_picker/color_stops/utils.js +0 -106
  199. package/test-env/components/suggest/index.js +0 -19
  200. package/test-env/components/suggest/suggest.a11y.js +0 -73
  201. package/test-env/components/suggest/suggest.js +0 -348
  202. package/test-env/components/suggest/suggest_item.js +0 -129
  203. package/test-env/components/suggest/types.js +0 -16
  204. package/test-env/services/accessibility/accessible_click_keys.js +0 -20
  205. package/test-env/services/accessibility/cascading_menu_keys.js +0 -35
  206. package/test-env/services/accessibility/combo_box_keys.js +0 -32
@@ -67,12 +67,6 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
67
67
  inputWidth: inputWidth
68
68
  });
69
69
  });
70
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updatePosition", function () {
71
- // Wait a beat for the DOM to update, since we depend on DOM elements' bounds.
72
- requestAnimationFrame(function () {
73
- _this.props.updatePosition();
74
- });
75
- });
76
70
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFocus", function (event) {
77
71
  _this.props.onFocus(event);
78
72
  _this.setState({
@@ -113,10 +107,6 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
113
107
  value: function componentDidUpdate(prevProps) {
114
108
  if (prevProps.searchValue !== this.props.searchValue) {
115
109
  this.updateInputSize(this.props.searchValue);
116
-
117
- // We need to update the position of everything if the user enters enough input to change
118
- // the size of the input.
119
- this.updatePosition();
120
110
  }
121
111
  }
122
112
  }, {
@@ -142,7 +132,6 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
142
132
  searchValue = _this$props3.searchValue,
143
133
  selectedOptions = _this$props3.selectedOptions,
144
134
  singleSelectionProp = _this$props3.singleSelection,
145
- toggleButtonRef = _this$props3.toggleButtonRef,
146
135
  value = _this$props3.value,
147
136
  prepend = _this$props3.prepend,
148
137
  append = _this$props3.append,
@@ -209,7 +198,6 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
209
198
  'data-test-subj': 'comboBoxToggleListButton',
210
199
  disabled: isDisabled,
211
200
  onClick: isListOpen && !isDisabled ? onCloseListClick : onOpenListClick,
212
- ref: toggleButtonRef,
213
201
  side: 'right',
214
202
  tabIndex: -1,
215
203
  type: 'arrowDown'
@@ -27,11 +27,12 @@ var _combo_box_title = require("./combo_box_title");
27
27
  var _i18n = require("../../i18n");
28
28
  var _filter_select_item = require("../../filter_group/filter_select_item");
29
29
  var _badge = require("../../badge");
30
- var _popover_panel = require("../../popover/popover_panel");
31
30
  var _text_truncate = require("../../text_truncate");
31
+ var _input_popover = require("../../popover/input_popover");
32
32
  var _react2 = require("@emotion/react");
33
- var _excluded = ["key", "isGroupLabelOption", "label", "value", "prepend", "append", "truncationProps"],
34
- _excluded2 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "optionRef", "options", "position", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "updatePosition", "width", "delimiter", "zIndex", "style", "truncationProps", "listboxAriaLabel"];
33
+ var _excluded = ["children"],
34
+ _excluded2 = ["key", "isGroupLabelOption", "label", "value", "prepend", "append", "truncationProps"],
35
+ _excluded3 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "options", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "delimiter", "truncationProps", "listboxAriaLabel"];
35
36
  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); }
36
37
  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; }
37
38
  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; }
@@ -60,43 +61,25 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
60
61
  args[_key] = arguments[_key];
61
62
  }
62
63
  _this = _super.call.apply(_super, [this].concat(args));
63
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "listRefInstance", null);
64
64
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "listRef", null);
65
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "listBoxRef", null);
66
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updatePosition", function () {
67
- // Wait a beat for the DOM to update, since we depend on DOM elements' bounds.
68
- requestAnimationFrame(function () {
69
- _this.props.updatePosition(_this.listRefInstance);
70
- });
71
- });
72
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "closeListOnScroll", function (event) {
73
- // Close the list when a scroll event happens, but not if the scroll happened in the options list.
74
- // This mirrors Firefox's approach of auto-closing `select` elements onscroll.
75
- if (_this.listRefInstance && event.target && _this.listRefInstance.contains(event.target) === false) {
76
- _this.props.onCloseList(event);
77
- }
78
- });
79
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "listRefCallback", function (ref) {
80
- _this.props.listRef(ref);
81
- _this.listRefInstance = ref;
82
- });
83
65
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setListRef", function (ref) {
84
66
  _this.listRef = ref;
85
67
  });
86
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setListBoxRef", function (ref) {
87
- _this.listBoxRef = ref;
88
- if (ref) {
89
- ref.setAttribute('aria-label', _this.props.listboxAriaLabel);
90
- ref.setAttribute('id', _this.props.rootId('listbox'));
91
- ref.setAttribute('role', 'listbox');
92
- ref.setAttribute('tabIndex', '0');
93
- }
68
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ListInnerElement", function (_ref) {
69
+ var children = _ref.children,
70
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
71
+ return (0, _react2.jsx)("div", (0, _extends2.default)({}, rest, {
72
+ "aria-label": _this.props.listboxAriaLabel,
73
+ id: _this.props.rootId('listbox'),
74
+ role: "listbox",
75
+ tabIndex: "0"
76
+ }), children);
94
77
  });
95
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ListRow", function (_ref) {
78
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ListRow", function (_ref2) {
96
79
  var _option$key;
97
- var data = _ref.data,
98
- index = _ref.index,
99
- style = _ref.style;
80
+ var data = _ref2.data,
81
+ index = _ref2.index,
82
+ style = _ref2.style;
100
83
  var option = data[index];
101
84
  var key = option.key,
102
85
  isGroupLabelOption = option.isGroupLabelOption,
@@ -105,12 +88,11 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
105
88
  prepend = option.prepend,
106
89
  append = option.append,
107
90
  _truncationProps = option.truncationProps,
108
- rest = (0, _objectWithoutProperties2.default)(option, _excluded);
91
+ rest = (0, _objectWithoutProperties2.default)(option, _excluded2);
109
92
  var _this$props = _this.props,
110
93
  singleSelection = _this$props.singleSelection,
111
94
  selectedOptions = _this$props.selectedOptions,
112
95
  onOptionClick = _this$props.onOptionClick,
113
- optionRef = _this$props.optionRef,
114
96
  activeOptionIndex = _this$props.activeOptionIndex,
115
97
  renderOption = _this$props.renderOption,
116
98
  searchValue = _this$props.searchValue,
@@ -138,7 +120,6 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
138
120
  onOptionClick(option);
139
121
  }
140
122
  },
141
- ref: optionRef.bind((0, _assertThisInitialized2.default)(_this), index),
142
123
  isFocused: optionIsFocused,
143
124
  checked: checked,
144
125
  showIcons: singleSelection ? true : false,
@@ -197,51 +178,12 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
197
178
  return _this;
198
179
  }
199
180
  (0, _createClass2.default)(EuiComboBoxOptionsList, [{
200
- key: "componentDidMount",
201
- value: function componentDidMount() {
202
- var _this2 = this;
203
- // Wait a frame, otherwise moving focus from one combo box to another will result in the class
204
- // being removed from the body.
205
- requestAnimationFrame(function () {
206
- document.body.classList.add('euiBody-hasPortalContent');
207
- });
208
- this.updatePosition();
209
- window.addEventListener('resize', this.updatePosition);
210
-
211
- // Firefox will trigger a scroll event in many common situations when the options list div is appended
212
- // to the DOM; in testing it was always within 100ms, but setting a timeout here for 500ms to be safe
213
- setTimeout(function () {
214
- window.addEventListener('scroll', _this2.closeListOnScroll, {
215
- passive: true,
216
- // for better performance as we won't call preventDefault
217
- capture: true // scroll events don't bubble, they must be captured instead
218
- });
219
- }, 500);
220
- }
221
- }, {
222
181
  key: "componentDidUpdate",
223
182
  value: function componentDidUpdate(prevProps) {
224
- var options = prevProps.options,
225
- selectedOptions = prevProps.selectedOptions,
226
- searchValue = prevProps.searchValue;
227
-
228
- // We don't compare matchingOptions because that will result in a loop.
229
- if (searchValue !== this.props.searchValue || options !== this.props.options || selectedOptions !== this.props.selectedOptions) {
230
- this.updatePosition();
231
- }
232
183
  if (this.listRef && typeof this.props.activeOptionIndex !== 'undefined' && this.props.activeOptionIndex !== prevProps.activeOptionIndex) {
233
184
  this.listRef.scrollToItem(this.props.activeOptionIndex, 'auto');
234
185
  }
235
186
  }
236
- }, {
237
- key: "componentWillUnmount",
238
- value: function componentWillUnmount() {
239
- document.body.classList.remove('euiBody-hasPortalContent');
240
- window.removeEventListener('resize', this.updatePosition);
241
- window.removeEventListener('scroll', this.closeListOnScroll, {
242
- capture: true
243
- });
244
- }
245
187
  }, {
246
188
  key: "render",
247
189
  value: function render() {
@@ -261,10 +203,7 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
261
203
  onOptionClick = _this$props2.onOptionClick,
262
204
  onOptionEnterKey = _this$props2.onOptionEnterKey,
263
205
  onScroll = _this$props2.onScroll,
264
- optionRef = _this$props2.optionRef,
265
206
  options = _this$props2.options,
266
- _this$props2$position = _this$props2.position,
267
- position = _this$props2$position === void 0 ? 'bottom' : _this$props2$position,
268
207
  renderOption = _this$props2.renderOption,
269
208
  rootId = _this$props2.rootId,
270
209
  rowHeight = _this$props2.rowHeight,
@@ -272,14 +211,10 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
272
211
  searchValue = _this$props2.searchValue,
273
212
  selectedOptions = _this$props2.selectedOptions,
274
213
  singleSelection = _this$props2.singleSelection,
275
- updatePosition = _this$props2.updatePosition,
276
- width = _this$props2.width,
277
214
  delimiter = _this$props2.delimiter,
278
- zIndex = _this$props2.zIndex,
279
- style = _this$props2.style,
280
215
  truncationProps = _this$props2.truncationProps,
281
216
  listboxAriaLabel = _this$props2.listboxAriaLabel,
282
- rest = (0, _objectWithoutProperties2.default)(_this$props2, _excluded2);
217
+ rest = (0, _objectWithoutProperties2.default)(_this$props2, _excluded3);
283
218
  var emptyStateContent;
284
219
  if (isLoading) {
285
220
  emptyStateContent = (0, _react2.jsx)(_flex.EuiFlexGroup, {
@@ -376,44 +311,30 @@ var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
376
311
  var numVisibleOptions = matchingOptions.length < 7 ? matchingOptions.length : 7;
377
312
  var height = numVisibleOptions * (rowHeight + 1); // Add one for the border
378
313
 
379
- // bounded by max-height of euiComboBoxOptionsList__rowWrap
314
+ // bounded by max-height of .euiComboBoxOptionsList
380
315
  var boundedHeight = height > 200 ? 200 : height;
381
316
  var optionsList = (0, _react2.jsx)(_reactWindow.FixedSizeList, {
317
+ className: "euiComboBoxOptionsList__virtualization",
382
318
  height: boundedHeight,
383
319
  onScroll: onScroll,
384
320
  itemCount: matchingOptions.length,
385
321
  itemSize: rowHeight,
386
322
  itemData: matchingOptions,
387
323
  ref: this.setListRef,
388
- innerRef: this.setListBoxRef,
389
- width: width
324
+ innerElementType: this.ListInnerElement,
325
+ width: this.context
390
326
  }, this.ListRow);
391
-
392
- /**
393
- * Reusing the EuiPopover__panel classes to help with consistency/maintenance.
394
- * But this should really be converted to user the popover component.
395
- */
396
- var classes = (0, _classnames.default)('euiComboBoxOptionsList');
397
- return (0, _react2.jsx)(_popover_panel.EuiPopoverPanel, (0, _extends2.default)({
398
- paddingSize: "none",
399
- hasShadow: false,
400
- className: classes,
401
- panelRef: this.listRefCallback,
327
+ return (0, _react2.jsx)("div", (0, _extends2.default)({
328
+ className: "euiComboBoxOptionsList",
402
329
  "data-test-subj": (0, _classnames.default)('comboBoxOptionsList', dataTestSubj),
403
- style: _objectSpread(_objectSpread({}, style), {}, {
404
- zIndex: zIndex
405
- }),
406
- isOpen: true,
407
- isAttached: true,
408
- position: position
409
- }, rest), (0, _react2.jsx)("div", {
410
- className: "euiComboBoxOptionsList__rowWrap"
411
- }, emptyState || optionsList));
330
+ ref: listRef
331
+ }, rest), emptyState || optionsList);
412
332
  }
413
333
  }]);
414
334
  return EuiComboBoxOptionsList;
415
335
  }(_react.Component);
416
336
  exports.EuiComboBoxOptionsList = EuiComboBoxOptionsList;
337
+ (0, _defineProperty2.default)(EuiComboBoxOptionsList, "contextType", _input_popover.EuiInputPopoverWidthContext);
417
338
  (0, _defineProperty2.default)(EuiComboBoxOptionsList, "defaultProps", {
418
339
  'data-test-subj': '',
419
340
  rowHeight: 29,
@@ -108,7 +108,7 @@ var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
108
108
  onClose = _this$props.onClose,
109
109
  showPreviousPanel = _this$props.showPreviousPanel;
110
110
  if (onClose && (items !== null && items !== void 0 && items.length || document.activeElement === _this.backButton || document.activeElement === _this.panel)) {
111
- if (event.key === _services.cascadingMenuKeys.ARROW_LEFT) {
111
+ if (event.key === _services.keys.ARROW_LEFT) {
112
112
  if (showPreviousPanel) {
113
113
  event.preventDefault();
114
114
  event.stopPropagation();
@@ -121,7 +121,7 @@ var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
121
121
  }
122
122
  if (items !== null && items !== void 0 && items.length) {
123
123
  switch (event.key) {
124
- case _services.cascadingMenuKeys.TAB:
124
+ case _services.keys.TAB:
125
125
  requestAnimationFrame(function () {
126
126
  // NOTE: document.activeElement is stale if not wrapped in requestAnimationFrame
127
127
  var focusedItemIndex = _this.state.menuItems.indexOf(document.activeElement);
@@ -132,21 +132,21 @@ var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
132
132
  });
133
133
  });
134
134
  break;
135
- case _services.cascadingMenuKeys.ARROW_UP:
135
+ case _services.keys.ARROW_UP:
136
136
  event.preventDefault();
137
137
  _this.focusMenuItem('up');
138
138
  if (_this.props.onUseKeyboardToNavigate) {
139
139
  _this.props.onUseKeyboardToNavigate();
140
140
  }
141
141
  break;
142
- case _services.cascadingMenuKeys.ARROW_DOWN:
142
+ case _services.keys.ARROW_DOWN:
143
143
  event.preventDefault();
144
144
  _this.focusMenuItem('down');
145
145
  if (_this.props.onUseKeyboardToNavigate) {
146
146
  _this.props.onUseKeyboardToNavigate();
147
147
  }
148
148
  break;
149
- case _services.cascadingMenuKeys.ARROW_RIGHT:
149
+ case _services.keys.ARROW_RIGHT:
150
150
  if (_this.props.showNextPanel) {
151
151
  event.preventDefault();
152
152
  _this.props.showNextPanel(onClose && _this.state.focusedItemIndex ? _this.state.focusedItemIndex - 1 // Account for panel title back button
@@ -115,7 +115,7 @@ var euiFlexGridStyles = function euiFlexGridStyles(euiThemeContext) {
115
115
  gutterSizes: {
116
116
  none: /*#__PURE__*/(0, _react.css)(";label:none;"),
117
117
  s: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.s, ";;label:s;"),
118
- m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.m, ";;label:m;"),
118
+ m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.base, ";;label:m;"),
119
119
  l: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.l, ";;label:l;"),
120
120
  xl: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.xl, ";;label:xl;")
121
121
  },
@@ -159,7 +159,7 @@ var euiFlexGroupStyles = function euiFlexGroupStyles(euiThemeContext) {
159
159
  none: /*#__PURE__*/(0, _react.css)(";label:none;"),
160
160
  xs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.xs, ";;label:xs;"),
161
161
  s: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.s, ";;label:s;"),
162
- m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.m, ";;label:m;"),
162
+ m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.base, ";;label:m;"),
163
163
  l: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.l, ";;label:l;"),
164
164
  xl: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.xxl, ";;label:xl;")
165
165
  },
@@ -24,7 +24,7 @@ var _portal = require("../portal");
24
24
  var _accessibility = require("../accessibility");
25
25
  var _flyout = require("./flyout.styles");
26
26
  var _react2 = require("@emotion/react");
27
- var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap", "aria-describedby"];
27
+ var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "pushAnimation", "focusTrapProps", "includeFixedHeadersInFocusTrap", "aria-describedby"];
28
28
  /*
29
29
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
30
30
  * or more contributor license agreements. Licensed under the Elastic License
@@ -79,8 +79,9 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
79
79
  outsideClickCloses = _ref.outsideClickCloses,
80
80
  _ref$pushMinBreakpoin = _ref.pushMinBreakpoint,
81
81
  pushMinBreakpoint = _ref$pushMinBreakpoin === void 0 ? 'l' : _ref$pushMinBreakpoin,
82
- _ref$focusTrapProps = _ref.focusTrapProps,
83
- _focusTrapProps = _ref$focusTrapProps === void 0 ? {} : _ref$focusTrapProps,
82
+ _ref$pushAnimation = _ref.pushAnimation,
83
+ pushAnimation = _ref$pushAnimation === void 0 ? false : _ref$pushAnimation,
84
+ _focusTrapProps = _ref.focusTrapProps,
84
85
  _ref$includeFixedHead = _ref.includeFixedHeadersInFocusTrap,
85
86
  includeFixedHeadersInFocusTrap = _ref$includeFixedHead === void 0 ? true : _ref$includeFixedHead,
86
87
  _ariaDescribedBy = _ref['aria-describedby'],
@@ -108,18 +109,16 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
108
109
  /**
109
110
  * Accomodate for the `isPushed` state by adding padding to the body equal to the width of the element
110
111
  */
111
- if (type === 'push') {
112
- if (isPushed) {
113
- if (side === 'right') {
114
- document.body.style.paddingRight = "".concat(dimensions.width, "px");
115
- } else if (side === 'left') {
116
- document.body.style.paddingLeft = "".concat(dimensions.width, "px");
117
- }
112
+ if (isPushed) {
113
+ if (side === 'right') {
114
+ document.body.style.paddingRight = "".concat(dimensions.width, "px");
115
+ } else if (side === 'left') {
116
+ document.body.style.paddingLeft = "".concat(dimensions.width, "px");
118
117
  }
119
118
  }
120
119
  return function () {
121
120
  document.body.classList.remove('euiBody--hasFlyout');
122
- if (type === 'push') {
121
+ if (isPushed) {
123
122
  if (side === 'right') {
124
123
  document.body.style.paddingRight = '';
125
124
  } else if (side === 'left') {
@@ -127,38 +126,36 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
127
126
  }
128
127
  }
129
128
  };
130
- }, [type, side, dimensions, isPushed]);
129
+ }, [side, dimensions, isPushed]);
131
130
 
132
131
  /**
133
132
  * ESC key closes flyout (always?)
134
133
  */
135
- var onKeyDown = function onKeyDown(event) {
134
+ var onKeyDown = (0, _react.useCallback)(function (event) {
136
135
  if (!isPushed && event.key === _services.keys.ESCAPE) {
137
136
  event.preventDefault();
138
137
  onClose(event);
139
138
  }
140
- };
139
+ }, [onClose, isPushed]);
141
140
 
142
141
  /**
143
142
  * Set inline styles
144
143
  */
145
- var newStyle = style;
146
- if (typeof maxWidth !== 'boolean') {
147
- newStyle = _objectSpread(_objectSpread({}, newStyle), (0, _global_styling.logicalStyle)('max-width', maxWidth));
148
- }
149
- if (!isEuiFlyoutSizeNamed(size)) {
150
- newStyle = _objectSpread(_objectSpread({}, newStyle), (0, _global_styling.logicalStyle)('width', size));
151
- }
144
+ var inlineStyles = (0, _react.useMemo)(function () {
145
+ var widthStyle = !isEuiFlyoutSizeNamed(size) && (0, _global_styling.logicalStyle)('width', size);
146
+ var maxWidthStyle = typeof maxWidth !== 'boolean' && (0, _global_styling.logicalStyle)('max-width', maxWidth);
147
+ return _objectSpread(_objectSpread(_objectSpread({}, style), widthStyle), maxWidthStyle);
148
+ }, [style, maxWidth, size]);
152
149
  var euiTheme = (0, _services.useEuiTheme)();
153
150
  var styles = (0, _flyout.euiFlyoutStyles)(euiTheme);
154
- var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, styles[type], type === 'push' && styles.pushSide[side], styles[side]];
151
+ var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay, isPushed && styles.push[side], isPushed && !pushAnimation && styles.push.noAnimation, styles[side]];
155
152
  var classes = (0, _classnames.default)('euiFlyout', className);
156
- var closeButton;
157
- if (onClose && !hideCloseButton) {
153
+ var closeButton = (0, _react.useMemo)(function () {
154
+ if (hideCloseButton || !onClose) return null;
158
155
  var closeButtonClasses = (0, _classnames.default)('euiFlyout__closeButton', closeButtonProps === null || closeButtonProps === void 0 ? void 0 : closeButtonProps.className);
159
156
  var closeButtonStyles = (0, _flyout.euiFlyoutCloseButtonStyles)(euiTheme);
160
157
  var closeButtonCssStyles = [closeButtonStyles.euiFlyout__closeButton, closeButtonStyles[closeButtonPosition], closeButtonPosition === 'outside' && closeButtonStyles.outsideSide[side], closeButtonProps === null || closeButtonProps === void 0 ? void 0 : closeButtonProps.css];
161
- closeButton = (0, _react2.jsx)(_i18n.EuiI18n, {
158
+ return (0, _react2.jsx)(_i18n.EuiI18n, {
162
159
  token: "euiFlyout.closeAriaLabel",
163
160
  default: "Close this dialog"
164
161
  }, function (closeAriaLabel) {
@@ -178,7 +175,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
178
175
  }
179
176
  }));
180
177
  });
181
- }
178
+ }, [onClose, hideCloseButton, closeButtonPosition, closeButtonProps, side, euiTheme]);
182
179
 
183
180
  /*
184
181
  * If not disabled, automatically add fixed EuiHeaders as shards
@@ -208,9 +205,11 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
208
205
  });
209
206
  }
210
207
  }, [includeFixedHeadersInFocusTrap, resizeRef]);
211
- var focusTrapProps = _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
212
- shards: [].concat((0, _toConsumableArray2.default)(fixedHeaders), (0, _toConsumableArray2.default)(_focusTrapProps.shards || []))
213
- });
208
+ var focusTrapProps = (0, _react.useMemo)(function () {
209
+ return _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
210
+ shards: [].concat((0, _toConsumableArray2.default)(fixedHeaders), (0, _toConsumableArray2.default)((_focusTrapProps === null || _focusTrapProps === void 0 ? void 0 : _focusTrapProps.shards) || []))
211
+ });
212
+ }, [fixedHeaders, _focusTrapProps]);
214
213
 
215
214
  /*
216
215
  * Provide meaningful screen reader instructions/details
@@ -243,7 +242,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
243
242
  * or if `outsideClickCloses={true}` to close on clicks that target
244
243
  * (both mousedown and mouseup) the overlay mask.
245
244
  */
246
- var onClickOutside = function onClickOutside(event) {
245
+ var onClickOutside = (0, _react.useCallback)(function (event) {
247
246
  // Do not close the flyout for any external click
248
247
  if (outsideClickCloses === false) return undefined;
249
248
  if (hasOverlayMask) {
@@ -255,7 +254,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
255
254
  }
256
255
  // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
257
256
  return undefined;
258
- };
257
+ }, [onClose, hasOverlayMask, outsideClickCloses]);
259
258
  var flyout = (0, _react2.jsx)(_focus_trap.EuiFocusTrap, (0, _extends2.default)({
260
259
  disabled: isPushed,
261
260
  scrollLock: hasOverlayMask,
@@ -264,7 +263,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
264
263
  }, focusTrapProps), (0, _react2.jsx)(Element, (0, _extends2.default)({
265
264
  className: classes,
266
265
  css: cssStyles,
267
- style: newStyle,
266
+ style: inlineStyles,
268
267
  ref: setRef
269
268
  }, rest, {
270
269
  role: !isPushed ? 'dialog' : rest.role,
@@ -12,13 +12,13 @@ var _mixins = require("../../themes/amsterdam/global_styling/mixins");
12
12
  var _color = require("../../services/color");
13
13
  var _form = require("../form/form.styles");
14
14
  var _templateObject, _templateObject2;
15
- /*
16
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
- * or more contributor license agreements. Licensed under the Elastic License
18
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
19
- * in compliance with, at your election, the Elastic License 2.0 or the Server
20
- * Side Public License, v 1.
21
- */
15
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
16
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
+ * or more contributor license agreements. Licensed under the Elastic License
18
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
19
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
20
+ * Side Public License, v 1.
21
+ */
22
22
  var euiFlyoutSlideInRight = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
23
23
  exports.euiFlyoutSlideInRight = euiFlyoutSlideInRight;
24
24
  var euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
@@ -38,6 +38,14 @@ var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeCon
38
38
  };
39
39
  };
40
40
  exports.euiFlyoutCloseButtonStyles = euiFlyoutCloseButtonStyles;
41
+ var _ref = process.env.NODE_ENV === "production" ? {
42
+ name: "yokctr-noAnimation",
43
+ styles: "animation-duration:0s!important;label:noAnimation;"
44
+ } : {
45
+ name: "yokctr-noAnimation",
46
+ styles: "animation-duration:0s!important;label:noAnimation;",
47
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
48
+ };
41
49
  var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
42
50
  var euiTheme = euiThemeContext.euiTheme;
43
51
  return {
@@ -53,10 +61,11 @@ var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
53
61
  left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:left;"),
54
62
  // Type
55
63
  overlay: /*#__PURE__*/(0, _react.css)((0, _mixins.euiShadowXLarge)(euiThemeContext), ";;label:overlay;"),
56
- push: /*#__PURE__*/(0, _react.css)("clip-path:none;animation-duration:0s!important;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
57
- pushSide: {
64
+ push: {
65
+ push: /*#__PURE__*/(0, _react.css)("clip-path:none;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
58
66
  right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', euiTheme.border.thick), ";;label:right;"),
59
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-right', euiTheme.border.thick), ";;label:left;")
67
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-right', euiTheme.border.thick), ";;label:left;"),
68
+ noAnimation: _ref
60
69
  },
61
70
  // Padding
62
71
  paddingSizes: {
@@ -817,17 +817,6 @@ Object.keys(_steps).forEach(function (key) {
817
817
  }
818
818
  });
819
819
  });
820
- var _suggest = require("./suggest");
821
- Object.keys(_suggest).forEach(function (key) {
822
- if (key === "default" || key === "__esModule") return;
823
- if (key in exports && exports[key] === _suggest[key]) return;
824
- Object.defineProperty(exports, key, {
825
- enumerable: true,
826
- get: function get() {
827
- return _suggest[key];
828
- }
829
- });
830
- });
831
820
  var _table = require("./table");
832
821
  Object.keys(_table).forEach(function (key) {
833
822
  if (key === "default" || key === "__esModule") return;
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.EuiInputPopover = void 0;
8
+ exports.EuiInputPopoverWidthContext = exports.EuiInputPopover = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -20,7 +20,7 @@ var _resize_observer = require("../observer/resize_observer");
20
20
  var _focus_trap = require("../focus_trap");
21
21
  var _form = require("../form/form.styles");
22
22
  var _popover = require("./popover");
23
- var _excluded = ["children", "className", "closePopover", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef"];
23
+ var _excluded = ["children", "className", "closePopover", "closeOnScroll", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef"];
24
24
  /*
25
25
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
26
26
  * or more contributor license agreements. Licensed under the Elastic License
@@ -32,11 +32,16 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
32
32
  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; }
33
33
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
34
34
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
35
+ // Used by child components that want to know the parent popover width
36
+ var EuiInputPopoverWidthContext = /*#__PURE__*/(0, _react.createContext)(0);
37
+ exports.EuiInputPopoverWidthContext = EuiInputPopoverWidthContext;
35
38
  var EuiInputPopover = function EuiInputPopover(_ref) {
36
39
  var _props$panelProps;
37
40
  var children = _ref.children,
38
41
  className = _ref.className,
39
42
  closePopover = _ref.closePopover,
43
+ _ref$closeOnScroll = _ref.closeOnScroll,
44
+ closeOnScroll = _ref$closeOnScroll === void 0 ? false : _ref$closeOnScroll,
40
45
  _ref$disableFocusTrap = _ref.disableFocusTrap,
41
46
  disableFocusTrap = _ref$disableFocusTrap === void 0 ? false : _ref$disableFocusTrap,
42
47
  focusTrapProps = _ref.focusTrapProps,
@@ -117,6 +122,40 @@ var EuiInputPopover = function EuiInputPopover(_ref) {
117
122
  }
118
123
  }
119
124
  }, [disableFocusTrap, closePopover, panelPropsOnKeyDown]);
125
+
126
+ /**
127
+ * Optional close on scroll behavior
128
+ */
129
+
130
+ (0, _react.useEffect)(function () {
131
+ // When the popover opens, add a scroll listener to the page (& remove it after)
132
+ if (closeOnScroll && panelEl) {
133
+ // Close the popover, but only if the scroll event occurs outside the input or the popover itself
134
+ var closePopoverOnScroll = function closePopoverOnScroll(event) {
135
+ if (!panelEl || !inputEl || !event.target) return;
136
+ var scrollTarget = event.target;
137
+ if (panelEl.contains(scrollTarget) === false && inputEl.contains(scrollTarget) === false) {
138
+ closePopover();
139
+ }
140
+ };
141
+
142
+ // Firefox will trigger a scroll event in many common situations when the options list div is appended
143
+ // to the DOM; in testing it was always within 100ms, but setting a timeout here for 500ms to be safe
144
+ var timeoutId = setTimeout(function () {
145
+ window.addEventListener('scroll', closePopoverOnScroll, {
146
+ passive: true,
147
+ // for better performance as we won't call preventDefault
148
+ capture: true // scroll events don't bubble, they must be captured instead
149
+ });
150
+ }, 500);
151
+ return function () {
152
+ window.removeEventListener('scroll', closePopoverOnScroll, {
153
+ capture: true
154
+ });
155
+ clearTimeout(timeoutId);
156
+ };
157
+ }
158
+ }, [closeOnScroll, closePopover, panelEl, inputEl]);
120
159
  return (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
121
160
  css: /*#__PURE__*/(0, _react2.css)(fullWidth ? undefined : (0, _global_styling.logicalCSS)('max-width', form.maxWidth), ";label:EuiInputPopover;"),
122
161
  repositionToCrossAxis: false,
@@ -134,7 +173,9 @@ var EuiInputPopover = function EuiInputPopover(_ref) {
134
173
  }), (0, _react2.jsx)(_focus_trap.EuiFocusTrap, (0, _extends2.default)({
135
174
  clickOutsideDisables: true,
136
175
  disabled: disableFocusTrap
137
- }, focusTrapProps), children));
176
+ }, focusTrapProps), (0, _react2.jsx)(EuiInputPopoverWidthContext.Provider, {
177
+ value: panelWidth
178
+ }, children)));
138
179
  };
139
180
  exports.EuiInputPopover = EuiInputPopover;
140
181
  EuiInputPopover.defaultProps = {