@elastic/eui 74.1.0 → 75.1.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 (149) hide show
  1. package/dist/eui_theme_dark.css +0 -323
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -323
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/code/code_block.js +5 -3
  6. package/es/components/code/code_block_annotations.js +94 -0
  7. package/es/components/code/code_block_annotations.style.js +18 -0
  8. package/es/components/code/code_block_full_screen.js +9 -3
  9. package/es/components/code/code_block_line.styles.js +3 -2
  10. package/es/components/code/utils.js +53 -13
  11. package/es/components/collapsible_nav/collapsible_nav.js +10 -11
  12. package/es/components/flyout/flyout.js +88 -24
  13. package/es/components/form/range/range_track.js +1 -1
  14. package/es/components/header/header.js +3 -1
  15. package/es/components/icon/assets/app_agent.js +2 -10
  16. package/es/components/icon/assets/app_fleet.js +10 -2
  17. package/es/components/search_bar/filters/field_value_selection_filter.js +6 -10
  18. package/es/components/selectable/selectable_list/selectable_list.js +19 -5
  19. package/es/components/steps/step.js +19 -12
  20. package/es/components/steps/step.styles.js +73 -0
  21. package/es/components/steps/step_horizontal.js +55 -42
  22. package/es/components/steps/step_horizontal.styles.js +55 -0
  23. package/es/components/steps/step_number.js +82 -73
  24. package/es/components/steps/step_number.styles.js +76 -0
  25. package/es/components/steps/steps_horizontal.js +11 -7
  26. package/es/components/steps/steps_horizontal.styles.js +35 -0
  27. package/es/components/steps/sub_steps.js +7 -1
  28. package/es/components/steps/sub_steps.styles.js +14 -0
  29. package/es/components/tour/tour_step_indicator.js +0 -3
  30. package/es/global_styling/utility/animations.js +4 -3
  31. package/eui.d.ts +130 -16
  32. package/i18ntokens.json +76 -12
  33. package/lib/components/code/code_block.js +5 -3
  34. package/lib/components/code/code_block_annotations.js +113 -0
  35. package/lib/components/code/code_block_annotations.style.js +29 -0
  36. package/lib/components/code/code_block_full_screen.js +9 -3
  37. package/lib/components/code/code_block_line.styles.js +3 -2
  38. package/lib/components/code/utils.js +54 -13
  39. package/lib/components/collapsible_nav/collapsible_nav.js +10 -11
  40. package/lib/components/flyout/flyout.js +85 -22
  41. package/lib/components/form/range/range_track.js +1 -1
  42. package/lib/components/header/header.js +3 -1
  43. package/lib/components/icon/assets/app_agent.js +2 -10
  44. package/lib/components/icon/assets/app_fleet.js +10 -2
  45. package/lib/components/icon/svgs/app_agent.svg +2 -4
  46. package/lib/components/icon/svgs/app_fleet.svg +4 -2
  47. package/lib/components/search_bar/filters/field_value_selection_filter.js +6 -10
  48. package/lib/components/selectable/selectable_list/selectable_list.js +19 -5
  49. package/lib/components/steps/step.js +21 -12
  50. package/lib/components/steps/step.styles.js +93 -0
  51. package/lib/components/steps/step_horizontal.js +56 -41
  52. package/lib/components/steps/step_horizontal.styles.js +66 -0
  53. package/lib/components/steps/step_number.js +86 -75
  54. package/lib/components/steps/step_number.styles.js +84 -0
  55. package/lib/components/steps/steps_horizontal.js +12 -7
  56. package/lib/components/steps/steps_horizontal.styles.js +38 -0
  57. package/lib/components/steps/sub_steps.js +9 -1
  58. package/lib/components/steps/sub_steps.styles.js +24 -0
  59. package/lib/components/tour/tour_step_indicator.js +0 -3
  60. package/lib/global_styling/utility/animations.js +6 -4
  61. package/optimize/es/components/code/code_block_annotations.js +79 -0
  62. package/optimize/es/components/code/code_block_annotations.style.js +18 -0
  63. package/optimize/es/components/code/code_block_full_screen.js +9 -3
  64. package/optimize/es/components/code/code_block_line.styles.js +3 -2
  65. package/optimize/es/components/code/utils.js +53 -13
  66. package/optimize/es/components/collapsible_nav/collapsible_nav.js +1 -4
  67. package/optimize/es/components/flyout/flyout.js +81 -24
  68. package/optimize/es/components/form/range/range_track.js +1 -1
  69. package/optimize/es/components/header/header.js +3 -1
  70. package/optimize/es/components/icon/assets/app_agent.js +2 -10
  71. package/optimize/es/components/icon/assets/app_fleet.js +10 -2
  72. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +6 -10
  73. package/optimize/es/components/selectable/selectable_list/selectable_list.js +19 -5
  74. package/optimize/es/components/steps/step.js +19 -12
  75. package/optimize/es/components/steps/step.styles.js +73 -0
  76. package/optimize/es/components/steps/step_horizontal.js +54 -41
  77. package/optimize/es/components/steps/step_horizontal.styles.js +55 -0
  78. package/optimize/es/components/steps/step_number.js +82 -73
  79. package/optimize/es/components/steps/step_number.styles.js +76 -0
  80. package/optimize/es/components/steps/steps_horizontal.js +11 -7
  81. package/optimize/es/components/steps/steps_horizontal.styles.js +35 -0
  82. package/optimize/es/components/steps/sub_steps.js +7 -1
  83. package/optimize/es/components/steps/sub_steps.styles.js +14 -0
  84. package/optimize/es/components/tour/tour_step_indicator.js +0 -3
  85. package/optimize/es/global_styling/utility/animations.js +4 -3
  86. package/optimize/lib/components/code/code_block_annotations.js +105 -0
  87. package/optimize/lib/components/code/code_block_annotations.style.js +29 -0
  88. package/optimize/lib/components/code/code_block_full_screen.js +9 -3
  89. package/optimize/lib/components/code/code_block_line.styles.js +3 -2
  90. package/optimize/lib/components/code/utils.js +54 -13
  91. package/optimize/lib/components/collapsible_nav/collapsible_nav.js +1 -4
  92. package/optimize/lib/components/flyout/flyout.js +80 -22
  93. package/optimize/lib/components/form/range/range_track.js +1 -1
  94. package/optimize/lib/components/header/header.js +3 -1
  95. package/optimize/lib/components/icon/assets/app_agent.js +2 -10
  96. package/optimize/lib/components/icon/assets/app_fleet.js +10 -2
  97. package/optimize/lib/components/icon/svgs/app_agent.svg +2 -4
  98. package/optimize/lib/components/icon/svgs/app_fleet.svg +4 -2
  99. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +6 -10
  100. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +16 -5
  101. package/optimize/lib/components/steps/step.js +21 -12
  102. package/optimize/lib/components/steps/step.styles.js +93 -0
  103. package/optimize/lib/components/steps/step_horizontal.js +55 -40
  104. package/optimize/lib/components/steps/step_horizontal.styles.js +66 -0
  105. package/optimize/lib/components/steps/step_number.js +86 -75
  106. package/optimize/lib/components/steps/step_number.styles.js +84 -0
  107. package/optimize/lib/components/steps/steps_horizontal.js +12 -7
  108. package/optimize/lib/components/steps/steps_horizontal.styles.js +38 -0
  109. package/optimize/lib/components/steps/sub_steps.js +9 -1
  110. package/optimize/lib/components/steps/sub_steps.styles.js +24 -0
  111. package/optimize/lib/components/tour/tour_step_indicator.js +0 -3
  112. package/optimize/lib/global_styling/utility/animations.js +6 -4
  113. package/package.json +3 -3
  114. package/src/components/index.scss +0 -1
  115. package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
  116. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  117. package/test-env/components/code/code_block_annotations.js +110 -0
  118. package/test-env/components/code/code_block_annotations.style.js +29 -0
  119. package/test-env/components/code/code_block_full_screen.js +9 -3
  120. package/test-env/components/code/code_block_line.styles.js +3 -2
  121. package/test-env/components/code/utils.js +54 -13
  122. package/test-env/components/collapsible_nav/collapsible_nav.js +10 -11
  123. package/test-env/components/form/range/range_track.js +1 -1
  124. package/test-env/components/header/header.js +3 -1
  125. package/test-env/components/icon/assets/app_agent.js +2 -10
  126. package/test-env/components/icon/assets/app_fleet.js +10 -2
  127. package/test-env/components/search_bar/filters/field_value_selection_filter.js +6 -10
  128. package/test-env/components/selectable/selectable_list/selectable_list.js +16 -5
  129. package/test-env/components/steps/step.js +21 -12
  130. package/test-env/components/steps/step.styles.js +93 -0
  131. package/test-env/components/steps/step_horizontal.js +56 -41
  132. package/test-env/components/steps/step_horizontal.styles.js +66 -0
  133. package/test-env/components/steps/step_number.js +86 -75
  134. package/test-env/components/steps/step_number.styles.js +84 -0
  135. package/test-env/components/steps/steps_horizontal.js +12 -7
  136. package/test-env/components/steps/steps_horizontal.styles.js +38 -0
  137. package/test-env/components/steps/sub_steps.js +9 -1
  138. package/test-env/components/steps/sub_steps.styles.js +24 -0
  139. package/test-env/components/tour/tour_step_indicator.js +0 -3
  140. package/test-env/global_styling/utility/animations.js +6 -4
  141. package/src/components/steps/_index.scss +0 -7
  142. package/src/components/steps/_mixins.scss +0 -12
  143. package/src/components/steps/_step_number.scss +0 -52
  144. package/src/components/steps/_steps.scss +0 -57
  145. package/src/components/steps/_steps_horizontal.scss +0 -135
  146. package/src/components/steps/_sub_steps.scss +0 -15
  147. package/src/components/steps/_variables.scss +0 -11
  148. package/src/themes/amsterdam/global_styling/variables/_steps.scss +0 -8
  149. package/src/themes/amsterdam/overrides/_steps.scss +0 -101
