@elastic/eui 85.1.0 → 86.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/eui_charts_theme.js +26 -2
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/es/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
  4. package/es/components/datagrid/body/data_grid_body.js +7 -7
  5. package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
  6. package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  7. package/es/components/datagrid/body/data_grid_cell.js +14 -13
  8. package/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
  9. package/es/components/datagrid/body/header/data_grid_header_cell.js +1 -1
  10. package/es/components/datagrid/body/header/data_grid_header_row.js +5 -5
  11. package/es/components/datagrid/controls/data_grid_toolbar.js +31 -26
  12. package/es/components/datagrid/controls/display_selector.js +1 -1
  13. package/es/components/datagrid/data_grid.js +7 -7
  14. package/es/components/datagrid/utils/in_memory.js +4 -4
  15. package/es/components/datagrid/utils/row_heights.js +4 -4
  16. package/es/components/date_picker/date_picker.js +1 -1
  17. package/es/components/drag_and_drop/drag_drop_context.js +1 -1
  18. package/es/components/drag_and_drop/draggable.js +2 -2
  19. package/es/components/drag_and_drop/droppable.js +1 -1
  20. package/es/components/drag_and_drop/index.js +3 -2
  21. package/es/components/header/header_section/header_section_item_button.js +94 -0
  22. package/es/components/highlight/highlight.js +2 -2
  23. package/es/components/inline_edit/inline_edit_text.js +2 -3
  24. package/es/components/inline_edit/inline_edit_title.js +2 -3
  25. package/es/components/inner_text/index.js +1 -2
  26. package/es/components/markdown_editor/markdown_actions.js +1 -1
  27. package/es/components/markdown_editor/markdown_editor_text_area.js +10 -4
  28. package/es/components/modal/confirm_modal.js +11 -29
  29. package/es/components/outside_click_detector/outside_click_detector.js +10 -11
  30. package/es/components/page/page_template.js +8 -8
  31. package/es/components/popover/wrapping_popover.js +1 -9
  32. package/es/components/portal/portal.js +34 -24
  33. package/es/components/tabs/tabs.js +25 -0
  34. package/es/components/timeline/timeline_item_icon.js +3 -3
  35. package/es/components/tour/tour_step.js +16 -12
  36. package/es/services/color/eui_palettes.js +7 -1
  37. package/es/services/color/index.js +1 -1
  38. package/es/services/index.js +1 -1
  39. package/es/services/time/timer.js +3 -5
  40. package/es/test/rtl/component_helpers.js +1 -1
  41. package/es/test/rtl/index.js +2 -1
  42. package/es/test/rtl/render_hook.js +23 -0
  43. package/eui.d.ts +1234 -748
  44. package/i18ntokens.json +144 -144
  45. package/lib/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
  46. package/lib/components/datagrid/body/data_grid_body.js +7 -7
  47. package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
  48. package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  49. package/lib/components/datagrid/body/data_grid_cell.js +14 -13
  50. package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
  51. package/lib/components/datagrid/body/header/data_grid_header_cell.js +1 -1
  52. package/lib/components/datagrid/body/header/data_grid_header_row.js +5 -5
  53. package/lib/components/datagrid/controls/data_grid_toolbar.js +41 -38
  54. package/lib/components/datagrid/controls/display_selector.js +1 -1
  55. package/lib/components/datagrid/data_grid.js +7 -7
  56. package/lib/components/datagrid/utils/in_memory.js +4 -4
  57. package/lib/components/datagrid/utils/row_heights.js +4 -4
  58. package/lib/components/date_picker/date_picker.js +1 -1
  59. package/lib/components/drag_and_drop/drag_drop_context.js +2 -2
  60. package/lib/components/drag_and_drop/draggable.js +3 -3
  61. package/lib/components/drag_and_drop/droppable.js +2 -2
  62. package/lib/components/header/header_section/header_section_item_button.js +94 -0
  63. package/lib/components/highlight/highlight.js +2 -2
  64. package/lib/components/inline_edit/inline_edit_text.js +2 -3
  65. package/lib/components/inline_edit/inline_edit_title.js +2 -3
  66. package/lib/components/inner_text/index.js +1 -8
  67. package/lib/components/markdown_editor/markdown_actions.js +1 -1
  68. package/lib/components/markdown_editor/markdown_editor_text_area.js +10 -4
  69. package/lib/components/modal/confirm_modal.js +10 -28
  70. package/lib/components/outside_click_detector/outside_click_detector.js +10 -11
  71. package/lib/components/page/page_template.js +8 -8
  72. package/lib/components/popover/wrapping_popover.js +1 -9
  73. package/lib/components/portal/portal.js +34 -24
  74. package/lib/components/tabs/tabs.js +25 -0
  75. package/lib/components/timeline/timeline_item_icon.js +6 -3
  76. package/lib/components/tour/tour_step.js +15 -11
  77. package/lib/services/color/eui_palettes.js +9 -2
  78. package/lib/services/color/index.js +7 -0
  79. package/lib/services/index.js +7 -0
  80. package/lib/services/time/timer.js +3 -5
  81. package/lib/test/rtl/component_helpers.js +1 -1
  82. package/lib/test/rtl/index.js +13 -1
  83. package/lib/test/rtl/render_hook.js +29 -0
  84. package/optimize/es/components/datagrid/body/data_grid_cell.js +10 -9
  85. package/optimize/es/components/datagrid/controls/data_grid_toolbar.js +31 -26
  86. package/optimize/es/components/datagrid/controls/display_selector.js +1 -1
  87. package/optimize/es/components/datagrid/utils/in_memory.js +2 -2
  88. package/optimize/es/components/datagrid/utils/row_heights.js +4 -4
  89. package/optimize/es/components/date_picker/date_picker.js +1 -1
  90. package/optimize/es/components/drag_and_drop/drag_drop_context.js +1 -1
  91. package/optimize/es/components/drag_and_drop/draggable.js +2 -2
  92. package/optimize/es/components/drag_and_drop/droppable.js +1 -1
  93. package/optimize/es/components/drag_and_drop/index.js +3 -2
  94. package/optimize/es/components/highlight/highlight.js +2 -2
  95. package/optimize/es/components/inline_edit/inline_edit_text.js +2 -3
  96. package/optimize/es/components/inline_edit/inline_edit_title.js +2 -3
  97. package/optimize/es/components/inner_text/index.js +1 -2
  98. package/optimize/es/components/markdown_editor/markdown_actions.js +1 -1
  99. package/optimize/es/components/markdown_editor/markdown_editor_text_area.js +10 -4
  100. package/optimize/es/components/modal/confirm_modal.js +11 -24
  101. package/optimize/es/components/outside_click_detector/outside_click_detector.js +10 -11
  102. package/optimize/es/components/popover/wrapping_popover.js +1 -9
  103. package/optimize/es/components/portal/portal.js +34 -25
  104. package/optimize/es/components/timeline/timeline_item_icon.js +3 -3
  105. package/optimize/es/components/tour/tour_step.js +16 -12
  106. package/optimize/es/services/color/eui_palettes.js +7 -1
  107. package/optimize/es/services/color/index.js +1 -1
  108. package/optimize/es/services/index.js +1 -1
  109. package/optimize/es/services/time/timer.js +3 -5
  110. package/optimize/es/test/rtl/component_helpers.js +1 -1
  111. package/optimize/es/test/rtl/index.js +2 -1
  112. package/optimize/es/test/rtl/render_hook.js +23 -0
  113. package/optimize/lib/components/datagrid/body/data_grid_cell.js +10 -9
  114. package/optimize/lib/components/datagrid/controls/data_grid_toolbar.js +36 -28
  115. package/optimize/lib/components/datagrid/controls/display_selector.js +1 -1
  116. package/optimize/lib/components/datagrid/utils/in_memory.js +2 -2
  117. package/optimize/lib/components/datagrid/utils/row_heights.js +4 -4
  118. package/optimize/lib/components/date_picker/date_picker.js +1 -1
  119. package/optimize/lib/components/drag_and_drop/drag_drop_context.js +2 -2
  120. package/optimize/lib/components/drag_and_drop/draggable.js +3 -3
  121. package/optimize/lib/components/drag_and_drop/droppable.js +2 -2
  122. package/optimize/lib/components/highlight/highlight.js +2 -2
  123. package/optimize/lib/components/inline_edit/inline_edit_text.js +2 -3
  124. package/optimize/lib/components/inline_edit/inline_edit_title.js +2 -3
  125. package/optimize/lib/components/inner_text/index.js +1 -8
  126. package/optimize/lib/components/markdown_editor/markdown_actions.js +1 -1
  127. package/optimize/lib/components/markdown_editor/markdown_editor_text_area.js +10 -4
  128. package/optimize/lib/components/modal/confirm_modal.js +10 -23
  129. package/optimize/lib/components/outside_click_detector/outside_click_detector.js +10 -11
  130. package/optimize/lib/components/popover/wrapping_popover.js +1 -9
  131. package/optimize/lib/components/portal/portal.js +34 -25
  132. package/optimize/lib/components/timeline/timeline_item_icon.js +6 -4
  133. package/optimize/lib/components/tour/tour_step.js +15 -11
  134. package/optimize/lib/services/color/eui_palettes.js +9 -2
  135. package/optimize/lib/services/color/index.js +7 -0
  136. package/optimize/lib/services/index.js +7 -0
  137. package/optimize/lib/services/time/timer.js +3 -5
  138. package/optimize/lib/test/rtl/component_helpers.js +1 -1
  139. package/optimize/lib/test/rtl/index.js +13 -1
  140. package/optimize/lib/test/rtl/render_hook.js +29 -0
  141. package/package.json +23 -16
  142. package/test-env/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
  143. package/test-env/components/datagrid/body/data_grid_body.js +7 -7
  144. package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
  145. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  146. package/test-env/components/datagrid/body/data_grid_cell.js +14 -13
  147. package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
  148. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +1 -1
  149. package/test-env/components/datagrid/body/header/data_grid_header_row.js +5 -5
  150. package/test-env/components/datagrid/controls/data_grid_toolbar.js +36 -28
  151. package/test-env/components/datagrid/controls/display_selector.js +1 -1
  152. package/test-env/components/datagrid/data_grid.js +7 -7
  153. package/test-env/components/datagrid/utils/in_memory.js +4 -4
  154. package/test-env/components/datagrid/utils/row_heights.js +4 -4
  155. package/test-env/components/date_picker/date_picker.js +1 -1
  156. package/test-env/components/drag_and_drop/drag_drop_context.js +2 -2
  157. package/test-env/components/drag_and_drop/draggable.js +3 -3
  158. package/test-env/components/drag_and_drop/droppable.js +2 -2
  159. package/test-env/components/header/header_section/header_section_item_button.js +94 -0
  160. package/test-env/components/highlight/highlight.js +2 -2
  161. package/test-env/components/inline_edit/inline_edit_text.js +2 -3
  162. package/test-env/components/inline_edit/inline_edit_title.js +2 -3
  163. package/test-env/components/inner_text/index.js +1 -8
  164. package/test-env/components/markdown_editor/markdown_actions.js +1 -1
  165. package/test-env/components/markdown_editor/markdown_editor_text_area.js +10 -4
  166. package/test-env/components/modal/confirm_modal.js +10 -23
  167. package/test-env/components/outside_click_detector/outside_click_detector.js +10 -11
  168. package/test-env/components/page/page_template.js +8 -8
  169. package/test-env/components/popover/wrapping_popover.js +1 -9
  170. package/test-env/components/portal/portal.js +34 -25
  171. package/test-env/components/tabs/tabs.js +25 -0
  172. package/test-env/components/timeline/timeline_item_icon.js +6 -3
  173. package/test-env/components/tour/tour_step.js +15 -11
  174. package/test-env/services/color/eui_palettes.js +9 -2
  175. package/test-env/services/color/index.js +7 -0
  176. package/test-env/services/index.js +7 -0
  177. package/test-env/services/time/timer.js +3 -5
  178. package/test-env/test/rtl/component_helpers.js +1 -1
  179. package/test-env/test/rtl/index.js +13 -1
  180. package/test-env/test/rtl/render_hook.js +29 -0
  181. package/es/components/inner_text/render_to_text.js +0 -47
  182. package/lib/components/inner_text/render_to_text.js +0 -54
  183. package/optimize/es/components/inner_text/render_to_text.js +0 -42
  184. package/optimize/lib/components/inner_text/render_to_text.js +0 -52
  185. package/test-env/components/inner_text/render_to_text.js +0 -52
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.euiPaletteWarm = exports.euiPalettePositive = exports.euiPaletteNegative = exports.euiPaletteGray = exports.euiPaletteForTemperature = exports.euiPaletteForStatus = exports.euiPaletteForLightBackground = exports.euiPaletteForDarkBackground = exports.euiPaletteCool = exports.euiPaletteComplimentary = exports.euiPaletteColorBlindBehindText = exports.euiPaletteColorBlind = void 0;
6
+ exports.euiPaletteWarm = exports.euiPalettePositive = exports.euiPaletteNegative = exports.euiPaletteGray = exports.euiPaletteForTemperature = exports.euiPaletteForStatus = exports.euiPaletteForLightBackground = exports.euiPaletteForDarkBackground = exports.euiPaletteCool = exports.euiPaletteComplimentary = exports.euiPaletteComplementary = exports.euiPaletteColorBlindBehindText = exports.euiPaletteColorBlind = void 0;
7
7
  var _chromaJs = _interopRequireDefault(require("chroma-js"));
