@elastic/eui 95.9.0 → 95.10.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 (101) hide show
  1. package/dist/eui_theme_dark.css +35 -6
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +35 -6
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/in_memory_table.js +2 -1
  6. package/es/components/datagrid/body/cell/data_grid_cell.js +2 -0
  7. package/es/components/datagrid/body/cell/focus_utils.js +57 -11
  8. package/es/components/datagrid/body/data_grid_body.js +1 -0
  9. package/es/components/datagrid/body/data_grid_body_custom.js +1 -0
  10. package/es/components/datagrid/body/data_grid_body_virtualized.js +1 -0
  11. package/es/components/datagrid/body/header/data_grid_header_cell.js +92 -83
  12. package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +37 -22
  13. package/es/components/datagrid/controls/column_sorting.js +1 -0
  14. package/es/components/datagrid/data_grid.a11y.js +2 -0
  15. package/es/components/datagrid/utils/in_memory.js +1 -0
  16. package/es/components/date_picker/date_picker.js +32 -10
  17. package/es/components/date_picker/date_picker.styles.js +3 -2
  18. package/es/components/date_picker/date_picker_range.styles.js +1 -1
  19. package/es/components/form/super_select/super_select.styles.js +1 -1
  20. package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +15 -8
  21. package/es/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +21 -4
  22. package/es/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  23. package/es/components/markdown_editor/plugins/markdown_link_validator.js +8 -2
  24. package/es/components/search_bar/filters/field_value_selection_filter.js +171 -152
  25. package/es/components/search_bar/search_bar.js +2 -1
  26. package/es/components/search_bar/search_filters.js +2 -1
  27. package/eui.d.ts +138 -69
  28. package/i18ntokens.json +78 -42
  29. package/lib/components/basic_table/in_memory_table.js +2 -1
  30. package/lib/components/datagrid/body/cell/data_grid_cell.js +2 -0
  31. package/lib/components/datagrid/body/cell/focus_utils.js +58 -12
  32. package/lib/components/datagrid/body/data_grid_body.js +1 -0
  33. package/lib/components/datagrid/body/data_grid_body_custom.js +1 -0
  34. package/lib/components/datagrid/body/data_grid_body_virtualized.js +1 -0
  35. package/lib/components/datagrid/body/header/data_grid_header_cell.js +98 -88
  36. package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +38 -23
  37. package/lib/components/datagrid/controls/column_sorting.js +1 -0
  38. package/lib/components/datagrid/data_grid.a11y.js +2 -0
  39. package/lib/components/datagrid/utils/in_memory.js +1 -0
  40. package/lib/components/date_picker/date_picker.js +32 -10
  41. package/lib/components/date_picker/date_picker.styles.js +3 -2
  42. package/lib/components/date_picker/date_picker_range.styles.js +1 -1
  43. package/lib/components/form/super_select/super_select.styles.js +1 -1
  44. package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +26 -17
  45. package/lib/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +21 -6
  46. package/lib/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  47. package/lib/components/markdown_editor/plugins/markdown_link_validator.js +9 -2
  48. package/lib/components/search_bar/filters/field_value_selection_filter.js +170 -151
  49. package/lib/components/search_bar/search_bar.js +2 -1
  50. package/lib/components/search_bar/search_filters.js +2 -1
  51. package/optimize/es/components/datagrid/body/cell/focus_utils.js +55 -10
  52. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +90 -83
  53. package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +33 -19
  54. package/optimize/es/components/datagrid/data_grid.a11y.js +2 -0
  55. package/optimize/es/components/date_picker/date_picker.js +15 -9
  56. package/optimize/es/components/date_picker/date_picker.styles.js +3 -2
  57. package/optimize/es/components/date_picker/date_picker_range.styles.js +1 -1
  58. package/optimize/es/components/form/super_select/super_select.styles.js +1 -1
  59. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +14 -8
  60. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +18 -4
  61. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  62. package/optimize/es/components/markdown_editor/plugins/markdown_link_validator.js +8 -2
  63. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +168 -151
  64. package/optimize/lib/components/datagrid/body/cell/focus_utils.js +56 -11
  65. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +92 -84
  66. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +33 -19
  67. package/optimize/lib/components/datagrid/data_grid.a11y.js +2 -0
  68. package/optimize/lib/components/date_picker/date_picker.js +15 -9
  69. package/optimize/lib/components/date_picker/date_picker.styles.js +3 -2
  70. package/optimize/lib/components/date_picker/date_picker_range.styles.js +1 -1
  71. package/optimize/lib/components/form/super_select/super_select.styles.js +1 -1
  72. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +15 -11
  73. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +19 -6
  74. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  75. package/optimize/lib/components/markdown_editor/plugins/markdown_link_validator.js +9 -2
  76. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +167 -150
  77. package/package.json +1 -1
  78. package/src/components/datagrid/_data_grid_data_row.scss +5 -0
  79. package/src/components/datagrid/body/header/_data_grid_header_row.scss +27 -5
  80. package/test-env/components/basic_table/in_memory_table.js +2 -1
  81. package/test-env/components/datagrid/body/cell/data_grid_cell.js +2 -0
  82. package/test-env/components/datagrid/body/cell/focus_utils.js +58 -12
  83. package/test-env/components/datagrid/body/data_grid_body.js +1 -0
  84. package/test-env/components/datagrid/body/data_grid_body_custom.js +1 -0
  85. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +1 -0
  86. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +93 -84
  87. package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +37 -22
  88. package/test-env/components/datagrid/controls/column_sorting.js +1 -0
  89. package/test-env/components/datagrid/data_grid.a11y.js +2 -0
  90. package/test-env/components/datagrid/utils/in_memory.js +1 -0
  91. package/test-env/components/date_picker/date_picker.js +32 -10
  92. package/test-env/components/date_picker/date_picker.styles.js +3 -2
  93. package/test-env/components/date_picker/date_picker_range.styles.js +1 -1
  94. package/test-env/components/form/super_select/super_select.styles.js +1 -1
  95. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +15 -11
  96. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/plugins.js +19 -6
  97. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/processing_plugins.js +5 -2
  98. package/test-env/components/markdown_editor/plugins/markdown_link_validator.js +9 -2
  99. package/test-env/components/search_bar/filters/field_value_selection_filter.js +169 -151
  100. package/test-env/components/search_bar/search_bar.js +2 -1
  101. package/test-env/components/search_bar/search_filters.js +2 -1