@@ -219,12 +219,14 @@ EuiCodeBlock.propTypes = {
219
219
 
220
220
  /**
221
221
  * Displays line numbers.
222
- * Optionally accepts a configuration object for setting the starting number and visual highlighting ranges:
223
- * `{ start: 100, highlight: '1, 5-10, 20-30, 40' }`
222
+ * Optionally accepts a configuration object for setting the starting number,
223
+ * visually highlighting ranges, or annotating specific lines:
224
+ * `{ start: 100, highlight: '1, 5-10, 20-30, 40', annotations: { 6: 'A special note about this line' } }`
224
225
  */
225
226
  lineNumbers: PropTypes.oneOfType([PropTypes.bool.isRequired, PropTypes.shape({
226
227
  start: PropTypes.number,
227
- highlight: PropTypes.string
228
+ highlight: PropTypes.string,
229
+ annotations: PropTypes.any
228
230
  }).isRequired]),
229
231
 
230
232
  /**
@@ -0,0 +1,94 @@
1
+ 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); }
2
+
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+
5
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
+
11
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
+
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+
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
+ */
22
+ import React, { useState } from 'react';
23
+ import PropTypes from "prop-types";
24
+ import { useEuiTheme } from '../../services';
25
+ import { useEuiI18n } from '../i18n';
26
+ import { EuiPopover } from '../popover';
27
+ import { EuiIcon } from '../icon';
28
+ import { useEuiButtonFocusCSS } from '../../themes/amsterdam/global_styling/mixins/button';
29
+ import { euiCodeBlockAnnotationsStyles } from './code_block_annotations.style';
30
+ import { jsx as ___EmotionJSX } from "@emotion/react";
31
+ export var EuiCodeBlockAnnotation = function EuiCodeBlockAnnotation(_ref) {
32
+ var lineNumber = _ref.lineNumber,
33
+ children = _ref.children;
34
+
35
+ var _useState = useState(false),
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ isOpen = _useState2[0],
38
+ setIsOpen = _useState2[1];
39
+
40
+ var ariaLabel = useEuiI18n('euiCodeBlockAnnotations.ariaLabel', 'Click to view a code annotation for line {lineNumber}', {
41
+ lineNumber: lineNumber
42
+ });
43
+
44
+ var _useEuiTheme = useEuiTheme(),
45
+ euiTheme = _useEuiTheme.euiTheme,
46
+ colorMode = _useEuiTheme.colorMode;
47
+
48
+ var styles = euiCodeBlockAnnotationsStyles(euiTheme);
49
+ var buttonIconFocusStyle = useEuiButtonFocusCSS();
50
+ var cssButtonIconStyles = [styles.euiCodeBlockAnnotation__buttonIcon, buttonIconFocusStyle];
51
+ var isDarkMode = colorMode === 'DARK';
52
+ return ___EmotionJSX(EuiPopover, {
53
+ isOpen: isOpen,
54
+ closePopover: function closePopover() {
55
+ return setIsOpen(false);
56
+ },
57
+ button: ___EmotionJSX("button", {
58
+ onClick: function onClick() {
59
+ return setIsOpen(!isOpen);
60
+ },
61
+ "aria-label": ariaLabel,
62
+ css: cssButtonIconStyles,
63
+ "data-test-subj": "euiCodeBlockAnnotationIcon"
64
+ }, ___EmotionJSX(EuiIcon, {
65
+ type: AnnotationInfoIcon,
66
+ size: "s",
67
+ color: isDarkMode ? euiTheme.colors.ink : 'ghost'
68
+ })),
69
+ css: styles.euiCodeBlockAnnotation,
70
+ zIndex: Number(euiTheme.levels.mask) + 1 // Ensure fullscreen annotation popovers sit above the mask
71
+ ,
72
+ anchorPosition: "leftCenter",
73
+ panelProps: {
74
+ 'data-test-subj': 'euiCodeBlockAnnotationPopover'
75
+ }
76
+ }, children);
77
+ };
78
+ EuiCodeBlockAnnotation.propTypes = {
79
+ lineNumber: PropTypes.number.isRequired
80
+ };
81
+
82
+ var AnnotationInfoIcon = function AnnotationInfoIcon(props) {
83
+ return ___EmotionJSX("svg", _extends({
84
+ width: 11,
85
+ height: 11,
86
+ viewBox: "0 0 16 16",
87
+ fill: "none",
88
+ xmlns: "http://www.w3.org/2000/svg"
89
+ }, props), ___EmotionJSX("path", {
90
+ fillRule: "evenodd",
91
+ clipRule: "evenodd",
92
+ d: "M7.139 14l-.052-6.007H5V6.28h4.111l.052 6.007h1.915V14h-3.94zM6.712 3.38c0-.396.118-.725.354-.987S7.639 2 8.077 2c.438 0 .777.131 1.016.393.24.262.359.591.359.987 0 .39-.12.714-.359.972s-.578.388-1.016.388c-.438 0-.775-.13-1.011-.388-.236-.258-.354-.582-.354-.972z"
93
+ }));
94
+ };
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ import { logicalCSS, logicalSizeCSS, mathWithUnits } from '../../global_styling';
10
+ export var euiCodeBlockAnnotationsStyles = function euiCodeBlockAnnotationsStyles(euiTheme) {
11
+ var buttonIconSize = mathWithUnits(euiTheme.size.base, function (x) {
12
+ return x - 1.5;
13
+ });
14
+ return {
15
+ euiCodeBlockAnnotation: /*#__PURE__*/css("position:absolute;", logicalCSS('right', 0), " ", logicalCSS('top', '50%'), " transform:translate(50%, -50%);line-height:1;;label:euiCodeBlockAnnotation;"),
16
+ euiCodeBlockAnnotation__buttonIcon: /*#__PURE__*/css(logicalSizeCSS(buttonIconSize), " display:flex;align-items:center;justify-content:center;background-color:", euiTheme.colors.primary, ";border-radius:50%;;label:euiCodeBlockAnnotation__buttonIcon;")
17
+ };
18
+ };
@@ -45,9 +45,15 @@ export var useFullScreen = function useFullScreen(_ref) {
45
45
  }, []);
