@elastic/eui 116.3.0 → 116.3.1-snapshot.1782148316870

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 (199) hide show
  1. package/es/components/avatar/avatar.js +4 -0
  2. package/es/components/avatar/avatar.styles.js +16 -16
  3. package/es/components/banner/banner.js +1 -2
  4. package/es/components/banner/banner.styles.js +1 -1
  5. package/es/components/basic_table/basic_table.js +35 -5
  6. package/es/components/basic_table/basic_table.styles.js +19 -1
  7. package/es/components/basic_table/in_memory_table.js +17 -0
  8. package/es/components/basic_table/index.js +2 -1
  9. package/es/components/basic_table/pagination_bar.js +19 -4
  10. package/es/components/basic_table/pagination_bar.styles.js +21 -0
  11. package/es/components/basic_table/panel.styles.js +14 -0
  12. package/es/components/basic_table/use_panel_props.js +28 -0
  13. package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
  14. package/es/components/date_picker/date_picker.js +1 -1
  15. package/es/components/flyout/flyout.component.js +10 -6
  16. package/es/components/flyout/flyout_menu.js +122 -19
  17. package/es/components/flyout/flyout_menu.styles.js +2 -1
  18. package/es/components/flyout/manager/actions.js +20 -0
  19. package/es/components/flyout/manager/flyout_child.js +23 -1
  20. package/es/components/flyout/manager/flyout_managed.js +65 -19
  21. package/es/components/flyout/manager/hooks.js +1 -1
  22. package/es/components/flyout/manager/index.js +2 -2
  23. package/es/components/flyout/manager/reducer.js +32 -8
  24. package/es/components/flyout/manager/selectors.js +8 -2
  25. package/es/components/flyout/manager/store.js +35 -2
  26. package/es/components/flyout/use_flyout_menu.js +2 -2
  27. package/es/components/form/field_password/field_password.styles.js +1 -1
  28. package/es/components/form/field_search/field_search.styles.js +1 -1
  29. package/es/components/form/form.styles.js +1 -1
  30. package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
  31. package/es/components/form/select/select.styles.js +1 -1
  32. package/es/components/form/text_area/text_area.styles.js +1 -1
  33. package/es/components/form/validatable_control/validatable_control.js +8 -55
  34. package/es/components/table/mobile/table_sort_mobile.js +64 -103
  35. package/es/components/table/store/use_unique_column_id.js +25 -0
  36. package/es/components/table/table_header_cell.js +7 -8
  37. package/es/components/table/table_header_cell_checkbox.js +5 -6
  38. package/es/components/tool_tip/tool_tip.js +61 -30
  39. package/es/components/tool_tip/tool_tip_anchor.js +5 -5
  40. package/es/components/tool_tip/tool_tip_manager.js +27 -2
  41. package/eui.d.ts +679 -530
  42. package/i18ntokens.json +810 -738
  43. package/lib/components/avatar/avatar.js +4 -0
  44. package/lib/components/avatar/avatar.styles.js +16 -16
  45. package/lib/components/banner/banner.js +1 -2
  46. package/lib/components/banner/banner.styles.js +1 -1
  47. package/lib/components/basic_table/basic_table.js +34 -4
  48. package/lib/components/basic_table/basic_table.styles.js +19 -1
  49. package/lib/components/basic_table/in_memory_table.js +17 -0
  50. package/lib/components/basic_table/index.js +8 -1
  51. package/lib/components/basic_table/pagination_bar.js +19 -4
  52. package/lib/components/basic_table/pagination_bar.styles.js +26 -0
  53. package/lib/components/basic_table/panel.styles.js +20 -0
  54. package/lib/components/basic_table/use_panel_props.js +33 -0
  55. package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
  56. package/lib/components/date_picker/date_picker.js +1 -1
  57. package/lib/components/flyout/flyout.component.js +10 -6
  58. package/lib/components/flyout/flyout_menu.js +120 -19
  59. package/lib/components/flyout/flyout_menu.styles.js +2 -1
  60. package/lib/components/flyout/manager/actions.js +21 -1
  61. package/lib/components/flyout/manager/flyout_child.js +23 -1
  62. package/lib/components/flyout/manager/flyout_managed.js +41 -17
  63. package/lib/components/flyout/manager/hooks.js +6 -0
  64. package/lib/components/flyout/manager/index.js +12 -0
  65. package/lib/components/flyout/manager/reducer.js +31 -7
  66. package/lib/components/flyout/manager/selectors.js +9 -3
  67. package/lib/components/flyout/manager/store.js +34 -1
  68. package/lib/components/flyout/use_flyout_menu.js +2 -2
  69. package/lib/components/form/field_password/field_password.styles.js +1 -1
  70. package/lib/components/form/field_search/field_search.styles.js +1 -1
  71. package/lib/components/form/form.styles.js +1 -1
  72. package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
  73. package/lib/components/form/select/select.styles.js +1 -1
  74. package/lib/components/form/text_area/text_area.styles.js +1 -1
  75. package/lib/components/form/validatable_control/validatable_control.js +7 -52
  76. package/lib/components/table/mobile/table_sort_mobile.js +71 -108
  77. package/lib/components/table/store/use_unique_column_id.js +34 -0
  78. package/lib/components/table/table_header_cell.js +7 -8
  79. package/lib/components/table/table_header_cell_checkbox.js +5 -6
  80. package/lib/components/tool_tip/tool_tip.js +59 -29
  81. package/lib/components/tool_tip/tool_tip_anchor.js +5 -5
  82. package/lib/components/tool_tip/tool_tip_manager.js +27 -2
  83. package/optimize/es/components/avatar/avatar.js +4 -0
  84. package/optimize/es/components/avatar/avatar.styles.js +16 -16
  85. package/optimize/es/components/banner/banner.js +1 -2
  86. package/optimize/es/components/banner/banner.styles.js +1 -1
  87. package/optimize/es/components/basic_table/basic_table.js +18 -5
  88. package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
  89. package/optimize/es/components/basic_table/index.js +2 -1
  90. package/optimize/es/components/basic_table/pagination_bar.js +19 -4
  91. package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
  92. package/optimize/es/components/basic_table/panel.styles.js +14 -0
  93. package/optimize/es/components/basic_table/use_panel_props.js +28 -0
  94. package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
  95. package/optimize/es/components/date_picker/date_picker.js +1 -1
  96. package/optimize/es/components/flyout/flyout.component.js +10 -6
  97. package/optimize/es/components/flyout/flyout_menu.js +99 -18
  98. package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
  99. package/optimize/es/components/flyout/manager/actions.js +20 -0
  100. package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
  101. package/optimize/es/components/flyout/manager/hooks.js +1 -1
  102. package/optimize/es/components/flyout/manager/index.js +2 -2
  103. package/optimize/es/components/flyout/manager/reducer.js +32 -8
  104. package/optimize/es/components/flyout/manager/selectors.js +8 -2
  105. package/optimize/es/components/flyout/manager/store.js +35 -2
  106. package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
  107. package/optimize/es/components/form/field_password/field_password.styles.js +1 -1
  108. package/optimize/es/components/form/field_search/field_search.styles.js +1 -1
  109. package/optimize/es/components/form/form.styles.js +1 -1
  110. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
  111. package/optimize/es/components/form/select/select.styles.js +1 -1
  112. package/optimize/es/components/form/text_area/text_area.styles.js +1 -1
  113. package/optimize/es/components/form/validatable_control/validatable_control.js +7 -48
  114. package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
  115. package/optimize/es/components/table/store/use_unique_column_id.js +25 -0
  116. package/optimize/es/components/table/table_header_cell.js +7 -8
  117. package/optimize/es/components/table/table_header_cell_checkbox.js +5 -6
  118. package/optimize/es/components/tool_tip/tool_tip.js +58 -30
  119. package/optimize/es/components/tool_tip/tool_tip_anchor.js +5 -5
  120. package/optimize/es/components/tool_tip/tool_tip_manager.js +27 -2
  121. package/optimize/lib/components/avatar/avatar.js +4 -0
  122. package/optimize/lib/components/avatar/avatar.styles.js +16 -16
  123. package/optimize/lib/components/banner/banner.js +1 -2
  124. package/optimize/lib/components/banner/banner.styles.js +1 -1
  125. package/optimize/lib/components/basic_table/basic_table.js +17 -4
  126. package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
  127. package/optimize/lib/components/basic_table/index.js +8 -1
  128. package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
  129. package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
  130. package/optimize/lib/components/basic_table/panel.styles.js +20 -0
  131. package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
  132. package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
  133. package/optimize/lib/components/date_picker/date_picker.js +1 -1
  134. package/optimize/lib/components/flyout/flyout.component.js +10 -6
  135. package/optimize/lib/components/flyout/flyout_menu.js +98 -18
  136. package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
  137. package/optimize/lib/components/flyout/manager/actions.js +21 -1
  138. package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
  139. package/optimize/lib/components/flyout/manager/hooks.js +6 -0
  140. package/optimize/lib/components/flyout/manager/index.js +12 -0
  141. package/optimize/lib/components/flyout/manager/reducer.js +31 -7
  142. package/optimize/lib/components/flyout/manager/selectors.js +9 -3
  143. package/optimize/lib/components/flyout/manager/store.js +34 -1
  144. package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
  145. package/optimize/lib/components/form/field_password/field_password.styles.js +1 -1
  146. package/optimize/lib/components/form/field_search/field_search.styles.js +1 -1
  147. package/optimize/lib/components/form/form.styles.js +1 -1
  148. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
  149. package/optimize/lib/components/form/select/select.styles.js +1 -1
  150. package/optimize/lib/components/form/text_area/text_area.styles.js +1 -1
  151. package/optimize/lib/components/form/validatable_control/validatable_control.js +6 -49
  152. package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
  153. package/optimize/lib/components/table/store/use_unique_column_id.js +34 -0
  154. package/optimize/lib/components/table/table_header_cell.js +7 -8
  155. package/optimize/lib/components/table/table_header_cell_checkbox.js +5 -6
  156. package/optimize/lib/components/tool_tip/tool_tip.js +57 -29
  157. package/optimize/lib/components/tool_tip/tool_tip_anchor.js +5 -5
  158. package/optimize/lib/components/tool_tip/tool_tip_manager.js +27 -2
  159. package/package.json +8 -5
  160. package/test-env/components/avatar/avatar.js +4 -0
  161. package/test-env/components/avatar/avatar.styles.js +16 -16
  162. package/test-env/components/banner/banner.js +1 -2
  163. package/test-env/components/banner/banner.styles.js +1 -1
  164. package/test-env/components/basic_table/basic_table.js +34 -4
  165. package/test-env/components/basic_table/basic_table.styles.js +19 -1
  166. package/test-env/components/basic_table/in_memory_table.js +17 -0
  167. package/test-env/components/basic_table/index.js +8 -1
  168. package/test-env/components/basic_table/pagination_bar.js +19 -4
  169. package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
  170. package/test-env/components/basic_table/panel.styles.js +20 -0
  171. package/test-env/components/basic_table/use_panel_props.js +33 -0
  172. package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
  173. package/test-env/components/date_picker/date_picker.js +1 -1
  174. package/test-env/components/flyout/flyout.component.js +10 -6
  175. package/test-env/components/flyout/flyout_menu.js +121 -19
  176. package/test-env/components/flyout/flyout_menu.styles.js +2 -1
  177. package/test-env/components/flyout/manager/actions.js +21 -1
  178. package/test-env/components/flyout/manager/flyout_child.js +23 -1
  179. package/test-env/components/flyout/manager/flyout_managed.js +41 -17
  180. package/test-env/components/flyout/manager/hooks.js +6 -0
  181. package/test-env/components/flyout/manager/index.js +12 -0
  182. package/test-env/components/flyout/manager/reducer.js +31 -7
  183. package/test-env/components/flyout/manager/selectors.js +9 -3
  184. package/test-env/components/flyout/manager/store.js +34 -1
  185. package/test-env/components/flyout/use_flyout_menu.js +2 -2
  186. package/test-env/components/form/field_password/field_password.styles.js +1 -1
  187. package/test-env/components/form/field_search/field_search.styles.js +1 -1
  188. package/test-env/components/form/form.styles.js +1 -1
  189. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
  190. package/test-env/components/form/select/select.styles.js +1 -1
  191. package/test-env/components/form/text_area/text_area.styles.js +1 -1
  192. package/test-env/components/form/validatable_control/validatable_control.js +6 -48
  193. package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
  194. package/test-env/components/table/store/use_unique_column_id.js +34 -0
  195. package/test-env/components/table/table_header_cell.js +7 -8
  196. package/test-env/components/table/table_header_cell_checkbox.js +5 -6
  197. package/test-env/components/tool_tip/tool_tip.js +57 -29
  198. package/test-env/components/tool_tip/tool_tip_anchor.js +5 -5
  199. package/test-env/components/tool_tip/tool_tip_manager.js +27 -2
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions", "iconType"];
1
+ var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions", "iconType", "pagination"];
2
2
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
4
4
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
@@ -24,7 +24,10 @@ import { EuiButtonEmpty, EuiButtonIcon } from '../button';
24
24
  import { EuiFlexGroup, EuiFlexItem } from '../flex';