@@ -6,41 +6,45 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.useSortingUtils = exports.usePopoverArrowNavigation = exports.EuiDataGridHeaderCell = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
13
  var _classnames2 = _interopRequireDefault(require("classnames"));
13
14
  var _react = _interopRequireWildcard(require("react"));
14
15
  var _tabbable = require("tabbable");
15
16
  var _services = require("../../../../services");
16
17
  var _accessibility = require("../../../../services/accessibility");
17
- var _accessibility2 = require("../../../accessibility");
18
18
  var _i18n = require("../../../i18n");
19
19
  var _icon = require("../../../icon");
20
20
  var _list_group = require("../../../list_group");
21
21
  var _popover = require("../../../popover");
22
+ var _button_icon = require("../../../button/button_icon/button_icon.styles");
22
23
  var _focus = require("../../utils/focus");
23
24
  var _column_actions = require("./column_actions");
24
25
  var _data_grid_column_resizer = require("./data_grid_column_resizer");
25
26
  var _data_grid_header_cell_wrapper = require("./data_grid_header_cell_wrapper");
26
27
  var _react2 = require("@emotion/react");
27
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
28
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
- 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)."; } /*
28
+ var _excluded = ["children", "title", "arrow"];
29
+ /*
30
30
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
31
31
  * or more contributor license agreements. Licensed under the Elastic License
32
32
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
33
33
  * in compliance with, at your election, the Elastic License 2.0 or the Server
34
34
  * Side Public License, v 1.
35
35
  */
36
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
37
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
38
+ 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)."; }
36
39
  var CellContent = function CellContent(_ref) {
37
40
  var children = _ref.children,
38
41
  title = _ref.title,
39
- arrow = _ref.arrow;
40
- return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", {
42
+ arrow = _ref.arrow,
43
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
44
+ return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", (0, _extends2.default)({}, rest, {
41
45
  title: title,
42
46
  className: "euiDataGridHeaderCell__content"
43
- }, children), arrow);
47
+ }), children), arrow);
44
48
  };
