@elastic/eui 67.1.6 → 67.1.8

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 (107) hide show
  1. package/dist/eui_theme_dark.css +0 -7
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -7
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/badge/beta_badge/beta_badge.js +4 -4
  6. package/es/components/basic_table/in_memory_table.js +16 -2
  7. package/es/components/breadcrumbs/breadcrumb.js +9 -5
  8. package/es/components/breadcrumbs/breadcrumbs.js +7 -4
  9. package/es/components/card/card.js +6 -28
  10. package/es/components/card/checkable_card/checkable_card.js +3 -2
  11. package/es/components/datagrid/controls/column_selector.js +1 -1
  12. package/es/components/datagrid/controls/column_sorting.js +1 -1
  13. package/es/components/header/header_links/header_links.js +6 -0
  14. package/es/components/modal/modal.js +17 -2
  15. package/es/components/page_template/page_template.js +6 -9
  16. package/es/components/popover/popover.js +13 -3
  17. package/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
  18. package/es/components/popover/popover_panel/_popover_panel.js +8 -2
  19. package/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
  20. package/es/components/search_bar/query/ast.js +14 -3
  21. package/es/components/search_bar/search_bar.js +39 -5
  22. package/es/components/search_bar/search_box.js +37 -4
  23. package/es/components/tour/tour.styles.js +4 -3
  24. package/es/components/tour/tour_step.js +13 -5
  25. package/eui.d.ts +43 -8
  26. package/i18ntokens.json +12 -12
  27. package/lib/components/badge/beta_badge/beta_badge.js +4 -8
  28. package/lib/components/basic_table/in_memory_table.js +16 -2
  29. package/lib/components/breadcrumbs/breadcrumb.js +9 -5
  30. package/lib/components/breadcrumbs/breadcrumbs.js +7 -4
  31. package/lib/components/card/card.js +7 -30
  32. package/lib/components/card/checkable_card/checkable_card.js +3 -2
  33. package/lib/components/datagrid/controls/column_selector.js +1 -1
  34. package/lib/components/datagrid/controls/column_sorting.js +1 -1
  35. package/lib/components/header/header_links/header_links.js +6 -0
  36. package/lib/components/modal/modal.js +23 -2
  37. package/lib/components/page_template/page_template.js +6 -9
  38. package/lib/components/popover/popover.js +13 -3
  39. package/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
  40. package/lib/components/popover/popover_panel/_popover_panel.js +8 -2
  41. package/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
  42. package/lib/components/search_bar/query/ast.js +14 -3
  43. package/lib/components/search_bar/search_bar.js +40 -5
  44. package/lib/components/search_bar/search_box.js +38 -4
  45. package/lib/components/tour/tour.styles.js +3 -2
  46. package/lib/components/tour/tour_step.js +7 -5
  47. package/optimize/es/components/badge/beta_badge/beta_badge.js +4 -4
  48. package/optimize/es/components/basic_table/in_memory_table.js +1 -1
  49. package/optimize/es/components/breadcrumbs/breadcrumb.js +3 -2
  50. package/optimize/es/components/breadcrumbs/breadcrumbs.js +7 -4
  51. package/optimize/es/components/card/card.js +5 -27
  52. package/optimize/es/components/card/checkable_card/checkable_card.js +3 -2
  53. package/optimize/es/components/datagrid/controls/column_selector.js +1 -1
  54. package/optimize/es/components/datagrid/controls/column_sorting.js +1 -1
  55. package/optimize/es/components/modal/modal.js +17 -2
  56. package/optimize/es/components/page_template/page_template.js +6 -9
  57. package/optimize/es/components/popover/popover.js +7 -3
  58. package/optimize/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
  59. package/optimize/es/components/popover/popover_panel/_popover_panel.js +6 -1
  60. package/optimize/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
  61. package/optimize/es/components/search_bar/query/ast.js +14 -3
  62. package/optimize/es/components/search_bar/search_bar.js +31 -5
  63. package/optimize/es/components/search_bar/search_box.js +29 -3
  64. package/optimize/es/components/tour/tour.styles.js +4 -3
  65. package/optimize/es/components/tour/tour_step.js +7 -5
  66. package/optimize/lib/components/badge/beta_badge/beta_badge.js +4 -11
  67. package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
  68. package/optimize/lib/components/breadcrumbs/breadcrumb.js +3 -2
  69. package/optimize/lib/components/breadcrumbs/breadcrumbs.js +7 -4
  70. package/optimize/lib/components/card/card.js +6 -29
  71. package/optimize/lib/components/card/checkable_card/checkable_card.js +3 -2
  72. package/optimize/lib/components/datagrid/controls/column_selector.js +1 -1
  73. package/optimize/lib/components/datagrid/controls/column_sorting.js +1 -1
  74. package/optimize/lib/components/modal/modal.js +22 -2
  75. package/optimize/lib/components/page_template/page_template.js +6 -9
  76. package/optimize/lib/components/popover/popover.js +7 -3
  77. package/optimize/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
  78. package/optimize/lib/components/popover/popover_panel/_popover_panel.js +6 -1
  79. package/optimize/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
  80. package/optimize/lib/components/search_bar/query/ast.js +14 -3
  81. package/optimize/lib/components/search_bar/search_bar.js +31 -5
  82. package/optimize/lib/components/search_bar/search_box.js +30 -3
  83. package/optimize/lib/components/tour/tour.styles.js +3 -2
  84. package/optimize/lib/components/tour/tour_step.js +7 -5
  85. package/package.json +1 -1
  86. package/src/components/datagrid/controls/_data_grid_toolbar.scss +0 -8
  87. package/src/components/modal/_modal.scss +3 -1
  88. package/test-env/components/badge/beta_badge/beta_badge.js +4 -11
  89. package/test-env/components/basic_table/in_memory_table.js +16 -2
  90. package/test-env/components/breadcrumbs/breadcrumb.js +9 -5
  91. package/test-env/components/breadcrumbs/breadcrumbs.js +7 -4
  92. package/test-env/components/card/card.js +7 -30
  93. package/test-env/components/card/checkable_card/checkable_card.js +3 -2
  94. package/test-env/components/datagrid/controls/column_selector.js +1 -1
  95. package/test-env/components/datagrid/controls/column_sorting.js +1 -1
  96. package/test-env/components/header/header_links/header_links.js +6 -0
  97. package/test-env/components/modal/modal.js +22 -2
  98. package/test-env/components/page_template/page_template.js +6 -9
  99. package/test-env/components/popover/popover.js +13 -3
  100. package/test-env/components/popover/popover_arrow/_popover_arrow.js +1 -0
  101. package/test-env/components/popover/popover_panel/_popover_panel.js +8 -2
  102. package/test-env/components/popover/popover_panel/_popover_panel.styles.js +16 -1
  103. package/test-env/components/search_bar/query/ast.js +14 -3
  104. package/test-env/components/search_bar/search_bar.js +39 -5
  105. package/test-env/components/search_bar/search_box.js +38 -4
  106. package/test-env/components/tour/tour.styles.js +3 -2
  107. package/test-env/components/tour/tour_step.js +7 -5