46
46
  var onKeyDown = useCallback(function (event) {
47
47
  if (event.key === keys.ESCAPE) {
48
- event.preventDefault();
49
- event.stopPropagation();
50
- setIsFullScreen(false);
48
+ // We need to make sure annotation Escape keypresses don't also cause fullscreen mode to close
49
+ var focus = document.activeElement;
50
+ var isAnnotationPopover = !!(focus !== null && focus !== void 0 && focus.dataset.popoverOpen) || !!(focus !== null && focus !== void 0 && focus.closest('[data-popover-open]'));
51
+
52
+ if (!isAnnotationPopover) {
53
+ event.preventDefault();
54
+ event.stopPropagation();
55
+ setIsFullScreen(false);
56
+ }
51
57
  }
52
58
  }, []);
53
59
 
@@ -39,11 +39,12 @@ export var euiCodeBlockLineStyles = function euiCodeBlockLineStyles(euiThemeCont
39
39
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
40
40
  }),
41
41
  lineText: {
42
- euiCodeBlock__lineText: /*#__PURE__*/css("flex-grow:1;display:inline-block;padding-inline-start:", euiTheme.size.s, ";border-inline-start:", euiTheme.border.thin, ";user-select:text;;label:euiCodeBlock__lineText;"),
42
+ euiCodeBlock__lineText: /*#__PURE__*/css("flex-grow:1;display:inline-block;padding-inline-start:", euiTheme.size.m, ";border-inline-start:", euiTheme.border.thin, ";user-select:text;;label:euiCodeBlock__lineText;"),
43
43
  isHighlighted: /*#__PURE__*/css("background:", euiBackgroundColor(euiThemeContext, 'primary'), ";border-inline-start:", euiTheme.border.width.thick, " solid ", euiTheme.colors.primary, ";;label:isHighlighted;")
44
44
  },