45
49
  var _ref3 = process.env.NODE_ENV === "production" ? {
46
50
  name: "mc0thx-EuiDataGridHeaderCell",
@@ -66,15 +70,29 @@ var EuiDataGridHeaderCell = exports.EuiDataGridHeaderCell = /*#__PURE__*/(0, _re
66
70
  display = column.display,
67
71
  displayAsText = column.displayAsText,
68
72
  displayHeaderCellProps = column.displayHeaderCellProps;
73
+ var title = displayAsText || id;
74
+ var children = display || displayAsText || id;
69
75
  var width = columnWidths[id] || defaultColumnWidth;
70
76
  var columnType = schema[id] ? schema[id].columnType : null;
71
77
  var _useContext = (0, _react.useContext)(_focus.DataGridFocusContext),
72
78
  setFocusedCell = _useContext.setFocusedCell,
73
79
  focusFirstVisibleInteractiveCell = _useContext.focusFirstVisibleInteractiveCell;
80
+
81
+ /*
82
+ * Column actions
83
+ */
74
84
  var _useState = (0, _react.useState)(false),
75
85
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
76
86
  isPopoverOpen = _useState2[0],
77
87
  setIsPopoverOpen = _useState2[1];
88
+ var togglePopover = (0, _react.useCallback)(function () {
89
+ setIsPopoverOpen(function (isOpen) {
90
+ return !isOpen;
91
+ });
92
+ }, []);
93
+ var closePopover = (0, _react.useCallback)(function () {
94
+ return setIsPopoverOpen(false);
95
+ }, []);
78
96
  var popoverArrowNavigationProps = usePopoverArrowNavigation();
79
97
  var columnActions = (0, _react.useMemo)(function () {
80
98
  return (0, _column_actions.getColumnActions)({
@@ -93,14 +111,22 @@ var EuiDataGridHeaderCell = exports.EuiDataGridHeaderCell = /*#__PURE__*/(0, _re
93
111
  }, [column, columns, schema, schemaDetectors, setVisibleColumns, focusFirstVisibleInteractiveCell, setIsPopoverOpen, sorting, switchColumnPos, setFocusedCell, index]);
94
112
  var showColumnActions = columnActions && columnActions.length > 0;
95
113
  var actionsButtonRef = (0, _react.useRef)(null);
96
- var focusActionsButton = (0, _react.useCallback)(function () {
114
+ var clickActionsButton = (0, _react.useCallback)(function () {
97
115
  var _actionsButtonRef$cur;
98
- (_actionsButtonRef$cur = actionsButtonRef.current) === null || _actionsButtonRef$cur === void 0 || _actionsButtonRef$cur.focus();
116
+ (_actionsButtonRef$cur = actionsButtonRef.current) === null || _actionsButtonRef$cur === void 0 || _actionsButtonRef$cur.click();
99
117
  }, []);
100
118
  var _useState3 = (0, _react.useState)(false),
101
119
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
102
120
  isActionsButtonFocused = _useState4[0],
103
121
  setIsActionsButtonFocused = _useState4[1];
122
+ var actionsButtonAriaLabel = (0, _i18n.useEuiI18n)('euiDataGridHeaderCell.actionsButtonAriaLabel', '{title}. Click to view column header actions.', {
123
+ title: title
124
+ });
125
+ var actionsEnterKeyInstructions = (0, _i18n.useEuiI18n)('euiDataGridHeaderCell.actionsEnterKeyInstructions', "Press the Enter key to view this column's actions");
126
+
127
+ /*
128
+ * Column sorting
129
+ */
104
130
  var _useSortingUtils = useSortingUtils({
105
131
  sorting: sorting,
106
132
  id: id,
@@ -113,13 +139,12 @@ var EuiDataGridHeaderCell = exports.EuiDataGridHeaderCell = /*#__PURE__*/(0, _re
113
139
  prefix: 'euiDataGridCellHeader',
114
140
  suffix: 'sorting'
115
141
  });
116
- var actionsAriaId = (0, _accessibility.useGeneratedHtmlId)({
117
- prefix: 'euiDataGridCellHeader',
118
- suffix: 'actions'
119
- });
142
+
143
+ /*
144
+ * Rendering
145
+ */
120
146
  var classes = (0, _classnames2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "euiDataGridHeaderCell--".concat(columnType), columnType), 'euiDataGridHeaderCell--hasColumnActions', showColumnActions), 'euiDataGridHeaderCell--isActionsPopoverOpen', isPopoverOpen), displayHeaderCellProps === null || displayHeaderCellProps === void 0 ? void 0 : displayHeaderCellProps.className);
121
- var title = displayAsText || id;
122
- var children = display || displayAsText || id;
147
+ var emptyHoverStyles = (0, _services.useEuiMemoizedStyles)(_button_icon._emptyHoverStyles);
123
148
  return (0, _react2.jsx)(_data_grid_header_cell_wrapper.EuiDataGridHeaderCellWrapper, (0, _extends2.default)({}, displayHeaderCellProps, {
124
149
  className: classes,
125
150
  id: id,
@@ -127,75 +152,58 @@ var EuiDataGridHeaderCell = exports.EuiDataGridHeaderCell = /*#__PURE__*/(0, _re
127
152
  width: width,
128
153
  "aria-sort": ariaSort,
129
154
  hasActionsPopover: showColumnActions,
130
- isActionsButtonFocused: isActionsButtonFocused,
131
- focusActionsButton: focusActionsButton
132
- }), column.isResizable !== false && width != null ? (0, _react2.jsx)(_data_grid_column_resizer.EuiDataGridColumnResizer, {
133
- columnId: id,
134
- columnWidth: width,
135
- setColumnWidth: setColumnWidth
136
- }) : null, !showColumnActions ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(CellContent, {
137
- title: title,
138
- arrow: sortingArrow
139
- }, children), sortingScreenReaderText && (0, _react2.jsx)(_accessibility2.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, sortingScreenReaderText))) : (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("button", {
140
- className: "euiDataGridHeaderCell__button",
141
- onClick: function onClick() {
142
- return setIsPopoverOpen(function (isPopoverOpen) {
143
- return !isPopoverOpen;
144
- });
145
- },
146
- onFocus: function onFocus() {
147
- return setIsActionsButtonFocused(true);
148
- },
149
- onBlur: function onBlur() {
150
- return setIsActionsButtonFocused(false);
151
- },
152
- "aria-describedby": "".concat(sortingAriaId, " ").concat(actionsAriaId),
153
- ref: actionsButtonRef,
154
- "data-test-subj": "dataGridHeaderCellActionButton-".concat(id)
155
- }, (0, _react2.jsx)(CellContent, {
156
- title: title,
157
- arrow: sortingArrow
158
- }, children), (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
159
- display: "block",
160
- panelPaddingSize: "none",
161
- offset: 7,
162
- anchorPosition: "downRight",
163
- css: _ref3 // Align to right
155
+ openActionsPopover: clickActionsButton,
156
+ "aria-label": displayAsText && "".concat(displayAsText, ", ") // ensure cell text content is read first, if available
164
157
  ,
165
- focusTrapProps: {
166
- // We need to override the default EuiPopover `onClickOutside` since the anchor is separate from the actual button
167
- onClickOutside: function onClickOutside(event) {
168
- var _actionsButtonRef$cur2;
169
- if (((_actionsButtonRef$cur2 = actionsButtonRef.current) === null || _actionsButtonRef$cur2 === void 0 ? void 0 : _actionsButtonRef$cur2.contains(event.target)) === false) {
170
- setIsPopoverOpen(false);
171
- }
172
- }
173
- },
174
- button: (0, _react2.jsx)("div", {
175
- className: "euiDataGridHeaderCell__icon"
176
- }, (0, _react2.jsx)(_icon.EuiIcon, {
177
- type: "boxesVertical",
178
- size: "s",
179
- color: "text"
180
- })),
181
- isOpen: isPopoverOpen,
182
- closePopover: function closePopover() {
183
- return setIsPopoverOpen(false);
184
- }
185
- }, popoverArrowNavigationProps), (0, _react2.jsx)(_list_group.EuiListGroup, {
186
- listItems: columnActions,
187
- gutterSize: "none",
188
- "data-test-subj": "dataGridHeaderCellActionGroup-".concat(id)
189
- }))), (0, _react2.jsx)("p", {
190
- id: sortingAriaId,
191
- hidden: true
192
- }, sortingScreenReaderText), (0, _react2.jsx)("p", {
193
- id: actionsAriaId,
194
- hidden: true
195
- }, (0, _react2.jsx)(_i18n.EuiI18n, {
196
- token: "euiDataGridHeaderCell.headerActions",
197
- default: "Click to view column header actions"
198
- }))));
158
+ "aria-describedby": sortingAriaId
159
+ }), function (hasFocusTrap) {
160
+ return (0, _react2.jsx)(_react.default.Fragment, null, column.isResizable !== false && width != null ? (0, _react2.jsx)(_data_grid_column_resizer.EuiDataGridColumnResizer, {
161
+ columnId: id,
162
+ columnWidth: width,
163
+ setColumnWidth: setColumnWidth
164
+ }) : null, (0, _react2.jsx)(CellContent, {
165
+ title: title,
166
+ arrow: sortingArrow
167
+ }, children), sortingScreenReaderText && (0, _react2.jsx)("p", {
168
+ id: sortingAriaId,
169
+ hidden: true
170
+ }, sortingScreenReaderText), showColumnActions && (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
171
+ display: "block",
172
+ panelPaddingSize: "none",
173
+ offset: 7,
174
+ anchorPosition: "downRight",
175
+ css: _ref3 // Align to right
176
+ ,
177
+ button: (0, _react2.jsx)("button", {
178
+ ref: actionsButtonRef,
179
+ className: "euiDataGridHeaderCell__button",
180
+ css: emptyHoverStyles.text,
181
+ onClick: togglePopover,
182
+ onFocus: function onFocus() {
183
+ return setIsActionsButtonFocused(true);
184
+ },
185
+ onBlur: function onBlur() {
186
+ return setIsActionsButtonFocused(false);
187
+ },
188
+ "aria-hidden": hasFocusTrap && !isActionsButtonFocused ? 'true' // prevent the actions button from being read on cell focus
189
+ : undefined,
190
+ "aria-label": hasFocusTrap ? actionsButtonAriaLabel : actionsEnterKeyInstructions,
191
+ "data-test-subj": "dataGridHeaderCellActionButton-".concat(id)
192
+ }, (0, _react2.jsx)("div", {
193
+ className: "euiDataGridHeaderCell__icon"
194
+ }, (0, _react2.jsx)(_icon.EuiIcon, {
195
+ type: "boxesVertical",
196
+ size: "s",
197
+ color: "text"
198
+ }))),
199
+ isOpen: isPopoverOpen,
200
+ closePopover: closePopover
201
+ }, popoverArrowNavigationProps), (0, _react2.jsx)(_list_group.EuiListGroup, {
202
+ listItems: columnActions,
203
+ gutterSize: "none",
204
+ "data-test-subj": "dataGridHeaderCellActionGroup-".concat(id)
205
+ })));
206
+ });
199
207
  });