25
25
  import { EuiListGroup, EuiListGroupItem } from '../list_group';
26
26
  import { EuiPopover } from '../popover';
27
+ import { EuiScreenReaderLive } from '../accessibility';
28
+ import { EuiText } from '../text';
27
29
  import { EuiTitle } from '../title';
30
+ import { EuiToolTip } from '../tool_tip';
28
31
  import { EuiFlyoutCloseButton } from './_flyout_close_button';
29
32
  import { euiFlyoutMenuStyles } from './flyout_menu.styles';
30
33
  import { EuiFlyoutMenuContext } from './flyout_menu_context';
@@ -34,6 +37,10 @@ import { EuiI18n, useEuiI18n } from '../i18n';
34
37
  * History item for the flyout menu history popover
35
38
  */
36
39
 
40
+ /**
41
+ * Pagination configuration for the flyout menu
42
+ */
43
+
37
44
  /**
38
45
  * Custom action item for the flyout menu component
39
46
  */
@@ -89,6 +96,73 @@ var HistoryPopover = function HistoryPopover(_ref) {
89
96
  }, item.title);
90
97
  })));
91
98
  };
99
+ var PaginationControls = function PaginationControls(_ref2) {
100
+ var pagination = _ref2.pagination,
101
+ styles = _ref2.styles;
102
+ var currentIndex = pagination.currentIndex,
103
+ total = pagination.total,
104
+ onPrevious = pagination.onPrevious,
105
+ onNext = pagination.onNext;
106
+ var prevLabel = useEuiI18n('euiFlyoutMenu.pagination.previous', 'Previous');
107
+ var nextLabel = useEuiI18n('euiFlyoutMenu.pagination.next', 'Next');
108
+ var isPrevDisabled = currentIndex === 0;
109
+ var isNextDisabled = currentIndex === total - 1;
110
+ var prevButton = ___EmotionJSX(EuiButtonIcon, {
111
+ iconType: "chevronSingleUp",
112
+ color: "text",
113
+ size: "xs",
114
+ "aria-label": prevLabel,
115
+ onClick: onPrevious,
116
+ isDisabled: isPrevDisabled,
117
+ "data-test-subj": "euiFlyoutMenuPaginationPrev"
118
+ });
119
+ var nextButton = ___EmotionJSX(EuiButtonIcon, {
120
+ iconType: "chevronSingleDown",
121
+ color: "text",
122
+ size: "xs",
123
+ "aria-label": nextLabel,
124
+ onClick: onNext,
125
+ isDisabled: isNextDisabled,
126
+ "data-test-subj": "euiFlyoutMenuPaginationNext"
127
+ });
128
+ return ___EmotionJSX(EuiFlexItem, {
129
+ grow: false
130
+ }, ___EmotionJSX(EuiFlexGroup, {
131
+ gutterSize: "xs",
132
+ alignItems: "center",
133
+ responsive: false
134
+ }, ___EmotionJSX(EuiFlexItem, {
135
+ grow: false
136
+ }, isPrevDisabled ? prevButton : ___EmotionJSX(EuiToolTip, {
137
+ content: prevLabel,
138
+ disableScreenReaderOutput: true
139
+ }, prevButton)), ___EmotionJSX(EuiFlexItem, {
140
+ grow: false
141
+ }, ___EmotionJSX(EuiText, {
142
+ size: "s",
143
+ css: styles.euiFlyoutMenu__paginationCounter,
144
+ "aria-hidden": "true"
145
+ }, ___EmotionJSX(EuiI18n, {
146
+ token: "euiFlyoutMenu.pagination.counter",
147
+ default: "{position} of {total}",
148
+ values: {
149
+ position: currentIndex + 1,
150
+ total: total
151
+ }
152
+ })), ___EmotionJSX(EuiScreenReaderLive, null, ___EmotionJSX(EuiI18n, {
153
+ token: "euiFlyoutMenu.pagination.counter",
154
+ default: "{position} of {total}",
155
+ values: {
156
+ position: currentIndex + 1,
157
+ total: total
158
+ }
159
+ }))), ___EmotionJSX(EuiFlexItem, {
160
+ grow: false
161
+ }, isNextDisabled ? nextButton : ___EmotionJSX(EuiToolTip, {
162
+ content: nextLabel,
163
+ disableScreenReaderOutput: true
164
+ }, nextButton))));
165
+ };
92
166
 