45
45
  lineNumber: {
46
- euiCodeBlock__lineNumber: /*#__PURE__*/css("flex-grow:0;flex-shrink:0;user-select:none;padding-inline-end:", euiTheme.size.s, ";box-sizing:content-box;&:before{content:attr(data-line-number);color:", euiTheme.colors.subduedText, ";text-align:end;display:block;};label:euiCodeBlock__lineNumber;")
46
+ euiCodeBlock__lineNumberWrapper: /*#__PURE__*/css("position:relative;flex-grow:0;flex-shrink:0;user-select:none;padding-inline-end:", euiTheme.size.m, ";box-sizing:content-box;;label:euiCodeBlock__lineNumberWrapper;"),
47
+ euiCodeBlock__lineNumber: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";text-align:end;display:block;;label:euiCodeBlock__lineNumber;")
47
48
  }
48
49
  };
49
50
  };
@@ -14,6 +14,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
14
14
  import React, { createElement } from 'react';
15
15
  import { listLanguages, highlight } from 'refractor';
16
16
  import { cx } from '@emotion/css';
17
+ import { EuiCodeBlockAnnotation } from './code_block_annotations';
17
18
  import { euiCodeBlockLineStyles } from './code_block_line.styles';
18
19
  /**
19
20
  * Utils shared between EuiCode and EuiCodeBlock
@@ -47,7 +48,15 @@ export var nodeToHtml = function nodeToHtml(node, idx, nodes) {
47
48
  key: key,
48
49
  className: cx(properties.className)
49
50
  }), children && children.map(function (el, i) {
50
- return nodeToHtml(el, i, nodes, depth + 1);
51
+ return (// @ts-ignore - using a custom type here to handle JSX annotations
52
+ el.type === 'annotation' ? // @ts-ignore - custom keys are passed by annotationElement below
53
+ ___EmotionJSX(EuiCodeBlockAnnotation, {
54
+ lineNumber: el.lineNumber,
55
+ children: el.annotation,
56
+ key: i
57
+ }) // prettier-ignore
58
+ : nodeToHtml(el, i, nodes, depth + 1)
59
+ );
51
60
  }));
52
61
  }
53
62
 
@@ -151,31 +160,61 @@ function wrapLines(nodes, options, euiTheme) {
151
160
  var lineStyles = cx([styles.euiCodeBlock__line, options.showLineNumbers && styles.hasLineNumbers]);
152
161
 
153
162
  if (options.showLineNumbers) {
154
- var _properties;
163
+ var _properties, _options$annotations;
155
164
 
156
165
  var lineNumber = i + 1;
157
166
  var digits = grouped.length.toString().length;
158
- var width = digits * CHAR_SIZE;
167
+ var width = digits * CHAR_SIZE; // Line text element and highlights
168
+
159
169
  var highlights = options.highlight ? parseLineRanges(options.highlight) : [];
160
170
  var lineTextStyles = cx([styles.lineText.euiCodeBlock__lineText, highlights.includes(lineNumber) && styles.lineText.isHighlighted]);
161
- var lineNumberStyles = cx(styles.lineNumber.euiCodeBlock__lineNumber);
162
- children = [{
171
+ var lineTextElement = {
172
+ type: 'element',
173
+ tagName: 'span',
174
+ properties: {
175
+ className: ['euiCodeBlock__lineText', lineTextStyles]
176
+ },
177
+ children: node
178
+ }; // Line number column/wrapper
179
+
180
+ var lineNumberWrapperStyles = cx(styles.lineNumber.euiCodeBlock__lineNumberWrapper);
181
+ var lineNumberWrapperElement = {
163
182
  type: 'element',
164
183
  tagName: 'span',
165
184
  properties: (_properties = {
166
185
  style: {
167
186
  inlineSize: width
168
187
  }
169
- }, _defineProperty(_properties, 'data-line-number', lineNumber), _defineProperty(_properties, 'aria-hidden', true), _defineProperty(_properties, "className", ['euiCodeBlock__lineNumber', lineNumberStyles]), _properties),
188
+ }, _defineProperty(_properties, 'data-line-number', lineNumber), _defineProperty(_properties, "className", ['euiCodeBlock__lineNumber', lineNumberWrapperStyles]), _properties),
170
189
  children: []
171
- }, {
190
+ }; // Line number element
191
+
192
+ var lineNumberStyles = cx(styles.lineNumber.euiCodeBlock__lineNumber);
193
+ var lineNumberElement = {
172
194
  type: 'element',
173
195
  tagName: 'span',
174
- properties: {
175
- className: ['euiCodeBlock__lineText', lineTextStyles]
176
- },
177
- children: node
178
- }];
196
+ properties: _defineProperty({
197
+ className: [lineNumberStyles]
198
+ }, 'aria-hidden', true),
199
+ children: [{
200
+ type: 'text',
201
+ value: String(lineNumber)
202
+ }]
203
+ };
204
+ lineNumberWrapperElement.children.push(lineNumberElement); // Annotation element
205
+
206
+ var hasAnnotation = (_options$annotations = options.annotations) === null || _options$annotations === void 0 ? void 0 : _options$annotations.hasOwnProperty(lineNumber);
207
+
208
+ if (hasAnnotation) {
209
+ var annotationElement = {
210
+ type: 'annotation',
211
+ annotation: options.annotations[lineNumber],
212
+ lineNumber: lineNumber
213
+ };
214
+ lineNumberWrapperElement.children.push(annotationElement);
215
+ }
216
+
217
+ children = [lineNumberWrapperElement, lineTextElement];
179
218
  }
180
219
 
181
220
  wrapped.push({
@@ -195,6 +234,7 @@ export var highlightByLine = function highlightByLine(children, language, data,
195
234
  lineNumber: data.start
196
235
  }), {
197
236
  showLineNumbers: data.show,
198
- highlight: data.highlight
237
+ highlight: data.highlight,
238
+ annotations: data.annotations
199
239
  }, euiTheme);
200
240
  };
@@ -1,4 +1,4 @@
1
- var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "role", "ownFocus", "outsideClickCloses", "closeButtonPosition", "paddingSize", "focusTrapProps"];
1
+ var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "ownFocus", "outsideClickCloses", "closeButtonPosition", "paddingSize", "focusTrapProps"];
2
2
 
3
3
  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); }
4
4
 
@@ -57,8 +57,6 @@ export var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
57
57
  size = _ref$size === void 0 ? 320 : _ref$size,
58
58
  _ref$side = _ref.side,
59
59
  side = _ref$side === void 0 ? 'left' : _ref$side,
60
- _ref$role = _ref.role,
61
- role = _ref$role === void 0 ? null : _ref$role,
62
60
  _ref$ownFocus = _ref.ownFocus,
63
61
  ownFocus = _ref$ownFocus === void 0 ? true : _ref$ownFocus,
64
62
  _ref$outsideClickClos = _ref.outsideClickCloses,
@@ -108,7 +106,6 @@ export var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
108
106
  as: as,
109
107
  size: size,
110
108
  side: side,
111
- role: role,
112
109
  ownFocus: ownFocus,
113
110
  outsideClickCloses: outsideClickCloses,
114
111
  closeButtonPosition: closeButtonPosition,
@@ -216,13 +213,6 @@ EuiCollapsibleNav.propTypes = {
216
213
  */