200
208
  EuiDataGridHeaderCell.displayName = 'EuiDataGridHeaderCell';
201
209
 
@@ -9,12 +9,13 @@ exports.EuiDataGridHeaderCellWrapper = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
12
  var _react = _interopRequireWildcard(require("react"));
13
+ var _classnames = _interopRequireDefault(require("classnames"));
14
+ var _services = require("../../../../services");
14
15
  var _focus = require("../../utils/focus");
15
16
  var _focus_utils = require("../cell/focus_utils");
16
17
  var _react2 = require("@emotion/react");
17
- var _excluded = ["id", "index", "width", "className", "children", "hasActionsPopover", "isActionsButtonFocused", "focusActionsButton"];
18
+ var _excluded = ["id", "index", "width", "className", "children", "hasActionsPopover", "openActionsPopover", "aria-label"];
18
19
  /*
19
20
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
20
21
  * or more contributor license agreements. Licensed under the Elastic License
@@ -36,8 +37,8 @@ var EuiDataGridHeaderCellWrapper = exports.EuiDataGridHeaderCellWrapper = functi
36
37
  className = _ref.className,
37
38
  children = _ref.children,
38
39
  hasActionsPopover = _ref.hasActionsPopover,
39
- isActionsButtonFocused = _ref.isActionsButtonFocused,
40
- focusActionsButton = _ref.focusActionsButton,
40
+ openActionsPopover = _ref.openActionsPopover,
41
+ ariaLabel = _ref['aria-label'],
41
42
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
42
43
  var classes = (0, _classnames.default)('euiDataGridHeaderCell', className);
43
44
 
@@ -46,16 +47,28 @@ var EuiDataGridHeaderCellWrapper = exports.EuiDataGridHeaderCellWrapper = functi
46
47
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
47
48
  headerEl = _useState2[0],
48
49
  setHeaderEl = _useState2[1];
50
+ var _useState3 = (0, _react.useState)(false),
51
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
52
+ renderFocusTrap = _useState4[0],
53
+ setRenderFocusTrap = _useState4[1];
54
+ var _useState5 = (0, _react.useState)([]),
55
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
56
+ interactiveChildren = _useState6[0],
57
+ setInteractiveChildren = _useState6[1];
58
+ (0, _react.useEffect)(function () {
59
+ // We're checking for interactive children outside of the default actions button
60
+ setRenderFocusTrap(interactiveChildren.length > (hasActionsPopover ? 1 : 0));
61
+ }, [hasActionsPopover, interactiveChildren]);
49
62
  var _useContext = (0, _react.useContext)(_focus.DataGridFocusContext),
50
63
  setFocusedCell = _useContext.setFocusedCell,
51
64
  onFocusUpdate = _useContext.onFocusUpdate;
52
65
  var updateCellFocusContext = (0, _react.useCallback)(function () {
53
66
  setFocusedCell([index, -1]);
54
67
  }, [index, setFocusedCell]);
55
- var _useState3 = (0, _react.useState)(false),
56
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
57
- isFocused = _useState4[0],
58
- setIsFocused = _useState4[1];
68
+ var _useState7 = (0, _react.useState)(false),
69
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
70
+ isFocused = _useState8[0],
71
+ setIsFocused = _useState8[1];
59
72
  (0, _react.useEffect)(function () {
60
73
  onFocusUpdate([index, -1], function (isFocused) {
61
74
  setIsFocused(isFocused);
@@ -68,18 +81,17 @@ var EuiDataGridHeaderCellWrapper = exports.EuiDataGridHeaderCellWrapper = functi
68
81
  });
69
82
  }, [index, onFocusUpdate, headerEl]);
70
83
 
71
- // For cell headers with actions, auto-focus into the button instead of the cell wrapper div
72
- // The button text is significantly more useful to screen readers (e.g. contains sort order & hints)
73
- var onFocus = (0, _react.useCallback)(function (e) {
74
- if (hasActionsPopover && e.target === headerEl) {
75
- focusActionsButton === null || focusActionsButton === void 0 || focusActionsButton();
84
+ // For cell headers with only actions, auto-open the actions popover on enter keypress
85
+ var onKeyDown = (0, _react.useCallback)(function (e) {
86
+ if (e.key === _services.keys.ENTER && hasActionsPopover && !renderFocusTrap && e.target === headerEl) {
87
+ openActionsPopover === null || openActionsPopover === void 0 || openActionsPopover();
76
88
  }
77
- }, [hasActionsPopover, focusActionsButton, headerEl]);
89
+ }, [hasActionsPopover, openActionsPopover, renderFocusTrap, headerEl]);
78
90
  return (0, _react2.jsx)("div", (0, _extends2.default)({
79
91
  role: "columnheader",
80
92
  ref: setHeaderEl,
81
- tabIndex: isFocused && !isActionsButtonFocused ? 0 : -1,
82
- onFocus: onFocus,
93
+ tabIndex: isFocused ? 0 : -1,
94
+ onKeyDown: onKeyDown,
83
95
  className: classes,
84
96
  "data-test-subj": "dataGridHeaderCell-".concat(id),
85
97
  "data-gridcell-column-id": id,
@@ -88,10 +100,12 @@ var EuiDataGridHeaderCellWrapper = exports.EuiDataGridHeaderCellWrapper = functi
88
100
  "data-gridcell-visible-row-index": "-1",
89
101
  style: width != null ? {
90
102
  width: "".concat(width, "px")
91
- } : {}
103
+ } : {},
104
+ "aria-label": renderFocusTrap ? ariaLabel : undefined
92
105
  }, rest), (0, _react2.jsx)(_focus_utils.HandleInteractiveChildren, {
93
106
  cellEl: headerEl,
94
107
  updateCellFocusContext: updateCellFocusContext,
95
- renderFocusTrap: !hasActionsPopover
96
- }, children));
108
+ renderFocusTrap: renderFocusTrap,
109
+ onInteractiveChildrenFound: setInteractiveChildren
110
+ }, typeof children === 'function' ? children(renderFocusTrap) : children));
97
111
  };
@@ -210,6 +210,7 @@ describe('EuiDataGrid', function () {
210
210
  cy.checkAxe();
211
211
  });
212
212
  it('has zero violations when the column actions menu is open', function () {
213
+ cy.get('.euiDataGridHeaderCell').first().realHover();
213
214
  cy.get('button.euiDataGridHeaderCell__button').first().realClick();
214
215
  cy.checkAxe();
215
216
  });
@@ -219,6 +220,7 @@ describe('EuiDataGrid', function () {
219
220
  cy.checkAxe();
220
221
  });
221
222
  it('has zero violations on sort and when the columns sorting menu is open', function () {
223
+ cy.get('.euiDataGridHeaderCell').last().realHover();
222
224
  cy.get('button.euiDataGridHeaderCell__button').last().realClick();
223
225
  cy.get('button.euiListGroupItem__button').contains('Sort Alma to Debian').should('exist').realClick();
224
226
  cy.get('div[data-test-subj="dataGridColumnSortingPopover"] button').realClick();
@@ -19,7 +19,7 @@ var _reactDatepicker = require("./react-datepicker");
19
19
  var _react_date_picker = require("./react_date_picker.styles");
20
20
  var _date_picker = require("./date_picker.styles");
21
21
  var _react2 = require("@emotion/react");
22
- var _excluded = ["adjustDateOnChange", "calendarClassName", "className", "compressed", "controlOnly", "customInput", "dateFormat", "dayClassName", "disabled", "excludeDates", "filterDate", "fullWidth", "iconType", "injectTimes", "inline", "inputRef", "isInvalid", "isLoading", "locale", "maxDate", "maxTime", "minDate", "minTime", "onChange", "onClear", "openToDate", "placeholder", "popperClassName", "popoverPlacement", "readOnly", "selected", "shadow", "shouldCloseOnSelect", "showIcon", "showTimeSelect", "showTimeSelectOnly", "timeFormat", "utcOffset"];
22
+ var _excluded = ["adjustDateOnChange", "append", "calendarClassName", "className", "compressed", "controlOnly", "customInput", "dateFormat", "dayClassName", "disabled", "excludeDates", "filterDate", "fullWidth", "iconType", "injectTimes", "inline", "inputRef", "isInvalid", "isLoading", "locale", "maxDate", "maxTime", "minDate", "minTime", "onChange", "onClear", "openToDate", "placeholder", "popperClassName", "popoverPlacement", "prepend", "readOnly", "selected", "shadow", "shouldCloseOnSelect", "showIcon", "showTimeSelect", "showTimeSelectOnly", "timeFormat", "utcOffset"];
23
23
  /*
24
24
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
25
25
  * or more contributor license agreements. Licensed under the Elastic License
@@ -63,6 +63,7 @@ var unsupportedProps = [
63
63
  var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
64
64
  var _ref$adjustDateOnChan = _ref.adjustDateOnChange,
65
65
  adjustDateOnChange = _ref$adjustDateOnChan === void 0 ? true : _ref$adjustDateOnChan,
66
+ append = _ref.append,
66
67
  calendarClassName = _ref.calendarClassName,
67
68
  className = _ref.className,
68
69
  compressed = _ref.compressed,
@@ -94,6 +95,7 @@ var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
94
95
  popperClassName = _ref.popperClassName,
95
96
  _ref$popoverPlacement = _ref.popoverPlacement,
96
97
  popoverPlacement = _ref$popoverPlacement === void 0 ? 'downLeft' : _ref$popoverPlacement,
98
+ prepend = _ref.prepend,
97
99
  readOnly = _ref.readOnly,
98
100
  selected = _ref.selected,
99
101
  _ref$shadow = _ref.shadow,
@@ -195,19 +197,23 @@ var EuiDatePicker = exports.EuiDatePicker = function EuiDatePicker(_ref) {
195
197
  return (0, _react2.jsx)("span", {
196
198
  css: cssStyles,
197
199
  className: classes
198
- }, (0, _react2.jsx)(_form.EuiFormControlLayout, {
200
+ }, (0, _react2.jsx)(_form.EuiFormControlLayout, (0, _extends2.default)({
199
201
  icon: optionalIcon,
200
- fullWidth: !inline && fullWidth,
201
- compressed: !inline && compressed,
202
202
  clear: selected && onClear ? {
203
203
  onClick: onClear
204
204
  } : undefined,
205
205
  isLoading: isLoading,
206
206
  isInvalid: isInvalid,
207
207
  isDisabled: disabled,
208
- readOnly: readOnly,
209
- isDelimited: inline // Styling shortcut for inline calendars
210
- ,
211
- iconsPosition: inline ? 'static' : undefined
212
- }, control));
208
+ readOnly: readOnly
209
+ }, inline ? {
210
+ isDelimited: true,
211
+ iconsPosition: 'static'
212
+ } : {
213
+ fullWidth: fullWidth,
214
+ compressed: compressed,
215
+ append: append,
216
+ prepend: prepend,
217
+ css: (append || prepend) && styles.inGroup
218
+ }), control));
213
219
  };
@@ -28,7 +28,7 @@ var euiDatePickerStyles = exports.euiDatePickerStyles = function euiDatePickerSt
28
28
  return {
29
29
  euiDatePicker: _ref,
30
30
  inline: {
31
- inline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " box-shadow:none;padding:0;}.euiFormControlLayout__childrenWrapper{flex-direction:column;}.euiFormControlLayoutIcons{justify-content:center;", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";};label:inline;"),
31
+ inline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " border:none;padding:0;}.euiFormControlLayout__childrenWrapper{flex-direction:column;}.euiFormControlLayoutIcons{justify-content:center;", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";};label:inline;"),
32
32
  // Skip css`` to avoid generating an Emotion className
33
33
  noShadow: "\n .euiFormControlLayout {\n background-color: transparent;\n }\n ",
34
34
  shadow: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{background-color:", euiTheme.colors.emptyShade, ";", (0, _mixins.euiShadowMedium)(euiThemeContext), ";};label:shadow;"),
@@ -39,6 +39,7 @@ var euiDatePickerStyles = exports.euiDatePickerStyles = function euiDatePickerSt
39
39
  // Should come after shadow CSS to override their background-colors
40
40
  disabled: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{", (0, _form.euiFormControlDisabledStyles)(euiThemeContext), ";};label:disabled;"),
41
41
  readOnly: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout{", (0, _form.euiFormControlReadOnlyStyles)(euiThemeContext), ";};label:readOnly;")
42
- }
42
+ },
43
+ inGroup: /*#__PURE__*/(0, _react.css)(".euiFormControlLayout__childrenWrapper{.euiPopover,.react-datepicker__input-container{", (0, _global_styling.logicalCSS)('height', '100%'), ";}};label:inGroup;")
43
44
  };