93
167
  /**
94
168
  * The component for the top menu bar inside a flyout. Since this is a private
@@ -99,24 +173,26 @@ var HistoryPopover = function HistoryPopover(_ref) {
99
173
  *
100
174
  * @private
101
175
  */
102
- export var EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
103
- var className = _ref2.className,
104
- title = _ref2.title,
105
- titleId = _ref2.titleId,
106
- _ref2$hideTitle = _ref2.hideTitle,
107
- hideTitle = _ref2$hideTitle === void 0 ? true : _ref2$hideTitle,
108
- hideCloseButton = _ref2.hideCloseButton,
109
- _ref2$historyItems = _ref2.historyItems,
110
- historyItems = _ref2$historyItems === void 0 ? [] : _ref2$historyItems,
111
- showBackButton = _ref2.showBackButton,
112
- backButtonProps = _ref2.backButtonProps,
113
- customActions = _ref2.customActions,
114
- _iconType = _ref2.iconType,
115
- rest = _objectWithoutProperties(_ref2, _excluded);
176
+ export var EuiFlyoutMenu = function EuiFlyoutMenu(_ref3) {
177
+ var className = _ref3.className,
178
+ title = _ref3.title,
179
+ titleId = _ref3.titleId,
180
+ _ref3$hideTitle = _ref3.hideTitle,
181
+ hideTitle = _ref3$hideTitle === void 0 ? true : _ref3$hideTitle,
182
+ hideCloseButton = _ref3.hideCloseButton,
183
+ _ref3$historyItems = _ref3.historyItems,
184
+ historyItems = _ref3$historyItems === void 0 ? [] : _ref3$historyItems,
185
+ showBackButton = _ref3.showBackButton,
186
+ backButtonProps = _ref3.backButtonProps,
187
+ customActions = _ref3.customActions,
188
+ _iconType = _ref3.iconType,
189
+ pagination = _ref3.pagination,
190
+ rest = _objectWithoutProperties(_ref3, _excluded);
116
191
  var _useContext = useContext(EuiFlyoutMenuContext),
117
192
  onClose = _useContext.onClose;
118
193
  var styles = useEuiMemoizedStyles(euiFlyoutMenuStyles);
119
194
  var classes = classNames('euiFlyoutMenu', className);
195
+ var showPaginationControls = pagination != null && pagination.total > 1;
120
196
  var titleNode;
121
197
  if (title) {
122
198
  titleNode = ___EmotionJSX(EuiTitle, {
@@ -127,7 +203,9 @@ export var EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
127
203
  }, title));
128
204
  }
