@elastic/eui 92.0.0 → 92.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist/eui_theme_dark.css +3 -18
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +3 -18
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/aspect_ratio/aspect_ratio.js +1 -1
  6. package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
  7. package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
  8. package/es/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +56 -209
  9. package/es/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
  10. package/es/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
  11. package/es/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
  12. package/es/components/datagrid/body/cell/focus_utils.js +166 -0
  13. package/es/components/datagrid/body/cell/index.js +11 -0
  14. package/es/components/datagrid/body/data_grid_body.js +0 -2
  15. package/es/components/datagrid/body/data_grid_body_custom.js +1 -7
  16. package/es/components/datagrid/body/data_grid_body_virtualized.js +1 -7
  17. package/es/components/datagrid/body/footer/data_grid_footer_row.js +1 -2
  18. package/es/components/datagrid/body/header/data_grid_control_header_cell.js +3 -6
  19. package/es/components/datagrid/body/header/data_grid_header_cell.js +27 -12
  20. package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +45 -116
  21. package/es/components/datagrid/body/header/data_grid_header_row.js +5 -10
  22. package/es/components/datagrid/body/header/use_data_grid_header.js +3 -14
  23. package/es/components/datagrid/data_grid.js +2 -12
  24. package/es/components/datagrid/utils/focus.js +25 -54
  25. package/es/components/datagrid/utils/scrolling.js +1 -1
  26. package/es/components/flyout/flyout_resizable.js +10 -10
  27. package/es/components/flyout/flyout_resizable.styles.js +12 -6
  28. package/es/components/resizable_container/helpers.js +5 -6
  29. package/es/components/resizable_container/resizable_button.js +13 -4
  30. package/es/components/resizable_container/resizable_button.styles.js +18 -8
  31. package/es/components/resizable_container/resizable_container.js +28 -22
  32. package/es/components/steps/step_number.styles.js +6 -7
  33. package/es/components/tree_view/tree_view.js +9 -2
  34. package/eui.d.ts +125 -90
  35. package/i18ntokens.json +108 -72
  36. package/lib/components/aspect_ratio/aspect_ratio.js +1 -1
  37. package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
  38. package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
  39. package/lib/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +56 -209
  40. package/lib/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
  41. package/lib/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
  42. package/lib/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
  43. package/lib/components/datagrid/body/cell/focus_utils.js +174 -0
  44. package/lib/components/datagrid/body/cell/index.js +32 -0
  45. package/lib/components/datagrid/body/data_grid_body.js +0 -2
  46. package/lib/components/datagrid/body/data_grid_body_custom.js +2 -8
  47. package/lib/components/datagrid/body/data_grid_body_virtualized.js +2 -8
  48. package/lib/components/datagrid/body/footer/data_grid_footer_row.js +5 -6
  49. package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +3 -6
  50. package/lib/components/datagrid/body/header/data_grid_header_cell.js +35 -20
  51. package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +47 -119
  52. package/lib/components/datagrid/body/header/data_grid_header_row.js +5 -10
  53. package/lib/components/datagrid/body/header/use_data_grid_header.js +10 -24
  54. package/lib/components/datagrid/data_grid.js +4 -14
  55. package/lib/components/datagrid/utils/focus.js +26 -56
  56. package/lib/components/datagrid/utils/scrolling.js +2 -2
  57. package/lib/components/flyout/flyout_resizable.js +10 -10
  58. package/lib/components/flyout/flyout_resizable.styles.js +12 -6
  59. package/lib/components/resizable_container/helpers.js +7 -7
  60. package/lib/components/resizable_container/resizable_button.js +13 -4
  61. package/lib/components/resizable_container/resizable_button.styles.js +18 -8
  62. package/lib/components/resizable_container/resizable_container.js +28 -22
  63. package/lib/components/steps/step_number.styles.js +6 -7
  64. package/lib/components/tree_view/tree_view.js +9 -2
  65. package/optimize/es/components/aspect_ratio/aspect_ratio.js +1 -1
  66. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
  67. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
  68. package/optimize/es/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +56 -209
  69. package/optimize/es/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
  70. package/optimize/es/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
  71. package/optimize/es/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
  72. package/optimize/es/components/datagrid/body/cell/focus_utils.js +153 -0
  73. package/optimize/es/components/datagrid/body/cell/index.js +11 -0
  74. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +1 -5
  75. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +1 -5
  76. package/optimize/es/components/datagrid/body/footer/data_grid_footer_row.js +1 -2
  77. package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -4
  78. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +25 -10
  79. package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +41 -115
  80. package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +4 -8
  81. package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +3 -13
  82. package/optimize/es/components/datagrid/data_grid.js +2 -12
  83. package/optimize/es/components/datagrid/utils/focus.js +25 -54
  84. package/optimize/es/components/datagrid/utils/scrolling.js +1 -1
  85. package/optimize/es/components/flyout/flyout_resizable.js +10 -10
  86. package/optimize/es/components/flyout/flyout_resizable.styles.js +12 -6
  87. package/optimize/es/components/resizable_container/helpers.js +5 -6
  88. package/optimize/es/components/resizable_container/resizable_button.js +5 -2
  89. package/optimize/es/components/resizable_container/resizable_button.styles.js +18 -8
  90. package/optimize/es/components/resizable_container/resizable_container.js +28 -22
  91. package/optimize/es/components/steps/step_number.styles.js +6 -7
  92. package/optimize/es/components/tree_view/tree_view.js +9 -2
  93. package/optimize/lib/components/aspect_ratio/aspect_ratio.js +1 -1
  94. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
  95. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
  96. package/optimize/lib/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +56 -209
  97. package/optimize/lib/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
  98. package/optimize/lib/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
  99. package/optimize/lib/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
  100. package/optimize/lib/components/datagrid/body/cell/focus_utils.js +163 -0
  101. package/optimize/lib/components/datagrid/body/cell/index.js +32 -0
  102. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +2 -6
  103. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +2 -6
  104. package/optimize/lib/components/datagrid/body/footer/data_grid_footer_row.js +5 -6
  105. package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -4
  106. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +25 -10
  107. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +41 -115
  108. package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +4 -8
  109. package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +4 -14
  110. package/optimize/lib/components/datagrid/data_grid.js +4 -14
  111. package/optimize/lib/components/datagrid/utils/focus.js +26 -56
  112. package/optimize/lib/components/datagrid/utils/scrolling.js +2 -2
  113. package/optimize/lib/components/flyout/flyout_resizable.js +10 -10
  114. package/optimize/lib/components/flyout/flyout_resizable.styles.js +12 -6
  115. package/optimize/lib/components/resizable_container/helpers.js +7 -7
  116. package/optimize/lib/components/resizable_container/resizable_button.js +5 -2
  117. package/optimize/lib/components/resizable_container/resizable_button.styles.js +18 -8
  118. package/optimize/lib/components/resizable_container/resizable_container.js +28 -22
  119. package/optimize/lib/components/steps/step_number.styles.js +6 -7
  120. package/optimize/lib/components/tree_view/tree_view.js +9 -2
  121. package/package.json +1 -1
  122. package/src/components/datagrid/body/header/_data_grid_header_row.scss +8 -7
  123. package/test-env/components/aspect_ratio/aspect_ratio.js +1 -1
  124. package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
  125. package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
  126. package/test-env/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +56 -209
  127. package/test-env/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
  128. package/test-env/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
  129. package/test-env/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
  130. package/test-env/components/datagrid/body/cell/focus_utils.js +172 -0
  131. package/test-env/components/datagrid/body/cell/index.js +32 -0
  132. package/test-env/components/datagrid/body/data_grid_body.js +0 -2
  133. package/test-env/components/datagrid/body/data_grid_body_custom.js +2 -8
  134. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +2 -8
  135. package/test-env/components/datagrid/body/footer/data_grid_footer_row.js +5 -6
  136. package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +3 -6
  137. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +25 -10
  138. package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +44 -116
  139. package/test-env/components/datagrid/body/header/data_grid_header_row.js +5 -10
  140. package/test-env/components/datagrid/body/header/use_data_grid_header.js +4 -14
  141. package/test-env/components/datagrid/data_grid.js +4 -14
  142. package/test-env/components/datagrid/utils/focus.js +26 -56
  143. package/test-env/components/datagrid/utils/scrolling.js +2 -2
  144. package/test-env/components/flyout/flyout_resizable.js +10 -10
  145. package/test-env/components/flyout/flyout_resizable.styles.js +12 -6
  146. package/test-env/components/resizable_container/helpers.js +7 -7
  147. package/test-env/components/resizable_container/resizable_button.js +13 -4
  148. package/test-env/components/resizable_container/resizable_button.styles.js +18 -8
  149. package/test-env/components/resizable_container/resizable_container.js +28 -22
  150. package/test-env/components/steps/step_number.styles.js +6 -7
  151. package/test-env/components/tree_view/tree_view.js +9 -2
  152. package/es/components/datagrid/body/header/header_is_interactive.js +0 -58
  153. package/lib/components/datagrid/body/header/header_is_interactive.js +0 -63
  154. package/optimize/es/components/datagrid/body/header/header_is_interactive.js +0 -53
  155. package/optimize/lib/components/datagrid/body/header/header_is_interactive.js +0 -61
  156. package/test-env/components/datagrid/body/header/header_is_interactive.js +0 -61