44
45
  };
@@ -36,7 +36,7 @@ var euiDatePickerRangeInlineStyles = exports.euiDatePickerRangeInlineStyles = fu
36
36
  return "\n display: block;\n container-type: inline-size;\n\n .euiFormControlLayout__childrenWrapper {\n /* Use static px widths for now, since render behavior comes from a third party library */\n @container (max-width: ".concat(datePickerWidth * 2 + delimiterWidth, "px) {\n /* Unset grid display */\n display: block !important;\n\n /* Center and point the default delimiter arrow downwards */\n .euiFormControlLayoutDelimited__delimiter .euiIcon {\n transform: rotate(90deg);\n margin-inline: auto;\n }\n }\n }");
37
37
  };
38
38
  return {
39
- euiDatePickerRangeInline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " box-shadow:none;padding:0;.euiFormControlLayout__childrenWrapper{display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto;align-items:stretch;background-color:transparent;}.euiFormControlLayoutIcons{justify-content:center;grid-column:1/span 3;", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";}}.react-datepicker{position:relative;};label:euiDatePickerRangeInline;"),
39
+ euiDatePickerRangeInline: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('width', 'fit-content'), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " border:none;padding:0;.euiFormControlLayout__childrenWrapper{display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto;align-items:stretch;background-color:transparent;}.euiFormControlLayoutIcons{justify-content:center;grid-column:1/span 3;", (0, _global_styling.logicalCSS)('height', 'auto'), " ", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.s), ";}}.react-datepicker{position:relative;};label:euiDatePickerRangeInline;"),
40
40
  responsive: /*#__PURE__*/(0, _react.css)(containerQuery(268), ";;label:responsive;"),