129
205
  var handleClose = function handleClose(event) {
130
- onClose === null || onClose === void 0 || onClose(event);
206
+ onClose === null || onClose === void 0 || onClose(event, {
207
+ reason: 'close-button'
208
+ });
131
209
  };
132
210
  var closeButton = ___EmotionJSX(EuiFlyoutCloseButton, {
133
211
  onClose: handleClose,
@@ -143,13 +221,16 @@ export var EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
143
221
  justifyContent: "spaceBetween",
144
222
  gutterSize: "none",
145
223
  responsive: false
146
- }, showBackButton && ___EmotionJSX(EuiFlexItem, {
224
+ }, showPaginationControls ? ___EmotionJSX(PaginationControls, {
225
+ pagination: pagination,
226
+ styles: styles
227
+ }) : ___EmotionJSX(React.Fragment, null, showBackButton && ___EmotionJSX(EuiFlexItem, {
147
228
  grow: false
148
229
  }, ___EmotionJSX(BackButton, backButtonProps)), historyItems.length > 0 && ___EmotionJSX(EuiFlexItem, {
149
230
  grow: false
150
231
  }, ___EmotionJSX(HistoryPopover, {
151
232
  items: historyItems
152
- })), titleNode && ___EmotionJSX(EuiFlexItem, {
233
+ }))), titleNode && ___EmotionJSX(EuiFlexItem, {
153
234
  grow: false
154
235
  }, titleNode), ___EmotionJSX(EuiFlexItem, {
155
236
  grow: true
@@ -251,5 +332,27 @@ EuiFlyoutMenu.propTypes = {
251
332
  * Aria label for the action button
252
333
  */
253
334
  "aria-label": PropTypes.string.isRequired
254
- }).isRequired)
335
+ }).isRequired),
336
+ /**
337
+ * Enables Prev/Next navigation controls and a position counter in the menu bar.
338
+ * Pagination replaces back/history navigation in the left menu slot.
339
+ */
340
+ pagination: PropTypes.shape({
341
+ /**
342
+ * Zero-based index of the currently displayed item
343
+ */
344
+ currentIndex: PropTypes.number.isRequired,
345
+ /**
346
+ * Total number of items
347
+ */
348
+ total: PropTypes.number.isRequired,
349
+ /**
350
+ * Called when the user clicks the Previous button
351
+ */
352
+ onPrevious: PropTypes.func.isRequired,
353
+ /**
354
+ * Called when the user clicks the Next button
355
+ */
356
+ onNext: PropTypes.func.isRequired
357
+ })
255
358
  };
@@ -14,6 +14,7 @@ export var euiFlyoutMenuStyles = function euiFlyoutMenuStyles(euiThemeContext) {
14
14
  euiFlyoutMenu__container: /*#__PURE__*/css("block-size:calc(", euiTheme.size.m, " * 3.5);flex-shrink:0;padding-block:", euiTheme.size.s, ";padding-inline:", euiTheme.size.s, ";border-block-end:", euiTheme.border.width.thin, " solid ", euiTheme.border.color, ";padding-block-start:calc(", euiTheme.size.m, " * 0.8);.euiTitle{padding-inline:", euiTheme.size.s, ";};label:euiFlyoutMenu__container;"),
15
15
  euiFlyoutMenu__spacer: /*#__PURE__*/css("padding-inline:", euiTheme.size.m, ";;label:euiFlyoutMenu__spacer;"),
16
16
  euiFlyoutMenu__actions: /*#__PURE__*/css("block-size:calc(", euiTheme.size.m, " * 1.8);;label:euiFlyoutMenu__actions;"),
17
- euiFlyoutMenu__hiddenTitle: /*#__PURE__*/css(euiScreenReaderOnly(), ";;label:euiFlyoutMenu__hiddenTitle;")
17
+ euiFlyoutMenu__hiddenTitle: /*#__PURE__*/css(euiScreenReaderOnly(), ";;label:euiFlyoutMenu__hiddenTitle;"),
18
+ euiFlyoutMenu__paginationCounter: /*#__PURE__*/css("color:", euiTheme.colors.textSubdued, ";white-space:nowrap;;label:euiFlyoutMenu__paginationCounter;")
18
19
  };
19
20
  };
@@ -18,6 +18,8 @@ export var ACTION_CLOSE_ALL = "".concat(PREFIX, "/closeAll");
18
18
  export var ACTION_SET_ACTIVE = "".concat(PREFIX, "/setActive");
19
19
  /** Dispatched when an active flyout's pixel width changes (for responsive layout). */
20
20
  export var ACTION_SET_WIDTH = "".concat(PREFIX, "/setWidth");
21
+ /** Dispatched to set a flyout's menu pagination. */
22
+ export var ACTION_SET_PAGINATION = "".concat(PREFIX, "/setPagination");
21
23
  /** Dispatched to switch layout mode between `side-by-side` and `stacked`. */
22
24
  export var ACTION_SET_LAYOUT_MODE = "".concat(PREFIX, "/setLayoutMode");
23
25
  /** Dispatched to update a flyout's activity stage (e.g., opening -> active). */
@@ -48,6 +50,8 @@ export var ACTION_CLOSE_UNMANAGED_FLYOUT = "".concat(PREFIX, "/closeUnmanagedFly
48
50
 
49
51
  /** Update a flyout's measured width in pixels. */
50
52
 
53
+ /** Set the manager pagination value for a flyout. */
54
+
51
55
  /** Change how flyouts are arranged: `side-by-side` or `stacked`. */
52
56
 
53
57
  /** Set a specific flyout's activity stage. */
@@ -122,6 +126,22 @@ export var setFlyoutWidth = function setFlyoutWidth(flyoutId, width) {
122
126
  };
123
127
  };
124
128
 
129
+ /**
130
+ * Set (or clear) the menu pagination config for a flyout. When set, this
131
+ * overrides any pagination passed via `flyoutMenuProps.pagination` on the
132
+ * flyout itself, allowing reactive updates from a different React root.
133
+ *
134
+ * Only works for managed flyouts. Unmanaged flyouts (session={false}) must use
135
+ * the `flyoutMenuProps.pagination` prop instead.
136
+ */
137
+ export var setPagination = function setPagination(flyoutId, pagination) {
138
+ return {
139
+ type: ACTION_SET_PAGINATION,
140
+ flyoutId: flyoutId,
141
+ pagination: pagination
142
+ };
143
+ };
144
+
125
145
  /** Switch layout mode between `side-by-side` and `stacked`. */