217
214
  side: PropTypes.any,
218
215
 
219
- /**
220
- * Defaults to `dialog` which is best for most cases of the flyout.
221
- * Otherwise pass in your own, aria-role, or `null` to remove it and use the semantic `as` element instead
222
- * @default dialog
223
- */
224
- role: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.string.isRequired]),
225
-
226
216
  /**
227
217
  * Named breakpoint (`xs` through `xl`) for customizing the minimum window width to enable docking
228
218
  */
@@ -236,6 +226,15 @@ EuiCollapsibleNav.propTypes = {
236
226
  */
237
227
  focusTrapProps: PropTypes.any,
238
228
 
229
+ /**
230
+ * By default, EuiFlyout will consider any fixed `EuiHeader`s that sit alongside or above the EuiFlyout
231
+ * as part of the flyout's focus trap. This prevents focus fighting with interactive elements
232
+ * within fixed headers.
233
+ *
234
+ * Set this to `false` if you need to disable this behavior for a specific reason.
235
+ */
236
+ includeFixedHeadersInFocusTrap: PropTypes.bool,
237
+
239
238
  /**
240
239
  * ReactNode to render as this component's content
241
240
  */
@@ -1,4 +1,12 @@
1
- var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonAriaLabel", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "role", "pushMinBreakpoint", "focusTrapProps"];
1
+ var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap"];
2
+
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+
5
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
2
10
 
3
11
  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); }
4
12
 
@@ -31,9 +39,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
31
39
  * in compliance with, at your election, the Elastic License 2.0 or the Server