@@ -23,7 +23,7 @@ var _checkable_card = require("./checkable_card.styles");
23
23
 
24
24
  var _react2 = require("@emotion/react");
25
25
 
26
- var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
26
+ var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
27
27
 
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
29
 
@@ -40,6 +40,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
40
40
  var EuiCheckableCard = function EuiCheckableCard(_ref) {
41
41
  var children = _ref.children,
42
42
  className = _ref.className,
43
+ css = _ref.css,
43
44
  _ref$checkableType = _ref.checkableType,
44
45
  checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
45
46
  label = _ref.label,
@@ -52,7 +53,7 @@ var EuiCheckableCard = function EuiCheckableCard(_ref) {
52
53
 
53
54
  var euiThemeContext = (0, _services.useEuiTheme)();
54
55
  var styles = (0, _checkable_card.euiCheckableCardStyles)(euiThemeContext);
55
- var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
56
+ var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
56
57
  var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
57
58
  var childStyles = [styles.euiCheckableCard__children];
58
59
  var id = rest.id;
@@ -147,7 +147,7 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
147
147
  },
148
148
  anchorPosition: "downLeft",
149
149
  panelPaddingSize: "s",
150
- panelClassName: "euiDataGrid__controlPopoverWithDragDrop",
150
+ hasDragDrop: true,
151
151
  button: (0, _react2.jsx)(_button.EuiButtonEmpty, {
152
152
  size: "xs",
153
153
  iconType: allowColumnHiding ? 'listAdd' : 'list',
@@ -159,7 +159,7 @@ var useDataGridColumnSorting = function useDataGridColumnSorting(columns, sortin
159
159
  },
160
160
  anchorPosition: "downLeft",
161
161
  panelPaddingSize: "s",
162
- panelClassName: "euiDataGrid__controlPopoverWithDragDrop",
162
+ hasDragDrop: true,
163
163
  button: (0, _react2.jsx)(_button.EuiButtonEmpty, {
164
164
  size: "xs",
165
165
  iconType: "sortable",
@@ -272,6 +272,12 @@ EuiHeaderLinks.propTypes = {
272
272
  */
273
273
  repositionOnScroll: _propTypes.default.bool,
274
274
 
275
+ /**
276
+ * Must be set to true if using `EuiDragDropContext` within a popover,
277
+ * otherwise your nested drag & drop will have incorrect positioning
278
+ */
279
+ hasDragDrop: _propTypes.default.bool,
280
+
275
281
  /**
276
282
  * By default, popover content inherits the z-index of the anchor
277
283
  * component; pass `zIndex` to override
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.EuiModal = void 0;
7
9
 
8
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
9
11
 
10
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
13
 
@@ -27,6 +29,10 @@ var _excluded = ["className", "children", "initialFocus", "onClose", "maxWidth",
27
29
 
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
31
 
32
+ 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); }
33
+
34
+ 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; }
35
+
30
36
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
31
37
 
32
38
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -49,6 +55,19 @@ var EuiModal = function EuiModal(_ref) {
49
55
  style = _ref.style,
50
56
  rest = _objectWithoutProperties(_ref, _excluded);
51
57
 
58
+ // TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
59
+ // @see https://github.com/elastic/eui/issues/6304
60
+ var bodyScrollTop = (0, _react.useRef)(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
61
+ );
62
+ var onFocus = (0, _react.useCallback)(function () {
63
+ if (bodyScrollTop.current != null) {
64
+ window.scrollTo({
65
+ top: bodyScrollTop.current
66
+ });
67
+ bodyScrollTop.current = undefined; // Unset after first auto focus
68
+ }
69
+ }, []);
70
+
52
71
  var onKeyDown = function onKeyDown(event) {
53
72
  if (event.key === _services.keys.ESCAPE) {
54
73
  event.preventDefault();
@@ -71,11 +90,13 @@ var EuiModal = function EuiModal(_ref) {
71
90
 
72
91
  var classes = (0, _classnames.default)('euiModal', widthClassName, className);
73
92
  return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, null, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
74
- initialFocus: initialFocus
93
+ initialFocus: initialFocus,
94
+ scrollLock: true
75
95
  }, (0, _react2.jsx)("div", _extends({
76
96
  className: classes,
77
97
  onKeyDown: onKeyDown,
78
98
  tabIndex: 0,
99
+ onFocus: onFocus,
79
100
  style: newStyle || style
80
101
  }, rest), (0, _react2.jsx)(_i18n.EuiI18n, {
81
102
  token: "euiModal.closeModal",
@@ -169,15 +169,12 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
169
169
  _react.default.Children.toArray(children).forEach(function (child, index) {
170
170
  if (! /*#__PURE__*/_react.default.isValidElement(child)) return; // Skip non-components
171
171
 
172
- switch (child.type) {
173
- case _page.EuiPageSidebar:
174
- sidebar.push( /*#__PURE__*/_react.default.cloneElement(child, _objectSpread(_objectSpread({
175
- key: "sidebar".concat(index)
176
- }, getSideBarProps()), child.props)));
177
- break;
178
-
179
- default:
180
- sections.push(child);
172
+ if (child.type === _page.EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === _page.EuiPageSidebar) {
173
+ sidebar.push( /*#__PURE__*/_react.default.cloneElement(child, _objectSpread(_objectSpread({
174
+ key: "sidebar".concat(index)
175
+ }, getSideBarProps()), child.props)));
176
+ } else {
177
+ sections.push(child);
181
178
  }
182
179
  });
183
180
 
@@ -42,7 +42,7 @@ var _popover2 = require("./popover.styles");
42
42
 
43
43
  var _popover_panel = require("./popover_panel");
44
44
 
45
- var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "onTrapDeactivation", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
45
+ var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "hasDragDrop", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "onTrapDeactivation", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
46
46
 
47
47
  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); }
48
48
 
@@ -446,7 +446,8 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
446
446
  }, {
447
447
  key: "render",
448
448
  value: function render() {
449
- var _this4 = this;
449
+ var _panelProps$tabIndex,
450
+ _this4 = this;
450
451
 
451
452
  var _this$props = this.props,
452
453
  anchorClassName = _this$props.anchorClassName,
@@ -469,6 +470,7 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
469
470
  hasArrow = _this$props.hasArrow,
470
471
  arrowChildren = _this$props.arrowChildren,
471
472
  repositionOnScroll = _this$props.repositionOnScroll,
473
+ hasDragDrop = _this$props.hasDragDrop,
472
474
  zIndex = _this$props.zIndex,
473
475
  attachToAnchor = _this$props.attachToAnchor,
474
476
  display = _this$props.display,
@@ -481,9 +483,10 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
481
483
  container = _this$props.container,
482
484
  focusTrapProps = _this$props.focusTrapProps,
483
485
  initialFocusProp = _this$props.initialFocus,
484
- tabIndexProp = _this$props.tabIndex,
486
+ _tabIndexProp = _this$props.tabIndex,
485
487
  rest = _objectWithoutProperties(_this$props, _excluded);
486
488
 
489
+ var tabIndexProp = (_panelProps$tabIndex = panelProps === null || panelProps === void 0 ? void 0 : panelProps.tabIndex) !== null && _panelProps$tabIndex !== void 0 ? _panelProps$tabIndex : _tabIndexProp;
487
490
  var styles = (0, _popover2.euiPopoverStyles)();
488
491
  var popoverStyles = [styles.euiPopover, {
489
492
  display: display
@@ -547,6 +550,7 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
547
550
  position: this.state.arrowPosition,
548
551
  isAttached: attachToAnchor,
549
552
  className: (0, _classnames.default)(panelClassName, panelProps === null || panelProps === void 0 ? void 0 : panelProps.className),
553
+ hasDragDrop: hasDragDrop,
550
554
  hasShadow: false,
551
555
  paddingSize: panelPaddingSize,
552
556
  tabIndex: tabIndex,
@@ -767,6 +771,12 @@ EuiPopover.propTypes = {
767
771
  */
768
772
  repositionOnScroll: _propTypes.default.bool,
769
773
 
774
+ /**
775
+ * Must be set to true if using `EuiDragDropContext` within a popover,
776
+ * otherwise your nested drag & drop will have incorrect positioning
777
+ */
778
+ hasDragDrop: _propTypes.default.bool,
779
+
770
780
  /**
771
781
  * By default, popover content inherits the z-index of the anchor
772
782
  * component; pass `zIndex` to override
@@ -37,6 +37,7 @@ var EuiPopoverArrow = function EuiPopoverArrow(_ref) {
37
37
  var styles = (0, _popover_arrow.euiPopoverArrowStyles)(euiTheme);
38
38
  var cssStyles = [styles.euiPopoverArrow, styles[position]];
39
39
  return (0, _react2.jsx)("div", _extends({
40
+ className: "euiPopover__arrow",
40
41
  "data-popover-arrow": position,
41
42
  css: cssStyles
42
43
  }, rest), children);
@@ -21,7 +21,7 @@ var _popover_panel = require("./_popover_panel.styles");
21
21
 
22
22
  var _react2 = require("@emotion/react");
23
23
 
24
- var _excluded = ["children", "className", "isOpen", "isAttached", "position"];
24
+ var _excluded = ["children", "className", "isOpen", "isAttached", "hasDragDrop", "position"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
@@ -61,6 +61,7 @@ var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
61
61
  className = _ref.className,
62
62
  isOpen = _ref.isOpen,
63
63
  isAttached = _ref.isAttached,
64
+ hasDragDrop = _ref.hasDragDrop,
64
65
  position = _ref.position,
65
66
  rest = _objectWithoutProperties(_ref, _excluded);
66
67
 
@@ -76,6 +77,10 @@ var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
76
77
  panelCSS = [].concat(_toConsumableArray(panelCSS), [isOpen && styles.attached.isOpen, position && styles.attached[position]]);
77
78
  }
78
79
 
80
+ if (hasDragDrop) {
81
+ panelCSS = [].concat(_toConsumableArray(panelCSS), [styles.hasDragDrop.hasDragDrop, position && styles.hasDragDrop[position]]);
82
+ }
83
+
79
84
  return (0, _react2.jsx)(EuiPopoverPanelContext.Provider, {
80
85
  value: panelContext
81
86
  }, (0, _react2.jsx)(_panel.EuiPanel, _extends({
@@ -129,5 +134,6 @@ EuiPopoverPanel.propTypes = {
129
134
  css: _propTypes.default.any,
130
135
  isOpen: _propTypes.default.bool,
131
136
  isAttached: _propTypes.default.bool,
132
- position: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([null])])
137
+ position: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([null])]),
138
+ hasDragDrop: _propTypes.default.bool
133
139
  };
@@ -9,6 +9,8 @@ var _react = require("@emotion/react");
9
9
 
10
10
  var _mixins = require("../../../themes/amsterdam/global_styling/mixins");
11
11
 
12
+ var _functions = require("../../../themes/amsterdam/global_styling/functions");
13
+
12
14
  var _global_styling = require("../../../global_styling");
13
15
 
14
16
  /*
@@ -28,7 +30,8 @@ var translateDistance = 's';
28
30
  */
29
31
 
30
32
  var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContext) {
31
- var euiTheme = euiThemeContext.euiTheme;
33
+ var euiTheme = euiThemeContext.euiTheme,
34
+ colorMode = euiThemeContext.colorMode;
32
35
  return {
33
36
  // Base
34
37
  euiPopover__panel: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('min-width', "".concat(euiTheme.base * 7, "px")), ";", (0, _global_styling.logicalCSS)('max-width', "calc(100vw - ".concat(euiTheme.size.xl, ")")), ";backface-visibility:hidden;pointer-events:none;opacity:0;transform:translateY(0) translateX(0) translateZ(0);", (0, _mixins.euiShadowMedium)(euiThemeContext, {
@@ -49,6 +52,18 @@ var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContext) {
49
52
  // Satisfies TS
50
53
  left: /*#__PURE__*/(0, _react.css)(";label:left;"),
51
54
  right: /*#__PURE__*/(0, _react.css)(";label:right;")
55
+ },
56
+ // Overrides for drag & drop contexts within popovers. This is required because
57
+ // the fixed positions of drag and drop don't work inside of transformed elements
58
+ hasDragDrop: {
59
+ hasDragDrop: /*#__PURE__*/(0, _react.css)("transform:none;filter:none;", (0, _mixins.euiShadowMedium)(euiThemeContext, {
60
+ property: 'box-shadow'
61
+ }), ";;label:hasDragDrop;"),
62
+ // The offset transforms must be recreated in margins
63
+ top: /*#__PURE__*/(0, _react.css)("margin-block-start:", euiTheme.size[translateDistance], ";;label:top;"),
64
+ bottom: /*#__PURE__*/(0, _react.css)("margin-block-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 0 -6px 6px ", (0, _functions.getShadowColor)(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:bottom;"),
65
+ left: /*#__PURE__*/(0, _react.css)("margin-inline-start:", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 6px 0 6px ", (0, _functions.getShadowColor)(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:left;"),
66
+ right: /*#__PURE__*/(0, _react.css)("margin-inline-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n -6px 0 6px ", (0, _functions.getShadowColor)(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:right;")
52
67
  }
53
68
  };
54
69
  };
@@ -287,6 +287,10 @@ var arrayIncludesValue = function arrayIncludesValue(array, value) {
287
287
  return valuesEqual(item, value);
288
288
  });
289
289
  };
290
+
291
+ var mustToMatch = function mustToMatch(must) {
292
+ return must === true ? Match.MUST : Match.MUST_NOT;
293
+ };
290
294
  /**
291
295
  * The AST structure is an array of clauses. There are 3 types of clauses that are supported:
292
296
  *
@@ -411,9 +415,16 @@ var _AST = /*#__PURE__*/function () {
411
415
  }
412
416
  }, {
413
417
  key: "getOrFieldClause",
414
- value: function getOrFieldClause(field, value) {
418
+ value: function getOrFieldClause(field, value, must, operator) {
415
419
  return this.getFieldClause(field, function (clause) {
416
- return (0, _predicate.isArray)(clause.value) && ((0, _predicate.isNil)(value) || arrayIncludesValue(clause.value, value));
420
+ if (!(0, _predicate.isArray)(clause.value)) {
421
+ return false;
422
+ }
423
+
424
+ var matchValue = (0, _predicate.isNil)(value) || arrayIncludesValue(clause.value, value);
425
+ var matchMust = (0, _predicate.isNil)(must) || mustToMatch(must) === clause.match;
426
+ var matchOperator = (0, _predicate.isNil)(operator) || operator === clause.operator;
427
+ return matchValue && matchMust && matchOperator;
417
428
  });
418
429
  }
419
430
  }, {
@@ -421,7 +432,7 @@ var _AST = /*#__PURE__*/function () {
421
432
  value: function addOrFieldValue(field, value) {
422
433
  var must = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
423
434
  var operator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Operator.EQ;
424
- var existingClause = this.getOrFieldClause(field);
435
+ var existingClause = this.getOrFieldClause(field, undefined, must, operator);
425
436
 
426
437
  if (!existingClause) {
427
438
  var newClause = must ? Field.must[operator](field, [value]) : Field.mustNot[operator](field, [value]);
@@ -21,6 +21,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
21
21
 
22
22
  var _react = _interopRequireWildcard(require("react"));
23
23
 
24
+ var _accessibility = require("../../services/accessibility");
25
+
24
26
  var _predicate = require("../../services/predicate");
25
27
 
26
28
  var _flex = require("../flex");
@@ -43,6 +45,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
43
45
 
44
46
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
45
47
 
48
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
49
+
50
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
51
+
46
52
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
47
53
 
48
54
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -103,6 +109,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
103
109
 
104
110
  _this = _super.call(this, props);
105
111
 
112
+ _defineProperty(_assertThisInitialized(_this), "hintId", (0, _accessibility.htmlIdGenerator)('__hint')());
113
+
106
114
  _defineProperty(_assertThisInitialized(_this), "onSearch", function (queryText) {
107
115
  try {
108
116
  var query = parseQuery(queryText, _this.props);
@@ -159,7 +167,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
159
167
  _this.state = {
160
168
  query: _query,
161
169
  queryText: _query.text,
162
- error: null
170
+ error: null,
171
+ isHintVisible: false
163
172
  };
164
173
  return _this;
165
174
  }
@@ -221,10 +230,15 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
221
230
  }, {
222
231
  key: "render",
223
232
  value: function render() {
233
+ var _hint$popoverProps$is,
234
+ _hint$popoverProps,
235
+ _this2 = this;
236
+
224
237
  var _this$state = this.state,
225
238
  query = _this$state.query,
226
239
  queryText = _this$state.queryText,
227
- error = _this$state.error;
240
+ error = _this$state.error,
241
+ isHintVisibleState = _this$state.isHintVisible;
228
242
  var _this$props = this.props,
229
243
  _this$props$box = _this$props.box;
230
244
  _this$props$box = _this$props$box === void 0 ? {
@@ -235,7 +249,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
235
249
  box = _objectWithoutProperties(_this$props$box, _excluded),
236
250
  filters = _this$props.filters,
237
251
  toolsLeft = _this$props.toolsLeft,
238
- toolsRight = _this$props.toolsRight;
252
+ toolsRight = _this$props.toolsRight,
253
+ hint = _this$props.hint;
239
254
 
240
255
  var toolsLeftEl = this.renderTools(toolsLeft);
241
256
  var filtersBar = !filters ? undefined : (0, _react2.jsx)(_flex.EuiFlexItem, {
@@ -247,6 +262,7 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
247
262
  onChange: this.onFiltersChange
248
263
  }));
249
264
  var toolsRightEl = this.renderTools(toolsRight);
265
+ var isHintVisible = (_hint$popoverProps$is = hint === null || hint === void 0 ? void 0 : (_hint$popoverProps = hint.popoverProps) === null || _hint$popoverProps === void 0 ? void 0 : _hint$popoverProps.isOpen) !== null && _hint$popoverProps$is !== void 0 ? _hint$popoverProps$is : isHintVisibleState;
250
266
  return (0, _react2.jsx)(_flex.EuiFlexGroup, {
251
267
  gutterSize: "m",
252
268
  alignItems: "center",
@@ -258,7 +274,17 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
258
274
  query: queryText,
259
275
  onSearch: this.onSearch,
260
276
  isInvalid: error != null,
261
- title: error ? error.message : undefined
277
+ title: error ? error.message : undefined,
278
+ "aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
279
+ hint: hint ? _objectSpread({
280
+ isVisible: isHintVisible,
281
+ setIsVisible: function setIsVisible(isVisible) {
282
+ _this2.setState({
283
+ isHintVisible: isVisible
284
+ });
285
+ },
286
+ id: this.hintId
287
+ }, hint) : undefined
262
288
  }))), filtersBar, toolsRightEl);
263
289
  }
264
290
  }], [{
@@ -269,7 +295,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
269
295
  return {
270
296
  query: query,
271
297
  queryText: query.text,
272
- error: null
298
+ error: null,
299
+ isHintVisible: prevState.isHintVisible
273
300
  };
274
301
  }
275
302
 
@@ -457,6 +484,14 @@ EuiSearchBar.propTypes = {
457
484
  * Date formatter to use when parsing date values
458
485
  */
459
486
  dateFormat: _propTypes.default.any,
487
+
488
+ /**
489
+ * Hint to render below the search bar
490
+ */
491
+ hint: _propTypes.default.shape({
492
+ content: _propTypes.default.node.isRequired,
493
+ popoverProps: _propTypes.default.any
494
+ }),
460
495
  className: _propTypes.default.string,
461
496
  "aria-label": _propTypes.default.string,
462
497
  "data-test-subj": _propTypes.default.string,
@@ -13,9 +13,11 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
14
  var _form = require("../form");
15
15
 
16
+ var _popover = require("../popover");
17
+
16
18
  var _react2 = require("@emotion/react");
17
19
 
18
- var _excluded = ["query", "incremental"];
20
+ var _excluded = ["query", "incremental", "hint"];
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
@@ -88,6 +90,7 @@ var EuiSearchBox = /*#__PURE__*/function (_Component) {
88
90
  var _this$props = this.props,
89
91
  query = _this$props.query,
90
92
  incremental = _this$props.incremental,
93
+ hint = _this$props.hint,
91
94
  rest = _objectWithoutProperties(_this$props, _excluded);
92
95
 
93
96
  var ariaLabel;
@@ -98,15 +101,39 @@ var EuiSearchBox = /*#__PURE__*/function (_Component) {
98
101
  ariaLabel = 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.';
99
102
  }
100
103
 
101
- return (0, _react2.jsx)(_form.EuiFieldSearch, _extends({
104
+ var search = (0, _react2.jsx)(_form.EuiFieldSearch, _extends({
102
105
  inputRef: function inputRef(input) {
103
106
  return _this2.inputElement = input;
104
107
  },
105
108
  fullWidth: true,
106
109
  defaultValue: query,
107
110
  incremental: incremental,
108
- "aria-label": ariaLabel
111
+ "aria-label": ariaLabel,
112
+ onFocus: function onFocus() {
113
+ hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
114
+ }
109
115
  }, rest));
116
+
117
+ if (hint) {
118
+ return (0, _react2.jsx)(_popover.EuiInputPopover, _extends({
119
+ disableFocusTrap: true,
120
+ input: search,
121
+ isOpen: hint.isVisible,
122
+ fullWidth: true,
123
+ closePopover: function closePopover() {
124
+ hint.setIsVisible(false);
125
+ },
126
+ panelProps: {
127
+ 'aria-live': undefined,
128
+ 'aria-modal': undefined,
129
+ role: undefined,
130
+ tabIndex: -1,
131
+ id: hint.id
132
+ }
133
+ }, hint.popoverProps), hint.content);
134
+ }
135
+
136
+ return search;
110
137
  }
111
138
  }]);
112
139
 
@@ -123,5 +150,12 @@ _defineProperty(EuiSearchBox, "defaultProps", {
123
150
  EuiSearchBox.propTypes = {
124
151
  query: _propTypes.default.string.isRequired,
125
152
  // This is optional in EuiFieldSearchProps
126
- onSearch: _propTypes.default.func.isRequired
153
+ onSearch: _propTypes.default.func.isRequired,
154
+ hint: _propTypes.default.shape({
155
+ id: _propTypes.default.string.isRequired,
156
+ isVisible: _propTypes.default.bool.isRequired,
157
+ setIsVisible: _propTypes.default.func.isRequired,
158
+ content: _propTypes.default.node.isRequired,
159
+ popoverProps: _propTypes.default.any
160
+ })
127
161
  };
@@ -31,7 +31,7 @@ var euiTourStyles = function euiTourStyles(_ref) {
31
31
  colorMode = _ref.colorMode;
32
32
  return {
33
33
  // Targets EuiPopoverPanel
34
- euiTour: /*#__PURE__*/(0, _react.css)("&[data-popover-open='true']{[class*='euiTourBeacon']{opacity:1;}}[data-popover-arrow='top']{&:before{", (0, _global_styling.logicalCSS)('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";}};label:euiTour;")
34
+ euiTour: /*#__PURE__*/(0, _react.css)("[data-popover-arrow='top']::before{", (0, _global_styling.logicalCSS)('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";};label:euiTour;")
35
35
  };
36
36
  };
37
37
 
@@ -48,7 +48,8 @@ var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
48
48
  });
49
49
  return {
50
50
  // Base
51
- euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], ";;label:euiTourBeacon;"),
51
+ euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;", _global_styling.euiCanAnimate, "{opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], ";};label:euiTourBeacon;"),
52
+ isOpen: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{opacity:1;};label:isOpen;"),
52
53
  // Positions
53
54
  right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowOffset), ";;label:right;"),
54
55
  left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
@@ -33,7 +33,7 @@ var _tour = require("./tour.styles");
33
33
 
34
34
  var _react2 = require("@emotion/react");
35
35
 
36
- var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
36
+ var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
37
37
 
38
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
39
 
@@ -79,6 +79,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
79
79
  anchor = _ref.anchor,
80
80
  children = _ref.children,
81
81
  className = _ref.className,
82
+ css = _ref.css,
82
83
  _ref$closePopover = _ref.closePopover,
83
84
  closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
84
85
  content = _ref.content,
@@ -98,6 +99,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
98
99
  _ref$decoration = _ref.decoration,
99
100
  decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
100
101
  footerAction = _ref.footerAction,
102
+ panelProps = _ref.panelProps,
101
103
  rest = _objectWithoutProperties(_ref, _excluded);
102
104
 
103
105
  var titleId = (0, _services.useGeneratedHtmlId)();
@@ -141,7 +143,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
141
143
  var headerStyles = (0, _tour.euiTourHeaderStyles)(euiTheme);
142
144
  var footerStyles = (0, _tour.euiTourFooterStyles)(euiTheme);
143
145
  var beaconStyles = (0, _tour.euiTourBeaconStyles)(euiTheme);
144
- var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
146
+ var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
145
147
  var finishButtonProps = {
146
148
  color: 'text',
147
149
  flush: 'right',
@@ -200,9 +202,9 @@ var EuiTourStep = function EuiTourStep(_ref) {
200
202
  ownFocus: false,
201
203
  panelClassName: classes,
202
204
  panelStyle: style,
203
- panelProps: {
204
- css: tourStyles.euiTour
205
- },
205
+ panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
206
+ css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
207
+ }),
206
208
  offset: hasBeacon ? 10 : 0,
207
209
  'aria-labelledby': titleId,
208
210
  arrowChildren: hasBeacon && (0, _react2.jsx)(_beacon.EuiBeacon, {
@@ -10,7 +10,7 @@ var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPositi
10
10
  * in compliance with, at your election, the Elastic License 2.0 or the Server
11
11
  * Side Public License, v 1.
12
12
  */
13
- import React, { Fragment } from 'react';
13
+ import React from 'react';
14
14
  import classNames from 'classnames';
15
15
  import { keysOf } from '../../common';
16
16
  import { getSecureRelForTarget } from '../../../services';
@@ -106,7 +106,7 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
106
106
  anchorProps: anchorProps
107
107
  }, content);
108
108
  } else {
109
- return ___EmotionJSX(Fragment, null, content);
109
+ return ___EmotionJSX("span", anchorProps, content);
110
110
  }
111
111
  } else {
112
112
  if (tooltipContent) {
@@ -127,10 +127,10 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
127
127
  console.warn("Only string titles are permitted on badges that do not use tooltips. Found: ".concat(_typeof(spanTitle)));
128
128
  }
129
129
 
130
- return ___EmotionJSX("span", _extends({
130
+ return ___EmotionJSX("span", anchorProps, ___EmotionJSX("span", _extends({
131
131
  className: classes,
132
132
  title: spanTitle
133
- }, rest), icon || label);
133
+ }, rest), icon || label));
134
134
  }
135
135
  }
136
136
  };
@@ -382,7 +382,7 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
382
382
  sortName = _this$state2.sortName,
383
383
  pageIndex = _this$state2.pageIndex,
384
384
  pageSize = _this$state2.pageSize;
385
- var matchingItems = query ? EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
385
+ var matchingItems = query !== null && (executeQueryOptions === null || executeQueryOptions === void 0 ? void 0 : executeQueryOptions.enabled) !== false ? EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
386
386
  var sortedItems = sortName ? matchingItems.slice(0) // avoid mutating the source array
387
387
  .sort(this.getItemSorter()) // sort, causes mutation
388
388
  : matchingItems;