126
146
  export var setLayoutMode = function setLayoutMode(layoutMode) {
127
147
  return {
@@ -148,7 +148,29 @@ EuiFlyoutChild.propTypes = {
148
148
  * Aria label for the action button
149
149
  */
150
150
  "aria-label": PropTypes.string.isRequired
151
- }).isRequired)
151
+ }).isRequired),
152
+ /**
153
+ * Enables Prev/Next navigation controls and a position counter in the menu bar.
154
+ * Pagination replaces back/history navigation in the left menu slot.
155
+ */
156
+ pagination: PropTypes.shape({
157
+ /**
158
+ * Zero-based index of the currently displayed item
159
+ */
160
+ currentIndex: PropTypes.number.isRequired,
161
+ /**
162
+ * Total number of items
163
+ */
164
+ total: PropTypes.number.isRequired,
165
+ /**
166
+ * Called when the user clicks the Previous button
167
+ */
168
+ onPrevious: PropTypes.func.isRequired,
169
+ /**
170
+ * Called when the user clicks the Next button
171
+ */
172
+ onNext: PropTypes.func.isRequired
173
+ })
152
174
  }),
153
175
  onActive: PropTypes.func
154
176
  };
@@ -36,7 +36,7 @@ import { useFlyoutActivityStage } from './activity_stage';
36
36
  import { LAYOUT_MODE_SIDE_BY_SIDE, LEVEL_CHILD, LEVEL_MAIN, PROPERTY_FLYOUT, PROPERTY_LAYOUT_MODE, PROPERTY_LEVEL } from './const';
37
37
  import { EuiFlyoutIsManagedProvider } from './context';
38
38
  import { euiManagedFlyoutStyles } from './flyout_managed.styles';
39
- import { useFlyoutManager as _useFlyoutManager, useFlyoutId } from './hooks';
39
+ import { useFlyoutManager as _useFlyoutManager, useFlyoutId, useFlyoutPagination } from './hooks';
40
40
  import { useIsFlyoutRegistered } from './selectors';
41
41
  import { getFlyoutManagerStore } from './store';
42
42
  import { createValidationErrorMessage, isNamedSize, validateManagedFlyoutSize, validateSizeCombination } from './validation';
@@ -154,10 +154,10 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref2, ref) {
154
154
 
155
155
  // Stabilize the onClose callback
156
156
  var onCloseCallbackRef = useRef();
157
- onCloseCallbackRef.current = function (e) {
157
+ onCloseCallbackRef.current = function (e, meta) {
158
158
  if (onCloseProp) {
159
159
  var event = e || new MouseEvent('click');
160
- onCloseProp(event);
160
+ onCloseProp(event, meta);
161
161
  }
162
162
  };
163
163
 
@@ -182,17 +182,20 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref2, ref) {
182
182
  useLayoutEffect(function () {
183
183
  addFlyout(flyoutId, title, level, size, level === LEVEL_MAIN ? historyKey : undefined, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, typeof minWidth === 'number' ? minWidth : undefined);
184
184
  return function () {
185
- var currentStoreState = getFlyoutManagerStore().getState();
186
- var stillInStore = currentStoreState.flyouts.some(function (f) {
185
+ var store = getFlyoutManagerStore();
186
+ var stillInStore = store.getState().flyouts.some(function (f) {
187
187
  return f.flyoutId === flyoutId;
188
188
  });
189
189
  if (stillInStore) {
190
190
  // Normal cleanup (deps changed or explicit close via isOpen=false)
191
191
  level === LEVEL_MAIN ? closeAllFlyouts() : closeFlyout(flyoutId);
192
192
  } else if (wasRegisteredRef.current) {
193
- var _onCloseCallbackRef$c;
194
- // Cascade close: was registered but removed externally (e.g. main closed)
195
- (_onCloseCallbackRef$c = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c === void 0 || _onCloseCallbackRef$c.call(onCloseCallbackRef, new MouseEvent('navigation'));
193
+ var _onCloseCallbackRef$c, _store$consumeCloseMe;
194
+ // Removed externally while mounted: forward the store-stamped reason
195
+ // (e.g. `navigation-back` from goBack), defaulting to cascade.
196
+ (_onCloseCallbackRef$c = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c === void 0 || _onCloseCallbackRef$c.call(onCloseCallbackRef, new MouseEvent('navigation'), (_store$consumeCloseMe = store.consumeCloseMeta(flyoutId)) !== null && _store$consumeCloseMe !== void 0 ? _store$consumeCloseMe : {
197
+ reason: 'navigation-cascade'
198
+ });
196
199
  }
197
200
  wasRegisteredRef.current = false;
198
201
  };
@@ -205,11 +208,16 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref2, ref) {
205
208
  wasRegisteredRef.current = true;
206
209
  }
207
210
 
208
- // If flyout was previously registered, is marked as open, but no longer exists in manager state,
209
- // it was removed via navigation (Back button) - trigger close callback
211
+ // If flyout was previously registered, is marked as open, but no longer
212
+ // exists in manager state, it was removed externally while still mounted.
213
+ // Forward the store-stamped reason (e.g. `navigation-back` from goBack);
214
+ // any other removal (e.g. a closeAllFlyouts cascade reaching a backgrounded
215
+ // flyout) defaults to `navigation-cascade`.
210
216
  if (wasRegisteredRef.current && !flyoutExistsInManager) {
211
- var _onCloseCallbackRef$c2;
212
- (_onCloseCallbackRef$c2 = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c2 === void 0 || _onCloseCallbackRef$c2.call(onCloseCallbackRef, new MouseEvent('navigation'));
217
+ var _onCloseCallbackRef$c2, _getFlyoutManagerStor;
218
+ (_onCloseCallbackRef$c2 = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c2 === void 0 || _onCloseCallbackRef$c2.call(onCloseCallbackRef, new MouseEvent('navigation'), (_getFlyoutManagerStor = getFlyoutManagerStore().consumeCloseMeta(flyoutId)) !== null && _getFlyoutManagerStor !== void 0 ? _getFlyoutManagerStor : {
219
+ reason: 'navigation-cascade'
220
+ });
213
221
  wasRegisteredRef.current = false; // Reset to avoid repeated calls
214
222
  }
215
223
  }, [flyoutExistsInManager, flyoutId]);
@@ -233,7 +241,12 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref2, ref) {
233
241
  width = _useResizeObserver.width;
234
242
 
235
243
  // Pass the stabilized onClose callback to the flyout menu context
236
- var onClose = function onClose(e) {
244
+ var onClose = function onClose(e, meta) {
245
+ // Clear before flushSync so that effects flushed synchronously inside it
246
+ // (the navigation-back detector) see wasRegisteredRef = false and do not
247
+ // misidentify this user-initiated close as a Back-button navigation.
248
+ wasRegisteredRef.current = false;
249
+
237
250
  // CRITICAL: Update manager state FIRST before allowing React to unmount
238
251
  // This prevents race conditions during portal → inline DOM transitions
239
252
  // and ensures cascade close logic runs before DOM cleanup begins
@@ -241,10 +254,9 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref2, ref) {
241
254
  flushSync(function () {
242
255
  level === LEVEL_MAIN ? closeAllFlyouts() : closeFlyout(flyoutId);
243
256
  });
244
- wasRegisteredRef.current = false; // Prevent cleanup from double-firing onClose
245
257
  if (onCloseCallbackRef.current) {
246
258
  var event = e || new MouseEvent('click');
247
- onCloseCallbackRef.current(event);
259
+ onCloseCallbackRef.current(event, meta);
248
260
  }
249
261
  };
250
262
 
@@ -273,11 +285,23 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref2, ref) {
273
285
  } : undefined;
274
286
  }, [level, goBack]);
275
287
  var showBackButton = historyItems ? historyItems.length > 0 : false;
288
+
289
+ // When the store has a defined pagination value it takes precedence; the
290
+ // prop acts as a fallback for callers that don't use the cross-root store.
291
+ // Using both simultaneously is not supported and will log a warning in dev.
292
+ var storePagination = useFlyoutPagination(flyoutId);
293
+ var propPagination = _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.pagination;
294
+ if (process.env.NODE_ENV === 'development' && storePagination != null && propPagination != null) {
295
+ console.warn("flyout-pagination-dual-source-".concat(flyoutId), "[EuiFlyoutManager] flyout \"".concat(flyoutId, "\" has pagination set both via the store (setPagination) ") + 'and via flyoutMenuProps.pagination. The store value will be used. Remove one source to avoid confusion.');
296
+ }
297
+ var pagination = storePagination !== null && storePagination !== void 0 ? storePagination : propPagination;
298
+ var showPaginationControls = pagination != null && pagination.total > 1;
276
299
  var flyoutMenuProps = _objectSpread(_objectSpread({}, _flyoutMenuProps), {}, {
277
- historyItems: historyItems,
278
- showBackButton: showBackButton,
300
+ historyItems: showPaginationControls ? [] : historyItems,
301
+ showBackButton: showPaginationControls ? false : showBackButton,
279
302
  backButtonProps: backButtonProps,
280
- title: title
303
+ title: title,
304
+ pagination: pagination
281
305
  });
282
306
  return ___EmotionJSX(EuiFlyoutIsManagedProvider, {
283
307
  isManaged: true
@@ -360,7 +384,29 @@ EuiManagedFlyout.propTypes = {
360
384
  * Aria label for the action button
361
385
  */
362
386
  "aria-label": PropTypes.string.isRequired
363
- }).isRequired)
387
+ }).isRequired),
388
+ /**
389
+ * Enables Prev/Next navigation controls and a position counter in the menu bar.
390
+ * Pagination replaces back/history navigation in the left menu slot.
391
+ */
392
+ pagination: PropTypes.shape({
393
+ /**
394
+ * Zero-based index of the currently displayed item
395
+ */
396
+ currentIndex: PropTypes.number.isRequired,
397
+ /**
398
+ * Total number of items
399
+ */
400
+ total: PropTypes.number.isRequired,
401
+ /**
402
+ * Called when the user clicks the Previous button
403
+ */
404
+ onPrevious: PropTypes.func.isRequired,
405
+ /**
406
+ * Called when the user clicks the Next button
407
+ */
408
+ onNext: PropTypes.func.isRequired
409
+ })
364
410
  }),