32
40
  * Side Public License, v 1.
33
41
  */
34
- import React, { useEffect, useRef, useState, forwardRef, Fragment } from 'react';
42
+ import React, { useEffect, useRef, useState, forwardRef } from 'react';
35
43
  import classnames from 'classnames';
36
- import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiTheme } from '../../services';
44
+ import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiTheme, useGeneratedHtmlId } from '../../services';
37
45
  import { logicalStyle } from '../../global_styling';
38
46
  import { EuiFocusTrap } from '../focus_trap';
39
47
  import { EuiOverlayMask } from '../overlay_mask';
@@ -41,6 +49,7 @@ import { EuiButtonIcon } from '../button';
41
49
  import { EuiI18n } from '../i18n';
42
50
  import { useResizeObserver } from '../observer/resize_observer';
43
51
  import { EuiPortal } from '../portal';
52
+ import { EuiScreenReaderOnly } from '../accessibility';
44
53
  import { euiFlyoutStyles, euiFlyoutCloseButtonStyles } from './flyout.styles';
45
54
  import { jsx as ___EmotionJSX } from "@emotion/react";
46
55
  export var TYPES = ['push', 'overlay'];
@@ -64,7 +73,6 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
64
73
  _ref$hideCloseButton = _ref.hideCloseButton,
65
74
  hideCloseButton = _ref$hideCloseButton === void 0 ? false : _ref$hideCloseButton,
66
75
  closeButtonProps = _ref.closeButtonProps,
67
- closeButtonAriaLabel = _ref.closeButtonAriaLabel,
68
76
  _ref$closeButtonPosit = _ref.closeButtonPosition,
69
77
  closeButtonPosition = _ref$closeButtonPosit === void 0 ? 'inside' : _ref$closeButtonPosit,
70
78
  onClose = _ref.onClose,
@@ -83,11 +91,12 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
83
91
  _ref$type = _ref.type,
84
92
  type = _ref$type === void 0 ? 'overlay' : _ref$type,
85
93
  outsideClickCloses = _ref.outsideClickCloses,
86
- _ref$role = _ref.role,
87
- role = _ref$role === void 0 ? 'dialog' : _ref$role,
88
94
  _ref$pushMinBreakpoin = _ref.pushMinBreakpoint,
89
95
  pushMinBreakpoint = _ref$pushMinBreakpoin === void 0 ? 'l' : _ref$pushMinBreakpoin,
90
- focusTrapProps = _ref.focusTrapProps,
96
+ _ref$focusTrapProps = _ref.focusTrapProps,
97
+ _focusTrapProps = _ref$focusTrapProps === void 0 ? {} : _ref$focusTrapProps,
98
+ _ref$includeFixedHead = _ref.includeFixedHeadersInFocusTrap,
99
+ includeFixedHeadersInFocusTrap = _ref$includeFixedHead === void 0 ? true : _ref$includeFixedHead,
91
100
  rest = _objectWithoutProperties(_ref, _excluded);
92
101
 
93
102
  var Element = as || defaultElement;
@@ -180,7 +189,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
180
189
  display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
181
190
  iconType: "cross",
182
191
  color: "text",
183
- "aria-label": closeButtonAriaLabel || closeAriaLabel,
192
+ "aria-label": closeAriaLabel,
184
193
  "data-test-subj": "euiFlyoutCloseButton"
185
194
  }, closeButtonProps, {
186
195
  className: closeButtonClasses,
@@ -193,24 +202,61 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
193
202
  }));
194
203
  });
195
204
  }
205
+ /*
206
+ * If not disabled, automatically add fixed EuiHeaders as shards
207
+ * to EuiFlyout focus traps, to prevent focus fighting
208
+ */
196
209
 
197
- var hasOverlayMask = ownFocus && !isPushed;
198
210
 
199
- var onClickOutside = function onClickOutside(event) {
200
- // Do not close the flyout for any external click
201
- if (outsideClickCloses === false) return undefined;
211
+ var flyoutToggle = useRef(document.activeElement);
202
212
 
203
- if (hasOverlayMask) {
204
- // The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
205
- if (event.target === maskRef.current) return onClose(event);
213
+ var _useState3 = useState([]),
214
+ _useState4 = _slicedToArray(_useState3, 2),
215
+ fixedHeaders = _useState4[0],
216
+ setFixedHeaders = _useState4[1];
217
+
218
+ useEffect(function () {
219
+ if (includeFixedHeadersInFocusTrap) {
220
+ var fixedHeaderEls = document.querySelectorAll('.euiHeader[data-fixed-header]');
221
+ setFixedHeaders(Array.from(fixedHeaderEls)); // Flyouts that are toggled from fixed headers do not have working
222
+ // focus trap autoFocus, so we need to focus the flyout wrapper ourselves
223
+
224
+ fixedHeaderEls.forEach(function (header) {
225
+ if (header.contains(flyoutToggle.current)) {
226
+ resizeRef === null || resizeRef === void 0 ? void 0 : resizeRef.focus();
227
+ }
228
+ });
206
229
  } else {
207
- // No overlay mask is present, so any outside clicks should close the flyout
208
- if (outsideClickCloses === true) return onClose(event);
209
- } // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
230
+ // Clear existing headers if necessary, e.g. switching to `false`
231
+ setFixedHeaders(function (headers) {
232
+ return headers.length ? [] : headers;
233
+ });
234
+ }
235
+ }, [includeFixedHeadersInFocusTrap, resizeRef]);
210
236
 
237
+ var focusTrapProps = _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
238
+ shards: [].concat(_toConsumableArray(fixedHeaders), _toConsumableArray(_focusTrapProps.shards || []))
239
+ });
240
+ /*
241
+ * Provide meaningful screen reader instructions/details
242
+ */
211
243
 