41
41
  responsiveWithTimeSelect: /*#__PURE__*/(0, _react.css)(containerQuery(374), ";;label:responsiveWithTimeSelect;"),
42
42
  shadow: /*#__PURE__*/(0, _react.css)(".euiFormControlLayoutDelimited{", (0, _mixins.euiShadowMedium)(euiThemeContext), ";};label:shadow;"),
@@ -46,6 +46,6 @@ var euiSuperSelectControlStyles = exports.euiSuperSelectControlStyles = function
46
46
  // Layout modifiers
47
47
  inGroup: /*#__PURE__*/(0, _react.css)(formStyles.inGroup, ";label:inGroup;"),
48
48
  // Children
49
- euiSuperSelect__placeholder: /*#__PURE__*/(0, _react.css)("color:", formVariables.controlDisabledColor, ";;label:euiSuperSelect__placeholder;")
49
+ euiSuperSelect__placeholder: /*#__PURE__*/(0, _react.css)("color:", formVariables.controlPlaceholderText, ";;label:euiSuperSelect__placeholder;")
50
50
  };
51
51
  };
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.getDefaultEuiMarkdownParsingPlugins = exports.defaultParsingPlugins = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
11
  var _remarkParseNoTrim = _interopRequireDefault(require("remark-parse-no-trim"));