365
411
  onActive: PropTypes.func
366
412
  };
@@ -13,7 +13,7 @@ import { useIsFlyoutRegistered } from './selectors';
13
13
 
14
14
  // Ensure uniqueness across multiple hook instances, including in test envs
15
15
  var autoGeneratedFlyoutIdCounter = 0;
16
- export { useIsFlyoutActive, useHasActiveSession, useCurrentSession, useCurrentMainFlyout, useCurrentChildFlyout, useFlyoutWidth, useParentFlyoutSize, useHasChildFlyout, usePushPaddingOffsets, useHasPushPadding } from './selectors';
16
+ export { useIsFlyoutActive, useHasActiveSession, useCurrentSession, useCurrentMainFlyout, useCurrentChildFlyout, useFlyoutWidth, useFlyoutPagination, useParentFlyoutSize, useHasChildFlyout, usePushPaddingOffsets, useHasPushPadding } from './selectors';
17
17
  export { useFlyoutLayoutMode } from './layout_mode';
18
18
  export { useIsInManagedFlyout } from './context';
19
19
 
@@ -9,7 +9,7 @@
9
9
  /**
10
10
  * Convenience re-exports of bound action creators for external usage.
11
11
  */
12
- export { addFlyout as addFlyoutAction, closeFlyout as closeFlyoutAction, closeAllFlyouts as closeAllFlyoutsAction, setActiveFlyout as setActiveFlyoutAction, setFlyoutWidth as setFlyoutWidthAction, setPushPadding as setPushPaddingAction, setActivityStage as setActivityStageAction } from './actions';
12
+ export { addFlyout as addFlyoutAction, closeFlyout as closeFlyoutAction, closeAllFlyouts as closeAllFlyoutsAction, setActiveFlyout as setActiveFlyoutAction, setFlyoutWidth as setFlyoutWidthAction, setPagination as setPaginationAction, setPushPadding as setPushPaddingAction, setActivityStage as setActivityStageAction } from './actions';
13
13
 
14
14
  /** Reducer and default state for the flyout manager. */
15
15
  export { flyoutManagerReducer, initialState } from './reducer';
@@ -25,7 +25,7 @@ export { EuiFlyoutManager } from './provider';
25
25
  /**
26
26
  * Selectors and derived state hooks for managed flyouts.
27
27
  */
28
- export { useCurrentChildFlyout, useCurrentMainFlyout, useCurrentSession, useFlyoutId, useFlyoutLayoutMode, useFlyoutManager, useFlyoutWidth, useHasChildFlyout, useIsFlyoutActive, useIsInManagedFlyout, useHasActiveSession, useParentFlyoutSize, usePushPaddingOffsets, useHasPushPadding } from './hooks';
28
+ export { useCurrentChildFlyout, useCurrentMainFlyout, useCurrentSession, useFlyoutId, useFlyoutLayoutMode, useFlyoutManager, useFlyoutPagination, useFlyoutWidth, useHasChildFlyout, useIsFlyoutActive, useIsInManagedFlyout, useHasActiveSession, useParentFlyoutSize, usePushPaddingOffsets, useHasPushPadding } from './hooks';
29
29
  export { EuiFlyoutChild } from './flyout_child';