212
- return undefined;
213
- };
244
+
245
+ var hasOverlayMask = ownFocus && !isPushed;
246
+ var descriptionId = useGeneratedHtmlId();
247
+
248
+ var screenReaderDescription = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
249
+ id: descriptionId
250
+ }, hasOverlayMask ? ___EmotionJSX(EuiI18n, {
251
+ token: "euiFlyout.screenReaderModalDialog",
252
+ default: "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close."
253
+ }) : ___EmotionJSX(EuiI18n, {
254
+ token: "euiFlyout.screenReaderNonModalDialog",
255
+ default: "You are in a non-modal dialog. To close the dialog, press Escape."
256
+ }), ' ', fixedHeaders.length > 0 && ___EmotionJSX(EuiI18n, {
257
+ token: "euiFlyout.screenReaderFixedHeaders",
258
+ default: "You can still continue tabbing through the page headers in addition to the dialog."
259
+ })));
214
260
  /*
215
261
  * Trap focus even when `ownFocus={false}`, otherwise closing
216
262
  * the flyout won't return focus to the originating button.
@@ -225,6 +271,22 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
225
271
  */
226
272
 
227
273
 
274
+ var onClickOutside = function onClickOutside(event) {
275
+ // Do not close the flyout for any external click
276
+ if (outsideClickCloses === false) return undefined;
277
+
278
+ if (hasOverlayMask) {
279
+ // The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
280
+ if (event.target === maskRef.current) return onClose(event);
281
+ } else {
282
+ // No overlay mask is present, so any outside clicks should close the flyout
283
+ if (outsideClickCloses === true) return onClose(event);
284
+ } // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
285
+
286
+
287
+ return undefined;
288
+ };
289
+
228
290
  var flyout = ___EmotionJSX(EuiFocusTrap, _extends({
229
291
  disabled: isPushed,
230
292
  clickOutsideDisables: !ownFocus,
@@ -232,12 +294,14 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
232
294
  }, focusTrapProps), ___EmotionJSX(Element, _extends({
233
295
  css: cssStyles
234
296
  }, rest, {
235
- role: role,
297
+ role: "dialog",
236
298
  className: classes,
237
- tabIndex: -1,
299
+ tabIndex: 0,
300
+ "data-autofocus": true,
301
+ "aria-describedby": !isPushed ? descriptionId : undefined,
238
302
  style: newStyle,
239
303
  ref: setRef
240
- }), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
304
+ }), !isPushed && screenReaderDescription, closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
241
305
 
242
306
 
243
307
  var mergedMaskProps = _objectSpread(_objectSpread({}, maskProps), {}, {
@@ -253,7 +317,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
253
317
  flyout = ___EmotionJSX(EuiPortal, null, flyout);
254
318
  }
255
319
 
256
- return ___EmotionJSX(Fragment, null, ___EmotionJSX(EuiWindowEvent, {
320
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiWindowEvent, {
257
321
  event: "keydown",
258
322
  handler: onKeyDown
259
323
  }), flyout);
@@ -101,7 +101,7 @@ export var EuiRangeTrack = function EuiRangeTrack(_ref) {
101
101
  }, [showTicks, ticks, min, max, tickInterval, step]);
102
102
  var euiTheme = useEuiTheme();
103
103
  var styles = euiRangeTrackStyles(euiTheme);
104
- var cssStyles = [styles.euiRangeTrack, disabled && styles.disabled, levels && !!levels.length && styles.hasLevels, (tickSequence || ticks) && styles.hasTicks];
104
+ var cssStyles = [styles.euiRangeTrack, disabled && styles.disabled, levels && !!levels.length && styles.hasLevels, showTicks && (tickSequence || ticks) && styles.hasTicks];
105
105
 
106
106
  var _useState = useState(0),
107
107
  _useState2 = _slicedToArray(_useState, 2),
@@ -92,7 +92,9 @@ export var EuiHeader = function EuiHeader(_ref) {
92
92
  }
93
93
 
94
94
  return ___EmotionJSX("div", _extends({
95
- className: classes
95
+ className: classes,
96
+ "data-fixed-header": position === 'fixed' || undefined // Used by EuiFlyouts as a query selector
97
+
96
98
  }, rest), contents);
97
99
  };