@@ -28,8 +28,7 @@ import { useDataGridColumnSelector, useDataGridColumnSorting, useDataGridDisplay
28
28
  import { DataGridSortingContext, useSorting } from './utils/sorting';
29
29
  import { DataGridFocusContext, useFocus, createKeyDownHandler, preventTabbing } from './utils/focus';
30
30
  import { useInMemoryValues, EuiDataGridInMemoryRenderer } from './utils/in_memory';
31
- import { useHeaderIsInteractive } from './body/header/header_is_interactive';
32
- import { DataGridCellPopoverContext, useCellPopover } from './body/data_grid_cell_popover';
31
+ import { DataGridCellPopoverContext, useCellPopover } from './body/cell';
33
32
  import { computeVisibleRows } from './utils/row_count';
34
33
  import { EuiDataGridPaginationRenderer } from './utils/data_grid_pagination';
35
34
  import { schemaDetectors as providedSchemaDetectors, useMergedSchema } from './utils/data_grid_schema';
@@ -199,13 +198,7 @@ export var EuiDataGrid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (pr
199
198
  /**
200
199
  * Focus
201
200
  */
202
- var _useHeaderIsInteracti = useHeaderIsInteractive(contentRef.current),
203
- headerIsInteractive = _useHeaderIsInteracti.headerIsInteractive,
204
- handleHeaderMutation = _useHeaderIsInteracti.handleHeaderMutation;
205
- var _useFocus = useFocus({
206
- headerIsInteractive: headerIsInteractive,
207
- gridItemsRendered: gridItemsRendered
208
- }),
201
+ var _useFocus = useFocus(),
209
202
  wrappingDivFocusProps = _useFocus.focusProps,
210
203
  focusContext = _objectWithoutProperties(_useFocus, _excluded2);
211
204
 
@@ -333,7 +326,6 @@ export var EuiDataGrid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (pr
333
326
  rowCount: rowCount,
334
327
  pagination: pagination,
335
328
  hasFooter: !!renderFooterCellValue,
336
- headerIsInteractive: headerIsInteractive,
337
329
  focusContext: focusContext
338
330
  }),
339
331
  "data-test-subj": "euiDataGridBody",
@@ -350,8 +342,6 @@ export var EuiDataGrid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (pr
350
342
  setVisibleColumns: setVisibleColumns,
351
343
  switchColumnPos: switchColumnPos,
352
344
  onColumnResize: onColumnResize,
353
- headerIsInteractive: headerIsInteractive,
354
- handleHeaderMutation: handleHeaderMutation,
355
345
  schemaDetectors: allSchemaDetectors,
356
346
  pagination: pagination,
357
347
  renderCellValue: renderCellValue,
@@ -7,7 +7,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
7
7
  * Side Public License, v 1.
8
8
  */
9
9
 
10
- import { createContext, useContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';
10
+ import { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';
11
11
  import { tabbable } from 'tabbable';
12
12
  import { keys } from '../../../services';
13
13
  export var DataGridFocusContext = /*#__PURE__*/createContext({
@@ -22,9 +22,7 @@ export var DataGridFocusContext = /*#__PURE__*/createContext({
22
22
  /**
23
23
  * Main focus context and overarching focus state management
24
24
  */
25
- export var useFocus = function useFocus(_ref) {
26
- var headerIsInteractive = _ref.headerIsInteractive,
27
- gridItemsRendered = _ref.gridItemsRendered;
25
+ export var useFocus = function useFocus() {
28
26
  // Maintain a map of focus cell state callbacks
29
27
  var cellsUpdateFocus = useRef(new Map());
30
28
  var onFocusUpdate = useCallback(function (cell, updateFocus) {
@@ -45,14 +43,17 @@ export var useFocus = function useFocus(_ref) {
45
43
  focusedCell = _useState4[0],
46
44
  _setFocusedCell = _useState4[1];
47
45
  var setFocusedCell = useCallback(function (nextFocusedCell) {
48
- // If the x/y coordinates remained the same, don't update. This keeps the focusedCell
49
- // reference stable, and allows it to be used in places that need reference equality.
50
- if (nextFocusedCell[0] === (focusedCell === null || focusedCell === void 0 ? void 0 : focusedCell[0]) && nextFocusedCell[1] === (focusedCell === null || focusedCell === void 0 ? void 0 : focusedCell[1])) {
51
- return;
52
- }
53
- _setFocusedCell(nextFocusedCell);
54
- setIsFocusedCellInView(true); // scrolling.ts ensures focused cells are fully in view
55
- }, [focusedCell]);
46
+ _setFocusedCell(function (prevFocusedCell) {
47
+ // If the x/y coordinates remained the same, don't update. This keeps the focusedCell
48
+ // reference stable, and allows it to be used in places that need reference equality.
49
+ if (nextFocusedCell[0] === (prevFocusedCell === null || prevFocusedCell === void 0 ? void 0 : prevFocusedCell[0]) && nextFocusedCell[1] === (prevFocusedCell === null || prevFocusedCell === void 0 ? void 0 : prevFocusedCell[1])) {
50
+ return prevFocusedCell;
51
+ } else {
52
+ setIsFocusedCellInView(true); // scrolling.ts ensures focused cells are fully in view
53
+ return nextFocusedCell;
54
+ }
55
+ });
56
+ }, []);
56
57
  var previousCell = useRef(undefined);
57
58
  useEffect(function () {
58
59
  if (previousCell.current) {
@@ -64,19 +65,8 @@ export var useFocus = function useFocus(_ref) {
64
65
  }
65
66
  }, [cellsUpdateFocus, focusedCell]);
66
67
  var focusFirstVisibleInteractiveCell = useCallback(function () {
67
- if (headerIsInteractive) {
68
- // The header (rowIndex -1) is sticky and will always be in view
69
- setFocusedCell([0, -1]);
70
- } else if (gridItemsRendered.current) {
71
- var _gridItemsRendered$cu = gridItemsRendered.current,
72
- visibleColumnStartIndex = _gridItemsRendered$cu.visibleColumnStartIndex,
73
- visibleRowStartIndex = _gridItemsRendered$cu.visibleRowStartIndex;
74
- setFocusedCell([visibleColumnStartIndex, visibleRowStartIndex]);
75
- } else {
76
- // If the header is non-interactive and there are no rendered cells,
77
- // there's nothing to do - we might as well leave focus on the grid body wrapper
78
- }
79
- }, [setFocusedCell, headerIsInteractive, gridItemsRendered]);
68
+ setFocusedCell([0, -1]);
69
+ }, [setFocusedCell]);
80
70
  var focusProps = useMemo(function () {
81
71
  return isFocusedCellInView ? {
82
72
  // FireFox allows tabbing to a div that is scrollable, while Chrome does not
@@ -117,16 +107,15 @@ export var notifyCellOfFocusState = function notifyCellOfFocusState(cellsUpdateF
117
107
  /**
118
108
  * Keydown handler for connecting focus state with keyboard navigation
119
109
  */
120
- export var createKeyDownHandler = function createKeyDownHandler(_ref2) {
121
- var gridElement = _ref2.gridElement,
122
- visibleColCount = _ref2.visibleColCount,
123
- visibleRowCount = _ref2.visibleRowCount,
124
- visibleRowStartIndex = _ref2.visibleRowStartIndex,
125
- rowCount = _ref2.rowCount,
126
- pagination = _ref2.pagination,
127
- hasFooter = _ref2.hasFooter,
128
- headerIsInteractive = _ref2.headerIsInteractive,
129
- focusContext = _ref2.focusContext;
110
+ export var createKeyDownHandler = function createKeyDownHandler(_ref) {
111
+ var gridElement = _ref.gridElement,
112
+ visibleColCount = _ref.visibleColCount,
113
+ visibleRowCount = _ref.visibleRowCount,
114
+ visibleRowStartIndex = _ref.visibleRowStartIndex,
115
+ rowCount = _ref.rowCount,
116
+ pagination = _ref.pagination,
117
+ hasFooter = _ref.hasFooter,
118
+ focusContext = _ref.focusContext;
130
119
  return function (event) {
131
120
  var focusedCell = focusContext.focusedCell,
132
121
  setFocusedCell = focusContext.setFocusedCell;
@@ -160,8 +149,7 @@ export var createKeyDownHandler = function createKeyDownHandler(_ref2) {
160
149
  }
161
150
  } else if (key === keys.ARROW_UP) {
162
151
  event.preventDefault();
163
- var minimumIndex = headerIsInteractive ? -1 : 0;
164
- if (y > minimumIndex) {
152
+ if (y > -1) {
165
153
  setFocusedCell([x, y - 1]);
166
154
  }
167
155
  } else if (key === keys.ARROW_RIGHT) {
@@ -248,21 +236,4 @@ export var getParentCellContent = function getParentCellContent(_element) {
248
236
  element = element.parentElement;
249
237
  }
250
238
  return element;
251
- };
252
-
253
- /**
254
- * Focus fixes & workarounds
255
- */
256
-
257
- // If the focus is on the header, and the header is no longer interactive,
258
- // move the focus down to the first row
259
- export var useHeaderFocusWorkaround = function useHeaderFocusWorkaround(headerIsInteractive) {
260
- var _useContext = useContext(DataGridFocusContext),
261
- focusedCell = _useContext.focusedCell,
262
- setFocusedCell = _useContext.setFocusedCell;
263
- useEffect(function () {
264
- if (!headerIsInteractive && focusedCell && focusedCell[1] === -1) {
265
- setFocusedCell([focusedCell[0], 0]);
266
- }
267
- }, [headerIsInteractive, focusedCell, setFocusedCell]);
268
239
  };
@@ -9,7 +9,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
  */
10
10
 
11
11
  import React, { useContext, useEffect, useCallback, useMemo } from 'react';
12
- import { DataGridCellPopoverContext } from '../body/data_grid_cell_popover';
12
+ import { DataGridCellPopoverContext } from '../body/cell';
13
13
  import { DataGridFocusContext } from './focus';
14
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
15
  /**
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["size", "maxWidth", "minWidth", "side", "children"];
4
+ var _excluded = ["size", "maxWidth", "minWidth", "side", "type", "children"];
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
7
  * or more contributor license agreements. Licensed under the Elastic License
@@ -13,6 +13,7 @@ var _excluded = ["size", "maxWidth", "minWidth", "side", "children"];
13
13
  import React, { forwardRef, useState, useEffect, useRef, useMemo, useCallback } from 'react';
14
14
  import { keys, useCombinedRefs, useEuiTheme } from '../../services';
15
15
  import { EuiResizableButton } from '../resizable_container';
16
+ import { getPosition } from '../resizable_container/helpers';
16
17
  import { EuiFlyout } from './flyout';
17
18
  import { euiFlyoutResizableButtonStyles } from './flyout_resizable.styles';
18
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -23,11 +24,13 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
23
24
  minWidth = _ref$minWidth === void 0 ? 200 : _ref$minWidth,
24
25
  _ref$side = _ref.side,
25
26
  side = _ref$side === void 0 ? 'right' : _ref$side,
27
+ _ref$type = _ref.type,
28
+ type = _ref$type === void 0 ? 'overlay' : _ref$type,
26
29
  children = _ref.children,
27
30
  rest = _objectWithoutProperties(_ref, _excluded);
28
31
  var euiTheme = useEuiTheme();
29
32
  var styles = euiFlyoutResizableButtonStyles(euiTheme);
30
- var cssStyles = [styles.euiFlyoutResizableButton, styles[side]];
33
+ var cssStyles = [styles.euiFlyoutResizableButton, styles[type][side]];
31
34
  var getFlyoutMinMaxWidth = useCallback(function (width) {
32
35
  return Math.min(Math.max(width, minWidth), maxWidth || Infinity, window.innerWidth - 20 // Leave some offset
33
36
  );
@@ -61,7 +64,7 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
61
64
  return modifier;
62
65
  }, [side, flyoutRef]);
63
66
  var onMouseMove = useCallback(function (e) {
64
- var mouseOffset = getMouseOrTouchX(e) - initialMouseX.current;
67
+ var mouseOffset = getPosition(e, true) - initialMouseX.current;
65
68
  var changedFlyoutWidth = initialWidth.current + mouseOffset * direction;
66
69
  setFlyoutWidth(getFlyoutMinMaxWidth(changedFlyoutWidth));
67
70
  }, [getFlyoutMinMaxWidth, direction]);
@@ -74,7 +77,7 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
74
77
  }, [onMouseMove]);
75
78
  var onMouseDown = useCallback(function (e) {
76
79
  var _flyoutRef$offsetWidt;
77
- initialMouseX.current = getMouseOrTouchX(e);
80
+ initialMouseX.current = getPosition(e, true);
78
81
  initialWidth.current = (_flyoutRef$offsetWidt = flyoutRef === null || flyoutRef === void 0 ? void 0 : flyoutRef.offsetWidth) !== null && _flyoutRef$offsetWidt !== void 0 ? _flyoutRef$offsetWidt : 0;
79
82
 
80
83
  // Window event listeners instead of React events are used
@@ -104,18 +107,15 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
104
107
  size: flyoutWidth || size,
105
108
  maxWidth: maxWidth,
106
109
  side: side,
110
+ type: type,
107
111
  ref: setRefs
108
112
  }), ___EmotionJSX(EuiResizableButton, {
109
113
  isHorizontal: true,
114
+ indicator: "border",
110
115
  css: cssStyles,
111
116
  onMouseDown: onMouseDown,
112
117
  onTouchStart: onMouseDown,
113
118
  onKeyDown: onKeyDown
114
119
  }), children);
115
120
  });
116
- EuiFlyoutResizable.displayName = 'EuiFlyoutResizable';
117
- var getMouseOrTouchX = function getMouseOrTouchX(e) {
118
- // Some Typescript fooling is needed here
119
- var x = e.targetTouches ? e.targetTouches[0].pageX : e.pageX;
120
- return x;
121
- };
121
+ EuiFlyoutResizable.displayName = 'EuiFlyoutResizable';
@@ -10,18 +10,24 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
10
10
  import { css } from '@emotion/react';
11
11
  import { logicalCSS } from '../../global_styling';
12
12
  var _ref = process.env.NODE_ENV === "production" ? {
13
- name: "6syi0e-euiFlyoutResizableButton",
14
- styles: "position:absolute;&::before,&::after{background-color:transparent;};label:euiFlyoutResizableButton;"
13
+ name: "1gfwqnd-euiFlyoutResizableButton",
14
+ styles: "position:absolute;label:euiFlyoutResizableButton;"
15
15
  } : {
16
- name: "6syi0e-euiFlyoutResizableButton",
17
- styles: "position:absolute;&::before,&::after{background-color:transparent;};label:euiFlyoutResizableButton;",
16
+ name: "1gfwqnd-euiFlyoutResizableButton",
17
+ styles: "position:absolute;label:euiFlyoutResizableButton;",
18
18
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
19
19
  };
20
20
  export var euiFlyoutResizableButtonStyles = function euiFlyoutResizableButtonStyles(_ref2) {
21
21
  var euiTheme = _ref2.euiTheme;
22
22
  return {
23
23
  euiFlyoutResizableButton: _ref,
24
- left: /*#__PURE__*/css(logicalCSS('right', "-".concat(euiTheme.border.width.thin)), ";;label:left;"),
25
- right: /*#__PURE__*/css(logicalCSS('left', "-".concat(euiTheme.border.width.thin)), ";;label:right;")
24
+ overlay: {
25
+ left: /*#__PURE__*/css(logicalCSS('right', 0), ";;label:left;"),
26
+ right: /*#__PURE__*/css(logicalCSS('left', 0), ";;label:right;")
27
+ },
28
+ push: {
29
+ left: /*#__PURE__*/css(logicalCSS('right', "-".concat(euiTheme.border.width.thin)), ";;label:left;"),
30
+ right: /*#__PURE__*/css(logicalCSS('left', "-".concat(euiTheme.border.width.thin)), ";;label:right;")
31
+ }
26
32
  };
27
33
  };
@@ -13,9 +13,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
13
13
 
14
14
  import { useMemo, useReducer } from 'react';
15
15
  import { assertNever } from '../common';
16
- function isMouseEvent(event) {
17
- return _typeof(event) === 'object' && 'pageX' in event && 'pageY' in event;
18
- }
16
+ export var isTouchEvent = function isTouchEvent(event) {
17
+ return _typeof(event) === 'object' && 'targetTouches' in event;
18
+ };
19
19
  export var pxToPercent = function pxToPercent(proportion, whole) {
20
20
  if (whole < 1 || proportion < 0) return 0;
21
21
  return proportion / whole * 100;
@@ -42,9 +42,8 @@ export var getPanelMinSize = function getPanelMinSize(panelMinSize, containerSiz
42
42
  return Math.max(configMin, paddingMin);
43
43
  };
44
44
  export var getPosition = function getPosition(event, isHorizontal) {
45
- var clientX = isMouseEvent(event) ? event.clientX : event.touches[0].clientX;
46
- var clientY = isMouseEvent(event) ? event.clientY : event.touches[0].clientY;
47
- return isHorizontal ? clientX : clientY;
45
+ var direction = isHorizontal ? 'clientX' : 'clientY';
46
+ return isTouchEvent(event) ? event.targetTouches[0][direction] : event[direction];
48
47
  };
49
48
  var getSiblingPanel = function getSiblingPanel(element, adjacency) {
50
49
  if (!element) return null;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["isHorizontal", "alignIndicator", "className"],
4
+ var _excluded = ["isHorizontal", "indicator", "alignIndicator", "className"],
5
5
  _excluded2 = ["registration", "id", "disabled", "onFocus"];
6
6
  /*
7
7
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -24,14 +24,17 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
24
24
  */
25
25
  export var EuiResizableButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
26
26
  var isHorizontal = _ref.isHorizontal,
27
+ _ref$indicator = _ref.indicator,
28
+ indicator = _ref$indicator === void 0 ? 'handle' : _ref$indicator,
27
29
  _ref$alignIndicator = _ref.alignIndicator,
28
30
  alignIndicator = _ref$alignIndicator === void 0 ? 'center' : _ref$alignIndicator,
29
31
  className = _ref.className,
30
32
  rest = _objectWithoutProperties(_ref, _excluded);
31
33
  var classes = classNames('euiResizableButton', className);
34
+ var resizeDirection = isHorizontal ? 'horizontal' : 'vertical';
32
35
  var euiTheme = useEuiTheme();
33
36
  var styles = euiResizableButtonStyles(euiTheme);
34
- var cssStyles = [styles.euiResizableButton, isHorizontal ? styles.horizontal : styles.vertical, styles.alignIndicator[alignIndicator]];
37
+ var cssStyles = [styles.euiResizableButton, styles[indicator], styles["".concat(indicator, "Direction")][resizeDirection], styles[resizeDirection], indicator === 'handle' && styles.alignIndicator[alignIndicator]];
35
38
  return ___EmotionJSX(EuiI18n, {
36
39
  tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
37
40
  defaults: ['Press the left or right arrow keys to adjust panels size', 'Press the up or down arrow keys to adjust panels size']
@@ -42,21 +42,31 @@ export var euiResizableButtonStyles = function euiResizableButtonStyles(euiTheme
42
42
  var transitionSpeed = euiTheme.animation.fast;
43
43
  var transition = "".concat(transitionSpeed, " ease");
44
44
  return {
45
- // Mimics the "grab" icon with CSS psuedo-elements.
46
- // 1. The "grab" icon transforms into a thicker straight line on :hover and :focus
47
- // 2. Start/end aligned handles should have a slight margin offset that disappears on hover/focus
45
+ // Creates a resizable indicator (either a grab handle or a plain border) with CSS psuedo-elements.
46
+ // 1. The "grab" handle transforms into a thicker straight line on :hover and :focus
47
+ // 2. Start/end aligned grab handles should have a slight margin offset that disappears on hover/focus
48
48
  // 3. CSS hack to smooth out/anti-alias the 1px wide handles at various zoom levels
49
- euiResizableButton: /*#__PURE__*/css("z-index:1;flex-shrink:0;display:flex;justify-content:center;gap:", mathWithUnits(grabHandleHeight, function (x) {
50
- return x * 2;
51
- }), ";&:disabled{display:none;}&:hover,&:focus{gap:0;justify-content:center;}", euiCanAnimate, "{transition:gap ", transition, ",justify-content ", transition, ";}&::before,&::after{content:'';display:block;background-color:", euiTheme.colors.darkestShade, ";transform:translateZ(0);", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ",margin ", transition, ",background-color ", transition, ";}}&:hover{&::before,&::after{background-color:", euiTheme.colors.mediumShade, ";", euiCanAnimate, "{transition-delay:", transitionSpeed, ";}}}&:focus,&:active{background-color:", transparentize(euiTheme.colors.primary, 0.1), ";&::before,&::after{background-color:", euiTheme.colors.primary, ";", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ";transition-delay:", mathWithUnits(transitionSpeed, function (x) {
49
+ euiResizableButton: /*#__PURE__*/css("z-index:1;flex-shrink:0;display:flex;justify-content:center;&:disabled{display:none;}&::before,&::after{content:'';display:block;", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ",margin ", transition, ",background-color ", transition, ";}}&:hover{&::before,&::after{background-color:", euiTheme.colors.mediumShade, ";}}&:focus,&:active{background-color:", transparentize(euiTheme.colors.primary, 0.1), ";&::before,&::after{background-color:", euiTheme.colors.primary, ";", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ";transition-delay:", mathWithUnits(transitionSpeed, function (x) {
52
50
  return x / 2;
53
51
  }), ";}}};label:euiResizableButton;"),
54
52
  horizontal: /*#__PURE__*/css("cursor:col-resize;", logicalCSS('height', '100%'), " ", logicalCSS('width', buttonSize), " margin-inline:", mathWithUnits(buttonSize, function (x) {
55
53
  return x / -2;
56
- }), ";&::before,&::after{", logicalCSS('width', grabHandleHeight), " ", logicalCSS('height', grabHandleWidth), " margin-block:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", logicalCSS('height', '100%'), " margin-block:0;transform:none;}};label:horizontal;"),
54
+ }), ";;label:horizontal;"),
57
55
  vertical: /*#__PURE__*/css("flex-direction:column;cursor:row-resize;", logicalCSS('width', '100%'), " ", logicalCSS('height', buttonSize), " margin-block:", mathWithUnits(buttonSize, function (x) {
58
56
  return x / -2;
59
- }), ";&::before,&::after{", logicalCSS('height', grabHandleHeight), " ", logicalCSS('width', grabHandleWidth), " margin-inline:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", logicalCSS('width', '100%'), " margin-inline:0;transform:none;}};label:vertical;"),
57
+ }), ";;label:vertical;"),
58
+ border: /*#__PURE__*/css("&::before,&::after{background-color:", euiTheme.border.color, ";};label:border;"),
59
+ borderDirection: {
60
+ horizontal: /*#__PURE__*/css("&::before{", logicalCSS('width', euiTheme.border.width.thin), " ", logicalCSS('height', '100%'), ";}&:hover,&:focus,&:active{&::after{", logicalCSS('width', euiTheme.border.width.thin), " ", logicalCSS('height', '100%'), ";}};label:horizontal;"),
61
+ vertical: /*#__PURE__*/css("&::before{", logicalCSS('height', euiTheme.border.width.thin), " ", logicalCSS('width', '100%'), ";}&:hover,&:focus,&:active{&::after{", logicalCSS('height', euiTheme.border.width.thin), " ", logicalCSS('width', '100%'), ";}};label:vertical;")
62
+ },
63
+ handle: /*#__PURE__*/css("gap:", mathWithUnits(grabHandleHeight, function (x) {
64
+ return x * 2;
65
+ }), ";&:hover,&:focus,&:active{gap:0;}", euiCanAnimate, "{transition:gap ", transition, ";}&::before,&::after{background-color:", euiTheme.colors.darkestShade, ";transform:translateZ(0);}&:hover{&::before,&::after{", euiCanAnimate, "{transition-delay:", transitionSpeed, ";}}};label:handle;"),
66
+ handleDirection: {
67
+ horizontal: /*#__PURE__*/css("&::before,&::after{", logicalCSS('width', grabHandleHeight), " ", logicalCSS('height', grabHandleWidth), " margin-block:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", logicalCSS('height', '100%'), " margin-block:0;transform:none;}};label:horizontal;"),
68
+ vertical: /*#__PURE__*/css("&::before,&::after{", logicalCSS('height', grabHandleHeight), " ", logicalCSS('width', grabHandleWidth), " margin-inline:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", logicalCSS('width', '100%'), " margin-inline:0;transform:none;}};label:vertical;")
69
+ },
60
70
  alignIndicator: {
61
71
  center: _ref3,
62
72
  start: _ref2,
@@ -99,16 +99,33 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
99
99
  prevPanelId: prevPanelId,
100
100
  nextPanelId: nextPanelId
101
101
  });
102
- }, [actions, isHorizontal, resizeStart]);
103
- var onMouseMove = useCallback(function (event) {
104
- if (!reducerState.prevPanelId || !reducerState.nextPanelId || !reducerState.isDragging) return;
105
- var position = getPosition(event, isHorizontal);
106
- actions.dragMove({
107
- position: position,
108
- prevPanelId: reducerState.prevPanelId,
109
- nextPanelId: reducerState.nextPanelId
110
- });
111
- }, [actions, isHorizontal, reducerState.prevPanelId, reducerState.nextPanelId, reducerState.isDragging]);
102
+
103
+ // Window event listeners instead of React events are used to continue
104
+ // detecting movement even if the user's mouse leaves the container
105
+
106
+ var onMouseMove = function onMouseMove(event) {
107
+ var position = getPosition(event, isHorizontal);
108
+ actions.dragMove({
109
+ position: position,
110
+ prevPanelId: prevPanelId,
111
+ nextPanelId: nextPanelId
112
+ });
113
+ };
114
+ var onMouseUp = function onMouseUp() {
115
+ if (resizeContext.current.trigger === 'pointer') {
116
+ resizeEnd();
117
+ }
118
+ actions.reset();
119
+ window.removeEventListener('mousemove', onMouseMove);
120
+ window.removeEventListener('mouseup', onMouseUp);
121
+ window.removeEventListener('touchmove', onMouseMove);
122
+ window.removeEventListener('touchend', onMouseUp);
123
+ };
124
+ window.addEventListener('mousemove', onMouseMove);
125
+ window.addEventListener('mouseup', onMouseUp);
126
+ window.addEventListener('touchmove', onMouseMove);
127
+ window.addEventListener('touchend', onMouseUp);
128
+ }, [actions, isHorizontal, resizeStart, resizeEnd]);
112
129
  var getKeyMoveDirection = useCallback(function (key) {
113
130
  var direction = null;
114
131
  if (isHorizontal && key === keys.ARROW_LEFT || !isHorizontal && key === keys.ARROW_UP) {
@@ -146,12 +163,6 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
146
163
  resizeEnd();
147
164
  }
148
165
  }, [getKeyMoveDirection, resizeEnd]);
149
- var onMouseUp = useCallback(function () {
150
- if (resizeContext.current.trigger === 'pointer') {
151
- resizeEnd();
152
- }
153
- actions.reset();
154
- }, [actions, resizeEnd]);
155
166
  var onBlur = useCallback(function () {
156
167
  if (resizeContext.current.trigger === 'key') {
157
168
  resizeEnd();
@@ -210,11 +221,6 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
210
221
  }, ___EmotionJSX("div", _extends({
211
222
  css: cssStyles,
212
223
  className: classes,
213
- ref: containerRef,
214
- onMouseMove: reducerState.isDragging ? onMouseMove : undefined,
215
- onMouseUp: onMouseUp,
216
- onMouseLeave: onMouseUp,
217
- onTouchMove: onMouseMove,
218
- onTouchEnd: onMouseUp
224
+ ref: containerRef
219
225
  }, rest), render()));
220
226
  };
@@ -9,7 +9,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
9
9
 
10
10
  import { css } from '@emotion/react';
11
11
  import { mathWithUnits, logicalCSS, euiFontSizeFromScale, euiCanAnimate, euiAnimScale } from '../../global_styling';
12
- import { makeHighContrastColor } from '../../services';
13
12
  import { euiStepVariables } from './step.styles';
14
13
  import { euiButtonFillColor } from '../../themes/amsterdam/global_styling/mixins';
15
14
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -42,12 +41,12 @@ export var euiStepNumberStyles = function euiStepNumberStyles(euiThemeContext) {
42
41
  xs: /*#__PURE__*/css(createStepsNumber(euiStep.numberXSSize, euiFontSizeFromScale('xs', euiTheme)), ";;label:xs;"),
43
42
  // status
44
43
  incomplete: /*#__PURE__*/css("background-color:transparent;color:", euiTheme.colors.text, ";border:", euiTheme.border.thick, ";;label:incomplete;"),
45
- disabled: /*#__PURE__*/css("background-color:", euiButtonFillColor(euiThemeContext, 'disabled').backgroundColor, ";color:", makeHighContrastColor(euiTheme.colors.disabledText)(euiButtonFillColor(euiThemeContext, 'disabled').backgroundColor), ";;label:disabled;"),
44
+ disabled: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, 'disabled'), ";;label:disabled;"),
46
45
  loading: _ref,
47
- warning: /*#__PURE__*/css("color:", euiButtonFillColor(euiThemeContext, 'warning').color, ";background-color:", euiButtonFillColor(euiThemeContext, 'warning').backgroundColor, ";", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:warning;"),
48
- danger: /*#__PURE__*/css("color:", euiButtonFillColor(euiThemeContext, 'danger').color, ";background-color:", euiButtonFillColor(euiThemeContext, 'danger').backgroundColor, ";", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:danger;"),
49
- complete: /*#__PURE__*/css("color:", euiButtonFillColor(euiThemeContext, 'success').color, ";background-color:", euiButtonFillColor(euiThemeContext, 'success').backgroundColor, ";", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:complete;"),
50
- current: /*#__PURE__*/css("border:2px solid ", euiTheme.colors.body, ";box-shadow:0 0 0 2px ", euiTheme.colors.primary, ";.euiStepNumber__number{display:inline-block;transform:translateY(-2px);};label:current;")
46
+ warning: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, 'warning'), " ", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:warning;"),
47
+ danger: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, 'danger'), " ", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:danger;"),
48
+ complete: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, 'success'), " ", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:complete;"),
49
+ current: /*#__PURE__*/css("border:", euiTheme.border.width.thick, " solid ", euiTheme.colors.body, ";box-shadow:0 0 0 ", euiTheme.border.width.thick, " ", euiTheme.colors.primary, ";;label:current;")
51
50
  };
52
51
  };
53
52
  export var euiStepNumberContentStyles = function euiStepNumberContentStyles(_ref3) {
@@ -67,6 +66,6 @@ export var euiStepNumberContentStyles = function euiStepNumberContentStyles(_ref
67
66
  incomplete: /*#__PURE__*/css("display:unset;position:relative;inset-block-start:-", euiTheme.border.width.thick, ";;label:incomplete;"),
68
67
  loading: /*#__PURE__*/css(";label:loading;"),
69
68
  disabled: /*#__PURE__*/css(";label:disabled;"),
70
- current: /*#__PURE__*/css(";label:current;")
69
+ current: /*#__PURE__*/css("display:inline-block;transform:translateY(-", euiTheme.border.width.thick, ");;label:current;")
71
70
  };
72
71
  };
@@ -32,7 +32,9 @@ var EuiTreeViewContext = /*#__PURE__*/createContext('');
32
32
  function hasAriaLabel(x) {
33
33
  return x.hasOwnProperty('aria-label');
34
34
  }
35
- function getTreeId(propId, contextId, idGenerator) {
35
+ function getTreeId(propId) {
36
+ var contextId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
37
+ var idGenerator = arguments.length > 2 ? arguments[2] : undefined;
36
38
  return propId !== null && propId !== void 0 ? propId : contextId === '' ? idGenerator() : contextId;
37
39
  }
38
40
  var displayToClassNameMap = {
@@ -42,9 +44,14 @@ var displayToClassNameMap = {
42
44
  export var EuiTreeView = /*#__PURE__*/function (_Component) {
43
45
  _inherits(EuiTreeView, _Component);
44
46
  var _super = _createSuper(EuiTreeView);
45
- function EuiTreeView(props, context) {
47
+ function EuiTreeView(props,
48
+ // Without the optional ? typing, TS will throw errors on JSX component errors
49
+ // @see https://github.com/facebook/react/issues/13944#issuecomment-1183693239
50
+ context) {
46
51
  var _this;
47
52
  _classCallCheck(this, EuiTreeView);
53
+ // TODO: context in constructor has been deprecated.
54
+ // We should likely convert this to a function component
48
55
  _this = _super.call(this, props, context);
49
56
  _defineProperty(_assertThisInitialized(_this), "treeIdGenerator", htmlIdGenerator('euiTreeView'));
50
57
  _defineProperty(_assertThisInitialized(_this), "isNested", void 0);
@@ -28,7 +28,7 @@ var EuiAspectRatio = function EuiAspectRatio(_ref) {
28
28
  style = _ref.style,
29
29
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
30
30
  var classes = (0, _classnames.default)('euiAspectRatio', className);
31
- var euiAspectRatioStyle = _objectSpread({
31
+ var euiAspectRatioStyle = _objectSpread(_objectSpread({}, children.props.style), {}, {
32
32
  aspectRatio: "".concat(width, " / ").concat(height),
33
33
  height: 'auto',
34
34
  width: '100%',
@@ -16,7 +16,7 @@ var _context = require("./context");
16
16
  var _collapsible_nav_body_footer = require("./collapsible_nav_body_footer.styles");
17
17
  var _react2 = require("@emotion/react");
18
18
  var _excluded = ["className"],
19
- _excluded2 = ["className"];
19
+ _excluded2 = ["className", "children"];
20
20
  /*
21
21
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
22
22
  * or more contributor license agreements. Licensed under the Elastic License
@@ -53,6 +53,7 @@ var EuiCollapsibleNavBody = function EuiCollapsibleNavBody(_ref) {
53
53
  exports.EuiCollapsibleNavBody = EuiCollapsibleNavBody;
54
54
  var EuiCollapsibleNavFooter = function EuiCollapsibleNavFooter(_ref2) {
55
55
  var className = _ref2.className,
56
+ children = _ref2.children,
56
57
  props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
57
58
  var classes = (0, _classnames.default)('euiCollapsibleNav__footer', className);
58
59
  var _useContext2 = (0, _react.useContext)(_context.EuiCollapsibleNavContext),
@@ -60,10 +61,13 @@ var EuiCollapsibleNavFooter = function EuiCollapsibleNavFooter(_ref2) {
60
61
  isPush = _useContext2.isPush;
61
62
  var euiTheme = (0, _services.useEuiTheme)();
62
63
  var styles = (0, _collapsible_nav_body_footer.euiCollapsibleNavFooterStyles)(euiTheme);
63
- var cssStyles = [styles.euiCollapsibleNav__footer, isCollapsed && isPush && styles.isPushCollapsed];
64
+ var cssStyles = styles.euiCollapsibleNav__footer;
65
+ var overflowWrapperStyles = [styles.euiFlyoutFooter__overflow, isCollapsed && isPush && styles.isPushCollapsed];
64
66
  return (0, _react2.jsx)(_flyout.EuiFlyoutFooter, (0, _extends2.default)({
65
67
  className: classes,
66
68
  css: cssStyles
67
- }, props));
69
+ }, props), (0, _react2.jsx)("div", {
70
+ css: overflowWrapperStyles
71
+ }, children));
68
72
  };
69
73
  exports.EuiCollapsibleNavFooter = EuiCollapsibleNavFooter;
@@ -19,17 +19,17 @@ var _global_styling = require("../../global_styling");
19
19
  var hideScrollbars = "\n scrollbar-width: none; /* Firefox */\n\n &::-webkit-scrollbar {\n display: none; /* Chrome, Edge, & Safari */\n }\n";
20
20
  exports.hideScrollbars = hideScrollbars;
21
21
  var euiCollapsibleNavBodyStyles = {
22
- // In case things get really dire responsively, ensure the footer doesn't overtake the body
23
- euiCollapsibleNav__body: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-height', '50%'), ";;label:euiCollapsibleNav__body;"),
22
+ euiCollapsibleNav__body: /*#__PURE__*/(0, _react.css)(";label:euiCollapsibleNav__body;"),
24
23
  isPushCollapsed: /*#__PURE__*/(0, _react.css)(".euiFlyoutBody__overflow{", hideScrollbars, ";};label:isPushCollapsed;")
25
24
  };
26
25
  exports.euiCollapsibleNavBodyStyles = euiCollapsibleNavBodyStyles;
27
26
  var euiCollapsibleNavFooterStyles = function euiCollapsibleNavFooterStyles(euiThemeContext) {
28
27
  var euiTheme = euiThemeContext.euiTheme;
29
28
  return {
30
- euiCollapsibleNav__footer: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), " ", (0, _global_styling.euiYScrollWithShadows)(euiThemeContext, {
29
+ euiCollapsibleNav__footer: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', '50%'), " background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), ";;label:euiCollapsibleNav__footer;"),
30
+ euiFlyoutFooter__overflow: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiYScrollWithShadows)(euiThemeContext, {
31
31
  side: 'end'
32
- }), ";;label:euiCollapsibleNav__footer;"),
32
+ }), ";;label:euiFlyoutFooter__overflow;"),
33
33
  isPushCollapsed: /*#__PURE__*/(0, _react.css)(hideScrollbars, ";;label:isPushCollapsed;")
34
34
  };
35
35
  };