30
30
  export { EuiFlyoutMain } from './flyout_main';
31
31
 
@@ -18,7 +18,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
18
18
  * Side Public License, v 1.
19
19
  */
20
20
 
21
- import { ACTION_ADD, ACTION_CLOSE, ACTION_CLOSE_ALL, ACTION_SET_ACTIVE, ACTION_SET_LAYOUT_MODE, ACTION_SET_WIDTH, ACTION_SET_ACTIVITY_STAGE, ACTION_GO_BACK, ACTION_GO_TO_FLYOUT, ACTION_SET_PUSH_PADDING, ACTION_ADD_UNMANAGED_FLYOUT, ACTION_CLOSE_UNMANAGED_FLYOUT, ACTION_SET_CONTAINER_ELEMENT, ACTION_SET_REFERENCE_WIDTH } from './actions';
21
+ import { ACTION_ADD, ACTION_CLOSE, ACTION_CLOSE_ALL, ACTION_SET_ACTIVE, ACTION_SET_LAYOUT_MODE, ACTION_SET_WIDTH, ACTION_SET_PAGINATION, ACTION_SET_ACTIVITY_STAGE, ACTION_GO_BACK, ACTION_GO_TO_FLYOUT, ACTION_SET_PUSH_PADDING, ACTION_ADD_UNMANAGED_FLYOUT, ACTION_CLOSE_UNMANAGED_FLYOUT, ACTION_SET_CONTAINER_ELEMENT, ACTION_SET_REFERENCE_WIDTH } from './actions';
22
22
  import { LAYOUT_MODE_SIDE_BY_SIDE, LEVEL_MAIN, LEVEL_CHILD, STAGE_OPENING } from './const';
23
23
  /**
24
24
  * Default flyout manager state used to initialize the reducer.
@@ -359,6 +359,30 @@ export function flyoutManagerReducer() {
359
359
  });
360
360
  }
361
361
 
362
+ // Update a flyout's menu pagination. No-op if unchanged or missing.
363
+ case ACTION_SET_PAGINATION:
364
+ {
365
+ var _flyoutId2 = action.flyoutId,
366
+ pagination = action.pagination;
367
+ var target = state.flyouts.find(function (f) {
368
+ return f.flyoutId === _flyoutId2;
369
+ });
370
+ if (!target) {
371
+ return state;
372
+ }
373
+ if (target.pagination === pagination) {
374
+ return state;
375
+ }
376
+ var _updatedFlyouts = state.flyouts.map(function (flyout) {
377
+ return flyout.flyoutId === _flyoutId2 ? _objectSpread(_objectSpread({}, flyout), {}, {
378
+ pagination: pagination
379
+ }) : flyout;
380
+ });
381
+ return _objectSpread(_objectSpread({}, state), {}, {
382
+ flyouts: _updatedFlyouts
383
+ });
384
+ }
385
+
362
386
  // Switch global layout mode for managed flyouts.
363
387
  case ACTION_SET_LAYOUT_MODE:
364
388
  {
@@ -370,14 +394,14 @@ export function flyoutManagerReducer() {
370
394
  // Update a flyout's activity stage in state
371
395
  case ACTION_SET_ACTIVITY_STAGE:
372
396
  {
373
- var _flyoutId2 = action.flyoutId;
374
- var _updatedFlyouts = state.flyouts.map(function (flyout) {
375
- return flyout.flyoutId === _flyoutId2 ? _objectSpread(_objectSpread({}, flyout), {}, {
397
+ var _flyoutId3 = action.flyoutId;
398
+ var _updatedFlyouts2 = state.flyouts.map(function (flyout) {
399
+ return flyout.flyoutId === _flyoutId3 ? _objectSpread(_objectSpread({}, flyout), {}, {
376
400
  activityStage: action.activityStage
377
401
  }) : flyout;
378
402
  });
379
403
  return _objectSpread(_objectSpread({}, state), {}, {
380
- flyouts: _updatedFlyouts
404
+ flyouts: _updatedFlyouts2
381
405
  });
382
406
  }
383
407
 
@@ -431,7 +455,7 @@ export function flyoutManagerReducer() {
431
455
  // Navigate to a specific flyout (by main session or by child in current session's history)
432
456
  case ACTION_GO_TO_FLYOUT:
433
457
  {
434
- var _flyoutId3 = action.flyoutId,
458
+ var _flyoutId4 = action.flyoutId,
435
459
  _level = action.level;
436
460
  var _currentSessionIndex4 = state.sessions.length - 1;
437
461
  if (_level === LEVEL_CHILD && state.sessions.length > 0) {
@@ -439,7 +463,7 @@ export function flyoutManagerReducer() {
439
463
  var _currentSession3 = state.sessions[_currentSessionIndex4];
440
464
  var _childHistory2 = (_currentSession3$chil = _currentSession3.childHistory) !== null && _currentSession3$chil !== void 0 ? _currentSession3$chil : [];
441
465
  var targetIndex = _childHistory2.findIndex(function (entry) {
442
- return entry.flyoutId === _flyoutId3;
466
+ return entry.flyoutId === _flyoutId4;
443
467
  });
444
468
  if (targetIndex === -1) {
445
469
  return state; // Target child not in history
@@ -471,7 +495,7 @@ export function flyoutManagerReducer() {
471
495
 
472
496
  // Navigate by main flyout: remove all sessions after the target
473
497
  var targetSessionIndex = state.sessions.findIndex(function (session) {
474
- return session.mainFlyoutId === _flyoutId3;
498
+ return session.mainFlyoutId === _flyoutId4;
475
499
  });
476
500
  if (targetSessionIndex === -1) {
477
501
  return state; // Target flyout not found
@@ -74,10 +74,16 @@ export var useFlyoutWidth = function useFlyoutWidth(flyoutId) {
74
74
  return (_useFlyout = useFlyout(flyoutId)) === null || _useFlyout === void 0 ? void 0 : _useFlyout.width;
75
75
  };
76
76
 
77
+ /** Returns the store pagination override for a flyout, if set. */
78
+ export var useFlyoutPagination = function useFlyoutPagination(flyoutId) {
79
+ var _useFlyout2;
80
+ return (_useFlyout2 = useFlyout(flyoutId)) === null || _useFlyout2 === void 0 ? void 0 : _useFlyout2.pagination;
81
+ };
82
+
77
83
  /** The configured minWidth (px) of the specified flyout, or `undefined` if not set. */