8
8
  var _color_palette = require("./color_palette");
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -158,12 +158,19 @@ var euiPaletteForTemperature = function euiPaletteForTemperature(steps) {
158
158
  return euiPalette([].concat(_toConsumableArray(cools), _toConsumableArray(warms)), steps, true);
159
159
  };
160
160
  exports.euiPaletteForTemperature = euiPaletteForTemperature;
161
- var euiPaletteComplimentary = function euiPaletteComplimentary(steps) {
161
+ var euiPaletteComplementary = function euiPaletteComplementary(steps) {
162
162
  if (steps === 1) {
163
163
  return [euiPaletteColorBlind()[1]];
164
164
  }
165
165
  return euiPalette([euiPaletteColorBlind()[1], euiPaletteColorBlind()[7]], steps, true);
166
166
  };
167
+
168
+ /**
169
+ * The old typo'd name for this palette remains exported until the end of its deprecation period
170
+ * @deprecated Use euiPaletteComplementary instead
171
+ */
172
+ exports.euiPaletteComplementary = euiPaletteComplementary;
173
+ var euiPaletteComplimentary = euiPaletteComplementary;
167
174
  exports.euiPaletteComplimentary = euiPaletteComplimentary;
168
175
  var euiPaletteNegative = function euiPaletteNegative(steps) {
169
176
  if (steps === 1) {
@@ -24,6 +24,7 @@ var _exportNames = {
24
24
  euiPaletteForStatus: true,
25
25
  euiPaletteForTemperature: true,
26
26
  euiPaletteComplimentary: true,
27
+ euiPaletteComplementary: true,
27
28
  euiPaletteNegative: true,
28
29
  euiPalettePositive: true,
29
30
  euiPaletteCool: true,
@@ -73,6 +74,12 @@ Object.defineProperty(exports, "euiPaletteColorBlindBehindText", {
73
74
  return _eui_palettes.euiPaletteColorBlindBehindText;
74
75
  }
75
76
  });
77
+ Object.defineProperty(exports, "euiPaletteComplementary", {
78
+ enumerable: true,
79
+ get: function get() {
80
+ return _eui_palettes.euiPaletteComplementary;
81
+ }
82
+ });
76
83
  Object.defineProperty(exports, "euiPaletteComplimentary", {
77
84
  enumerable: true,
78
85
  get: function get() {
@@ -30,6 +30,7 @@ var _exportNames = {
30
30
  euiPaletteColorBlind: true,
31
31
  euiPaletteColorBlindBehindText: true,
32
32
  euiPaletteComplimentary: true,
33
+ euiPaletteComplementary: true,
33
34
  euiPaletteCool: true,
34
35
  euiPaletteForDarkBackground: true,
35
36
  euiPaletteForLightBackground: true,
@@ -264,6 +265,12 @@ Object.defineProperty(exports, "euiPaletteColorBlindBehindText", {
264
265
  return _color.euiPaletteColorBlindBehindText;
265
266
  }
266
267
  });
268
+ Object.defineProperty(exports, "euiPaletteComplementary", {
269
+ enumerable: true,
270
+ get: function get() {
271
+ return _color.euiPaletteComplementary;
272
+ }
273
+ });
267
274
  Object.defineProperty(exports, "euiPaletteComplimentary", {
268
275
  enumerable: true,
269
276
  get: function get() {
@@ -18,13 +18,11 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
18
18
  * in compliance with, at your election, the Elastic License 2.0 or the Server
19
19
  * Side Public License, v 1.
20
20
  */
21
- var Timer = /*#__PURE__*/_createClass(
22
- // In a browser this is a number, but in node it's a NodeJS.Time (a
23
- // class). We don't care about this difference.
24
-
25
- function Timer(callback, timeMs) {
21
+ var Timer = /*#__PURE__*/_createClass(function Timer(callback, timeMs) {
26
22
  var _this = this;
27
23
  _classCallCheck(this, Timer);
24
+ // In a browser this is a number, but in node it's a NodeJS.Time (a
25
+ // class). We don't care about this difference.
28
26
  _defineProperty(this, "id", void 0);
29
27
  _defineProperty(this, "callback", void 0);
30
28
  _defineProperty(this, "finishTime", void 0);
@@ -81,7 +81,7 @@ var waitForEuiToolTipVisible = /*#__PURE__*/function () {
81
81
  var tooltip = document.querySelector('.euiToolTipPopover');
82
82
  expect(tooltip).toBeVisible();
83
83
  }, {
84
- timeout: 1500
84
+ timeout: 3000
85
85
  } // Account for long delay on tooltips
86
86
  );
87
87
  case 2:
@@ -81,4 +81,16 @@ Object.keys(_component_helpers).forEach(function (key) {
81
81
  });
82
82
  });
83
83
  var _data_test_subj_queries = require("./data_test_subj_queries");
84
- var _custom_render = require("./custom_render");
84
+ var _custom_render = require("./custom_render");
85
+ var _render_hook = require("./render_hook");
86
+ Object.keys(_render_hook).forEach(function (key) {
87
+ if (key === "default" || key === "__esModule") return;
88
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
89
+ if (key in exports && exports[key] === _render_hook[key]) return;
90
+ Object.defineProperty(exports, key, {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _render_hook[key];
94
+ }
95
+ });
96
+ });
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderHookAct = exports.renderHook = void 0;
7
+ /*
8
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
9
+ * or more contributor license agreements. Licensed under the Elastic License
10
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
11
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
12
+ * Side Public License, v 1.
13
+ */
14
+
15
+ /* eslint-disable @typescript-eslint/no-var-requires */
16
+
17
+ var renderHook;
18
+ exports.renderHook = renderHook;
19
+ var renderHookAct;
20
+ exports.renderHookAct = renderHookAct;
21
+ if (process.env.REACT_VERSION === '18') {
22
+ exports.renderHook = renderHook = require('@testing-library/react').renderHook;
23
+ exports.renderHookAct = renderHookAct = require('@testing-library/react').act;
24
+ } else {
25
+ exports.renderHook = renderHook = require('@testing-library/react-hooks').renderHook;
26
+ exports.renderHookAct = renderHookAct = require('@testing-library/react-hooks').act;
27
+ }
28
+
29
+ /* eslint-enable @typescript-eslint/no-var-requires */
@@ -314,15 +314,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
314
314
  }
315
315
  });
316
316
  return _this;
317
- } // focus tracking is split between the entire grid & individual cells,
318
- // the parent grid owns which cell is focused,
319
- // but individual cells need to react to changes and also report that
320
- // they are focused in response to user actions like clicking on the cell
321
- // to avoid focus trap fighting, cells wait a tick after being clicked to allow
322
- // any existing traps to disconnect before the cell reports the new focus state to the parent grid
323
- // but because of this small delay, multiple cells could queue up focus and
324
- // create an infinite loop as the cells activate->deactivate->...
325
- // so we track the last timeout id and clear that request if superseded
317
+ }
326
318
  _createClass(EuiDataGridCell, [{
327
319
  key: "componentDidMount",
328
320
  value: function componentDidMount() {
@@ -625,5 +617,14 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
625
617
  }]);
626
618
  return EuiDataGridCell;
627
619
  }(Component);
620
+ // focus tracking is split between the entire grid & individual cells,
621
+ // the parent grid owns which cell is focused,
622
+ // but individual cells need to react to changes and also report that
623
+ // they are focused in response to user actions like clicking on the cell
624
+ // to avoid focus trap fighting, cells wait a tick after being clicked to allow
625
+ // any existing traps to disconnect before the cell reports the new focus state to the parent grid
626
+ // but because of this small delay, multiple cells could queue up focus and
627
+ // create an infinite loop as the cells activate->deactivate->...
628
+ // so we track the last timeout id and clear that request if superseded
628
629
  _defineProperty(EuiDataGridCell, "activeFocusTimeoutId", undefined);
629
630
  _defineProperty(EuiDataGridCell, "contextType", DataGridFocusContext);
@@ -1,3 +1,4 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
1
2
  /*
2
3
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
4
  * or more contributor license agreements. Licensed under the Elastic License
@@ -6,7 +7,7 @@
6
7
  * Side Public License, v 1.
7
8
  */
8
9
 
9
- import React from 'react';
10
+ import React, { isValidElement } from 'react';
10
11
  import { EuiScreenReaderOnly } from '../../accessibility';
11
12
  import { IS_JEST_ENVIRONMENT } from '../../../utils';
12
13
 
@@ -58,40 +59,44 @@ export function checkOrDefaultToolBarDisplayOptions(arg, option) {
58
59
  return true;
59
60
  }
60
61
  }
61
- export function renderAdditionalControls(toolbarVisibility, position) {
62
- var _additionalControlsOb;
62
+ export var renderAdditionalControls = function renderAdditionalControls(toolbarVisibility, position) {
63
63
  if (typeof toolbarVisibility === 'boolean') return null;
64
64
  var _ref2 = toolbarVisibility || {},
65
65
  additionalControls = _ref2.additionalControls;
66
66
  if (!additionalControls) return null;
67
67
 
68
- // Typescript is having obj issues, so we need to force cast to EuiDataGridToolBarAdditionalControlsOptions here
69
- var additionalControlsObj = (additionalControls === null || additionalControls === void 0 ? void 0 : additionalControls.constructor) === Object ? additionalControls : {};
70
- // Typescript workarounds continued
71
- var leftPositionObj = ((_additionalControlsOb = additionalControlsObj.left) === null || _additionalControlsOb === void 0 ? void 0 : _additionalControlsOb.constructor) === Object ? additionalControlsObj.left : {};
72
- if (position === 'right') {
73
- if (additionalControlsObj !== null && additionalControlsObj !== void 0 && additionalControlsObj.right) {
74
- return additionalControlsObj.right;
68
+ // API backwards compatability: if the consumer passed a single ReactNode
69
+ // to `additionalControls`, default to the left append position.
70
+ if ( /*#__PURE__*/isValidElement(additionalControls) && position === 'left.append') {
71
+ return additionalControls;
72
+ }
73
+ if (_typeof(additionalControls) !== 'object') {
74
+ return null;
75
+ }
76
+ var handleLeftObjectConfig = function handleLeftObjectConfig(leftConfig) {
77
+ if (position === 'left.prepend') {
78
+ return leftConfig.prepend;
75
79
  }
76
- } else if (position === 'left.prepend') {
77
- if (leftPositionObj !== null && leftPositionObj !== void 0 && leftPositionObj.prepend) {
78
- return leftPositionObj.prepend;
80
+ if (position === 'left.append') {
81
+ return leftConfig.append;
79
82
  }
80
- } else if (position === 'left.append') {
81
- if (leftPositionObj !== null && leftPositionObj !== void 0 && leftPositionObj.append) {
82
- return leftPositionObj.append;
83
+ };
84
+ var handleObjectConfig = function handleObjectConfig(additionalControls) {
85
+ if (position === 'right') {
86
+ return additionalControls.right;
83
87
  }
84
- if ( /*#__PURE__*/React.isValidElement(additionalControlsObj === null || additionalControlsObj === void 0 ? void 0 : additionalControlsObj.left)) {
85
- // If the consumer passed a single ReactNode to `additionalControls.left`, default to the left append position
86
- return additionalControlsObj.left;
88
+ // API backwards compatability: If the consumer passed a single ReactNode
89
+ // to `additionalControls.left`, default to the left append position
90
+ if ( /*#__PURE__*/isValidElement(additionalControls.left) && position === 'left.append') {
91
+ return additionalControls.left;
87
92
  }
88
- if ( /*#__PURE__*/React.isValidElement(additionalControls)) {
89
- // API backwards compatability: if the consumer passed a single ReactNode to `additionalControls`, default to the the left append position
90
- return additionalControls;
93
+ if (additionalControls.left && _typeof(additionalControls.left) === 'object') {
94
+ return handleLeftObjectConfig(additionalControls.left);
91
95
  }
92
- }
93
- return null;
94
- }
96
+ };
97
+ var rendered = handleObjectConfig(additionalControls);
98
+ return rendered || null;
99
+ };
95
100
 
96
101
  /**
97
102
  * Utility helper for selectors/controls that allow nested options
@@ -101,7 +106,7 @@ export function renderAdditionalControls(toolbarVisibility, position) {
101
106
  export function getNestedObjectOptions(controlOption, objectKey) {
102
107
  var _controlOption$object;
103
108
  // If the config is a boolean, nested options follow that boolean
104
- if (controlOption === false || controlOption === true) return controlOption;
109
+ if (typeof controlOption === 'boolean') return controlOption;
105
110
  // If config is not defined, default to enabled
106
111
  if (controlOption == null) return true;
107
112
  // Otherwise, type should be an object of boolean values - dive into it and return the value
@@ -124,7 +124,7 @@ export var useDataGridDisplaySelector = function useDataGridDisplaySelector(show
124
124
  setUserRowHeightsOptions(rowHeightsOptions);
125
125
  }, [lineCount]);
126
126
  var setLineCountHeight = useCallback(function (event) {
127
- var newLineCount = Number(event.target.value);
127
+ var newLineCount = Number(event.currentTarget.value);
128
128
  if (newLineCount < 1) return; // Don't let users set a 0 or negative line count
129
129
 
130
130
  setLineCount(newLineCount);
@@ -144,9 +144,9 @@ export var EuiDataGridInMemoryRenderer = function EuiDataGridInMemoryRenderer(_r
144
144
  var cellDivs = documentFragment.childNodes[0].childNodes;
145
145
  for (var i = 0; i < cellDivs.length; i++) {
146
146
  var cellDiv = cellDivs[i];
147
- var _rowIndex = parseInt(cellDiv.getAttribute('data-dg-row'), 10);
147
+ var rowIndex = parseInt(cellDiv.getAttribute('data-dg-row'), 10);
148
148
  var column = cellDiv.getAttribute('data-dg-column');
149
- onCellRender(_rowIndex, column, getElementText(cellDiv));
149
+ onCellRender(rowIndex, column, getElementText(cellDiv));
150
150
  }
151
151
  // changes to documentFragment.children is reflected by `cells`
152
152
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -197,15 +197,15 @@ export var RowHeightVirtualizationUtils = /*#__PURE__*/function (_RowHeightUtils
197
197
  var _this2;
198
198
  _classCallCheck(this, RowHeightVirtualizationUtils);
199
199
  _this2 = _super.call(this);
200
- _this2.gridRef = gridRef;
201
- _this2.outerGridElementRef = outerGridElementRef;
202
- _this2.gridItemsRenderedRef = gridItemsRenderedRef;
203
- _this2.rerenderGridBodyRef = rerenderGridBodyRef;
204
200
  /**
205
201
  * Virtualization workarounds for auto height rows
206
202
  */
207
203
  _defineProperty(_assertThisInitialized(_this2), "timerId", void 0);
208
204
  _defineProperty(_assertThisInitialized(_this2), "lastUpdatedRow", Infinity);
205
+ _this2.gridRef = gridRef;
206
+ _this2.outerGridElementRef = outerGridElementRef;
207
+ _this2.gridItemsRenderedRef = gridItemsRenderedRef;
208
+ _this2.rerenderGridBodyRef = rerenderGridBodyRef;
209
209
  return _this2;
210
210
  }
211
211
  _createClass(RowHeightVirtualizationUtils, [{
@@ -135,7 +135,7 @@ export var EuiDatePicker = function EuiDatePicker(_ref) {
135
135
  inputValidityRef = _useState2[0],
136
136
  _setInputValidityRef = _useState2[1];
137
137
  var setInputValidityRef = useCallback(function (ref) {
138
- _setInputValidityRef(ref === null || ref === void 0 ? void 0 : ref.input);
138
+ _setInputValidityRef((ref === null || ref === void 0 ? void 0 : ref.input) || null);
139
139
  }, []);
140
140
  useEuiValidatableControl({
141
141
  isInvalid: isInvalid,
@@ -11,7 +11,7 @@ var _excluded = ["onBeforeDragStart", "onDragStart", "onDragUpdate", "onDragEnd"
11
11
  */
12
12
 
13
13
  import React, { useState, createContext } from 'react';
14
- import { DragDropContext } from 'react-beautiful-dnd';
14
+ import { DragDropContext } from '@hello-pangea/dnd';
15
15
 
16
16
  // export interface EuiDragDropContextProps extends DragDropContextProps {}
17
17
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -13,7 +13,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
13
13
  */
14
14
 
15
15
  import React, { Fragment, cloneElement, useContext } from 'react';
16
- import { Draggable } from 'react-beautiful-dnd';
16
+ import { Draggable } from '@hello-pangea/dnd';
17
17
  import classNames from 'classnames';
18
18
  import { EuiDroppableContext } from './droppable';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -62,7 +62,7 @@ export var EuiDraggable = function EuiDraggable(_ref) {
62
62
  'euiDraggable__item--isDragging': snapshot.isDragging,
63
63
  'euiDraggable__item--isDropAnimating': snapshot.isDropAnimating
64
64
  });
65
- var DraggableElement = typeof children === 'function' ? children(provided, snapshot, rubric) : children; // as specified by `DraggableProps`
65
+ var DraggableElement = typeof children === 'function' ? children(provided, snapshot, rubric) : children;
66
66
  return ___EmotionJSX(Fragment, null, ___EmotionJSX("div", _extends({}, provided.draggableProps, !customDragHandle ? provided.dragHandleProps : {}, {
67
67
  ref: provided.innerRef,
68
68
  "data-test-subj": dataTestSubj,
@@ -10,7 +10,7 @@ var _excluded = ["droppableId", "direction", "isDropDisabled", "children", "clas
10
10
  */
11
11
 
12
12
  import React, { useContext } from 'react';
13
- import { Droppable } from 'react-beautiful-dnd';
13
+ import { Droppable } from '@hello-pangea/dnd';
14
14
  import classNames from 'classnames';
15
15
  import { EuiDragDropContextContext } from './drag_drop_context';
16
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -11,5 +11,6 @@ export { EuiDraggable } from './draggable';
11
11
  export { EuiDroppable } from './droppable';
12
12
  export { euiDragDropCopy, euiDragDropMove, euiDragDropReorder } from './services';
13
13
 
14
- // Interfaces in react-beautiful-dnd that EUI abstracts over
15
- // allows consumers to pull these from EUI instead of react-beautiful-dnd
14
+ // Interfaces in @hello-pangea/dnd (a fork of react-beautiful-dnd) that EUI
15
+ // abstracts over allows consumers to pull these from EUI
16
+ // instead of @hello-pangea/dnd
@@ -44,9 +44,9 @@ var highlight = function highlight(searchSubject, searchValue, isStrict, highlig
44
44
  var preMatch = searchSubject.substring(0, indexOfMatch);
45
45
  var match = searchSubject.substring(indexOfMatch, indexOfMatch + searchValue.length);
46
46
  var postMatch = searchSubject.substring(indexOfMatch + searchValue.length);
47
- return ___EmotionJSX(Fragment, null, preMatch, ___EmotionJSX(EuiMark, {
47
+ return ___EmotionJSX(Fragment, null, preMatch || undefined, ___EmotionJSX(EuiMark, {
48
48
  hasScreenReaderHelpText: hasScreenReaderHelpText
49
- }, match), postMatch);
49
+ }, match), postMatch || undefined);
50
50
  };
51
51
  var getHightlightWords = function getHightlightWords(searchSubject, searchValue, isStrict) {
52
52
  var regex = new RegExp(searchValue, isStrict ? 'g' : 'gi');
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["children", "className", "size", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
4
+ var _excluded = ["className", "size", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  /*
@@ -20,8 +20,7 @@ import { useEuiTheme } from '../../services';
20
20
  import { euiInlineEditTextStyles } from './inline_edit_text.styles';
21
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
22
22
  export var EuiInlineEditText = function EuiInlineEditText(_ref) {
23
- var children = _ref.children,
24
- className = _ref.className,
23
+ var className = _ref.className,
25
24
  _ref$size = _ref.size,
26
25
  size = _ref$size === void 0 ? 'm' : _ref$size,
27
26
  defaultValue = _ref.defaultValue,
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["children", "className", "size", "heading", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
4
+ var _excluded = ["className", "size", "heading", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  /*
@@ -21,8 +21,7 @@ import { euiInlineEditTitleStyles } from './inline_edit_title.styles';
21
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
22
22
  export var HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span'];
23
23
  export var EuiInlineEditTitle = function EuiInlineEditTitle(_ref) {
24
- var children = _ref.children,
25
- className = _ref.className,
24
+ var className = _ref.className,
26
25
  _ref$size = _ref.size,
27
26
  size = _ref$size === void 0 ? 'm' : _ref$size,
28
27
  heading = _ref.heading,
@@ -6,5 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- export { useInnerText, EuiInnerText } from './inner_text';
10
- export { useRenderToText } from './render_to_text';
9
+ export { useInnerText, EuiInnerText } from './inner_text';
@@ -48,8 +48,8 @@ import { isPluginWithImmediateFormatting } from './markdown_types';
48
48
  var MarkdownActions = /*#__PURE__*/function () {
49
49
  function MarkdownActions(editorID, uiPlugins) {
50
50
  _classCallCheck(this, MarkdownActions);
51
- this.editorID = editorID;
52
51
  _defineProperty(this, "styles", void 0);
52
+ this.editorID = editorID;
53
53
  /**
54
54
  * This object is in the format:
55
55
  * [nameOfAction]: {[styles to apply]}
@@ -29,13 +29,19 @@ export var EuiMarkdownEditorTextArea = /*#__PURE__*/forwardRef(function (_ref, r
29
29
  var classes = classNames('euiMarkdownEditorTextArea', {
30
30
  'euiMarkdownEditorTextArea-isReadOnly': readOnly
31
31
  });
32
+
33
+ // Ignore invalid empty string style values
34
+ var style = {};
35
+ if (height !== '') {
36
+ style.height = height;
37
+ }
38
+ if (maxHeight !== '') {
39
+ style.maxHeight = maxHeight;
40
+ }
32
41
  return ___EmotionJSX("textarea", _extends({
33
42
  ref: ref,
34
43
  "data-test-subj": "euiMarkdownEditorTextArea",
35
- style: {
36
- height: height,
37
- maxHeight: maxHeight
38
- },
44
+ style: style,
39
45
  className: classes
40
46
  }, rest, {
41
47
  rows: 6,
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
3
  var _excluded = ["children", "title", "titleProps", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
5
4
  /*
@@ -10,7 +9,7 @@ var _excluded = ["children", "title", "titleProps", "onCancel", "onConfirm", "ca
10
9
  * Side Public License, v 1.
11
10
  */
12
11
 
13
- import React, { useEffect, useState } from 'react';
12
+ import React, { useEffect, useRef } from 'react';
14
13
  import classnames from 'classnames';
15
14
  import { EuiModal } from './modal';
16
15
  import { EuiModalFooter } from './modal_footer';
@@ -39,33 +38,21 @@ export var EuiConfirmModal = function EuiConfirmModal(_ref) {
39
38
  defaultFocusedButton = _ref.defaultFocusedButton,
40
39
  isLoading = _ref.isLoading,
41
40
  rest = _objectWithoutProperties(_ref, _excluded);
42
- var _useState = useState(null),
43
- _useState2 = _slicedToArray(_useState, 2),
44
- cancelButton = _useState2[0],
45
- setCancelButton = _useState2[1];
46
- var _useState3 = useState(null),
47
- _useState4 = _slicedToArray(_useState3, 2),
48
- confirmButton = _useState4[0],
49
- setConfirmButton = _useState4[1];
41
+ var cancelButtonRef = useRef(null);
42
+ var confirmButtonRef = useRef(null);
50
43
  useEffect(function () {
51
44
  // We have to do this instead of using `autoFocus` because React's polyfill for auto-focusing
52
45
  // elements conflicts with the focus-trap logic we have on EuiModal.
53
46
  // Wait a beat for the focus-trap to complete, and then set focus to the right button. Check that
54
47
  // the buttons exist first, because it's possible the modal has been closed already.
55
- requestAnimationFrame(function () {
56
- if (defaultFocusedButton === CANCEL_BUTTON && cancelButton) {
57
- cancelButton.focus();
58
- } else if (defaultFocusedButton === CONFIRM_BUTTON && confirmButton) {
59
- confirmButton.focus();
48
+ setTimeout(function () {
49
+ if (defaultFocusedButton === CANCEL_BUTTON && cancelButtonRef.current) {
50
+ cancelButtonRef.current.focus();
51
+ } else if (defaultFocusedButton === CONFIRM_BUTTON && confirmButtonRef.current) {
52
+ confirmButtonRef.current.focus();
60
53
  }
61
54
  });
62
- });
63
- var confirmRef = function confirmRef(node) {
64
- return setConfirmButton(node);
65
- };
66
- var cancelRef = function cancelRef(node) {
67
- return setCancelButton(node);
68
- };
55
+ }, [defaultFocusedButton, cancelButtonRef, confirmButtonRef]);
69
56
  var classes = classnames('euiModal--confirmation', className);
70
57
  var euiTheme = useEuiTheme();
71
58
  var styles = euiModalStyles(euiTheme);
@@ -91,13 +78,13 @@ export var EuiConfirmModal = function EuiConfirmModal(_ref) {
91
78
  }, message)), ___EmotionJSX(EuiModalFooter, null, ___EmotionJSX(EuiButtonEmpty, {
92
79
  "data-test-subj": "confirmModalCancelButton",
93
80
  onClick: onCancel,
94
- buttonRef: cancelRef
81
+ buttonRef: cancelButtonRef
95
82
  }, cancelButtonText), ___EmotionJSX(EuiButton, {
96
83
  "data-test-subj": "confirmModalConfirmButton",
97
84
  onClick: onConfirm,
98
85
  isLoading: isLoading,
99
86
  fill: true,
100
- buttonRef: confirmRef,
87
+ buttonRef: confirmButtonRef,
101
88
  color: buttonColor,
102
89
  isDisabled: confirmButtonDisabled
103
90
  }, confirmButtonText)));
@@ -22,17 +22,6 @@ import { htmlIdGenerator } from '../../services/accessibility';
22
22
  export var EuiOutsideClickDetector = /*#__PURE__*/function (_Component) {
23
23
  _inherits(EuiOutsideClickDetector, _Component);
24
24
  var _super = _createSuper(EuiOutsideClickDetector);
25
- // We are working with the assumption that a click event is
26
- // equivalent to a sequential, compound press and release of
27
- // the pointing device (mouse, finger, stylus, etc.).
28
- // A click event's target can be imprecise, as the value will be
29
- // the closest common ancestor of the press (mousedown, touchstart)
30
- // and release (mouseup, touchend) events (often <body />) if
31
- // the the target of each event differs.
32
- // We need the actual event targets to make the correct decisions
33
- // about user intention. So, consider the down/start and up/end
34
- // items below as the deconstruction of a click event.
35
-
36
25
  function EuiOutsideClickDetector(props) {
37
26
  var _this;
38
27
  _classCallCheck(this, EuiOutsideClickDetector);
@@ -54,6 +43,16 @@ export var EuiOutsideClickDetector = /*#__PURE__*/function (_Component) {
54
43
  // virtual DOM and executes EuiClickDetector's onClick handler,
55
44
  // stamping the id even though the event originates outside
56
45
  // this component's reified DOM tree.
46
+ // We are working with the assumption that a click event is
47
+ // equivalent to a sequential, compound press and release of
48
+ // the pointing device (mouse, finger, stylus, etc.).
49
+ // A click event's target can be imprecise, as the value will be
50
+ // the closest common ancestor of the press (mousedown, touchstart)
51
+ // and release (mouseup, touchend) events (often <body />) if
52
+ // the the target of each event differs.
53
+ // We need the actual event targets to make the correct decisions
54
+ // about user intention. So, consider the down/start and up/end
55
+ // items below as the deconstruction of a click event.
57
56
  _defineProperty(_assertThisInitialized(_this), "id", void 0);
58
57
  _defineProperty(_assertThisInitialized(_this), "capturedDownIds", void 0);
59
58
  _defineProperty(_assertThisInitialized(_this), "onClickOutside", function (e) {
@@ -38,23 +38,15 @@ export var EuiWrappingPopover = /*#__PURE__*/function (_Component) {
38
38
  }
39
39
  _this = _super.call.apply(_super, [this].concat(args));
40
40
  _defineProperty(_assertThisInitialized(_this), "portal", null);
41
- _defineProperty(_assertThisInitialized(_this), "anchor", null);
42
41
  _defineProperty(_assertThisInitialized(_this), "setPortalRef", function (node) {
43
42
  _this.portal = node;
44
43
  });
45
44
  _defineProperty(_assertThisInitialized(_this), "setAnchorRef", function (node) {
46
- _this.anchor = node;
45
+ node === null || node === void 0 ? void 0 : node.insertAdjacentElement('beforebegin', _this.props.button);
47
46
  });
48
47
  return _this;
49
48
  }
50
49
  _createClass(EuiWrappingPopover, [{
51
- key: "componentDidMount",
52
- value: function componentDidMount() {
53
- if (this.anchor) {
54
- this.anchor.insertAdjacentElement('beforebegin', this.props.button);
55
- }
56
- }
57
- }, {
58
50
  key: "componentWillUnmount",
59
51
  value: function componentWillUnmount() {
60
52
  if (this.props.button.parentNode) {