98
100
  EuiHeader.propTypes = {
@@ -31,18 +31,10 @@ var EuiIconAppAgent = function EuiIconAppAgent(_ref) {
31
31
  }, props), title ? ___EmotionJSX("title", {
32
32
  id: titleId
33
33
  }, title) : null, ___EmotionJSX("path", {
34
- className: "euiIcon__fillSecondary",
35
- d: "M21 2.82L16 .038 11 2.82v2.289l5-2.782 5 2.782v-2.29z"
36
- }), ___EmotionJSX("path", {
37
- className: "euiIcon__fillSecondary",
38
- d: "M21 7.282L16 4.5l-5 2.782V9.57l5-2.781 5 2.781V7.282z"
39
- }), ___EmotionJSX("path", {
40
- d: "M7 5.045L2 7.827v15.577l14 7.788 14-7.788V7.827l-5-2.782v2.289l3 1.669v13.225l-12 6.676-12-6.676V9.003l3-1.669V5.045z"
34
+ d: "M2.996 18.636L0 20.434v6.132l6 3.6 5-3 5 3 5-3 5 3 6-3.6v-6.132l-5-3v-5l-5-3v-5l-6-3.6-6 3.6v2.832l2 .033V5.566l4-2.4 4 2.4v3.868l-1.996 1.197 1 1.733L21 11.166l4 2.4v3.868l-4 2.4-2.257-1.354-.971 1.75L20 21.565v3.868l-4 2.4-4-2.4v-1.7l-2-.033v1.733l-4 2.4-4-2.4v-3.868l1.996-1.197-1-1.733zM22 25.434v-3.868l4-2.4 4 2.4v3.868l-4 2.4-4-2.4z"
41
35
  }), ___EmotionJSX("path", {
42
36
  className: "euiIcon__fillSecondary",
43
- fillRule: "evenodd",
44
- clipRule: "evenodd",
45
- d: "M22 12.5L16 9l-6 3.5v7l6 3.5 6-3.5v-7zm-9.974 1.205L16 11.387l3.974 2.318v4.59L16 20.613l-3.974-2.318v-4.59z"
37
+ d: "M11 22.166l-6-3.6v-6.132l6-3.6 6 3.6v6.132l-6 3.6zm4-4.732v-3.868l-4-2.4-4 2.4v3.868l4 2.4 4-2.4z"
46
38
  }));
47
39
  };
48
40
 
@@ -31,10 +31,18 @@ var EuiIconAppFleet = function EuiIconAppFleet(_ref) {
31
31
  }, props), title ? ___EmotionJSX("title", {
32
32
  id: titleId
33
33
  }, title) : null, ___EmotionJSX("path", {
34
- d: "M2.996 18.636L0 20.434v6.132l6 3.6 5-3 5 3 5-3 5 3 6-3.6v-6.132l-5-3v-5l-5-3v-5l-6-3.6-6 3.6v2.832l2 .033V5.566l4-2.4 4 2.4v3.868l-1.996 1.197 1 1.733L21 11.166l4 2.4v3.868l-4 2.4-2.257-1.354-.971 1.75L20 21.565v3.868l-4 2.4-4-2.4v-1.7l-2-.033v1.733l-4 2.4-4-2.4v-3.868l1.996-1.197-1-1.733zM22 25.434v-3.868l4-2.4 4 2.4v3.868l-4 2.4-4-2.4z"
34
+ className: "euiIcon__fillSecondary",
35
+ d: "M21 2.82L16 .038 11 2.82v2.289l5-2.782 5 2.782v-2.29z"
36
+ }), ___EmotionJSX("path", {
37
+ className: "euiIcon__fillSecondary",
38
+ d: "M21 7.282L16 4.5l-5 2.782V9.57l5-2.781 5 2.781V7.282z"
39
+ }), ___EmotionJSX("path", {
40
+ d: "M7 5.045L2 7.827v15.577l14 7.788 14-7.788V7.827l-5-2.782v2.289l3 1.669v13.225l-12 6.676-12-6.676V9.003l3-1.669V5.045z"
35
41
  }), ___EmotionJSX("path", {
36
42
  className: "euiIcon__fillSecondary",
37
- d: "M11 22.166l-6-3.6v-6.132l6-3.6 6 3.6v6.132l-6 3.6zm4-4.732v-3.868l-4-2.4-4 2.4v3.868l4 2.4 4-2.4z"
43
+ fillRule: "evenodd",
44
+ clipRule: "evenodd",
45
+ d: "M22 12.5L16 9l-6 3.5v7l6 3.5 6-3.5v-7zm-9.974 1.205L16 11.387l3.974 2.318v4.59L16 20.613l-3.974-2.318v-4.59z"
38
46
  }));
39
47
  };
40
48
 
@@ -276,16 +276,16 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
276
276
  if (!multiSelect && autoClose) {
277
277
  this.closePopover();
278
278
 
279
- var _query = checked ? this.props.query.removeSimpleFieldClauses(field) : this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator);
279
+ var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
280
280
 
281
281
  this.props.onChange(_query);
282
282
  } else {
283
283
  if (multiSelect === 'or') {
284
- var _query2 = checked ? this.props.query.removeOrFieldValue(field, value) : this.props.query.addOrFieldValue(field, value, true, operator);
284
+ var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
285
285
 
286
286
  this.props.onChange(_query2);
287
287
  } else {
288
- var _query3 = checked ? this.props.query.removeSimpleFieldValue(field, value) : this.props.query.addSimpleFieldValue(field, value, true, operator);
288
+ var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
289
289
 
290
290
  this.props.onChange(_query3);
291
291
  }
@@ -395,13 +395,9 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
395
395
  listProps: {
396
396
  isVirtualized: isOverSearchThreshold || false
397
397
  },
398
- onChange: function onChange(options) {
399
- var diff = items.find(function (item, index) {
400
- return item.checked !== options[index].checked;
401
- });
402
-
403
- if (diff) {
404
- _this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
398
+ onChange: function onChange(options, event, changedOption) {
399
+ if (changedOption.data) {
400
+ _this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
405
401
  }
406
402
  }
407
403
  }, searchProps), function (list, search) {