11
12
  var _remarkEmoji = _interopRequireDefault(require("remark-emoji"));
12
13
  var _remarkBreaks = _interopRequireDefault(require("remark-breaks"));
@@ -14,8 +15,7 @@ var _remark_prismjs = _interopRequireDefault(require("../remark/remark_prismjs")
14
15
  var MarkdownTooltip = _interopRequireWildcard(require("../markdown_tooltip"));
15
16
  var MarkdownCheckbox = _interopRequireWildcard(require("../markdown_checkbox"));
16
17
  var _markdown_link_validator = require("../markdown_link_validator");
17
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ var _excluded = ["exclude"];
19
19
  /*
20
20
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
21
21
  * or more contributor license agreements. Licensed under the Elastic License
@@ -23,34 +23,38 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
23
23
  * in compliance with, at your election, the Elastic License 2.0 or the Server
24
24
  * Side Public License, v 1.
25
25
  */
26
-
27
26
  // Importing seemingly unused types from `unified` because the definitions
28
27
  // are exported for two versions of TypeScript (3.4, 4.0) and implicit
29
28
  // imports during eui.d.ts generation default to the incorrect version (3.4).
30
29
  // Explicit imports here resolve the version mismatch.
31
-
30
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
31
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
32
  var DEFAULT_PARSING_PLUGINS = {
33
33
  emoji: [_remarkEmoji.default, {
34
34
  emoticon: false
35
35
  }],
36
36
  lineBreaks: [_remarkBreaks.default, {}],
37
- linkValidator: [_markdown_link_validator.euiMarkdownLinkValidator, {
38
- allowRelative: true,
39
- allowProtocols: ['https:', 'http:', 'mailto:']
40
- }],
37
+ linkValidator: [_markdown_link_validator.euiMarkdownLinkValidator, _markdown_link_validator.DEFAULT_OPTIONS],
41
38
  checkbox: [MarkdownCheckbox.parser, {}],
42
39
  tooltip: [MarkdownTooltip.parser, {}]
43
40
  };
44
41
  var getDefaultEuiMarkdownParsingPlugins = exports.getDefaultEuiMarkdownParsingPlugins = function getDefaultEuiMarkdownParsingPlugins() {
45
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
46
- exclude = _ref.exclude;
42
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
+ var exclude = _ref.exclude,
44
+ parsingConfig = (0, _objectWithoutProperties2.default)(_ref, _excluded);
47
45
  var parsingPlugins = [[_remarkParseNoTrim.default, {}], [_remark_prismjs.default, {}]];
48
46
  Object.entries(DEFAULT_PARSING_PLUGINS).forEach(function (_ref2) {
49
47
  var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
50
48
  pluginName = _ref3[0],
51
49
  plugin = _ref3[1];
50
+ // Check for plugin exclusions
52
51
  if (!(exclude !== null && exclude !== void 0 && exclude.includes(pluginName))) {
53
- parsingPlugins.push(plugin);
52
+ // Check for plugin configuration overrides
53
+ if (pluginName in parsingConfig) {
54
+ parsingPlugins.push([plugin[0], parsingConfig[pluginName]]);
55
+ } else {
56
+ parsingPlugins.push(plugin);
57
+ }
54
58
  }
55
59
  });
56
60
  return parsingPlugins;
@@ -1,24 +1,37 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.getDefaultEuiMarkdownPlugins = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _ui_plugins = require("./ui_plugins");
8
10
  var _parsing_plugins = require("./parsing_plugins");
9
11
  var _processing_plugins = require("./processing_plugins");
10
- /*
12
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /*
11
14
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
15
  * or more contributor license agreements. Licensed under the Elastic License
13
16
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
17
  * in compliance with, at your election, the Elastic License 2.0 or the Server
15
18
  * Side Public License, v 1.
16
19
  */
17
-
18
- var getDefaultEuiMarkdownPlugins = exports.getDefaultEuiMarkdownPlugins = function getDefaultEuiMarkdownPlugins(config) {
20
+ var getDefaultEuiMarkdownPlugins = exports.getDefaultEuiMarkdownPlugins = function getDefaultEuiMarkdownPlugins() {
21
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
22
+ var exclude = config.exclude,
23
+ processingConfig = config.processingConfig,
24
+ parsingConfig = config.parsingConfig,
25
+ uiConfig = config.uiConfig;
19
26
  return {
20
- parsingPlugins: (0, _parsing_plugins.getDefaultEuiMarkdownParsingPlugins)(config),
21
- processingPlugins: (0, _processing_plugins.getDefaultEuiMarkdownProcessingPlugins)(config),
22
- uiPlugins: (0, _ui_plugins.getDefaultEuiMarkdownUiPlugins)(config)
27
+ parsingPlugins: (0, _parsing_plugins.getDefaultEuiMarkdownParsingPlugins)(_objectSpread({
28
+ exclude: exclude
29
+ }, parsingConfig)),
30
+ processingPlugins: (0, _processing_plugins.getDefaultEuiMarkdownProcessingPlugins)(_objectSpread({
31
+ exclude: exclude
32
+ }, processingConfig)),
33
+ uiPlugins: (0, _ui_plugins.getDefaultEuiMarkdownUiPlugins)(_objectSpread({
34
+ exclude: exclude
35
+ }, uiConfig))
23
36
  };
24
37
  };
@@ -42,7 +42,8 @@ var DEFAULT_COMPONENT_RENDERERS = {
42
42
  };
43
43
  var getDefaultEuiMarkdownProcessingPlugins = exports.getDefaultEuiMarkdownProcessingPlugins = function getDefaultEuiMarkdownProcessingPlugins() {
44
44
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
45
- exclude = _ref.exclude;
45
+ exclude = _ref.exclude,
46
+ linkProps = _ref.linkProps;
46
47
  var componentPluginsWithExclusions = {};
47
48
  Object.entries(DEFAULT_COMPONENT_RENDERERS).forEach(function (_ref2) {
48
49
  var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
@@ -61,7 +62,9 @@ var getDefaultEuiMarkdownProcessingPlugins = exports.getDefaultEuiMarkdownProces
61
62
  createElement: _react.createElement,
62
63
  Fragment: _react.Fragment,
63
64
  components: _objectSpread({
64
- a: _link.EuiLink,
65
+ a: function a(props) {
66
+ return (0, _react2.jsx)(_link.EuiLink, (0, _extends2.default)({}, props, linkProps));
67
+ },
65
68
  code: function code(props) {
66
69
  return (
67
70
  // If there are linebreaks use codeblock, otherwise code