78
84
  export var useFlyoutMinWidth = function useFlyoutMinWidth(flyoutId) {
79
- var _useFlyout2;
80
- return (_useFlyout2 = useFlyout(flyoutId)) === null || _useFlyout2 === void 0 ? void 0 : _useFlyout2.minWidth;
85
+ var _useFlyout3;
86
+ return (_useFlyout3 = useFlyout(flyoutId)) === null || _useFlyout3 === void 0 ? void 0 : _useFlyout3.minWidth;
81
87
  };
82
88
 
83
89
  /** The configured size of the parent (main) flyout for a given child flyout ID. */
@@ -12,7 +12,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
12
12
  * Side Public License, v 1.
13
13
  */
14
14
 
15
- import { addFlyout as addFlyoutAction, closeFlyout as closeFlyoutAction, closeAllFlyouts as closeAllFlyoutsAction, setActiveFlyout as setActiveFlyoutAction, setFlyoutWidth as setFlyoutWidthAction, setPushPadding as setPushPaddingAction, goBack as goBackAction, goToFlyout as goToFlyoutAction, addUnmanagedFlyout as addUnmanagedFlyoutAction, closeUnmanagedFlyout as closeUnmanagedFlyoutAction, setContainerElement as setContainerElementAction } from './actions';
15
+ import { addFlyout as addFlyoutAction, closeFlyout as closeFlyoutAction, closeAllFlyouts as closeAllFlyoutsAction, setActiveFlyout as setActiveFlyoutAction, setFlyoutWidth as setFlyoutWidthAction, setPagination as setPaginationAction, setPushPadding as setPushPaddingAction, goBack as goBackAction, goToFlyout as goToFlyoutAction, addUnmanagedFlyout as addUnmanagedFlyoutAction, closeUnmanagedFlyout as closeUnmanagedFlyoutAction, setContainerElement as setContainerElementAction } from './actions';
16
16
  import { flyoutManagerReducer, initialState } from './reducer';
17
17
 
18
18
  /**
@@ -24,6 +24,13 @@ function createStore() {
24
24
  var currentState = initial;
25
25
  var listeners = new Set();
26
26
  var eventListeners = new Set();
27
+
28
+ // Transient, one-shot close annotations keyed by flyoutId. `goBack` stamps the
29
+ // flyouts it removes so the managed flyout can report `navigation-back`; any
30
+ // other removal (e.g. closeAllFlyouts cascade) leaves no stamp and defaults to
31
+ // `navigation-cascade`. Kept off reducer state because it is a per-close
32
+ // annotation, not persistent state.
33
+ var pendingCloseMeta = new Map();
27
34
  var getState = function getState() {
28
35
  return currentState;
29
36
  };
@@ -167,6 +174,9 @@ function createStore() {
167
174
  setFlyoutWidth: function setFlyoutWidth(flyoutId, width) {
168
175
  return dispatch(setFlyoutWidthAction(flyoutId, width));
169
176
  },
177
+ setPagination: function setPagination(flyoutId, pagination) {
178
+ return dispatch(setPaginationAction(flyoutId, pagination));
179
+ },
170
180
  setPushPadding: function setPushPadding(side, width) {
171
181
  return dispatch(setPushPaddingAction(side, width));
172
182
  },
@@ -174,7 +184,23 @@ function createStore() {
174
184
  return dispatch(setContainerElementAction(element));
175
185
  },
176
186
  goBack: function goBack() {
177
- return dispatch(goBackAction());
187
+ // Stamp the flyouts goBack removes as `navigation-back` (vs. the default
188
+ // `navigation-cascade`) BEFORE dispatching. dispatch synchronously flushes
189
+ // subscribers, which can consume the meta during unmount, so peek the pure
190
+ // reducer to learn which flyouts go away and stamp them first.
191
+ var action = goBackAction();
192
+ var nextState = flyoutManagerReducer(currentState, action);
193
+ var remaining = new Set(nextState.flyouts.map(function (f) {
194
+ return f.flyoutId;
195
+ }));
196
+ currentState.flyouts.forEach(function (f) {
197
+ if (!remaining.has(f.flyoutId)) {
198
+ pendingCloseMeta.set(f.flyoutId, {
199
+ reason: 'navigation-back'
200
+ });
201
+ }
202
+ });
203
+ dispatch(action);
178
204
  },
179
205
  goToFlyout: function goToFlyout(flyoutId, level) {
180
206
  return dispatch(goToFlyoutAction(flyoutId, level));
@@ -185,6 +211,13 @@ function createStore() {
185
211
  closeUnmanagedFlyout: function closeUnmanagedFlyout(flyoutId) {
186
212
  return dispatch(closeUnmanagedFlyoutAction(flyoutId));
187
213
  },
214
+ consumeCloseMeta: function consumeCloseMeta(flyoutId) {
215
+ var meta = pendingCloseMeta.get(flyoutId);
216
+ if (meta) {
217
+ pendingCloseMeta.delete(flyoutId);
218
+ }
219
+ return meta;
220
+ },
188
221
  historyItems: computeHistoryItems(dispatch) // Initialize with current state
189
222
  };
190
223
  return store;
@@ -41,10 +41,10 @@ export var useEuiFlyoutMenu = function useEuiFlyoutMenu(_ref) {
41
41
  }, [hasMenu, _titleId, generatedMenuId]);
42
42
 
43
43
  // Determine if the menu has any content
44
- // hasBackButton or hasHistory or hasCustomActions or hasVisibleTitle
44
+ // hasBackButton or hasHistory or hasCustomActions or hasVisibleTitle or hasPagination
45
45
  var menuHasContent = hasMenu && (!!flyoutMenuProps.showBackButton || ((_flyoutMenuProps$hist = (_flyoutMenuProps$hist2 = flyoutMenuProps.historyItems) === null || _flyoutMenuProps$hist2 === void 0 ? void 0 : _flyoutMenuProps$hist2.length) !== null && _flyoutMenuProps$hist !== void 0 ? _flyoutMenuProps$hist : 0) > 0 || ((_flyoutMenuProps$cust = (_flyoutMenuProps$cust2 = flyoutMenuProps.customActions) === null || _flyoutMenuProps$cust2 === void 0 ? void 0 : _flyoutMenuProps$cust2.length) !== null && _flyoutMenuProps$cust !== void 0 ? _flyoutMenuProps$cust : 0) > 0 ||
46
46
  // Component defaults to hiding the title, so only explicit false means the title will be visible
47
- !!(flyoutMenuProps.title && flyoutMenuProps.hideTitle === false));
47
+ !!(flyoutMenuProps.title && flyoutMenuProps.hideTitle === false) || !!(flyoutMenuProps.pagination && flyoutMenuProps.pagination.total > 1));
48
48
 
49
49
  // Determine if the menu should be rendered based on the display mode and menu content
50
50
  var shouldRenderMenu = useMemo(function () {